Skip to content

Commit

Permalink
1.5.22 #2351 crafting stick fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lothrazar committed Apr 1, 2024
1 parent bfeb28e commit 676db8f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 17 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

curse_id=239286
mod_version=1.5.22-SNAPSHOT
mod_version=1.5.22

mc_version=1.16.5
forge_version=36.2.34
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.lothrazar.cyclic.item.crafting;

import com.lothrazar.cyclic.ModCyclic;
import com.lothrazar.cyclic.base.ContainerBase;
import com.lothrazar.cyclic.data.IContainerCraftingAction;
import com.lothrazar.cyclic.registry.ContainerScreenRegistry;
Expand Down Expand Up @@ -42,9 +41,8 @@ public CraftingBagContainer(int id, PlayerInventory playerInventory, PlayerEntit
//
if (slot > -1) {
this.bag = playerInventory.getStackInSlot(slot);
ModCyclic.LOGGER.info("bag " + bag);
}
if (bag.isEmpty()) {
if (bag == null || bag.isEmpty()) {
this.bag = super.findBag(ItemRegistry.crafting_bag);
}
//grid
Expand All @@ -59,11 +57,7 @@ public boolean isItemValid(ItemStack stack) {
});
}
}
//
// this.nbt = bag.getOrCreateTag();
bag.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h -> {
// this.handler = h;
// this.slots = h.getSlots();
for (int j = 0; j < h.getSlots(); j++) {
ItemStack inBag = h.getStackInSlot(j);
if (!inBag.isEmpty()) {
Expand All @@ -80,25 +74,17 @@ public void onContainerClosed(PlayerEntity playerIn) {
this.craftResult.setInventorySlotContents(0, ItemStack.EMPTY);
//this is not the saving version
if (playerIn.world.isRemote == false) {
// if (this.handler == null) {
IItemHandler handler = bag.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).orElse(null);
if (handler == null) {
return;
}
// }
for (int i = 0; i < 9; i++) {
ItemStack crafty = this.craftMatrix.getStackInSlot(i);
// if (crafty.isEmpty()) {
// continue;
// }
handler.extractItem(i, 64, false);
ItemStack failtest = handler.insertItem(i, crafty, false);
if (!failtest.isEmpty()) {
//
}
//
// ItemStack doubleTest = h.extractItem(i, 64, true);
// ModCyclic.LOGGER.info(doubleTest + " got saved in " + i);
}
}
// clearContainer(playerIn, playerIn.world, craftMatrix);
Expand Down
3 changes: 2 additions & 1 deletion update.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"homepage": "https://www.curseforge.com/minecraft/mc-mods/cyclic",
"promos": {
"1.16.5-latest": "1.5.21"
"1.16.5-latest": "1.5.22"
},
"1.16.5": {
"0.6.1": "Ported ",
Expand Down Expand Up @@ -78,5 +78,6 @@
,"1.5.19":"Backports from mc1.18.2: right-click the Crafting Stick anywhere in your inventory screen, even while not holding it, to open it. Fix logs about 'unused frames'. Fixed logs about ' Unknown recipe category: cyclic:'. Fix Combustion Generator consumes Empty Bucket #2146. Fix #2171 Rich Soil acting translucent and blocksounds. #2138 /cyclic commands can run in functions and command blocks"
,"1.5.20":"#2102 wooden and golden hopper deposit logic fixed, now matches 1.18.2+ versions. #2085 Hopper reach area & pickup logic now uses vanilla-hopper area size. JEED compatibility added for some potion effects. Port Fishing Net and Mending Fishingrods compatibility from 1.12.2 #2067. Ender Apple now sends a message if nothing is found (void/flatworlds/etc). Growth enchant now skips IGrowable blocks that return false for 'canGrow();'. Many new config options added for: growth enchant, beheading enchant, battery, sprinkler, experience_pylon, fisher, scythes, and others in cyclic.toml"
,"1.5.21":"#1933 Sack of Holding chest placement override added, with new config to revert back to legacy behavior if desired (overrideChestSingle). #2168 fix bug where ender shelf sometimes would not save contents when mined after exiting reloading world when client data desyncs. Added a percentage config and ignorelist config for cyclic:disarm enchantment (disarmPercentPerLevel, disarmIngoredMobs), resolves it dropping your copied weapon from alexsmobs:mimicube #2249. Fix #1878 layered and/or logic for multiple wireless transmitters on the same node "
,"1.5.22":"Fix #2351 advanced crafting stick not opening. "
}
}

0 comments on commit 676db8f

Please sign in to comment.