aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2023-02-16 06:08:11 +0000
committerGitHub <noreply@github.com>2023-02-16 07:08:11 +0100
commit663c7bf01d000c39040dad98ba2cf961aa28191f (patch)
treee488acc2a3d3079b7b3f95c20d33f078ddf6aad1 /src
parent47f632c7cabadc1e4ae58b2d04bfffc60d62bfba (diff)
downloadGT5-Unofficial-663c7bf01d000c39040dad98ba2cf961aa28191f.tar.gz
GT5-Unofficial-663c7bf01d000c39040dad98ba2cf961aa28191f.tar.bz2
GT5-Unofficial-663c7bf01d000c39040dad98ba2cf961aa28191f.zip
Apply post-decompilation cleanup patches from the new RFG version (#1744)
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/common/GT_Worldgenerator.java8
-rw-r--r--src/main/java/gregtech/common/entities/GT_Entity_Arrow.java11
-rw-r--r--src/main/java/gregtech/common/render/GT_CapeRenderer.java4
-rw-r--r--src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java20
4 files changed, 22 insertions, 21 deletions
diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java
index 8566fd769e..c14444a3af 100644
--- a/src/main/java/gregtech/common/GT_Worldgenerator.java
+++ b/src/main/java/gregtech/common/GT_Worldgenerator.java
@@ -520,7 +520,7 @@ public class GT_Worldgenerator implements IWorldGenerator {
// mSize = aRandom.nextInt((int) (gcMaxSize - gcMinSize));
}
if ((mWorld.getBlock(tX, tY, tZ).isAir(mWorld, tX, tY, tZ))) {
- float randomRadian = aRandom.nextFloat() * 3.141593F;
+ float randomRadian = aRandom.nextFloat() * (float) Math.PI;
double xBase = tX + 8 + MathHelper.sin(randomRadian) * mSize / 8.0F;
double xFactor = tX + 8 - MathHelper.sin(randomRadian) * mSize / 8.0F;
double zBase = tZ + 8 + MathHelper.cos(randomRadian) * mSize / 8.0F;
@@ -532,8 +532,10 @@ public class GT_Worldgenerator implements IWorldGenerator {
double yCenter = yBase + (yFactor - yBase) * i / mSize;
double zCenter = zBase + (zFactor - zBase) * i / mSize;
double randomDistance = aRandom.nextDouble() * mSize / 16.0D;
- double halfLength = (MathHelper.sin(i * 3.141593F / mSize) + 1.0F) * randomDistance + 1.0D;
- double halfHeight = (MathHelper.sin(i * 3.141593F / mSize) + 1.0F) * randomDistance + 1.0D;
+ double halfLength = (MathHelper.sin(i * (float) Math.PI / mSize) + 1.0F) * randomDistance
+ + 1.0D;
+ double halfHeight = (MathHelper.sin(i * (float) Math.PI / mSize) + 1.0F) * randomDistance
+ + 1.0D;
int tMinX = MathHelper.floor_double(xCenter - halfLength / 2.0D);
int tMinY = MathHelper.floor_double(yCenter - halfHeight / 2.0D);
int tMinZ = MathHelper.floor_double(zCenter - halfLength / 2.0D);
diff --git a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java
index 5afd1b3b47..6c096c09ee 100644
--- a/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java
+++ b/src/main/java/gregtech/common/entities/GT_Entity_Arrow.java
@@ -77,9 +77,8 @@ public class GT_Entity_Arrow extends EntityArrow {
if ((this.prevRotationPitch == 0.0F) && (this.prevRotationYaw == 0.0F)) {
float f = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.prevRotationYaw = (this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D
- / 3.141592653589793D));
- this.prevRotationPitch = (this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D
- / 3.141592653589793D));
+ / Math.PI));
+ this.prevRotationPitch = (this.rotationPitch = (float) (Math.atan2(this.motionY, f) * 180.0D / Math.PI));
}
if (this.mTicksAlive++ == 3000) {
setDead();
@@ -123,7 +122,7 @@ public class GT_Entity_Arrow extends EntityArrow {
List tAllPotentiallyHitEntities = this.worldObj.getEntitiesWithinAABBExcludingEntity(
this,
this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
- double tLargestDistance = 1.7976931348623157E+308D;
+ double tLargestDistance = Double.MAX_VALUE;
for (int i = 0; i < tAllPotentiallyHitEntities.size(); i++) {
Entity entity1 = (Entity) tAllPotentiallyHitEntities.get(i);
if ((entity1.canBeCollidedWith()) && ((entity1 != tShootingEntity) || (this.ticksInAir >= 5))) {
@@ -336,11 +335,11 @@ public class GT_Entity_Arrow extends EntityArrow {
this.posY += this.motionY;
this.posZ += this.motionZ;
- this.rotationYaw = ((float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / 3.141592653589793D));
+ this.rotationYaw = ((float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI));
for (this.rotationPitch = ((float) (Math.atan2(
this.motionY,
MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ)) * 180.0D
- / 3.141592653589793D)); this.rotationPitch - this.prevRotationPitch
+ / Math.PI)); this.rotationPitch - this.prevRotationPitch
< -180.0F; this.prevRotationPitch -= 360.0F) {}
while (this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
diff --git a/src/main/java/gregtech/common/render/GT_CapeRenderer.java b/src/main/java/gregtech/common/render/GT_CapeRenderer.java
index 1a6d44ca5b..274a914b67 100644
--- a/src/main/java/gregtech/common/render/GT_CapeRenderer.java
+++ b/src/main/java/gregtech/common/render/GT_CapeRenderer.java
@@ -93,8 +93,8 @@ public class GT_CapeRenderer extends RenderPlayer {
- (aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ) * aPartialTicks);
float f6 = aPlayer.prevRenderYawOffset
+ (aPlayer.renderYawOffset - aPlayer.prevRenderYawOffset) * aPartialTicks;
- double d3 = MathHelper.sin(f6 * 3.141593F / 180.0F);
- double d4 = -MathHelper.cos(f6 * 3.141593F / 180.0F);
+ double d3 = MathHelper.sin(f6 * (float) Math.PI / 180.0F);
+ double d4 = -MathHelper.cos(f6 * (float) Math.PI / 180.0F);
float f7 = (float) d1 * 10.0F;
float f8 = (float) (d0 * d3 + d2 * d4) * 100.0F;
float f9 = (float) (d0 * d4 - d2 * d3) * 100.0F;
diff --git a/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java b/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java
index 1f7e72387a..b03b7d2f2d 100644
--- a/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java
+++ b/src/main/java/gregtech/common/render/GT_MetaGenerated_Tool_Renderer.java
@@ -53,7 +53,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
return;
}
GT_MetaGenerated_Tool aItem = (GT_MetaGenerated_Tool) aStack.getItem();
- GL11.glEnable(3042);
+ GL11.glEnable(GL11.GL_BLEND);
if (aType == IItemRenderer.ItemRenderType.ENTITY) {
if (RenderItem.renderInFrame) {
GL11.glScalef(0.85F, 0.85F, 0.85F);
@@ -73,7 +73,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
IIcon tOverlay = aIcon.getOverlayIcon();
if (tIcon != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
short[] tModulation = tToolStats.getRGBa(false, aStack);
GL11.glColor3f(tModulation[0] / 255.0F, tModulation[1] / 255.0F, tModulation[2] / 255.0F);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
@@ -93,7 +93,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
}
if (tOverlay != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
@@ -115,7 +115,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
IIcon tOverlay = aIcon.getOverlayIcon();
if (tIcon != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
short[] tModulation = tToolStats.getRGBa(true, aStack);
GL11.glColor3f(tModulation[0] / 255.0F, tModulation[1] / 255.0F, tModulation[2] / 255.0F);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
@@ -135,7 +135,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
}
if (tOverlay != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
@@ -168,7 +168,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
IIcon tOverlay = aIcon.getOverlayIcon();
if (tIcon != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
@@ -185,7 +185,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
}
if (tOverlay != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
@@ -220,7 +220,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
IIcon tOverlay = aIcon.getOverlayIcon();
if (tIcon != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
GT_RenderUtil.renderItemIcon(tIcon, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
@@ -237,7 +237,7 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
}
if (tOverlay != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(aIcon.getTextureFile());
- GL11.glBlendFunc(770, 771);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if (aType.equals(IItemRenderer.ItemRenderType.INVENTORY)) {
GT_RenderUtil.renderItemIcon(tOverlay, 16.0D, 0.001D, 0.0F, 0.0F, -1.0F);
} else {
@@ -255,6 +255,6 @@ public class GT_MetaGenerated_Tool_Renderer implements IItemRenderer {
}
}
}
- GL11.glDisable(3042);
+ GL11.glDisable(GL11.GL_BLEND);
}
}