Ported some patches for testing
parent
9399090571
commit
a4019d4721
|
@ -17,10 +17,12 @@
|
||||||
/src/.classpath
|
/src/.classpath
|
||||||
/src/.project
|
/src/.project
|
||||||
/src/bin
|
/src/bin
|
||||||
/src/minecraft/net/minecraft/client
|
|
||||||
/src/minecraft/net/minecraft/isom
|
/src/minecraft/net/minecraft/isom
|
||||||
|
|
||||||
/src/minecraft/net/minecraft/src/*
|
/src/minecraft/net/minecraft/src/*
|
||||||
!/src/minecraft/net/minecraft/src/mod_*
|
!/src/minecraft/net/minecraft/src/mod_*
|
||||||
!/src/minecraft/net/minecraft/src/*.patch
|
!/src/minecraft/net/minecraft/src/*.patch
|
||||||
!/src/minecraft/net/minecraft/src/finalbeta
|
!/src/minecraft/net/minecraft/src/finalbeta
|
||||||
|
|
||||||
|
/src/minecraft/net/minecraft/client/*
|
||||||
|
!/src/minecraft/net/minecraft/client/*.patch
|
||||||
|
|
17
justfile
17
justfile
|
@ -6,17 +6,24 @@ modVersion := "1.4.0"
|
||||||
setup:
|
setup:
|
||||||
./cleanup.sh
|
./cleanup.sh
|
||||||
./decompile.sh
|
./decompile.sh
|
||||||
just create-bakups
|
just _create-bakups
|
||||||
|
|
||||||
[working-directory: './src/minecraft/net/minecraft/src/']
|
[working-directory: './src/minecraft/net/minecraft/src/']
|
||||||
create-bakups:
|
_create-bakups:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
(for file in $(fd --no-ignore ".java"); do
|
(for file in $(fd --no-ignore ".java"); do
|
||||||
[ -e "$file" ] || continue
|
[ -e "$file" ] || continue
|
||||||
bak="$file.bak"
|
just create-bakup "$file"
|
||||||
cp "$file" "$bak"
|
|
||||||
done)
|
done)
|
||||||
|
|
||||||
|
[working-directory: './src/minecraft/net/minecraft/src/']
|
||||||
|
_create-backup file:
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
bak="$file.bak"
|
||||||
|
# stop from accidentally overwriting backups
|
||||||
|
[ -e "$bak" ] && echo "$bak already exists, skipping!" && exit
|
||||||
|
cp "$file" "$bak"
|
||||||
|
|
||||||
[working-directory: './src/minecraft/net/minecraft/src/']
|
[working-directory: './src/minecraft/net/minecraft/src/']
|
||||||
apply-patches:
|
apply-patches:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
@ -28,7 +35,7 @@ apply-patches:
|
||||||
patch < "$patch"
|
patch < "$patch"
|
||||||
done)
|
done)
|
||||||
|
|
||||||
[working-directory: './src/minecraft/net/minecraft/src/']
|
[working-directory: './src/minecraft/net/minecraft/']
|
||||||
create-patches:
|
create-patches:
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
(for file in $(fd --no-ignore ".java.bak"); do
|
(for file in $(fd --no-ignore ".java.bak"); do
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
--- client/Minecraft.java.bak 2025-04-05 22:51:08.900093138 +0300
|
||||||
|
+++ client/Minecraft.java 2025-04-05 22:53:49.139224592 +0300
|
||||||
|
@@ -113,7 +113,8 @@
|
||||||
|
Display.setTitle("Minecraft Minecraft Beta 1.7.3");
|
||||||
|
try
|
||||||
|
{
|
||||||
|
- Display.create();
|
||||||
|
+ PixelFormat pf = new PixelFormat().withDepthBits(24);
|
||||||
|
+ Display.create(pf);
|
||||||
|
}
|
||||||
|
catch(LWJGLException lwjglexception)
|
||||||
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
--- BlockBed.java.bak 2025-04-04 22:37:36.783594000 +0300
|
--- src/BlockBed.java.bak 2025-04-04 22:37:36.783594000 +0300
|
||||||
+++ BlockBed.java 2025-04-05 20:34:45.887405008 +0300
|
+++ src/BlockBed.java 2025-04-05 20:34:45.887405008 +0300
|
||||||
@@ -5,6 +5,7 @@
|
@@ -5,6 +5,7 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
--- BlockReed.java.bak 2025-04-04 22:55:28.995768000 +0300
|
--- src/BlockReed.java.bak 2025-04-04 22:55:28.995768000 +0300
|
||||||
+++ BlockReed.java 2025-04-05 20:34:20.143731179 +0300
|
+++ src/BlockReed.java 2025-04-05 20:34:20.143731179 +0300
|
||||||
@@ -5,6 +5,7 @@
|
@@ -5,6 +5,7 @@
|
||||||
package net.minecraft.src;
|
package net.minecraft.src;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
--- src/GuiContainer.java.bak 2025-04-05 22:02:27.088322318 +0300
|
||||||
|
+++ src/GuiContainer.java 2025-04-05 22:06:33.043329689 +0300
|
||||||
|
@@ -43,6 +43,7 @@
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef(k, l, 0.0F);
|
||||||
|
+ drawGuiContainerForegroundLayer();
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
GL11.glEnable(32826 /*GL_RESCALE_NORMAL_EXT*/);
|
||||||
|
Slot slot = null;
|
||||||
|
@@ -74,7 +75,7 @@
|
||||||
|
RenderHelper.disableStandardItemLighting();
|
||||||
|
GL11.glDisable(2896 /*GL_LIGHTING*/);
|
||||||
|
GL11.glDisable(2929 /*GL_DEPTH_TEST*/);
|
||||||
|
- drawGuiContainerForegroundLayer();
|
||||||
|
+// drawGuiContainerForegroundLayer();
|
||||||
|
if(inventoryplayer.getItemStack() == null && slot != null && slot.getHasStack())
|
||||||
|
{
|
||||||
|
String s = (new StringBuilder()).append("").append(StringTranslate.getInstance().translateNamedKey(slot.getStack().getItemName())).toString().trim();
|
|
@ -0,0 +1,11 @@
|
||||||
|
--- src/GuiGameOver.java.bak 2025-04-05 23:00:50.099286718 +0300
|
||||||
|
+++ src/GuiGameOver.java 2025-04-05 23:03:44.980201062 +0300
|
||||||
|
@@ -55,7 +55,7 @@
|
||||||
|
GL11.glScalef(2.0F, 2.0F, 2.0F);
|
||||||
|
drawCenteredString(fontRenderer, "Game over!", width / 2 / 2, 30, 0xffffff);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
- drawCenteredString(fontRenderer, (new StringBuilder()).append("Score: &e").append(mc.thePlayer.getScore()).toString(), width / 2, 100, 0xffffff);
|
||||||
|
+ drawCenteredString(fontRenderer, (new StringBuilder()).append("Score: &e".replace('&', '\u00a7')).append(mc.thePlayer.getScore()).toString(), width / 2, 100, 0xffffff);
|
||||||
|
super.drawScreen(i, j, f);
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
--- src/GuiIngame.java.bak 2025-04-05 21:59:28.543494774 +0300
|
||||||
|
+++ src/GuiIngame.java 2025-04-05 22:01:02.702349083 +0300
|
||||||
|
@@ -7,8 +7,11 @@
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Random;
|
||||||
|
-import net.minecraft.client.Minecraft;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
+import net.minecraft.client.Minecraft;
|
||||||
|
+import net.minecraft.src.finalbeta.Direction;
|
||||||
|
+import net.minecraft.src.finalbeta.ModConfig;
|
||||||
|
+import net.minecraft.src.finalbeta.WyHelper;
|
||||||
|
|
||||||
|
// Referenced classes of package net.minecraft.src:
|
||||||
|
// Gui, ScaledResolution, EntityRenderer, EntityPlayerSP,
|
||||||
|
@@ -199,6 +202,10 @@
|
||||||
|
drawString(fontrenderer, (new StringBuilder()).append("y: ").append(mc.thePlayer.posY).toString(), 2, 72, 0xe0e0e0);
|
||||||
|
drawString(fontrenderer, (new StringBuilder()).append("z: ").append(mc.thePlayer.posZ).toString(), 2, 80, 0xe0e0e0);
|
||||||
|
drawString(fontrenderer, (new StringBuilder()).append("f: ").append(MathHelper.floor_double((double)((mc.thePlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3).toString(), 2, 88, 0xe0e0e0);
|
||||||
|
+ this.drawString(fontrenderer, "(" + Direction.fromEntity(this.mc.thePlayer).toString() + ")", 23, 88, 14737632);
|
||||||
|
+ if (ModConfig.ENABLE_TIME_TRACKING.get()) {
|
||||||
|
+ this.drawString(fontrenderer, "Play Time: " + WyHelper.getGameDaysPlayed() + " (" + WyHelper.getRealDaysPlayed() + ")", 2, 96, 14737632);
|
||||||
|
+ }
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
}
|
||||||
|
if(recordPlayingUpFor > 0)
|
|
@ -0,0 +1,21 @@
|
||||||
|
--- src/RenderGlobal.java.bak 2025-04-05 22:12:27.557016177 +0300
|
||||||
|
+++ src/RenderGlobal.java 2025-04-05 22:12:39.943865458 +0300
|
||||||
|
@@ -7,6 +7,7 @@
|
||||||
|
import java.nio.IntBuffer;
|
||||||
|
import java.util.*;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
+import net.minecraft.src.finalbeta.ModConfig;
|
||||||
|
import org.lwjgl.opengl.ARBOcclusionQuery;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
@@ -767,6 +768,10 @@
|
||||||
|
|
||||||
|
public void renderClouds(float f)
|
||||||
|
{
|
||||||
|
+ if (!ModConfig.ENABLE_CLOUDS.get()) {
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if(mc.theWorld.worldProvider.isNether)
|
||||||
|
{
|
||||||
|
return;
|
|
@ -0,0 +1,29 @@
|
||||||
|
package net.minecraft.src.finalbeta;
|
||||||
|
|
||||||
|
import net.minecraft.src.EntityLiving;
|
||||||
|
import net.minecraft.src.MathHelper;
|
||||||
|
|
||||||
|
public enum Direction {
|
||||||
|
SOUTH,
|
||||||
|
WEST,
|
||||||
|
NORTH,
|
||||||
|
EAST,
|
||||||
|
;
|
||||||
|
|
||||||
|
private String displayName;
|
||||||
|
|
||||||
|
private Direction() {
|
||||||
|
String name = this.name();
|
||||||
|
this.displayName = Character.toUpperCase(name.charAt(0)) + name.substring(1).toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Direction fromEntity(EntityLiving entity) {
|
||||||
|
int dir = MathHelper.floor_double(entity.rotationYaw / 90.0D + 0.5D) & 3;
|
||||||
|
return values()[Math.abs(dir) % values().length];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return this.displayName;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
package net.minecraft.src.finalbeta;
|
package net.minecraft.src.finalbeta;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import net.minecraft.src.ModLoader;
|
import net.minecraft.src.ModLoader;
|
||||||
|
|
||||||
|
@ -9,6 +11,45 @@ public class WyHelper {
|
||||||
|
|
||||||
public static long playTime;
|
public static long playTime;
|
||||||
|
|
||||||
|
public static Field getField(Class clz, String... names) {
|
||||||
|
for (String name : names) {
|
||||||
|
try {
|
||||||
|
Field field = clz.getDeclaredField(name);
|
||||||
|
field.setAccessible(true);
|
||||||
|
return field;
|
||||||
|
}
|
||||||
|
catch (NoSuchFieldException ex) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setField(Object obj, Object value, String... names) {
|
||||||
|
Field field = getField(obj.getClass(), names);
|
||||||
|
try {
|
||||||
|
field.set(obj, value);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Method getMethod(Class clz, String[] names, Class<?>... params) {
|
||||||
|
for (String name : names) {
|
||||||
|
try {
|
||||||
|
Method method = clz.getDeclaredMethod(name, params);
|
||||||
|
method.setAccessible(true);
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
catch (NoSuchMethodException ex) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static long getRealDaysPlayed() {
|
public static long getRealDaysPlayed() {
|
||||||
long seconds = WyHelper.playTime / 20;
|
long seconds = WyHelper.playTime / 20;
|
||||||
return Duration.ofSeconds(seconds).toDays();
|
return Duration.ofSeconds(seconds).toDays();
|
||||||
|
|
|
@ -10,6 +10,11 @@ public class mod_FinalBeta extends BaseMod {
|
||||||
public mod_FinalBeta() {
|
public mod_FinalBeta() {
|
||||||
ModConfig.instance();
|
ModConfig.instance();
|
||||||
|
|
||||||
|
Minecraft mc = ModLoader.getMinecraftInstance();
|
||||||
|
|
||||||
|
mc.hideQuitButton = false;
|
||||||
|
Minecraft.field_28006_b = null;
|
||||||
|
|
||||||
ModLoader.SetInGameHook(this, true, true);
|
ModLoader.SetInGameHook(this, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue