mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 04:09:43 +00:00
Merge branch 'RemoveMJ' of https://github.com/CrazyPants/EnderIO.git into RemoveMJ
This commit is contained in:
commit
5b90e51600
3 files changed
+29
-25
No files matched your search
@@ -193,6 +193,7 @@ public class KillerJoeRenderer extends TileEntitySpecialRenderer implements IIte
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
renderModel(ForgeDirection.EAST.ordinal());
|
||||
renderSword(ForgeDirection.EAST.ordinal(), DEFAULT_SWORD, 0);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
@@ -135,6 +135,7 @@ public class GuiTravelAccessable extends GuiContainerBase {
|
||||
RenderUtil.bindTexture("enderio:textures/gui/travelAccessable.png");
|
||||
GL11.glColor4f(1, 1, 1, 0.75f);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
drawTexturedModalRect(43, 72, 5, 35, 90, 18);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
@@ -510,28 +510,10 @@ public class TravelController {
|
||||
return;
|
||||
}
|
||||
|
||||
Vector3d eye = Util.getEyePositionEio(player);
|
||||
Vec3 look = player.getLookVec();
|
||||
|
||||
Vector3d b = new Vector3d(eye);
|
||||
b.add(look.xCoord, look.yCoord, look.zCoord);
|
||||
|
||||
Vector3d c = new Vector3d(eye);
|
||||
c.add(0, 1, 0);
|
||||
|
||||
Vector4d leftPlane = new Vector4d();
|
||||
VecmathUtil.computePlaneEquation(eye, b, c, leftPlane);
|
||||
|
||||
c.set(eye);
|
||||
c.add(leftPlane.x, leftPlane.y, leftPlane.z);
|
||||
|
||||
Vector4d upPlane = new Vector4d();
|
||||
VecmathUtil.computePlaneEquation(eye, b, c, upPlane);
|
||||
|
||||
double closestDistance = Double.MAX_VALUE;
|
||||
Vector3d point = new Vector3d();
|
||||
for (BlockCoord bc : candidates.keySet()) {
|
||||
if(!bc.equals(onBlockCoord)) {
|
||||
if(!bc.equals(onBlockCoord)) {
|
||||
point.set(bc.x + 0.5, bc.y + 0.5, bc.z + 0.5);
|
||||
|
||||
Vector2d sp = currentView.getScreenPoint(new Vector3d(point.x, point.y, point.z));
|
||||
@@ -539,7 +521,12 @@ public class TravelController {
|
||||
mid.scale(0.5);
|
||||
|
||||
double d = sp.distance(mid);
|
||||
if(d != d) {
|
||||
d = 0f;
|
||||
}
|
||||
float ratio = (float) d / Minecraft.getMinecraft().displayWidth;
|
||||
|
||||
|
||||
candidates.put(bc, ratio);
|
||||
if(d < closestDistance) {
|
||||
selectedCoord = bc;
|
||||
@@ -549,13 +536,28 @@ public class TravelController {
|
||||
}
|
||||
|
||||
if(selectedCoord != null) {
|
||||
Vector2d sp = currentView.getScreenPoint(new Vector3d(selectedCoord.x + 0.5, selectedCoord.y + 0.5, selectedCoord.z + 0.5));
|
||||
Vector2d mid = new Vector2d(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
|
||||
mid.scale(0.5);
|
||||
double ratio = sp.distance(mid) / Minecraft.getMinecraft().displayWidth;
|
||||
if(ratio > 0.2) {
|
||||
|
||||
Vector3d blockCenter = new Vector3d(selectedCoord.x + 0.5, selectedCoord.y + 0.5, selectedCoord.z + 0.5);
|
||||
Vector2d blockCenterPixel = currentView.getScreenPoint(blockCenter);
|
||||
|
||||
Vector2d screenMidPixel = new Vector2d(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
|
||||
screenMidPixel.scale(0.5);
|
||||
double ratio = blockCenterPixel.distance(screenMidPixel) / Minecraft.getMinecraft().displayWidth;
|
||||
|
||||
Vector3d blockLeft = new Vector3d();
|
||||
Vector3d up = new Vector3d(0,1,0);
|
||||
up.add(currentView.getEyePoint());
|
||||
blockLeft.cross(currentView.getEyePoint(), up);
|
||||
blockLeft.normalize();
|
||||
blockLeft.scale(0.5);
|
||||
blockLeft.add(blockCenter);
|
||||
|
||||
Vector2d blockLeftPixel = currentView.getScreenPoint(blockLeft);
|
||||
double blockSizeRatio = blockCenterPixel.distance(blockLeftPixel)/ Minecraft.getMinecraft().displayWidth;
|
||||
double maxRatio = Math.max(0.2, blockSizeRatio);
|
||||
if(ratio > maxRatio) {
|
||||
selectedCoord = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user