Added Day and Night alchemy arrays
- Added new alchemy arrays: - Two arrays, which changes the current daylight cycle to day and night. - Fixed the JEI so that it no longer ouputs an error when loading Alchemy Array recipes without a crafting output.
This commit is contained in:
parent
a0b756240f
commit
dac93b7ec4
23 changed files with 781 additions and 23 deletions
|
@ -22,7 +22,9 @@ import wayoftime.bloodmagic.BloodMagic;
|
|||
import wayoftime.bloodmagic.api.compat.IMultiWillTool;
|
||||
import wayoftime.bloodmagic.client.model.MimicColor;
|
||||
import wayoftime.bloodmagic.client.render.alchemyarray.BeaconAlchemyCircleRenderer;
|
||||
import wayoftime.bloodmagic.client.render.alchemyarray.DayAlchemyCircleRenderer;
|
||||
import wayoftime.bloodmagic.client.render.alchemyarray.LowStaticAlchemyCircleRenderer;
|
||||
import wayoftime.bloodmagic.client.render.alchemyarray.NightAlchemyCircleRenderer;
|
||||
import wayoftime.bloodmagic.client.render.alchemyarray.StaticAlchemyCircleRenderer;
|
||||
import wayoftime.bloodmagic.client.render.block.RenderAlchemyArray;
|
||||
import wayoftime.bloodmagic.client.render.block.RenderAltar;
|
||||
|
@ -106,7 +108,8 @@ public class ClientEvents
|
|||
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/movement"), new StaticAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/movementarray.png")));
|
||||
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/updraft"), new BeaconAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/updraftarray.png")));
|
||||
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/spike"), new LowStaticAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/spikearray.png")));
|
||||
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/day"), new LowStaticAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/spikearray.png")));
|
||||
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/day"), new DayAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/sunarray.png"), BloodMagic.rl("textures/models/alchemyarrays/sunarrayspikes.png"), BloodMagic.rl("textures/models/alchemyarrays/sunarraycircle.png")));
|
||||
AlchemyArrayRendererRegistry.registerRenderer(BloodMagic.rl("array/night"), new NightAlchemyCircleRenderer(BloodMagic.rl("textures/models/alchemyarrays/moonarrayoutside.png"), BloodMagic.rl("textures/models/alchemyarrays/moonarraysymbols.png"), BloodMagic.rl("textures/models/alchemyarrays/moonarrayinside.png")));
|
||||
}
|
||||
|
||||
public static void registerItemModelProperties(FMLClientSetupEvent event)
|
||||
|
|
|
@ -0,0 +1,229 @@
|
|||
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.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 DayAlchemyCircleRenderer extends AlchemyArrayRenderer
|
||||
{
|
||||
private final ResourceLocation spikesResource;
|
||||
private final ResourceLocation circleResource;
|
||||
|
||||
public DayAlchemyCircleRenderer(ResourceLocation arrayResource, ResourceLocation spikesResource, ResourceLocation circleResource)
|
||||
{
|
||||
super(arrayResource);
|
||||
this.spikesResource = spikesResource;
|
||||
this.circleResource = circleResource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotation(float craftTime)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getSecondaryRotation(float craftTime)
|
||||
{
|
||||
float offset = 2;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
float modifier = (craftTime - offset) * (craftTime - offset) * 0.05f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getVerticalOffset(float craftTime)
|
||||
{
|
||||
if (craftTime >= 40)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return (float) (-0.4 + (0.4) * Math.pow((craftTime - 40) / 60f, 3));
|
||||
} else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return -0.4f;
|
||||
}
|
||||
|
||||
public float getSizeModifier(float craftTime)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public float getSecondarySizeModifier(float craftTime)
|
||||
{
|
||||
if (craftTime >= 40)
|
||||
{
|
||||
if (craftTime <= 160)
|
||||
{
|
||||
return (float) ((2f) * Math.pow((craftTime - 40) / 120f, 3));
|
||||
} else
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getTertiarySizeModifier(float craftTime)
|
||||
{
|
||||
if (craftTime >= 40)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return (float) ((1f) * Math.pow((craftTime - 40) / 60f, 3));
|
||||
} else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getSpikeVerticalOffset(float craftTime)
|
||||
{
|
||||
if (craftTime >= 40)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return (float) (-0.4 + (0.4) * Math.pow((craftTime - 40) / 60f, 3));
|
||||
} else if (craftTime <= 140)
|
||||
{
|
||||
return -0.01f * (craftTime - 100);
|
||||
} else
|
||||
{
|
||||
return -0.4f;
|
||||
}
|
||||
}
|
||||
return -0.4f;
|
||||
}
|
||||
|
||||
public float getCentralCircleOffset(float craftTime)
|
||||
{
|
||||
if (craftTime >= 40)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return (float) (-0.4 + (0.4) * Math.pow((craftTime - 40) / 60f, 3));
|
||||
} else if (craftTime <= 140)
|
||||
{
|
||||
return 0.01f * (craftTime - 100);
|
||||
} else
|
||||
{
|
||||
return 0.4f;
|
||||
}
|
||||
}
|
||||
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.UP.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, combinedOverlayIn);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.translate(0, getSpikeVerticalOffset(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.UP.toVector3f(), -secondaryRot, true));
|
||||
// matrixStack.rotate(new Quaternion(Direction.EAST.toVector3f(), secondaryRot * 0.45812f, true));
|
||||
|
||||
twoDBuffer = renderer.getBuffer(RenderType.getEntityTranslucent(spikesResource));
|
||||
arrayModel = new BloodMagicRenderer.Model2D();
|
||||
arrayModel.minX = -0.5;
|
||||
arrayModel.maxX = +0.5;
|
||||
arrayModel.minY = -0.5;
|
||||
arrayModel.maxY = +0.5;
|
||||
arrayModel.resource = spikesResource;
|
||||
|
||||
float secondarySize = 1.0F * getSecondarySizeModifier(craftTime);
|
||||
|
||||
matrixStack.scale(secondarySize, secondarySize, secondarySize);
|
||||
|
||||
int colorWanted = 0xFFFFFFFF;
|
||||
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, colorWanted, 0x00F000F0, combinedOverlayIn);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.translate(0, getCentralCircleOffset(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.UP.toVector3f(), -secondaryRot, true));
|
||||
// matrixStack.rotate(new Quaternion(Direction.EAST.toVector3f(), secondaryRot * 0.45812f, true));
|
||||
|
||||
twoDBuffer = renderer.getBuffer(RenderType.getEntityTranslucent(circleResource));
|
||||
arrayModel = new BloodMagicRenderer.Model2D();
|
||||
arrayModel.minX = -0.5;
|
||||
arrayModel.maxX = +0.5;
|
||||
arrayModel.minY = -0.5;
|
||||
arrayModel.maxY = +0.5;
|
||||
arrayModel.resource = circleResource;
|
||||
|
||||
float tertiarySize = 1.0F * getTertiarySizeModifier(craftTime);
|
||||
|
||||
matrixStack.scale(tertiarySize, tertiarySize, tertiarySize);
|
||||
|
||||
colorWanted = 0xFFFFFFFF;
|
||||
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, colorWanted, 0x00F000F0, combinedOverlayIn);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,327 @@
|
|||
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.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 NightAlchemyCircleRenderer extends AlchemyArrayRenderer
|
||||
{
|
||||
private final ResourceLocation symbolResource;
|
||||
private final ResourceLocation circleResource;
|
||||
|
||||
public NightAlchemyCircleRenderer(ResourceLocation arrayResource, ResourceLocation symbolResource, ResourceLocation circleResource)
|
||||
{
|
||||
super(arrayResource);
|
||||
this.symbolResource = symbolResource;
|
||||
this.circleResource = circleResource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getRotation(float craftTime)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getSecondaryRotation(float craftTime)
|
||||
{
|
||||
float offset = 2;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
float modifier = (craftTime - offset) * (craftTime - offset) * 0.05f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getTertiaryRotation(float craftTime)
|
||||
{
|
||||
float offset = 60;
|
||||
if (craftTime >= offset)
|
||||
{
|
||||
float modifier = (craftTime - offset) * (craftTime - offset) * 0.15f;
|
||||
return modifier * 1f;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getVerticalOffset(float craftTime)
|
||||
{
|
||||
// if (craftTime >= 40)
|
||||
// {
|
||||
// if (craftTime <= 100)
|
||||
// {
|
||||
// return (float) (-0.4 + (0.4) * Math.pow((craftTime - 40) / 60f, 3));
|
||||
// } else
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
// }
|
||||
return -0.4f;
|
||||
}
|
||||
|
||||
public float getSizeModifier(float craftTime)
|
||||
{
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public float getSecondarySizeModifier(float craftTime)
|
||||
{
|
||||
if (craftTime >= 100)
|
||||
{
|
||||
if (craftTime <= 160)
|
||||
{
|
||||
return (float) ((1f) * Math.pow((craftTime - 100) / 60f, 3)) + 1f;
|
||||
} else
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public float getTertiarySizeModifier(float craftTime)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public float getSymbolVerticaloffset(float craftTime)
|
||||
{
|
||||
if (craftTime >= 40)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return (float) (-0.4 + (0.4) * Math.pow((craftTime - 40) / 60f, 3));
|
||||
} else if (craftTime <= 140)
|
||||
{
|
||||
return 0.01f * (craftTime - 100);
|
||||
} else
|
||||
{
|
||||
return 0.4f;
|
||||
}
|
||||
}
|
||||
|
||||
return -0.4f;
|
||||
}
|
||||
|
||||
public float getCentralCircleOffset(float craftTime)
|
||||
{
|
||||
if (craftTime >= 40)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return (float) (-0.4 + (0.4) * Math.pow((craftTime - 40) / 60f, 3));
|
||||
} else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return -0.4f;
|
||||
}
|
||||
|
||||
public float getSymbolPitch(float craftTime)
|
||||
{
|
||||
if (craftTime > 70)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return 90 * (craftTime - 70) / 30f;
|
||||
} else
|
||||
{
|
||||
return 90;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float getCentralCirclePitch(float craftTime)
|
||||
{
|
||||
if (craftTime > 70)
|
||||
{
|
||||
if (craftTime <= 150)
|
||||
{
|
||||
return 360 * (craftTime - 70) / 80f;
|
||||
} else
|
||||
{
|
||||
return 360;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float moonDisplacement(float craftTime)
|
||||
{
|
||||
if (craftTime > 40)
|
||||
{
|
||||
if (craftTime <= 100)
|
||||
{
|
||||
return (float) (2 * Math.pow((craftTime - 40) / 60f, 3));
|
||||
} else
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public float moonArc(float craftTime)
|
||||
{
|
||||
if (craftTime > 100)
|
||||
{
|
||||
if (craftTime <= 200)
|
||||
{
|
||||
return 180 * (craftTime - 100) / 100f;
|
||||
} else
|
||||
{
|
||||
return 180;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
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 tertiaryRot = getTertiaryRotation(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.UP.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, combinedOverlayIn);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
|
||||
// matrixStack.push();
|
||||
// matrixStack.translate(0, getSymbolVerticaloffset(craftTime), 0);
|
||||
// matrixStack.rotate(new Quaternion(Direction.UP.toVector3f(), -rotation.getHorizontalAngle(), true));
|
||||
//
|
||||
// matrixStack.push();
|
||||
//
|
||||
float pitch = getSymbolPitch(craftTime);
|
||||
// matrixStack.rotate(new Quaternion(Direction.WEST.toVector3f(), pitch, true));
|
||||
// matrixStack.rotate(new Quaternion(Direction.NORTH.toVector3f(), tertiaryRot, true));
|
||||
//// matrixStack.rotate(new Quaternion(Direction.EAST.toVector3f(), secondaryRot * 0.45812f, true));
|
||||
//
|
||||
// twoDBuffer = renderer.getBuffer(RenderType.getEntityTranslucent(symbolResource));
|
||||
// arrayModel = new BloodMagicRenderer.Model2D();
|
||||
// arrayModel.minX = -0.5;
|
||||
// arrayModel.maxX = +0.5;
|
||||
// arrayModel.minY = -0.5;
|
||||
// arrayModel.maxY = +0.5;
|
||||
// arrayModel.resource = symbolResource;
|
||||
//
|
||||
float secondarySize = 1.0F * getSecondarySizeModifier(craftTime);
|
||||
//
|
||||
// matrixStack.scale(secondarySize, secondarySize, secondarySize);
|
||||
//
|
||||
int colorWanted = 0xFFFFFFFF;
|
||||
//
|
||||
// RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, colorWanted, 0x00F000F0, combinedOverlayIn);
|
||||
//
|
||||
// matrixStack.pop();
|
||||
// matrixStack.pop();
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.translate(0, getCentralCircleOffset(craftTime), 0);
|
||||
matrixStack.rotate(new Quaternion(Direction.UP.toVector3f(), -rotation.getHorizontalAngle(), true));
|
||||
|
||||
matrixStack.push();
|
||||
|
||||
pitch = getCentralCirclePitch(craftTime);
|
||||
matrixStack.rotate(new Quaternion(Direction.WEST.toVector3f(), pitch, true));
|
||||
matrixStack.rotate(new Quaternion(Direction.UP.toVector3f(), -secondaryRot, true));
|
||||
// matrixStack.rotate(new Quaternion(Direction.EAST.toVector3f(), secondaryRot * 0.45812f, true));
|
||||
|
||||
twoDBuffer = renderer.getBuffer(RenderType.getEntityTranslucent(circleResource));
|
||||
arrayModel = new BloodMagicRenderer.Model2D();
|
||||
arrayModel.minX = -0.5;
|
||||
arrayModel.maxX = +0.5;
|
||||
arrayModel.minY = -0.5;
|
||||
arrayModel.maxY = +0.5;
|
||||
arrayModel.resource = circleResource;
|
||||
|
||||
float tertiarySize = 1.0F * getTertiarySizeModifier(craftTime);
|
||||
|
||||
matrixStack.scale(tertiarySize, tertiarySize, tertiarySize);
|
||||
|
||||
colorWanted = 0xFFFFFFFF;
|
||||
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, colorWanted, 0x00F000F0, combinedOverlayIn);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
|
||||
// Moon going over the array
|
||||
|
||||
matrixStack.push();
|
||||
matrixStack.translate(0, getCentralCircleOffset(craftTime), 0);
|
||||
matrixStack.rotate(new Quaternion(Direction.UP.toVector3f(), -rotation.getHorizontalAngle(), true));
|
||||
matrixStack.rotate(new Quaternion(Direction.SOUTH.toVector3f(), moonArc(craftTime), true));
|
||||
matrixStack.translate(moonDisplacement(craftTime), 0, 0);
|
||||
|
||||
matrixStack.push();
|
||||
|
||||
pitch = getSymbolPitch(craftTime);
|
||||
|
||||
matrixStack.rotate(new Quaternion(Direction.WEST.toVector3f(), pitch, true));
|
||||
matrixStack.rotate(new Quaternion(Direction.NORTH.toVector3f(), tertiaryRot, true));
|
||||
// matrixStack.rotate(new Quaternion(Direction.EAST.toVector3f(), secondaryRot * 0.45812f, true));
|
||||
|
||||
twoDBuffer = renderer.getBuffer(RenderType.getEntityTranslucent(symbolResource));
|
||||
arrayModel = new BloodMagicRenderer.Model2D();
|
||||
arrayModel.minX = -0.5;
|
||||
arrayModel.maxX = +0.5;
|
||||
arrayModel.minY = -0.5;
|
||||
arrayModel.maxY = +0.5;
|
||||
arrayModel.resource = symbolResource;
|
||||
|
||||
secondarySize = 1.0F;
|
||||
|
||||
matrixStack.scale(secondarySize, secondarySize, secondarySize);
|
||||
|
||||
colorWanted = 0xFFFFFFFF;
|
||||
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, colorWanted, 0x00F000F0, combinedOverlayIn);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ 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;
|
||||
|
@ -75,7 +74,7 @@ public class SingleAlchemyCircleRenderer extends AlchemyArrayRenderer
|
|||
|
||||
matrixStack.scale(size, size, size);
|
||||
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, 0xFFFFFFFF, 0x00F000F0, OverlayTexture.NO_OVERLAY);
|
||||
RenderResizableQuadrilateral.INSTANCE.renderSquare(arrayModel, matrixStack, twoDBuffer, 0xFFFFFFFF, 0x00F000F0, combinedOverlayIn);
|
||||
|
||||
matrixStack.pop();
|
||||
matrixStack.pop();
|
||||
|
|
|
@ -1,11 +1,18 @@
|
|||
package wayoftime.bloodmagic.common.alchemyarray;
|
||||
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.effect.LightningBoltEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import wayoftime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class AlchemyArrayEffectDay extends AlchemyArrayEffect
|
||||
{
|
||||
private long startingTime = 0;
|
||||
|
||||
public AlchemyArrayEffectDay()
|
||||
{
|
||||
|
||||
|
@ -14,21 +21,58 @@ public class AlchemyArrayEffectDay extends AlchemyArrayEffect
|
|||
@Override
|
||||
public boolean update(TileAlchemyArray tile, int ticksActive)
|
||||
{
|
||||
// TODO: Add recipe rechecking to verify nothing screwy is going on.
|
||||
if (tile.getWorld().isRemote)
|
||||
// if (ticksActive < 200)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
World world = tile.getWorld();
|
||||
|
||||
if (ticksActive == 100)
|
||||
{
|
||||
startingTime = world.getDayTime();
|
||||
tile.doDropIngredients(false);
|
||||
}
|
||||
|
||||
if (ticksActive <= 100)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tile.getWorld() instanceof ServerWorld)
|
||||
// TODO: Add recipe rechecking to verify nothing screwy is going on.
|
||||
if (world.isRemote && world instanceof ClientWorld)
|
||||
{
|
||||
long time = (tile.getWorld().getGameTime() / 24000) * 24000;
|
||||
for (ServerWorld serverworld : tile.getWorld().getServer().getWorlds())
|
||||
long finalTime = ((world.getDayTime() + 24000) / 24000) * 24000;
|
||||
long time = (finalTime - startingTime) * (ticksActive - 100) / 100 + startingTime;
|
||||
|
||||
((ClientWorld) world).getWorldInfo().setDayTime(time);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world instanceof ServerWorld)
|
||||
{
|
||||
// world.getDayTime()
|
||||
long finalTime = ((world.getDayTime() + 24000) / 24000) * 24000;
|
||||
long time = (finalTime - startingTime) * (ticksActive - 100) / 100 + startingTime;
|
||||
for (ServerWorld serverworld : world.getServer().getWorlds())
|
||||
{
|
||||
serverworld.func_241114_a_((long) time);
|
||||
}
|
||||
|
||||
return true;
|
||||
if (ticksActive >= 200)
|
||||
{
|
||||
BlockPos pos = tile.getPos();
|
||||
LightningBoltEntity lightningboltentity = EntityType.LIGHTNING_BOLT.create(world);
|
||||
// LightningBoltEntity lightning = new LightningBoltEntity(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
lightningboltentity.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
|
||||
lightningboltentity.setEffectOnly(true);
|
||||
world.addEntity(lightningboltentity);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
package wayoftime.bloodmagic.common.alchemyarray;
|
||||
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.effect.LightningBoltEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import wayoftime.bloodmagic.tile.TileAlchemyArray;
|
||||
|
||||
public class AlchemyArrayEffectNight extends AlchemyArrayEffect
|
||||
{
|
||||
private long startingTime = 0;
|
||||
|
||||
public AlchemyArrayEffectNight()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean update(TileAlchemyArray tile, int ticksActive)
|
||||
{
|
||||
// if (ticksActive < 200)
|
||||
// {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
World world = tile.getWorld();
|
||||
if (ticksActive == 100)
|
||||
{
|
||||
startingTime = world.getDayTime();
|
||||
tile.doDropIngredients(false);
|
||||
}
|
||||
|
||||
if (ticksActive <= 100)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// TODO: Add recipe rechecking to verify nothing screwy is going on.
|
||||
|
||||
if (world.isRemote && world instanceof ClientWorld)
|
||||
{
|
||||
long finalTime = ((world.getDayTime() + 11000) / 24000) * 24000 + 13000;
|
||||
long time = (finalTime - startingTime) * (ticksActive - 100) / 100 + startingTime;
|
||||
|
||||
((ClientWorld) world).getWorldInfo().setDayTime(time);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world instanceof ServerWorld)
|
||||
{
|
||||
// world.getDayTime()
|
||||
long finalTime = ((world.getDayTime() + 11000) / 24000) * 24000 + 13000;
|
||||
long time = (finalTime - startingTime) * (ticksActive - 100) / 100 + startingTime;
|
||||
for (ServerWorld serverworld : world.getServer().getWorlds())
|
||||
{
|
||||
serverworld.func_241114_a_((long) time);
|
||||
}
|
||||
|
||||
if (ticksActive >= 200)
|
||||
{
|
||||
BlockPos pos = tile.getPos();
|
||||
LightningBoltEntity lightningboltentity = EntityType.LIGHTNING_BOLT.create(world);
|
||||
// LightningBoltEntity lightning = new LightningBoltEntity(world, pos.getX() + dispX, pos.getY(), pos.getZ() + dispZ);
|
||||
lightningboltentity.setPosition(pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5);
|
||||
lightningboltentity.setEffectOnly(true);
|
||||
world.addEntity(lightningboltentity);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(CompoundNBT tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(CompoundNBT tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlchemyArrayEffect getNewCopy()
|
||||
{
|
||||
return new AlchemyArrayEffectNight();
|
||||
}
|
||||
}
|
|
@ -39,7 +39,8 @@ public class AlchemyArrayRecipeProvider implements ISubRecipeProvider
|
|||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/movementarray.png"), Ingredient.fromItems(Items.FEATHER), Ingredient.fromTag(Tags.Items.DUSTS_REDSTONE), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "movement"));
|
||||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/updraftarray.png"), Ingredient.fromItems(Items.FEATHER), Ingredient.fromTag(Tags.Items.DUSTS_GLOWSTONE), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "updraft"));
|
||||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/spikearray.png"), Ingredient.fromItems(Items.COBBLESTONE), Ingredient.fromTag(Tags.Items.INGOTS_IRON), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "spike"));
|
||||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/spikearray.png"), Ingredient.fromItems(Items.COAL), Ingredient.fromItems(Items.COAL), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "day"));
|
||||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/sunarray.png"), Ingredient.fromItems(Items.COAL), Ingredient.fromItems(Items.COAL), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "day"));
|
||||
AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/moonarray.png"), Ingredient.fromItems(Items.LAPIS_LAZULI), Ingredient.fromItems(Items.LAPIS_LAZULI), ItemStack.EMPTY).build(consumer, BloodMagic.rl(basePath + "night"));
|
||||
// AlchemyArrayRecipeBuilder.array(BloodMagic.rl("textures/models/alchemyarrays/fastminersigil.png"),
|
||||
// Ingredient.fromItems(BloodMagicItems.REAGENT_FAST_MINER.get()),
|
||||
// Ingredient.fromItems(BloodMagicItems.REINFORCED_SLATE.get()), new
|
||||
|
|
|
@ -13,8 +13,8 @@ import mezz.jei.api.recipe.category.IRecipeCategory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import wayoftime.bloodmagic.BloodMagic;
|
||||
import wayoftime.bloodmagic.recipe.RecipeAlchemyArray;
|
||||
import wayoftime.bloodmagic.common.item.BloodMagicItems;
|
||||
import wayoftime.bloodmagic.recipe.RecipeAlchemyArray;
|
||||
import wayoftime.bloodmagic.util.Constants;
|
||||
import wayoftime.bloodmagic.util.helper.TextHelper;
|
||||
|
||||
|
@ -88,6 +88,14 @@ public class AlchemyArrayCraftingCategory implements IRecipeCategory<RecipeAlche
|
|||
public void setIngredients(RecipeAlchemyArray recipe, IIngredients ingredients)
|
||||
{
|
||||
ingredients.setInputIngredients(recipe.getIngredients());
|
||||
ingredients.setOutput(VanillaTypes.ITEM, recipe.getOutput());
|
||||
if (recipe.getOutput().isEmpty())
|
||||
{
|
||||
ingredients.setOutput(VanillaTypes.ITEM, new ItemStack(BloodMagicItems.ARCANE_ASHES.get()));
|
||||
// ingredients.setOutput(VanillaTypes.ITEM, new ItemStack(BloodMagicBlocks.ALCHEMY_ARRAY.get()));
|
||||
} else
|
||||
{
|
||||
ingredients.setOutput(VanillaTypes.ITEM, recipe.getOutput());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import wayoftime.bloodmagic.common.alchemyarray.AlchemyArrayEffectBinding;
|
|||
import wayoftime.bloodmagic.common.alchemyarray.AlchemyArrayEffectCrafting;
|
||||
import wayoftime.bloodmagic.common.alchemyarray.AlchemyArrayEffectDay;
|
||||
import wayoftime.bloodmagic.common.alchemyarray.AlchemyArrayEffectMovement;
|
||||
import wayoftime.bloodmagic.common.alchemyarray.AlchemyArrayEffectNight;
|
||||
import wayoftime.bloodmagic.common.alchemyarray.AlchemyArrayEffectSpike;
|
||||
import wayoftime.bloodmagic.common.alchemyarray.AlchemyArrayEffectUpdraft;
|
||||
import wayoftime.bloodmagic.impl.BloodMagicAPI;
|
||||
|
@ -39,6 +40,7 @@ public class AlchemyArrayRegistry
|
|||
registerEffect(BloodMagic.rl("array/updraft"), new AlchemyArrayEffectUpdraft());
|
||||
registerEffect(BloodMagic.rl("array/spike"), new AlchemyArrayEffectSpike());
|
||||
registerEffect(BloodMagic.rl("array/day"), new AlchemyArrayEffectDay());
|
||||
registerEffect(BloodMagic.rl("array/night"), new AlchemyArrayEffectNight());
|
||||
}
|
||||
|
||||
public static AlchemyArrayEffect getEffect(World world, ResourceLocation rl, RecipeAlchemyArray recipe)
|
||||
|
|
|
@ -70,6 +70,11 @@ public class TileAlchemyArray extends TileInventory implements ITickableTileEnti
|
|||
}
|
||||
}
|
||||
|
||||
public void doDropIngredients(boolean drop)
|
||||
{
|
||||
this.doDropIngredients = drop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT serialize(CompoundNBT tagCompound)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue