This commit is contained in:
Bob 2020-12-21 21:05:19 +01:00
parent 8a69381ec0
commit d08b3fa98d
20 changed files with 479 additions and 50 deletions

View File

@ -1125,6 +1125,10 @@ item.hazmat_plate.name=Strahlenschutzbrustplatte
item.hazmat_plate_grey.name=Hochleistungs-Strahlenschutzbrustplatte
item.hazmat_plate_red.name=Verbesserte Strahlenschutzbrustplatte
item.hazmat_red_kit.name=Lvl 2 Strahlenschutz-Kit
item.hev_boots.name=HEV Mark IV Stiefel
item.hev_plate.name=HEV Mark IV Brustpanzer
item.hev_helmet.name=HEV Mark IV Helm
item.hev_legs.name=HEV Mark IV Beinschutz
item.hull_big_aluminium.name=Große Aluminiumhülle
item.hull_big_steel.name=Große Stahlhülle
item.hull_big_titanium.name=Große Titanhülle
@ -1534,6 +1538,7 @@ item.piston_selenium.name=Sternmotorenkolben
item.plan_c.name=Plan C
item.plate_advanced_alloy.name=Fortgeschrittene Legierungsplatte
item.plate_aluminium.name=Aluminiumplatte
item.plate_armor_hev.name=Reaktive Panzerplatte
item.plate_armor_lunar.name=Lunare Panzerplatte
item.plate_armor_titanium.name=Titanium-Panzerplatte
item.plate_combine_steel.name=CMB-Stahlplatte

View File

@ -1125,6 +1125,10 @@ item.hazmat_plate.name=Hazmat Chestplate
item.hazmat_plate_grey.name=High-Performance Hazmat Chestplate
item.hazmat_plate_red.name=Advanced Hazmat Chestplate
item.hazmat_red_kit.name=Advanced Hazmat Kit
item.hev_boots.name=HEV Mark IV Boots
item.hev_plate.name=HEV Mark IV Chestplate
item.hev_helmet.name=HEV Mark IV Helmet
item.hev_legs.name=HEV Mark IV Leggings
item.hull_big_aluminium.name=Big Aluminium Shell
item.hull_big_steel.name=Big Steel Shell
item.hull_big_titanium.name=Big Titanium Shell
@ -1534,6 +1538,7 @@ item.piston_selenium.name=Radial Engine Piston
item.plan_c.name=Plan C
item.plate_advanced_alloy.name=Advanced Alloy Plate
item.plate_aluminium.name=Aluminium Plate
item.plate_armor_hev.name=Reactive Armor Plating
item.plate_armor_lunar.name=Lunar Plating
item.plate_armor_titanium.name=Titanium Armor Plate
item.plate_combine_steel.name=CMB Steel Plate

View File

