Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PTOM76 committed Sep 20, 2024
1 parent 91b8179 commit 28ed522
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/net/pitan76/itemalchemy/tile/EMCCondenserTile.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.pitan76.itemalchemy.EMCManager;
import net.pitan76.itemalchemy.ItemAlchemy;
import net.pitan76.itemalchemy.api.EMCStorageUtil;
import net.pitan76.itemalchemy.config.ItemAlchemyConfig;
import net.pitan76.itemalchemy.gui.screen.EMCCondenserScreenHandler;
import net.pitan76.itemalchemy.tile.base.EMCStorageBlockEntity;
import net.pitan76.mcpitanlib.api.entity.Player;
Expand Down Expand Up @@ -118,11 +119,16 @@ public void tick(TileTickEvent<EMCCondenserTile> e) {
long useEMC = EMCManager.get(targetStack.getItem());
if (useEMC == 0) useEMC = 1;
if (storedEMC >= useEMC) {
ItemStack newStack = targetStack.copy();
ItemStack newStack;
if (ItemAlchemyConfig.isRemoveDataFromCopyStack()) {
// Remove Data
newStack = new ItemStack(targetStack.getItem());
} else {
newStack = targetStack.copy();
}

newStack.setCount(1);
// Remove NBT
CustomDataUtil.setNbt(newStack, NbtUtil.create());
//newStack.setNbt(new NbtCompound());

if (insertItem(newStack, getItems(), true)) {
insertItem(newStack, getItems());
storedEMC -= useEMC;
Expand Down

0 comments on commit 28ed522

Please sign in to comment.