Skip to content

Commit

Permalink
Merge pull request #5 from Blood-Asp/unstable
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
Techlone committed Jan 19, 2017
2 parents 90442a8 + 65c5813 commit cb4111d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
27 changes: 23 additions & 4 deletions src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
private String mOwnerName = "";
private NBTTagCompound mRecipeStuff = new NBTTagCompound();

private static final Field ENTITY_ITEM_HEALTH_FIELD;
static
{
Field f = null;

try {
f = EntityItem.class.getDeclaredField("field_70291_e");
f.setAccessible(true);
} catch (Exception e1) {
try {
f = EntityItem.class.getDeclaredField("health");
f.setAccessible(true);
} catch (Exception e2) {
e1.printStackTrace();
e2.printStackTrace();
}
}
ENTITY_ITEM_HEALTH_FIELD = f;
}

public BaseMetaTileEntity() {
}

Expand Down Expand Up @@ -1144,10 +1164,9 @@ public void dropItems(ItemStack tItem){
tItemEntity.hurtResistantTime = 999999;
tItemEntity.lifespan = 60000;
try {
Field tField = tItemEntity.getClass().getDeclaredField("health");
tField.setAccessible(true);
tField.setInt(tItemEntity, 99999999);
} catch (Exception e) {e.printStackTrace();}
if(ENTITY_ITEM_HEALTH_FIELD != null)
ENTITY_ITEM_HEALTH_FIELD.setInt(tItemEntity, 99999999);
} catch (Exception ignored) {}
this.worldObj.spawnEntityInWorld(tItemEntity);
tItem.stackSize = 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public void onArmorTick(World aWorld, EntityPlayer aPlayer, ItemStack aStack) {
if (stepup > 1) {
aPlayer.stepHeight = 1.0f;
}
if (GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindJump)) {
if (aWorld.isRemote && GameSettings.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindJump)) {
if (stepup > 0 && jumpticks > 0) {
if (data.maxWeight > 2000) {
stepup *= 2000.0D / data.maxWeight;
Expand Down

0 comments on commit cb4111d

Please sign in to comment.