Search in sources :

Example 1 with BlastEMP

use of icbm.classic.content.blast.BlastEMP in project ICBM-Classic by BuiltBrokenModding.

the class ExplosiveInit method init.

// TODO use a datafixer to flatten missiles into (ex, homing, anti, cluster)
// https://github.com/RS485/LogisticsPipes/blob/dev-mc1122/common/logisticspipes/datafixer/DataFixerSolidBlockItems.java
// https://github.com/RS485/LogisticsPipes/blob/dev-mc1122/common/logisticspipes/datafixer/LPDataFixer.java#L17-L19
// the fuse suppliers all return 100 (default in ExBlockContentReg#getFuseTime) when an unknown enum value is given as a type
public static void init() {
    // =================== Tier 1
    ICBMExplosives.CONDENSED = newEx(0, "condensed", EnumTier.ONE, () -> new BlastTNT().setBlastSize(6));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.CONDENSED.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.CONDENSED);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.CONDENSED.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.CONVENTIONAL);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.CONDENSED.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.CONDENSED);
    ICBMExplosives.SHRAPNEL = newEx(1, "shrapnel", EnumTier.ONE, () -> new BlastShrapnel().setFlaming().setBlastSize(30));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.SHRAPNEL.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.SHRAPNEL);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.SHRAPNEL.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.SHRAPNEL);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.SHRAPNEL.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.SHRAPNEL);
    ICBMExplosives.INCENDIARY = newEx(2, "incendiary", EnumTier.ONE, () -> new BlastFire().setBlastSize(14));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseTickListener(ICBMExplosives.INCENDIARY.getRegistryName(), (world, x, y, z, tick) -> world.spawnParticle(EnumParticleTypes.LAVA, x, y + 0.5D, z, 0.0D, 0.0D, 0.0D));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.INCENDIARY.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.INCENDIARY);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.INCENDIARY.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.INCENDIARY);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.INCENDIARY.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.INCENDIARY);
    ICBMExplosives.DEBILITATION = newEx(3, "debilitation", EnumTier.ONE, () -> new BlastGasBase(20 * 30, false).setConfuse().setBlastSize(20));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.DEBILITATION.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.DEBILITATION);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.DEBILITATION.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.DEBILITATION);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.DEBILITATION.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.DEBILITATION);
    ICBMExplosives.CHEMICAL = newEx(4, "chemical", EnumTier.ONE, () -> new BlastGasBase(20 * 30, false).setPoison().setRGB(0.8f, 0.8f, 0).setBlastSize(20));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.CHEMICAL.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.CHEMICAL);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.CHEMICAL.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.CHEMICAL);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.CHEMICAL.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.CHEMICAL);
    ICBMExplosives.ANVIL = newEx(5, "anvil", EnumTier.ONE, () -> new BlastShrapnel().setAnvil().setBlastSize(25));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.ANVIL.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.ANVIL);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.ANVIL.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.ANVIL);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.ANVIL.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.ANVIL);
    ICBMExplosives.REPULSIVE = newEx(6, "repulsive", EnumTier.ONE, () -> new BlastTNT().setDestroyItems().setPushType(PushType.REPEL).setBlastSize(2));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.REPULSIVE.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.REPULSIVE);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.REPULSIVE.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.REPULSIVE);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.REPULSIVE.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.REPULSIVE);
    ICBMExplosives.ATTRACTIVE = newEx(7, "attractive", EnumTier.ONE, () -> new BlastTNT().setDestroyItems().setPushType(PushType.ATTRACT).setBlastSize(2));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.ATTRACTIVE.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.ATTRACTIVE);
    ICBMClassicAPI.EX_GRENADE_REGISTRY.setFuseSupplier(ICBMExplosives.ATTRACTIVE.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.GRENADES.ATTRACTIVE);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.ATTRACTIVE.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.ATTRACTIVE);
    // =================== Tier 2
    ICBMExplosives.FRAGMENTATION = newEx(8, "fragmentation", EnumTier.TWO, () -> new BlastShrapnel().setFlaming().setExplosive().setBlastSize(15));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.FRAGMENTATION.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.FRAGMENTATION);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.FRAGMENTATION.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.FRAGMENTATION);
    ICBMExplosives.CONTAGIOUS = newEx(9, "contagious", EnumTier.TWO, () -> new BlastGasBase(20 * 30, false).setContagious().setRGB(0.3f, 0.8f, 0).setBlastSize(20));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.CONTAGIOUS.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.CONTAGIOUS);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.CONTAGIOUS.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.CONTAGIOUS);
    ICBMExplosives.SONIC = newEx(10, "sonic", EnumTier.TWO, () -> new BlastSonic().setBlastSize(15));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.SONIC.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.SONIC);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.SONIC.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.SONIC);
    ICBMExplosives.BREACHING = newEx(11, "breaching", EnumTier.TWO, () -> new BlastBreach(7).setBlastSize(2.5));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.BREACHING.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.BREACHING);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.BREACHING.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.BREACHING);
    // 12 -> Regen
    ICBMExplosives.THERMOBARIC = newEx(13, "thermobaric", EnumTier.TWO, () -> new BlastNuclear().setEnergy(45).setBlastSize(30));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.THERMOBARIC.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.THERMOBARIC);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.THERMOBARIC.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.THERMOBARIC);
    // 14 -> S-Mine
    // =================== Tier 3
    ICBMExplosives.NUCLEAR = newEx(15, "nuclear", EnumTier.THREE, () -> new BlastNuclear().setNuclear().setEnergy(80).setBlastSize(50));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.NUCLEAR.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.NUCLEAR);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.NUCLEAR.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.NUCLEAR);
    ICBMExplosives.EMP = newEx(16, "emp", EnumTier.THREE, () -> new BlastEMP().setEffectBlocks().setEffectEntities().setBlastSize(50));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.EMP.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.EMP);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.EMP.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.EMP);
    ICBMExplosives.EXOTHERMIC = newEx(17, "exothermic", EnumTier.THREE, () -> new BlastExothermic().setBlastSize(30));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseTickListener(ICBMExplosives.EXOTHERMIC.getRegistryName(), (world, x, y, z, tick) -> world.spawnParticle(EnumParticleTypes.LAVA, x, y + 0.5D, z, 0.0D, 0.0D, 0.0D));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.EXOTHERMIC.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.EXOTHERMIC);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.EXOTHERMIC.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.EXOTHERMIC);
    ICBMExplosives.ENDOTHERMIC = newEx(18, "endothermic", EnumTier.THREE, () -> new BlastEndothermic().setBlastSize(30));
    // TODO add ice fuse animation
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.ENDOTHERMIC.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.ENDOTHERMIC);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.ENDOTHERMIC.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.ENDOTHERMIC);
    ICBMExplosives.ANTI_GRAVITATIONAL = newEx(19, "antigravitational", EnumTier.THREE, () -> new BlastAntiGravitational().setBlastSize(30));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.ANTI_GRAVITATIONAL.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.ANTI_GRAVITATIONAL);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.ANTI_GRAVITATIONAL.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.ANTI_GRAVITATIONAL);
    ICBMExplosives.ENDER = newEx(20, "ender", EnumTier.THREE, () -> new BlastEnderman().setBlastSize(30));
    ICBMClassicAPI.EX_MISSILE_REGISTRY.setInteractionListener(ICBMExplosives.ENDER.getRegistryName(), ExplosiveInit::enderMissileCoordSet);
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setActivationListener(ICBMExplosives.ENDER.getRegistryName(), ExplosiveInit::enderBlockCoordSet);
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.ENDER.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.ENDER);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.ENDER.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.ENDER);
    // TODO find Missile model
    ICBMExplosives.HYPERSONIC = newEx(21, "hypersonic", EnumTier.THREE, () -> new BlastSonic().setShockWave().setBlastSize(20));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.HYPERSONIC.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.HYPERSONIC);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.HYPERSONIC.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.HYPERSONIC);
    // =================== Tier 4
    ICBMExplosives.ANTIMATTER = newEx(22, "antimatter", EnumTier.FOUR, () -> new BlastAntimatter().setBlastSize(ConfigBlast.ANTIMATTER_SIZE));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.ANTIMATTER.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.ANTIMATTER);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.ANTIMATTER.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.ANTIMATTER);
    // TODO add config (disable by default) for alarm audio
    ICBMExplosives.REDMATTER = newEx(23, "redMatter", EnumTier.FOUR, () -> new BlastRedmatter().setBlastSize(ConfigBlast.REDMATTER.NORMAL_RADIUS));
    ICBMClassicAPI.EX_BLOCK_REGISTRY.setFuseSupplier(ICBMExplosives.REDMATTER.getRegistryName(), (world, x, y, z) -> ConfigBlast.FUSE_TIMES.EXPLOSIVES.REDMATTER);
    ICBMClassicAPI.EX_MINECART_REGISTRY.setFuseSupplier(ICBMExplosives.REDMATTER.getRegistryName(), (entity) -> ConfigBlast.FUSE_TIMES.BOMB_CARTS.REDMATTER);
    // =================== No content, only blast
    ICBMExplosives.MUTATION = newEx(24, "mutation", EnumTier.NONE, BlastMutation::new);
    ICBMExplosives.ROT = newEx(25, "rot", EnumTier.NONE, BlastRot::new);
    ((ExplosiveRegistry) ICBMClassicAPI.EXPLOSIVE_REGISTRY).lockForce();
