Fix hasChunkAt(BlockPos) deprecation warning in WrapperWorld.java
alexiokay opened this issue ยท 1 comments
Description
The hasChunkAt(BlockPos) method in LevelReader has been deprecated in Minecraft 1.21.1 and should be replaced with the modern equivalent.
Current Warning
C:\...\WrapperWorld.java:1195: warning: [deprecation] hasChunkAt(BlockPos) in LevelReader has been deprecated
boolean playerReady = totalTicksWaited >= 5 && mcPlayer.hasPermissions(0) && mcPlayer.level().hasChunkAt(mcPlayer.blockPosition());
Location
- File:
neoforge/src/main/java/mcinterface1211/WrapperWorld.java - Line: ~1195
- Method: Player ready check in world ticking logic
Suggested Fix
Replace hasChunkAt(BlockPos) with isLoaded(BlockPos):
// Before
mcPlayer.level().hasChunkAt(mcPlayer.blockPosition())
// After
mcPlayer.level().isLoaded(mcPlayer.blockPosition())Priority
Low - This is a deprecation warning that doesn't affect functionality but should be addressed for future Minecraft compatibility.
Labels
- bug
- deprecation
- low-priority