Fixed server sided issue with Attractor Array

Added Movement Array, and helped generalize the Arrays a bit more
This commit is contained in:
WayofTime 2016-06-29 07:43:04 -04:00
parent 22c1f0db55
commit 1836fc742d
11 changed files with 130 additions and 13 deletions

View file

@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import WayofTime.bloodmagic.api.iface.IAlchemyArray;
@RequiredArgsConstructor
public abstract class AlchemyArrayEffect
@ -23,7 +24,7 @@ public abstract class AlchemyArrayEffect
public abstract AlchemyArrayEffect getNewCopy();
public void onEntityCollidedWithBlock(World world, BlockPos pos, IBlockState state, Entity entity)
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity)
{
}

View file

@ -8,6 +8,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import WayofTime.bloodmagic.tile.TileAlchemyArray;
public class AlchemyCircleRenderer
{
@ -72,6 +73,13 @@ public class AlchemyCircleRenderer
public void renderAt(TileEntity tile, double x, double y, double z, float craftTime)
{
if (!(tile instanceof TileAlchemyArray))
{
return;
}
TileAlchemyArray tileArray = (TileAlchemyArray) tile;
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer wr = tessellator.getBuffer();
@ -94,6 +102,7 @@ public class AlchemyCircleRenderer
// Specify which face this "circle" is located on
EnumFacing sideHit = EnumFacing.UP;
EnumFacing rotation = tileArray.getRotation();
GlStateManager.translate(sideHit.getFrontOffsetX() * offsetFromFace, sideHit.getFrontOffsetY() * offsetFromFace, sideHit.getFrontOffsetZ() * offsetFromFace);
@ -125,6 +134,9 @@ public class AlchemyCircleRenderer
GlStateManager.pushMatrix();
GlStateManager.translate(0.5f, 0.5f, getVerticalOffset(craftTime));
GlStateManager.rotate(rotation.getHorizontalAngle() + 180, 0, 0, 1);
GlStateManager.pushMatrix();
GlStateManager.rotate(rot, 0, 0, 1);
GlStateManager.rotate(secondaryRot, 1, 0, 0);
GlStateManager.rotate(secondaryRot * 0.45812f, 0, 0, 1);
@ -150,5 +162,6 @@ public class AlchemyCircleRenderer
// GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
}
}