@ -16,6 +16,7 @@ public class MobConfig {
public static int raidAmount = 15;
public static int raidAttackDelay = 40;
public static int raidAttackReach = 2;
public static int raidAttackDistance = 32;
public static void loadFromConfig(Configuration config) {
@ -32,7 +33,8 @@ public class MobConfig {
raidChance = CommonConfig.createConfigInt(config, CATEGORY, "12.07_raidChance", "1:x chance to spawn a raid, must be at least 1", 3);
raidAmount = CommonConfig.createConfigInt(config, CATEGORY, "12.08_raidAmount", "How many FBI agents are spawned each raid", 15);
raidAttackDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.09_raidAttackDelay", "Time between individual attempts to break machines", 40);
raidAttackReach = CommonConfig.createConfigInt(config, CATEGORY, "12.10_raidAttackReach", "How far away machiens can be broken", 2);
raidAttackReach = CommonConfig.createConfigInt(config, CATEGORY, "12.10_raidAttackReach", "How far away machines can be broken", 2);
raidAttackDistance = CommonConfig.createConfigInt(config, CATEGORY, "12.11_raidAttackDistance", "How far away agents will spawn from the targeted player", 32);
}
}

View File

@ -6,6 +6,8 @@ import java.util.Set;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.MobConfig;
import com.hbm.entity.mob.ai.EntityAIBreaking;
import com.hbm.entity.mob.ai.EntityAI_MLPF;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.items.ModItems;
@ -28,6 +30,7 @@ import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
@ -43,16 +46,19 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
super(world);
this.getNavigator().setBreakDoors(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIBreakDoor(this));
this.tasks.addTask(1, new EntityAIBreaking(this));
this.tasks.addTask(2, new EntityAIArrowAttack(this, 1D, 20, 25, 15.0F));
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
this.tasks.addTask(3, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, true));
this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));
this.tasks.addTask(6, new EntityAI_MLPF(this, EntityPlayer.class, 100, 1D, 16));
this.tasks.addTask(7, new EntityAIWander(this, 1.0D));
this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(8, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, false));
this.setSize(0.6F, 1.8F);
this.isImmuneToFire = true;
}
protected void applyEntityAttributes() {
@ -66,6 +72,13 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
if(source instanceof EntityDamageSourceIndirect && ((EntityDamageSourceIndirect)source).getEntity() instanceof EntityFBI) {
return false;
}
if(this.getEquipmentInSlot(4) != null && this.getEquipmentInSlot(4).getItem() == Item.getItemFromBlock(Blocks.glass)) {
if("oxygenSuffocation".equals(source.damageType))
return false;
if("thermal".equals(source.damageType))
return false;
}
return super.attackEntityFrom(source, amount);
}
@ -83,6 +96,20 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
case 0: this.setCurrentItemOrArmor(0, new ItemStack(ModItems.gun_revolver_nopip)); break;
case 1: this.setCurrentItemOrArmor(0, new ItemStack(ModItems.gun_ks23)); break;
}
if(rand.nextInt(10) == 0) {
this.setCurrentItemOrArmor(4, new ItemStack(ModItems.security_helmet));
this.setCurrentItemOrArmor(3, new ItemStack(ModItems.security_plate));
this.setCurrentItemOrArmor(2, new ItemStack(ModItems.security_legs));
this.setCurrentItemOrArmor(1, new ItemStack(ModItems.security_boots));
}
if(this.worldObj != null && this.worldObj.provider.dimensionId != 0) {
this.setCurrentItemOrArmor(4, new ItemStack(Blocks.glass));
this.setCurrentItemOrArmor(3, new ItemStack(ModItems.paa_plate));
this.setCurrentItemOrArmor(2, new ItemStack(ModItems.paa_legs));
this.setCurrentItemOrArmor(1, new ItemStack(ModItems.paa_boots));
}
}
protected boolean isAIEnabled() {
@ -153,7 +180,7 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
public void onLivingUpdate() {
super.onLivingUpdate();
if(worldObj.isRemote)
if(worldObj.isRemote || this.getHealth() <= 0)
return;
if(this.ticksExisted % MobConfig.raidAttackDelay == 0) {

View File

@ -0,0 +1,195 @@
package com.hbm.entity.mob.ai;
import net.minecraft.block.Block;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.init.Blocks;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class EntityAIBreaking extends EntityAIBase {
EntityLivingBase target;
int[] markedLoc;
EntityLiving entityDigger;
int digTick = 0;
int scanTick = 0;
public EntityAIBreaking(EntityLiving entity)
{
this.entityDigger = entity;
}
@Override
public boolean shouldExecute()
{
target = entityDigger.getAttackTarget();
if(target != null && entityDigger.getNavigator().noPath() && entityDigger.getDistanceToEntity(target) > 1D && (target.onGround || !entityDigger.canEntityBeSeen(target)))
{
MovingObjectPosition mop = GetNextObstical(entityDigger, 2D);
if(mop == null || mop.typeOfHit != MovingObjectType.BLOCK)
{
return false;
}
Block block = entityDigger.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ);
if(block.getBlockHardness(entityDigger.worldObj, mop.blockX, mop.blockY, mop.blockZ) >= 0) {
markedLoc = new int[]{mop.blockX, mop.blockY, mop.blockZ};
return true;
}
}
return false;
}
@Override
public boolean continueExecuting()
{
//return target != null && entityDigger != null && target.isEntityAlive() && entityDigger.isEntityAlive() && markedLoc != null && entityDigger.getNavigator().noPath() && entityDigger.getDistanceToEntity(target) > 1D && (target.onGround || !entityDigger.canEntityBeSeen(target));
if(markedLoc != null) {
Vec3 vector = Vec3.createVectorHelper(
markedLoc[0] - entityDigger.posX,
markedLoc[1] - (entityDigger.posY + entityDigger.getEyeHeight()),
markedLoc[2] - entityDigger.posZ);
return entityDigger != null && entityDigger.isEntityAlive() && vector.lengthVector() <= 4;
}
return false;
}
@Override
public void updateTask()
{
MovingObjectPosition mop = null;
if(entityDigger.ticksExisted%10 == 0)
{
mop = GetNextObstical(entityDigger, 2D);
}
if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK)
{
markedLoc = new int[]{mop.blockX, mop.blockY, mop.blockZ};
}
if(markedLoc == null || markedLoc.length != 3 || entityDigger.worldObj.getBlock(markedLoc[0], markedLoc[1], markedLoc[2]) == Blocks.air)
{
digTick = 0;
return;
}
Block block = entityDigger.worldObj.getBlock(markedLoc[0], markedLoc[1], markedLoc[2]);
digTick++;
int health = (int) block.getBlockHardness(entityDigger.worldObj, markedLoc[0], markedLoc[1], markedLoc[2]) / 3;
if(health <= 0) {
markedLoc = null;
return;
}
float str = (digTick * 0.05F) / (float)health;
if(str >= 1F)
{
digTick = 0;
boolean canHarvest = false;
entityDigger.worldObj.func_147480_a(markedLoc[0], markedLoc[1], markedLoc[2], canHarvest);
markedLoc = null;
if(target != null)
entityDigger.getNavigator().setPath(entityDigger.getNavigator().getPathToEntityLiving(target), 1D);
} else
{
if(digTick % 5 == 0)
{
entityDigger.worldObj.playSoundAtEntity(entityDigger, block.stepSound.getStepResourcePath(), block.stepSound.getVolume() + 1F, block.stepSound.getPitch());
entityDigger.swingItem();
entityDigger.worldObj.destroyBlockInWorldPartially(entityDigger.getEntityId(), markedLoc[0], markedLoc[1], markedLoc[2], (int)(str * 10F));
}
}
}
@Override
public void resetTask()
{
markedLoc = null;
digTick = 0;
}
/**
* Rolls through all the points in the bounding box of the entity and raycasts them toward it's current heading to return any blocks that may be obstructing it's path.
* The bigger the entity the longer this calculation will take due to the increased number of points (Generic bipeds should only need 2)
*/
public MovingObjectPosition GetNextObstical(EntityLivingBase entityLiving, double dist)
{
// Returns true if something like Iguana Tweaks is nerfing the vanilla picks. This will then cause zombies to ignore the harvestability of blocks when holding picks
float f = 1.0F;
float f1 = entityLiving.prevRotationPitch + (entityLiving.rotationPitch - entityLiving.prevRotationPitch) * f;
float f2 = entityLiving.prevRotationYaw + (entityLiving.rotationYaw - entityLiving.prevRotationYaw) * f;
int digWidth = MathHelper.ceiling_double_int(entityLiving.width);
int digHeight = MathHelper.ceiling_double_int(entityLiving.height);
int passMax = digWidth * digWidth * digHeight;
int x = scanTick%digWidth - (digWidth/2);
int y = scanTick/(digWidth * digWidth);
int z = (scanTick%(digWidth * digWidth))/digWidth - (digWidth/2);
double rayX = x + entityLiving.posX;
double rayY = y + entityLiving.posY;
double rayZ = z + entityLiving.posZ;
MovingObjectPosition mop = RayCastBlocks(entityLiving.worldObj, rayX, rayY, rayZ, f2, f1, dist, false);
if(mop != null && mop.typeOfHit == MovingObjectType.BLOCK)
{
Block block = entityLiving.worldObj.getBlock(mop.blockX, mop.blockY, mop.blockZ);
if(block.getBlockHardness(entityLiving.worldObj, mop.blockX, mop.blockY, mop.blockZ) >= 0)
{
scanTick = 0;
return mop;
} else
{
scanTick = (scanTick + 1)%passMax;
return null;
}
} else
{
scanTick = (scanTick + 1)%passMax;
return null;
}
}
public static MovingObjectPosition RayCastBlocks(World world, double x, double y, double z, float yaw, float pitch, double dist, boolean liquids)
{
Vec3 vec3 = Vec3.createVectorHelper(x, y, z);
float f3 = MathHelper.cos(-yaw * 0.017453292F - (float)Math.PI);
float f4 = MathHelper.sin(-yaw * 0.017453292F - (float)Math.PI);
float f5 = -MathHelper.cos(-pitch * 0.017453292F);
float f6 = MathHelper.sin(-pitch * 0.017453292F);
float f7 = f4 * f5;
float f8 = f3 * f5;
double d3 = dist; // Ray Distance
Vec3 vec31 = vec3.addVector((double)f7 * d3, (double)f6 * d3, (double)f8 * d3);
return RayCastBlocks(world, vec3, vec31, liquids);
}
public static MovingObjectPosition RayCastBlocks(World world, Vec3 vector1, Vec3 vector2, boolean liquids)
{
return world.func_147447_a(vector1, vector2, liquids, !liquids, false);
}
}

View File

@ -0,0 +1,131 @@
package com.hbm.entity.mob.ai;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
public class EntityAI_MLPF extends EntityAIBase {
private Class targetClass;
private EntityLivingBase target;
private EntityLiving mover;
private final Sorter theNearestAttackableTargetSorter;
private int range;
private int distance;
private static final int vertical = 10;
private double speed;
public EntityAI_MLPF(EntityLiving entity, Class targetClass, int range, double speed, int distance)
{
this.mover = entity;
this.targetClass = targetClass;
this.range = range;
this.speed = speed;
this.distance = distance;
this.theNearestAttackableTargetSorter = new Sorter(entity);
}
@Override
public boolean shouldExecute() {
//roll the dice for targetiing if there's nothing to track
if(mover.getRNG().nextInt(100) < 5 && mover.getAttackTarget() == null) {
//System.out.println("Randomizer fired!");
//load potential targets
calculateTarget();
//start if there is a valid target
return target != null;
}
return false;
}
public void startExecuting() {
//create a path line from mover to target
Vec3 vec = Vec3.createVectorHelper(
target.posX - mover.posX,
target.posY - mover.posY,
target.posZ - mover.posZ);
//line length is capped so the pathfinder can manage it
int range = distance;
vec = vec.normalize();
vec.xCoord *= range;
vec.yCoord *= range;
vec.zCoord *= range;
//target positions are set (with randomized Y-offset)
double x = mover.posX + vec.xCoord;
double y = mover.posY + vec.yCoord - 5 + mover.getRNG().nextInt(11);
double z = mover.posZ + vec.zCoord;
//System.out.println("Routing to " + x + "/" + y + "/" + z);
//this is where the magic happens
boolean success = this.mover.getNavigator().tryMoveToXYZ(x, y, z, this.speed);
//System.out.println("Start successful? " + success);
}
@Override
public boolean continueExecuting() {
//only continue if the path is valid
return !this.mover.getNavigator().noPath();
}
@Override
public void resetTask()
{
//once the task is complete, remove target
target = null;
}
//scans the area and determines a new target entity
private void calculateTarget() {
List list = mover.worldObj.getEntitiesWithinAABB(targetClass, AxisAlignedBB.getBoundingBox(
mover.posX - range,
mover.posY - vertical,
mover.posZ - range,
mover.posX + range,
mover.posY + vertical,
mover.posZ + range));
Collections.sort(list, theNearestAttackableTargetSorter);
if (!list.isEmpty())
{
target = (EntityLivingBase)list.get(0);
}
}
public static class Sorter implements Comparator {
private final Entity theEntity;
public Sorter(Entity p_i1662_1_) {
this.theEntity = p_i1662_1_;
}
public int compare(Entity p_compare_1_, Entity p_compare_2_) {
double d0 = this.theEntity.getDistanceSqToEntity(p_compare_1_);
double d1 = this.theEntity.getDistanceSqToEntity(p_compare_2_);
return d0 < d1 ? -1 : (d0 > d1 ? 1 : 0);
}
public int compare(Object p_compare_1_, Object p_compare_2_) {
return this.compare((Entity) p_compare_1_, (Entity) p_compare_2_);
}
}
}

View File

@ -47,7 +47,7 @@ public class BossSpawnHandler {
EntityPlayer player = (EntityPlayer) world.playerEntities.get(world.rand.nextInt(world.playerEntities.size()));
Vec3 vec = Vec3.createVectorHelper(32, 0, 0);
Vec3 vec = Vec3.createVectorHelper(MobConfig.raidAttackDistance, 0, 0);
vec.rotateAroundY((float)(Math.PI * 2) * world.rand.nextFloat());
for(int i = 0; i < MobConfig.raidAmount; i++) {

View File

@ -2039,7 +2039,7 @@ public class MachineRecipes {
output[0] = new ItemStack(ModItems.plate_kevlar, 4);
break;
case SOLID_FUEL:
output[0] = new ItemStack(ModItems.rocket_fuel, 1);
output[0] = new ItemStack(ModItems.rocket_fuel, 4);
break;
case SATURN:
output[0] = new ItemStack(ModItems.ingot_saturnite, 2);

View File

@ -199,6 +199,7 @@ public class ModItems {
public static Item blade_meteorite;
public static Item plate_armor_titanium;
public static Item plate_armor_hev;
public static Item plate_armor_lunar;
public static Item solid_fuel;
@ -2129,6 +2130,7 @@ public class ModItems {
blade_meteorite = new ItemHot(10).setUnlocalizedName("blade_meteorite").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":blade_meteorite");
plate_armor_titanium = new Item().setUnlocalizedName("plate_armor_titanium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_armor_titanium");
plate_armor_hev = new Item().setUnlocalizedName("plate_armor_hev").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_armor_hev");
plate_armor_lunar = new Item().setUnlocalizedName("plate_armor_lunar").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_armor_lunar");
solid_fuel = new Item().setUnlocalizedName("solid_fuel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":solid_fuel");
@ -3624,18 +3626,19 @@ public class ModItems {
gas_mask_m65 = new ArmorModel(ArmorMaterial.IRON, 7, 0).setUnlocalizedName("gas_mask_m65").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":gas_mask_m65");
hat = new ArmorHat(ArmorMaterial.IRON, 7, 0).setUnlocalizedName("nossy_hat").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":hat");
//oxy_mask = new ArmorModel(ArmorMaterial.IRON, 7, 0).setUnlocalizedName("oxy_mask").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":oxy_mask");
t45_helmet = new ArmorT45(MainRegistry.aMatT45, 2, 0, 1000000, 10000, 1000).setCap(6.5F).setMod(0.25F)
ArmorMaterial aMatT45 = EnumHelper.addArmorMaterial("HBM_T45", 150, new int[] { 3, 8, 6, 3 }, 0);
aMatT45.customCraftingMaterial = ModItems.plate_armor_titanium;
t45_helmet = new ArmorT45(aMatT45, 2, 0, 1000000, 10000, 1000).setCap(6.5F).setMod(0.25F)
.setFireproof(true)
.enableVATS(true)
.addEffect(new PotionEffect(Potion.damageBoost.id, 20, 0))
.addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 1))
.setBlastProtection(0.5F)
.addResistance("fall", 0)
.setUnlocalizedName("t45_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_helmet");
t45_plate = new ArmorT45(MainRegistry.aMatT45, 2, 1, 1000000, 10000, 1000).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_plate");
t45_legs = new ArmorT45(MainRegistry.aMatT45, 2, 2, 1000000, 10000, 1000).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_legs");
t45_boots = new ArmorT45(MainRegistry.aMatT45, 2, 3, 1000000, 10000, 1000).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_boots");
t45_plate = new ArmorT45(aMatT45, 2, 1, 1000000, 10000, 1000).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_plate");
t45_legs = new ArmorT45(aMatT45, 2, 2, 1000000, 10000, 1000).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_legs");
t45_boots = new ArmorT45(aMatT45, 2, 3, 1000000, 10000, 1000).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_boots");
schrabidium_helmet = new ArmorFSB(MainRegistry.aMatSchrab, 7, 0, RefStrings.MODID + ":textures/armor/schrabidium_1.png").setCap(4F).setMod(0.1F)
.addEffect(new PotionEffect(Potion.digSpeed.id, 20, 2))
@ -3688,7 +3691,9 @@ public class ModItems {
starmetal_legs = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_legs").setTextureName(RefStrings.MODID + ":starmetal_legs");
starmetal_boots = new ArmorFSB(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) starmetal_helmet).setUnlocalizedName("starmetal_boots").setTextureName(RefStrings.MODID + ":starmetal_boots");
bj_helmet = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).setMod(0.25F).setCap(4.0F)
ArmorMaterial aMatBJ = EnumHelper.addArmorMaterial("HBM_BLACKJACK", 150, new int[] { 3, 8, 6, 3 }, 100);
aMatBJ.customCraftingMaterial = ModItems.plate_armor_lunar;
bj_helmet = new ArmorBJ(aMatBJ, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).setMod(0.25F).setCap(4.0F)
.setFireproof(true)
.enableVATS(true)
.enableThermalSight(true)
@ -3702,17 +3707,14 @@ public class ModItems {
.setJump("hbm:step.iron_jump")
.setFall("hbm:step.iron_land")
.addResistance("fall", 0).setUnlocalizedName("bj_helmet").setTextureName(RefStrings.MODID + ":bj_helmet");
bj_plate = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate").setTextureName(RefStrings.MODID + ":bj_plate");
bj_legs = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 1000).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_legs").setTextureName(RefStrings.MODID + ":bj_legs");
bj_boots = new ArmorBJ(MainRegistry.aMatStarmetal, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_boots").setTextureName(RefStrings.MODID + ":bj_boots");
bj_plate = new ArmorBJ(aMatBJ, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate").setTextureName(RefStrings.MODID + ":bj_plate");
bj_legs = new ArmorBJ(aMatBJ, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 1000).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_legs").setTextureName(RefStrings.MODID + ":bj_legs");
bj_boots = new ArmorBJ(aMatBJ, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_boots").setTextureName(RefStrings.MODID + ":bj_boots");
hev_helmet = new ArmorHEV(MainRegistry.aMatStarmetal, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 1000).setMod(0.25F).setCap(4.0F)
.addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 1))
.setBlastProtection(0.25F)
//.setGravity(0.02D)
.setStep("hbm:step.metal")
.setJump("hbm:step.iron_jump")
.setFall("hbm:step.iron_land")
.setThreshold(2.0F)
.addResistance("fall", 0.5F).setUnlocalizedName("hev_helmet").setTextureName(RefStrings.MODID + ":hev_helmet");
hev_plate = new ArmorHEV(MainRegistry.aMatStarmetal, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 1000).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_plate").setTextureName(RefStrings.MODID + ":hev_plate");
hev_legs = new ArmorHEV(MainRegistry.aMatStarmetal, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 1000000, 10000, 1000).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_legs").setTextureName(RefStrings.MODID + ":hev_legs");
@ -4441,6 +4443,7 @@ public class ModItems {
//Armor Plates
GameRegistry.registerItem(plate_armor_titanium, plate_armor_titanium.getUnlocalizedName());
GameRegistry.registerItem(plate_armor_hev, plate_armor_hev.getUnlocalizedName());
GameRegistry.registerItem(plate_armor_lunar, plate_armor_lunar.getUnlocalizedName());
//Boards

View File

@ -44,6 +44,7 @@ public class ArmorFSB extends ItemArmor {
public float blastProtection = -1;
public float damageCap = -1;
public float damageMod = -1;
public float damageThreshold = 0;
public boolean fireproof = false;
public boolean noHelmet = false;
public boolean vats = false;
@ -78,6 +79,11 @@ public class ArmorFSB extends ItemArmor {
return this;
}
public ArmorFSB setThreshold(float threshold) {
this.damageThreshold = threshold;
return this;
}
public ArmorFSB setBlastProtection(float blastProtection) {
this.blastProtection = blastProtection;
return this;
@ -135,6 +141,7 @@ public class ArmorFSB extends ItemArmor {
this.resistance = original.resistance;
this.damageCap = original.damageCap;
this.damageMod = original.damageMod;
this.damageThreshold = original.damageThreshold;
this.blastProtection = original.blastProtection;
this.fireproof = original.fireproof;
this.noHelmet = original.noHelmet;
@ -189,6 +196,10 @@ public class ArmorFSB extends ItemArmor {
list.add(EnumChatFormatting.YELLOW + " General damage modifier of " + damageMod);
}
if(damageThreshold > 0) {
list.add(EnumChatFormatting.YELLOW + " Damage threshold of " + damageThreshold);
}
if(fireproof) {
list.add(EnumChatFormatting.RED + " Fireproof");
}
@ -208,28 +219,54 @@ public class ArmorFSB extends ItemArmor {
public static boolean hasFSBArmor(EntityPlayer player) {
ItemStack helmet = player.inventory.armorInventory[3];
ItemStack plate = player.inventory.armorInventory[2];
ItemStack legs = player.inventory.armorInventory[1];
ItemStack boots = player.inventory.armorInventory[0];
if(plate != null && plate.getItem() instanceof ArmorFSB) {
ArmorFSB chestplate = (ArmorFSB)plate.getItem();
boolean noHelmet = chestplate.noHelmet;
if(((helmet != null && helmet.getItem() instanceof ItemArmor) || noHelmet) &&
plate != null && plate.getItem() instanceof ItemArmor &&
legs != null && legs.getItem() instanceof ItemArmor &&
boots != null && boots.getItem() instanceof ItemArmor) {
for(int i = 0; i < (noHelmet ? 3 : 4); i++) {
if((noHelmet || chestplate.getArmorMaterial() == ((ItemArmor)helmet.getItem()).getArmorMaterial()) &&
chestplate.getArmorMaterial() == ((ItemArmor)legs.getItem()).getArmorMaterial() &&
chestplate.getArmorMaterial() == ((ItemArmor)boots.getItem()).getArmorMaterial()) {
return true;
}
ItemStack armor = player.inventory.armorInventory[i];
if(armor == null || !(armor.getItem() instanceof ArmorFSB))
return false;
if(((ArmorFSB)armor.getItem()).getArmorMaterial() != chestplate.getArmorMaterial())
return false;
if(!((ArmorFSB)armor.getItem()).isArmorEnabled(armor))
return false;
}
return true;
}
return false;
}
public static boolean hasFSBArmorIgnoreCharge(EntityPlayer player) {
ItemStack plate = player.inventory.armorInventory[2];
if(plate != null && plate.getItem() instanceof ArmorFSB) {
ArmorFSB chestplate = (ArmorFSB)plate.getItem();
boolean noHelmet = chestplate.noHelmet;
for(int i = 0; i < (noHelmet ? 3 : 4); i++) {
ItemStack armor = player.inventory.armorInventory[i];
if(armor == null || !(armor.getItem() instanceof ArmorFSB))
return false;
if(((ArmorFSB)armor.getItem()).getArmorMaterial() != chestplate.getArmorMaterial())
return false;
}
return true;
}
return false;
@ -249,6 +286,10 @@ public class ArmorFSB extends ItemArmor {
ArmorFSB chestplate = (ArmorFSB)plate.getItem();
if(chestplate.damageThreshold >= event.ammount) {
event.setCanceled(true);
}
if(chestplate.fireproof && event.source.isFireDamage()) {
player.extinguish();
event.setCanceled(true);
@ -276,6 +317,8 @@ public class ArmorFSB extends ItemArmor {
if(event.ammount < 100) {
event.ammount -= chestplate.damageThreshold;
if(chestplate.damageMod != -1) {
event.ammount *= chestplate.damageMod;
}
@ -366,6 +409,10 @@ public class ArmorFSB extends ItemArmor {
}
}
public boolean isArmorEnabled(ItemStack stack) {
return true;
}
@SideOnly(Side.CLIENT)
public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY){

View File

@ -33,6 +33,11 @@ public class ArmorFSBPowered extends ArmorFSB implements IBatteryItem {
super.addInformation(stack, player, list, ext);
}
@Override
public boolean isArmorEnabled(ItemStack stack) {
return getCharge(stack) > 0;
}
@Override
public void chargeBattery(ItemStack stack, long i) {
if(stack.getItem() instanceof ArmorFSBPowered) {

View File

@ -38,7 +38,7 @@ public class ItemPancake extends ItemFood {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(ArmorFSB.hasFSBArmor(player) && player.inventory.armorInventory[3].getItem() == ModItems.bj_helmet) {
if(ArmorFSB.hasFSBArmorIgnoreCharge(player) && player.inventory.armorInventory[3].getItem() == ModItems.bj_helmet) {
return super.onItemRightClick(stack, world, player);
}

View File

@ -17,7 +17,7 @@ public class ItemFusionCore extends Item {
@Override
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
if(ArmorFSB.hasFSBArmor(player) && player.inventory.armorInventory[3].getItem() instanceof ArmorFSBPowered) {
if(ArmorFSB.hasFSBArmorIgnoreCharge(player) && player.inventory.armorInventory[3].getItem() instanceof ArmorFSBPowered) {
for(ItemStack st : player.inventory.armorInventory) {

View File

@ -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 (3719)";
public static final String VERSION = "1.0.27 BETA (3725)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version

View File

@ -206,9 +206,9 @@ public class ClientProxy extends ServerProxy {
MinecraftForgeClient.registerItemRenderer(ModItems.assembly_template, new ItemRenderTemplate());
MinecraftForgeClient.registerItemRenderer(ModItems.chemistry_template, new ItemRenderTemplate());
//hot stuff
MinecraftForgeClient.registerItemRenderer(ModItems.ingot_meteorite, new ItemRendererHot());
/*MinecraftForgeClient.registerItemRenderer(ModItems.ingot_meteorite, new ItemRendererHot());
MinecraftForgeClient.registerItemRenderer(ModItems.ingot_meteorite_forged, new ItemRendererHot());
MinecraftForgeClient.registerItemRenderer(ModItems.blade_meteorite, new ItemRendererHot());
MinecraftForgeClient.registerItemRenderer(ModItems.blade_meteorite, new ItemRendererHot());*/
//swords and hammers
MinecraftForgeClient.registerItemRenderer(ModItems.redstone_sword, new ItemRenderRedstoneSword());
MinecraftForgeClient.registerItemRenderer(ModItems.big_sword, new ItemRenderBigSword());

View File

@ -787,12 +787,6 @@ public class CraftingManager {
GameRegistry.addShapelessRecipe(new ItemStack(ModItems.gun_sauer, 1), new Object[] { ModItems.ducttape, ModItems.gun_ks23, Blocks.lever, ModItems.gun_ks23 });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_xvl1456, 1), new Object[] { "PBB", "ACC", "PRY", 'P', "plateSteel", 'R', ModItems.redcoil_capacitor, 'A', ModItems.coil_advanced_alloy, 'B', ModItems.battery_generic, 'C', ModItems.coil_advanced_torus, 'Y', ModItems.mechanism_special }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_xvl1456_ammo, 64), new Object[] { "SSS", "SRS", "SSS", 'S', "plateSteel", 'R', ModItems.rod_quad_uranium_fuel_depleted }));
reg2();
}
public static void reg2() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_xvl1456_ammo, 32), new Object[] { " S ", "SRS", " S ", 'S', "plateSteel", 'R', ModItems.rod_dual_uranium_fuel_depleted }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { " S ", " R ", " S ", 'S', "plateSteel", 'R', ModItems.rod_uranium_fuel_depleted }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_xvl1456_ammo, 16), new Object[] { "SRS", 'S', "plateSteel", 'R', ModItems.rod_uranium_fuel_depleted }));
@ -803,6 +797,12 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_immolator_ammo, 16), new Object[] { "SPS", "PCP", "SPS", 'S', "plateSteel", 'C', "dustCoal", 'P', ModItems.powder_fire }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_immolator_ammo, 16), new Object[] { " F ", "SFS", " F ", 'S', "plateSteel", 'F', ModItems.canister_fuel }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_immolator_ammo, 24), new Object[] { " F ", "SFS", " F ", 'S', "plateSteel", 'F', ModItems.canister_napalm }));
reg2();
}
public static void reg2() {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_flamer, 1), new Object[] { "WPP", "SCT", "WMI", 'W', ModItems.wire_gold, 'P', ModItems.pipes_steel, 'S', ModItems.hull_small_steel, 'C', ModItems.coil_tungsten, 'T', ModItems.tank_steel, 'M', ModItems.mechanism_launcher_1, 'I', "ingotSteel" }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_cryolator, 1), new Object[] { "SSS", "IWL", "LMI", 'S', "plateSteel", 'I', "plateIron", 'L', Items.leather, 'M', ModItems.mechanism_launcher_1, 'W', ModItems.wire_aluminium }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.gun_cryolator_ammo, 16), new Object[] { "SPS", "PCP", "SPS", 'S', "plateSteel", 'C', "dustSaltpeter", 'P', Items.snowball }));
@ -1310,6 +1310,10 @@ public class CraftingManager {
GameRegistry.addRecipe(new ItemStack(ModItems.bj_plate, 1), new Object[] { "N N", "MSM", "NCN", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_plate, 'C', ModItems.circuit_targeting_tier5 });
GameRegistry.addRecipe(new ItemStack(ModItems.bj_legs, 1), new Object[] { "NBN", "MSM", "N N", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_legs, 'B', ModBlocks.block_starmetal });
GameRegistry.addRecipe(new ItemStack(ModItems.bj_boots, 1), new Object[] { "N N", "BSB", 'N', ModItems.plate_armor_lunar, 'S', ModItems.starmetal_boots, 'B', ModBlocks.block_starmetal });
GameRegistry.addRecipe(new ItemStack(ModItems.hev_helmet, 1), new Object[] { "PCP", "PBP", "IFI", 'P', ModItems.plate_armor_hev, 'C', ModItems.circuit_targeting_tier4, 'B', ModItems.titanium_helmet, 'I', ModItems.plate_polymer, 'F', ModItems.gas_mask_filter });
GameRegistry.addRecipe(new ItemStack(ModItems.hev_plate, 1), new Object[] { "MPM", "IBI", "PPP", 'P', ModItems.plate_armor_hev, 'B', ModItems.titanium_plate, 'I', ModItems.ingot_polymer, 'M', ModItems.motor_desh });
GameRegistry.addRecipe(new ItemStack(ModItems.hev_legs, 1), new Object[] { "MPM", "IBI", "P P", 'P', ModItems.plate_armor_hev, 'B', ModItems.titanium_legs, 'I', ModItems.ingot_polymer, 'M', ModItems.motor_desh });
GameRegistry.addRecipe(new ItemStack(ModItems.hev_boots, 1), new Object[] { "P P", "PBP", 'P', ModItems.plate_armor_hev, 'B', ModItems.titanium_boots });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.drax, 1), new Object[] { "BCF", "DDM", "BCC", 'B', ModItems.blades_advanced_alloy, 'C', "ingotCobalt", 'F', ModItems.fusion_core, 'D', "ingotDesh", 'M', ModItems.motor }));
GameRegistry.addRecipe(new ItemStack(ModItems.drax_mk2, 1), new Object[] { "SCS", "IDI", "FEF", 'S', ModItems.ingot_starmetal, 'C', ModItems.crystal_trixite, 'I', ModItems.ingot_saturnite, 'D', ModItems.drax, 'F', ModItems.fusion_core, 'E', ModItems.circuit_targeting_tier5 });
@ -1700,6 +1704,7 @@ public class CraftingManager {
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.upgrade_crystallizer, 1), new Object[] { "PHP", "CUC", "DTD", 'P', new ItemStack(ModItems.fluid_barrel_full, 1, FluidType.ACID.ordinal()), 'H', ModItems.circuit_targeting_tier4, 'C', ModBlocks.barrel_steel, 'U', ModItems.upgrade_centrifuge, 'D', ModItems.motor, 'T', ModBlocks.machine_transformer }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_armor_titanium, 1), new Object[] { "NPN", "PIP", "NPN", 'N', ModItems.bolt_tungsten, 'P', "plateTitanium", 'I', "ingotSteel" }));
GameRegistry.addRecipe(new ItemStack(ModItems.plate_armor_hev, 1), new Object[] { "NPN", "PIP", "NPN", 'N', ModItems.wire_tungsten, 'P', ModItems.plate_advanced_alloy, 'I', ModItems.plate_armor_titanium });
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.plate_armor_lunar, 1), new Object[] { "NPN", "PIP", "NPN", 'N', ModItems.wire_magnetized_tungsten, 'P', "plateDenseLead", 'I', ModItems.ingot_starmetal }));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModItems.wood_gavel, 1), new Object[] { "SWS", " R ", " R ", 'S', "slabWood", 'W', "logWood", 'R', "stickWood" }));

