Merge branch 'master' of https://github.com/calclavia/Resonant-Induction
This commit is contained in:
commit
797f50f84a
3 changed files with 17 additions and 9 deletions
|
@ -5,7 +5,8 @@ import net.minecraft.client.model.ModelRenderer;
|
||||||
|
|
||||||
public class ModelEMContractor extends ModelBase
|
public class ModelEMContractor extends ModelBase
|
||||||
{
|
{
|
||||||
// fields
|
public boolean doSpin;
|
||||||
|
|
||||||
ModelRenderer frame1;
|
ModelRenderer frame1;
|
||||||
ModelRenderer frame2;
|
ModelRenderer frame2;
|
||||||
ModelRenderer frame3;
|
ModelRenderer frame3;
|
||||||
|
@ -37,8 +38,10 @@ public class ModelEMContractor extends ModelBase
|
||||||
ModelRenderer poletop4;
|
ModelRenderer poletop4;
|
||||||
ModelRenderer nase_depth2;
|
ModelRenderer nase_depth2;
|
||||||
|
|
||||||
public ModelEMContractor()
|
public ModelEMContractor(boolean spin)
|
||||||
{
|
{
|
||||||
|
doSpin = spin;
|
||||||
|
|
||||||
textureWidth = 128;
|
textureWidth = 128;
|
||||||
textureHeight = 128;
|
textureHeight = 128;
|
||||||
|
|
||||||
|
@ -224,9 +227,9 @@ public class ModelEMContractor extends ModelBase
|
||||||
setRotation(nase_depth2, 0F, 0F, 0F);
|
setRotation(nase_depth2, 0F, 0F, 0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(float f5, boolean rotate)
|
public void render(float f5)
|
||||||
{
|
{
|
||||||
if (rotate)
|
if (doSpin)
|
||||||
{
|
{
|
||||||
Coil1.rotateAngleY = (float) Math.toRadians(Math.toDegrees(Coil1.rotateAngleY) + 3 < 360 ? Math.toDegrees(Coil1.rotateAngleY) + 3 : 0);
|
Coil1.rotateAngleY = (float) Math.toRadians(Math.toDegrees(Coil1.rotateAngleY) + 3 < 360 ? Math.toDegrees(Coil1.rotateAngleY) + 3 : 0);
|
||||||
coil2.rotateAngleY = (float) Math.toRadians(Math.toDegrees(coil2.rotateAngleY) + 3 < 360 ? Math.toDegrees(coil2.rotateAngleY) + 3 : 0);
|
coil2.rotateAngleY = (float) Math.toRadians(Math.toDegrees(coil2.rotateAngleY) + 3 < 360 ? Math.toDegrees(coil2.rotateAngleY) + 3 : 0);
|
||||||
|
|
|
@ -11,7 +11,6 @@ import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import resonantinduction.battery.BlockBattery;
|
import resonantinduction.battery.BlockBattery;
|
||||||
import resonantinduction.contractor.BlockEMContractor;
|
import resonantinduction.contractor.BlockEMContractor;
|
||||||
import resonantinduction.model.ModelEMContractor;
|
|
||||||
import resonantinduction.tesla.BlockTesla;
|
import resonantinduction.tesla.BlockTesla;
|
||||||
import cpw.mods.fml.client.FMLClientHandler;
|
import cpw.mods.fml.client.FMLClientHandler;
|
||||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||||
|
@ -27,7 +26,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||||
public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
|
public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
{
|
{
|
||||||
public static final BlockRenderingHandler INSTANCE = new BlockRenderingHandler();
|
public static final BlockRenderingHandler INSTANCE = new BlockRenderingHandler();
|
||||||
public static final ModelEMContractor MODEL_CONTRACTOR = new ModelEMContractor();
|
|
||||||
private static final int ID = RenderingRegistry.getNextAvailableRenderId();
|
private static final int ID = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,7 +46,7 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
GL11.glTranslated(0.5, 1.5, 0.5);
|
GL11.glTranslated(0.5, 1.5, 0.5);
|
||||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(RenderEMContractor.TEXTURE);
|
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(RenderEMContractor.TEXTURE);
|
||||||
MODEL_CONTRACTOR.render(0.0625f, false);
|
RenderEMContractor.MODEL.render(0.0625f);
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
else if (block instanceof BlockBattery)
|
else if (block instanceof BlockBattery)
|
||||||
|
|
|
@ -12,7 +12,8 @@ import resonantinduction.model.ModelEMContractor;
|
||||||
|
|
||||||
public class RenderEMContractor extends TileEntitySpecialRenderer
|
public class RenderEMContractor extends TileEntitySpecialRenderer
|
||||||
{
|
{
|
||||||
public ModelEMContractor MODEL = new ModelEMContractor();
|
public static final ModelEMContractor MODEL = new ModelEMContractor(false);
|
||||||
|
public static final ModelEMContractor MODEL_SPIN = new ModelEMContractor(true);
|
||||||
public static final ResourceLocation TEXTURE = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor.png");
|
public static final ResourceLocation TEXTURE = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor.png");
|
||||||
public static final ResourceLocation TEXTURE_PUSH = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor_push.png");
|
public static final ResourceLocation TEXTURE_PUSH = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor_push.png");
|
||||||
|
|
||||||
|
@ -59,7 +60,13 @@ public class RenderEMContractor extends TileEntitySpecialRenderer
|
||||||
this.func_110628_a(TEXTURE_PUSH);
|
this.func_110628_a(TEXTURE_PUSH);
|
||||||
}
|
}
|
||||||
|
|
||||||
MODEL.render(0.0625f, ((TileEntityEMContractor)t).canFunction() && ResonantInduction.proxy.isPaused());
|
if(((TileEntityEMContractor)t).canFunction() && !ResonantInduction.proxy.isPaused())
|
||||||
|
{
|
||||||
|
MODEL_SPIN.render(0.0625f);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MODEL.render(0.0625f);
|
||||||
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue