Some fixes(?)

Fixed some issues that should make some configs work properly. The full scale W9 shell is also implemented fully.
This commit is contained in:
UFFR 2022-10-11 21:22:44 -04:00
parent 1df36201c0
commit 65a704eb2f
No known key found for this signature in database
GPG Key ID: 1CDEFC5119049FC5
18 changed files with 268 additions and 134 deletions

View File

@ -116,12 +116,11 @@ public class Gun45ACPFactory
return config;
}
static byte i = 0;
public static BulletConfiguration get45AutoConfig()
{
final BulletConfiguration bullet = Gun9mmFactory.get9mmConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_45, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_45, 1, 0);
bullet.dmgMax = 30;
bullet.dmgMin = 27;
bullet.penetration *= 1.25;
@ -133,7 +132,7 @@ public class Gun45ACPFactory
{
final BulletConfiguration bullet = get45AutoConfig().clone();
bullet.ammo = new ComparableStack(ModItems.ammo_45, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_45, 1, 1);
bullet.dmgMax *= 1.5;
bullet.dmgMin *= 1.5;
bullet.penetration *= 1.5;
@ -145,7 +144,7 @@ public class Gun45ACPFactory
{
final BulletConfiguration bullet = get45AutoAPConfig().clone();
bullet.ammo = new ComparableStack(ModItems.ammo_45, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_45, 1, 2);
bullet.dmgMax *= 1.5;
bullet.dmgMin *= 1.5;
bullet.penetration *= 1.5;

View File

@ -123,6 +123,7 @@ public class Gun4GaugeFactory {
return config;
}
static byte i = 0;
static final BulletConfiguration stock = get4GaugeConfig();
public static BulletConfiguration get4GaugeConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardBuckshotConfig();
@ -338,7 +339,7 @@ public class Gun4GaugeFactory {
public static BulletConfiguration get4GaugeClawConfig() {
BulletConfiguration bullet = get4GaugeConfig();
BulletConfiguration bullet = stock.clone();
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge, 1, i++);
bullet.dmgMin = 6;
@ -372,7 +373,7 @@ public class Gun4GaugeFactory {
public static BulletConfiguration get4GaugeVampireConfig() {
BulletConfiguration bullet = get4GaugeConfig();
BulletConfiguration bullet = stock.clone();
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge, 1, i++);
bullet.dmgMin = 5;
@ -406,7 +407,7 @@ public class Gun4GaugeFactory {
public static BulletConfiguration get4GaugeVoidConfig() {
BulletConfiguration bullet = get4GaugeConfig();
BulletConfiguration bullet = stock.clone();
bullet.ammo = new ComparableStack(ModItems.ammo_4gauge, 1, i++);
bullet.dmgMin = 6;

View File

@ -198,12 +198,11 @@ public class Gun556mmFactory {
}
static final float inaccuracy = 1.15F;
static byte i = 0;
public static BulletConfiguration get556Config() {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 0);
bullet.spread *= inaccuracy;
bullet.dmgMin = 16;
bullet.dmgMax = 20;
@ -216,7 +215,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 1);
bullet.dmgMin = 250;
bullet.dmgMax = 320;
bullet.spread = 0.0F;
@ -228,7 +227,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 2);
bullet.wear = 15;
bullet.incendiary = 5;
bullet.doesPenetrate = false;
@ -256,7 +255,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 3);
bullet.dmgMin = 20;
bullet.dmgMax = 26;
bullet.penetration *= 1.5;
@ -270,7 +269,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 4);
bullet.dmgMin = 24;
bullet.dmgMax = 32;
bullet.penetration *= 2;
@ -284,7 +283,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 5);
bullet.dmgMin = 30;
bullet.dmgMax = 36;
bullet.penetration *= 2.5;
@ -298,7 +297,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 6);
bullet.dmgMin = 45;
bullet.dmgMax = 50;
bullet.wear = 10;
@ -339,7 +338,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 7);
bullet.vPFX = "reddust";
return bullet;
@ -349,7 +348,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556Config();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 8);
bullet.dmgMin = 26;
bullet.dmgMax = 32;
bullet.penetration = 22;
@ -366,7 +365,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 9);
bullet.incendiary = 5;
return bullet;
@ -376,7 +375,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 10);
bullet.incendiary = 5;
PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 20 * 20, 0, true);
@ -402,7 +401,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 11);
bullet.dmgMin = 46;
bullet.dmgMax = 52;
bullet.penetration *= 2.5;
@ -417,7 +416,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = get556FlechetteConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 12);
bullet.dmgMin = 45;
bullet.dmgMax = 50;
bullet.wear = 10;
@ -458,7 +457,7 @@ public class Gun556mmFactory {
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_556, 1, 13);
bullet.dmgMin = 0;
bullet.dmgMax = 0;
bullet.penetration = 0;

