Files
NotEnoughEnergistics/src/main/java/com/github/vfyjxf/nee/container/WCTContainerCraftingConfirm.java
T
Raven Szewczyk 233f2460ac Replace asm with api calls (#35)
* 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
2023-05-28 22:44:59 +02:00

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;
}
}