Fixed crash, and lag
This commit is contained in:
parent
f5d58b57eb
commit
98427bbe8a
2 changed files with 2 additions and 21 deletions
|
@ -43,8 +43,9 @@ public class QModPartFactory implements IPartFactory, IPartProvider {
|
|||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return new QModPart(modPart.getClass().newInstance());
|
||||
}
|
||||
} catch (InstantiationException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IllegalAccessException e) {
|
||||
|
|
|
@ -44,17 +44,11 @@ public class CablePart extends ModPart implements IEnergyConductor {
|
|||
protected ForgeDirection[] dirs = ForgeDirection.values();
|
||||
private boolean[] connections = new boolean[6];
|
||||
public boolean addedToEnergyNet = false;
|
||||
TileEntityCable entityCable = new TileEntityCable();
|
||||
|
||||
public int type = 3;
|
||||
|
||||
public CablePart(int type) {
|
||||
this.type = type;
|
||||
if(Minecraft.getMinecraft().theWorld != null){
|
||||
entityCable = new TileEntityCable();
|
||||
entityCable.setWorldObj(new fakeWorld());
|
||||
entityCable.changeType((short) type);
|
||||
}
|
||||
refreshBounding();
|
||||
connectedSides = new HashMap<ForgeDirection, TileEntity>();
|
||||
}
|
||||
|
@ -150,20 +144,6 @@ public class CablePart extends ModPart implements IEnergyConductor {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
public class fakeWorld extends WorldClient{
|
||||
public fakeWorld() {
|
||||
super(new NetHandlerPlayClient(Minecraft.getMinecraft(), null, new NetworkManager(true)), new WorldSettings(0, WorldSettings.GameType.NOT_SET,
|
||||
false, false, WorldType.DEFAULT), 0, EnumDifficulty.PEACEFUL, Minecraft.getMinecraft().theWorld.theProfiler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setBlockMetadataWithNotify(int p_72921_1_, int p_72921_2_, int p_72921_3_, int p_72921_4_, int p_72921_5_) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tag) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue