Skip to content

Commit

Permalink
Check if backpack is air before setting backpack
Browse files Browse the repository at this point in the history
Check if player is dead before looting a grave
  • Loading branch information
B1n-ry committed Dec 11, 2023
1 parent 25c10f4 commit 5d09680
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# You're in Grave Danger 2.0.0-beta.6

### Fixes
* Players can't retrieve their graves while dead anymore

---

# You're in Grave Danger 2.0.0-beta.5

### Fixes
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.parallel=true
loader_version=0.14.24

# Mod Properties
mod_version = 2.0.0-beta.5
mod_version = 2.0.0-beta.6
maven_group = com.b1n_ry.yigd
archives_base_name = youre-in-grave-danger

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ public DefaultedList<ItemStack> merge(CompatComponent<?> mergingComponent) {

@Override
public DefaultedList<ItemStack> storeToPlayer(ServerPlayerEntity player) {
if (this.inventory.isEmpty()) return DefaultedList.of();

ITravelersBackpackComponent component = ComponentUtils.getComponent(player);

component.setWearable(this.inventory);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/b1n_ry/yigd/config/YigdConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public static class PersistentGraves {
public static class RandomSpawn {
public int percentSpawnChance = 0;
public String spawnEntity = "minecraft:zombie";
public String spawnNbt = "{ArmorItems:[{},{},{},{id:\"minecraft:player_head\",tag:{SkullOwner:{Name:\"${name}\",Id:\"${uuid}\"}},Count:1b}]}";
public String spawnNbt = "{ArmorItems:[{},{},{},{id:\"minecraft:player_head\",tag:{SkullOwner:{Name:\"${owner.name}\",Id:\"${owner.uuid}\"}},Count:1b}]}";
}

public static class Range {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public static void registerEventCallbacks() {
});

GraveClaimEvent.EVENT.register((player, world, pos, grave, tool) -> {
if (player.isDead()) return false;

YigdConfig config = YigdConfig.getConfig();

if (config.extraFeatures.graveKeys.enabled) {
Expand Down

0 comments on commit 5d09680

Please sign in to comment.