Skip to content

Commit

Permalink
workaround banners being weird to showfake banners properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 12, 2020
1 parent 358b859 commit 6e47011
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Expand Up @@ -34,7 +34,7 @@ public class CompoundTagBuilder {
/**
* Create a new instance.
*/
CompoundTagBuilder() {
public CompoundTagBuilder() {
this.entries = new HashMap<>();
}

Expand Down
Expand Up @@ -136,6 +136,9 @@ private void updateBlock(MaterialTag material, DurationTag duration) {
}
if (material.hasModernData()) {
material.getModernData().sendFakeChangeTo(player.getPlayerEntity(), location);
if (material.getMaterial().name().endsWith("_BANNER")) { // Banners are weird
location.getWorld().refreshChunk(chunkCoord.x, chunkCoord.z);
}
}
else {
player.getPlayerEntity().sendBlockChange(location, material.getMaterial(), material.getMaterialData().getData());
Expand Down
Expand Up @@ -122,6 +122,9 @@ public CompoundTag getNbtData(Block block) {
NMSHandler.getChunkHelper().changeChunkServerThread(block.getWorld());
org.bukkit.block.BlockState state = block.getState();
NMSHandler.getChunkHelper().restoreServerThread(block.getWorld());
if (!(state instanceof CraftBlockEntityState)) {
return null;
}
TileEntity tileEntity = getTE((CraftBlockEntityState) state);
if (tileEntity == null) {
return null;
Expand Down

0 comments on commit 6e47011

Please sign in to comment.