mirror of
https://github.com/GTNewHorizons/Gadomancy.git
synced 2026-11-27 15:23:22 +00:00
update BS+SA
This commit is contained in:
262 files changed
+8101
-4674
No files matched your search
@@ -45,14 +45,26 @@ public class RenderTileNodeBasic {
|
||||
|
||||
public static final ResourceLocation nodetex = new ResourceLocation("thaumcraft", "textures/misc/nodes.png");
|
||||
|
||||
//Gadomancy: changed params x, y, z from int to double
|
||||
public static void renderNode(EntityLivingBase viewer, double viewDistance, boolean visible, boolean depthIgnore, float size, double x, double y, double z, float partialTicks, AspectList aspects, NodeType type, NodeModifier mod) {
|
||||
// Gadomancy: changed params x, y, z from int to double
|
||||
public static void renderNode(
|
||||
EntityLivingBase viewer,
|
||||
double viewDistance,
|
||||
boolean visible,
|
||||
boolean depthIgnore,
|
||||
float size,
|
||||
double x,
|
||||
double y,
|
||||
double z,
|
||||
float partialTicks,
|
||||
AspectList aspects,
|
||||
NodeType type,
|
||||
NodeModifier mod) {
|
||||
long nt = System.nanoTime();
|
||||
|
||||
UtilsFX.bindTexture(RenderTileNodeBasic.nodetex);
|
||||
int frames = 32;
|
||||
if ((aspects.size() > 0) && (visible)) {
|
||||
double distance = viewer.getDistance(x, y, z); //Gadomancy: Removed '+ 0.5D' to coords.
|
||||
double distance = viewer.getDistance(x, y, z); // Gadomancy: Removed '+ 0.5D' to coords.
|
||||
if (distance > viewDistance) {
|
||||
return;
|
||||
}
|
||||
@@ -84,7 +96,6 @@ public class RenderTileNodeBasic {
|
||||
float rad = 6.283186F;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, alpha);
|
||||
|
||||
|
||||
int i = (int) ((nt / 40000000L + x) % frames);
|
||||
|
||||
int count = 0;
|
||||
@@ -103,8 +114,19 @@ public class RenderTileNodeBasic {
|
||||
scale = 0.2F + scale * (aspects.getAmount(aspect) / 50.0F);
|
||||
scale *= size;
|
||||
angle = (float) (time % (5000 + 500 * count)) / (5000.0F + 500 * count) * rad;
|
||||
//Gadomancy (following line): Removed '+ 0.5D' to coords.
|
||||
UtilsFX.renderFacingStrip(x, y, z, angle, scale, alpha / Math.max(1.0F, aspects.size() / 2.0F), frames, 0, i, partialTicks, aspect.getColor());
|
||||
// Gadomancy (following line): Removed '+ 0.5D' to coords.
|
||||
UtilsFX.renderFacingStrip(
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
angle,
|
||||
scale,
|
||||
alpha / Math.max(1.0F, aspects.size() / 2.0F),
|
||||
frames,
|
||||
0,
|
||||
i,
|
||||
partialTicks,
|
||||
aspect.getColor());
|
||||
GL11.glDisable(3042);
|
||||
GL11.glPopMatrix();
|
||||
count++;
|
||||
@@ -146,7 +168,7 @@ public class RenderTileNodeBasic {
|
||||
strip = 3;
|
||||
}
|
||||
GL11.glColor4f(1.0F, 0.0F, 1.0F, alpha);
|
||||
//Gadomancy (following line): Removed '+ 0.5D' to coords.
|
||||
// Gadomancy (following line): Removed '+ 0.5D' to coords.
|
||||
UtilsFX.renderFacingStrip(x, y, z, angle, scale, alpha, frames, strip, i, partialTicks, 16777215);
|
||||
GL11.glDisable(3042);
|
||||
GL11.glPopMatrix();
|
||||
@@ -169,7 +191,7 @@ public class RenderTileNodeBasic {
|
||||
|
||||
int i = (int) ((nt / 40000000L + x) % frames);
|
||||
GL11.glColor4f(1.0F, 0.0F, 1.0F, 0.1F);
|
||||
//Gadomancy (following line): Removed '+ 0.5D' to coords.
|
||||
// Gadomancy (following line): Removed '+ 0.5D' to coords.
|
||||
UtilsFX.renderFacingStrip(x, y, z, 0.0F, 0.5F, 0.1F, frames, 1, i, partialTicks, 16777215);
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
@@ -179,19 +201,20 @@ public class RenderTileNodeBasic {
|
||||
}
|
||||
}
|
||||
|
||||
//Gadomancy START
|
||||
// Gadomancy START
|
||||
public static void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks) {
|
||||
RenderTileNodeBasic.renderTileEntityAt(tile, x, y, z, partialTicks, 1.0F);
|
||||
}
|
||||
//Gadomancy END
|
||||
// Gadomancy END
|
||||
|
||||
//Gadomancy: Added dynamic size
|
||||
public static void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks, float size) {
|
||||
//Gadomancy Added event hook
|
||||
// Gadomancy: Added dynamic size
|
||||
public static void renderTileEntityAt(
|
||||
TileEntity tile, double x, double y, double z, float partialTicks, float size) {
|
||||
// Gadomancy Added event hook
|
||||
EventHandlerRedirect.preNodeRender(tile);
|
||||
|
||||
if (!(tile instanceof INode)) {
|
||||
//Gadomancy Added event hook
|
||||
// Gadomancy Added event hook
|
||||
EventHandlerRedirect.postNodeRender(tile);
|
||||
return;
|
||||
}
|
||||
@@ -203,12 +226,21 @@ public class RenderTileNodeBasic {
|
||||
if ((viewer instanceof EntityPlayer)) {
|
||||
if ((tile != null) && ((tile instanceof TileJarNode))) {
|
||||
condition = true;
|
||||
size = (float) ((size * 7D) / 10D); //Gadomancy: Node size is 70% of the default size in standart TC. calculating the same here.
|
||||
} else if ((((EntityPlayer) viewer).inventory.armorItemInSlot(3) != null) && ((((EntityPlayer) viewer).inventory.armorItemInSlot(3).getItem() instanceof IRevealer)) && (((IRevealer) ((EntityPlayer) viewer).inventory.armorItemInSlot(3).getItem()).showNodes(((EntityPlayer) viewer).inventory.armorItemInSlot(3), viewer))) {
|
||||
size = (float) ((size * 7D)
|
||||
/ 10D); // Gadomancy: Node size is 70% of the default size in standart TC. calculating the same
|
||||
// here.
|
||||
} else if ((((EntityPlayer) viewer).inventory.armorItemInSlot(3) != null)
|
||||
&& ((((EntityPlayer) viewer).inventory.armorItemInSlot(3).getItem() instanceof IRevealer))
|
||||
&& (((IRevealer) ((EntityPlayer) viewer)
|
||||
.inventory
|
||||
.armorItemInSlot(3)
|
||||
.getItem())
|
||||
.showNodes(((EntityPlayer) viewer).inventory.armorItemInSlot(3), viewer))) {
|
||||
condition = true;
|
||||
depthIgnore = true;
|
||||
} else if ((((EntityPlayer) viewer).inventory.getCurrentItem() != null) && ((((EntityPlayer) viewer).inventory.getCurrentItem().getItem() instanceof ItemThaumometer))) {
|
||||
//Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params
|
||||
} else if ((((EntityPlayer) viewer).inventory.getCurrentItem() != null)
|
||||
&& ((((EntityPlayer) viewer).inventory.getCurrentItem().getItem() instanceof ItemThaumometer))) {
|
||||
// Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params
|
||||
if (UtilsFX.isVisibleTo(0.44F, viewer, x, y, z)) {
|
||||
condition = true;
|
||||
depthIgnore = true;
|
||||
@@ -216,15 +248,29 @@ public class RenderTileNodeBasic {
|
||||
}
|
||||
}
|
||||
}
|
||||
//Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params
|
||||
RenderTileNodeBasic.renderNode(viewer, viewDistance, condition, depthIgnore, size, x, y, z, partialTicks, ((INode) tile).getAspects(), ((INode) tile).getNodeType(), ((INode) tile).getNodeModifier());
|
||||
if (((tile instanceof TileNode)) && (((TileNode) tile).drainEntity != null) && (((TileNode) tile).drainCollision != null)) {
|
||||
// Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params
|
||||
RenderTileNodeBasic.renderNode(
|
||||
viewer,
|
||||
viewDistance,
|
||||
condition,
|
||||
depthIgnore,
|
||||
size,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
partialTicks,
|
||||
((INode) tile).getAspects(),
|
||||
((INode) tile).getNodeType(),
|
||||
((INode) tile).getNodeModifier());
|
||||
if (((tile instanceof TileNode))
|
||||
&& (((TileNode) tile).drainEntity != null)
|
||||
&& (((TileNode) tile).drainCollision != null)) {
|
||||
Entity drainEntity = ((TileNode) tile).drainEntity;
|
||||
if (((drainEntity instanceof EntityPlayer)) && (!((EntityPlayer) drainEntity).isUsingItem())) {
|
||||
((TileNode) tile).drainEntity = null;
|
||||
((TileNode) tile).drainCollision = null;
|
||||
|
||||
//Gadomancy Added event hook
|
||||
// Gadomancy Added event hook
|
||||
EventHandlerRedirect.postNodeRender(tile);
|
||||
return;
|
||||
}
|
||||
@@ -237,8 +283,14 @@ public class RenderTileNodeBasic {
|
||||
f10 = MathHelper.sin(iiud / 10.0F) * 10.0F;
|
||||
}
|
||||
Vec3 vec3 = Vec3.createVectorHelper(-0.1D, -0.1D, 0.5D);
|
||||
vec3.rotateAroundX(-(drainEntity.prevRotationPitch + (drainEntity.rotationPitch - drainEntity.prevRotationPitch) * partialTicks) * 3.141593F / 180.0F);
|
||||
vec3.rotateAroundY(-(drainEntity.prevRotationYaw + (drainEntity.rotationYaw - drainEntity.prevRotationYaw) * partialTicks) * 3.141593F / 180.0F);
|
||||
vec3.rotateAroundX(-(drainEntity.prevRotationPitch
|
||||
+ (drainEntity.rotationPitch - drainEntity.prevRotationPitch) * partialTicks)
|
||||
* 3.141593F
|
||||
/ 180.0F);
|
||||
vec3.rotateAroundY(-(drainEntity.prevRotationYaw
|
||||
+ (drainEntity.rotationYaw - drainEntity.prevRotationYaw) * partialTicks)
|
||||
* 3.141593F
|
||||
/ 180.0F);
|
||||
vec3.rotateAroundY(-f10 * 0.01F);
|
||||
vec3.rotateAroundX(-f10 * 0.015F);
|
||||
double d3 = drainEntity.prevPosX + (drainEntity.posX - drainEntity.prevPosX) * partialTicks + vec3.xCoord;
|
||||
@@ -246,13 +298,23 @@ public class RenderTileNodeBasic {
|
||||
double d5 = drainEntity.prevPosZ + (drainEntity.posZ - drainEntity.prevPosZ) * partialTicks + vec3.zCoord;
|
||||
double d6 = drainEntity == Minecraft.getMinecraft().thePlayer ? 0.0D : drainEntity.getEyeHeight();
|
||||
|
||||
UtilsFX.drawFloatyLine(d3, d4 + d6, d5, drainCollision.blockX + 0.5D, drainCollision.blockY + 0.5D, drainCollision.blockZ + 0.5D, partialTicks, ((TileNode) tile).color.getRGB(), "textures/misc/wispy.png", -0.02F, Math.min(iiud, 10) / 10.0F);
|
||||
UtilsFX.drawFloatyLine(
|
||||
d3,
|
||||
d4 + d6,
|
||||
d5,
|
||||
drainCollision.blockX + 0.5D,
|
||||
drainCollision.blockY + 0.5D,
|
||||
drainCollision.blockZ + 0.5D,
|
||||
partialTicks,
|
||||
((TileNode) tile).color.getRGB(),
|
||||
"textures/misc/wispy.png",
|
||||
-0.02F,
|
||||
Math.min(iiud, 10) / 10.0F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
//Gadomancy Added event hook
|
||||
// Gadomancy Added event hook
|
||||
EventHandlerRedirect.postNodeRender(tile);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user