[Fixed] Crash when placing an eternal Crystal with no portal blocks in range (#323)
This commit is contained in:
parent
964671317a
commit
fe0f3dd210
2 changed files with 5 additions and 1 deletions
|
@ -38,7 +38,10 @@ public class EternalPedestalEntity extends PedestalBlockEntity {
|
|||
@Override
|
||||
public void saveAdditional(CompoundTag tag) {
|
||||
if (hasRitual()) {
|
||||
tag.put("ritual", linkedRitual.toTag(new CompoundTag()));
|
||||
final CompoundTag ritualTag = linkedRitual.toTag(new CompoundTag());
|
||||
if (ritualTag != null) {
|
||||
tag.put("ritual", ritualTag);
|
||||
}
|
||||
}
|
||||
super.saveAdditional(tag);
|
||||
}
|
||||
|
|
|
@ -488,6 +488,7 @@ public class EternalRitual {
|
|||
}
|
||||
|
||||
public CompoundTag toTag(CompoundTag tag) {
|
||||
if (this.center == null || this.axis == null || this.exit == null) return null;
|
||||
tag.put("center", NbtUtils.writeBlockPos(center));
|
||||
tag.putString("axis", axis.getName());
|
||||
tag.putBoolean("active", active);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue