mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
small FSB armor adjustments
This commit is contained in:
parent
b8f28ae413
commit
c0dd864e03
@ -160,6 +160,8 @@
|
||||
"entity.ducc": {"category": "neutral", "sounds": ["entity/ducc1", "entity/ducc2"]},
|
||||
"entity.slicer": {"category": "neutral", "sounds": ["entity/slicer1", "entity/slicer2", "entity/slicer3", "entity/slicer4"]},
|
||||
|
||||
"step.metal": {"category": "player", "sounds": [{"name": "footsteps/metal", "stream": false}]},
|
||||
|
||||
"potatos.random": {"category": "player", "sounds": ["potatos/randResponse0", "potatos/randResponse1", "potatos/randResponse2", "potatos/randResponse3", "potatos/randResponse4", "potatos/randResponse5", "potatos/randResponse6", "potatos/randResponse7"]},
|
||||
|
||||
"fm.clap": {"category": "block", "sounds": [{"name": "clap", "stream": false}]},
|
||||
|
||||
BIN
src/main/java/assets/hbm/sounds/footsteps/metal.ogg
Normal file
BIN
src/main/java/assets/hbm/sounds/footsteps/metal.ogg
Normal file
Binary file not shown.
@ -3613,7 +3613,12 @@ public class ModItems {
|
||||
starmetal_boots = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_boots").setTextureName(RefStrings.MODID + ":starmetal_boots");
|
||||
|
||||
bj_helmet = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000, 100, 10).setMod(0.5F).setCap(15F)
|
||||
.setFireproof(true).setUnlocalizedName("bj_helmet").setTextureName(RefStrings.MODID + ":bj_helmet");
|
||||
.setFireproof(true)
|
||||
.enableThermalSight(true)
|
||||
.addEffect(new PotionEffect(Potion.jump.id, 20, 0))
|
||||
.setGravity(0.02D)
|
||||
.setStep("hbm:step.metal")
|
||||
.addResistance("fall", 0).setUnlocalizedName("bj_helmet").setTextureName(RefStrings.MODID + ":bj_helmet");
|
||||
bj_plate = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000, 100, 10).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate").setTextureName(RefStrings.MODID + ":bj_plate");
|
||||
bj_legs = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000, 100, 10).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_legs").setTextureName(RefStrings.MODID + ":bj_legs");
|
||||
bj_boots = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000, 100, 10).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_boots").setTextureName(RefStrings.MODID + ":bj_boots");
|
||||
|
||||
@ -9,6 +9,7 @@ import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.interfaces.Untested;
|
||||
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@ -25,8 +26,11 @@ import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.sound.PlaySoundEvent17;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
|
||||
|
||||
//Armor with full set bonus
|
||||
public class ArmorFSB extends ItemArmor {
|
||||
@ -40,6 +44,9 @@ public class ArmorFSB extends ItemArmor {
|
||||
public float damageMod = -1;
|
||||
public boolean fireproof = false;
|
||||
public boolean noHelmet = false;
|
||||
public boolean thermal = false;
|
||||
public double gravity = 0;
|
||||
public String step;
|
||||
|
||||
public ArmorFSB(ArmorMaterial material, int layer, int slot, String texture) {
|
||||
super(material, layer, slot);
|
||||
@ -76,6 +83,21 @@ public class ArmorFSB extends ItemArmor {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB enableThermalSight(boolean thermal) {
|
||||
this.thermal = thermal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setGravity(double gravity) {
|
||||
this.gravity = gravity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setStep(String step) {
|
||||
this.step = step;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setOverlay(String path) {
|
||||
this.overlay = new ResourceLocation(path);
|
||||
return this;
|
||||
@ -90,6 +112,9 @@ public class ArmorFSB extends ItemArmor {
|
||||
this.damageMod = original.damageMod;
|
||||
this.fireproof = original.fireproof;
|
||||
this.noHelmet = original.noHelmet;
|
||||
this.thermal = original.thermal;
|
||||
this.gravity = original.gravity;
|
||||
this.step = original.step;
|
||||
//overlay doesn't need to be copied because it's helmet exclusive
|
||||
return this;
|
||||
}
|
||||
@ -134,6 +159,10 @@ public class ArmorFSB extends ItemArmor {
|
||||
if(fireproof) {
|
||||
list.add(" Fireproof");
|
||||
}
|
||||
|
||||
if(thermal) {
|
||||
list.add(" Thermal Sight");
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean hasFSBArmor(EntityPlayer player) {
|
||||
@ -180,6 +209,11 @@ public class ArmorFSB extends ItemArmor {
|
||||
player.extinguish();
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
||||
if(chestplate.resistance.get(event.source.getDamageType()) != null &&
|
||||
chestplate.resistance.get(event.source.getDamageType()) <= 0) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -201,7 +235,7 @@ public class ArmorFSB extends ItemArmor {
|
||||
}
|
||||
|
||||
if(chestplate.resistance.get(event.source.getDamageType()) != null) {
|
||||
event.ammount *= chestplate.resistance.get(event.source);
|
||||
event.ammount *= chestplate.resistance.get(event.source.getDamageType());
|
||||
}
|
||||
|
||||
if(chestplate.blastProtection != -1 && event.source.isExplosion()) {
|
||||
@ -214,6 +248,41 @@ public class ArmorFSB extends ItemArmor {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Untested
|
||||
public static void handleTick(TickEvent.PlayerTickEvent event) {
|
||||
|
||||
EntityPlayer player = event.player;
|
||||
|
||||
if(ArmorFSB.hasFSBArmor(player)) {
|
||||
|
||||
ItemStack plate = player.inventory.armorInventory[2];
|
||||
|
||||
ArmorFSB chestplate = (ArmorFSB) plate.getItem();
|
||||
|
||||
if(!chestplate.effects.isEmpty()) {
|
||||
|
||||
for(PotionEffect i : chestplate.effects) {
|
||||
player.addPotionEffect(new PotionEffect(i.getPotionID(), i.getDuration(), i.getAmplifier(), i.getIsAmbient()));
|
||||
}
|
||||
}
|
||||
|
||||
if(!player.capabilities.isFlying && !player.isInWater())
|
||||
player.motionY -= chestplate.gravity;
|
||||
}
|
||||
}
|
||||
|
||||
@Untested
|
||||
public static void handleFall(EntityPlayer player) {
|
||||
|
||||
if(ArmorFSB.hasFSBArmor(player)) {
|
||||
|
||||
ArmorFSB chestplate = (ArmorFSB) player.inventory.armorInventory[3].getItem();
|
||||
|
||||
if(chestplate.step != null)
|
||||
player.playSound(chestplate.step, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){
|
||||
|
||||
@ -571,7 +571,7 @@ public class ItemStarterKit extends Item {
|
||||
|
||||
if(this == ModItems.stealth_boy)
|
||||
{
|
||||
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, 30 * 20, 0, true));
|
||||
player.addPotionEffect(new PotionEffect(Potion.invisibility.id, 30 * 20, 1, true));
|
||||
}
|
||||
|
||||
if(this == ModItems.euphemium_kit)
|
||||
|
||||
@ -67,8 +67,10 @@ import net.minecraftforge.event.ServerChatEvent;
|
||||
import net.minecraftforge.event.entity.EntityEvent.EnteringChunk;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingDeathEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingFallEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingSpawnEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
|
||||
|
||||
@ -402,11 +404,26 @@ public class ModEventHandler
|
||||
ArmorFSB.handleHurt(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerFall(PlayerFlyableFallEvent event) {
|
||||
|
||||
ArmorFSB.handleFall(event.entityPlayer);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityFall(LivingFallEvent event) {
|
||||
|
||||
if(event.entityLiving instanceof EntityPlayer)
|
||||
ArmorFSB.handleFall((EntityPlayer) event.entityLiving);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
|
||||
EntityPlayer player = event.player;
|
||||
|
||||
ArmorFSB.handleTick(event);
|
||||
|
||||
if(!player.worldObj.isRemote && event.phase == TickEvent.Phase.START) {
|
||||
|
||||
/// GHOST FIX START ///
|
||||
|
||||
@ -16,6 +16,7 @@ import com.hbm.interfaces.IHoldableWeapon;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.armor.ArmorFSB;
|
||||
import com.hbm.items.weapon.ItemGunBase;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -50,6 +51,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.boss.IBossDisplayData;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
||||
@ -57,6 +59,8 @@ import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
@ -162,6 +166,11 @@ public class ModEventHandlerClient {
|
||||
RenderPlayer renderer = event.renderer;
|
||||
AbstractClientPlayer player = (AbstractClientPlayer)event.entityPlayer;
|
||||
|
||||
PotionEffect invis = player.getActivePotionEffect(Potion.invisibility);
|
||||
|
||||
if(invis != null && invis.getAmplifier() > 0)
|
||||
event.setCanceled(true);
|
||||
|
||||
ResourceLocation cloak = RenderAccessoryUtility.getCloakFromPlayer(player);
|
||||
|
||||
if(cloak != null)
|
||||
@ -380,7 +389,13 @@ public class ModEventHandlerClient {
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderThermalSight(event.partialTicks);
|
||||
if(ArmorFSB.hasFSBArmor(player)) {
|
||||
ItemStack plate = player.inventory.armorInventory[2];
|
||||
ArmorFSB chestplate = (ArmorFSB)plate.getItem();
|
||||
|
||||
if(chestplate.thermal)
|
||||
renderThermalSight(event.partialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
public void renderThermalSight(float partialTicks) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user