-
Notifications
You must be signed in to change notification settings - Fork 787
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix seared furnaces not updating temperature required on stack size c…
…hange (#3733)
- Loading branch information
1 parent
30a587e
commit f5d7b2a
Showing
3 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
.../java/slimeknights/tconstruct/smeltery/inventory/ContainerSearedFurnaceSideInventory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package slimeknights.tconstruct.smeltery.inventory; | ||
|
||
import net.minecraft.inventory.Slot; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraftforge.items.IItemHandler; | ||
import net.minecraftforge.items.SlotItemHandler; | ||
import slimeknights.tconstruct.smeltery.tileentity.TileSearedFurnace; | ||
import slimeknights.tconstruct.tools.common.inventory.ContainerSideInventory; | ||
|
||
public class ContainerSearedFurnaceSideInventory extends ContainerSideInventory<TileSearedFurnace> { | ||
|
||
public ContainerSearedFurnaceSideInventory(TileSearedFurnace tile, int x, int y, int columns) { | ||
super(tile, x, y, columns); | ||
} | ||
|
||
@Override | ||
protected Slot createSlot(IItemHandler itemHandler, int index, int x, int y) { | ||
return new SearedFurnaceSlot(tile, itemHandler, index, x, y); | ||
} | ||
|
||
private static class SearedFurnaceSlot extends SlotItemHandler { | ||
|
||
private TileSearedFurnace tile; | ||
private int index; | ||
public SearedFurnaceSlot(TileSearedFurnace tile, IItemHandler itemHandler, int index, int xPosition, int yPosition) { | ||
super(itemHandler, index, xPosition, yPosition); | ||
this.tile = tile; | ||
this.index = index; | ||
} | ||
|
||
@Override | ||
public boolean isItemValid(ItemStack stack) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public int getItemStackLimit(ItemStack stack) { | ||
return 16; | ||
} | ||
|
||
@Override | ||
public void onSlotChanged() { | ||
// don't update client side, its going to sync in a tick or two | ||
if(!tile.getWorld().isRemote) { | ||
this.tile.updateHeatRequired(index); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters