ForgePatch/forge/minecraft.patch

296 lines
13 KiB
Diff

diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/ChunkProviderGenerate.java ../src_work/minecraft/net/minecraft/src/ChunkProviderGenerate.java
--- ../src_base/minecraft/net/minecraft/src/ChunkProviderGenerate.java 2011-07-11 21:58:45.029673700 +0200
+++ ../src_work/minecraft/net/minecraft/src/ChunkProviderGenerate.java 2011-07-15 21:55:40.634969900 +0200
@@ -6,6 +6,8 @@
import java.util.Random;
+import net.minecraft.src.forge.MinecraftForge;
+
// Referenced classes of package net.minecraft.src:
// IChunkProvider, MapGenCaves, NoiseGeneratorOctaves, Block,
// BiomeGenBase, Chunk, World, WorldChunkManager,
@@ -632,6 +634,8 @@
int i25 = l + rand.nextInt(16) + 8;
(new WorldGenLiquids(Block.lavaMoving.blockID)).generate(worldObj, rand, i22, l23, i25);
}
+
+ MinecraftForge.populateBiome(worldObj, biomegenbase, k, l);
generatedTemperatures = worldObj.getWorldChunkManager().getTemperatures(generatedTemperatures, k + 8, l + 8, 16, 16);
for(int j19 = k + 8; j19 < k + 8 + 16; j19++)
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/ItemBucket.java ../src_work/minecraft/net/minecraft/src/ItemBucket.java
--- ../src_base/minecraft/net/minecraft/src/ItemBucket.java 2011-07-11 21:58:45.174682000 +0200
+++ ../src_work/minecraft/net/minecraft/src/ItemBucket.java 2011-07-15 23:13:30.143050500 +0200
@@ -6,6 +6,8 @@
import java.util.Random;
+import net.minecraft.src.forge.MinecraftForge;
+
// Referenced classes of package net.minecraft.src:
// Item, EntityPlayer, Vec3D, MathHelper,
// World, MovingObjectPosition, EnumMovingObjectType, Material,
@@ -55,6 +57,13 @@
}
if(isFull == 0)
{
+ ItemStack customBucket = MinecraftForge.fillCustomBucket(world,
+ i, j, k);
+
+ if (customBucket != null) {
+ return customBucket;
+ }
+
if(world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0)
{
world.setBlockWithNotify(i, j, k, 0);
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/ItemRenderer.java ../src_work/minecraft/net/minecraft/src/ItemRenderer.java
--- ../src_base/minecraft/net/minecraft/src/ItemRenderer.java 2011-07-11 21:58:45.189682900 +0200
+++ ../src_work/minecraft/net/minecraft/src/ItemRenderer.java 2011-07-16 01:00:00.046532100 +0200
@@ -5,6 +5,8 @@
package net.minecraft.src;
import net.minecraft.client.Minecraft;
+import net.minecraft.src.forge.MinecraftForgeClient;
+
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
@@ -34,15 +36,18 @@
if(itemstack.itemID < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType()))
{
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
+ MinecraftForgeClient.overrideTexture (Block.blocksList[itemstack.itemID]);
renderBlocksInstance.renderBlockOnInventory(Block.blocksList[itemstack.itemID], itemstack.getItemDamage(), entityliving.getEntityBrightness(1.0F));
} else
{
if(itemstack.itemID < 256)
{
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/terrain.png"));
+ MinecraftForgeClient.overrideTexture (Block.blocksList[itemstack.itemID]);
} else
{
GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("/gui/items.png"));
+ MinecraftForgeClient.overrideTexture (Item.itemsList[itemstack.itemID]);
}
Tessellator tessellator = Tessellator.instance;
int i = entityliving.getItemIcon(itemstack);
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/RenderBlocks.java ../src_work/minecraft/net/minecraft/src/RenderBlocks.java
--- ../src_base/minecraft/net/minecraft/src/RenderBlocks.java 2011-07-11 21:58:45.359692600 +0200
+++ ../src_work/minecraft/net/minecraft/src/RenderBlocks.java 2011-07-16 00:51:36.820749200 +0200
@@ -5,6 +5,8 @@
package net.minecraft.src;
import net.minecraft.client.Minecraft;
+import net.minecraft.src.forge.MinecraftForgeClient;
+
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/RenderItem.java ../src_work/minecraft/net/minecraft/src/RenderItem.java
--- ../src_base/minecraft/net/minecraft/src/RenderItem.java 2011-07-11 21:58:45.370693200 +0200
+++ ../src_work/minecraft/net/minecraft/src/RenderItem.java 2011-07-16 01:01:10.494561500 +0200
@@ -5,6 +5,9 @@
package net.minecraft.src;
import java.util.Random;
+
+import net.minecraft.src.forge.MinecraftForgeClient;
+
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
@@ -51,6 +54,7 @@
{
GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F);
loadTexture("/terrain.png");
+ MinecraftForgeClient.overrideTexture(Block.blocksList[itemstack.itemID]);
float f4 = 0.25F;
if(!Block.blocksList[itemstack.itemID].renderAsNormalBlock() && itemstack.itemID != Block.stairSingle.blockID && Block.blocksList[itemstack.itemID].getRenderType() != 16)
{
@@ -78,10 +82,12 @@
if(itemstack.itemID < 256)
{
loadTexture("/terrain.png");
+ MinecraftForgeClient.overrideTexture(Block.blocksList[itemstack.itemID]);
} else
{
loadTexture("/gui/items.png");
- }
+ MinecraftForgeClient.overrideTexture(Item.itemsList[itemstack.itemID]);
+ }
Tessellator tessellator = Tessellator.instance;
float f6 = (float)((i % 16) * 16 + 0) / 256F;
float f8 = (float)((i % 16) * 16 + 16) / 256F;
@@ -92,6 +98,7 @@
float f14 = 0.25F;
if(field_27004_a)
{
+
int k = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage());
float f15 = (float)(k >> 16 & 0xff) / 255F;
float f17 = (float)(k >> 8 & 0xff) / 255F;
@@ -131,6 +138,7 @@
{
int j1 = i;
renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
+ MinecraftForgeClient.overrideTexture (Block.blocksList[i]);
Block block = Block.blocksList[j1];
GL11.glPushMatrix();
GL11.glTranslatef(l - 2, i1 + 3, -3F);
@@ -159,9 +167,11 @@
if(i < 256)
{
renderengine.bindTexture(renderengine.getTexture("/terrain.png"));
+ MinecraftForgeClient.overrideTexture (Block.blocksList[i]);
} else
{
renderengine.bindTexture(renderengine.getTexture("/gui/items.png"));
+ MinecraftForgeClient.overrideTexture(Item.itemsList[i]);
}
int k1 = Item.itemsList[i].getColorFromDamage(j);
float f = (float)(k1 >> 16 & 0xff) / 255F;
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/WorldRenderer.java ../src_work/minecraft/net/minecraft/src/WorldRenderer.java
--- ../src_base/minecraft/net/minecraft/src/WorldRenderer.java 2011-07-11 21:58:45.464698600 +0200
+++ ../src_work/minecraft/net/minecraft/src/WorldRenderer.java 2011-07-16 00:27:38.378475000 +0200
@@ -5,6 +5,9 @@
package net.minecraft.src;
import java.util.*;
+
+import net.minecraft.src.forge.MinecraftForgeClient;
+
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
@@ -144,8 +147,10 @@
continue;
}
if(j3 == i2)
- {
+ {
+ MinecraftForgeClient.beforeBlockRender(block, renderblocks);
flag1 |= renderblocks.renderBlockByRenderType(block, l2, j2, k2);
+ MinecraftForgeClient.afterBlockRender(block, renderblocks);
}
}
diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/client/Minecraft.java ../src_work/minecraft/net/minecraft/client/Minecraft.java
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java 2011-07-11 21:58:45.464698600 +0200
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java 2011-07-16 00:27:38.378475000 +0200
@@ -177,6 +177,7 @@
renderGlobal = new RenderGlobal(this, renderEngine);
GL11.glViewport(0, 0, displayWidth, displayHeight);
effectRenderer = new EffectRenderer(theWorld, renderEngine);
+ MinecraftForgeClient.onGameStart();
try
{
downloadResourcesThread = new ThreadDownloadResources(mcDataDir, this);
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/server/MinecraftServer.java ../src_work/minecraft_server/net/minecraft/server/MinecraftServer.java
--- ../src_base/minecraft_server/net/minecraft/server/MinecraftServer.java 2011-07-11 21:58:45.468698800 +0200
+++ ../src_work/minecraft_server/net/minecraft/server/MinecraftServer.java 2011-07-11 22:00:55.619143000 +0200
@@ -333,41 +333,22 @@
}
finally
{
- System.exit(0);
+ try
+ {
+ stopServer();
+ serverStopped = true;
+ }
+ catch(Throwable throwable2)
+ {
+ throwable2.printStackTrace();
+ }
+ finally
+ {
+ System.exit(0);
+ }
}
- break MISSING_BLOCK_LABEL_350;
- }
- try
- {
- stopServer();
- serverStopped = true;
- }
- catch(Throwable throwable)
- {
- throwable.printStackTrace();
- }
- finally
- {
- System.exit(0);
- }
- break MISSING_BLOCK_LABEL_350;
- Exception exception2;
- exception2;
- try
- {
- stopServer();
- serverStopped = true;
- }
- catch(Throwable throwable3)
- {
- throwable3.printStackTrace();
- }
- finally
- {
- System.exit(0);
- }
- throw exception2;
}
+}
private void doTick()
{
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ChunkProviderGenerate.java ../src_work/minecraft_server/net/minecraft/src/ChunkProviderGenerate.java
--- ../src_base/minecraft_server/net/minecraft/src/ChunkProviderGenerate.java 2011-07-11 21:58:45.652709400 +0200
+++ ../src_work/minecraft_server/net/minecraft/src/ChunkProviderGenerate.java 2011-07-15 23:09:16.449540100 +0200
@@ -6,6 +6,8 @@
import java.util.Random;
+import net.minecraft.src.forge.MinecraftForge;
+
// Referenced classes of package net.minecraft.src:
// IChunkProvider, MapGenCaves, NoiseGeneratorOctaves, Block,
// BiomeGenBase, Chunk, World, WorldChunkManager,
@@ -632,6 +634,8 @@
int i25 = l + rand.nextInt(16) + 8;
(new WorldGenLiquids(Block.lavaMoving.blockID)).generate(worldObj, rand, i22, l23, i25);
}
+
+ MinecraftForge.populateBiome(worldObj, biomegenbase, k, l);
generatedTemperatures = worldObj.getWorldChunkManager().getTemperatures(generatedTemperatures, k + 8, l + 8, 16, 16);
for(int j19 = k + 8; j19 < k + 8 + 16; j19++)
diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemBucket.java ../src_work/minecraft_server/net/minecraft/src/ItemBucket.java
--- ../src_base/minecraft_server/net/minecraft/src/ItemBucket.java 2011-07-11 21:58:45.765715800 +0200
+++ ../src_work/minecraft_server/net/minecraft/src/ItemBucket.java 2011-07-15 23:15:07.301607700 +0200
@@ -6,6 +6,8 @@
import java.util.Random;
+import net.minecraft.src.forge.MinecraftForge;
+
// Referenced classes of package net.minecraft.src:
// Item, EntityPlayer, Vec3D, MathHelper,
// World, MovingObjectPosition, EnumMovingObjectType, Material,
@@ -55,6 +57,13 @@
}
if(isFull == 0)
{
+ ItemStack customBucket = MinecraftForge.fillCustomBucket(world,
+ i, j, k);
+
+ if (customBucket != null) {
+ return customBucket;
+ }
+
if(world.getBlockMaterial(i, j, k) == Material.water && world.getBlockMetadata(i, j, k) == 0)
{
world.setBlockWithNotify(i, j, k, 0);