mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
add DummyWorld to use in Log crafting recipe checks
This commit is contained in:
1 parent
28c13c8322
commit
75d1fd7f12
2 files changed
+37
-4
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package mekanism.common.world;
|
||||
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProvider;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
/**
|
||||
* Dummy object for providing something to CraftingManager#findMatchingRecipe during startup, to prevent in-dev non-null assertions from breaking things
|
||||
*/
|
||||
public class DummyWorld extends World {
|
||||
|
||||
public DummyWorld() {
|
||||
super(null, null, new WorldProvider() {
|
||||
@Override
|
||||
public DimensionType getDimensionType() {
|
||||
return DimensionType.OVERWORLD;
|
||||
}
|
||||
}, null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IChunkProvider createChunkProvider() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user