Skip to content

Commit

Permalink
Remove references to the now-broken BlockEntity#save(CompoundTag) m…
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperMartijn642 authored Jan 19, 2022
1 parent 00fafb0 commit 75408c1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,12 @@
}

public static BlockPos m_187472_(CompoundTag p_187473_) {
@@ -48,6 +_,13 @@
@@ -48,6 +_,8 @@
}

public void m_142466_(CompoundTag p_155245_) {
+ if (p_155245_.m_128441_("ForgeData")) this.customTileData = p_155245_.m_128469_("ForgeData");
+ if (getCapabilities() != null && p_155245_.m_128441_("ForgeCaps")) deserializeCaps(p_155245_.m_128469_("ForgeCaps"));
+ }
+
+ public CompoundTag save(CompoundTag tag) {
+ m_187478_(tag);
+ return tag;
}

protected void m_183515_(CompoundTag p_187471_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ default void deserializeNBT(CompoundTag nbt)
@Override
default CompoundTag serializeNBT()
{
CompoundTag ret = new CompoundTag();
self().save(ret);
return ret;
return self().saveWithFullMetadata();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static BlockSnapshot create(ResourceKey<Level> dim, LevelAccessor world,
@Nullable
private static CompoundTag getBlockEntityTag(@Nullable BlockEntity te)
{
return te == null ? null : te.save(new CompoundTag());
return te == null ? null : te.saveWithFullMetadata();
}

public BlockState getCurrentBlock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,10 @@ public void load(CompoundTag tag)
}

@Override
public CompoundTag save(CompoundTag tag)
protected void saveAdditional(CompoundTag tag)
{
super.save(tag);
super.saveAdditional(tag);
tank.writeToNBT(tag);
return tag;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void setPlant(Block plant)
@Override
public CompoundTag getUpdateTag()
{
return save(new CompoundTag());
return saveWithFullMetadata();
}

@Override
Expand Down Expand Up @@ -238,11 +238,11 @@ public void load(CompoundTag tag)
}

@Override
public CompoundTag save(CompoundTag tag)
protected void saveAdditional(CompoundTag tag)
{
//noinspection ConstantConditions
tag.putString("plant", plant.getRegistryName().toString());
return super.save(tag);
super.saveAdditional(tag);
}
}

Expand Down

0 comments on commit 75408c1

Please sign in to comment.