Glow Panels render in item form, use getEffectiveSide() instead of isRemote when checking packet security

This commit is contained in:
aidancbrady committed 2016-05-18 19:06:36 -04:00
1 parent 64f60150df
commit c002ac6d8a
67 files changed
+394 -169

No files matched your search

@@ -376,6 +376,7 @@ public class ClientProxy extends CommonProxy
registerItemRender(MekanismItems.GaugeDropper);
registerItemRender(MekanismItems.FactoryInstaller);
registerItemRender(MekanismItems.OtherDust);
registerItemRender(MekanismItems.GlowPanel);
ModelBakery.registerItemVariants(MekanismItems.WalkieTalkie, ItemWalkieTalkie.OFF_MODEL);
@@ -855,10 +856,11 @@ public class ClientProxy extends CommonProxy
{
MekanismRenderer.init();
ModelLoaderRegistry.registerLoader(new MekanismOBJLoader());
ModelLoaderRegistry.registerLoader(MekanismOBJLoader.INSTANCE);
MinecraftForge.EVENT_BUS.register(new CTMRegistry());
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(MekanismOBJLoader.INSTANCE);
//Register entity rendering handlers
RenderingRegistry.registerEntityRenderingHandler(EntityObsidianTNT.class, new IRenderFactory<EntityObsidianTNT>() {
@@ -9,50 +9,50 @@ import net.minecraft.util.EnumWorldBlockLayer;
/**
* Chisel Face, basically a list of IChiselTexture's
*/
public final class ChiselFace {
public final class CTMFace {
private List<ChiselTextureCTM> textureList;
private List<TextureCTM> textureList;
private List<ChiselFace> childFaces;
private List<CTMFace> childFaces;
private EnumWorldBlockLayer layer;
public ChiselFace() {
public CTMFace() {
this(new ArrayList<>(), new ArrayList<>());
}
public ChiselFace(EnumWorldBlockLayer layer) {
public CTMFace(EnumWorldBlockLayer layer) {
this();
setLayer(layer);
}
public ChiselFace(List<ChiselTextureCTM> textureList, List<ChiselFace> childFaces) {
public CTMFace(List<TextureCTM> textureList, List<CTMFace> childFaces) {
this.textureList = textureList;
this.childFaces = childFaces;
}
public List<ChiselTextureCTM> getTextureList(){
List<ChiselTextureCTM> list = new ArrayList<>();
public List<TextureCTM> getTextureList(){
List<TextureCTM> list = new ArrayList<>();
list.addAll(this.textureList);
for (ChiselFace face : childFaces){
for (CTMFace face : childFaces){
list.addAll(face.getTextureList());
}
return list;
}
public void addTexture(ChiselTextureCTM texture){
public void addTexture(TextureCTM texture){
this.textureList.add(texture);
}
public void addChildFace(ChiselFace face){
public void addChildFace(CTMFace face){
this.childFaces.add(face);
}
public boolean removeTexture(ChiselTextureCTM texture){
public boolean removeTexture(TextureCTM texture){
return this.textureList.remove(texture);
}
public boolean removeChildFace(ChiselFace face){
public boolean removeChildFace(CTMFace face){
return this.childFaces.remove(face);
}
@@ -131,7 +131,7 @@ public class CTMModelFactory implements ISmartBlockModel, ISmartItemModel, IPers
for(EnumFacing facing : EnumFacing.VALUES)
{
ChiselTextureCTM face = model.getFace(facing);
TextureCTM face = model.getFace(facing);
ICTMBlock block = (ICTMBlock)state.getBlock();
CTMData data = block.getCTMData(state);
@@ -151,7 +151,7 @@ public class CTMModelFactory implements ISmartBlockModel, ISmartItemModel, IPers
return new CTMModelFactory(faceQuads, generalQuads, model);
}
private void addAllQuads(List<BakedQuad> from, ChiselTextureCTM tex, @Nullable CTMBlockRenderContext ctx, IBlockState state, int quadGoal, List<BakedQuad> to)
private void addAllQuads(List<BakedQuad> from, TextureCTM tex, @Nullable CTMBlockRenderContext ctx, IBlockState state, int quadGoal, List<BakedQuad> to)
{
for(BakedQuad q : from)
{
@@ -30,7 +30,7 @@ public class CTMRegistry
public static List<Pair<String, String>> ctmTypes = new ArrayList<Pair<String, String>>();
public static Map<String, ChiselTextureCTM> textureCache = new HashMap<String, ChiselTextureCTM>();
public static Map<String, TextureCTM> textureCache = new HashMap<String, TextureCTM>();
@SubscribeEvent
public void onTextureStitch(TextureStitchEvent.Pre event)
@@ -69,7 +69,7 @@ public class CTMRegistry
textures.add(callback);
}
public static ChiselTextureCTM createTexture(String domain, String name)
public static TextureCTM createTexture(String domain, String name)
{
TextureSpriteCallback[] callbacks = new TextureSpriteCallback[CTM.REQUIRED_TEXTURES];
@@ -79,6 +79,6 @@ public class CTMRegistry
register(callbacks[0]);
register(callbacks[1]);
return new ChiselTextureCTM(EnumWorldBlockLayer.SOLID, callbacks);
return new TextureCTM(EnumWorldBlockLayer.SOLID, callbacks);
}
}
@@ -26,8 +26,8 @@ public class ModelCTM implements IModel
{
private Map<EnumFacing, String> overrides = Maps.newHashMap();
private transient ChiselTextureCTM faceObj;
private transient Map<EnumFacing, ChiselTextureCTM> overridesObj = new EnumMap<>(EnumFacing.class);
private transient TextureCTM faceObj;
private transient Map<EnumFacing, TextureCTM> overridesObj = new EnumMap<>(EnumFacing.class);
private transient IBakedModel modelObj;
@@ -77,12 +77,12 @@ public class ModelCTM implements IModel
overridesObj.values().forEach(t -> textures.addAll(t.getTextures()));
}
public ChiselTextureCTM getDefaultFace()
public TextureCTM getDefaultFace()
{
return faceObj;
}
public ChiselTextureCTM getFace(EnumFacing facing)
public TextureCTM getFace(EnumFacing facing)
{
return overridesObj.getOrDefault(facing, faceObj);
}
@@ -13,13 +13,13 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.util.ResourceLocation;
public class ChiselTextureCTM
public class TextureCTM
{
protected EnumWorldBlockLayer layer;
public TextureSpriteCallback[] sprites;
public ChiselTextureCTM(EnumWorldBlockLayer layer, TextureSpriteCallback[] sprites)
public TextureCTM(EnumWorldBlockLayer layer, TextureSpriteCallback[] sprites)
{
this.layer = layer;
this.sprites = sprites;
@@ -9,20 +9,28 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.vecmath.Matrix4f;
import mcmultipart.client.multipart.ISmartMultipartModel;
import mekanism.api.EnumColor;
import mekanism.client.render.ctm.CTMModelFactory;
import mekanism.common.multipart.GlowPanelBlockState;
import mekanism.common.multipart.PartGlowPanel;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.client.model.IModelPart;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IFlexibleBakedModel;
import net.minecraftforge.client.model.IModelState;
import net.minecraftforge.client.model.IPerspectiveAwareModel;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.TRSRTransformation;
import net.minecraftforge.client.model.obj.OBJModel;
@@ -36,55 +44,96 @@ import net.minecraftforge.client.model.obj.OBJModel.Vertex;
import net.minecraftforge.client.model.pipeline.LightUtil;
import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad;
import net.minecraftforge.common.property.IExtendedBlockState;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import codechicken.lib.vec.Matrix4;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
public class MekanismSmartOBJModel extends OBJBakedModel implements ISmartMultipartModel
public class GlowPanelModel extends OBJBakedModel implements ISmartMultipartModel
{
private IBakedModel baseModel;
private HashMap<TransformType, Matrix4> transformationMap = new HashMap<TransformType, Matrix4>();
private static Map<Integer, MekanismSmartOBJModel> glowPanelCache = new HashMap<Integer, MekanismSmartOBJModel>();
private static Map<Integer, GlowPanelModel> glowPanelCache = new HashMap<Integer, GlowPanelModel>();
private static Map<Integer, GlowPanelModel> glowPanelItemCache = new HashMap<Integer, GlowPanelModel>();
private Set<BakedQuad> bakedQuads;
private IBlockState tempState;
private TextureAtlasSprite tempSprite;
private ItemStack tempStack;
public MekanismSmartOBJModel(IBakedModel base, OBJModel model, IModelState state, VertexFormat format, ImmutableMap<String, TextureAtlasSprite> textures, HashMap<TransformType, Matrix4> transform)
public GlowPanelModel(IBakedModel base, OBJModel model, IModelState state, VertexFormat format, ImmutableMap<String, TextureAtlasSprite> textures, HashMap<TransformType, Matrix4> transform)
{
model.super(model, state, format, textures);
baseModel = base;
transformationMap = transform;
}
public EnumColor getColor()
{
if(tempStack != null)
{
return EnumColor.DYES[tempStack.getItemDamage()];
}
if(tempState != null)
{
return ((IExtendedBlockState)tempState).getValue(GlowPanelBlockState.colorState).color;
}
return EnumColor.WHITE;
}
@Override
public OBJBakedModel handlePartState(IBlockState state)
{
if(isGlowPanel(state))
int hash = PartGlowPanel.hash((IExtendedBlockState)state);
EnumColor color = ((IExtendedBlockState)state).getValue(GlowPanelBlockState.colorState).color;
if(!glowPanelCache.containsKey(hash))
{
int hash = PartGlowPanel.hash((IExtendedBlockState)state);
EnumColor color = ((IExtendedBlockState)state).getValue(GlowPanelBlockState.colorState).color;
if(!glowPanelCache.containsKey(hash))
{
MekanismSmartOBJModel model = new MekanismSmartOBJModel(baseModel, getModel(), getState(), getFormat(), getTextures(), transformationMap);
model.tempState = state;
glowPanelCache.put(hash, model);
}
return glowPanelCache.get(hash);
GlowPanelModel model = new GlowPanelModel(baseModel, getModel(), getState(), getFormat(), getTextures(), transformationMap);
model.tempState = state;
glowPanelCache.put(hash, model);
}
return this;
return glowPanelCache.get(hash);
}
public boolean isGlowPanel(IBlockState state)
@Override
public IBakedModel handleItemState(ItemStack stack)
{
return state instanceof IExtendedBlockState && ((IExtendedBlockState)state).getUnlistedProperties().containsKey(GlowPanelBlockState.colorState);
if(glowPanelItemCache.containsKey(stack.getItemDamage()))
return glowPanelItemCache.get(stack.getItemDamage());
ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
builder.put(ModelLoader.White.loc.toString(), ModelLoader.White.instance);
TextureAtlasSprite missing = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(new ResourceLocation("missingno").toString());
for(String s : getModel().getMatLib().getMaterialNames())
{
TextureAtlasSprite sprite = null;
if(sprite==null)
sprite = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(getModel().getMatLib().getMaterial(s).getTexture().getTextureLocation().toString());
if(sprite==null)
sprite = missing;
builder.put(s, sprite);
}
builder.put("missingno", missing);
GlowPanelModel bakedModel = new GlowPanelModel(baseModel, getModel(), getState(), getFormat(), builder.build(), transformationMap);
bakedModel.tempStack = stack;
glowPanelItemCache.put(stack.getItemDamage(), bakedModel);
return bakedModel;
}
@Override
@@ -97,28 +146,34 @@ public class MekanismSmartOBJModel extends OBJBakedModel implements ISmartMultip
Optional<TRSRTransformation> transform = Optional.absent();
Set<Face> coloredFaces = new HashSet<Face>();
for(Group g : this.getModel().getMatLib().getGroups().values())
for(Group g : getModel().getMatLib().getGroups().values())
{
if(getState() instanceof OBJState)
{
OBJState state = (OBJState) this.getState();
OBJState state = (OBJState)getState();
if(state.parent != null)
{
transform = state.parent.apply(Optional.<IModelPart> absent());
transform = state.parent.apply(Optional.absent());
}
if(state.getGroupsWithVisibility(true).contains(g.getName()))
{
faces.addAll(g.applyTransform(transform));
LinkedHashSet<Face> tempFaces = g.applyTransform(transform);
faces.addAll(tempFaces);
if(g.getName().equals("light"))
{
coloredFaces.addAll(tempFaces);
}
}
}
else {
transform = getState().apply(Optional.<IModelPart> absent());
transform = getState().apply(Optional.absent());
LinkedHashSet<Face> tempFaces = g.applyTransform(transform);
faces.addAll(tempFaces);
if(isGlowPanel(tempState) && g.getName().equals("light"))
if(g.getName().equals("light"))
{
coloredFaces.addAll(tempFaces);
}
@@ -147,7 +202,7 @@ public class MekanismSmartOBJModel extends OBJBakedModel implements ISmartMultip
if(coloredFaces.contains(f))
{
EnumColor c = ((IExtendedBlockState) tempState).getValue(GlowPanelBlockState.colorState).color;
EnumColor c = getColor();
color = new float[] {c.getColor(0), c.getColor(1), c.getColor(2), 1};
}
@@ -249,4 +304,34 @@ public class MekanismSmartOBJModel extends OBJBakedModel implements ISmartMultip
{
return getTexturesForOBJModel(this);
}
private Pair<IPerspectiveAwareModel, Matrix4f> thirdPersonTransform;
@Override
public Pair<? extends IFlexibleBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType)
{
if(cameraTransformType == TransformType.GUI)
{
GlStateManager.translate(0.3F, 0.25F, 0.0F);
GlStateManager.rotate(90, 1, 0, 0);
GlStateManager.scale(1.6F, 1.6F, 1.6F);
}
else if(cameraTransformType == TransformType.FIRST_PERSON)
{
GlStateManager.translate(0.0F, 0.3F, 0.0F);
}
else if(cameraTransformType == TransformType.THIRD_PERSON)
{
GlStateManager.translate(0.0F, -0.1F, 0.0F);
if(thirdPersonTransform == null)
{
thirdPersonTransform = ImmutablePair.of(this, CTMModelFactory.DEFAULT_BLOCK_THIRD_PERSON_MATRIX);
}
return thirdPersonTransform;
}
return Pair.of(this, null);
}
}
@@ -4,16 +4,95 @@ import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import mekanism.client.render.obj.MekanismOBJModel.OBJModelType;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.model.IBakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.ModelBakeEvent;
import net.minecraftforge.client.model.IModel;
import net.minecraftforge.client.model.IModelState;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.client.model.obj.OBJLoader;
import net.minecraftforge.client.model.obj.OBJModel;
import net.minecraftforge.client.model.obj.OBJModel.OBJBakedModel;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import codechicken.lib.vec.Matrix4;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
public class MekanismOBJLoader extends OBJLoader
{
public static final MekanismOBJLoader INSTANCE = new MekanismOBJLoader();
private final Map<ResourceLocation, MekanismOBJModel> modelCache = new HashMap<ResourceLocation, MekanismOBJModel>();
private static final ImmutableMap<String, String> flipData = ImmutableMap.of("flip-v", String.valueOf(true));
public static final String[] OBJ_RENDERS = new String[] {"glow_panel"};
@SubscribeEvent
public void onModelBake(ModelBakeEvent event) throws IOException
{
for(String s : OBJ_RENDERS)
{
ModelResourceLocation model = new ModelResourceLocation("mekanism:" + s, "inventory");
Object obj = event.modelRegistry.getObject(model);
if(obj instanceof IBakedModel)
{
event.modelRegistry.putObject(model, createBakedObjItemModel((IBakedModel)obj, "mekanism:models/block/" + s + ".obj.mek", new OBJModel.OBJState(Lists.newArrayList(OBJModel.Group.ALL), true), DefaultVertexFormats.ITEM));
}
}
}
public OBJBakedModel createBakedObjItemModel(IBakedModel existingModel, String name, IModelState state, VertexFormat format)
{
try {
Function<ResourceLocation, TextureAtlasSprite> textureGetter = new Function<ResourceLocation, TextureAtlasSprite>() {
public TextureAtlasSprite apply(ResourceLocation location)
{
return Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(location.toString());
}
};
ResourceLocation modelLocation = new ResourceLocation(name);
OBJModel objModel = (OBJModel)OBJLoader.instance.loadModel(modelLocation);
objModel = (OBJModel)objModel.process(flipData);
ImmutableMap.Builder<String, TextureAtlasSprite> builder = ImmutableMap.builder();
builder.put(ModelLoader.White.loc.toString(), ModelLoader.White.instance);
TextureAtlasSprite missing = textureGetter.apply(new ResourceLocation("missingno"));
for(String s : objModel.getMatLib().getMaterialNames())
{
if(objModel.getMatLib().getMaterial(s).getTexture().getTextureLocation().getResourcePath().startsWith("#"))
{
FMLLog.severe("OBJLoader: Unresolved texture '%s' for obj model '%s'", objModel.getMatLib().getMaterial(s).getTexture().getTextureLocation().getResourcePath(), modelLocation);
builder.put(s, missing);
}
else {
builder.put(s, textureGetter.apply(objModel.getMatLib().getMaterial(s).getTexture().getTextureLocation()));
}
}
builder.put("missingno", missing);
return new GlowPanelModel(existingModel, objModel, state, format, builder.build(), new HashMap<TransformType, Matrix4>());
} catch(Exception e) {
e.printStackTrace();
}
return null;
}
@Override
public boolean accepts(ResourceLocation modelLocation)
{
@@ -29,8 +108,11 @@ public class MekanismOBJLoader extends OBJLoader
if(model instanceof OBJModel)
{
MekanismOBJModel mekModel = new MekanismOBJModel(((OBJModel)model).getMatLib(), loc);
modelCache.put(loc, mekModel);
if(loc.getResourcePath().contains("glow_panel"))
{
MekanismOBJModel mekModel = new MekanismOBJModel(OBJModelType.GLOW_PANEL, ((OBJModel)model).getMatLib(), loc);
modelCache.put(loc, mekModel);
}
}
}
@@ -11,15 +11,30 @@ import com.google.common.base.Function;
public class MekanismOBJModel extends OBJModel
{
public MekanismOBJModel(MaterialLibrary matLib, ResourceLocation modelLocation)
public OBJModelType modelType;
public MekanismOBJModel(OBJModelType type, MaterialLibrary matLib, ResourceLocation modelLocation)
{
super(matLib, modelLocation);
modelType = type;
}
@Override
public IFlexibleBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter)
{
IFlexibleBakedModel preBaked = super.bake(state, format, bakedTextureGetter);
return new MekanismSmartOBJModel(preBaked, this, state, format, MekanismSmartOBJModel.getTexturesForOBJModel(preBaked), null);
if(modelType == OBJModelType.GLOW_PANEL)
{
return new GlowPanelModel(preBaked, this, state, format, GlowPanelModel.getTexturesForOBJModel(preBaked), null);
}
return null;
}
public static enum OBJModelType
{
GLOW_PANEL
}
}
@@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import net.minecraftforge.fml.common.FMLCommonHandler;
import mekanism.common.PacketHandler;
import mekanism.common.tile.TileEntityBasicBlock;
@@ -19,7 +20,7 @@ public class TileEntityInternalMultiblock extends TileEntityBasicBlock
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -14,6 +14,7 @@ import mcmultipart.item.ItemMultiPart;
import mcmultipart.multipart.IMultipart;
import mekanism.api.EnumColor;
import mekanism.common.Mekanism;
import mekanism.common.base.IMetaItem;
import mekanism.common.util.LangUtils;
//import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -26,7 +27,7 @@ import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class ItemGlowPanel extends ItemMultiPart
public class ItemGlowPanel extends ItemMultiPart implements IMetaItem
{
public ItemGlowPanel()
{
@@ -48,53 +49,11 @@ public class ItemGlowPanel extends ItemMultiPart
{
return new PartGlowPanel(col, orientation);
}
/*
if(world.getTileEntity(pos.x, pos.y, pos.z) instanceof IMultipartContainer && ((TileMultipart) world.getTileEntity(pos.x, pos.y, pos.z)).partMap(orientation.ordinal()) instanceof HollowMicroblock)
{
return new PartGlowPanel(col, orientation);
}
*/
}
return null;
}
/*
public EnumFacing getSideFromVector3(Vec3 vector)
{
if(Math.abs(vector.xCoord) > Math.abs(vector.yCoord) && Math.abs(vector.xCoord) > Math.abs(vector.zCoord))
{
if((vector.xCoord < 0.5 && vector.xCoord > 0) || vector.xCoord == -0.5)
{
return EnumFacing.EAST;
}
return EnumFacing.WEST;
}
else if(Math.abs(vector.y) > Math.abs(vector.x) && Math.abs(vector.y) > Math.abs(vector.z))
{
if((vector.y < 0.5 && vector.y > 0) || vector.y == -0.5)
{
return EnumFacing.UP;
}
return EnumFacing.DOWN;
}
else if(Math.abs(vector.z) > Math.abs(vector.x) && Math.abs(vector.z) > Math.abs(vector.y))
{
if((vector.z < 0.5 && vector.z > 0) || vector.z == -0.5)
{
return EnumFacing.SOUTH;
}
return EnumFacing.NORTH;
}
return null;
}
*/
@Override
public void getSubItems(Item item, CreativeTabs tab, List listToAddTo)
{
@@ -131,4 +90,16 @@ public class ItemGlowPanel extends ItemMultiPart
{
return true;
}
@Override
public String getTexture(int meta)
{
return "glow_panel";
}
@Override
public int getVariants()
{
return EnumColor.DYES.length;
}
}
@@ -8,7 +8,10 @@ import mcmultipart.multipart.MultipartRegistry;
import mekanism.common.MekanismBlocks;
import mekanism.common.Tier;
import mekanism.common.block.states.BlockStateMachine.MachineType;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.event.FMLInterModComms;
/*
import codechicken.microblock.BlockMicroMaterial;
@@ -192,4 +195,14 @@ public class MultipartMekanism implements IPartFactory
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.BasicBlock2, 1, 0));
FMLInterModComms.sendMessage("ForgeMicroblock", "microMaterial", new ItemStack(MekanismBlocks.CardboardBox));
}
public static void dropItem(ItemStack stack, World world, Vec3 pos)
{
EntityItem item = new EntityItem(world, pos.xCoord, pos.yCoord, pos.zCoord, stack);
item.motionX = world.rand.nextGaussian() * 0.05;
item.motionY = world.rand.nextGaussian() * 0.05 + 0.2;
item.motionZ = world.rand.nextGaussian() * 0.05;
item.setDefaultPickupDelay();
world.spawnEntityInWorld(item);
}
}
@@ -12,6 +12,7 @@ import mcmultipart.raytrace.PartMOP;
import mcmultipart.util.TransformationHelper;
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.Pos3D;
import mekanism.common.MekanismItems;
import mekanism.common.block.states.BlockStateFacing;
import mekanism.common.multipart.GlowPanelBlockState.GlowPanelColorProperty;
@@ -100,7 +101,7 @@ public class PartGlowPanel extends Multipart implements IOccludingPart
{
if(!getWorld().isRemote && !canStay())
{
//TileMultipart.dropItem(new ItemStack(MekanismItems.GlowPanel, 1, colour.getMetaValue()), getWorld(), Vector3.fromTileEntityCenter(tile()));
MultipartMekanism.dropItem(new ItemStack(MekanismItems.GlowPanel, 1, colour.getMetaValue()), getWorld(), new Pos3D(getPos()).translate(0.5, 0.5, 0.5));
getContainer().removePart(this);
}
}
@@ -110,7 +111,7 @@ public class PartGlowPanel extends Multipart implements IOccludingPart
{
if(!getWorld().isRemote && !canStay())
{
//TileMultipart.dropItem(new ItemStack(MekanismItems.GlowPanel, 1, colour.getMetaValue()), getWorld(), Vector3.fromTileEntityCenter(tile()));
MultipartMekanism.dropItem(new ItemStack(MekanismItems.GlowPanel, 1, colour.getMetaValue()), getWorld(), new Pos3D(getPos()).translate(0.5, 0.5, 0.5));
getContainer().removePart(this);
}
}
@@ -32,6 +32,7 @@ import mekanism.common.util.StatUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedMachineRecipe<RECIPE>> extends TileEntityBasicMachine<AdvancedMachineInput, ItemStackOutput, RECIPE> implements IGasHandler, ITubeConnection
{
@@ -314,7 +315,7 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -15,6 +15,7 @@ import mekanism.common.recipe.inputs.IntegerInput;
import mekanism.common.recipe.machines.AmbientGasRecipe;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityAmbientAccumulator extends TileEntityContainerBlock implements IGasHandler, ITubeConnection
{
@@ -111,7 +112,7 @@ public class TileEntityAmbientAccumulator extends TileEntityContainerBlock imple
@Override
public void handlePacketData(ByteBuf data)
{
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
int gasID = data.readInt();
@@ -31,6 +31,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ITickable;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Optional.Interface;
import net.minecraftforge.fml.common.Optional.Method;
@@ -122,7 +123,7 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
facing = EnumFacing.getFront(dataStream.readInt());
redstone = dataStream.readBoolean();
@@ -30,6 +30,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.common.FMLCommonHandler;
public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>, OUTPUT extends MachineOutput<OUTPUT>, RECIPE extends MachineRecipe<INPUT, OUTPUT, RECIPE>> extends TileEntityNoisyElectricBlock implements IElectricMachine<INPUT, OUTPUT, RECIPE>, IComputerIntegration, ISideConfiguration, IUpgradeTile, IRedstoneControl, IConfigCardAccess, ISecurityTile
{
@@ -157,7 +158,7 @@ public abstract class TileEntityBasicMachine<INPUT extends MachineInput<INPUT>,
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
operatingTicks = dataStream.readInt();
clientActive = dataStream.readBoolean();
@@ -31,6 +31,7 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.ITickable;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Optional.Interface;
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
@@ -294,7 +295,7 @@ public class TileEntityBin extends TileEntityBasicBlock implements ISidedInvento
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
isActive = dataStream.readBoolean();
clientAmount = dataStream.readInt();
@@ -24,6 +24,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityBoilerCasing extends TileEntityMultiblock<SynchronizedBoilerData> implements IHeatTransfer
{
@@ -296,7 +297,7 @@ public class TileEntityBoilerCasing extends TileEntityMultiblock<SynchronizedBoi
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(clientHasStructure)
{
@@ -26,6 +26,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import cofh.api.energy.IEnergyContainerItem;
@@ -184,7 +185,7 @@ public class TileEntityChargepad extends TileEntityNoisyElectricBlock
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
clientActive = dataStream.readBoolean();
@@ -43,6 +43,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISideConfiguration, IUpgradeTile, ISustainedData, ITankManager, IConfigCardAccess, ISecurityTile
{
@@ -211,7 +212,7 @@ public class TileEntityChemicalCrystallizer extends TileEntityNoisyElectricBlock
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
isActive = dataStream.readBoolean();
operatingTicks = dataStream.readInt();
@@ -39,6 +39,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IGasHandler, IUpgradeTile, ISustainedData, ITankManager, ISecurityTile
{
@@ -268,7 +269,7 @@ public class TileEntityChemicalDissolutionChamber extends TileEntityNoisyElectri
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
isActive = dataStream.readBoolean();
controlType = RedstoneControl.values()[dataStream.readInt()];
@@ -40,6 +40,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumFacing.Axis;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISustainedData, IUpgradeTile, IUpgradeInfoHandler, ITankManager, ISecurityTile
{
@@ -222,7 +223,7 @@ public class TileEntityChemicalInfuser extends TileEntityNoisyElectricBlock impl
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
isActive = dataStream.readBoolean();
controlType = RedstoneControl.values()[dataStream.readInt()];
@@ -37,6 +37,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumFacing.Axis;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock implements ITubeConnection, IRedstoneControl, IUpgradeTile, ISustainedData, ITankManager, ISecurityTile
{
@@ -242,7 +243,7 @@ public class TileEntityChemicalOxidizer extends TileEntityNoisyElectricBlock imp
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
isActive = dataStream.readBoolean();
controlType = RedstoneControl.values()[dataStream.readInt()];
@@ -51,6 +51,7 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock implements IGasHandler, ITubeConnection, IRedstoneControl, IFluidHandler, IUpgradeTile, ISustainedData, IUpgradeInfoHandler, ITankManager, ISecurityTile
{
@@ -229,7 +230,7 @@ public class TileEntityChemicalWasher extends TileEntityNoisyElectricBlock imple
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
isActive = dataStream.readBoolean();
controlType = RedstoneControl.values()[dataStream.readInt()];
@@ -61,6 +61,7 @@ import net.minecraft.world.WorldServer;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -713,7 +714,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -789,7 +790,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
int type = dataStream.readInt();
@@ -27,6 +27,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTankData> implements IFluidContainerManager
{
@@ -251,7 +252,7 @@ public class TileEntityDynamicTank extends TileEntityMultiblock<SynchronizedTank
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(clientHasStructure)
{
@@ -19,6 +19,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Optional.Method;
public abstract class TileEntityElectricBlock extends TileEntityContainerBlock implements IEnergyWrapper
@@ -135,7 +136,7 @@ public abstract class TileEntityElectricBlock extends TileEntityContainerBlock i
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
setEnergy(dataStream.readDouble());
}
@@ -45,6 +45,7 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.ByteBufUtils;
public class TileEntityElectricPump extends TileEntityElectricBlock implements IFluidHandler, ISustainedTank, IConfigurable, IRedstoneControl, IUpgradeTile, ITankManager, IComputerIntegration, ISecurityTile
@@ -269,7 +270,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readInt() == 1)
{
@@ -52,6 +52,7 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.ByteBufUtils;
public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock implements IFluidHandler, IComputerIntegration, ITubeConnection, ISustainedData, IGasHandler, IUpgradeTile, IUpgradeInfoHandler, ITankManager, IRedstoneControl, IActiveState, ISecurityTile
@@ -385,7 +386,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
byte type = dataStream.readByte();
@@ -403,7 +404,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -29,6 +29,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityEnergyCube extends TileEntityElectricBlock implements IComputerIntegration, IRedstoneControl, ISideConfiguration, ISecurityTile
{
@@ -202,7 +203,7 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements ICo
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
EnergyCubeTier prevTier = tier;
@@ -60,6 +60,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -746,7 +747,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -766,7 +767,7 @@ public class TileEntityFactory extends TileEntityNoisyElectricBlock implements I
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
clientActive = dataStream.readBoolean();
RecipeType oldRecipe = recipeType;
@@ -36,6 +36,7 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityFluidTank extends TileEntityContainerBlock implements IActiveState, IConfigurable, IFluidHandler, ISustainedTank, IFluidContainerManager, ITankManager, ISecurityTile
{
@@ -319,7 +320,7 @@ public class TileEntityFluidTank extends TileEntityContainerBlock implements IAc
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
FluidTankTier prevTier = tier;
@@ -42,6 +42,7 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.ByteBufUtils;
public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implements IComputerIntegration, IConfigurable, IFluidHandler, ISustainedTank, IUpgradeTile, IRedstoneControl, ISecurityTile
@@ -238,7 +239,7 @@ public class TileEntityFluidicPlenisher extends TileEntityElectricBlock implemen
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
finishedCalc = dataStream.readBoolean();
controlType = RedstoneControl.values()[dataStream.readInt()];
@@ -30,6 +30,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock implements ISideConfiguration, IUpgradeTile, IRedstoneControl, IConfigCardAccess, ISecurityTile
{
@@ -565,7 +566,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -601,7 +602,7 @@ public class TileEntityFormulaicAssemblicator extends TileEntityElectricBlock im
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
autoMode = dataStream.readBoolean();
operatingTicks = dataStream.readInt();
@@ -20,6 +20,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityFuelwoodHeater extends TileEntityContainerBlock implements IHeatTransfer, ISecurityTile, IActiveState
{
@@ -141,7 +142,7 @@ public class TileEntityFuelwoodHeater extends TileEntityContainerBlock implement
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
temperature = dataStream.readDouble();
clientActive = dataStream.readBoolean();
@@ -34,6 +34,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityGasTank extends TileEntityContainerBlock implements IGasHandler, ITubeConnection, IRedstoneControl, ISideConfiguration, ISecurityTile
{
@@ -217,7 +218,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -237,7 +238,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
GasTankTier prevTier = tier;
@@ -21,6 +21,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityInductionCasing extends TileEntityMultiblock<SynchronizedMatrixData> implements IStrictEnergyStorage, IComputerIntegration
{
@@ -102,7 +103,7 @@ public class TileEntityInductionCasing extends TileEntityMultiblock<Synchronized
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(clientHasStructure)
{
@@ -11,6 +11,7 @@ import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityInductionCell extends TileEntityBasicBlock implements IStrictEnergyStorage
{
@@ -31,7 +32,7 @@ public class TileEntityInductionCell extends TileEntityBasicBlock implements ISt
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
InductionCellTier prevTier = tier;
@@ -30,6 +30,7 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.Optional.Interface;
import net.minecraftforge.fml.common.Optional.InterfaceList;
import net.minecraftforge.fml.common.Optional.Method;
@@ -156,7 +157,7 @@ public class TileEntityInductionPort extends TileEntityInductionCasing implement
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
boolean prevMode = mode;
mode = dataStream.readBoolean();
@@ -8,6 +8,7 @@ import mekanism.common.Tier.InductionProviderTier;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityInductionProvider extends TileEntityBasicBlock
{
@@ -26,7 +27,7 @@ public class TileEntityInductionProvider extends TileEntityBasicBlock
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
InductionProviderTier prevTier = tier;
tier = InductionProviderTier.values()[dataStream.readInt()];
@@ -22,6 +22,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IActiveState
{
@@ -166,7 +167,7 @@ public class TileEntityLaser extends TileEntityNoisyElectricBlock implements IAc
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
clientActive = dataStream.readBoolean();
@@ -26,6 +26,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityLaserAmplifier extends TileEntityContainerBlock implements ILaserReceptor, IRedstoneControl, ICableOutputter, IStrictEnergyStorage, IComputerIntegration, ISecurityTile
{
@@ -220,7 +221,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
switch(dataStream.readInt())
{
@@ -243,7 +244,7 @@ public class TileEntityLaserAmplifier extends TileEntityContainerBlock implement
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
on = dataStream.readBoolean();
minThreshold = dataStream.readDouble();
@@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MovingObjectPosition;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityLaserTractorBeam extends TileEntityContainerBlock implements ILaserReceptor, ISecurityTile
{
@@ -214,7 +215,7 @@ public class TileEntityLaserTractorBeam extends TileEntityContainerBlock impleme
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
on = dataStream.readBoolean();
collectedEnergy = dataStream.readDouble();
@@ -38,6 +38,7 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityLogisticalSorter extends TileEntityElectricBlock implements IRedstoneControl, IActiveState, ISpecialConfigData, ISustainedData, ISecurityTile
{
@@ -275,7 +276,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -324,7 +325,7 @@ public class TileEntityLogisticalSorter extends TileEntityElectricBlock implemen
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
int type = dataStream.readInt();
@@ -42,6 +42,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock implements IComputerIntegration, ISideConfiguration, IUpgradeTile, IRedstoneControl, IConfigCardAccess, ISecurityTile
{
@@ -385,7 +386,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
infuseStored.amount = dataStream.readInt();
return;
@@ -393,7 +394,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityNoisyElectricBlock i
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
clientActive = dataStream.readBoolean();
operatingTicks = dataStream.readInt();
@@ -23,6 +23,7 @@ import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -229,7 +230,7 @@ public abstract class TileEntityMultiblock<T extends SynchronizedData<T>> extend
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(structure == null)
{
@@ -28,6 +28,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.common.util.Constants.NBT;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.oredict.OreDictionary;
public class TileEntityOredictionificator extends TileEntityContainerBlock implements IRedstoneControl, ISpecialConfigData, ISustainedData, ISecurityTile
@@ -224,7 +225,7 @@ public class TileEntityOredictionificator extends TileEntityContainerBlock imple
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
int type = dataStream.readInt();
@@ -41,6 +41,7 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, PressurizedOutput, PressurizedRecipe> implements IFluidHandler, IGasHandler, ITubeConnection, ISustainedData, ITankManager
{
@@ -247,7 +248,7 @@ public class TileEntityPRC extends TileEntityBasicMachine<PressurizedInput, Pres
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -40,6 +40,7 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityQuantumEntangloporter extends TileEntityElectricBlock implements ISideConfiguration, ITankManager, IFluidHandler, IFrequencyHandler, IGasHandler, IHeatTransfer, ITubeConnection, IComputerIntegration, ISecurityTile
{
@@ -253,7 +254,7 @@ public class TileEntityQuantumEntangloporter extends TileEntityElectricBlock imp
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -282,7 +283,7 @@ public class TileEntityQuantumEntangloporter extends TileEntityElectricBlock imp
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
lastTransferLoss = dataStream.readDouble();
lastEnvironmentLoss = dataStream.readDouble();
@@ -23,6 +23,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityResistiveHeater extends TileEntityNoisyElectricBlock implements IHeatTransfer, IComputerIntegration, IRedstoneControl, ISecurityTile
{
@@ -163,7 +164,7 @@ public class TileEntityResistiveHeater extends TileEntityNoisyElectricBlock impl
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
energyUsage = MekanismUtils.convertToJoules(dataStream.readInt());
maxEnergy = energyUsage * 400;
@@ -173,7 +174,7 @@ public class TileEntityResistiveHeater extends TileEntityNoisyElectricBlock impl
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
energyUsage = dataStream.readDouble();
temperature = dataStream.readDouble();
@@ -47,6 +47,7 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.network.ByteBufUtils;
public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock implements IActiveState, ISustainedData, IFluidHandler, IGasHandler, ITubeConnection, IRedstoneControl, IUpgradeTile, IUpgradeInfoHandler, ITankManager, ISecurityTile
@@ -253,7 +254,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -272,7 +273,7 @@ public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock imp
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
mode = dataStream.readInt();
isActive = dataStream.readBoolean();
@@ -21,6 +21,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -147,7 +148,7 @@ public class TileEntitySecurityDesk extends TileEntityContainerBlock implements
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -191,7 +192,7 @@ public class TileEntitySecurityDesk extends TileEntityContainerBlock implements
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -23,6 +23,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -133,7 +134,7 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
clientActive = dataStream.readBoolean();
controlType = RedstoneControl.values()[dataStream.readInt()];
@@ -33,6 +33,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.biome.BiomeGenDesert;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -179,7 +180,7 @@ public class TileEntitySolarNeutronActivator extends TileEntityContainerBlock im
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
isActive = dataStream.readBoolean();
recipeTicks = dataStream.readInt();
@@ -589,7 +589,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -618,7 +618,7 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements ICo
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -36,6 +36,7 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -567,7 +568,7 @@ public class TileEntityThermalEvaporationController extends TileEntityThermalEva
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -19,6 +19,7 @@ import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityBioGenerator extends TileEntityGenerator implements IFluidHandler, ISustainedData
{
@@ -200,7 +201,7 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements IFlui
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
bioFuelSlot.fluidStored = dataStream.readInt();
}
@@ -21,6 +21,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityGasGenerator extends TileEntityGenerator implements IGasHandler, ITubeConnection, ISustainedData
{
@@ -236,7 +237,7 @@ public class TileEntityGasGenerator extends TileEntityGenerator implements IGasH
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(dataStream.readBoolean())
{
@@ -23,6 +23,7 @@ import mekanism.common.util.MekanismUtils;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -150,7 +151,7 @@ public abstract class TileEntityGenerator extends TileEntityNoisyElectricBlock i
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
clientActive = dataStream.readBoolean();
controlType = RedstoneControl.values()[dataStream.readInt()];
@@ -30,6 +30,7 @@ import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidContainerItem;
import net.minecraftforge.fluids.IFluidHandler;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityHeatGenerator extends TileEntityGenerator implements IFluidHandler, ISustainedData, IHeatTransfer
{
@@ -265,7 +266,7 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements IFlu
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
producingEnergy = dataStream.readDouble();
@@ -12,6 +12,7 @@ import micdoodle8.mods.galacticraft.api.world.ISolarLevel;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.world.biome.BiomeGenDesert;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -172,7 +173,7 @@ public class TileEntitySolarGenerator extends TileEntityGenerator
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
seesSun = dataStream.readBoolean();
}
@@ -29,6 +29,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -229,7 +230,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -245,7 +246,7 @@ public class TileEntityReactorController extends TileEntityReactorBlock implemen
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
boolean formed = dataStream.readBoolean();
@@ -9,6 +9,7 @@ import mekanism.common.util.LangUtils;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fml.common.FMLCommonHandler;
import dan200.computercraft.api.lua.LuaException;
public class TileEntityReactorLogicAdapter extends TileEntityReactorBlock implements IComputerIntegration
@@ -98,7 +99,7 @@ public class TileEntityReactorLogicAdapter extends TileEntityReactorBlock implem
@Override
public void handlePacketData(ByteBuf dataStream)
{
if(!worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isServer())
{
int type = dataStream.readInt();
@@ -116,7 +117,7 @@ public class TileEntityReactorLogicAdapter extends TileEntityReactorBlock implem
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
logicType = ReactorLogic.values()[dataStream.readInt()];
activeCooled = dataStream.readBoolean();
@@ -25,6 +25,7 @@ import mekanism.generators.common.content.turbine.TurbineUpdateProtocol;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.common.FMLCommonHandler;
public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTurbineData> implements IStrictEnergyStorage
{
@@ -201,7 +202,7 @@ public class TileEntityTurbineCasing extends TileEntityMultiblock<SynchronizedTu
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
if(clientHasStructure)
{
@@ -15,6 +15,7 @@ import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -197,7 +198,7 @@ public class TileEntityTurbineRotor extends TileEntityBasicBlock
{
super.handlePacketData(dataStream);
if(worldObj.isRemote)
if(FMLCommonHandler.instance().getEffectiveSide().isClient())
{
int prevBlades = blades;
int prevIndex = clientIndex;