Implement blast modifier support for all applicable constructs, plus misc construct-related cleanup and fixes
This commit is contained in:
@@ -18,6 +18,7 @@ import java.util.Collections;
|
||||
|
||||
public class RenderBlackHole extends Render<EntityBlackHole> {
|
||||
|
||||
// TODO: Remove RayHelper and the ray texture entirely and use colours with depth mask off (like imbuement altar)
|
||||
private static final ResourceLocation RAY_TEXTURE = new ResourceLocation(Wizardry.MODID,
|
||||
"textures/entity/black_hole/ray.png");
|
||||
private static final ResourceLocation CENTRE_TEXTURE = new ResourceLocation(Wizardry.MODID,
|
||||
@@ -65,20 +66,20 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
|
||||
|
||||
for(int j = 0; j < 30; j++){
|
||||
|
||||
float scale = 3.0f;
|
||||
float radius = 3.0f * entity.getSizeMultiplier();
|
||||
|
||||
int a = entity.randomiser[j];
|
||||
int b = entity.randomiser2[j];
|
||||
|
||||
int sliceAngle = 20 + a;
|
||||
|
||||
double x1 = scale * MathHelper.sin((entity.ticksExisted + 40 * j) * ((float)Math.PI / 180f));
|
||||
double x1 = radius * MathHelper.sin((entity.ticksExisted + 40 * j) * ((float)Math.PI / 180f));
|
||||
// double y1 = 0.7*MathHelper.cos((blackhole.timer - 40*j)*(Math.PI/180))*j/10;
|
||||
double z1 = scale * MathHelper.cos((entity.ticksExisted + 40 * j) * ((float)Math.PI / 180));
|
||||
double z1 = radius * MathHelper.cos((entity.ticksExisted + 40 * j) * ((float)Math.PI / 180));
|
||||
|
||||
double x2 = scale * MathHelper.sin((entity.ticksExisted + 40 * j - sliceAngle) * ((float)Math.PI / 180));
|
||||
double x2 = radius * MathHelper.sin((entity.ticksExisted + 40 * j - sliceAngle) * ((float)Math.PI / 180));
|
||||
// double y2 = 0.7*MathHelper.sin((blackhole.timer - 40*j)*(Math.PI/180))*j/10;
|
||||
double z2 = scale * MathHelper.cos((entity.ticksExisted + 40 * j - sliceAngle) * ((float)Math.PI / 180));
|
||||
double z2 = radius * MathHelper.cos((entity.ticksExisted + 40 * j - sliceAngle) * ((float)Math.PI / 180));
|
||||
|
||||
double absoluteX = x1 * MathHelper.cos(31 * b);
|
||||
double absoluteY = z1 * MathHelper.sin(31 * a) + x1 * MathHelper.cos(31 * a) * MathHelper.sin(31 * b);
|
||||
|
||||
@@ -19,12 +19,10 @@ import org.lwjgl.opengl.GL11;
|
||||
public class RenderFireRing extends Render<EntityFireRing> {
|
||||
|
||||
private final ResourceLocation texture;
|
||||
private float scale;
|
||||
|
||||
public RenderFireRing(RenderManager renderManager, ResourceLocation texture, float scale){
|
||||
public RenderFireRing(RenderManager renderManager, ResourceLocation texture){
|
||||
super(renderManager);
|
||||
this.texture = texture;
|
||||
this.scale = scale;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -48,7 +46,7 @@ public class RenderFireRing extends Render<EntityFireRing> {
|
||||
GlStateManager.rotate(-90, 1, 0, 0);
|
||||
|
||||
float s = DrawingUtils.smoothScaleFactor(entity.lifetime, entity.ticksExisted, partialTicks, 10, 10);
|
||||
GlStateManager.scale(scale * s, scale * s, scale * s);
|
||||
GlStateManager.scale(entity.width * s, entity.width * s, entity.width * s);
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
@@ -66,20 +64,21 @@ public class RenderFireRing extends Render<EntityFireRing> {
|
||||
GlStateManager.popMatrix();
|
||||
|
||||
// Fire
|
||||
// TODO: Bleeeuuurugh this is disgusting must fix :0
|
||||
|
||||
if(s >= 1){
|
||||
GlStateManager.disableLighting();
|
||||
TextureAtlasSprite icon = Minecraft.getMinecraft().getBlockRendererDispatcher()
|
||||
.getModelForState(Blocks.FIRE.getDefaultState()).getParticleTexture();
|
||||
int sides = 16;
|
||||
float s1 = entity.width/5;
|
||||
int sides = (int)(16 * s1);
|
||||
float height = 1.0f;
|
||||
|
||||
for(int k = 0; k < sides; k++){
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float)x, (float)y + 0.05f, (float)z);
|
||||
float f1 = 1.0f;
|
||||
GlStateManager.scale(f1, f1, f1);
|
||||
// GlStateManager.scale(s1, s1, s1);
|
||||
float f2 = 0.5F;
|
||||
float f3 = 0.0F;
|
||||
float f4 = 0.2f;
|
||||
@@ -89,7 +88,7 @@ public class RenderFireRing extends Render<EntityFireRing> {
|
||||
int i = 0;
|
||||
|
||||
GlStateManager.rotate((360f / (float)sides) * k, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, -2.3f);
|
||||
GlStateManager.translate(0, 0, -2.3f * s1);
|
||||
|
||||
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
|
||||
@@ -126,8 +125,7 @@ public class RenderFireRing extends Render<EntityFireRing> {
|
||||
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float)x, (float)y + 0.05f, (float)z);
|
||||
float f1 = 1.0f;
|
||||
GlStateManager.scale(f1, f1, f1);
|
||||
// GlStateManager.scale(s1, s1, s1);
|
||||
float f2 = 0.5F;
|
||||
float f3 = 0.0F;
|
||||
float f4 = 0.2f;
|
||||
@@ -137,7 +135,7 @@ public class RenderFireRing extends Render<EntityFireRing> {
|
||||
int i = 0;
|
||||
|
||||
GlStateManager.rotate((360f / (float)sides) * k, 0, 1, 0);
|
||||
GlStateManager.translate(0, 0, 2.3f);
|
||||
GlStateManager.translate(0, 0, 2.3f * s1);
|
||||
|
||||
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
|
||||
|
||||
|
||||
@@ -107,9 +107,9 @@ public class RenderRadiantTotem extends Render<EntityRadiantTotem> {
|
||||
float age = entity.ticksExisted + partialTicks;
|
||||
float rotationSpeed = 2;
|
||||
|
||||
// GlStateManager.rotate(age * rotationSpeed/2, 0.0F, 1.0F, 0.0F);
|
||||
// GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
|
||||
// GlStateManager.rotate(age * rotationSpeed, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(age * rotationSpeed/2, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(60.0F, 0.7071F, 0.0F, 0.7071F);
|
||||
GlStateManager.rotate(age * rotationSpeed, 0.0F, 1.0F, 0.0F);
|
||||
|
||||
GlStateManager.scale(0.5, 0.5, 0.5);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package electroblob.wizardry.client.renderer.entity;
|
||||
|
||||
import electroblob.wizardry.client.DrawingUtils;
|
||||
import electroblob.wizardry.entity.construct.EntityHealAura;
|
||||
import electroblob.wizardry.entity.construct.EntityMagicConstruct;
|
||||
import electroblob.wizardry.util.AllyDesignationSystem;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -19,13 +18,13 @@ import org.lwjgl.opengl.GL11;
|
||||
public class RenderSigil extends Render<EntityMagicConstruct> {
|
||||
|
||||
private final ResourceLocation texture;
|
||||
private float scale;
|
||||
private float rotationSpeed;
|
||||
private boolean invisibleToEnemies;
|
||||
|
||||
public RenderSigil(RenderManager renderManager, ResourceLocation texture, float scale, boolean invisibleToEnemies){
|
||||
public RenderSigil(RenderManager renderManager, ResourceLocation texture, float rotationSpeed, boolean invisibleToEnemies){
|
||||
super(renderManager);
|
||||
this.texture = texture;
|
||||
this.scale = scale;
|
||||
this.rotationSpeed = rotationSpeed;
|
||||
this.invisibleToEnemies = invisibleToEnemies;
|
||||
}
|
||||
|
||||
@@ -35,8 +34,8 @@ public class RenderSigil extends Render<EntityMagicConstruct> {
|
||||
// Makes the sigil invisible to enemies of the player that created it
|
||||
if(this.invisibleToEnemies){
|
||||
// Unfortunately we can't access the caster's allies if they're not online, it only works the other way round
|
||||
if(entity.getCaster() instanceof EntityPlayer && !AllyDesignationSystem
|
||||
.isPlayerAlly((EntityPlayer)entity.getCaster(), Minecraft.getMinecraft().player)){
|
||||
if(entity.getCaster() != Minecraft.getMinecraft().player && entity.getCaster() instanceof EntityPlayer
|
||||
&& !AllyDesignationSystem.isPlayerAlly((EntityPlayer)entity.getCaster(), Minecraft.getMinecraft().player)){
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -59,10 +58,10 @@ public class RenderSigil extends Render<EntityMagicConstruct> {
|
||||
GlStateManager.rotate(-90, 1, 0, 0);
|
||||
|
||||
// Healing aura rotates slowly
|
||||
if(entity instanceof EntityHealAura) GlStateManager.rotate(entity.ticksExisted / 3.0f, 0, 0, 1);
|
||||
if(rotationSpeed != 0) GlStateManager.rotate(entity.ticksExisted * rotationSpeed, 0, 0, 1);
|
||||
|
||||
float s = DrawingUtils.smoothScaleFactor(entity.lifetime, entity.ticksExisted, partialTicks, 10, 10);
|
||||
GlStateManager.scale(scale * s, scale * s, scale * s);
|
||||
float s = entity.width * DrawingUtils.smoothScaleFactor(entity.lifetime, entity.ticksExisted, partialTicks, 10, 10);
|
||||
GlStateManager.scale(s, s, s);
|
||||
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder buffer = tessellator.getBuffer();
|
||||
|
||||
Reference in New Issue
Block a user