mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-21 04:22:09 +00:00
Tweaked Wings. Yay.
This commit is contained in:
1 parent
a0c4bb9ec2
commit
1165cf716f
6 files changed
+91
-37
No files matched your search
@@ -1,8 +1,10 @@
|
||||
package tombenpotter.emt.client.model;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ModelWings extends ModelBiped {
|
||||
|
||||
@@ -15,21 +17,21 @@ public class ModelWings extends ModelBiped {
|
||||
textureHeight = 64;
|
||||
|
||||
rightWing = new ModelRenderer(this, 24, 0);
|
||||
rightWing.addBox(-11F, 0F, 0F, 11, 13, 1);
|
||||
rightWing.addBox(-11F, -1F, -1.5F, 11, 13, 1);
|
||||
rightWing.setRotationPoint(-2F, 0F, 3F);
|
||||
rightWing.setTextureSize(64, 32);
|
||||
rightWing.mirror = true;
|
||||
rightWing.mirror = false;
|
||||
setRotation(rightWing, 0F, 0.1570796F, 0F);
|
||||
|
||||
leftWing = new ModelRenderer(this, 0, 0);
|
||||
leftWing.addBox(0F, 0F, 0F, 11, 13, 1);
|
||||
leftWing.addBox(0F, -1F, -1.5F, 11, 13, 1);
|
||||
leftWing.setRotationPoint(2F, 0F, 3F);
|
||||
leftWing.setTextureSize(64, 32);
|
||||
leftWing.mirror = true;
|
||||
setRotation(leftWing, 0F, -0.1570796F, 0F);
|
||||
|
||||
center = new ModelRenderer(this, 0, 14);
|
||||
center.addBox(0F, 0F, 0F, 8, 14, 1);
|
||||
center.addBox(0F, 0F, -0.5F, 8, 14, 1);
|
||||
center.setRotationPoint(-4F, 0F, 3F);
|
||||
center.setTextureSize(64, 32);
|
||||
center.mirror = true;
|
||||
@@ -42,20 +44,33 @@ public class ModelWings extends ModelBiped {
|
||||
|
||||
@Override
|
||||
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
bipedHead.showModel = false;
|
||||
bipedHeadwear.showModel = false;
|
||||
bipedLeftLeg.showModel = false;
|
||||
bipedRightLeg.showModel = false;
|
||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
rightWing.render(f5);
|
||||
leftWing.render(f5);
|
||||
center.render(f5);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
private void setRotation (ModelRenderer model, float x, float y, float z)
|
||||
{
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
public void setRotationAngles(float f, float f1, float pt, float f3, float f4, float f5, Entity entity){
|
||||
|
||||
if(Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed()){
|
||||
this.rightWing.rotateAngleY = 0.5f;
|
||||
this.leftWing.rotateAngleY = -0.5f;
|
||||
}
|
||||
|
||||
if(entity.isSneaking()){
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ import net.minecraftforge.common.util.EnumHelper;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import tombenpotter.emt.ModInformation;
|
||||
import tombenpotter.emt.common.items.armor.ItemFeatherWing;
|
||||
import tombenpotter.emt.common.items.armor.ItemThaumiumReinforcedWing;
|
||||
import tombenpotter.emt.common.items.armor.wings.ItemFeatherWing;
|
||||
import tombenpotter.emt.common.items.armor.wings.ItemThaumiumReinforcedWing;
|
||||
import tombenpotter.emt.common.items.armor.boots.ItemElectricBootsTraveller;
|
||||
import tombenpotter.emt.common.items.armor.boots.ItemNanoBootsTraveller;
|
||||
import tombenpotter.emt.common.items.armor.boots.ItemQuantumBootsTraveller;
|
||||
|
||||
+15
-5
@@ -1,4 +1,4 @@
|
||||
package tombenpotter.emt.common.items.armor;
|
||||
package tombenpotter.emt.common.items.armor.wings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -19,6 +19,8 @@ import tombenpotter.emt.common.util.ConfigHandler;
|
||||
public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
public int visDiscount = 0;
|
||||
public int f = 0;
|
||||
boolean isHolding = false;
|
||||
|
||||
public ItemFeatherWing(ArmorMaterial material, int par3, int par4) {
|
||||
super(material, par3, par4);
|
||||
@@ -51,21 +53,29 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping) player.motionY = 0.25;
|
||||
if(isHoldingJump){
|
||||
isHolding = true;
|
||||
f += 1;
|
||||
if(f > 7) f = 7;
|
||||
}
|
||||
else if(isHolding){
|
||||
isHolding = false;
|
||||
player.motionY = 0.09 * f;
|
||||
f = 0;
|
||||
}
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.9;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.6;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.3;
|
||||
}
|
||||
|
||||
if (isSneaking && !player.onGround) player.motionY = -0.6;
|
||||
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ISpecialArmor;
|
||||
import tombenpotter.emt.ElectroMagicTools;
|
||||
import tombenpotter.emt.ModInformation;
|
||||
import tombenpotter.emt.common.items.armor.ItemThaumiumReinforcedWing;
|
||||
import tombenpotter.emt.common.items.armor.wings.ItemThaumiumReinforcedWing;
|
||||
import tombenpotter.emt.common.util.ConfigHandler;
|
||||
|
||||
import java.util.List;
|
||||
@@ -69,21 +69,31 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping) player.motionY = 0.7;
|
||||
|
||||
if(isHoldingJump){
|
||||
isHolding = true;
|
||||
f += 1;
|
||||
if(f > 7) f = 7;
|
||||
}
|
||||
else if(isHolding){
|
||||
isHolding = false;
|
||||
player.motionY = 0.25 * f;
|
||||
player.motionX /= 0.7;
|
||||
player.motionZ /= 0.7;
|
||||
f = 0;
|
||||
}
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.3;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.4;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.2;
|
||||
}
|
||||
|
||||
if (isSneaking && !player.onGround) player.motionY = -0.6;
|
||||
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
|
||||
@@ -42,23 +42,33 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping) player.motionY = 0.85;
|
||||
|
||||
if(isHoldingJump){
|
||||
isHolding = true;
|
||||
f += 1;
|
||||
if(f > 7) f = 7;
|
||||
}
|
||||
else if(isHolding){
|
||||
isHolding = false;
|
||||
player.motionY = 0.33 * f;
|
||||
player.motionX /= 0.6;
|
||||
player.motionZ /= 0.6;
|
||||
f = 0;
|
||||
}
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.3;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.1;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.1;
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.05;
|
||||
}
|
||||
|
||||
if (isSneaking && isHoldingJump) player.motionY = 0;
|
||||
if (player.isSneaking() && isHoldingJump) player.motionY = 0;
|
||||
|
||||
if (isSneaking && !player.onGround && !isHoldingJump) player.motionY = -0.6;
|
||||
if (player.isSneaking() && !player.onGround && !isHoldingJump) player.motionY = -0.6;
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
|
||||
+16
-7
@@ -1,4 +1,4 @@
|
||||
package tombenpotter.emt.common.items.armor;
|
||||
package tombenpotter.emt.common.items.armor.wings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -57,22 +57,31 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
||||
if (world.isRemote) {
|
||||
boolean isJumping = Minecraft.getMinecraft().gameSettings.keyBindJump.isPressed();
|
||||
boolean isHoldingJump = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
|
||||
boolean isSneaking = Minecraft.getMinecraft().gameSettings.keyBindSneak.getIsKeyPressed();
|
||||
|
||||
if (isJumping) player.motionY = 0.5;
|
||||
|
||||
if(isHoldingJump){
|
||||
isHolding = true;
|
||||
f += 1;
|
||||
if(f > 7) f = 7;
|
||||
}
|
||||
else if(isHolding){
|
||||
isHolding = false;
|
||||
player.motionY = 0.15 * f;
|
||||
player.motionX /= 0.8;
|
||||
player.motionZ /= 0.8;
|
||||
f = 0;
|
||||
}
|
||||
|
||||
if (isHoldingJump && !player.onGround && player.motionY < 0 && !player.capabilities.isCreativeMode)
|
||||
player.motionY *= 0.5;
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY = -0.6;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.3;
|
||||
}
|
||||
|
||||
if (isSneaking && !player.onGround) player.motionY = -0.6;
|
||||
|
||||
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
|
||||
}
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
Reference in new issue
Block a user