Skip to content

Commit

Permalink
馃敤 resolve nbtapi method changes
Browse files Browse the repository at this point in the history
Took 5 minutes
  • Loading branch information
kiranhart committed Sep 29, 2023
1 parent 91c4dbd commit c0856f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/ca/tweetzy/skulls/commands/InspectCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ protected ReturnType execute(CommandSender sender, String... args) {
skullId = placedSkull.getSkullId();
}
} else {
if (NBT.get(hand, nbt -> nbt.hasTag("Skulls:ID"))) {
final String skullIdString = NBT.get(hand, nbt -> nbt.getString("Skulls:ID"));
if (NBT.get(hand, nbt -> (boolean) nbt.hasTag("Skulls:ID"))) {
final String skullIdString = NBT.get(hand, nbt -> (String) nbt.getString("Skulls:ID"));
skullId = Integer.parseInt(skullIdString);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public void onSkullPlace(final BlockPlaceEvent event) {
final ItemStack item = PlayerUtil.getHand(event.getPlayer());
if (item == null || item.getType() == CompMaterial.AIR.parseMaterial() || item.getAmount() == 0) return;

if (!NBT.get(item, nbt -> nbt.hasTag("Skulls:ID"))) {
if (!NBT.get(item, nbt -> (boolean) nbt.hasTag("Skulls:ID"))) {
return;
}

final Block block = event.getBlockPlaced();
if (block.getType() == CompMaterial.PLAYER_HEAD.parseMaterial() || block.getType() == CompMaterial.PLAYER_WALL_HEAD.parseMaterial()) {
final int skullId = Integer.parseInt(NBT.get(item, nbt -> nbt.getString("Skulls:ID")));
final int skullId = Integer.parseInt(NBT.get(item, nbt -> (String) nbt.getString("Skulls:ID")));
Skulls.getSkullManager().addPlacedSkull(new PlacedSkullLocation(UUID.randomUUID(), skullId, block.getLocation()));
}

Expand Down

0 comments on commit c0856f0

Please sign in to comment.