Jump to content

Recommended Posts

Posted

I have been working on the fix for awhile but it still has major problems.  I would like to know what others think could work as a fix without throwing out compatibility.  The main problem I see is generation and writing to the save file.  I did mess with the NBT stuff but it didn't help.  So, what are some ideas people have to fix this error?  Would someone else be willing to test the code too?

 

EDIT: More Detail of problem:

I converted the code to use ints instead of bytes for the blocks and such but it is still using bytes and all that nonsense.  The block ID of 592 converted to a byte is 80.  80 is the ID of the block of snow.  This caused snow blocks to generate in my world instead of my block.  The point is this, somewhere it is stuck with the -128 and +127 byte code.  Could someone help me locate this problem and figure out a way around it?

width=320 height=64http://www.slothygaming.com/img/ota.png[/img]

If your grammar is shit and you blatantly don't know what you're doing, I will not help you.

  • 2 weeks later...
Posted

Working patch for Forge 251 (1.3.2) --

 

# HG changeset patch
# User Robert Dennington <[email protected]>
# Date 1347274498 -3600
REALLY fix 4096 IDs

diff --git a/common/net/minecraft/src/BiomeGenBase.java b/common/net/minecraft/src/BiomeGenBase.java
--- a/common/net/minecraft/src/BiomeGenBase.java
+++ b/common/net/minecraft/src/BiomeGenBase.java
@@ -52,10 +52,10 @@
     public int color;

     /** The block expected to be on the top of this biome */
-    public byte topBlock;
+    public int topBlock;

     /** The block to fill spots in when not on the top */
-    public byte fillerBlock;
+    public int fillerBlock;
     public int field_76754_C;

     /** The minimum height of this biome. Default 0.1. */
@@ -110,8 +110,8 @@

     protected BiomeGenBase(int par1)
     {
-        this.topBlock = (byte)Block.grass.blockID;
-        this.fillerBlock = (byte)Block.dirt.blockID;
+        this.topBlock = Block.grass.blockID;
+        this.fillerBlock = Block.dirt.blockID;
         this.field_76754_C = 5169201;
         this.minHeight = 0.1F;
         this.maxHeight = 0.3F;
diff --git a/common/net/minecraft/src/BiomeGenBeach.java b/common/net/minecraft/src/BiomeGenBeach.java
--- a/common/net/minecraft/src/BiomeGenBeach.java
+++ b/common/net/minecraft/src/BiomeGenBeach.java
@@ -6,8 +6,8 @@
     {
         super(par1);
         this.spawnableCreatureList.clear();
-        this.topBlock = (byte)Block.sand.blockID;
-        this.fillerBlock = (byte)Block.sand.blockID;
+        this.topBlock = Block.sand.blockID;
+        this.fillerBlock = Block.sand.blockID;
         this.theBiomeDecorator.treesPerChunk = -999;
         this.theBiomeDecorator.deadBushPerChunk = 0;
         this.theBiomeDecorator.reedsPerChunk = 0;
diff --git a/common/net/minecraft/src/BiomeGenDesert.java b/common/net/minecraft/src/BiomeGenDesert.java
--- a/common/net/minecraft/src/BiomeGenDesert.java
+++ b/common/net/minecraft/src/BiomeGenDesert.java
@@ -8,8 +8,8 @@
     {
         super(par1);
         this.spawnableCreatureList.clear();
-        this.topBlock = (byte)Block.sand.blockID;
-        this.fillerBlock = (byte)Block.sand.blockID;
+        this.topBlock = Block.sand.blockID;
+        this.fillerBlock = Block.sand.blockID;
         this.theBiomeDecorator.treesPerChunk = -999;
         this.theBiomeDecorator.deadBushPerChunk = 2;
         this.theBiomeDecorator.reedsPerChunk = 50;
diff --git a/common/net/minecraft/src/BiomeGenEnd.java b/common/net/minecraft/src/BiomeGenEnd.java
--- a/common/net/minecraft/src/BiomeGenEnd.java
+++ b/common/net/minecraft/src/BiomeGenEnd.java
@@ -12,8 +12,8 @@
         this.spawnableCreatureList.clear();
         this.spawnableWaterCreatureList.clear();
         this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 10, 4, 4));
-        this.topBlock = (byte)Block.dirt.blockID;
-        this.fillerBlock = (byte)Block.dirt.blockID;
+        this.topBlock = Block.dirt.blockID;
+        this.fillerBlock = Block.dirt.blockID;
         this.theBiomeDecorator = new BiomeEndDecorator(this);
     }

