Skip to content

Commit

Permalink
Fixed mauler related crash
Browse files Browse the repository at this point in the history
  • Loading branch information
Faboslav committed Sep 16, 2023
1 parent 0cda3fa commit 64bdcb5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .github/versions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"1.19.2": "1.8.6",
"1.19.1": "1.8.6",
"1.19": "1.8.6",
"1.18.2": "1.4.7",
"1.19.2": "1.8.7",
"1.19.1": "1.8.7",
"1.19": "1.8.7",
"1.18.2": "1.4.8",
"1.18.1": "1.2.5",
"1.18": "1.2.5"
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public MaulerEntity(EntityType<? extends MaulerEntity> entityType, World world)
BURROWING_DOWN_ANIMATION_PROGRESS = DataTracker.registerData(MaulerEntity.class, TrackedDataHandlerRegistry.FLOAT);
}

@Override
protected void initDataTracker() {
super.initDataTracker();
this.dataTracker.startTracking(TYPE, Type.DESERT.name());
Expand All @@ -128,6 +129,7 @@ protected void initDataTracker() {
this.dataTracker.startTracking(BURROWING_DOWN_ANIMATION_PROGRESS, 0.0F);
}

@Override
public void writeCustomDataToNbt(NbtCompound nbt) {
super.writeCustomDataToNbt(nbt);
this.writeAngerToNbt(nbt);
Expand All @@ -137,7 +139,7 @@ public void writeCustomDataToNbt(NbtCompound nbt) {
nbt.putInt(TICKS_UNTIL_NEXT_BURROWING_DOWN_NBT_NAME, this.getTicksUntilNextBurrowingDown());
nbt.putFloat(BURROWING_DOWN_ANIMATION_PROGRESS_NBT_NAME, this.getBurrowingDownAnimationProgress());

if (this.isBurrowedDown() && this.burrowDownGoal.getBurrowedDownTicks() > 0) {
if (this.burrowDownGoal != null && this.isBurrowedDown() && this.burrowDownGoal.getBurrowedDownTicks() > 0) {
nbt.putInt(BURROWED_DOWN_TICKS_NBT_NAME, this.burrowDownGoal.getBurrowedDownTicks());
}
}
Expand All @@ -152,7 +154,7 @@ public void readCustomDataFromNbt(NbtCompound nbt) {
this.setTicksUntilNextBurrowingDown(nbt.getInt(TICKS_UNTIL_NEXT_BURROWING_DOWN_NBT_NAME));
this.setBurrowingDownAnimationProgress(nbt.getFloat(BURROWING_DOWN_ANIMATION_PROGRESS_NBT_NAME));

if (this.isBurrowedDown() && nbt.contains(BURROWED_DOWN_TICKS_NBT_NAME)) {
if (this.burrowDownGoal != null && this.isBurrowedDown() && nbt.contains(BURROWED_DOWN_TICKS_NBT_NAME)) {
this.burrowDownGoal.setBurrowedDownTicks(nbt.getInt(BURROWED_DOWN_TICKS_NBT_NAME));
this.setInvulnerable(true);
this.setInvisible(true);
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.configureondemand=false
# Mod
mod_name=Friends&Foes
mod_id=friendsandfoes
mod_version=1.8.6
mod_version=1.8.7
mod_author=Faboslav
mod_description=Adds outvoted and forgotten mobs from the mob votes in a believable vanilla plus style.
maven_group=com.faboslav.friendsandfoes
Expand Down

0 comments on commit 64bdcb5

Please sign in to comment.