-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/gnembon/carpetmod
- Loading branch information
Showing
11 changed files
with
105 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
.project | ||
/build/ | ||
/ForgeGradle/ | ||
/.idea/ | ||
/out/ |
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,21 @@ | ||
--- a/net/minecraft/client/Minecraft.java | ||
+++ b/net/minecraft/client/Minecraft.java | ||
@@ -195,6 +195,8 @@ | ||
import org.lwjgl.glfw.GLFW; | ||
import org.lwjgl.glfw.GLFWErrorCallback; | ||
|
||
+import carpet.CarpetServer; | ||
+ | ||
@OnlyIn(Dist.CLIENT) | ||
public class Minecraft implements IThreadListener, ISnooperInfo, IGuiEventListenerDeferred | ||
{ | ||
@@ -516,6 +518,9 @@ | ||
this.mainWindow.updateVsyncFromGameSettings(); | ||
this.mainWindow.setLogOnGlError(); | ||
this.renderGlobal.makeEntityOutlineShader(); | ||
+ | ||
+ //CM start game hook | ||
+ CarpetServer.onGameStarted(); | ||
} | ||
|
||
private void checkForGLFWInitError() |
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,12 @@ | ||
--- a/net/minecraft/client/gui/GuiIngame.java | ||
+++ b/net/minecraft/client/gui/GuiIngame.java | ||
@@ -353,7 +353,8 @@ | ||
GlStateManager.popMatrix(); | ||
scoreobjective1 = scoreboard.getObjectiveInDisplaySlot(0); | ||
|
||
- if (!this.mc.gameSettings.keyBindPlayerList.isKeyDown() || this.mc.isIntegratedServerRunning() && this.mc.player.connection.getPlayerInfoMap().size() <= 1 && scoreobjective1 == null) | ||
+ //CM display player list if footer or header exists to make logs visible in singleplayer | ||
+ if (!this.mc.gameSettings.keyBindPlayerList.isKeyDown() || this.mc.isIntegratedServerRunning() && this.mc.player.connection.getPlayerInfoMap().size() <= 1 && scoreobjective1 == null && !overlayPlayerList.hasFooterOrHeader()) | ||
{ | ||
this.overlayPlayerList.setVisible(false); | ||
} |
15 changes: 15 additions & 0 deletions
15
patches/net/minecraft/client/gui/GuiPlayerTabOverlay.java.patch
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,15 @@ | ||
--- a/net/minecraft/client/gui/GuiPlayerTabOverlay.java | ||
+++ b/net/minecraft/client/gui/GuiPlayerTabOverlay.java | ||
@@ -375,6 +375,12 @@ | ||
this.footer = null; | ||
} | ||
|
||
+ //CM accessor | ||
+ public boolean hasFooterOrHeader() | ||
+ { | ||
+ return footer != null || header != null; | ||
+ } | ||
+ | ||
@OnlyIn(Dist.CLIENT) | ||
static class PlayerComparator implements Comparator<NetworkPlayerInfo> | ||
{ |
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
20 changes: 20 additions & 0 deletions
20
patches/net/minecraft/server/integrated/IntegratedServer.java.patch
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,20 @@ | ||
--- a/net/minecraft/server/integrated/IntegratedServer.java | ||
+++ b/net/minecraft/server/integrated/IntegratedServer.java | ||
@@ -38,6 +38,8 @@ | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
+import carpet.CarpetServer; | ||
+ | ||
@OnlyIn(Dist.CLIENT) | ||
public class IntegratedServer extends MinecraftServer | ||
{ | ||
@@ -101,6 +103,8 @@ | ||
this.setAllowFlight(true); | ||
LOGGER.info("Generating keypair"); | ||
this.setKeyPair(CryptManager.generateKeyPair()); | ||
+ //CM init - all stuff loaded from the server, just before worlds loading | ||
+ CarpetServer.onServerLoaded(this); | ||
this.loadAllWorlds(this.getFolderName(), this.getWorldName(), this.worldSettings.getSeed(), this.worldSettings.getTerrainType(), this.worldSettings.getGeneratorOptions()); | ||
this.setMOTD(this.getServerOwner() + " - " + this.getWorld(DimensionType.OVERWORLD).getWorldInfo().getWorldName()); | ||
return true; |
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
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