-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed ticksync command and added warnings
Closes #20
- Loading branch information
1 parent
774d02f
commit d589cf5
Showing
9 changed files
with
122 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
src/main/java/de/scribble/lp/tasmod/gui/GuiMultiplayerTimeOut.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package de.scribble.lp.tasmod.gui; | ||
|
||
import java.io.IOException; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiMainMenu; | ||
import net.minecraft.client.gui.GuiMultiplayer; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.client.gui.ScaledResolution; | ||
import net.minecraft.client.resources.I18n; | ||
|
||
public class GuiMultiplayerTimeOut extends GuiScreen{ | ||
private GuiScreen previous; | ||
|
||
public GuiMultiplayerTimeOut() { | ||
previous=new GuiMainMenu(); | ||
} | ||
@Override | ||
public void initGui() { | ||
this.buttonList.add(new GuiButton(0, width / 2 -100, height / 2 + 70, "Continue")); | ||
super.initGui(); | ||
} | ||
@Override | ||
public void drawScreen(int mouseX, int mouseY, float partialTicks) { | ||
this.drawDefaultBackground(); | ||
|
||
ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); | ||
int width = scaled.getScaledWidth(); | ||
int height = scaled.getScaledHeight(); | ||
|
||
drawCenteredString(fontRenderer,I18n.format("TASmod: Timed out"), width / 2, height / 4 + 50 + -16, 0xFFFFFF); | ||
drawCenteredString(fontRenderer,I18n.format("Lost or could not make a connection to the TASmod on the server side"), width / 2, height / 4 + 50 + -6, 0xFFFFFF); | ||
drawCenteredString(fontRenderer,I18n.format("Possible Cause:"), width / 2, height / 4 + 50 + 14, 0xFFFFFF); | ||
drawCenteredString(fontRenderer,I18n.format("The server has no TASmod installed or the server lagged too much."), width / 2, height / 4 + 50 + 24, 0xFFFFFF); | ||
drawCenteredString(fontRenderer,I18n.format("It's also possible to get this message in singleplayer if the integrated server stopped responding."), width / 2, height / 4 + 50 + 34, 0xFFFFFF); | ||
super.drawScreen(mouseX, mouseY, partialTicks); | ||
} | ||
@Override | ||
protected void actionPerformed(GuiButton button) throws IOException { | ||
if(button.id==0) { | ||
Minecraft.getMinecraft().displayGuiScreen(new GuiMultiplayer(previous)); | ||
} | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/main/java/de/scribble/lp/tasmod/gui/GuiMultiplayerWarn.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package de.scribble.lp.tasmod.gui; | ||
|
||
import java.io.IOException; | ||
|
||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiButton; | ||
import net.minecraft.client.gui.GuiMultiplayer; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import net.minecraft.client.gui.ScaledResolution; | ||
import net.minecraft.client.resources.I18n; | ||
|
||
public class GuiMultiplayerWarn extends GuiScreen{ | ||
private GuiScreen previous; | ||
public GuiMultiplayerWarn(GuiScreen screen) { | ||
previous=screen; | ||
} | ||
@Override | ||
public void initGui() { | ||
this.buttonList.add(new GuiButton(0, width / 2 -100, height / 2 + 70, "Continue")); | ||
super.initGui(); | ||
} | ||
@Override | ||
public void drawScreen(int mouseX, int mouseY, float partialTicks) { | ||
this.drawDefaultBackground(); | ||
|
||
ScaledResolution scaled = new ScaledResolution(Minecraft.getMinecraft()); | ||
int width = scaled.getScaledWidth(); | ||
int height = scaled.getScaledHeight(); | ||
|
||
drawCenteredString(fontRenderer,I18n.format("WARNING"), width / 2, height / 4 + 50 + -16, 0xCE0000); | ||
drawCenteredString(fontRenderer,I18n.format("Do NOT join a server that has not installed the TASmod (e.g. Hypixel)."), width / 2, height / 4 + 50 + -6, 0xFFFFFF); | ||
drawCenteredString(fontRenderer,I18n.format("You will softlock your game for a few seconds then disconnect!"), width / 2, height / 4 + 50 + 4, 0xFFFFFF); | ||
drawCenteredString(fontRenderer,I18n.format("This mod only works together with a server."), width / 2, height / 4 + 50 + 14, 0xFFFFFF); | ||
|
||
super.drawScreen(mouseX, mouseY, partialTicks); | ||
} | ||
@Override | ||
protected void actionPerformed(GuiButton button) throws IOException { | ||
if(button.id==0) { | ||
Minecraft.getMinecraft().displayGuiScreen(new GuiMultiplayer(previous)); | ||
} | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/de/scribble/lp/tasmod/mixin/MixinGuiMainMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package de.scribble.lp.tasmod.mixin; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import de.scribble.lp.tasmod.gui.GuiMultiplayerWarn; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.GuiMainMenu; | ||
import net.minecraft.client.gui.GuiScreen; | ||
|
||
@Mixin(GuiMainMenu.class) | ||
public class MixinGuiMainMenu { | ||
@Redirect(method = "actionPerformed", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V", ordinal = 3)) | ||
public void redirectOpenGuiMultiplayer(Minecraft mc) { | ||
mc.displayGuiScreen(new GuiMultiplayerWarn((GuiMainMenu)(Object)this)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
src/main/java/de/scribble/lp/tasmod/ticksync/CommandTickSync.java
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
src/main/java/de/scribble/lp/tasmod/ticksync/TickSyncCamera.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters