handheld barrel yeeting

This commit is contained in:
Boblet 2022-03-01 11:55:32 +01:00
parent d5650da0cb
commit 6441aee9d3
8 changed files with 47 additions and 1 deletions

View File

@ -210,6 +210,7 @@ public class BulletConfigSyncingUtil {
public static int NUKE_TOTS = i++;
public static int NUKE_SAFE = i++;
public static int NUKE_PUMPKIN = i++;
public static int NUKE_BARREL = i++;
public static int NUKE_PROTO_NORMAL = i++;
public static int NUKE_PROTO_LOW = i++;
public static int NUKE_PROTO_HIGH = i++;
@ -451,6 +452,7 @@ public class BulletConfigSyncingUtil {
configSet.put(NUKE_TOTS, GunFatmanFactory.getNukeTotsConfig());
configSet.put(NUKE_SAFE, GunFatmanFactory.getNukeSafeConfig());
configSet.put(NUKE_PUMPKIN, GunFatmanFactory.getNukePumpkinConfig());
configSet.put(NUKE_BARREL, GunFatmanFactory.getNukeBarrelConfig());
configSet.put(NUKE_PROTO_NORMAL, GunFatmanFactory.getNukeConfig().accuracyMod(20F));
configSet.put(NUKE_PROTO_LOW, GunFatmanFactory.getNukeLowConfig().accuracyMod(20F));
configSet.put(NUKE_PROTO_HIGH, GunFatmanFactory.getNukeHighConfig().accuracyMod(20F));

View File

@ -120,6 +120,7 @@ public class BulletConfiguration {
public static final int STYLE_METEOR = 13;
public static final int STYLE_APDS = 14;
public static final int STYLE_BLADE = 15;
public static final int STYLE_BARREL = 16;
public static final int PLINK_NONE = 0;
public static final int PLINK_BULLET = 1;

View File

@ -213,7 +213,39 @@ public class GunFatmanFactory {
@Override
public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) {
if(bullet.worldObj.isRemote) {
if(!bullet.worldObj.isRemote) {
double posX = bullet.posX;
double posY = bullet.posY + 0.5;
double posZ = bullet.posZ;
if(y >= 0) {
posX = x + 0.5;
posY = y + 1.5;
posZ = z + 0.5;
}
ExplosionLarge.spawnParticles(bullet.worldObj, posX, posY, posZ, 45);
}
}
};
return bullet;
}
public static BulletConfiguration getNukeBarrelConfig() {
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
bullet.ammo = ModItems.ammo_nuke_pumpkin;
bullet.explosive = 3F;
bullet.style = bullet.STYLE_BARREL;
bullet.bImpact = new IBulletImpactBehavior() {
@Override
public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) {
if(!bullet.worldObj.isRemote) {
double posX = bullet.posX;
double posY = bullet.posY + 0.5;

View File

@ -1551,6 +1551,7 @@ public class ModItems {
public static Item ammo_nuke_tots;
public static Item ammo_nuke_safe;
public static Item ammo_nuke_pumpkin;
public static Item ammo_nuke_barrel;
public static Item ammo_mirv;
public static Item ammo_mirv_low;
public static Item ammo_mirv_high;
@ -4216,6 +4217,7 @@ public class ModItems {
ammo_nuke_tots = new ItemAmmo().setUnlocalizedName("ammo_nuke_tots");
ammo_nuke_safe = new ItemAmmo().setUnlocalizedName("ammo_nuke_safe");
ammo_nuke_pumpkin = new ItemAmmo().setUnlocalizedName("ammo_nuke_pumpkin");
ammo_nuke_barrel = new ItemAmmo().setUnlocalizedName("ammo_nuke_barrel");
ammo_mirv = new ItemAmmo().setUnlocalizedName("ammo_mirv");
ammo_mirv_low = new ItemAmmo().setUnlocalizedName("ammo_mirv_low");
ammo_mirv_high = new ItemAmmo().setUnlocalizedName("ammo_mirv_high");
@ -7251,6 +7253,7 @@ public class ModItems {
GameRegistry.registerItem(ammo_nuke_tots, ammo_nuke_tots.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke_safe, ammo_nuke_safe.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke_pumpkin, ammo_nuke_pumpkin.getUnlocalizedName());
GameRegistry.registerItem(ammo_nuke_barrel, ammo_nuke_barrel.getUnlocalizedName());
GameRegistry.registerItem(ammo_mirv, ammo_mirv.getUnlocalizedName());
GameRegistry.registerItem(ammo_mirv_low, ammo_mirv_low.getUnlocalizedName());
GameRegistry.registerItem(ammo_mirv_high, ammo_mirv_high.getUnlocalizedName());

View File

@ -68,6 +68,7 @@ public class RenderBullet extends Render {
case BulletConfiguration.STYLE_METEOR: renderMeteor(trail); break;
case BulletConfiguration.STYLE_APDS: renderAPDS(); break;
case BulletConfiguration.STYLE_BLADE: renderBlade(); break;
case BulletConfiguration.STYLE_BARREL: renderNuke(3); break;
default: renderBullet(trail); break;
}
@ -217,6 +218,13 @@ public class RenderBullet extends Render {
case 2:
bindTexture(new ResourceLocation(RefStrings.MODID + ":textures/models/BaleFlare.png"));
bf.renderAll(0.0625F); break;
case 3:
GL11.glScaled(0.5, 0.5, 0.5);
GL11.glRotated(90, 0, 0, 1);
GL11.glRotated(90, 0, 1, 0);
bindTexture(ResourceManager.waste_drum_tex);
ResourceManager.waste_drum.renderAll();
break;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B