Ported several more patches, mostly generic world ones such as save data or sound3 loading

master
Wynd 2025-04-07 01:49:42 +03:00
parent 276bdde2b1
commit 3473dbcffd
7 changed files with 231 additions and 2 deletions

View File

@ -1,6 +1,14 @@
--- 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 @@
+++ client/Minecraft.java 2025-04-07 01:45:06.894086534 +0300
@@ -8,6 +8,7 @@
import java.io.File;
import java.io.PrintStream;
import net.minecraft.src.*;
+import net.minecraft.src.finalbeta.ModConfig;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.*;
import org.lwjgl.opengl.*;
@@ -113,7 +114,8 @@
Display.setTitle("Minecraft Minecraft Beta 1.7.3");
try
{
@ -10,3 +18,19 @@
}
catch(LWJGLException lwjglexception)
{
@@ -1447,6 +1449,15 @@
{
sndManager.addMusic(s, file);
}
+
+ if (ModConfig.ADD_MORE_SOUNDS.get()) {
+ // For now only allow the minecart sounds, allowing all of them causes weird effects with same name
+ // sounds when the game decides which one to use
+ if (s1.equalsIgnoreCase("sound3")) {
+ mod_FinalBeta.LOGGER.info("Registered a new sound sound3/" + s + " from " + file);
+ this.sndManager.addSound("sound3/" + s, file);
+ }
+ }
}
public OpenGlCapsChecker getOpenGlCapsChecker()

View File

