Patches that applied with little to no functional changes.

This commit is contained in:
LexManos 2012-10-21 10:16:55 -07:00
parent 01722c6c3c
commit fd1f09a34e
52 changed files with 560 additions and 547 deletions

View File

@ -8,7 +8,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.logging.Level;
@@ -58,6 +59,9 @@
@@ -71,6 +72,9 @@
import net.minecraft.src.WorldServerMulti;
import net.minecraft.src.WorldSettings;
import net.minecraft.src.WorldType;
@ -18,76 +18,76 @@
public abstract class MinecraftServer implements Runnable, IPlayerUsage, ICommandSender
{
@@ -137,7 +141,9 @@
@@ -150,7 +154,8 @@
public final long[] tickTimeArray = new long[100];
/** Stats are [dimension][tick%100] system.nanoTime is stored. */
- public long[][] timeOfLastDimensionTick;
+ //public long[][] timeOfLastDimensionTick;
+ public Hashtable<Integer, long[]> worldTickTimes = new Hashtable<Integer, long[]>();
+ public int spawnProtectionSize = 16;
private KeyPair serverKeyPair;
/** Username of the server owner (for integrated servers) */
@@ -204,8 +210,6 @@
@@ -238,8 +243,6 @@
{
this.convertMapIfNeeded(par1Str);
this.setUserMessage("menu.loadingLevel");
- this.worldServers = new WorldServer[3];
- this.timeOfLastDimensionTick = new long[this.worldServers.length][100];
ISaveHandler var6 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
WorldInfo var8 = var6.loadWorldInfo();
WorldSettings var7;
@@ -224,46 +228,22 @@
var7.enableBonusChest();
ISaveHandler var7 = this.anvilConverterForAnvilFile.getSaveLoader(par1Str, true);
WorldInfo var9 = var7.loadWorldInfo();
WorldSettings var8;
@@ -259,46 +262,23 @@
var8.enableBonusChest();
}
- for (int var9 = 0; var9 < this.worldServers.length; ++var9)
- for (int var10 = 0; var10 < this.worldServers.length; ++var10)
- {
- byte var10 = 0;
- byte var11 = 0;
-
- if (var9 == 1)
- if (var10 == 1)
- {
- var10 = -1;
- var11 = -1;
- }
-
- if (var9 == 2)
- if (var10 == 2)
- {
- var10 = 1;
- var11 = 1;
- }
-
- if (var9 == 0)
- if (var10 == 0)
- {
- if (this.isDemo())
- {
- this.worldServers[var9] = new DemoWorldServer(this, var6, par2Str, var10, this.theProfiler);
- this.worldServers[var10] = new DemoWorldServer(this, var7, par2Str, var11, this.theProfiler);
- }
- else
- {
- this.worldServers[var9] = new WorldServer(this, var6, par2Str, var10, var7, this.theProfiler);
- this.worldServers[var10] = new WorldServer(this, var7, par2Str, var11, var8, this.theProfiler);
- }
- }
- else
- {
- this.worldServers[var9] = new WorldServerMulti(this, var6, par2Str, var10, var7, this.worldServers[0], this.theProfiler);
- this.worldServers[var10] = new WorldServerMulti(this, var7, par2Str, var11, var8, this.worldServers[0], this.theProfiler);
- }
-
- this.worldServers[var9].addWorldAccess(new WorldManager(this, this.worldServers[var9]));
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, var6, par2Str, 0, theProfiler) : new WorldServer(this, var6, par2Str, 0, var7, theProfiler));
- this.worldServers[var10].addWorldAccess(new WorldManager(this, this.worldServers[var10]));
+ WorldServer overWorld = (isDemo() ? new DemoWorldServer(this, var7, par2Str, 0, theProfiler) : new WorldServer(this, var7, par2Str, 0, var8, theProfiler));
+ for (int dim : DimensionManager.getStaticDimensionIDs())
+ {
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, var6, par2Str, dim, var7, overWorld, theProfiler));
+ WorldServer world = (dim == 0 ? overWorld : new WorldServerMulti(this, var7, par2Str, dim, var8, overWorld, theProfiler));
+ world.addWorldAccess(new WorldManager(this, world));
if (!this.isSinglePlayer())
{
- this.worldServers[var9].getWorldInfo().setGameType(this.getGameType());
- this.worldServers[var10].getWorldInfo().setGameType(this.getGameType());
+ world.getWorldInfo().setGameType(this.getGameType());
}
this.serverConfigManager.setPlayerManager(this.worldServers);
- }
-
+
+ MinecraftForge.EVENT_BUS.post(new WorldEvent.Load(world));
+ }
+
@ -95,7 +95,7 @@
this.setDifficultyForAllWorlds(this.getDifficulty());
this.initialWorldChunkLoad();
}
@@ -408,7 +388,9 @@
@@ -429,7 +409,9 @@
for (int var3 = 0; var3 < var2; ++var3)
{
WorldServer var4 = var1[var3];
@ -105,7 +105,7 @@
}
if (this.usageSnooper != null && this.usageSnooper.isSnooperRunning())
@@ -622,13 +604,13 @@
@@ -642,13 +624,13 @@
{
this.theProfiler.startSection("levels");
@ -121,10 +121,10 @@
+ {
+ WorldServer var4 = DimensionManager.getWorld(id);
this.theProfiler.startSection(var4.getWorldInfo().getWorldName());
if (this.tickCounter % 20 == 0)
@@ -659,9 +641,11 @@
}
this.theProfiler.startSection("pools");
var4.func_82732_R().clear();
@@ -673,9 +655,11 @@
this.theProfiler.endSection();
}
- this.timeOfLastDimensionTick[var1][this.tickCounter % 100] = System.nanoTime() - var2;
@ -138,13 +138,14 @@
this.theProfiler.endStartSection("connection");
this.getNetworkThread().networkTick();
this.theProfiler.endStartSection("players");
@@ -717,7 +701,12 @@
@@ -731,7 +715,13 @@
*/
public WorldServer worldServerForDimension(int par1)
{
- return par1 == -1 ? this.worldServers[1] : (par1 == 1 ? this.worldServers[2] : this.worldServers[0]);
+ WorldServer ret = DimensionManager.getWorld(par1);
+ if (ret == null) {
+ if (ret == null)
+ {
+ DimensionManager.initDimension(par1);
+ ret = DimensionManager.getWorld(par1);
+ }
@ -152,7 +153,7 @@
}
@SideOnly(Side.SERVER)
@@ -830,7 +819,7 @@
@@ -840,7 +830,7 @@
public String getServerModName()
{
@ -161,7 +162,7 @@
}
/**
@@ -1104,6 +1093,7 @@
@@ -1119,6 +1109,7 @@
if (var2 != null)
{

View File

@ -22,7 +22,7 @@
/**
* used as foreach item, if item.tab = current tab, display it on the screen
*/
@@ -279,6 +289,7 @@
@@ -291,6 +301,7 @@
lightOpacity[par1] = this.isOpaqueCube() ? 255 : 0;
canBlockGrass[par1] = !par2Material.getCanBlockGrass();
}
@ -30,7 +30,7 @@
}
/**
@@ -417,9 +428,10 @@
@@ -429,9 +440,10 @@
return this.needsRandomTick;
}
@ -42,7 +42,7 @@
}
/**
@@ -442,7 +454,7 @@
@@ -454,7 +466,7 @@
*/
public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
@ -51,7 +51,7 @@
}
@SideOnly(Side.CLIENT)
@@ -452,7 +464,7 @@
@@ -464,7 +476,7 @@
*/
public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
@ -60,7 +60,7 @@
}
@SideOnly(Side.CLIENT)
@@ -621,8 +633,7 @@
@@ -633,8 +645,7 @@
*/
public float getPlayerRelativeBlockHardness(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5)
{
@ -70,7 +70,7 @@
}
/**
@@ -640,18 +651,13 @@
@@ -652,18 +663,13 @@
{
if (!par1World.isRemote)
{
@ -93,16 +93,16 @@
}
}
}
@@ -985,7 +991,7 @@
@@ -997,7 +1003,7 @@
par2EntityPlayer.addStat(StatList.mineBlockStatArray[this.blockID], 1);
par2EntityPlayer.addExhaustion(0.025F);
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer.inventory))
- if (this.canSilkHarvest() && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
+ if (this.canSilkHarvest(par1World, par2EntityPlayer, par3, par4, par5, par6) && EnchantmentHelper.getSilkTouchModifier(par2EntityPlayer))
{
ItemStack var8 = this.createStackedBlock(par6);
@@ -1249,4 +1255,831 @@
@@ -1267,4 +1273,831 @@
canBlockGrass[0] = true;
StatList.initBreakableStats();
}
@ -732,7 +732,7 @@
+ else
+ {
+ int id = world.getBlockId(x, y, z);
+ return id == Block.fence.blockID || id == Block.netherFence.blockID || id == Block.glass.blockID;
+ return id == Block.fence.blockID || id == Block.netherFence.blockID || id == Block.glass.blockID || id == Block.field_82515_ce.blockID;
+ }
+ }
+

View File

@ -1,8 +1,8 @@
--- ../src_base/common/net/minecraft/src/BlockButton.java
+++ ../src_work/common/net/minecraft/src/BlockButton.java
@@ -1,6 +1,10 @@
package net.minecraft.src;
@@ -2,6 +2,10 @@
import java.util.List;
import java.util.Random;
+
+import net.minecraftforge.common.ForgeDirection;
@ -11,7 +11,7 @@
public class BlockButton extends Block
{
@@ -50,7 +54,11 @@
@@ -54,7 +58,11 @@
*/
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
{
@ -24,7 +24,7 @@
}
/**
@@ -58,7 +66,10 @@
@@ -62,7 +70,10 @@
*/
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
{
@ -36,7 +36,7 @@
}
/**
@@ -69,20 +80,22 @@
@@ -73,20 +84,22 @@
int var9 = par1World.getBlockMetadata(par2, par3, par4);
int var10 = var9 & 8;
var9 &= 7;
@ -64,7 +64,7 @@
{
var9 = 1;
}
@@ -99,7 +112,11 @@
@@ -103,7 +116,11 @@
*/
private int getOrientation(World par1World, int par2, int par3, int par4)
{
@ -77,7 +77,7 @@
}
/**
@@ -113,22 +130,22 @@
@@ -117,22 +134,22 @@
int var6 = par1World.getBlockMetadata(par2, par3, par4) & 7;
boolean var7 = false;

View File

@ -8,7 +8,7 @@
public class BlockDoor extends Block
{
@@ -263,7 +264,7 @@
@@ -260,7 +261,7 @@
{
if (this.blockMaterial == Material.iron)
{

View File

@ -28,56 +28,60 @@
}
/**
@@ -110,12 +113,8 @@
*/
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
@@ -112,12 +115,8 @@
{
- boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
-
- if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID)
- {
- var6 = true;
- }
+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
+ boolean var6 = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
if (par1World.func_82736_K().func_82766_b("doFireTick"))
{
@@ -144,7 +143,7 @@
- boolean var6 = par1World.getBlockId(par2, par3 - 1, par4) == Block.netherrack.blockID;
-
- if (par1World.provider instanceof WorldProviderEnd && par1World.getBlockId(par2, par3 - 1, par4) == Block.bedrock.blockID)
- {
- var6 = true;
- }
+ Block base = Block.blocksList[par1World.getBlockId(par2, par3 - 1, par4)];
+ boolean var6 = (base != null && base.isFireSource(par1World, par2, par3 - 1, par4, par1World.getBlockMetadata(par2, par3 - 1, par4), UP));
if (!this.canPlaceBlockAt(par1World, par2, par3, par4))
{
@@ -146,7 +145,7 @@
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
- else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0)
+ else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP) && var7 == 15 && par5Random.nextInt(4) == 0)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
- else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4) && var7 == 15 && par5Random.nextInt(4) == 0)
+ else if (!var6 && !this.canBlockCatchFire(par1World, par2, par3 - 1, par4, UP) && var7 == 15 && par5Random.nextInt(4) == 0)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
@@ -158,12 +157,12 @@
var9 = -50;
}
@@ -160,12 +159,12 @@
var9 = -50;
}
- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7);
+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7, WEST );
+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7, EAST );
+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7, UP );
+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7, DOWN );
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7, SOUTH);
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7, NORTH);
- this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7);
- this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7);
+ this.tryToCatchBlockOnFire(par1World, par2 + 1, par3, par4, 300 + var9, par5Random, var7, WEST );
+ this.tryToCatchBlockOnFire(par1World, par2 - 1, par3, par4, 300 + var9, par5Random, var7, EAST );
+ this.tryToCatchBlockOnFire(par1World, par2, par3 - 1, par4, 250 + var9, par5Random, var7, UP );
+ this.tryToCatchBlockOnFire(par1World, par2, par3 + 1, par4, 250 + var9, par5Random, var7, DOWN );
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 - 1, 300 + var9, par5Random, var7, SOUTH);
+ this.tryToCatchBlockOnFire(par1World, par2, par3, par4 + 1, 300 + var9, par5Random, var7, NORTH);
for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10)
{
@@ -213,7 +212,16 @@
for (int var10 = par2 - 1; var10 <= par2 + 1; ++var10)
{
@@ -219,9 +218,20 @@
return false;
}
+ @Deprecated
private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7)
{
- int var8 = this.abilityToCatchFire[par1World.getBlockId(par2, par3, par4)];
+ tryToCatchBlockOnFire(par1World, par2, par3, par4, par5, par6Random, par7, UP);
+ }
+
+ private void tryToCatchBlockOnFire(World par1World, int par2, int par3, int par4, int par5, Random par6Random, int par7, ForgeDirection face)
+ {
+ int var8 = 0;
@ -89,7 +93,7 @@
if (par6Random.nextInt(par5) < var8)
{
@@ -247,7 +255,12 @@
@@ -255,7 +265,12 @@
*/
private boolean canNeighborBurn(World par1World, int par2, int par3, int par4)
{
@ -103,7 +107,7 @@
}
/**
@@ -263,12 +276,12 @@
@@ -271,12 +286,12 @@
}
else
{
@ -122,7 +126,7 @@
return var6;
}
}
@@ -283,21 +296,24 @@
@@ -291,21 +306,24 @@
/**
* Checks the specified block coordinate to see if it can catch fire. Args: blockAccess, x, y, z
@ -152,7 +156,7 @@
}
/**
@@ -355,9 +371,9 @@
@@ -363,9 +381,9 @@
float var8;
float var9;
@ -165,7 +169,7 @@
{
for (var6 = 0; var6 < 2; ++var6)
{
@@ -368,7 +384,7 @@
@@ -376,7 +394,7 @@
}
}
@ -174,7 +178,7 @@
{
for (var6 = 0; var6 < 2; ++var6)
{
@@ -379,7 +395,7 @@
@@ -387,7 +405,7 @@
}
}
@ -183,7 +187,7 @@
{
for (var6 = 0; var6 < 2; ++var6)
{
@@ -390,7 +406,7 @@
@@ -398,7 +416,7 @@
}
}
@ -192,7 +196,7 @@
{
for (var6 = 0; var6 < 2; ++var6)
{
@@ -401,7 +417,7 @@
@@ -409,7 +427,7 @@
}
}
@ -201,7 +205,7 @@
{
for (var6 = 0; var6 < 2; ++var6)
{
@@ -423,4 +439,46 @@
@@ -431,4 +449,46 @@
}
}
}

View File

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/BlockGrass.java
+++ ../src_work/common/net/minecraft/src/BlockGrass.java
@@ -51,7 +51,7 @@
@@ -95,7 +95,7 @@
{
if (!par1World.isRemote)
{
@ -9,7 +9,7 @@
{
par1World.setBlockWithNotify(par2, par3, par4, Block.dirt.blockID);
}
@@ -64,7 +64,7 @@
@@ -108,7 +108,7 @@
int var9 = par4 + par5Random.nextInt(3) - 1;
int var10 = par1World.getBlockId(var7, var8 + 1, var9);

View File

@ -17,7 +17,7 @@
}
}
}
@@ -148,4 +143,16 @@
@@ -147,4 +142,16 @@
{
return new ItemStack(this.blockID, 1, limitToValidMetadata(par1));
}

View File

@ -36,7 +36,7 @@
{
var20 = 3.0F;
}
@@ -236,35 +241,22 @@
@@ -236,29 +241,22 @@
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
{
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
@ -70,13 +70,7 @@
- {
- if (par1World.rand.nextInt(15) <= par5)
- {
- float var10 = 0.7F;
- float var11 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F;
- float var12 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F;
- float var13 = par1World.rand.nextFloat() * var10 + (1.0F - var10) * 0.5F;
- EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var11), (double)((float)par3 + var12), (double)((float)par4 + var13), new ItemStack(var8));
- var14.delayBeforeCanPickup = 10;
- par1World.spawnEntityInWorld(var14);
- this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(var8));
- }
- }
- }

View File

@ -43,7 +43,7 @@
}
@SideOnly(Side.CLIENT)
@@ -107,4 +104,35 @@
@@ -105,4 +102,35 @@
par3List.add(new ItemStack(par1, 1, var4));
}
}

View File

@ -13,7 +13,7 @@
else
{
int var5 = par1World.getBlockId(par2, par3, par4);
- return var5 == Block.fence.blockID || var5 == Block.netherFence.blockID || var5 == Block.glass.blockID;
- return var5 == Block.fence.blockID || var5 == Block.netherFence.blockID || var5 == Block.glass.blockID || var5 == Block.field_82515_ce.blockID;
+ return (Block.blocksList[var5] != null && Block.blocksList[var5].canPlaceTorchOnTop(par1World, par2, par3, par4));
}
}

View File

@ -15,7 +15,7 @@
protected BlockTrapDoor(int par1, Material par2Material)
{
super(par1, par2Material);
@@ -188,7 +192,7 @@
@@ -193,7 +197,7 @@
--var7;
}
@ -24,7 +24,7 @@
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
this.dropBlockAsItem(par1World, par2, par3, par4, var6, 0);
@@ -248,6 +252,10 @@
@@ -260,6 +264,10 @@
*/
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5)
{
@ -35,7 +35,7 @@
if (par5 == 0)
{
return false;
@@ -278,7 +286,7 @@
@@ -290,7 +298,7 @@
--par2;
}
@ -44,7 +44,7 @@
}
}
@@ -293,6 +301,10 @@
@@ -305,6 +313,10 @@
*/
private static boolean isValidSupportBlock(int par0)
{

View File

@ -11,7 +11,7 @@
public class Chunk
{
@@ -122,7 +126,9 @@
@@ -124,7 +128,9 @@
{
for (int var8 = 0; var8 < var5; ++var8)
{
@ -22,7 +22,7 @@
if (var9 != 0)
{
@@ -141,6 +147,48 @@
@@ -143,6 +149,48 @@
}
/**
@ -71,7 +71,7 @@
* Checks whether the chunk is at the X/Z location specified
*/
public boolean isAtLocation(int par1, int par2)
@@ -204,7 +252,7 @@
@@ -206,7 +254,7 @@
{
int var5 = this.getBlockID(var2, var4 - 1, var3);
@ -80,7 +80,7 @@
{
--var4;
continue;
@@ -499,7 +547,10 @@
@@ -512,7 +560,10 @@
public int getBlockLightOpacity(int par1, int par2, int par3)
{
@ -92,7 +92,7 @@
}
/**
@@ -507,7 +558,7 @@
@@ -520,7 +571,7 @@
*/
public int getBlockID(int par1, int par2, int par3)
{
@ -101,7 +101,7 @@
{
return 0;
}
@@ -523,7 +574,7 @@
@@ -536,7 +587,7 @@
*/
public int getBlockMetadata(int par1, int par2, int par3)
{
@ -110,7 +110,7 @@
{
return 0;
}
@@ -564,6 +615,11 @@
@@ -577,6 +628,11 @@
}
else
{
@ -122,7 +122,7 @@
ExtendedBlockStorage var10 = this.storageArrays[par2 >> 4];
boolean var11 = false;
@@ -594,7 +650,7 @@
@@ -607,7 +663,7 @@
{
Block.blocksList[var8].breakBlock(this.worldObj, var12, par2, var13, var8, var9);
}
@ -131,7 +131,7 @@
{
this.worldObj.removeBlockTileEntity(var12, par2, var13);
}
@@ -614,7 +670,7 @@
@@ -627,7 +683,7 @@
}
else
{
@ -140,7 +140,7 @@
{
if (par2 >= var7)
{
@@ -638,29 +694,21 @@
@@ -651,29 +707,21 @@
Block.blocksList[par4].onBlockAdded(this.worldObj, var12, par2, var13);
}
@ -173,7 +173,7 @@
}
}
@@ -675,7 +723,7 @@
@@ -688,7 +736,7 @@
*/
public boolean setBlockMetadata(int par1, int par2, int par3, int par4)
{
@ -182,7 +182,7 @@
if (var5 == null)
{
@@ -695,7 +743,7 @@
@@ -708,7 +756,7 @@
var5.setExtBlockMetadata(par1, par2 & 15, par3, par4);
int var7 = var5.getExtBlockID(par1, par2 & 15, par3);
@ -191,7 +191,7 @@
{
TileEntity var8 = this.getChunkBlockTileEntity(par1, par2, par3);
@@ -716,7 +764,7 @@
@@ -729,7 +777,7 @@
*/
public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
{
@ -200,7 +200,7 @@
return var5 == null ? (this.canBlockSeeTheSky(par2, par3, par4) ? par1EnumSkyBlock.defaultLightValue : 0) : (par1EnumSkyBlock == EnumSkyBlock.Sky ? var5.getExtSkylightValue(par2, par3 & 15, par4) : (par1EnumSkyBlock == EnumSkyBlock.Block ? var5.getExtBlocklightValue(par2, par3 & 15, par4) : par1EnumSkyBlock.defaultLightValue));
}
@@ -726,6 +774,11 @@
@@ -739,6 +787,11 @@
*/
public void setLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4, int par5)
{
@ -212,7 +212,7 @@
ExtendedBlockStorage var6 = this.storageArrays[par3 >> 4];
if (var6 == null)
@@ -754,7 +807,7 @@
@@ -767,7 +820,7 @@
*/
public int getBlockLightValue(int par1, int par2, int par3, int par4)
{
@ -221,7 +221,7 @@
if (var5 == null)
{
@@ -807,7 +860,7 @@
@@ -820,7 +873,7 @@
{
var4 = this.entityLists.length - 1;
}
@ -230,7 +230,7 @@
par1Entity.addedToChunk = true;
par1Entity.chunkCoordX = this.xPosition;
par1Entity.chunkCoordY = var4;
@@ -857,33 +910,33 @@
@@ -870,33 +923,33 @@
ChunkPosition var4 = new ChunkPosition(par1, par2, par3);
TileEntity var5 = (TileEntity)this.chunkTileEntityMap.get(var4);
@ -275,7 +275,7 @@
}
/**
@@ -898,7 +951,7 @@
@@ -911,7 +964,7 @@
if (this.isChunkLoaded)
{
@ -284,7 +284,7 @@
}
}
@@ -913,8 +966,14 @@
@@ -926,8 +979,14 @@
par4TileEntity.yCoord = par2;
par4TileEntity.zCoord = this.zPosition * 16 + par3;
@ -301,7 +301,7 @@
par4TileEntity.validate();
this.chunkTileEntityMap.put(var5, par4TileEntity);
}
@@ -953,6 +1012,7 @@
@@ -966,6 +1025,7 @@
List var4 = var1[var3];
this.worldObj.addLoadedEntities(var4);
}
@ -309,7 +309,7 @@
}
/**
@@ -977,6 +1037,7 @@
@@ -990,6 +1050,7 @@
List var4 = var5[var3];
this.worldObj.unloadEntities(var4);
}
@ -317,7 +317,7 @@
}
/**
@@ -993,8 +1054,8 @@
@@ -1006,8 +1067,8 @@
*/
public void getEntitiesWithinAABBForEntity(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB, List par3List)
{
@ -328,18 +328,18 @@
if (var4 < 0)
{
@@ -1042,8 +1103,8 @@
@@ -1055,8 +1116,8 @@
*/
public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List)
public void getEntitiesOfTypeWithinAAAB(Class par1Class, AxisAlignedBB par2AxisAlignedBB, List par3List, IEntitySelector par4IEntitySelector)
{
- int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D);
- int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D);
+ int var4 = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D);
+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D);
- int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - 2.0D) / 16.0D);
- int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + 2.0D) / 16.0D);
+ int var5 = MathHelper.floor_double((par2AxisAlignedBB.minY - World.MAX_ENTITY_RADIUS) / 16.0D);
+ int var6 = MathHelper.floor_double((par2AxisAlignedBB.maxY + World.MAX_ENTITY_RADIUS) / 16.0D);
if (var4 < 0)
if (var5 < 0)
{
@@ -1227,6 +1288,15 @@
@@ -1240,6 +1301,15 @@
*/
public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
{
@ -355,7 +355,7 @@
int var5 = 0;
int var6;
@@ -1323,12 +1393,26 @@
@@ -1336,12 +1406,26 @@
}
this.generateHeightMap();
@ -388,7 +388,7 @@
}
}
@@ -1437,4 +1521,18 @@
@@ -1450,4 +1534,18 @@
}
}
}

View File

@ -32,7 +32,7 @@
if (var5 == null)
{
@@ -274,6 +281,11 @@
@@ -279,6 +286,11 @@
{
if (!this.currentServer.canNotSave)
{
@ -44,7 +44,7 @@
for (int var1 = 0; var1 < 100; ++var1)
{
if (!this.chunksToUnload.isEmpty())
@@ -286,6 +298,11 @@
@@ -291,6 +303,11 @@
this.chunksToUnload.remove(var2);
this.loadedChunkHashMap.remove(var2.longValue());
this.loadedChunks.remove(var3);

View File

@ -1,32 +1,29 @@
--- ../src_base/common/net/minecraft/src/CommandHandler.java
+++ ../src_work/common/net/minecraft/src/CommandHandler.java
@@ -8,6 +8,9 @@
import java.util.Map;
@@ -9,6 +9,9 @@
import java.util.Set;
import java.util.Map.Entry;
+
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.CommandEvent;
+
public class CommandHandler implements ICommandManager
{
@@ -38,7 +41,18 @@
/** Map of Strings to the ICommand objects they represent */
@@ -39,6 +42,16 @@
if (var5.canCommandSenderUseCommand(par1ICommandSender))
{
- var5.processCommand(par1ICommandSender, var3);
+ CommandEvent event = new CommandEvent(var5, par1ICommandSender, var3);
+ if (!MinecraftForge.EVENT_BUS.post(event))
+ {
+ var5.processCommand(par1ICommandSender, event.parameters);
+ }
+ else
+ if (MinecraftForge.EVENT_BUS.post(event))
+ {
+ if (event.exception != null)
+ {
+ throw event.exception;
+ }
+ return;
+ }
}
else
{
+
if (var6 > -1)
{
EntityPlayerMP[] var7 = PlayerSelector.func_82380_c(par1ICommandSender, var3[var6]);

View File

@ -1,11 +1,11 @@
--- ../src_base/common/net/minecraft/src/ContainerFurnace.java
+++ ../src_work/common/net/minecraft/src/ContainerFurnace.java
@@ -122,7 +122,7 @@
@@ -119,7 +119,7 @@
}
else if (par1 != 1 && par1 != 0)
else if (par2 != 1 && par2 != 0)
{
- if (FurnaceRecipes.smelting().getSmeltingResult(var4.getItem().shiftedIndex) != null)
+ if (FurnaceRecipes.smelting().getSmeltingResult(var4) != null)
- if (FurnaceRecipes.smelting().getSmeltingResult(var5.getItem().shiftedIndex) != null)
+ if (FurnaceRecipes.smelting().getSmeltingResult(var5) != null)
{
if (!this.mergeItemStack(var4, 0, 1, false))
if (!this.mergeItemStack(var5, 0, 1, false))
{

View File

@ -1,11 +1,11 @@
--- ../src_base/common/net/minecraft/src/CraftingManager.java
+++ ../src_work/common/net/minecraft/src/CraftingManager.java
@@ -255,7 +255,7 @@
@@ -266,7 +266,7 @@
}
}
- if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isDamageable())
+ if (var2 == 2 && var3.itemID == var4.itemID && var3.stackSize == 1 && var4.stackSize == 1 && Item.itemsList[var3.itemID].isRepairable())
- if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isDamageable())
+ if (var3 == 2 && var4.itemID == var5.itemID && var4.stackSize == 1 && var5.stackSize == 1 && Item.itemsList[var4.itemID].isRepairable())
{
Item var10 = Item.itemsList[var3.itemID];
int var12 = var10.getMaxDamage() - var3.getItemDamageForDisplay();
Item var13 = Item.itemsList[var4.itemID];
int var14 = var13.getMaxDamage() - var4.getItemDamageForDisplay();

View File

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/EnchantmentHelper.java
+++ ../src_work/common/net/minecraft/src/EnchantmentHelper.java
@@ -365,7 +365,7 @@
@@ -408,7 +408,7 @@
{
Enchantment var7 = var4[var6];

View File

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/EntityDragon.java
+++ ../src_work/common/net/minecraft/src/EntityDragon.java
@@ -505,10 +505,11 @@
@@ -519,10 +519,11 @@
for (int var12 = var4; var12 <= var7; ++var12)
{
int var13 = this.worldObj.getBlockId(var10, var11, var12);

View File

@ -35,8 +35,8 @@
++this.age;
- if (this.age >= 6000)
+ if (this.age >= lifespan)
- if (!this.worldObj.isRemote && this.age >= 6000)
+ if (!this.worldObj.isRemote && this.age >= lifespan)
+ {
+ ItemExpireEvent event = new ItemExpireEvent(this, (item.getItem() == null ? 6000 : item.getItem().getEntityLifespan(item, worldObj)));
+ if (MinecraftForge.EVENT_BUS.post(event))
@ -53,7 +53,7 @@
{
this.setDead();
}
@@ -208,6 +231,7 @@
@@ -215,6 +238,7 @@
{
par1NBTTagCompound.setShort("Health", (short)((byte)this.health));
par1NBTTagCompound.setShort("Age", (short)this.age);
@ -61,7 +61,7 @@
if (this.item != null)
{
@@ -225,10 +249,15 @@
@@ -232,10 +256,15 @@
NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("Item");
this.item = ItemStack.loadItemStackFromNBT(var2);
@ -78,7 +78,7 @@
}
/**
@@ -238,9 +267,21 @@
@@ -245,9 +274,21 @@
{
if (!this.worldObj.isRemote)
{

View File

@ -11,7 +11,7 @@
public abstract class EntityLiving extends Entity
{
@@ -319,6 +323,7 @@
@@ -336,6 +340,7 @@
public void setAttackTarget(EntityLiving par1EntityLiving)
{
this.attackTarget = par1EntityLiving;
@ -19,7 +19,7 @@
}
public boolean isExplosiveMob(Class par1Class)
@@ -375,6 +380,7 @@
@@ -419,6 +424,7 @@
{
this.entityLivingToAttack = par1EntityLiving;
this.revengeTimer = this.entityLivingToAttack != null ? 60 : 0;
@ -27,7 +27,7 @@
}
protected void entityInit()
@@ -661,6 +667,11 @@
@@ -707,6 +713,11 @@
*/
public void onUpdate()
{
@ -38,8 +38,8 @@
+
super.onUpdate();
if (this.arrowHitTempCounter > 0)
@@ -828,6 +839,11 @@
if (!this.worldObj.isRemote)
@@ -888,6 +899,11 @@
*/
public boolean attackEntityFrom(DamageSource par1DamageSource, int par2)
{
@ -51,7 +51,7 @@
if (this.worldObj.isRemote)
{
return false;
@@ -1012,6 +1028,12 @@
@@ -1092,6 +1108,12 @@
*/
protected void damageEntity(DamageSource par1DamageSource, int par2)
{
@ -64,7 +64,7 @@
par2 = this.applyArmorCalculations(par1DamageSource, par2);
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
this.health -= par2;
@@ -1075,6 +1097,11 @@
@@ -1155,6 +1177,11 @@
*/
public void onDeath(DamageSource par1DamageSource)
{
@ -76,17 +76,18 @@
Entity var2 = par1DamageSource.getEntity();
if (this.scoreValue >= 0 && var2 != null)
@@ -1098,13 +1125,17 @@
var3 = EnchantmentHelper.getLootingModifier(((EntityPlayer)var2).inventory);
@@ -1177,6 +1204,10 @@
{
var3 = EnchantmentHelper.getLootingModifier((EntityLiving)var2);
}
+
+ captureDrops = true;
+ capturedDrops.clear();
+ int var4 = 0;
+
if (!this.isChild())
if (!this.isChild() && this.worldObj.func_82736_K().func_82766_b("doMobLoot"))
{
this.dropFewItems(this.recentlyHit > 0, var3);
@@ -1185,7 +1216,7 @@
if (this.recentlyHit > 0)
{
@ -95,7 +96,7 @@
if (var4 < 5)
{
@@ -1112,6 +1143,16 @@
@@ -1193,6 +1224,16 @@
}
}
}
@ -112,7 +113,7 @@
}
this.worldObj.setEntityState(this, (byte)3);
@@ -1155,6 +1196,12 @@
@@ -1236,6 +1277,12 @@
*/
protected void fall(float par1)
{
@ -125,7 +126,7 @@
super.fall(par1);
int var2 = MathHelper.ceiling_float_int(par1 - 3.0F);
@@ -1342,7 +1389,7 @@
@@ -1423,7 +1470,7 @@
int var2 = MathHelper.floor_double(this.boundingBox.minY);
int var3 = MathHelper.floor_double(this.posZ);
int var4 = this.worldObj.getBlockId(var1, var2, var3);
@ -134,7 +135,7 @@
}
/**
@@ -1605,6 +1652,7 @@
@@ -1828,6 +1875,7 @@
}
this.isAirBorne = true;
@ -142,7 +143,7 @@
}
/**
@@ -2091,8 +2139,6 @@
@@ -2355,8 +2403,6 @@
return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
}
@ -151,9 +152,9 @@
/**
* input is the potion id to remove from the current active potion effects
*/
@@ -2180,4 +2226,30 @@
this.worldObj.spawnParticle("iconcrack_" + par1ItemStack.getItem().shiftedIndex, var4.xCoord, var4.yCoord, var4.zCoord, var3.xCoord, var3.yCoord + 0.05D, var3.zCoord);
}
@@ -2774,4 +2820,30 @@
{
return false;
}
+
+ /***

View File

@ -16,7 +16,7 @@
public class EntityMinecart extends Entity implements IInventory
{
@@ -31,6 +39,25 @@
@@ -33,6 +41,25 @@
@SideOnly(Side.CLIENT)
protected double velocityZ;
@ -42,10 +42,10 @@
public EntityMinecart(World par1World)
{
super(par1World);
@@ -40,6 +67,18 @@
this.preventEntitySpawning = true;
@@ -44,6 +71,18 @@
this.setSize(0.98F, 0.7F);
this.yOffset = this.height / 2.0F;
this.field_82344_g = par1World != null ? par1World.func_82735_a(this) : null;
+
+ maxSpeedRail = defaultMaxSpeedRail;
+ maxSpeedGround = defaultMaxSpeedGround;
@ -61,7 +61,7 @@
}
/**
@@ -65,6 +104,10 @@
@@ -69,6 +108,10 @@
*/
public AxisAlignedBB getCollisionBox(Entity par1Entity)
{
@ -72,7 +72,7 @@
return par1Entity.boundingBox;
}
@@ -73,6 +116,10 @@
@@ -77,6 +120,10 @@
*/
public AxisAlignedBB getBoundingBox()
{
@ -83,7 +83,7 @@
return null;
}
@@ -81,7 +128,7 @@
@@ -85,7 +132,7 @@
*/
public boolean canBePushed()
{
@ -92,7 +92,7 @@
}
public EntityMinecart(World par1World, double par2, double par4, double par6, int par8)
@@ -130,48 +177,7 @@
@@ -134,48 +181,7 @@
}
this.setDead();
@ -142,7 +142,7 @@
}
return true;
@@ -266,7 +272,7 @@
@@ -289,7 +295,7 @@
this.kill();
}
@ -151,7 +151,7 @@
{
this.worldObj.spawnParticle("largesmoke", this.posX, this.posY + 0.8D, this.posZ, 0.0D, 0.0D, 0.0D);
}
@@ -310,17 +316,17 @@
@@ -333,17 +339,17 @@
double var6 = 0.0078125D;
int var8 = this.worldObj.getBlockId(var1, var2, var3);
@ -172,7 +172,7 @@
var12 = !var11;
}
@@ -334,25 +340,7 @@
@@ -357,25 +363,7 @@
this.posY = (double)(var2 + 1);
}
@ -199,7 +199,7 @@
int[][] var13 = field_70500_g[var10];
double var14 = (double)(var13[1][0] - var13[0][0]);
@@ -385,7 +373,7 @@
@@ -408,7 +396,7 @@
}
}
@ -208,7 +208,7 @@
{
var24 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@@ -433,36 +421,8 @@
@@ -456,36 +444,8 @@
this.posX = var26 + var14 * var24;
this.posZ = var28 + var16 * var24;
this.setPosition(this.posX, this.posY + (double)this.yOffset, this.posZ);
@ -247,7 +247,7 @@
if (var13[0][1] != 0 && MathHelper.floor_double(this.posX) - var1 == var13[0][0] && MathHelper.floor_double(this.posZ) - var3 == var13[0][2])
{
@@ -473,42 +433,7 @@
@@ -496,42 +456,7 @@
this.setPosition(this.posX, this.posY + (double)var13[1][1], this.posZ);
}
@ -291,7 +291,7 @@
Vec3 var52 = this.func_70489_a(this.posX, this.posY, this.posZ);
@@ -538,30 +463,14 @@
@@ -561,30 +486,14 @@
double var41;
@ -330,7 +330,7 @@
{
var41 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@@ -599,41 +508,7 @@
@@ -620,41 +529,7 @@
}
else
{
@ -372,8 +372,8 @@
+ moveMinecartOffRail(var1, var2, var3);
}
this.rotationPitch = 0.0F;
@@ -659,7 +534,18 @@
this.doBlockCollisions();
@@ -681,7 +556,18 @@
}
this.setRotation(this.rotationYaw, this.rotationPitch);
@ -393,7 +393,7 @@
if (var15 != null && !var15.isEmpty())
{
@@ -684,17 +570,8 @@
@@ -706,17 +592,8 @@
this.riddenByEntity = null;
}
@ -413,7 +413,7 @@
}
}
@@ -718,12 +595,7 @@
@@ -740,12 +617,7 @@
}
else
{
@ -427,7 +427,7 @@
par3 = (double)var10;
@@ -769,13 +641,8 @@
@@ -791,13 +663,8 @@
if (BlockRail.isRailBlock(var10))
{
@ -442,7 +442,7 @@
if (var11 >= 2 && var11 <= 5)
{
@@ -840,13 +707,14 @@
@@ -862,13 +729,14 @@
{
par1NBTTagCompound.setInteger("Type", this.minecartType);
@ -461,7 +461,7 @@
{
NBTTagList var2 = new NBTTagList();
@@ -872,13 +740,21 @@
@@ -894,13 +762,21 @@
{
this.minecartType = par1NBTTagCompound.getInteger("Type");
@ -487,7 +487,7 @@
{
NBTTagList var2 = par1NBTTagCompound.getTagList("Items");
this.cargoItems = new ItemStack[this.getSizeInventory()];
@@ -907,11 +783,17 @@
@@ -929,11 +805,17 @@
*/
public void applyEntityCollision(Entity par1Entity)
{
@ -506,7 +506,7 @@
{
par1Entity.mountEntity(this);
}
@@ -957,7 +839,7 @@
@@ -979,7 +861,7 @@
double var18 = par1Entity.motionX + this.motionX;
double var20 = par1Entity.motionZ + this.motionZ;
@ -515,7 +515,7 @@
{
this.motionX *= 0.20000000298023224D;
this.motionZ *= 0.20000000298023224D;
@@ -965,7 +847,7 @@
@@ -987,7 +869,7 @@
par1Entity.motionX *= 0.949999988079071D;
par1Entity.motionZ *= 0.949999988079071D;
}
@ -524,7 +524,7 @@
{
par1Entity.motionX *= 0.20000000298023224D;
par1Entity.motionZ *= 0.20000000298023224D;
@@ -1000,7 +882,7 @@
@@ -1022,7 +904,7 @@
*/
public int getSizeInventory()
{
@ -533,7 +533,7 @@
}
/**
@@ -1103,7 +985,12 @@
@@ -1125,7 +1007,12 @@
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
@ -547,7 +547,7 @@
{
if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer)
{
@@ -1115,14 +1002,14 @@
@@ -1137,14 +1024,14 @@
par1EntityPlayer.mountEntity(this);
}
}
@ -564,7 +564,7 @@
{
ItemStack var2 = par1EntityPlayer.inventory.getCurrentItem();
@@ -1246,4 +1133,375 @@
@@ -1268,4 +1155,375 @@
{
return this.dataWatcher.getWatchableObjectInt(18);
}

View File

@ -18,7 +18,7 @@
public abstract class EntityPlayer extends EntityLiving implements ICommandSender
{
@@ -222,6 +233,7 @@
@@ -206,6 +217,7 @@
if (var1 == this.itemInUse)
{
@ -26,7 +26,7 @@
if (this.itemInUseCount <= 25 && this.itemInUseCount % 4 == 0)
{
this.updateItemUse(var1, 5);
@@ -574,12 +586,28 @@
@@ -552,6 +564,9 @@
this.setPosition(this.posX, this.posY, this.posZ);
this.motionY = 0.10000000149011612D;
@ -36,9 +36,12 @@
if (this.username.equals("Notch"))
{
this.dropPlayerItemWithRandomChoice(new ItemStack(Item.appleRed, 1), true);
}
this.inventory.dropAllItems();
@@ -560,6 +575,20 @@
if (!this.worldObj.func_82736_K().func_82766_b("keepInventory"))
{
this.inventory.dropAllItems();
+ }
+
+ captureDrops = false;
+
+ if (!worldObj.isRemote)
@ -51,11 +54,10 @@
+ joinEntityItemWithWorld(item);
+ }
+ }
+ }
}
if (par1DamageSource != null)
{
@@ -627,7 +655,16 @@
@@ -599,7 +628,16 @@
*/
public EntityItem dropOneItem()
{
@ -73,7 +75,7 @@
}
/**
@@ -636,7 +673,7 @@
@@ -608,7 +646,7 @@
*/
public EntityItem dropPlayerItem(ItemStack par1ItemStack)
{
@ -82,7 +84,7 @@
}
/**
@@ -688,18 +725,33 @@
@@ -660,18 +698,33 @@
*/
public void joinEntityItemWithWorld(EntityItem par1EntityItem)
{
@ -113,14 +115,14 @@
+ {
+ ItemStack stack = inventory.getCurrentItem();
+ float var2 = (stack == null ? 1.0F : stack.getItem().getStrVsBlock(stack, par1Block, meta));
int var3 = EnchantmentHelper.getEfficiencyModifier(this.inventory);
int var3 = EnchantmentHelper.getEfficiencyModifier(this);
- if (var3 > 0 && this.inventory.canHarvestBlock(par1Block))
+ if (var3 > 0 && ForgeHooks.canHarvestBlock(par1Block, this, meta))
{
var2 += (float)(var3 * var3 + 1);
}
@@ -724,7 +776,8 @@
@@ -696,7 +749,8 @@
var2 /= 5.0F;
}
@ -130,7 +132,7 @@
}
/**
@@ -732,7 +785,7 @@
@@ -704,7 +758,7 @@
*/
public boolean canHarvestBlock(Block par1Block)
{
@ -139,7 +141,7 @@
}
/**
@@ -992,12 +1045,23 @@
@@ -978,12 +1032,23 @@
*/
protected void damageEntity(DamageSource par1DamageSource, int par2)
{
@ -164,7 +166,7 @@
par2 = this.applyPotionDamageCalculations(par1DamageSource, par2);
this.addExhaustion(par1DamageSource.getHungerDamage());
this.health -= par2;
@@ -1032,6 +1096,10 @@
@@ -1020,6 +1085,10 @@
public boolean interactWith(Entity par1Entity)
{
@ -175,7 +177,7 @@
if (par1Entity.interact(this))
{
return true;
@@ -1075,7 +1143,9 @@
@@ -1063,7 +1132,9 @@
*/
public void destroyCurrentEquippedItem()
{
@ -185,7 +187,7 @@
}
/**
@@ -1104,6 +1174,15 @@
@@ -1080,6 +1151,15 @@
*/
public void attackTargetEntityWithCurrentItem(Entity par1Entity)
{
@ -201,7 +203,7 @@
if (par1Entity.canAttackWithItem())
{
int var2 = this.inventory.getDamageVsEntity(par1Entity);
@@ -1247,6 +1326,12 @@
@@ -1223,6 +1303,12 @@
*/
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
{
@ -214,7 +216,7 @@
if (!this.worldObj.isRemote)
{
if (this.isPlayerSleeping() || !this.isEntityAlive())
@@ -1286,6 +1371,11 @@
@@ -1262,6 +1348,11 @@
{
int var9 = this.worldObj.getBlockMetadata(par1, par2, par3);
int var5 = BlockBed.getDirection(var9);
@ -226,7 +228,7 @@
float var10 = 0.5F;
float var7 = 0.5F;
@@ -1356,10 +1446,12 @@
@@ -1332,10 +1423,12 @@
ChunkCoordinates var4 = this.playerLocation;
ChunkCoordinates var5 = this.playerLocation;
@ -243,7 +245,7 @@
if (var5 == null)
{
@@ -1396,7 +1488,9 @@
@@ -1372,7 +1465,9 @@
*/
private boolean isInBed()
{
@ -254,25 +256,26 @@
}
/**
@@ -1411,13 +1505,15 @@
var2.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
var2.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
@@ -1387,13 +1482,16 @@
var3.loadChunk(par1ChunkCoordinates.posX - 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
var3.loadChunk(par1ChunkCoordinates.posX + 3 >> 4, par1ChunkCoordinates.posZ + 3 >> 4);
- if (par0World.getBlockId(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) != Block.bed.blockID)
+ ChunkCoordinates c = par1ChunkCoordinates;
+ Block block = Block.blocksList[par0World.getBlockId(c.posX, c.posY, c.posZ)];
+
+ if (block == null || !block.isBed(par0World, c.posX, c.posY, c.posZ, null))
{
return null;
return par2 && par0World.isAirBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ) && par0World.isAirBlock(par1ChunkCoordinates.posX, par1ChunkCoordinates.posY + 1, par1ChunkCoordinates.posZ) ? par1ChunkCoordinates : null;
}
else
{
- ChunkCoordinates var3 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0);
+ ChunkCoordinates var3 = block.getBedSpawnPosition(par0World, c.posX, c.posY, c.posZ, null);
return var3;
- ChunkCoordinates var4 = BlockBed.getNearestEmptyChunkCoordinates(par0World, par1ChunkCoordinates.posX, par1ChunkCoordinates.posY, par1ChunkCoordinates.posZ, 0);
+ ChunkCoordinates var4 = block.getBedSpawnPosition(par0World, c.posX, c.posY, c.posZ, null);
return var4;
}
}
@@ -1431,8 +1527,11 @@
@@ -1407,8 +1505,11 @@
{
if (this.playerLocation != null)
{
@ -286,7 +289,7 @@
switch (var2)
{
@@ -1725,6 +1824,7 @@
@@ -1728,6 +1829,7 @@
return 101;
}
}

View File

@ -10,7 +10,7 @@
public class EntityPlayerMP extends EntityPlayer implements ICrafting
{
@@ -85,17 +88,10 @@
@@ -80,18 +83,10 @@
par4ItemInWorldManager.thisPlayerMP = this;
this.theItemInWorldManager = par4ItemInWorldManager;
this.renderDistance = par1MinecraftServer.getConfigurationManager().getViewDistance();
@ -22,26 +22,28 @@
-
- if (!par2World.provider.hasNoSky && par2World.getWorldInfo().getGameType() != EnumGameType.ADVENTURE)
- {
- var6 += this.rand.nextInt(20) - 10;
- int var9 = Math.max(5, par1MinecraftServer.func_82357_ak() - 6);
- var6 += this.rand.nextInt(var9 * 2) - var9;
- var7 += this.rand.nextInt(var9 * 2) - var9;
- var8 = par2World.getTopSolidOrLiquidBlock(var6, var7);
- var7 += this.rand.nextInt(20) - 10;
- }
this.setLocationAndAngles((double)var6 + 0.5D, (double)var8, (double)var7 + 0.5D, 0.0F, 0.0F);
this.mcServer = par1MinecraftServer;
@@ -193,7 +189,10 @@
@@ -169,7 +164,11 @@
if (var4 != null && this.worldObj.blockExists(var4.chunkXPos << 4, 0, var4.chunkZPos << 4))
{
var6.add(this.worldObj.getChunkFromChunkCoords(var4.chunkXPos, var4.chunkZPos));
var1.add(this.worldObj.getChunkFromChunkCoords(var4.chunkXPos, var4.chunkZPos));
- var3.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var4.chunkXPos * 16, 0, var4.chunkZPos * 16, var4.chunkXPos * 16 + 16, 256, var4.chunkZPos * 16 + 16));
+ //BugFix: 16 makes it load an extra chunk, which isn't associated with a player, which makes it not unload unless a player walks near it.
+ //ToDo: Find a way to efficiently clean abandoned chunks.
+ //var3.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var4.chunkXPos * 16, 0, var4.chunkZPos * 16, var4.chunkXPos * 16 + 16, 256, var4.chunkZPos * 16 + 16));
+ var3.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var4.chunkXPos * 16, 0, var4.chunkZPos * 16, var4.chunkXPos * 16 + 15, 256, var4.chunkZPos * 16 + 15));
+
}
}
@@ -336,9 +335,28 @@
@@ -242,11 +241,29 @@
*/
public void onDeath(DamageSource par1DamageSource)
{
@ -51,22 +53,23 @@
+ }
+
this.mcServer.getConfigurationManager().sendPacketToAllPlayers(new Packet3Chat(par1DamageSource.getDeathMessage(this)));
this.mcServer.getConfigurationManager().logger.info(par1DamageSource.getDeathMessage(this));
if (!this.worldObj.func_82736_K().func_82766_b("keepInventory"))
{
+ captureDrops = true;
+ capturedDrops.clear();
+
+ captureDrops = true;
+ capturedDrops.clear();
this.inventory.dropAllItems();
+
this.inventory.dropAllItems();
+
+ captureDrops = false;
+ PlayerDropsEvent event = new PlayerDropsEvent(this, par1DamageSource, capturedDrops, recentlyHit > 0);
+ if (!MinecraftForge.EVENT_BUS.post(event))
+ {
+ for (EntityItem item : capturedDrops)
+ captureDrops = false;
+ PlayerDropsEvent event = new PlayerDropsEvent(this, par1DamageSource, capturedDrops, recentlyHit > 0);
+ if (!MinecraftForge.EVENT_BUS.post(event))
+ {
+ joinEntityItemWithWorld(item);
+ for (EntityItem item : capturedDrops)
+ {
+ joinEntityItemWithWorld(item);
+ }
+ }
+ }
}
}
/**

View File

@ -15,7 +15,7 @@
{
/**
* Holds the RGB table of the sheep colors - in OpenGL glColor3f values - used to render the sheep colored fleece.
@@ -134,27 +138,6 @@
@@ -134,28 +138,6 @@
*/
public boolean interact(EntityPlayer par1EntityPlayer)
{
@ -38,14 +38,15 @@
- }
-
- var2.damageItem(1, par1EntityPlayer);
- this.worldObj.playSoundAtEntity(this, "mob.sheep.shear", 1.0F, 1.0F);
- }
-
return super.interact(par1EntityPlayer);
}
@@ -287,4 +270,23 @@
this.setGrowingAge(var1);
}
@@ -301,4 +283,24 @@
{
this.setFleeceColor(getRandomFleeceColor(this.worldObj.rand));
}
+
+ @Override
@ -64,6 +65,7 @@
+ {
+ ret.add(new ItemStack(Block.cloth.blockID, 1, getFleeceColor()));
+ }
+ this.worldObj.playSoundAtEntity(this, "mob.sheep.shear", 1.0F, 1.0F);
+ return ret;
+ }
}

View File

@ -1,11 +1,11 @@
--- ../src_base/common/net/minecraft/src/Explosion.java
+++ ../src_work/common/net/minecraft/src/Explosion.java
@@ -76,7 +76,7 @@
@@ -78,7 +78,7 @@
if (var25 > 0)
{
- var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder) + 0.3F) * var21;
+ var14 -= (Block.blocksList[var25].getExplosionResistance(this.exploder, worldObj, var22, var23, var24, explosionX, explosionY, explosionZ) + 0.3F) * var21;
Block var26 = Block.blocksList[var25];
- float var27 = this.exploder != null ? this.exploder.func_82146_a(this, var26, var22, var23, var24) : var26.getExplosionResistance(this.exploder);
+ float var27 = this.exploder != null ? this.exploder.func_82146_a(this, var26, var22, var23, var24) : var26.getExplosionResistance(this.exploder, worldObj, var22, var23, var24, explosionX, explosionY, explosionZ);
var14 -= (var27 + 0.3F) * var21;
}
if (var14 > 0.0F)

View File

@ -15,7 +15,7 @@
/**
* Used to call methods addSmelting and getSmeltingResult.
@@ -50,7 +52,9 @@
@@ -51,7 +53,9 @@
/**
* Returns the smelting result of an item.
@ -25,7 +25,7 @@
public ItemStack getSmeltingResult(int par1)
{
return (ItemStack)this.smeltingList.get(Integer.valueOf(par1));
@@ -65,4 +69,34 @@
@@ -66,4 +70,34 @@
{
return this.experienceList.containsKey(Integer.valueOf(par1)) ? ((Float)this.experienceList.get(Integer.valueOf(par1))).floatValue() : 0.0F;
}

View File

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/Item.java
+++ ../src_work/common/net/minecraft/src/Item.java
@@ -196,16 +196,24 @@
@@ -208,16 +208,24 @@
/** full name of item from language file */
private String itemName;
@ -26,7 +26,7 @@
}
/**
@@ -593,6 +601,10 @@
@@ -603,6 +611,10 @@
float var18 = var15 * var16;
float var20 = var14 * var16;
double var21 = 5.0D;
@ -37,7 +37,7 @@
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
}
@@ -654,4 +666,240 @@
@@ -674,4 +686,240 @@
{
StatList.initStats();
}

View File

@ -32,7 +32,7 @@
-
+ if (placeBlockAt(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10))
+ {
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getStepSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.func_82593_b(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
--par1ItemStack.stackSize;
}
@@ -118,7 +114,8 @@

View File

@ -20,7 +20,7 @@
@@ -134,6 +144,13 @@
{
if (!this.gameType.isAdventure())
if (!this.gameType.func_82752_c() || this.thisPlayerMP.func_82246_f(par1, par2, par3))
{
+ PlayerInteractEvent event = ForgeEventFactory.onPlayerInteract(thisPlayerMP, Action.LEFT_CLICK_BLOCK, par1, par2, par3, par4);
+ if (event.isCanceled())
@ -125,15 +125,15 @@
if (var6 && var8)
{
Block.blocksList[var4].harvestBlock(this.theWorld, this.thisPlayerMP, par1, par2, par3, var5);
@@ -306,6 +353,7 @@
@@ -310,6 +357,7 @@
if (var6.stackSize == 0)
{
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = null;
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thisPlayerMP, var6));
}
return true;
@@ -318,29 +366,56 @@
if (!par1EntityPlayer.isUsingItem())
@@ -327,29 +375,56 @@
*/
public boolean activateBlockOrUseItem(EntityPlayer par1EntityPlayer, World par2World, ItemStack par3ItemStack, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
@ -212,7 +212,7 @@
}
/**
@@ -350,4 +425,13 @@
@@ -359,4 +434,13 @@
{
this.theWorld = par1WorldServer;
}

View File

@ -1,20 +1,20 @@
--- ../src_base/common/net/minecraft/src/ItemMap.java
+++ ../src_work/common/net/minecraft/src/ItemMap.java
@@ -88,7 +88,7 @@
byte var23 = 0;
byte var24 = 0;
byte var25 = 0;
- int[] var26 = new int[256];
+ int[] var26 = new int[Block.blocksList.length];
Chunk var27 = par1World.getChunkFromBlockCoords(var21, var22);
@@ -87,7 +87,7 @@
boolean var21 = var19 * var19 + var20 * var20 > (var11 - 2) * (var11 - 2);
int var22 = (var7 / var6 + var13 - var4 / 2) * var6;
int var23 = (var8 / var6 + var18 - var5 / 2) * var6;
- int[] var24 = new int[256];
+ int[] var24 = new int[Block.blocksList.length];
Chunk var25 = par1World.getChunkFromBlockCoords(var22, var23);
if (!var27.isEmpty())
@@ -187,7 +187,7 @@
var33 = 0;
var34 = 0;
if (!var25.isEmpty())
@@ -183,7 +183,7 @@
var31 = 0;
var32 = 0;
- for (var35 = 0; var35 < 256; ++var35)
+ for (var35 = 0; var35 < Block.blocksList.length; ++var35)
- for (var33 = 0; var33 < 256; ++var33)
+ for (var33 = 0; var33 < Block.blocksList.length; ++var33)
{
if (var26[var35] > var33)
if (var24[var33] > var31)
{

View File

@ -7,9 +7,9 @@
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
@@ -99,4 +100,15 @@
@@ -104,4 +105,15 @@
{
return this.toolMaterial.toString();
return this.toolMaterial.func_82844_f() == par2ItemStack.itemID ? true : super.func_82789_a(par1ItemStack, par2ItemStack);
}
+
+ /** FORGE: Overridden to allow custom tool effectiveness */

View File

@ -8,25 +8,26 @@
public class PotionEffect
{
@@ -10,12 +13,17 @@
@@ -13,6 +16,9 @@
private boolean field_82723_d;
private boolean field_82724_e;
/** The amplifier of the potion effect */
private int amplifier;
+
+ /** List of ItemStack that can cure the potion effect **/
+ private List<ItemStack> curativeItems;
public PotionEffect(int par1, int par2, int par3)
+
public PotionEffect(int par1, int par2)
{
this.potionID = par1;
this(par1, par2, 0);
@@ -29,6 +35,8 @@
this.duration = par2;
this.amplifier = par3;
this.field_82724_e = par4;
+ this.curativeItems = new ArrayList<ItemStack>();
+ this.curativeItems.add(new ItemStack(Item.bucketMilk));
}
public PotionEffect(PotionEffect par1PotionEffect)
@@ -23,6 +31,7 @@
@@ -36,6 +44,7 @@
this.potionID = par1PotionEffect.potionID;
this.duration = par1PotionEffect.duration;
this.amplifier = par1PotionEffect.amplifier;
@ -34,7 +35,7 @@
}
/**
@@ -63,6 +72,63 @@
@@ -80,6 +89,63 @@
public int getAmplifier()
{
return this.amplifier;
@ -97,4 +98,4 @@
+ }
}
public boolean onUpdate(EntityLiving par1EntityLiving)
public void func_82721_a(boolean par1)

View File

@ -9,21 +9,21 @@
import cpw.mods.fml.common.registry.GameRegistry;
@@ -122,9 +126,15 @@
@@ -119,9 +123,15 @@
if (var3.getItem().hasContainerItem())
if (var4.getItem().hasContainerItem())
{
- ItemStack var4 = new ItemStack(var3.getItem().getContainerItem());
+ ItemStack var4 = var3.getItem().getContainerItemStack(var3);
- ItemStack var5 = new ItemStack(var4.getItem().getContainerItem());
+ ItemStack var5 = var4.getItem().getContainerItemStack(var4);
+
+ if (var4.isItemStackDamageable() && var4.getItemDamage() > var4.getMaxDamage())
+ if (var5.isItemStackDamageable() && var5.getItemDamage() > var5.getMaxDamage())
+ {
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, var4));
+ MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(thePlayer, var5));
+ var4 = null;
+ }
- if (!var3.getItem().doesContainerItemLeaveCraftingGrid(var3) || !this.thePlayer.inventory.addItemStackToInventory(var4))
+ if (var4 != null && (!var3.getItem().doesContainerItemLeaveCraftingGrid(var3) || !this.thePlayer.inventory.addItemStackToInventory(var4)))
- if (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5))
+ if (var5 != null && (!var4.getItem().doesContainerItemLeaveCraftingGrid(var4) || !this.thePlayer.inventory.addItemStackToInventory(var5)))
{
if (this.craftMatrix.getStackInSlot(var2) == null)
if (this.craftMatrix.getStackInSlot(var3) == null)
{

View File

@ -16,15 +16,15 @@
public final class SpawnerAnimals
{
@@ -79,6 +84,9 @@
if ((!var34.getPeacefulCreature() || par2) && (var34.getPeacefulCreature() || par1) && par0WorldServer.countEntities(var34.getCreatureClass()) <= var34.getMaxNumberOfCreature() * eligibleChunksForSpawning.size() / 256)
if ((!var35.getPeacefulCreature() || par2) && (var35.getPeacefulCreature() || par1) && (!var35.func_82705_e() || par3) && par0WorldServer.countEntities(var35.getCreatureClass()) <= var35.getMaxNumberOfCreature() * eligibleChunksForSpawning.size() / 256)
{
Iterator var35 = eligibleChunksForSpawning.keySet().iterator();
Iterator var37 = eligibleChunksForSpawning.keySet().iterator();
+ ArrayList<ChunkCoordIntPair> tmp = new ArrayList(eligibleChunksForSpawning.keySet());
+ Collections.shuffle(tmp);
+ var35 = tmp.iterator();
label108:
+ var37 = tmp.iterator();
label110:
while (var35.hasNext())
while (var37.hasNext())
@@ -207,7 +215,8 @@
else
{
@ -45,7 +45,7 @@
+ {
+ return;
+ }
+
if (par0EntityLiving instanceof EntitySpider && par1World.rand.nextInt(100) == 0)
{
EntitySkeleton var7 = new EntitySkeleton(par1World);
+
par0EntityLiving.func_82163_bD();
}

View File

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/StatList.java
+++ ../src_work/common/net/minecraft/src/StatList.java
@@ -168,9 +168,9 @@
@@ -172,9 +172,9 @@
*/
private static StatBase[] initMinableStats(String par0Str, int par1)
{

View File

@ -8,7 +8,7 @@
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
@@ -185,7 +187,7 @@
@@ -187,7 +189,7 @@
public static WorldProvider getProviderForDimension(int par0)
{
@ -17,7 +17,7 @@
}
@SideOnly(Side.CLIENT)
@@ -254,4 +256,238 @@
@@ -256,4 +258,238 @@
* Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
*/
public abstract String getDimensionName();

View File

@ -21,7 +21,7 @@
public class WorldServer extends World
{
@@ -50,6 +57,9 @@
@@ -44,6 +51,9 @@
/** An IntHashMap of entity IDs (integers) to their Entity objects. */
private IntHashMap entityIdMap;
@ -31,7 +31,7 @@
public WorldServer(MinecraftServer par1MinecraftServer, ISaveHandler par2ISaveHandler, String par3Str, int par4, WorldSettings par5WorldSettings, Profiler par6Profiler)
{
super(par2ISaveHandler, par3Str, par5WorldSettings, WorldProvider.getProviderForDimension(par4), par6Profiler);
@@ -71,6 +81,7 @@
@@ -65,6 +75,7 @@
{
this.pendingTickListEntries = new TreeSet();
}
@ -94,26 +94,26 @@
{
this.updateLCG = this.updateLCG * 3 + 1013904223;
var8 = this.updateLCG >> 2;
@@ -362,7 +380,8 @@
public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5)
@@ -367,7 +385,8 @@
public void func_82740_a(int par1, int par2, int par3, int par4, int par5, int par6)
{
NextTickListEntry var6 = new NextTickListEntry(par1, par2, par3, par4);
- byte var7 = 8;
+ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(var6.xCoord >> 4, var6.zCoord >> 4));
+ byte var7 = isForced ? (byte)0 : 8;
NextTickListEntry var7 = new NextTickListEntry(par1, par2, par3, par4);
- byte var8 = 8;
+ boolean isForced = getPersistentChunks().containsKey(new ChunkCoordIntPair(var7.xCoord >> 4, var7.zCoord >> 4));
+ byte var8 = isForced ? (byte)0 : 8;
if (this.scheduledUpdatesAreImmediate)
if (this.scheduledUpdatesAreImmediate && par4 > 0)
{
@@ -418,7 +437,7 @@
@@ -429,7 +448,7 @@
*/
public void updateEntities()
{
- if (this.playerEntities.isEmpty())
+ if (this.playerEntities.isEmpty() && getPersistentChunks().isEmpty())
{
if (this.updateEntityTick++ >= 60)
if (this.updateEntityTick++ >= 1200)
{
@@ -462,7 +481,8 @@
@@ -478,7 +497,8 @@
this.pendingTickListEntries.remove(var4);
this.field_73064_N.remove(var4);
@ -123,7 +123,7 @@
if (this.checkChunksExist(var4.xCoord - var5, var4.yCoord - var5, var4.zCoord - var5, var4.xCoord + var5, var4.yCoord + var5, var4.zCoord + var5))
{
@@ -559,15 +579,27 @@
@@ -575,15 +595,27 @@
public List getAllTileEntityInBox(int par1, int par2, int par3, int par4, int par5, int par6)
{
ArrayList var7 = new ArrayList();
@ -160,7 +160,7 @@
}
}
@@ -578,6 +610,11 @@
@@ -594,6 +626,11 @@
* Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
*/
public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
@ -172,16 +172,16 @@
{
int var5 = MathHelper.abs_int(par2 - this.worldInfo.getSpawnX());
int var6 = MathHelper.abs_int(par4 - this.worldInfo.getSpawnZ());
@@ -587,7 +624,7 @@
@@ -603,7 +640,7 @@
var6 = var5;
}
- return var6 > 16 || this.mcServer.getConfigurationManager().areCommandsAllowed(par1EntityPlayer.username) || this.mcServer.isSinglePlayer();
+ return var6 > mcServer.spawnProtectionSize || this.mcServer.getConfigurationManager().areCommandsAllowed(par1EntityPlayer.username) || this.mcServer.isSinglePlayer();
+ return var6 > mcServer.func_82357_ak() || this.mcServer.getConfigurationManager().areCommandsAllowed(par1EntityPlayer.username) || this.mcServer.isSinglePlayer();
}
protected void initialize(WorldSettings par1WorldSettings)
@@ -670,7 +707,7 @@
@@ -686,7 +723,7 @@
*/
protected void createBonusChest()
{
@ -190,7 +190,7 @@
for (int var2 = 0; var2 < 10; ++var2)
{
@@ -713,6 +750,7 @@
@@ -729,6 +766,7 @@
}
this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
@ -198,7 +198,7 @@
}
}
@@ -971,4 +1009,9 @@
@@ -965,4 +1003,9 @@
{
return this.thePlayerManager;
}

View File

@ -1,6 +1,6 @@
--- ../src_base/common/net/minecraft/src/WorldType.java
+++ ../src_work/common/net/minecraft/src/WorldType.java
@@ -201,8 +201,19 @@
@@ -217,8 +217,19 @@
{
return this == FLAT ? random.nextInt(4) != 1 : false;
}

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/client/Minecraft.java
+++ ../src_work/minecraft/net/minecraft/client/Minecraft.java
@@ -118,6 +118,9 @@
@@ -120,6 +120,9 @@
import net.minecraft.src.WorldInfo;
import net.minecraft.src.WorldRenderer;
import net.minecraft.src.WorldSettings;
@ -10,16 +10,16 @@
import org.lwjgl.LWJGLException;
import org.lwjgl.Sys;
@@ -1245,7 +1248,7 @@
@@ -1251,7 +1254,7 @@
if (this.thePlayer.canPlayerEdit(var3, var4, var5))
if (this.thePlayer.func_82246_f(var3, var4, var5))
{
- this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver.sideHit);
+ this.effectRenderer.addBlockHitEffects(var3, var4, var5, this.objectMouseOver);
this.thePlayer.swingItem();
}
}
@@ -1311,7 +1314,8 @@
@@ -1317,7 +1320,8 @@
{
int var8 = var3 != null ? var3.stackSize : 0;
@ -29,7 +29,7 @@
{
var2 = false;
this.thePlayer.swingItem();
@@ -1337,7 +1341,8 @@
@@ -1343,7 +1347,8 @@
{
ItemStack var9 = this.thePlayer.inventory.getCurrentItem();
@ -39,7 +39,7 @@
{
this.entityRenderer.itemRenderer.func_78445_c();
}
@@ -1917,6 +1922,18 @@
@@ -1941,6 +1946,18 @@
if (this.theIntegratedServer != null)
{
this.theIntegratedServer.initiateShutdown();
@ -58,7 +58,7 @@
}
this.theIntegratedServer = null;
@@ -2221,80 +2238,12 @@
@@ -2250,95 +2267,12 @@
if (this.objectMouseOver != null)
{
boolean var1 = this.thePlayer.capabilities.isCreativeMode;
@ -87,7 +87,7 @@
- }
-
- var4 = Item.itemsList[var2].getHasSubtypes();
- int var9 = var2 >= 256 ? var8.blockID : var2;
- int var9 = var2 < 256 && !Block.blocksList[var8.blockID].func_82505_u_() ? var2 : var8.blockID;
- var3 = Block.blocksList[var9].getDamageValue(this.theWorld, var5, var6, var7);
- }
- else
@ -101,15 +101,30 @@
- {
- var2 = Item.painting.shiftedIndex;
- }
- else if (this.objectMouseOver.entityHit instanceof EntityItemFrame)
- {
- EntityItemFrame var10 = (EntityItemFrame)this.objectMouseOver.entityHit;
-
- if (var10.func_82335_i() == null)
- {
- var2 = Item.field_82802_bI.shiftedIndex;
- }
- else
- {
- var2 = var10.func_82335_i().itemID;
- var3 = var10.func_82335_i().getItemDamage();
- var4 = true;
- }
- }
- else if (this.objectMouseOver.entityHit instanceof EntityMinecart)
- {
- EntityMinecart var10 = (EntityMinecart)this.objectMouseOver.entityHit;
- EntityMinecart var11 = (EntityMinecart)this.objectMouseOver.entityHit;
-
- if (var10.minecartType == 2)
- if (var11.minecartType == 2)
- {
- var2 = Item.minecartPowered.shiftedIndex;
- }
- else if (var10.minecartType == 1)
- else if (var11.minecartType == 1)
- {
- var2 = Item.minecartCrate.shiftedIndex;
- }

View File

@ -12,7 +12,7 @@
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
@@ -292,8 +297,15 @@
@@ -311,8 +316,15 @@
*/
private void updateFovModifierHand()
{
@ -30,7 +30,7 @@
this.fovModifierHandPrev = this.fovModifierHand;
this.fovModifierHand += (this.fovMultiplierTemp - this.fovModifierHand) * 0.5F;
}
@@ -309,7 +321,7 @@
@@ -328,7 +340,7 @@
}
else
{
@ -39,7 +39,7 @@
float var4 = 70.0F;
if (par2)
@@ -396,15 +408,7 @@
@@ -415,15 +427,7 @@
if (!this.mc.gameSettings.debugCamEnable)
{
@ -56,7 +56,7 @@
GL11.glRotatef(var2.prevRotationYaw + (var2.rotationYaw - var2.prevRotationYaw) * par1 + 180.0F, 0.0F, -1.0F, 0.0F);
GL11.glRotatef(var2.prevRotationPitch + (var2.rotationPitch - var2.prevRotationPitch) * par1, -1.0F, 0.0F, 0.0F);
}
@@ -1037,8 +1041,11 @@
@@ -1101,8 +1105,11 @@
var17 = (EntityPlayer)var4;
GL11.glDisable(GL11.GL_ALPHA_TEST);
this.mc.mcProfiler.endStartSection("outline");
@ -70,7 +70,7 @@
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
}
@@ -1102,15 +1109,18 @@
@@ -1166,15 +1173,18 @@
var17 = (EntityPlayer)var4;
GL11.glDisable(GL11.GL_ALPHA_TEST);
this.mc.mcProfiler.endStartSection("outline");
@ -92,9 +92,9 @@
GL11.glDisable(GL11.GL_BLEND);
this.mc.mcProfiler.endStartSection("weather");
this.renderRainSnow(par1);
@@ -1127,6 +1137,9 @@
this.setupFog(1, par1);
GL11.glPopMatrix();
@@ -1184,6 +1194,9 @@
{
this.func_82829_a(var5, par1);
}
+
+ this.mc.mcProfiler.endStartSection("FRenderLast");

View File

@ -1,18 +1,18 @@
--- ../src_base/minecraft/net/minecraft/src/GuiContainerCreative.java
+++ ../src_work/minecraft/net/minecraft/src/GuiContainerCreative.java
@@ -32,6 +32,8 @@
private List field_74236_u;
@@ -33,6 +33,8 @@
private Slot field_74235_v = null;
private boolean field_74234_w = false;
private CreativeCrafting field_82324_x;
+ private int tabPage = 0;
+ private int maxPages = 0;
public GuiContainerCreative(EntityPlayer par1EntityPlayer)
{
@@ -200,6 +202,14 @@
int var1 = selectedTabIndex;
selectedTabIndex = -1;
@@ -207,6 +209,14 @@
this.func_74227_b(CreativeTabs.creativeTabArray[var1]);
this.field_82324_x = new CreativeCrafting(this.mc);
this.mc.thePlayer.inventorySlots.addCraftingToCrafters(this.field_82324_x);
+ int tabCount = CreativeTabs.creativeTabArray.length;
+ if (tabCount > 12)
+ {
@ -24,16 +24,16 @@
}
else
{
@@ -311,7 +321,7 @@
@@ -322,7 +332,7 @@
{
CreativeTabs var1 = CreativeTabs.creativeTabArray[selectedTabIndex];
CreativeTabs var3 = CreativeTabs.creativeTabArray[selectedTabIndex];
- if (var1.drawInForegroundOfTab())
+ if (var1 != null && var1.drawInForegroundOfTab())
- if (var3.drawInForegroundOfTab())
+ if (var3 != null && var3.drawInForegroundOfTab())
{
this.fontRenderer.drawString(var1.getTranslatedTabLabel(), 8, 6, 4210752);
this.fontRenderer.drawString(var3.getTranslatedTabLabel(), 8, 6, 4210752);
}
@@ -333,7 +343,7 @@
@@ -344,7 +354,7 @@
{
CreativeTabs var9 = var6[var8];
@ -42,7 +42,7 @@
{
this.func_74227_b(var9);
return;
@@ -349,11 +359,17 @@
@@ -360,11 +370,17 @@
*/
private boolean needsScrollBars()
{
@ -60,7 +60,7 @@
int var2 = selectedTabIndex;
selectedTabIndex = par1CreativeTabs.getTabIndex();
ContainerCreative var3 = (ContainerCreative)this.inventorySlots;
@@ -523,21 +539,42 @@
@@ -534,21 +550,42 @@
super.drawScreen(par1, par2, par3);
CreativeTabs[] var11 = CreativeTabs.creativeTabArray;
@ -108,7 +108,7 @@
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -558,14 +595,32 @@
@@ -569,14 +606,32 @@
int var8 = var7.length;
int var9;
@ -143,7 +143,7 @@
}
}
@@ -578,6 +633,14 @@
@@ -589,6 +644,14 @@
var9 = var8 + 112;
this.mc.renderEngine.bindTexture(var4);
@ -158,7 +158,7 @@
if (var5.shouldHidePlayerInventory())
{
this.drawTexturedModalRect(var11, var8 + (int)((float)(var9 - var8 - 17) * this.currentScroll), 232 + (this.needsScrollBars() ? 0 : 12), 0, 12, 15);
@@ -593,6 +656,15 @@
@@ -604,6 +667,15 @@
protected boolean func_74232_a(CreativeTabs par1CreativeTabs, int par2, int par3)
{
@ -174,16 +174,16 @@
int var4 = par1CreativeTabs.getTabColumn();
int var5 = 28 * var4;
byte var6 = 0;
@@ -707,7 +779,7 @@
@@ -718,7 +790,7 @@
var8 += 8 + (var3 ? 1 : -1);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- ItemStack var10 = new ItemStack(par1CreativeTabs.getTabIconItem());
+ ItemStack var10 = par1CreativeTabs.getIconItemStack();
itemRenderer.renderItemIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
itemRenderer.func_82406_b(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
itemRenderer.renderItemOverlayIntoGUI(this.fontRenderer, this.mc.renderEngine, var10, var7, var8);
GL11.glDisable(GL11.GL_LIGHTING);
@@ -729,6 +801,15 @@
@@ -740,6 +812,15 @@
{
this.mc.displayGuiScreen(new GuiStats(this, this.mc.statFileWriter));
}

View File

@ -9,12 +9,12 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@@ -139,7 +141,7 @@
@@ -140,7 +142,7 @@
var47 = var7 - 39;
var22 = var47 - 10;
- var23 = this.mc.thePlayer.getTotalArmorValue();
+ var23 = ForgeHooks.getTotalArmorValue(mc.thePlayer);
int var24 = -1;
var24 = -1;
if (this.mc.thePlayer.isPotionActive(Potion.regeneration))

View File

@ -65,29 +65,34 @@
GL11.glPushMatrix();
var7 = 0.8F;
var20 = var3.getSwingProgress(par1);
@@ -332,8 +333,15 @@
@@ -332,11 +333,17 @@
var28.addVertexWithUV((double)(128 + var27), (double)(0 - var27), 0.0D, 1.0D, 0.0D);
var28.addVertexWithUV((double)(0 - var27), (double)(0 - var27), 0.0D, 0.0D, 0.0D);
var28.draw();
- MapData var16 = Item.map.getMapData(var17, this.mc.theWorld);
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
-
- if (var16 != null)
- {
- this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
+ MapData var16 = ((ItemMap)var17.getItem()).getMapData(var17, this.mc.theWorld);
+ if (custom == null)
+ {
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
+ if (var16 != null)
+ {
+ this.mapItemRenderer.renderMap(this.mc.thePlayer, this.mc.renderEngine, var16);
+ }
+ }
+ else
+ {
+ custom.renderItem(FIRST_PERSON_MAP, var17, mc.thePlayer, mc.renderEngine, var16);
+ }
}
GL11.glPopMatrix();
}
else if (var17 != null)
@@ -434,12 +442,15 @@
@@ -439,12 +446,15 @@
if (var17.getItem().requiresMultipleRenderPasses())
{
this.renderItem(var3, var17, 0);
- int var25 = Item.itemsList[var17.itemID].getColorFromDamage(var17.getItemDamage(), 1);
- int var25 = Item.itemsList[var17.itemID].func_82790_a(var17, 1);
- var13 = (float)(var25 >> 16 & 255) / 255.0F;
- var14 = (float)(var25 >> 8 & 255) / 255.0F;
- var15 = (float)(var25 & 255) / 255.0F;
@ -95,7 +100,7 @@
- this.renderItem(var3, var17, 1);
+ for (int x = 1; x < var17.getItem().getRenderPasses(var17.getItemDamage()); x++)
+ {
+ int var25 = Item.itemsList[var17.itemID].getColorFromDamage(var17.getItemDamage(), x);
+ int var25 = Item.itemsList[var17.itemID].func_82790_a(var17, x);
+ var13 = (float)(var25 >> 16 & 255) / 255.0F;
+ var14 = (float)(var25 >> 8 & 255) / 255.0F;
+ var15 = (float)(var25 & 255) / 255.0F;

View File

@ -8,7 +8,7 @@
public class ModelRenderer
{
/** The size of the texture file's width in pixels. */
@@ -117,7 +116,8 @@
@@ -120,7 +119,8 @@
this.rotationPointY = par2;
this.rotationPointZ = par3;
}
@ -18,7 +18,7 @@
public void render(float par1)
{
if (!this.isHidden)
@@ -207,6 +207,7 @@
@@ -213,6 +213,7 @@
}
}
@ -26,7 +26,7 @@
public void renderWithRotation(float par1)
{
if (!this.isHidden)
@@ -245,6 +246,7 @@
@@ -251,6 +252,7 @@
/**
* Allows the changing of Angles after a box has been rendered
*/
@ -34,7 +34,7 @@
public void postRender(float par1)
{
if (!this.isHidden)
@@ -289,6 +291,7 @@
@@ -295,6 +297,7 @@
/**
* Compiles a GL display list for this model
*/

View File

@ -12,7 +12,7 @@
import org.lwjgl.input.Keyboard;
@SideOnly(Side.CLIENT)
@@ -597,7 +602,7 @@
@@ -614,7 +619,7 @@
public void handleKickDisconnect(Packet255KickDisconnect par1Packet255KickDisconnect)
{
@ -21,7 +21,7 @@
this.disconnected = true;
this.mc.loadWorld((WorldClient)null);
this.mc.displayGuiScreen(new GuiDisconnected("disconnect.disconnected", "disconnect.genericReason", new Object[] {par1Packet255KickDisconnect.reason}));
@@ -663,7 +668,11 @@
@@ -680,7 +685,11 @@
public void handleChat(Packet3Chat par1Packet3Chat)
{
par1Packet3Chat = FMLNetworkHandler.handleChatMessage(this, par1Packet3Chat);
@ -34,23 +34,14 @@
}
public void handleAnimation(Packet18Animation par1Packet18Animation)
@@ -1018,6 +1027,19 @@
{
((TileEntityMobSpawner)var2).readFromNBT(par1Packet132TileEntityData.customParam1);
@@ -1056,6 +1065,10 @@
{
var2.readFromNBT(par1Packet132TileEntityData.customParam1);
}
+ else
+ {
+ var2.onDataPacket(netManager, par1Packet132TileEntityData);
+ }
}
+ else if (var2 != null)
+ {
+ var2.onDataPacket(netManager, par1Packet132TileEntityData);
+ }
+ else
+ {
+ /*Packet132TileEntityData pkt = par1Packet132TileEntityData;
+ ModLoader.getLogger().log(Level.WARNING, String.format(
+ "Received a TileEntityData packet for a location that did not have a TileEntity: (%d, %d, %d) %d: %d, %d, %d",
+ pkt.xPosition, pkt.yPosition, pkt.zPosition,
+ pkt.actionType,
+ pkt.customParam1, pkt.customParam2, pkt.customParam3));*/
+ }
}
}

View File

@ -10,7 +10,7 @@
@SideOnly(Side.CLIENT)
public class PlayerControllerMP
@@ -104,6 +107,11 @@
@@ -104,6 +107,12 @@
*/
public boolean onPlayerDestroyBlock(int par1, int par2, int par3, int par4)
{
@ -19,10 +19,11 @@
+ {
+ return false;
+ }
if (this.currentGameType.isAdventure())
+
if (this.currentGameType.func_82752_c() && !this.mc.thePlayer.func_82246_f(par1, par2, par3))
{
return false;
@@ -121,7 +129,7 @@
@@ -121,7 +130,7 @@
{
var5.playAuxSFX(2001, par1, par2, par3, var6.blockID + (var5.getBlockMetadata(par1, par2, par3) << 12));
int var7 = var5.getBlockMetadata(par1, par2, par3);
@ -31,7 +32,7 @@
if (var8)
{
@@ -304,6 +312,12 @@
@@ -309,6 +318,12 @@
float var11 = (float)par8Vec3.zCoord - (float)par6;
boolean var12 = false;
int var13 = par2World.getBlockId(par4, par5, par6);
@ -44,7 +45,7 @@
if (var13 > 0 && Block.blocksList[var13].onBlockActivated(par2World, par4, par5, par6, par1EntityPlayer, par7, var9, var10, var11))
{
@@ -341,7 +355,15 @@
@@ -346,7 +361,15 @@
}
else
{
@ -61,7 +62,7 @@
}
}
@@ -363,9 +385,10 @@
@@ -368,9 +391,10 @@
{
par1EntityPlayer.inventory.mainInventory[par1EntityPlayer.inventory.currentItem] = var5;

View File

@ -9,7 +9,7 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@@ -492,9 +494,8 @@
@@ -505,9 +507,8 @@
public boolean renderBlockBed(Block par1Block, int par2, int par3, int par4)
{
Tessellator var5 = Tessellator.instance;
@ -21,7 +21,7 @@
float var9 = 0.5F;
float var10 = 1.0F;
float var11 = 0.8F;
@@ -503,6 +504,7 @@
@@ -516,6 +517,7 @@
var5.setBrightness(var25);
var5.setColorOpaque_F(var9, var9, var9);
int var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 0);
@ -29,7 +29,7 @@
int var28 = (var27 & 15) << 4;
int var29 = var27 & 240;
double var30 = (double)((float)var28 / 256.0F);
@@ -521,6 +523,7 @@
@@ -534,6 +536,7 @@
var5.setBrightness(par1Block.getMixedBrightnessForBlock(this.blockAccess, par2, par3 + 1, par4));
var5.setColorOpaque_F(var10, var10, var10);
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 1);
@ -37,16 +37,16 @@
var28 = (var27 & 15) << 4;
var29 = var27 & 240;
var30 = (double)((float)var28 / 256.0F);
@@ -1965,7 +1968,7 @@
@@ -2246,7 +2249,7 @@
double var28;
double var30;
double var32;
- if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4))
+ if (!this.blockAccess.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(this.blockAccess, par2, par3 - 1, par4, UP))
{
float var36 = 0.2F;
float var19 = 0.0625F;
@@ -1985,7 +1988,7 @@
@@ -2266,7 +2269,7 @@
var9 = var20;
}
@ -55,7 +55,7 @@
{
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 1), var11, var15);
@@ -1997,7 +2000,7 @@
@@ -2278,7 +2281,7 @@
var5.addVertexWithUV((double)((float)par2 + var36), (double)((float)par3 + var17 + var19), (double)(par4 + 1), var11, var13);
}
@ -64,7 +64,7 @@
{
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
var5.addVertexWithUV((double)(par2 + 1 - 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var9, var15);
@@ -2009,7 +2012,7 @@
@@ -2290,7 +2293,7 @@
var5.addVertexWithUV((double)((float)(par2 + 1) - var36), (double)((float)par3 + var17 + var19), (double)(par4 + 0), var9, var13);
}
@ -73,7 +73,7 @@
{
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
var5.addVertexWithUV((double)(par2 + 0), (double)((float)(par3 + 0) + var19), (double)(par4 + 0), var11, var15);
@@ -2021,7 +2024,7 @@
@@ -2302,7 +2305,7 @@
var5.addVertexWithUV((double)(par2 + 0), (double)((float)par3 + var17 + var19), (double)((float)par4 + var36), var11, var13);
}
@ -82,7 +82,7 @@
{
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
var5.addVertexWithUV((double)(par2 + 1), (double)((float)(par3 + 0) + var19), (double)(par4 + 1 - 0), var9, var15);
@@ -2033,7 +2036,7 @@
@@ -2314,7 +2317,7 @@
var5.addVertexWithUV((double)(par2 + 1), (double)((float)par3 + var17 + var19), (double)((float)(par4 + 1) - var36), var9, var13);
}
@ -91,7 +91,7 @@
{
var20 = (double)par2 + 0.5D + 0.5D;
var22 = (double)par2 + 0.5D - 0.5D;
@@ -4220,7 +4223,7 @@
@@ -4502,7 +4505,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -100,7 +100,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4343,7 +4346,7 @@
@@ -4625,7 +4628,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3));
@ -109,7 +109,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4466,7 +4469,7 @@
@@ -4748,7 +4751,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -118,7 +118,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4589,7 +4592,7 @@
@@ -4871,7 +4874,7 @@
var27 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var27);
@ -127,7 +127,7 @@
{
this.colorRedTopLeft *= par5;
this.colorRedBottomLeft *= par5;
@@ -4701,7 +4704,7 @@
@@ -4983,7 +4986,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 2);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -136,7 +136,7 @@
{
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
this.renderEastFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -4717,7 +4720,7 @@
@@ -4999,7 +5002,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 3);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -145,7 +145,7 @@
{
var8.setColorOpaque_F(var18 * par5, var21 * par6, var24 * par7);
this.renderWestFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -4733,7 +4736,7 @@
@@ -5015,7 +5018,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 4);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);
@ -154,7 +154,7 @@
{
var8.setColorOpaque_F(var19 * par5, var22 * par6, var25 * par7);
this.renderNorthFace(par1Block, (double)par2, (double)par3, (double)par4, 38);
@@ -4749,7 +4752,7 @@
@@ -5031,7 +5034,7 @@
var28 = par1Block.getBlockTexture(this.blockAccess, par2, par3, par4, 5);
this.renderSouthFace(par1Block, (double)par2, (double)par3, (double)par4, var28);

View File

@ -11,7 +11,7 @@
import org.lwjgl.opengl.ARBOcclusionQuery;
import org.lwjgl.opengl.GL11;
@@ -870,6 +873,12 @@
@@ -891,6 +894,12 @@
*/
public void renderSky(float par1)
{
@ -24,7 +24,7 @@
if (this.mc.theWorld.provider.dimensionId == 1)
{
GL11.glDisable(GL11.GL_FOG);
@@ -1535,6 +1544,11 @@
@@ -1556,6 +1565,11 @@
public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityPlayer par2EntityPlayer, float par3)
{
@ -36,7 +36,7 @@
double var4 = par2EntityPlayer.lastTickPosX + (par2EntityPlayer.posX - par2EntityPlayer.lastTickPosX) * (double)par3;
double var6 = par2EntityPlayer.lastTickPosY + (par2EntityPlayer.posY - par2EntityPlayer.lastTickPosY) * (double)par3;
double var8 = par2EntityPlayer.lastTickPosZ + (par2EntityPlayer.posZ - par2EntityPlayer.lastTickPosZ) * (double)par3;
@@ -1790,6 +1804,7 @@
@@ -1811,6 +1825,7 @@
double var17 = this.mc.renderViewEntity.posY - par4;
double var19 = this.mc.renderViewEntity.posZ - par6;
EntityFX var21 = null;
@ -44,7 +44,7 @@
if (par1Str.equals("hugeexplosion"))
{
@@ -1909,6 +1924,7 @@
@@ -1943,6 +1958,7 @@
else if (par1Str.equals("snowballpoof"))
{
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.snowball);
@ -52,7 +52,7 @@
}
else if (par1Str.equals("dripWater"))
{
@@ -1925,6 +1941,7 @@
@@ -1959,6 +1975,7 @@
else if (par1Str.equals("slime"))
{
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, Item.slimeBall);
@ -60,17 +60,17 @@
}
else if (par1Str.equals("heart"))
{
@@ -1938,17 +1955,19 @@
@@ -1984,17 +2001,19 @@
{
var24 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var24]);
+ effectObject = Item.itemsList[var24];
var25 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
var21 = new EntityBreakingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Item.itemsList[var25]);
+ effectObject = Item.itemsList[var25];
}
else if (par1Str.startsWith("tilecrack_"))
{
var24 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
var21 = new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[var24], 0, 0);
+ effectObject = Block.blocksList[var24];
var25 = Integer.parseInt(par1Str.substring(par1Str.indexOf("_") + 1));
var21 = new EntityDiggingFX(this.theWorld, par2, par4, par6, par8, par10, par12, Block.blocksList[var25], 0, 0);
+ effectObject = Block.blocksList[var25];
}
}

View File

@ -9,7 +9,7 @@
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
@@ -54,18 +56,21 @@
@@ -55,13 +57,16 @@
GL11.glTranslatef((float)par2, (float)par4 + var11, (float)par6);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
@ -22,11 +22,16 @@
- if (var14 != null && RenderBlocks.renderItemIn3d(var14.getRenderType()))
+ if (ForgeHooksClient.renderEntityItem(par1EntityItem, var10, var11, var12, random, renderManager.renderEngine, renderBlocks))
+ {
+ ;
+ ;
+ }
+ else if (var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType()))
{
GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
@@ -72,9 +77,9 @@
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
}
- this.loadTexture("/terrain.png");
+ this.loadTexture(Block.blocksList[var10.itemID].getTextureFile());
float var22 = 0.25F;
@ -35,7 +40,7 @@
if (var16 == 1 || var16 == 19 || var16 == 12 || var16 == 2)
{
@@ -87,7 +92,7 @@
@@ -96,7 +101,7 @@
}
var24 = 1.0F;
@ -44,23 +49,24 @@
GL11.glPopMatrix();
}
}
@@ -99,10 +104,11 @@
if (var10.getItem().requiresMultipleRenderPasses())
{
GL11.glScalef(0.5F, 0.5F, 0.5F);
@@ -118,10 +123,11 @@
GL11.glScalef(0.5F, 0.5F, 0.5F);
}
- this.loadTexture("/gui/items.png");
-
- for (var15 = 0; var15 <= 1; ++var15)
- {
+ this.loadTexture(Item.itemsList[var10.itemID].getTextureFile());
+
+ for (var15 = 0; var15 <= var10.getItem().getRenderPasses(var10.getItemDamage()); ++var15)
{
+ {
+ this.random.setSeed(187L); //Fixes Vanilla bug where layers would not render aligns properly.
var16 = var10.getItem().getIconFromDamageForRenderPass(var10.getItemDamage(), var15);
var17 = 1.0F;
@@ -123,14 +129,7 @@
GL11.glScalef(0.5F, 0.5F, 0.5F);
@@ -152,14 +158,7 @@
var15 = var10.getIconIndex();
- if (var14 != null)
@ -75,37 +81,38 @@
if (this.field_77024_a)
{
@@ -192,9 +191,9 @@
float var12;
@@ -227,10 +226,10 @@
float var13;
float var16;
- if (par3 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType()))
- if (var6 < 256 && RenderBlocks.renderItemIn3d(Block.blocksList[var6].getRenderType()))
- {
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
+ if (Item.itemsList[par3] instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par3].getRenderType()))
+ if (par3ItemStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par3ItemStack.itemID].getRenderType()))
+ {
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Block.blocksList[par3].getTextureFile()));
Block var15 = Block.blocksList[par3];
Block var15 = Block.blocksList[var6];
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(var15.getTextureFile()));
GL11.glPushMatrix();
GL11.glTranslatef((float)(par6 - 2), (float)(par7 + 3), -3.0F + this.zLevel);
@@ -226,9 +225,9 @@
if (Item.itemsList[par3].requiresMultipleRenderPasses())
GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel);
GL11.glScalef(10.0F, 10.0F, 10.0F);
@@ -261,9 +260,9 @@
if (Item.itemsList[var6].requiresMultipleRenderPasses())
{
GL11.glDisable(GL11.GL_LIGHTING);
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
-
- for (var8 = 0; var8 <= 1; ++var8)
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[par3].getTextureFile()));
- for (var9 = 0; var9 <= 1; ++var9)
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[var6].getTextureFile()));
+
+ for (var8 = 0; var8 <= Item.itemsList[par3].getRenderPasses(par4); ++var8)
+ for (var9 = 0; var9 <= Item.itemsList[var6].getRenderPasses(var7); ++var9)
{
var9 = Item.itemsList[par3].getIconFromDamageForRenderPass(par4, var8);
int var10 = Item.itemsList[par3].getColorFromDamage(par4, var8);
@@ -250,14 +249,7 @@
var10 = Item.itemsList[var6].getIconFromDamageForRenderPass(var7, var9);
int var11 = Item.itemsList[var6].func_82790_a(par3ItemStack, var9);
@@ -285,14 +284,7 @@
{
GL11.glDisable(GL11.GL_LIGHTING);
- if (par3 < 256)
- if (var6 < 256)
- {
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/terrain.png"));
- }
@ -113,18 +120,18 @@
- {
- par2RenderEngine.bindTexture(par2RenderEngine.getTexture("/gui/items.png"));
- }
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[par3].getTextureFile()));
+ par2RenderEngine.bindTexture(par2RenderEngine.getTexture(par3ItemStack.getItem().getTextureFile()));
var8 = Item.itemsList[par3].getColorFromDamage(par4, 0);
float var14 = (float)(var8 >> 16 & 255) / 255.0F;
@@ -284,7 +276,10 @@
var9 = Item.itemsList[var6].func_82790_a(par3ItemStack, 0);
float var17 = (float)(var9 >> 16 & 255) / 255.0F;
@@ -316,7 +308,10 @@
{
if (par3ItemStack != null)
{
- this.drawItemIntoGui(par1FontRenderer, par2RenderEngine, par3ItemStack.itemID, par3ItemStack.getItemDamage(), par3ItemStack.getIconIndex(), par4, par5);
- this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5);
+ if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, field_77024_a, zLevel, (float)par4, (float)par5))
+ {
+ this.drawItemIntoGui(par1FontRenderer, par2RenderEngine, par3ItemStack.itemID, par3ItemStack.getItemDamage(), par3ItemStack.getIconIndex(), par4, par5);
+ this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5);
+ }
if (par3ItemStack != null && par3ItemStack.hasEffect())

View File

@ -1,6 +1,6 @@
--- ../src_base/minecraft/net/minecraft/src/RenderManager.java
+++ ../src_work/minecraft/net/minecraft/src/RenderManager.java
@@ -127,12 +127,14 @@
@@ -132,12 +132,14 @@
if (par4EntityLiving.isPlayerSleeping())
{

View File

@ -1,28 +1,16 @@
--- ../src_base/minecraft/net/minecraft/src/SoundManager.java
+++ ../src_work/minecraft/net/minecraft/src/SoundManager.java
@@ -4,6 +4,21 @@
import cpw.mods.fml.common.asm.SideOnly;
import java.io.File;
import java.util.Random;
+
+import net.minecraftforge.client.ForgeHooksClient;
+import net.minecraftforge.client.ModCompatibilityClient;
+import net.minecraftforge.client.event.sound.PlaySoundEffectEvent;
+import net.minecraftforge.client.event.sound.PlaySoundEffectSourceEvent;
+import net.minecraftforge.client.event.sound.PlaySoundEvent;
+import net.minecraftforge.client.event.sound.PlaySoundSourceEvent;
+import net.minecraftforge.client.event.sound.PlayStreamingEvent;
+import net.minecraftforge.client.event.sound.PlayStreamingSourceEvent;
+import net.minecraftforge.client.event.sound.SoundEvent;
+import net.minecraftforge.client.event.sound.PlayBackgroundMusicEvent;
+import net.minecraftforge.client.event.sound.SoundLoadEvent;
+import net.minecraftforge.client.event.sound.SoundSetupEvent;
@@ -1,5 +1,9 @@
package net.minecraft.src;
+import net.minecraftforge.client.*;
+import net.minecraftforge.client.event.sound.*;
+import net.minecraftforge.common.MinecraftForge;
+import static net.minecraftforge.client.event.sound.SoundEvent.*;
import paulscode.sound.SoundSystem;
import paulscode.sound.SoundSystemConfig;
import paulscode.sound.codecs.CodecJOrbis;
@@ -40,9 +55,11 @@
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
import java.io.File;
@@ -44,9 +48,11 @@
private Random rand = new Random();
private int ticksBeforeMusic;
@ -35,7 +23,7 @@
}
/**
@@ -57,6 +74,8 @@
@@ -61,6 +67,8 @@
{
this.tryToSetLibraryAndCodecs();
}
@ -44,7 +32,7 @@
}
/**
@@ -76,6 +95,8 @@
@@ -80,6 +88,8 @@
SoundSystemConfig.setCodec("ogg", CodecJOrbis.class);
SoundSystemConfig.setCodec("mus", CodecMus.class);
SoundSystemConfig.setCodec("wav", CodecWav.class);
@ -53,7 +41,7 @@
sndSystem = new SoundSystem();
this.options.soundVolume = var1;
this.options.musicVolume = var2;
@@ -164,10 +185,12 @@
@@ -168,10 +178,12 @@
}
SoundPoolEntry var1 = this.soundPoolMusic.getRandomSound();
@ -67,23 +55,23 @@
sndSystem.backgroundMusic("BgMusic", var1.soundUrl, var1.soundName, false);
sndSystem.setVolume("BgMusic", this.options.musicVolume);
sndSystem.play("BgMusic");
@@ -217,6 +240,7 @@
@@ -234,6 +246,7 @@
if (par1Str != null)
{
SoundPoolEntry var8 = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str);
+ var8 = SoundEvent.getResult(new PlayStreamingEvent(this, var8, par1Str, par2, par3, par4));
SoundPoolEntry var6 = this.soundPoolStreaming.getRandomSoundFromSoundPool(par1Str);
+ var6 = SoundEvent.getResult(new PlayStreamingEvent(this, var6, par1Str, par2, par3, par4));
if (var8 != null && par5 > 0.0F)
if (var6 != null)
{
@@ -228,6 +252,7 @@
float var9 = 16.0F;
sndSystem.newStreamingSource(true, var7, var8.soundUrl, var8.soundName, false, par2, par3, par4, 2, var9 * 4.0F);
sndSystem.setVolume(var7, 0.5F * this.options.soundVolume);
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, var7, par2, par3, par4));
sndSystem.play(var7);
@@ -245,6 +258,7 @@
float var7 = 16.0F;
sndSystem.newStreamingSource(true, var5, var6.soundUrl, var6.soundName, false, par2, par3, par4, 2, var7 * 4.0F);
sndSystem.setVolume(var5, 0.5F * this.options.soundVolume);
+ MinecraftForge.EVENT_BUS.post(new PlayStreamingSourceEvent(this, var5, par2, par3, par4));
sndSystem.play(var5);
}
}
@@ -242,6 +267,7 @@
@@ -399,6 +413,7 @@
if (loaded && this.options.soundVolume != 0.0F)
{
SoundPoolEntry var7 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
@ -91,7 +79,7 @@
if (var7 != null && par5 > 0.0F)
{
@@ -263,6 +289,7 @@
@@ -420,6 +435,7 @@
}
sndSystem.setVolume(var8, par5 * this.options.soundVolume);
@ -99,7 +87,7 @@
sndSystem.play(var8);
}
}
@@ -277,6 +304,7 @@
@@ -434,6 +450,7 @@
if (loaded && this.options.soundVolume != 0.0F)
{
SoundPoolEntry var4 = this.soundPoolSounds.getRandomSoundFromSoundPool(par1Str);
@ -107,7 +95,7 @@
if (var4 != null)
{
@@ -292,6 +320,7 @@
@@ -449,6 +466,7 @@
par2 *= 0.25F;
sndSystem.setPitch(var5, par3);
sndSystem.setVolume(var5, par2 * this.options.soundVolume);

View File

@ -22,7 +22,7 @@
}
/**
@@ -265,6 +270,12 @@
@@ -271,6 +276,12 @@
*/
protected void updateWeather()
{