Added a few more upgrades to the Living Armour
... Wait, was I supposed to put something in here?
This commit is contained in:
parent
507c541d5b
commit
953bac9298
23 changed files with 493 additions and 23 deletions
|
@ -21,6 +21,7 @@ import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
|||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.api.compat.IMultiWillTool;
|
||||
import wayoftime.bloodmagic.client.model.MimicColor;
|
||||
import wayoftime.bloodmagic.client.render.alchemyarray.StaticAlchemyCircleRenderer;
|
||||
import wayoftime.bloodmagic.client.render.block.RenderAlchemyArray;
|
||||
import wayoftime.bloodmagic.client.render.block.RenderAltar;
|
||||
import wayoftime.bloodmagic.client.render.block.RenderDemonCrucible;
|
||||
|
@ -35,6 +36,7 @@ import wayoftime.bloodmagic.common.item.ItemSacrificialDagger;
|
|||
import wayoftime.bloodmagic.common.item.sigil.ItemSigilToggleable;
|
||||
import wayoftime.bloodmagic.common.item.soul.ItemSentientSword;
|
||||
import wayoftime.bloodmagic.common.registries.BloodMagicEntityTypes;
|
||||
import wayoftime.bloodmagic.core.registry.AlchemyArrayRendererRegistry;
|
||||
import wayoftime.bloodmagic.tile.TileAlchemyArray;
|
||||
import wayoftime.bloodmagic.tile.TileAltar;
|
||||
import wayoftime.bloodmagic.tile.TileDemonCrucible;
|
||||
|
@ -99,6 +101,7 @@ public class ClientEvents
|
|||
RenderTypeLookup.setRenderLayer(BloodMagicBlocks.MIMIC.get(), (RenderType) -> true);
|
||||
});
|
||||
|
||||
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/movement"), new StaticAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/movementarray.png")));
|
||||
}
|
||||
|
||||
public static void registerItemModelProperties(FMLClientSetupEvent event)
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder;
|
|||
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.vector.Quaternion;
|
||||
|
@ -105,7 +106,7 @@ public class AlchemyArrayRenderer
|
|||
|
||||
matrixStack.scale(size, size, size);
|
||||
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, 0xFFFFFFFF, combinedLightIn, combinedOverlayIn);
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, 0xFFFFFFFF, 0x00F000F0, OverlayTexture.NO_OVERLAY);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
|
|
|
@ -0,0 +1,98 @@
|
|||
package wayoftime.bloodmagic.client.render.alchemyarray;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.vertex.IVertexBuilder;
|
||||
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.vector.Quaternion;
|
||||
import wayoftime.bloodmagic.client.render.BloodMagicRenderer;
|
||||
import wayoftime.bloodmagic.client.render.BloodMagicRenderer.Model2D;
|
||||
import wayoftime.bloodmagic.client.render.RenderResizableQuadrilateral;
|
||||
import wayoftime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class StaticAlchemyCircleRenderer extends AlchemyArrayRenderer
|
||||
{
|
||||
public StaticAlchemyCircleRenderer(ResourceLocation arrayResource)
|
||||
{
|
||||
super(arrayResource);
|
||||
}
|
||||
|
||||
public float getRotation(float craftTime)
|
||||
{
|
||||
float offset = 50;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
float modifier = (float) (craftTime - offset) * 5f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getSecondaryRotation(float craftTime)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getSizeModifier(float craftTime)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
// public float getVerticalOffset(float craftTime)
|
||||
// {
|
||||
// if (craftTime >= 5)
|
||||
// {
|
||||
// if (craftTime <= 40)
|
||||
// {
|
||||
// return (float) (-0.4 + (0.4) * Math.pow((craftTime - 5) / 35f, 3));
|
||||
// } else
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
// return -0.4f;
|
||||
// }
|
||||
|
||||
public void renderAt(TileAlchemyArray tileArray, double x, double y, double z, float craftTime, MatrixStack matrixStack, IRenderTypeBuffer renderer, int combinedLightIn, int combinedOverlayIn)
|
||||
{
|
||||
matrixStack.push();
|
||||
|
||||
matrixStack.translate(0.5, 0.5, 0.5);
|
||||
|
||||
float rot = getRotation(craftTime);
|
||||
float secondaryRot = getSecondaryRotation(craftTime);
|
||||
|
||||
float size = 1.0F * getSizeModifier(craftTime);
|
||||
Direction rotation = tileArray.getRotation();
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.translate(0, getVerticalOffset(craftTime), 0);
|
||||
matrixStack.rotate(new Quaternion(Direction.UP.toVector3f(), -rotation.getHorizontalAngle(), true));
|
||||
|
||||
matrixStack.push();
|
||||
|
||||
matrixStack.rotate(new Quaternion(Direction.NORTH.toVector3f(), rot, true));
|
||||
// matrixStack.rotate(new Quaternion(Direction.NORTH.toVector3f(), secondaryRot, true));
|
||||
// matrixStack.rotate(new Quaternion(Direction.EAST.toVector3f(), secondaryRot * 0.45812f, true));
|
||||
|
||||
IVertexBuilder twoDBuffer = renderer.getBuffer(RenderType.getEntityTranslucent(arrayResource));
|
||||
Model2D arrayModel = new BloodMagicRenderer.Model2D();
|
||||
arrayModel.minX = -0.5;
|
||||
arrayModel.maxX = +0.5;
|
||||
arrayModel.minY = -0.5;
|
||||
arrayModel.maxY = +0.5;
|
||||
arrayModel.resource = arrayResource;
|
||||
|
||||
matrixStack.scale(size, size, size);
|
||||
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, 0xFFFFFFFF, 0x00F000F0, OverlayTexture.NO_OVERLAY);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue