mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
colorful casings, more casing configs
This commit is contained in:
parent
d6b0d5b9ca
commit
e7a9fac26c
@ -141,7 +141,11 @@ public class CasingEjector implements Cloneable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public CasingEjector clone() throws CloneNotSupportedException {
|
||||
return (CasingEjector) super.clone();
|
||||
public CasingEjector clone() {
|
||||
try {
|
||||
return (CasingEjector) super.clone();
|
||||
} catch(CloneNotSupportedException e) {
|
||||
return new CasingEjector();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ public class Gun12GaugeFactory {
|
||||
bullet.dmgMin = 5;
|
||||
bullet.dmgMax = 7;
|
||||
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaStock").setColor(0x2847FF, 0x757575);
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaStock").setColor(0x2847FF, SpentCasing.COLOR_CASE_12GA);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -220,7 +220,7 @@ public class Gun12GaugeFactory {
|
||||
bullet.dmgMax = 7;
|
||||
bullet.incendiary = 5;
|
||||
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaInc").setColor(0xFF6329, 0x757575);
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaInc").setColor(0xFF6329, SpentCasing.COLOR_CASE_12GA);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -237,7 +237,7 @@ public class Gun12GaugeFactory {
|
||||
bullet.HBRC = 80;
|
||||
bullet.LBRC = 95;
|
||||
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaShrap").setColor(0xF0E800, 0x757575);
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaShrap").setColor(0xF0E800, SpentCasing.COLOR_CASE_12GA);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -253,7 +253,7 @@ public class Gun12GaugeFactory {
|
||||
bullet.doesPenetrate = true;
|
||||
bullet.leadChance = 50;
|
||||
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaDU").setColor(0x62A362, 0x757575);
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaDU").setColor(0x62A362, SpentCasing.COLOR_CASE_12GA);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -279,7 +279,7 @@ public class Gun12GaugeFactory {
|
||||
|
||||
};
|
||||
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaAM").setColor(0x416645, 0x757575);
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaAM").setColor(0x416645, SpentCasing.COLOR_CASE_12GA);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -290,7 +290,7 @@ public class Gun12GaugeFactory {
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_12gauge.stackFromEnum(Ammo12Gauge.SLEEK));
|
||||
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaIF").setColor(0x2A2A2A, 0x757575);
|
||||
bullet.spentCasing = CASING12GAUGE.clone().register("12GaIF").setColor(0x2A2A2A, SpentCasing.COLOR_CASE_12GA);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -24,12 +24,11 @@ import net.minecraft.util.Vec3;
|
||||
|
||||
public class Gun20GaugeFactory {
|
||||
|
||||
private static final CasingEjector CASING_LEVER;
|
||||
private static final CasingEjector EJECTOR_SHOTGUN;
|
||||
private static final SpentCasing CASING20GAUGE;
|
||||
|
||||
static {
|
||||
CASING_LEVER = new CasingEjector().setMotion(Vec3.createVectorHelper(-0.4, 0.95, 0)).setOffset(Vec3.createVectorHelper(-0.55, 0, 0.5)).setAngleRange(0.01F, 0.05F);
|
||||
|
||||
EJECTOR_SHOTGUN = new CasingEjector().setMotion(Vec3.createVectorHelper(-0.4, 0.95, 0)).setOffset(Vec3.createVectorHelper(-0.55, 0, 0.5)).setAngleRange(0.01F, 0.05F);
|
||||
CASING20GAUGE = new SpentCasing(CasingType.SHOTGUN).setScale(1.25F).setBounceMotion(0.01F, 0.05F);
|
||||
}
|
||||
|
||||
@ -66,7 +65,7 @@ public class Gun20GaugeFactory {
|
||||
|
||||
config.config = HbmCollection.twentyGauge;
|
||||
|
||||
config.ejector = CASING_LEVER;
|
||||
config.ejector = EJECTOR_SHOTGUN;
|
||||
|
||||
return config;
|
||||
}
|
||||
@ -221,7 +220,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.dmgMin = 3;
|
||||
bullet.dmgMax = 5;
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaStock").setColor(0xB52B2B, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaStock").setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -236,7 +235,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.wear = 7;
|
||||
bullet.style = BulletConfiguration.STYLE_NORMAL;
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaSlug").setColor(0x2A2A2A, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaSlug").setColor(0x2A2A2A, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -253,7 +252,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.HBRC = 2;
|
||||
bullet.LBRC = 95;
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaFlech").setColor(0x2847FF, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaFlech").setColor(0x2847FF, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -268,7 +267,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.wear = 15;
|
||||
bullet.incendiary = 5;
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaInc").setColor(0xFF6329, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaInc").setColor(0xFF6329, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -285,7 +284,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.HBRC = 80;
|
||||
bullet.LBRC = 95;
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaShrap").setColor(0xF0E800, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaShrap").setColor(0xF0E800, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -300,7 +299,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.wear = 25;
|
||||
bullet.explosive = 0.5F;
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaExp").setColor(0xF0E800, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaExp").setColor(0xF0E800, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -321,7 +320,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.effects = new ArrayList();
|
||||
bullet.effects.add(new PotionEffect(Potion.poison.id, 10 * 20, 1));
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaCaus").setColor(0x64E800, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaCaus").setColor(0x64E800, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -343,7 +342,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.effects.add(new PotionEffect(Potion.moveSlowdown.id, 10 * 20, 1));
|
||||
bullet.effects.add(new PotionEffect(Potion.weakness.id, 10 * 20, 4));
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaShock").setColor(0x00EFEF, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaShock").setColor(0x00EFEF, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -359,7 +358,7 @@ public class Gun20GaugeFactory {
|
||||
bullet.effects = new ArrayList();
|
||||
bullet.effects.add(new PotionEffect(Potion.wither.id, 10 * 20, 2));
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaWith").setColor(0x391717, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaWith").setColor(0x391717, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -370,7 +369,7 @@ public class Gun20GaugeFactory {
|
||||
|
||||
bullet.ammo = new ComparableStack(ModItems.ammo_20gauge.stackFromEnum(Ammo20Gauge.SLEEK));
|
||||
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaIF").setColor(0x2A2A2A, 0xEBC35E);
|
||||
bullet.spentCasing = CASING20GAUGE.clone().register("20GaIF").setColor(0x2A2A2A, SpentCasing.COLOR_CASE_BRASS);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -1,16 +1,29 @@
|
||||
package com.hbm.handler.guncfg;
|
||||
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo22LR;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class Gun22LRFactory {
|
||||
|
||||
private static final CasingEjector EJECTOR_22LR;
|
||||
private static final SpentCasing CASING22LR;
|
||||
|
||||
static {
|
||||
EJECTOR_22LR = new CasingEjector().setMotion(Vec3.createVectorHelper(-0.4, 0.1, 0)).setOffset(Vec3.createVectorHelper(-0.35, -0.2, 0.35)).setAngleRange(0.01F, 0.03F);
|
||||
CASING22LR = new SpentCasing(CasingType.STRAIGHT).setScale(0.8F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS);
|
||||
}
|
||||
|
||||
public static GunConfiguration getUziConfig() {
|
||||
|
||||
GunConfiguration config = new GunConfiguration();
|
||||
@ -36,6 +49,8 @@ public class Gun22LRFactory {
|
||||
|
||||
config.config = HbmCollection.twentyTwoLR;
|
||||
|
||||
config.ejector = EJECTOR_22LR;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -63,6 +78,8 @@ public class Gun22LRFactory {
|
||||
bullet.dmgMin = 6;
|
||||
bullet.dmgMax = 8;
|
||||
|
||||
bullet.spentCasing = CASING22LR.clone().register("22LRStock");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -77,6 +94,8 @@ public class Gun22LRFactory {
|
||||
bullet.leadChance = 10;
|
||||
bullet.wear = 15;
|
||||
|
||||
bullet.spentCasing = CASING22LR.clone().register("22LRAP");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
|
||||
@ -4,19 +4,33 @@ import java.util.ArrayList;
|
||||
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class Gun357MagnumFactory {
|
||||
|
||||
private static final CasingEjector EJECTOR_REVOLVER;
|
||||
private static final SpentCasing CASING357;
|
||||
private static final SpentCasing CASINGNM;
|
||||
|
||||
static {
|
||||
EJECTOR_REVOLVER = new CasingEjector().setMotion(Vec3.createVectorHelper(0, 0, -0.03)).setOffset(Vec3.createVectorHelper(0, -0.15, 0)).setAngleRange(0.01F, 0.05F).setAfterReload().setAmount(6);
|
||||
CASING357 = new SpentCasing(CasingType.STRAIGHT).setBounceMotion(0.01F, 0.05F);
|
||||
CASINGNM = new SpentCasing(CasingType.SHOTGUN).setScale(1.25F).setBounceMotion(0.01F, 0.05F).setColor(0xC7AB1C, 0x6D63A6).register("357N2");
|
||||
}
|
||||
|
||||
public static GunConfiguration getBaseConfig() {
|
||||
|
||||
GunConfiguration config = new GunConfiguration();
|
||||
@ -35,6 +49,8 @@ public class Gun357MagnumFactory {
|
||||
config.firingSound = "hbm:weapon.revolverShoot";
|
||||
config.reloadSoundEnd = false;
|
||||
|
||||
config.ejector = EJECTOR_REVOLVER;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -223,6 +239,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMin = 8;
|
||||
bullet.dmgMax = 10;
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Iron").setColor(0xA8A8A8);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -234,6 +252,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMin = 18;
|
||||
bullet.dmgMax = 22;
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Lead").setColor(0x646470);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -248,6 +268,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.effects = new ArrayList();
|
||||
bullet.effects.add(new PotionEffect(HbmPotion.radiation.id, 10 * 20, 4));
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Nuc").setColor(0xFEFEFE);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -259,6 +281,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMin = 25;
|
||||
bullet.dmgMax = 28;
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Gold").setColor(0xF9FF3E);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -270,6 +294,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMin = 30;
|
||||
bullet.dmgMax = 33;
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Desh").setColor(0xF22929);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -282,6 +308,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMax = 100000;
|
||||
bullet.instakill = true;
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Schrab").setColor(0x32FFFF);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -293,6 +321,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMin = 18;
|
||||
bullet.dmgMax = 25;
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Cursed").setColor(0x565656);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -304,6 +334,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMin = 1;
|
||||
bullet.dmgMax = 100;
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357N1").setColor(0x3A3A3A);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -324,6 +356,8 @@ public class Gun357MagnumFactory {
|
||||
|
||||
bullet.damageType = ModDamageSource.s_laser;
|
||||
|
||||
bullet.spentCasing = CASINGNM;
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import com.hbm.entity.projectile.EntityBulletBase;
|
||||
import com.hbm.entity.projectile.EntityDuchessGambit;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.GunConfiguration;
|
||||
import com.hbm.interfaces.IBulletHitBehavior;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
@ -19,6 +20,8 @@ import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
@ -26,9 +29,18 @@ import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.Vec3;
|
||||
|
||||
public class Gun44MagnumFactory {
|
||||
|
||||
private static final CasingEjector EJECTOR_PIP;
|
||||
private static final SpentCasing CASING44;
|
||||
|
||||
static {
|
||||
EJECTOR_PIP = new CasingEjector().setMotion(Vec3.createVectorHelper(0, 0, -0.05)).setOffset(Vec3.createVectorHelper(0, -0.15, 0)).setAngleRange(0.01F, 0.05F).setAfterReload().setAmount(6);
|
||||
CASING44 = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F, 1.0F, 1.5F).setBounceMotion(0.01F, 0.05F).setColor(SpentCasing.COLOR_CASE_44);
|
||||
}
|
||||
|
||||
public static GunConfiguration getBaseConfig() {
|
||||
|
||||
GunConfiguration config = new GunConfiguration();
|
||||
@ -49,6 +61,8 @@ public class Gun44MagnumFactory {
|
||||
|
||||
config.config.addAll(HbmCollection.fourtyFourMagBasic);
|
||||
|
||||
config.ejector = EJECTOR_PIP;
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -97,6 +111,8 @@ public class Gun44MagnumFactory {
|
||||
config.config.add(BulletConfigSyncingUtil.M44_BJ);
|
||||
config.config.addAll(HbmCollection.fourtyFourMagBasic);
|
||||
|
||||
config.ejector = EJECTOR_PIP.clone().setAmount(5);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -134,6 +150,8 @@ public class Gun44MagnumFactory {
|
||||
config.config = new ArrayList<Integer>();
|
||||
config.config.addAll(HbmCollection.fourtyFourMagAll);
|
||||
|
||||
config.ejector = EJECTOR_PIP.clone().setAmount(64);
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -145,6 +163,8 @@ public class Gun44MagnumFactory {
|
||||
bullet.dmgMin = 18;
|
||||
bullet.dmgMax = 26;
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44NoPip");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -158,6 +178,8 @@ public class Gun44MagnumFactory {
|
||||
bullet.wear = 15;
|
||||
bullet.leadChance = 10;
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44AP");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -171,6 +193,8 @@ public class Gun44MagnumFactory {
|
||||
bullet.wear = 25;
|
||||
bullet.leadChance = 50;
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44DU");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -205,6 +229,8 @@ public class Gun44MagnumFactory {
|
||||
}
|
||||
};
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44Phos");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -218,6 +244,8 @@ public class Gun44MagnumFactory {
|
||||
bullet.wear = 25;
|
||||
bullet.leadChance = 100;
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44Star");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -255,6 +283,8 @@ public class Gun44MagnumFactory {
|
||||
}
|
||||
};
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44Pip").setColor(0x532C64);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -293,6 +323,8 @@ public class Gun44MagnumFactory {
|
||||
|
||||
};
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44BJ").setColor(0x632B2C);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -331,6 +363,8 @@ public class Gun44MagnumFactory {
|
||||
|
||||
};
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44Silver").setColor(0x2B5963);
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -343,6 +377,8 @@ public class Gun44MagnumFactory {
|
||||
bullet.explosive = 15F;
|
||||
bullet.trail = 1;
|
||||
|
||||
bullet.spentCasing = CASING44.clone().register("44Rocket");
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.particle;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@ -14,10 +15,12 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -53,7 +56,7 @@ public class ParticleSpentCasing extends EntityFX
|
||||
motionY = my;
|
||||
motionZ = mz;
|
||||
|
||||
particleGravity = 8f;
|
||||
particleGravity = 8F;
|
||||
|
||||
maxHeight = y;
|
||||
}
|
||||
@ -130,6 +133,15 @@ public class ParticleSpentCasing extends EntityFX
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
double pX = prevPosX + (posX - prevPosX) * interp;
|
||||
double pY = prevPosY + (posY - prevPosY) * interp;
|
||||
double pZ = prevPosZ + (posZ - prevPosZ) * interp;
|
||||
|
||||
int brightness = worldObj.getLightBrightnessForSkyBlocks(MathHelper.floor_double(pX), MathHelper.floor_double(pY), MathHelper.floor_double(pZ), 0);
|
||||
int lX = brightness % 65536;
|
||||
int lY = brightness / 65536;
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)lX / 1.0F, (float)lY / 1.0F);
|
||||
|
||||
textureManager.bindTexture(ResourceManager.casings_tex);
|
||||
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
@ -137,7 +149,7 @@ public class ParticleSpentCasing extends EntityFX
|
||||
double dY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)interp;
|
||||
double dZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)interp;
|
||||
|
||||
GL11.glTranslated(prevPosX + (posX - prevPosX) * interp - dX, prevPosY + (posY - prevPosY) * interp - dY - this.height / 4, prevPosZ + (posZ - prevPosZ) * interp - dZ);
|
||||
GL11.glTranslated(pX - dX, pY - dY - this.height / 4, pZ - dZ);
|
||||
|
||||
GL11.glScalef(dScale, dScale, dScale);
|
||||
|
||||
@ -146,11 +158,16 @@ public class ParticleSpentCasing extends EntityFX
|
||||
|
||||
GL11.glScalef(config.getScaleX(), config.getScaleY(), config.getScaleZ());
|
||||
|
||||
int index = 0;
|
||||
for(String name : config.getType().partNames) {
|
||||
//TODO: set part color
|
||||
int col = this.config.getColors()[index]; //unsafe on purpose, set your colors properly or else...!
|
||||
Color color = new Color(col);
|
||||
GL11.glColor3f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
ResourceManager.casings.renderPart(name);
|
||||
index++;
|
||||
}
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
/*if(!smokeNodes.isEmpty()) {
|
||||
@ -190,11 +207,27 @@ public class ParticleSpentCasing extends EntityFX
|
||||
GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1F);
|
||||
}*/
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float p_70070_1_) {
|
||||
int i = MathHelper.floor_double(this.posX);
|
||||
int j = MathHelper.floor_double(this.posZ);
|
||||
|
||||
if(this.worldObj.blockExists(i, 0, j)) {
|
||||
double d0 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
|
||||
int k = MathHelper.floor_double(this.posY - (double) this.yOffset + d0);
|
||||
return this.worldObj.getLightBrightnessForSkyBlocks(i, k, j, 0);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void tryPlayBounceSound() {
|
||||
|
||||
String sound = config.getSound();
|
||||
|
||||
@ -7,13 +7,17 @@ import java.util.HashMap;
|
||||
* @author uffr, hbm
|
||||
*/
|
||||
public class SpentCasing implements Cloneable {
|
||||
|
||||
public static final int COLOR_CASE_BRASS = 0xEBC35E;
|
||||
public static final int COLOR_CASE_12GA = 0x757575;
|
||||
public static final int COLOR_CASE_44 = 0x3E3E3E;
|
||||
|
||||
public static final HashMap<String, SpentCasing> casingMap = new HashMap();
|
||||
|
||||
public enum CasingType {
|
||||
BRASS_STRAIGHT_WALL("Straight"),
|
||||
BRASS_BOTTLENECK("Bottleneck"),
|
||||
SHOTGUN("Shotgun", "ShotgunBase"), //plastic shell, brass case
|
||||
STRAIGHT("Straight"),
|
||||
BOTTLENECK("Bottleneck"),
|
||||
SHOTGUN("Shotgun", "ShotgunCase"), //plastic shell, brass case
|
||||
AR2("AR2", "AR2Highlight"); //plug, back detailing
|
||||
|
||||
public final String[] partNames;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 9.9 KiB After Width: | Height: | Size: 338 B |
BIN
src/main/resources/assets/hbm/textures/particle/casings_base.png
Normal file
BIN
src/main/resources/assets/hbm/textures/particle/casings_base.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 492 B |
Loading…
x
Reference in New Issue
Block a user