@ -0,0 +1,33 @@
--- src/EntityPlayerSP.java.bak 2025-04-07 01:04:11.632376872 +0300
+++ src/EntityPlayerSP.java 2025-04-07 01:27:52.507902587 +0300
@@ -6,6 +6,7 @@
import java.util.Random;
import net.minecraft.client.Minecraft;
+import net.minecraft.src.finalbeta.ModConfig;
// Referenced classes of package net.minecraft.src:
// EntityPlayer, MouseFilter, Session, MovementInput,
@@ -131,6 +132,12 @@
public void closeScreen()
{
+ if (ModConfig.ADD_MORE_SOUNDS.get()) {
+ if (this.craftingInventory instanceof ContainerChest) {
+ this.worldObj.playSoundAtEntity(this, "random.chestclosed", 0.3f, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ }
+ }
+
super.closeScreen();
mc.displayGuiScreen(null);
}
@@ -143,6 +150,9 @@
public void displayGUIChest(IInventory iinventory)
{
mc.displayGuiScreen(new GuiChest(inventory, iinventory));
+ if (ModConfig.ADD_MORE_SOUNDS.get()) {
+ this.worldObj.playSoundAtEntity(this, "random.chestopen", 0.3f, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
+ }
}
public void displayWorkbenchGUI(int i, int j, int k)

View File

@ -0,0 +1,21 @@
--- src/RenderLiving.java.bak 2025-04-07 01:47:26.325482383 +0300
+++ src/RenderLiving.java 2025-04-07 01:47:33.477400105 +0300
@@ -5,6 +5,7 @@
package net.minecraft.src;
import net.minecraft.client.Minecraft;
+import net.minecraft.src.finalbeta.ModConfig;
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
@@ -191,6 +192,10 @@
protected void passSpecialRender(EntityLiving entityliving, double d, double d1, double d2)
{
+ if (ModConfig.DISABLE_ID_TAGS.get()) {
+ return;
+ }
+
if(Minecraft.isDebugInfoEnabled())
{
renderLivingLabel(entityliving, Integer.toString(entityliving.entityId), d, d1, d2, 64);

View File

@ -0,0 +1,21 @@
--- src/SpawnerAnimals.java.bak 2025-04-07 00:28:26.349265964 +0300
+++ src/SpawnerAnimals.java 2025-04-07 00:28:58.481889413 +0300
@@ -6,6 +6,7 @@
import java.lang.reflect.Constructor;
import java.util.*;
+import net.minecraft.src.finalbeta.ModConfig;
// Referenced classes of package net.minecraft.src:
// World, ChunkPosition, EntityPlayer, MathHelper,
@@ -200,6 +201,10 @@
public static boolean performSleepSpawning(World world, List list)
{
+ if (ModConfig.REMOVE_NIGHTMARES.get()) {
+ return false;
+ }
+
boolean flag = false;
Pathfinder pathfinder = new Pathfinder(world);
Iterator iterator = list.iterator();

View File

@ -0,0 +1,60 @@
--- src/World.java.bak 2025-04-07 00:21:20.862252059 +0300
+++ src/World.java 2025-04-07 00:26:42.954477600 +0300
@@ -6,6 +6,8 @@
import java.io.PrintStream;
import java.util.*;
+import net.minecraft.src.finalbeta.ModConfig;
+import net.minecraft.src.finalbeta.WyHelper;
// Referenced classes of package net.minecraft.src:
// IBlockAccess, WorldProvider, WorldInfo, MapStorage,
@@ -1530,7 +1532,38 @@
updateEntity(entity.riddenByEntity);
}
}
- }
+
+ if (ModConfig.FURNACE_MINECART_CHUNK_LOADING.get() && entity instanceof EntityMinecart) {
+ EntityMinecart minecart = ((EntityMinecart) entity);
+ int x = MathHelper.floor_double(entity.posX);
+ int z = MathHelper.floor_double(entity.posZ);
+ /*
+ * TODO This is very likely not optimal, we could probably do better and only load "forward" chunks
+ * relative to the cart's direction, but its barely noticeable in my tests and at least at the
+ * moment I don't care enough for this optimization.
+ */
+ int area = 64;
+ boolean isRegionLoaded = entity.worldObj.checkChunksExist(x - area, 0, z - area, x + area, 128, z + area);
+ if (!isRegionLoaded && minecart.minecartType == 2) {
+ loadRegion(entity.worldObj, x - area, z - area, x + area, z + area);
+ }
+ }
+ }
+
+ private void loadRegion(World level, int minX, int minZ, int maxX, int maxZ) {
+ minX >>= 4;
+ minZ >>= 4;
+ maxX >>= 4;
+ maxZ >>= 4;
+
+ for (int x = minX; x <= maxX; ++x) {
+ for (int z = minZ; z <= maxZ; ++z) {
+ if (!level.chunkProvider.chunkExists(x, z)) {
+ level.chunkProvider.chunkExists(x, z);
+ }
+ }
+ }
+ }
public boolean checkIfAABBIsClear(AxisAlignedBB axisalignedbb)
{
@@ -2050,6 +2083,8 @@
worldInfo.setWorldTime(l1);
TickUpdates(false);
updateBlocksAndPlayCaveSounds();
+
+ WyHelper.playTime++;
}
private void func_27163_E()

View File

@ -0,0 +1,41 @@
--- src/WorldInfo.java.bak 2025-04-07 00:31:25.816162873 +0300
+++ src/WorldInfo.java 2025-04-07 00:41:09.294367286 +0300
@@ -5,12 +5,14 @@
package net.minecraft.src;
import java.util.List;
+import net.minecraft.src.finalbeta.WyHelper;
// Referenced classes of package net.minecraft.src:
// NBTTagCompound, EntityPlayer
public class WorldInfo
{
+ private long spawnTime;
public WorldInfo(NBTTagCompound nbttagcompound)
{
@@ -32,6 +34,13 @@
playerTag = nbttagcompound.getCompoundTag("Player");
dimension = playerTag.getInteger("Dimension");
}
+
+ if (!nbttagcompound.hasKey(WyHelper.SPAWN_TIME_TAG)) {
+ this.spawnTime = System.currentTimeMillis();
+ } else {
+ this.spawnTime = nbttagcompound.getLong(WyHelper.SPAWN_TIME_TAG);
+ }
+ WyHelper.playTime = nbttagcompound.getLong(WyHelper.PLAY_TIME_TAG);
}
public WorldInfo(long l, String s)
@@ -103,6 +112,9 @@
{
nbttagcompound.setCompoundTag("Player", nbttagcompound1);
}
+
+ nbttagcompound.setLong(WyHelper.SPAWN_TIME_TAG, this.spawnTime);
+ nbttagcompound.setLong(WyHelper.PLAY_TIME_TAG, WyHelper.playTime);
}
public long getRandomSeed()

View File

@ -0,0 +1,29 @@
--- src/WorldProvider.java.bak 2025-04-07 00:52:42.422328763 +0300
+++ src/WorldProvider.java 2025-04-07 00:57:46.098825034 +0300
@@ -4,6 +4,7 @@
package net.minecraft.src;
+import net.minecraft.src.finalbeta.ModConfig;
// Referenced classes of package net.minecraft.src:
// WorldChunkManager, ChunkProviderGenerate, World, Block,
@@ -12,7 +13,8 @@
public abstract class WorldProvider
{
-
+ private static final float CLOUD_HEIGHT = 108.0F;
+
public WorldProvider()
{
isNether = false;
@@ -142,7 +144,7 @@
public float getCloudHeight()
{
- return 108F;
+ return CLOUD_HEIGHT + (CLOUD_HEIGHT * 2.0f * ModConfig.CLOUDS_HEIGHT.get().floatValue());
}
public boolean func_28112_c()