mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Fixed crash due to the preview entity's world being null
This commit is contained in:
parent
808efacfbe
commit
11ce47f3de
2 changed files with 41 additions and 1 deletions
39
src/hdskins/java/com/sollace/dummy/DWorld.java
Normal file
39
src/hdskins/java/com/sollace/dummy/DWorld.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package com.sollace.dummy;
|
||||
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.GameType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldProviderSurface;
|
||||
import net.minecraft.world.WorldSettings;
|
||||
import net.minecraft.world.WorldType;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.storage.WorldInfo;
|
||||
|
||||
public class DWorld extends World {
|
||||
|
||||
public DWorld() {
|
||||
super(null, new WorldInfo(
|
||||
new WorldSettings(0, GameType.NOT_SET, false, false, WorldType.DEFAULT), "MpServer"),
|
||||
new WorldProviderSurface(), null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected IChunkProvider createChunkProvider() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isChunkLoaded(int x, int z, boolean allowEmpty) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLightBrightness(BlockPos pos) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getSpawnPoint() {
|
||||
return BlockPos.ORIGIN;
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
import com.google.common.collect.Maps;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
import com.sollace.dummy.DWorld;
|
||||
import com.voxelmodpack.hdskins.DynamicTextureImage;
|
||||
import com.voxelmodpack.hdskins.HDSkinManager;
|
||||
import com.voxelmodpack.hdskins.ImageBufferDownloadHD;
|
||||
|
@ -56,7 +57,7 @@ public class EntityPlayerModel extends EntityLivingBase {
|
|||
protected boolean previewThinArms = false;
|
||||
|
||||
public EntityPlayerModel(GameProfile profile) {
|
||||
super(null);
|
||||
super(new DWorld());
|
||||
this.profile = profile;
|
||||
this.textureManager = Minecraft.getMinecraft().getTextureManager();
|
||||
this.remoteSkinResource = new ResourceLocation("skins/preview_" + this.profile.getName() + ".png");
|
||||
|
|
Loading…
Reference in a new issue