diff --git a/common/net/minecraft/src/BiomeGenMushroomIsland.java b/common/net/minecraft/src/BiomeGenMushroomIsland.java
--- a/common/net/minecraft/src/BiomeGenMushroomIsland.java
+++ b/common/net/minecraft/src/BiomeGenMushroomIsland.java
@@ -10,7 +10,7 @@
         this.theBiomeDecorator.grassPerChunk = -100;
         this.theBiomeDecorator.mushroomsPerChunk = 1;
         this.theBiomeDecorator.bigMushroomsPerChunk = 1;
-        this.topBlock = (byte)Block.mycelium.blockID;
+        this.topBlock = Block.mycelium.blockID;
         this.spawnableMonsterList.clear();
         this.spawnableCreatureList.clear();
         this.spawnableWaterCreatureList.clear();
diff --git a/common/net/minecraft/src/Block.java b/common/net/minecraft/src/Block.java
--- a/common/net/minecraft/src/Block.java
+++ b/common/net/minecraft/src/Block.java
@@ -1217,7 +1217,7 @@
         Item.itemsList[pistonBase.blockID] = new ItemPiston(pistonBase.blockID - 256);
         Item.itemsList[pistonStickyBase.blockID] = new ItemPiston(pistonStickyBase.blockID - 256);

