Skip to content

Commit

Permalink
allow anvil dropping with items in other hand
Browse files Browse the repository at this point in the history
  • Loading branch information
nad2040 committed May 30, 2024
1 parent 21ece0e commit d732e81
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions src/main/java/com/nad2040/elytrabombing/ElytraBombingMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ public class ElytraBombingMod implements ModInitializer {

@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.

LOGGER.info("Elytra Bombing Mod initialized!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void use(World world, PlayerEntity user, Hand hand, CallbackInfoReturnabl
}
user.incrementStat(Stats.USED.getOrCreateStat((FlintAndSteelItem) (Object) this));
cir.setReturnValue(TypedActionResult.success(user.getStackInHand(hand), world.isClient()));
} else if ((usedItemStack.isOf(Items.ANVIL) || usedItemStack.isOf(Items.CHIPPED_ANVIL) || usedItemStack.isOf(Items.DAMAGED_ANVIL)) && otherItemStack.isEmpty()) {
} else if (usedItemStack.isOf(Items.ANVIL) || usedItemStack.isOf(Items.CHIPPED_ANVIL) || usedItemStack.isOf(Items.DAMAGED_ANVIL)) {
FallingBlockEntity anvilEntity = new FallingBlockEntity(EntityType.FALLING_BLOCK, world);
anvilEntity.timeFalling = 1; // allows anvils to work on 1.18* by avoiding `(this.timeFalling++ == 0)`
anvilEntity.setPosition(position);
Expand Down

0 comments on commit d732e81

Please sign in to comment.