// =================== Missiles
// /* 24 */MISSILE(new MissileModule());
// /* 25 */MISSILE_HOMING(new MissileHoming());
// /* 26 */MISSILE_ANTI(new MissileAnti());
// /* 27 */MISSILE_CLUSTER(new MissileCluster("cluster", EnumTier.TWO));
// /* 28 */MISSILE_CLUSTER_NUKE(new MissileNuclearCluster())
}
Also used : BlastEnderman(icbm.classic.content.blast.BlastEnderman) BlastGasBase(icbm.classic.content.blast.BlastGasBase) BlastExothermic(icbm.classic.content.blast.BlastExothermic) BlastBreach(icbm.classic.content.blast.BlastBreach) BlastEndothermic(icbm.classic.content.blast.BlastEndothermic) BlastEMP(icbm.classic.content.blast.BlastEMP) BlastFire(icbm.classic.content.blast.BlastFire) BlastSonic(icbm.classic.content.blast.BlastSonic) ExplosiveRegistry(icbm.classic.lib.explosive.reg.ExplosiveRegistry) BlastAntiGravitational(icbm.classic.content.blast.BlastAntiGravitational) BlastNuclear(icbm.classic.content.blast.threaded.BlastNuclear) BlastAntimatter(icbm.classic.content.blast.threaded.BlastAntimatter) BlastRedmatter(icbm.classic.content.blast.BlastRedmatter) BlastTNT(icbm.classic.content.blast.BlastTNT) BlastShrapnel(icbm.classic.content.blast.BlastShrapnel)

