mirror of
https://github.com/GTNewHorizons/NotEnoughEnergistics.git
synced 2026-11-24 22:04:31 +00:00
* Update buildscript&dependencies * Remove AE2 asm and use the new API instead * Remove stack size limitation for ctrl+scroll, it's useful to bypass by other means anyway * spotlessApply * Use RFG Tags instead of token replacement * Suppress deprecation via an annotation instead of IntelliJ magic comment * Update dependencies.gradle * Update dependencies.gradle
47 lines
1.3 KiB
Java
47 lines
1.3 KiB
Java
package com.github.vfyjxf.nee.container;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
import com.github.vfyjxf.nee.block.tile.TilePatternInterface;
|
|
|
|
import appeng.api.storage.ITerminalHost;
|
|
import appeng.container.implementations.ContainerCraftConfirm;
|
|
import appeng.util.Platform;
|
|
|
|
public class WCTContainerCraftingConfirm extends ContainerCraftConfirm {
|
|
|
|
private TilePatternInterface tile;
|
|
private int patternIndex;
|
|
private boolean hasWorkCommitted = false;
|
|
|
|
public WCTContainerCraftingConfirm(InventoryPlayer ip, ITerminalHost te) {
|
|
super(ip, te);
|
|
}
|
|
|
|
@Override
|
|
public void startJob() {
|
|
if (Platform.isServer()) {
|
|
hasWorkCommitted = true;
|
|
}
|
|
super.startJob();
|
|
}
|
|
|
|
@Override
|
|
public void onContainerClosed(EntityPlayer par1EntityPlayer) {
|
|
super.onContainerClosed(par1EntityPlayer);
|
|
if (Platform.isServer() && tile != null && !hasWorkCommitted) {
|
|
this.tile.getPatternInventory().setInventorySlotContents(patternIndex, null);
|
|
this.tile.updateCraftingList();
|
|
}
|
|
}
|
|
|
|
public void setTile(TilePatternInterface tile) {
|
|
this.tile = tile;
|
|
}
|
|
|
|
public void setPatternIndex(int patternIndex) {
|
|
this.patternIndex = patternIndex;
|
|
}
|
|
}
|