This repository has been archived by the owner on Apr 18, 2018. It is now read-only.
/
GuiRewiLanguage.java
44 lines (38 loc) · 1.68 KB
/
GuiRewiLanguage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* RewiMod, a Minecraft Client Enhancement
* Copyright (C) rewinside.tv <https://rewinside.tv/>
* Copyright (C) RewiMod team and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package tv.rewinside.rewimod.forge.gui;
import java.io.IOException;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiLanguage;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.LanguageManager;
import net.minecraft.client.settings.GameSettings;
import net.minecraftforge.common.MinecraftForge;
import tv.rewinside.rewimod.forge.event.LanguageChangedEvent;
public class GuiRewiLanguage extends GuiLanguage {
public GuiRewiLanguage(GuiScreen screen, GameSettings gameSettingsObj, LanguageManager manager) {
super(screen, gameSettingsObj, manager);
}
@Override
public void actionPerformed(GuiButton button) throws IOException {
super.actionPerformed(button);
MinecraftForge.EVENT_BUS.post(new LanguageChangedEvent(Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode()));
}
}