142 lines
6.8 KiB
Diff
142 lines
6.8 KiB
Diff
--- a/net/minecraft/tileentity/AbstractFurnaceTileEntity.java
|
|
+++ b/net/minecraft/tileentity/AbstractFurnaceTileEntity.java
|
|
@@ -85,6 +85,7 @@
|
|
this.field_214014_c = p_i49964_2_;
|
|
}
|
|
|
|
+ @Deprecated //Forge - get burn times by calling ForgeHooks#getBurnTime(ItemStack)
|
|
public static Map<Item, Integer> func_214001_f() {
|
|
Map<Item, Integer> map = Maps.newLinkedHashMap();
|
|
func_213996_a(map, Items.field_151129_at, 20000);
|
|
@@ -98,18 +99,8 @@
|
|
func_213992_a(map, ItemTags.field_202899_i, 150);
|
|
func_213992_a(map, ItemTags.field_212188_k, 300);
|
|
func_213992_a(map, ItemTags.field_202900_j, 300);
|
|
- func_213996_a(map, Blocks.field_180407_aO, 300);
|
|
- func_213996_a(map, Blocks.field_180404_aQ, 300);
|
|
- func_213996_a(map, Blocks.field_180408_aP, 300);
|
|
- func_213996_a(map, Blocks.field_180403_aR, 300);
|
|
- func_213996_a(map, Blocks.field_180406_aS, 300);
|
|
- func_213996_a(map, Blocks.field_180405_aT, 300);
|
|
- func_213996_a(map, Blocks.field_180390_bo, 300);
|
|
- func_213996_a(map, Blocks.field_180392_bq, 300);
|
|
- func_213996_a(map, Blocks.field_180391_bp, 300);
|
|
- func_213996_a(map, Blocks.field_180386_br, 300);
|
|
- func_213996_a(map, Blocks.field_180385_bs, 300);
|
|
- func_213996_a(map, Blocks.field_180387_bt, 300);
|
|
+ func_213992_a(map, net.minecraftforge.common.Tags.Items.FENCES_WOODEN, 300);
|
|
+ func_213992_a(map, net.minecraftforge.common.Tags.Items.FENCE_GATES_WOODEN, 300);
|
|
func_213996_a(map, Blocks.field_196586_al, 300);
|
|
func_213996_a(map, Blocks.field_150342_X, 300);
|
|
func_213996_a(map, Blocks.field_222428_lQ, 300);
|
|
@@ -169,9 +160,9 @@
|
|
super.func_145839_a(p_145839_1_);
|
|
this.field_214012_a = NonNullList.func_191197_a(this.func_70302_i_(), ItemStack.field_190927_a);
|
|
ItemStackHelper.func_191283_b(p_145839_1_, this.field_214012_a);
|
|
- this.field_214018_j = p_145839_1_.func_74765_d("BurnTime");
|
|
- this.field_214020_l = p_145839_1_.func_74765_d("CookTime");
|
|
- this.field_214021_m = p_145839_1_.func_74765_d("CookTimeTotal");
|
|
+ this.field_214018_j = p_145839_1_.func_74762_e("BurnTime");
|
|
+ this.field_214020_l = p_145839_1_.func_74762_e("CookTime");
|
|
+ this.field_214021_m = p_145839_1_.func_74762_e("CookTimeTotal");
|
|
this.field_214019_k = this.func_213997_a(this.field_214012_a.get(1));
|
|
int i = p_145839_1_.func_74765_d("RecipesUsedSize");
|
|
|
|
@@ -185,9 +176,9 @@
|
|
|
|
public CompoundNBT func_189515_b(CompoundNBT p_189515_1_) {
|
|
super.func_189515_b(p_189515_1_);
|
|
- p_189515_1_.func_74777_a("BurnTime", (short)this.field_214018_j);
|
|
- p_189515_1_.func_74777_a("CookTime", (short)this.field_214020_l);
|
|
- p_189515_1_.func_74777_a("CookTimeTotal", (short)this.field_214021_m);
|
|
+ p_189515_1_.func_74768_a("BurnTime", this.field_214018_j);
|
|
+ p_189515_1_.func_74768_a("CookTime", this.field_214020_l);
|
|
+ p_189515_1_.func_74768_a("CookTimeTotal", this.field_214021_m);
|
|
ItemStackHelper.func_191282_a(p_189515_1_, this.field_214012_a);
|
|
p_189515_1_.func_74777_a("RecipesUsedSize", (short)this.field_214022_n.size());
|
|
int i = 0;
|
|
@@ -217,12 +208,14 @@
|
|
this.field_214019_k = this.field_214018_j;
|
|
if (this.func_214006_r()) {
|
|
flag1 = true;
|
|
+ if (itemstack.hasContainerItem())
|
|
+ this.field_214012_a.set(1, itemstack.getContainerItem());
|
|
+ else
|
|
if (!itemstack.func_190926_b()) {
|
|
Item item = itemstack.func_77973_b();
|
|
itemstack.func_190918_g(1);
|
|
if (itemstack.func_190926_b()) {
|
|
- Item item1 = item.func_77668_q();
|
|
- this.field_214012_a.set(1, item1 == null ? ItemStack.field_190927_a : new ItemStack(item1));
|
|
+ this.field_214012_a.set(1, itemstack.getContainerItem());
|
|
}
|
|
}
|
|
}
|
|
@@ -266,10 +259,10 @@
|
|
return true;
|
|
} else if (!itemstack1.func_77969_a(itemstack)) {
|
|
return false;
|
|
- } else if (itemstack1.func_190916_E() < this.func_70297_j_() && itemstack1.func_190916_E() < itemstack1.func_77976_d()) {
|
|
+ } else if (itemstack1.func_190916_E() + itemstack.func_190916_E() <= this.func_70297_j_() && itemstack1.func_190916_E() + itemstack.func_190916_E() <= itemstack1.func_77976_d()) { // Forge fix: make furnace respect stack sizes in furnace recipes
|
|
return true;
|
|
} else {
|
|
- return itemstack1.func_190916_E() < itemstack.func_77976_d();
|
|
+ return itemstack1.func_190916_E() + itemstack.func_190916_E() <= itemstack.func_77976_d(); // Forge fix: make furnace respect stack sizes in furnace recipes
|
|
}
|
|
}
|
|
} else {
|
|
@@ -285,7 +278,7 @@
|
|
if (itemstack2.func_190926_b()) {
|
|
this.field_214012_a.set(2, itemstack1.func_77946_l());
|
|
} else if (itemstack2.func_77973_b() == itemstack1.func_77973_b()) {
|
|
- itemstack2.func_190917_f(1);
|
|
+ itemstack2.func_190917_f(itemstack1.func_190916_E());
|
|
}
|
|
|
|
if (!this.field_145850_b.field_72995_K) {
|
|
@@ -305,7 +298,7 @@
|
|
return 0;
|
|
} else {
|
|
Item item = p_213997_1_.func_77973_b();
|
|
- return func_214001_f().getOrDefault(item, 0);
|
|
+ return net.minecraftforge.common.ForgeHooks.getBurnTime(p_213997_1_);
|
|
}
|
|
}
|
|
|
|
@@ -314,7 +307,7 @@
|
|
}
|
|
|
|
public static boolean func_213991_b(ItemStack p_213991_0_) {
|
|
- return func_214001_f().containsKey(p_213991_0_.func_77973_b());
|
|
+ return net.minecraftforge.common.ForgeHooks.getBurnTime(p_213991_0_) > 0;
|
|
}
|
|
|
|
public int[] func_180463_a(Direction p_180463_1_) {
|
|
@@ -462,4 +455,27 @@
|
|
}
|
|
|
|
}
|
|
+
|
|
+ net.minecraftforge.common.util.LazyOptional<? extends net.minecraftforge.items.IItemHandler>[] handlers =
|
|
+ net.minecraftforge.items.wrapper.SidedInvWrapper.create(this, Direction.UP, Direction.DOWN, Direction.NORTH);
|
|
+
|
|
+ @Override
|
|
+ public <T> net.minecraftforge.common.util.LazyOptional<T> getCapability(net.minecraftforge.common.capabilities.Capability<T> capability, @Nullable Direction facing) {
|
|
+ if (!this.field_145846_f && facing != null && capability == net.minecraftforge.items.CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
|
|
+ if (facing == Direction.UP)
|
|
+ return handlers[0].cast();
|
|
+ else if (facing == Direction.DOWN)
|
|
+ return handlers[1].cast();
|
|
+ else
|
|
+ return handlers[2].cast();
|
|
+ }
|
|
+ return super.getCapability(capability, facing);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void func_145843_s() {
|
|
+ super.func_145843_s();
|
|
+ for (int x = 0; x < handlers.length; x++)
|
|
+ handlers[x].invalidate();
|
|
+ }
|
|
}
|