- Changed the recipe of the Acceleration rune so that it is a T4 rune.

- Added the Charging rune, which accumulates charge by using the LP from the Blood Altar (1 charge = 1 LP always). If enough charge is stored when crafting, the crafting occurs instantly.
This commit is contained in:
WayofTime 2016-09-22 14:20:05 -04:00
parent dade5f0837
commit ca96afa375
13 changed files with 699 additions and 12 deletions

View file

@ -0,0 +1,15 @@
package WayofTime.bloodmagic.client.render.entity;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
public class CorruptedSpiderRenderFactory implements IRenderFactory<EntityCorruptedSpider>
{
@Override
public Render<? super EntityCorruptedSpider> createRenderFor(RenderManager manager)
{
return new RenderCorruptedSpider(manager);
}
}

View file

@ -0,0 +1,39 @@
package WayofTime.bloodmagic.client.render.entity;
import net.minecraft.client.model.ModelSpider;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.bloodmagic.client.render.entity.layer.LayerCorruptedSpiderEyes;
import WayofTime.bloodmagic.client.render.entity.layer.LayerWill;
import WayofTime.bloodmagic.client.render.model.ModelCorruptedSpider;
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
@SideOnly(Side.CLIENT)
public class RenderCorruptedSpider extends RenderLiving<EntityCorruptedSpider>
{
private static final ResourceLocation SPIDER_TEXTURES = new ResourceLocation("textures/entity/spider/spider.png");
public RenderCorruptedSpider(RenderManager renderManagerIn)
{
super(renderManagerIn, new ModelSpider(), 1.0F);
this.addLayer(new LayerCorruptedSpiderEyes(this));
this.addLayer(new LayerWill<EntityCorruptedSpider>(this, new ModelCorruptedSpider(1.1f)));
}
protected float getDeathMaxRotation(EntityCorruptedSpider entityLivingBaseIn)
{
return 180.0F;
}
/**
* Returns the location of an entity's texture. Doesn't seem to be called
* unless you call Render.bindEntityTexture.
*/
protected ResourceLocation getEntityTexture(EntityCorruptedSpider entity)
{
return SPIDER_TEXTURES;
}
}

View file

@ -0,0 +1,57 @@
package WayofTime.bloodmagic.client.render.entity.layer;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.entity.layers.LayerRenderer;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import WayofTime.bloodmagic.client.render.entity.RenderCorruptedSpider;
import WayofTime.bloodmagic.entity.mob.EntityCorruptedSpider;
@SideOnly(Side.CLIENT)
public class LayerCorruptedSpiderEyes implements LayerRenderer<EntityCorruptedSpider>
{
private static final ResourceLocation SPIDER_EYES = new ResourceLocation("textures/entity/spider_eyes.png");
private final RenderCorruptedSpider spiderRenderer;
public LayerCorruptedSpiderEyes(RenderCorruptedSpider spiderRendererIn)
{
this.spiderRenderer = spiderRendererIn;
}
public void doRenderLayer(EntityCorruptedSpider entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.spiderRenderer.bindTexture(SPIDER_EYES);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
if (entitylivingbaseIn.isInvisible())
{
GlStateManager.depthMask(false);
} else
{
GlStateManager.depthMask(true);
}
int i = 61680;
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j, (float) k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.spiderRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
j = i % 65536;
k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) j, (float) k);
this.spiderRenderer.setLightmap(entitylivingbaseIn, partialTicks);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
public boolean shouldCombineTextures()
{
return false;
}
}

View file

