26.1 support

This commit is contained in:
Acuadragon100
2026-04-21 21:31:33 +02:00
parent 81abcbdb86
commit 30143cbbcb
2 changed files with 7 additions and 3 deletions
@@ -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);
}