Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public void onEmblemTick(ItemStack stack, PlayerEntity player, Entity entity) {
- if (!isEmblemEnabled(stack) || player.isRidingOrBeingRiddenBy(entity)) return;
- POS.setPos(player.posX, player.posY - 1, player.posZ);
- BlockPos min = POS.subtract(new Vec3i(1, 0, 1));
- BlockPos max = POS.add(new Vec3i(1, 0, 1));
- boolean hasPlacedBlocks = false;
- for (BlockPos target : BlockPos.getAllInBoxMutable(min, max)) {
- BlockState stateAt = player.world.getBlockState(target);
- if (stateAt.getBlock().isReplaceable(player.world, target)) {
- hasPlacedBlocks = true;
- if (!player.world.isRemote) {
- player.world.setBlockState(target, MATERIAL);
- stack.damageItem(1, player,l ->l.sendBreakAnimation(EquipmentSlotType.MAINHAND));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement