Skip to content

Commit 06f817f

Browse files
committed
Update to 1.10.2
1 parent baf6d92 commit 06f817f

File tree

6 files changed

+45
-62
lines changed

6 files changed

+45
-62
lines changed

build.gradle

+7-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ minecraft {
2828
runDir = "run"
2929

3030
mappings = mcp_mappings
31+
32+
replaceIn "DiscordChat.java"
33+
replace "@VERSION@", mod_version
3134
}
3235

3336
processResources {
@@ -54,9 +57,9 @@ repositories {
5457
}
5558

5659
dependencies {
57-
compile group: "net.shadowfacts", name: "ShadowMC", version: mc_version + "-" + shadowmc_version
60+
deobfCompile group: "net.shadowfacts", name: "ShadowMC", version: mc_version + "-" + shadowmc_version
5861

59-
compile group: "net.dv8tion", name: "JDA", version: "2.0.0_242", classifier: "withDependencies"
62+
compile group: "net.dv8tion", name: "JDA", version: "2.1.3_327", classifier: "withDependencies"
6063
}
6164

6265
shadowJar {
@@ -79,7 +82,7 @@ shadowJar {
7982
relocate "org.apache.commons.logging", "net.shadowfacts.discordchat.repack.org.apache.commons.logging"
8083

8184
dependencies {
82-
include(dependency("net.dv8tion:JDA:2.0.0_242:withDependencies"))
85+
include(dependency("net.dv8tion:JDA:2.1.3_327:withDependencies"))
8386
}
8487
}
8588

@@ -89,7 +92,7 @@ curseforge {
8992
project {
9093
id = "240995"
9194

92-
addGameVersion "1.9"
95+
addGameVersion "1.10.2"
9396
addGameVersion "Java 8"
9497

9598
mainArtifact(shadowJar) {

gradle.properties

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
mod_version = 1.2.1
1+
mod_version = 1.3.0
22
group = net.shadowfacts
33
archivesBaseName = DiscordChat
44

5-
mc_version = 1.9.4
6-
forge_version = 12.17.0.1910-1.9.4
7-
mcp_mappings = snapshot_20160521
5+
mc_version = 1.10.2
6+
forge_version = 12.18.1.2014
7+
mcp_mappings = snapshot_20160715
88

9-
shadowmc_version = 3.3.0
9+
shadowmc_version = 3.4.2

src/main/java/net/shadowfacts/discordchat/DiscordChat.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
/**
1414
* @author shadowfacts
1515
*/
16-
@Mod(modid = DiscordChat.modId, name = DiscordChat.modId, version = DiscordChat.version, acceptableRemoteVersions = "*", acceptedMinecraftVersions = "[1.9.4]", dependencies = "required-after:shadowmc;")
16+
@Mod(modid = DiscordChat.modId, name = DiscordChat.modId, version = DiscordChat.version, acceptableRemoteVersions = "*", acceptedMinecraftVersions = "[1.10.2]", dependencies = "required-after:shadowmc;")
1717
public class DiscordChat {
1818

1919
public static final String modId = "DiscordChat";
20-
public static final String version = "1.2.1";
20+
public static final String version = "@VERSION@";
2121

2222
public static Logger log = LogManager.getLogger(modId);
2323

Original file line numberDiff line numberDiff line change
@@ -1,84 +1,59 @@
11
package net.shadowfacts.discordchat.client;
22

3+
import net.minecraft.client.Minecraft;
34
import net.minecraft.client.gui.GuiMainMenu;
45
import net.minecraft.client.gui.GuiScreen;
5-
import net.minecraft.client.renderer.GlStateManager;
6+
import net.minecraft.client.resources.I18n;
67
import net.shadowfacts.discordchat.DCConfig;
78
import net.shadowfacts.discordchat.DCPrivateProps;
8-
import net.shadowfacts.shadowlib.util.DesktopUtils;
9-
import net.shadowfacts.shadowmc.gui.component.GUIComponentText;
10-
import net.shadowfacts.shadowmc.gui.component.button.GUIButtonText;
11-
import net.shadowfacts.shadowmc.gui.mcwrapper.GuiScreenWrapper;
12-
import net.shadowfacts.shadowmc.gui.mcwrapper.MCBaseGUI;
9+
import net.shadowfacts.discordchat.DiscordChat;
10+
import net.shadowfacts.shadowmc.ui.element.UILabel;
11+
import net.shadowfacts.shadowmc.ui.element.button.UIButtonLink;
12+
import net.shadowfacts.shadowmc.ui.element.button.UIButtonText;
13+
import net.shadowfacts.shadowmc.ui.element.view.UIStackView;
14+
import net.shadowfacts.shadowmc.ui.util.UIBuilder;
1315
import net.shadowfacts.shadowmc.util.MouseButton;
14-
import net.shadowfacts.shadowmc.util.StringHelper;
15-
16-
import java.net.URISyntaxException;
1716

1817
/**
1918
* @author shadowfacts
2019
*/
21-
public class GUISetup extends MCBaseGUI {
20+
public class GUISetup {
2221

22+
public static GuiScreen create() {
23+
UIStackView view = new UIStackView("setup");
2324

24-
public GUISetup(GuiScreenWrapper wrapper) {
25-
super(wrapper);
25+
UILabel line1 = new UILabel(I18n.format("dc.gui.setup.line1"), "line1");
26+
view.add(line1);
2627

27-
String line1 = StringHelper.localize("dc.gui.setup.line1");
28-
String line2 = StringHelper.localize("dc.gui.setup.line2");
28+
UILabel line2 = new UILabel(I18n.format("dc.gui.setup.line2"), "line2");
29+
view.add(line2);
2930

30-
addChild(new GUIComponentText(-(mc.fontRendererObj.getStringWidth(line1) / 2), 10, line1));
31-
addChild(new GUIComponentText(-(mc.fontRendererObj.getStringWidth(line2) / 2), mc.fontRendererObj.FONT_HEIGHT + 14, line2));
31+
UIButtonText instructions = new UIButtonLink(I18n.format("dc.gui.setup.instructions"), "https://git.io/vrGte", "instructions");
32+
view.add(instructions);
3233

33-
addChild(new GUIButtonText(-100, 40, 200, 20, this::handleInstructions, StringHelper.localize("dc.gui.setup.instructions")));
34-
addChild(new GUIButtonText(-100, 70, 200, 20, this::handleFinished, StringHelper.localize("dc.gui.setup.finished")));
35-
addChild(new GUIButtonText(-100, 100, 200, 20, this::handleSkip, StringHelper.localize("dc.gui.setup.skip")));
36-
}
34+
UIButtonText finished = new UIButtonText(I18n.format("dc.gui.setup.finished"), GUISetup::handleFinished, "finished");
35+
view.add(finished);
3736

38-
@Override
39-
public void setInitialized(boolean initialized) {
40-
super.setInitialized(initialized);
41-
updatePosition(width / 2, y);
42-
}
37+
UIButtonText skip = new UIButtonText(I18n.format("dc.gui.setup.skip"), GUISetup::handleSkip, "skip");
38+
view.add(skip);
4339

44-
private boolean handleInstructions(GUIButtonText button, MouseButton mouseButton) {
45-
try {
46-
DesktopUtils.openWebpage("https://git.io/vrGte");
47-
} catch (URISyntaxException ignored) {}
48-
return true;
40+
return new UIBuilder().add(view).style(DiscordChat.modId + ":setup").createScreen();
4941
}
5042

51-
private boolean handleFinished(GUIButtonText button, MouseButton mouseButton) {
43+
private static boolean handleFinished(UIButtonText button, MouseButton mouseButton) {
5244
DCPrivateProps.setup = true;
5345
DCPrivateProps.save();
5446
DCConfig.load();
55-
mc.displayGuiScreen(new GuiMainMenu());
47+
Minecraft.getMinecraft().displayGuiScreen(new GuiMainMenu());
5648
return true;
5749
}
5850

59-
private boolean handleSkip(GUIButtonText button, MouseButton mouseButton) {
51+
private static boolean handleSkip(UIButtonText button, MouseButton mouseButton) {
6052
DCPrivateProps.setup = true;
6153
DCPrivateProps.save();
6254
DCConfig.load();
63-
mc.displayGuiScreen(new GuiMainMenu());
55+
Minecraft.getMinecraft().displayGuiScreen(new GuiMainMenu());
6456
return true;
6557
}
6658

67-
@Override
68-
public void draw(int mouseX, int mouseY) {
69-
// because something else disables GL_TEXTURE_2D without using the GlStateManager
70-
GlStateManager.disableTexture2D();
71-
GlStateManager.enableTexture2D();
72-
73-
super.draw(mouseX, mouseY);
74-
}
75-
76-
public static GuiScreen create() {
77-
GuiScreenWrapper wrapper = new GuiScreenWrapper();
78-
GUISetup gui = new GUISetup(wrapper);
79-
gui.setZLevel(0);
80-
wrapper.gui = gui;
81-
return wrapper;
82-
}
83-
8459
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#setup {
2+
vertical-layout: top
3+
margin-top: 10
4+
stack-spacing: 10
5+
}

0 commit comments

Comments
 (0)