Refractored Code

+added Solar Factory
-removed unnessecary solar and essentia generator classes
+started gtnh researches
+added tooltip clearance on solars (maximal output)

Signed-off-by: bartimaeusnek <[email protected]>
This commit is contained in:
bartimaeusnek committed 2019-03-18 18:39:23 +01:00
1 parent 980df8516a
commit 0fecf28b65
397 files changed
+8693 -9288

No files matched your search

@@ -10,111 +10,111 @@ import net.minecraft.item.EnumAction;
@SideOnly(Side.CLIENT)
public class ModelSpecialArmor extends ModelBiped {
public ModelRenderer rightWing;
public ModelRenderer leftWing;
public ModelRenderer center;
public ModelRenderer jetpack;
public boolean isJumping;
public int type = 0;// 0 - Nothing, 1 - Jetpack, 2 - Wings
public ModelRenderer rightWing;
public ModelRenderer leftWing;
public ModelRenderer center;
public ModelRenderer jetpack;
public boolean isJumping;
public int type = 0;// 0 - Nothing, 1 - Jetpack, 2 - Wings
public ModelSpecialArmor() {
this(1, 0);
}
public ModelSpecialArmor() {
this(1, 0);
}
public ModelSpecialArmor(float scale, int type) {
this(scale, 0.0F, type);
}
public ModelSpecialArmor(float scale, int type) {
this(scale, 0.0F, type);
}
public ModelSpecialArmor(float scale, float offset, int type) {
super(scale, offset, type == 1? 128 : 64, type == 0? 32 : type == 1? 96 : 64);
this.type = type;
switch (this.type) {
case 1:
this.textureWidth = 128;
this.textureHeight = 96;
this.jetpack = new ModelRenderer(this, 16, 69);
this.jetpack.setTextureSize(64, 48);
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
break;
public ModelSpecialArmor(float scale, float offset, int type) {
super(scale, offset, type == 1 ? 128 : 64, type == 0 ? 32 : type == 1 ? 96 : 64);
this.type = type;
switch (this.type) {
case 1:
this.textureWidth = 128;
this.textureHeight = 96;
this.jetpack = new ModelRenderer(this, 16, 69);
this.jetpack.setTextureSize(64, 48);
this.jetpack.addBox(-4.0F, -12.0F, -2.0F, 8, 12 * 2, 4, scale * 2);
this.jetpack.setRotationPoint(0.0F, 0.0F + offset, 0.0F);
break;
case 2:
this.textureWidth = 64;
this.textureHeight = 64;
rightWing = new ModelRenderer(this, 24, 0 + 32);
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
rightWing.setRotationPoint(-2F, 0F, 3F);
rightWing.setTextureSize(64, 32);
rightWing.mirror = false;
setRotation(rightWing, 0F, 0.1570796F, 0F);
leftWing = new ModelRenderer(this, 0, 0 + 32);
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
leftWing.setRotationPoint(2F, 0F, 3F);
leftWing.setTextureSize(64, 32);
leftWing.mirror = true;
setRotation(leftWing, 0F, -0.1570796F, 0F);
case 2:
this.textureWidth = 64;
this.textureHeight = 64;
rightWing = new ModelRenderer(this, 24, 0 + 32);
rightWing.addBox(-11F, -1F, 0F, 11, 13, 1);
rightWing.setRotationPoint(-2F, 0F, 3F);
rightWing.setTextureSize(64, 32);
rightWing.mirror = false;
setRotation(rightWing, 0F, 0.1570796F, 0F);
center = new ModelRenderer(this, 0, 14 + 32);
center.addBox(0F, 0F, 1F, 8, 14, 1);
center.setRotationPoint(-4F, 0F, 3F);
center.setTextureSize(64, 32);
center.mirror = true;
setRotation(center, 0F, 0F, 0F);
break;
}
}
leftWing = new ModelRenderer(this, 0, 0 + 32);
leftWing.addBox(0F, -1F, 0F, 11, 13, 1);
leftWing.setRotationPoint(2F, 0F, 3F);
leftWing.setTextureSize(64, 32);
leftWing.mirror = true;
setRotation(leftWing, 0F, -0.1570796F, 0F);
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
center = new ModelRenderer(this, 0, 14 + 32);
center.addBox(0F, 0F, 1F, 8, 14, 1);
center.setRotationPoint(-4F, 0F, 3F);
center.setTextureSize(64, 32);
center.mirror = true;
setRotation(center, 0F, 0F, 0F);
break;
}
}
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) {
EntityPlayer player = (EntityPlayer)entity;
this.heldItemRight = player.inventory.getCurrentItem() != null? 1 : 0;
this.isRiding = player.isRiding();
this.isSneak = player.isSneaking();
this.aimedBow = player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem().getItemUseAction(player.inventory.getCurrentItem()) == EnumAction.bow && player.isUsingItem();
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entity);
private void setRotation(ModelRenderer model, float x, float y, float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
this.bipedBody.render(scale);
this.bipedRightArm.render(scale);
this.bipedLeftArm.render(scale);
switch (this.type) {
case 1:
this.jetpack.render(scale);
break;
case 2:
this.center.render(scale);
this.leftWing.render(scale);
this.rightWing.render(scale);
}
public void render(Entity entity, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale) {
EntityPlayer player = (EntityPlayer) entity;
this.heldItemRight = player.inventory.getCurrentItem() != null ? 1 : 0;
this.isRiding = player.isRiding();
this.isSneak = player.isSneaking();
this.aimedBow = player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem().getItemUseAction(player.inventory.getCurrentItem()) == EnumAction.bow && player.isUsingItem();
this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale, entity);
}
this.bipedBody.render(scale);
this.bipedRightArm.render(scale);
this.bipedLeftArm.render(scale);
switch (this.type) {
case 1:
this.jetpack.render(scale);
break;
case 2:
this.center.render(scale);
this.leftWing.render(scale);
this.rightWing.render(scale);
}
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity) {
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
if (this.isJumping) {
this.rightWing.rotateAngleY = 0.5f;
this.leftWing.rotateAngleY = -0.5f;
}
}
if (this.isSneak) {
switch (this.type) {
case 1:
this.jetpack.rotateAngleX = 0.5F;
break;
case 2:
this.center.offsetY -= 0.1;
this.rightWing.offsetY -= 0.1;
this.leftWing.offsetY -= 0.1;
this.center.rotateAngleX = 0.5F;
this.rightWing.rotateAngleX = 0.5F;
this.leftWing.rotateAngleX = 0.5F;
break;
}
}
}
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity) {
super.setRotationAngles(p_78087_1_, p_78087_2_, p_78087_3_, p_78087_4_, p_78087_5_, p_78087_6_, entity);
if (this.isJumping) {
this.rightWing.rotateAngleY = 0.5f;
this.leftWing.rotateAngleY = -0.5f;
}
if (this.isSneak) {
switch (this.type) {
case 1:
this.jetpack.rotateAngleX = 0.5F;
break;
case 2:
this.center.offsetY -= 0.1;
this.rightWing.offsetY -= 0.1;
this.leftWing.offsetY -= 0.1;
this.center.rotateAngleX = 0.5F;
this.rightWing.rotateAngleX = 0.5F;
this.leftWing.rotateAngleX = 0.5F;
break;
}
}
}
}