diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java --- ../src_base/minecraft/net/minecraft/src/BlockRedstoneWire.java 2011-08-02 16:05:38.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/BlockRedstoneWire.java 2011-08-02 16:07:39.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.*; import java.util.*; @@ -451,6 +452,10 @@ { return false; } + if (Block.blocksList[i1] instanceof IConnectRedstone) { + IConnectRedstone icr = (IConnectRedstone) Block.blocksList[i1]; + return icr.canConnectRedstone(iblockaccess, i, j, k, l); + } if(Block.blocksList[i1].canProvidePower()) { return true; diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/Chunk.java ../src_work/minecraft/net/minecraft/src/Chunk.java --- ../src_base/minecraft/net/minecraft/src/Chunk.java 2011-08-02 16:05:38.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/Chunk.java 2011-08-02 16:07:39.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.*; import java.io.PrintStream; import java.util.*; @@ -249,6 +250,13 @@ } int l1 = xPosition * 16 + i; int i2 = zPosition * 16 + k; + + if (Block.blocksList[k1] instanceof IOverrideReplace) { + IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[k1]; + if (!iovr.canReplaceBlock(worldObj, l1, j, i2, l)) + return iovr.getReplacedSuccess(); + } + blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); if(k1 != 0 && !worldObj.multiplayerWorld) { @@ -292,6 +300,13 @@ } int k1 = xPosition * 16 + i; int l1 = zPosition * 16 + k; + + if (Block.blocksList[j1] instanceof IOverrideReplace) { + IOverrideReplace iovr = (IOverrideReplace) Block.blocksList[j1]; + if (!iovr.canReplaceBlock(worldObj, k1, j, l1, l)) + return iovr.getReplacedSuccess(); + } + blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); if(j1 != 0) { diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/EffectRenderer.java ../src_work/minecraft/net/minecraft/src/EffectRenderer.java --- ../src_base/minecraft/net/minecraft/src/EffectRenderer.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/EffectRenderer.java 2011-08-02 16:07:40.000000000 -0400 @@ -7,6 +7,9 @@ import java.util.*; import org.lwjgl.opengl.GL11; +import net.minecraft.src.forge.BlockTextureParticles; +import net.minecraft.src.forge.ITextureProvider; + // Referenced classes of package net.minecraft.src: // EntityFX, Entity, MathHelper, RenderEngine, // Tessellator, Block, EntityDiggingFX, World @@ -16,6 +19,7 @@ public EffectRenderer(World world, RenderEngine renderengine) { + effectList = new ArrayList(); fxLayers = new List[4]; rand = new Random(); if(world != null) @@ -55,6 +59,18 @@ } } + for (int x = 0; x < effectList.size(); x++) { + BlockTextureParticles entry = (BlockTextureParticles) effectList + .get(x); + for (int y = 0; y < entry.effects.size(); y++) { + EntityFX entityfx = (EntityFX) entry.effects.get(y); + if (entityfx.isDead) { + entry.effects.remove(y--); + } + } + if (effectList.size() == 0) + effectList.remove(x--); + } } @@ -93,11 +109,26 @@ for(int k = 0; k < fxLayers[i].size(); k++) { EntityFX entityfx = (EntityFX)fxLayers[i].get(k); + if(entityfx instanceof EntityDiggingFX) continue; entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4); } tessellator.draw(); } + Tessellator tessellator = Tessellator.instance; + + for (int x = 0; x < effectList.size(); x++) { + BlockTextureParticles entry = (BlockTextureParticles) effectList + .get(x); + GL11.glBindTexture(3553 /* GL_TEXTURE_2D */, + renderer.getTexture(entry.texture)); + tessellator.startDrawingQuads(); + for (int y = 0; y < entry.effects.size(); y++) { + EntityFX entityfx = (EntityFX) entry.effects.get(y); + entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4); + } + tessellator.draw(); + } } @@ -124,6 +155,13 @@ { fxLayers[i].clear(); } + + for (int x = 0; x < effectList.size(); x++) { + BlockTextureParticles entry = (BlockTextureParticles) effectList + .get(x); + entry.effects.clear(); + } + effectList.clear(); } @@ -145,7 +183,12 @@ double d1 = (double)j + ((double)l1 + 0.5D) / (double)j1; double d2 = (double)k + ((double)i2 + 0.5D) / (double)j1; int j2 = rand.nextInt(6); - addEffect((new EntityDiggingFX(worldObj, d, d1, d2, d - (double)i - 0.5D, d1 - (double)j - 0.5D, d2 - (double)k - 0.5D, block, j2, i1)).func_4041_a(i, j, k)); + EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, + d, d1, d2, d - (double) i - 0.5D, d1 - (double) j + - 0.5D, d2 - (double) k - 0.5D, block, j2, + i1); + dig_effect.func_4041_a(i, j, k); + addDigParticleEffect(dig_effect, block); } } @@ -190,16 +233,48 @@ { d = (double)i + block.maxX + (double)f; } - addEffect((new EntityDiggingFX(worldObj, d, d1, d2, 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k))).func_4041_a(i, j, k).func_407_b(0.2F).func_405_d(0.6F)); + EntityDiggingFX dig_effect = new EntityDiggingFX(worldObj, d, d1, d2, + 0.0D, 0.0D, 0.0D, block, l, worldObj.getBlockMetadata(i, j, k)); + dig_effect.func_4041_a(i, j, k); + dig_effect.func_407_b(0.2F); + dig_effect.func_405_d(0.6F); + addDigParticleEffect(dig_effect, block); } public String getStatistics() { return (new StringBuilder()).append("").append(fxLayers[0].size() + fxLayers[1].size() + fxLayers[2].size()).toString(); } + + public void addDigParticleEffect(EntityDiggingFX dig_effect, Block block) { + boolean added = false; + String comp; + + if (block instanceof ITextureProvider) { + comp = ((ITextureProvider) block).getTextureFile(); + } else { + comp = "/terrain.png"; + } + for (int x = 0; x < effectList.size(); x++) { + BlockTextureParticles entry = (BlockTextureParticles) effectList + .get(x); + if (entry.texture.equals(comp)) { + entry.effects.add(dig_effect); + added = true; + } + } + if (!added) { + BlockTextureParticles entry = new BlockTextureParticles(); + entry.texture = comp; + entry.effects.add(dig_effect); + effectList.add(entry); + } + addEffect(dig_effect); + } protected World worldObj; private List fxLayers[]; + private List effectList; private RenderEngine renderer; private Random rand; } diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/EntityPlayer.java ../src_work/minecraft/net/minecraft/src/EntityPlayer.java --- ../src_base/minecraft/net/minecraft/src/EntityPlayer.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/EntityPlayer.java 2011-08-02 16:07:41.000000000 -0400 @@ -6,6 +6,8 @@ import java.util.*; +import net.minecraft.src.forge.ISpecialArmor; + // Referenced classes of package net.minecraft.src: // EntityLiving, InventoryPlayer, ContainerPlayer, World, // ChunkCoordinates, DataWatcher, Container, StatList, @@ -477,6 +479,21 @@ protected void damageEntity(int i) { + boolean doRegularComputation = true; + for (ItemStack stack : inventory.armorInventory) { + if (stack != null && stack.getItem() instanceof ISpecialArmor) { + ISpecialArmor armor = (ISpecialArmor) stack.getItem(); + + i = armor.adjustArmorDamage(i); + doRegularComputation = doRegularComputation + && armor.allowRegularComputation(); + } + } + + if (!doRegularComputation) { + super.damageEntity(i); + } + int j = 25 - inventory.getTotalArmorValue(); int k = i * j + damageRemainder; inventory.damageArmor(i); diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/Explosion.java ../src_work/minecraft/net/minecraft/src/Explosion.java --- ../src_base/minecraft/net/minecraft/src/Explosion.java 2011-08-02 16:05:38.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/Explosion.java 2011-08-02 16:07:42.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.ISpecialResistance; import java.util.*; @@ -65,7 +66,17 @@ int i5 = worldObj.getBlockId(j4, k4, l4); if(i5 > 0) { - f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2; + if (Block.blocksList[i5] instanceof ISpecialResistance) { + ISpecialResistance isr = (ISpecialResistance) Block.blocksList[i5]; + f1 -= (isr.getSpecialExplosionResistance( + worldObj, j4, k4, l4, explosionX, + explosionY, explosionZ, exploder) + 0.3F) + * f2; + } else { + f1 -= (Block.blocksList[i5] + .getExplosionResistance(exploder) + 0.3F) + * f2; + } } if(f1 > 0.0F) { 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-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/ItemBucket.java 2011-08-02 16:07:42.000000000 -0400 @@ -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/ItemPickaxe.java ../src_work/minecraft/net/minecraft/src/ItemPickaxe.java --- ../src_base/minecraft/net/minecraft/src/ItemPickaxe.java 2011-08-02 16:05:38.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/ItemPickaxe.java 2011-08-02 16:07:42.000000000 -0400 @@ -4,6 +4,8 @@ package net.minecraft.src; +import net.minecraft.src.forge.MinecraftForge; + // Referenced classes of package net.minecraft.src: // ItemTool, Block, EnumToolMaterial, Material @@ -42,6 +44,9 @@ { return toolMaterial.getHarvestLevel() >= 2; } + if (MinecraftForge.canHarvestBlock(this, block)) { + return true; + } if(block.blockMaterial == Material.rock) { return true; 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-08-02 16:05:38.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/ItemRenderer.java 2011-08-02 16:07:42.000000000 -0400 @@ -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/ItemTool.java ../src_work/minecraft/net/minecraft/src/ItemTool.java --- ../src_base/minecraft/net/minecraft/src/ItemTool.java 2011-08-02 16:05:38.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/ItemTool.java 2011-08-02 16:07:42.000000000 -0400 @@ -4,6 +4,7 @@ package net.minecraft.src; +import java.util.Arrays; // Referenced classes of package net.minecraft.src: // Item, EnumToolMaterial, ItemStack, Block, @@ -63,4 +64,11 @@ private float efficiencyOnProperMaterial; private int damageVsEntity; protected EnumToolMaterial toolMaterial; + + public void addBlockEffectiveAgainst (Block block) { + blocksEffectiveAgainst = Arrays.copyOf(blocksEffectiveAgainst, + blocksEffectiveAgainst.length + 1); + + blocksEffectiveAgainst [blocksEffectiveAgainst.length-1] = block; + } } diff -u -r --strip-trailing-cr ../src_base/minecraft/net/minecraft/src/PlayerController.java ../src_work/minecraft/net/minecraft/src/PlayerController.java --- ../src_base/minecraft/net/minecraft/src/PlayerController.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/PlayerController.java 2011-08-02 16:07:42.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.*; import net.minecraft.client.Minecraft; @@ -98,6 +99,12 @@ public boolean sendPlaceBlock(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l) { + if (itemstack != null && itemstack.getItem() instanceof IUseItemFirst) { + IUseItemFirst iuif = (IUseItemFirst) itemstack.getItem(); + if (iuif.onItemUseFirst(itemstack, entityplayer, world, i, j, k, l)) { + return true; + } + } int i1 = world.getBlockId(i, j, k); if(i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer)) { 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-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/RenderItem.java 2011-08-02 16:07:42.000000000 -0400 @@ -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/World.java ../src_work/minecraft/net/minecraft/src/World.java --- ../src_base/minecraft/net/minecraft/src/World.java 2011-08-02 16:05:38.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/World.java 2011-08-03 01:10:53.000000000 -0400 @@ -7,6 +7,8 @@ import java.io.PrintStream; import java.util.*; +import net.minecraft.src.forge.IBlockSecondaryProperties; + // Referenced classes of package net.minecraft.src: // IBlockAccess, WorldProvider, WorldInfo, MapStorage, // ISaveHandler, ChunkProvider, EntityPlayer, ChunkProviderLoadOrGenerate, @@ -313,7 +315,25 @@ public boolean isAirBlock(int i, int j, int k) { - return getBlockId(i, j, k) == 0; + int iBlockID = getBlockId( i, j, k ); + + if ( iBlockID == 0 ) + { + return true; + } + else + { + Block block = Block.blocksList[iBlockID]; + + if ( block instanceof IBlockSecondaryProperties ) + { + return ((IBlockSecondaryProperties)block).isAirBlock( this, i, j, k ); + } + else + { + return false; + } + } } public boolean blockExists(int i, int j, int k) @@ -1608,6 +1628,18 @@ { return true; } + else + { + Block block = Block.blocksList[j2]; + + if ( block instanceof IBlockSecondaryProperties ) + { + if ( ((IBlockSecondaryProperties)block).isBlockBurning( this, k1, i1, i2 ) ) + { + return true; + } + } + } } } @@ -1900,7 +1932,14 @@ return false; } else { - return block.blockMaterial.getIsTranslucent() && block.renderAsNormalBlock(); + if ( block instanceof IBlockSecondaryProperties ) + { + return ((IBlockSecondaryProperties)block).isBlockNormalCube( this, i, j, k ); + } + else + { + return block.blockMaterial.getIsTranslucent() && block.renderAsNormalBlock(); + } } } @@ -2425,6 +2464,16 @@ { block = null; } + else + { + if ( block instanceof IBlockSecondaryProperties ) + { + if ( ((IBlockSecondaryProperties)block).isBlockReplaceable( this, j, k, l ) ) + { + block = null; + } + } + } return i > 0 && block == null && block1.canPlaceBlockOnSide(this, j, k, l, i1); } 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-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft/net/minecraft/src/WorldRenderer.java 2011-08-02 16:07:42.000000000 -0400 @@ -3,8 +3,12 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.*; import java.util.*; + +import net.minecraft.src.forge.MinecraftForgeClient; + import org.lwjgl.opengl.GL11; // Referenced classes of package net.minecraft.src: @@ -138,14 +142,27 @@ } Block block = Block.blocksList[i3]; int j3 = block.getRenderBlockPass(); + + if (block instanceof IMultipassRender) { + if (j3 != i2) { + flag = true; + } + IMultipassRender impr = (IMultipassRender) block; + if (impr.canRenderInPass(i2)) { + j3 = i2; + } + } + if(j3 != i2) { flag = true; 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_server/net/minecraft/src/BlockRedstoneWire.java ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneWire.java --- ../src_base/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 2011-08-02 16:05:40.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/BlockRedstoneWire.java 2011-08-02 16:07:43.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.*; import java.util.*; @@ -413,6 +414,10 @@ { return false; } + if(Block.blocksList[i1] instanceof IConnectRedstone) { + IConnectRedstone icr=(IConnectRedstone)Block.blocksList[i1]; + return icr.canConnectRedstone(iblockaccess,i,j,k,l); + } if(Block.blocksList[i1].canProvidePower()) { return true; diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/Chunk.java ../src_work/minecraft_server/net/minecraft/src/Chunk.java --- ../src_base/minecraft_server/net/minecraft/src/Chunk.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/Chunk.java 2011-08-02 16:07:43.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.*; import java.io.PrintStream; import java.util.*; @@ -227,6 +228,13 @@ } int l1 = xPosition * 16 + i; int i2 = zPosition * 16 + k; + + if(Block.blocksList[k1] instanceof IOverrideReplace) { + IOverrideReplace iovr=(IOverrideReplace)Block.blocksList[k1]; + if(!iovr.canReplaceBlock(worldObj,l1,j,i2,l)) + return iovr.getReplacedSuccess(); + } + blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); if(k1 != 0 && !worldObj.singleplayerWorld) { @@ -270,6 +278,13 @@ } int k1 = xPosition * 16 + i; int l1 = zPosition * 16 + k; + + if(Block.blocksList[j1] instanceof IOverrideReplace) { + IOverrideReplace iovr=(IOverrideReplace)Block.blocksList[j1]; + if(!iovr.canReplaceBlock(worldObj,k1,j,l1,l)) + return iovr.getReplacedSuccess(); + } + blocks[i << 11 | k << 7 | j] = (byte)(byte0 & 0xff); if(j1 != 0) { diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/EntityPlayer.java ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java --- ../src_base/minecraft_server/net/minecraft/src/EntityPlayer.java 2011-08-02 16:05:40.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/EntityPlayer.java 2011-08-02 16:07:43.000000000 -0400 @@ -6,6 +6,8 @@ import java.util.*; +import net.minecraft.src.forge.ISpecialArmor; + // Referenced classes of package net.minecraft.src: // EntityLiving, InventoryPlayer, ContainerPlayer, World, // ChunkCoordinates, DataWatcher, Container, StatList, @@ -457,6 +459,21 @@ protected void damageEntity(int i) { + boolean doRegularComputation = true; + for (ItemStack stack : inventory.armorInventory) { + if (stack != null && stack.getItem() instanceof ISpecialArmor) { + ISpecialArmor armor = (ISpecialArmor) stack.getItem(); + + i = armor.adjustArmorDamage(i); + doRegularComputation = doRegularComputation + && armor.allowRegularComputation(); + } + } + + if (!doRegularComputation) { + super.damageEntity(i); + } + int j = 25 - inventory.getTotalArmorValue(); int k = i * j + damageRemainder; inventory.damageArmor(i); diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/Explosion.java ../src_work/minecraft_server/net/minecraft/src/Explosion.java --- ../src_base/minecraft_server/net/minecraft/src/Explosion.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/Explosion.java 2011-08-02 16:07:43.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.ISpecialResistance; import java.util.*; @@ -65,7 +66,16 @@ int i5 = worldObj.getBlockId(j4, k4, l4); if(i5 > 0) { - f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2; + if(Block.blocksList[i5] instanceof ISpecialResistance) { + ISpecialResistance isr=(ISpecialResistance) + Block.blocksList[i5]; + f1-=(isr.getSpecialExplosionResistance( + worldObj,j4,k4,l4, + explosionX,explosionY,explosionZ, + exploder) + 0.3F) * f2; + } else { + f1 -= (Block.blocksList[i5].getExplosionResistance(exploder) + 0.3F) * f2; + } } if(f1 > 0.0F) { 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-08-02 16:05:40.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/ItemBucket.java 2011-08-02 16:07:43.000000000 -0400 @@ -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_server/net/minecraft/src/ItemInWorldManager.java ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java --- ../src_base/minecraft_server/net/minecraft/src/ItemInWorldManager.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/ItemInWorldManager.java 2011-08-02 16:07:43.000000000 -0400 @@ -3,6 +3,7 @@ // Decompiler options: packimports(3) braces deadcode package net.minecraft.src; +import net.minecraft.src.forge.*; // Referenced classes of package net.minecraft.src: @@ -145,6 +146,11 @@ public boolean activeBlockOrUseItem(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l) { + if(itemstack!=null && itemstack.getItem() instanceof IUseItemFirst) { + IUseItemFirst iuif=(IUseItemFirst)itemstack.getItem(); + if(iuif.onItemUseFirst(itemstack,entityplayer,world,i,j,k,l)) + return true; + } int i1 = world.getBlockId(i, j, k); if(i1 > 0 && Block.blocksList[i1].blockActivated(world, i, j, k, entityplayer)) { diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemPickaxe.java ../src_work/minecraft_server/net/minecraft/src/ItemPickaxe.java --- ../src_base/minecraft_server/net/minecraft/src/ItemPickaxe.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/ItemPickaxe.java 2011-08-02 16:07:43.000000000 -0400 @@ -4,6 +4,8 @@ package net.minecraft.src; +import net.minecraft.src.forge.MinecraftForge; + // Referenced classes of package net.minecraft.src: // ItemTool, Block, EnumToolMaterial, Material @@ -42,6 +44,9 @@ { return toolMaterial.getHarvestLevel() >= 2; } + if (MinecraftForge.canHarvestBlock(this, block)) { + return true; + } if(block.blockMaterial == Material.rock) { return true; diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/ItemTool.java ../src_work/minecraft_server/net/minecraft/src/ItemTool.java --- ../src_base/minecraft_server/net/minecraft/src/ItemTool.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/ItemTool.java 2011-08-02 16:07:43.000000000 -0400 @@ -4,6 +4,8 @@ package net.minecraft.src; +import java.util.Arrays; + // Referenced classes of package net.minecraft.src: // Item, EnumToolMaterial, ItemStack, Block, @@ -58,4 +60,11 @@ private float efficiencyOnProperMaterial; private int damageVsEntity; protected EnumToolMaterial toolMaterial; + + public void addBlockEffectiveAgainst (Block block) { + blocksEffectiveAgainst = Arrays.copyOf(blocksEffectiveAgainst, + blocksEffectiveAgainst.length + 1); + + blocksEffectiveAgainst [blocksEffectiveAgainst.length-1] = block; + } } diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/PlayerInstance.java ../src_work/minecraft_server/net/minecraft/src/PlayerInstance.java --- ../src_base/minecraft_server/net/minecraft/src/PlayerInstance.java 2011-08-02 16:05:40.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/PlayerInstance.java 2011-08-02 16:07:43.000000000 -0400 @@ -169,12 +169,11 @@ sendPacketToPlayersInInstance(new Packet52MultiBlockChange(chunkX, chunkZ, blocksToUpdate, numBlocksToUpdate, worldserver)); for(int k = 0; k < numBlocksToUpdate; k++) { - int j1 = chunkX * 16 + (numBlocksToUpdate >> 12 & 0xf); - int i2 = numBlocksToUpdate & 0xff; - int k2 = chunkZ * 16 + (numBlocksToUpdate >> 8 & 0xf); + int j1 = chunkX * 16 + (blocksToUpdate[k] >> 12 & 0xf); + int i2 = blocksToUpdate[k] & 0xff; + int k2 = chunkZ * 16 + (blocksToUpdate[k] >> 8 & 0xf); if(Block.isBlockContainer[worldserver.getBlockId(j1, i2, k2)]) { - System.out.println("Sending!"); updateTileEntity(worldserver.getBlockTileEntity(j1, i2, k2)); } } diff -u -r --strip-trailing-cr ../src_base/minecraft_server/net/minecraft/src/World.java ../src_work/minecraft_server/net/minecraft/src/World.java --- ../src_base/minecraft_server/net/minecraft/src/World.java 2011-08-02 16:05:39.000000000 -0400 +++ ../src_work/minecraft_server/net/minecraft/src/World.java 2011-08-03 01:10:51.000000000 -0400 @@ -7,6 +7,8 @@ import java.io.PrintStream; import java.util.*; +import net.minecraft.src.forge.IBlockSecondaryProperties; + // Referenced classes of package net.minecraft.src: // IBlockAccess, WorldProvider, MapStorage, ISaveHandler, // WorldInfo, ChunkProvider, IChunkProvider, IProgressUpdate, @@ -166,7 +168,25 @@ public boolean isAirBlock(int i, int j, int k) { - return getBlockId(i, j, k) == 0; + int iBlockID = getBlockId( i, j, k ); + + if ( iBlockID == 0 ) + { + return true; + } + else + { + Block block = Block.blocksList[iBlockID]; + + if ( block instanceof IBlockSecondaryProperties ) + { + return ((IBlockSecondaryProperties)block).isAirBlock( this, i, j, k ); + } + else + { + return false; + } + } } public boolean blockExists(int i, int j, int k) @@ -1409,6 +1429,18 @@ { return true; } + else + { + Block block = Block.blocksList[j2]; + + if ( block instanceof IBlockSecondaryProperties ) + { + if ( ((IBlockSecondaryProperties)block).isBlockBurning( this, k1, i1, i2 ) ) + { + return true; + } + } + } } } @@ -1686,7 +1718,14 @@ return false; } else { - return block.blockMaterial.getIsOpaque() && block.isACube(); + if ( block instanceof IBlockSecondaryProperties ) + { + return ((IBlockSecondaryProperties)block).isBlockNormalCube( this, i, j, k ); + } + else + { + return block.blockMaterial.getIsOpaque() && block.isACube(); + } } } @@ -2178,6 +2217,16 @@ { block = null; } + else + { + if ( block instanceof IBlockSecondaryProperties ) + { + if ( ((IBlockSecondaryProperties)block).isBlockReplaceable( this, j, k, l ) ) + { + block = null; + } + } + } return i > 0 && block == null && block1.canPlaceBlockOnSide(this, j, k, l, i1); }