Skip to content

Commit 392d831

Browse files
committed
Fix
1 parent 6b71a04 commit 392d831

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

neoforge-1.20.6/procedures/block_inv_damage_item.java.ftl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ if (world instanceof ILevelExtension _ext &&
44
_ext.getCapability(Capabilities.ItemHandler.BLOCK, ${toBlockPos(input$x,input$y,input$z)}, null) instanceof IItemHandlerModifiable _itemHandlerModifiable) {
55
int _slotid = ${opt.toInt(input$slotid)};
66
ItemStack _stk = _itemHandlerModifiable.getStackInSlot(_slotid).copy();
7-
_stk.hurtAndBreak(${opt.toInt(input$amount)}, RandomSource.create(), null, _stkprov -> {});
7+
_stk.hurtAndBreak(${opt.toInt(input$amount)}, RandomSource.create(), null, () -> {
8+
_stk.shrink(1);
9+
_stk.setDamageValue(0);
10+
});
811
_itemHandlerModifiable.setStackInSlot(_slotid, _stk);
912
}
1013
<#-- @formatter:on -->
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
if(${input$entity} instanceof Player _player && _player.containerMenu instanceof ${JavaModName}Menus.MenuAccessor _menu) {
22
ItemStack stack = _menu.getSlots().get(${opt.toInt(input$slotid)}).getItem();
33
if(stack != null) {
4-
stack.hurtAndBreak(${opt.toInt(input$amount)}, RandomSource.create(), null, _stkprov -> {});
4+
stack.hurtAndBreak(${opt.toInt(input$amount)}, RandomSource.create(), null, () -> {
5+
stack.shrink(1);
6+
stack.setDamageValue(0);
7+
});
58
_player.containerMenu.broadcastChanges();
69
}
710
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
11
<#include "mcitems.ftl">
2-
${mappedMCItemToItemStackCode(input$item, 1)}.hurtAndBreak(${opt.toInt(input$amount)}, RandomSource.create(), null, _stkprov -> {});
2+
{
3+
ItemStack _ist = ${mappedMCItemToItemStackCode(input$item, 1)};
4+
_ist.hurtAndBreak(${opt.toInt(input$amount)}, RandomSource.create(), null, () -> {
5+
_ist.shrink(1);
6+
_ist.setDamageValue(0);
7+
});
8+
}

neoforge-1.20.6/procedures/utils/projectiles/arrow.java.ftl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ private static AbstractArrow initArrowProjectile(AbstractArrow entityToSpawn, En
44
if (silent)
55
entityToSpawn.setSilent(true);
66
if (fire)
7-
entityToSpawn.setSecondsOnFire(100);
7+
entityToSpawn.igniteForSeconds(100);
88
if (particles)
99
entityToSpawn.setCritArrow(true);
1010
entityToSpawn.pickup = pickup;

neoforge-1.20.6/templates/item/item.java.ftl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ public class ${name}Item extends <#if data.hasBannerPatterns()>BannerPattern<#el
354354
projectile.pickup = AbstractArrow.Pickup.CREATIVE_ONLY;
355355
} else {
356356
if (stack.isDamageableItem()) {
357-
stack.hurtAndBreak(1, world.getRandom(), player, _stkprov -> {});
357+
stack.hurtAndBreak(1, world.getRandom(), player, () -> {
358+
stack.shrink(1);
359+
stack.setDamageValue(0);
360+
});
358361
} else {
359362
stack.shrink(1);
360363
}

0 commit comments

Comments
 (0)