mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-22 04:52:18 +00:00
fixes
This commit is contained in:
1 parent
25e64459bb
commit
5e20f177f1
11 files changed
+110
-66
No files matched your search
@@ -66,4 +66,8 @@ public class ItemElectricScribingTools extends ItemInkwell implements IElectricI
|
||||
public Item getEmptyItem(ItemStack itemStack) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
}
|
||||
+60
-45
@@ -66,11 +66,11 @@ import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
|
||||
public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
|
||||
IIcon icon0;
|
||||
IIcon icon1;
|
||||
IIcon icon2;
|
||||
IIcon icon3;
|
||||
IIcon icon4;
|
||||
IIcon iconNONE;
|
||||
IIcon iconJETPACK;
|
||||
IIcon iconTHAUMIUM;
|
||||
IIcon iconNANO;
|
||||
IIcon iconQUANTUM;
|
||||
Random rnd;
|
||||
|
||||
public final byte NONE = 0;
|
||||
@@ -98,11 +98,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister iconRegister) {
|
||||
icon0 = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest");
|
||||
icon1 = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_jetpack");
|
||||
icon2 = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_t");
|
||||
icon3 = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_n");
|
||||
icon4 = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_q");
|
||||
iconNONE = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest");
|
||||
iconJETPACK = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_jetpack");
|
||||
iconTHAUMIUM = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_t");
|
||||
iconNANO = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_n");
|
||||
iconQUANTUM = iconRegister.registerIcon(ModInformation.texturePath + ":armor/armor_quantum_chest_wing_q");
|
||||
}
|
||||
|
||||
|
||||
@@ -267,11 +267,11 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
}
|
||||
|
||||
if(wing == THAUMIUM)
|
||||
useWings(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
|
||||
useWing(player, itemStack, world, 0.15f, 0.7f, 0.5f, 0, false);
|
||||
if(wing == NANO)
|
||||
useWings(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
|
||||
useWing(player, itemStack, world, 0.25f, 0.6f, 0.3f, 5, true);
|
||||
if(wing == QUANTUM)
|
||||
useWings(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
|
||||
useWing(player, itemStack, world, 0.33f, 0.5f, 0.2f, 7, true);
|
||||
|
||||
|
||||
if ((IC2.platform.isSimulating()) && (toggleTimer > 0)) {
|
||||
@@ -315,14 +315,14 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch(wing){
|
||||
case JETPACK : return icon1;
|
||||
case THAUMIUM : return icon2;
|
||||
case NANO : return icon3;
|
||||
case QUANTUM : return icon4;
|
||||
default : return icon0;
|
||||
case JETPACK : return iconJETPACK;
|
||||
case THAUMIUM : return iconTHAUMIUM;
|
||||
case NANO : return iconNANO;
|
||||
case QUANTUM : return iconQUANTUM;
|
||||
default : return iconNONE;
|
||||
}
|
||||
}
|
||||
catch(Exception ex){return icon0;}
|
||||
catch(Exception ex){return iconNONE;}
|
||||
}
|
||||
|
||||
|
||||
@@ -332,24 +332,23 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
byte wing = stack.stackTagCompound.getByte("wing");
|
||||
|
||||
switch(wing){
|
||||
case JETPACK : return icon1;
|
||||
case THAUMIUM : return icon2;
|
||||
case NANO : return icon3;
|
||||
case QUANTUM : return icon4;
|
||||
default : return icon0;
|
||||
case JETPACK : return iconJETPACK;
|
||||
case THAUMIUM : return iconTHAUMIUM;
|
||||
case NANO : return iconNANO;
|
||||
case QUANTUM : return iconQUANTUM;
|
||||
default : return iconNONE;
|
||||
}
|
||||
}
|
||||
catch(Exception e){return icon0;}
|
||||
catch(Exception e){return iconNONE;}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemEnchantability() {
|
||||
if (ConfigHandler.enchanting == false) {
|
||||
if (ConfigHandler.enchanting == false)
|
||||
return 0;
|
||||
} else {
|
||||
else
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +379,7 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
}
|
||||
else if(wing != 0){
|
||||
ModelCpecialArmor mbm = new ModelCpecialArmor(1, 2);
|
||||
mbm.isJumping = stack.stackTagCompound.getBoolean("isJumping");
|
||||
mbm.isJumping = IC2.keyboard.isJumpKeyDown((EntityPlayer) entity);
|
||||
return mbm;
|
||||
}
|
||||
}
|
||||
@@ -458,19 +457,21 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
}
|
||||
|
||||
|
||||
void useWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric){
|
||||
void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount, boolean isElectric){
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
|
||||
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
|
||||
if(nbtData.getBoolean("isJumping")){
|
||||
boolean isJumping = IC2.keyboard.isJumpKeyDown(player);
|
||||
|
||||
if(isJumping){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
nbtData.setInteger("f", nbtData.getInteger("f") + 1);
|
||||
if(nbtData.getInteger("f") > 7) nbtData.setInteger("f", 7);
|
||||
nbtData.setByte("f", (byte) (f + 1));
|
||||
if(f > 7) nbtData.setByte("f", (byte) 7);
|
||||
}
|
||||
else if(nbtData.getBoolean("isHolding")){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", false);
|
||||
player.motionY = motionY * nbtData.getInteger("f");
|
||||
ElectricItem.manager.use(stack, ((motionY * nbtData.getInteger("f")) * 100) * amount, player);
|
||||
player.motionY = motionY * f;
|
||||
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||
if(player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5){
|
||||
player.motionX /= motionXZ;
|
||||
player.motionZ /= motionXZ;
|
||||
@@ -479,16 +480,30 @@ public class ItemInfusedQuantumChestplate extends ItemArmorElectric {
|
||||
for(int i = 0; i < 4; i++){
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
nbtData.setInteger("f", 0);
|
||||
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
if (nbtData.getBoolean("isJumping") && !player.onGround && player.motionY < 0)
|
||||
|
||||
if (isJumping && !player.onGround && player.motionY < 0){
|
||||
player.motionY *= f1;
|
||||
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 (player.isInWater() && !player.capabilities.isCreativeMode) {
|
||||
player.motionY += -0.05;
|
||||
}
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((world.getBiomeGenForCoords((int)player.posX, (int)player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int)player.posX, (int)player.posY, (int)player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode){
|
||||
player.motionY += -0.05;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0) {
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F) {
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
@@ -64,27 +64,27 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
updateWings(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
||||
useWing(player, stack, world, 0.09f, 0.9f, 0.9f, 0);
|
||||
}
|
||||
|
||||
public void updateWings(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount){
|
||||
public void useWing(EntityPlayer player, ItemStack stack, World world, float motionY, float motionXZ, float f1, int amount){
|
||||
NBTTagCompound nbtData = StackUtil.getOrCreateNbtData(stack);
|
||||
boolean isJmuping = nbtData.getBoolean("isJumping");
|
||||
boolean isHolding = nbtData.getBoolean("isHolding");
|
||||
int f = nbtData.getInteger("f");
|
||||
|
||||
nbtData.setBoolean("isJumping", IC2.keyboard.isJumpKeyDown(player));
|
||||
|
||||
if(isJmuping){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", true);
|
||||
nbtData.setInteger("f", f + 1);
|
||||
if(nbtData.getInteger("f") > 7) nbtData.setInteger("f", 7);
|
||||
nbtData.setByte("f", (byte) (f + 1));
|
||||
if(f > 7) nbtData.setByte("f", (byte) 7);
|
||||
}
|
||||
else if(isHolding){
|
||||
byte f = nbtData.getByte("f");
|
||||
nbtData.setBoolean("isHolding", false);
|
||||
|
||||
player.motionY = motionY * f;
|
||||
ElectricItem.manager.use(stack, ((motionY * nbtData.getInteger("f")) * 100) * amount, player);
|
||||
ElectricItem.manager.use(stack, ((motionY * f) * 10) * amount, player);
|
||||
if(player.motionX < 0.5 && player.motionZ < 0.5 && player.motionX > -0.5 && player.motionZ > -0.5){
|
||||
player.motionX /= motionXZ;
|
||||
player.motionZ /= motionXZ;
|
||||
@@ -93,20 +93,29 @@ public class ItemFeatherWing extends ItemArmor {
|
||||
for(int i = 0; i < 4; i++){
|
||||
world.spawnParticle("cloud", player.posX - 1 + (rnd.nextInt(100) / 50d), player.posY - 1, player.posZ - 1 + (rnd.nextInt(100) / 50d), 0, -0.5, 0);
|
||||
}
|
||||
nbtData.setInteger("f", 0);
|
||||
nbtData.setByte("f", (byte) 0);
|
||||
}
|
||||
|
||||
if (isJmuping && !player.onGround && player.motionY < 0)
|
||||
if (isJmuping && !player.onGround && player.motionY < 0){
|
||||
player.motionY *= f1;
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode) player.motionY += -0.2;
|
||||
}
|
||||
|
||||
if (player.isInWater() && !player.capabilities.isCreativeMode){
|
||||
player.motionY += -0.03;
|
||||
}
|
||||
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((player.worldObj.isRaining() || player.worldObj.isThundering()) && !player.capabilities.isCreativeMode)
|
||||
player.motionY = -0.3;
|
||||
if(ConfigHandler.impactOfRain){
|
||||
if ((world.getBiomeGenForCoords((int)player.posX, (int)player.posZ)).canSpawnLightningBolt() && world.canBlockSeeTheSky((int)player.posX, (int)player.posY, (int)player.posZ) && world.isRaining() && !player.capabilities.isCreativeMode){
|
||||
player.motionY += -0.03;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.isSneaking() && !player.onGround) player.motionY = -0.6;
|
||||
if (player.isSneaking() && !player.onGround && player.motionY < 0){
|
||||
player.motionY *= 0.6;
|
||||
}
|
||||
|
||||
if (player.fallDistance > 0.0F) player.fallDistance = 0;
|
||||
if (player.fallDistance > 0.0F){
|
||||
player.fallDistance = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class ItemNanoWing extends ItemThaumiumReinforcedWing implements IElectri
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.updateWings(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||
this.useWing(player, stack, world, 0.25f, 0.6f, 0.3f, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ItemQuantumWing extends ItemNanoWing {
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.updateWings(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
|
||||
this.useWing(player, stack, world, 0.33f, 0.5f, 0.2f, 7);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -57,6 +57,6 @@ public class ItemThaumiumReinforcedWing extends ItemFeatherWing implements IVisD
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
this.updateWings(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||
this.useWing(player, stack, world, 0.15f, 0.7f, 0.5f, 0);
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
|
||||
private IIcon ornament, depth;
|
||||
String t = null;
|
||||
String textureName = null;
|
||||
|
||||
public ItemBaseFocus(String unlocName, String textureName) {
|
||||
super();
|
||||
@@ -34,7 +34,7 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
setMaxDamage(1);
|
||||
setNoRepair();
|
||||
setMaxStackSize(1);
|
||||
t = textureName;
|
||||
this.textureName = textureName;
|
||||
}
|
||||
|
||||
boolean hasOrnament() {
|
||||
@@ -43,7 +43,7 @@ public abstract class ItemBaseFocus extends ItemFocusBasic {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister ir) {
|
||||
this.icon = ir.registerIcon(ModInformation.texturePath + ":" + t);
|
||||
this.icon = ir.registerIcon(ModInformation.texturePath + ":" + textureName);
|
||||
}
|
||||
|
||||
boolean hasDepth() {
|
||||
|
||||
@@ -119,6 +119,10 @@ public class ItemElectricHoeGrowth extends ItemHoe implements IElectricItem {
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
|
||||
|
||||
@@ -178,6 +178,10 @@ public class ItemDiamondChainsaw extends ItemAxe implements IElectricItem {
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
return ConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
|
||||
|
||||
@@ -117,6 +117,10 @@ public class ItemThaumiumDrill extends ItemPickaxe implements IElectricItem {
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
return ConfigHandler.enchanting;
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
|
||||
/* IC2 API METHODS */
|
||||
|
||||
|
||||
@@ -143,6 +143,10 @@ public class ItemOmnitoolIron extends ItemPickaxe implements IElectricItem {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
public void setDamage(ItemStack stack, int damage){
|
||||
super.setDamage(stack, damage > 1 ? damage : 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
|
||||
|
||||
Reference in new issue
Block a user