mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 06:26:43 +01:00
Added an item tag so other mods' shears and knives can be used to cut the pumpkin pie
This commit is contained in:
parent
c56170b560
commit
b91eb9c3f8
3 changed files with 11 additions and 2 deletions
|
@ -17,6 +17,7 @@ public interface UTags {
|
||||||
TagKey<Item> FRESH_APPLES = item("fresh_apples");
|
TagKey<Item> FRESH_APPLES = item("fresh_apples");
|
||||||
|
|
||||||
TagKey<Item> FALLS_SLOWLY = item("falls_slowly");
|
TagKey<Item> FALLS_SLOWLY = item("falls_slowly");
|
||||||
|
TagKey<Item> CAN_CUT_PIE = item("can_cut_pie");
|
||||||
|
|
||||||
TagKey<Item> MAGIC_FEATHERS = item("magic_feathers");
|
TagKey<Item> MAGIC_FEATHERS = item("magic_feathers");
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class PieBlock extends Block implements Waterloggable {
|
||||||
|
|
||||||
if (world.isClient) {
|
if (world.isClient) {
|
||||||
|
|
||||||
if (itemStack.getItem() == Items.SHEARS) {
|
if (itemStack.isIn(UTags.CAN_CUT_PIE)) {
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,9 +79,10 @@ public class PieBlock extends Block implements Waterloggable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemStack.getItem() == Items.SHEARS) {
|
if (itemStack.isIn(UTags.CAN_CUT_PIE)) {
|
||||||
SoundEmitter.playSoundAt(player, USounds.BLOCK_PIE_SLICE, SoundCategory.NEUTRAL, 1, 1);
|
SoundEmitter.playSoundAt(player, USounds.BLOCK_PIE_SLICE, SoundCategory.NEUTRAL, 1, 1);
|
||||||
removeSlice(world, pos, state, player);
|
removeSlice(world, pos, state, player);
|
||||||
|
itemStack.damage(1, player, p -> p.sendToolBreakStatus(hand));
|
||||||
SoundEmitter.playSoundAt(player, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.NEUTRAL, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F);
|
SoundEmitter.playSoundAt(player, SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.NEUTRAL, 0.5F, world.getRandom().nextFloat() * 0.1F + 0.9F);
|
||||||
Block.dropStack(world, pos, sliceItem.asItem().getDefaultStack());
|
Block.dropStack(world, pos, sliceItem.asItem().getDefaultStack());
|
||||||
return ActionResult.SUCCESS;
|
return ActionResult.SUCCESS;
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"replace": false,
|
||||||
|
"values": [
|
||||||
|
"c:shears",
|
||||||
|
{ "id": "#c:tools/knives", "required": false}
|
||||||
|
]
|
||||||
|
}
|
Loading…
Reference in a new issue