Merge branch 'master' of https://github.com/calclavia/Resonant-Induction
This commit is contained in:
commit
2d742be347
8 changed files with 104 additions and 2 deletions
|
@ -3,5 +3,6 @@
|
|||
itemGroup.resonantinduction=Resonant Induction
|
||||
|
||||
tile.resonantinduction\:tesla.name=Tesla Coil
|
||||
tile.resonantinduction\:contractor.name=Electromagnetic Contractor
|
||||
|
||||
item.resonantinduction\:entangler.name=Quantum Entangler
|
|
@ -6,8 +6,10 @@ package resonantinduction;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import resonantinduction.base.Vector3;
|
||||
import resonantinduction.contractor.TileEntityEMContractor;
|
||||
import resonantinduction.fx.FXElectricBolt;
|
||||
import resonantinduction.render.BlockRenderingHandler;
|
||||
import resonantinduction.render.RenderEMContractor;
|
||||
import resonantinduction.render.RenderTesla;
|
||||
import resonantinduction.tesla.TileEntityTesla;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
|
@ -27,7 +29,9 @@ public class ClientProxy extends CommonProxy
|
|||
public void registerRenderers()
|
||||
{
|
||||
RenderingRegistry.registerBlockHandler(BlockRenderingHandler.INSTANCE);
|
||||
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityTesla.class, new RenderTesla());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityEMContractor.class, new RenderEMContractor());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,6 +9,8 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import resonantinduction.contractor.BlockEMContractor;
|
||||
import resonantinduction.contractor.TileEntityEMContractor;
|
||||
import resonantinduction.entangler.ItemQuantumEntangler;
|
||||
import resonantinduction.tesla.BlockTesla;
|
||||
import resonantinduction.tesla.TileEntityTesla;
|
||||
|
@ -102,6 +104,7 @@ public class ResonantInduction
|
|||
|
||||
// Blocks
|
||||
public static Block blockTesla;
|
||||
public static Block blockEMContractor;
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent evt)
|
||||
|
@ -120,11 +123,15 @@ public class ResonantInduction
|
|||
// Blocks
|
||||
blockTesla = new BlockTesla(getNextBlockID());
|
||||
GameRegistry.registerBlock(blockTesla, blockTesla.getUnlocalizedName());
|
||||
|
||||
blockEMContractor = new BlockEMContractor(getNextBlockID());
|
||||
GameRegistry.registerBlock(blockEMContractor, blockEMContractor.getUnlocalizedName());
|
||||
|
||||
CONFIGURATION.save();
|
||||
|
||||
// Tiles
|
||||
GameRegistry.registerTileEntity(TileEntityTesla.class, blockTesla.getUnlocalizedName());
|
||||
GameRegistry.registerTileEntity(TileEntityEMContractor.class, blockEMContractor.getUnlocalizedName());
|
||||
|
||||
ResonantInduction.proxy.registerRenderers();
|
||||
|
||||
|
|
45
src/resonantinduction/contractor/BlockEMContractor.java
Normal file
45
src/resonantinduction/contractor/BlockEMContractor.java
Normal file
|
@ -0,0 +1,45 @@
|
|||
package resonantinduction.contractor;
|
||||
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.base.BlockBase;
|
||||
import resonantinduction.render.BlockRenderingHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockEMContractor extends BlockBase implements ITileEntityProvider
|
||||
{
|
||||
public BlockEMContractor(int id)
|
||||
{
|
||||
super("contractor", id, Material.iron);
|
||||
this.func_111022_d(ResonantInduction.PREFIX + "machine");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderType()
|
||||
{
|
||||
return BlockRenderingHandler.INSTANCE.getRenderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world)
|
||||
{
|
||||
return new TileEntityEMContractor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package resonantinduction.contractor;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityEMContractor extends TileEntity
|
||||
{
|
||||
|
||||
}
|
|
@ -5,7 +5,6 @@ import net.minecraft.client.model.ModelRenderer;
|
|||
|
||||
public class ModelEMContractor extends ModelBase
|
||||
{
|
||||
// fields
|
||||
ModelRenderer frame1;
|
||||
ModelRenderer frame2;
|
||||
ModelRenderer frame3;
|
||||
|
@ -264,5 +263,4 @@ public class ModelEMContractor extends ModelBase
|
|||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.world.IBlockAccess;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import resonantinduction.contractor.BlockEMContractor;
|
||||
import resonantinduction.tesla.BlockTesla;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
@ -38,6 +39,15 @@ public class BlockRenderingHandler implements ISimpleBlockRenderingHandler
|
|||
RenderTesla.MODEL_BOTTOM.render(0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
else if (block instanceof BlockEMContractor)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.5, 1.5, 0.5);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
FMLClientHandler.instance().getClient().renderEngine.func_110577_a(RenderEMContractor.TEXTURE);
|
||||
RenderEMContractor.MODEL.render(0.0625f);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
29
src/resonantinduction/render/RenderEMContractor.java
Normal file
29
src/resonantinduction/render/RenderEMContractor.java
Normal file
|
@ -0,0 +1,29 @@
|
|||
package resonantinduction.render;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import resonantinduction.ResonantInduction;
|
||||
import resonantinduction.model.ModelEMContractor;
|
||||
|
||||
public class RenderEMContractor extends TileEntitySpecialRenderer
|
||||
{
|
||||
public static final ModelEMContractor MODEL = new ModelEMContractor();
|
||||
public static final ResourceLocation TEXTURE = new ResourceLocation(ResonantInduction.DOMAIN, ResonantInduction.MODEL_TEXTURE_DIRECTORY + "em_contractor.png");
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity t, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
this.func_110628_a(TEXTURE);
|
||||
MODEL.render(0.0625f);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue