From 456d4990bf1d11845a907654839bf00c409fec0f Mon Sep 17 00:00:00 2001 From: WayofTime Date: Thu, 6 Feb 2014 22:17:22 -0500 Subject: [PATCH] Added some spell block rendering --- .../client/ClientProxy.java | 59 +++- .../common/block/BlockSpellEffect.java | 18 ++ .../block/RenderSpellEffectBlock.java | 49 +++ .../itemRender/TEConduitItemRenderer.java | 98 ++++++ .../TESpellEffectBlockItemRenderer.java | 107 +++++++ .../renderer/model/ModelSpellEffectBlock.java | 287 ++++++++++++++++++ .../common/tileEntity/TEOrientable.java | 10 +- .../common/tileEntity/TESpellEffectBlock.java | 12 + .../tileEntity/TESpellParadigmBlock.java | 2 + .../textures/models/BlockSpellEffect.png | Bin 0 -> 985 bytes .../textures/models/SpellEffectFire.png | Bin 0 -> 1258 bytes 11 files changed, 633 insertions(+), 9 deletions(-) create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/renderer/block/RenderSpellEffectBlock.java create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TEConduitItemRenderer.java create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/renderer/block/itemRender/TESpellEffectBlockItemRenderer.java create mode 100644 BM_src/WayofTime/alchemicalWizardry/common/renderer/model/ModelSpellEffectBlock.java create mode 100644 resources/assets/alchemicalwizardry/textures/models/BlockSpellEffect.png create mode 100644 resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png 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 0000000000000000000000000000000000000000..e22b9c40349441ae1673097274da3d2b689e1af9 GIT binary patch literal 985 zcmV;~119{5P)VGd000McNliru-U0^#01KC)vA_TT17=A? zK~#9!?U>I}+g23De^aX>er zR)X9SV4xL1JGA`@dyvdPs|d>*D6Wb}7y!z>>$UOE;S9MyTQ7l=Lc9q69(eoEZQ9M} z_rYn~j+q8ije!KHXZ)Ps2i1Y_1!QWF+_G)CUFdkw^*|qjo4hCE+7JLxn+K-@jW0pJ zJ=@mK+W)Qt#sRN!4GHLGpyR{LKlTl`<{)J5jK0BO>*H5Nc(s6U!T@b$UvD4y&wN!dV@>xYJ>3By$XpfO()| zH}4-pdjX=QUa8xJP6<*CnKxD!+F7W62T2}u3v&P3zVUr%-Ug=*{_%8(qpGZ6nls>5 zz->Ub0%;MV2ataW;cKXV1F8;w1ZeRIubx;P33tB-s1x856 zi#F#ofR}*t2BP~={2jbw=w@xA_&X33K{r5GAiE9zD@f+S1VG#V@>@V`t4J^f0;$6n zkd*92sz9eOvkl!@sL$Cb$Zgw_sOr6b0R(^BRMBnV2vieHkNZvunjtvdDIj3}xBieZ zPy(t7Ism4?G9`|JUy082%d?=Kaxl$hQ1|5$^f7Ygx;*6md8|#g_+97(ZwgKg#)+Z0 z2q%U^4fZ929x?ewNN|%=U}UCb6sAT*Z~{cIU*yzB-{hx`mk1C7ga9Ex2oOw?5xNNF zOU^vV2wlc3onJ@!|NY7oBQ(yh!H=1xVe1(FywMmeiGWF2h(v(kCX~SmJYTr+DWFfq z=kdtPppo+cDT7xpgC`hv+&$`(COtCIkwejIB7z@?+@(b9Q^$XH0w!f4t9^R3Iz*(D zq<|101PB3w>;E+q)@s&mP1Y4-n00000NkvXX Hu0mjfAnLK& literal 0 HcmV?d00001 diff --git a/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png b/resources/assets/alchemicalwizardry/textures/models/SpellEffectFire.png new file mode 100644 index 0000000000000000000000000000000000000000..ea5baeffe9833577d1fd9d2319b8fcbead6287d2 GIT binary patch literal 1258 zcmVVGd000McNliru-U0^$3pmP0V=4du1b0b9 zK~#9!?V8PR8$}q#fBRvtKjJvCi4>HiL{RY&B#!(894f_UPFy%3RqDNGdhb0Fw_dow zh08|$AAkd>ssIti5CSbNuH&!xW9{KEyTqQ@@j5oKHABj`)0~kq6U* z>N+^b5PJr_mVEfkGcY^SFn&s;F>gnaLrAWVowI121h9lbbo9a#EXhI@MzR-Qm> z9a68L-UG7@}R!q-*sm)$LI*i0VVnH&P(X5L1n|2 zx&!Fu!LuR$T=GIE0p<6gnE|^k7X_et8(Ob}*#M_@rW6aU0;M~M))H7HuudUS0xt`d zw;}T@r2m5QJ76@xseqRPs|6?TpM`(oH%WxeZD=k-`VSci-YTqrGdZ(g=@u|Ou-ek= z&M$JmTNT-9RiwmuNl3qd@&}MQfOyS+@G4lxKpd*?LaYIX0AYb`fER&8$gZwK<`CjQ ztO@3GsN9C^_YkW=FCjOIa|EfZWPG~>i6S_ELNf;<1$5*qa|l$WilibykaqfKXy#?Z zGi1`URD|9NG*)F4B#TlKjfQWRg4FMFtJodj1dJ94f9<<@Xr;mIUHs*HiezoiV*zsC zo!_GZ@<7>uE`V5Oi##W(Z>bE}Wmq$w@FLPO7+f4ZLfrjYN=L!>PSKZ>Kv0f8cL{6) zyW-Q~vJ_@7&LR<-76Ym97axzlfs6X0od`V|JWPy3un<8c1YT4Vlz^RQmBjpSiBNw? z_g||BYo`&_dcd>^#VnGVdBD8!5ukcb#W+t+JAUpF(4UR%xh`ru42F%{bE6@fhFVio zF|Nio?Rd=ri?9Iq3Wb5hL2ZXkXNS$BNiZUEs1qU8lcREO^(>&;1^ru}4k5qKe8SxH z+Yc_V39za3KbS44UWx?6o*5#O2&rBj6#>KS#zoA&>lzPzsl3lazuuIi63qT{e%N}zb*c?43`5T?0<;cj8I%Z0W8>saCBTcwZ>l>BBbl?_0@q32 z!opTPKTiKu1-Q%bhzaH$nh-78VQ3QXUZ#kuWpDx+44@`WXE!WnDuec@vw$v&-VoTM z&h!1h>|CZE5O)0BQ3SDDD2UxcK@>r#?J%J~Y+TS@coHn?qUgfMS|DquQW#gpQFM=z^K|lR3pKh)N7Y1qH1VpXlQ6?XlQ6?Xe=831?s&_ Uy{>IGc>n+a07*qoM6N<$f-B`dd;kCd literal 0 HcmV?d00001