aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java134
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java2
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java15
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java1
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java119
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java69
6 files changed, 310 insertions, 30 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java
index 644535a9..d73cb344 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java
@@ -7,7 +7,20 @@ import kr.syeyoung.dungeonsguide.events.*;
import kr.syeyoung.dungeonsguide.features.*;
import kr.syeyoung.dungeonsguide.features.AbstractFeature;
import kr.syeyoung.dungeonsguide.features.listener.*;
+import kr.syeyoung.dungeonsguide.utils.RenderUtils;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.WorldRenderer;
+import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.util.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.PlaySoundEvent;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
@@ -15,6 +28,11 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
+import org.lwjgl.opengl.GL11;
+
+import java.awt.*;
+import java.util.ArrayList;
+import java.util.List;
public class FeatureListener {
@SubscribeEvent
@@ -144,6 +162,122 @@ public class FeatureListener {
@SubscribeEvent
public void onRenderWorld(RenderWorldLastEvent postRender) {
try {
+ {
+
+ if (Minecraft.getMinecraft().thePlayer.getItemInUse() != null){
+ float partialTicks = postRender.partialTicks;
+ List<Vec3> locations = new ArrayList<>();
+
+ EntityPlayer shooter = Minecraft.getMinecraft().thePlayer;
+ Vec3 startLoc = new Vec3(shooter.posX, shooter.posY + (double)shooter.getEyeHeight(), shooter.posZ);
+ float rotationYaw = shooter.rotationYaw;
+ float rotationPitch = shooter.rotationPitch;
+ startLoc = startLoc.addVector((double)(MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * 0.16F),
+ 0.10000000149011612D, (double)(MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * 0.16F));
+
+ double motionX = (double)(-MathHelper.sin(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI));
+ double motionZ = (double)(MathHelper.cos(rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(rotationPitch / 180.0F * (float)Math.PI));
+ double motionY = (double)(-MathHelper.sin(rotationPitch / 180.0F * (float)Math.PI));
+
+ float f = MathHelper.sqrt_double(motionX * motionX + motionY * motionY + motionZ * motionZ);
+ motionX = motionX / (double)f;
+ motionY = motionY / (double)f;
+ motionZ = motionZ / (double)f;
+
+ int i = Items.bow.getMaxItemUseDuration(Minecraft.getMinecraft().thePlayer.getItemInUse()) - Minecraft.getMinecraft().thePlayer.getItemInUseCount();
+ float velocity = (float)i / 20.0F;
+ velocity = (velocity * velocity + velocity * 2.0F) / 3.0F;
+
+ if (velocity > 1.0F)
+ {
+ velocity = 1.0F;
+ }
+
+ motionX = motionX * (double)velocity * 2 * 1.5;
+ motionY = motionY * (double)velocity* 2 * 1.5;
+ motionZ = motionZ * (double)velocity* 2 * 1.5;
+
+
+ boolean water;
+
+ // do calc
+
+ for (int index = 0; index < 9999; index++) {
+ IBlockState iBlockState = Minecraft.getMinecraft().theWorld.getBlockState(new BlockPos(startLoc));
+ Block block = iBlockState.getBlock();
+ water = block == Blocks.water || block == Blocks.flowing_water;
+
+ if (block.getMaterial() != Material.air)
+ {
+ AxisAlignedBB axisalignedbb = block.getCollisionBoundingBox(Minecraft.getMinecraft().theWorld, new BlockPos(startLoc), iBlockState);
+
+ if (axisalignedbb != null && axisalignedbb.isVecInside(startLoc))
+ {
+ RenderUtils.highlightBlock(new BlockPos(startLoc), new Color(0,255,0,100), postRender.partialTicks);
+ break;
+ }
+ }
+
+ {
+ // do magic
+
+ Vec3 vec31 = startLoc;
+ Vec3 vec3 = startLoc.addVector(motionX, motionY, motionZ);
+ MovingObjectPosition movingobjectposition = Minecraft.getMinecraft().theWorld.rayTraceBlocks(vec31, vec3, false, true, false);
+ vec31 = startLoc;
+ vec3 = startLoc.addVector(motionX, motionY, motionZ);
+
+ System.out.println(movingobjectposition);
+
+ }
+
+ locations.add(startLoc);
+ startLoc = startLoc.addVector(motionX, motionY, motionZ); // it
+
+ float f4 = 0.99F;
+ float f6 = 0.05F;
+
+ if (water) {
+ f4 = 0.6F;
+ }
+
+ motionX *= (double) f4;
+ motionY *= (double) f4;
+ motionZ *= (double) f4;
+ motionY -= (double) f6;
+ }
+ {
+ Entity render = Minecraft.getMinecraft().getRenderViewEntity();
+ WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
+
+ double realX = render.lastTickPosX + (render.posX - render.lastTickPosX) * partialTicks;
+ double realY = render.lastTickPosY + (render.posY - render.lastTickPosY) * partialTicks;
+ double realZ = render.lastTickPosZ + (render.posZ - render.lastTickPosZ) * partialTicks;
+
+ GlStateManager.pushMatrix();
+ GlStateManager.translate(-realX, -realY, -realZ);
+ GlStateManager.disableTexture2D();
+ GlStateManager.enableBlend();
+ GlStateManager.disableAlpha();
+ GL11.glLineWidth(2);
+ GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
+
+ GlStateManager.color(1,1,1,1);
+ worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION);
+ for (Vec3 pos2:locations) {
+ worldRenderer.pos(pos2.xCoord, pos2.yCoord, pos2.zCoord).endVertex();
+ }
+ Tessellator.getInstance().draw();
+
+ GlStateManager.translate(realX, realY, realZ);
+ GlStateManager.disableBlend();
+ GlStateManager.enableAlpha();
+ GlStateManager.enableTexture2D();
+ GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
+ GlStateManager.popMatrix();
+ }
+ }
+ }
SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
if (!skyblockStatus.isOnSkyblock()) return;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java
index 4567abb2..6ef89019 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/party/PartyManager.java
@@ -33,7 +33,7 @@ public class PartyManager implements StompMessageHandler {
public static final PartyManager INSTANCE = new PartyManager();
@Getter
- private String partyID = null;
+ private String partyID = "GENERATE_PARTYID_PLEASE_POG_THIS_IS_INVALID_ID_THAT_SHOULD_BE_REGENERATED";
@Getter
private String askToJoinSecret = null;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
index b3a42aa0..6a0a3dfa 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
@@ -17,25 +17,33 @@ import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet;
import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit;
import lombok.Getter;
import lombok.Setter;
+import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
+import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.WorldRenderer;
+import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.entity.passive.EntityBat;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
-import net.minecraft.util.BlockPos;
-import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.IChatComponent;
+import net.minecraft.util.*;
import net.minecraftforge.client.event.GuiScreenEvent;
+import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.fml.common.gameevent.InputEvent;
+import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.*;
+import java.util.List;
public class GeneralRoomProcessor implements RoomProcessor {
@@ -129,6 +137,7 @@ public class GeneralRoomProcessor implements RoomProcessor {
}
}
if (path != null) path.onRenderWorld(partialTicks);
+
}
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
index ff3b0ae3..a4f4188d 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
@@ -4,6 +4,7 @@ import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.event.GuiScreenEvent;
+import net.minecraftforge.client.event.RenderLivingEvent;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java
index 38acb3c8..ab25e451 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessorBlazeSolver.java
@@ -6,11 +6,25 @@ import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
import kr.syeyoung.dungeonsguide.utils.RenderUtils;
import kr.syeyoung.dungeonsguide.utils.TextUtils;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.WorldRenderer;
+import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
+import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityArmorStand;
-import net.minecraft.util.BlockPos;
-import net.minecraft.util.Vec3;
+import net.minecraft.entity.monster.EntityBlaze;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemBow;
+import net.minecraft.util.*;
import net.minecraft.world.World;
import org.jetbrains.annotations.Nullable;
+import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.ArrayList;
@@ -21,7 +35,9 @@ public class RoomProcessorBlazeSolver extends GeneralRoomProcessor {
private boolean highToLow = false;
private List<EntityArmorStand> entityList = new ArrayList<EntityArmorStand>();
+ private List<EntityBlaze> blazeList = new ArrayList<>();
private EntityArmorStand next;
+ private EntityBlaze nextBlaze;
public RoomProcessorBlazeSolver(DungeonRoom dungeonRoom) {
super(dungeonRoom);
Object highToLow = dungeonRoom.getDungeonRoomInfo().getProperties().get("order");
@@ -37,13 +53,15 @@ public class RoomProcessorBlazeSolver extends GeneralRoomProcessor {
World w = dungeonRoom.getContext().getWorld();
final BlockPos low = dungeonRoom.getMin();
final BlockPos high = dungeonRoom.getMax();
- entityList = new ArrayList<EntityArmorStand>(w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() {
- @Override
- public boolean apply(@Nullable EntityArmorStand input) {
- BlockPos pos = input.getPosition();
- return low.getX() < pos.getX() && pos.getX() < high.getX()
- && low.getZ() < pos.getZ() && pos.getZ() < high.getZ() && input.getName().toLowerCase().contains("blaze");
- }
+ entityList = new ArrayList<EntityArmorStand>(w.getEntities(EntityArmorStand.class, input -> {
+ BlockPos pos = input.getPosition();
+ return low.getX() < pos.getX() && pos.getX() < high.getX()
+ && low.getZ() < pos.getZ() && pos.getZ() < high.getZ() && input.getName().toLowerCase().contains("blaze");
+ }));
+ blazeList = new ArrayList<EntityBlaze>(w.getEntities(EntityBlaze.class, input -> {
+ BlockPos pos = input.getPosition();
+ return low.getX() < pos.getX() && pos.getX() < high.getX()
+ && low.getZ() < pos.getZ() && pos.getZ() < high.getZ() && input.getName().toLowerCase().contains("blaze");
}));
EntityArmorStand semi_target = null;
@@ -64,6 +82,10 @@ public class RoomProcessorBlazeSolver extends GeneralRoomProcessor {
} catch (Exception e){}
}
+ if (semi_target != null) {
+ EntityArmorStand finalSemi_target = semi_target;
+ nextBlaze = blazeList.stream().filter(e -> e.getDistanceSqToEntity(finalSemi_target) < 9).findFirst().orElse(null);
+ }
next = semi_target;
}
@@ -75,10 +97,87 @@ public class RoomProcessorBlazeSolver extends GeneralRoomProcessor {
if (!FeatureRegistry.SOLVER_BLAZE.isEnabled()) return;
if (next == null) return;
Vec3 pos = next.getPositionEyes(partialTicks);
- RenderUtils.highlightBox(next, new Color(0,255,0,100), partialTicks, false);
RenderUtils.drawTextAtWorld("NEXT", (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, 0xFFFF0000, 0.5f, true, false, partialTicks);
+
+ Entity viewing_from = Minecraft.getMinecraft().getRenderViewEntity();
+
+ double x_fix = viewing_from.lastTickPosX + ((viewing_from.posX - viewing_from.lastTickPosX) * partialTicks);
+ double y_fix = viewing_from.lastTickPosY + ((viewing_from.posY - viewing_from.lastTickPosY) * partialTicks);
+ double z_fix = viewing_from.lastTickPosZ + ((viewing_from.posZ - viewing_from.lastTickPosZ) * partialTicks);
+
+
+ for (EntityBlaze entity : blazeList) {
+ float f = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks;
+ double x = entity.prevPosX + (entity.posX - entity.prevPosX) * partialTicks;
+ double y = entity.prevPosY + (entity.posY - entity.prevPosY) * partialTicks;
+ double z = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * partialTicks;
+
+
+ GL11.glEnable(GL11.GL_STENCIL_TEST);
+ GL11.glClearStencil(0);
+ GlStateManager.disableDepth();
+ GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
+
+ GL11.glStencilMask(0xFF);
+ GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0xFF);
+ GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_REPLACE, GL11.GL_REPLACE);
+
+ GlStateManager.pushMatrix();
+ GlStateManager.pushAttrib();
+ GlStateManager.translate(-x_fix, -y_fix, -z_fix);
+
+ GlStateManager.colorMask(false, false, false, false);
+ Minecraft.getMinecraft().getRenderManager().doRenderEntity(entity, x,y,z,f,partialTicks, true);
+ GlStateManager.colorMask(true, true, true, true);
+
+ GlStateManager.popMatrix();
+ GlStateManager.popAttrib();
+
+ GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF);
+ GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
+
+// Gui.drawRect(-9999,-9999, 9999, 9999, 0xFFFFFFFF);
+
+ boolean border = false;
+
+ if (entity != nextBlaze)
+ RenderUtils.highlightBox(entity, AxisAlignedBB.fromBounds(-0.8,0, -0.8, 0.8, 2, 0.8), new Color(255,255,255,255), partialTicks, false);
+ else
+ RenderUtils.highlightBox(entity, AxisAlignedBB.fromBounds(-0.8,0, -0.8, 0.8, 2, 0.8), new Color(0,255,0,255), partialTicks, false);
+ GlStateManager.color(1,1,1,1);
+
+
+ if (border) {
+ GL11.glStencilFunc(GL11.GL_NOTEQUAL, 3, 0x01);
+ GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_REPLACE, GL11.GL_REPLACE);
+ GlStateManager.pushMatrix();
+ GlStateManager.pushAttrib();
+ GlStateManager.translate(-x_fix, -y_fix, -z_fix);
+ GlStateManager.translate(x, y + 0.7, z);
+ GlStateManager.scale(1.1f, 1.1f, 1.1f);
+
+ GlStateManager.colorMask(false, false, false, false);
+ Minecraft.getMinecraft().getRenderManager().doRenderEntity(entity, 0, -0.7, 0, f, partialTicks, true);
+ GlStateManager.colorMask(true, true, true, true);
+
+ GlStateManager.popMatrix();
+ GlStateManager.popAttrib();
+
+
+ GL11.glStencilFunc(GL11.GL_EQUAL, 3, 0xFF);
+ GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
+
+ RenderUtils.highlightBox(entity, AxisAlignedBB.fromBounds(-1, 0, -1, 1, 2, 1), new Color(0, 255, 255, 255), partialTicks, false);
+ }
+
+
+ GL11.glDisable(GL11.GL_STENCIL_TEST);
+ GlStateManager.enableDepth();
+ }
}
+
+
public static class Generator implements RoomProcessorGenerator<RoomProcessorBlazeSolver> {
@Override
public RoomProcessorBlazeSolver createNew(DungeonRoom dungeonRoom) {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
index 13eb53e3..35319e71 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java
@@ -395,13 +395,26 @@ public class RenderUtils {
}
int rgb = RenderUtils.getColorAt(entity.posX * 10,entity.posY * 10,c);
GlStateManager.color(((rgb >> 16) &0XFF)/ 255.0f, ((rgb>>8) &0XFF)/ 255.0f, (rgb & 0xff)/ 255.0f, ((rgb >> 24) & 0xFF) / 255.0f);
+ if (axisAlignedBB == null) {
+ if (entity instanceof EntityArmorStand) {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4);
+ } else if (entity instanceof EntityBat) {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.4, -0.4, 0.4, 0.4, 0.4);
+ } else {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4);
+ }
+ }
+ Vec3 renderPos = new Vec3(
+ (float) (entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks),
+ (float) (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks),
+ (float) (entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks)
+ );
+ GlStateManager.translate(axisAlignedBB.minX + renderPos.xCoord, axisAlignedBB.minY + renderPos.yCoord, axisAlignedBB.minZ + renderPos.zCoord);
- GlStateManager.translate(-0.4 + entity.posX, entity.posY, -0.4 + entity.posZ);
-
- double x = 0.8;
- double y = 1.5;
- double z = 0.8;
+ double x = axisAlignedBB.maxX - axisAlignedBB.minX;
+ double y = axisAlignedBB.maxY - axisAlignedBB.minY;
+ double z = axisAlignedBB.maxZ - axisAlignedBB.minZ;
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(0, 0, 0);
GL11.glVertex3d(0, 0, z);
@@ -470,13 +483,26 @@ public class RenderUtils {
GlStateManager.depthMask(false);
}
GlStateManager.color(c.getRed()/ 255.0f, c.getGreen()/ 255.0f, c.getBlue()/ 255.0f, c.getAlpha()/ 255.0f);
+ if (axisAlignedBB == null) {
+ if (entity instanceof EntityArmorStand) {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4);
+ } else if (entity instanceof EntityBat) {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.4, -0.4, 0.4, 0.4, 0.4);
+ } else {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4);
+ }
+ }
+ Vec3 renderPos = new Vec3(
+ (float) (entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks),
+ (float) (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks),
+ (float) (entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks)
+ );
+ GlStateManager.translate(axisAlignedBB.minX + renderPos.xCoord, axisAlignedBB.minY + renderPos.yCoord, axisAlignedBB.minZ + renderPos.zCoord);
- GlStateManager.translate(-0.4 + entity.posX, entity.posY, -0.4 + entity.posZ);
-
- double x = 0.8;
- double y = 1.5;
- double z = 0.8;
+ double x = axisAlignedBB.maxX - axisAlignedBB.minX;
+ double y = axisAlignedBB.maxY - axisAlignedBB.minY;
+ double z = axisAlignedBB.maxZ - axisAlignedBB.minZ;
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(0, 0, 0);
GL11.glVertex3d(0, 0, z);
@@ -544,14 +570,25 @@ public class RenderUtils {
GlStateManager.depthMask(false);
}
GlStateManager.color(c.getRed()/ 255.0f, c.getGreen()/ 255.0f, c.getBlue()/ 255.0f, c.getAlpha()/ 255.0f);
- AxisAlignedBB axisAlignedBB = AxisAlignedBB.fromBounds(-0.4,-1.5,-0.4,0.4,0,0.4);
-
+ AxisAlignedBB axisAlignedBB;
+ if (entity instanceof EntityArmorStand) {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4);
+ } else if (entity instanceof EntityBat) {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.4, -0.4, 0.4, 0.4, 0.4);
+ } else {
+ axisAlignedBB = AxisAlignedBB.fromBounds(-0.4, -1.5, -0.4, 0.4, 0, 0.4);
+ }
- GlStateManager.translate(-0.4 + entity.posX, -1.5 + entity.posY, -0.4 + entity.posZ);
+ Vec3 renderPos = new Vec3(
+ (float) (entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks),
+ (float) (entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks),
+ (float) (entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks)
+ );
+ GlStateManager.translate(axisAlignedBB.minX + renderPos.xCoord, axisAlignedBB.minY + renderPos.yCoord, axisAlignedBB.minZ + renderPos.zCoord);
- double x = 0.8;
- double y = 1.5;
- double z = 0.8;
+ double x = axisAlignedBB.maxX - axisAlignedBB.minX;
+ double y = axisAlignedBB.maxY - axisAlignedBB.minY;
+ double z = axisAlignedBB.maxZ - axisAlignedBB.minZ;
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3d(0, 0, 0);
GL11.glVertex3d(0, 0, z);