Skip to content

Commit

Permalink
No longer sending error message to player when claiming the grave by …
Browse files Browse the repository at this point in the history
…breaking it
  • Loading branch information
B1n-ry committed Mar 9, 2024
1 parent 9457515 commit 87a643a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
### Fixes
* Fixed mod clearing player inventory when trying to claim a grave that had generated
before removing a compatible inventory mod
*
* Improved compat and fixed issues from update of Beans Backpacks
* No longer sending error message to player when claiming the grave by breaking it

---

Expand Down
12 changes: 7 additions & 5 deletions src/main/java/com/b1n_ry/yigd/block/entity/GraveBlockEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ public void setClaimed(boolean claimed) {
public void onBroken() {
if (this.world == null || this.world.isClient) return;

Optional<GraveComponent> component = DeathInfoManager.INSTANCE.getGrave(this.graveId);
component.ifPresent(grave -> {
if (grave.getStatus() == GraveStatus.UNCLAIMED) {
grave.onDestroyed();
}
Yigd.END_OF_TICK.add(() -> {
Optional<GraveComponent> component = DeathInfoManager.INSTANCE.getGrave(this.graveId);
component.ifPresent(grave -> {
if (grave.getStatus() == GraveStatus.UNCLAIMED) {
grave.onDestroyed();
}
});
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ public boolean removeItem(Predicate<ItemStack> predicate, int itemCount) {
}

// TODO: If it becomes possible, implement drop to drop the backpack entities

@Override
public void dropItems(ServerWorld world, Vec3d pos) {
super.dropItems(world, pos);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/yigd/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"text.yigd.message.grave_location": "Your grave is located at X: %d / Y: %d / Z: %d / %s",
"text.yigd.message.on_day": " on day %d",
"text.yigd.message.irl_time": " (%d %s, %d, %d:%d%s)",
"text.yigd.message.grave_destroyed": "Your grave has been destroyed due to a bug. With proper permissions graves can be restored by using /yigd commands",
"text.yigd.message.grave_destroyed": "Your grave has been unexpectedly destroyed. With proper permissions graves can be restored by using /yigd commands",

"text.yigd.dimension.name.minecraft:overworld": "The Overworld",
"text.yigd.dimension.name.minecraft:the_nether": "The Nether",
Expand Down

0 comments on commit 87a643a

Please sign in to comment.