diff --git a/BM_src/WayofTime/alchemicalWizardry/client/ClientProxy.java b/BM_src/WayofTime/alchemicalWizardry/client/ClientProxy.java index 9fadd55d..c3c18cac 100644 --- a/BM_src/WayofTime/alchemicalWizardry/client/ClientProxy.java +++ b/BM_src/WayofTime/alchemicalWizardry/client/ClientProxy.java @@ -1,26 +1,66 @@ package WayofTime.alchemicalWizardry.client; +import net.minecraft.world.World; +import net.minecraftforge.client.MinecraftForgeClient; import WayofTime.alchemicalWizardry.ModBlocks; import WayofTime.alchemicalWizardry.common.CommonProxy; import WayofTime.alchemicalWizardry.common.EntityAirElemental; -import WayofTime.alchemicalWizardry.common.entity.mob.*; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBileDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityBoulderFist; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityEarthElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFallenAngel; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityFireElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityHolyElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityIceDemon; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityLowerGuardian; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityShade; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityShadeElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntitySmallEarthGolem; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityWaterElemental; +import WayofTime.alchemicalWizardry.common.entity.mob.EntityWingedFireDemon; import WayofTime.alchemicalWizardry.common.entity.projectile.EnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityEnergyBazookaMainProjectile; import WayofTime.alchemicalWizardry.common.entity.projectile.EntityMeteor; -import WayofTime.alchemicalWizardry.common.renderer.block.*; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderConduit; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderPedestal; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderPlinth; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderSpellEffectBlock; +import WayofTime.alchemicalWizardry.common.renderer.block.RenderWritingTable; +import WayofTime.alchemicalWizardry.common.renderer.block.TEAltarRenderer; import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEAltarItemRenderer; -import WayofTime.alchemicalWizardry.common.renderer.mob.*; -import WayofTime.alchemicalWizardry.common.renderer.model.*; +import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TEConduitItemRenderer; +import WayofTime.alchemicalWizardry.common.renderer.block.itemRender.TESpellEffectBlockItemRenderer; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBileDemon; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderBoulderFist; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderElemental; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderFallenAngel; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderIceDemon; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderLowerGuardian; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderShade; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderSmallEarthGolem; +import WayofTime.alchemicalWizardry.common.renderer.mob.RenderWingedFireDemon; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBileDemon; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelBoulderFist; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelElemental; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelFallenAngel; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelIceDemon; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelLowerGuardian; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelShade; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSmallEarthGolem; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelWingedFireDemon; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBazookaMainProjectile; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderEnergyBlastProjectile; import WayofTime.alchemicalWizardry.common.renderer.projectile.RenderMeteor; import WayofTime.alchemicalWizardry.common.spell.complex.EntitySpellProjectile; -import WayofTime.alchemicalWizardry.common.tileEntity.*; +import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar; +import WayofTime.alchemicalWizardry.common.tileEntity.TEConduit; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPedestal; +import WayofTime.alchemicalWizardry.common.tileEntity.TEPlinth; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable; import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; -import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; public class ClientProxy extends CommonProxy { @@ -67,6 +107,11 @@ public class ClientProxy extends CommonProxy ClientRegistry.bindTileEntitySpecialRenderer(TEPlinth.class, new RenderPlinth()); ClientRegistry.bindTileEntitySpecialRenderer(TEWritingTable.class, new RenderWritingTable()); ClientRegistry.bindTileEntitySpecialRenderer(TEConduit.class, new RenderConduit()); + ClientRegistry.bindTileEntitySpecialRenderer(TESpellEffectBlock.class, new RenderSpellEffectBlock()); + + //Item Renderer stuff + MinecraftForgeClient.registerItemRenderer(ModBlocks.blockConduit.blockID, new TEConduitItemRenderer()); + MinecraftForgeClient.registerItemRenderer(ModBlocks.blockSpellEffect.blockID, new TESpellEffectBlockItemRenderer()); //RenderingRegistry.registerEntityRenderingHandler(FireProjectile.class, new RenderFireProjectile()); //RenderingRegistry.registerBlockHandler(new AltarRenderer()); } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java index e3efbe58..2130e46c 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/block/BlockSpellEffect.java @@ -26,6 +26,24 @@ public class BlockSpellEffect extends BlockOrientable return new TESpellEffectBlock(); } + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public int getRenderType() + { + return -1; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + @SideOnly(Side.CLIENT) public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { diff --git a/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java new file mode 100644 index 00000000..b750b2a3 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java @@ -0,0 +1,49 @@ +package WayofTime.alchemicalWizardry.common.renderer.block; + +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; +import WayofTime.alchemicalWizardry.common.tileEntity.TESpellEffectBlock; +import cpw.mods.fml.client.FMLClientHandler; + +public class RenderSpellEffectBlock extends TileEntitySpecialRenderer +{ + private ModelSpellEffectBlock modelSpellEffectBlock = new ModelSpellEffectBlock(); + + @Override + public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) + { + if (tileEntity instanceof TESpellEffectBlock) + { + TESpellEffectBlock tileSpellBlock = (TESpellEffectBlock) tileEntity; + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/BlockSpellEffect.png"); + int meta = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord); + String resource = tileSpellBlock.getResourceLocationForMeta(meta); + test = new ResourceLocation(resource); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelSpellEffectBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, tileSpellBlock.getInputDirection(), tileSpellBlock.getOutputDirection()); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + } +} \ No newline at end of file diff --git a/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java b/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java new file mode 100644 index 00000000..cf062cfa --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java @@ -0,0 +1,98 @@ +package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.common.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.client.FMLClientHandler; +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelConduit; + +public class TEConduitItemRenderer implements IItemRenderer +{ + private ModelConduit modelConduit = new ModelConduit(); + + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + + Block block = ModBlocks.blockConduit; + Icon icon = item.getItem().getIconFromDamage(0); + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); + ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/Conduit.png"); + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelConduit.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.UP, ForgeDirection.DOWN); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + + + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } + + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (type) { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java b/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java new file mode 100644 index 00000000..340f18c2 --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java @@ -0,0 +1,107 @@ +package WayofTime.alchemicalWizardry.common.renderer.block.itemRender; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.entity.Entity; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.common.ForgeDirection; + +import org.lwjgl.opengl.GL11; + +import WayofTime.alchemicalWizardry.ModBlocks; +import WayofTime.alchemicalWizardry.common.renderer.model.ModelSpellEffectBlock; +import cpw.mods.fml.client.FMLClientHandler; + +public class TESpellEffectBlockItemRenderer implements IItemRenderer +{ + private ModelSpellEffectBlock modelSpellBlock = new ModelSpellEffectBlock(); + + private void renderConduitItem(RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) + { + Tessellator tessellator = Tessellator.instance; + + Block block = ModBlocks.blockSpellEffect; + //Icon icon = item.getItem().getIconFromDamage(0); + + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + /** + * Render the ghost item inside of the Altar, slowly spinning + */ + GL11.glPushMatrix(); + GL11.glTranslatef((float) translateX + 0.5F, (float) translateY + 1.5F, (float) translateZ + 0.5F); + ResourceLocation test = new ResourceLocation(this.getResourceLocationForMeta(item.getItemDamage())); + + FMLClientHandler.instance().getClient().renderEngine.bindTexture(test); + GL11.glPushMatrix(); + GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); + //GL11.glRotatef(90F, 0.0F, 0.0F, 1.0F); + //A reference to your Model file. Again, very important. + this.modelSpellBlock.render((Entity) null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F, ForgeDirection.UP, ForgeDirection.DOWN); + //Tell it to stop rendering for both the PushMatrix's + GL11.glPopMatrix(); + GL11.glPopMatrix(); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + } + + + /** + * IItemRenderer implementation * + */ + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch (type) { + case ENTITY: + return true; + case EQUIPPED: + return true; + case EQUIPPED_FIRST_PERSON: + return true; + case INVENTORY: + return true; + default: + return false; + } + } + + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } + + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + switch (type) { + case ENTITY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + case EQUIPPED: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case EQUIPPED_FIRST_PERSON: + renderConduitItem((RenderBlocks) data[0], item, -0.4f, 0.50f, 0.35f); + break; + case INVENTORY: + renderConduitItem((RenderBlocks) data[0], item, -0.5f, -0.5f, -0.5f); + break; + default: + } + } + + public String getResourceLocationForMeta(int meta) + { + switch(meta) + { + case 0: return "alchemicalwizardry:textures/models/SpellEffectFire.png"; + case 1: return "alchemicalwizardry:textures/models/SpellEffectIce.png"; + } + return ""; + } +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java new file mode 100644 index 00000000..af9f1d6a --- /dev/null +++ b/BM_src/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java @@ -0,0 +1,287 @@ +package WayofTime.alchemicalWizardry.common.renderer.model; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import net.minecraftforge.common.ForgeDirection; + +public class ModelSpellEffectBlock extends ModelBase +{ + //fields + ModelRenderer core; + ModelRenderer frame1; + ModelRenderer frame2; + ModelRenderer frame3; + ModelRenderer frame4; + ModelRenderer frame5; + ModelRenderer frame6; + ModelRenderer frame7; + ModelRenderer frame8; + ModelRenderer frame9; + ModelRenderer frame10; + ModelRenderer frame11; + ModelRenderer frame12; + ModelRenderer inputSpacer1; + ModelRenderer inputFace; + ModelRenderer inputSpacer2; + ModelRenderer inputSpacer3; + ModelRenderer inputSpacer4; + ModelRenderer outputFace; + + public ModelSpellEffectBlock() + { + textureWidth = 64; + textureHeight = 64; + + core = new ModelRenderer(this, 0, 0); + core.addBox(-3F, -3F, -3F, 6, 6, 6); + core.setRotationPoint(0F, 16F, 0F); + core.setTextureSize(64, 64); + core.mirror = true; + setRotation(core, 0F, 0F, 0F); + frame1 = new ModelRenderer(this, 16, 18); + frame1.addBox(3F, -3F, -5F, 2, 6, 2); + frame1.setRotationPoint(0F, 16F, 0F); + frame1.setTextureSize(64, 64); + frame1.mirror = true; + setRotation(frame1, 0F, 0F, 0F); + frame2 = new ModelRenderer(this, 0, 18); + frame2.addBox(-5F, -3F, -5F, 2, 6, 2); + frame2.setRotationPoint(0F, 16F, 0F); + frame2.setTextureSize(64, 64); + frame2.mirror = true; + setRotation(frame2, 0F, 0F, 0F); + frame3 = new ModelRenderer(this, 0, 13); + frame3.addBox(-5F, -5F, -5F, 10, 2, 2); + frame3.setRotationPoint(0F, 16F, 0F); + frame3.setTextureSize(64, 64); + frame3.mirror = true; + setRotation(frame3, 0F, 0F, 0F); + frame4 = new ModelRenderer(this, 0, 27); + frame4.addBox(-5F, 3F, -5F, 10, 2, 2); + frame4.setRotationPoint(0F, 16F, 0F); + frame4.setTextureSize(64, 64); + frame4.mirror = true; + setRotation(frame4, 0F, 0F, 0F); + frame5 = new ModelRenderer(this, 0, 34); + frame5.addBox(-5F, -5F, 3F, 10, 2, 2); + frame5.setRotationPoint(0F, 16F, 0F); + frame5.setTextureSize(64, 64); + frame5.mirror = true; + setRotation(frame5, 0F, 0F, 0F); + frame6 = new ModelRenderer(this, 0, 48); + frame6.addBox(-5F, 3F, 3F, 10, 2, 2); + frame6.setRotationPoint(0F, 16F, 0F); + frame6.setTextureSize(64, 64); + frame6.mirror = true; + setRotation(frame6, 0F, 0F, 0F); + frame7 = new ModelRenderer(this, 16, 39); + frame7.addBox(-5F, -3F, 3F, 2, 6, 2); + frame7.setRotationPoint(0F, 16F, 0F); + frame7.setTextureSize(64, 64); + frame7.mirror = true; + setRotation(frame7, 0F, 0F, 0F); + frame8 = new ModelRenderer(this, 0, 39); + frame8.addBox(3F, -3F, 3F, 2, 6, 2); + frame8.setRotationPoint(0F, 16F, 0F); + frame8.setTextureSize(64, 64); + frame8.mirror = true; + setRotation(frame8, 0F, 0F, 0F); + frame9 = new ModelRenderer(this, 25, 9); + frame9.addBox(-5F, 3F, -3F, 2, 2, 6); + frame9.setRotationPoint(0F, 16F, 0F); + frame9.setTextureSize(64, 64); + frame9.mirror = true; + setRotation(frame9, 0F, 0F, 0F); + frame10 = new ModelRenderer(this, 25, 0); + frame10.addBox(-5F, -5F, -3F, 2, 2, 6); + frame10.setRotationPoint(0F, 16F, 0F); + frame10.setTextureSize(64, 64); + frame10.mirror = true; + setRotation(frame10, 0F, 0F, 0F); + frame11 = new ModelRenderer(this, 42, 0); + frame11.addBox(3F, -5F, -3F, 2, 2, 6); + frame11.setRotationPoint(0F, 16F, 0F); + frame11.setTextureSize(64, 64); + frame11.mirror = true; + setRotation(frame11, 0F, 0F, 0F); + frame12 = new ModelRenderer(this, 42, 9); + frame12.addBox(3F, 3F, -3F, 2, 2, 6); + frame12.setRotationPoint(0F, 16F, 0F); + frame12.setTextureSize(64, 64); + frame12.mirror = true; + setRotation(frame12, 0F, 0F, 0F); + inputSpacer1 = new ModelRenderer(this, 25, 27); + inputSpacer1.addBox(3F, -5F, -8F, 2, 2, 2); + inputSpacer1.setRotationPoint(0F, 16F, 0F); + inputSpacer1.setTextureSize(64, 64); + inputSpacer1.mirror = true; + setRotation(inputSpacer1, 0F, 0F, 0F); + inputFace = new ModelRenderer(this, 34, 27); + inputFace.addBox(-2F, -2F, -8F, 4, 4, 2); + inputFace.setRotationPoint(0F, 16F, 0F); + inputFace.setTextureSize(64, 64); + inputFace.mirror = true; + setRotation(inputFace, 0F, 0F, 0F); + inputSpacer2 = new ModelRenderer(this, 25, 27); + inputSpacer2.addBox(-5F, -5F, -8F, 2, 2, 2); + inputSpacer2.setRotationPoint(0F, 16F, 0F); + inputSpacer2.setTextureSize(64, 64); + inputSpacer2.mirror = true; + setRotation(inputSpacer2, 0F, 0F, 0F); + inputSpacer3 = new ModelRenderer(this, 25, 27); + inputSpacer3.addBox(3F, 3F, -8F, 2, 2, 2); + inputSpacer3.setRotationPoint(0F, 16F, 0F); + inputSpacer3.setTextureSize(64, 64); + inputSpacer3.mirror = true; + setRotation(inputSpacer3, 0F, 0F, 0F); + inputSpacer4 = new ModelRenderer(this, 25, 27); + inputSpacer4.addBox(-5F, 3F, -8F, 2, 2, 2); + inputSpacer4.setRotationPoint(0F, 16F, 0F); + inputSpacer4.setTextureSize(64, 64); + inputSpacer4.mirror = true; + setRotation(inputSpacer4, 0F, 0F, 0F); + outputFace = new ModelRenderer(this, 34, 34); + outputFace.addBox(6F, -2F, -2F, 2, 4, 4); + outputFace.setRotationPoint(0F, 16F, 0F); + outputFace.setTextureSize(64, 64); + outputFace.mirror = true; + setRotation(outputFace, 0F, 0F, 0F); + } + + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5, ForgeDirection input, ForgeDirection output) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + float xInputRot = 0.0f; + float yInputRot = 0.0f; + float zInputRot = 0.0f; + float xOutputRot = 0.0f; + float yOutputRot = 0.0f; + float zOutputRot = 0.0f; + + switch (input) + { + case NORTH: + xInputRot = 0.0f; + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case EAST: + xInputRot = 0.0f; + yInputRot = (float) (0.5f * Math.PI); + zInputRot = 0.0f; + break; + + case SOUTH: + xInputRot = 0.0f; + yInputRot = (float) (1.0f * Math.PI); + zInputRot = 0.0f; + break; + + case WEST: + xInputRot = 0.0f; + yInputRot = (float) (-0.5f * Math.PI); + zInputRot = 0.0f; + break; + + case UP: + xInputRot = (float) (-0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + case DOWN: + xInputRot = (float) (0.5f * Math.PI); + yInputRot = 0.0f; + zInputRot = 0.0f; + break; + + default: + break; + } + + switch (output) + { + case NORTH: + xOutputRot = 0.0f; + yOutputRot = (float) (0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case EAST: + xOutputRot = 0.0f; + yOutputRot = (float) (1.0f * Math.PI); + zOutputRot = 0.0f; + break; + + case SOUTH: + xOutputRot = 0.0f; + yOutputRot = (float) (-0.5f * Math.PI); + zOutputRot = 0.0f; + break; + + case WEST: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = 0.0f; + break; + + case UP: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (-0.5f * Math.PI); + break; + + case DOWN: + xOutputRot = 0.0f; + yOutputRot = 0.0f; + zOutputRot = (float) (0.5f * Math.PI); + break; + + default: + break; + } + + this.setRotation(inputFace, xInputRot, yInputRot, zInputRot); + this.setRotation(outputFace, xOutputRot, yOutputRot, zOutputRot); + this.setRotation(inputSpacer1, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer2, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer3, xInputRot, yInputRot, zInputRot); + this.setRotation(inputSpacer4, xInputRot, yInputRot, zInputRot); + + core.render(f5); + frame1.render(f5); + frame2.render(f5); + frame3.render(f5); + frame4.render(f5); + frame5.render(f5); + frame6.render(f5); + frame7.render(f5); + frame8.render(f5); + frame9.render(f5); + frame10.render(f5); + frame11.render(f5); + frame12.render(f5); + inputSpacer1.render(f5); + inputFace.render(f5); + inputSpacer2.render(f5); + inputSpacer3.render(f5); + inputSpacer4.render(f5); + outputFace.render(f5); + } + + private void setRotation(ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + +} diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java index 6c22e269..741d7f42 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TEOrientable.java @@ -1,11 +1,12 @@ package WayofTime.alchemicalWizardry.common.tileEntity; -import WayofTime.alchemicalWizardry.common.PacketHandler; -import WayofTime.alchemicalWizardry.common.block.IOrientable; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.packet.Packet; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.ForgeDirection; +import WayofTime.alchemicalWizardry.common.PacketHandler; +import WayofTime.alchemicalWizardry.common.block.IOrientable; public class TEOrientable extends TileEntity implements IOrientable { @@ -99,4 +100,9 @@ public class TEOrientable extends TileEntity implements IOrientable } return false; } + + public String getResourceLocationForMeta(int meta) + { + return ""; + } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java index d12bc579..389d3399 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellEffectBlock.java @@ -1,5 +1,6 @@ package WayofTime.alchemicalWizardry.common.tileEntity; +import net.minecraft.util.ResourceLocation; import WayofTime.alchemicalWizardry.common.spell.complex.SpellParadigm; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffect; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellEffectFire; @@ -23,4 +24,15 @@ public class TESpellEffectBlock extends TESpellBlock } return new SpellEffectFire(); } + + @Override + public String getResourceLocationForMeta(int meta) + { + switch(meta) + { + case 0: return "alchemicalwizardry:textures/models/SpellEffectFire.png"; + case 1: return "alchemicalwizardry:textures/models/SpellEffectIce.png"; + } + return ""; + } } diff --git a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java index 73b39124..c612a1f3 100644 --- a/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java +++ b/BM_src/WayofTime/alchemicalWizardry/common/tileEntity/TESpellParadigmBlock.java @@ -70,4 +70,6 @@ public class TESpellParadigmBlock extends TESpellBlock } } + + } diff --git a/resources/assets/alchemicalwizardry/textures/models/BlockSpellEffect.png b/resources/assets/alchemicalwizardry/textures/models/BlockSpellEffect.png new file mode 100644 index 00000000..e22b9c40 Binary files /dev/null and b/resources/assets/alchemicalwizardry/textures/models/BlockSpellEffect.png differ diff --git a/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png b/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png new file mode 100644 index 00000000..ea5baeff Binary files /dev/null and b/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png differ