diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 545cfe47f..8e507f00f 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -3127,18 +3127,18 @@ public class ModBlocks { GameRegistry.registerBlock(ladder_lead, ladder_lead.getUnlocalizedName()); GameRegistry.registerBlock(ladder_cobalt, ladder_cobalt.getUnlocalizedName()); - GameRegistry.registerBlock(barrel_plastic, ItemBlockLore.class, barrel_plastic.getUnlocalizedName()); - GameRegistry.registerBlock(barrel_corroded, ItemBlockLore.class, barrel_corroded.getUnlocalizedName()); - GameRegistry.registerBlock(barrel_iron, ItemBlockLore.class, barrel_iron.getUnlocalizedName()); - GameRegistry.registerBlock(barrel_steel, ItemBlockLore.class, barrel_steel.getUnlocalizedName()); - GameRegistry.registerBlock(barrel_tcalloy, ItemBlockLore.class, barrel_tcalloy.getUnlocalizedName()); - GameRegistry.registerBlock(barrel_antimatter, ItemBlockLore.class, barrel_antimatter.getUnlocalizedName()); - GameRegistry.registerBlock(machine_battery_potato, machine_battery_potato.getUnlocalizedName()); - GameRegistry.registerBlock(machine_battery, machine_battery.getUnlocalizedName()); - GameRegistry.registerBlock(machine_lithium_battery, machine_lithium_battery.getUnlocalizedName()); - GameRegistry.registerBlock(machine_schrabidium_battery, machine_schrabidium_battery.getUnlocalizedName()); - GameRegistry.registerBlock(machine_dineutronium_battery, machine_dineutronium_battery.getUnlocalizedName()); - GameRegistry.registerBlock(machine_fensu, machine_fensu.getUnlocalizedName()); + register(barrel_plastic); + register(barrel_corroded); + register(barrel_iron); + register(barrel_steel); + register(barrel_tcalloy); + register(barrel_antimatter); + register(machine_battery_potato); + register(machine_battery); + register(machine_lithium_battery); + register(machine_schrabidium_battery); + register(machine_dineutronium_battery); + register(machine_fensu); GameRegistry.registerBlock(machine_transformer, machine_transformer.getUnlocalizedName()); GameRegistry.registerBlock(machine_transformer_20, machine_transformer_20.getUnlocalizedName()); GameRegistry.registerBlock(machine_transformer_dnt, machine_transformer_dnt.getUnlocalizedName()); @@ -3154,9 +3154,9 @@ public class ModBlocks { GameRegistry.registerBlock(machine_assemfac, machine_assemfac.getUnlocalizedName()); GameRegistry.registerBlock(machine_chemplant, machine_chemplant.getUnlocalizedName()); GameRegistry.registerBlock(machine_chemfac, machine_chemfac.getUnlocalizedName()); - GameRegistry.registerBlock(machine_fluidtank, machine_fluidtank.getUnlocalizedName()); - GameRegistry.registerBlock(machine_bat9000, machine_bat9000.getUnlocalizedName()); - GameRegistry.registerBlock(machine_orbus, machine_orbus.getUnlocalizedName()); + register(machine_fluidtank); + register(machine_bat9000); + register(machine_orbus); GameRegistry.registerBlock(machine_boiler_off, machine_boiler_off.getUnlocalizedName()); GameRegistry.registerBlock(machine_boiler_on, machine_boiler_on.getUnlocalizedName()); GameRegistry.registerBlock(machine_boiler_electric_on, machine_boiler_electric_on.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/machine/MachineFluidTank.java b/src/main/java/com/hbm/blocks/machine/MachineFluidTank.java index bc4094202..1b5e3670d 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineFluidTank.java +++ b/src/main/java/com/hbm/blocks/machine/MachineFluidTank.java @@ -85,6 +85,9 @@ public class MachineFluidTank extends BlockContainer implements IMultiblock, IPe @Override public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) { int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3; + + ItemStack drop = itemStack.copy(); + drop.stackSize = 1; if (i == 0) { world.setBlockMetadataWithNotify(x, y, z, 5, 2); @@ -128,8 +131,11 @@ public class MachineFluidTank extends BlockContainer implements IMultiblock, IPe DummyBlockFluidTank.safeBreak = false; // - } else - world.func_147480_a(x, y, z, true); + } else { + this.dropBlockAsItem(world, x, y, z, drop); + world.func_147480_a(x, y, z, false); + System.out.println("piss and shit"); + } } if (i == 1) { world.setBlockMetadataWithNotify(x, y, z, 3, 2); @@ -173,8 +179,11 @@ public class MachineFluidTank extends BlockContainer implements IMultiblock, IPe DummyBlockFluidTank.safeBreak = false; // - } else - world.func_147480_a(x, y, z, true); + } else { + this.dropBlockAsItem(world, x, y, z, drop); + world.func_147480_a(x, y, z, false); + System.out.println("piss and shit"); + } } if (i == 2) { world.setBlockMetadataWithNotify(x, y, z, 4, 2); @@ -218,8 +227,11 @@ public class MachineFluidTank extends BlockContainer implements IMultiblock, IPe DummyBlockFluidTank.safeBreak = false; // - } else - world.func_147480_a(x, y, z, true); + } else { + this.dropBlockAsItem(world, x, y, z, drop); + world.func_147480_a(x, y, z, false); + System.out.println("piss and shit"); + } } if (i == 3) { world.setBlockMetadataWithNotify(x, y, z, 2, 2); @@ -263,8 +275,11 @@ public class MachineFluidTank extends BlockContainer implements IMultiblock, IPe DummyBlockFluidTank.safeBreak = false; // - } else - world.func_147480_a(x, y, z, true); + } else { + this.dropBlockAsItem(world, x, y, z, drop); + world.func_147480_a(x, y, z, false); + System.out.println("piss and shit"); + } } IPersistentNBT.restoreData(world, x, y, z, itemStack); diff --git a/src/main/java/com/hbm/blocks/machine/MachineOrbus.java b/src/main/java/com/hbm/blocks/machine/MachineOrbus.java index 5bf08f383..17e5004e7 100644 --- a/src/main/java/com/hbm/blocks/machine/MachineOrbus.java +++ b/src/main/java/com/hbm/blocks/machine/MachineOrbus.java @@ -1,19 +1,30 @@ package com.hbm.blocks.machine; +import java.util.ArrayList; +import java.util.List; + import com.hbm.blocks.BlockDummyable; +import com.hbm.blocks.IPersistentInfoProvider; import com.hbm.blocks.ModBlocks; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.main.MainRegistry; +import com.hbm.tileentity.IPersistentNBT; import com.hbm.tileentity.TileEntityProxyCombo; import com.hbm.tileentity.machine.storage.TileEntityMachineOrbus; +import com.hbm.util.I18nUtil; import cpw.mods.fml.common.network.internal.FMLNetworkHandler; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class MachineOrbus extends BlockDummyable { +public class MachineOrbus extends BlockDummyable implements IPersistentInfoProvider { public MachineOrbus(Material mat) { super(mat); @@ -73,4 +84,16 @@ public class MachineOrbus extends BlockDummyable { this.makeExtra(world, x + dir.offsetX + d2.offsetX, y + i, z + dir.offsetZ + d2.offsetZ); } } + + @Override + public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { + return IPersistentNBT.getDrops(world, x, y, z, this); + } + + @Override + public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) { + FluidTank tank = new FluidTank(Fluids.NONE, 0, 0); + tank.readFromNBT(persistentTag, "tank"); + list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + I18nUtil.resolveKey(tank.getTankType().getUnlocalizedName())); + } } diff --git a/src/main/java/com/hbm/crafting/WeaponRecipes.java b/src/main/java/com/hbm/crafting/WeaponRecipes.java index 9a8291b1e..2ca3c5638 100644 --- a/src/main/java/com/hbm/crafting/WeaponRecipes.java +++ b/src/main/java/com/hbm/crafting/WeaponRecipes.java @@ -87,6 +87,7 @@ public class WeaponRecipes { CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nightmare, 1), new Object[] { "SEM", " RW", 'S', STEEL.plate(), 'W', KEY_PLANKS, 'R', ModItems.wire_aluminium, 'E', ModItems.powder_power, 'M', ModItems.mechanism_revolver_2 }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nightmare2, 1), new Object[] { "SSM", "RRW", 'S', OreDictManager.getReflector(), 'W', W.ingot(), 'R', ModItems.wire_gold, 'M', ModItems.mechanism_special }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_bio_revolver, 1), new Object[] { "SSM", "BTW", 'S', STEEL.plate(), 'M', ModItems.mechanism_revolver_2, 'B', B.ingot(), 'T', ModItems.bolt_tungsten, 'W', KEY_LOG }); + CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_chemthrower, 1), new Object[] { "RWC", "HHT", "RLC", 'R', RUBBER.ingot(), 'W', ModItems.wrench, 'C', CU.plate(), 'H', ModItems.hull_small_steel, 'T', ModItems.tank_steel, 'L', ModItems.mechanism_launcher_2 }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fatman, 1), new Object[] { "SSI", "IIM", "WPH", 'S', STEEL.plate(), 'I', STEEL.ingot(), 'W', ModItems.wire_aluminium, 'H', ModItems.hull_small_steel, 'P', Item.getItemFromBlock(Blocks.piston), 'M', ModItems.mechanism_launcher_2 }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mirv, 1), new Object[] { "LLL", "WFW", "SSS", 'S', STEEL.plate(), 'L', PB.plate(), 'W', ModItems.wire_gold, 'F', ModItems.gun_fatman }); CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_proto, 1), new Object[] { "LLL", "WFW", "SSS", 'S', ModItems.plate_polymer, 'L', ModItems.plate_desh, 'W', ModItems.wire_tungsten, 'F', ModItems.gun_fatman }); diff --git a/src/main/java/com/hbm/entity/EntityMappings.java b/src/main/java/com/hbm/entity/EntityMappings.java index 9f9c0db4b..8a0f2a135 100644 --- a/src/main/java/com/hbm/entity/EntityMappings.java +++ b/src/main/java/com/hbm/entity/EntityMappings.java @@ -206,6 +206,7 @@ public class EntityMappings { addEntity(EntitySiegeTunneler.class, "entity_meme_tunneler", 1000); addEntity(EntitySPV.class, "entity_self_propelled_vehicle_mark_1", 1000); addEntity(EntityCog.class, "entity_stray_cog", 1000); + addEntity(EntityChemical.class, "entity_chemthrower_splash", 1000); addMob(EntityNuclearCreeper.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00); addMob(EntityTaintedCreeper.class, "entity_mob_tainted_creeper", 0x813b9b, 0xd71fdd); diff --git a/src/main/java/com/hbm/entity/projectile/EntityChemical.java b/src/main/java/com/hbm/entity/projectile/EntityChemical.java new file mode 100644 index 000000000..4c798bc3d --- /dev/null +++ b/src/main/java/com/hbm/entity/projectile/EntityChemical.java @@ -0,0 +1,364 @@ +package com.hbm.entity.projectile; + +import java.awt.Color; +import java.util.List; + +import com.hbm.extprop.HbmLivingProps; +import com.hbm.handler.radiation.ChunkRadiationManager; +import com.hbm.inventory.fluid.FluidType; +import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.fluid.trait.FT_Combustible; +import com.hbm.inventory.fluid.trait.FT_Corrosive; +import com.hbm.inventory.fluid.trait.FT_Flammable; +import com.hbm.inventory.fluid.trait.FT_VentRadiation; +import com.hbm.lib.ModDamageSource; +import com.hbm.main.MainRegistry; +import com.hbm.util.ArmorUtil; +import com.hbm.util.ContaminationUtil; +import com.hbm.util.ContaminationUtil.ContaminationType; +import com.hbm.util.ContaminationUtil.HazardType; +import com.hbm.util.EntityDamageUtil; + +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.init.Blocks; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.DamageSource; +import net.minecraft.util.EntityDamageSourceIndirect; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class EntityChemical extends EntityThrowableNT { + + /* + * TYPE INFO: + * + * if ANTIMATTER: ignore all other traits, become a gamme beam with no gravity + * if HOT: set fire and deal extra fire damage, scaling with the temperature + * if COLD: freeze, duration scaling with temperature, assuming COMBUSTIBLE does not apply + * if GAS: short range with the spread going up + * if EVAP: same as gas + * if LIQUID: if EVAP doesn't apply, create a narrow spray with long range affected by gravity + * if COMBUSTIBLE: auto-ignite + * if FLAMMABLE: if GAS or EVAP apply, do the same as COMBUSTIBLE, otherwise create a neutral spray that adds the "soaked" effect + * if CORROSIVE: apply extra acid damage, poison effect as well as armor degradation + */ + + public EntityChemical(World world) { + super(world); + this.ignoreFrustumCheck = true; + } + + public EntityChemical(World world, EntityLivingBase thrower) { + super(world, thrower); + this.ignoreFrustumCheck = true; + } + + @Override + protected void entityInit() { + this.dataWatcher.addObject(10, new Integer(0)); + } + + public EntityChemical setFluid(FluidType fluid) { + this.dataWatcher.updateObject(10, fluid.getID()); + return this; + } + + public FluidType getType() { + return Fluids.fromID(this.dataWatcher.getWatchableObjectInt(10)); + } + + @Override + public void onUpdate() { + + if(!worldObj.isRemote) { + + if(this.ticksExisted > this.getMaxAge()) { + this.setDead(); + } + + FluidType type = this.getType(); + + if(type.hasTrait(Fluids.GASEOUS.getClass()) || type.hasTrait(Fluids.EVAP.getClass())) { + + double intensity = 1D - (double) this.ticksExisted / (double) this.getMaxAge(); + List affected = worldObj.getEntitiesWithinAABBExcludingEntity(this.thrower, this.boundingBox.expand(intensity * 2.5, intensity * 2.5, intensity * 2.5)); + + for(Entity e : affected) { + this.affect(e, intensity); + } + } + + } else { + + ChemicalStyle style = getStyle(); + + if(style == ChemicalStyle.LIQUID) { + + FluidType type = getType(); + Color color = new Color(type.getColor()); + + NBTTagCompound data = new NBTTagCompound(); + data.setString("type", "vanillaExt"); + data.setString("mode", "colordust"); + data.setDouble("posX", posX); + data.setDouble("posY", posY); + data.setDouble("posZ", posZ); + data.setDouble("mX", motionX + worldObj.rand.nextGaussian() * 0.05); + data.setDouble("mY", motionY - 0.2 + worldObj.rand.nextGaussian() * 0.05); + data.setDouble("mZ", motionZ + worldObj.rand.nextGaussian() * 0.05); + data.setFloat("r", color.getRed() / 255F); + data.setFloat("g", color.getGreen() / 255F); + data.setFloat("b", color.getBlue() / 255F); + MainRegistry.proxy.effectNT(data); + } + + if(style == ChemicalStyle.BURNING) { + + double motion = Math.min(Vec3.createVectorHelper(motionX, motionY, motionZ).lengthVector(), 0.1); + + for(double d = 0; d < motion; d += 0.0625) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "vanillaExt"); + nbt.setString("mode", "flame"); + nbt.setDouble("posX", (this.lastTickPosX - this.posX) * d + this.posX); + nbt.setDouble("posY", (this.lastTickPosY - this.posY) * d + this.posY); + nbt.setDouble("posZ", (this.lastTickPosZ - this.posZ) * d + this.posZ); + MainRegistry.proxy.effectNT(nbt); + } + } + } + super.onUpdate(); + } + + protected void affect(Entity e, double intensity) { + + ChemicalStyle style = getStyle(); + FluidType type = getType(); + EntityLivingBase living = e instanceof EntityLivingBase ? (EntityLivingBase) e : null; + + if(style == ChemicalStyle.LIQUID || style == ChemicalStyle.BURNING) //ignore range penalty for liquids + intensity = 1D; + + if(style == ChemicalStyle.AMAT) { + if(living != null) { + ContaminationUtil.contaminate(living, HazardType.RADIATION, ContaminationType.CREATIVE, 50F * (float) intensity); + return; + } + } + + if(type.temperature >= 100) { + EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_boil), 5F + (type.temperature - 100) * 0.02F); //5 damage at 100°C with one extra damage every 50°C + + if(type.temperature >= 500) { + e.setFire(10); //afterburn for 10 seconds + } + } + + if(style == ChemicalStyle.LIQUID || style == ChemicalStyle.GAS) { + if(type.temperature < -20) { + if(living != null) { //only living things are affected + EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_cryolator), 5F + (type.temperature + 20) * -0.05F); //5 damage at -20°C with one extra damage every -20°C + living.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 2)); + living.addPotionEffect(new PotionEffect(Potion.digSlowdown.id, 100, 4)); + } + } + + if(type.hasTrait(Fluids.DELICIOUS.getClass())) { + if(living != null && living.isEntityAlive()) { + living.heal(2F * (float) intensity); + } + } + } + + if(style == ChemicalStyle.LIQUID) { + + if(type.hasTrait(FT_Flammable.class)) { + if(living != null) { + HbmLivingProps.setOil(living, 300); //doused in oil for 15 seconds + } + } else { + + if(type.temperature < 50) { + e.extinguish(); //if it's a cold non-flammable liquid (that isn't burning), extinguish + } + } + } + + if(style == ChemicalStyle.BURNING) { + FT_Combustible trait = type.getTrait(FT_Combustible.class); + EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_flamethrower), 2F + (trait != null ? (trait.getCombustionEnergy() / 100_000F) : 0)); + e.setFire(5); + } + + if(style == ChemicalStyle.GASFLAME) { + FT_Flammable flammable = type.getTrait(FT_Flammable.class); + FT_Combustible combustible = type.getTrait(FT_Combustible.class); + + float heat = Math.max(flammable != null ? flammable.getHeatEnergy() / 50_000F : 0, combustible != null ? combustible.getCombustionEnergy() / 100_000F : 0); + heat *= intensity; + EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_flamethrower), (2F + heat) * (float) intensity); + e.setFire((int) Math.ceil(5 * intensity)); + } + + if(type.hasTrait(FT_Corrosive.class)) { + FT_Corrosive trait = type.getTrait(FT_Corrosive.class); + EntityDamageUtil.attackEntityFromIgnoreIFrame(e, getDamage(ModDamageSource.s_acid), trait.getRating() / 20F); + + if(living != null) { + for(int i = 0; i < 4; i++) { + ArmorUtil.damageSuit(living, i, trait.getRating() / 5); + } + } + } + + if(type.hasTrait(FT_VentRadiation.class)) { + FT_VentRadiation trait = type.getTrait(FT_VentRadiation.class); + if(living != null) { + ContaminationUtil.contaminate(living, HazardType.RADIATION, ContaminationType.CREATIVE, trait.getRadPerMB() * 5); + } + ChunkRadiationManager.proxy.incrementRad(worldObj, (int) Math.floor(e.posX), (int) Math.floor(e.posY), (int) Math.floor(e.posZ), trait.getRadPerMB() * 5); + } + } + + protected DamageSource getDamage(String name) { + + if(thrower != null) { + return new EntityDamageSourceIndirect(name, this, thrower); + } else { + return new DamageSource(name); + } + } + + @Override + protected void onImpact(MovingObjectPosition mop) { + + if(!worldObj.isRemote) { + + if(mop.typeOfHit == mop.typeOfHit.ENTITY) { + this.affect(mop.entityHit, 1D - (double) this.ticksExisted / (double) this.getMaxAge()); + } + + if(mop.typeOfHit == mop.typeOfHit.BLOCK) { + + FluidType type = getType(); + + if(type.hasTrait(FT_VentRadiation.class)) { + FT_VentRadiation trait = type.getTrait(FT_VentRadiation.class); + ChunkRadiationManager.proxy.incrementRad(worldObj, mop.blockX, mop.blockY, mop.blockZ, trait.getRadPerMB() * 5); + } + + ChemicalStyle style = getStyle(); + + if(style == ChemicalStyle.BURNING || style == ChemicalStyle.GASFLAME) { + int x = mop.blockX; + int y = mop.blockY; + int z = mop.blockZ; + + for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { + if(worldObj.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).isAir(worldObj, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) { + worldObj.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, Blocks.fire); + } + } + } + + this.setDead(); + } + } + } + + @Override + protected float getAirDrag() { + + ChemicalStyle type = getStyle(); + + if(type == ChemicalStyle.AMAT) return 1F; + if(type == ChemicalStyle.GAS) return 0.95F; + + return 0.99F; + } + + @Override + protected float getWaterDrag() { + + ChemicalStyle type = getStyle(); + + if(type == ChemicalStyle.AMAT) return 1F; + if(type == ChemicalStyle.GAS) return 1F; + + return 0.8F; + } + + public int getMaxAge() { + + switch(this.getStyle()) { + case AMAT: return 100; + case BURNING:return 600; + case GAS: return 60; + case GASFLAME: return 20; + case LIQUID: return 600; + } + + return 100; + } + + @Override + public double getGravityVelocity() { + + ChemicalStyle type = getStyle(); + + if(type == ChemicalStyle.AMAT) return 0D; + if(type == ChemicalStyle.GAS) return 0D; + if(type == ChemicalStyle.GASFLAME) return -0.01D; + + return 0.03D; + } + + public ChemicalStyle getStyle() { + return getStyleFromType(this.getType()); + } + + public static ChemicalStyle getStyleFromType(FluidType type) { + + if(type.isAntimatter()) { + return ChemicalStyle.AMAT; + } + + if(type.hasTrait(Fluids.GASEOUS.getClass()) || type.hasTrait(Fluids.EVAP.getClass())) { + + if(type.hasTrait(FT_Flammable.class) || type.hasTrait(FT_Combustible.class)) { + return ChemicalStyle.GASFLAME; + } else { + return ChemicalStyle.GAS; + } + } + + if(type.hasTrait(Fluids.LIQUID.getClass())) { + + if(type.hasTrait(FT_Combustible.class)) { + return ChemicalStyle.BURNING; + } else { + return ChemicalStyle.LIQUID; + } + } + + return ChemicalStyle.NULL; + } + + /** + * The general type of the chemical, determines rendering and movement + */ + public static enum ChemicalStyle { + AMAT, //renders as beam + LIQUID, //no renderer, fluid particles + GAS, //renders as particles + GASFLAME, //renders as fire particles + BURNING, //no renderer, fire particles + NULL + } +} diff --git a/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java b/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java index cfbfabc17..b1a27a009 100644 --- a/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java +++ b/src/main/java/com/hbm/entity/projectile/EntityThrowableNT.java @@ -30,7 +30,7 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile { private Block stuckBlock; protected boolean inGround; public int throwableShake; - private EntityLivingBase thrower; + protected EntityLivingBase thrower; private String throwerName; private int ticksInGround; private int ticksInAir; diff --git a/src/main/java/com/hbm/extprop/HbmLivingProps.java b/src/main/java/com/hbm/extprop/HbmLivingProps.java index 72d76ec0f..6eb410031 100644 --- a/src/main/java/com/hbm/extprop/HbmLivingProps.java +++ b/src/main/java/com/hbm/extprop/HbmLivingProps.java @@ -43,6 +43,7 @@ public class HbmLivingProps implements IExtendedEntityProperties { private float radBuf; private int bombTimer; private int contagion; + private int oil; private List contamination = new ArrayList(); public HbmLivingProps(EntityLivingBase entity) { @@ -269,6 +270,15 @@ public class HbmLivingProps implements IExtendedEntityProperties { public static void setContagion(EntityLivingBase entity, int contageon) { getData(entity).contagion = contageon; } + + /// OIL /// + public static int getOil(EntityLivingBase entity) { + return getData(entity).oil; + } + + public static void setOil(EntityLivingBase entity, int oil) { + getData(entity).oil = oil; + } @Override public void init(Entity entity, World world) { } @@ -285,6 +295,7 @@ public class HbmLivingProps implements IExtendedEntityProperties { props.setInteger("hfr_contagion", contagion); props.setInteger("hfr_blacklung", blacklung); props.setInteger("hfr_fibrosis", fibrosis); + props.setInteger("hfr_oil", oil); props.setInteger("hfr_cont_count", this.contamination.size()); @@ -308,6 +319,7 @@ public class HbmLivingProps implements IExtendedEntityProperties { contagion = props.getInteger("hfr_contagion"); blacklung = props.getInteger("hfr_blacklung"); fibrosis = props.getInteger("hfr_fibrosis"); + oil = props.getInteger("hfr_oil"); int cont = props.getInteger("hfr_cont_count"); diff --git a/src/main/java/com/hbm/handler/EntityEffectHandler.java b/src/main/java/com/hbm/handler/EntityEffectHandler.java index 78c037158..1b78ce031 100644 --- a/src/main/java/com/hbm/handler/EntityEffectHandler.java +++ b/src/main/java/com/hbm/handler/EntityEffectHandler.java @@ -94,6 +94,7 @@ public class EntityEffectHandler { handleRadiation(entity); handleDigamma(entity); handleLungDisease(entity); + handleOil(entity); handleDashing(entity); handlePlinking(entity); @@ -426,6 +427,29 @@ public class EntityEffectHandler { } } + private static void handleOil(EntityLivingBase entity) { + int oil = HbmLivingProps.getOil(entity); + + if(oil > 0) { + + if(entity.isBurning()) { + HbmLivingProps.setOil(entity, 0); + entity.worldObj.newExplosion(null, entity.posX, entity.posY + entity.height / 2, entity.posZ, 3F, false, true); + } else { + HbmLivingProps.setOil(entity, oil - 1); + } + + if(entity.ticksExisted % 5 == 0) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "sweat"); + nbt.setInteger("count", 1); + nbt.setInteger("block", Block.getIdFromBlock(Blocks.coal_block)); + nbt.setInteger("entity", entity.getEntityId()); + PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(nbt, 0, 0, 0), new TargetPoint(entity.dimension, entity.posX, entity.posY, entity.posZ, 25)); + } + } + } + private static void handleDashing(Entity entity) { //AAAAAAAAAAAAAAAAAAAAEEEEEEEEEEEEEEEEEEEE diff --git a/src/main/java/com/hbm/handler/ToolAbility.java b/src/main/java/com/hbm/handler/ToolAbility.java index 87bfcf558..60bdb43d5 100644 --- a/src/main/java/com/hbm/handler/ToolAbility.java +++ b/src/main/java/com/hbm/handler/ToolAbility.java @@ -14,11 +14,15 @@ import com.hbm.inventory.recipes.CrystallizerRecipes; import com.hbm.inventory.recipes.ShredderRecipes; import com.hbm.items.ModItems; import com.hbm.items.tool.IItemAbility; +import com.hbm.util.EnchantmentUtil; import net.minecraft.block.Block; import net.minecraft.client.resources.I18n; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; @@ -28,8 +32,7 @@ import net.minecraft.world.World; public abstract class ToolAbility { //how to potentially save this: cancel the event/operation so that ItemInWorldManager's harvest method falls short, then recreate it with a more sensible structure - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { } - public void onDigPost(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { } + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { return false; } public abstract String getName(); public abstract String getFullName(); public abstract String getExtension(); @@ -46,14 +49,14 @@ public abstract class ToolAbility { private Set pos = new HashSet(); @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { Block b = world.getBlock(x, y, z); if(b == Blocks.stone && !ToolConfig.recursiveStone) - return; + return false; if(b == Blocks.netherrack && !ToolConfig.recursiveNetherrack) - return; + return false; List indices = Arrays.asList(new Integer[] {0, 1, 2, 3, 4, 5}); Collections.shuffle(indices); @@ -70,6 +73,7 @@ public abstract class ToolAbility { case 5: breakExtra(world, x, y, z - 1, x, y, z, player, tool, 0); break; } } + return false; } private void breakExtra(World world, int x, int y, int z, int refX, int refY, int refZ, EntityPlayer player, IItemAbility tool, int depth) { @@ -160,7 +164,7 @@ public abstract class ToolAbility { } @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { for(int a = x - range; a <= x + range; a++) { for(int b = y - range; b <= y + range; b++) { @@ -173,6 +177,8 @@ public abstract class ToolAbility { } } } + + return false; } @Override @@ -199,23 +205,20 @@ public abstract class ToolAbility { public static class SilkAbility extends ToolAbility { @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { - /*//if the tool is already enchanted, do nothing if(EnchantmentHelper.getSilkTouchModifier(player) || player.getHeldItem() == null) - return; + return false; - //add enchantment ItemStack stack = player.getHeldItem(); - EnchantmentUtil.addEnchantment(stack, Enchantment.silkTouch, 1); - block.harvestBlock(world, player, x, y, z, meta); + + if(player instanceof EntityPlayerMP) + IItemAbility.standardDigPost(world, x, y, z, (EntityPlayerMP) player); + EnchantmentUtil.removeEnchantment(stack, Enchantment.silkTouch); - world.setBlockToAir(x, y, z); - player.getHeldItem().damageItem(1, player);*/ - - //tool.breakBlockSpecial(world, x, y, z, block, meta, player, 0, true); //TODO: replace + return true; } @Override @@ -248,25 +251,20 @@ public abstract class ToolAbility { } @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { - /*//if the tool is already enchanted, do nothing if(EnchantmentHelper.getFortuneModifier(player) > 0 || player.getHeldItem() == null) - return; + return false; - //add enchantment ItemStack stack = player.getHeldItem(); - EnchantmentUtil.addEnchantment(stack, Enchantment.fortune, luck); - block.harvestBlock(world, player, x, y, z, meta); + + if(player instanceof EntityPlayerMP) + IItemAbility.standardDigPost(world, x, y, z, (EntityPlayerMP) player); + EnchantmentUtil.removeEnchantment(stack, Enchantment.fortune); - world.setBlockToAir(x, y, z); - player.getHeldItem().damageItem(1, player);*/ - - - - //tool.breakBlockSpecial(world, x, y, z, block, meta, player, luck, false); //TODO: replace + return true; } @Override @@ -293,10 +291,12 @@ public abstract class ToolAbility { public static class SmelterAbility extends ToolAbility { @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { List drops = block.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0); + boolean doesSmelt = false; + for(int i = 0; i < drops.size(); i++) { ItemStack stack = drops.get(i).copy(); ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(stack); @@ -305,14 +305,19 @@ public abstract class ToolAbility { result = result.copy(); result.stackSize *= stack.stackSize; drops.set(i, result); + doesSmelt = true; } } - world.setBlockToAir(x, y, z); - player.getHeldItem().damageItem(1, player); + if(doesSmelt) { + world.setBlockToAir(x, y, z); + player.getHeldItem().damageItem(1, player); + + for(ItemStack stack : drops) + world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack.copy())); + } - for(ItemStack stack : drops) - world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack.copy())); + return false; } @Override @@ -339,7 +344,7 @@ public abstract class ToolAbility { public static class ShredderAbility extends ToolAbility { @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { //a band-aid on a gaping wound if(block == Blocks.lit_redstone_ore) @@ -353,6 +358,8 @@ public abstract class ToolAbility { world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, result.copy())); player.getHeldItem().damageItem(1, player); } + + return false; } @Override @@ -379,7 +386,7 @@ public abstract class ToolAbility { public static class CentrifugeAbility extends ToolAbility { @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { //a band-aid on a gaping wound if(block == Blocks.lit_redstone_ore) @@ -397,6 +404,8 @@ public abstract class ToolAbility { world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, st.copy())); } } + + return false; } @Override @@ -423,7 +432,7 @@ public abstract class ToolAbility { public static class CrystallizerAbility extends ToolAbility { @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { //a band-aid on a gaping wound if(block == Blocks.lit_redstone_ore) @@ -437,6 +446,8 @@ public abstract class ToolAbility { world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, result.copy())); player.getHeldItem().damageItem(1, player); } + + return false; } @Override @@ -463,7 +474,7 @@ public abstract class ToolAbility { public static class MercuryAbility extends ToolAbility { @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { //a band-aid on a gaping wound if(block == Blocks.lit_redstone_ore) @@ -481,6 +492,8 @@ public abstract class ToolAbility { world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModItems.ingot_mercury, mercury))); player.getHeldItem().damageItem(1, player); } + + return false; } @Override @@ -513,7 +526,7 @@ public abstract class ToolAbility { } @Override - public void onDigPre(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { + public boolean onDig(World world, int x, int y, int z, EntityPlayer player, Block block, int meta, IItemAbility tool) { ExplosionNT ex = new ExplosionNT(player.worldObj, player, x + 0.5, y + 0.5, z + 0.5, strength); ex.addAttrib(ExAttrib.ALLDROP); @@ -523,6 +536,8 @@ public abstract class ToolAbility { ex.doExplosionB(false); player.worldObj.createExplosion(player, x + 0.5, y + 0.5, z + 0.5, 0.1F, false); + + return true; } @Override diff --git a/src/main/java/com/hbm/handler/guncfg/GunEnergyFactory.java b/src/main/java/com/hbm/handler/guncfg/GunEnergyFactory.java index 7ebb1c831..5b52257b3 100644 --- a/src/main/java/com/hbm/handler/guncfg/GunEnergyFactory.java +++ b/src/main/java/com/hbm/handler/guncfg/GunEnergyFactory.java @@ -37,7 +37,7 @@ public class GunEnergyFactory { config.firingMode = GunConfiguration.FIRE_AUTO; config.allowsInfinity = false; config.ammoCap = 3_000; - config.durability = 30_000; + config.durability = 90_000; config.reloadType = GunConfiguration.RELOAD_FULL; config.crosshair = Crosshair.CIRCLE; diff --git a/src/main/java/com/hbm/interfaces/IPartiallyFillable.java b/src/main/java/com/hbm/interfaces/IPartiallyFillable.java deleted file mode 100644 index f35f1df6a..000000000 --- a/src/main/java/com/hbm/interfaces/IPartiallyFillable.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.hbm.interfaces; - -import com.hbm.inventory.fluid.FluidType; - -import net.minecraft.item.ItemStack; - -@Deprecated -public interface IPartiallyFillable { - - public FluidType getType(ItemStack stack); - - public int getFill(ItemStack stack); - - public void setFill(ItemStack stack, int fill); - - public int getMaxFill(ItemStack stack); - - public int getLoadSpeed(ItemStack stack); - - public int getUnloadSpeed(ItemStack stack); - -} diff --git a/src/main/java/com/hbm/inventory/fluid/Fluids.java b/src/main/java/com/hbm/inventory/fluid/Fluids.java index 810df8eba..867f1789e 100644 --- a/src/main/java/com/hbm/inventory/fluid/Fluids.java +++ b/src/main/java/com/hbm/inventory/fluid/Fluids.java @@ -150,27 +150,27 @@ public class Fluids { BIOGAS = new FluidType("BIOGAS", 0xbfd37c, 1, 4, 1, EnumSymbol.NONE).addTraits(new FT_Flammable(25_000), GASEOUS); BIOFUEL = new FluidType("BIOFUEL", 0xeef274, 1, 2, 0, EnumSymbol.NONE).addContainers(0x9EB623, ExtContainer.CANISTER).addTraits(new FT_Flammable(150_000), new FT_Combustible(FuelGrade.HIGH, 400_000), LIQUID); NITAN = new FluidType("NITAN", 0x8018ad, 2, 4, 1, EnumSymbol.NONE).addContainers(0x6B238C, ExtContainer.CANISTER).addTraits(new FT_Flammable(2_000_000), new FT_Combustible(FuelGrade.HIGH, 5_000_000), LIQUID); - UF6 = new FluidType("UF6", 0xD1CEBE, 4, 0, 2, EnumSymbol.RADIATION).addTraits(new FT_Corrosive(15), GASEOUS); - PUF6 = new FluidType("PUF6", 0x4C4C4C, 4, 0, 4, EnumSymbol.RADIATION).addTraits(new FT_Corrosive(15), GASEOUS); - SAS3 = new FluidType("SAS3", 0x4ffffc, 5, 0, 4, EnumSymbol.RADIATION).addTraits(new FT_Corrosive(30), LIQUID); - SCHRABIDIC = new FluidType("SCHRABIDIC", 0x006B6B, 5, 0, 5, EnumSymbol.ACID).addTraits(new FT_Corrosive(75), LIQUID); + UF6 = new FluidType("UF6", 0xD1CEBE, 4, 0, 2, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.2F), new FT_Corrosive(15), GASEOUS); + PUF6 = new FluidType("PUF6", 0x4C4C4C, 4, 0, 4, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.1F), new FT_Corrosive(15), GASEOUS); + SAS3 = new FluidType("SAS3", 0x4ffffc, 5, 0, 4, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(1F), new FT_Corrosive(30), LIQUID); + SCHRABIDIC = new FluidType("SCHRABIDIC", 0x006B6B, 5, 0, 5, EnumSymbol.ACID).addTraits(new FT_VentRadiation(1F), new FT_Corrosive(75), LIQUID); AMAT = new FluidType("AMAT", 0x010101, 5, 0, 5, EnumSymbol.ANTIMATTER).addTraits(ANTI, GASEOUS); ASCHRAB = new FluidType("ASCHRAB", 0xb50000, 5, 0, 5, EnumSymbol.ANTIMATTER).addTraits(ANTI, GASEOUS); ACID = new FluidType("ACID", 0xfff7aa, 3, 0, 3, EnumSymbol.OXIDIZER).addTraits(new FT_Corrosive(40), LIQUID); WATZ = new FluidType("WATZ", 0x86653E, 4, 0, 3, EnumSymbol.ACID).addTraits(new FT_Corrosive(60), LIQUID); CRYOGEL = new FluidType("CRYOGEL", 0x32ffff, 2, 0, 0, EnumSymbol.CROYGENIC).setTemp(-170).addTraits(LIQUID); - HYDROGEN = new FluidType("HYDROGEN", 0x4286f4, 3, 4, 0, EnumSymbol.CROYGENIC).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), LIQUID, EVAP); - OXYGEN = new FluidType("OXYGEN", 0x98bdf9, 3, 0, 0, EnumSymbol.CROYGENIC).addTraits(LIQUID, EVAP); + HYDROGEN = new FluidType("HYDROGEN", 0x4286f4, 3, 4, 0, EnumSymbol.CROYGENIC).setTemp(-260).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), LIQUID, EVAP); + OXYGEN = new FluidType("OXYGEN", 0x98bdf9, 3, 0, 0, EnumSymbol.CROYGENIC).setTemp(-100).addTraits(LIQUID, EVAP); XENON = new FluidType("XENON", 0xba45e8, 0, 0, 0, EnumSymbol.ASPHYXIANT).addTraits(GASEOUS); BALEFIRE = new FluidType("BALEFIRE", 0x28e02e, 4, 4, 3, EnumSymbol.RADIATION).setTemp(1500).addTraits(new FT_Corrosive(50), new FT_Flammable(1_000_000), new FT_Combustible(FuelGrade.HIGH, 2_500_000), LIQUID); MERCURY = new FluidType("MERCURY", 0x808080, 2, 0, 0, EnumSymbol.NONE).addTraits(LIQUID); PAIN = new FluidType("PAIN", 0x938541, 2, 0, 1, EnumSymbol.ACID).setTemp(300).addTraits(new FT_Corrosive(30)); - WASTEFLUID = new FluidType("WASTEFLUID", 0x544400, 2, 0, 1, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.5F), NOCON); - WASTEGAS = new FluidType("WASTEGAS", 0xB8B8B8, 2, 0, 1, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.5F), NOCON); + WASTEFLUID = new FluidType("WASTEFLUID", 0x544400, 2, 0, 1, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.5F), NOCON, LIQUID); + WASTEGAS = new FluidType("WASTEGAS", 0xB8B8B8, 2, 0, 1, EnumSymbol.RADIATION).addTraits(new FT_VentRadiation(0.5F), NOCON, GASEOUS); GASOLINE = new FluidType("GASOLINE", 0x445772, 1, 2, 0, EnumSymbol.NONE).addContainers(0x2F7747, ExtContainer.CANISTER).addTraits(new FT_Flammable(400_000), new FT_Combustible(FuelGrade.HIGH, 1_000_000), LIQUID); COALGAS = new FluidType("COALGAS", 0x445772, 1, 2, 0, EnumSymbol.NONE).addContainers(0x2E155F, ExtContainer.CANISTER).addTraits(new FT_Flammable(75_000), new FT_Combustible(FuelGrade.MEDIUM, 150_000), LIQUID); - SPENTSTEAM = new FluidType("SPENTSTEAM", 0x445772, 2, 0, 0, EnumSymbol.NONE).setCompression(1D).addTraits(NOCON); - FRACKSOL = new FluidType("FRACKSOL", 0x798A6B, 1, 3, 3, EnumSymbol.ACID).addContainers(0x4F887F, ExtContainer.CANISTER).addTraits(new FT_Corrosive(15)); + SPENTSTEAM = new FluidType("SPENTSTEAM", 0x445772, 2, 0, 0, EnumSymbol.NONE).setCompression(1D).addTraits(NOCON, GASEOUS); + FRACKSOL = new FluidType("FRACKSOL", 0x798A6B, 1, 3, 3, EnumSymbol.ACID).addContainers(0x4F887F, ExtContainer.CANISTER).addTraits(new FT_Corrosive(15), LIQUID); PLASMA_DT = new FluidType("PLASMA_DT", 0xF7AFDE, 0, 4, 0, EnumSymbol.RADIATION).setTemp(3250).addTraits(NOCON, NOID, PLASMA); PLASMA_HD = new FluidType("PLASMA_HD", 0xF0ADF4, 0, 4, 0, EnumSymbol.RADIATION).setTemp(2500).addTraits(NOCON, NOID, PLASMA); PLASMA_HT = new FluidType("PLASMA_HT", 0xD1ABF2, 0, 4, 0, EnumSymbol.RADIATION).setTemp(3000).addTraits(NOCON, NOID, PLASMA); diff --git a/src/main/java/com/hbm/inventory/fluid/trait/FT_VentRadiation.java b/src/main/java/com/hbm/inventory/fluid/trait/FT_VentRadiation.java index 9126aea5d..64c4c5072 100644 --- a/src/main/java/com/hbm/inventory/fluid/trait/FT_VentRadiation.java +++ b/src/main/java/com/hbm/inventory/fluid/trait/FT_VentRadiation.java @@ -13,6 +13,10 @@ public class FT_VentRadiation extends FluidTrait { this.radPerMB = rad; } + public float getRadPerMB() { + return this.radPerMB; + } + @Override public void onFluidRelease(World world, int x, int y, int z, FluidTank tank, int overflowAmount) { ChunkRadiationManager.proxy.incrementRad(world, x, y, z, overflowAmount * radPerMB); diff --git a/src/main/java/com/hbm/inventory/fluid/trait/FluidTraitSimple.java b/src/main/java/com/hbm/inventory/fluid/trait/FluidTraitSimple.java index 8cceb5db3..8afc8ee8f 100644 --- a/src/main/java/com/hbm/inventory/fluid/trait/FluidTraitSimple.java +++ b/src/main/java/com/hbm/inventory/fluid/trait/FluidTraitSimple.java @@ -27,7 +27,7 @@ public class FluidTraitSimple { } public static class FT_Amat extends FluidTrait { - @Override public void addInfoHidden(List info) { + @Override public void addInfo(List info) { info.add(EnumChatFormatting.DARK_RED + "[Antimatter]"); } } @@ -37,8 +37,11 @@ public class FluidTraitSimple { info.add(EnumChatFormatting.DARK_RED + "[Requires hazardous material tank to hold]"); } } + public static class FT_Delicious extends FluidTrait { + @Override public void addInfoHidden(List info) { + info.add(EnumChatFormatting.DARK_GREEN + "[Delicious]"); + }} public static class FT_NoID extends FluidTrait { } public static class FT_NoContainer extends FluidTrait { } - public static class FT_Delicious extends FluidTrait { } } diff --git a/src/main/java/com/hbm/items/IHeldSoundProvider.java b/src/main/java/com/hbm/items/IHeldSoundProvider.java new file mode 100644 index 000000000..3549e6df4 --- /dev/null +++ b/src/main/java/com/hbm/items/IHeldSoundProvider.java @@ -0,0 +1,5 @@ +package com.hbm.items; + +public interface IHeldSoundProvider { + +} diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 12a1cb086..2bd682de5 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -5182,7 +5182,7 @@ public class ModItems { jackt = new ModArmor(MainRegistry.aMatSteel, 7, 1).setUnlocalizedName("jackt").setTextureName(RefStrings.MODID + ":jackt"); jackt2 = new ModArmor(MainRegistry.aMatSteel, 7, 1).setUnlocalizedName("jackt2").setTextureName(RefStrings.MODID + ":jackt2"); - chainsaw = new ItemToolAbilityFueled(25, -0.05, MainRegistry.tMatChainsaw, EnumToolType.AXE, 5000, 1, 250, + chainsaw = new ItemChainsaw(25, -0.05, MainRegistry.tMatChainsaw, EnumToolType.AXE, 5000, 1, 250, Fluids.DIESEL, Fluids.DIESEL_CRACK, Fluids.KEROSENE, Fluids.BIOFUEL, Fluids.GASOLINE, Fluids.GASOLINE_LEADED, Fluids.PETROIL, Fluids.PETROIL_LEADED, Fluids.COALGAS, Fluids.COALGAS_LEADED) .addBreakAbility(new ToolAbility.SilkAbility()) .addBreakAbility(new ToolAbility.RecursionAbility(5)) diff --git a/src/main/java/com/hbm/items/armor/ArmorFSB.java b/src/main/java/com/hbm/items/armor/ArmorFSB.java index 5da09df69..73f20974c 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSB.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSB.java @@ -433,7 +433,7 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel { if(!chestplate.effects.isEmpty()) { for(PotionEffect i : chestplate.effects) { - player.addPotionEffect(new PotionEffect(i.getPotionID(), i.getDuration(), i.getAmplifier(), i.getIsAmbient())); + player.addPotionEffect(new PotionEffect(i.getPotionID(), i.getDuration(), i.getAmplifier(), true)); } } diff --git a/src/main/java/com/hbm/items/armor/JetpackBase.java b/src/main/java/com/hbm/items/armor/JetpackBase.java index c701fecc5..c036d3ad6 100644 --- a/src/main/java/com/hbm/items/armor/JetpackBase.java +++ b/src/main/java/com/hbm/items/armor/JetpackBase.java @@ -3,12 +3,12 @@ package com.hbm.items.armor; import java.util.List; import com.hbm.handler.ArmorModHandler; -import com.hbm.interfaces.IPartiallyFillable; import com.hbm.inventory.fluid.FluidType; import com.hbm.render.model.ModelJetPack; import com.hbm.util.ArmorUtil; import com.hbm.util.I18nUtil; +import api.hbm.fluid.IFillableItem; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; @@ -24,7 +24,7 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.RenderPlayerEvent; -public abstract class JetpackBase extends ItemArmorMod implements IPartiallyFillable { +public abstract class JetpackBase extends ItemArmorMod implements IFillableItem { private ModelJetPack model; public FluidType fuel; @@ -138,33 +138,43 @@ public abstract class JetpackBase extends ItemArmorMod implements IPartiallyFill } - @Override - public FluidType getType(ItemStack stack) { - return fuel; - } - - @Override - public int getFill(ItemStack stack) { - return this.getFuel(stack); - } - - @Override - public void setFill(ItemStack stack, int fill) { - this.setFuel(stack, fill); - } - - @Override public int getMaxFill(ItemStack stack) { return this.maxFuel; } - @Override public int getLoadSpeed(ItemStack stack) { return 10; } @Override - public int getUnloadSpeed(ItemStack stack) { + public boolean acceptsFluid(FluidType type, ItemStack stack) { + return type == this.fuel; + } + + @Override + public int tryFill(FluidType type, int amount, ItemStack stack) { + + if(!acceptsFluid(type, stack)) + return amount; + + int fill = this.getFuel(stack); + int req = maxFuel - fill; + + int toFill = Math.min(amount, req); + //toFill = Math.min(toFill, getLoadSpeed(stack)); + + this.setFuel(stack, fill + toFill); + + return amount - toFill; + } + + @Override + public boolean providesFluid(FluidType type, ItemStack stack) { + return false; + } + + @Override + public int tryEmpty(FluidType type, int amount, ItemStack stack) { return 0; } } diff --git a/src/main/java/com/hbm/items/block/ItemBlockLore.java b/src/main/java/com/hbm/items/block/ItemBlockLore.java index c83b5293b..5be85c400 100644 --- a/src/main/java/com/hbm/items/block/ItemBlockLore.java +++ b/src/main/java/com/hbm/items/block/ItemBlockLore.java @@ -12,7 +12,7 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; -public class ItemBlockLore extends ItemBlock { +public class ItemBlockLore extends ItemBlockBase { public ItemBlockLore(Block p_i45328_1_) { super(p_i45328_1_); @@ -20,6 +20,7 @@ public class ItemBlockLore extends ItemBlock { @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) { + super.addInformation(itemstack, player, list, bool); if(this.field_150939_a instanceof RedBarrel) { list.add("Static fluid barrel"); diff --git a/src/main/java/com/hbm/items/special/ItemSyringe.java b/src/main/java/com/hbm/items/special/ItemSyringe.java index b14fddcd3..d50a57074 100644 --- a/src/main/java/com/hbm/items/special/ItemSyringe.java +++ b/src/main/java/com/hbm/items/special/ItemSyringe.java @@ -6,13 +6,13 @@ import java.util.Random; import com.hbm.config.VersatileConfig; import com.hbm.extprop.HbmLivingProps; import com.hbm.handler.ArmorModHandler; -import com.hbm.interfaces.IPartiallyFillable; import com.hbm.inventory.fluid.Fluids; import com.hbm.items.ModItems; import com.hbm.items.weapon.ItemGunBase; import com.hbm.lib.ModDamageSource; import com.hbm.potion.HbmPotion; +import api.hbm.fluid.IFillableItem; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.EntityLivingBase; @@ -279,16 +279,15 @@ public class ItemSyringe extends Item { jetpack = ArmorModHandler.pryMods(jetpack)[ArmorModHandler.plate_only]; } - if(jetpack == null || !(jetpack.getItem() instanceof IPartiallyFillable)) + if(jetpack == null || !(jetpack.getItem() instanceof IFillableItem)) return stack; - IPartiallyFillable fillable = (IPartiallyFillable) jetpack.getItem(); + IFillableItem fillable = (IFillableItem) jetpack.getItem(); - if(fillable.getType(jetpack) != Fluids.KEROSENE) + if(!fillable.acceptsFluid(Fluids.KEROSENE, jetpack)) return stack; - int fill = Math.min(fillable.getFill(jetpack) + 1000, fillable.getMaxFill(jetpack)); - fillable.setFill(jetpack, fill); + fillable.tryFill(Fluids.KEROSENE, 1000, jetpack); if(jetpack.getItem() != player.inventory.armorInventory[2].getItem()) ArmorModHandler.applyMod(player.inventory.armorInventory[2], jetpack); diff --git a/src/main/java/com/hbm/items/tool/IItemAbility.java b/src/main/java/com/hbm/items/tool/IItemAbility.java index 00f5cefab..ca8a33b4b 100644 --- a/src/main/java/com/hbm/items/tool/IItemAbility.java +++ b/src/main/java/com/hbm/items/tool/IItemAbility.java @@ -86,4 +86,52 @@ public interface IItemAbility { Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C07PacketPlayerDigging(2, x, y, z, Minecraft.getMinecraft().objectMouseOver.sideHit)); } } + + public static void standardDigPost(World world, int x, int y, int z, EntityPlayerMP player) { + + Block block = world.getBlock(x, y, z); + int l = world.getBlockMetadata(x, y, z); + world.playAuxSFXAtEntity(player, 2001, x, y, z, Block.getIdFromBlock(block) + (world.getBlockMetadata(x, y, z) << 12)); + boolean flag = false; + + if(player.capabilities.isCreativeMode) { + flag = removeBlock(world, x, y, z, false, player); + player.playerNetServerHandler.sendPacket(new S23PacketBlockChange(x, y, z, world)); + } else { + ItemStack itemstack = player.getCurrentEquippedItem(); + boolean flag1 = block.canHarvestBlock(player, l); + + if(itemstack != null) { + itemstack.func_150999_a(world, block, x, y, z, player); + + if(itemstack.stackSize == 0) { + player.destroyCurrentEquippedItem(); + } + } + + flag = removeBlock(world, x, y, z, flag1, player); + if(flag && flag1) { + block.harvestBlock(world, player, x, y, z, l); + } + } + + /* + * // Drop experience if (!player.capabilities.isCreativeMode && flag && + * event != null) { block.dropXpOnBlockBreak(world, x, y, z, + * event.getExpToDrop()); } + */ + } + + public static boolean removeBlock(World world, int x, int y, int z, boolean canHarvest, EntityPlayerMP player) { + Block block = world.getBlock(x, y, z); + int l = world.getBlockMetadata(x, y, z); + block.onBlockHarvested(world, x, y, z, l, player); + boolean flag = block.removedByPlayer(world, player, x, y, z, canHarvest); + + if(flag) { + block.onBlockDestroyedByPlayer(world, x, y, z, l); + } + + return flag; + } } diff --git a/src/main/java/com/hbm/items/tool/ItemChainsaw.java b/src/main/java/com/hbm/items/tool/ItemChainsaw.java new file mode 100644 index 000000000..a2d4dfb38 --- /dev/null +++ b/src/main/java/com/hbm/items/tool/ItemChainsaw.java @@ -0,0 +1,35 @@ +package com.hbm.items.tool; + +import com.hbm.inventory.fluid.FluidType; +import com.hbm.items.IHeldSoundProvider; +import com.hbm.packet.AuxParticlePacketNT; +import com.hbm.packet.PacketDispatcher; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public class ItemChainsaw extends ItemToolAbilityFueled implements IHeldSoundProvider { + + public ItemChainsaw(float damage, double movement, ToolMaterial material, EnumToolType type, int maxFuel, int consumption, int fillRate, FluidType... acceptedFuels) { + super(damage, movement, material, type, maxFuel, consumption, fillRate, acceptedFuels); + } + + @Override + public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) { + + if(!(entityLiving instanceof EntityPlayerMP)) + return false; + + if(stack.getItemDamage() >= stack.getMaxDamage()) + return false; + + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setString("type", "anim"); + nbt.setString("mode", "sSwing"); + PacketDispatcher.wrapper.sendTo(new AuxParticlePacketNT(nbt, 0, 0, 0), (EntityPlayerMP)entityLiving); + + return false; + } +} diff --git a/src/main/java/com/hbm/items/tool/ItemToolAbility.java b/src/main/java/com/hbm/items/tool/ItemToolAbility.java index accb7ba63..8497d24ce 100644 --- a/src/main/java/com/hbm/items/tool/ItemToolAbility.java +++ b/src/main/java/com/hbm/items/tool/ItemToolAbility.java @@ -130,7 +130,7 @@ public class ItemToolAbility extends ItemTool implements IItemAbility, IDepthRoc int meta = world.getBlockMetadata(x, y, z); if(!world.isRemote && canHarvestBlock(block, stack) && this.getCurrentAbility(stack) != null && canOperate(stack)) - this.getCurrentAbility(stack).onDigPre(world, x, y, z, player, block, meta, this); + return this.getCurrentAbility(stack).onDig(world, x, y, z, player, block, meta, this); return false; } @@ -274,7 +274,7 @@ public class ItemToolAbility extends ItemTool implements IItemAbility, IDepthRoc stack.stackTagCompound.setInteger("ability", ability); } - protected boolean canOperate(ItemStack stack) { + public boolean canOperate(ItemStack stack) { return true; } diff --git a/src/main/java/com/hbm/items/tool/ItemToolAbilityFueled.java b/src/main/java/com/hbm/items/tool/ItemToolAbilityFueled.java index 3af794c96..fd116a9b0 100644 --- a/src/main/java/com/hbm/items/tool/ItemToolAbilityFueled.java +++ b/src/main/java/com/hbm/items/tool/ItemToolAbilityFueled.java @@ -55,7 +55,7 @@ public class ItemToolAbilityFueled extends ItemToolAbility implements IFillableI } @Override - protected boolean canOperate(ItemStack stack) { + public boolean canOperate(ItemStack stack) { return getFill(stack) >= this.consumption; } diff --git a/src/main/java/com/hbm/items/tool/ItemToolAbilityPower.java b/src/main/java/com/hbm/items/tool/ItemToolAbilityPower.java index 865d5d5af..80fb5fa87 100644 --- a/src/main/java/com/hbm/items/tool/ItemToolAbilityPower.java +++ b/src/main/java/com/hbm/items/tool/ItemToolAbilityPower.java @@ -97,7 +97,7 @@ public class ItemToolAbilityPower extends ItemToolAbility implements IBatteryIte } @Override - protected boolean canOperate(ItemStack stack) { + public boolean canOperate(ItemStack stack) { return getCharge(stack) >= this.consumption; } diff --git a/src/main/java/com/hbm/items/weapon/ItemGunChemthrower.java b/src/main/java/com/hbm/items/weapon/ItemGunChemthrower.java index eea0f648a..04f029d2a 100644 --- a/src/main/java/com/hbm/items/weapon/ItemGunChemthrower.java +++ b/src/main/java/com/hbm/items/weapon/ItemGunChemthrower.java @@ -3,15 +3,13 @@ package com.hbm.items.weapon; import java.util.List; import com.hbm.config.GeneralConfig; -import com.hbm.handler.BulletConfigSyncingUtil; -import com.hbm.handler.BulletConfiguration; +import com.hbm.entity.projectile.EntityChemical; import com.hbm.handler.GunConfiguration; import com.hbm.handler.guncfg.GunEnergyFactory; import com.hbm.interfaces.IHoldableWeapon; import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.Fluids; import com.hbm.items.machine.ItemFluidIcon; -import com.hbm.packet.AuxParticlePacketNT; import com.hbm.packet.GunAnimationPacket; import com.hbm.packet.PacketDispatcher; import com.hbm.render.anim.HbmAnimations.AnimType; @@ -28,7 +26,6 @@ import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType; @@ -43,8 +40,6 @@ public class ItemGunChemthrower extends ItemGunBase implements IFillableItem { @Override protected void fire(ItemStack stack, World world, EntityPlayer player) { - System.out.println("nuts"); - if(!hasAmmo(stack, player, true)) return; @@ -99,6 +94,10 @@ public class ItemGunChemthrower extends ItemGunBase implements IFillableItem { //spawn fluid projectile + EntityChemical chem = new EntityChemical(world, player); + chem.setFluid(this.getFluidType(stack)); + world.spawnEntityInWorld(chem); + if(player instanceof EntityPlayerMP) PacketDispatcher.wrapper.sendTo(new GunAnimationPacket(AnimType.CYCLE.ordinal()), (EntityPlayerMP) player); } diff --git a/src/main/java/com/hbm/lib/ModDamageSource.java b/src/main/java/com/hbm/lib/ModDamageSource.java index 0c5e3ba5a..a477d929c 100644 --- a/src/main/java/com/hbm/lib/ModDamageSource.java +++ b/src/main/java/com/hbm/lib/ModDamageSource.java @@ -65,6 +65,8 @@ public class ModDamageSource extends DamageSource { public static final String s_immolator = "plasma"; public static final String s_cryolator = "ice"; public static final String s_laser = "laser"; + public static final String s_boil = "boil"; + public static final String s_acid = "acidPlayer"; public ModDamageSource(String p_i1566_1_) { super(p_i1566_1_); diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 7734a8c20..867d48a7e 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (4327)"; + public static final String VERSION = "1.0.27 BETA (4333)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index 72809337b..a570423a0 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -410,6 +410,7 @@ public class ClientProxy extends ServerProxy { MinecraftForgeClient.registerItemRenderer(ModItems.diamond_gavel, new ItemRenderGavel()); MinecraftForgeClient.registerItemRenderer(ModItems.mese_gavel, new ItemRenderGavel()); MinecraftForgeClient.registerItemRenderer(ModItems.crucible, new ItemRenderCrucible()); + MinecraftForgeClient.registerItemRenderer(ModItems.chainsaw, new ItemRenderChainsaw()); //guns MinecraftForgeClient.registerItemRenderer(ModItems.gun_rpg, new ItemRenderRpg()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_karl, new ItemRenderRpg()); @@ -556,6 +557,7 @@ public class ClientProxy extends ServerProxy { RenderingRegistry.registerEntityRenderingHandler(EntityZirnoxDebris.class, new RenderZirnoxDebris()); RenderingRegistry.registerEntityRenderingHandler(EntityArtilleryShell.class, new RenderArtilleryShell()); RenderingRegistry.registerEntityRenderingHandler(EntityCog.class, new RenderCog()); + RenderingRegistry.registerEntityRenderingHandler(EntityChemical.class, new RenderChemical()); //grenades RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeGeneric.class, new RenderSnowball(ModItems.grenade_generic)); RenderingRegistry.registerEntityRenderingHandler(EntityGrenadeStrong.class, new RenderSnowball(ModItems.grenade_strong)); @@ -1137,6 +1139,14 @@ public class ClientProxy extends ServerProxy { fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(20), "particleMaxAge", "field_70547_e"); } + + if("colordust".equals(data.getString("mode"))) { + + Block b = Blocks.wool; + fx = new net.minecraft.client.particle.EntityBlockDustFX(world, x, y, z, mX, mY + 0.2, mZ, b, 0); + fx.setRBGColorF(data.getFloat("r"), data.getFloat("g"), data.getFloat("b")); + ReflectionHelper.setPrivateValue(EntityFX.class, fx, 10 + rand.nextInt(20), "particleMaxAge", "field_70547_e"); + } if(fx != null) { @@ -1637,6 +1647,50 @@ public class ClientProxy extends ServerProxy { HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); } } + + if("sSwing".equals(data.getString("mode"))) { + + int forward = 150; + int sideways = 100; + int retire = 200; + + if(HbmAnimations.getRelevantAnim() == null) { + + BusAnimation animation = new BusAnimation() + .addBus("SWING_ROT", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(0, 0, 90, forward)) + .addKeyframe(new BusAnimationKeyframe(45, 0, 90, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))) + .addBus("SWING_TRANS", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(0, 0, 3, forward)) + .addKeyframe(new BusAnimationKeyframe(2, 0, 2, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))); + + + HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); + + } else { + + double[] rot = HbmAnimations.getRelevantTransformation("SWING_ROT"); + double[] trans = HbmAnimations.getRelevantTransformation("SWING_TRANS"); + + if(System.currentTimeMillis() - HbmAnimations.getRelevantAnim().startMillis < 50) return; + + BusAnimation animation = new BusAnimation() + .addBus("SWING_ROT", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(rot[0], rot[1], rot[2], 0)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 90, forward)) + .addKeyframe(new BusAnimationKeyframe(45, 0, 90, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))) + .addBus("SWING_TRANS", new BusAnimationSequence() + .addKeyframe(new BusAnimationKeyframe(trans[0], trans[1], trans[2], 0)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 3, forward)) + .addKeyframe(new BusAnimationKeyframe(2, 0, 2, sideways)) + .addKeyframe(new BusAnimationKeyframe(0, 0, 0, retire))); + + HbmAnimations.hotbar[player.inventory.currentItem] = new Animation(player.getHeldItem().getItem().getUnlocalizedName(), System.currentTimeMillis(), animation); + } + } } if("tau".equals(type)) { diff --git a/src/main/java/com/hbm/main/ModEventHandlerClient.java b/src/main/java/com/hbm/main/ModEventHandlerClient.java index ca1f2767e..2432a68ce 100644 --- a/src/main/java/com/hbm/main/ModEventHandlerClient.java +++ b/src/main/java/com/hbm/main/ModEventHandlerClient.java @@ -76,7 +76,6 @@ import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.AbstractClientPlayer; -import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.multiplayer.WorldClient; import net.minecraft.client.renderer.OpenGlHelper; diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index 149248f01..3de95a373 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -655,6 +655,7 @@ public class ResourceManager { public static final IModelCustom pch = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/pch.obj")); public static final IModelCustom gavel = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/gavel.obj")); public static final IModelCustom crucible = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/crucible.obj")); + public static final IModelCustom chainsaw = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/chainsaw.obj"), false); public static final IModelCustom brimstone = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/brimstone.obj")); public static final IModelCustom hk69 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/hk69.obj")); @@ -723,6 +724,7 @@ public class ResourceManager { public static final ResourceLocation crucible_hilt = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_hilt.png"); public static final ResourceLocation crucible_guard = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_guard.png"); public static final ResourceLocation crucible_blade = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/crucible_blade.png"); + public static final ResourceLocation chainsaw_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/chainsaw.png"); public static final ResourceLocation brimstone_tex = new ResourceLocation(RefStrings.MODID, "textures/models/brimstone.png"); public static final ResourceLocation hk69_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/hk69.png"); diff --git a/src/main/java/com/hbm/render/entity/projectile/RenderChemical.java b/src/main/java/com/hbm/render/entity/projectile/RenderChemical.java new file mode 100644 index 000000000..fc6fa00af --- /dev/null +++ b/src/main/java/com/hbm/render/entity/projectile/RenderChemical.java @@ -0,0 +1,170 @@ +package com.hbm.render.entity.projectile; + +import java.awt.Color; + +import org.lwjgl.opengl.GL11; + +import com.hbm.entity.projectile.EntityChemical; +import com.hbm.entity.projectile.EntityChemical.ChemicalStyle; +import com.hbm.lib.RefStrings; + +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.entity.Render; +import net.minecraft.entity.Entity; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.Vec3; + +public class RenderChemical extends Render { + + private static ResourceLocation gas = new ResourceLocation(RefStrings.MODID + ":textures/particle/particle_base.png"); + + @Override + public void doRender(Entity entity, double x, double y, double z, float f0, float f1) { + + GL11.glPushMatrix(); + GL11.glTranslated(x, y, z); + + EntityChemical chem = (EntityChemical) entity; + ChemicalStyle style = chem.getStyle(); + + if(style == ChemicalStyle.AMAT) + renderAmatBeam(chem, f1); + + if(style == ChemicalStyle.GAS) { + this.bindEntityTexture(chem); + renderGasCloud(chem, f1); + } + + if(style == ChemicalStyle.GASFLAME) { + this.bindEntityTexture(chem); + renderGasFire(chem, f1); + } + + GL11.glPopMatrix(); + } + + private void renderGasFire(EntityChemical chem, float interp) { + + float exp = (float) (chem.ticksExisted + interp) / (float) chem.getMaxAge(); + double size = 0.0 + exp * 2; + Color color = Color.getHSBColor(Math.max((60 - exp * 100) / 360F, 0.0F), 1 - exp * 0.25F, 1 - exp * 0.5F); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDepthMask(false); + + Tessellator tess = Tessellator.instance; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + tess.startDrawingQuads(); + tess.setNormal(0.0F, 1.0F, 0.0F); + tess.setColorRGBA_I(color.getRGB(), (int) Math.max(255 * (1 - exp), 0)); + tess.addVertexWithUV(-size, -size, 0.0D, 1, 1); + tess.addVertexWithUV(size, -size, 0.0D, 0, 1); + tess.addVertexWithUV(size, size, 0.0D, 0, 0); + tess.addVertexWithUV(-size, size, 0.0D, 1, 0); + tess.draw(); + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F); + } + + private void renderGasCloud(EntityChemical chem, float interp) { + + double exp = (double) (chem.ticksExisted + interp) / (double) chem.getMaxAge(); + double size = 0.0 + exp * 10; + int color = chem.getType().getColor(); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GREATER, 0); + OpenGlHelper.glBlendFunc(770, 771, 1, 0); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glDepthMask(false); + + Tessellator tess = Tessellator.instance; + GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); + tess.startDrawingQuads(); + tess.setNormal(0.0F, 1.0F, 0.0F); + tess.setColorRGBA_I(color, (int) Math.max(127 * (1 - exp), 0)); + tess.addVertexWithUV(-size, -size, 0.0D, 1, 1); + tess.addVertexWithUV(size, -size, 0.0D, 0, 1); + tess.addVertexWithUV(size, size, 0.0D, 0, 0); + tess.addVertexWithUV(-size, size, 0.0D, 1, 0); + tess.draw(); + + GL11.glDepthMask(true); + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glDisable(GL11.GL_BLEND); + GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F); + } + + private void renderAmatBeam(EntityChemical chem, float interp) { + + float yaw = chem.prevRotationYaw + (chem.rotationYaw - chem.prevRotationYaw) * interp; + float pitch = chem.prevRotationPitch + (chem.rotationPitch - chem.prevRotationPitch) * interp; + GL11.glRotatef(yaw, 0.0F, 1.0F, 0.0F); + GL11.glRotatef(-pitch - 90, 1.0F, 0.0F, 0.0F); + + GL11.glDisable(GL11.GL_TEXTURE_2D); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glDisable(GL11.GL_ALPHA_TEST); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glDepthMask(false); + + double length = Vec3.createVectorHelper(chem.motionX, chem.motionY, chem.motionZ).lengthVector() * (chem.ticksExisted + interp) * 0.75; + double size = 0.0625; + float o = 0.2F; + + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); + + tess.setColorRGBA_F(1F, 1F, 1F, o); + tess.addVertex(-size, 0, -size); + tess.addVertex(size, 0, -size); + tess.setColorRGBA_F(1F, 1F, 1F, 0.0F); + tess.addVertex(size, length, -size); + tess.addVertex(-size, length, -size); + + tess.setColorRGBA_F(1F, 1F, 1F, o); + tess.addVertex(-size, 0, size); + tess.addVertex(size, 0, size); + tess.setColorRGBA_F(1F, 1F, 1F, 0.0F); + tess.addVertex(size, length, size); + tess.addVertex(-size, length, size); + + tess.setColorRGBA_F(1F, 1F, 1F, o); + tess.addVertex(-size, 0, -size); + tess.addVertex(-size, 0, size); + tess.setColorRGBA_F(1F, 1F, 1F, 0.0F); + tess.addVertex(-size, length, size); + tess.addVertex(-size, length, -size); + + tess.setColorRGBA_F(1F, 1F, 1F, o); + tess.addVertex(size, 0, -size); + tess.addVertex(size, 0, size); + tess.setColorRGBA_F(1F, 1F, 1F, 0.0F); + tess.addVertex(size, length, size); + tess.addVertex(size, length, -size); + + tess.draw(); + + GL11.glDepthMask(true); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glEnable(GL11.GL_ALPHA_TEST); + } + + @Override + protected ResourceLocation getEntityTexture(Entity entity) { + return gas; + } +} diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderChainsaw.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderChainsaw.java new file mode 100644 index 000000000..2f3aecabe --- /dev/null +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderChainsaw.java @@ -0,0 +1,131 @@ +package com.hbm.render.item.weapon; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + +import com.hbm.handler.BulletConfigSyncingUtil; +import com.hbm.items.ModItems; +import com.hbm.items.tool.ItemToolAbilityFueled; +import com.hbm.items.weapon.ItemGunBase; +import com.hbm.main.ResourceManager; +import com.hbm.render.anim.HbmAnimations; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MathHelper; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.IItemRenderer.ItemRenderType; +import net.minecraftforge.client.IItemRenderer.ItemRendererHelper; + +public class ItemRenderChainsaw implements IItemRenderer { + + public ItemRenderChainsaw() { } + + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + switch(type) { + case EQUIPPED: + case EQUIPPED_FIRST_PERSON: + case ENTITY: + case INVENTORY: + return true; + default: return false; + } + } + + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + + return type == ItemRenderType.ENTITY && (helper == ItemRendererHelper.ENTITY_ROTATION || helper == ItemRendererHelper.ENTITY_BOBBING); + } + + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + + GL11.glPushMatrix(); + + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + + GL11.glEnable(GL11.GL_CULL_FACE); + Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.chainsaw_tex); + + switch(type) { + + case EQUIPPED_FIRST_PERSON: + + player.isSwingInProgress = false; + + double s0 = 0.35D; + GL11.glTranslated(0.5, 0.25, -0.25F); + GL11.glRotated(45, 0, 0, 1); + GL11.glRotated(80, 0, 1, 0); + GL11.glScaled(s0, s0, s0); + + if(!player.isBlocking()) { + double[] sRot = HbmAnimations.getRelevantTransformation("SWING_ROT"); + double[] sTrans = HbmAnimations.getRelevantTransformation("SWING_TRANS"); + GL11.glTranslated(sTrans[0], sTrans[1], sTrans[2]); + GL11.glRotated(sRot[2], 0, 0, 1); + GL11.glRotated(sRot[1], 0, 1, 0); + GL11.glRotated(sRot[0], 1, 0, 0); + } + + break; + + case EQUIPPED: + + double scale = -0.375D; + GL11.glScaled(scale, scale, scale); + GL11.glRotated(85, 0, 1, 0); + GL11.glRotated(135D, 1.0D, 0.0D, 0.0D); + GL11.glTranslated(-0.125, -2.0, 1.75); + + break; + + case ENTITY: + + double s1 = 0.5D; + GL11.glScaled(s1, s1, s1); + break; + + case INVENTORY: + + GL11.glEnable(GL11.GL_ALPHA_TEST); + GL11.glEnable(GL11.GL_LIGHTING); + + double s = 4D; + GL11.glTranslated(8, 10, 0); + GL11.glRotated(-90, 0, 1, 0); + GL11.glRotated(-135, 1, 0, 0); + GL11.glScaled(s, s, -s); + + break; + + default: break; + } + + ResourceManager.chainsaw.renderPart("Saw"); + + for(int i = 0; i < 20; i++) { + + double run = ((ItemToolAbilityFueled) item.getItem()).canOperate(item) ? System.currentTimeMillis() % 100D * 0.25D / 100D : 0.0625D; + double forward = i * 0.25 + (run) - 2.0625; + + GL11.glPushMatrix(); + + GL11.glTranslated(0, 0, 1.9375); + GL11.glTranslated(0, 0.375, 0.5625); + double angle = MathHelper.clamp_double(forward, 0, 0.25 * Math.PI); + GL11.glRotated(angle * 180D / (Math.PI * 0.25), 1, 0, 0); + GL11.glTranslated(0, -0.375, -0.5625); + if(forward < 0) GL11.glTranslated(0, 0, forward); + if(forward > Math.PI * 0.25) GL11.glTranslated(0, 0, forward - Math.PI * 0.25); + ResourceManager.chainsaw.renderPart("Tooth"); + GL11.glPopMatrix(); + } + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponChemthrower.java b/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponChemthrower.java index 6cca2ee0b..4996d353e 100644 --- a/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponChemthrower.java +++ b/src/main/java/com/hbm/render/item/weapon/ItemRenderWeaponChemthrower.java @@ -52,18 +52,18 @@ public class ItemRenderWeaponChemthrower implements IItemRenderer { case EQUIPPED: - double scale = 0.125D; + double scale = 0.25D; GL11.glScaled(scale, scale, scale); - GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(10, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(15F, 1.0F, 0.0F, 0.0F); - GL11.glTranslatef(4F, -2F, 5F); + GL11.glRotated(100, 0, 1, 0); + GL11.glRotated(-10, 1, 0, 0); + GL11.glRotated(10, 0, 0, 1); + GL11.glTranslatef(-0.25F, -2.5F, 1.75F); break; case ENTITY: - double s1 = 0.1D; + double s1 = 0.25D; GL11.glScaled(s1, s1, s1); break; diff --git a/src/main/java/com/hbm/tileentity/IPersistentNBT.java b/src/main/java/com/hbm/tileentity/IPersistentNBT.java index 61195a6c0..fe9b5e835 100644 --- a/src/main/java/com/hbm/tileentity/IPersistentNBT.java +++ b/src/main/java/com/hbm/tileentity/IPersistentNBT.java @@ -18,8 +18,10 @@ public interface IPersistentNBT { public default ArrayList getDrops(Block b) { ArrayList list = new ArrayList(); ItemStack stack = new ItemStack(b); - stack.stackTagCompound = new NBTTagCompound(); - writeNBT(stack.stackTagCompound); + NBTTagCompound data = new NBTTagCompound(); + writeNBT(data); + if(!data.hasNoTags()) + stack.stackTagCompound = data; list.add(stack); return list; } diff --git a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java index 4d4256312..0eaca905a 100644 --- a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java +++ b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityBarrel.java @@ -224,6 +224,7 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc @Override public void writeNBT(NBTTagCompound nbt) { + if(tank.getFill() == 0) return; NBTTagCompound data = new NBTTagCompound(); this.tank.writeToNBT(data, "tank"); data.setShort("mode", mode); diff --git a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java index a2d8df30a..264b154d8 100644 --- a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java +++ b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMachineFluidTank.java @@ -211,6 +211,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements @Override public void writeNBT(NBTTagCompound nbt) { + if(tank.getFill() == 0) return; NBTTagCompound data = new NBTTagCompound(); this.tank.writeToNBT(data, "tank"); data.setShort("mode", mode); diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 2f10c0958..03636b45b 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -356,13 +356,15 @@ container.watzPowerplant=Watzkraftwerk container.zirnox=ZIRNOX Atomreaktor death.attack.acid=%1$s fiel in Säure. +death.attack.acidPlayer=%1$s wurde von %2$s aufgelöst. death.attack.ams=%1$s wurde in tödlichen Teilchen gebadet, die von der Menschheit erst benannt werden müssen. death.attack.amsCore=%1$s wurde vom Feuer einer Singularität verdampft. death.attack.asbestos=%1$s hat sich für finanzielle Entschädigung qualifiziert. death.attack.bang=%1$s wurde in mundgerechte Stücke zerfetzt. death.attack.blackhole=%1$s wurde spaghettifiziert. death.attack.blender=%1$s wurde in kleine, mundgerechte Stücke geschnitten. -death.attack.boat=%1$s wurde von Schiff erschlagen. +death.attack.boat=%1$s wurde von einem Schiff erschlagen. +death.attack.boil=%1$s wurde von %2$s lebend gekocht. death.attack.boxcar=%1$s wurde von einem fallenden Güterwagon zermatscht. Autsch! death.attack.broadcast=%1$s wurde das Gehirn geschmolzen. death.attack.building=%1$s wurde von einem Gebäude zermatscht. @@ -1527,6 +1529,7 @@ item.gun_bolter_digamma.name=Digammagewehr item.gun_calamity.name=Knochensäge item.gun_calamity_ammo.name=.50 BMG Patrone (LEGACY) item.gun_calamity_dual.name=Sattelkanone +item.gun_chemthrower.name=Chemowerfer item.gun_cryolator.name=Der Cryolator item.gun_cryolator_ammo.name=Kryozelle item.gun_dampfmaschine.name=Garantiert keine Scherzwaffe diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 8aa4b70a9..75ad64d4d 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -547,6 +547,7 @@ container.watzPowerplant=Watz Power Plant container.zirnox=ZIRNOX Nuclear Reactor death.attack.acid=%1$s fell into acid. +death.attack.acidPlayer=%1$s was dissolved by %2$s. death.attack.ams=%1$s was bathed in deadly particles that have yet to be named by human science. death.attack.amsCore=%1$s was vaporized in the fire of a singularity. death.attack.asbestos=%1$s is now entitled to financial compensation. @@ -554,6 +555,7 @@ death.attack.bang=%1$s was blasted into bite-sized pieces. death.attack.blackhole=%1$s was spaghettified. death.attack.blender=%1$s was chopped in small, bite-sized pieces. death.attack.boat=%1$s was hit by a boat. +death.attack.boil=%1$s was boiled alive by %2$s. death.attack.boxcar=%1$s was smushed by a falling boxcar. Oh well. death.attack.broadcast=%1$s got their brain melted. death.attack.building=%1$s was hit by a falling building. @@ -1793,6 +1795,7 @@ item.gun_bolter_digamma.name=Digamma Gun item.gun_calamity.name=Buzzsaw item.gun_calamity_ammo.name=.50 BMG Round (LEGACY) item.gun_calamity_dual.name=Saddle Gun +item.gun_chemthrower.name=Chemthrower item.gun_cryolator.name=The Cryolator item.gun_cryolator_ammo.name=Cryo Cell item.gun_dampfmaschine.name=Totally Not a Joke Weapon diff --git a/src/main/resources/assets/hbm/models/weapons/chainsaw.obj b/src/main/resources/assets/hbm/models/weapons/chainsaw.obj new file mode 100644 index 000000000..3bd2f83db --- /dev/null +++ b/src/main/resources/assets/hbm/models/weapons/chainsaw.obj @@ -0,0 +1,505 @@ +# Blender v2.79 (sub 0) OBJ File: 'chainsaw.blend' +# www.blender.org +o Tooth +v -0.421875 0.562500 0.625000 +v -0.390625 0.562500 0.625000 +v -0.390625 0.687500 0.625000 +v -0.421875 0.687500 0.625000 +v -0.421875 0.687500 0.500000 +v -0.390625 0.687500 0.500000 +v -0.390625 0.562500 0.500000 +v -0.421875 0.562500 0.500000 +vt 0.755814 0.579710 +vt 0.732558 0.608696 +vt 0.732558 0.579710 +vt 0.790698 0.579710 +vt 0.767442 0.608696 +vt 0.767442 0.579710 +vt 0.755814 0.608696 +vt 0.732558 0.623188 +vt 0.720930 0.579710 +vt 0.790698 0.608696 +vt 0.755814 0.623188 +vt 0.720930 0.608696 +vn -1.0000 0.0000 0.0000 +vn 1.0000 0.0000 0.0000 +vn 0.0000 0.0000 1.0000 +vn 0.0000 1.0000 0.0000 +vn 0.0000 0.0000 -1.0000 +s off +f 1/1/1 5/2/1 8/3/1 +f 7/4/2 3/5/2 2/6/2 +f 1/1/3 3/5/3 4/7/3 +f 4/7/4 6/8/4 5/2/4 +f 5/2/5 7/9/5 8/3/5 +f 1/1/1 4/7/1 5/2/1 +f 7/4/2 6/10/2 3/5/2 +f 1/1/3 2/6/3 3/5/3 +f 4/7/4 3/11/4 6/8/4 +f 5/2/5 6/12/5 7/9/5 +o Saw +v 0.500000 0.687500 0.250000 +v 0.500000 0.062500 0.250000 +v 0.500000 0.687500 -0.312500 +v 0.500000 0.062500 -0.312500 +v 0.562500 0.625000 -0.250000 +v 0.562500 0.625000 0.250000 +v 0.562500 0.125000 0.250000 +v 0.562500 0.125000 -0.250000 +v -0.125000 0.000000 -1.000000 +v 0.125000 0.000000 -1.000000 +v -0.125000 0.000000 -1.750000 +v 0.125000 0.000000 -1.750000 +v -0.125000 0.375000 -1.750000 +v 0.125000 0.375000 -1.750000 +v -0.125000 0.750000 -1.000000 +v 0.125000 0.750000 -1.000000 +v -0.125000 0.125000 -1.000000 +v 0.125000 0.125000 -1.000000 +v -0.125000 0.125000 -1.625000 +v 0.125000 0.125000 -1.625000 +v -0.125000 0.250000 -1.625000 +v 0.125000 0.250000 -1.625000 +v -0.125000 0.625000 -0.885000 +v 0.125000 0.625000 -0.885000 +v -0.062500 0.896676 -0.695873 +v 0.062500 0.896676 -0.695873 +v -0.062500 0.834176 -0.804127 +v 0.062500 0.834176 -0.804127 +v -0.062500 0.888302 -0.835377 +v -0.062500 0.950802 -0.727123 +v 0.062500 0.950802 -0.727123 +v 0.062500 0.888302 -0.835377 +v -0.500000 0.125000 0.500000 +v -0.500000 0.625000 0.500000 +v 0.375000 0.750000 0.500000 +v -0.500000 0.625000 -0.250000 +v -0.375000 0.750000 0.500000 +v -0.625000 0.125000 0.500000 +v -0.625000 0.625000 0.500000 +v -0.625000 0.625000 -0.250000 +v -0.500000 0.375000 -0.500000 +v -0.500000 0.125000 -0.500000 +v -0.625000 0.375000 -0.500000 +v -0.625000 0.125000 -0.500000 +v 0.500000 0.000000 0.375000 +v 0.625000 0.000000 0.375000 +v 0.500000 0.000000 0.250000 +v 0.625000 0.000000 0.250000 +v 0.500000 1.250000 0.375000 +v 0.625000 1.375000 0.375000 +v 0.500000 1.250000 0.250000 +v 0.625000 1.375000 0.250000 +v -0.500000 1.250000 0.375000 +v -0.500000 1.250000 0.250000 +v -0.500000 0.625000 0.375000 +v -0.500000 0.625000 0.250000 +v -0.625000 1.375000 0.375000 +v -0.625000 1.375000 0.250000 +v -0.625000 0.625000 0.375000 +v -0.625000 0.625000 0.250000 +v -0.375000 0.750000 0.500000 +v 0.375000 0.750000 0.500000 +v -0.375000 1.000000 0.750000 +v 0.375000 1.000000 0.750000 +v -0.375000 1.500000 0.750000 +v 0.375000 1.500000 0.750000 +v -0.437500 0.125000 0.500000 +v -0.437500 0.625000 0.500000 +v -0.375000 0.125000 0.500000 +v -0.375000 0.625000 0.500000 +v -0.437500 0.125000 2.500000 +v -0.437500 0.625000 2.500000 +v -0.375000 0.125000 2.500000 +v -0.375000 0.625000 2.500000 +v -0.375000 0.125000 0.500000 +v -0.375000 0.625000 0.500000 +v 0.375000 0.125000 0.500000 +v 0.375000 0.625000 0.500000 +v -0.375000 0.250000 0.625000 +v -0.375000 0.500000 0.625000 +v 0.375000 0.250000 0.625000 +v 0.375000 0.500000 0.625000 +v -0.500000 0.000000 -0.500000 +v -0.500000 0.000000 0.500000 +v -0.375000 0.198223 2.676777 +v -0.437500 0.551777 2.676777 +v -0.437500 0.375000 2.750000 +v -0.437500 0.198223 2.676777 +v -0.375000 0.375000 2.750000 +v -0.375000 0.551777 2.676777 +v 0.500000 0.000000 0.500000 +v 0.500000 0.000000 -0.500000 +v -0.250000 0.000000 -1.000000 +v 0.250000 0.000000 -1.000000 +v -0.500000 0.750000 -0.500000 +v -0.500000 0.750000 0.500000 +v 0.500000 0.750000 0.500000 +v 0.500000 0.750000 -0.500000 +v -0.250000 0.750000 -1.000000 +v 0.250000 0.750000 -1.000000 +v -0.250000 1.000000 0.500000 +v 0.250000 1.000000 0.500000 +v -0.250000 1.000000 -0.500000 +v 0.250000 1.000000 -0.500000 +v -0.447500 0.262500 0.625000 +v -0.447500 0.487500 0.625000 +v -0.447500 0.262500 2.500000 +v -0.447500 0.487500 2.500000 +v -0.365000 0.262500 0.625000 +v -0.365000 0.487500 0.625000 +v -0.365000 0.262500 2.500000 +v -0.365000 0.487500 2.500000 +v -0.375000 1.000000 0.750000 +v 0.375000 1.000000 0.750000 +v -0.375000 1.500000 0.750000 +v 0.375000 1.500000 0.750000 +vt 0.209302 0.057971 +vt 0.186047 0.086957 +vt 0.186047 0.057971 +vt 0.325581 0.724638 +vt 0.186047 0.637681 +vt 0.325581 0.637681 +vt 0.209302 0.086957 +vt 0.441860 0.115942 +vt 0.209302 0.115942 +vt 0.465116 0.130435 +vt 0.558140 0.246377 +vt 0.465116 0.246377 +vt 0.569767 0.260870 +vt 0.558140 0.130435 +vt 0.569767 0.115942 +vt 0.058140 0.869565 +vt 0.930233 1.000000 +vt 0.058140 1.000000 +vt 0.465116 0.115942 +vt 0.465116 0.260870 +vt 0.720930 0.289855 +vt 0.674419 0.115942 +vt 0.720930 0.115942 +vt 0.720930 0.376812 +vt 0.674419 0.289855 +vt 0.720930 0.550725 +vt 0.674419 0.376812 +vt 0.790698 0.115942 +vt 0.744186 0.260870 +vt 0.744186 0.115942 +vt 0.790698 0.318841 +vt 0.744186 0.347826 +vt 0.744186 0.318841 +vt 0.790698 0.405797 +vt 0.744186 0.579710 +vt 0.744186 0.405797 +vt 0.651163 0.347826 +vt 0.651163 0.260870 +vt 0.674419 0.550725 +vt 0.651163 0.405797 +vt 0.581395 0.159420 +vt 0.604651 0.130435 +vt 0.604651 0.159420 +vt 0.616279 0.159420 +vt 0.616279 0.130435 +vt 0.604651 0.115942 +vt 0.581395 0.130435 +vt 0.581395 0.115942 +vt 0.581395 0.173913 +vt 0.604651 0.173913 +vt 0.569767 0.130435 +vt 0.569767 0.159420 +vt 0.209302 0.289855 +vt 0.348837 0.260870 +vt 0.348837 0.289855 +vt 0.186047 0.637681 +vt 0.325581 0.724638 +vt 0.325581 0.637681 +vt 0.162791 0.260870 +vt 0.209302 0.260870 +vt 0.372093 0.260870 +vt 0.348837 0.144928 +vt 0.372093 0.144928 +vt 0.139535 0.144928 +vt 0.162791 0.202899 +vt 0.139535 0.202899 +vt 0.186047 0.724638 +vt 0.325581 0.840580 +vt 0.441860 0.028986 +vt 0.209302 0.028986 +vt 0.162791 0.144928 +vt 0.441860 -0.000000 +vt 0.209302 -0.000000 +vt 0.465116 0.057971 +vt 0.465116 0.086957 +vt 0.488372 -0.000000 +vt 0.674419 0.028986 +vt 0.488372 0.028986 +vt 0.720930 0.000000 +vt 0.837209 0.028986 +vt 0.720930 0.028986 +vt 0.697674 0.086957 +vt 0.697674 0.057971 +vt 0.837209 0.086957 +vt 0.488372 0.115942 +vt 0.720930 0.115942 +vt 0.837209 0.115942 +vt 0.837209 0.057971 +vt 0.325581 0.840580 +vt 0.186047 0.724638 +vt 0.895349 0.115942 +vt 0.883721 0.579710 +vt 0.883721 0.115942 +vt 0.988372 0.115942 +vt 0.895349 0.579710 +vt 1.000000 0.115942 +vt 0.988372 0.579710 +vt 0.790698 0.579710 +vt 0.790698 0.115942 +vt 0.511628 0.666667 +vt 0.651163 0.724638 +vt 0.511628 0.724638 +vt 0.511628 0.753623 +vt 0.651163 0.753623 +vt 0.651163 0.637681 +vt 0.511628 0.637681 +vt 0.674419 0.753623 +vt 0.651163 0.666667 +vt 0.674419 0.637681 +vt 0.988372 0.623188 +vt 1.000000 0.666667 +vt 0.988372 0.666667 +vt 0.895349 0.666667 +vt 0.883721 0.623188 +vt 0.895349 0.623188 +vt 1.000000 0.623188 +vt 1.000000 0.579710 +vt 0.974987 0.620786 +vt 0.941860 0.637681 +vt 0.909405 0.620786 +vt 0.870647 0.620786 +vt 0.805065 0.620786 +vt 0.186047 0.405797 +vt 0.000000 0.637681 +vt -0.000000 0.405797 +vt 0.046512 0.289855 +vt 0.651163 0.637681 +vt 0.511628 0.405797 +vt 0.651163 0.405797 +vt 0.186047 0.289855 +vt 0.325581 0.405797 +vt 0.325581 0.869565 +vt 0.511628 0.695652 +vt 0.511628 0.869565 +vt 0.511628 0.289855 +vt 0.651163 0.289855 +vt 0.465116 0.115942 +vt 0.372093 0.289855 +vt 0.372093 0.115942 +vt 0.325581 0.637681 +vt 0.186047 0.637681 +vt 0.325581 0.695652 +vt 0.465116 0.637681 +vt 0.372093 0.637681 +vt 0.465116 0.405797 +vt 0.372093 0.405797 +vt 0.511628 0.637681 +vt 0.465116 0.289855 +vt 0.325581 0.289855 +vt 0.058140 1.000000 +vt 0.930233 0.869565 +vt 0.930233 1.000000 +vt 0.348837 0.115942 +vt 0.930233 0.869565 +vt 0.790698 0.260870 +vt 0.790698 0.347826 +vt 0.790698 0.579710 +vt 0.651163 0.318841 +vt 0.651163 0.115942 +vt 0.651163 0.579710 +vt 0.162791 0.289855 +vt 0.186047 0.840580 +vt 0.674419 0.000000 +vt 0.837209 0.000000 +vt 0.674419 0.115942 +vt 0.186047 0.840580 +vt 0.883721 0.666667 +vt 0.837209 0.637681 +vt 0.139535 0.289855 +vt 0.058140 0.869565 +vt 0.162791 0.115942 +vn 0.0000 -1.0000 0.0000 +vn 0.0000 0.7071 -0.7071 +vn 0.0000 0.0000 1.0000 +vn 1.0000 0.0000 0.0000 +vn 0.7071 0.0000 -0.7071 +vn -1.0000 0.0000 0.0000 +vn 0.7071 -0.7071 0.0000 +vn 0.7071 0.7071 0.0000 +vn 0.0000 0.0000 -1.0000 +vn 0.0000 0.8944 -0.4472 +vn 0.0000 1.0000 0.0000 +vn 0.0000 -0.8920 0.4520 +vn 0.0000 0.8660 -0.5000 +vn 0.0000 -0.5000 -0.8660 +vn 0.0000 0.5000 0.8660 +vn 0.0000 -0.7071 0.7071 +vn 0.0000 0.7071 0.7071 +vn 0.0000 -0.3827 0.9239 +vn 0.0000 0.3827 0.9239 +vn 0.0000 0.9239 0.3827 +vn 0.0000 -0.9239 0.3827 +vn 0.8944 0.0000 -0.4472 +vn -0.8944 0.0000 -0.4472 +vn -0.7071 0.7071 0.0000 +vn -0.6667 0.6667 -0.3333 +vn 0.6667 0.6667 -0.3333 +s off +f 56/13/6 53/14/6 55/15/6 +f 71/16/7 70/17/7 69/18/7 +f 54/19/8 57/20/8 53/21/8 +f 15/22/9 13/23/9 14/24/9 +f 11/25/10 16/26/10 12/27/10 +f 113/28/11 116/29/11 114/30/11 +f 10/31/12 16/26/12 15/22/12 +f 9/32/13 13/23/13 11/25/13 +f 19/33/6 18/34/6 17/35/6 +f 21/36/14 20/37/14 19/33/14 +f 23/38/15 22/39/15 21/36/15 +f 26/40/16 27/41/16 25/42/16 +f 28/43/8 29/44/8 27/45/8 +f 30/46/17 31/47/17 29/48/17 +f 27/45/11 21/36/11 19/33/11 +f 30/49/9 20/37/9 22/39/9 +f 28/50/9 18/34/9 20/37/9 +f 29/48/11 23/38/11 21/36/11 +f 24/51/9 30/52/9 22/39/9 +f 17/35/11 27/41/11 19/33/11 +f 39/53/18 37/54/18 38/55/18 +f 33/56/11 37/54/11 35/57/11 +f 35/58/19 40/59/19 36/60/19 +f 34/61/20 38/55/20 33/62/20 +f 36/63/9 39/53/9 34/64/9 +f 44/65/16 47/66/16 42/67/16 +f 43/68/21 121/69/21 45/70/21 +f 44/65/7 51/71/7 48/72/7 +f 42/73/8 46/74/8 41/75/8 +f 50/76/14 51/77/14 49/78/14 +f 122/79/8 123/80/8 121/69/8 +f 59/81/14 56/13/14 55/82/14 +f 46/74/11 48/72/11 52/83/11 +f 57/84/11 55/82/11 53/85/11 +f 54/19/9 60/86/9 58/87/9 +f 57/88/6 62/89/6 59/90/6 +f 61/91/9 64/92/9 62/93/9 +f 60/86/16 65/94/16 58/87/16 +f 66/95/11 67/96/11 65/94/11 +f 65/94/8 57/97/8 58/87/8 +f 61/98/8 67/96/8 63/99/8 +f 59/90/14 66/95/14 60/86/14 +f 68/100/14 62/93/14 64/92/14 +f 73/101/14 72/102/14 71/16/14 +f 76/103/16 82/104/16 78/105/16 +f 75/106/11 80/107/11 76/103/11 +f 77/108/6 79/109/6 75/106/6 +f 78/105/9 81/110/9 77/111/9 +f 87/112/8 90/113/8 88/114/8 +f 84/115/22 90/113/22 86/116/22 +f 85/117/21 87/112/21 83/118/21 +f 86/119/9 89/120/9 85/121/9 +f 96/122/23 97/123/23 95/124/23 +f 95/125/24 98/126/24 94/127/24 +f 94/127/25 82/104/25 80/107/25 +f 93/128/26 79/109/26 81/129/26 +f 96/130/11 95/131/11 94/132/11 +f 98/133/9 93/134/9 81/110/9 +f 100/135/6 92/136/6 91/137/6 +f 101/138/6 100/135/6 91/137/6 +f 92/139/11 103/140/11 91/141/11 +f 102/142/27 106/143/27 100/135/27 +f 99/144/8 104/145/8 92/146/8 +f 91/141/28 107/147/28 101/148/28 +f 101/149/14 108/150/14 102/151/14 +f 100/135/9 105/152/9 99/153/9 +f 105/154/8 109/155/8 104/145/8 +f 110/156/16 111/157/16 109/155/16 +f 112/158/13 105/152/13 106/143/13 +f 109/155/29 103/140/29 104/159/29 +f 107/160/15 112/158/15 108/150/15 +f 107/147/30 103/140/30 111/157/30 +f 108/161/31 112/158/31 106/143/31 +f 120/162/9 117/163/9 118/164/9 +f 52/83/6 41/165/6 46/74/6 +f 56/13/6 54/19/6 53/14/6 +f 71/16/7 72/102/7 70/17/7 +f 54/19/8 58/87/8 57/20/8 +f 15/22/9 16/26/9 13/23/9 +f 11/25/10 13/23/10 16/26/10 +f 113/28/11 115/166/11 116/29/11 +f 10/31/12 12/27/12 16/26/12 +f 9/32/13 14/24/13 13/23/13 +f 19/33/6 20/37/6 18/34/6 +f 21/36/14 22/39/14 20/37/14 +f 23/38/15 24/51/15 22/39/15 +f 26/40/16 28/167/16 27/41/16 +f 28/43/8 30/168/8 29/44/8 +f 30/46/17 32/169/17 31/47/17 +f 27/45/11 29/44/11 21/36/11 +f 30/49/9 28/170/9 20/37/9 +f 28/50/9 26/171/9 18/34/9 +f 29/48/11 31/47/11 23/38/11 +f 24/51/9 32/172/9 30/52/9 +f 17/35/11 25/42/11 27/41/11 +f 39/53/18 40/59/18 37/54/18 +f 33/56/11 38/55/11 37/54/11 +f 35/58/19 37/54/19 40/59/19 +f 34/61/20 39/53/20 38/55/20 +f 36/63/9 40/59/9 39/53/9 +f 44/65/16 48/72/16 47/66/16 +f 43/68/21 122/79/21 121/69/21 +f 44/65/7 49/173/7 51/71/7 +f 42/73/8 47/66/8 46/74/8 +f 50/76/14 52/83/14 51/77/14 +f 122/79/8 124/174/8 123/80/8 +f 59/81/14 60/86/14 56/13/14 +f 47/66/11 48/72/11 46/74/11 +f 48/72/11 51/77/11 52/83/11 +f 57/84/11 59/81/11 55/82/11 +f 54/19/9 56/13/9 60/86/9 +f 57/88/6 61/175/6 62/89/6 +f 61/91/9 63/176/9 64/92/9 +f 60/86/16 66/95/16 65/94/16 +f 66/95/11 68/100/11 67/96/11 +f 65/94/8 61/177/8 57/97/8 +f 61/98/8 65/94/8 67/96/8 +f 59/90/14 62/89/14 66/95/14 +f 68/100/14 66/95/14 62/93/14 +f 73/101/14 74/178/14 72/102/14 +f 76/103/16 80/107/16 82/104/16 +f 75/106/11 79/109/11 80/107/11 +f 77/108/6 81/129/6 79/109/6 +f 78/105/9 82/104/9 81/110/9 +f 87/112/8 89/120/8 90/113/8 +f 84/115/22 88/114/22 90/113/22 +f 85/117/21 89/120/21 87/112/21 +f 86/119/9 90/113/9 89/120/9 +f 96/122/23 93/128/23 97/123/23 +f 95/125/24 97/179/24 98/126/24 +f 94/127/25 98/126/25 82/104/25 +f 93/128/26 96/122/26 79/109/26 +f 94/132/11 80/107/11 79/109/11 +f 79/109/11 96/130/11 94/132/11 +f 81/110/9 82/104/9 98/133/9 +f 98/133/9 97/180/9 93/134/9 +f 100/135/6 99/153/6 92/136/6 +f 101/138/6 102/181/6 100/135/6 +f 92/139/11 104/159/11 103/140/11 +f 102/142/27 108/161/27 106/143/27 +f 99/144/8 105/154/8 104/145/8 +f 91/141/28 103/140/28 107/147/28 +f 101/149/14 107/160/14 108/150/14 +f 100/135/9 106/143/9 105/152/9 +f 105/154/8 110/156/8 109/155/8 +f 110/156/16 112/158/16 111/157/16 +f 112/158/13 110/156/13 105/152/13 +f 109/155/29 111/157/29 103/140/29 +f 107/160/15 111/157/15 112/158/15 +f 120/162/9 119/182/9 117/163/9 +f 52/83/6 50/183/6 41/165/6 diff --git a/src/main/resources/assets/hbm/sounds/weapon/chainsaw_loop.ogg b/src/main/resources/assets/hbm/sounds/weapon/chainsaw_loop.ogg new file mode 100644 index 000000000..a687020c8 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/weapon/chainsaw_loop.ogg differ diff --git a/src/main/resources/assets/hbm/textures/models/weapons/chainsaw.png b/src/main/resources/assets/hbm/textures/models/weapons/chainsaw.png new file mode 100644 index 000000000..60c9c44f8 Binary files /dev/null and b/src/main/resources/assets/hbm/textures/models/weapons/chainsaw.png differ diff --git a/src/main/resources/assets/hbm/textures/models/weapons/chemthrower.png b/src/main/resources/assets/hbm/textures/models/weapons/chemthrower.png index 9463a1987..6d09425ae 100644 Binary files a/src/main/resources/assets/hbm/textures/models/weapons/chemthrower.png and b/src/main/resources/assets/hbm/textures/models/weapons/chemthrower.png differ diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 7b308e431..b80e198dd 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "hbm", "name": "Hbm's Nuclear Tech", "description": "A mod that adds weapons, nuclear themed stuff and machines", - "version":"1.0.27_X4327", + "version":"1.0.27_X4333", "mcversion": "1.7.10", "url": "", "updateUrl": "",