Skip to content

Commit

Permalink
Replace TileEntity.getCustomManipulators() with TileEntity.getContain…
Browse files Browse the repository at this point in the history
…ers() for BlockSnapshot creation.
  • Loading branch information
JBYoshi committed Nov 17, 2019
1 parent 040c73b commit 0a3894f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import org.spongepowered.api.world.storage.WorldProperties;
import org.spongepowered.common.bridge.data.CustomDataHolderBridge;
import org.spongepowered.common.data.persistence.NbtTranslator;
import org.spongepowered.common.data.util.DataUtil;
import org.spongepowered.common.util.Constants;
Expand Down Expand Up @@ -153,7 +152,7 @@ public SpongeBlockSnapshotBuilder from(final Location<World> location) {
this.compound = new NBTTagCompound();
final org.spongepowered.api.block.tileentity.TileEntity te = location.getTileEntity().get();
((TileEntity) te).writeToNBT(this.compound);
this.manipulators = ((CustomDataHolderBridge) te).bridge$getCustomManipulators().stream()
this.manipulators = te.getContainers().stream()
.map(DataManipulator::asImmutable)
.collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public BlockSnapshot snapshotFor(final Location<World> location) {
if (this.block.hasTileEntity() && location.getBlockType().equals(this.block)) {
final TileEntity tileEntity = location.getTileEntity()
.orElseThrow(() -> new IllegalStateException("Unable to retrieve a TileEntity for location: " + location));
for (final DataManipulator<?, ?> manipulator : ((CustomDataHolderBridge) tileEntity).bridge$getCustomManipulators()) {
for (final DataManipulator<?, ?> manipulator : tileEntity.getContainers()) {
builder.add(manipulator);
}
final NBTTagCompound compound = new NBTTagCompound();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ public BlockSnapshot createSnapshot(int x, int y, int z) {
}
if (te.isPresent()) {
final TileEntity tileEntity = te.get();
for (DataManipulator<?, ?> manipulator : ((CustomDataHolderBridge) tileEntity).bridge$getCustomManipulators()) {
for (DataManipulator<?, ?> manipulator : tileEntity.getContainers()) {
builder.add(manipulator);
}
final NBTTagCompound compound = new NBTTagCompound();
Expand Down

0 comments on commit 0a3894f

Please sign in to comment.