mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
test sound category, V1 speed, steam suit using steam, armor cleanup
This commit is contained in:
parent
c3b2838e7a
commit
f8cb3ee1ed
@ -4872,7 +4872,7 @@ public class ModItems {
|
||||
|
||||
ArmorMaterial aMatDesh = EnumHelper.addArmorMaterial("HBM_DESH", 150, new int[] { 3, 8, 6, 3 }, 0);
|
||||
aMatDesh.customCraftingMaterial = ModItems.ingot_desh;
|
||||
steamsuit_helmet = new ArmorDesh(aMatDesh, 2, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png").setCap(15F).setMod(0.5F)
|
||||
steamsuit_helmet = new ArmorDesh(aMatDesh, 2, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 216000, 500, 1, 50).setCap(15F).setMod(0.5F)
|
||||
.setFireproof(true)
|
||||
.setHasHardLanding(true)
|
||||
.addEffect(new PotionEffect(Potion.digSpeed.id, 20, 2))
|
||||
@ -4880,9 +4880,9 @@ public class ModItems {
|
||||
.addResistance("monoxide", 0F)
|
||||
.addResistance("fall", 0)
|
||||
.setUnlocalizedName("steamsuit_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_helmet");
|
||||
steamsuit_plate = new ArmorDesh(aMatDesh, 2, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_plate");
|
||||
steamsuit_legs = new ArmorDesh(aMatDesh, 2, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_legs");
|
||||
steamsuit_boots = new ArmorDesh(aMatDesh, 2, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_boots");
|
||||
steamsuit_plate = new ArmorDesh(aMatDesh, 2, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 216000, 500, 1, 50).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_plate");
|
||||
steamsuit_legs = new ArmorDesh(aMatDesh, 2, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", Fluids.STEAM, 216000, 500, 1, 50).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_legs");
|
||||
steamsuit_boots = new ArmorDesh(aMatDesh, 2, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 216000, 500, 1, 50).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_boots");
|
||||
|
||||
ArmorMaterial aMatAJR = EnumHelper.addArmorMaterial("HBM_T45AJR", 150, new int[] { 3, 8, 6, 3 }, 100);
|
||||
aMatAJR.customCraftingMaterial = ModItems.plate_armor_ajr;
|
||||
|
||||
@ -67,7 +67,7 @@ public class ArmorDNT extends ArmorFSBPowered {
|
||||
HbmPlayerProps props = HbmPlayerProps.getData(player);
|
||||
|
||||
/// SPEED ///
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
Multimap multimap = super.getAttributeModifiers(stack);
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(speed, "DNT SPEED", 0.25, 0));
|
||||
player.getAttributeMap().removeAttributeModifiers(multimap);
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.items.armor;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.render.model.ModelArmorDesh;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -13,10 +14,10 @@ import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ArmorDesh extends ArmorFSB {
|
||||
public class ArmorDesh extends ArmorFSBFueled {
|
||||
|
||||
public ArmorDesh(ArmorMaterial material, int layer, int slot, String texture) {
|
||||
super(material, layer, slot, texture);
|
||||
public ArmorDesh(ArmorMaterial material, int layer, int slot, String texture, FluidType fuelType, int maxFuel, int fillRate, int consumption, int drain) {
|
||||
super(material, layer, slot, texture, fuelType, maxFuel, fillRate, consumption, drain);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -15,8 +15,6 @@ import com.hbm.util.ArmorUtil;
|
||||
|
||||
public class ArmorEuphemium extends ItemArmor {
|
||||
|
||||
private String [] armourTypes = new String [] {"euphemium_helmet", "euphemium_chest", "euphemium_legs", "euphemium_boots"};
|
||||
|
||||
public ArmorEuphemium(ArmorMaterial armorMaterial, int renderIndex, int armorType) {
|
||||
super(armorMaterial, renderIndex, armorType);
|
||||
this.setCreativeTab(null);
|
||||
@ -52,14 +50,14 @@ public class ArmorEuphemium extends ItemArmor {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack p_77613_1_) {
|
||||
|
||||
|
||||
return EnumRarity.epic;
|
||||
}
|
||||
|
||||
//do literally nothing lole
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) { }
|
||||
}
|
||||
|
||||
//do literally nothing lole
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) { }
|
||||
|
||||
}
|
||||
|
||||
80
src/main/java/com/hbm/items/armor/ArmorFSBFueled.java
Normal file
80
src/main/java/com/hbm/items/armor/ArmorFSBFueled.java
Normal file
@ -0,0 +1,80 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import com.hbm.interfaces.IPartiallyFillable;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ArmorFSBFueled extends ArmorFSB implements IPartiallyFillable {
|
||||
|
||||
FluidType fuelType;
|
||||
public int maxFuel = 1;
|
||||
public int fillRate;
|
||||
public int consumption;
|
||||
public int drain;
|
||||
|
||||
public ArmorFSBFueled(ArmorMaterial material, int layer, int slot, String texture, FluidType fuelType, int maxFuel, int fillRate, int consumption, int drain) {
|
||||
super(material, layer, slot, texture);
|
||||
this.fuelType = fuelType;
|
||||
this.fillRate = fillRate;
|
||||
this.consumption = consumption;
|
||||
this.drain = drain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidType getType(ItemStack stack) {
|
||||
return this.fuelType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFill(ItemStack stack) {
|
||||
if(stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
return 0;
|
||||
}
|
||||
|
||||
return stack.stackTagCompound.getInteger("fuel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFill(ItemStack stack, int fill) {
|
||||
if(stack.stackTagCompound == null) {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
|
||||
stack.stackTagCompound.setInteger("fuel", fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFill(ItemStack stack) {
|
||||
return this.maxFuel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLoadSpeed(ItemStack stack) {
|
||||
return this.fillRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUnloadSpeed(ItemStack stack) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
this.setFill(stack, Math.max(this.getFill(stack) - (damage * consumption), 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||
|
||||
super.onArmorTick(world, player, stack);
|
||||
|
||||
if(this.drain > 0 && ArmorFSB.hasFSBArmor(player) && !player.capabilities.isCreativeMode) {
|
||||
this.setFill(stack, Math.max(this.getFill(stack) - this.drain, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -27,14 +27,14 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
this.drain = drain;
|
||||
this.setMaxDamage(1);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
||||
|
||||
super.addInformation(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
list.add("Charge: " + BobMathUtil.getShortNumber(getCharge(stack)) + " / " + BobMathUtil.getShortNumber(maxPower));
|
||||
|
||||
super.addInformation(stack, player, list, ext);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArmorEnabled(ItemStack stack) {
|
||||
@ -42,80 +42,80 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chargeBattery(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void chargeBattery(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") + i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCharge(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void setCharge(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dischargeBattery(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", this.maxPower - i);
|
||||
}
|
||||
|
||||
if(stack.stackTagCompound.getLong("charge") < 0)
|
||||
stack.stackTagCompound.setLong("charge", 0);
|
||||
}
|
||||
}
|
||||
public void dischargeBattery(ItemStack stack, long i) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
stack.stackTagCompound.setLong("charge", stack.stackTagCompound.getLong("charge") - i);
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", this.maxPower - i);
|
||||
}
|
||||
|
||||
if(stack.stackTagCompound.getLong("charge") < 0)
|
||||
stack.stackTagCompound.setLong("charge", 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getCharge(ItemStack stack) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", ((ArmorFSBPowered)stack.getItem()).maxPower);
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
public long getCharge(ItemStack stack) {
|
||||
if(stack.getItem() instanceof ArmorFSBPowered) {
|
||||
if(stack.hasTagCompound()) {
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
} else {
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setLong("charge", ((ArmorFSBPowered) stack.getItem()).maxPower);
|
||||
return stack.stackTagCompound.getLong("charge");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
|
||||
return getCharge(stack) < maxPower;
|
||||
}
|
||||
public boolean showDurabilityBar(ItemStack stack) {
|
||||
|
||||
return getCharge(stack) < maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
|
||||
return 1 - (double)getCharge(stack) / (double)maxPower;
|
||||
}
|
||||
public double getDurabilityForDisplay(ItemStack stack) {
|
||||
|
||||
return 1 - (double) getCharge(stack) / (double) maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxCharge() {
|
||||
return maxPower;
|
||||
}
|
||||
public long getMaxCharge() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getChargeRate() {
|
||||
return chargeRate;
|
||||
}
|
||||
public long getChargeRate() {
|
||||
return chargeRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getDischargeRate() {
|
||||
@ -123,17 +123,16 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int damage)
|
||||
{
|
||||
this.dischargeBattery(stack, damage * consumption);
|
||||
}
|
||||
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
|
||||
super.onArmorTick(world, player, itemStack);
|
||||
|
||||
if(this.drain > 0 && ArmorFSB.hasFSBArmor(player) && !player.capabilities.isCreativeMode) {
|
||||
this.dischargeBattery(itemStack, drain);
|
||||
}
|
||||
}
|
||||
public void setDamage(ItemStack stack, int damage) {
|
||||
this.dischargeBattery(stack, damage * consumption);
|
||||
}
|
||||
|
||||
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
|
||||
|
||||
super.onArmorTick(world, player, itemStack);
|
||||
|
||||
if(this.drain > 0 && ArmorFSB.hasFSBArmor(player) && !player.capabilities.isCreativeMode) {
|
||||
this.dischargeBattery(itemStack, drain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.render.model.ModelArmorHEV;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -16,14 +12,9 @@ import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
|
||||
|
||||
@ -11,11 +11,8 @@ import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class ArmorHazmat extends ArmorFSB {
|
||||
|
||||
@ -16,7 +16,6 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
public class ArmorSchrabidium extends ItemArmor implements ISpecialArmor {
|
||||
private String [] armourTypes = new String [] {"schrabidium_helmet", "schrabidium_plate", "schrabidium_legs", "schrabidium_boots"};
|
||||
|
||||
public ArmorSchrabidium(ArmorMaterial armorMaterial, int renderIndex, int armorType) {
|
||||
super(armorMaterial, renderIndex, armorType);
|
||||
|
||||
@ -8,7 +8,6 @@ import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ArmorTest extends ItemArmor {
|
||||
private String [] armourTypes = new String [] {"test_helmet", "test_chestplate", "test_leggings", "test_boots"};
|
||||
|
||||
public ArmorTest(ArmorMaterial armorMaterial, int renderIndex, int armorType) {
|
||||
super(armorMaterial, renderIndex, armorType);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
|
||||
@ -48,7 +48,7 @@ public class ItemModHealth extends ItemArmorMod {
|
||||
|
||||
@Override
|
||||
public Multimap getModifiers(ItemStack armor) {
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
|
||||
multimap.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(ArmorModHandler.UUIDs[((ItemArmor)armor.getItem()).armorType], "NTM Armor Mod Health", health, 0));
|
||||
|
||||
@ -8,7 +8,6 @@ import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
@ -16,7 +15,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
|
||||
public class ItemModInsert extends ItemArmorMod {
|
||||
@ -120,8 +118,8 @@ public class ItemModInsert extends ItemArmorMod {
|
||||
|
||||
if(speed == 1)
|
||||
return null;
|
||||
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(ArmorModHandler.UUIDs[((ItemArmor)armor.getItem()).armorType], "NTM Armor Mod Speed", -1F + speed, 2));
|
||||
|
||||
@ -32,7 +32,7 @@ public class ItemModIron extends ItemArmorMod {
|
||||
|
||||
@Override
|
||||
public Multimap getModifiers(ItemStack armor) {
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
|
||||
multimap.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(ArmorModHandler.UUIDs[((ItemArmor)armor.getItem()).armorType], "NTM Armor Mod Knockback", 0.5, 0));
|
||||
|
||||
@ -91,7 +91,7 @@ public class ItemModServos extends ItemArmorMod {
|
||||
|
||||
@Override
|
||||
public Multimap getModifiers(ItemStack armor) {
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
|
||||
ItemArmor item = (ItemArmor)armor.getItem();
|
||||
|
||||
|
||||
@ -3,18 +3,12 @@ package com.hbm.items.armor;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.render.model.ModelBackTesla;
|
||||
import com.hbm.render.util.BeamPronter;
|
||||
import com.hbm.render.util.BeamPronter.EnumBeamType;
|
||||
import com.hbm.render.util.BeamPronter.EnumWaveType;
|
||||
import com.hbm.tileentity.machine.TileEntityTesla;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@ -22,7 +16,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
public class ItemModTesla extends ItemArmorMod {
|
||||
|
||||
@ -1,19 +1,31 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ItemModV1 extends ItemArmorMod {
|
||||
|
||||
private static final UUID speed = UUID.fromString("1d11e63e-28c4-4e14-b09f-fe0bd1be708f");
|
||||
|
||||
public ItemModV1() {
|
||||
super(ArmorModHandler.extra, false, true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getModifiers(ItemStack armor) {
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(speed, "V1 SPEED", 0.5, 2));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
@ -50,7 +50,7 @@ public class ItemModWD40 extends ItemArmorMod {
|
||||
|
||||
@Override
|
||||
public Multimap getModifiers(ItemStack armor) {
|
||||
Multimap multimap = super.getItemAttributeModifiers();
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
|
||||
multimap.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(ArmorModHandler.UUIDs[((ItemArmor)armor.getItem()).armorType], "NTM Armor Mod Health", 4, 0));
|
||||
|
||||
@ -81,6 +81,7 @@ import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.machine.storage.*;
|
||||
import com.hbm.tileentity.network.*;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
import com.hbm.util.SoundUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@ -674,6 +675,8 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.addNewArmourRendererPrefix("7");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("8");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("9");
|
||||
|
||||
SoundUtil.addSoundCategory("ntmMachines");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
44
src/main/java/com/hbm/util/SoundUtil.java
Normal file
44
src/main/java/com/hbm/util/SoundUtil.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.util;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.SoundCategory;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class SoundUtil {
|
||||
|
||||
public static void addSoundCategory(String name) {
|
||||
|
||||
try {
|
||||
SoundCategory category = EnumHelper.addEnum(SoundCategory.class, name.toUpperCase(), new Class[] { String.class, int.class }, new Object[] { name, SoundCategory.values().length });
|
||||
|
||||
Map nameMapping = (Map) ReflectionHelper.findField(SoundCategory.class, "field_147168_j").get(null);
|
||||
Map idMapping = (Map) ReflectionHelper.findField(SoundCategory.class, "field_147169_k").get(null);
|
||||
|
||||
Map mapSoundLevelsOrig = (Map) ReflectionHelper.findField(GameSettings.class, "mapSoundLevels" /* TODO: add obfus case */).get(Minecraft.getMinecraft().gameSettings);
|
||||
Map mapSoundLevels = Maps.newEnumMap(SoundCategory.class); //(Map) ReflectionHelper.findField(GameSettings.class, "mapSoundLevels" /* TODO: add obfus case */).get(Minecraft.getMinecraft().gameSettings);
|
||||
|
||||
nameMapping.put(category.getCategoryName(), category);
|
||||
idMapping.put(Integer.valueOf(category.getCategoryId()), category);
|
||||
|
||||
//we have to copy the new map before putting it in the settings because otherwise the EnumMap fucking dies
|
||||
for(Object o : mapSoundLevelsOrig.keySet()) {
|
||||
mapSoundLevels.put(o, mapSoundLevelsOrig.get(o));
|
||||
}
|
||||
|
||||
mapSoundLevels.put(category, 1F);
|
||||
|
||||
//ReflectionHelper.setPrivateValue(SoundCategory.class, null, nameMapping, "field_147168_j");
|
||||
//ReflectionHelper.setPrivateValue(SoundCategory.class, null, idMapping, "field_147169_k");
|
||||
ReflectionHelper.setPrivateValue(GameSettings.class, Minecraft.getMinecraft().gameSettings, mapSoundLevels, "mapSoundLevels");
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user