26.1 support
This commit is contained in:
+6
-1
@@ -247,8 +247,13 @@ public class ServerLevelWrapper implements IServerLevelWrapper
|
||||
#else
|
||||
|
||||
// directly hitting the chunkMap is required otherwise MC will run this on the main server thread,
|
||||
#if MC_VER <= MC_1_21_11
|
||||
var cPos = new ChunkPos(pos.getX(), pos.getZ()).toLong();
|
||||
#else
|
||||
var cPos = new ChunkPos(pos.getX(), pos.getZ()).pack();
|
||||
#endif
|
||||
// causing lag
|
||||
ChunkHolder chunkHolder = this.level.getChunkSource().chunkMap.getVisibleChunkIfPresent(new ChunkPos(pos.getX(), pos.getZ()).toLong());
|
||||
ChunkHolder chunkHolder = this.level.getChunkSource().chunkMap.getVisibleChunkIfPresent(cPos);
|
||||
if (chunkHolder == null)
|
||||
{
|
||||
return null;
|
||||
|
||||
@@ -164,7 +164,6 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
{
|
||||
//LOGGER.trace("break or block attack at blockPos: " + event.getPos());
|
||||
|
||||
LevelAccessor level = event.getLevel();
|
||||
ChunkAccess chunk = level.getChunk(event.getPos());
|
||||
this.onBlockChangeEvent(level, chunk);
|
||||
});
|
||||
@@ -174,7 +173,7 @@ public class NeoforgeClientProxy implements AbstractModInitializer.IEventProxy
|
||||
private void onBlockChangeEvent(LevelAccessor level, ChunkAccess chunk)
|
||||
{
|
||||
ILevelWrapper wrappedLevel = ProxyUtil.getLevelWrapper(level);
|
||||
SharedApi.INSTANCE.chunkBlockChangedEvent(new ChunkWrapper(chunk, wrappedLevel), wrappedLevel);
|
||||
SharedApi.INSTANCE.applyChunkUpdate(new ChunkWrapper(chunk, wrappedLevel), wrappedLevel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user