View File

@ -116,12 +116,12 @@ public class Gun762mmFactory
return config;
}
static byte i = 0;
public static BulletConfiguration get762NATOConfig()
{
final BulletConfiguration bullet = Gun556mmFactory.get556Config();
final BulletConfiguration bullet = Gun556mmFactory.get556Config().clone();
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, 0);
bullet.dmgMax *= 2;
bullet.dmgMin *= 2;
bullet.penetration *= 1.5;
@ -134,9 +134,9 @@ public class Gun762mmFactory
public static BulletConfiguration get762APConfig()
{
final BulletConfiguration bullet = get762NATOConfig().clone();
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, 1);
bullet.dmgMax *= 1.5;
bullet.dmgMin *= 1.5;
bullet.penetration *= 1.5;
@ -146,9 +146,9 @@ public class Gun762mmFactory
public static BulletConfiguration get762DUConfig()
{
final BulletConfiguration bullet = get762NATOConfig().clone();
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, 2);
bullet.dmgMax *= 2;
bullet.dmgMin *= 2;
bullet.penetration *= 2;
@ -158,9 +158,9 @@ public class Gun762mmFactory
public static BulletConfiguration get762TracerConfig()
{
final BulletConfiguration bullet = get762NATOConfig().clone();
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, 3);
bullet.vPFX = "reddust";
return bullet;
@ -168,9 +168,9 @@ public class Gun762mmFactory
public static BulletConfiguration get762BlankConfig()
{
final BulletConfiguration bullet = get762NATOConfig().clone();
final BulletConfiguration bullet = get762NATOConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_308, 1, 4);
bullet.dmgMax = 0;
bullet.dmgMin = 0;
bullet.penetration = 0;

View File

@ -75,10 +75,7 @@ public class GunCannonFactory {
bullet.dmgMax = 1250;
bullet.penetration = stockPen;
bullet.bImpact = (projectile, x, y, z) -> {
BulletConfigFactory.nuclearExplosion(projectile, x, y, z, 1);
};
bullet.bImpact = (projectile, x, y, z) -> BulletConfigFactory.nuclearExplosion(projectile, (int) projectile.posX, (int) projectile.posY, (int) projectile.posZ, 1);
return bullet;
}
@ -87,14 +84,14 @@ public class GunCannonFactory {
{
final BulletConfiguration bullet = getShellW9Config().clone();
bullet.ammo = new ComparableStack(ModItems.ammo_shell, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_shell, 1, 5);
bullet.bImpact = (projectile, x, y, z) ->
{
projectile.worldObj.playSoundEffect(x, y, z, "random.explode", 1.0f, projectile.worldObj.rand.nextFloat() * 0.1F + 0.9F);
projectile.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(projectile.worldObj, BombConfig.boyRadius, x + 0.5, y + 0.5, z + 0.5));
projectile.worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(projectile.worldObj, x, y, z, BombConfig.boyRadius));
projectile.worldObj.spawnEntityInWorld(EntityNukeExplosionMK4.statFac(projectile.worldObj, BombConfig.boyRadius, projectile.posX + 0.5, projectile.posY + 0.5, projectile.posZ + 0.5));
projectile.worldObj.spawnEntityInWorld(EntityNukeCloudSmall.statFac(projectile.worldObj, projectile.posX, projectile.posY, projectile.posZ, BombConfig.boyRadius));
};
return bullet;

View File

