mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 23:48:00 +01:00
Make DummyWorld singleton.
This commit is contained in:
parent
0ef8f810d7
commit
6ef13d9e9a
2 changed files with 30 additions and 27 deletions
|
@ -13,34 +13,38 @@ import net.minecraft.world.storage.WorldInfo;
|
||||||
|
|
||||||
public class DummyWorld extends World {
|
public class DummyWorld extends World {
|
||||||
|
|
||||||
public DummyWorld() {
|
public static final World INSTANCE = new DummyWorld();
|
||||||
super(null, new WorldInfo(
|
|
||||||
new WorldSettings(0, GameType.NOT_SET, false, false, WorldType.DEFAULT), "MpServer"),
|
|
||||||
new WorldProviderSurface(), null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
private DummyWorld() {
|
||||||
protected IChunkProvider createChunkProvider() {
|
super(null,
|
||||||
return null;
|
new WorldInfo(new WorldSettings(0, GameType.NOT_SET, false, false, WorldType.DEFAULT), "MpServer"),
|
||||||
}
|
new WorldProviderSurface(),
|
||||||
|
null,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) {
|
protected IChunkProvider createChunkProvider() {
|
||||||
return true;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState getBlockState(BlockPos pos) {
|
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) {
|
||||||
return Blocks.AIR.getDefaultState();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float getLightBrightness(BlockPos pos) {
|
public IBlockState getBlockState(BlockPos pos) {
|
||||||
return 1;
|
return Blocks.AIR.getDefaultState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockPos getSpawnPoint() {
|
public float getLightBrightness(BlockPos pos) {
|
||||||
return BlockPos.ORIGIN;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BlockPos getSpawnPoint() {
|
||||||
|
return BlockPos.ORIGIN;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||||
import com.voxelmodpack.hdskins.LocalTexture;
|
import com.voxelmodpack.hdskins.LocalTexture;
|
||||||
import com.voxelmodpack.hdskins.LocalTexture.IBlankSkinSupplier;
|
import com.voxelmodpack.hdskins.LocalTexture.IBlankSkinSupplier;
|
||||||
import com.voxelmodpack.hdskins.SkinUploader;
|
import com.voxelmodpack.hdskins.SkinUploader;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.SkinManager;
|
import net.minecraft.client.resources.SkinManager;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -43,7 +42,7 @@ public class EntityPlayerModel extends EntityLivingBase implements IBlankSkinSup
|
||||||
protected boolean previewThinArms = false;
|
protected boolean previewThinArms = false;
|
||||||
|
|
||||||
public EntityPlayerModel(GameProfile gameprofile) {
|
public EntityPlayerModel(GameProfile gameprofile) {
|
||||||
super(new DummyWorld());
|
super(DummyWorld.INSTANCE);
|
||||||
|
|
||||||
profile = gameprofile;
|
profile = gameprofile;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue