Skip to content

Commit a66f1e7

Browse files
Fixed zot overloader not charging zots
1 parent dce6c16 commit a66f1e7

1 file changed

Lines changed: 4 additions & 10 deletions

File tree

src/main/java/me/sfiguz7/transcendence/implementation/items/machines/ZotOverloader.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private void processInputSlots(Block b, BlockMenu menu, ItemStack zot, ItemMeta
166166
int inpToBeRemoved = inpRemoveCalc(inpSpin, zotSpin);
167167

168168
if (inputItem.getAmount() >= inpToBeRemoved) {
169-
handleInputRemoval(b, menu, zot, zotMeta, zotCharge, chargeKey, requiredCharge, inputSlot, inputItem, inpToBeRemoved);
169+
handleInputRemoval(b, menu, zot, zotMeta, ++zotCharge, chargeKey, requiredCharge, inputSlot, inputItem, inpToBeRemoved);
170170
}
171171
break;
172172
}
@@ -179,10 +179,11 @@ private boolean isValidInput(ItemStack inputItem) {
179179

180180
private void handleInputRemoval(Block b, BlockMenu menu, ItemStack zot, ItemMeta zotMeta, int zotCharge,
181181
NamespacedKey chargeKey, int requiredCharge, int inputSlot, ItemStack inputItem, int inpToBeRemoved) {
182-
if (zotCharge == requiredCharge - 1) {
182+
if (zotCharge == requiredCharge) {
183183
menu.replaceExistingItem(ZOT_SLOT, getZot(zotMeta.getDisplayName().split(" ")[1]));
184184
} else {
185-
updateZotMeta(zotMeta, zotCharge, requiredCharge);
185+
zotMeta.setLore(Arrays.asList(ChatColor.BLUE + "Concentrated matter",
186+
ChatColor.GRAY + "Charge: " + ChatColor.YELLOW + zotCharge + "/" + requiredCharge));
186187
}
187188

188189
PersistentDataAPI.setInt(zotMeta, chargeKey, zotCharge);
@@ -196,13 +197,6 @@ private void handleInputRemoval(Block b, BlockMenu menu, ItemStack zot, ItemMeta
196197
}
197198
}
198199

199-
private void updateZotMeta(ItemMeta zotMeta, int zotCharge, int requiredCharge) {
200-
zotMeta.setLore(Arrays.asList(ChatColor.BLUE + "Concentrated matter",
201-
ChatColor.GRAY + "Charge: " + ChatColor.YELLOW + ++zotCharge + "/" + requiredCharge));
202-
}
203-
204-
205-
206200
@Override
207201
public boolean isSynchronized() {
208202
return true;

0 commit comments

Comments
 (0)