Prevent anvil damage restore

This commit is contained in:
paulevsGitch 2021-04-21 21:41:52 +03:00
parent 5e2335b255
commit 38a09c0aef
5 changed files with 60 additions and 4 deletions

View file

@ -48,7 +48,10 @@ public class EndAnvilBlock extends AnvilBlock implements BlockPatterned {
@Override
public List<ItemStack> getDrops(BlockState state, LootContext.Builder builder) {
return Collections.singletonList(new ItemStack(this));
ItemStack stack = new ItemStack(this);
int level = state.getValue(getDestructionProperty());
stack.getOrCreateTag().putInt("level", level);
return Collections.singletonList(stack);
}
@Override