-        for (int var0 = 0; var0 < 256; ++var0)
+        for (int var0 = 0; var0 < blocksList.length; ++var0)
         {
             if (blocksList[var0] != null)
             {
diff --git a/common/net/minecraft/src/Chunk.java b/common/net/minecraft/src/Chunk.java
--- a/common/net/minecraft/src/Chunk.java
+++ b/common/net/minecraft/src/Chunk.java
@@ -114,7 +114,7 @@
         Arrays.fill(this.blockBiomeArray, (byte) - 1);
     }

-    public Chunk(World par1World, byte[] par2ArrayOfByte, int par3, int par4)
+    public Chunk(World par1World, int[] par2ArrayOfByte, int par3, int par4)
     {
         this(par1World, par3, par4);
         int var5 = par2ArrayOfByte.length / 256;
@@ -125,9 +125,7 @@
             {
                 for (int var8 = 0; var8 < var5; ++var8)
                 {
-                    /* FORGE: The following change, a cast from unsigned byte to int,
-                     * fixes a vanilla bug when generating new chunks that contain a block ID > 127 */
-                    int var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8] & 0xFF;
+                    int var9 = par2ArrayOfByte[var6 << 11 | var7 << 7 | var8];

                     if (var9 != 0)
                     {
diff --git a/common/net/minecraft/src/ChunkProviderEnd.java b/common/net/minecraft/src/ChunkProviderEnd.java
--- a/common/net/minecraft/src/ChunkProviderEnd.java
+++ b/common/net/minecraft/src/ChunkProviderEnd.java
@@ -34,7 +34,7 @@
         this.noiseGen5 = new NoiseGeneratorOctaves(this.endRNG, 16);
     }

-    public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
+    public void generateTerrain(int par1, int par2, int[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
     {
         byte var5 = 2;
         int var6 = var5 + 1;
@@ -83,7 +83,7 @@
                                     var51 = Block.whiteStone.blockID;
                                 }

-                                par3ArrayOfByte[var42] = (byte)var51;
+                                par3ArrayOfByte[var42] = var51;
                                 var42 += var43;
                                 var46 += var48;
                             }
@@ -102,7 +102,7 @@
         }
     }

-    public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
+    public void replaceBlocksForBiome(int par1, int par2, int[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
     {
         for (int var5 = 0; var5 < 16; ++var5)
         {
@@ -110,13 +110,13 @@
             {
                 byte var7 = 1;
                 int var8 = -1;
-                byte var9 = (byte)Block.whiteStone.blockID;
-                byte var10 = (byte)Block.whiteStone.blockID;
+                int var9 = Block.whiteStone.blockID;
+                int var10 = Block.whiteStone.blockID;

                 for (int var11 = 127; var11 >= 0; --var11)
                 {
                     int var12 = (var6 * 16 + var5) * 128 + var11;
-                    byte var13 = par3ArrayOfByte[var12];
+                    int var13 = par3ArrayOfByte[var12];

                     if (var13 == 0)
                     {
@@ -129,7 +129,7 @@
                             if (var7 <= 0)
                             {
                                 var9 = 0;
-                                var10 = (byte)Block.whiteStone.blockID;
+                                var10 = Block.whiteStone.blockID;
                             }

                             var8 = var7;
@@ -169,7 +169,7 @@
     public Chunk provideChunk(int par1, int par2)
     {
         this.endRNG.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
-        byte[] var3 = new byte[32768];
+        int[] var3 = new int[32768];
         this.biomesForGeneration = this.endWorld.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
         this.generateTerrain(par1, par2, var3, this.biomesForGeneration);
         this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration);
diff --git a/common/net/minecraft/src/ChunkProviderFlat.java b/common/net/minecraft/src/ChunkProviderFlat.java
--- a/common/net/minecraft/src/ChunkProviderFlat.java
+++ b/common/net/minecraft/src/ChunkProviderFlat.java
@@ -17,7 +17,7 @@
         this.random = new Random(par2);
     }

-    private void generate(byte[] par1ArrayOfByte)
+    private void generate(int[] par1ArrayOfByte)
     {
         int var2 = par1ArrayOfByte.length / 256;

@@ -42,7 +42,7 @@
                         var6 = Block.grass.blockID;
                     }

-                    par1ArrayOfByte[var3 << 11 | var4 << 7 | var5] = (byte)var6;
+                    par1ArrayOfByte[var3 << 11 | var4 << 7 | var5] = var6;
                 }
             }
         }
@@ -62,7 +62,7 @@
      */
     public Chunk provideChunk(int par1, int par2)
     {
-        byte[] var3 = new byte[32768];
+        int[] var3 = new int[32768];
         this.generate(var3);
         Chunk var4 = new Chunk(this.worldObj, var3, par1, par2);

diff --git a/common/net/minecraft/src/ChunkProviderGenerate.java b/common/net/minecraft/src/ChunkProviderGenerate.java
--- a/common/net/minecraft/src/ChunkProviderGenerate.java
+++ b/common/net/minecraft/src/ChunkProviderGenerate.java
@@ -93,7 +93,7 @@
      * Generates the shape of the terrain for the chunk though its all stone though the water is frozen if the
      * temperature is low enough
      */
-    public void generateTerrain(int par1, int par2, byte[] par3ArrayOfByte)
+    public void generateTerrain(int par1, int par2, int[] par3ArrayOfByte)
     {
         byte var4 = 4;
         byte var5 = 16;
@@ -141,11 +141,11 @@
                             {
                                 if ((var47 += var49) > 0.0D)
                                 {
-                                    par3ArrayOfByte[var43 += var44] = (byte)Block.stone.blockID;
+                                    par3ArrayOfByte[var43 += var44] = Block.stone.blockID;
                                 }
                                 else if (var12 * 8 + var31 < var6)
                                 {
-                                    par3ArrayOfByte[var43 += var44] = (byte)Block.waterStill.blockID;
+                                    par3ArrayOfByte[var43 += var44] = Block.waterStill.blockID;
                                 }
                                 else
                                 {
@@ -170,7 +170,7 @@
     /**
      * Replaces the stone that was placed in with blocks that match the biome
      */
-    public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
+    public void replaceBlocksForBiome(int par1, int par2, int[] par3ArrayOfByte, BiomeGenBase[] par4ArrayOfBiomeGenBase)
     {
         byte var5 = 63;
         double var6 = 0.03125D;
@@ -184,8 +184,8 @@
                 float var11 = var10.getFloatTemperature();
                 int var12 = (int)(this.stoneNoise[var8 + var9 * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
                 int var13 = -1;
-                byte var14 = var10.topBlock;
-                byte var15 = var10.fillerBlock;
+                int var14 = var10.topBlock;
+                int var15 = var10.fillerBlock;

                 for (int var16 = 127; var16 >= 0; --var16)
                 {
@@ -193,11 +193,11 @@

                     if (var16 <= 0 + this.rand.nextInt(5))
                     {
-                        par3ArrayOfByte[var17] = (byte)Block.bedrock.blockID;
+                        par3ArrayOfByte[var17] = Block.bedrock.blockID;
                     }
                     else
                     {
-                        byte var18 = par3ArrayOfByte[var17];
+                        int var18 = par3ArrayOfByte[var17];

                         if (var18 == 0)
                         {
@@ -210,7 +210,7 @@
                                 if (var12 <= 0)
                                 {
                                     var14 = 0;
-                                    var15 = (byte)Block.stone.blockID;
+                                    var15 = Block.stone.blockID;
                                 }
                                 else if (var16 >= var5 - 4 && var16 <= var5 + 1)
                                 {
@@ -222,11 +222,11 @@
                                 {
                                     if (var11 < 0.15F)
                                     {
-                                        var14 = (byte)Block.ice.blockID;
+                                        var14 = Block.ice.blockID;
                                     }
                                     else
                                     {
-                                        var14 = (byte)Block.waterStill.blockID;
+                                        var14 = Block.waterStill.blockID;
                                     }
                                 }

@@ -249,7 +249,7 @@
                                 if (var13 == 0 && var15 == Block.sand.blockID)
                                 {
                                     var13 = this.rand.nextInt(4);
-                                    var15 = (byte)Block.sandStone.blockID;
+                                    var15 = Block.sandStone.blockID;
                                 }
                             }
                         }
@@ -274,7 +274,7 @@
     public Chunk provideChunk(int par1, int par2)
     {
         this.rand.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
-        byte[] var3 = new byte[32768];
+        int[] var3 = new int[32768];
         this.generateTerrain(par1, par2, var3);
         this.biomesForGeneration = this.worldObj.getWorldChunkManager().loadBlockGeneratorData(this.biomesForGeneration, par1 * 16, par2 * 16, 16, 16);
         this.replaceBlocksForBiome(par1, par2, var3, this.biomesForGeneration);
diff --git a/common/net/minecraft/src/ChunkProviderHell.java b/common/net/minecraft/src/ChunkProviderHell.java
--- a/common/net/minecraft/src/ChunkProviderHell.java
+++ b/common/net/minecraft/src/ChunkProviderHell.java
@@ -60,7 +60,7 @@
     /**
      * Generates the shape of the terrain in the nether.
      */
-    public void generateNetherTerrain(int par1, int par2, byte[] par3ArrayOfByte)
+    public void generateNetherTerrain(int par1, int par2, int[] par3ArrayOfByte)
     {
         byte var4 = 4;
         byte var5 = 32;
@@ -115,7 +115,7 @@
                                     var51 = Block.netherrack.blockID;
                                 }

-                                par3ArrayOfByte[var42] = (byte)var51;
+                                par3ArrayOfByte[var42] = var51;
                                 var42 += var43;
                                 var46 += var48;
                             }
@@ -137,7 +137,7 @@
     /**
      * name based on ChunkProviderGenerate
      */
-    public void replaceBlocksForBiome(int par1, int par2, byte[] par3ArrayOfByte)
+    public void replaceBlocksForBiome(int par1, int par2, int[] par3ArrayOfByte)
     {
         byte var4 = 64;
         double var5 = 0.03125D;
@@ -153,8 +153,8 @@
                 boolean var10 = this.gravelNoise[var7 + var8 * 16] + this.hellRNG.nextDouble() * 0.2D > 0.0D;
                 int var11 = (int)(this.netherrackExclusivityNoise[var7 + var8 * 16] / 3.0D + 3.0D + this.hellRNG.nextDouble() * 0.25D);
                 int var12 = -1;
-                byte var13 = (byte)Block.netherrack.blockID;
-                byte var14 = (byte)Block.netherrack.blockID;
+                int var13 = Block.netherrack.blockID;
+                int var14 = Block.netherrack.blockID;

                 for (int var15 = 127; var15 >= 0; --var15)
                 {
@@ -162,7 +162,7 @@

                     if (var15 < 127 - this.hellRNG.nextInt(5) && var15 > 0 + this.hellRNG.nextInt(5))
                     {
-                        byte var17 = par3ArrayOfByte[var16];
+                        int var17 = par3ArrayOfByte[var16];

                         if (var17 == 0)
                         {
@@ -175,37 +175,37 @@
                                 if (var11 <= 0)
                                 {
                                     var13 = 0;
-                                    var14 = (byte)Block.netherrack.blockID;
+                                    var14 = Block.netherrack.blockID;
                                 }
                                 else if (var15 >= var4 - 4 && var15 <= var4 + 1)
                                 {
-                                    var13 = (byte)Block.netherrack.blockID;
-                                    var14 = (byte)Block.netherrack.blockID;
+                                    var13 = Block.netherrack.blockID;
+                                    var14 = Block.netherrack.blockID;

                                     if (var10)
                                     {
-                                        var13 = (byte)Block.gravel.blockID;
+                                        var13 = Block.gravel.blockID;
                                     }

                                     if (var10)
                                     {
-                                        var14 = (byte)Block.netherrack.blockID;
+                                        var14 = Block.netherrack.blockID;
                                     }

                                     if (var9)
                                     {
-                                        var13 = (byte)Block.slowSand.blockID;
+                                        var13 = Block.slowSand.blockID;
                                     }

                                     if (var9)
                                     {
-                                        var14 = (byte)Block.slowSand.blockID;
+                                        var14 = Block.slowSand.blockID;
                                     }
                                 }

                                 if (var15 < var4 && var13 == 0)
                                 {
-                                    var13 = (byte)Block.lavaStill.blockID;
+                                    var13 = Block.lavaStill.blockID;
                                 }

                                 var12 = var11;
@@ -228,7 +228,7 @@
                     }
                     else
                     {
-                        par3ArrayOfByte[var16] = (byte)Block.bedrock.blockID;
+                        par3ArrayOfByte[var16] = Block.bedrock.blockID;
                     }
                 }
             }
@@ -250,7 +250,7 @@
     public Chunk provideChunk(int par1, int par2)
     {
         this.hellRNG.setSeed((long)par1 * 341873128712L + (long)par2 * 132897987541L);
-        byte[] var3 = new byte[32768];
+        int[] var3 = new int[32768];
         this.generateNetherTerrain(par1, par2, var3);
         this.replaceBlocksForBiome(par1, par2, var3);
         this.netherCaveGenerator.generate(this, this.worldObj, par1, par2, var3);
diff --git a/common/net/minecraft/src/MapGenBase.java b/common/net/minecraft/src/MapGenBase.java
--- a/common/net/minecraft/src/MapGenBase.java
+++ b/common/net/minecraft/src/MapGenBase.java
@@ -13,7 +13,7 @@
     /** This world object. */
     protected World worldObj;

-    public void generate(IChunkProvider par1IChunkProvider, World par2World, int par3, int par4, byte[] par5ArrayOfByte)
+    public void generate(IChunkProvider par1IChunkProvider, World par2World, int par3, int par4, int[] par5ArrayOfByte)
     {
         int var6 = this.range;
         this.worldObj = par2World;
@@ -36,5 +36,5 @@
     /**
      * Recursively called by generate() (generate) and optionally by itself.
      */
-    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte) {}
+    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, int[] par6ArrayOfByte) {}
}
diff --git a/common/net/minecraft/src/MapGenCaves.java b/common/net/minecraft/src/MapGenCaves.java
--- a/common/net/minecraft/src/MapGenCaves.java
+++ b/common/net/minecraft/src/MapGenCaves.java
@@ -7,7 +7,7 @@
     /**
      * Generates a larger initial cave node than usual. Called 25% of the time.
      */
-    protected void generateLargeCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10)
+    protected void generateLargeCaveNode(long par1, int par3, int par4, int[] par5ArrayOfByte, double par6, double par8, double par10)
     {
         this.generateCaveNode(par1, par3, par4, par5ArrayOfByte, par6, par8, par10, 1.0F + this.rand.nextFloat() * 6.0F, 0.0F, 0.0F, -1, -1, 0.5D);
     }
@@ -15,7 +15,7 @@
     /**
      * Generates a node in the current cave system recursion tree.
      */
-    protected void generateCaveNode(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
+    protected void generateCaveNode(long par1, int par3, int par4, int[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
     {
         double var19 = (double)(par3 * 16 + ;
         double var21 = (double)(par4 * 16 + ;
@@ -171,7 +171,7 @@

                                         if (var51 > -0.7D && var59 * var59 + var51 * var51 + var46 * var46 < 1.0D)
                                         {
-                                            byte var53 = par5ArrayOfByte[var48];
+                                            int var53 = par5ArrayOfByte[var48];

                                             if (var53 == Block.grass.blockID)
                                             {
@@ -182,7 +182,7 @@
                                             {
                                                 if (var50 < 10)
                                                 {
-                                                    par5ArrayOfByte[var48] = (byte)Block.lavaMoving.blockID;
+                                                    par5ArrayOfByte[var48] = Block.lavaMoving.blockID;
                                                 }
                                                 else
                                                 {
@@ -215,7 +215,7 @@
     /**
      * Recursively called by generate() (generate) and optionally by itself.
      */
-    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte)
+    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, int[] par6ArrayOfByte)
     {
         int var7 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(40) + 1) + 1);

diff --git a/common/net/minecraft/src/MapGenRavine.java b/common/net/minecraft/src/MapGenRavine.java
--- a/common/net/minecraft/src/MapGenRavine.java
+++ b/common/net/minecraft/src/MapGenRavine.java
@@ -6,7 +6,7 @@
{
     private float[] field_75046_d = new float[1024];

-    protected void generateRavine(long par1, int par3, int par4, byte[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
+    protected void generateRavine(long par1, int par3, int par4, int[] par5ArrayOfByte, double par6, double par8, double par10, float par12, float par13, float par14, int par15, int par16, double par17)
     {
         Random var19 = new Random(par1);
         double var20 = (double)(par3 * 16 + ;
@@ -158,7 +158,7 @@

                                         if ((var59 * var59 + var45 * var45) * (double)this.field_75046_d[var49] + var50 * var50 / 6.0D < 1.0D)
                                         {
-                                            byte var52 = par5ArrayOfByte[var47];
+                                            int var52 = par5ArrayOfByte[var47];

                                             if (var52 == Block.grass.blockID)
                                             {
@@ -169,7 +169,7 @@
                                             {
                                                 if (var49 < 10)
                                                 {
-                                                    par5ArrayOfByte[var47] = (byte)Block.lavaMoving.blockID;
+                                                    par5ArrayOfByte[var47] = Block.lavaMoving.blockID;
                                                 }
                                                 else
                                                 {
@@ -202,7 +202,7 @@
     /**
      * Recursively called by generate() (generate) and optionally by itself.
      */
-    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, byte[] par6ArrayOfByte)
+    protected void recursiveGenerate(World par1World, int par2, int par3, int par4, int par5, int[] par6ArrayOfByte)
     {
         if (this.rand.nextInt(50) == 0)
         {
diff --git a/common/net/minecraft/src/WorldGenBigTree.java b/common/net/minecraft/src/WorldGenBigTree.java
--- a/common/net/minecraft/src/WorldGenBigTree.java
+++ b/common/net/minecraft/src/WorldGenBigTree.java
@@ -362,7 +362,7 @@

             if (this.leafNodeNeedsBase(var6))
             {
-                this.placeBlockLine(var3, var5, (byte)Block.wood.blockID);
+                this.placeBlockLine(var3, var5, Block.wood.blockID);
             }
         }
     }
diff --git a/common/net/minecraftforge/common/MinecraftForge.java b/common/net/minecraftforge/common/MinecraftForge.java
--- a/common/net/minecraftforge/common/MinecraftForge.java
+++ b/common/net/minecraftforge/common/MinecraftForge.java
@@ -173,7 +173,7 @@

        for (int x = 256; x < 4096; x++)
        {
-           if (Item.itemsList[x] != null)
+           if (Item.itemsList[x] != null && (Block.blocksList[x] == null))
            {
                Block.blocksList[x] = filler;
            }

 

Problem solved.

Posted

Maybe not, but the root cause of the problem is that all the information in the generators are being stored as bytes (rather than shorts or ints) so thus that information is capped at 255. Changing all the bytes to ints (and fixing a few other issues here and there as I did in the above patch) works perfectly fine, at least as a cheap hack.

 

Obviously said patch breaks compatibility with any mods which expect a byte to be used, so this is not a perfect solution, but at least it's a start. The above patch was based on the test of changing the ID of grass block and netherrack to > 255 and having them still generate correctly (I'm working on a mod which allows you to remap the vanilla IDs so this was a major issue for me).

 

I imagine that adding compatibility for mods expecting bytes wouldn't be too hard of an extension. I will probably work on it if I can find the time.

  • 2 weeks later...
Posted

Currently I just intend to get the source for (or decompile) any mods that don't work, then patch them to use int rather than byte. I know it's an ugly solution, but that can't really be helped. I looked into the problem more and don't really see any way of fixing it other than applying this byte-to-int patch to Forge itself and any mod that comes along which happens to need it.

Posted

Someone could fairly simply write a core mod for this, but, its never gunna go into forge. Go bitch at mojang to change it to int or short in the next version.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • When I first heard about Bitcoin back in 2018, I was skeptical. The idea of a decentralized, digital currency seemed too good to be true. But I was intrigued as I learned more about the technology behind it and its potential. I started small, investing just a few hundred dollars, dipping my toes into the cryptocurrency waters. At first, it was exhilarating to watch the value of my investment grow exponentially. I felt like I was part of the future, an early adopter of this revolutionary new asset. But that euphoria was short-lived. One day, I logged into my digital wallet only to find it empty - my Bitcoin had vanished without a trace. It turned out that the online exchange I had trusted had been hacked, and my funds were stolen. I was devastated, both financially and emotionally. All the potential I had seen in Bitcoin was tainted by the harsh reality that with decentralization came a lack of regulation and oversight. My hard-earned money was gone, lost to the ether of the digital world. This experience taught me a painful lesson about the price of trust in the uncharted territory of cryptocurrency. While the technology holds incredible promise, the risks can be catastrophic if you don't approach it with extreme caution. My Bitcoin investment gamble had failed, and I was left to pick up the pieces, wiser but poorer for having placed my faith in the wrong hands. My sincere appreciation goes to MUYERN TRUST HACKER. You are my hero in recovering my lost funds. Send a direct m a i l ( muyerntrusted ( @ ) mail-me ( . )c o m ) or message on whats app : + 1 ( 4-4-0 ) ( 3 -3 -5 ) ( 0-2-0-5 )
    • You could try posting a log (if there is no log at all, it may be the launcher you are using, the FAQ may have info on how to enable the log) as described in the FAQ, however this will probably need to be reported to/remedied by the mod author.
    • So me and a couple of friends are playing with a shitpost mod pack and one of the mods in the pack is corail tombstone and for some reason there is a problem with it, where on death to fire the player will get kicked out of the server and the tombstone will not spawn basically deleting an entire inventory, it doesn't matter what type of fire it is, whether it's from vanilla fire/lava, or from modded fire like ice&fire/lycanites and it's common enough to where everyone on the server has experienced at least once or twice and it doesn't give any crash log. a solution to this would be much appreciated thank you!
    • It is 1.12.2 - I have no idea if there is a 1.12 pack
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.