Skip to content

Commit bbc7aa5

Browse files
committed
Fixed block particle duplication bug when there are views in the same dimension as the player
1 parent bbe692d commit bbc7aa5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/main/java/com/xcompwiz/lookingglass/client/proxyworld/ProxyWorldManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@ public static WorldView createWorldView(int dimid, ChunkCoordinates spawn, int w
119119
EntityLivingBase backup = mc.renderViewEntity;
120120
mc.renderViewEntity = view.camera;
121121
view.getRenderGlobal().setWorldAndLoadRenderers(proxyworld);
122+
if(proxyworld.provider.dimensionId == Minecraft.getMinecraft().thePlayer.dimension) {
123+
proxyworld.removeWorldAccess(view.getRenderGlobal());
124+
}
125+
else if(proxyworld.provider.dimensionId != Minecraft.getMinecraft().thePlayer.dimension){
126+
// Since there is no "getWorldAccess" or "hasWorldAccess(dim)" method in WorldClient,
127+
// this is a makeshift way to prevent duplicate world accesses being added
128+
proxyworld.removeWorldAccess(view.getRenderGlobal());
129+
proxyworld.addWorldAccess(view.getRenderGlobal());
130+
}
122131
mc.renderViewEntity = backup;
123132

124133
// Inform the server of the new view

0 commit comments

Comments
 (0)