Initial 1.11.2 update

This commit is contained in:
Electroblob
2018-02-07 21:15:50 +00:00
parent 67f6be0671
commit 3df5597dcc
368 changed files with 17234 additions and 15082 deletions
@@ -20,15 +20,17 @@ import net.minecraft.util.ResourceLocation;
public class RenderBlackHole extends Render<EntityBlackHole> {
private static final ResourceLocation texture = new ResourceLocation(Wizardry.MODID, "textures/entity/dark_ray.png");
private static final ResourceLocation texture2 = new ResourceLocation(Wizardry.MODID, "textures/entity/black_hole.png");
private static final ResourceLocation texture = new ResourceLocation(Wizardry.MODID,
"textures/entity/dark_ray.png");
private static final ResourceLocation texture2 = new ResourceLocation(Wizardry.MODID,
"textures/entity/black_hole.png");
public RenderBlackHole(RenderManager renderManager) {
public RenderBlackHole(RenderManager renderManager){
super(renderManager);
}
@Override
public void doRender(EntityBlackHole blackhole, double x, double y, double z, float fa, float fb) {
public void doRender(EntityBlackHole blackhole, double x, double y, double z, float fa, float fb){
GlStateManager.pushMatrix();
@@ -42,8 +44,8 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
GlStateManager.translate(x, y, z);
//float pitch = (float) Math.toDegrees(Math.atan(y/(x*x+z*z)));
//float yaw = (float) Math.toDegrees(Math.atan(x/z));
// float pitch = (float) Math.toDegrees(Math.atan(y/(x*x+z*z)));
// float yaw = (float) Math.toDegrees(Math.atan(x/z));
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer buffer = tessellator.getBuffer();
@@ -51,10 +53,13 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
if(blackhole.ticksExisted < 10){
GlStateManager.scale((float)blackhole.ticksExisted/10, (float)blackhole.ticksExisted/10, (float)blackhole.ticksExisted/10);
GlStateManager.scale((float)blackhole.ticksExisted / 10, (float)blackhole.ticksExisted / 10,
(float)blackhole.ticksExisted / 10);
}
if(blackhole.ticksExisted > blackhole.lifetime - 10){
GlStateManager.scale((float)(blackhole.lifetime-blackhole.ticksExisted)/10, (float)(blackhole.lifetime-blackhole.ticksExisted)/10, (float)(blackhole.lifetime-blackhole.ticksExisted)/10);
GlStateManager.scale((float)(blackhole.lifetime - blackhole.ticksExisted) / 10,
(float)(blackhole.lifetime - blackhole.ticksExisted) / 10,
(float)(blackhole.lifetime - blackhole.ticksExisted) / 10);
}
this.bindTexture(texture);
@@ -67,7 +72,7 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
ArrayList<RayHelper> rays = new ArrayList<RayHelper>(1);
for(int j=0; j<30; j++){
for(int j = 0; j < 30; j++){
float scale = 3.0f;
@@ -76,33 +81,29 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
int sliceAngle = 20 + a;
double x1 = scale*Math.sin((blackhole.ticksExisted + 40*j)*(Math.PI/180));
//double y1 = 0.7*Math.cos((blackhole.timer - 40*j)*(Math.PI/180))*j/10;
double z1 = scale*Math.cos((blackhole.ticksExisted + 40*j)*(Math.PI/180));
double x1 = scale * Math.sin((blackhole.ticksExisted + 40 * j) * (Math.PI / 180));
// double y1 = 0.7*Math.cos((blackhole.timer - 40*j)*(Math.PI/180))*j/10;
double z1 = scale * Math.cos((blackhole.ticksExisted + 40 * j) * (Math.PI / 180));
double x2 = scale*Math.sin((blackhole.ticksExisted + 40*j - sliceAngle)*(Math.PI/180));
//double y2 = 0.7*Math.sin((blackhole.timer - 40*j)*(Math.PI/180))*j/10;
double z2 = scale*Math.cos((blackhole.ticksExisted + 40*j - sliceAngle)*(Math.PI/180));
double x2 = scale * Math.sin((blackhole.ticksExisted + 40 * j - sliceAngle) * (Math.PI / 180));
// double y2 = 0.7*Math.sin((blackhole.timer - 40*j)*(Math.PI/180))*j/10;
double z2 = scale * Math.cos((blackhole.ticksExisted + 40 * j - sliceAngle) * (Math.PI / 180));
double absoluteX = x1*Math.cos(31*b);
double absoluteY = z1*Math.sin(31*a) + x1*Math.cos(31*a)*Math.sin(31*b);
double absoluteZ = z1*Math.cos(31*a);
double absoluteX = x1 * Math.cos(31 * b);
double absoluteY = z1 * Math.sin(31 * a) + x1 * Math.cos(31 * a) * Math.sin(31 * b);
double absoluteZ = z1 * Math.cos(31 * a);
double absoluteX2 = x2*Math.cos(31*b);
double absoluteY2 = z2*Math.sin(31*a) + x2*Math.cos(31*a)*Math.sin(31*b);
double absoluteZ2 = z2*Math.cos(31*a);
/*
buffer.begin(0, DefaultVertexFormats.POSITION_TEX);
tessellator.setColorOpaque(255, 255, 255);
GL11.glPointSize(5);
tessellator.addVertex(absoluteX-x, 0, 0);
tessellator.addVertex(0, absoluteY-y, 0);
tessellator.addVertex(0, 0, absoluteZ-z);
tessellator.draw();
*/
double absoluteX2 = x2 * Math.cos(31 * b);
double absoluteY2 = z2 * Math.sin(31 * a) + x2 * Math.cos(31 * a) * Math.sin(31 * b);
double absoluteZ2 = z2 * Math.cos(31 * a);
/* buffer.begin(0, DefaultVertexFormats.POSITION_TEX);
*
* tessellator.setColorOpaque(255, 255, 255); GL11.glPointSize(5);
*
* tessellator.addVertex(absoluteX-x, 0, 0); tessellator.addVertex(0, absoluteY-y, 0);
* tessellator.addVertex(0, 0, absoluteZ-z);
*
* tessellator.draw(); */
rays.add(new RayHelper(j, absoluteX, absoluteY, absoluteZ, absoluteX2, absoluteY2, absoluteZ2, x, y, z));
}
@@ -112,16 +113,16 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
for(RayHelper ray : rays){
GlStateManager.pushMatrix();
//GlStateManager.rotate(31*blackhole.randomiser[ray.ordinal], 1, 0, 0);
//GlStateManager.rotate(31*blackhole.randomiser2[ray.ordinal], 0, 0, 1);
// GlStateManager.rotate(31*blackhole.randomiser[ray.ordinal], 1, 0, 0);
// GlStateManager.rotate(31*blackhole.randomiser2[ray.ordinal], 0, 0, 1);
buffer.begin(5, DefaultVertexFormats.POSITION_TEX);
//tessellator.setColorRGBA(255, 255, 255, 0);
// tessellator.setColorRGBA(255, 255, 255, 0);
buffer.pos(0, 0, 0).tex(0, 0).endVertex();
buffer.pos(0, 0, 0).tex(0, 1).endVertex();
//tessellator.setColorRGBA(0, 0, 0, 255);
// tessellator.setColorRGBA(0, 0, 0, 255);
buffer.pos(ray.x1, ray.y1, ray.z1).tex(1, 0).endVertex();
buffer.pos(ray.x2, ray.y2, ray.z2).tex(1, 1).endVertex();
@@ -132,20 +133,15 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
GlStateManager.pushMatrix();
/* Deprecated in favour of particle style method.
GlStateManager.rotate(yaw, 0, 1, 0);
// GL transformations are relative, hence only x rotation
if(z < 0){
GlStateManager.rotate(pitch, 1, 0, 0);
}else{
GlStateManager.rotate(-1*pitch, 1, 0, 0);
}
*/
/* Deprecated in favour of particle style method. GlStateManager.rotate(yaw, 0, 1, 0); // GL transformations are
* relative, hence only x rotation if(z < 0){ GlStateManager.rotate(pitch, 1, 0, 0); }else{
* GlStateManager.rotate(-1*pitch, 1, 0, 0); } */
// Renders the aura effect
// This counteracts the reverse rotation behaviour when in front f5 view. Vanilla now has this fix too.
float yaw = Minecraft.getMinecraft().gameSettings.thirdPersonView == 2 ? this.renderManager.playerViewX : -this.renderManager.playerViewX;
float yaw = Minecraft.getMinecraft().gameSettings.thirdPersonView == 2 ? this.renderManager.playerViewX
: -this.renderManager.playerViewX;
GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(yaw, 1.0F, 0.0F, 0.0F);
@@ -162,7 +158,6 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
GlStateManager.popMatrix();
GlStateManager.shadeModel(GL11.GL_FLAT);
GlStateManager.enableCull();
GlStateManager.disableBlend();
@@ -173,7 +168,7 @@ public class RenderBlackHole extends Render<EntityBlackHole> {
}
@Override
protected ResourceLocation getEntityTexture(EntityBlackHole entity) {
protected ResourceLocation getEntityTexture(EntityBlackHole entity){
return texture;
}