@ -600,10 +600,10 @@ public class GunEnergyFactory {
bullet.dmgProj = false;
bullet.dmgBypass = true;
bullet.style = bullet.STYLE_BOLT;
bullet.trail = bullet.BOLT_ZOMG;
bullet.style = BulletConfiguration.STYLE_BOLT;
bullet.trail = BulletConfiguration.BOLT_ZOMG;
bullet.effects = new ArrayList();
bullet.effects = new ArrayList<>();
bullet.effects.add(new PotionEffect(HbmPotion.bang.id, 10 * 20, 0));
bullet.bImpact = new IBulletImpactBehavior() {
@ -632,7 +632,7 @@ public class GunEnergyFactory {
bullet.velocity = 1F;
bullet.gravity = 0.0;
bullet.maxAge = 200;
bullet.style = bullet.STYLE_BLADE;
bullet.style = BulletConfiguration.STYLE_BLADE;
bullet.destroysBlocks = true;
bullet.doesRicochet = false;

View File

@ -125,11 +125,10 @@ public class GunFatmanFactory {
return config;
}
static byte i = 0;
public static BulletConfiguration getNukeConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 0);
bullet.bImpact = new IBulletImpactBehavior() {
@ -141,11 +140,11 @@ public class GunFatmanFactory {
return bullet;
}
public static BulletConfiguration getNukeLowConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 1);
bullet.bImpact = new IBulletImpactBehavior() {
@ -161,7 +160,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeHighConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 2);
bullet.bImpact = new IBulletImpactBehavior() {
@ -177,7 +176,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeTotsConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 3);
bullet.bulletsMin = 8;
bullet.bulletsMax = 8;
bullet.spread = 0.1F;
@ -197,7 +196,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeSafeConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 4);
bullet.bImpact = new IBulletImpactBehavior() {
@ -213,7 +212,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukePumpkinConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 5);
bullet.explosive = 10F;
bullet.bImpact = new IBulletImpactBehavior() {
@ -244,7 +243,7 @@ public class GunFatmanFactory {
public static BulletConfiguration getNukeBarrelConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 6);
bullet.explosive = 3F;
bullet.style = BulletConfiguration.STYLE_BARREL;
@ -298,7 +297,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 7);
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -335,7 +334,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeLowConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 8);
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -372,7 +371,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeHighConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 9);
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -409,7 +408,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeSafeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 10);
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -446,7 +445,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = getNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 11);
bullet.style = BulletConfiguration.STYLE_MIRV;
bullet.velocity *= 3;
@ -494,7 +493,7 @@ public class GunFatmanFactory {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, i++);
bullet.ammo = new ComparableStack(ModItems.ammo_nuke, 1, 12);
bullet.style = BulletConfiguration.STYLE_BF;
bullet.bImpact = new IBulletImpactBehavior() {

View File

@ -107,10 +107,17 @@ public class GunGrenadeFactory {
public static BulletConfiguration getGrenadeSmokeConfig()
{
BulletConfiguration bullet = getGrenadePhosphorusConfig().clone();
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_grenade, 1, i++);
bullet.explosive = 0;
bullet.velocity = 2.0F;
bullet.dmgMin = 15;
bullet.dmgMax = 15;
bullet.wear = 15;
bullet.trail = 0;
bullet.incendiary = 2;
bullet.bImpact = BulletConfigFactory.getPhosphorousEffect(20, 120 * 20, 400, 0.5, 1);
return bullet;
@ -165,9 +172,13 @@ public class GunGrenadeFactory {
public static BulletConfiguration getGrenadeFinnedConfig() {
BulletConfiguration bullet = getGrenadeConfig();
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_grenade, 1, i++);
bullet.velocity = 2.0F;
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.wear = 10;
bullet.gravity = 0.02;
bullet.explosive = 1.5F;
bullet.trail = 5;
@ -177,23 +188,24 @@ public class GunGrenadeFactory {
public static BulletConfiguration getGrenadeNuclearConfig() {
BulletConfiguration bullet = getGrenadeConfig();
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_grenade, 1, i++);
bullet.dmgMin = 10;
bullet.dmgMax = 15;
bullet.wear = 10;
bullet.trail = 0;
bullet.velocity = 4;
bullet.explosive = 0.0F;
bullet.bImpact = (projectile, x, y, z) ->
{
BulletConfigFactory.nuclearExplosion(projectile, x, y, z, 1);
};
bullet.bImpact = (projectile, x, y, z) -> BulletConfigFactory.nuclearExplosion(projectile, x, y, z, 1);
return bullet;
}
static final byte size = 25;
public static BulletConfiguration getGrenadeLunaticConfig()
{
BulletConfiguration bullet = getGrenadeConfig();
BulletConfiguration bullet = BulletConfigFactory.standardGrenadeConfig();
bullet.ammo = new ComparableStack(ModItems.ammo_grenade, 1, i++);
bullet.velocity = 4;
@ -203,7 +215,7 @@ public class GunGrenadeFactory {
bullet.bImpact = (projectile, x, y, z) ->
{
if(!projectile.worldObj.isRemote)
if (!projectile.worldObj.isRemote)
{
EntityNukeExplosionMK3 explosionEntity = new EntityNukeExplosionMK3(projectile.worldObj);
explosionEntity.posX = projectile.posX;

View File

@ -7,10 +7,13 @@ import com.hbm.entity.projectile.EntityBulletBase;
import com.hbm.explosion.ExplosionNukeGeneric;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.handler.GunConfiguration;
import com.hbm.interfaces.IBulletUpdateBehavior;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.lib.HbmCollection;
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -327,4 +330,16 @@ public class GunNPCFactory {
return bullet;
}
public static GunConfiguration getHeavySGConfig()
{
final GunConfiguration config = new GunConfiguration();
config.manufacturer = EnumGunManufacturer.COMBINE;
config.ammoCap = 12;
config.reloadDuration = 50;
config.config = HbmCollection.fourGauge;
return config;
}
}

View File

@ -65,7 +65,7 @@ public interface IHasLore
public static boolean getHasLore(String ulocIn)
{
return !getLoc(ulocIn).equals(ulocIn);
return !getLoc(ulocIn).equals(ulocIn + (MainRegistry.isPolaroid11() ? ".desc.11" : ".desc"));
}
public static boolean keyExists(String key)

View File

@ -3,6 +3,7 @@ package com.hbm.inventory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import com.hbm.config.GeneralConfig;
import com.hbm.items.ModItems;
@ -97,6 +98,9 @@ public class RecipesCommon {
public abstract String getFriendlyName();
@Override
public abstract String toString();
/**
* Generates either an ItemStack or an ArrayList of ItemStacks
* @return
@ -162,6 +166,7 @@ public class RecipesCommon {
this.meta = meta;
}
@Override
public ItemStack toStack() {
return new ItemStack(item, stacksize, meta);
}
@ -316,6 +321,15 @@ public class RecipesCommon {
{
return toStack().getDisplayName();
}
@Override
public String toString()
{
final StringBuilder builder = new StringBuilder();
builder.append("ComparableStack [item=").append(item == null ? null : item.getUnlocalizedName()).append(", meta=").append(meta).append(", stacksize=")
.append(stacksize).append(']');
return builder.toString();
}
}
/*
@ -366,6 +380,37 @@ public class RecipesCommon {
stack.stackTagCompound = this.nbt;
return stack;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = super.hashCode();
result = prime * result + Objects.hash(nbt);
return result;
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (!(obj instanceof ComparableNBTStack))
return false;
final ComparableNBTStack other = (ComparableNBTStack) obj;
return Objects.equals(nbt, other.nbt);
}
@Override
public String toString()
{
final StringBuilder builder = new StringBuilder();
builder.append("ComparableNBTStack [item=").append(item).append(", meta=").append(meta)
.append(", stacksize=").append(stacksize).append(", nbt=").append(nbt).append(']');
return builder.toString();
}
}
public static class OreDictStack extends AStack {
@ -445,7 +490,7 @@ public class RecipesCommon {
public List<ItemStack> extractForNEI() {
List<ItemStack> fromDict = OreDictionary.getOres(name);
List<ItemStack> ores = new ArrayList();
List<ItemStack> ores = new ArrayList<>();
for(ItemStack stack : fromDict) {
@ -496,6 +541,14 @@ public class RecipesCommon {
{
return name;
}
@Override
public String toString()
{
final StringBuilder builder = new StringBuilder();
builder.append("OreDictStack [name=").append(name).append(", stacksize=").append(stacksize).append(']');
return builder.toString();
}
}
public static class MetaBlock {

View File

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Random;
import com.hbm.config.GeneralConfig;
import com.hbm.interfaces.IHasLore;
import com.hbm.main.MainRegistry;
import com.hbm.util.ArmorUtil;
import com.hbm.util.I18nUtil;
@ -16,88 +17,148 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class ItemCustomLore extends Item {
EnumRarity rarity;
public class ItemCustomLore extends Item implements IHasLore
{
EnumRarity rarity = EnumRarity.common;
boolean hasEffect = false;
public String basicLore = new String();
/** New item with custom lore, assumes that it is in the localization file
* Allows rarity and shimmer effect **/
public ItemCustomLore() {}
/** New item with manually inserted lore
* Allows rarity and shimmer effect
* @param lore - The tooltip to be added using the localization
*/
public ItemCustomLore(String lore)
{
this.basicLore = lore;
}
static int setSize = 0;
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool) {
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
{
if (!basicLore.isEmpty())
list.add(I18nUtil.resolveKey(basicLore));
boolean p11 = !I18nUtil.resolveKey(this.getUnlocalizedName() + ".desc.P11").equals(this.getUnlocalizedName() + ".desc.P11");
standardLore(itemstack, list);
if(MainRegistry.polaroidID == 11 && p11) {
String unlocP11 = this.getUnlocalizedName() + ".desc.P11";
String locP11 = I18nUtil.resolveKey(unlocP11);
if (this == ModItems.undefined)
{
if(!unlocP11.equals(locP11)) {
String[] locsP11 = locP11.split("\\$");
for(String s : locsP11) {
list.add(s);
}
}
} else {
String unloc = this.getUnlocalizedName() + ".desc";
String loc = I18nUtil.resolveKey(unloc);
if(!unloc.equals(loc)) {
String[] locs = loc.split("\\$");
for(String s : locs) {
list.add(s);
}
}
}
if(this == ModItems.undefined) {
if(player.worldObj.rand.nextInt(10) == 0) {
if (player.worldObj.rand.nextInt(10) == 0)
list.add(EnumChatFormatting.DARK_RED + "UNDEFINED");
} else {
else
{
Random rand = new Random(System.currentTimeMillis() / 500);
if(setSize == 0)
if (setSize == 0)
setSize = Item.itemRegistry.getKeys().size();
int r = rand.nextInt(setSize);
Item item = Item.getItemById(r);
if(item != null) {
if(item != null)
list.add(new ItemStack(item).getDisplayName());
} else {
else
list.add(EnumChatFormatting.RED + "ERROR #" + r);
}
}
}
if(this == ModItems.pin)
{
if(ArmorUtil.checkArmorPiece(player, ModItems.jackt, 2) || ArmorUtil.checkArmorPiece(player, ModItems.jackt2, 2))
list.add(I18nUtil.resolveKey(this.getUnlocalizedName() + "desc.100"));
else
list.add(I18nUtil.resolveKey(this.getUnlocalizedName() + "desc.10"));
}
if (this == ModItems.ingot_schraranium)
if(GeneralConfig.enableLBSM)
list.add("shut up peer please for the love of god shut up i can't stand it any longer shut up shut up shut up shut up shut up");
}
/**
* Check if the item has a tooltip specified by the localization file
* @param item - The item in question
* @param special - If Polaroid ID #11 applies in this case
* @return Boolean of whether it does or not
*/
public static boolean getHasLore(Item item, boolean special)
{
String uloc = item.getUnlocalizedName() + ".desc";
if (special)
uloc += ".11";
String loc = I18nUtil.resolveKey(uloc);
return !uloc.equals(loc);
}
public static boolean getHasLore(Item item)
{
return getHasLore(item.getUnlocalizedName());
}
public static boolean getHasLore(ItemStack item)
{
return getHasLore(item.getUnlocalizedName());
}
public static boolean getHasLore(String ulocIn)
{
String uloc = ulocIn.concat(MainRegistry.isPolaroid11() ? ".desc.11" : ".desc");
String loc = I18nUtil.resolveKey(uloc);
if (loc.equals(uloc))
uloc = ulocIn.concat(".desc");
else
return true;
loc = I18nUtil.resolveKey(uloc);
return !uloc.equals(loc);
}
public static String getLoc(ItemStack stack)
{
String uloc = stack.getUnlocalizedName();
if (!getHasLore(uloc))
return null;
String testKey = uloc.concat(MainRegistry.isPolaroid11() ? ".desc.11" : ".desc");
String loc = I18nUtil.resolveKey(testKey);
if (!loc.equals(testKey))
return loc;
else
{
testKey = uloc.concat(".desc");
loc = I18nUtil.resolveKey(testKey);
return (loc.equals(testKey) ? null : loc);
}
}
static int setSize = 0;
public static boolean keyExists(String key)
{
String loc = I18nUtil.resolveKey(key);
return !(loc == key);
}
@Override
public EnumRarity getRarity(ItemStack p_77613_1_) {
return this.rarity != null ? rarity : super.getRarity(p_77613_1_);
public EnumRarity getRarity(ItemStack p_77613_1_)
{
return rarity;
}
@Override
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack p_77636_1_)
{
return hasEffect;
}
public ItemCustomLore setHasEffect()
{
if(this == ModItems.rune_isa ||
this == ModItems.rune_dagaz ||
this == ModItems.rune_hagalaz ||
this == ModItems.rune_jera ||
this == ModItems.rune_thurisaz ||
this == ModItems.egg_balefire_shard ||
this == ModItems.egg_balefire) {
return true;
}
return false;
hasEffect = true;
return this;
}
public ItemCustomLore setRarity(EnumRarity rarity) {
this.rarity = rarity;
return this;
}
}
}

View File

@ -9,11 +9,12 @@ import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemEnumMulti extends Item {
public class ItemEnumMulti extends ItemCustomLore {
//hell yes, now we're thinking with enums!
protected Class<? extends Enum<?>> theEnum;

View File

@ -174,7 +174,7 @@ public final class HbmCollection
public static final List<Integer> rocket = ImmutableList.of(BulletConfigSyncingUtil.ROCKET_NORMAL, BulletConfigSyncingUtil.ROCKET_HE, BulletConfigSyncingUtil.ROCKET_INCENDIARY, BulletConfigSyncingUtil.ROCKET_PHOSPHORUS, BulletConfigSyncingUtil.ROCKET_SHRAPNEL, BulletConfigSyncingUtil.ROCKET_EMP, BulletConfigSyncingUtil.ROCKET_GLARE, BulletConfigSyncingUtil.ROCKET_TOXIC, BulletConfigSyncingUtil.ROCKET_CANISTER, BulletConfigSyncingUtil.ROCKET_SLEEK, BulletConfigSyncingUtil.ROCKET_NUKE, BulletConfigSyncingUtil.ROCKET_CHAINSAW);
/// HASH SETS
// PRIMES
public static final Set<Integer> primes = ImmutableSet.of(3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223);
public static final Set<Integer> primes = ImmutableSet.of(3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223);
// ENERGY BULLET SPECTRAL-ABLE
public static Set<Block> energyRoundBlock;
public static Set<Material> energyRoundMaterial;

View File

@ -317,8 +317,7 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
// if(conf.ammo == slots[i].getItem())
// return conf;
if (new ComparableStack(slots[i]).isApplicable(conf.ammo))
if (conf.ammo != null && conf.ammo.matchesRecipe(slots[i], true))
return conf;
}
}
@ -784,10 +783,12 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
return this.isOn;
}
@Override
public void setPower(long i) {
this.power = i;
}
@Override
public long getPower() {
return this.power;
}

View File

@ -3,8 +3,8 @@ package com.hbm.tileentity.turret;
import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.BulletConfigSyncingUtil;
import com.hbm.handler.BulletConfiguration;
import com.hbm.lib.HbmCollection;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
@ -14,14 +14,10 @@ import net.minecraft.util.Vec3;
public class TileEntityTurretJeremy extends TileEntityTurretBaseNT {
static List<Integer> configs = new ArrayList();
static List<Integer> configs = new ArrayList<Integer>();
static {
configs.add(BulletConfigSyncingUtil.SHELL_NORMAL);
configs.add(BulletConfigSyncingUtil.SHELL_EXPLOSIVE);
configs.add(BulletConfigSyncingUtil.SHELL_AP);
configs.add(BulletConfigSyncingUtil.SHELL_DU);
configs.add(BulletConfigSyncingUtil.SHELL_W9);
configs.addAll(HbmCollection.cannon);
}
@Override
@ -82,7 +78,6 @@ public class TileEntityTurretJeremy extends TileEntityTurretBaseNT {
if(timer % 40 == 0) {
BulletConfiguration conf = this.getFirstConfigLoaded();
if(conf != null) {
this.spawnBullet(conf);
this.conusmeAmmo(conf.ammo);

View File

@ -1293,6 +1293,7 @@ item.ammo_shell.apfsds_du.name=240mm APFSDS-DU
item.ammo_shell.apfsds_t.name=240mm APFSDS-T
item.ammo_shell.explosive.name=240mm HE Shell
item.ammo_shell.w9.name=240mm W9 Nuclear Shell
item.ammo_shell.w9_true.desc=We did too much trolling
item.ammo_shell.w9_true.name=240mm W9 Nuclear Shell (Full Yield)
item.ammo_stinger_rocket.stock.name=Stinger Rocket
item.ammo_stinger_rocket.he.name=Stinger Rocket (HE)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB