mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
Compare commits
No commits in common. "d050b5966d397e083446cdeeeba2b06b59c33788" and "6caea5ecc451da4607b08ca1307b9f1fb2def23e" have entirely different histories.
d050b5966d
...
6caea5ecc4
56
changelog
56
changelog
@ -1,37 +1,29 @@
|
||||
## Added
|
||||
* New grenades
|
||||
* Universal system where there's only one grenade item
|
||||
* A grenade is composed of a shell, filling and fuze, which can be mixed and matched as needed
|
||||
* Instead of having dedicated grenades with impact or long timers, the desired fuze can simply be put into any grenade configuration
|
||||
* Comes with proper 3D models and animations
|
||||
* Grenade max stacksize has been drastically reduced (and now depends on the shell used)
|
||||
* Plasma forge
|
||||
* Plasma-powered assembly machine
|
||||
* Used to produce lategame items that until now were regular assembler recipes
|
||||
* Can pass on plasma, 25% of the plasma energy that passes through a plasma forge is consumed
|
||||
* This allows plasma forges to be chained, or unused residue energy to be used in turbines
|
||||
* Parts that interact with the fusion reactor directly, like the collector chambers, are not compatible
|
||||
* Like all assembler-type machines, features custom animations (i spent a lot of time on those, please look at them for prolonged periods of time, ideally without blinking)
|
||||
* Base production rates for plasma forge exclusive recipes are very slow
|
||||
* Does not accept upgrades, however, can use up otherwise useless fission fragments and unstable isotopes to gain a temporary x4 speed bonus with no penalty
|
||||
* Can also assemble fusion reactor vessels, which are cheaper but need quantum circuits
|
||||
|
||||
## Changed
|
||||
* Removed the euphemium and DNT compound plate recipes from the anvil, they are now plasma forge exclusive
|
||||
* More RoR integration
|
||||
* PWRs can now output the control rod position
|
||||
* Industrial turbines and leviathans can now output their current energy production
|
||||
* Industrial turbines can output their current flywheel speed in %
|
||||
* The ZIRNOX now outputs its heat and pressure
|
||||
* The CCGT can output the turbine setting in percent, the turbine's RPM and the produced energy
|
||||
* The fusion reactor plasma vessel can output its output plasma energy and fuel consumption in percent
|
||||
* Cast plate foundry molds now have a triple variant
|
||||
* Zombies now have a chance to drop copper, aluminium and titanium ingots (1:200 each)
|
||||
* The burner press now has nine additional storage slots for things like stamps and reserve fuel
|
||||
* Improved minigun muzzleflash
|
||||
* The flash is now faster and larger
|
||||
* Moved the origin up to be at the firing barrel instead of the center of the rotor
|
||||
* Doubled bismuth and tantalum yields from high-performance solvent bedrock ore processing
|
||||
* Hoppers and buckets can now be made out of steel
|
||||
* RoR gauges now show the lowest and highest configured value on the actual gauge
|
||||
* The steel sword now looks like a medieval broad sword with the appropriate scale
|
||||
* All remaining items have been removed from the template folder, siren tracks and plate stamps are now made in the anvil
|
||||
* Gerald assembly now requires stellar flux
|
||||
* The DFC parts are now made in the plasma forge, with the recipes being more expensive
|
||||
* The restrictions for firing Folly (using the scope, waiting for the startup) no longer apply to NPCs (which can never fulfill them anyway), allowing them to actually use it
|
||||
* The plinking sound played when a drill cannot break a block now only plays once for the entire AoE instead of once for every single block that couldn't be broken
|
||||
* Fluid barrels now have a sideways connector when hooked up to pipes, bridging the two pixel gap
|
||||
|
||||
## Fixed
|
||||
* Fixed euphemium compound plate recipe not yielding four items as it should in the plasma forge
|
||||
* Fixed NTM rare item drops ignoring the mob loot gamerule
|
||||
* Fixed flamethrowers not properly igniting entities on direct hit, only via lingering fire
|
||||
* Fixed PWR RoR components not properly showing the possible values/functions when connected to ports
|
||||
* Fixed missing ports on the plasma forge
|
||||
* Fixed wrong texture being bound in the crucible for the molten metal gauge
|
||||
* Fixed RoR panels having no hardness at all
|
||||
* Undid the change to the crucible where using no recipe would fill up the recipe stack anyway because people would NOT STOP smelting stuff then setting the recipe after the fact which DOES NOT WORK.
|
||||
* This change however introduced yet another inconsistency with external pouring behavior that I simply cannot be assed to fix, so we are just rolling all that back
|
||||
* If you're still to dumb, old or irradiated to use the crucible correctly, please bother LITERALLY ANOYNE EXCEPT ME.
|
||||
* This basically fixes the aforementioned inconsistency
|
||||
* Fixed meteorite sword progression having some issues ever since the fusion reactor rework
|
||||
* Fixed size 15 dual kerosene thruster not rendering at all
|
||||
* Fixed HUD/jetpack toggle popup not working at all on multiplayer servers
|
||||
* Fixed assembly machine NEI handler not being able to handle all thirteen inputs at once
|
||||
* Fixed RBMK fuel channels playing the meltdown sound when broken while hot with meltdowns disabled
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5649
|
||||
mod_build_number=5634
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
package api.hbm.ntl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@ -12,7 +11,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class StorageManifest {
|
||||
|
||||
public LinkedHashMap<Integer, MetaNode> itemMeta = new LinkedHashMap();
|
||||
public HashMap<Integer, MetaNode> itemMeta = new HashMap();
|
||||
|
||||
public void writeStack(ItemStack stack) {
|
||||
int id = Item.getIdFromItem(stack.getItem());
|
||||
@ -39,7 +38,7 @@ public class StorageManifest {
|
||||
nbt.nbtAmount.put(compound, amount);
|
||||
}
|
||||
|
||||
public List<StorageStack> getStacks(boolean sorted) {
|
||||
public List<StorageStack> getStacks() {
|
||||
List<StorageStack> stacks = new ArrayList();
|
||||
|
||||
for(Entry<Integer, MetaNode> itemNode : itemMeta.entrySet()) {
|
||||
@ -54,16 +53,16 @@ public class StorageManifest {
|
||||
}
|
||||
}
|
||||
|
||||
if(sorted) Collections.sort(stacks);
|
||||
|
||||
return stacks;
|
||||
}
|
||||
|
||||
public class MetaNode {
|
||||
public LinkedHashMap<Integer, NBTNode> metaNBT = new LinkedHashMap();
|
||||
|
||||
public HashMap<Integer, NBTNode> metaNBT = new HashMap();
|
||||
}
|
||||
|
||||
public class NBTNode {
|
||||
public LinkedHashMap<NBTTagCompound, Long> nbtAmount = new LinkedHashMap();
|
||||
|
||||
public HashMap<NBTTagCompound, Long> nbtAmount = new HashMap();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,14 @@
|
||||
package api.hbm.ntl;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class StorageStack implements Comparable {
|
||||
public class StorageStack {
|
||||
|
||||
private int cachedItemId;
|
||||
private ItemStack type;
|
||||
private long amount;
|
||||
|
||||
public StorageStack(ItemStack type) {
|
||||
this(type, type.stackSize);
|
||||
this.cachedItemId = Item.getIdFromItem(type.getItem());
|
||||
}
|
||||
|
||||
public StorageStack(ItemStack type, long amount) {
|
||||
@ -27,27 +24,4 @@ public class StorageStack implements Comparable {
|
||||
public long getAmount() {
|
||||
return this.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object o) {
|
||||
StorageStack other = (StorageStack) o;
|
||||
|
||||
if(this.cachedItemId < other.cachedItemId) return -1;
|
||||
if(this.cachedItemId > other.cachedItemId) return 1;
|
||||
if(this.type.getItemDamage() < other.type.getItemDamage()) return -1;
|
||||
if(this.type.getItemDamage() > other.type.getItemDamage()) return 1;
|
||||
if(this.type.hasTagCompound() && !other.type.hasTagCompound()) return -1;
|
||||
if(!this.type.hasTagCompound() && other.type.hasTagCompound()) return 1;
|
||||
if(this.type.hasTagCompound() && other.type.hasTagCompound()) {
|
||||
// keyset size comparison should hopefully catch most of the larger NBT cases
|
||||
if(this.type.stackTagCompound.func_150296_c().size() < other.type.stackTagCompound.func_150296_c().size()) return -1;
|
||||
if(this.type.stackTagCompound.func_150296_c().size() > other.type.stackTagCompound.func_150296_c().size()) return 1;
|
||||
int comp = this.type.stackTagCompound.toString().compareTo(other.type.stackTagCompound.toString()); // not terribly performant but hopefully not that common
|
||||
if(comp != 0) return comp;
|
||||
}
|
||||
if(this.type.stackSize < other.type.stackSize) return -1;
|
||||
if(this.type.stackSize > other.type.stackSize) return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1090,12 +1090,9 @@ public class ModBlocks {
|
||||
public static Block rbmk_heater;
|
||||
public static Block rbmk_console;
|
||||
public static Block rbmk_crane_console;
|
||||
public static Block rbmk_display_blank;
|
||||
public static Block rbmk_display;
|
||||
public static Block rbmk_key_pad;
|
||||
public static Block rbmk_gauge;
|
||||
public static Block rbmk_numitron;
|
||||
public static Block rbmk_graph;
|
||||
public static Block rbmk_autoloader;
|
||||
public static Block rbmk_loader;
|
||||
public static Block rbmk_steam_inlet;
|
||||
@ -1150,6 +1147,10 @@ public class ModBlocks {
|
||||
public static Block gas_explosive;
|
||||
public static Block vacuum;
|
||||
|
||||
@Deprecated public static Block absorber;
|
||||
@Deprecated public static Block absorber_red;
|
||||
@Deprecated public static Block absorber_green;
|
||||
@Deprecated public static Block absorber_pink;
|
||||
public static Block rad_absorber;
|
||||
public static Block decon;
|
||||
|
||||
@ -2112,12 +2113,9 @@ public class ModBlocks {
|
||||
rbmk_heater = new RBMKHeater().setBlockName("rbmk_heater").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_heater");
|
||||
rbmk_console = new RBMKConsole().setBlockName("rbmk_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_console");
|
||||
rbmk_crane_console = new RBMKCraneConsole().setBlockName("rbmk_crane_console").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_crane_console");
|
||||
rbmk_display_blank = new RBMKMiniPanelBase().setBlockName("rbmk_display_blank").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
|
||||
rbmk_display = new RBMKDisplay().setBlockName("rbmk_display").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
|
||||
rbmk_key_pad = new RBMKKeyPad().setBlockName("rbmk_key_pad").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
|
||||
rbmk_gauge = new RBMKGauge().setBlockName("rbmk_gauge").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
|
||||
rbmk_numitron = new RBMKNumitron().setBlockName("rbmk_numitron").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
|
||||
rbmk_graph = new RBMKGraph().setBlockName("rbmk_graph").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display");
|
||||
rbmk_autoloader = new RBMKAutoloader().setBlockName("rbmk_autoloader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_autoloader");
|
||||
rbmk_loader = new RBMKLoader(Material.iron).setBlockName("rbmk_loader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_loader");
|
||||
rbmk_steam_inlet = new RBMKInlet(Material.iron).setBlockName("rbmk_steam_inlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_inlet");
|
||||
@ -2284,6 +2282,11 @@ public class ModBlocks {
|
||||
gas_explosive = new BlockGasExplosive().setBlockName("gas_explosive").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":gas_explosive");
|
||||
vacuum = new BlockVacuum().setBlockName("vacuum").setResistance(1000000F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":vacuum");
|
||||
|
||||
absorber = new BlockGeneric(Material.iron).setBlockName("absorber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
|
||||
absorber_red = new BlockGeneric(Material.iron).setBlockName("absorber_red").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
|
||||
absorber_green = new BlockGeneric(Material.iron).setBlockName("absorber_green").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
|
||||
absorber_pink = new BlockGeneric(Material.iron).setBlockName("absorber_pink").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_deprecated");
|
||||
|
||||
rad_absorber = new BlockAbsorber(Material.iron).setBlockName("rad_absorber").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
decon = new BlockDecon(Material.iron).setBlockName("decon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":decon_side");
|
||||
|
||||
@ -3104,12 +3107,9 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(rbmk_heater, rbmk_heater.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_console, rbmk_console.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rbmk_crane_console, rbmk_crane_console.getUnlocalizedName());
|
||||
register(rbmk_display_blank);
|
||||
register(rbmk_display);
|
||||
register(rbmk_key_pad);
|
||||
register(rbmk_gauge);
|
||||
register(rbmk_numitron);
|
||||
register(rbmk_graph);
|
||||
register(rbmk_autoloader);
|
||||
register(rbmk_loader);
|
||||
register(rbmk_steam_inlet);
|
||||
@ -3303,6 +3303,10 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(struct_icf_core, struct_icf_core.getUnlocalizedName());
|
||||
|
||||
//Absorbers
|
||||
GameRegistry.registerBlock(absorber, absorber.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(absorber_red, absorber_red.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(absorber_green, absorber_green.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(absorber_pink, absorber_pink.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rad_absorber, ItemBlockBase.class, rad_absorber.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(decon, decon.getUnlocalizedName());
|
||||
|
||||
|
||||
@ -6,11 +6,6 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeUniversal;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeExtra.EnumGrenadeExtra;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFuze.EnumGrenadeFuze;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBatteryPack.EnumBatteryPack;
|
||||
@ -60,9 +55,10 @@ public class BlockCrate extends BlockFalling {
|
||||
// Supply Crate
|
||||
BlockCrate.addToListWithWeight(crateList, ModItems.syringe_metal_stimpak, 10);
|
||||
BlockCrate.addToListWithWeight(crateList, ModItems.syringe_antidote, 5);
|
||||
BlockCrate.addToListWithWeight(crateList, ItemGrenadeUniversal.make(EnumGrenadeShell.FRAG, EnumGrenadeFilling.HE, EnumGrenadeFuze.S3, EnumGrenadeExtra.FRAG_SLEEVE), 8);
|
||||
BlockCrate.addToListWithWeight(crateList, ItemGrenadeUniversal.make(EnumGrenadeShell.STICK, EnumGrenadeFilling.HE, EnumGrenadeFuze.IMPACT), 6);
|
||||
BlockCrate.addToListWithWeight(crateList, ItemGrenadeUniversal.make(EnumGrenadeShell.FRAG, EnumGrenadeFilling.INC, EnumGrenadeFuze.S7), 4);
|
||||
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_generic, 8);
|
||||
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_strong, 6);
|
||||
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_mk2, 4);
|
||||
BlockCrate.addToListWithWeight(crateList, ModItems.grenade_flare, 4);
|
||||
BlockCrate.addToListWithWeight(crateList, ModItems.ammo_container, 2);
|
||||
|
||||
// Weapon Crate
|
||||
|
||||
@ -342,7 +342,10 @@ public class BlockPWR extends BlockContainer implements IBlockCT {
|
||||
|
||||
@Override
|
||||
public String[] getFunctionInfo() {
|
||||
return TileEntityPWRController.ROR;
|
||||
if(this.getBlockMetadata() != 1) return new String[0];
|
||||
TileEntityPWRController controller = this.getCore();
|
||||
if(controller != null) return controller.getFunctionInfo();
|
||||
return new String[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -350,7 +353,7 @@ public class BlockPWR extends BlockContainer implements IBlockCT {
|
||||
if(this.getBlockMetadata() != 1) return "";
|
||||
TileEntityPWRController controller = this.getCore();
|
||||
if(controller != null) return controller.provideRORValue(name);
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -358,7 +361,7 @@ public class BlockPWR extends BlockContainer implements IBlockCT {
|
||||
if(this.getBlockMetadata() != 1) return "";
|
||||
TileEntityPWRController controller = this.getCore();
|
||||
if(controller != null) return controller.runRORFunction(name, params);
|
||||
return null;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,6 +149,9 @@ public class MachineCrucible extends BlockDummyable implements ICrucibleAcceptor
|
||||
float exp = 0.002F;
|
||||
|
||||
ICustomBlockHighlight.setup();
|
||||
/*event.context.drawOutlinedBoundingBox(AxisAlignedBB.getBoundingBox(x - 1, y, z - 1, x + 2, y + 0.5, z + 2).expand(exp, exp, exp).getOffsetBoundingBox(-dX, -dY, -dZ), -1);
|
||||
event.context.drawOutlinedBoundingBox(AxisAlignedBB.getBoundingBox(x - 0.75, y + 0.5, z - 0.75, x + 1.75, y + 1.5, z + 1.75).expand(exp, exp, exp).getOffsetBoundingBox(-dX, -dY, -dZ), -1);
|
||||
event.context.drawOutlinedBoundingBox(AxisAlignedBB.getBoundingBox(x - 0.5, y + 0.75, z - 0.5, x + 1.5, y + 1.5, z + 1.5).expand(exp, exp, exp).getOffsetBoundingBox(-dX, -dY, -dZ), -1);*/
|
||||
for(AxisAlignedBB aabb : this.bounding) event.context.drawOutlinedBoundingBox(aabb.expand(exp, exp, exp).getOffsetBoundingBox(x - dX + 0.5, y - dY, z - dZ + 0.5), -1);
|
||||
ICustomBlockHighlight.cleanup();
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.blocks.machine.fusion;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.fusion.TileEntityFusionPlasmaForge;
|
||||
|
||||
@ -29,42 +28,11 @@ public class MachineFusionPlasmaForge extends BlockDummyable {
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] { 2, 0, 2, 2, 5, 5 }; }
|
||||
@Override public int[] getDimensions() { return new int[] { 0, 0, 5, 5, 5, 5 }; }
|
||||
@Override public int getOffset() { return 5; }
|
||||
|
||||
@Override
|
||||
public boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
return super.checkRequirement(world, x, y, z, dir, o) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 3, -2, 4, 4}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -2, 3, 4, 4}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 4, -3, 3, 3}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -3, 4, 3, 3}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 5, -4, 2, 2}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -4, 5, 2, 2}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -2, 1, 1, 5, 5}, x, y, z, dir) &&
|
||||
MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {4, -3, 0, 0, 4, 4}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 3, -2, 4, 4}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -2, 3, 4, 4}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 4, -3, 3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -3, 4, 3, 3}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, 5, -4, 2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {2, 0, -4, 5, 2, 2}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {3, -2, 1, 1, 5, 5}, this, dir);
|
||||
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o, y + dir.offsetY * o, z + dir.offsetZ * o, new int[] {4, -3, 0, 0, 4, 4}, this, dir);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
for(int i = -2; i <= 2; i++) {
|
||||
this.makeExtra(world, x + dir.offsetX * 5 + rot.offsetX * i, y, z + dir.offsetZ * 5 + rot.offsetZ * i);
|
||||
this.makeExtra(world, x - dir.offsetX * 5 + rot.offsetX * i, y, z - dir.offsetZ * 5 + rot.offsetZ * i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.tileentity.RenderArcFurnace;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKGauge;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
@ -28,39 +22,4 @@ public class RBMKGauge extends RBMKMiniPanelBase implements IToolable {
|
||||
if(world.isRemote) FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
super.renderInventoryBlock(block, meta, modelId, renderBlocks);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.25, (i / 2) * -0.5 + 0.25, (i % 2) * -0.5 + 0.25);
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rbmk_gauge_tex);
|
||||
ResourceManager.rbmk_gauge.renderPart("Gauge");
|
||||
|
||||
GL11.glColor3f(0.5F, 0F, 0F);
|
||||
GL11.glTranslated(0, 0.4375, -0.125);
|
||||
GL11.glRotated(85, 1, 0, 0);
|
||||
GL11.glTranslated(0, -0.4375, 0.125);
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
RenderArcFurnace.fullbright(true);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
ResourceManager.rbmk_gauge.renderPart("Needle");
|
||||
RenderArcFurnace.fullbright(false);
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKGraph;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RBMKGraph extends RBMKMiniPanelBase implements IToolable {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityRBMKGraph();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
if(tool != ToolType.SCREWDRIVER) return false;
|
||||
if(world.isRemote) FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
super.renderInventoryBlock(block, meta, modelId, renderBlocks);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.25, i * -0.5 + 0.25, 0);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rbmk_numitron_tex);
|
||||
ResourceManager.rbmk_numitron.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,10 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKKeyPad;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
@ -53,29 +48,4 @@ public class RBMKKeyPad extends RBMKMiniPanelBase implements IToolable {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
super.renderInventoryBlock(block, meta, modelId, renderBlocks);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.25, (i / 2) * -0.5 + 0.25, (i % 2) * -0.5 + 0.25);
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rbmk_keypad_tex);
|
||||
ResourceManager.rbmk_button.renderPart("Socket");
|
||||
GL11.glColor3f(0.65F, 0F, 0F);
|
||||
ResourceManager.rbmk_button.renderPart("Button");
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,22 +15,14 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RBMKMiniPanelBase extends BlockContainer implements ISBRHUniversal {
|
||||
public abstract class RBMKMiniPanelBase extends BlockContainer implements ISBRHUniversal {
|
||||
|
||||
public RBMKMiniPanelBase() {
|
||||
super(Material.iron);
|
||||
this.setHardness(3F);
|
||||
this.setResistance(30F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public int getRenderType() { return renderID; }
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
package com.hbm.blocks.machine.rbmk;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKNumitron;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class RBMKNumitron extends RBMKMiniPanelBase implements IToolable {
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityRBMKNumitron();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
if(tool != ToolType.SCREWDRIVER) return false;
|
||||
if(world.isRemote) FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) {
|
||||
super.renderInventoryBlock(block, meta, modelId, renderBlocks);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
GL11.glRotated(-90, 0, 1, 0);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.25, i * -0.5 + 0.25, 0);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rbmk_numitron_tex);
|
||||
ResourceManager.rbmk_numitron.renderAll();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -21,6 +21,7 @@ public class ServerConfig extends RunningConfig {
|
||||
public static ConfigWrapper<Boolean> CRATE_KEEP_CONTENTS = new ConfigWrapper(true);
|
||||
public static ConfigWrapper<Integer> ITEM_HAZARD_DROP_TICKRATE = new ConfigWrapper(2);
|
||||
public static ConfigWrapper<Boolean> ENABLE_MKU = new ConfigWrapper(true);
|
||||
public static ConfigWrapper<Boolean> LEGACY_CRUCIBLE_RULES = new ConfigWrapper(false);
|
||||
|
||||
private static void initDefaults() {
|
||||
configMap.put("DAMAGE_COMPATIBILITY_MODE", DAMAGE_COMPATIBILITY_MODE);
|
||||
@ -34,6 +35,7 @@ public class ServerConfig extends RunningConfig {
|
||||
configMap.put("CRATE_KEEP_CONTENTS", CRATE_KEEP_CONTENTS);
|
||||
configMap.put("ITEM_HAZARD_DROP_TICKRATE", ITEM_HAZARD_DROP_TICKRATE);
|
||||
configMap.put("ENABLE_MKU", ENABLE_MKU);
|
||||
configMap.put("LEGACY_CRUCIBLE_RULES", LEGACY_CRUCIBLE_RULES);
|
||||
}
|
||||
|
||||
/** Initializes defaults, then reads the config file if it exists, then writes the config file. */
|
||||
|
||||
@ -6,7 +6,6 @@ import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.machine.ItemBatteryPack.EnumBatteryPack;
|
||||
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.ItemEnums;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -30,8 +29,9 @@ public class ConsumableRecipes {
|
||||
|
||||
//Airstikes
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 0), new Object[] { "TTT", "TRT", "TTT", 'T', Blocks.tnt, 'R', ModItems.rangefinder });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 1), new Object[] { "TTT", "TRT", "TTT", 'T', DictFrame.fromOne(ModItems.grenade_filling, EnumGrenadeFilling.INC), 'R', ModItems.rangefinder });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 1), new Object[] { "TTT", "TRT", "TTT", 'T', ModItems.grenade_gascan, 'R', ModItems.rangefinder });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 2), new Object[] { "TTT", "TRT", "TTT", 'T', ModItems.pellet_gas, 'R', ModItems.rangefinder });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 3), new Object[] { "TRT", 'T', ModItems.grenade_cloud, 'R', ModItems.rangefinder });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bomb_caller, 1, 4), new Object[] { "TRC", 'T', DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_HIGH), 'R', ModItems.rangefinder, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CONTROLLER) });
|
||||
|
||||
//Food
|
||||
|
||||
@ -16,10 +16,6 @@ import com.hbm.items.machine.ItemBatteryPack.EnumBatteryPack;
|
||||
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.GunB92Cell;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeExtra.EnumGrenadeExtra;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFuze.EnumGrenadeFuze;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumModGeneric;
|
||||
@ -28,6 +24,7 @@ import com.hbm.main.CraftingManager;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
@ -171,7 +168,7 @@ public class WeaponRecipes {
|
||||
//Missiles
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_taint, 1), new Object[] { ModItems.missile_assembly, ModItems.bucket_mud, ModItems.powder_spark_mix, ModItems.powder_magic });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_micro, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.NUKE_HIGH) });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_bhole, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.black_hole });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_bhole, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.grenade_black_hole });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_schrabidium, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModItems.cell_anti_schrabidium, ANY_HARDPLASTIC.ingot() });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.missile_emp, 1), new Object[] { ModItems.missile_assembly, ModItems.ducttape, ModBlocks.emp_bomb });
|
||||
|
||||
@ -256,31 +253,30 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(ModItems.ammo_fireext.stackFromEnum(AmmoFireExt.SAND), new Object[] { "NNN", "NFN", "NNN", 'N', new ItemStack(ModBlocks.sand_mix, 1, EnumSandType.BORON.ordinal()), 'F', ModItems.ammo_fireext });
|
||||
|
||||
//Grenades
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_generic, 4), new Object[] { "RS ", "ITI", " I ", 'I', IRON.plate(), 'R', MINGRADE.wireFine(), 'S', STEEL.plate(), 'T', Item.getItemFromBlock(Blocks.tnt) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_strong, 2), new Object[] { " G ", "SGS", " S ", 'G', ModItems.grenade_generic, 'S', Items.gunpowder });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_frag, 2), new Object[] { " G ", "WGW", " K ", 'G', ModItems.grenade_generic, 'W', KEY_PLANKS, 'K', Item.getItemFromBlock(Blocks.gravel) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_poison, 2), new Object[] { " G ", "PGP", " P ", 'G', ModItems.grenade_generic, 'P', ModItems.powder_poison });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_gas, 2), new Object[] { " G ", "CGC", " C ", 'G', ModItems.grenade_generic, 'C', ModItems.pellet_gas });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_aschrab, 1), new Object[] {"RS ", "ITI", " S ", 'I', KEY_CLEARGLASS, 'R', MINGRADE.wireFine(), 'S', STEEL.plate(), 'T', ModItems.cell_anti_schrabidium });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_mk2, 2), new Object[] { " G ", "SGS", " S ", 'G', ModItems.grenade_strong, 'S', Items.gunpowder });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_gascan, 1), new Object[] { Fluids.DIESEL.getDict(1000), Items.flint });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_gascan, 1), new Object[] { Fluids.DIESEL_CRACK.getDict(1000), Items.flint });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_gascan, 1), new Object[] { Fluids.PETROIL.getDict(1000), Items.flint });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_gascan, 1), new Object[] { Fluids.PETROIL_LEADED.getDict(1000), Items.flint });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_gascan, 1), new Object[] { Fluids.GASOLINE.getDict(1000), Items.flint });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_gascan, 1), new Object[] { Fluids.GASOLINE_LEADED.getDict(1000), Items.flint });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_gascan, 1), new Object[] { Fluids.BIOFUEL.getDict(1000), Items.flint });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_lemon, 1), new Object[] { ModItems.lemon, ModItems.grenade_strong });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_smart, 4), new Object[] { " A ", "ACA", " A ", 'A', ModItems.grenade_strong, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_mirv, 1), new Object[] { "GGG", "GCG", "GGG", 'G', ModItems.grenade_smart, 'C', ModItems.grenade_generic });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_breach, 1), new Object[] { "G", "G", "P", 'G', ModItems.grenade_smart, 'P', BIGMT.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_burst, 1), new Object[] { "GGG", "GCG", "GGG", 'G', ModItems.grenade_breach, 'C', ModItems.grenade_generic });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_cloud), new Object[] { "SPS", "CAC", "SPS", 'S', S.dust(), 'P', ModItems.powder_poison, 'C', CU.dust(), 'A', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.PEROXIDE.getID()) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_pink_cloud), new Object[] { " S ", "ECE", " E ", 'S', ModItems.powder_spark_mix, 'E', ModItems.powder_magic, 'C', ModItems.grenade_cloud });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.nuclear_waste_pearl), new Object[] { "WWW", "WFW", "WWW", 'W', ModItems.nuclear_waste_tiny, 'F', ModBlocks.block_fallout });
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_kyiv), new Object[] { ModItems.canister_napalm, ModItems.bottle2_empty, ModItems.rag });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.disperser_canister_empty, 4), new Object[] { " P ", "PGP", " P ", 'P', ANY_HARDPLASTIC.ingot(), 'G', ModBlocks.glass_boron });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_shell, 4, EnumGrenadeShell.FRAG.ordinal()), new Object[] { "B", "P", "S", 'B', STEEL.bolt(), 'P', AL.plate(), 'S', STEEL.shell() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_shell, 4, EnumGrenadeShell.STICK.ordinal()), new Object[] { "S", "B", "W", 'B', STEEL.bolt(), 'S', STEEL.shell(), 'W', KEY_PLANKS });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_shell, 4, EnumGrenadeShell.TECH.ordinal()), new Object[] { "C", "M", "S", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'M', WEAPONSTEEL.mechanism(), 'S', WEAPONSTEEL.shell() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_shell, 2, EnumGrenadeShell.NUKE.ordinal()), new Object[] { " S ", "CMC", " S ", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', WEAPONSTEEL.mechanism(), 'S', WEAPONSTEEL.shell() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_fuze, 4, EnumGrenadeFuze.S3.ordinal()), new Object[] { "S", "F", 'S', STEEL.bolt(), 'F', ModItems.safety_fuse });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_fuze, 4, EnumGrenadeFuze.S7.ordinal()), new Object[] { "S", "F", "F", 'S', STEEL.bolt(), 'F', ModItems.safety_fuse });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_fuze, 4, EnumGrenadeFuze.S15.ordinal()), new Object[] { " S ", " F ", "FFF", 'S', STEEL.bolt(), 'F', ModItems.safety_fuse });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_fuze, 4, EnumGrenadeFuze.IMPACT.ordinal()), new Object[] { "C", "S", "F", 'C', ANY_SMOKELESS.dust(), 'S', STEEL.bolt(), 'F', ModItems.safety_fuse });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_fuze, 4, EnumGrenadeFuze.AIRBURST.ordinal()), new Object[] { "C", "S", "F", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE), 'S', STEEL.bolt(), 'F', ModItems.safety_fuse });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.POWDER.ordinal()), new Object[] { "F", "I", "F", 'F', Items.gunpowder, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.HE.ordinal()), new Object[] { "F", "I", "F", 'F', ModItems.ball_dynamite, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.DEMO.ordinal()), new Object[] { "F", "I", "F", 'F', ANY_HIGHEXPLOSIVE.ingot(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.INC.ordinal()), new Object[] { "F", "I", "F", 'F', P_RED.dust(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.WP.ordinal()), new Object[] { "F", "I", "F", 'F', P_WHITE.ingot(), 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.CLUSTER.ordinal()), new Object[] { "F", "I", "F", 'F', ModItems.pellet_cluster, 'I', ModItems.plate_polymer });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 1, EnumGrenadeFilling.CLUSTER_HEAVY.ordinal()), new Object[] { "F", "I", "F", 'F', ModItems.pellet_cluster, 'I', WEAPONSTEEL.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.EMP.ordinal()), new Object[] { " C ", "KWK", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'K', ModItems.coil_gold, 'W', WEAPONSTEEL.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.PLASMA.ordinal()), new Object[] { " C ", "KWK", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CAPACITOR_BOARD), 'K', ModItems.cell_tritium, 'W', WEAPONSTEEL.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 4, EnumGrenadeFilling.LASER.ordinal()), new Object[] { " C ", "KWK", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ATOMIC_CLOCK), 'K', ModItems.crystal_redstone, 'W', WEAPONSTEEL.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 1, EnumGrenadeFilling.NUCLEAR.ordinal()), new Object[] { " T ", "CPC", " T ", 'T', ModItems.ball_tatb, 'C', WEAPONSTEEL.plate(), 'P', PU239.nugget() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_filling, 1, EnumGrenadeFilling.NUCLEAR_DEMO.ordinal()), new Object[] { "TPT", "CPC", "TPT", 'T', ModItems.ball_tatb, 'C', WEAPONSTEEL.plate(), 'P', PU239.nugget() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_extra, 1, EnumGrenadeExtra.GLUE.ordinal()), new Object[] { " P ", "PSP", " P ", 'P', Items.paper, 'S', Items.slime_ball });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_extra, 1, EnumGrenadeExtra.PROXY_FUZE.ordinal()), new Object[] { "C", "F", 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP), 'F', ModItems.safety_fuse });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_extra, 1, EnumGrenadeExtra.FRAG_SLEEVE.ordinal()), new Object[] { "BBB", " T ", "BBB", 'B', STEEL.bolt(), 'T', ModItems.ducttape });
|
||||
|
||||
//Sticks of explosives
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.stick_dynamite, 4), new Object[] { " S ", "PDP", "PDP", 'S', ModItems.safety_fuse, 'P', Items.paper, 'D', ModItems.ball_dynamite });
|
||||
@ -296,6 +292,22 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.c4, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_c4, 'S', ModItems.safety_fuse });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.fissure_bomb, 1), new Object[] { "SUS", "RPR", "SUS", 'S', ModBlocks.semtex, 'U', U238.block(), 'R', TA.ingot(), 'P', PU239.billet() });
|
||||
|
||||
|
||||
//IF Grenades
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_generic, 1), new Object[] { " C ", "PTP", " P ", 'C', ModItems.coil_tungsten, 'P', STEEL.plate(), 'T', Blocks.tnt });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_he, 1), new Object[] { "A", "G", "A", 'G', ModItems.grenade_if_generic, 'A', Items.gunpowder });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_bouncy, 1), new Object[] { "G", "A", 'G', ModItems.grenade_if_generic, 'A', ANY_RUBBER.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_sticky, 1), new Object[] { "G", "A", 'G', ModItems.grenade_if_generic, 'A', KEY_SLIME });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_impact, 1), new Object[] { "G", "A", 'G', ModItems.grenade_if_generic, 'A', REDSTONE.dust() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_concussion, 1), new Object[] { "G", "A", 'G', ModItems.grenade_if_generic, 'A', Items.glowstone_dust });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_toxic, 1), new Object[] { "G", "A", 'G', ModItems.grenade_if_generic, 'A', ModItems.powder_poison });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_incendiary, 1), new Object[] { "G", "A", 'G', ModItems.grenade_if_generic, 'A', P_RED.dust() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_brimstone, 1), new Object[] { "R", "G", "A", 'G', ModItems.grenade_if_generic, 'R', REDSTONE.dust(), 'A', S.dust() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_mystery, 1), new Object[] { "A", "G", "A", 'G', ModItems.grenade_if_generic, 'A', ModItems.powder_magic });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_spark, 1), new Object[] { " A ", "AGA", " A ", 'G', ModItems.grenade_if_generic, 'A', ModItems.powder_spark_mix });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_hopwire, 1), new Object[] { " A ", "AGA", " A ", 'G', ModItems.grenade_if_generic, 'A', ModItems.powder_power });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_null, 1), new Object[] { "BAB", "AGA", "BAB", 'G', ModItems.grenade_if_generic, 'A', ModItems.undefined, 'B', BIGMT.ingot() });
|
||||
|
||||
//Mines
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_ap, 4), new Object[] { "I", "C", "S", 'I', ModItems.plate_polymer, 'C', ANY_SMOKELESS.dust(), 'S', STEEL.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_shrap, 1), new Object[] { "L", "M", 'M', ModBlocks.mine_ap, 'L', ModItems.pellet_buckshot });
|
||||
|
||||
@ -1,79 +0,0 @@
|
||||
package com.hbm.crafting.handlers;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeExtra.EnumGrenadeExtra;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFuze.EnumGrenadeFuze;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeUniversal;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class GrenadeCraftingHandler implements IRecipe {
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
if(hasForeignObject(inv)) return false; // can't be non-grenade items and can't be more than 4 items total
|
||||
EnumGrenadeShell shell = getFirst(inv, ModItems.grenade_shell, EnumGrenadeShell.class); // only one shell, null otherwise
|
||||
EnumGrenadeFilling filling = getFirst(inv, ModItems.grenade_filling, EnumGrenadeFilling.class); // only one filling, null otherwise
|
||||
EnumGrenadeFuze fuze = getFirst(inv, ModItems.grenade_fuze, EnumGrenadeFuze.class); // only one fuze, null otherwise
|
||||
// this leaves the extra unaccounted for, but the restrictions we put in place will allow exactly one without dedicated check
|
||||
return shell != null && filling != null && fuze != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
EnumGrenadeShell shell = getFirst(inv, ModItems.grenade_shell, EnumGrenadeShell.class);
|
||||
EnumGrenadeFilling filling = getFirst(inv, ModItems.grenade_filling, EnumGrenadeFilling.class);
|
||||
EnumGrenadeFuze fuze = getFirst(inv, ModItems.grenade_fuze, EnumGrenadeFuze.class);
|
||||
EnumGrenadeExtra extra = getFirst(inv, ModItems.grenade_extra, EnumGrenadeExtra.class); // if this is null, then we don't care, MAKE works with a null extra too
|
||||
return ItemGrenadeUniversal.make(shell, filling, fuze, extra);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
// why write the same crap four times when you can just use your massive cock instead
|
||||
public static <T extends Enum> T getFirst(InventoryCrafting inv, Item itemType, Class<? extends T> type) { // god i love generics
|
||||
T firstShell = null;
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack stack = inv.getStackInRowAndColumn(i % 3, i / 3);
|
||||
if(stack == null) continue;
|
||||
if(stack.getItem() == itemType) {
|
||||
if(firstShell != null) return null;
|
||||
firstShell = EnumUtil.grabEnumSafely(type, stack.getItemDamage());
|
||||
}
|
||||
}
|
||||
|
||||
return firstShell;
|
||||
}
|
||||
|
||||
// this should weed out non-grenade grids quickly as to not waste too much CPU time
|
||||
public static boolean hasForeignObject(InventoryCrafting inv) {
|
||||
int itemCount = 0;
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack stack = inv.getStackInRowAndColumn(i % 3, i / 3);
|
||||
if(stack == null) continue;
|
||||
if(stack.getItem() != ModItems.grenade_shell &&
|
||||
stack.getItem() != ModItems.grenade_filling &&
|
||||
stack.getItem() != ModItems.grenade_fuze &&
|
||||
stack.getItem() != ModItems.grenade_extra) return true;
|
||||
itemCount++;
|
||||
if(itemCount > 4) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return new ItemStack(ModItems.grenade_universal);
|
||||
}
|
||||
}
|
||||
@ -16,8 +16,8 @@ public class TemplateTab extends CreativeTabs {
|
||||
@Override
|
||||
public Item getTabIconItem() {
|
||||
|
||||
if(ModItems.blueprints != null) {
|
||||
return ModItems.blueprints;
|
||||
if(ModItems.crucible_template != null) {
|
||||
return ModItems.crucible_template;
|
||||
}
|
||||
|
||||
return Items.iron_pickaxe;
|
||||
|
||||
@ -42,7 +42,18 @@ public class EntityMappings {
|
||||
public static void writeMappings() {
|
||||
|
||||
addEntity(EntityRocket.class, "entity_rocket", 250);
|
||||
addEntity(EntityGrenadeGeneric.class, "entity_grenade_generic", 250);
|
||||
addEntity(EntityGrenadeStrong.class, "entity_grenade_strong", 250);
|
||||
addEntity(EntityGrenadeFrag.class, "entity_grenade_frag", 250);
|
||||
addEntity(EntityGrenadeFire.class, "entity_grenade_fire", 250);
|
||||
addEntity(EntityGrenadeCluster.class, "entity_grenade_cluster", 250);
|
||||
addEntity(EntityBullet.class, "entity_bullet", 250);
|
||||
addEntity(EntityGrenadeFlare.class, "entity_grenade_flare", 500);
|
||||
addEntity(EntityGrenadeElectric.class, "entity_grenade_electric", 500);
|
||||
addEntity(EntityGrenadePoison.class, "entity_grenade_poison", 500);
|
||||
addEntity(EntityGrenadeGas.class, "entity_grenade_gas", 500);
|
||||
addEntity(EntityGrenadeSchrabidium.class, "entity_grenade_schrab", 500);
|
||||
addEntity(EntityGrenadeNuke.class, "entity_grenade_nuke", 500);
|
||||
addEntity(EntitySchrab.class, "entity_schrabnel", 500);
|
||||
addEntity(EntityMissileGeneric.class, "entity_missile_generic", 1000);
|
||||
addEntity(EntityMissileDecoy.class, "entity_missile_decoy", 1000);
|
||||
@ -60,13 +71,23 @@ public class EntityMappings {
|
||||
addEntity(EntityMissileRain.class, "entity_missile_rain", 1000);
|
||||
addEntity(EntityMissileDrill.class, "entity_missile_drill", 1000);
|
||||
addEntity(EntityMissileMirv.class, "entity_missile_mirv", 1000);
|
||||
addEntity(EntityGrenadeNuclear.class, "entity_grenade_nuclear", 1000);
|
||||
addEntity(EntityGrenadePlasma.class, "entity_grenade_plasma", 500);
|
||||
addEntity(EntityGrenadeTau.class, "entity_grenade_tau", 500);
|
||||
addEntity(EntityChopperMine.class, "entity_chopper_mine", 1000);
|
||||
addEntity(EntityGrenadeLemon.class, "entity_grenade_lemon", 500);
|
||||
addEntity(EntityCloudFleija.class, "entity_cloud_fleija", 500);
|
||||
addEntity(EntityGrenadeMk2.class, "entity_grenade_mk2", 500);
|
||||
addEntity(EntityGrenadeZOMG.class, "entity_grenade_zomg", 500);
|
||||
addEntity(EntityGrenadeASchrab.class, "entity_grenade_aschrab", 500);
|
||||
addEntity(EntityFalloutRain.class, "entity_fallout", 1000);
|
||||
addEntity(EntityEMPBlast.class, "entity_emp_blast", 1000);
|
||||
addEntity(EntityGrenadePulse.class, "entity_grenade_pulse", 1000);
|
||||
addEntity(EntityRubble.class, "entity_rubble", 1000);
|
||||
addEntity(EntityShrapnel.class, "entity_shrapnel", 1000);
|
||||
addEntity(EntityGrenadeShrapnel.class, "entity_grenade_shrapnel", 250);
|
||||
addEntity(EntityBlackHole.class, "entity_black_hole", 250);
|
||||
addEntity(EntityGrenadeBlackHole.class, "entity_grenade_black_hole", 250);
|
||||
addEntity(EntityMinecartTest.class, "entity_minecart_test", 1000);
|
||||
addEntity(EntityMissileDoomsday.class, "entity_missile_doomsday", 1000);
|
||||
addEntity(EntityMissileDoomsdayRusted.class, "entity_missile_doomsday_rusted", 1000);
|
||||
@ -76,9 +97,10 @@ public class EntityMappings {
|
||||
addEntity(EntityBoxcar.class, "entity_boxcar", 1000);
|
||||
addEntity(EntityTorpedo.class, "entity_torpedo", 1000);
|
||||
addEntity(EntityMissileTaint.class, "entity_missile_taint", 1000);
|
||||
addEntity(EntityGrenadeGascan.class, "entity_grenade_gascan", 1000);
|
||||
addEntity(EntityNukeExplosionMK5.class, "entity_nuke_mk5", 1000);
|
||||
addEntity(EntityCloudFleijaRainbow.class, "entity_cloud_rainbow", 1000);
|
||||
addEntity(EntityB92Beam.class, "entity_beam_bomb", 1000);
|
||||
addEntity(EntityExplosiveBeam.class, "entity_beam_bomb", 1000);
|
||||
addEntity(EntityMissileTest.class, "entity_missile_test_mk2", 1000);
|
||||
addEntity(EntityMissileMicro.class, "entity_missile_micronuclear", 1000);
|
||||
addEntity(EntityCloudSolinium.class, "entity_cloud_rainbow", 1000);
|
||||
@ -89,18 +111,36 @@ public class EntityMappings {
|
||||
addEntity(EntityChlorineFX.class, "entity_chlorine_fx", 1000);
|
||||
addEntity(EntityPinkCloudFX.class, "entity_pink_cloud_fx", 1000);
|
||||
addEntity(EntityCloudFX.class, "entity_cloud_fx", 1000);
|
||||
addEntity(EntityGrenadePC.class, "entity_grenade_pink_cloud", 250);
|
||||
addEntity(EntityGrenadeCloud.class, "entity_grenade_cloud", 250);
|
||||
addEntity(EntityBomber.class, "entity_bomber", 1000);
|
||||
addEntity(EntityC130.class, "entity_c130", 1000);
|
||||
addEntity(EntityBombletZeta.class, "entity_zeta", 1000);
|
||||
addEntity(EntityOrangeFX.class, "entity_agent_orange", 1000);
|
||||
addEntity(EntityDeathBlast.class, "entity_laser_blast", 1000);
|
||||
addEntity(EntityGrenadeSmart.class, "entity_grenade_smart", 250);
|
||||
addEntity(EntityGrenadeMIRV.class, "entity_grenade_mirv", 250);
|
||||
addEntity(EntityGrenadeBreach.class, "entity_grenade_breach", 250);
|
||||
addEntity(EntityGrenadeBurst.class, "entity_grenade_burst", 250);
|
||||
addEntity(EntityBurningFOEQ.class, "entity_burning_foeq", 1000);
|
||||
addEntity(EntityGrenadeIFGeneric.class, "entity_grenade_ironshod", 250);
|
||||
addEntity(EntityGrenadeIFHE.class, "entity_grenade_ironshod_he", 250);
|
||||
addEntity(EntityGrenadeIFBouncy.class, "entity_grenade_ironshod_bouncy", 250);
|
||||
addEntity(EntityGrenadeIFSticky.class, "entity_grenade_ironshod_sticky", 250);
|
||||
addEntity(EntityGrenadeIFImpact.class, "entity_grenade_ironshod_impact", 250);
|
||||
addEntity(EntityGrenadeIFIncendiary.class, "entity_grenade_ironshod_fire", 250);
|
||||
addEntity(EntityGrenadeIFToxic.class, "entity_grenade_ironshod_toxic", 250);
|
||||
addEntity(EntityGrenadeIFConcussion.class, "entity_grenade_ironshod_con", 250);
|
||||
addEntity(EntityGrenadeIFBrimstone.class, "entity_grenade_ironshod_brim", 250);
|
||||
addEntity(EntityGrenadeIFMystery.class, "entity_grenade_ironshod_m", 250);
|
||||
addEntity(EntityGrenadeIFSpark.class, "entity_grenade_ironshod_s", 250);
|
||||
addEntity(EntityGrenadeIFHopwire.class, "entity_grenade_ironshod_hopwire", 250);
|
||||
addEntity(EntityGrenadeIFNull.class, "entity_grenade_ironshod_null", 250);
|
||||
addEntity(EntityFallingNuke.class, "entity_falling_bomb", 1000);
|
||||
addEntity(EntityBulletBaseNT.class, "entity_bullet_mk3", 250, false);
|
||||
addEntity(EntityBulletBaseMK4.class, "entity_bullet_mk4", 250, false);
|
||||
addEntity(EntityBulletBaseMK4CL.class, "entity_bullet_mk4_cl", 250, false);
|
||||
addEntity(EntityBulletBeamBase.class, "entity_beam_mk4", 250, false);
|
||||
addEntity(EntityGrenadeUniversal.class, "entity_grenade_universal", 250, false);
|
||||
addEntity(EntityMinerRocket.class, "entity_miner_lander", 1000);
|
||||
addEntity(EntityFogFX.class, "entity_nuclear_fog", 1000);
|
||||
addEntity(EntityDuchessGambit.class, "entity_duchessgambit", 1000);
|
||||
@ -135,13 +175,16 @@ public class EntityMappings {
|
||||
addEntity(EntityMissileShuttle.class, "entity_missile_shuttle", 1000);
|
||||
addEntity(EntityZirnoxDebris.class, "entity_zirnox_debris", 1000);
|
||||
addEntity(EntityGhost.class, "entity_ntm_ghost", 1000);
|
||||
addEntity(EntityGrenadeDynamite.class, "entity_grenade_dynamite", 250);
|
||||
addEntity(EntitySiegeLaser.class, "entity_ntm_siege_laser", 1000);
|
||||
addEntity(EntityTNTPrimedBase.class, "entity_ntm_tnt_primed", 1000);
|
||||
addEntity(EntityGrenadeBouncyGeneric.class, "entity_grenade_bouncy_generic", 250);
|
||||
addEntity(EntityGrenadeImpactGeneric.class, "entity_grenade_impact_generic", 250);
|
||||
addEntity(EntityMinecartCrate.class, "entity_ntm_cart_crate", 250, false);
|
||||
addEntity(EntityMinecartDestroyer.class, "entity_ntm_cart_destroyer", 250, false);
|
||||
addEntity(EntityMinecartDestroyer.class, "entity_ntm_cart_crate", 250, false);
|
||||
addEntity(EntityMinecartOre.class, "entity_ntm_cart_ore", 250, false);
|
||||
addEntity(EntityMinecartBogie.class, "entity_ntm_cart_bogie", 250, false);
|
||||
addEntity(EntityMagnusCartus.class, "entity_ntm_cart_chungoid", 250, false);
|
||||
addEntity(EntityMinecartPowder.class, "entity_ntm_cart_powder", 250, false);
|
||||
addEntity(EntityMinecartSemtex.class, "entity_ntm_cart_semtex", 250, false);
|
||||
addEntity(EntityNukeTorex.class, "entity_effect_torex", 250, false);
|
||||
|
||||
20
src/main/java/com/hbm/entity/cart/EntityMinecartBogie.java
Normal file
20
src/main/java/com/hbm/entity/cart/EntityMinecartBogie.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.hbm.entity.cart;
|
||||
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityMinecartBogie extends EntityMinecart {
|
||||
|
||||
public EntityMinecartBogie(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityMinecartBogie(World world, double x, double y, double z) {
|
||||
super(world, x, y ,z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinecartType() {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityCloudFleija;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeASchrab extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeASchrab(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeASchrab(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeASchrab(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, posX, posY, posZ, BombConfig.aSchrabRadius);
|
||||
if(!ex.isDead) {
|
||||
this.worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100.0F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F);
|
||||
worldObj.spawnEntityInWorld(ex);
|
||||
|
||||
EntityCloudFleija cloud = new EntityCloudFleija(this.worldObj, BombConfig.aSchrabRadius);
|
||||
cloud.posX = this.posX;
|
||||
cloud.posY = this.posY;
|
||||
cloud.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(cloud);
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.entity.effect.EntityBlackHole;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
public class EntityGrenadeBlackHole extends EntityGrenadeBouncyBase
|
||||
{
|
||||
public EntityGrenadeBlackHole(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBlackHole(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBlackHole(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
|
||||
|
||||
EntityBlackHole bl = new EntityBlackHole(this.worldObj, 1.5F);
|
||||
bl.posX = this.posX;
|
||||
bl.posY = this.posY;
|
||||
bl.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(bl);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_black_hole);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -30,7 +30,7 @@ public class EntityGrenadeBouncyGeneric extends EntityGrenadeBouncyBase implemen
|
||||
@Override
|
||||
public ItemGenericGrenade getGrenade() {
|
||||
ItemGenericGrenade gren = (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
|
||||
return gren != null ? gren : (ItemGenericGrenade) ModItems.stick_dynamite;
|
||||
return gren != null ? gren : (ItemGenericGrenade) ModItems.grenade_kyiv;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeBreach extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeBreach(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBreach(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBreach(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if(rand.nextInt(10) == 0)
|
||||
this.setDead();
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 2.5F, false, false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
57
src/main/java/com/hbm/entity/grenade/EntityGrenadeBurst.java
Normal file
57
src/main/java/com/hbm/entity/grenade/EntityGrenadeBurst.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeBurst extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeBurst(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBurst(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeBurst(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
|
||||
EntityGrenadeBreach grenade = new EntityGrenadeBreach(worldObj);
|
||||
grenade.posX = posX;
|
||||
grenade.posY = posY;
|
||||
grenade.posZ = posZ;
|
||||
grenade.motionX = rand.nextGaussian() * 0.1D;
|
||||
grenade.motionY = -0.25D;
|
||||
grenade.motionZ = rand.nextGaussian() * 0.1D;
|
||||
|
||||
worldObj.spawnEntityInWorld(grenade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_burst);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
32
src/main/java/com/hbm/entity/grenade/EntityGrenadeCloud.java
Normal file
32
src/main/java/com/hbm/entity/grenade/EntityGrenadeCloud.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeCloud extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeCloud(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeCloud(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeCloud(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
|
||||
ExplosionChaos.spawnPoisonCloud(worldObj, posX, posY, posZ, 250, 1.5, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
public class EntityGrenadeCluster extends EntityGrenadeBouncyBase
|
||||
{
|
||||
public EntityGrenadeCluster(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeCluster(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeCluster(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
ExplosionChaos.cluster(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 10, 50);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_cluster);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeDynamite extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeDynamite(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityGrenadeDynamite(World world, EntityLivingBase living) {
|
||||
super(world, living);
|
||||
}
|
||||
|
||||
public EntityGrenadeDynamite(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
worldObj.newExplosion(this, posX, posY + 0.25D, posZ, 3F, false, false);
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return 60;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.5D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeElectric extends EntityGrenadeBouncyBase
|
||||
{
|
||||
public EntityGrenadeElectric(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeElectric(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeElectric(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true);
|
||||
}
|
||||
this.worldObj.spawnEntityInWorld(new EntityLightningBolt(this.worldObj, this.posX, this.posY, this.posZ));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_electric);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
|
||||
}
|
||||
52
src/main/java/com/hbm/entity/grenade/EntityGrenadeFire.java
Normal file
52
src/main/java/com/hbm/entity/grenade/EntityGrenadeFire.java
Normal file
@ -0,0 +1,52 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
public class EntityGrenadeFire extends EntityGrenadeBouncyBase
|
||||
{
|
||||
public Entity shooter;
|
||||
|
||||
public EntityGrenadeFire(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeFire(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeFire(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
ExplosionChaos.frag(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 100, true, this.shooter);
|
||||
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 15);
|
||||
this.worldObj.playSoundEffect((int)this.posX, (int)this.posY, (int)this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_fire);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
44
src/main/java/com/hbm/entity/grenade/EntityGrenadeFlare.java
Normal file
44
src/main/java/com/hbm/entity/grenade/EntityGrenadeFlare.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeFlare extends EntityThrowable
|
||||
{
|
||||
public Entity shooter;
|
||||
|
||||
public EntityGrenadeFlare(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeFlare(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeFlare(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
if(this.ticksExisted > 250)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition p_70184_1_)
|
||||
{
|
||||
this.motionX = 0;
|
||||
this.motionY = 0;
|
||||
this.motionZ = 0;
|
||||
}
|
||||
}
|
||||
59
src/main/java/com/hbm/entity/grenade/EntityGrenadeFrag.java
Normal file
59
src/main/java/com/hbm/entity/grenade/EntityGrenadeFrag.java
Normal file
@ -0,0 +1,59 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
public class EntityGrenadeFrag extends EntityGrenadeBouncyBase
|
||||
{
|
||||
public Entity shooter;
|
||||
|
||||
public EntityGrenadeFrag(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeFrag(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeFrag(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if(this.isBurning())
|
||||
{
|
||||
this.setDead();
|
||||
ExplosionChaos.frag(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 100, true, this.shooter);
|
||||
ExplosionChaos.burn(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 5);
|
||||
ExplosionChaos.flameDeath(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 15);
|
||||
this.worldObj.playSoundEffect((int)this.posX, (int)this.posY, (int)this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
} else {
|
||||
this.setDead();
|
||||
ExplosionChaos.frag(this.worldObj, (int)this.posX, (int)this.posY, (int)this.posZ, 100, false, this.shooter);
|
||||
this.worldObj.playSoundEffect((int)this.posX, (int)this.posY, (int)this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_frag);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
53
src/main/java/com/hbm/entity/grenade/EntityGrenadeGas.java
Normal file
53
src/main/java/com/hbm/entity/grenade/EntityGrenadeGas.java
Normal file
@ -0,0 +1,53 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.entity.effect.EntityMist;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
public class EntityGrenadeGas extends EntityGrenadeBouncyBase {
|
||||
Random rand = new Random();
|
||||
|
||||
public EntityGrenadeGas(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeGas(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeGas(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 0.0F, true);
|
||||
|
||||
EntityMist mist = new EntityMist(worldObj);
|
||||
mist.setType(Fluids.CHLORINE);
|
||||
mist.setPosition(posX, posY - 5, posZ);
|
||||
mist.setArea(15, 10);
|
||||
worldObj.spawnEntityInWorld(mist);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_gas);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeGascan extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeGascan(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeGascan(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeGascan(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
this.worldObj.newExplosion((Entity) null, (float) this.posX, (float) this.posY, (float) this.posZ, 5.0F, true, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeGeneric extends EntityGrenadeBouncyBase
|
||||
{
|
||||
public EntityGrenadeGeneric(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeGeneric(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeGeneric(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFBouncy extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFBouncy(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFBouncy(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFBouncy(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_bouncy);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.75D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFBrimstone extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFBrimstone(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFBrimstone(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFBrimstone(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(this.timer > (this.getMaxTimer() * 0.65)) {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
EntityBullet fragment;
|
||||
|
||||
fragment = new EntityBullet(worldObj, (EntityPlayer) this.thrower, 3.0F, 35, 45, false, "tauDay");
|
||||
fragment.setDamage(rand.nextInt(301) + 100);
|
||||
|
||||
fragment.motionX = rand.nextGaussian();
|
||||
fragment.motionY = rand.nextGaussian();
|
||||
fragment.motionZ = rand.nextGaussian();
|
||||
fragment.shootingEntity = this.thrower;
|
||||
|
||||
fragment.posX = posX;
|
||||
fragment.posY = posY;
|
||||
fragment.posZ = posZ;
|
||||
|
||||
fragment.setIsCritical(true);
|
||||
|
||||
worldObj.spawnEntityInWorld(fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
worldObj.newExplosion(this, posX, posY, posZ, 5, false, false);
|
||||
|
||||
for(int i = 0; i < 100; i++) {
|
||||
EntityBullet fragment;
|
||||
|
||||
fragment = new EntityBullet(worldObj, (EntityPlayer) this.thrower, 3.0F, 35, 45, false, "tauDay");
|
||||
fragment.setDamage(rand.nextInt(301) + 100);
|
||||
|
||||
fragment.motionX = rand.nextGaussian() * 0.25;
|
||||
fragment.motionY = rand.nextGaussian() * 0.25;
|
||||
fragment.motionZ = rand.nextGaussian() * 0.25;
|
||||
fragment.shootingEntity = this.thrower;
|
||||
|
||||
fragment.posX = posX;
|
||||
fragment.posY = posY;
|
||||
fragment.posZ = posZ;
|
||||
|
||||
fragment.setIsCritical(true);
|
||||
|
||||
worldObj.spawnEntityInWorld(fragment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_brimstone);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFConcussion extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFConcussion(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFConcussion(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFConcussion(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
worldObj.newExplosion(this, posX, posY, posZ, 15, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_concussion);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFGeneric extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFGeneric(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFGeneric(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFGeneric(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_generic);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
48
src/main/java/com/hbm/entity/grenade/EntityGrenadeIFHE.java
Normal file
48
src/main/java/com/hbm/entity/grenade/EntityGrenadeIFHE.java
Normal file
@ -0,0 +1,48 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFHE extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFHE(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFHE(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFHE(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 7.5, 300, 0.25);
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 7, true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_he);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.entity.effect.EntityVortex;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFHopwire extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFHopwire(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFHopwire(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFHopwire(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
EntityVortex vortex = new EntityVortex(worldObj, 0.75F);
|
||||
vortex.posX = posX;
|
||||
vortex.posY = posY;
|
||||
vortex.posZ = posZ;
|
||||
worldObj.spawnEntityInWorld(vortex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_hopwire);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFImpact extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeIFImpact(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFImpact(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFImpact(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,53 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.explosion.ExplosionThermo;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFIncendiary extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFIncendiary(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFIncendiary(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFIncendiary(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
|
||||
ExplosionThermo.setEntitiesOnFire(worldObj, (int)posX, (int)posY, (int)posZ, 8);
|
||||
ExplosionChaos.flameDeath(worldObj, (int)posX, (int)posY, (int)posZ, 15);
|
||||
ExplosionChaos.burn(worldObj, (int)posX, (int)posY, (int)posZ, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_incendiary);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFMystery extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFMystery(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFMystery(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFMystery(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
worldObj.newExplosion(this, posX, posY, posZ, 10, false, false);
|
||||
|
||||
ExplosionChaos.spawnVolley(worldObj, posX, posY, posZ, 100, 1.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_mystery);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFNull extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFNull(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFNull(World world, EntityLivingBase thrower) {
|
||||
super(world, thrower);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFNull(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
int range = 5;
|
||||
|
||||
for(int a = -range; a <= range; a++)
|
||||
for(int b = -range; b <= range; b++)
|
||||
for(int c = -range; c <= range; c++)
|
||||
worldObj.setBlockToAir((int) Math.floor(posX + a), (int) Math.floor(posY + b), (int) Math.floor(posZ + c));
|
||||
|
||||
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
|
||||
AxisAlignedBB.getBoundingBox((int) posX + 0.5 - 3, (int) posY + 0.5 - 3, (int) posZ + 0.5 - 3, (int) posX + 0.5 + 3, (int) posY + 0.5 + 3, (int) posZ + 0.5 + 3));
|
||||
|
||||
for(Object o : list) {
|
||||
if(o instanceof EntityLivingBase) {
|
||||
EntityLivingBase e = (EntityLivingBase) o;
|
||||
e.setHealth(0);
|
||||
e.onDeath(DamageSource.outOfWorld);
|
||||
} else if(o instanceof Entity) {
|
||||
Entity e = (Entity) o;
|
||||
e.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,51 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.entity.effect.EntityRagingVortex;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFSpark extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFSpark(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFSpark(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFSpark(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
EntityRagingVortex vortex = new EntityRagingVortex(worldObj, 1.5F);
|
||||
vortex.posX = posX;
|
||||
vortex.posY = posY;
|
||||
vortex.posZ = posZ;
|
||||
worldObj.spawnEntityInWorld(vortex);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_spark);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,48 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFSticky extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFSticky(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFSticky(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFSticky(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 5, 200, 0.25);
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5, true, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_sticky);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.05D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeIFToxic extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeIFToxic(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFToxic(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeIFToxic(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
ExplosionLarge.jolt(worldObj, posX, posY, posZ, 3, 200, 0.25);
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 2, true, true, true);
|
||||
ExplosionChaos.poison(worldObj, (int)posX, (int)posY, (int)posZ, 12);
|
||||
ExplosionNukeGeneric.waste(worldObj, (int)posX, (int)posY, (int)posZ, 12);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_if_toxic);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -30,7 +30,7 @@ public class EntityGrenadeImpactGeneric extends EntityGrenadeBase implements IGe
|
||||
@Override
|
||||
public ItemGenericGrenade getGrenade() {
|
||||
ItemGenericGrenade gren = (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
|
||||
return gren != null ? gren : (ItemGenericGrenade) ModItems.stick_dynamite;
|
||||
return gren != null ? gren : (ItemGenericGrenade) ModItems.grenade_kyiv;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
46
src/main/java/com/hbm/entity/grenade/EntityGrenadeLemon.java
Normal file
46
src/main/java/com/hbm/entity/grenade/EntityGrenadeLemon.java
Normal file
@ -0,0 +1,46 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeLemon extends EntityGrenadeBouncyBase
|
||||
{
|
||||
public EntityGrenadeLemon(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeLemon(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeLemon(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
this.worldObj.newExplosion((Entity)null, (float)this.posX, (float)this.posY, (float)this.posZ, 5.0F, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_lemon);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
58
src/main/java/com/hbm/entity/grenade/EntityGrenadeMIRV.java
Normal file
58
src/main/java/com/hbm/entity/grenade/EntityGrenadeMIRV.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeMIRV extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeMIRV(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeMIRV(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeMIRV(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
|
||||
EntityGrenadeSmart grenade = new EntityGrenadeSmart(worldObj);
|
||||
grenade.posX = posX;
|
||||
grenade.posY = posY;
|
||||
grenade.posZ = posZ;
|
||||
grenade.motionX = motionX + rand.nextGaussian() * 0.25D;
|
||||
grenade.motionY = motionY + rand.nextGaussian() * 0.25D;
|
||||
grenade.motionZ = motionZ + rand.nextGaussian() * 0.25D;
|
||||
grenade.ticksExisted = 10;
|
||||
|
||||
worldObj.spawnEntityInWorld(grenade);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_mirv);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
43
src/main/java/com/hbm/entity/grenade/EntityGrenadeMk2.java
Normal file
43
src/main/java/com/hbm/entity/grenade/EntityGrenadeMk2.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeMk2 extends EntityGrenadeBouncyBase {
|
||||
|
||||
|
||||
public EntityGrenadeMk2(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeMk2(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeMk2(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 7.5F, true, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_mk2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeNuclear extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeNuclear(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeNuclear(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeNuclear(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
ExplosionNukeSmall.explode(worldObj, posX, posY + 0.5, posZ, ExplosionNukeSmall.PARAMS_TOTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_nuclear);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
30
src/main/java/com/hbm/entity/grenade/EntityGrenadeNuke.java
Normal file
30
src/main/java/com/hbm/entity/grenade/EntityGrenadeNuke.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeNuke extends EntityGrenadeBase {
|
||||
public int count = 2;
|
||||
|
||||
public EntityGrenadeNuke(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeNuke(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeNuke(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
// this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 30F, true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
32
src/main/java/com/hbm/entity/grenade/EntityGrenadePC.java
Normal file
32
src/main/java/com/hbm/entity/grenade/EntityGrenadePC.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadePC extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadePC(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadePC(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadePC(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
|
||||
ExplosionChaos.spawnPoisonCloud(worldObj, posX, posY, posZ, 500, 2, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadePlasma extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadePlasma(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadePlasma(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadePlasma(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true);
|
||||
ExplosionChaos.plasma(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, 7);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_plasma);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadePoison extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadePoison(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadePoison(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadePoison(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true);
|
||||
ExplosionNukeGeneric.wasteNoSchrab(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_poison);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
|
||||
}
|
||||
48
src/main/java/com/hbm/entity/grenade/EntityGrenadePulse.java
Normal file
48
src/main/java/com/hbm/entity/grenade/EntityGrenadePulse.java
Normal file
@ -0,0 +1,48 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadePulse extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadePulse(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadePulse(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadePulse(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
ExplosionChaos.pulse(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, 7);
|
||||
this.worldObj.playSoundEffect((int)this.posX, (int)this.posY, (int)this.posZ, "random.explode", 4.0F, (1.0F + (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||
ExplosionLarge.spawnShock(worldObj, posX, posY, posZ, 24, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_pulse);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeSchrabidium extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeSchrabidium(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeSchrabidium(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeSchrabidium(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
ExplosionChaos.schrab(this.worldObj, (int) this.posX, (int) this.posY, (int) this.posZ, 50, 50);
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 1.5F, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_schrabidium);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
public class EntityGrenadeShrapnel extends EntityGrenadeBouncyBase {
|
||||
public Entity shooter;
|
||||
|
||||
public EntityGrenadeShrapnel(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeShrapnel(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeShrapnel(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true);
|
||||
for(int i = 0; i < 5; i++) {
|
||||
ExplosionLarge.spawnShrapnels(worldObj, this.posX, this.posY, this.posZ, 5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_shrapnel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
41
src/main/java/com/hbm/entity/grenade/EntityGrenadeSmart.java
Normal file
41
src/main/java/com/hbm/entity/grenade/EntityGrenadeSmart.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeSmart extends EntityGrenadeBase {
|
||||
|
||||
public EntityGrenadeSmart(World p_i1773_1_)
|
||||
{
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeSmart(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
||||
{
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeSmart(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
||||
{
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
|
||||
if(this.ticksExisted > 10)
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5.0F, true, false, false);
|
||||
else
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, new ItemStack(ModItems.grenade_smart)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeStrong extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeStrong(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeStrong(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeStrong(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 5.0F, true, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_strong);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
43
src/main/java/com/hbm/entity/grenade/EntityGrenadeTau.java
Normal file
43
src/main/java/com/hbm/entity/grenade/EntityGrenadeTau.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.explosion.ExplosionChaos;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeTau extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeTau(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeTau(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeTau(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 2.0F, true);
|
||||
ExplosionChaos.tauMeSinPi(this.worldObj, this.posX, this.posY, this.posZ, 100, this.getThrower(), this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_tau);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
}
|
||||
@ -1,165 +0,0 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.entity.projectile.EntityThrowableInterp;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeExtra.EnumGrenadeExtra;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFuze.EnumGrenadeFuze;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeUniversal;
|
||||
import com.hbm.util.TrackerUtil;
|
||||
import com.hbm.util.Vec3NT;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class EntityGrenadeUniversal extends EntityThrowableInterp {
|
||||
|
||||
public static final int DW_GRENADE = 3;
|
||||
public static final int DW_BOUNCES = 4;
|
||||
public static final int DW_TRAIL = 5;
|
||||
|
||||
public static final int TRAIL_TRIPLET = 1;
|
||||
|
||||
public double prevSpin;
|
||||
public double spin;
|
||||
|
||||
public EntityGrenadeUniversal(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityGrenadeUniversal(World world, ItemStack grenade) {
|
||||
super(world);
|
||||
ItemStack copy = grenade.copy();
|
||||
copy.stackSize = 1;
|
||||
this.dataWatcher.updateObject(DW_GRENADE, copy);
|
||||
}
|
||||
|
||||
public EntityGrenadeUniversal(World world, EntityPlayer thrower, ItemStack grenade) {
|
||||
super(world);
|
||||
this.setThrower(thrower);
|
||||
ItemStack copy = grenade.copy();
|
||||
copy.stackSize = 1;
|
||||
this.dataWatcher.updateObject(DW_GRENADE, copy);
|
||||
|
||||
Vec3NT offset = new Vec3NT(0.25, -0.25, 0).rotateAroundYDeg(-thrower.rotationYaw + 180);
|
||||
|
||||
this.setPosition(thrower.posX + offset.xCoord, thrower.posY + thrower.getEyeHeight() + offset.yCoord, thrower.posZ + offset.zCoord);
|
||||
|
||||
EnumGrenadeShell shell = ItemGrenadeUniversal.getShell(grenade);
|
||||
|
||||
Vec3NT yeet = new Vec3NT(thrower.getLookVec()).normalizeSelf();
|
||||
this.setThrowableHeading(yeet.xCoord, yeet.yCoord, yeet.zCoord, (float) shell.getYeetForce(), 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entityInit() {
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObjectByDataType(DW_GRENADE, 5);
|
||||
this.dataWatcher.addObject(DW_BOUNCES, new Integer(0));
|
||||
this.dataWatcher.addObject(DW_TRAIL, new Integer(0));
|
||||
}
|
||||
|
||||
public EntityGrenadeUniversal setTrail(int trail) {
|
||||
this.dataWatcher.updateObject(DW_TRAIL, trail);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack getGrenadeItem() { return this.dataWatcher.getWatchableObjectItemStack(DW_GRENADE); }
|
||||
public int getBounces() { return this.dataWatcher.getWatchableObjectInt(DW_BOUNCES); }
|
||||
public int getTrail() { return this.dataWatcher.getWatchableObjectInt(DW_TRAIL); }
|
||||
|
||||
public EnumGrenadeShell getShell() { return ItemGrenadeUniversal.getShell(getGrenadeItem()); }
|
||||
public EnumGrenadeFilling getFilling() { return ItemGrenadeUniversal.getFilling(getGrenadeItem()); }
|
||||
public EnumGrenadeFuze getFuze() { return ItemGrenadeUniversal.getFuze(getGrenadeItem()); }
|
||||
public EnumGrenadeExtra getExtra() { return ItemGrenadeUniversal.getExtra(getGrenadeItem()); }
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
EnumGrenadeFuze fuze = this.getFuze();
|
||||
EnumGrenadeExtra extra = this.getExtra();
|
||||
|
||||
if(fuze.updateTick != null) fuze.updateTick.accept(this);
|
||||
if(extra != null && extra.updateTick != null) extra.updateTick.accept(this);
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
this.prevSpin = this.spin;
|
||||
|
||||
if(this.getBounces() <= 0) {
|
||||
this.spin += 15;
|
||||
} else {
|
||||
this.spin += Math.min(15, new Vec3NT(lastTickPosX - posX, 0, lastTickPosZ - posZ).lengthVector() * 50);
|
||||
}
|
||||
|
||||
if(this.spin >= 360) {
|
||||
this.prevSpin -= 360;
|
||||
this.spin -= 360;
|
||||
}
|
||||
|
||||
if(this.getTrail() == TRAIL_TRIPLET) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setDouble("posX", posX);
|
||||
data.setDouble("posY", posY);
|
||||
data.setDouble("posZ", posZ);
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", "flame");
|
||||
MainRegistry.proxy.effectNT(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition mop) {
|
||||
EnumGrenadeFuze fuze = this.getFuze();
|
||||
EnumGrenadeExtra extra = this.getExtra();
|
||||
|
||||
if(fuze.onImpact != null) fuze.onImpact.accept(this, mop);
|
||||
if(extra != null && extra.onImpact != null) extra.onImpact.accept(this, mop);
|
||||
|
||||
if(this.isDead) return; // we assume the grenade has gone off by this point
|
||||
|
||||
if(mop.typeOfHit == mop.typeOfHit.BLOCK) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(mop.sideHit);
|
||||
this.setPosition(mop.hitVec.xCoord + dir.offsetX * 0.05, mop.hitVec.yCoord + dir.offsetY * 0.05, mop.hitVec.zCoord + dir.offsetZ * 0.05);
|
||||
EnumGrenadeShell shell = this.getShell();
|
||||
Vec3NT vec = new Vec3NT(this.motionX, this.motionY, this.motionZ);
|
||||
if(vec.lengthVector() > 0.2) {
|
||||
worldObj.playSoundEffect(posX, posY, posZ, "hbm:weapon.grenadeBounce", 1F, 1F);
|
||||
}
|
||||
if(dir.offsetX != 0) this.motionX *= -shell.getBounce(); else this.motionX *= 0.8;
|
||||
if(dir.offsetY != 0) this.motionY *= -shell.getBounce(); else this.motionY *= 0.8;
|
||||
if(dir.offsetZ != 0) this.motionZ *= -shell.getBounce(); else this.motionZ *= 0.8;
|
||||
if(worldObj instanceof WorldServer) TrackerUtil.sendTeleport((WorldServer) worldObj, this);
|
||||
this.dataWatcher.updateObject(DW_BOUNCES, this.getBounces() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public void explode() {
|
||||
this.setDead();
|
||||
EnumGrenadeFilling filling = this.getFilling();
|
||||
if(filling.explode != null) filling.explode.accept(this);
|
||||
EnumGrenadeExtra extra = this.getExtra();
|
||||
if(extra != null && extra.onExplode != null) extra.onExplode.accept(this);
|
||||
|
||||
if(GeneralConfig.enableExtendedLogging) {
|
||||
String s = "null";
|
||||
if(getThrower() != null && getThrower() instanceof EntityPlayer) s = ((EntityPlayer) getThrower()).getDisplayName();
|
||||
MainRegistry.logger.log(Level.INFO, "[GREN] Set off grenade at " + ((int) posX) + " / " + ((int) posY) + " / " + ((int) posZ) + " by " + s + "!");
|
||||
}
|
||||
}
|
||||
|
||||
public int getTimer() { return this.ticksInAir + this.ticksInGround; }
|
||||
|
||||
@Override protected int groundDespawn() { return 0; }
|
||||
@Override public boolean fullBlockCollisions() { return true; }
|
||||
}
|
||||
62
src/main/java/com/hbm/entity/grenade/EntityGrenadeZOMG.java
Normal file
62
src/main/java/com/hbm/entity/grenade/EntityGrenadeZOMG.java
Normal file
@ -0,0 +1,62 @@
|
||||
package com.hbm.entity.grenade;
|
||||
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.ItemGrenade;
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityGrenadeZOMG extends EntityGrenadeBouncyBase {
|
||||
|
||||
public EntityGrenadeZOMG(World p_i1773_1_) {
|
||||
super(p_i1773_1_);
|
||||
}
|
||||
|
||||
public EntityGrenadeZOMG(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||
super(p_i1774_1_, p_i1774_2_);
|
||||
}
|
||||
|
||||
public EntityGrenadeZOMG(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void explode() {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
this.setDead();
|
||||
|
||||
EntityNukeExplosionMK3 ex = new EntityNukeExplosionMK3(worldObj);
|
||||
ex.posX = posX;
|
||||
ex.posY = posY;
|
||||
ex.posZ = posZ;
|
||||
ex.destructionRange = 50;
|
||||
ex.speed = BombConfig.blastSpeed;
|
||||
ex.coefficient = 1.0F;
|
||||
ex.waste = false;
|
||||
worldObj.spawnEntityInWorld(ex);
|
||||
|
||||
worldObj.playSoundEffect(this.posX, this.posY, this.posZ, "random.explode", 100000.0F, 1.0F);
|
||||
|
||||
EntityCloudFleijaRainbow cloud = new EntityCloudFleijaRainbow(worldObj, 50);
|
||||
cloud.posX = posX;
|
||||
cloud.posY = posY;
|
||||
cloud.posZ = posZ;
|
||||
worldObj.spawnEntityInWorld(cloud);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxTimer() {
|
||||
return ItemGrenade.getFuseTicks(ModItems.grenade_tau);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getBounceMod() {
|
||||
return 0.25D;
|
||||
}
|
||||
|
||||
}
|
||||
107
src/main/java/com/hbm/entity/item/EntityMagnusCartus.java
Normal file
107
src/main/java/com/hbm/entity/item/EntityMagnusCartus.java
Normal file
@ -0,0 +1,107 @@
|
||||
package com.hbm.entity.item;
|
||||
|
||||
import com.hbm.entity.cart.EntityMinecartBogie;
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityMinecart;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityMagnusCartus extends EntityMinecart {
|
||||
|
||||
public EntityMinecartBogie bogie;
|
||||
|
||||
public EntityMagnusCartus(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityMagnusCartus(World p_i1713_1_, double p_i1713_2_, double p_i1713_4_, double p_i1713_6_) {
|
||||
super(p_i1713_1_, p_i1713_2_, p_i1713_4_, p_i1713_6_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMinecartType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
super.entityInit();
|
||||
this.dataWatcher.addObject(25, new Integer(0));
|
||||
}
|
||||
|
||||
public void setBogie(EntityMinecartBogie bogie) {
|
||||
this.bogie = bogie;
|
||||
this.dataWatcher.updateObject(25, bogie.getEntityId());
|
||||
}
|
||||
|
||||
public int getBogieID() {
|
||||
return this.dataWatcher.getWatchableObjectInt(25);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
double dist = 3.0D;
|
||||
double force = 0.3D;
|
||||
|
||||
if(bogie == null) {
|
||||
Vec3 vec = Vec3.createVectorHelper(dist, 0, 0);
|
||||
vec.rotateAroundY(rand.nextFloat() * 6.28F);
|
||||
EntityMinecartBogie bog = new EntityMinecartBogie(worldObj, posX + vec.xCoord, posY + vec.yCoord, posZ + vec.zCoord);
|
||||
this.setBogie(bog);
|
||||
worldObj.spawnEntityInWorld(bog);
|
||||
}
|
||||
|
||||
Vec3 delta = Vec3.createVectorHelper(posX - bogie.posX, posY - bogie.posY, posZ - bogie.posZ);
|
||||
delta = delta.normalize();
|
||||
delta.xCoord *= dist;
|
||||
delta.yCoord *= dist;
|
||||
delta.zCoord *= dist;
|
||||
|
||||
double x = posX - delta.xCoord;
|
||||
double y = posY - delta.yCoord;
|
||||
double z = posZ - delta.zCoord;
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", "reddust");
|
||||
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(this.dimension, x, y, z, 25));
|
||||
|
||||
Vec3 pull = Vec3.createVectorHelper(x - bogie.posX, y - bogie.posY, z - bogie.posZ);
|
||||
bogie.motionX += pull.xCoord * force;
|
||||
bogie.motionY += pull.yCoord * force;
|
||||
bogie.motionZ += pull.zCoord * force;
|
||||
|
||||
if(pull.lengthVector() > 1) {
|
||||
this.motionX -= pull.xCoord * force;
|
||||
this.motionY -= pull.yCoord * force;
|
||||
this.motionZ -= pull.zCoord * force;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
super.readEntityFromNBT(nbt);
|
||||
int bogieID = nbt.getInteger("bogie");
|
||||
Entity e = worldObj.getEntityByID(bogieID);
|
||||
|
||||
if(e instanceof EntityMinecartBogie) {
|
||||
this.setBogie((EntityMinecartBogie) e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
super.writeEntityToNBT(nbt);
|
||||
nbt.setInteger("bogie", this.getBogieID());
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,7 @@ public abstract class EntityMissileTier0 extends EntityMissileBaseNT {
|
||||
bl.posZ = this.posZ;
|
||||
this.worldObj.spawnEntityInWorld(bl);
|
||||
}
|
||||
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.black_hole, 1); }
|
||||
@Override public ItemStack getDebrisRareDrop() { return new ItemStack(ModItems.grenade_black_hole, 1); }
|
||||
@Override public ItemStack getMissileItemForInfo() { return new ItemStack(ModItems.missile_bhole); }
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,6 @@
|
||||
package com.hbm.entity.mob;
|
||||
|
||||
import com.hbm.entity.grenade.EntityGrenadeUniversal;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeUniversal;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFuze.EnumGrenadeFuze;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
import com.hbm.entity.grenade.EntityGrenadeStrong;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.util.Vec3;
|
||||
@ -33,8 +29,7 @@ public class EntityFBIDrone extends EntityUFOBase {
|
||||
Vec3 vec = Vec3.createVectorHelper(posX - target.posX, posY - target.posY, posZ - target.posZ);
|
||||
if(Math.abs(vec.xCoord) < 5 && Math.abs(vec.zCoord) < 5 && vec.yCoord > 3) {
|
||||
attackCooldown = 60;
|
||||
EntityGrenadeUniversal grenade = new EntityGrenadeUniversal(worldObj, ItemGrenadeUniversal.make(EnumGrenadeShell.FRAG, EnumGrenadeFilling.HE, EnumGrenadeFuze.S7));
|
||||
grenade.setThrower(this);
|
||||
EntityGrenadeStrong grenade = new EntityGrenadeStrong(worldObj);
|
||||
grenade.setPosition(posX, posY, posZ);
|
||||
worldObj.spawnEntityInWorld(grenade);
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.blocks.bomb.BlockDetonatable;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.mob.EntityCreeperNuclear;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
@ -39,7 +40,6 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Deprecated // ancient ass fucking bullet entity from pre ItemGunBase days
|
||||
public class EntityBullet extends Entity implements IProjectile {
|
||||
private int tileX = -1;
|
||||
private int tileY = -1;
|
||||
@ -190,6 +190,31 @@ public class EntityBullet extends Entity implements IProjectile {
|
||||
this.setChopper(isTau == "chopper");
|
||||
this.setIsCritical(isTau != "chopper");
|
||||
}
|
||||
|
||||
//why the living shit did i make isTau a string? who knows, who cares.
|
||||
public EntityBullet(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax,
|
||||
boolean instakill, String isTau, EntityGrenadeTau grenade) {
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ,
|
||||
grenade.rotationYaw, grenade.rotationPitch);
|
||||
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.yOffset = 0.0F;
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI)
|
||||
* MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI)
|
||||
* MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
|
||||
this.setTau(isTau == "tauDay");
|
||||
this.setIsCritical(true);
|
||||
}
|
||||
|
||||
public EntityBullet(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
|
||||
super(world);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.entity.projectile;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.effect.EntityCloudFleijaRainbow;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -20,7 +21,7 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityB92Beam extends Entity implements IProjectile
|
||||
public class EntityExplosiveBeam extends Entity implements IProjectile
|
||||
{
|
||||
private int field_145791_d = -1;
|
||||
private int field_145792_e = -1;
|
||||
@ -38,14 +39,14 @@ public class EntityB92Beam extends Entity implements IProjectile
|
||||
private int ticksInGround;
|
||||
private int ticksInAir;
|
||||
private double damage = 2.0D;
|
||||
public EntityB92Beam(World p_i1753_1_)
|
||||
public EntityExplosiveBeam(World p_i1753_1_)
|
||||
{
|
||||
super(p_i1753_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.setSize(0.5F, 0.5F);
|
||||
}
|
||||
|
||||
public EntityB92Beam(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_)
|
||||
public EntityExplosiveBeam(World p_i1754_1_, double p_i1754_2_, double p_i1754_4_, double p_i1754_6_)
|
||||
{
|
||||
super(p_i1754_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
@ -54,7 +55,7 @@ public class EntityB92Beam extends Entity implements IProjectile
|
||||
this.yOffset = 0.0F;
|
||||
}
|
||||
|
||||
public EntityB92Beam(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
|
||||
public EntityExplosiveBeam(World p_i1755_1_, EntityLivingBase p_i1755_2_, EntityLivingBase p_i1755_3_, float p_i1755_4_, float p_i1755_5_)
|
||||
{
|
||||
super(p_i1755_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
@ -83,8 +84,29 @@ public class EntityB92Beam extends Entity implements IProjectile
|
||||
this.setThrowableHeading(d0, d1 + f4, d2, p_i1755_4_, p_i1755_5_);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityExplosiveBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_, int dmgMin, int dmgMax, EntityGrenadeZOMG grenade) {
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
this.shootingEntity = p_i1756_2_;
|
||||
|
||||
public EntityB92Beam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_)
|
||||
this.setSize(0.5F, 0.5F);
|
||||
this.setLocationAndAngles(grenade.posX, grenade.posY + grenade.getEyeHeight(), grenade.posZ,
|
||||
grenade.rotationYaw, grenade.rotationPitch);
|
||||
this.posX -= MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
this.posY -= 0.10000000149011612D;
|
||||
this.posZ -= MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F;
|
||||
this.setPosition(this.posX, this.posY, this.posZ);
|
||||
this.yOffset = 0.0F;
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI)
|
||||
* MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI)
|
||||
* MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
public EntityExplosiveBeam(World p_i1756_1_, EntityLivingBase p_i1756_2_, float p_i1756_3_)
|
||||
{
|
||||
super(p_i1756_1_);
|
||||
this.renderDistanceWeight = 10.0D;
|
||||
@ -103,7 +125,7 @@ public class EntityB92Beam extends Entity implements IProjectile
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);
|
||||
}
|
||||
|
||||
public EntityB92Beam(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
|
||||
public EntityExplosiveBeam(World world, int x, int y, int z, double mx, double my, double mz, double grav) {
|
||||
super(world);
|
||||
this.posX = x + 0.5F;
|
||||
this.posY = y + 0.5F;
|
||||
@ -35,7 +35,7 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
||||
protected EntityLivingBase thrower;
|
||||
private String throwerName;
|
||||
public int ticksInGround;
|
||||
public int ticksInAir;
|
||||
private int ticksInAir;
|
||||
|
||||
public EntityThrowableNT(World world) {
|
||||
super(world);
|
||||
@ -248,13 +248,9 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
||||
float drag = this.getAirDrag();
|
||||
double gravity = this.getGravityVelocity();
|
||||
|
||||
if(fullBlockCollisions()) {
|
||||
this.moveEntity(this.motionX * motionMult(), this.motionY * motionMult(), this.motionZ * motionMult());
|
||||
} else {
|
||||
this.posX += this.motionX * motionMult();
|
||||
this.posY += this.motionY * motionMult();
|
||||
this.posZ += this.motionZ * motionMult();
|
||||
}
|
||||
this.posX += this.motionX * motionMult();
|
||||
this.posY += this.motionY * motionMult();
|
||||
this.posZ += this.motionZ * motionMult();
|
||||
|
||||
if(this.isInWater()) {
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
@ -273,10 +269,6 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean fullBlockCollisions() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean doesImpactEntities() {
|
||||
return true;
|
||||
}
|
||||
@ -320,8 +312,6 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
||||
nbt.setByte("inTile", (byte) Block.getIdFromBlock(this.stuckBlock));
|
||||
nbt.setByte("shake", (byte) this.throwableShake);
|
||||
nbt.setByte("inGround", (byte) (this.inGround ? 1 : 0));
|
||||
nbt.setInteger("ticksInGround", this.ticksInGround);
|
||||
nbt.setInteger("ticksInAir", this.ticksInAir);
|
||||
|
||||
if((this.throwerName == null || this.throwerName.length() == 0) && this.thrower != null && this.thrower instanceof EntityPlayer) {
|
||||
this.throwerName = this.thrower.getCommandSenderName();
|
||||
@ -339,8 +329,6 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
||||
this.throwableShake = nbt.getByte("shake") & 255;
|
||||
this.inGround = nbt.getByte("inGround") == 1;
|
||||
this.throwerName = nbt.getString("ownerName");
|
||||
this.ticksInGround = nbt.getInteger("ticksInGround");
|
||||
this.ticksInAir = nbt.getInteger("ticksInAir");
|
||||
|
||||
if(this.throwerName != null && this.throwerName.length() == 0) {
|
||||
this.throwerName = null;
|
||||
|
||||
@ -4,11 +4,13 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.item.EntityFallingBlockNT;
|
||||
import com.hbm.entity.particle.EntityCloudFX;
|
||||
import com.hbm.entity.particle.EntityModFX;
|
||||
import com.hbm.entity.particle.EntityOrangeFX;
|
||||
import com.hbm.entity.particle.EntityPinkCloudFX;
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.entity.projectile.EntityRocket;
|
||||
import com.hbm.entity.projectile.EntityRubble;
|
||||
import com.hbm.entity.projectile.EntitySchrab;
|
||||
@ -24,6 +26,7 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntityArrow;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.potion.Potion;
|
||||
@ -523,6 +526,51 @@ public class ExplosionChaos { //TODO: destroy this entire class
|
||||
}
|
||||
}
|
||||
|
||||
public static void tauMeSinPi(World world, double x, double y, double z, int count, Entity shooter,
|
||||
EntityGrenadeTau tau) {
|
||||
|
||||
double d1 = 0;
|
||||
double d2 = 0;
|
||||
double d3 = 0;
|
||||
EntityBullet fragment;
|
||||
|
||||
if (shooter != null && shooter instanceof EntityPlayer)
|
||||
for (int i = 0; i < count; i++) {
|
||||
d1 = rand.nextDouble();
|
||||
d2 = rand.nextDouble();
|
||||
d3 = rand.nextDouble();
|
||||
|
||||
if (rand.nextInt(2) == 0) {
|
||||
d1 *= -1;
|
||||
}
|
||||
|
||||
if (rand.nextInt(2) == 0) {
|
||||
d2 *= -1;
|
||||
}
|
||||
|
||||
if (rand.nextInt(2) == 0) {
|
||||
d3 *= -1;
|
||||
}
|
||||
|
||||
if (rand.nextInt(5) == 0) {
|
||||
fragment = new EntityBullet(world, (EntityPlayer) shooter, 3.0F, 35, 45, false, "tauDay", tau);
|
||||
fragment.setDamage(rand.nextInt(301) + 100);
|
||||
} else {
|
||||
fragment = new EntityBullet(world, (EntityPlayer) shooter, 3.0F, 35, 45, false, "eyyOk", tau);
|
||||
fragment.setDamage(rand.nextInt(11) + 35);
|
||||
}
|
||||
|
||||
fragment.motionX = d1 * 5;
|
||||
fragment.motionY = d2 * 5;
|
||||
fragment.motionZ = d3 * 5;
|
||||
fragment.shootingEntity = shooter;
|
||||
|
||||
fragment.setIsCritical(true);
|
||||
|
||||
world.spawnEntityInWorld(fragment);
|
||||
}
|
||||
}
|
||||
|
||||
public static void levelDown(World world, int x, int y, int z, int radius) {
|
||||
|
||||
if(!world.isRemote)
|
||||
|
||||
@ -20,8 +20,10 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.entity.grenade.EntityGrenadeASchrab;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.projectile.EntityBulletBaseNT;
|
||||
import com.hbm.entity.projectile.EntityB92Beam;
|
||||
import com.hbm.entity.projectile.EntityExplosiveBeam;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
@ -100,7 +102,9 @@ public class ExplosionNukeGeneric {
|
||||
private static boolean isExplosionExempt(Entity e) {
|
||||
|
||||
if (e instanceof EntityOcelot ||
|
||||
e instanceof EntityB92Beam ||
|
||||
e instanceof EntityGrenadeASchrab ||
|
||||
e instanceof EntityGrenadeNuclear ||
|
||||
e instanceof EntityExplosiveBeam ||
|
||||
e instanceof EntityBulletBaseNT ||
|
||||
e instanceof EntityPlayer &&
|
||||
ArmorUtil.checkArmor((EntityPlayer) e, ModItems.euphemium_helmet, ModItems.euphemium_plate, ModItems.euphemium_legs, ModItems.euphemium_boots)) {
|
||||
|
||||
@ -9,7 +9,6 @@ import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.interfaces.ICustomDamageHandler;
|
||||
import com.hbm.explosion.vanillant.interfaces.IEntityProcessor;
|
||||
import com.hbm.explosion.vanillant.interfaces.IEntityRangeMutator;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
|
||||
import net.minecraft.enchantment.EnchantmentProtection;
|
||||
import net.minecraft.entity.Entity;
|
||||
@ -23,7 +22,6 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
|
||||
@NotableComments
|
||||
/** The amount of good decisions in NTM is few and far between, but the VNT explosion surely is one of them. */
|
||||
public class EntityProcessorCross implements IEntityProcessor {
|
||||
|
||||
|
||||
@ -52,8 +52,6 @@ public class HbmPlayerProps implements IExtendedEntityProperties {
|
||||
public int reputation;
|
||||
|
||||
public boolean isOnLadder = false;
|
||||
|
||||
public int grenadeDeployment;
|
||||
|
||||
public HbmPlayerProps(EntityPlayer player) {
|
||||
this.player = player;
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.event.world.ChunkDataEvent;
|
||||
|
||||
public class BlockMigrations {
|
||||
|
||||
private static final String NBT_KEY_BUILD_NUMBER = "hfr_migrations_version";
|
||||
private static int buildNumber = -1;
|
||||
|
||||
public static int buildNumber() {
|
||||
if(buildNumber != -1) return buildNumber;
|
||||
String versionString = RefStrings.VERSION.substring(RefStrings.VERSION.indexOf('(') + 1, RefStrings.VERSION.indexOf(')'));
|
||||
try {
|
||||
buildNumber = Integer.parseInt(versionString);
|
||||
} catch(Exception ex) { }
|
||||
return buildNumber;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChunkLoad(ChunkDataEvent.Load event) {
|
||||
// if no build number for migrations has been found, we assume this is a freshly generated chunk, so we skip the migrations.
|
||||
// side effect is that migrations will not work when the starting version is one from before the current migrations system.
|
||||
// we are in this for the long game anyway, so i'd wager this isn't that big of an issue.
|
||||
if(!event.getData().hasKey(NBT_KEY_BUILD_NUMBER)) return;
|
||||
int prevBuildNo = event.getData().getInteger(NBT_KEY_BUILD_NUMBER);
|
||||
|
||||
if(prevBuildNo != buildNumber) try { doMigraion(event.getChunk()); } catch(Exception ex) { }
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChunkSave(ChunkDataEvent.Save event) {
|
||||
event.getData().setInteger(NBT_KEY_BUILD_NUMBER, buildNumber);
|
||||
}
|
||||
|
||||
public static void doMigraion(Chunk chunk) {
|
||||
|
||||
for(int x = 0; x < 16; x++) for(int z = 0; z < 16; z++) {
|
||||
// save ourselves a ton of iterations by optimizing all this air away
|
||||
for(int y = chunk.getHeightValue(x, z); y >= 0; y++) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -78,6 +78,7 @@ public class BobmazonOfferFactory {
|
||||
special.add(new Offer(new ItemStack(ModItems.boy_kit), Requirement.STEEL, 5));
|
||||
special.add(new Offer(new ItemStack(ModItems.prototype_kit), Requirement.STEEL, 10));
|
||||
special.add(new Offer(new ItemStack(ModItems.missile_kit), Requirement.STEEL, 5));
|
||||
special.add(new Offer(new ItemStack(ModItems.grenade_kit), Requirement.STEEL, 5));
|
||||
special.add(new Offer(new ItemStack(ModItems.jetpack_vector), Requirement.STEEL, 2));
|
||||
special.add(new Offer(new ItemStack(ModItems.jetpack_tank), Requirement.STEEL, 2));
|
||||
special.add(new Offer(new ItemStack(ModItems.gun_kit_1, 1), Requirement.STEEL, 1));
|
||||
|
||||
@ -1,10 +1,52 @@
|
||||
package com.hbm.handler;
|
||||
|
||||
import com.hbm.entity.grenade.*;
|
||||
import com.hbm.entity.grenade.EntityGrenadeASchrab;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBlackHole;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBreach;
|
||||
import com.hbm.entity.grenade.EntityGrenadeBurst;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCloud;
|
||||
import com.hbm.entity.grenade.EntityGrenadeCluster;
|
||||
import com.hbm.entity.grenade.EntityGrenadeDynamite;
|
||||
import com.hbm.entity.grenade.EntityGrenadeElectric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeFire;
|
||||
import com.hbm.entity.grenade.EntityGrenadeFlare;
|
||||
import com.hbm.entity.grenade.EntityGrenadeFrag;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGas;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGascan;
|
||||
import com.hbm.entity.grenade.EntityGrenadeGeneric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFBouncy;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFBrimstone;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFConcussion;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFGeneric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFHE;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFHopwire;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFImpact;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFIncendiary;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFMystery;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFNull;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFSpark;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFSticky;
|
||||
import com.hbm.entity.grenade.EntityGrenadeIFToxic;
|
||||
import com.hbm.entity.grenade.EntityGrenadeImpactGeneric;
|
||||
import com.hbm.entity.grenade.EntityGrenadeLemon;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMIRV;
|
||||
import com.hbm.entity.grenade.EntityGrenadeMk2;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuke;
|
||||
import com.hbm.entity.grenade.EntityGrenadePC;
|
||||
import com.hbm.entity.grenade.EntityGrenadePlasma;
|
||||
import com.hbm.entity.grenade.EntityGrenadePoison;
|
||||
import com.hbm.entity.grenade.EntityGrenadePulse;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSchrabidium;
|
||||
import com.hbm.entity.grenade.EntityGrenadeShrapnel;
|
||||
import com.hbm.entity.grenade.EntityGrenadeSmart;
|
||||
import com.hbm.entity.grenade.EntityGrenadeStrong;
|
||||
import com.hbm.entity.grenade.EntityGrenadeTau;
|
||||
import com.hbm.entity.grenade.EntityGrenadeZOMG;
|
||||
import com.hbm.entity.grenade.EntityWastePearl;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemFertilizer;
|
||||
import com.hbm.items.weapon.ItemGenericGrenade;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
|
||||
import net.minecraft.block.BlockDispenser;
|
||||
import net.minecraft.dispenser.BehaviorDefaultDispenseItem;
|
||||
@ -20,29 +62,224 @@ public class DispenserBehaviorHandler {
|
||||
|
||||
public static void init() {
|
||||
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_universal, new BehaviorDefaultDispenseItem() {
|
||||
@Override protected ItemStack dispenseStack(IBlockSource source, ItemStack stack) {
|
||||
|
||||
EnumFacing enumfacing = BlockDispenser.func_149937_b(source.getBlockMetadata());
|
||||
|
||||
EntityGrenadeUniversal grenade = new EntityGrenadeUniversal(source.getWorld(), stack);
|
||||
EnumGrenadeShell shell = grenade.getShell();
|
||||
|
||||
// this kinda sucks ass but it works so i'm not complaining
|
||||
grenade.setPosition(source.getX() + enumfacing.getFrontOffsetX() * 0.75, source.getY() + enumfacing.getFrontOffsetY() * 0.75, source.getZ() + enumfacing.getFrontOffsetZ() * 0.75);
|
||||
grenade.motionX = enumfacing.getFrontOffsetX() * shell.getYeetForce();
|
||||
grenade.motionY = enumfacing.getFrontOffsetY() * shell.getYeetForce();
|
||||
grenade.motionZ = enumfacing.getFrontOffsetZ() * shell.getYeetForce();
|
||||
source.getWorld().spawnEntityInWorld(grenade);
|
||||
|
||||
stack.stackSize--;
|
||||
return stack;
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_generic, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeGeneric(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_strong, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeStrong(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_frag, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeFrag(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_fire, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeFire(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_cluster, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeCluster(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_flare, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeFlare(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_electric, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeElectric(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_poison, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadePoison(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_gas, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeGas(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_schrabidium, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeSchrabidium(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_nuke, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeNuke(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_nuclear, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeNuclear(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_pulse, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadePulse(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_plasma, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadePlasma(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_tau, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeTau(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_lemon, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeLemon(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_mk2, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeMk2(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_aschrab, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeASchrab(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_zomg, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeZOMG(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_shrapnel, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeShrapnel(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_black_hole, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeBlackHole(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_gascan, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeGascan(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_cloud, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeCloud(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_pink_cloud, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadePC(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_smart, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeSmart(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_mirv, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeMIRV(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_breach, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeBreach(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_burst, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeBurst(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_generic, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFGeneric(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_he, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFHE(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_bouncy, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFBouncy(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_sticky, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFSticky(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_impact, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFImpact(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_incendiary, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFIncendiary(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_toxic, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFToxic(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_concussion, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFConcussion(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_brimstone, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFBrimstone(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_mystery, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFMystery(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_spark, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFSpark(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_hopwire, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFHopwire(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_if_null, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeIFNull(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.nuclear_waste_pearl, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityWastePearl(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.stick_dynamite, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeImpactGeneric(world, position.getX(), position.getY(), position.getZ()).setType((ItemGenericGrenade) ModItems.stick_dynamite);
|
||||
return new EntityGrenadeDynamite(world, position.getX(), position.getY(), position.getZ());
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.grenade_kyiv, new BehaviorProjectileDispense() {
|
||||
protected IProjectile getProjectileEntity(World world, IPosition position) {
|
||||
return new EntityGrenadeImpactGeneric(world, position.getX(), position.getY(), position.getZ()).setType((ItemGenericGrenade) ModItems.grenade_kyiv);
|
||||
}
|
||||
});
|
||||
BlockDispenser.dispenseBehaviorRegistry.putObject(ModItems.stick_dynamite_fishing, new BehaviorProjectileDispense() {
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.AnnihilatorRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -23,7 +24,7 @@ public class AnnihilatorHandler extends NEIUniversalHandler {
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
|
||||
outer: for(Pair<Object, Object> recipe : recipes) {
|
||||
outer: for(Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
ItemStack[][] ins = InventoryUtil.extractObject(recipe.getKey());
|
||||
ItemStack[][] outs = InventoryUtil.extractObject(recipe.getValue());
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@ import com.hbm.handler.imc.ICompatNHNEI;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
import com.hbm.inventory.recipes.CrucibleRecipe;
|
||||
import com.hbm.inventory.recipes.CrucibleRecipes;
|
||||
import com.hbm.inventory.recipes.CrucibleRecipes.CrucibleRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -38,16 +38,17 @@ public class CrucibleAlloyingHandler extends TemplateRecipeHandler implements IC
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
List<PositionedStack> inputs = new ArrayList();
|
||||
PositionedStack template;
|
||||
PositionedStack crucible;
|
||||
List<PositionedStack> outputs = new ArrayList();
|
||||
|
||||
public RecipeSet(CrucibleRecipe recipe) {
|
||||
|
||||
List<ItemStack> inputs = new ArrayList();
|
||||
List<ItemStack> outputs = new ArrayList();
|
||||
for(MaterialStack stack : recipe.input) inputs.add(ItemScraps.create(stack, true));
|
||||
for(MaterialStack stack : recipe.output) outputs.add(ItemScraps.create(stack, true));
|
||||
|
||||
this.template = new PositionedStack(new ItemStack(ModItems.crucible_template, 1, recipe.getId()), 75, 6);
|
||||
this.crucible = new PositionedStack(new ItemStack(ModBlocks.machine_crucible), 75, 42);
|
||||
|
||||
for(int i = 0; i < inputs.size(); i++) {
|
||||
@ -76,6 +77,7 @@ public class CrucibleAlloyingHandler extends TemplateRecipeHandler implements IC
|
||||
List<PositionedStack> other = new ArrayList();
|
||||
other.addAll(inputs);
|
||||
other.add(crucible);
|
||||
other.add(template);
|
||||
other.addAll(outputs);
|
||||
return getCycledIngredients(cycleticks / 20, other);
|
||||
}
|
||||
@ -96,7 +98,7 @@ public class CrucibleAlloyingHandler extends TemplateRecipeHandler implements IC
|
||||
|
||||
if(outputId.equals("ntmCrucibleAlloying")) {
|
||||
|
||||
for(CrucibleRecipe recipe : CrucibleRecipes.INSTANCE.recipeOrderedList) {
|
||||
for(CrucibleRecipe recipe : CrucibleRecipes.recipes) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
}
|
||||
} else {
|
||||
@ -112,7 +114,7 @@ public class CrucibleAlloyingHandler extends TemplateRecipeHandler implements IC
|
||||
|
||||
NTMMaterial material = Mats.matById.get(result.getItemDamage());
|
||||
|
||||
for(CrucibleRecipe recipe : CrucibleRecipes.INSTANCE.recipeOrderedList) {
|
||||
for(CrucibleRecipe recipe : CrucibleRecipes.recipes) {
|
||||
|
||||
for(MaterialStack stack : recipe.output) {
|
||||
if(stack.material == material) {
|
||||
@ -141,7 +143,7 @@ public class CrucibleAlloyingHandler extends TemplateRecipeHandler implements IC
|
||||
|
||||
NTMMaterial material = Mats.matById.get(ingredient.getItemDamage());
|
||||
|
||||
for(CrucibleRecipe recipe : CrucibleRecipes.INSTANCE.recipeOrderedList) {
|
||||
for(CrucibleRecipe recipe : CrucibleRecipes.recipes) {
|
||||
|
||||
for(MaterialStack stack : recipe.input) {
|
||||
if(stack.material == material) {
|
||||
|
||||
@ -1,111 +0,0 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeExtra.EnumGrenadeExtra;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFuze.EnumGrenadeFuze;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeUniversal;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class GrenadeRecipeHandler extends NEIUniversalHandler {
|
||||
|
||||
public GrenadeRecipeHandler() {
|
||||
super("Grenade Crafting", Blocks.crafting_table, new ArrayList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmGrenade";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
if(outputId.equals(getKey())) {
|
||||
|
||||
for(EnumGrenadeShell shell : EnumGrenadeShell.values()) for(EnumGrenadeFilling filling : EnumGrenadeFilling.values()) {
|
||||
if(filling.compatibleShells.contains(shell)) for(EnumGrenadeFuze fuze : EnumGrenadeFuze.values()) {
|
||||
addRecipe(shell, filling, fuze, null);
|
||||
for(EnumGrenadeExtra extra : EnumGrenadeExtra.values()) addRecipe(shell, filling, fuze, extra);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
if(ingredient.getItem() == ModItems.grenade_shell) {
|
||||
EnumGrenadeShell shell = EnumUtil.grabEnumSafely(EnumGrenadeShell.class, ingredient.getItemDamage());
|
||||
for(EnumGrenadeFilling filling : EnumGrenadeFilling.values()) {
|
||||
if(filling.compatibleShells.contains(shell)) for(EnumGrenadeFuze fuze : EnumGrenadeFuze.values()) {
|
||||
addRecipe(shell, filling, fuze, null);
|
||||
for(EnumGrenadeExtra extra : EnumGrenadeExtra.values()) addRecipe(shell, filling, fuze, extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ingredient.getItem() == ModItems.grenade_filling) {
|
||||
EnumGrenadeFilling filling = EnumUtil.grabEnumSafely(EnumGrenadeFilling.class, ingredient.getItemDamage());
|
||||
for(EnumGrenadeShell shell : EnumGrenadeShell.values()) {
|
||||
if(filling.compatibleShells.contains(shell)) for(EnumGrenadeFuze fuze : EnumGrenadeFuze.values()) {
|
||||
addRecipe(shell, filling, fuze, null);
|
||||
for(EnumGrenadeExtra extra : EnumGrenadeExtra.values()) addRecipe(shell, filling, fuze, extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ingredient.getItem() == ModItems.grenade_fuze) {
|
||||
EnumGrenadeFuze fuze = EnumUtil.grabEnumSafely(EnumGrenadeFuze.class, ingredient.getItemDamage());
|
||||
for(EnumGrenadeShell shell : EnumGrenadeShell.values()) for(EnumGrenadeFilling filling : EnumGrenadeFilling.values()) {
|
||||
if(filling.compatibleShells.contains(shell)) {
|
||||
addRecipe(shell, filling, fuze, null);
|
||||
for(EnumGrenadeExtra extra : EnumGrenadeExtra.values()) addRecipe(shell, filling, fuze, extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(ingredient.getItem() == ModItems.grenade_extra) {
|
||||
EnumGrenadeExtra extra = EnumUtil.grabEnumSafely(EnumGrenadeExtra.class, ingredient.getItemDamage());
|
||||
for(EnumGrenadeShell shell : EnumGrenadeShell.values()) for(EnumGrenadeFilling filling : EnumGrenadeFilling.values()) {
|
||||
if(filling.compatibleShells.contains(shell)) for(EnumGrenadeFuze fuze : EnumGrenadeFuze.values()) {
|
||||
addRecipe(shell, filling, fuze, extra);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
if(result == null || result.getItem() != ModItems.grenade_universal) return;
|
||||
|
||||
EnumGrenadeShell shell = ItemGrenadeUniversal.getShell(result);
|
||||
EnumGrenadeFilling filling = ItemGrenadeUniversal.getFilling(result);
|
||||
EnumGrenadeFuze fuze = ItemGrenadeUniversal.getFuze(result);
|
||||
EnumGrenadeExtra extra = ItemGrenadeUniversal.getExtra(result);
|
||||
addRecipe(shell, filling, fuze, extra);
|
||||
}
|
||||
|
||||
public void addRecipe(EnumGrenadeShell shell, EnumGrenadeFilling filling, EnumGrenadeFuze fuze, EnumGrenadeExtra extra) {
|
||||
|
||||
ItemStack[][] ins = new ItemStack[extra != null ? 4 : 3][1];
|
||||
ins[0][0] = DictFrame.fromOne(ModItems.grenade_shell, shell);
|
||||
ins[1][0] = DictFrame.fromOne(ModItems.grenade_filling, filling);
|
||||
ins[2][0] = DictFrame.fromOne(ModItems.grenade_fuze, fuze);
|
||||
if(extra != null) ins[3][0] = DictFrame.fromOne(ModItems.grenade_extra, extra);
|
||||
|
||||
ItemStack[][] outs = new ItemStack[][] {{ItemGrenadeUniversal.make(shell, filling, fuze, extra)}};
|
||||
this.arecipes.add(new RecipeSet(ins, outs, null));
|
||||
}
|
||||
}
|
||||
@ -14,7 +14,6 @@ import com.hbm.handler.imc.ICompatNHNEI;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
@ -24,6 +23,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@Deprecated // an experiment that i had to staple more and more features to until it ended up a bloated decaying corpse
|
||||
public abstract class NEIUniversalHandler extends TemplateRecipeHandler implements ICompatNHNEI {
|
||||
|
||||
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
|
||||
@ -34,37 +34,24 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
/// SETUP ///
|
||||
public final String display;
|
||||
public final ItemStack[] machine;
|
||||
public final List<Pair<Object, Object>> recipes = new ArrayList();
|
||||
public final HashMap<Object, Object> recipes;
|
||||
public HashMap<Object, Object> machineOverrides;
|
||||
/// SETUP ///
|
||||
@Deprecated public NEIUniversalHandler(String display, ItemStack machine[], HashMap recipes) {
|
||||
public NEIUniversalHandler(String display, ItemStack machine[], HashMap recipes) {
|
||||
this.display = display;
|
||||
this.machine = machine;
|
||||
for(Object e : recipes.entrySet()) this.recipes.add(new Pair(((Entry) e).getKey(), ((Entry) e).getValue()));
|
||||
this.machineOverrides = null;
|
||||
}
|
||||
public NEIUniversalHandler(String display, ItemStack machine[], List recipes) {
|
||||
this.display = display;
|
||||
this.machine = machine;
|
||||
this.recipes.addAll(recipes);
|
||||
this.recipes = recipes;
|
||||
this.machineOverrides = null;
|
||||
}
|
||||
|
||||
@Deprecated public NEIUniversalHandler(String display, HashMap recipes, HashMap machines) {
|
||||
this(display, (ItemStack[]) null, recipes);
|
||||
this.machineOverrides = machines;
|
||||
}
|
||||
public NEIUniversalHandler(String display, List recipes, HashMap machines) {
|
||||
public NEIUniversalHandler(String display, HashMap recipes, HashMap machines) {
|
||||
this(display, (ItemStack[]) null, recipes);
|
||||
this.machineOverrides = machines;
|
||||
}
|
||||
|
||||
@Deprecated public NEIUniversalHandler(String display, ItemStack machine, HashMap recipes) { this(display, new ItemStack[]{machine}, recipes); }
|
||||
@Deprecated public NEIUniversalHandler(String display, Item machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
@Deprecated public NEIUniversalHandler(String display, Block machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
public NEIUniversalHandler(String display, ItemStack machine, List recipes) { this(display, new ItemStack[]{machine}, recipes); }
|
||||
public NEIUniversalHandler(String display, Item machine, List recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
public NEIUniversalHandler(String display, Block machine, List recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
public NEIUniversalHandler(String display, ItemStack machine, HashMap recipes) { this(display, new ItemStack[]{machine}, recipes); }
|
||||
public NEIUniversalHandler(String display, Item machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
public NEIUniversalHandler(String display, Block machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
@ -292,7 +279,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
|
||||
if(outputId.equals(getKey())) {
|
||||
|
||||
outer: for(Pair<Object, Object> recipe : recipes) {
|
||||
outer: for(Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
ItemStack[][] ins = InventoryUtil.extractObject(recipe.getKey());
|
||||
ItemStack[][] outs = InventoryUtil.extractObject(recipe.getValue());
|
||||
|
||||
@ -310,7 +297,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
|
||||
outer: for(Pair<Object, Object> recipe : recipes) {
|
||||
outer: for(Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
ItemStack[][] ins = InventoryUtil.extractObject(recipe.getKey());
|
||||
ItemStack[][] outs = InventoryUtil.extractObject(recipe.getValue());
|
||||
|
||||
@ -341,7 +328,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
outer: for(Pair<Object, Object> recipe : recipes) {
|
||||
outer: for(Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
ItemStack[][] ins = InventoryUtil.extractObject(recipe.getKey());
|
||||
ItemStack[][] outs = InventoryUtil.extractObject(recipe.getValue());
|
||||
|
||||
|
||||
@ -17,6 +17,9 @@ public class ContainerCrucible extends Container {
|
||||
public ContainerCrucible(InventoryPlayer invPlayer, TileEntityCrucible crucible) {
|
||||
this.crucible = crucible;
|
||||
|
||||
//template
|
||||
this.addSlotToContainer(new SlotNonRetarded(crucible, 0, 107, 81));
|
||||
|
||||
//input
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 3; j++) {
|
||||
@ -50,14 +53,14 @@ public class ContainerCrucible extends Container {
|
||||
ItemStack originalStack = slot.getStack();
|
||||
stack = originalStack.copy();
|
||||
|
||||
if(index <= 8) {
|
||||
if(!this.mergeItemStack(originalStack, 9, this.inventorySlots.size(), true)) {
|
||||
if(index <= 9) {
|
||||
if(!this.mergeItemStack(originalStack, 10, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(originalStack, stack);
|
||||
|
||||
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, originalStack, 0, 9, false)) {
|
||||
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, originalStack, 0, 10, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -26,19 +26,15 @@ public class ContainerMachinePress extends Container {
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 80, 53));
|
||||
// Output
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 140, 35));
|
||||
// Extra Storage
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(tedf, 4 + i, 8 + i * 18, 84));
|
||||
}
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 120 + i * 18));
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 178));
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,29 +47,23 @@ public class ContainerMachinePress extends Container {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 12) {
|
||||
if(!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true)) {
|
||||
if(par2 <= 3) {
|
||||
if(!this.mergeItemStack(var5, 4, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(TileEntityFurnace.isItemFuel(var3)) {
|
||||
if(!this.mergeItemStack(var5, 0, 1, false)) {
|
||||
if(!this.mergeItemStack(var5, 4, 13, false)) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
} else if(var3.getItem() instanceof ItemStamp) {
|
||||
if(!this.mergeItemStack(var5, 1, 2, false)) {
|
||||
if(!this.mergeItemStack(var5, 4, 13, false)) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 2, 3, false)) {
|
||||
if(!this.mergeItemStack(var5, 4, 13, false)) {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,9 +12,6 @@ import com.hbm.inventory.container.ContainerCrucible;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial.SmeltingBehavior;
|
||||
import com.hbm.inventory.recipes.CrucibleRecipe;
|
||||
import com.hbm.inventory.recipes.CrucibleRecipes;
|
||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityCrucible;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
@ -48,22 +45,6 @@ public class GUICrucible extends GuiInfoContainer {
|
||||
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 125, guiTop + 81, 34, 7, x, y, new String[] { String.format(Locale.US, "%,d", crucible.progress) + " / " + String.format(Locale.US, "%,d", crucible.processTime) + "TU" });
|
||||
this.drawCustomInfoStat(x, y, guiLeft + 125, guiTop + 90, 34, 7, x, y, new String[] { String.format(Locale.US, "%,d", crucible.heat) + " / " + String.format(Locale.US, "%,d", crucible.maxHeat) + "TU" });
|
||||
|
||||
if(guiLeft + 106 <= x && guiLeft + 106 + 18 > x && guiTop + 80 < y && guiTop + 80 + 18 >= y) {
|
||||
if(this.crucible.recipe != null && CrucibleRecipes.INSTANCE.recipeNameMap.containsKey(this.crucible.recipe)) {
|
||||
CrucibleRecipe recipe = (CrucibleRecipe) CrucibleRecipes.INSTANCE.recipeNameMap.get(this.crucible.recipe);
|
||||
this.func_146283_a(recipe.print(), x, y);
|
||||
} else {
|
||||
this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int button) {
|
||||
super.mouseClicked(x, y, button);
|
||||
|
||||
if(this.checkClick(x, y, 106, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(CrucibleRecipes.INSTANCE, crucible, crucible.recipe, 0, null, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -85,10 +66,6 @@ public class GUICrucible extends GuiInfoContainer {
|
||||
int hGauge = crucible.heat * 33 / crucible.maxHeat;
|
||||
if(hGauge > 0) drawTexturedModalRect(guiLeft + 126, guiTop + 91, 176, 5, hGauge, 5);
|
||||
|
||||
GenericRecipe recipe = CrucibleRecipes.INSTANCE.recipeNameMap.get(crucible.recipe);
|
||||
this.renderItem(recipe != null ? recipe.getIcon() : TEMPLATE_FOLDER, 107, 81);
|
||||
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
if(!crucible.recipeStack.isEmpty()) drawStack(crucible.recipeStack, crucible.recipeZCapacity, 62, 97);
|
||||
if(!crucible.wasteStack.isEmpty()) drawStack(crucible.wasteStack, crucible.wasteZCapacity, 17, 97);
|
||||
}
|
||||
|
||||
@ -78,8 +78,6 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
|
||||
list.set(cycle, selected);
|
||||
}
|
||||
|
||||
lines.add(new Object[] {"Booster Isotope:"});
|
||||
|
||||
if(list.size() < 10) {
|
||||
lines.add(list.toArray());
|
||||
} else if(list.size() < 24) {
|
||||
@ -119,7 +117,7 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer {
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int p = (int) (forge.power * 62 / forge.maxPower);
|
||||
int p = (int) (forge.power * 61 / forge.maxPower);
|
||||
drawTexturedModalRect(guiLeft + 152, guiTop + 80 - p, 176, 62 - p, 16, p);
|
||||
|
||||
if(forge.plasmaModule.progress > 0) {
|
||||
|
||||
@ -22,7 +22,7 @@ public class GUIMachinePress extends GuiInfoContainer {
|
||||
press = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 202;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -48,11 +48,11 @@ public class GUIMachinePress extends GuiInfoContainer {
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(press.burnTime >= 20) {
|
||||
this.drawTexturedModalRect(guiLeft + 27, guiTop + 36, 0, 202, 14, 14);
|
||||
this.drawTexturedModalRect(guiLeft + 27, guiTop + 36, 176, 0, 14, 14);
|
||||
}
|
||||
|
||||
int k = (int) (press.renderPress * 16 / press.maxPress);
|
||||
this.drawTexturedModalRect(guiLeft + 79, guiTop + 35, 14, 202, 18, k);
|
||||
this.drawTexturedModalRect(guiLeft + 79, guiTop + 35, 194, 0, 18, k);
|
||||
|
||||
double i = (double) press.speed / (double) press.maxSpeed;
|
||||
GaugeUtil.drawSmoothGauge(guiLeft + 34, guiTop + 25, this.zLevel, i, 5, 2, 1, 0x7f0000);
|
||||
|
||||
@ -1,149 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKNumitron;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIScreenRBMKDisplay extends GuiScreen {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_rbmk_numitron.png");
|
||||
public TileEntityRBMKNumitron display;
|
||||
protected int xSize = 256;
|
||||
protected int ySize = 114;
|
||||
protected int guiLeft;
|
||||
protected int guiTop;
|
||||
|
||||
protected GuiTextField[] label = new GuiTextField[2];
|
||||
protected GuiTextField[] rtty = new GuiTextField[2];
|
||||
protected boolean[] active = new boolean[2];
|
||||
protected boolean[] polling = new boolean[2];
|
||||
|
||||
public GUIScreenRBMKDisplay(TileEntityRBMKNumitron display) {
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.guiLeft = (this.width - this.xSize) / 2;
|
||||
this.guiTop = (this.height - this.ySize) / 2;
|
||||
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
int oX = 4;
|
||||
int oY = 4;
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
label[i] = new GuiTextField(this.fontRendererObj, guiLeft + 175 + oX, guiTop + 55 + oY + i * 36, 72 - oX * 2, 14);
|
||||
GUIScreenRBMKKeyPad.setupTextFieldStandard(label[i], 30, display.displays[i].label);
|
||||
rtty[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 55 + oY + i * 36, 72 - oX * 2, 14);
|
||||
GUIScreenRBMKKeyPad.setupTextFieldStandard(rtty[i], 10, display.displays[i].rtty);
|
||||
|
||||
active[i] = display.displays[i].active;
|
||||
polling[i] = display.displays[i].polling;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
this.drawDefaultBackground();
|
||||
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
private void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
String name = I18nUtil.resolveKey("container.rbmkNumitron");
|
||||
this.fontRendererObj.drawString(name, this.guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, this.guiTop + 6, 4210752);
|
||||
}
|
||||
|
||||
private void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(this.active[i]) drawTexturedModalRect(guiLeft + 111, guiTop + i * 36 + 54, 18, 114, 16, 16);
|
||||
if(this.polling[i]) drawTexturedModalRect(guiLeft + 128, guiTop + i * 36 + 53, 0, 114, 18, 18);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
this.label[i].drawTextBox();
|
||||
this.rtty[i].drawTextBox();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int b) {
|
||||
super.mouseClicked(x, y, b);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(guiLeft + 111 <= x && guiLeft + 111 + 16 > x && guiTop + i * 36 + 54 < y && guiTop + i * 36 + 54 + 16 >= y) {
|
||||
this.active[i] = !this.active[i];
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.5F + (this.active[i] ? 0.25F : 0F)));
|
||||
return;
|
||||
}
|
||||
|
||||
if(guiLeft + 128 <= x && guiLeft + 128 + 18 > x && guiTop + i * 36 + 53 < y && guiTop + i * 36 + 53 + 18 >= y) {
|
||||
this.polling[i] = !this.polling[i];
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.5F + (this.polling[i] ? 0.25F : 0F)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(guiLeft + 209 <= x && guiLeft + 209 + 18 > x && guiTop + 17 < y && guiTop + 17 + 18 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
byte active = 0;
|
||||
byte polling = 0;
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(this.active[i]) active |= 1 << i;
|
||||
if(this.polling[i]) polling |= 1 << i;
|
||||
}
|
||||
data.setByte("active", active);
|
||||
data.setByte("polling", polling);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
data.setString("label" + i, this.label[i].getText());
|
||||
data.setString("rtty" + i, this.rtty[i].getText());
|
||||
}
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, display.xCoord, display.yCoord, display.zCoord));
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
this.label[i].mouseClicked(x, y, b);
|
||||
this.rtty[i].mouseClicked(x, y, b);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int b) {
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(this.label[i].textboxKeyTyped(c, b)) return;
|
||||
if(this.rtty[i].textboxKeyTyped(c, b)) return;
|
||||
}
|
||||
|
||||
if(b == 1 || b == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
this.mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onGuiClosed() { Keyboard.enableRepeatEvents(false); }
|
||||
@Override public boolean doesGuiPauseGame() { return false; }
|
||||
}
|
||||
@ -35,6 +35,9 @@ public class GUIScreenRBMKGauge extends GuiScreen {
|
||||
|
||||
public GUIScreenRBMKGauge(TileEntityRBMKGauge keypad) {
|
||||
this.keypad = keypad;
|
||||
|
||||
this.xSize = 256;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,150 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKGraph;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
// Literally just GUIScreenRBMKDisplay but with three lines switched out - this sucks ass
|
||||
public class GUIScreenRBMKGraph extends GuiScreen {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_rbmk_graph.png");
|
||||
public TileEntityRBMKGraph graph;
|
||||
protected int xSize = 256;
|
||||
protected int ySize = 114;
|
||||
protected int guiLeft;
|
||||
protected int guiTop;
|
||||
|
||||
protected GuiTextField[] label = new GuiTextField[2];
|
||||
protected GuiTextField[] rtty = new GuiTextField[2];
|
||||
protected boolean[] active = new boolean[2];
|
||||
protected boolean[] polling = new boolean[2];
|
||||
|
||||
public GUIScreenRBMKGraph(TileEntityRBMKGraph display) {
|
||||
this.graph = display;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.guiLeft = (this.width - this.xSize) / 2;
|
||||
this.guiTop = (this.height - this.ySize) / 2;
|
||||
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
int oX = 4;
|
||||
int oY = 4;
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
label[i] = new GuiTextField(this.fontRendererObj, guiLeft + 175 + oX, guiTop + 55 + oY + i * 36, 72 - oX * 2, 14);
|
||||
GUIScreenRBMKKeyPad.setupTextFieldStandard(label[i], 30, graph.graphs[i].label);
|
||||
rtty[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 55 + oY + i * 36, 72 - oX * 2, 14);
|
||||
GUIScreenRBMKKeyPad.setupTextFieldStandard(rtty[i], 10, graph.graphs[i].rtty);
|
||||
|
||||
active[i] = graph.graphs[i].active;
|
||||
polling[i] = graph.graphs[i].polling;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
this.drawDefaultBackground();
|
||||
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
private void drawGuiContainerForegroundLayer(int x, int y) {
|
||||
String name = I18nUtil.resolveKey("container.rbmkNumitron");
|
||||
this.fontRendererObj.drawString(name, this.guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, this.guiTop + 6, 4210752);
|
||||
}
|
||||
|
||||
private void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(this.active[i]) drawTexturedModalRect(guiLeft + 111, guiTop + i * 36 + 54, 18, 114, 16, 16);
|
||||
if(this.polling[i]) drawTexturedModalRect(guiLeft + 128, guiTop + i * 36 + 53, 0, 114, 18, 18);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
this.label[i].drawTextBox();
|
||||
this.rtty[i].drawTextBox();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int b) {
|
||||
super.mouseClicked(x, y, b);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(guiLeft + 111 <= x && guiLeft + 111 + 16 > x && guiTop + i * 36 + 54 < y && guiTop + i * 36 + 54 + 16 >= y) {
|
||||
this.active[i] = !this.active[i];
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.5F + (this.active[i] ? 0.25F : 0F)));
|
||||
return;
|
||||
}
|
||||
|
||||
if(guiLeft + 128 <= x && guiLeft + 128 + 18 > x && guiTop + i * 36 + 53 < y && guiTop + i * 36 + 53 + 18 >= y) {
|
||||
this.polling[i] = !this.polling[i];
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.5F + (this.polling[i] ? 0.25F : 0F)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(guiLeft + 209 <= x && guiLeft + 209 + 18 > x && guiTop + 17 < y && guiTop + 17 + 18 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
byte active = 0;
|
||||
byte polling = 0;
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(this.active[i]) active |= 1 << i;
|
||||
if(this.polling[i]) polling |= 1 << i;
|
||||
}
|
||||
data.setByte("active", active);
|
||||
data.setByte("polling", polling);
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
data.setString("label" + i, this.label[i].getText());
|
||||
data.setString("rtty" + i, this.rtty[i].getText());
|
||||
}
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, graph.xCoord, graph.yCoord, graph.zCoord));
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
this.label[i].mouseClicked(x, y, b);
|
||||
this.rtty[i].mouseClicked(x, y, b);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int b) {
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
if(this.label[i].textboxKeyTyped(c, b)) return;
|
||||
if(this.rtty[i].textboxKeyTyped(c, b)) return;
|
||||
}
|
||||
|
||||
if(b == 1 || b == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
this.mc.setIngameFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void onGuiClosed() { Keyboard.enableRepeatEvents(false); }
|
||||
@Override public boolean doesGuiPauseGame() { return false; }
|
||||
}
|
||||
330
src/main/java/com/hbm/inventory/gui/GUIScreenTemplateFolder.java
Normal file
330
src/main/java/com/hbm/inventory/gui/GUIScreenTemplateFolder.java
Normal file
@ -0,0 +1,330 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.inventory.recipes.CrucibleRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.ItemFolderPacket;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIScreenTemplateFolder extends GuiScreen {
|
||||
|
||||
protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_planner.png");
|
||||
protected static final ResourceLocation texture_journal = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_planner_journal.png");
|
||||
private boolean isJournal = false;
|
||||
protected int xSize = 176;
|
||||
protected int ySize = 229;
|
||||
protected int guiLeft;
|
||||
protected int guiTop;
|
||||
int currentPage = 0;
|
||||
List<ItemStack> allStacks = new ArrayList<ItemStack>();
|
||||
List<ItemStack> stacks = new ArrayList<ItemStack>();
|
||||
List<FolderButton> buttons = new ArrayList<FolderButton>();
|
||||
private GuiTextField search;
|
||||
|
||||
public GUIScreenTemplateFolder(EntityPlayer player) {
|
||||
|
||||
if(player.getHeldItem() == null)
|
||||
return;
|
||||
|
||||
Item item = player.getHeldItem().getItem();
|
||||
|
||||
this.isJournal = item != ModItems.template_folder;
|
||||
|
||||
|
||||
|
||||
if(!this.isJournal) {
|
||||
|
||||
// Crucible Templates
|
||||
for(int i = 0; i < CrucibleRecipes.recipes.size(); i++) {
|
||||
allStacks.add(new ItemStack(ModItems.crucible_template, 1, CrucibleRecipes.recipes.get(i).getId()));
|
||||
}
|
||||
}
|
||||
|
||||
search(null);
|
||||
}
|
||||
|
||||
private void search(String sub) {
|
||||
|
||||
stacks.clear();
|
||||
|
||||
this.currentPage = 0;
|
||||
|
||||
if(sub == null || sub.isEmpty()) {
|
||||
stacks.addAll(allStacks);
|
||||
updateButtons();
|
||||
return;
|
||||
}
|
||||
|
||||
sub = sub.toLowerCase(Locale.US);
|
||||
|
||||
outer:
|
||||
for(ItemStack stack : allStacks) {
|
||||
|
||||
for(Object o : stack.getTooltip(MainRegistry.proxy.me(), true)) {
|
||||
|
||||
if(o instanceof String) {
|
||||
String text = (String) o;
|
||||
|
||||
if(text.toLowerCase(Locale.US).contains(sub)) {
|
||||
stacks.add(stack);
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
int getPageCount() {
|
||||
return (int) Math.ceil((stacks.size() - 1) / (5 * 7));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
if(currentPage < 0)
|
||||
currentPage = 0;
|
||||
if(currentPage > getPageCount())
|
||||
currentPage = getPageCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
this.drawDefaultBackground();
|
||||
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
this.guiLeft = (this.width - this.xSize) / 2;
|
||||
this.guiTop = (this.height - this.ySize) / 2;
|
||||
|
||||
updateButtons();
|
||||
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
this.search = new GuiTextField(this.fontRendererObj, guiLeft + 61, guiTop + 213, 48, 12);
|
||||
this.search.setTextColor(0xffffff);
|
||||
this.search.setDisabledTextColour(0xffffff);
|
||||
this.search.setEnableBackgroundDrawing(false);
|
||||
this.search.setMaxStringLength(100);
|
||||
this.search.setFocused(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void updateButtons() {
|
||||
|
||||
if(!buttons.isEmpty())
|
||||
buttons.clear();
|
||||
|
||||
for(int i = currentPage * 35; i < Math.min(currentPage * 35 + 35, stacks.size()); i++) {
|
||||
buttons.add(new FolderButton(guiLeft + 25 + (27 * (i % 5)), guiTop + 26 + (27 * (int) Math.floor((i / 5D))) - currentPage * 27 * 7, stacks.get(i)));
|
||||
}
|
||||
|
||||
if(currentPage != 0)
|
||||
buttons.add(new FolderButton(guiLeft + 25 - 18, guiTop + 26 + (27 * 3), 1, "Previous"));
|
||||
if(currentPage != getPageCount())
|
||||
buttons.add(new FolderButton(guiLeft + 25 + (27 * 4) + 18, guiTop + 26 + (27 * 3), 2, "Next"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleMouseInput() {
|
||||
super.handleMouseInput();
|
||||
|
||||
if(Mouse.getEventButton() == -1) {
|
||||
int scroll = Mouse.getEventDWheel();
|
||||
|
||||
if(scroll > 0) {
|
||||
if(currentPage > 0)
|
||||
currentPage--;
|
||||
updateButtons();
|
||||
} else if(scroll < 0) {
|
||||
if(currentPage < getPageCount())
|
||||
currentPage++;
|
||||
updateButtons();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int i, int j, int k) {
|
||||
|
||||
if(i >= guiLeft + 45 && i < guiLeft + 117 && j >= guiTop + 211 && j < guiTop + 223) {
|
||||
this.search.setFocused(true);
|
||||
} else {
|
||||
this.search.setFocused(false);
|
||||
}
|
||||
|
||||
try {
|
||||
for(FolderButton b : buttons)
|
||||
if(b.isMouseOnButton(i, j))
|
||||
b.executeAction();
|
||||
} catch(Exception ex) {
|
||||
updateButtons();
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
|
||||
this.fontRendererObj.drawString(I18n.format((currentPage + 1) + "/" + (getPageCount() + 1)), guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth(I18n.format((currentPage + 1) + "/" + (getPageCount() + 1))) / 2, guiTop + 10, isJournal ? 4210752 : 0xffffff);
|
||||
|
||||
for(FolderButton b : buttons)
|
||||
if(b.isMouseOnButton(i, j))
|
||||
b.drawString(i, j);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
if(!isJournal)
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
else
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture_journal);
|
||||
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(search.isFocused())
|
||||
drawTexturedModalRect(guiLeft + 45, guiTop + 211, 176, 54, 72, 12);
|
||||
|
||||
for(FolderButton b : buttons)
|
||||
b.drawButton(b.isMouseOnButton(i, j));
|
||||
for(FolderButton b : buttons)
|
||||
b.drawIcon(b.isMouseOnButton(i, j));
|
||||
|
||||
search.drawTextBox();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char p_73869_1_, int p_73869_2_) {
|
||||
|
||||
if (this.search.textboxKeyTyped(p_73869_1_, p_73869_2_)) {
|
||||
this.search(this.search.getText());
|
||||
return;
|
||||
}
|
||||
|
||||
if(p_73869_2_ == 1 || p_73869_2_ == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FolderButton {
|
||||
|
||||
int xPos;
|
||||
int yPos;
|
||||
// 0: regular, 1: prev, 2: next
|
||||
int type;
|
||||
String info;
|
||||
ItemStack stack;
|
||||
|
||||
public FolderButton(int x, int y, int t, String i) {
|
||||
xPos = x;
|
||||
yPos = y;
|
||||
type = t;
|
||||
info = i;
|
||||
}
|
||||
|
||||
public FolderButton(int x, int y, ItemStack stack) {
|
||||
xPos = x;
|
||||
yPos = y;
|
||||
type = 0;
|
||||
info = stack.getDisplayName();
|
||||
this.stack = stack.copy();
|
||||
}
|
||||
|
||||
public void updateButton(int mouseX, int mouseY) {
|
||||
}
|
||||
|
||||
public boolean isMouseOnButton(int mouseX, int mouseY) {
|
||||
return xPos <= mouseX && xPos + 18 > mouseX && yPos < mouseY && yPos + 18 >= mouseY;
|
||||
}
|
||||
|
||||
public void drawButton(boolean b) {
|
||||
|
||||
if(!isJournal)
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
else
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture_journal);
|
||||
|
||||
drawTexturedModalRect(xPos, yPos, b ? 176 + 18 : 176, type == 1 ? 18 : (type == 2 ? 36 : 0), 18, 18);
|
||||
}
|
||||
|
||||
public void drawIcon(boolean b) {
|
||||
try {
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) 240 / 1.0F, (float) 240 / 1.0F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
if(stack != null) {
|
||||
if(stack.getItem() == ModItems.crucible_template)
|
||||
itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), CrucibleRecipes.indexMapping.get(stack.getItemDamage()).icon, xPos + 1, yPos + 1);
|
||||
else
|
||||
itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), stack, xPos + 1, yPos + 1);
|
||||
}
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
} catch(Exception x) {
|
||||
}
|
||||
}
|
||||
|
||||
public void drawString(int x, int y) {
|
||||
if(info == null || info.isEmpty())
|
||||
return;
|
||||
|
||||
if(stack != null) {
|
||||
GUIScreenTemplateFolder.this.renderToolTip(stack, x, y);
|
||||
} else {
|
||||
func_146283_a(Arrays.asList(new String[] { info }), x, y);
|
||||
}
|
||||
}
|
||||
|
||||
public void executeAction() {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
if(type == 0) {
|
||||
PacketDispatcher.wrapper.sendToServer(new ItemFolderPacket(stack.copy()));
|
||||
} else if(type == 1) {
|
||||
if(currentPage > 0)
|
||||
currentPage--;
|
||||
updateButtons();
|
||||
} else if(type == 2) {
|
||||
if(currentPage < getPageCount())
|
||||
currentPage++;
|
||||
updateButtons();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
}
|
||||
}
|
||||
@ -684,6 +684,32 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
||||
this.register(new GenericRecipe("ass.soliniumcharge").setup(300, 100).outputItems(new ItemStack(ModItems.solinium_propellant, 1))
|
||||
.inputItems(new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 3), new OreDictStack(OreDictManager.getReflector(), 2), new ComparableStack(ModItems.plate_polymer, 6), new OreDictStack(W.wireFine(), 6), new ComparableStack(ModItems.biomass_compressed, 4)));
|
||||
|
||||
// grenades
|
||||
this.register(new GenericRecipe("ass.incgrenade").setup(100, 100).outputItems(new ItemStack(ModItems.grenade_fire, 1))
|
||||
.inputItems(new ComparableStack(ModItems.grenade_frag, 1), new OreDictStack(P_RED.dust(), 1), new OreDictStack(CU.plate(), 2)));
|
||||
this.register(new GenericRecipe("ass.shrapgrenade").setup(100, 100).outputItems(new ItemStack(ModItems.grenade_shrapnel, 1))
|
||||
.inputItems(new ComparableStack(ModItems.grenade_frag, 1), new ComparableStack(ModItems.pellet_buckshot, 1), new OreDictStack(STEEL.plate(), 2)));
|
||||
this.register(new GenericRecipe("ass.clustergrenade").setup(100, 100).outputItems(new ItemStack(ModItems.grenade_cluster, 1))
|
||||
.inputItems(new ComparableStack(ModItems.grenade_frag, 1), new ComparableStack(ModItems.pellet_cluster, 1), new OreDictStack(STEEL.plate(), 2)));
|
||||
this.register(new GenericRecipe("ass.signalflare").setup(100, 100).outputItems(new ItemStack(ModItems.grenade_flare, 1))
|
||||
.inputItems(new ComparableStack(ModItems.grenade_generic, 1), new ComparableStack(Items.glowstone_dust, 1), new OreDictStack(AL.plate(), 2)));
|
||||
this.register(new GenericRecipe("ass.electricgrenade").setup(100, 100).outputItems(new ItemStack(ModItems.grenade_electric, 1))
|
||||
.inputItems(new ComparableStack(ModItems.grenade_generic, 1), new ComparableStack(ModItems.circuit, 3, EnumCircuitType.CAPACITOR.ordinal()), new OreDictStack(GOLD.plate(), 2)));
|
||||
this.register(new GenericRecipe("ass.pulsegrenade").setup(100, 100).outputItems(new ItemStack(ModItems.grenade_pulse, 4))
|
||||
.inputItems(new OreDictStack(STEEL.plate(), 1), new OreDictStack(IRON.plate(), 3), new OreDictStack(MINGRADE.wireFine(), 6), new ComparableStack(Items.diamond, 1)));
|
||||
this.register(new GenericRecipe("ass.plasmagrenade").setup(200, 100).outputItems(new ItemStack(ModItems.grenade_plasma, 2))
|
||||
.inputItems(new OreDictStack(STEEL.plate(), 3), new OreDictStack(ALLOY.plate(), 1), new ComparableStack(ModItems.coil_advanced_torus, 1), new ComparableStack(ModItems.cell_deuterium, 1), new ComparableStack(ModItems.cell_tritium, 1)));
|
||||
this.register(new GenericRecipe("ass.taugrenade").setup(200, 100).outputItems(new ItemStack(ModItems.grenade_tau, 2))
|
||||
.inputItems(new OreDictStack(PB.plate(), 3), new OreDictStack(ALLOY.plate(), 1), new ComparableStack(ModItems.coil_advanced_torus, 1), new ComparableStack(ModItems.ammo_standard, 1, EnumAmmo.TAU_URANIUM)));
|
||||
this.register(new GenericRecipe("ass.schrabgrenade").setup(200, 100).outputItems(new ItemStack(ModItems.grenade_schrabidium, 1))
|
||||
.inputItems(new ComparableStack(ModItems.grenade_flare, 1), new OreDictStack(SA326.dust(), 1), new OreDictStack(OreDictManager.getReflector(), 2)));
|
||||
this.register(new GenericRecipe("ass.nukagrenade").setup(600, 100).outputItems(new ItemStack(ModItems.grenade_nuclear, 1))
|
||||
.inputItems(new OreDictStack(IRON.plate(), 1), new OreDictStack(STEEL.plate(), 1), new OreDictStack(PU239.nugget(), 2), new OreDictStack(MINGRADE.wireFine(), 2)));
|
||||
this.register(new GenericRecipe("ass.zomggrenade").setup(600, 100).outputItems(new ItemStack(ModItems.grenade_zomg, 1))
|
||||
.inputItems(new ComparableStack(ModItems.plate_paa, 3), new OreDictStack(OreDictManager.getReflector(), 1), new ComparableStack(ModItems.coil_magnetized_tungsten, 3), new ComparableStack(ModItems.powder_power, 3)));
|
||||
this.register(new GenericRecipe("ass.bholegrenade").setup(1_200, 100).outputItems(new ItemStack(ModItems.grenade_black_hole, 1))
|
||||
.inputItems(new OreDictStack(ANY_PLASTIC.ingot(), 6), new OreDictStack(OreDictManager.getReflector(), 3), new ComparableStack(ModItems.coil_magnetized_tungsten, 2), new ComparableStack(ModItems.black_hole, 1)));
|
||||
|
||||
// turrets
|
||||
this.register(new GenericRecipe("ass.turretchekhov").setup(200, 100).outputItems(new ItemStack(ModBlocks.turret_chekhov, 1))
|
||||
.inputItems(new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LEAD), new OreDictStack(STEEL.ingot(), 16), new ComparableStack(ModItems.motor, 3), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ADVANCED), new OreDictStack(STEEL.pipe(), 3), new OreDictStack(GUNMETAL.mechanism(), 3), new ComparableStack(ModBlocks.crate_iron, 1), new ComparableStack(ModItems.crt_display, 1))
|
||||
@ -865,7 +891,7 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
||||
this.register(new GenericRecipe("ass.mpw10taint").setup(100, 100).outputItems(new ItemStack(ModItems.mp_warhead_10_taint, 1))
|
||||
.inputItems(new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.det_cord, 2), new ComparableStack(ModItems.powder_magic, 12), new OreDictStack(Fluids.WATZ.getDict(1_000), 1)));
|
||||
this.register(new GenericRecipe("ass.mpw10cloud").setup(100, 100).outputItems(new ItemStack(ModItems.mp_warhead_10_cloud, 1))
|
||||
.inputItems(new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.det_cord, 2), new ComparableStack(ModItems.powder_magic, 16)));
|
||||
.inputItems(new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.det_cord, 2), new ComparableStack(ModItems.grenade_pink_cloud, 2)));
|
||||
this.register(new GenericRecipe("ass.mpw15he").setup(200, 100).outputItems(new ItemStack(ModItems.mp_warhead_15_he, 1))
|
||||
.inputItems(new ComparableStack(ModItems.seg_15, 1), new OreDictStack(STEEL.plate(), 12), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 12), new ComparableStack(ModItems.circuit, 3, EnumCircuitType.BASIC)));
|
||||
this.register(new GenericRecipe("ass.mpw15inc").setup(200, 100).outputItems(new ItemStack(ModItems.mp_warhead_15_incendiary, 1))
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||
import com.hbm.util.i18n.I18nUtil;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class CrucibleRecipe extends GenericRecipe {
|
||||
|
||||
public MaterialStack[] input;
|
||||
public MaterialStack[] output;
|
||||
public int frequency = 1;
|
||||
|
||||
public CrucibleRecipe(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
public CrucibleRecipe setup(int frequency, ItemStack icon) {
|
||||
this.frequency = frequency;
|
||||
this.setIcon(icon);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CrucibleRecipe inputs(MaterialStack... input) { this.input = input; return this; }
|
||||
public CrucibleRecipe outputs(MaterialStack... output) { this.output = output; return this; }
|
||||
|
||||
public int getInputAmount() {
|
||||
int content = 0;
|
||||
for(MaterialStack stack : input) content += stack.amount;
|
||||
return content;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> print() {
|
||||
List<String> list = new ArrayList();
|
||||
list.add(EnumChatFormatting.YELLOW + this.getLocalizedName());
|
||||
|
||||
input(list);
|
||||
output(list);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void input(List<String> list) {
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("gui.recipe.input") + ":");
|
||||
for(MaterialStack stack : input) {
|
||||
list.add(I18nUtil.resolveKey(stack.material.getUnlocalizedName()) + ": " + Mats.formatAmount(stack.amount, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void output(List<String> list) {
|
||||
list.add(EnumChatFormatting.BOLD + I18nUtil.resolveKey("gui.recipe.output") + ":");
|
||||
for(MaterialStack stack : output) {
|
||||
list.add(I18nUtil.resolveKey(stack.material.getUnlocalizedName()) + ": " + Mats.formatAmount(stack.amount, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@ import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
import com.hbm.inventory.material.NTMMaterial.SmeltingBehavior;
|
||||
import com.hbm.inventory.recipes.loader.GenericRecipes;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMold;
|
||||
import com.hbm.items.machine.ItemMold.Mold;
|
||||
@ -32,22 +32,10 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class CrucibleRecipes extends GenericRecipes<CrucibleRecipe> {
|
||||
public class CrucibleRecipes extends SerializableRecipe {
|
||||
|
||||
public static final CrucibleRecipes INSTANCE = new CrucibleRecipes();
|
||||
|
||||
@Override public int inputItemLimit() { return 0; }
|
||||
@Override public int inputFluidLimit() { return 0; }
|
||||
@Override public int outputItemLimit() { return 0; }
|
||||
@Override public int outputFluidLimit() { return 0; }
|
||||
|
||||
@Override public CrucibleRecipe instantiateRecipe(String name) { return new CrucibleRecipe(name); }
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
super.deleteRecipes();
|
||||
this.moldRecipes.clear();
|
||||
}
|
||||
public static HashMap<Integer, CrucibleRecipe> indexMapping = new HashMap();
|
||||
public static List<CrucibleRecipe> recipes = new ArrayList();
|
||||
|
||||
/*
|
||||
* IMPORTANT: crucibles do not have stack size checks for the recipe's result, meaning that they can overflow if the resulting stacks are
|
||||
@ -60,82 +48,138 @@ public class CrucibleRecipes extends GenericRecipes<CrucibleRecipe> {
|
||||
int n = MaterialShapes.NUGGET.q(1);
|
||||
int i = MaterialShapes.INGOT.q(1);
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.steel").setup(2, new ItemStack(ModItems.ingot_steel))
|
||||
recipes.add(new CrucibleRecipe(0, "crucible.steel", 2, new ItemStack(ModItems.ingot_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_IRON, n * 2), new MaterialStack(Mats.MAT_CARBON, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_STEEL, n * 2)));
|
||||
|
||||
if(Compat.isModLoaded(Compat.MOD_GT6)) {
|
||||
this.register(new CrucibleRecipe("crucible.steelWrought").setup(2, new ItemStack(ModItems.ingot_steel))
|
||||
recipes.add(new CrucibleRecipe(9, "crucible.steelWrought", 2, new ItemStack(ModItems.ingot_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_WROUGHTIRON, n * 2), new MaterialStack(Mats.MAT_CARBON, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_STEEL, n * 2)));
|
||||
this.register(new CrucibleRecipe("crucible.steelPig").setup(2, new ItemStack(ModItems.ingot_steel))
|
||||
recipes.add(new CrucibleRecipe(10, "crucible.steelPig", 2, new ItemStack(ModItems.ingot_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_PIGIRON, n * 2), new MaterialStack(Mats.MAT_CARBON, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_STEEL, n * 2)));
|
||||
this.register(new CrucibleRecipe("crucible.steelMeteoric").setup(2, new ItemStack(ModItems.ingot_steel))
|
||||
recipes.add(new CrucibleRecipe(11, "crucible.steelMeteoric", 2, new ItemStack(ModItems.ingot_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_METEORICIRON, n * 2), new MaterialStack(Mats.MAT_CARBON, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_STEEL, n * 2)));
|
||||
}
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.hematite").setup(6, DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.HEMATITE))
|
||||
recipes.add(new CrucibleRecipe(7, "crucible.hematite", 6, DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.HEMATITE))
|
||||
.inputs(new MaterialStack(Mats.MAT_HEMATITE, i * 2), new MaterialStack(Mats.MAT_FLUX, n * 2))
|
||||
.outputs(new MaterialStack(Mats.MAT_IRON, i), new MaterialStack(Mats.MAT_SLAG, n * 3)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.malachite").setup(6, DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.MALACHITE))
|
||||
recipes.add(new CrucibleRecipe(8, "crucible.malachite", 6, DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.MALACHITE))
|
||||
.inputs(new MaterialStack(Mats.MAT_MALACHITE, i * 2), new MaterialStack(Mats.MAT_FLUX, n * 2))
|
||||
.outputs(new MaterialStack(Mats.MAT_COPPER, i), new MaterialStack(Mats.MAT_SLAG, n * 3)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.redcopper").setup(2, new ItemStack(ModItems.ingot_red_copper))
|
||||
recipes.add(new CrucibleRecipe(1, "crucible.redcopper", 2, new ItemStack(ModItems.ingot_red_copper))
|
||||
.inputs(new MaterialStack(Mats.MAT_COPPER, n), new MaterialStack(Mats.MAT_REDSTONE, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_MINGRADE, n * 2)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.aa").setup(2, new ItemStack(ModItems.ingot_advanced_alloy))
|
||||
recipes.add(new CrucibleRecipe(2, "crucible.aa", 2, new ItemStack(ModItems.ingot_advanced_alloy))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n), new MaterialStack(Mats.MAT_MINGRADE, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_ALLOY, n * 2)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.hss").setup(9, new ItemStack(ModItems.ingot_dura_steel))
|
||||
recipes.add(new CrucibleRecipe(3, "crucible.hss", 9, new ItemStack(ModItems.ingot_dura_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 5), new MaterialStack(Mats.MAT_TUNGSTEN, n * 3), new MaterialStack(Mats.MAT_COBALT, n * 1))
|
||||
.outputs(new MaterialStack(Mats.MAT_DURA, n * 9)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.ferro").setup(3, new ItemStack(ModItems.ingot_ferrouranium))
|
||||
recipes.add(new CrucibleRecipe(4, "crucible.ferro", 3, new ItemStack(ModItems.ingot_ferrouranium))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 2), new MaterialStack(Mats.MAT_U238, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_FERRO, n * 3)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.tcalloy").setup(9, new ItemStack(ModItems.ingot_tcalloy))
|
||||
recipes.add(new CrucibleRecipe(5, "crucible.tcalloy", 9, new ItemStack(ModItems.ingot_tcalloy))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 8), new MaterialStack(Mats.MAT_TECHNETIUM, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_TCALLOY, i)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.cdalloy").setup(9, new ItemStack(ModItems.ingot_cdalloy))
|
||||
recipes.add(new CrucibleRecipe(12, "crucible.cdalloy", 9, new ItemStack(ModItems.ingot_cdalloy))
|
||||
.inputs(new MaterialStack(Mats.MAT_STEEL, n * 8), new MaterialStack(Mats.MAT_CADMIUM, n))
|
||||
.outputs(new MaterialStack(Mats.MAT_CDALLOY, i)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.bbronze").setup(9, new ItemStack(ModItems.ingot_bismuth_bronze))
|
||||
recipes.add(new CrucibleRecipe(14, "crucible.bbronze", 9, new ItemStack(ModItems.ingot_bismuth_bronze))
|
||||
.inputs(new MaterialStack(Mats.MAT_COPPER, n * 8), new MaterialStack(Mats.MAT_BISMUTH, n), new MaterialStack(Mats.MAT_FLUX, n * 3))
|
||||
.outputs(new MaterialStack(Mats.MAT_BBRONZE, i), new MaterialStack(Mats.MAT_SLAG, n * 3)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.abronze").setup(9, new ItemStack(ModItems.ingot_arsenic_bronze))
|
||||
recipes.add(new CrucibleRecipe(15, "crucible.abronze", 9, new ItemStack(ModItems.ingot_arsenic_bronze))
|
||||
.inputs(new MaterialStack(Mats.MAT_COPPER, n * 8), new MaterialStack(Mats.MAT_ARSENIC, n), new MaterialStack(Mats.MAT_FLUX, n * 3))
|
||||
.outputs(new MaterialStack(Mats.MAT_ABRONZE, i), new MaterialStack(Mats.MAT_SLAG, n * 3)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.cmb").setup(3, new ItemStack(ModItems.ingot_combine_steel))
|
||||
recipes.add(new CrucibleRecipe(13, "crucible.cmb", 3, new ItemStack(ModItems.ingot_combine_steel))
|
||||
.inputs(new MaterialStack(Mats.MAT_MAGTUNG, n * 6), new MaterialStack(Mats.MAT_MUD, n * 3))
|
||||
.outputs(new MaterialStack(Mats.MAT_CMB, i)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.magtung").setup(3, new ItemStack(ModItems.ingot_magnetized_tungsten))
|
||||
recipes.add(new CrucibleRecipe(16, "crucible.magtung", 3, new ItemStack(ModItems.ingot_magnetized_tungsten))
|
||||
.inputs(new MaterialStack(Mats.MAT_TUNGSTEN, i), new MaterialStack(Mats.MAT_SCHRABIDIUM, n * 1))
|
||||
.outputs(new MaterialStack(Mats.MAT_MAGTUNG, i)));
|
||||
|
||||
this.register(new CrucibleRecipe("crucible.bscco").setup(3, new ItemStack(ModItems.ingot_bscco))
|
||||
recipes.add(new CrucibleRecipe(17, "crucible.bscco", 3, new ItemStack(ModItems.ingot_bscco))
|
||||
.inputs(new MaterialStack(Mats.MAT_BISMUTH, n * 2), new MaterialStack(Mats.MAT_STRONTIUM, n * 2), new MaterialStack(Mats.MAT_CALCIUM, n * 2), new MaterialStack(Mats.MAT_COPPER, n * 3))
|
||||
.outputs(new MaterialStack(Mats.MAT_BSCCO, i)));
|
||||
|
||||
registerMoldsForNEI();
|
||||
}
|
||||
|
||||
public static class CrucibleRecipe {
|
||||
public MaterialStack[] input;
|
||||
public MaterialStack[] output;
|
||||
private int id;
|
||||
private String name;
|
||||
public int frequency = 1;
|
||||
public ItemStack icon;
|
||||
|
||||
public CrucibleRecipe(int id, String name, int frequency, ItemStack icon) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.frequency = frequency;
|
||||
this.icon = icon;
|
||||
|
||||
if(!indexMapping.containsKey(id)) {
|
||||
indexMapping.put(id, this);
|
||||
} else {
|
||||
throw new IllegalStateException("Crucible recipe " + name + " has been registered with duplicate id " + id + " used by " + indexMapping.get(id).name + "!");
|
||||
}
|
||||
}
|
||||
|
||||
public CrucibleRecipe inputs(MaterialStack... input) {
|
||||
this.input = input;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CrucibleRecipe outputs(MaterialStack... output) {
|
||||
this.output = output;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public int getInputAmount() {
|
||||
|
||||
int content = 0;
|
||||
|
||||
for(MaterialStack stack : input) {
|
||||
content += stack.amount;
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmCrucible.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return this.recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "ID must be unique, but not sequential. Order in which the recipes are defined determines the order in which they are displayed in-game. "
|
||||
@ -146,10 +190,10 @@ public class CrucibleRecipes extends GenericRecipes<CrucibleRecipe> {
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
int id = obj.get("id").getAsInt();
|
||||
String name = obj.get("name").getAsString();
|
||||
int freq = obj.get("frequency").getAsInt();
|
||||
ItemStack icon = this.readItemStack(obj.get("icon").getAsJsonArray());
|
||||
|
||||
MaterialStack[] input = new MaterialStack[obj.get("input").getAsJsonArray().size()];
|
||||
for(int i = 0; i < input.length; i++) {
|
||||
JsonArray entry = obj.get("input").getAsJsonArray().get(i).getAsJsonArray();
|
||||
@ -157,7 +201,6 @@ public class CrucibleRecipes extends GenericRecipes<CrucibleRecipe> {
|
||||
int amount = entry.get(1).getAsInt();
|
||||
input[i] = new MaterialStack(Mats.matByName.get(matname), amount);
|
||||
}
|
||||
|
||||
MaterialStack[] output = new MaterialStack[obj.get("output").getAsJsonArray().size()];
|
||||
for(int i = 0; i < output.length; i++) {
|
||||
JsonArray entry = obj.get("output").getAsJsonArray().get(i).getAsJsonArray();
|
||||
@ -165,18 +208,17 @@ public class CrucibleRecipes extends GenericRecipes<CrucibleRecipe> {
|
||||
int amount = entry.get(1).getAsInt();
|
||||
output[i] = new MaterialStack(Mats.matByName.get(matname), amount);
|
||||
}
|
||||
|
||||
this.register(new CrucibleRecipe(name).setup(freq, icon).inputs(input).outputs(output));
|
||||
recipes.add(new CrucibleRecipe(id, name, freq, icon).inputs(input).outputs(output));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
CrucibleRecipe rec = (CrucibleRecipe) recipe;
|
||||
writer.name("name").value(rec.getInternalName());
|
||||
writer.name("id").value(rec.id);
|
||||
writer.name("name").value(rec.name);
|
||||
writer.name("frequency").value(rec.frequency);
|
||||
writer.name("icon");
|
||||
this.writeItemStack(rec.getIcon(), writer);
|
||||
|
||||
this.writeItemStack(rec.icon, writer);
|
||||
writer.name("input");
|
||||
writer.beginArray();
|
||||
for(MaterialStack mat : rec.input) {
|
||||
@ -187,7 +229,6 @@ public class CrucibleRecipes extends GenericRecipes<CrucibleRecipe> {
|
||||
writer.setIndent(" ");
|
||||
}
|
||||
writer.endArray();
|
||||
|
||||
writer.name("output");
|
||||
writer.beginArray();
|
||||
for(MaterialStack mat : rec.output) {
|
||||
@ -199,6 +240,13 @@ public class CrucibleRecipes extends GenericRecipes<CrucibleRecipe> {
|
||||
}
|
||||
writer.endArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
this.indexMapping.clear();
|
||||
this.recipes.clear();
|
||||
this.moldRecipes.clear();
|
||||
}
|
||||
|
||||
/** Returns a map containing all recipes where an item becomes a liquid material in the crucible. */
|
||||
public static HashMap<AStack, List<ItemStack>> getSmeltingRecipes() {
|
||||
|
||||
@ -25,7 +25,7 @@ public class PlasmaForgeRecipe extends GenericRecipe {
|
||||
autoSwitch(list);
|
||||
duration(list);
|
||||
power(list);
|
||||
list.add(EnumChatFormatting.LIGHT_PURPLE + I18nUtil.resolveKey("gui.recipe.plasmaIn") + ": " + BobMathUtil.getShortNumber(ignitionTemp) + "TU/t");
|
||||
list.add(EnumChatFormatting.LIGHT_PURPLE + I18nUtil.resolveKey("gui.recipe.fusionIn") + ": " + BobMathUtil.getShortNumber(ignitionTemp) + "TU/t");
|
||||
input(list);
|
||||
output(list);
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ public class PlasmaForgeRecipes extends GenericRecipes<PlasmaForgeRecipe> {
|
||||
String autoPlate = "autoswitch.weldPlates";
|
||||
|
||||
// Plates
|
||||
this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.plateeuphemium").setInputEnergy(1_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModItems.plate_euphemium, 4))
|
||||
this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.plateeuphemium").setInputEnergy(1_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModItems.plate_euphemium, 1))
|
||||
.inputItems(new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 3), new OreDictStack(BI.dust(), 1), new OreDictStack(VOLCANIC.gem(), 1), new OreDictStack(OSMIRIDIUM.ingot())));
|
||||
this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.platednt").setInputEnergy(1_000_000).setup(600, 10_000_000).outputItems(new ItemStack(ModItems.plate_dineutronium, 4))
|
||||
.inputItems(new OreDictStack(DNT.ingot(), 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack(DESH.ingot(), 1)));
|
||||
@ -57,7 +57,7 @@ public class PlasmaForgeRecipes extends GenericRecipes<PlasmaForgeRecipe> {
|
||||
this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.hde").setInputEnergy(10_000_000).setup(600, 25_000_000L)
|
||||
.outputItems(DictFrame.fromOne(ModItems.part_generic, EnumPartType.HDE))
|
||||
.inputItems(new OreDictStack(ANY_BISMOIDBRONZE.plateCast(), 2), new OreDictStack(CMB.plateWelded(), 1), new ComparableStack(ModItems.ingot_cft))
|
||||
.inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)));
|
||||
.inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 4_000)).setGroup(autoPlate, this));
|
||||
|
||||
// Welded Plates
|
||||
this.register((PlasmaForgeRecipe) new PlasmaForgeRecipe("plsm.weldiron").setInputEnergy(500_000).setup(50, 100L)
|
||||
@ -112,7 +112,7 @@ public class PlasmaForgeRecipes extends GenericRecipes<PlasmaForgeRecipe> {
|
||||
new ComparableStack(ModBlocks.fusion_component, 64, 3),
|
||||
new ComparableStack(ModBlocks.fusion_component, 64, 2),
|
||||
new ComparableStack(ModBlocks.fusion_component, 64, 2),
|
||||
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.QUANTUM))
|
||||
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.CHIP_QUANTUM))
|
||||
.setPools528(PlasmaForgeRecipes.POOL_PREFIX_528 + "chlorophyte"));
|
||||
|
||||
// ICF
|
||||
|
||||
@ -100,7 +100,6 @@ public class AnvilRecipes extends SerializableRecipe {
|
||||
smithingRecipes.add(new AnvilSmithingMold(2, new OreDictStack(IRON.ingot()), new OreDictStack("ingot")));
|
||||
smithingRecipes.add(new AnvilSmithingMold(3, new OreDictStack(IRON.plate()), new OreDictStack("plate")));
|
||||
smithingRecipes.add(new AnvilSmithingMold(19, new OreDictStack(IRON.plateCast()), new OreDictStack("plateTriple")));
|
||||
smithingRecipes.add(new AnvilSmithingMold(13, new OreDictStack(IRON.plateCast(), 3), new OreDictStack("plateTriple", 3)));
|
||||
smithingRecipes.add(new AnvilSmithingMold(4, new OreDictStack(CU.wireFine()), new OreDictStack("wireFine")));
|
||||
smithingRecipes.add(new AnvilSmithingMold(5, new ComparableStack(ModItems.blade_titanium), new ItemStack[] {
|
||||
new ItemStack(ModItems.blade_titanium),
|
||||
@ -521,6 +520,12 @@ public class AnvilRecipes extends SerializableRecipe {
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new ComparableStack(ModItems.nugget_bismuth, 2), new OreDictStack(U238.billet(), 2), new OreDictStack(NB.dust(), 1)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_bismuth, 1))).setTier(4));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 3), new OreDictStack(BI.dust(), 1), new OreDictStack(VOLCANIC.gem(), 1), new ComparableStack(ModItems.ingot_osmiridium)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_euphemium, 4))).setTier(6));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(DNT.ingot(), 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack(DESH.ingot(), 1)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_dineutronium, 4))).setTier(7));
|
||||
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(TI.plate(), 2), new OreDictStack(STEEL.ingot(), 1), new OreDictStack(STEEL.bolt(), 4)},
|
||||
|
||||
@ -56,6 +56,7 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new ShredderRecipes());
|
||||
recipeHandlers.add(new SolderingRecipes());
|
||||
recipeHandlers.add(new CombinationRecipes());
|
||||
recipeHandlers.add(new CrucibleRecipes());
|
||||
recipeHandlers.add(new CentrifugeRecipes());
|
||||
recipeHandlers.add(new CrystallizerRecipes());
|
||||
recipeHandlers.add(new RefineryRecipes());
|
||||
@ -88,7 +89,6 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new AnnihilatorRecipes());
|
||||
|
||||
//GENERIC
|
||||
recipeHandlers.add(CrucibleRecipes.INSTANCE);
|
||||
recipeHandlers.add(AssemblyMachineRecipes.INSTANCE);
|
||||
recipeHandlers.add(ChemicalPlantRecipes.INSTANCE);
|
||||
recipeHandlers.add(PUREXRecipes.INSTANCE);
|
||||
|
||||
@ -8,11 +8,6 @@ import com.hbm.items.machine.ItemBatteryPack.EnumBatteryPack;
|
||||
import com.hbm.items.machine.ItemBreedingRod.BreedingRodType;
|
||||
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
|
||||
import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeUniversal;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeExtra.EnumGrenadeExtra;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeFuze.EnumGrenadeFuze;
|
||||
import com.hbm.items.weapon.grenade.ItemGrenadeShell.EnumGrenadeShell;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
|
||||
import static com.hbm.lib.HbmChestContents.*;
|
||||
@ -116,9 +111,9 @@ public class ItemPoolsLegacy {
|
||||
weighted(ModItems.ammo_standard, EnumAmmo.ROCKET_HE.ordinal(), 1, 4, 5),
|
||||
weighted(ModItems.ammo_standard, EnumAmmo.G26_FLARE_SUPPLY.ordinal(), 1, 1, 5),
|
||||
weighted(ModItems.ammo_standard, EnumAmmo.G26_FLARE_WEAPON.ordinal(), 1, 1, 3),
|
||||
weighted(ItemGrenadeUniversal.make(EnumGrenadeShell.NUKE, EnumGrenadeFilling.NUCLEAR, EnumGrenadeFuze.S7), 1, 1, 2),
|
||||
weighted(ItemGrenadeUniversal.make(EnumGrenadeShell.FRAG, EnumGrenadeFilling.CLUSTER, EnumGrenadeFuze.S7), 1, 3, 3),
|
||||
weighted(ModItems.grenade_extra, EnumGrenadeExtra.TRIPLEX.ordinal(), 1, 1, 1),
|
||||
weighted(ModItems.grenade_nuclear, 0, 1, 1, 2),
|
||||
weighted(ModItems.grenade_smart, 0, 1, 3, 3),
|
||||
weighted(ModItems.grenade_mirv, 0, 1, 1, 2),
|
||||
weighted(ModItems.stealth_boy, 0, 1, 1, 2),
|
||||
weighted(ModItems.battery_pack, EnumBatteryPack.BATTERY_LITHIUM.ordinal(), 1, 1, 1),
|
||||
weighted(ModItems.syringe_awesome, 0, 1, 1, 1),
|
||||
@ -207,7 +202,7 @@ public class ItemPoolsLegacy {
|
||||
weighted(ModItems.stealth_boy, 0, 1, 1, 7),
|
||||
weighted(ModItems.gas_mask_m65, 0, 1, 1, 5),
|
||||
weighted(ModItems.gas_mask_filter, 0, 1, 1, 5),
|
||||
weighted(ItemGrenadeUniversal.make(EnumGrenadeShell.NUKE, EnumGrenadeFilling.NUCLEAR, EnumGrenadeFuze.S7), 1, 2, 2),
|
||||
weighted(ModItems.grenade_nuclear, 0, 1, 2, 2),
|
||||
weighted(ModItems.bomb_caller, 0, 1, 1, 1),
|
||||
weighted(ModItems.bomb_caller, 1, 1, 1, 1),
|
||||
weighted(ModItems.bomb_caller, 2, 1, 1, 2)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user