diff --git a/resources/changelog/1.18.2-1.17.5.txt b/resources/changelog/1.18.2-1.17.5.txt new file mode 100644 index 00000000000..949b7729620 --- /dev/null +++ b/resources/changelog/1.18.2-1.17.5.txt @@ -0,0 +1,6 @@ +As always, don't forget to backup your world before updating! +Requires CyclopsCore version 1.17.0 or higher. + +Fixes: +* Fix crash for illegal item tag chars in recipe in LP, Closes CyclopsMC/IntegratedCrafting#103 +* Fix Dank Storage item removal when placing cables, Closes #1332 diff --git a/src/main/java/org/cyclops/integrateddynamics/core/logicprogrammer/ValueTypeRecipeLPElement.java b/src/main/java/org/cyclops/integrateddynamics/core/logicprogrammer/ValueTypeRecipeLPElement.java index e39e21dd55b..2d7741acba4 100644 --- a/src/main/java/org/cyclops/integrateddynamics/core/logicprogrammer/ValueTypeRecipeLPElement.java +++ b/src/main/java/org/cyclops/integrateddynamics/core/logicprogrammer/ValueTypeRecipeLPElement.java @@ -308,6 +308,16 @@ public Component validate() { } catch (NumberFormatException e) { return Component.translatable(L10NValues.VALUETYPE_ERROR_INVALIDINPUT, outputEnergy); } + // Validate input item tag strings if they are defined + for (ItemMatchProperties inputStack : inputStacks) { + if (inputStack.getItemTag() != null) { + try { + new ResourceLocation(inputStack.getItemTag()); + } catch (ResourceLocationException e) { + return Component.translatable(L10NValues.VALUETYPE_ERROR_INVALIDINPUT, inputStack.getItemTag()); + } + } + } return null; } diff --git a/src/main/java/org/cyclops/integrateddynamics/item/ItemBlockCable.java b/src/main/java/org/cyclops/integrateddynamics/item/ItemBlockCable.java index 88f3a4c2988..3b93898d356 100644 --- a/src/main/java/org/cyclops/integrateddynamics/item/ItemBlockCable.java +++ b/src/main/java/org/cyclops/integrateddynamics/item/ItemBlockCable.java @@ -95,7 +95,9 @@ protected boolean attempItemUseTarget(UseOnContext context, BlockPos pos, Direct protected void afterItemUse(UseOnContext context, BlockPos pos, BlockCable blockCable, boolean calledSuper) { if(!calledSuper) { playPlaceSound(context.getLevel(), pos); - context.getItemInHand().shrink(1); + if (context.getItemInHand().getItem() == RegistryEntries.ITEM_CABLE) { + context.getItemInHand().shrink(1); + } } blockCable.setDisableCollisionBox(false); }