Fixed serverside reference to Icon

This commit is contained in:
Krapht 2013-04-03 18:24:18 +02:00
parent 5aed4d1261
commit d79c4326cf
4 changed files with 27 additions and 25 deletions

View file

@ -19,7 +19,7 @@ import cpw.mods.fml.relauncher.SideOnly;
public class EntityBlock extends Entity {
@SideOnly(Side.CLIENT)
public Icon texture = null;
public Icon texture;
public float shadowSize = 0;
public float rotationX = 0;
@ -51,11 +51,6 @@ public class EntityBlock extends Entity {
this.motionZ = 0.0;
}
public EntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, Icon texture) {
this(world, i, j, k, iSize, jSize, kSize);
this.texture = texture;
}
@Override
public void setPosition(double d, double d1, double d2) {
super.setPosition(d, d1, d2);

View file

@ -28,6 +28,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import net.minecraftforge.oredict.ShapedOreRecipe;
import buildcraft.api.core.LaserKind;
import buildcraft.core.EntityBlock;
import buildcraft.core.ItemBlockBuildCraft;
import buildcraft.core.network.BuildCraftPacket;
import cpw.mods.fml.common.Loader;
@ -234,5 +236,8 @@ public class CoreProxy {
return CoreProxy.buildCraftPlayer;
}
public EntityBlock newEntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, LaserKind laserKind) {
return new EntityBlock(world, i, j, k, iSize, jSize, kSize);
}
}

View file

@ -27,6 +27,7 @@ import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.StringTranslate;
import net.minecraft.world.World;
import buildcraft.BuildCraftCore;
import buildcraft.api.core.LaserKind;
import buildcraft.core.EntityBlock;
import buildcraft.core.EntityEnergyLaser;
import buildcraft.core.EntityPowerLaser;
@ -169,5 +170,23 @@ public class CoreProxyClient extends CoreProxy {
return CoreProxy.buildCraftPlayer;
}
@Override
public EntityBlock newEntityBlock(World world, double i, double j, double k, double iSize, double jSize, double kSize, LaserKind laserKind) {
EntityBlock eb = super.newEntityBlock(world, i, j, k, iSize, jSize, kSize, laserKind);
switch (laserKind) {
case Blue:
eb.texture = BuildCraftCore.blueLaserTexture;
break;
case Red:
eb.texture = BuildCraftCore.redLaserTexture;
break;
case Stripes:
eb.texture = BuildCraftCore.stripesLaserTexture;
break;
}
return eb;
}
}

View file

@ -21,7 +21,6 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
@ -316,23 +315,7 @@ public class Utils {
jSize = 0.10;
}
Icon texture = BuildCraftCore.redLaserTexture;
switch (kind) {
case Blue:
texture = BuildCraftCore.blueLaserTexture;
break;
case Red:
texture = BuildCraftCore.redLaserTexture;
break;
case Stripes:
texture = BuildCraftCore.stripesLaserTexture;
break;
}
EntityBlock block = new EntityBlock(world, i, j, k, iSize, jSize, kSize, texture);
EntityBlock block = CoreProxy.proxy.newEntityBlock(world, i, j, k, iSize, jSize, kSize, kind);
world.spawnEntityInWorld(block);