Updated for MCP Mappings

This commit is contained in:
LexManos 2012-01-25 13:08:09 +00:00
parent 08195cfc03
commit c6121b5676
15 changed files with 491 additions and 491 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -14,8 +14,8 @@
{
j1--;
}
- if (!func_41052_f(world.getBlockId(j1, j, k1)))
+ if (!(func_41052_f(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
- if (!isValidSupportBlock(world.getBlockId(j1, j, k1)))
+ if (!(isValidSupportBlock(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
{
world.setBlockWithNotify(i, j, k, 0);
dropBlockAsItem(world, i, j, k, i1, 0);
@ -34,14 +34,14 @@
{
i--;
}
- return func_41052_f(world.getBlockId(i, j, k));
+ return func_41052_f(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
- return isValidSupportBlock(world.getBlockId(i, j, k));
+ return isValidSupportBlock(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
}
public static boolean isTrapdoorOpen(int i)
@@ -215,6 +222,11 @@
private static boolean func_41052_f(int i)
private static boolean isValidSupportBlock(int i)
{
+ if (disableValidation)
+ {

View file

@ -2,7 +2,7 @@
+++ ../src_work/minecraft/net/minecraft/src/Entity.java 0000-00-00 00:00:00.000000000 -0000
@@ -70,6 +70,9 @@
public int serverPosZ;
public boolean ignoreFrustumCheck;
public boolean ignoreFrustrumCheck;
public boolean isAirBorne;
+
+ //Forge: Used to store custom data for each entity.

View file

@ -28,11 +28,11 @@
{
{
{
@@ -76,16 +81,36 @@
@@ -76,16 +81,35 @@
}
}
};
- private int minecartPosRotationIncrements;
- private int turnProgress;
- private double minecartX;
- private double minecartY;
- private double minecartZ;
@ -42,7 +42,7 @@
- private double velocityY;
- private double velocityZ;
-
+ protected int minecartPosRotationIncrements;
+ protected int turnProgress;
+ protected double minecartX;
+ protected double minecartY;
+ protected double minecartZ;
@ -51,9 +51,8 @@
+ protected double velocityX;
+ protected double velocityY;
+ protected double velocityZ;
+
+ /*Forge: Minecart Compatibility Layer Integration.
+ */
+
+ /*Forge: Minecart Compatibility Layer Integration. */
+ public static float defaultMaxSpeedRail = 0.4f;
+ public static float defaultMaxSpeedGround = 0.4f;
+ public static float defaultMaxSpeedAirLateral = 0.4f;
@ -62,7 +61,7 @@
+ protected boolean canUseRail = true;
+ protected boolean canBePushed = true;
+ private static IMinecartCollisionHandler collisionHandler = null;
+
+
+ /*
+ * Instance versions of the above physics properties
+ */
@ -70,12 +69,12 @@
+ protected float maxSpeedGround;
+ protected float maxSpeedAirLateral;
+ protected float maxSpeedAirVertical;
+ protected double dragAir;
+ protected double dragAir;
+
public EntityMinecart(World world)
{
super(world);
@@ -95,6 +120,18 @@
@@ -95,6 +119,18 @@
preventEntitySpawning = true;
setSize(0.98F, 0.7F);
yOffset = height / 2.0F;
@ -94,7 +93,7 @@
}
protected boolean canTriggerWalking()
@@ -112,17 +149,27 @@
@@ -112,17 +148,27 @@
public AxisAlignedBB getCollisionBox(Entity entity)
{
@ -123,7 +122,7 @@
}
public EntityMinecart(World world, double d, double d1, double d2,
@@ -161,49 +208,8 @@
@@ -161,49 +207,8 @@
riddenByEntity.mountEntity(this);
}
setEntityDead();
@ -175,7 +174,7 @@
}
return true;
}
@@ -268,7 +274,7 @@
@@ -268,7 +273,7 @@
{
func_41024_b(func_41025_i() - 1);
}
@ -184,7 +183,7 @@
{
worldObj.spawnParticle("largesmoke", posX, posY + 0.80000000000000004D, posZ, 0.0D, 0.0D, 0.0D);
}
@@ -309,22 +315,18 @@
@@ -309,22 +314,18 @@
double d2 = 0.40000000000000002D;
double d4 = 0.0078125D;
int l = worldObj.getBlockId(i, j, k);
@ -210,7 +209,7 @@
if (i1 >= 2 && i1 <= 5)
{
posY = j + 1;
@@ -358,7 +360,7 @@
@@ -358,7 +359,7 @@
double d13 = Math.sqrt(motionX * motionX + motionZ * motionZ);
motionX = (d13 * d9) / d11;
motionZ = (d13 * d10) / d11;
@ -219,7 +218,7 @@
{
double d16 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d16 < 0.029999999999999999D)
@@ -401,30 +403,9 @@
@@ -401,30 +402,9 @@
posX = d18 + d9 * d17;
posZ = d19 + d10 * d17;
setPosition(posX, posY + (double)yOffset, posZ);
@ -253,7 +252,7 @@
if (ai[0][1] != 0 && MathHelper.floor_double(posX) - i == ai[0][0] && MathHelper.floor_double(posZ) - k == ai[0][2])
{
setPosition(posX, posY + (double)ai[0][1], posZ);
@@ -433,39 +414,9 @@
@@ -433,39 +413,9 @@
{
setPosition(posX, posY + (double)ai[1][1], posZ);
}
@ -296,7 +295,7 @@
Vec3D vec3d1 = func_514_g(posX, posY, posZ);
if (vec3d1 != null && vec3d != null)
{
@@ -486,26 +437,14 @@
@@ -486,26 +436,14 @@
motionX = d15 * (double)(k1 - i);
motionZ = d15 * (double)(l1 - k);
}
@ -329,7 +328,7 @@
{
double d31 = Math.sqrt(motionX * motionX + motionZ * motionZ);
if (d31 > 0.01D)
@@ -540,35 +479,7 @@
@@ -540,35 +478,7 @@
}
else
{
@ -366,7 +365,7 @@
}
rotationPitch = 0.0F;
double d6 = prevPosX - posX;
@@ -590,7 +501,20 @@
@@ -590,7 +500,20 @@
field_856_i = !field_856_i;
}
setRotation(rotationYaw, rotationPitch);
@ -388,7 +387,7 @@
if (list != null && list.size() > 0)
{
for (int j1 = 0; j1 < list.size(); j1++)
@@ -610,15 +534,8 @@
@@ -610,15 +533,8 @@
}
riddenByEntity = null;
}
@ -406,7 +405,7 @@
}
public Vec3D func_515_a(double d, double d1, double d2, double d3)
@@ -633,11 +550,7 @@
@@ -633,11 +549,7 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@ -419,7 +418,7 @@
d1 = j;
if (i1 >= 2 && i1 <= 5)
{
@@ -679,12 +592,8 @@
@@ -679,12 +591,8 @@
int l = worldObj.getBlockId(i, j, k);
if (BlockRail.isRailBlock(l))
{
@ -433,7 +432,7 @@
if (i1 >= 2 && i1 <= 5)
{
d1 = j + 1;
@@ -739,13 +648,13 @@
@@ -739,13 +647,13 @@
protected void writeEntityToNBT(NBTTagCompound nbttagcompound)
{
nbttagcompound.setInteger("Type", minecartType);
@ -450,7 +449,7 @@
{
NBTTagList nbttaglist = new NBTTagList();
for (int i = 0; i < cargoItems.length; i++)
@@ -766,13 +675,13 @@
@@ -766,13 +674,13 @@
protected void readEntityFromNBT(NBTTagCompound nbttagcompound)
{
minecartType = nbttagcompound.getInteger("Type");
@ -467,7 +466,7 @@
{
NBTTagList nbttaglist = nbttagcompound.getTagList("Items");
cargoItems = new ItemStack[getSizeInventory()];
@@ -795,6 +704,12 @@
@@ -795,6 +703,12 @@
public void applyEntityCollision(Entity entity)
{
@ -480,7 +479,7 @@
if (worldObj.isRemote)
{
return;
@@ -803,7 +718,7 @@
@@ -803,7 +717,7 @@
{
return;
}
@ -489,7 +488,7 @@
{
entity.mountEntity(this);
}
@@ -841,7 +756,7 @@
@@ -841,7 +755,7 @@
}
double d7 = entity.motionX + motionX;
double d8 = entity.motionZ + motionZ;
@ -498,7 +497,7 @@
{
motionX *= 0.20000000298023224D;
motionZ *= 0.20000000298023224D;
@@ -849,7 +764,7 @@
@@ -849,7 +763,7 @@
entity.motionX *= 0.94999998807907104D;
entity.motionZ *= 0.94999998807907104D;
}
@ -507,7 +506,7 @@
{
entity.motionX *= 0.20000000298023224D;
entity.motionZ *= 0.20000000298023224D;
@@ -879,7 +794,7 @@
@@ -879,7 +793,7 @@
public int getSizeInventory()
{
@ -516,7 +515,7 @@
}
public ItemStack getStackInSlot(int i)
@@ -935,7 +850,11 @@
@@ -935,7 +849,11 @@
public boolean interact(EntityPlayer entityplayer)
{
@ -529,7 +528,7 @@
{
if (riddenByEntity != null && (riddenByEntity instanceof EntityPlayer) && riddenByEntity != entityplayer)
{
@@ -946,14 +865,14 @@
@@ -946,14 +864,14 @@
entityplayer.mountEntity(this);
}
}
@ -546,7 +545,7 @@
{
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
if (itemstack != null && itemstack.itemID == Item.coal.shiftedIndex)
@@ -1000,7 +919,7 @@
@@ -1000,7 +918,7 @@
return entityplayer.getDistanceSqToEntity(this) <= 64D;
}
@ -555,7 +554,7 @@
{
return (dataWatcher.getWatchableObjectByte(16) & 1) != 0;
}
@@ -1054,4 +973,382 @@
@@ -1054,4 +972,382 @@
{
return dataWatcher.getWatchableObjectInt(18);
}

View file

@ -9,7 +9,7 @@
import java.util.Random;
@@ -157,6 +158,9 @@
private String potionModifier;
private String potionEffect;
private String itemName;
+ // FORGE: To disable repair recipes.

View file

@ -46,7 +46,7 @@
+ curBlockDamageMP += block.blockStrength(mc.theWorld, mc.thePlayer, i, j, k);
if (stepSoundTickCounter % 4F == 0.0F && block != null)
{
mc.sndManager.playSound(block.stepSound.stepSoundDir2(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
mc.sndManager.playSound(block.stepSound.getStepSound(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
@@ -207,6 +214,16 @@
{
syncCurrentPlayItem();

View file

@ -44,7 +44,7 @@
+ curBlockDamage += block.blockStrength(mc.theWorld, mc.thePlayer, i, j, k);
if (blockDestroySoundCounter % 4F == 0.0F && block != null)
{
mc.sndManager.playSound(block.stepSound.stepSoundDir2(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
mc.sndManager.playSound(block.stepSound.getStepSound(), (float)i + 0.5F, (float)j + 0.5F, (float)k + 0.5F, (block.stepSound.getVolume() + 1.0F) / 8F, block.stepSound.getPitch() * 0.5F);
@@ -165,6 +171,14 @@
public boolean onPlayerRightClick(EntityPlayer entityplayer, World world, ItemStack itemstack, int i, int j, int k, int l)

View file

@ -14,8 +14,8 @@
{
j1--;
}
- if (!func_41006_g(world.getBlockId(j1, j, k1)))
+ if (!(func_41006_g(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
- if (!isValidSupportBlock(world.getBlockId(j1, j, k1)))
+ if (!(isValidSupportBlock(world.getBlockId(j1, j, k1)) || world.isBlockSolidOnSide(j1, j, k1, (i1 & 3) + 2)))
{
world.setBlockWithNotify(i, j, k, 0);
dropBlockAsItem(world, i, j, k, i1, 0);
@ -34,8 +34,8 @@
{
i--;
}
- return func_41006_g(world.getBlockId(i, j, k));
+ return func_41006_g(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
- return isValidSupportBlock(world.getBlockId(i, j, k));
+ return isValidSupportBlock(world.getBlockId(i, j, k)) || world.isBlockSolidOnSide(i, j, k, l);
}
public static boolean isTrapdoorOpen(int i)

View file

@ -28,7 +28,7 @@
{
{
{
@@ -76,13 +81,36 @@
@@ -76,12 +81,35 @@
}
}
};
@ -36,27 +36,25 @@
- private double minecartX;
- private double minecartY;
- private double minecartZ;
- private double field_9159_ar;
- private double minecartYaw;
- private double minecartPitch;
-
+ protected int turnProgress;
+ protected double minecartX;
+ protected double minecartY;
+ protected double minecartZ;
+ protected double field_9159_ar;
+ protected double minecartYaw;
+ protected double minecartPitch;
+
+ /*Forge: Minecart Compatibility Layer Integration.
+ */
+ /*Forge: Minecart Compatibility Layer Integration. */
+ protected double velocityX;
+ protected double velocityY;
+ protected double velocityZ;
+ protected double velocityZ;
+ public static float defaultMaxSpeedRail = 0.4f;
+ public static float defaultMaxSpeedGround = 0.4f;
+ public static float defaultMaxSpeedAirLateral = 0.4f;
+ public static float defaultMaxSpeedAirVertical = -1f;
+ public static double defaultDragAir = 0.94999998807907104D;
+ protected boolean canUseRail = true;
+ protected boolean canUseRail = true;
+ protected boolean canBePushed = true;
+ private static IMinecartCollisionHandler collisionHandler = null;
+
@ -67,11 +65,11 @@
+ protected float maxSpeedGround;
+ protected float maxSpeedAirLateral;
+ protected float maxSpeedAirVertical;
+ protected double dragAir;
+
+ protected double dragAir;
+
public EntityMinecart(World world)
{
super(world);
@@ -92,6 +120,18 @@
preventEntitySpawning = true;
setSize(0.98F, 0.7F);

View file

@ -19,15 +19,18 @@
if (itemInUseCount <= 25 && itemInUseCount % 4 == 0)
{
func_35208_b(itemstack, 5);
@@ -274,6 +279,7 @@
@@ -274,6 +279,10 @@
protected void usePersonalCraftingInventory()
protected void closeScreen()
{
+ currentCraftingInventory.onCraftGuiClosed(this);
currentCraftingInventory = personalCraftingInventory;
+ if (craftingInventory != null)
+ {
+ craftingInventory.onCraftGuiClosed(this);
+ }
craftingInventory = inventorySlots;
}
@@ -433,7 +439,16 @@
@@ -433,7 +442,16 @@
public void dropCurrentItem()
{
@ -45,7 +48,7 @@
}
public void dropPlayerItem(ItemStack itemstack)
@@ -480,6 +495,8 @@
@@ -480,6 +498,8 @@
worldObj.spawnEntityInWorld(entityitem);
}
@ -54,7 +57,7 @@
public float getCurrentPlayerStrVsBlock(Block block)
{
float f = inventory.getStrVsBlock(block);
@@ -508,6 +525,45 @@
@@ -508,6 +528,45 @@
return f1;
}
@ -100,7 +103,7 @@
public boolean canHarvestBlock(Block block)
{
return inventory.canHarvestBlock(block);
@@ -707,6 +763,26 @@
@@ -707,6 +766,26 @@
protected void damageEntity(DamageSource damagesource, int i)
{
@ -127,7 +130,7 @@
if (!damagesource.isUnblockable() && isBlocking())
{
i = 1 + i >> 1;
@@ -758,7 +834,9 @@
@@ -758,7 +837,9 @@
public void destroyCurrentEquippedItem()
{
@ -137,7 +140,7 @@
}
public double getYOffset()
@@ -884,6 +962,11 @@
@@ -884,6 +965,11 @@
public EnumStatus sleepInBedAt(int i, int j, int k)
{

View file

@ -6,45 +6,45 @@
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 1, "Crafting", 9));
currentCraftingInventory = new ContainerWorkbench(inventory, worldObj, i, j, k);
currentCraftingInventory.windowId = currentWindowId;
craftingInventory = new ContainerWorkbench(inventory, worldObj, i, j, k);
craftingInventory.windowId = currentWindowId;
@@ -414,6 +415,7 @@
public void displayGUIEnchantment(int i, int j, int k)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 4, "Enchanting", 9));
currentCraftingInventory = new ContainerEnchantment(inventory, worldObj, i, j, k);
currentCraftingInventory.windowId = currentWindowId;
craftingInventory = new ContainerEnchantment(inventory, worldObj, i, j, k);
craftingInventory.windowId = currentWindowId;
@@ -423,6 +425,7 @@
public void displayGUIChest(IInventory iinventory)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 0, iinventory.getInvName(), iinventory.getSizeInventory()));
currentCraftingInventory = new ContainerChest(inventory, iinventory);
currentCraftingInventory.windowId = currentWindowId;
craftingInventory = new ContainerChest(inventory, iinventory);
craftingInventory.windowId = currentWindowId;
@@ -432,6 +435,7 @@
public void displayGUIFurnace(TileEntityFurnace tileentityfurnace)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 2, tileentityfurnace.getInvName(), tileentityfurnace.getSizeInventory()));
currentCraftingInventory = new ContainerFurnace(inventory, tileentityfurnace);
currentCraftingInventory.windowId = currentWindowId;
craftingInventory = new ContainerFurnace(inventory, tileentityfurnace);
craftingInventory.windowId = currentWindowId;
@@ -441,6 +445,7 @@
public void displayGUIDispenser(TileEntityDispenser tileentitydispenser)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 3, tileentitydispenser.getInvName(), tileentitydispenser.getSizeInventory()));
currentCraftingInventory = new ContainerDispenser(inventory, tileentitydispenser);
currentCraftingInventory.windowId = currentWindowId;
craftingInventory = new ContainerDispenser(inventory, tileentitydispenser);
craftingInventory.windowId = currentWindowId;
@@ -450,6 +455,7 @@
public void displayGUIBrewingStand(TileEntityBrewingStand tileentitybrewingstand)
{
getNextWidowId();
+ closeCraftingGui();
playerNetServerHandler.sendPacket(new Packet100OpenWindow(currentWindowId, 5, tileentitybrewingstand.getInvName(), tileentitybrewingstand.getSizeInventory()));
currentCraftingInventory = new ContainerBrewingStand(inventory, tileentitybrewingstand);
currentCraftingInventory.windowId = currentWindowId;
craftingInventory = new ContainerBrewingStand(inventory, tileentitybrewingstand);
craftingInventory.windowId = currentWindowId;

View file

@ -9,7 +9,7 @@
public class Item
@@ -156,6 +157,9 @@
private String potionInfo;
private String potionEffect;
private String itemName;
+ // FORGE: To disable repair recipes.

View file

@ -1,10 +1,10 @@
--- ../src_base/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft_server/net/minecraft/src/ModLoader.java 0000-00-00 00:00:00.000000000 -0000
@@ -1317,6 +1317,7 @@
@@ -1325,6 +1325,7 @@
{
method_getNextWindowId.invoke(entityplayermp, new Object[0]);
int j = field_currentWindowId.getInt(entityplayermp);
+ entityplayermp.closeCraftingGui();
entityplayermp.playerNetServerHandler.sendPacket(new Packet100OpenWindow(j, i, iinventory.getInvName(), iinventory.getSizeInventory()));
entityplayermp.currentCraftingInventory = container;
entityplayermp.currentCraftingInventory.windowId = j;
entityplayermp.craftingInventory = container;
entityplayermp.craftingInventory.windowId = j;

View file

@ -178,7 +178,7 @@
@@ -3028,4 +3029,38 @@
{
return getChunkProvider().func_40182_a(this, s, i, j, k);
return getChunkProvider().findClosestStructure(this, s, i, j, k);
}
+
+ /**