View File

@ -123,7 +123,6 @@ public class MainRegistry {
public static ArmorMaterial aMatHaz = EnumHelper.addArmorMaterial("HBM_HAZMAT", 60, new int[] { 2, 5, 4, 1 }, 5);
public static ArmorMaterial aMatHaz2 = EnumHelper.addArmorMaterial("HBM_HAZMAT2", 60, new int[] { 2, 5, 4, 1 }, 5);
public static ArmorMaterial aMatHaz3 = EnumHelper.addArmorMaterial("HBM_HAZMAT3", 60, new int[] { 2, 5, 4, 1 }, 5);
public static ArmorMaterial aMatT45 = EnumHelper.addArmorMaterial("HBM_T45", 1000, new int[] { 2, 5, 4, 1 }, 0);
public static ArmorMaterial aMatSteel = EnumHelper.addArmorMaterial("HBM_STEEL", 20, new int[] { 2, 6, 5, 2 }, 5);
public static ArmorMaterial aMatAsbestos = EnumHelper.addArmorMaterial("HBM_ASBESTOS", 20, new int[] { 1, 4, 3, 1 }, 5);
public static ArmorMaterial aMatTitan = EnumHelper.addArmorMaterial("HBM_TITANIUM", 25, new int[] { 3, 8, 6, 3 }, 9);
@ -235,7 +234,6 @@ public class MainRegistry {
aMatHaz.customCraftingMaterial = ModItems.hazmat_cloth;
aMatHaz2.customCraftingMaterial = ModItems.hazmat_cloth_red;
aMatHaz3.customCraftingMaterial = ModItems.hazmat_cloth_grey;
aMatT45.customCraftingMaterial = ModItems.plate_titanium;
aMatTitan.customCraftingMaterial = ModItems.ingot_titanium;
aMatSteel.customCraftingMaterial = ModItems.ingot_steel;
aMatAsbestos.customCraftingMaterial = ModItems.asbestos_cloth;

View File

@ -18,4 +18,11 @@ public class RenderFBI extends RenderBiped {
protected ResourceLocation getEntityTexture(EntityLiving entity) {
return texture;
}
public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) {
modelBipedMain.aimedBow = field_82423_g.aimedBow = field_82425_h.aimedBow = true;
super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
modelBipedMain.aimedBow = field_82423_g.aimedBow = field_82425_h.aimedBow = true;
}
}

View File

@ -7,7 +7,6 @@ public class ModelFBI extends ModelBiped {
public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float p_78088_7_) {
this.aimedBow = true;
super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_);
}
}

View File

@ -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-3719",
"version":"1.0.27-3725",
"mcversion": "1.7.10",
"url": "",
"updateUrl": "",