@ -0,0 +1,148 @@
package WayofTime.bloodmagic.client.render.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelCorruptedSpider extends ModelBase
{
/** The spider's head box */
public ModelRenderer spiderHead;
/** The spider's neck box */
public ModelRenderer spiderNeck;
/** The spider's body box */
public ModelRenderer spiderBody;
/** Spider's first leg */
public ModelRenderer spiderLeg1;
/** Spider's second leg */
public ModelRenderer spiderLeg2;
/** Spider's third leg */
public ModelRenderer spiderLeg3;
/** Spider's fourth leg */
public ModelRenderer spiderLeg4;
/** Spider's fifth leg */
public ModelRenderer spiderLeg5;
/** Spider's sixth leg */
public ModelRenderer spiderLeg6;
/** Spider's seventh leg */
public ModelRenderer spiderLeg7;
/** Spider's eight leg */
public ModelRenderer spiderLeg8;
public ModelCorruptedSpider(float scale)
{
float f = 0.0F;
int i = 15;
this.spiderHead = new ModelRenderer(this, 32, 4);
this.spiderHead.addBox(-4.0F, -4.0F, -8.0F, 8, 8, 8, scale);
this.spiderHead.setRotationPoint(0.0F, 15.0F, -3.0F);
this.spiderNeck = new ModelRenderer(this, 0, 0);
this.spiderNeck.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6, scale);
this.spiderNeck.setRotationPoint(0.0F, 15.0F, 0.0F);
this.spiderBody = new ModelRenderer(this, 0, 12);
this.spiderBody.addBox(-5.0F, -4.0F, -6.0F, 10, 8, 12, scale);
this.spiderBody.setRotationPoint(0.0F, 15.0F, 9.0F);
this.spiderLeg1 = new ModelRenderer(this, 18, 0);
this.spiderLeg1.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg1.setRotationPoint(-4.0F, 15.0F, 2.0F);
this.spiderLeg2 = new ModelRenderer(this, 18, 0);
this.spiderLeg2.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg2.setRotationPoint(4.0F, 15.0F, 2.0F);
this.spiderLeg3 = new ModelRenderer(this, 18, 0);
this.spiderLeg3.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg3.setRotationPoint(-4.0F, 15.0F, 1.0F);
this.spiderLeg4 = new ModelRenderer(this, 18, 0);
this.spiderLeg4.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg4.setRotationPoint(4.0F, 15.0F, 1.0F);
this.spiderLeg5 = new ModelRenderer(this, 18, 0);
this.spiderLeg5.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg5.setRotationPoint(-4.0F, 15.0F, 0.0F);
this.spiderLeg6 = new ModelRenderer(this, 18, 0);
this.spiderLeg6.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg6.setRotationPoint(4.0F, 15.0F, 0.0F);
this.spiderLeg7 = new ModelRenderer(this, 18, 0);
this.spiderLeg7.addBox(-15.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg7.setRotationPoint(-4.0F, 15.0F, -1.0F);
this.spiderLeg8 = new ModelRenderer(this, 18, 0);
this.spiderLeg8.addBox(-1.0F, -1.0F, -1.0F, 16, 2, 2, scale);
this.spiderLeg8.setRotationPoint(4.0F, 15.0F, -1.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, entityIn);
this.spiderHead.render(scale);
this.spiderNeck.render(scale);
this.spiderBody.render(scale);
this.spiderLeg1.render(scale);
this.spiderLeg2.render(scale);
this.spiderLeg3.render(scale);
this.spiderLeg4.render(scale);
this.spiderLeg5.render(scale);
this.spiderLeg6.render(scale);
this.spiderLeg7.render(scale);
this.spiderLeg8.render(scale);
}
/**
* Sets the model's various rotation angles. For bipeds, par1 and par2 are
* used for animating the movement of arms and legs, where par1 represents
* the time(so that arms and legs swing back and forth) and par2 represents
* how "far" arms and legs can swing at most.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
this.spiderHead.rotateAngleY = netHeadYaw * 0.017453292F;
this.spiderHead.rotateAngleX = headPitch * 0.017453292F;
float f = ((float) Math.PI / 4F);
this.spiderLeg1.rotateAngleZ = -((float) Math.PI / 4F);
this.spiderLeg2.rotateAngleZ = ((float) Math.PI / 4F);
this.spiderLeg3.rotateAngleZ = -0.58119464F;
this.spiderLeg4.rotateAngleZ = 0.58119464F;
this.spiderLeg5.rotateAngleZ = -0.58119464F;
this.spiderLeg6.rotateAngleZ = 0.58119464F;
this.spiderLeg7.rotateAngleZ = -((float) Math.PI / 4F);
this.spiderLeg8.rotateAngleZ = ((float) Math.PI / 4F);
float f1 = -0.0F;
float f2 = 0.3926991F;
this.spiderLeg1.rotateAngleY = ((float) Math.PI / 4F);
this.spiderLeg2.rotateAngleY = -((float) Math.PI / 4F);
this.spiderLeg3.rotateAngleY = 0.3926991F;
this.spiderLeg4.rotateAngleY = -0.3926991F;
this.spiderLeg5.rotateAngleY = -0.3926991F;
this.spiderLeg6.rotateAngleY = 0.3926991F;
this.spiderLeg7.rotateAngleY = -((float) Math.PI / 4F);
this.spiderLeg8.rotateAngleY = ((float) Math.PI / 4F);
float f3 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + 0.0F) * 0.4F) * limbSwingAmount;
float f4 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + (float) Math.PI) * 0.4F) * limbSwingAmount;
float f5 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float) Math.PI / 2F)) * 0.4F) * limbSwingAmount;
float f6 = -(MathHelper.cos(limbSwing * 0.6662F * 2.0F + ((float) Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;
float f7 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + 0.0F) * 0.4F) * limbSwingAmount;
float f8 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + (float) Math.PI) * 0.4F) * limbSwingAmount;
float f9 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float) Math.PI / 2F)) * 0.4F) * limbSwingAmount;
float f10 = Math.abs(MathHelper.sin(limbSwing * 0.6662F + ((float) Math.PI * 3F / 2F)) * 0.4F) * limbSwingAmount;
this.spiderLeg1.rotateAngleY += f3;
this.spiderLeg2.rotateAngleY += -f3;
this.spiderLeg3.rotateAngleY += f4;
this.spiderLeg4.rotateAngleY += -f4;
this.spiderLeg5.rotateAngleY += f5;
this.spiderLeg6.rotateAngleY += -f5;
this.spiderLeg7.rotateAngleY += f6;
this.spiderLeg8.rotateAngleY += -f6;
this.spiderLeg1.rotateAngleZ += f7;
this.spiderLeg2.rotateAngleZ += -f7;
this.spiderLeg3.rotateAngleZ += f8;
this.spiderLeg4.rotateAngleZ += -f8;
this.spiderLeg5.rotateAngleZ += f9;
this.spiderLeg6.rotateAngleZ += -f9;
this.spiderLeg7.rotateAngleZ += f10;
this.spiderLeg8.rotateAngleZ += -f10;
}
}