Example 2 with BlastEMP

use of icbm.classic.content.blast.BlastEMP in project ICBM-Classic by BuiltBrokenModding.

the class TestTileEMPTower method setupForAllTests.

@BeforeAll
public static void setupForAllTests() {
    final ResourceLocation name = new ResourceLocation("ICBM:EMP");
    final IBlastFactory factory = () -> new BlastEMP().setEffectBlocks().setEffectEntities().setBlastSize(50);
    ICBMExplosives.EMP = new ExplosiveData(name, 16, EnumTier.THREE).blastFactory(factory);
}
Also used : ExplosiveData(icbm.classic.lib.explosive.reg.ExplosiveData) ResourceLocation(net.minecraft.util.ResourceLocation) IBlastFactory(icbm.classic.api.explosion.IBlastFactory) BlastEMP(icbm.classic.content.blast.BlastEMP) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

BlastEMP (icbm.classic.content.blast.BlastEMP)2 IBlastFactory (icbm.classic.api.explosion.IBlastFactory)1 BlastAntiGravitational (icbm.classic.content.blast.BlastAntiGravitational)1 BlastBreach (icbm.classic.content.blast.BlastBreach)1 BlastEnderman (icbm.classic.content.blast.BlastEnderman)1 BlastEndothermic (icbm.classic.content.blast.BlastEndothermic)1 BlastExothermic (icbm.classic.content.blast.BlastExothermic)1 BlastFire (icbm.classic.content.blast.BlastFire)1 BlastGasBase (icbm.classic.content.blast.BlastGasBase)1 BlastRedmatter (icbm.classic.content.blast.BlastRedmatter)1 BlastShrapnel (icbm.classic.content.blast.BlastShrapnel)1 BlastSonic (icbm.classic.content.blast.BlastSonic)1 BlastTNT (icbm.classic.content.blast.BlastTNT)1 BlastAntimatter (icbm.classic.content.blast.threaded.BlastAntimatter)1 BlastNuclear (icbm.classic.content.blast.threaded.BlastNuclear)1 ExplosiveData (icbm.classic.lib.explosive.reg.ExplosiveData)1 ExplosiveRegistry (icbm.classic.lib.explosive.reg.ExplosiveRegistry)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1