mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'HbmMods/master' into structure-2
This commit is contained in:
commit
86c738532d
47
changelog
47
changelog
@ -1,10 +1,43 @@
|
||||
## Added
|
||||
* Muffler
|
||||
* An upgrade-like item that replaces the old muffler block
|
||||
* Creates 16 when crafted, however it is not returned when the muffled machine is broken
|
||||
* Should work with pretty much all machines that use looped sounds, as well as a few other noisy ones (compressors, diesel generators, presses)
|
||||
* Simply right-click to install, doesn't need to be inserted into an upgrade slot, in fact it works on a few machines that have no GUI at all
|
||||
* More custom machine parts
|
||||
* Custom machines now have a neutron acceptor which allows them to use flux from the breeding reactor in recipes
|
||||
* There is now a heat acceptor which can accept heat from things like fireboxes or electric heaters
|
||||
* Also added a config option to create pollution
|
||||
* Hydrotreater
|
||||
* Tier 3 oil machine (on the same level as vacuum oil and reforming)
|
||||
* Can de-sulfurize oil, which allows extraction of sour gas directly from crude oil
|
||||
* Using desulfurized oil skips the (rather destructive) desulfurization process of the standard refinery, yielding higher-quality oils
|
||||
* Hydrotreating also allows cracked diesel variants to turn into their normal counterparts
|
||||
* Can convert coal oil directly into coal gasoline
|
||||
|
||||
## Changed
|
||||
* Deco bocks now drop all of the time, but they drop themselves instead of ingots
|
||||
* To get the ingots, deco blocks now have to be deconstructed in the anvil, yielding an ingot 25% of the time
|
||||
* If I see one more person complaining about the chances I'm reducing it down to 10%
|
||||
* Catalytic reformers now have a tooltip informing about the need for a catalytic converter
|
||||
* Several guns now have reload animations including most .357 revolvers and Samuel
|
||||
* Updated stealth missile texture
|
||||
* Some of the larger oil machines now render using display lists which should make them somewhat more performant
|
||||
* Glyphid diggers can no longer yeet multiblocks or blocks with tile entity
|
||||
* Parasite-infested glyphids now explode into gore when the parasites pop out
|
||||
* Missiles now have a top acceleration twice as much as the previous acceleration, but instead of being static, the acceleration goes up from 0 to max within 3 seconds
|
||||
* This makes missiles reach top speed faster while also making the launches themselves slower and more pleasant
|
||||
* Strange stone can no longer be destroyed via AoE, making it easier to find without accidentally mining it
|
||||
* Launch pads now spawn launch smoke just like custom missile compact launchers
|
||||
* Remodeled all tier 0 missiles
|
||||
* Tier 0 missiles now have a much thinner contrail to match their size better
|
||||
* Covneyor ejectors can now eject sulfur out of the side ports of refineries
|
||||
* Refineries and vacuum refineries now have fluid ID slots for changing the recipe
|
||||
* Removed the remaining old oil separation recipes from the chemical plant
|
||||
|
||||
## Fixed
|
||||
* Fixed basalt ores dropping their items with invalid metadata
|
||||
* Fixed creative infinite fluid tanks not being able to fill fluid gauges at >0PU
|
||||
* Fixed dupe caused by shift-clicking ashes out of the bricked furnace
|
||||
* Fixed missiles jerkingly rotating when launching, they should now smoothly transition from being part of the launch pad to being an entity
|
||||
* Fixed missile control and launch smoke shifting around when the player is moving
|
||||
* Fixed fast-moving missiles spawning too few particles, causing holes in the contrail
|
||||
* Fixed coker units creating soot when not processing anything
|
||||
* Foundry molds can no longer be removed from basins when there's still material in them, fixing a bug where doing so would void the material
|
||||
* Fixed molds not saving when cooling off, allowing to dupe metal when leaving and rejoining
|
||||
* Fixed normal drones loading chunks
|
||||
* Fixed chunk-loading drones not loading chunks
|
||||
* Fixed several chemistry templates missing names
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=4851
|
||||
mod_build_number=4859
|
||||
|
||||
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
|
||||
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\
|
||||
@ -16,4 +16,6 @@ credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion al
|
||||
\ (OpenComputers integration), martemen (project settings), Pvndols (thorium fuel recipe, gas turbine),\
|
||||
\ JamesH2 (blood mechanics, nitric acid, particle emitter), sdddddf80 (recipe configs, chinese localization,\
|
||||
\ custom machine holograms, I18n improvements), SuperCraftAlex (tooltips) LePeep (coilgun model, BDCL QC),\
|
||||
\ 70k (textures, glyphid AI, strand caster), Maksymisio (polish localization) Ice-Arrow (research reactor tweaks)
|
||||
\ 70k (textures, glyphid AI, strand caster), Maksymisio (polish localization) Ice-Arrow (research reactor tweaks),\
|
||||
\ 245tt (anvil GUI improvements), MellowArpeggiation (new animation system, turbine sounds, sound fixes),\
|
||||
\ FOlkvangrField (custom machine parts)
|
||||
|
||||
BIN
ntm-animator.blend
Normal file
BIN
ntm-animator.blend
Normal file
Binary file not shown.
@ -143,7 +143,6 @@ public class ModBlocks {
|
||||
public static Block stalagmite;
|
||||
public static Block stalactite;
|
||||
public static Block stone_biome;
|
||||
public static Block stone_deep_cobble;
|
||||
|
||||
public static Block depth_brick;
|
||||
public static Block depth_tiles;
|
||||
@ -153,10 +152,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block basalt;
|
||||
public static Block ore_basalt;
|
||||
@Deprecated public static Block basalt_sulfur;
|
||||
@Deprecated public static Block basalt_fluorite;
|
||||
@Deprecated public static Block basalt_asbestos;
|
||||
@Deprecated public static Block basalt_gem;
|
||||
public static Block basalt_smooth;
|
||||
public static Block basalt_brick;
|
||||
public static Block basalt_polished;
|
||||
@ -714,10 +709,11 @@ public class ModBlocks {
|
||||
public static Block machine_puf6_tank;
|
||||
|
||||
public static Block machine_reactor_breeding;
|
||||
|
||||
|
||||
public static Block machine_furnace_brick_off;
|
||||
public static Block machine_furnace_brick_on;
|
||||
public static Block machine_nuke_furnace_off;
|
||||
public static Block machine_nuke_furnace_on;
|
||||
|
||||
public static Block machine_rtg_furnace_off;
|
||||
public static Block machine_rtg_furnace_on;
|
||||
|
||||
@ -891,6 +887,8 @@ public class ModBlocks {
|
||||
public static Block cm_tank;
|
||||
public static Block cm_circuit;
|
||||
public static Block cm_port;
|
||||
public static Block cm_flux;
|
||||
public static Block cm_heat;
|
||||
public static Block custom_machine;
|
||||
public static Block cm_anchor;
|
||||
|
||||
@ -989,6 +987,7 @@ public class ModBlocks {
|
||||
public static Block fraction_spacer;
|
||||
public static Block machine_catalytic_cracker;
|
||||
public static Block machine_catalytic_reformer;
|
||||
public static Block machine_hydrotreater;
|
||||
public static Block machine_coker;
|
||||
|
||||
public static Block machine_boiler_off;
|
||||
@ -1376,14 +1375,9 @@ public class ModBlocks {
|
||||
stalagmite = new BlockStalagmite().setBlockName("stalagmite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stone_biome = new BlockBiomeStone().setBlockName("stone_biome").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stone_deep_cobble = new BlockDeepCobble().setBlockName("stone_deep_cobble").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(30.0F);
|
||||
|
||||
basalt = new BlockGeneric(Material.rock).setBlockName("basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt");
|
||||
ore_basalt = new BlockOreBasalt().setBlockName("ore_basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_basalt");
|
||||
basalt_sulfur = new BlockRemap(ore_basalt, 0).setBlockName("basalt_sulfur");
|
||||
basalt_fluorite = new BlockRemap(ore_basalt, 1).setBlockName("basalt_fluorite");
|
||||
basalt_asbestos = new BlockRemap(ore_basalt, 2).setBlockName("basalt_asbestos");
|
||||
basalt_gem = new BlockRemap(ore_basalt, 3).setBlockName("basalt_gem");
|
||||
basalt_smooth = new BlockGeneric(Material.rock).setBlockName("basalt_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_smooth");
|
||||
basalt_brick = new BlockGeneric(Material.rock).setBlockName("basalt_brick").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_brick");
|
||||
basalt_polished = new BlockGeneric(Material.rock).setBlockName("basalt_polished").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_polished");
|
||||
@ -1866,10 +1860,11 @@ public class ModBlocks {
|
||||
machine_puf6_tank = new MachinePuF6Tank(Material.iron).setBlockName("machine_puf6_tank").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
|
||||
machine_reactor_breeding = new MachineReactorBreeding(Material.iron).setBlockName("machine_reactor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor");
|
||||
|
||||
|
||||
machine_furnace_brick_off = new MachineBrickFurnace(false).setBlockName("machine_furnace_brick_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_furnace_brick_on = new MachineBrickFurnace(true).setBlockName("machine_furnace_brick_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_nuke_furnace_off = new MachineNukeFurnace(false).setBlockName("machine_nuke_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_nuke_furnace_on = new MachineNukeFurnace(true).setBlockName("machine_nuke_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
|
||||
machine_rtg_furnace_off = new MachineRtgFurnace(false).setBlockName("machine_rtg_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_rtg_furnace_on = new MachineRtgFurnace(true).setBlockName("machine_rtg_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
|
||||
@ -2053,6 +2048,8 @@ public class ModBlocks {
|
||||
cm_tank = new BlockCMGlass(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_tank").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_tank");
|
||||
cm_circuit = new BlockCM(Material.iron, EnumCMCircuit.class, true, true).setBlockName("cm_circuit").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_circuit");
|
||||
cm_port = new BlockCMPort(Material.iron, EnumCMMaterials.class, true, true).setBlockName("cm_port").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_port");
|
||||
cm_flux = new BlockCMFlux(Material.iron, RefStrings.MODID + ":cm_flux_top").setBlockName("cm_flux").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_flux_side");
|
||||
cm_heat = new BlockCMHeat(Material.iron, RefStrings.MODID +":cm_heat_top").setBlockName("cm_heat").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cm_heat_side");
|
||||
custom_machine = new BlockCustomMachine().setBlockName("custom_machine").setCreativeTab(MainRegistry.machineTab).setLightLevel(1F).setHardness(5.0F).setResistance(10.0F);
|
||||
cm_anchor = new BlockCMAnchor().setBlockName("custom_machine_anchor").setCreativeTab(MainRegistry.machineTab).setHardness(5.0F).setResistance(10.0F);
|
||||
|
||||
@ -2257,6 +2254,7 @@ public class ModBlocks {
|
||||
fraction_spacer = new FractionSpacer(Material.iron).setBlockName("fraction_spacer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_catalytic_cracker = new MachineCatalyticCracker(Material.iron).setBlockName("machine_catalytic_cracker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_catalytic_reformer = new MachineCatalyticReformer(Material.iron).setBlockName("machine_catalytic_reformer").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_hydrotreater = new MachineHydrotreater(Material.iron).setBlockName("machine_hydrotreater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_coker = new MachineCoker(Material.iron).setBlockName("machine_coker").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_autosaw = new MachineAutosaw().setBlockName("machine_autosaw").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -2551,10 +2549,6 @@ public class ModBlocks {
|
||||
|
||||
//Basalt ores
|
||||
register(ore_basalt);
|
||||
GameRegistry.registerBlock(basalt_sulfur, basalt_sulfur.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_fluorite, basalt_fluorite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_asbestos, basalt_asbestos.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(basalt_gem, ItemBlockBase.class, basalt_gem.getUnlocalizedName());
|
||||
|
||||
//End Ores
|
||||
GameRegistry.registerBlock(ore_tikite, ore_tikite.getUnlocalizedName());
|
||||
@ -3138,6 +3132,8 @@ public class ModBlocks {
|
||||
register(foundry_outlet);
|
||||
register(foundry_slagtap);
|
||||
register(slag);
|
||||
register(machine_furnace_brick_off);
|
||||
register(machine_furnace_brick_on);
|
||||
register(machine_difurnace_off);
|
||||
register(machine_difurnace_on);
|
||||
register(machine_difurnace_extension);
|
||||
@ -3367,6 +3363,7 @@ public class ModBlocks {
|
||||
register(fraction_spacer);
|
||||
register(machine_catalytic_cracker);
|
||||
register(machine_catalytic_reformer);
|
||||
register(machine_hydrotreater);
|
||||
register(machine_coker);
|
||||
register(machine_autosaw);
|
||||
register(machine_excavator);
|
||||
@ -3419,6 +3416,8 @@ public class ModBlocks {
|
||||
register(cm_tank);
|
||||
register(cm_circuit);
|
||||
register(cm_port);
|
||||
register(cm_flux);
|
||||
register(cm_heat);
|
||||
register(cm_anchor);
|
||||
|
||||
//PWR
|
||||
|
||||
@ -62,7 +62,6 @@ public class BlockCluster extends Block implements IDrillInteraction, ITooltipPr
|
||||
if(this == ModBlocks.cluster_titanium) return ModItems.crystal_titanium;
|
||||
if(this == ModBlocks.cluster_aluminium) return ModItems.crystal_aluminium;
|
||||
if(this == ModBlocks.cluster_copper) return ModItems.crystal_copper;
|
||||
if(this == ModBlocks.basalt_gem) return ModItems.gem_volcanic;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -1,43 +0,0 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockDeepCobble extends BlockEnumMulti {
|
||||
|
||||
public static enum EnumDeepCobbleTypes {
|
||||
NORMAL,
|
||||
BURNING,
|
||||
STEAMING
|
||||
}
|
||||
|
||||
public BlockDeepCobble() {
|
||||
super(Material.rock, EnumDeepCobbleTypes.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
super.randomDisplayTick(world, x, y, z, rand);
|
||||
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
Block b = world.getBlock(x, y + 1, z);
|
||||
|
||||
if(!b.isNormalCube()) {
|
||||
if(meta == EnumDeepCobbleTypes.BURNING.ordinal()) {
|
||||
world.spawnParticle("flame", x + rand.nextDouble(), y + 1.0625, z + rand.nextDouble(), 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
if(meta == EnumDeepCobbleTypes.STEAMING.ordinal()) {
|
||||
world.spawnParticle("cloud", x + 0.25 + rand.nextDouble() * 0.5, y + 1.0625, z + 0.25 + rand.nextDouble() * 0.5, 0.0, 0.05, 0.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.interfaces.IBomb;
|
||||
import com.hbm.items.special.ItemDoorSkin;
|
||||
import com.hbm.items.tool.ItemLock;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
import com.hbm.tileentity.TileEntityDoorGeneric;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
@ -6,6 +6,15 @@ import java.util.function.Function;
|
||||
import com.hbm.blocks.IBlockMulti;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.entity.mob.*;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphid;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidBehemoth;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidBlaster;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidBombardier;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidBrawler;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidBrenda;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidDigger;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidNuclear;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidScout;
|
||||
import com.hbm.handler.pollution.PollutionHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
@ -51,19 +51,23 @@ public class BlockKeyhole extends BlockStone {
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.key_red && side != 0 && side != 1) {
|
||||
if(world.isRemote) return true;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
generateRoom(world, x - dir.offsetX * 4, y - 2, z - dir.offsetZ * 4);
|
||||
int b = 0;
|
||||
if(side == 2) b = 1;
|
||||
if(side == 5) b = 2;
|
||||
if(side == 3) b = 3;
|
||||
if(side == 4) b = 0;
|
||||
ItemModDoor.placeDoorBlock(world, x, y - 1, z, b, ModBlocks.door_red);
|
||||
world.playSoundAtEntity(player, "hbm:block.lockOpen", 1.0F, 1.0F);
|
||||
player.triggerAchievement(MainRegistry.achRedRoom);
|
||||
return true;
|
||||
if(player.getHeldItem() != null) {
|
||||
boolean cracked = player.getHeldItem().getItem() == ModItems.key_red_cracked;
|
||||
if((player.getHeldItem().getItem() == ModItems.key_red || cracked) && side != 0 && side != 1) {
|
||||
if(cracked) player.getHeldItem().stackSize--;
|
||||
if(world.isRemote) return true;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(side);
|
||||
generateRoom(world, x - dir.offsetX * 4, y - 2, z - dir.offsetZ * 4);
|
||||
int b = 0;
|
||||
if(side == 2) b = 1;
|
||||
if(side == 5) b = 2;
|
||||
if(side == 3) b = 3;
|
||||
if(side == 4) b = 0;
|
||||
ItemModDoor.placeDoorBlock(world, x, y - 1, z, b, ModBlocks.door_red);
|
||||
world.playSoundAtEntity(player, "hbm:block.lockOpen", 1.0F, 1.0F);
|
||||
player.triggerAchievement(MainRegistry.achRedRoom);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.Random;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ItemEnums.EnumChunkType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -43,13 +44,13 @@ public class BlockOre extends Block {
|
||||
@Spaghetti("*throws up*")
|
||||
@Override
|
||||
public Item getItemDropped(int i, Random rand, int j) {
|
||||
if(this == ModBlocks.ore_fluorite || this == ModBlocks.basalt_fluorite) {
|
||||
if(this == ModBlocks.ore_fluorite) {
|
||||
return ModItems.fluorite;
|
||||
}
|
||||
if(this == ModBlocks.ore_niter) {
|
||||
return ModItems.niter;
|
||||
}
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur || this == ModBlocks.basalt_sulfur) {
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur) {
|
||||
return ModItems.sulfur;
|
||||
}
|
||||
if(this == ModBlocks.waste_trinitite || this == ModBlocks.waste_trinitite_red) {
|
||||
@ -151,46 +152,9 @@ public class BlockOre extends Block {
|
||||
}
|
||||
}
|
||||
if(this == ModBlocks.ore_rare || this == ModBlocks.ore_gneiss_rare) {
|
||||
switch(rand.nextInt(6)) {
|
||||
case 0:
|
||||
return ModItems.fragment_boron;
|
||||
case 1:
|
||||
return ModItems.fragment_cerium;
|
||||
case 2:
|
||||
return ModItems.fragment_cobalt;
|
||||
case 3:
|
||||
return ModItems.fragment_lanthanium;
|
||||
case 4:
|
||||
return ModItems.fragment_neodymium;
|
||||
case 5:
|
||||
return ModItems.fragment_niobium;
|
||||
}
|
||||
return ModItems.chunk_ore;
|
||||
}
|
||||
if(this == ModBlocks.deco_aluminium) {
|
||||
return ModItems.ingot_aluminium;
|
||||
}
|
||||
if(this == ModBlocks.deco_beryllium) {
|
||||
return ModItems.ingot_beryllium;
|
||||
}
|
||||
if(this == ModBlocks.deco_lead) {
|
||||
return ModItems.ingot_lead;
|
||||
}
|
||||
if(this == ModBlocks.deco_red_copper) {
|
||||
return ModItems.ingot_red_copper;
|
||||
}
|
||||
if(this == ModBlocks.deco_steel) {
|
||||
return ModItems.ingot_steel;
|
||||
}
|
||||
if(this == ModBlocks.deco_titanium) {
|
||||
return ModItems.ingot_titanium;
|
||||
}
|
||||
if(this == ModBlocks.deco_tungsten) {
|
||||
return ModItems.ingot_tungsten;
|
||||
}
|
||||
if(this == ModBlocks.deco_asbestos) {
|
||||
return ModItems.ingot_asbestos;
|
||||
}
|
||||
if(this == ModBlocks.ore_asbestos || this == ModBlocks.ore_gneiss_asbestos || this == ModBlocks.basalt_asbestos) {
|
||||
if(this == ModBlocks.ore_asbestos || this == ModBlocks.ore_gneiss_asbestos) {
|
||||
return ModItems.ingot_asbestos;
|
||||
}
|
||||
if(this == ModBlocks.ore_lignite) {
|
||||
@ -214,18 +178,15 @@ public class BlockOre extends Block {
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
if(this == ModBlocks.ore_fluorite || this == ModBlocks.basalt_fluorite) {
|
||||
if(this == ModBlocks.ore_fluorite) {
|
||||
return 2 + rand.nextInt(3);
|
||||
}
|
||||
if(this == ModBlocks.ore_niter) {
|
||||
return 2 + rand.nextInt(3);
|
||||
}
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur || this == ModBlocks.basalt_sulfur) {
|
||||
if(this == ModBlocks.ore_sulfur || this == ModBlocks.ore_nether_sulfur || this == ModBlocks.ore_meteor_sulfur) {
|
||||
return 2 + rand.nextInt(3);
|
||||
}
|
||||
if(this == ModBlocks.ore_rare || this == ModBlocks.ore_gneiss_rare) {
|
||||
return 4 + rand.nextInt(8);
|
||||
}
|
||||
if(this == ModBlocks.block_meteor_broken) {
|
||||
return 1 + rand.nextInt(3);
|
||||
}
|
||||
@ -266,7 +227,8 @@ public class BlockOre extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int p_149692_1_) {
|
||||
public int damageDropped(int meta) {
|
||||
if(this == ModBlocks.ore_rare || this == ModBlocks.ore_gneiss_rare) return EnumChunkType.RARE.ordinal();
|
||||
return this == ModBlocks.waste_planks ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
@ -57,8 +57,7 @@ public class BlockOutgas extends BlockOre {
|
||||
if(this == ModBlocks.ore_asbestos || this == ModBlocks.ore_gneiss_asbestos ||
|
||||
this == ModBlocks.block_asbestos || this == ModBlocks.deco_asbestos ||
|
||||
this == ModBlocks.brick_asbestos || this == ModBlocks.tile_lab ||
|
||||
this == ModBlocks.tile_lab_cracked || this == ModBlocks.tile_lab_broken ||
|
||||
this == ModBlocks.basalt_asbestos) {
|
||||
this == ModBlocks.tile_lab_cracked || this == ModBlocks.tile_lab_broken) {
|
||||
return ModBlocks.gas_asbestos;
|
||||
}
|
||||
|
||||
|
||||
9
src/main/java/com/hbm/blocks/machine/BlockCMFlux.java
Normal file
9
src/main/java/com/hbm/blocks/machine/BlockCMFlux.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockCMFlux extends BlockPillar{
|
||||
public BlockCMFlux(Material mat, String top) {
|
||||
super(mat, top);
|
||||
}
|
||||
}
|
||||
9
src/main/java/com/hbm/blocks/machine/BlockCMHeat.java
Normal file
9
src/main/java/com/hbm/blocks/machine/BlockCMHeat.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class BlockCMHeat extends BlockPillar{
|
||||
public BlockCMHeat(Material mat, String top) {
|
||||
super(mat, top);
|
||||
}
|
||||
}
|
||||
@ -170,8 +170,8 @@ public abstract class FoundryCastingBase extends BlockContainer implements ICruc
|
||||
|
||||
TileEntityFoundryCastingBase cast = (TileEntityFoundryCastingBase) world.getTileEntity(x, y, z);
|
||||
|
||||
if(cast.slots[0] == null)
|
||||
return false;
|
||||
if(cast.slots[0] == null) return false;
|
||||
if(cast.amount > 0) return false;
|
||||
|
||||
if(!player.inventory.addItemStackToInventory(cast.slots[0].copy())) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, cast.slots[0].copy());
|
||||
|
||||
172
src/main/java/com/hbm/blocks/machine/MachineBrickFurnace.java
Normal file
172
src/main/java/com/hbm/blocks/machine/MachineBrickFurnace.java
Normal file
@ -0,0 +1,172 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityFurnaceBrick;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineBrickFurnace extends BlockContainer {
|
||||
|
||||
private final Random rand = new Random();
|
||||
private final boolean isActive;
|
||||
private static boolean keepInventory;
|
||||
|
||||
@SideOnly(Side.CLIENT) private IIcon iconTop;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconBottom;
|
||||
@SideOnly(Side.CLIENT) private IIcon iconFront;
|
||||
|
||||
public MachineBrickFurnace(boolean blockState) {
|
||||
super(Material.iron);
|
||||
isActive = blockState;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_furnace_brick_top");
|
||||
this.iconBottom = iconRegister.registerIcon(RefStrings.MODID + ":machine_furnace_brick_bottom");
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":machine_furnace_brick_front_on" : ":machine_furnace_brick_front_off"));
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_furnace_brick_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : (side == 1 ? this.iconTop : (side == 0 ? this.iconBottom : this.blockIcon)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityFurnaceBrick();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z) {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_furnace_brick_off);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
this.setDefaultDirection(world, x, y, z);
|
||||
}
|
||||
|
||||
private void setDefaultDirection(World world, int x, int y, int z) {
|
||||
if(!world.isRemote) {
|
||||
Block nZ = world.getBlock(x, y, z - 1);
|
||||
Block pZ = world.getBlock(x, y, z + 1);
|
||||
Block nX = world.getBlock(x - 1, y, z);
|
||||
Block pX = world.getBlock(x + 1, y, z);
|
||||
|
||||
byte meta = 3;
|
||||
|
||||
if(nZ.func_149730_j() && !pZ.func_149730_j()) meta = 3;
|
||||
if(pZ.func_149730_j() && !nZ.func_149730_j()) meta = 2;
|
||||
if(nX.func_149730_j() && !pX.func_149730_j()) meta = 5;
|
||||
if(pX.func_149730_j() && !nX.func_149730_j()) meta = 4;
|
||||
|
||||
world.setBlockMetadataWithNotify(x, y, z, meta, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
if(i == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(i == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||
if(i == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(i == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
|
||||
if(itemStack.hasDisplayName()) ((TileEntityFurnaceBrick)world.getTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) {
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
TileEntityFurnaceBrick entity = (TileEntityFurnaceBrick) world.getTileEntity(x, y, z);
|
||||
if(entity != null) {
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateBlockState(boolean isProcessing, World world, int x, int y, int z) {
|
||||
int i = world.getBlockMetadata(x, y, z);
|
||||
TileEntity entity = world.getTileEntity(x, y, z);
|
||||
keepInventory = true;
|
||||
|
||||
if(isProcessing) {
|
||||
world.setBlock(x, y, z, ModBlocks.machine_furnace_brick_on);
|
||||
} else {
|
||||
world.setBlock(x, y, z, ModBlocks.machine_furnace_brick_off);
|
||||
}
|
||||
|
||||
keepInventory = false;
|
||||
world.setBlockMetadataWithNotify(x, y, z, i, 2);
|
||||
|
||||
if(entity != null) {
|
||||
entity.validate();
|
||||
world.setTileEntity(x, y, z, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
if(!keepInventory) ItemStackUtil.spillItems(world, x, y, z, block, rand);
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if(isActive) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
float cX = x + 0.5F;
|
||||
float cY = y + rand.nextFloat() * 0.375F;
|
||||
float cZ = z + 0.5F;
|
||||
float off = 0.52F;
|
||||
float var = rand.nextFloat() * 0.6F - 0.3F;
|
||||
rand.nextFloat();
|
||||
rand.nextFloat();
|
||||
|
||||
if(meta == 4) {
|
||||
world.spawnParticle("smoke", cX - off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX - off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
} else if(meta == 5) {
|
||||
world.spawnParticle("smoke", cX + off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX + off, cY, cZ + var, 0.0D, 0.0D, 0.0D);
|
||||
} else if(meta == 2) {
|
||||
world.spawnParticle("smoke", cX + var, cY, cZ - off, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX + var, cY, cZ - off, 0.0D, 0.0D, 0.0D);
|
||||
} else if(meta == 3) {
|
||||
world.spawnParticle("smoke", cX + var, cY, cZ + off, 0.0D, 0.0D, 0.0D);
|
||||
world.spawnParticle("flame", cX + var, cY, cZ + off, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,17 +1,25 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticReformer;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineCatalyticReformer extends BlockDummyable {
|
||||
public class MachineCatalyticReformer extends BlockDummyable implements IPersistentInfoProvider {
|
||||
|
||||
public MachineCatalyticReformer(Material mat) {
|
||||
super(mat);
|
||||
@ -61,4 +69,14 @@ public class MachineCatalyticReformer extends BlockDummyable {
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,61 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.IPersistentInfoProvider;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineHydrotreater;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineHydrotreater extends BlockDummyable implements IPersistentInfoProvider {
|
||||
|
||||
public MachineHydrotreater(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineHydrotreater();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid().power();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {6, 0, 1, 1, 1, 1}; }
|
||||
@Override public int getOffset() { return 1; }
|
||||
|
||||
@Override
|
||||
protected void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
this.makeExtra(world, x - dir.offsetX + 1, y, z - dir.offsetZ + 1);
|
||||
this.makeExtra(world, x - dir.offsetX + 1, y, z - dir.offsetZ - 1);
|
||||
this.makeExtra(world, x - dir.offsetX - 1, y, z - dir.offsetZ + 1);
|
||||
this.makeExtra(world, x - dir.offsetX - 1, y, z - dir.offsetZ - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, NBTTagCompound persistentTag, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
for(int i = 0; i < 4; i++) {
|
||||
FluidTank tank = new FluidTank(Fluids.NONE, 0);
|
||||
tank.readFromNBT(persistentTag, "" + i);
|
||||
list.add(EnumChatFormatting.YELLOW + "" + tank.getFill() + "/" + tank.getMaxFill() + "mB " + tank.getTankType().getLocalizedName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -42,7 +42,7 @@ public class MachineRefinery extends BlockDummyable implements IPersistentInfoPr
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineRefinery();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid().power();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().fluid().power().inventory();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,8 @@ import api.hbm.conveyor.IEnterableBlock;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.network.TileEntityCraneBase;
|
||||
import com.hbm.tileentity.network.TileEntityCraneInserter;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -17,7 +19,6 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@ -72,7 +73,7 @@ public class CraneInserter extends BlockCraneBase implements IEnterableBlock {
|
||||
|
||||
if(te instanceof ISidedInventory) {
|
||||
ISidedInventory sided = (ISidedInventory) te;
|
||||
access = masquerade(sided, outputDirection.getOpposite().ordinal());
|
||||
access = InventoryUtil.masquerade(sided, outputDirection.getOpposite().ordinal());
|
||||
}
|
||||
|
||||
if(te instanceof IInventory) {
|
||||
@ -90,15 +91,6 @@ public class CraneInserter extends BlockCraneBase implements IEnterableBlock {
|
||||
}
|
||||
}
|
||||
|
||||
public static int[] masquerade(ISidedInventory sided, int side) {
|
||||
|
||||
if(sided instanceof TileEntityFurnace) {
|
||||
return new int[] {1, 0};
|
||||
}
|
||||
|
||||
return sided.getAccessibleSlotsFromSide(side);
|
||||
}
|
||||
|
||||
public static ItemStack addToInventory(IInventory inv, int[] access, ItemStack toAdd, int side) {
|
||||
|
||||
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
||||
|
||||
@ -5,18 +5,13 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.entity.train.EntityRailCarBase;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
package com.hbm.blocks.test;
|
||||
|
||||
import com.hbm.entity.missile.EntityTestMissile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TestMissile extends Block {
|
||||
|
||||
public TestMissile(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World p_149695_1_, int x, int y, int z, Block p_149695_5_)
|
||||
{
|
||||
if (p_149695_1_.isBlockIndirectlyGettingPowered(x, y, z))
|
||||
{
|
||||
EntityTestMissile missile = new EntityTestMissile(p_149695_1_, x + 150, z + 150, x + 0.5F, y + 2F, z + 0.5F);
|
||||
p_149695_1_.spawnEntityInWorld(missile);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -34,19 +34,19 @@ public class CustomMachineConfigJSON {
|
||||
public static final Gson gson = new Gson();
|
||||
public static HashMap<String, MachineConfiguration> customMachines = new HashMap();
|
||||
public static List<MachineConfiguration> niceList = new ArrayList();
|
||||
|
||||
|
||||
public static void initialize() {
|
||||
File folder = MainRegistry.configHbmDir;
|
||||
|
||||
File config = new File(folder.getAbsolutePath() + File.separatorChar + "hbmCustomMachines.json");
|
||||
|
||||
|
||||
if(!config.exists()) {
|
||||
writeDefault(config);
|
||||
}
|
||||
|
||||
|
||||
readConfig(config);
|
||||
}
|
||||
|
||||
|
||||
public static void writeDefault(File config) {
|
||||
|
||||
try {
|
||||
@ -54,7 +54,7 @@ public class CustomMachineConfigJSON {
|
||||
writer.setIndent(" ");
|
||||
writer.beginObject();
|
||||
writer.name("machines").beginArray();
|
||||
|
||||
|
||||
writer.beginObject();
|
||||
writer.name("recipeKey").value("paperPress");
|
||||
writer.name("unlocalizedName").value("paperPress");
|
||||
@ -66,14 +66,17 @@ public class CustomMachineConfigJSON {
|
||||
writer.name("fluidOutCap").value(0);
|
||||
writer.name("itemOutCount").value(1);
|
||||
writer.name("generatorMode").value(false);
|
||||
writer.name("maxPollutionCap").value(100);
|
||||
writer.name("fluxMode").value(false);
|
||||
writer.name("recipeSpeedMult").value(1.0D);
|
||||
writer.name("recipeConsumptionMult").value(1.0D);
|
||||
writer.name("maxPower").value(10_000L);
|
||||
|
||||
writer.name("maxHeat").value(0);
|
||||
|
||||
writer.name("recipeShape").beginArray();
|
||||
writer.value("IPI").value("PCP").value("IPI");
|
||||
writer.endArray();
|
||||
|
||||
|
||||
writer.name("recipeParts").beginArray().setIndent("");
|
||||
writer.value("I");
|
||||
SerializableRecipe.writeAStack(new OreDictStack(OreDictManager.STEEL.ingot()), writer);
|
||||
@ -84,9 +87,9 @@ public class CustomMachineConfigJSON {
|
||||
writer.value("C");
|
||||
SerializableRecipe.writeAStack(new ComparableStack(ModItems.circuit_aluminium), writer);
|
||||
writer.endArray().setIndent(" ");
|
||||
|
||||
|
||||
writer.name("components").beginArray();
|
||||
|
||||
|
||||
for(int x = -1; x <= 1; x++) {
|
||||
for(int y = -1; y <= 1; y++) {
|
||||
for(int z = 0; z <= 2; z++) {
|
||||
@ -104,7 +107,7 @@ public class CustomMachineConfigJSON {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
writer.beginObject().setIndent("");
|
||||
writer.name("block").value("hbm:tile.cm_port");
|
||||
writer.name("x").value(0);
|
||||
@ -114,7 +117,7 @@ public class CustomMachineConfigJSON {
|
||||
writer.value(0);
|
||||
writer.endArray();
|
||||
writer.endObject().setIndent(" ");
|
||||
|
||||
|
||||
writer.beginObject().setIndent("");
|
||||
writer.name("block").value("hbm:tile.cm_port");
|
||||
writer.name("x").value(0);
|
||||
@ -124,10 +127,10 @@ public class CustomMachineConfigJSON {
|
||||
writer.value(0);
|
||||
writer.endArray();
|
||||
writer.endObject().setIndent(" ");
|
||||
|
||||
|
||||
writer.endArray();
|
||||
writer.endObject();
|
||||
|
||||
|
||||
writer.endArray();
|
||||
writer.endObject();
|
||||
writer.close();
|
||||
@ -135,16 +138,16 @@ public class CustomMachineConfigJSON {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void readConfig(File config) {
|
||||
|
||||
|
||||
try {
|
||||
JsonObject json = gson.fromJson(new FileReader(config), JsonObject.class);
|
||||
JsonArray machines = json.get("machines").getAsJsonArray();
|
||||
|
||||
|
||||
for(int i = 0; i < machines.size(); i++) {
|
||||
JsonObject machineObject = machines.get(i).getAsJsonObject();
|
||||
|
||||
|
||||
MachineConfiguration configuration = new MachineConfiguration();
|
||||
configuration.recipeKey = machineObject.get("recipeKey").getAsString();
|
||||
configuration.unlocalizedName = machineObject.get("unlocalizedName").getAsString();
|
||||
@ -156,45 +159,57 @@ public class CustomMachineConfigJSON {
|
||||
configuration.fluidOutCap = machineObject.get("fluidOutCap").getAsInt();
|
||||
configuration.itemOutCount = machineObject.get("itemOutCount").getAsInt();
|
||||
configuration.generatorMode = machineObject.get("generatorMode").getAsBoolean();
|
||||
if(machineObject.get("maxPollutionCap")!=null) {
|
||||
configuration.maxPollutionCap = machineObject.get("maxPollutionCap").getAsInt();
|
||||
}
|
||||
else configuration.maxPollutionCap = 0;
|
||||
if(machineObject.get("fluxMode")!=null) {
|
||||
configuration.fluxMode = machineObject.get("fluxMode").getAsBoolean();
|
||||
}
|
||||
else configuration.fluxMode = false;
|
||||
configuration.recipeSpeedMult = machineObject.get("recipeSpeedMult").getAsDouble();
|
||||
configuration.recipeConsumptionMult = machineObject.get("recipeConsumptionMult").getAsDouble();
|
||||
configuration.maxPower = machineObject.get("maxPower").getAsLong();
|
||||
|
||||
if(machineObject.get("maxHeat")!=null) {
|
||||
configuration.maxHeat = machineObject.get("maxHeat").getAsInt();
|
||||
}
|
||||
else configuration.maxHeat = 0;
|
||||
|
||||
if(machineObject.has("recipeShape") && machineObject.has("recipeParts")) {
|
||||
JsonArray recipeShape = machineObject.get("recipeShape").getAsJsonArray();
|
||||
JsonArray recipeParts = machineObject.get("recipeParts").getAsJsonArray();
|
||||
|
||||
|
||||
Object[] parts = new Object[recipeShape.size() + recipeParts.size()];
|
||||
|
||||
|
||||
for(int j = 0; j < recipeShape.size(); j++) {
|
||||
parts[j] = recipeShape.get(j).getAsString();
|
||||
}
|
||||
|
||||
|
||||
for(int j = 0; j < recipeParts.size(); j++) {
|
||||
Object o = null;
|
||||
|
||||
|
||||
if(j % 2 == 0) {
|
||||
o = recipeParts.get(j).getAsString().charAt(0); //god is dead and we killed him
|
||||
} else {
|
||||
AStack a = SerializableRecipe.readAStack(recipeParts.get(j).getAsJsonArray());
|
||||
|
||||
|
||||
if(a instanceof ComparableStack) o = ((ComparableStack) a).toStack();
|
||||
if(a instanceof OreDictStack) o = ((OreDictStack) a).name;
|
||||
}
|
||||
|
||||
|
||||
parts[j + recipeShape.size()] = o;
|
||||
}
|
||||
|
||||
|
||||
ItemStack stack = new ItemStack(ModBlocks.custom_machine, 1, i + 100);
|
||||
stack.stackTagCompound = new NBTTagCompound();
|
||||
stack.stackTagCompound.setString("machineType", configuration.unlocalizedName);
|
||||
|
||||
CraftingManager.addRecipeAuto(stack, parts);
|
||||
}
|
||||
|
||||
|
||||
JsonArray components = machineObject.get("components").getAsJsonArray();
|
||||
configuration.components = new ArrayList();
|
||||
|
||||
|
||||
for(int j = 0; j < components.size(); j++) {
|
||||
JsonObject compObject = components.get(j).getAsJsonObject();
|
||||
ComponentDefinition compDef = new ComponentDefinition();
|
||||
@ -207,21 +222,21 @@ public class CustomMachineConfigJSON {
|
||||
for(int k = 0; k < compDef.metas.size(); k++) {
|
||||
compDef.allowedMetas.add(compDef.metas.get(k).getAsInt());
|
||||
}
|
||||
|
||||
|
||||
configuration.components.add(compDef);
|
||||
}
|
||||
|
||||
|
||||
customMachines.put(configuration.unlocalizedName, configuration);
|
||||
niceList.add(configuration);
|
||||
}
|
||||
|
||||
|
||||
} catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static class MachineConfiguration {
|
||||
|
||||
|
||||
/** The name of the recipe set that this machine can handle */
|
||||
public String recipeKey;
|
||||
/** The internal name of this machine */
|
||||
@ -237,14 +252,17 @@ public class CustomMachineConfigJSON {
|
||||
public int itemOutCount;
|
||||
/** Whether inputs should be used up when the process begins */
|
||||
public boolean generatorMode;
|
||||
|
||||
public int maxPollutionCap;
|
||||
public boolean fluxMode;
|
||||
public double recipeSpeedMult = 1D;
|
||||
public double recipeConsumptionMult = 1D;
|
||||
public long maxPower;
|
||||
|
||||
public int maxHeat;
|
||||
|
||||
|
||||
/** Definitions of blocks that this machine is composed of */
|
||||
public List<ComponentDefinition> components;
|
||||
|
||||
|
||||
public static class ComponentDefinition {
|
||||
public Block block;
|
||||
public Set<Integer> allowedMetas;
|
||||
|
||||
@ -69,6 +69,7 @@ public class ToolRecipes {
|
||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.centri_stick, 1), new Object[] { ModItems.centrifuge_element, ModItems.energy_core, KEY_STICK });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.smashing_hammer, 1), new Object[] { "STS", "SPS", " P ", 'S', STEEL.block(), 'T', W.block(), 'P', ANY_PLASTIC.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.meteorite_sword, 1), new Object[] { " B", "GB ", "SG ", 'B', ModItems.blade_meteorite, 'G', GOLD.plate(), 'S', KEY_STICK });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dwarven_pickaxe, 1), new Object[] { "CIC", " S ", " S ", 'C', CU.ingot(), 'I', IRON.ingot(), 'S', KEY_STICK });
|
||||
|
||||
//Drax
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.drax, 1), new Object[] { "BDS", "CDC", "FMF", 'B', ModItems.starmetal_pickaxe, 'S', ModItems.starmetal_shovel, 'C', CO.ingot(), 'F', ModItems.fusion_core, 'D', DESH.ingot(), 'M', ModItems.motor_desh });
|
||||
@ -133,6 +134,8 @@ public class ToolRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pipette_boron, 1), new Object[] { " P", " B ", "B ", 'P', RUBBER.ingot(), 'B', ModBlocks.glass_boron});
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pipette_laboratory, 1), new Object[] { " C", " R ", "P ", 'C', ModItems.circuit_aluminium, 'R', RUBBER.ingot(), 'P', ModItems.pipette_boron });
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.siphon, 1), new Object[] { " GR", " GR", " G ", 'G', KEY_CLEARGLASS, 'R', ANY_RUBBER.ingot()});
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.mirror_tool), new Object[] { " A ", " IA", "I ", 'A', AL.ingot(), 'I', IRON.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rbmk_tool), new Object[] { " A ", " IA", "I ", 'A', PB.ingot(), 'I', IRON.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.power_net_tool), new Object[] { "WRW", " I ", " B ", 'W', ModItems.wire_red_copper, 'R', REDSTONE.dust(), 'I', IRON.ingot(), 'B', ModItems.battery_su });
|
||||
|
||||
@ -16,6 +16,7 @@ import com.hbm.entity.missile.EntityMissileTier3.*;
|
||||
import com.hbm.entity.missile.EntityMissileTier4.*;
|
||||
import com.hbm.entity.mob.*;
|
||||
import com.hbm.entity.mob.botprime.*;
|
||||
import com.hbm.entity.mob.glyphid.*;
|
||||
import com.hbm.entity.mob.siege.*;
|
||||
import com.hbm.entity.particle.*;
|
||||
import com.hbm.entity.projectile.*;
|
||||
@ -47,8 +48,6 @@ public class EntityMappings {
|
||||
addEntity(EntityGrenadeFrag.class, "entity_grenade_frag", 250);
|
||||
addEntity(EntityGrenadeFire.class, "entity_grenade_fire", 250);
|
||||
addEntity(EntityGrenadeCluster.class, "entity_grenade_cluster", 250);
|
||||
addEntity(EntityTestMissile.class, "entity_test_missile", 1000);
|
||||
addEntity(EntityNukeCloudSmall.class, "entity_nuke_cloud_small", 10000);
|
||||
addEntity(EntityBullet.class, "entity_bullet", 250);
|
||||
addEntity(EntityGrenadeFlare.class, "entity_grenade_flare", 500);
|
||||
addEntity(EntityGrenadeElectric.class, "entity_grenade_electric", 500);
|
||||
@ -77,7 +76,6 @@ public class EntityMappings {
|
||||
addEntity(EntityMissileMirv.class, "entity_missile_mirv", 1000);
|
||||
addEntity(EntityMIRV.class, "entity_mirvlet", 1000);
|
||||
addEntity(EntitySmokeFX.class, "entity_smoke_fx", 1000);
|
||||
addEntity(EntityNukeCloudBig.class, "entity_nuke_cloud_big", 1000);
|
||||
addEntity(EntityGrenadeNuclear.class, "entity_grenade_nuclear", 1000);
|
||||
addEntity(EntityBSmokeFX.class, "entity_b_smoke_fx", 1000);
|
||||
addEntity(EntityGrenadePlasma.class, "entity_grenade_plasma", 500);
|
||||
|
||||
@ -64,7 +64,7 @@ public class EntityFalloutRain extends Entity {
|
||||
for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
||||
double percent = Math.hypot(x - posX, z - posZ) * 100 / getScale();
|
||||
stomp(x, z, percent);
|
||||
BiomeGenBase biome = getBiomeChange(percent, getScale());
|
||||
BiomeGenBase biome = getBiomeChange(percent, getScale(), worldObj.getBiomeGenForCoords(x, z));
|
||||
if(biome != null) {
|
||||
WorldUtil.setBiome(worldObj, x, z, biome);
|
||||
biomeModified = true;
|
||||
@ -84,7 +84,7 @@ public class EntityFalloutRain extends Entity {
|
||||
if(distance <= getScale()) {
|
||||
double percent = distance * 100 / getScale();
|
||||
stomp(x, z, percent);
|
||||
BiomeGenBase biome = getBiomeChange(percent, getScale());
|
||||
BiomeGenBase biome = getBiomeChange(percent, getScale(), worldObj.getBiomeGenForCoords(x, z));
|
||||
if(biome != null) {
|
||||
WorldUtil.setBiome(worldObj, x, z, biome);
|
||||
biomeModified = true;
|
||||
@ -114,11 +114,14 @@ public class EntityFalloutRain extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
public static BiomeGenBase getBiomeChange(double dist, int scale) {
|
||||
public static BiomeGenBase getBiomeChange(double dist, int scale, BiomeGenBase original) {
|
||||
if(!WorldConfig.enableCraterBiomes) return null;
|
||||
if(scale >= 150 && dist < 15) return BiomeGenCraterBase.craterInnerBiome;
|
||||
if(scale >= 100 && dist < 55) return BiomeGenCraterBase.craterBiome;
|
||||
if(scale >= 25) return BiomeGenCraterBase.craterOuterBiome;
|
||||
if(scale >= 150 && dist < 15)
|
||||
return BiomeGenCraterBase.craterInnerBiome;
|
||||
if(scale >= 100 && dist < 55 && original != BiomeGenCraterBase.craterInnerBiome)
|
||||
return BiomeGenCraterBase.craterBiome;
|
||||
if(scale >= 25 && original != BiomeGenCraterBase.craterInnerBiome && original != BiomeGenCraterBase.craterBiome)
|
||||
return BiomeGenCraterBase.craterOuterBiome;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ package com.hbm.entity.effect;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.mob.EntityGlyphid;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphid;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
@ -1,97 +0,0 @@
|
||||
package com.hbm.entity.effect;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityNukeCloudBig extends Entity {
|
||||
|
||||
public int maxAge = 1000;
|
||||
public int age;
|
||||
public float scale = 0;
|
||||
public float ring = 0;
|
||||
public float height = 0;
|
||||
|
||||
public EntityNukeCloudBig(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
this.setSize(1, 80);
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.isImmuneToFire = true;
|
||||
this.age = 0;
|
||||
scale = 0;
|
||||
ring = 0;
|
||||
height = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getBrightnessForRender(float p_70070_1_)
|
||||
{
|
||||
return 15728880;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBrightness(float p_70013_1_)
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
public EntityNukeCloudBig(World p_i1582_1_, int maxAge) {
|
||||
super(p_i1582_1_);
|
||||
this.setSize(20, 40);
|
||||
this.isImmuneToFire = true;
|
||||
this.maxAge = maxAge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
//super.onUpdate();
|
||||
this.age++;
|
||||
this.worldObj.spawnEntityInWorld(new EntityLightningBolt(this.worldObj, this.posX, this.posY + 200, this.posZ));
|
||||
|
||||
if(this.age >= this.maxAge)
|
||||
{
|
||||
this.age = 0;
|
||||
this.setDead();
|
||||
}
|
||||
ring += 0.1F;
|
||||
|
||||
if(age < 150)
|
||||
{
|
||||
height = -60F + ((age - 100) * 60 / 50);
|
||||
if(scale < 1.5)
|
||||
{
|
||||
scale += 0.02;
|
||||
}
|
||||
}
|
||||
|
||||
if(age > 100)
|
||||
{
|
||||
if(scale < 1.5)
|
||||
{
|
||||
scale += 0.02;
|
||||
}
|
||||
} else {
|
||||
scale = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
age = p_70037_1_.getShort("age");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
p_70014_1_.setShort("age", (short)age);
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,150 +0,0 @@
|
||||
package com.hbm.entity.effect;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Deprecated
|
||||
public class EntityNukeCloudSmall extends Entity {
|
||||
|
||||
public int maxAge = 1000;
|
||||
public int age;
|
||||
|
||||
public static int cloudletLife = 50;
|
||||
public ArrayList<Cloudlet> cloudlets = new ArrayList();
|
||||
|
||||
public EntityNukeCloudSmall(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
this.setSize(20, 40);
|
||||
this.ignoreFrustumCheck = true;
|
||||
this.isImmuneToFire = true;
|
||||
this.age = 0;
|
||||
this.noClip = true;
|
||||
}
|
||||
|
||||
public EntityNukeCloudSmall(World p_i1582_1_, int maxAge, float scale) {
|
||||
super(p_i1582_1_);
|
||||
this.setSize(20, 40);
|
||||
this.isImmuneToFire = true;
|
||||
this.maxAge = maxAge;
|
||||
this.noClip = true;
|
||||
this.dataWatcher.updateObject(18, scale);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
this.age++;
|
||||
|
||||
this.worldObj.lastLightningBolt = 2;
|
||||
|
||||
if(this.age >= this.maxAge)
|
||||
{
|
||||
this.age = 0;
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
int cloudCount = age * 3;
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(age * 2, 0, 0);
|
||||
|
||||
int toRem = 0;
|
||||
|
||||
for(int i = 0; i < this.cloudlets.size(); i++) {
|
||||
|
||||
if(age > cloudlets.get(i).age + cloudletLife)
|
||||
toRem = i;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
for(int i = 0; i < toRem; i++)
|
||||
this.cloudlets.remove(0);
|
||||
|
||||
if(age < 200) {
|
||||
for(int i = 0; i < cloudCount; i++) {
|
||||
vec.rotateAroundY((float)(Math.PI * 2 * worldObj.rand.nextDouble()));
|
||||
|
||||
this.cloudlets.add(new Cloudlet(vec.xCoord, worldObj.getHeightValue((int) (vec.xCoord + posX), (int) (vec.zCoord + posZ)), vec.zCoord, age));
|
||||
}
|
||||
}
|
||||
|
||||
this.dataWatcher.updateObject(16, (short)maxAge);
|
||||
this.dataWatcher.updateObject(17, (short)age);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
this.dataWatcher.addObject(16, (short)maxAge);
|
||||
this.dataWatcher.addObject(17, (short)age);
|
||||
this.dataWatcher.addObject(18, 1.0F);
|
||||
this.dataWatcher.addObject(19, Byte.valueOf((byte)0));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
maxAge = p_70037_1_.getShort("maxAge");
|
||||
age = p_70037_1_.getShort("age");
|
||||
this.dataWatcher.updateObject(18, p_70037_1_.getFloat("scale"));
|
||||
this.dataWatcher.updateObject(19, p_70037_1_.getByte("type"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
p_70014_1_.setShort("maxAge", (short)maxAge);
|
||||
p_70014_1_.setShort("age", (short)age);
|
||||
p_70014_1_.setFloat("scale", this.dataWatcher.getWatchableObjectFloat(18));
|
||||
p_70014_1_.setByte("type", this.dataWatcher.getWatchableObjectByte(19));
|
||||
|
||||
}
|
||||
|
||||
public static EntityNukeCloudSmall statFac(World world, double x, double y, double z, float radius) {
|
||||
|
||||
EntityNukeCloudSmall cloud = new EntityNukeCloudSmall(world, (int)radius * 5, radius * 0.005F);
|
||||
cloud.posX = x;
|
||||
cloud.posY = y;
|
||||
cloud.posZ = z;
|
||||
cloud.dataWatcher.updateObject(19, (byte)0);
|
||||
|
||||
return cloud;
|
||||
}
|
||||
|
||||
public static EntityNukeCloudSmall statFacBale(World world, double x, double y, double z, float radius, int maxAge) {
|
||||
|
||||
EntityNukeCloudSmall cloud = new EntityNukeCloudSmall(world, (int)radius * 5, radius * 0.005F);
|
||||
cloud.posX = x;
|
||||
cloud.posY = y;
|
||||
cloud.posZ = z;
|
||||
cloud.dataWatcher.updateObject(19, (byte)1);
|
||||
|
||||
return cloud;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isInRangeToRenderDist(double distance)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public static class Cloudlet {
|
||||
|
||||
public double posX;
|
||||
public double posY;
|
||||
public double posZ;
|
||||
public int age;
|
||||
|
||||
public Cloudlet(double posX, double posY, double posZ, int age) {
|
||||
this.posX = posX;
|
||||
this.posY = posY;
|
||||
this.posZ = posZ;
|
||||
this.age = age;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -552,6 +552,7 @@ public class EntityNukeTorex extends Entity {
|
||||
public static void statFac(World world, double x, double y, double z, float scale) {
|
||||
EntityNukeTorex torex = new EntityNukeTorex(world).setScale(MathHelper.clamp_float((float) BobMathUtil.squirt(scale * 0.01) * 1.5F, 0.5F, 5F));
|
||||
torex.setPosition(x, y, z);
|
||||
torex.forceSpawn = true;
|
||||
world.spawnEntityInWorld(torex);
|
||||
TrackerUtil.setTrackingRange(world, torex, 1000);
|
||||
}
|
||||
@ -559,6 +560,7 @@ public class EntityNukeTorex extends Entity {
|
||||
public static void statFacBale(World world, double x, double y, double z, float scale) {
|
||||
EntityNukeTorex torex = new EntityNukeTorex(world).setScale(MathHelper.clamp_float((float) BobMathUtil.squirt(scale * 0.01) * 1.5F, 0.5F, 5F)).setType(1);
|
||||
torex.setPosition(x, y, z);
|
||||
torex.forceSpawn = true;
|
||||
world.spawnEntityInWorld(torex);
|
||||
TrackerUtil.setTrackingRange(world, torex, 1000);
|
||||
}
|
||||
|
||||
@ -21,8 +21,8 @@ public class EntityDeliveryDrone extends EntityDroneBase implements IInventory,
|
||||
protected ItemStack[] slots = new ItemStack[this.getSizeInventory()];
|
||||
public FluidStack fluid;
|
||||
|
||||
protected boolean chunkLoading = false;
|
||||
private Ticket loaderTicket;
|
||||
public boolean isChunkLoading = false;
|
||||
|
||||
public EntityDeliveryDrone(World world) {
|
||||
super(world);
|
||||
@ -36,6 +36,7 @@ public class EntityDeliveryDrone extends EntityDroneBase implements IInventory,
|
||||
|
||||
public EntityDeliveryDrone setChunkLoading() {
|
||||
init(ForgeChunkManager.requestTicket(MainRegistry.instance, worldObj, Type.ENTITY));
|
||||
this.chunkLoading = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -77,6 +78,7 @@ public class EntityDeliveryDrone extends EntityDroneBase implements IInventory,
|
||||
}
|
||||
|
||||
nbt.setByte("load", this.dataWatcher.getWatchableObjectByte(11));
|
||||
nbt.setBoolean("chunkLoading", chunkLoading);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -100,6 +102,7 @@ public class EntityDeliveryDrone extends EntityDroneBase implements IInventory,
|
||||
}
|
||||
|
||||
this.dataWatcher.updateObject(11, nbt.getByte("load"));
|
||||
if(nbt.getBoolean("chunkLoading")) this.setChunkLoading();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,16 +1,17 @@
|
||||
package com.hbm.entity.logic;
|
||||
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.entity.mob.EntityGlyphid;
|
||||
import static com.hbm.entity.mob.EntityGlyphid.*;
|
||||
import com.hbm.entity.mob.EntityGlyphidNuclear;
|
||||
import com.hbm.entity.mob.EntityGlyphidScout;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphid;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidNuclear;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidScout;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import static com.hbm.entity.mob.glyphid.EntityGlyphid.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EntityWaypoint extends Entity {
|
||||
|
||||
@ -14,10 +14,12 @@ import com.hbm.explosion.vanillant.standard.EntityProcessorCross;
|
||||
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
|
||||
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.TrackerUtil;
|
||||
|
||||
import api.hbm.entity.IRadarDetectableNT;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.EntityTrackerEntry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@ -26,6 +28,7 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
@ -66,6 +69,8 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
accelXZ = decelY = 1 / vector.lengthVector();
|
||||
decelY *= 2;
|
||||
velocity = 0;
|
||||
|
||||
this.rotationYaw = (float) (Math.atan2(targetX - posX, targetZ - posZ) * 180.0D / Math.PI);
|
||||
|
||||
this.setSize(1.5F, 1.5F);
|
||||
}
|
||||
@ -105,9 +110,12 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.lastTickPosX = this.posX;
|
||||
this.lastTickPosY = this.posY;
|
||||
this.lastTickPosZ = this.posZ;
|
||||
super.onUpdate();
|
||||
|
||||
if(velocity < 4) velocity += 0.025;
|
||||
if(velocity < 4) velocity += MathHelper.clamp_double(this.ticksExisted / 60D * 0.05D, 0, 0.05);
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
@ -141,15 +149,18 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
this.rotationYaw = (float) (Math.atan2(targetX - posX, targetZ - posZ) * 180.0D / Math.PI);
|
||||
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
for(this.rotationPitch = (float) (Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F);
|
||||
EntityTrackerEntry tracker = TrackerUtil.getTrackerEntry((WorldServer) worldObj, this.getEntityId());
|
||||
if(tracker != null) tracker.lastYaw += 100; //coax the tracker into sending smother updates
|
||||
|
||||
loadNeighboringChunks((int) Math.floor(posX / 16), (int) Math.floor(posZ / 16));
|
||||
} else {
|
||||
this.spawnContrail();
|
||||
}
|
||||
|
||||
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
for(this.rotationPitch = (float) (Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F);
|
||||
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) this.prevRotationPitch += 360.0F;
|
||||
while(this.rotationYaw - this.prevRotationYaw < -180.0F) this.prevRotationYaw -= 360.0F;
|
||||
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) this.prevRotationYaw += 360.0F;
|
||||
@ -160,8 +171,23 @@ public abstract class EntityMissileBaseNT extends EntityThrowableInterp implemen
|
||||
}
|
||||
|
||||
protected void spawnContrail() {
|
||||
Vec3 vec = Vec3.createVectorHelper(motionX, motionY, motionZ).normalize();
|
||||
MainRegistry.proxy.particleControl(posX - vec.xCoord, posY - vec.yCoord, posZ - vec.zCoord, 2);
|
||||
Vec3 vec = Vec3.createVectorHelper(this.lastTickPosX - this.posX, this.lastTickPosY - this.posY, this.lastTickPosZ - this.posZ);
|
||||
double len = vec.lengthVector();
|
||||
vec = vec.normalize();
|
||||
for(int i = 0; i < Math.max(Math.min(len, 10), 1); i++) {
|
||||
int j = i - 1;
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setDouble("posX", posX - vec.xCoord * j);
|
||||
data.setDouble("posY", posY - vec.yCoord * j);
|
||||
data.setDouble("posZ", posZ - vec.zCoord * j);
|
||||
data.setString("type", "missileContrail");
|
||||
data.setFloat("scale", this.getContrailScale());
|
||||
MainRegistry.proxy.effectNT(data);
|
||||
}
|
||||
}
|
||||
|
||||
protected float getContrailScale() {
|
||||
return 1F;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -46,6 +46,11 @@ public abstract class EntityMissileTier0 extends EntityMissileBaseNT {
|
||||
public int getBlipLevel() {
|
||||
return IRadarDetectableNT.TIER0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getContrailScale() {
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
public static class EntityMissileMicro extends EntityMissileTier0 {
|
||||
public EntityMissileMicro(World world) { super(world); }
|
||||
|
||||
@ -1,275 +0,0 @@
|
||||
package com.hbm.entity.missile;
|
||||
|
||||
import com.hbm.calc.EasyLocation;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityTestMissile extends EntityThrowable {
|
||||
|
||||
EasyLocation origin;
|
||||
EasyLocation loc0;
|
||||
EasyLocation loc1;
|
||||
EasyLocation loc2;
|
||||
EasyLocation loc3;
|
||||
EasyLocation loc4;
|
||||
EasyLocation loc5;
|
||||
EasyLocation loc6;
|
||||
EasyLocation loc7;
|
||||
EasyLocation target;
|
||||
|
||||
public int lengthX;
|
||||
public int lengthZ;
|
||||
public double lengthFlight;
|
||||
public int baseHeight = 0;
|
||||
public double missileSpeed = 3;
|
||||
|
||||
public int phase = 0;
|
||||
|
||||
public EntityTestMissile(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
}
|
||||
|
||||
public EntityTestMissile(World p_i1582_1_, int x, int z, double a, double b, double c) {
|
||||
super(p_i1582_1_);
|
||||
this.posX = a;
|
||||
this.posY = b;
|
||||
this.posZ = c;
|
||||
|
||||
this.motionY = 0.1;
|
||||
|
||||
lengthX = (int) (x - this.posX);
|
||||
lengthZ = (int) (z - this.posZ);
|
||||
lengthFlight = Math.sqrt(Math.pow(lengthX, 2) + Math.pow(lengthZ, 2));
|
||||
|
||||
|
||||
origin = new EasyLocation(this.posX, this.posY, this.posZ);
|
||||
|
||||
loc0 = new EasyLocation(this.posX, this.posY + baseHeight, this.posZ);
|
||||
loc1 = new EasyLocation(this.posX + lengthX/lengthFlight * 10, this.posY + baseHeight + 20, this.posZ + lengthZ/lengthFlight * 10);
|
||||
loc2 = new EasyLocation(this.posX + lengthX/lengthFlight * 30, this.posY + baseHeight + 40, this.posZ + lengthZ/lengthFlight * 30);
|
||||
loc3 = new EasyLocation(this.posX + lengthX/lengthFlight * 50, this.posY + baseHeight + 50, this.posZ + lengthZ/lengthFlight * 50);
|
||||
|
||||
loc4 = new EasyLocation(x - (lengthX/lengthFlight * 50), this.posY + baseHeight + 50, z - (lengthZ/lengthFlight * 50));
|
||||
loc5 = new EasyLocation(x - (lengthX/lengthFlight * 30), this.posY + baseHeight + 40, z - (lengthZ/lengthFlight * 30));
|
||||
loc6 = new EasyLocation(x - (lengthX/lengthFlight * 10), this.posY + baseHeight + 20, z - (lengthZ/lengthFlight * 10));
|
||||
loc7 = new EasyLocation(x, this.posY + baseHeight, z);
|
||||
|
||||
|
||||
target = new EasyLocation(x, 0, z);
|
||||
|
||||
/*this.worldObj.setBlock((int)loc0.posX, (int)loc0.posY, (int)loc0.posZ, Blocks.dirt);
|
||||
this.worldObj.setBlock((int)loc1.posX, (int)loc1.posY, (int)loc1.posZ, Blocks.dirt);
|
||||
this.worldObj.setBlock((int)loc2.posX, (int)loc2.posY, (int)loc2.posZ, Blocks.dirt);
|
||||
this.worldObj.setBlock((int)loc3.posX, (int)loc3.posY, (int)loc3.posZ, Blocks.dirt);
|
||||
this.worldObj.setBlock((int)loc4.posX, (int)loc4.posY, (int)loc4.posZ, Blocks.stone);
|
||||
this.worldObj.setBlock((int)loc5.posX, (int)loc5.posY, (int)loc5.posZ, Blocks.stone);
|
||||
this.worldObj.setBlock((int)loc6.posX, (int)loc6.posY, (int)loc6.posZ, Blocks.stone);
|
||||
this.worldObj.setBlock((int)loc7.posX, (int)loc7.posY, (int)loc7.posZ, Blocks.stone);*/
|
||||
|
||||
/*System.out.print("\n" + loc0.posX + " " + loc0.posY + " " + loc0.posZ);
|
||||
System.out.print("\n" + loc1.posX + " " + loc1.posY + " " + loc1.posZ);
|
||||
System.out.print("\n" + loc2.posX + " " + loc2.posY + " " + loc2.posZ);
|
||||
System.out.print("\n" + loc3.posX + " " + loc3.posY + " " + loc3.posZ);
|
||||
System.out.print("\n");
|
||||
System.out.print("\n" + loc4.posX + " " + loc4.posY + " " + loc4.posZ);
|
||||
System.out.print("\n" + loc5.posX + " " + loc5.posY + " " + loc5.posZ);
|
||||
System.out.print("\n" + loc6.posX + " " + loc6.posY + " " + loc6.posZ);
|
||||
System.out.print("\n" + loc7.posX + " " + loc7.posY + " " + loc7.posZ);*/
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
//super.onUpdate();
|
||||
|
||||
this.posX += this.motionX;
|
||||
this.posY += this.motionY;
|
||||
this.posZ += this.motionZ;
|
||||
|
||||
this.rotation();
|
||||
|
||||
switch(phase)
|
||||
{
|
||||
case 0:
|
||||
if(loc0 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc0);
|
||||
if(loc0.posX + 2 > this.posX && loc0.posX - 2 < this.posX &&
|
||||
loc0.posY + 2 > this.posY && loc0.posY - 2 < this.posY &&
|
||||
loc0.posZ + 2 > this.posZ && loc0.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(loc1 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc1);
|
||||
if(loc1.posX + 2 > this.posX && loc1.posX - 2 < this.posX &&
|
||||
loc1.posY + 2 > this.posY && loc1.posY - 2 < this.posY &&
|
||||
loc1.posZ + 2 > this.posZ && loc1.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 2;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(loc2 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc2);
|
||||
if(loc2.posX + 2 > this.posX && loc2.posX - 2 < this.posX &&
|
||||
loc2.posY + 2 > this.posY && loc2.posY - 2 < this.posY &&
|
||||
loc2.posZ + 2 > this.posZ && loc2.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(loc3 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc3);
|
||||
if(loc3.posX + 2 > this.posX && loc3.posX - 2 < this.posX &&
|
||||
loc3.posY + 2 > this.posY && loc3.posY - 2 < this.posY &&
|
||||
loc3.posZ + 2 > this.posZ && loc3.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 4;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if(loc4 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc4);
|
||||
if(loc4.posX + 2 > this.posX && loc4.posX - 2 < this.posX &&
|
||||
loc4.posY + 2 > this.posY && loc4.posY - 2 < this.posY &&
|
||||
loc4.posZ + 2 > this.posZ && loc4.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 5;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if(loc5 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc5);
|
||||
if(loc5.posX + 2 > this.posX && loc5.posX - 2 < this.posX &&
|
||||
loc5.posY + 2 > this.posY && loc5.posY - 2 < this.posY &&
|
||||
loc5.posZ + 2 > this.posZ && loc5.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 6;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if(loc6 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc6);
|
||||
if(loc6.posX + 2 > this.posX && loc6.posX - 2 < this.posX &&
|
||||
loc6.posY + 2 > this.posY && loc6.posY - 2 < this.posY &&
|
||||
loc6.posZ + 2 > this.posZ && loc6.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 7;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if(loc7 != null)
|
||||
{
|
||||
freePizzaGoddammit(loc7);
|
||||
if(loc7.posX + 2 > this.posX && loc7.posX - 2 < this.posX &&
|
||||
loc7.posY + 2 > this.posY && loc7.posY - 2 < this.posY &&
|
||||
loc7.posZ + 2 > this.posZ && loc7.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = 8;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if(target != null)
|
||||
{
|
||||
freePizzaGoddammit(target);
|
||||
if(target.posX + 2 > this.posX && target.posX - 2 < this.posX &&
|
||||
target.posY + 2 > this.posY && target.posY - 2 < this.posY &&
|
||||
target.posZ + 2 > this.posZ && target.posZ - 2 < this.posZ)
|
||||
{
|
||||
this.phase = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air)
|
||||
{
|
||||
if(!this.worldObj.isRemote)
|
||||
{
|
||||
this.worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5.0F, true);
|
||||
}
|
||||
this.setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(MovingObjectPosition p_70184_1_) {
|
||||
}
|
||||
|
||||
private void freePizzaGoddammit(EasyLocation loc) {
|
||||
double x = loc.posX - this.posX;
|
||||
double y = loc.posY - this.posY;
|
||||
double z = loc.posZ - this.posZ;
|
||||
lengthFlight = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2) + Math.pow(z, 2));
|
||||
|
||||
this.motionX = x / this.lengthFlight * missileSpeed;
|
||||
this.motionY = y / this.lengthFlight * missileSpeed;
|
||||
this.motionZ = z / this.lengthFlight * missileSpeed;
|
||||
}
|
||||
|
||||
private void rotation() {
|
||||
/*EasyVector vec0 = new EasyVector(this.motionX, this.motionZ);
|
||||
|
||||
EasyVector vec1 = new EasyVector(this.motionY, vec0.getResult());
|
||||
|
||||
this.rotationYaw = (float)Math.acos((vec0.a * 0 + vec0.b * 1) / (vec0.getResult() * 1));
|
||||
//this.rotationPitch = (float)Math.acos((vec0.a * vec1.a + vec0.b * vec1.b) / (vec0.getResult() * vec1.getResult())) * 10;
|
||||
|
||||
this.rotationPitch = (float)Math.acos((vec0.a * vec1.a + vec0.b * vec1.b) / (vec0.getResult() * vec1.getResult())) * 100 - 90;
|
||||
if(this.rotationPitch < 0)
|
||||
this.rotationPitch += 180;
|
||||
|
||||
System.out.print("\n" + this.rotationYaw);
|
||||
System.out.print("\n" + this.rotationPitch);*/
|
||||
float f2;
|
||||
f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
|
||||
{
|
||||
this.prevRotationPitch += 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
|
||||
{
|
||||
this.prevRotationYaw -= 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
|
||||
{
|
||||
this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -7,16 +7,18 @@ import java.util.List;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.entity.logic.EntityWaypoint;
|
||||
import com.hbm.entity.mob.EntityParasiteMaggot;
|
||||
import com.hbm.entity.pathfinder.PathFinderUtils;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.*;
|
||||
import com.hbm.handler.pollution.PollutionHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@ -114,9 +116,17 @@ public class EntityGlyphid extends EntityMob {
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(30D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getGrunt().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getGrunt().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getGrunt().damage);
|
||||
}
|
||||
|
||||
public float getDivisorPerArmorPoint() {
|
||||
return GlyphidStats.getStats().getGrunt().divisor;
|
||||
}
|
||||
|
||||
public float getDamageThreshold() {
|
||||
return GlyphidStats.getStats().getGrunt().damageThreshold;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -290,43 +300,9 @@ public class EntityGlyphid extends EntityMob {
|
||||
if(source.getEntity() instanceof EntityGlyphid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!source.isDamageAbsolute() && !source.isUnblockable() && !worldObj.isRemote && !source.isFireDamage() && !source.getDamageType().equals(ModDamageSource.s_cryolator)) {
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(DW_ARMOR);
|
||||
|
||||
if(armor != 0) { //if at least one bit of armor is present
|
||||
|
||||
if(amount < getDamageThreshold()) return false;
|
||||
|
||||
//chances of armor being broken off
|
||||
if(amount > 1 && isArmorBroken(amount)) {
|
||||
breakOffArmor();
|
||||
amount *= 0.25F;
|
||||
}
|
||||
|
||||
amount -= getDamageThreshold();
|
||||
if(amount < 0) return true;
|
||||
}
|
||||
|
||||
amount = this.calculateDamage(amount);
|
||||
}
|
||||
|
||||
if(source.isFireDamage()) {
|
||||
amount *= 0.7F;
|
||||
} else if(source.getDamageType().equals("player")) {
|
||||
amount *= getScale() < 1.25 ? 1.5 : getScale() < 1.3 ? 0.8 : 0.5;
|
||||
} else if(source == ModDamageSource.acid || source.equals(new DamageSource(ModDamageSource.s_acid))){
|
||||
amount = 0;
|
||||
} else if(source == DamageSource.inWall) {
|
||||
amount *= 15F;
|
||||
}
|
||||
|
||||
if(this.isPotionActive(HbmPotion.phosphorus.getId())){
|
||||
amount *= 1.5F;
|
||||
}
|
||||
|
||||
boolean alive = this.getHealth() > 0;
|
||||
boolean wasAttacked = super.attackEntityFrom(source, amount);
|
||||
boolean wasAttacked = GlyphidStats.getStats().handleAttack(this, source, amount);
|
||||
|
||||
if(alive && this.getHealth() <= 0) {
|
||||
if(doesInfectedSpawnMaggots() && this.dataWatcher.getWatchableObjectByte(DW_SUBTYPE) == TYPE_INFECTED) {
|
||||
@ -343,11 +319,24 @@ public class EntityGlyphid extends EntityMob {
|
||||
maggot.velocityChanged = true;
|
||||
this.worldObj.spawnEntityInWorld(maggot);
|
||||
}
|
||||
|
||||
worldObj.playSoundEffect(posX, posY, posZ, "mob.zombie.woodbreak", 2.0F, 0.95F + worldObj.rand.nextFloat() * 0.2F);
|
||||
|
||||
NBTTagCompound vdat = new NBTTagCompound();
|
||||
vdat.setString("type", "giblets");
|
||||
vdat.setInteger("ent", this.getEntityId());
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(vdat, posX, posY + height * 0.5, posZ), new TargetPoint(dimension, posX, posY + height * 0.5, posZ, 150));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return wasAttacked;
|
||||
}
|
||||
|
||||
/** Provides a direct entrypoint from outside to access the superclass' implementation because otherwise we end up wwith infinite recursion */
|
||||
public boolean attackSuperclass(DamageSource source, float amount) {
|
||||
return super.attackEntityFrom(source, amount);
|
||||
}
|
||||
|
||||
public boolean doesInfectedSpawnMaggots() {
|
||||
return true;
|
||||
@ -360,11 +349,11 @@ public class EntityGlyphid extends EntityMob {
|
||||
public float calculateDamage(float amount) {
|
||||
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(DW_ARMOR);
|
||||
int divisor = 1;
|
||||
float divisor = 1;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if((armor & (1 << i)) > 0) {
|
||||
divisor++;
|
||||
divisor += getDivisorPerArmorPoint();
|
||||
}
|
||||
}
|
||||
|
||||
@ -373,10 +362,6 @@ public class EntityGlyphid extends EntityMob {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public float getDamageThreshold() {
|
||||
return 0.5F;
|
||||
}
|
||||
|
||||
public void breakOffArmor() {
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(DW_ARMOR);
|
||||
List<Integer> indices = Arrays.asList(0, 1, 2, 3, 4);
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.entity.effect.EntityMist;
|
||||
import com.hbm.entity.projectile.EntityChemical;
|
||||
@ -36,10 +36,14 @@ public class EntityGlyphidBehemoth extends EntityGlyphid {
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(130D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.8D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(25D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getBehemoth().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBehemoth().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBehemoth().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBehemoth().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getBehemoth().damageThreshold; }
|
||||
|
||||
public int timer = 120;
|
||||
int breathTime = 0;
|
||||
|
||||
@ -63,11 +67,6 @@ public class EntityGlyphidBehemoth extends EntityGlyphid {
|
||||
timer = 120;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public boolean attackEntityAsMob(Entity victum) {
|
||||
return super.attackEntityAsMob(victum);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -108,25 +107,4 @@ public class EntityGlyphidBehemoth extends EntityGlyphid {
|
||||
public int swingDuration() {
|
||||
return 100;
|
||||
}
|
||||
@Override
|
||||
public float calculateDamage(float amount) {
|
||||
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(17);
|
||||
int divisor = 1;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if((armor & (1 << i)) > 0) {
|
||||
divisor += 4;
|
||||
}
|
||||
}
|
||||
|
||||
amount /= divisor;
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamageThreshold() {
|
||||
return 2.5F;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
@ -26,38 +26,19 @@ public class EntityGlyphidBlaster extends EntityGlyphidBombardier {
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(10D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getBlaster().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBlaster().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBlaster().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBlaster().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getBlaster().damageThreshold; }
|
||||
|
||||
@Override
|
||||
public boolean isArmorBroken(float amount) {
|
||||
return this.rand.nextInt(100) <= Math.min(Math.pow(amount * 0.25, 2), 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateDamage(float amount) {
|
||||
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(17);
|
||||
int divisor = 1;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if((armor & (1 << i)) > 0) {
|
||||
divisor += 2;
|
||||
}
|
||||
}
|
||||
|
||||
amount /= divisor;
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamageThreshold() {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBombDamage() {
|
||||
return 15F;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.entity.projectile.EntityAcidBomb;
|
||||
import com.hbm.main.ResourceManager;
|
||||
@ -28,9 +28,14 @@ public class EntityGlyphidBombardier extends EntityGlyphid {
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20D);
|
||||
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getBombardier().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBombardier().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBombardier().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBombardier().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getBombardier().damageThreshold; }
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
@ -26,35 +26,16 @@ public class EntityGlyphidBrawler extends EntityGlyphid {
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(10D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getBrawler().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBrawler().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBrawler().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBrawler().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getBrawler().damageThreshold; }
|
||||
|
||||
@Override
|
||||
public boolean isArmorBroken(float amount) {
|
||||
return this.rand.nextInt(100) <= Math.min(Math.pow(amount * 0.25, 2), 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateDamage(float amount) {
|
||||
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(17);
|
||||
float divisor = 1;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if((armor & (1 << i)) > 0) {
|
||||
divisor += 3;
|
||||
}
|
||||
}
|
||||
|
||||
amount /= divisor;
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamageThreshold() {
|
||||
return 1.0F;
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.entity.effect.EntityMist;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -32,39 +32,20 @@ public class EntityGlyphidBrenda extends EntityGlyphid {
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(250D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.2D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getBrenda().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getBrenda().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getBrenda().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getBrenda().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getBrenda().damageThreshold; }
|
||||
|
||||
@Override
|
||||
public boolean isArmorBroken(float amount) {
|
||||
// amount < 5 ? 5 : amount < 10 ? 3 : 2;
|
||||
return this.rand.nextInt(100) <= Math.min(Math.pow(amount * 0.12, 2), 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateDamage(float amount) {
|
||||
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(17);
|
||||
int divisor = 1;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if((armor & (1 << i)) > 0) {
|
||||
divisor += 5;
|
||||
}
|
||||
}
|
||||
|
||||
amount /= divisor;
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamageThreshold() {
|
||||
return 10F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDeath(DamageSource source) {
|
||||
super.onDeath(source);
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRubble;
|
||||
import com.hbm.lib.Library;
|
||||
@ -38,17 +39,21 @@ public class EntityGlyphidDigger extends EntityGlyphid {
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(50D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getDigger().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getDigger().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getDigger().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getDigger().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getDigger().damageThreshold; }
|
||||
|
||||
public int timer = 0;
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
super.onUpdate();
|
||||
Entity e = this.getEntityToAttack();
|
||||
if (e != null) {
|
||||
if (e != null && this.isEntityAlive()) {
|
||||
|
||||
this.lastX = e.posX;
|
||||
this.lastY = e.posY;
|
||||
@ -60,9 +65,8 @@ public class EntityGlyphidDigger extends EntityGlyphid {
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Mainly composed of crusty old power fist code, with some touch ups
|
||||
**/
|
||||
|
||||
/** Mainly composed of crusty old power fist code, with some touch ups **/
|
||||
public void groundSlam(){
|
||||
if (!worldObj.isRemote && entityToAttack instanceof EntityLivingBase && this.getDistanceToEntity(entityToAttack) < 30) {
|
||||
Entity e = this.getEntityToAttack();
|
||||
@ -128,7 +132,7 @@ public class EntityGlyphidDigger extends EntityGlyphid {
|
||||
Block b = worldObj.getBlock(x1, y1, z1);
|
||||
float k = b.getExplosionResistance(this, worldObj, x1, y1, z1, posX, posY, posZ);
|
||||
|
||||
if (k < ModBlocks.concrete.getExplosionResistance(this) && b.isNormalCube()) {
|
||||
if (k < ModBlocks.concrete.getExplosionResistance(this) && b.isNormalCube() && !(b instanceof BlockDummyable) && worldObj.getTileEntity(x1, y1, z1) == null) {
|
||||
|
||||
EntityRubble rubble = new EntityRubble(worldObj);
|
||||
rubble.posX = x1 + 0.5F;
|
||||
@ -1,7 +1,8 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.logic.EntityWaypoint;
|
||||
import com.hbm.entity.mob.EntityParasiteMaggot;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||
import com.hbm.explosion.vanillant.standard.BlockMutatorDebris;
|
||||
@ -45,6 +46,17 @@ public class EntityGlyphidNuclear extends EntityGlyphid {
|
||||
return 2D;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getNuclear().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getNuclear().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getNuclear().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getNuclear().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getNuclear().damageThreshold; }
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
@ -86,42 +98,11 @@ public class EntityGlyphidNuclear extends EntityGlyphid {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(100D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.8D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(50D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isArmorBroken(float amount) {
|
||||
return this.rand.nextInt(100) <= Math.min(Math.pow(amount * 0.12, 2), 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float calculateDamage(float amount) {
|
||||
|
||||
byte armor = this.dataWatcher.getWatchableObjectByte(17);
|
||||
int divisor = 1;
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if((armor & (1 << i)) > 0) {
|
||||
divisor += 5;
|
||||
}
|
||||
}
|
||||
|
||||
amount /= divisor;
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getDamageThreshold() {
|
||||
return 10F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesInfectedSpawnMaggots() {
|
||||
return false;
|
||||
@ -1,4 +1,4 @@
|
||||
package com.hbm.entity.mob;
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.MobConfig;
|
||||
@ -54,19 +54,22 @@ public class EntityGlyphidScout extends EntityGlyphid {
|
||||
return 0.75D;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(GlyphidStats.getStats().getScout().health);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(GlyphidStats.getStats().getScout().speed);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(GlyphidStats.getStats().getScout().damage);
|
||||
}
|
||||
|
||||
@Override public float getDivisorPerArmorPoint() { return GlyphidStats.getStats().getScout().divisor; }
|
||||
@Override public float getDamageThreshold() { return GlyphidStats.getStats().getScout().damageThreshold; }
|
||||
|
||||
@Override
|
||||
public boolean isArmorBroken(float amount) {
|
||||
return this.rand.nextInt(100) <= Math.min(Math.pow(amount, 2), 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEntityAttributes() {
|
||||
super.applyEntityAttributes();
|
||||
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.5D);
|
||||
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
129
src/main/java/com/hbm/entity/mob/glyphid/GlyphidStats.java
Normal file
129
src/main/java/com/hbm/entity/mob/glyphid/GlyphidStats.java
Normal file
@ -0,0 +1,129 @@
|
||||
package com.hbm.entity.mob.glyphid;
|
||||
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import net.minecraft.util.DamageSource;
|
||||
|
||||
public abstract class GlyphidStats {
|
||||
|
||||
public static GlyphidStats GLYPHID_STATS_70K = new GlyphidStats70K();
|
||||
public static GlyphidStats GLYPHID_STATS_NT = new GlyphidStatsNT();
|
||||
|
||||
public static GlyphidStats getStats() {
|
||||
return GLYPHID_STATS_70K;
|
||||
}
|
||||
|
||||
protected StatBundle statsGrunt;
|
||||
protected StatBundle statsBombardier;
|
||||
protected StatBundle statsBrawler;
|
||||
protected StatBundle statsDigger;
|
||||
protected StatBundle statsBlaster;
|
||||
protected StatBundle statsBehemoth;
|
||||
protected StatBundle statsBrenda;
|
||||
protected StatBundle statsNuclear;
|
||||
protected StatBundle statsScout;
|
||||
|
||||
public static class StatBundle {
|
||||
public final double health;
|
||||
public final double speed;
|
||||
public final double damage;
|
||||
public final float divisor;
|
||||
public final float damageThreshold;
|
||||
|
||||
public StatBundle(double health, double speed, double damage, float divisor, float damageThreshold) {
|
||||
this.health = health;
|
||||
this.speed = speed;
|
||||
this.damage = damage;
|
||||
this.divisor = divisor;
|
||||
this.damageThreshold = damageThreshold;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract boolean handleAttack(EntityGlyphid glyphid, DamageSource source, float amount);
|
||||
|
||||
/** Tier 1 */ public StatBundle getGrunt() { return statsGrunt; }
|
||||
/** Tier 1 Ranged */ public StatBundle getBombardier() { return statsBombardier; }
|
||||
/** Tier 2 */ public StatBundle getBrawler() { return statsBrawler; }
|
||||
/** Tier 2 Specialist */ public StatBundle getDigger() { return statsDigger; }
|
||||
/** Tier 2 Ranged */ public StatBundle getBlaster() { return statsBlaster; }
|
||||
/** Tier 3 */ public StatBundle getBehemoth() { return statsBehemoth; }
|
||||
/** Tier 4 */ public StatBundle getBrenda() { return statsBrenda; }
|
||||
/** Tier 4 Specialist */ public StatBundle getNuclear() { return statsNuclear; }
|
||||
/** Tier 0 */ public StatBundle getScout() { return statsScout; }
|
||||
|
||||
public static class GlyphidStats70K extends GlyphidStats {
|
||||
|
||||
public GlyphidStats70K() {
|
||||
this.statsGrunt = new StatBundle(30D, 1D, 5D, 1F, 0.5F);
|
||||
this.statsBombardier = new StatBundle(20D, 1D, 5D, 1F, 0.5F);
|
||||
this.statsBrawler = new StatBundle(50D, 1D, 10D, 3F, 1F);
|
||||
this.statsDigger = new StatBundle(50D, 1D, 5D, 1F, 0.5F);
|
||||
this.statsBlaster = new StatBundle(50D, 1D, 10D, 2F, 1F);
|
||||
this.statsBehemoth = new StatBundle(130D, 0.8D, 25D, 4F, 2.5F);
|
||||
this.statsBrenda = new StatBundle(250D, 1.2D, 50D, 5F, 10F);
|
||||
this.statsNuclear = new StatBundle(100D, 0.8D, 50D, 5F, 10F);
|
||||
this.statsScout = new StatBundle(20D, 1.5D, 2D, 1F, 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleAttack(EntityGlyphid glyphid, DamageSource source, float amount) {
|
||||
|
||||
if(!source.isDamageAbsolute() && !source.isUnblockable() && !glyphid.worldObj.isRemote && !source.isFireDamage() && !source.getDamageType().equals(ModDamageSource.s_cryolator)) {
|
||||
byte armor = glyphid.getDataWatcher().getWatchableObjectByte(glyphid.DW_ARMOR);
|
||||
|
||||
if(armor != 0) { //if at least one bit of armor is present
|
||||
|
||||
if(amount < glyphid.getDamageThreshold()) return false;
|
||||
|
||||
//chances of armor being broken off
|
||||
if(amount > 1 && glyphid.isArmorBroken(amount)) {
|
||||
glyphid.breakOffArmor();
|
||||
amount *= 0.25F;
|
||||
}
|
||||
|
||||
amount -= glyphid.getDamageThreshold();
|
||||
if(amount < 0) return true;
|
||||
}
|
||||
|
||||
amount = glyphid.calculateDamage(amount);
|
||||
}
|
||||
|
||||
if(source.isFireDamage()) {
|
||||
amount *= 0.7F;
|
||||
} else if(source.getDamageType().equals("player")) {
|
||||
amount *= glyphid.getScale() < 1.25 ? 1.5 : glyphid.getScale() < 1.3 ? 0.8 : 0.5;
|
||||
} else if(source == ModDamageSource.acid || ModDamageSource.s_acid.equals(source.getDamageType())){
|
||||
amount = 0;
|
||||
} else if(source == DamageSource.inWall) {
|
||||
amount *= 15F;
|
||||
}
|
||||
|
||||
if(glyphid.isPotionActive(HbmPotion.phosphorus.getId())){
|
||||
amount *= 1.5F;
|
||||
}
|
||||
|
||||
return glyphid.attackSuperclass(source, amount);
|
||||
}
|
||||
}
|
||||
|
||||
public static class GlyphidStatsNT extends GlyphidStats {
|
||||
|
||||
public GlyphidStatsNT() {
|
||||
this.statsGrunt = new StatBundle(30D, 1D, 5D, 1, 0.5F);
|
||||
this.statsBombardier = new StatBundle(20D, 1D, 5D, 1, 0.5F);
|
||||
this.statsBrawler = new StatBundle(50D, 1D, 10D, 3, 1F);
|
||||
this.statsDigger = new StatBundle(50D, 1D, 5D, 1, 0.5F);
|
||||
this.statsBlaster = new StatBundle(50D, 1D, 10D, 2, 1F);
|
||||
this.statsBehemoth = new StatBundle(130D, 0.8D, 25D, 4, 2.5F);
|
||||
this.statsBrenda = new StatBundle(250D, 1.2D, 50D, 5, 10F);
|
||||
this.statsNuclear = new StatBundle(100D, 0.8D, 50D, 5, 10F);
|
||||
this.statsScout = new StatBundle(20D, 1.5D, 2D, 1, 0.5F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean handleAttack(EntityGlyphid glyphid, DamageSource source, float amount) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import com.hbm.entity.mob.EntityGlyphid;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphid;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
@ -4,7 +4,7 @@ import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.mob.EntityGlyphid;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphid;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
@ -6,8 +6,6 @@ import com.hbm.packet.ParticleBurstPacket;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -34,6 +34,9 @@ public abstract class EntityThrowableInterp extends EntityThrowableNT {
|
||||
if(!worldObj.isRemote) {
|
||||
super.onUpdate();
|
||||
} else {
|
||||
this.lastTickPosX = this.posX;
|
||||
this.lastTickPosY = this.posY;
|
||||
this.lastTickPosZ = this.posZ;
|
||||
if(this.turnProgress > 0) {
|
||||
double interpX = this.posX + (this.syncPosX - this.posX) / (double) this.turnProgress;
|
||||
double interpY = this.posY + (this.syncPosY - this.posY) / (double) this.turnProgress;
|
||||
|
||||
@ -142,9 +142,6 @@ public abstract class EntityThrowableNT extends Entity implements IProjectile {
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.lastTickPosX = this.posX;
|
||||
this.lastTickPosY = this.posY;
|
||||
this.lastTickPosZ = this.posZ;
|
||||
super.onUpdate();
|
||||
|
||||
if(this.throwableShake > 0) {
|
||||
|
||||
@ -12,11 +12,8 @@ import com.hbm.blocks.rail.IRailNTM.RailCheckType;
|
||||
import com.hbm.blocks.rail.IRailNTM.RailContext;
|
||||
import com.hbm.blocks.rail.IRailNTM.TrackGauge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -890,7 +887,7 @@ public abstract class EntityRailCarBase extends Entity implements ILookOverlay {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void printHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z) {
|
||||
List<String> text = new ArrayList();
|
||||
//List<String> text = new ArrayList();
|
||||
//ILookOverlay.printGeneric(event, this.getClass().getSimpleName() + " " + this.hashCode(), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -20,7 +20,6 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.VersatileConfig;
|
||||
import com.hbm.entity.effect.EntityNukeCloudSmall;
|
||||
import com.hbm.entity.grenade.EntityGrenadeASchrab;
|
||||
import com.hbm.entity.grenade.EntityGrenadeNuclear;
|
||||
import com.hbm.entity.missile.EntityMIRV;
|
||||
@ -103,7 +102,6 @@ public class ExplosionNukeGeneric {
|
||||
private static boolean isExplosionExempt(Entity e) {
|
||||
|
||||
if (e instanceof EntityOcelot ||
|
||||
e instanceof EntityNukeCloudSmall ||
|
||||
e instanceof EntityMIRV ||
|
||||
e instanceof EntityGrenadeASchrab ||
|
||||
e instanceof EntityGrenadeNuclear ||
|
||||
|
||||
@ -9,7 +9,7 @@ import com.hbm.items.ModItems;
|
||||
|
||||
public class BulletConfigSyncingUtil {
|
||||
|
||||
private static HashMap<Integer, BulletConfiguration> configSet = new HashMap();
|
||||
private static HashMap<Integer, BulletConfiguration> configSet = new HashMap<Integer, BulletConfiguration>();
|
||||
|
||||
static int i = 0;
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ import net.minecraft.world.World;
|
||||
*/
|
||||
public class CasingEjector implements Cloneable {
|
||||
|
||||
public static HashMap<Integer, CasingEjector> mappings = new HashMap();
|
||||
public static HashMap<Integer, CasingEjector> mappings = new HashMap<Integer, CasingEjector>();
|
||||
public static final Random rand = new Random();
|
||||
|
||||
private int id;
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.handler;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
@ -35,7 +36,10 @@ public class GunConfiguration implements Cloneable {
|
||||
public int durability;
|
||||
|
||||
//animations!
|
||||
public HashMap<AnimType, BusAnimation> animations = new HashMap();
|
||||
public HashMap<AnimType, BusAnimation> animations = new HashMap<AnimType, BusAnimation>();
|
||||
//lazy-ish loading for animations, required for loading animations from ResourceManager, since that occurs after we've initialised the guns
|
||||
public Consumer<Void> loadAnimations;
|
||||
public boolean animationsLoaded = false;
|
||||
//when sneaking, disables crosshair and centers the bullet spawn point
|
||||
public boolean hasSights;
|
||||
//texture overlay when sneaking
|
||||
@ -45,17 +49,18 @@ public class GunConfiguration implements Cloneable {
|
||||
//the target FOV/multiplied FOV modifier when sneaking
|
||||
public float zoomFOV = 0.0F;
|
||||
|
||||
//how long the reload animation will play
|
||||
//MUST BE GREATER THAN ZERO ! ! !
|
||||
public int reloadDuration;
|
||||
//duration of every animation cycle, used also for how quickly a burst fire rifle can fire
|
||||
public int firingDuration;
|
||||
//sound path to the reload sound
|
||||
public String reloadSound = "";
|
||||
//sound path to the shooting sound
|
||||
public String firingSound = "";
|
||||
public float firingVolume = 1.0F;
|
||||
public float firingPitch = 1.0F;
|
||||
//how long the reload animation will play
|
||||
//MUST BE GREATER THAN ZERO ! ! !
|
||||
public int reloadDuration;
|
||||
public int emptyReloadAdditionalDuration;
|
||||
//sound path to the reload sound
|
||||
public String reloadSound = "";
|
||||
//whether the reload sound should be played at the beginning or at the end of the reload
|
||||
public boolean reloadSoundEnd = true;
|
||||
public String equipSound = "";
|
||||
@ -64,6 +69,8 @@ public class GunConfiguration implements Cloneable {
|
||||
public int ammoCap;
|
||||
//0 does not allow direct reload, 1 is full clip, 2 is single bullet
|
||||
public int reloadType;
|
||||
// If the animations are designed to be sequential, the last frame will be held until the next anmiation starts
|
||||
public boolean reloadAnimationsSequential = false;
|
||||
//whether or not the infinity enchantment should work
|
||||
public boolean allowsInfinity;
|
||||
//whether the ammo count should be displayed
|
||||
@ -79,10 +86,10 @@ public class GunConfiguration implements Cloneable {
|
||||
|
||||
public String name = "";
|
||||
public EnumGunManufacturer manufacturer = EnumGunManufacturer.NONE;
|
||||
public List<String> comment = new ArrayList();
|
||||
public List<String> comment = new ArrayList<String>();
|
||||
|
||||
//bullet configs for main and alt fire
|
||||
public List<Integer> config = new ArrayList();
|
||||
public List<Integer> config = new ArrayList<Integer>();
|
||||
|
||||
//crosshair
|
||||
public Crosshair crosshair;
|
||||
|
||||
@ -10,13 +10,13 @@ import com.hbm.items.ItemAmmoEnums.Ammo12Gauge;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
@ -70,13 +70,13 @@ public class Gun12GaugeFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL_TRANSLATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -2, 100))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
.addKeyframePosition(0, 0, -2, 100)
|
||||
.addKeyframePosition(0, 0, 0, 200)
|
||||
)
|
||||
.addBus("PUMP", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 450))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -1.8, 200))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
.addKeyframePosition(0, 0, 0, 450)
|
||||
.addKeyframePosition(0, 0, -1.8, 200)
|
||||
.addKeyframePosition(0, 0, 0, 200)
|
||||
)
|
||||
);
|
||||
|
||||
@ -88,11 +88,12 @@ public class Gun12GaugeFactory {
|
||||
|
||||
GunConfiguration config = new GunConfiguration();
|
||||
|
||||
config.rateOfFire = 25;
|
||||
config.rateOfFire = 20;
|
||||
config.roundsPerCycle = 1;
|
||||
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
||||
config.reloadDuration = 10;
|
||||
config.emptyReloadAdditionalDuration = 5;
|
||||
config.firingDuration = 5;
|
||||
config.ammoCap = 8;
|
||||
config.durability = 2500;
|
||||
@ -100,6 +101,7 @@ public class Gun12GaugeFactory {
|
||||
config.allowsInfinity = true;
|
||||
config.crosshair = Crosshair.CIRCLE;
|
||||
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
|
||||
config.reloadSoundEnd = false;
|
||||
config.firingSound = "hbm:weapon.shotgunPump";
|
||||
|
||||
config.name = "spas12";
|
||||
@ -108,22 +110,17 @@ public class Gun12GaugeFactory {
|
||||
config.comment.add("Alt-fire with Mouse 2 (Right-click) to fire 2 shells at once");
|
||||
|
||||
config.config = HbmCollection.g12hs;
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("SPAS_RECOIL_TRANSLATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -2, 100))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
)
|
||||
.addBus("SPAS_RECOIL_ROT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, 0, 1, 100))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
)
|
||||
.addBus("SPAS_PUMP", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 450))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -1.8, 200))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
)
|
||||
);
|
||||
|
||||
config.reloadAnimationsSequential = true;
|
||||
|
||||
config.loadAnimations = i -> {
|
||||
config.animations.put(AnimType.CYCLE, ResourceManager.spas_12_anim.get("Fire"));
|
||||
config.animations.put(AnimType.ALT_CYCLE, ResourceManager.spas_12_anim.get("FireAlt"));
|
||||
config.animations.put(AnimType.RELOAD, ResourceManager.spas_12_anim.get("ReloadStart"));
|
||||
config.animations.put(AnimType.RELOAD_EMPTY, ResourceManager.spas_12_anim.get("ReloadEmptyStart"));
|
||||
config.animations.put(AnimType.RELOAD_CYCLE, ResourceManager.spas_12_anim.get("Reload"));
|
||||
config.animations.put(AnimType.RELOAD_END, ResourceManager.spas_12_anim.get("ReloadEnd"));
|
||||
};
|
||||
|
||||
config.ejector = EJECTOR_SPAS;
|
||||
|
||||
@ -141,7 +138,7 @@ public class Gun12GaugeFactory {
|
||||
config.firingDuration = 10;
|
||||
config.ammoCap = 8;
|
||||
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
|
||||
config.firingSound = "hbm:weapon.shotgunPump";
|
||||
config.firingSound = "hbm:weapon.shotgunPumpAlt";
|
||||
config.reloadType = GunConfiguration.RELOAD_SINGLE;
|
||||
|
||||
config.config = HbmCollection.g12hs;
|
||||
@ -200,24 +197,24 @@ public class Gun12GaugeFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("SHOTTY_RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.5, 0, 0, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 50))
|
||||
.addKeyframePosition(0.5, 0, 0, 50)
|
||||
.addKeyframePosition(0, 0, 0, 50)
|
||||
)
|
||||
.addBus("SHOTTY_BREAK", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 100)) //do nothing for 100ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 60, 200)) //open
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 60, 500)) //do nothing for 500ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200)) //close
|
||||
.addKeyframePosition(0, 0, 0, 100) //do nothing for 100ms
|
||||
.addKeyframePosition(0, 0, 60, 200) //open
|
||||
.addKeyframePosition(0, 0, 60, 500) //do nothing for 500ms
|
||||
.addKeyframePosition(0, 0, 0, 200) //close
|
||||
)
|
||||
.addBus("SHOTTY_EJECT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 300)) //do nothing for 300ms
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 700)) //fling!
|
||||
.addKeyframePosition(0, 0, 0, 300) //do nothing for 300ms
|
||||
.addKeyframePosition(1, 0, 0, 700) //fling!
|
||||
)
|
||||
.addBus("SHOTTY_INSERT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 300)) //do nothing for 300ms
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 1, 0)) //reposition
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 350)) //come in from the side
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 150)) //push
|
||||
.addKeyframePosition(0, 0, 0, 300) //do nothing for 300ms
|
||||
.addKeyframePosition(1, 0, 1, 0) //reposition
|
||||
.addKeyframePosition(1, 0, 0, 350) //come in from the side
|
||||
.addKeyframePosition(0, 0, 0, 150) //push
|
||||
)
|
||||
);
|
||||
|
||||
@ -252,26 +249,26 @@ public class Gun12GaugeFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(6.25, 0.25, 2.5, 55))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 55))
|
||||
.addKeyframePosition(6.25, 0.25, 2.5, 55)
|
||||
.addKeyframePosition(0, 0, 0, 55)
|
||||
)
|
||||
.addBus("EJECT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(25, 0, 0, 100))
|
||||
.addKeyframePosition(0, 0, 0, 25)
|
||||
.addKeyframePosition(25, 0, 0, 100)
|
||||
)
|
||||
);
|
||||
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("RELOAD", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(60, 0, -10, 400))
|
||||
.addKeyframe(new BusAnimationKeyframe(60, 125, -10, 200))
|
||||
.addKeyframe(new BusAnimationKeyframe(60, 125, -10, 300))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 300))
|
||||
.addKeyframePosition(60, 0, -10, 400)
|
||||
.addKeyframePosition(60, 125, -10, 200)
|
||||
.addKeyframePosition(60, 125, -10, 300)
|
||||
.addKeyframePosition(0, 0, 0, 300)
|
||||
)
|
||||
.addBus("PUMP", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 900))
|
||||
.addKeyframe(new BusAnimationKeyframe(10, 0, 0, 200))
|
||||
.addKeyframe(new BusAnimationKeyframe())
|
||||
.addKeyframePosition(0, 0, 0, 900)
|
||||
.addKeyframePosition(10, 0, 0, 200)
|
||||
.addKeyframePosition(0, 0, 0, 1)
|
||||
)
|
||||
);
|
||||
|
||||
@ -292,7 +289,7 @@ public class Gun12GaugeFactory {
|
||||
config.reloadType = 1;
|
||||
config.ammoCap = 24;
|
||||
config.reloadDuration = 20;
|
||||
config.reloadSound = config.RSOUND_MAG;
|
||||
config.reloadSound = GunConfiguration.RSOUND_MAG;
|
||||
config.reloadSoundEnd = true;
|
||||
config.name += "Drum";
|
||||
return config;
|
||||
|
||||
@ -50,16 +50,16 @@ public class Gun20GaugeFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("LEVER_ROTATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 45, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))
|
||||
.addKeyframePosition(0, 0, 0, 250)
|
||||
.addKeyframePosition(0, 0, 45, 500)
|
||||
.addKeyframePosition(0, 0, 0, 500)
|
||||
)
|
||||
.addBus("LEVER_RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.5, 0, 0, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 150))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, -0.5, 0, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))
|
||||
.addKeyframePosition(0.5, 0, 0, 50)
|
||||
.addKeyframePosition(0, 0, 0, 50)
|
||||
.addKeyframePosition(0, 0, 0, 150)
|
||||
.addKeyframePosition(0, -0.5, 0, 500)
|
||||
.addKeyframePosition(0, 0, 0, 500)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -10,10 +10,12 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@ -39,7 +41,7 @@ public class Gun357MagnumFactory {
|
||||
config.roundsPerCycle = 1;
|
||||
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
||||
config.reloadDuration = 10;
|
||||
config.reloadDuration = 30;
|
||||
config.firingDuration = 0;
|
||||
config.ammoCap = 6;
|
||||
config.reloadType = GunConfiguration.RELOAD_FULL;
|
||||
@ -50,6 +52,11 @@ public class Gun357MagnumFactory {
|
||||
config.reloadSoundEnd = false;
|
||||
|
||||
config.ejector = EJECTOR_REVOLVER;
|
||||
|
||||
config.loadAnimations = i -> {
|
||||
config.animations.put(AnimType.CYCLE, ResourceManager.python_anim.get("Fire"));
|
||||
config.animations.put(AnimType.RELOAD, ResourceManager.python_anim.get("Reload"));
|
||||
};
|
||||
|
||||
return config;
|
||||
}
|
||||
@ -122,6 +129,11 @@ public class Gun357MagnumFactory {
|
||||
config.config = new ArrayList<Integer>();
|
||||
config.config.add(BulletConfigSyncingUtil.CURSED_REVOLVER);
|
||||
config.config.add(BulletConfigSyncingUtil.DESH_REVOLVER);
|
||||
|
||||
config.loadAnimations = i -> {
|
||||
config.animations.put(AnimType.CYCLE, ResourceManager.cursed_anim.get("Fire"));
|
||||
config.animations.put(AnimType.RELOAD, ResourceManager.cursed_anim.get("Reload"));
|
||||
};
|
||||
|
||||
return config;
|
||||
}
|
||||
@ -242,7 +254,7 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMin = 10;
|
||||
bullet.dmgMax = 15;
|
||||
|
||||
bullet.effects = new ArrayList();
|
||||
bullet.effects = new ArrayList<PotionEffect>();
|
||||
bullet.effects.add(new PotionEffect(HbmPotion.radiation.id, 10 * 20, 4));
|
||||
|
||||
bullet.spentCasing = CASING357.clone().register("357Nuc").setColor(0xFEFEFE);
|
||||
@ -328,8 +340,8 @@ public class Gun357MagnumFactory {
|
||||
bullet.dmgMax = 100;
|
||||
bullet.doesRicochet = false;
|
||||
bullet.destroysBlocks = true;
|
||||
bullet.style = bullet.STYLE_BOLT;
|
||||
bullet.trail = bullet.BOLT_NIGHTMARE;
|
||||
bullet.style = BulletConfiguration.STYLE_BOLT;
|
||||
bullet.trail = BulletConfiguration.BOLT_NIGHTMARE;
|
||||
|
||||
bullet.damageType = ModDamageSource.s_laser;
|
||||
|
||||
|
||||
@ -15,12 +15,14 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo44Magnum;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -60,6 +62,10 @@ public class Gun44MagnumFactory {
|
||||
config.config.addAll(HbmCollection.m44Normal);
|
||||
|
||||
config.ejector = EJECTOR_PIP;
|
||||
|
||||
config.loadAnimations = i -> {
|
||||
config.animations.put(AnimType.CYCLE, ResourceManager.novac_anim.get("Fire"));
|
||||
};
|
||||
|
||||
return config;
|
||||
}
|
||||
@ -220,7 +226,7 @@ public class Gun44MagnumFactory {
|
||||
|
||||
PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 20 * 20, 0, true);
|
||||
eff.getCurativeItems().clear();
|
||||
bullet.effects = new ArrayList();
|
||||
bullet.effects = new ArrayList<PotionEffect>();
|
||||
bullet.effects.add(new PotionEffect(eff));
|
||||
|
||||
bullet.bntImpact = (bulletnt, x, y, z, sideHit) -> {
|
||||
|
||||
@ -81,12 +81,12 @@ public class Gun45ACPFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("SLIDE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 10))// Wait for hammer
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -3.5, 40))// Slide back
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 40)))// Return
|
||||
.addKeyframePosition(0, 0, 0, 10)// Wait for hammer
|
||||
.addKeyframePosition(0, 0, -3.5, 40)// Slide back
|
||||
.addKeyframePosition(0, 0, 0, 40))// Return
|
||||
.addBus("HAMMER", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(15, 0, 0, 10))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 40))));
|
||||
.addKeyframePosition(15, 0, 0, 10)
|
||||
.addKeyframePosition(0, 0, 0, 40)));
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo4Gauge;
|
||||
import com.hbm.lib.HbmCollection;
|
||||
import com.hbm.lib.HbmCollection.EnumGunManufacturer;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
@ -24,7 +25,6 @@ import com.hbm.particle.SpentCasing;
|
||||
import com.hbm.particle.SpentCasing.CasingType;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationKeyframe;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
import com.hbm.render.anim.HbmAnimations.AnimType;
|
||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||
@ -78,12 +78,27 @@ public class Gun4GaugeFactory {
|
||||
|
||||
config.durability = 3000;
|
||||
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
|
||||
config.reloadSoundEnd = false;
|
||||
config.firingSound = "hbm:weapon.revolverShootAlt";
|
||||
config.firingPitch = 0.65F;
|
||||
|
||||
config.ejector = EJECTOR_SHOTGUN.clone().setDelay(10);
|
||||
|
||||
config.name = "ks23";
|
||||
config.manufacturer = EnumGunManufacturer.TULSKY;
|
||||
|
||||
config.emptyReloadAdditionalDuration = 5;
|
||||
|
||||
config.reloadAnimationsSequential = true;
|
||||
|
||||
config.loadAnimations = i -> {
|
||||
config.animations.put(AnimType.CYCLE, ResourceManager.ks23_anim.get("Fire"));
|
||||
config.animations.put(AnimType.RELOAD, ResourceManager.ks23_anim.get("ReloadStart"));
|
||||
config.animations.put(AnimType.RELOAD_EMPTY, ResourceManager.ks23_anim.get("ReloadEmptyStart"));
|
||||
config.animations.put(AnimType.RELOAD_CYCLE, ResourceManager.ks23_anim.get("Reload"));
|
||||
config.animations.put(AnimType.RELOAD_END, ResourceManager.ks23_anim.get("ReloadEnd"));
|
||||
};
|
||||
|
||||
config.config = HbmCollection.g4;
|
||||
|
||||
return config;
|
||||
@ -109,25 +124,25 @@ public class Gun4GaugeFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("SAUER_RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.5, 0, 0, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 50))
|
||||
.addKeyframePosition(0.5, 0, 0, 50)
|
||||
.addKeyframePosition(0, 0, 0, 50)
|
||||
)
|
||||
.addBus("SAUER_TILT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.0, 0, 0, 200)) // do nothing for 200ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 30, 150)) //tilt forward
|
||||
.addKeyframe(new BusAnimationKeyframe(45, 0, 30, 150)) //tilt sideways
|
||||
.addKeyframe(new BusAnimationKeyframe(45, 0, 30, 200)) //do nothing for 200ms (eject)
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 30, 150)) //restore sideways
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 150)) //restore forward
|
||||
.addKeyframePosition(0.0, 0, 0, 200) // do nothing for 200ms
|
||||
.addKeyframePosition(0, 0, 30, 150) //tilt forward
|
||||
.addKeyframePosition(45, 0, 30, 150) //tilt sideways
|
||||
.addKeyframePosition(45, 0, 30, 200) //do nothing for 200ms (eject)
|
||||
.addKeyframePosition(0, 0, 30, 150) //restore sideways
|
||||
.addKeyframePosition(0, 0, 0, 150) //restore forward
|
||||
)
|
||||
.addBus("SAUER_COCK", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500)) //do nothing for 500ms
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 100)) //pull back lever for 100ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 100)) //release lever for 100ms
|
||||
.addKeyframePosition(0, 0, 0, 500) //do nothing for 500ms
|
||||
.addKeyframePosition(1, 0, 0, 100) //pull back lever for 100ms
|
||||
.addKeyframePosition(0, 0, 0, 100) //release lever for 100ms
|
||||
)
|
||||
.addBus("SAUER_SHELL_EJECT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500)) //do nothing for 500ms
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 500)) //FLING!
|
||||
.addKeyframePosition(0, 0, 0, 500) //do nothing for 500ms
|
||||
.addKeyframePosition(0, 0, 1, 500) //FLING!
|
||||
)
|
||||
);
|
||||
|
||||
@ -203,7 +218,7 @@ public class Gun4GaugeFactory {
|
||||
|
||||
PotionEffect eff = new PotionEffect(HbmPotion.phosphorus.id, 20 * 20, 0, true);
|
||||
eff.getCurativeItems().clear();
|
||||
bullet.effects = new ArrayList();
|
||||
bullet.effects = new ArrayList<PotionEffect>();
|
||||
bullet.effects.add(new PotionEffect(eff));
|
||||
|
||||
bullet.bntImpact = (bulletnt, x, y, z, sideHit) -> {
|
||||
@ -494,7 +509,7 @@ public class Gun4GaugeFactory {
|
||||
BulletConfigFactory.nuclearExplosion(creature, 0, 0, 0, ExplosionNukeSmall.PARAMS_TOTS);
|
||||
|
||||
bulletnt.worldObj.removeEntity(creature);
|
||||
bulletnt.worldObj.unloadEntities(new ArrayList() {{ add(creature); }});
|
||||
bulletnt.worldObj.unloadEntities(new ArrayList<EntityCreature>() {{ add(creature); }});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -138,20 +138,20 @@ public class Gun50BMGFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
);
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("TILT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 125))
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 750))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 125))
|
||||
.addKeyframePosition(1, 0, 0, 125)
|
||||
.addKeyframePosition(1, 0, 0, 750)
|
||||
.addKeyframePosition(0, 0, 0, 125)
|
||||
)
|
||||
.addBus("MAG", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 200))
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 1, 200))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||
.addKeyframePosition(0, 0, 1, 200)
|
||||
.addKeyframePosition(1, 0, 1, 200)
|
||||
.addKeyframePosition(0, 0, 0, 200)
|
||||
)
|
||||
);
|
||||
|
||||
@ -191,8 +191,8 @@ public class Gun50BMGFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
);
|
||||
|
||||
@ -238,10 +238,10 @@ public class Gun50BMGFactory {
|
||||
config.animations.put(AnimType.CYCLE,
|
||||
new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(-0.45, 0.15, 0, 40)) // Moves back and raise slightly
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))) // Then forward again
|
||||
.addBus("EJECT", new BusAnimationSequence().addKeyframe(new BusAnimationKeyframe(0, 0, 0, 30)) // Wait
|
||||
.addKeyframe(new BusAnimationKeyframe(50, 0, 0, 120)))); // Fly // out
|
||||
.addKeyframePosition(-0.45, 0.15, 0, 40) // Moves back and raise slightly
|
||||
.addKeyframePosition(0, 0, 0, 75)) // Then forward again
|
||||
.addBus("EJECT", new BusAnimationSequence().addKeyframePosition(0, 0, 0, 30) // Wait
|
||||
.addKeyframePosition(50, 0, 0, 120))); // Fly // out
|
||||
|
||||
config.ejector = EJECTOR_SNIPER;
|
||||
return config;
|
||||
|
||||
@ -94,8 +94,8 @@ public class Gun556mmFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0.5, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(0.5, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -49,25 +49,25 @@ public class Gun75BoltFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
.addBus("EJECT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 75))
|
||||
.addKeyframePosition(0, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 1, 75)
|
||||
)
|
||||
);
|
||||
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("TILT", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 250))
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 1500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250))
|
||||
.addKeyframePosition(1, 0, 0, 250)
|
||||
.addKeyframePosition(1, 0, 0, 1500)
|
||||
.addKeyframePosition(0, 0, 0, 250)
|
||||
)
|
||||
.addBus("MAG", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 1, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 1, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))
|
||||
.addKeyframePosition(0, 0, 1, 500)
|
||||
.addKeyframePosition(1, 0, 1, 500)
|
||||
.addKeyframePosition(0, 0, 0, 500)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -58,15 +58,15 @@ public class Gun762mmFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
);
|
||||
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("MAG", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, -1, 0, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 500))
|
||||
.addKeyframePosition(0, -1, 0, 500)
|
||||
.addKeyframePosition(0, 0, 0, 500)
|
||||
)
|
||||
);
|
||||
|
||||
@ -177,19 +177,19 @@ public class Gun762mmFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
.addBus("LEVER_PULL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //wait out recoil and lever flick
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, 0, 0, 375)) //pull back bolt
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //release bolt
|
||||
.addKeyframePosition(0, 0, 0, 375) //wait out recoil and lever flick
|
||||
.addKeyframePosition(-1, 0, 0, 375) //pull back bolt
|
||||
.addKeyframePosition(0, 0, 0, 375) //release bolt
|
||||
)
|
||||
.addBus("LEVER_ROTATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250)) //wait out recoil
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 125)) //flick up lever in 125ms
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 750)) //pull action
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 125)) //flick down lever again
|
||||
.addKeyframePosition(0, 0, 0, 250) //wait out recoil
|
||||
.addKeyframePosition(1, 0, 0, 125) //flick up lever in 125ms
|
||||
.addKeyframePosition(1, 0, 0, 750) //pull action
|
||||
.addKeyframePosition(0, 0, 0, 125) //flick down lever again
|
||||
)
|
||||
);
|
||||
|
||||
@ -216,19 +216,19 @@ public class Gun762mmFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
.addBus("LEVER_PULL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //wait out recoil and lever flick
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, 0, 0, 375)) //pull back bolt
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //release bolt
|
||||
.addKeyframePosition(0, 0, 0, 375) //wait out recoil and lever flick
|
||||
.addKeyframePosition(-1, 0, 0, 375) //pull back bolt
|
||||
.addKeyframePosition(0, 0, 0, 375) //release bolt
|
||||
)
|
||||
.addBus("LEVER_ROTATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250)) //wait out recoil
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 125)) //flick up lever in 125ms
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 750)) //pull action
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 125)) //flick down lever again
|
||||
.addKeyframePosition(0, 0, 0, 250) //wait out recoil
|
||||
.addKeyframePosition(1, 0, 0, 125) //flick up lever in 125ms
|
||||
.addKeyframePosition(1, 0, 0, 750) //pull action
|
||||
.addKeyframePosition(0, 0, 0, 125) //flick down lever again
|
||||
)
|
||||
);
|
||||
|
||||
@ -259,19 +259,19 @@ public class Gun762mmFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
.addBus("LEVER_PULL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //wait out recoil and lever flick
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, 0, 0, 375)) //pull back bolt
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //release bolt
|
||||
.addKeyframePosition(0, 0, 0, 375) //wait out recoil and lever flick
|
||||
.addKeyframePosition(-1, 0, 0, 375) //pull back bolt
|
||||
.addKeyframePosition(0, 0, 0, 375) //release bolt
|
||||
)
|
||||
.addBus("LEVER_ROTATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250)) //wait out recoil
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 125)) //flick up lever in 125ms
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 750)) //pull action
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 125)) //flick down lever again
|
||||
.addKeyframePosition(0, 0, 0, 250) //wait out recoil
|
||||
.addKeyframePosition(1, 0, 0, 125) //flick up lever in 125ms
|
||||
.addKeyframePosition(1, 0, 0, 750) //pull action
|
||||
.addKeyframePosition(0, 0, 0, 125) //flick down lever again
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -42,8 +42,8 @@ public class GunGaussFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||
.addKeyframePosition(1, 0, 0, 25)
|
||||
.addKeyframePosition(0, 0, 0, 75)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -84,23 +84,23 @@ public class GunRocketFactory {
|
||||
|
||||
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||
.addBus("QUADRO_RECOIL", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, -0.5, 50))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 50))
|
||||
.addKeyframePosition(0, 0, -0.5, 50)
|
||||
.addKeyframePosition(0, 0, 0, 50)
|
||||
)
|
||||
);
|
||||
|
||||
config.animations.put(AnimType.RELOAD, new BusAnimation()
|
||||
.addBus("QUADRO_RELOAD_ROTATE", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 60, 750))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 60, 3500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 750))
|
||||
.addKeyframePosition(0, 0, 60, 750)
|
||||
.addKeyframePosition(0, 0, 60, 3500)
|
||||
.addKeyframePosition(0, 0, 0, 750)
|
||||
)
|
||||
.addBus("QUADRO_RELOAD_PUSH", new BusAnimationSequence()
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, -1, 0, 0))
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, -1, 0, 750))
|
||||
.addKeyframe(new BusAnimationKeyframe(-1, 0, 0, 500))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 3000))
|
||||
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 750))
|
||||
.addKeyframePosition(-1, -1, 0, 0)
|
||||
.addKeyframePosition(-1, -1, 0, 750)
|
||||
.addKeyframePosition(-1, 0, 0, 500)
|
||||
.addKeyframePosition(0, 0, 0, 3000)
|
||||
.addKeyframePosition(0, 0, 0, 750)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.CustomMachineConfigJSON;
|
||||
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
|
||||
@ -25,10 +26,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
|
||||
|
||||
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
|
||||
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
|
||||
public MachineConfiguration conf;
|
||||
|
||||
@Override
|
||||
@ -39,20 +40,25 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public CustomMachineHandler(MachineConfiguration conf) {
|
||||
super();
|
||||
this.conf = conf;
|
||||
loadTransferRects();
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
}
|
||||
|
||||
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
List<PositionedStack> inputs = new ArrayList();
|
||||
PositionedStack machine;
|
||||
List<PositionedStack> outputs = new ArrayList();
|
||||
|
||||
public int flux = 0;
|
||||
public int heat = 0;
|
||||
public float radiationAmount = 0;
|
||||
public String pollutionType;
|
||||
public float pollutionAmount = 0;
|
||||
|
||||
public RecipeSet(CustomMachineRecipe recipe) {
|
||||
|
||||
for(int i = 0; i < 3; i++) if(recipe.inputFluids.length > i) inputs.add(new PositionedStack(ItemFluidIcon.make(recipe.inputFluids[i]), 12 + i * 18, 6));
|
||||
@ -60,7 +66,7 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
for(int i = 3; i < 6; i++) if(recipe.inputItems.length > i) inputs.add(new PositionedStack(recipe.inputItems[i].extractForNEI(), 12 + (i - 3) * 18, 42));
|
||||
|
||||
for(int i = 0; i < 3; i++) if(recipe.outputFluids.length > i) outputs.add(new PositionedStack(ItemFluidIcon.make(recipe.outputFluids[i]), 102 + i * 18, 6));
|
||||
|
||||
|
||||
for(int i = 0; i < 3; i++) if(recipe.outputItems.length > i) {
|
||||
Pair<ItemStack, Float> pair = recipe.outputItems[i];
|
||||
ItemStack out = pair.getKey().copy();
|
||||
@ -69,7 +75,7 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
outputs.add(new PositionedStack(out, 102 + i * 18, 24));
|
||||
}
|
||||
|
||||
|
||||
for(int i = 3; i < 6; i++) if(recipe.outputItems.length > i) {
|
||||
Pair<ItemStack, Float> pair = recipe.outputItems[i];
|
||||
ItemStack out = pair.getKey().copy();
|
||||
@ -78,7 +84,13 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
outputs.add(new PositionedStack(out, 102 + (i - 3) * 18, 42));
|
||||
}
|
||||
|
||||
if(recipe.pollutionMode) {
|
||||
this.pollutionType = recipe.pollutionType;
|
||||
this.pollutionAmount = recipe.pollutionAmount;
|
||||
}
|
||||
if(recipe.radiationMode) this.radiationAmount = recipe.radiationAmount;
|
||||
if(conf.fluxMode) this.flux = recipe.flux;
|
||||
if(conf.maxHeat>0 && recipe.heat>0) this.heat = recipe.heat;
|
||||
this.machine = new PositionedStack(new ItemStack(ModBlocks.custom_machine, 1, 100 + CustomMachineConfigJSON.niceList.indexOf(conf)), 75, 42);
|
||||
}
|
||||
|
||||
@ -111,14 +123,14 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
public String getGuiTexture() {
|
||||
return RefStrings.MODID + ":textures/gui/nei/gui_nei_custom.png";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
|
||||
if(outputId.equals("ntm_" + conf.unlocalizedName)) {
|
||||
|
||||
|
||||
List<CustomMachineRecipe> recipes = CustomMachineRecipes.recipes.get(conf.recipeKey);
|
||||
|
||||
|
||||
if(recipes != null) for(CustomMachineRecipe recipe : recipes) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
}
|
||||
@ -126,25 +138,25 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
|
||||
|
||||
List<CustomMachineRecipe> recipes = CustomMachineRecipes.recipes.get(conf.recipeKey);
|
||||
|
||||
|
||||
if(recipes != null) outer:for(CustomMachineRecipe recipe : recipes) {
|
||||
|
||||
|
||||
for(Pair<ItemStack, Float> stack : recipe.outputItems) {
|
||||
|
||||
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(stack.getKey(), result)) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(FluidStack fluid : recipe.outputFluids) {
|
||||
ItemStack drop = ItemFluidIcon.make(fluid);
|
||||
|
||||
|
||||
if(compareFluidStacks(result, drop)) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
continue outer;
|
||||
@ -152,28 +164,28 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
|
||||
|
||||
if(inputId.equals("ntm_" + conf.unlocalizedName)) {
|
||||
loadCraftingRecipes("ntm_" + conf.unlocalizedName, new Object[0]);
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
|
||||
List<CustomMachineRecipe> recipes = CustomMachineRecipes.recipes.get(conf.recipeKey);
|
||||
|
||||
if(recipes != null) outer:for(CustomMachineRecipe recipe : recipes) {
|
||||
|
||||
|
||||
for(AStack stack : recipe.inputItems) {
|
||||
|
||||
|
||||
List<ItemStack> stacks = stack.extractForNEI();
|
||||
|
||||
|
||||
for(ItemStack sta : stacks) {
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(ingredient, sta)) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
@ -181,10 +193,10 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(FluidStack fluid : recipe.inputFluids) {
|
||||
ItemStack drop = ItemFluidIcon.make(fluid);
|
||||
|
||||
|
||||
if(compareFluidStacks(ingredient, drop)) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
continue outer;
|
||||
@ -196,11 +208,32 @@ public class CustomMachineHandler extends TemplateRecipeHandler {
|
||||
public static boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
|
||||
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
if(this.conf == null) return;
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(65, 23, 36, 18), "ntm_" + conf.unlocalizedName));
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
}
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
RecipeSet Recipe = (RecipeSet) this.arecipes.get(recipe);
|
||||
int side = 83;
|
||||
if(Recipe.radiationAmount != 0){
|
||||
String radiation = "Radiation:" + Recipe.radiationAmount + "";
|
||||
GuiDraw.drawString(radiation, 160 - GuiDraw.fontRenderer.getStringWidth(radiation), 63, 0x08FF00);
|
||||
}
|
||||
if (Recipe.pollutionAmount != 0){
|
||||
String pollution = Recipe.pollutionType + ":" + Recipe.pollutionAmount + "";
|
||||
GuiDraw.drawString(pollution, 160 - GuiDraw.fontRenderer.getStringWidth(pollution), 75, 0x404040);
|
||||
}
|
||||
if(conf.fluxMode) {
|
||||
String flux = "Flux:" + Recipe.flux + "";
|
||||
GuiDraw.drawString(flux, side - GuiDraw.fontRenderer.getStringWidth(flux) / 2, 16, 0x08FF00);
|
||||
}
|
||||
if(conf.maxHeat>0 && Recipe.heat>0){
|
||||
String heat = "Heat:" + Recipe.heat + "";
|
||||
GuiDraw.drawString(heat, side - GuiDraw.fontRenderer.getStringWidth(heat) / 2, 8, 0xFF0000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,9 +10,10 @@ import java.util.UUID;
|
||||
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphid;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidDigger;
|
||||
import com.hbm.entity.mob.glyphid.EntityGlyphidScout;
|
||||
|
||||
import com.hbm.entity.mob.EntityGlyphidDigger;
|
||||
import com.hbm.entity.mob.EntityGlyphidScout;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
@ -332,7 +333,7 @@ public class PollutionHandler {
|
||||
PollutionData data = getPollutionData(world, (int) Math.floor(event.x), (int) Math.floor(event.y), (int) Math.floor(event.z));
|
||||
if(data == null) return;
|
||||
|
||||
if(living instanceof IMob) {
|
||||
if(living instanceof IMob && !(living instanceof EntityGlyphid)) {
|
||||
|
||||
if(data.pollution[PollutionType.SOOT.ordinal()] > RadiationConfig.buffMobThreshold) {
|
||||
if(living.getEntityAttribute(SharedMonsterAttributes.maxHealth) != null && living.getEntityAttribute(SharedMonsterAttributes.maxHealth).getModifier(maxHealth) == null) living.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier(maxHealth, "Soot Anger Health Increase", 1D, 1));
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.inventory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
@ -18,8 +19,9 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class FluidContainerRegistry {
|
||||
|
||||
//TODO: somehow incorporate hashmaps into this
|
||||
//TODO: continue incorporating hashmaps into this
|
||||
public static List<FluidContainer> allContainers = new ArrayList<FluidContainer>();
|
||||
private static HashMap<FluidType, List<FluidContainer>> containerMap = new HashMap<FluidType, List<FluidContainer>>();
|
||||
|
||||
public static void register() {
|
||||
FluidContainerRegistry.registerContainer(new FluidContainer(new ItemStack(Items.water_bucket), new ItemStack(Items.bucket), Fluids.WATER, 1000));
|
||||
@ -88,6 +90,35 @@ public class FluidContainerRegistry {
|
||||
public static void registerContainer(FluidContainer con) {
|
||||
allContainers.add(con);
|
||||
OreDictionary.registerOre(con.type.getDict(con.content), con.fullContainer);
|
||||
|
||||
if (!containerMap.containsKey(con.type))
|
||||
containerMap.put(con.type, new ArrayList<FluidContainer>());
|
||||
|
||||
List<FluidContainer> items = containerMap.get(con.type);
|
||||
items.add(con);
|
||||
}
|
||||
|
||||
public static List<FluidContainer> getContainers(FluidType type) {
|
||||
return containerMap.get(type);
|
||||
}
|
||||
|
||||
public static FluidContainer getContainer(FluidType type, ItemStack stack) {
|
||||
if(stack == null)
|
||||
return null;
|
||||
|
||||
ItemStack sta = stack.copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
if (!containerMap.containsKey(type))
|
||||
return null;
|
||||
|
||||
for (FluidContainer container : getContainers(type)) {
|
||||
if (ItemStack.areItemStacksEqual(container.emptyContainer, sta) && ItemStack.areItemStackTagsEqual(container.emptyContainer, sta)) {
|
||||
return container;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getFluidContent(ItemStack stack, FluidType type) {
|
||||
@ -97,11 +128,12 @@ public class FluidContainerRegistry {
|
||||
|
||||
ItemStack sta = stack.copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
if (!containerMap.containsKey(type))
|
||||
return 0;
|
||||
|
||||
for(FluidContainer container : allContainers) {
|
||||
if(container.type == type &&
|
||||
ItemStack.areItemStacksEqual(container.fullContainer, sta) &&
|
||||
ItemStack.areItemStackTagsEqual(container.fullContainer, sta))
|
||||
for(FluidContainer container : containerMap.get(type)) {
|
||||
if(ItemStack.areItemStacksEqual(container.fullContainer, sta) && ItemStack.areItemStackTagsEqual(container.fullContainer, sta))
|
||||
return container.content;
|
||||
}
|
||||
|
||||
@ -131,8 +163,11 @@ public class FluidContainerRegistry {
|
||||
ItemStack sta = stack.copy();
|
||||
sta.stackSize = 1;
|
||||
|
||||
for(FluidContainer container : allContainers) {
|
||||
if(ItemStack.areItemStacksEqual(container.emptyContainer, sta) && ItemStack.areItemStackTagsEqual(container.emptyContainer, sta) && container.type == type)
|
||||
if (!containerMap.containsKey(type))
|
||||
return null;
|
||||
|
||||
for(FluidContainer container : containerMap.get(type)) {
|
||||
if(ItemStack.areItemStacksEqual(container.emptyContainer, sta) && ItemStack.areItemStackTagsEqual(container.emptyContainer, sta))
|
||||
return container.fullContainer.copy();
|
||||
}
|
||||
|
||||
|
||||
@ -392,15 +392,15 @@ public class OreDictManager {
|
||||
EUPH .nugget(nugget_euphemium) .ingot(ingot_euphemium) .dust(powder_euphemium) .block(block_euphemium);
|
||||
DNT .nugget(nugget_dineutronium) .ingot(ingot_dineutronium) .dust(powder_dineutronium) .block(block_dineutronium);
|
||||
FIBER .ingot(ingot_fiberglass) .block(block_fiberglass);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.ASBESTOS), DictFrame.fromOne(stone_resource, EnumStoneType.ASBESTOS));
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.ASBESTOS), DictFrame.fromOne(stone_resource, EnumStoneType.ASBESTOS));
|
||||
OSMIRIDIUM .nugget(nugget_osmiridium) .ingot(ingot_osmiridium);
|
||||
|
||||
/*
|
||||
* DUST AND GEM ORES
|
||||
*/
|
||||
S .dust(sulfur) .block(block_sulfur) .ore(ore_sulfur, ore_nether_sulfur, basalt_sulfur, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.SULFUR), ore_meteor_sulfur, DictFrame.fromOne(stone_resource, EnumStoneType.SULFUR)) .oreNether(ore_nether_sulfur);
|
||||
S .dust(sulfur) .block(block_sulfur) .ore(ore_sulfur, ore_nether_sulfur, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.SULFUR), ore_meteor_sulfur, DictFrame.fromOne(stone_resource, EnumStoneType.SULFUR)) .oreNether(ore_nether_sulfur);
|
||||
KNO .dust(niter) .block(block_niter) .ore(ore_niter);
|
||||
F .dust(fluorite) .block(block_fluorite) .ore(ore_fluorite, basalt_fluorite, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.FLUORITE));
|
||||
F .dust(fluorite) .block(block_fluorite) .ore(ore_fluorite, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.FLUORITE));
|
||||
LIGNITE .gem(lignite) .dust(powder_lignite) .ore(ore_lignite);
|
||||
COALCOKE .gem(fromOne(coke, EnumCokeType.COAL)) .block(fromOne(block_coke, EnumCokeType.COAL));
|
||||
PETCOKE .gem(fromOne(coke, EnumCokeType.PETROLEUM)) .block(fromOne(block_coke, EnumCokeType.PETROLEUM));
|
||||
@ -410,7 +410,7 @@ public class OreDictManager {
|
||||
CHLOROCALCITE .dust(powder_chlorocalcite);
|
||||
MOLYSITE .dust(powder_molysite) .ore(DictFrame.fromOne(ore_basalt, EnumBasaltOreType.MOLYSITE));
|
||||
SODALITE .gem(gem_sodalite);
|
||||
VOLCANIC .gem(gem_volcanic) .ore(basalt_gem, DictFrame.fromOne(ore_basalt, EnumBasaltOreType.GEM));
|
||||
VOLCANIC .gem(gem_volcanic) .ore(DictFrame.fromOne(ore_basalt, EnumBasaltOreType.GEM));
|
||||
HEMATITE .ore(fromOne(stone_resource, EnumStoneType.HEMATITE));
|
||||
MALACHITE .ore(fromOne(stone_resource, EnumStoneType.MALACHITE));
|
||||
SLAG .block(block_slag);
|
||||
|
||||
@ -14,109 +14,93 @@ import net.minecraft.inventory.SlotCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerBook extends Container {
|
||||
|
||||
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2);
|
||||
public IInventory craftResult = new InventoryCraftResult();
|
||||
|
||||
public ContainerBook(InventoryPlayer inventory) {
|
||||
|
||||
this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 124, 35));
|
||||
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 2, 2);
|
||||
public IInventory craftResult = new InventoryCraftResult();
|
||||
|
||||
for (int l = 0; l < 2; ++l) {
|
||||
for (int i1 = 0; i1 < 2; ++i1) {
|
||||
this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 2, 30 + i1 * 36, 17 + l * 36));
|
||||
}
|
||||
}
|
||||
public ContainerBook(InventoryPlayer inventory) {
|
||||
|
||||
for(int l = 0; l < 3; ++l) {
|
||||
for (int i1 = 0; i1 < 9; ++i1) {
|
||||
this.addSlotToContainer(new Slot(inventory, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
|
||||
}
|
||||
}
|
||||
this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 124, 35));
|
||||
|
||||
for(int l = 0; l < 9; ++l) {
|
||||
this.addSlotToContainer(new Slot(inventory, l, 8 + l * 18, 142));
|
||||
}
|
||||
for(int l = 0; l < 2; ++l) {
|
||||
for(int i1 = 0; i1 < 2; ++i1) {
|
||||
this.addSlotToContainer(new Slot(this.craftMatrix, i1 + l * 2, 30 + i1 * 36, 17 + l * 36));
|
||||
}
|
||||
}
|
||||
|
||||
this.onCraftMatrixChanged(this.craftMatrix);
|
||||
}
|
||||
|
||||
public void onCraftMatrixChanged(IInventory inventory) {
|
||||
this.craftResult.setInventorySlotContents(0, MagicRecipes.getRecipe(this.craftMatrix));
|
||||
}
|
||||
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
for(int l = 0; l < 3; ++l) {
|
||||
for(int i1 = 0; i1 < 9; ++i1) {
|
||||
this.addSlotToContainer(new Slot(inventory, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
|
||||
}
|
||||
}
|
||||
|
||||
if (!player.worldObj.isRemote) {
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
|
||||
for(int l = 0; l < 9; ++l) {
|
||||
this.addSlotToContainer(new Slot(inventory, l, 8 + l * 18, 142));
|
||||
}
|
||||
|
||||
this.onCraftMatrixChanged(this.craftMatrix);
|
||||
}
|
||||
|
||||
public void onCraftMatrixChanged(IInventory inventory) {
|
||||
this.craftResult.setInventorySlotContents(0, MagicRecipes.getRecipe(this.craftMatrix));
|
||||
}
|
||||
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
|
||||
if(!player.worldObj.isRemote) {
|
||||
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i);
|
||||
|
||||
if(itemstack != null)
|
||||
player.dropPlayerItemWithRandomChoice(itemstack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itemstack != null)
|
||||
player.dropPlayerItemWithRandomChoice(itemstack, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_)
|
||||
{
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot)this.inventorySlots.get(p_82846_2_);
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int p_82846_2_) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(p_82846_2_);
|
||||
|
||||
if (slot != null && slot.getHasStack())
|
||||
{
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
if (p_82846_2_ == 0)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 10 - 5, 46 - 5, true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if(p_82846_2_ == 0) {
|
||||
if(!this.mergeItemStack(itemstack1, 10 - 5, 46 - 5, true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
}
|
||||
else if (p_82846_2_ >= 10 - 5 && p_82846_2_ < 37 - 5)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 37 - 5, 46 - 5, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (p_82846_2_ >= 37 - 5 && p_82846_2_ < 46 - 5)
|
||||
{
|
||||
if (!this.mergeItemStack(itemstack1, 10 - 5, 37 - 5, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(itemstack1, 10 - 5, 46 - 5, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
} else if(p_82846_2_ >= 10 - 5 && p_82846_2_ < 37 - 5) {
|
||||
if(!this.mergeItemStack(itemstack1, 37 - 5, 46 - 5, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(p_82846_2_ >= 37 - 5 && p_82846_2_ < 46 - 5) {
|
||||
if(!this.mergeItemStack(itemstack1, 10 - 5, 37 - 5, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(itemstack1, 10 - 5, 46 - 5, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == 0)
|
||||
{
|
||||
slot.putStack((ItemStack)null);
|
||||
}
|
||||
else
|
||||
{
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
if(itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if (itemstack1.stackSize == itemstack.stackSize)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
if(itemstack1.stackSize == itemstack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(p_82846_1_, itemstack1);
|
||||
}
|
||||
slot.onPickupFromSlot(p_82846_1_, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
@ -124,8 +108,7 @@ public class ContainerBook extends Container {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_94530_a(ItemStack stack, Slot slot) {
|
||||
return slot.inventory != this.craftResult && super.func_94530_a(stack, slot);
|
||||
}
|
||||
|
||||
public boolean func_94530_a(ItemStack stack, Slot slot) {
|
||||
return slot.inventory != this.craftResult && super.func_94530_a(stack, slot);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,79 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.inventory.SlotSmelting;
|
||||
import com.hbm.tileentity.machine.TileEntityFurnaceBrick;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
|
||||
public class ContainerFurnaceBrick extends Container {
|
||||
|
||||
private TileEntityFurnaceBrick furnace;
|
||||
|
||||
public ContainerFurnaceBrick(InventoryPlayer invPlayer, TileEntityFurnaceBrick tedf) {
|
||||
furnace = tedf;
|
||||
|
||||
//input
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 62, 35));
|
||||
//fuel
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 35, 17));
|
||||
//output
|
||||
this.addSlotToContainer(new SlotSmelting(invPlayer.player, tedf, 2, 116, 35));
|
||||
//ash
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 3, 35, 53));
|
||||
|
||||
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, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 3) {
|
||||
if(!this.mergeItemStack(var5, 4, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(!TileEntityFurnace.isItemFuel(var5)) {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, 1, false))
|
||||
return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 1, 2, false) && !this.mergeItemStack(var5, 0, 1, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return furnace.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.recipes.LemegetonRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.InventoryCraftResult;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.inventory.SlotCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerLemegeton extends Container {
|
||||
|
||||
public InventoryCrafting craftMatrix = new InventoryCrafting(this, 1, 1);
|
||||
public IInventory craftResult = new InventoryCraftResult();
|
||||
|
||||
public ContainerLemegeton(InventoryPlayer inventory) {
|
||||
|
||||
this.addSlotToContainer(new SlotCrafting(inventory.player, this.craftMatrix, this.craftResult, 0, 107, 35));
|
||||
this.addSlotToContainer(new Slot(this.craftMatrix, 0, 49, 35));
|
||||
|
||||
for(int l = 0; l < 3; ++l) {
|
||||
for(int i1 = 0; i1 < 9; ++i1) {
|
||||
this.addSlotToContainer(new Slot(inventory, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int l = 0; l < 9; ++l) {
|
||||
this.addSlotToContainer(new Slot(inventory, l, 8 + l * 18, 142));
|
||||
}
|
||||
|
||||
this.onCraftMatrixChanged(this.craftMatrix);
|
||||
}
|
||||
|
||||
public void onCraftMatrixChanged(IInventory inventory) {
|
||||
this.craftResult.setInventorySlotContents(0, LemegetonRecipes.getRecipe(this.craftMatrix.getStackInSlot(0)));
|
||||
}
|
||||
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
|
||||
if(!player.worldObj.isRemote) {
|
||||
ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(0);
|
||||
if(itemstack != null) player.dropPlayerItemWithRandomChoice(itemstack, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int slotNo) {
|
||||
ItemStack itemstack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(slotNo);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack itemstack1 = slot.getStack();
|
||||
itemstack = itemstack1.copy();
|
||||
|
||||
if(slotNo <= 1) {
|
||||
if(!this.mergeItemStack(itemstack1, 2, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(itemstack1, itemstack);
|
||||
} else if(!this.mergeItemStack(itemstack1, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(itemstack1.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
if(itemstack1.stackSize == itemstack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(p_82846_1_, itemstack1);
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return player.inventory.hasItem(ModItems.book_lemegeton);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_94530_a(ItemStack stack, Slot slot) {
|
||||
return slot.inventory != this.craftResult && super.func_94530_a(stack, slot);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,107 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotTakeOnly;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineHydrotreater;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineHydrotreater extends Container {
|
||||
|
||||
private TileEntityMachineHydrotreater hydrotreater;
|
||||
|
||||
public ContainerMachineHydrotreater(InventoryPlayer invPlayer, TileEntityMachineHydrotreater tedf) {
|
||||
|
||||
hydrotreater = tedf;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 17, 90));
|
||||
//Canister Input
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 35, 90));
|
||||
//Canister Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 2, 35, 108));
|
||||
//Hydrogen Input
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 53, 90));
|
||||
//Hydrogen Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 4, 53, 108));
|
||||
//Desulfated Oil Input
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 125, 90));
|
||||
//Desulfated Oil Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 6, 125, 108));
|
||||
//Sour Gas Input
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 143, 90));
|
||||
//Sour Gas Oil Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 8, 143, 108));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 17, 108));
|
||||
//Catalyst
|
||||
this.addSlotToContainer(new Slot(tedf, 10, 89, 36));
|
||||
|
||||
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, 156 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 214));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 10) {
|
||||
if(!this.mergeItemStack(var5, 11, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(var3.getItem() instanceof IBatteryItem) {
|
||||
if(!this.mergeItemStack(var5, 0, 1, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(var3.getItem() instanceof IItemFluidIdentifier) {
|
||||
if(!this.mergeItemStack(var5, 9, 10, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(var3.getItem() == ModItems.catalytic_converter) {
|
||||
if(!this.mergeItemStack(var5, 10, 11, false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 1, 2, false))
|
||||
if(!this.mergeItemStack(var5, 3, 4, false))
|
||||
if(!this.mergeItemStack(var5, 5, 6, false))
|
||||
if(!this.mergeItemStack(var5, 7, 8, false))
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return hydrotreater.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,7 @@ public class ContainerMachineRefinery extends Container {
|
||||
public ContainerMachineRefinery(InventoryPlayer invPlayer, TileEntityMachineRefinery tedf) {
|
||||
|
||||
testNuke = tedf;
|
||||
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 90));
|
||||
//Canister Input
|
||||
@ -42,17 +42,16 @@ public class ContainerMachineRefinery extends Container {
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 134, 108));
|
||||
//Sulfur Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 11, 152, 36));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 12, 8, 108));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
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, 84 + i * 18 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
@ -71,8 +70,8 @@ public class ContainerMachineRefinery extends Container {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= 11) {
|
||||
if(!this.mergeItemStack(var5, 12, this.inventorySlots.size(), true)) {
|
||||
if(par2 <= 12) {
|
||||
if(!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!this.mergeItemStack(var5, 0, 1, false))
|
||||
|
||||
@ -40,6 +40,8 @@ public class ContainerMachineVacuumDistill extends Container {
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 134, 90));
|
||||
//Petroleum Output
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 10, 134, 108));
|
||||
//Fluid ID
|
||||
this.addSlotToContainer(new Slot(tedf, 11, 26, 108));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
|
||||
@ -46,8 +46,12 @@ public class Fluids {
|
||||
public static FluidType OIL;
|
||||
public static FluidType CRACKOIL;
|
||||
public static FluidType COALOIL;
|
||||
public static FluidType OIL_DS;
|
||||
public static FluidType CRACKOIL_DS;
|
||||
public static FluidType HOTOIL;
|
||||
public static FluidType HOTCRACKOIL;
|
||||
public static FluidType HOTOIL_DS;
|
||||
public static FluidType HOTCRACKOIL_DS;
|
||||
public static FluidType HEAVYOIL;
|
||||
public static FluidType BITUMEN;
|
||||
public static FluidType SMEAR;
|
||||
@ -56,10 +60,12 @@ public class Fluids {
|
||||
public static FluidType LUBRICANT;
|
||||
public static FluidType NAPHTHA;
|
||||
public static FluidType NAPHTHA_CRACK;
|
||||
public static FluidType NAPHTHA_DS;
|
||||
public static FluidType DIESEL;
|
||||
public static FluidType DIESEL_CRACK;
|
||||
public static FluidType LIGHTOIL;
|
||||
public static FluidType LIGHTOIL_CRACK;
|
||||
public static FluidType LIGHTOIL_DS;
|
||||
public static FluidType KEROSENE;
|
||||
public static FluidType GAS;
|
||||
public static FluidType PETROLEUM;
|
||||
@ -118,7 +124,6 @@ public class Fluids {
|
||||
public static FluidType SOLVENT; //oranic solvent in fact
|
||||
public static FluidType BLOOD; //BLOOD ORB! BLOOD ORB! BLOOD ORB!
|
||||
public static FluidType BLOOD_HOT;
|
||||
|
||||
public static FluidType PHEROMONE;
|
||||
public static FluidType PHEROMONE_M;
|
||||
public static FluidType SYNGAS;
|
||||
@ -185,6 +190,7 @@ public class Fluids {
|
||||
public static final FT_NoID NOID = new FT_NoID();
|
||||
public static final FT_Delicious DELICIOUS = new FT_Delicious();
|
||||
public static final FT_Leaded LEADED = new FT_Leaded();
|
||||
public static final FT_Unsiphonable UNSIPHONABLE = new FT_Unsiphonable();
|
||||
|
||||
public static void init() {
|
||||
|
||||
@ -202,11 +208,11 @@ public class Fluids {
|
||||
*/
|
||||
|
||||
NONE = new FluidType("NONE", 0x888888, 0, 0, 0, EnumSymbol.NONE);
|
||||
WATER = new FluidType("WATER", 0x3333FF, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
STEAM = new FluidType("STEAM", 0xe5e5e5, 3, 0, 0, EnumSymbol.NONE).setTemp(100).addTraits(GASEOUS);
|
||||
HOTSTEAM = new FluidType("HOTSTEAM", 0xE7D6D6, 4, 0, 0, EnumSymbol.NONE).setTemp(300).addTraits(GASEOUS);
|
||||
SUPERHOTSTEAM = new FluidType("SUPERHOTSTEAM", 0xE7B7B7, 4, 0, 0, EnumSymbol.NONE).setTemp(450).addTraits(GASEOUS);
|
||||
ULTRAHOTSTEAM = new FluidType("ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600).addTraits(GASEOUS);
|
||||
WATER = new FluidType("WATER", 0x3333FF, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, UNSIPHONABLE);
|
||||
STEAM = new FluidType("STEAM", 0xe5e5e5, 3, 0, 0, EnumSymbol.NONE).setTemp(100).addTraits(GASEOUS, UNSIPHONABLE);
|
||||
HOTSTEAM = new FluidType("HOTSTEAM", 0xE7D6D6, 4, 0, 0, EnumSymbol.NONE).setTemp(300).addTraits(GASEOUS, UNSIPHONABLE);
|
||||
SUPERHOTSTEAM = new FluidType("SUPERHOTSTEAM", 0xE7B7B7, 4, 0, 0, EnumSymbol.NONE).setTemp(450).addTraits(GASEOUS, UNSIPHONABLE);
|
||||
ULTRAHOTSTEAM = new FluidType("ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600).addTraits(GASEOUS, UNSIPHONABLE);
|
||||
COOLANT = new FluidType("COOLANT", 0xd8fcff, 1, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
LAVA = new FluidType("LAVA", 0xFF3300, 4, 0, 0, EnumSymbol.NOWATER).setTemp(1200).addTraits(LIQUID, VISCOUS);
|
||||
DEUTERIUM = new FluidType("DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE).addTraits(new FT_Flammable(5_000), new FT_Combustible(FuelGrade.HIGH, 10_000), GASEOUS);
|
||||
@ -334,6 +340,13 @@ public class Fluids {
|
||||
FULLERENE = new FluidType("FULLERENE", 0xFF7FED, 3, 3, 3, EnumSymbol.NONE).addTraits(LIQUID, new FT_Corrosive(65));
|
||||
PHEROMONE = new FluidType("PHEROMONE", 0x5FA6E8, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, new FT_Pheromone(1));
|
||||
PHEROMONE_M = new FluidType(132, "PHEROMONE_M", 0x48C9B0 , 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, new FT_Pheromone(2));
|
||||
OIL_DS = new FluidType("OIL_DS", 0x020202, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
HOTOIL_DS = new FluidType("HOTOIL_DS", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS);
|
||||
CRACKOIL_DS = new FluidType("CRACKOIL_DS", 0x020202, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
HOTCRACKOIL_DS = new FluidType("HOTCRACKOIL_DS", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS);
|
||||
NAPHTHA_DS = new FluidType("NAPHTHA_DS", 0x595744, 2, 1, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
LIGHTOIL_DS = new FluidType("LIGHTOIL_DS", 0x8c7451, 1, 2, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
|
||||
// ^ ^ ^ ^ ^ ^ ^ ^
|
||||
//ADD NEW FLUIDS HERE
|
||||
|
||||
@ -384,18 +397,24 @@ public class Fluids {
|
||||
metaOrder.add(MERCURY);
|
||||
//oils, fuels
|
||||
metaOrder.add(OIL);
|
||||
metaOrder.add(OIL_DS);
|
||||
metaOrder.add(CRACKOIL);
|
||||
metaOrder.add(CRACKOIL_DS);
|
||||
metaOrder.add(COALOIL);
|
||||
metaOrder.add(OIL_COKER);
|
||||
metaOrder.add(HOTOIL);
|
||||
metaOrder.add(HOTOIL_DS);
|
||||
metaOrder.add(HOTCRACKOIL);
|
||||
metaOrder.add(HOTCRACKOIL_DS);
|
||||
metaOrder.add(HEAVYOIL);
|
||||
metaOrder.add(HEAVYOIL_VACUUM);
|
||||
metaOrder.add(NAPHTHA);
|
||||
metaOrder.add(NAPHTHA_DS);
|
||||
metaOrder.add(NAPHTHA_CRACK);
|
||||
metaOrder.add(NAPHTHA_COKER);
|
||||
metaOrder.add(REFORMATE);
|
||||
metaOrder.add(LIGHTOIL);
|
||||
metaOrder.add(LIGHTOIL_DS);
|
||||
metaOrder.add(LIGHTOIL_CRACK);
|
||||
metaOrder.add(LIGHTOIL_VACUUM);
|
||||
metaOrder.add(BITUMEN);
|
||||
|
||||
@ -20,8 +20,6 @@ public class FluidLoaderStandard extends FluidLoadingHandler {
|
||||
|
||||
if(full != null && slots[in] != null && tank.getFill() - FluidContainerRegistry.getFluidContent(full, type) >= 0) {
|
||||
|
||||
ItemStack fullContainer = FluidContainerRegistry.getFullContainer(slots[in], type);
|
||||
|
||||
if(slots[out] == null) {
|
||||
|
||||
tank.setFill(tank.getFill() - FluidContainerRegistry.getFluidContent(full, type));
|
||||
@ -31,7 +29,7 @@ public class FluidLoaderStandard extends FluidLoadingHandler {
|
||||
slots[in] = null;
|
||||
}
|
||||
|
||||
} else if(slots[out] != null && slots[out].getItem() == fullContainer.getItem() && slots[out].getItemDamage() == fullContainer.getItemDamage() && slots[out].stackSize < slots[out].getMaxStackSize()) {
|
||||
} else if(slots[out] != null && slots[out].getItem() == full.getItem() && slots[out].getItemDamage() == full.getItemDamage() && slots[out].stackSize < slots[out].getMaxStackSize()) {
|
||||
|
||||
tank.setFill(tank.getFill() - FluidContainerRegistry.getFluidContent(full, type));
|
||||
slots[in].stackSize--;
|
||||
|
||||
@ -15,6 +15,7 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEFluidPacket;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.Item;
|
||||
@ -26,8 +27,8 @@ import net.minecraft.util.MathHelper;
|
||||
|
||||
public class FluidTank {
|
||||
|
||||
public static final List<FluidLoadingHandler> loadingHandlers = new ArrayList();
|
||||
public static final Set<Item> noDualUnload = new HashSet();
|
||||
public static final List<FluidLoadingHandler> loadingHandlers = new ArrayList<FluidLoadingHandler>();
|
||||
public static final Set<Item> noDualUnload = new HashSet<Item>();
|
||||
|
||||
static {
|
||||
loadingHandlers.add(new FluidLoaderStandard());
|
||||
@ -300,5 +301,18 @@ public class FluidTank {
|
||||
|
||||
this.pressure = nbt.getShort(s + "_p");
|
||||
}
|
||||
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeInt(fluid);
|
||||
buf.writeInt(maxFluid);
|
||||
buf.writeInt(type.getID());
|
||||
buf.writeShort((short) pressure);
|
||||
}
|
||||
|
||||
public void deserialize(ByteBuf buf) {
|
||||
fluid = buf.readInt();
|
||||
maxFluid = buf.readInt();
|
||||
type = Fluids.fromID(buf.readInt());
|
||||
pressure = buf.readShort();
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,6 +38,7 @@ public abstract class FluidTrait {
|
||||
traitNameMap.put("pheromone", FT_Pheromone.class);
|
||||
traitNameMap.put("noid", FT_NoID.class);
|
||||
traitNameMap.put("nocontainer", FT_NoContainer.class);
|
||||
traitNameMap.put("unsiphonable", FT_Unsiphonable.class);
|
||||
}
|
||||
|
||||
/** Important information that should always be displayed */
|
||||
|
||||
@ -62,6 +62,12 @@ public class FluidTraitSimple {
|
||||
}
|
||||
}
|
||||
|
||||
public static class FT_Unsiphonable extends FluidTrait {
|
||||
@Override public void addInfoHidden(List<String> info) {
|
||||
info.add(EnumChatFormatting.BLUE + "[Ignored by siphon]");
|
||||
}
|
||||
}
|
||||
|
||||
public static class FT_NoID extends FluidTrait { }
|
||||
public static class FT_NoContainer extends FluidTrait { }
|
||||
}
|
||||
|
||||
@ -44,6 +44,7 @@ public class GUIAnvil extends GuiContainer {
|
||||
int size;
|
||||
int selection;
|
||||
private GuiTextField search;
|
||||
private InventoryPlayer playerInventory;
|
||||
|
||||
public GUIAnvil(InventoryPlayer player, int tier) {
|
||||
super(new ContainerAnvil(player, tier));
|
||||
@ -51,7 +52,8 @@ public class GUIAnvil extends GuiContainer {
|
||||
this.tier = tier;
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
|
||||
|
||||
this.playerInventory = player;
|
||||
for(AnvilConstructionRecipe recipe : AnvilRecipes.getConstruction()) {
|
||||
if(recipe.isTierValid(this.tier))
|
||||
this.originList.add(recipe);
|
||||
@ -243,7 +245,7 @@ public class GUIAnvil extends GuiContainer {
|
||||
if(this.selection >= 0) {
|
||||
|
||||
AnvilConstructionRecipe recipe = recipes.get(this.selection);
|
||||
List<String> list = recipeToList(recipe);
|
||||
List<String> list = recipeToList(recipe, playerInventory);
|
||||
int longest = 0;
|
||||
|
||||
for(String s : list) {
|
||||
@ -274,25 +276,55 @@ public class GUIAnvil extends GuiContainer {
|
||||
* @param recipe
|
||||
* @return
|
||||
*/
|
||||
public List<String> recipeToList(AnvilConstructionRecipe recipe) {
|
||||
public List<String> recipeToList(AnvilConstructionRecipe recipe, InventoryPlayer inventory) {
|
||||
|
||||
List<String> list = new ArrayList();
|
||||
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + "Inputs:");
|
||||
|
||||
|
||||
for(AStack stack : recipe.input) {
|
||||
if(stack instanceof ComparableStack) {
|
||||
if(stack instanceof ComparableStack) {
|
||||
ItemStack input = ((ComparableStack) stack).toStack();
|
||||
list.add(">" + input.stackSize + "x " + input.getDisplayName());
|
||||
|
||||
boolean hasItem = false;
|
||||
int amount = 0;
|
||||
for(int i = 0; i < inventory.mainInventory.length; i++) {
|
||||
ItemStack stackItem = inventory.mainInventory[i];
|
||||
if(stackItem == null) {
|
||||
continue;
|
||||
}
|
||||
if(stackItem.getItem() == input.getItem() && input.getItemDamage() == stackItem.getItemDamage()) {
|
||||
hasItem = true;
|
||||
amount += stackItem.stackSize;
|
||||
}
|
||||
}
|
||||
if(hasItem && amount >= stack.stacksize) {
|
||||
list.add(">" + input.stackSize + "x " + input.getDisplayName());
|
||||
} else {
|
||||
list.add(EnumChatFormatting.RED + ">" + input.stackSize + "x " + input.getDisplayName());
|
||||
}
|
||||
} else if(stack instanceof OreDictStack) {
|
||||
OreDictStack input = (OreDictStack) stack;
|
||||
ArrayList<ItemStack> ores = OreDictionary.getOres(input.name);
|
||||
|
||||
|
||||
if(ores.size() > 0) {
|
||||
boolean hasItem = false;
|
||||
int amount = 0;
|
||||
for(int i = 0; i < inventory.mainInventory.length; i++) {
|
||||
ItemStack stackItem = inventory.mainInventory[i];
|
||||
if(stackItem == null) {
|
||||
continue;
|
||||
}
|
||||
if(input.matchesRecipe(stackItem, true)) {
|
||||
hasItem = true;
|
||||
amount += stackItem.stackSize;
|
||||
}
|
||||
}
|
||||
ItemStack inStack = ores.get((int) (Math.abs(System.currentTimeMillis() / 1000) % ores.size()));
|
||||
list.add(">" + input.stacksize + "x " + inStack.getDisplayName());
|
||||
|
||||
if(hasItem && amount >= stack.stacksize) {
|
||||
list.add(">" + input.stacksize + "x " + inStack.getDisplayName());
|
||||
} else {
|
||||
list.add(EnumChatFormatting.RED + ">" + input.stacksize + "x " + inStack.getDisplayName());
|
||||
}
|
||||
} else {
|
||||
list.add("I AM ERROR");
|
||||
}
|
||||
@ -301,11 +333,11 @@ public class GUIAnvil extends GuiContainer {
|
||||
|
||||
list.add("");
|
||||
list.add(EnumChatFormatting.YELLOW + "Outputs:");
|
||||
|
||||
|
||||
for(AnvilOutput stack : recipe.output) {
|
||||
list.add(">" + stack.stack.stackSize + "x " + stack.stack.getDisplayName() + (stack.chance != 1F ? (" (" + (stack.chance * 100) + "%)" ) : ""));
|
||||
list.add(">" + stack.stack.stackSize + "x " + stack.stack.getDisplayName() + (stack.chance != 1F ? (" (" + (stack.chance * 100) + "%)") : ""));
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@ -16,6 +16,8 @@ public class GUIBook extends GuiContainer {
|
||||
|
||||
public GUIBook(InventoryPlayer player) {
|
||||
super(new ContainerBook(player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int mX, int mY) {
|
||||
@ -25,7 +27,6 @@ public class GUIBook extends GuiContainer {
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float inter, int mX, int mY) {
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int left = (this.width - this.xSize) / 2;
|
||||
|
||||
44
src/main/java/com/hbm/inventory/gui/GUIFurnaceBrick.java
Normal file
44
src/main/java/com/hbm/inventory/gui/GUIFurnaceBrick.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerFurnaceBrick;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityFurnaceBrick;
|
||||
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIFurnaceBrick extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_furnace_brick.png");
|
||||
private TileEntityFurnaceBrick furnace;
|
||||
|
||||
public GUIFurnaceBrick(InventoryPlayer invPlayer, TileEntityFurnaceBrick tile) {
|
||||
super(new ContainerFurnaceBrick(invPlayer, tile));
|
||||
this.furnace = tile;
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
|
||||
String name = this.furnace.hasCustomInventoryName() ? this.furnace.getInventoryName() : I18n.format(this.furnace.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xffffff);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 0xffffff);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if(furnace.isInvalid() && furnace.getWorldObj().getTileEntity(furnace.xCoord, furnace.yCoord, furnace.zCoord) instanceof TileEntityFurnaceBrick)
|
||||
furnace = (TileEntityFurnaceBrick) furnace.getWorldObj().getTileEntity(furnace.xCoord, furnace.yCoord, furnace.zCoord);
|
||||
|
||||
if(this.furnace.burnTime > 0) {
|
||||
int b = furnace.burnTime * 13 / furnace.maxBurnTime;
|
||||
this.drawTexturedModalRect(guiLeft + 62, guiTop + 54 + 12 - b, 176, 12 - b, 14, b + 1);
|
||||
int p = this.furnace.progress * 24 / 200;
|
||||
this.drawTexturedModalRect(guiLeft + 85, guiTop + 34, 176, 14, p + 1, 16);
|
||||
}
|
||||
}
|
||||
}
|
||||
40
src/main/java/com/hbm/inventory/gui/GUILemegeton.java
Normal file
40
src/main/java/com/hbm/inventory/gui/GUILemegeton.java
Normal file
@ -0,0 +1,40 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerLemegeton;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUILemegeton extends GuiContainer {
|
||||
|
||||
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_lemegeton.png");
|
||||
|
||||
public GUILemegeton(InventoryPlayer player) {
|
||||
super(new ContainerLemegeton(player));
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int mX, int mY) {
|
||||
|
||||
Minecraft.getMinecraft().standardGalacticFontRenderer.drawString("Material Upgrade Conversion", 28, 6, 4210752);
|
||||
Minecraft.getMinecraft().standardGalacticFontRenderer.drawString("Standard Inventory", 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float inter, int mX, int mY) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
int left = (this.width - this.xSize) / 2;
|
||||
int top = (this.height - this.ySize) / 2;
|
||||
|
||||
this.drawTexturedModalRect(left, top, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if(this.inventorySlots.getSlot(0).getHasStack())
|
||||
this.drawTexturedModalRect(left + 7, top + 22, 0, 166, 162, 42);
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,19 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineCatalyticReformer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticReformer;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineCatalyticReformer extends GuiInfoContainer {
|
||||
@ -33,6 +38,14 @@ public class GUIMachineCatalyticReformer extends GuiInfoContainer {
|
||||
refinery.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 125, guiTop + 70 - 52, 16, 52);
|
||||
refinery.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 143, guiTop + 70 - 52, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 17, guiTop + 70 - 52, 16, 52, refinery.power, refinery.maxPower);
|
||||
|
||||
if(this.mc.thePlayer.inventory.getItemStack() == null && this.isMouseOverSlot(this.inventorySlots.getSlot(10), mouseX, mouseY) && !this.inventorySlots.getSlot(10).getHasStack()) {
|
||||
List<Object[]> lines = new ArrayList();
|
||||
ItemStack converter = new ItemStack(ModItems.catalytic_converter);
|
||||
lines.add(new Object[] {converter});
|
||||
lines.add(new Object[] {converter.getDisplayName()});
|
||||
this.drawStackText(lines, mouseX, mouseY, this.fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.render.util.GaugeUtil;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.SlotPattern;
|
||||
@ -17,58 +19,59 @@ import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineCustom extends GuiInfoContainer {
|
||||
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_custom.png");
|
||||
private TileEntityCustomMachine custom;
|
||||
|
||||
public GUIMachineCustom(InventoryPlayer invPlayer, TileEntityCustomMachine tedf) {
|
||||
super(new ContainerMachineCustom(invPlayer, tedf));
|
||||
custom = tedf;
|
||||
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 256;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float interp) {
|
||||
super.drawScreen(x, y, interp);
|
||||
|
||||
this.drawElectricityInfo(this, x, y, guiLeft + 150, guiTop + 18, 16, 52, custom.power, custom.config.maxPower);
|
||||
|
||||
this.drawElectricityInfo(this, x, y, guiLeft + 150, guiTop + 18, 16, 52, custom.power, custom.config.maxPower);
|
||||
if(custom.config.maxHeat>0) this.drawCustomInfoStat(x, y, guiLeft + 61, guiTop + 53, 18, 18, x, y, new String[] { "Heat:" + String.format(Locale.US, "%,d", custom.heat) + " / " + String.format(Locale.US, "%,d", custom.config.maxHeat)});
|
||||
if(this.mc.thePlayer.inventory.getItemStack() == null) {
|
||||
for(int i = 0; i < this.inventorySlots.inventorySlots.size(); ++i) {
|
||||
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(i);
|
||||
int tileIndex = slot.getSlotIndex();
|
||||
|
||||
|
||||
if(this.isMouseOverSlot(slot, x, y) && slot instanceof SlotPattern && custom.matcher.modes[tileIndex - 10] != null) {
|
||||
|
||||
|
||||
String label = EnumChatFormatting.YELLOW + "";
|
||||
|
||||
|
||||
switch(custom.matcher.modes[tileIndex - 10]) {
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + custom.matcher.modes[tileIndex - 10]; break;
|
||||
case "exact": label += "Item and meta match"; break;
|
||||
case "wildcard": label += "Item matches"; break;
|
||||
default: label += "Ore dict key matches: " + custom.matcher.modes[tileIndex - 10]; break;
|
||||
}
|
||||
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { EnumChatFormatting.RED + "Right click to change", label }), x, y - 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < custom.inputTanks.length; i++) {
|
||||
custom.inputTanks[i].renderTankInfo(this, x, y, guiLeft + 8 + 18 * i, guiTop + 18, 16, 34);
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < custom.outputTanks.length; i++) {
|
||||
custom.outputTanks[i].renderTankInfo(this, x, y, guiLeft + 78 + 18 * i, guiTop + 18, 16, 34);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.custom.getInventoryName();
|
||||
this.fontRendererObj.drawString(name, 68 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
if(custom.config.fluxMode) this.fontRendererObj.drawString("Flux:" + custom.flux,83, 57,0x08FF00);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -76,17 +79,23 @@ public class GUIMachineCustom extends GuiInfoContainer {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
if(custom.config.fluxMode){
|
||||
drawTexturedModalRect(guiLeft + 78, guiTop + 54, 192, 122,51 , 15);
|
||||
}
|
||||
if(custom.maxHeat>0) {
|
||||
drawTexturedModalRect(guiLeft + 61, guiTop + 53, 236,0 , 18, 18);
|
||||
GaugeUtil.drawSmoothGauge(guiLeft + 70, guiTop + 62, this.zLevel, (double) custom.heat / (double) custom.config.maxHeat, 5, 2, 1, 0x7F0000);
|
||||
}
|
||||
int p = custom.progress * 90 / custom.maxProgress;
|
||||
drawTexturedModalRect(guiLeft + 78, guiTop + 119, 192, 0, Math.min(p, 44), 16);
|
||||
if(p > 44) {
|
||||
p-= 44;
|
||||
drawTexturedModalRect(guiLeft + 78 + 44, guiTop + 119, 192, 16, p, 16);
|
||||
}
|
||||
|
||||
|
||||
int e = (int) (custom.power * 52 / custom.config.maxPower);
|
||||
drawTexturedModalRect(guiLeft + 150, guiTop + 70 - e, 176, 52 - e, 16, e);
|
||||
|
||||
|
||||
for(int i = 0; i < 2; i++) {
|
||||
for(int j = 0; j < 3; j++) {
|
||||
int index = i * 3 + j;
|
||||
@ -99,7 +108,7 @@ public class GUIMachineCustom extends GuiInfoContainer {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
if(custom.config.fluidInCount <= i) {
|
||||
drawTexturedModalRect(guiLeft + 7 + i * 18, guiTop + 17, 192 + i * 18, 32, 18, 54);
|
||||
@ -108,11 +117,11 @@ public class GUIMachineCustom extends GuiInfoContainer {
|
||||
drawTexturedModalRect(guiLeft + 77 + i * 18, guiTop + 17, 192 + i * 18, 32, 18, 36);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < custom.inputTanks.length; i++) {
|
||||
custom.inputTanks[i].renderTank(guiLeft + 8 + 18 * i, guiTop + 52, this.zLevel, 16, 34);
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < custom.outputTanks.length; i++) {
|
||||
custom.outputTanks[i].renderTank(guiLeft + 78 + 18 * i, guiTop + 52, this.zLevel, 16, 34);
|
||||
}
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineHydrotreater;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineHydrotreater;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineHydrotreater extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_hydrotreater.png");
|
||||
private TileEntityMachineHydrotreater refinery;
|
||||
|
||||
public GUIMachineHydrotreater(InventoryPlayer invPlayer, TileEntityMachineHydrotreater tedf) {
|
||||
super(new ContainerMachineHydrotreater(invPlayer, tedf));
|
||||
refinery = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 238;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
refinery.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 35, guiTop + 70 - 52, 16, 52);
|
||||
refinery.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 53, guiTop + 70 - 52, 16, 52);
|
||||
refinery.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 125, guiTop + 70 - 52, 16, 52);
|
||||
refinery.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 143, guiTop + 70 - 52, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 17, guiTop + 70 - 52, 16, 52, refinery.power, refinery.maxPower);
|
||||
|
||||
if(this.mc.thePlayer.inventory.getItemStack() == null && this.isMouseOverSlot(this.inventorySlots.getSlot(10), mouseX, mouseY) && !this.inventorySlots.getSlot(10).getHasStack()) {
|
||||
List<Object[]> lines = new ArrayList();
|
||||
ItemStack converter = new ItemStack(ModItems.catalytic_converter);
|
||||
lines.add(new Object[] {converter});
|
||||
lines.add(new Object[] {converter.getDisplayName()});
|
||||
this.drawStackText(lines, mouseX, mouseY, this.fontRendererObj);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.refinery.hasCustomInventoryName() ? this.refinery.getInventoryName() : I18n.format(this.refinery.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 5, 0xffffff);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int j = (int) (refinery.power * 54 / refinery.maxPower);
|
||||
drawTexturedModalRect(guiLeft + 17, guiTop + 70 - j, 176, 52 - j, 16, j);
|
||||
|
||||
refinery.tanks[0].renderTank(guiLeft + 35, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[1].renderTank(guiLeft + 53, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[2].renderTank(guiLeft + 125, guiTop + 70, this.zLevel, 16, 52);
|
||||
refinery.tanks[3].renderTank(guiLeft + 143, guiTop + 70, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
@ -5,15 +5,11 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.hbm.inventory.container.ContainerMachineRefinery;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.NBTControlPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineRefinery;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
@ -40,18 +36,6 @@ public class GUIMachineRefinery extends GuiInfoContainer {
|
||||
refinery.tanks[4].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 70 - 52, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 70 - 52, 16, 52, refinery.power, refinery.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 64 <= x && guiLeft + 76 > x && guiTop + 20 < y && guiTop + 46 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("toggle", true); //we only need to send one bit, so boolean it is
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, refinery.xCoord, refinery.yCoord, refinery.zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
|
||||
@ -186,6 +186,7 @@ public class GUIScreenTemplateFolder extends GuiScreen {
|
||||
this.search.setDisabledTextColour(0xffffff);
|
||||
this.search.setEnableBackgroundDrawing(false);
|
||||
this.search.setMaxStringLength(100);
|
||||
this.search.setFocused(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -277,13 +277,13 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_schrabidium_battery, 1), new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack(NP237.dust(), 12), new OreDictStack(SA326.dust(), 12), new OreDictStack(SA326.ingot(), 2), new ComparableStack(ModItems.wire_schrabidium, 4), },800);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_dineutronium_battery, 1), new AStack[] {new OreDictStack(DNT.ingot(), 24), new ComparableStack(ModItems.powder_spark_mix, 12), new ComparableStack(ModItems.battery_spark_cell_1000, 1), new OreDictStack(CMB.ingot(), 32), new ComparableStack(ModItems.coil_magnetized_tungsten, 8), },1600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_shredder, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 8), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModBlocks.steel_beam, 2), new ComparableStack(Blocks.iron_bars, 2) },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_well, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 20), new ComparableStack(ModBlocks.steel_beam, 8), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.pipes_steel, 3), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.wire_red_copper, 6), },250);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_pumpjack, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 8), new OreDictStack(STEEL.plateWelded(), 8), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.tank_steel, 4), new OreDictStack(STEEL.plate(), 32), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.motor, 2) }, 400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_well, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 20), new ComparableStack(ModBlocks.steel_beam, 8), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.pipes_steel, 1), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.wire_red_copper, 6), },250);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_pumpjack, 1), new AStack[] {new ComparableStack(ModBlocks.steel_scaffold, 8), new OreDictStack(STEEL.plateWelded(), 8), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.tank_steel, 4), new OreDictStack(STEEL.plate(), 32), new ComparableStack(ModItems.drill_titanium, 1), new ComparableStack(ModItems.motor_desh) }, 400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_flare, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(IRON.ingot(), 12), new OreDictStack(CU.plate528(), 4), new ComparableStack(ModItems.tank_steel, 1), new ComparableStack(ModBlocks.deco_pipe_quad, 8), new ComparableStack(ModItems.hull_small_steel, 4), new ComparableStack(ModItems.thermo_element, 3), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_coker, 1), new AStack[] {!exp ? new OreDictStack(STEEL.plateWelded(), 3) : new OreDictStack(STEEL.heavyComp(), 2), new OreDictStack(IRON.ingot(), 16), new OreDictStack(CU.plate528(), 8), new OreDictStack(RUBBER.ingot(), 4), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.steel_grate, 4) },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_refinery, 1), new AStack[] {!exp ? new OreDictStack(STEEL.plateWelded(), 3) : new OreDictStack(STEEL.heavyComp(), 1), new OreDictStack(CU.plate528(), 16), new ComparableStack(ModItems.hull_big_steel, 6), new ComparableStack(ModItems.pipes_steel, 2), new ComparableStack(ModItems.plate_polymer, 8), new ComparableStack(ModItems.circuit_red_copper, 1) },350);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_epress, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new OreDictStack(ANY_RUBBER.ingot(), 4), new ComparableStack(ModItems.part_generic, 2, EnumPartType.PISTON_HYDRAULIC.ordinal()), new ComparableStack(ModItems.circuit_copper, 1) }, 100);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_chemplant, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 8), new OreDictStack(CU.plate528(), 6), new ComparableStack(ModItems.tank_steel, 4), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.coil_tungsten, 3), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.plate_polymer, 8), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_chemplant, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(CU.plate528(), 6), new ComparableStack(ModItems.tank_steel, 4), new ComparableStack(ModItems.coil_tungsten, 3), new ComparableStack(ModItems.circuit_copper, 2), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.plate_polymer, 8), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_crystallizer, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 4), new ComparableStack(ModItems.pipes_steel, 1), new OreDictStack(DESH.ingot(), 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.blades_advanced_alloy, 2), new OreDictStack(STEEL.plateWelded(), 4), new OreDictStack(TI.plate(), 16), new ComparableStack(Blocks.glass, 4), new ComparableStack(ModItems.circuit_gold, 1), },400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_fluidtank, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 2), new OreDictStack(STEEL.plate528(), 6), new ComparableStack(ModItems.hull_big_steel, 4), new OreDictStack(ANY_TAR.any(), 4), },150);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_bat9000, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 16), new OreDictStack(ANY_RESISTANTALLOY.plateWelded(), 2), new ComparableStack(ModBlocks.steel_scaffold, 16), new OreDictStack(ANY_TAR.any(), 16), },150);
|
||||
|
||||
@ -38,7 +38,6 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
registerFuelProcessing();
|
||||
//6-30, formerly oil cracking, coal liquefaction and solidifciation
|
||||
registerOtherOil();
|
||||
|
||||
@ -314,7 +313,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
.inputFluids(
|
||||
new FluidStack(Fluids.PETROLEUM, 100),
|
||||
new FluidStack(Fluids.STEAM, 1000))
|
||||
.outputItems(new ItemStack(ModItems.antiknock)));
|
||||
.outputItems(new ItemStack(ModItems.fuel_additive)));
|
||||
recipes.add(new ChemRecipe(4, "FR_REOIL", 30)
|
||||
.inputFluids(new FluidStack(1000, Fluids.SMEAR))
|
||||
.outputFluids(new FluidStack(800, Fluids.RECLAIMED)));
|
||||
@ -324,18 +323,18 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
new FluidStack(200, Fluids.LUBRICANT))
|
||||
.outputFluids(new FluidStack(1000, Fluids.PETROIL)));
|
||||
recipes.add(new ChemRecipe(86, "PETROIL_LEADED", 40)
|
||||
.inputItems(new ComparableStack(ModItems.antiknock))
|
||||
.inputItems(new ComparableStack(ModItems.fuel_additive))
|
||||
.inputFluids(new FluidStack(Fluids.PETROIL, 10_000))
|
||||
.outputFluids(new FluidStack(Fluids.PETROIL_LEADED, 12_000)));
|
||||
recipes.add(new ChemRecipe(71, "GASOLINE", 40)
|
||||
.inputFluids(new FluidStack(Fluids.NAPHTHA, 1000))
|
||||
.outputFluids(new FluidStack(Fluids.GASOLINE, 800)));
|
||||
recipes.add(new ChemRecipe(85, "GASOLINE_LEADED", 40)
|
||||
.inputItems(new ComparableStack(ModItems.antiknock))
|
||||
.inputItems(new ComparableStack(ModItems.fuel_additive))
|
||||
.inputFluids(new FluidStack(Fluids.GASOLINE, 10_000))
|
||||
.outputFluids(new FluidStack(Fluids.GASOLINE_LEADED, 12_000)));
|
||||
recipes.add(new ChemRecipe(87, "COALGAS_LEADED", 40)
|
||||
.inputItems(new ComparableStack(ModItems.antiknock))
|
||||
.inputItems(new ComparableStack(ModItems.fuel_additive))
|
||||
.inputFluids(new FluidStack(Fluids.COALGAS, 10_000))
|
||||
.outputFluids(new FluidStack(Fluids.COALGAS_LEADED, 12_000)));
|
||||
recipes.add(new ChemRecipe(72, "FRACKSOL", 20)
|
||||
@ -418,33 +417,6 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
.outputFluids(new FluidStack(Fluids.SALIENT, 250)));
|
||||
|
||||
}
|
||||
|
||||
public static void registerFuelProcessing() {
|
||||
recipes.add(new ChemRecipe(0, "FP_HEAVYOIL", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.HEAVYOIL))
|
||||
.outputFluids(
|
||||
new FluidStack(FractionRecipes.heavy_frac_bitu * 10, Fluids.BITUMEN),
|
||||
new FluidStack(FractionRecipes.heavy_frac_smear * 10, Fluids.SMEAR)
|
||||
));
|
||||
recipes.add(new ChemRecipe(1, "FP_SMEAR", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.SMEAR))
|
||||
.outputFluids(
|
||||
new FluidStack(FractionRecipes.smear_frac_heat * 10, Fluids.HEATINGOIL),
|
||||
new FluidStack(FractionRecipes.smear_frac_lube * 10, Fluids.LUBRICANT)
|
||||
));
|
||||
recipes.add(new ChemRecipe(2, "FP_NAPHTHA", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.NAPHTHA))
|
||||
.outputFluids(
|
||||
new FluidStack(FractionRecipes.napht_frac_heat * 10, Fluids.HEATINGOIL),
|
||||
new FluidStack(FractionRecipes.napht_frac_diesel * 10, Fluids.DIESEL)
|
||||
));
|
||||
recipes.add(new ChemRecipe(3, "FP_LIGHTOIL", 50)
|
||||
.inputFluids(new FluidStack(1000, Fluids.LIGHTOIL))
|
||||
.outputFluids(
|
||||
new FluidStack(FractionRecipes.light_frac_diesel * 10, Fluids.DIESEL),
|
||||
new FluidStack(FractionRecipes.light_frac_kero * 10, Fluids.KEROSENE)
|
||||
));
|
||||
}
|
||||
|
||||
public static void registerOtherOil() {
|
||||
recipes.add(new ChemRecipe(31, "BP_BIOGAS", 60)
|
||||
|
||||
@ -38,12 +38,14 @@ public class CokerRecipes extends SerializableRecipe {
|
||||
registerAuto(HEATINGOIL_VACUUM, OIL_COKER);
|
||||
registerAuto(RECLAIMED, NAPHTHA_COKER);
|
||||
registerAuto(NAPHTHA, NAPHTHA_COKER);
|
||||
registerAuto(NAPHTHA_DS, NAPHTHA_COKER);
|
||||
registerAuto(NAPHTHA_CRACK, NAPHTHA_COKER);
|
||||
registerAuto(DIESEL, NAPHTHA_COKER);
|
||||
registerAuto(DIESEL_REFORM, NAPHTHA_COKER);
|
||||
registerAuto(DIESEL_CRACK, GAS_COKER);
|
||||
registerAuto(DIESEL_CRACK_REFORM, GAS_COKER);
|
||||
registerAuto(LIGHTOIL, GAS_COKER);
|
||||
registerAuto(LIGHTOIL_DS, GAS_COKER);
|
||||
registerAuto(LIGHTOIL_CRACK, GAS_COKER);
|
||||
registerAuto(LIGHTOIL_VACUUM, GAS_COKER);
|
||||
registerAuto(BIOFUEL, GAS_COKER);
|
||||
@ -60,6 +62,7 @@ public class CokerRecipes extends SerializableRecipe {
|
||||
registerRecipe(BITUMEN, 16_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_600));
|
||||
registerRecipe(LUBRICANT, 12_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_200));
|
||||
registerRecipe(CALCIUM_SOLUTION, 125, new ItemStack(ModItems.powder_calcium), new FluidStack(SPENTSTEAM, 100));
|
||||
registerRecipe(SOURGAS, 250, new ItemStack(ModItems.sulfur), new FluidStack(GAS_COKER, 150));
|
||||
}
|
||||
|
||||
private static void registerAuto(FluidType fluid, FluidType type) {
|
||||
|
||||
@ -44,7 +44,7 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
recipes.put(LIGNITE.dust(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 50)));
|
||||
recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.briquette, EnumBriquetteType.LIGNITE)), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 100)));
|
||||
|
||||
//recipes.put(CHLOROCALCITE.dust(), new Pair(new ItemStack(ModItems.powder_calcium), new FluidStack(Fluids.CHLORINE, 250)));
|
||||
recipes.put(CHLOROCALCITE.dust(), new Pair(new ItemStack(ModItems.powder_calcium), new FluidStack(Fluids.CHLORINE, 250)));
|
||||
recipes.put(MOLYSITE.dust(), new Pair(new ItemStack(Items.iron_ingot), new FluidStack(Fluids.CHLORINE, 250)));
|
||||
recipes.put(CINNABAR.crystal(), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.MERCURY, 100)));
|
||||
recipes.put(new ComparableStack(Items.glowstone_dust), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.CHLORINE, 100)));
|
||||
|
||||
@ -22,12 +22,12 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CustomMachineRecipes extends SerializableRecipe {
|
||||
|
||||
|
||||
public static HashMap<String, List<CustomMachineRecipe>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
|
||||
recipes.put("paperPress", new ArrayList() {{
|
||||
CustomMachineRecipe recipe = new CustomMachineRecipe();
|
||||
recipe.inputFluids = new FluidStack[] {new FluidStack(Fluids.WATER, 250)};
|
||||
@ -36,6 +36,13 @@ public class CustomMachineRecipes extends SerializableRecipe {
|
||||
recipe.outputItems = new Pair[] {new Pair(new ItemStack(Items.paper, 3), 1F)};
|
||||
recipe.duration = 60;
|
||||
recipe.consumptionPerTick = 10;
|
||||
recipe.pollutionMode = true;
|
||||
recipe.pollutionType = "SOOT";
|
||||
recipe.pollutionAmount = 0.03f;
|
||||
recipe.radiationMode = false;
|
||||
recipe.radiationAmount = 0;
|
||||
recipe.flux = 0;
|
||||
recipe.heat = 0;
|
||||
add(recipe);
|
||||
}});
|
||||
}
|
||||
@ -58,11 +65,11 @@ public class CustomMachineRecipes extends SerializableRecipe {
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = recipe.getAsJsonObject();
|
||||
|
||||
|
||||
String name = obj.get("recipeKey").getAsString();
|
||||
List<CustomMachineRecipe> list = new ArrayList();
|
||||
JsonArray array = obj.get("recipes").getAsJsonArray();
|
||||
|
||||
|
||||
for(int i = 0; i < array.size(); i++) {
|
||||
JsonObject rec = array.get(i).getAsJsonObject();
|
||||
CustomMachineRecipe recipeInstance = new CustomMachineRecipe();
|
||||
@ -72,56 +79,98 @@ public class CustomMachineRecipes extends SerializableRecipe {
|
||||
recipeInstance.outputItems = this.readItemStackArrayChance(rec.get("outputItems").getAsJsonArray());
|
||||
recipeInstance.duration = rec.get("duration").getAsInt();
|
||||
recipeInstance.consumptionPerTick = rec.get("consumptionPerTick").getAsInt();
|
||||
|
||||
if(rec.get("pollutionMode")!=null) {
|
||||
recipeInstance.pollutionMode = rec.get("pollutionMode").getAsBoolean();
|
||||
recipeInstance.pollutionType = rec.get("pollutionType").getAsString();
|
||||
recipeInstance.pollutionAmount = rec.get("pollutionAmount").getAsFloat();
|
||||
}
|
||||
else {
|
||||
recipeInstance.pollutionMode = false;
|
||||
recipeInstance.pollutionType = "";
|
||||
recipeInstance.pollutionAmount = 0;
|
||||
}
|
||||
if(rec.get("radiationMode")!=null) {
|
||||
recipeInstance.radiationMode = rec.get("radiationMode").getAsBoolean();
|
||||
recipeInstance.radiationAmount = rec.get("radiationAmount").getAsFloat();
|
||||
}
|
||||
else {
|
||||
recipeInstance.radiationMode = false;
|
||||
recipeInstance.radiationAmount = 0;
|
||||
}
|
||||
if(rec.get("flux")!=null) {
|
||||
recipeInstance.flux = rec.get("flux").getAsInt();
|
||||
}
|
||||
else recipeInstance.flux = 0;
|
||||
if(rec.get("heat")!=null) {
|
||||
recipeInstance.heat = rec.get("heat").getAsInt();
|
||||
}
|
||||
else recipeInstance.heat = 0;
|
||||
list.add(recipeInstance);
|
||||
}
|
||||
|
||||
|
||||
recipes.put(name, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<String, List<CustomMachineRecipe>> entry = (Entry) recipe;
|
||||
|
||||
|
||||
writer.name("recipeKey").value(entry.getKey());
|
||||
writer.name("recipes").beginArray();
|
||||
|
||||
|
||||
for(CustomMachineRecipe recipeInstance : entry.getValue()) {
|
||||
writer.beginObject();
|
||||
|
||||
|
||||
writer.name("inputFluids").beginArray();
|
||||
for(FluidStack stack : recipeInstance.inputFluids) this.writeFluidStack(stack, writer);
|
||||
writer.endArray();
|
||||
|
||||
|
||||
writer.name("inputItems").beginArray();
|
||||
for(AStack stack : recipeInstance.inputItems) this.writeAStack(stack, writer);
|
||||
writer.endArray();
|
||||
|
||||
|
||||
writer.name("outputFluids").beginArray();
|
||||
for(FluidStack stack : recipeInstance.outputFluids) this.writeFluidStack(stack, writer);
|
||||
writer.endArray();
|
||||
|
||||
|
||||
writer.name("outputItems").beginArray();
|
||||
for(Pair stack : recipeInstance.outputItems) this.writeItemStackChance(stack, writer);
|
||||
writer.endArray();
|
||||
|
||||
writer.name("duration").value(recipeInstance.duration);
|
||||
writer.name("consumptionPerTick").value(recipeInstance.consumptionPerTick);
|
||||
|
||||
writer.name("pollutionMode").value(recipeInstance.pollutionMode);
|
||||
writer.name("pollutionType").value(recipeInstance.pollutionType);
|
||||
writer.name("pollutionAmount").value(recipeInstance.pollutionAmount);
|
||||
writer.name("radiationMode").value(recipeInstance.radiationMode);
|
||||
writer.name("radiationnAmount").value(recipeInstance.radiationAmount);
|
||||
writer.name("flux").value(recipeInstance.flux);
|
||||
writer.name("heat").value(recipeInstance.heat);
|
||||
|
||||
writer.endObject();
|
||||
}
|
||||
|
||||
|
||||
writer.endArray();
|
||||
}
|
||||
|
||||
|
||||
public static class CustomMachineRecipe {
|
||||
|
||||
|
||||
public FluidStack[] inputFluids;
|
||||
public AStack[] inputItems;
|
||||
public FluidStack[] outputFluids;
|
||||
public Pair<ItemStack, Float>[] outputItems;
|
||||
|
||||
|
||||
public int duration;
|
||||
public int consumptionPerTick;
|
||||
public boolean pollutionMode;
|
||||
|
||||
public String pollutionType;
|
||||
public float pollutionAmount;
|
||||
public boolean radiationMode;
|
||||
public float radiationAmount;
|
||||
public int flux;
|
||||
public int heat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -19,51 +19,28 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FractionRecipes extends SerializableRecipe {
|
||||
|
||||
public static final int heavy_frac_bitu = 30;
|
||||
public static final int heavy_frac_smear = 70;
|
||||
public static final int smear_frac_heat = 60;
|
||||
public static final int smear_frac_lube = 40;
|
||||
public static final int napht_frac_heat = 40;
|
||||
public static final int napht_frac_diesel = 60;
|
||||
public static final int light_frac_diesel = 40;
|
||||
public static final int light_frac_kero = 60;
|
||||
|
||||
public static final int ncrack_frac_heat = 30;
|
||||
public static final int ncrack_frac_diesel = 70;
|
||||
public static final int lcrack_frac_kero = 70;
|
||||
public static final int lcrack_frac_petro = 30;
|
||||
public static final int coal_frac_coalgas = 30;
|
||||
public static final int coal_frac_oil = 70;
|
||||
public static final int creo_frac_coaloil = 10;
|
||||
public static final int creo_frac_bitu = 90;
|
||||
public static final int reform_frac_arom = 40;
|
||||
public static final int reform_frac_xyle = 60;
|
||||
public static final int hvac_frac_smear = 40;
|
||||
public static final int hvac_frac_heat = 60;
|
||||
public static final int lvac_frac_kero = 70;
|
||||
public static final int lvac_frac_gas = 30;
|
||||
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> fractions = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, heavy_frac_bitu), new FluidStack(Fluids.SMEAR, heavy_frac_smear)));
|
||||
fractions.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.HEATINGOIL, smear_frac_heat), new FluidStack(Fluids.LUBRICANT, smear_frac_lube)));
|
||||
fractions.put(Fluids.NAPHTHA, new Pair(new FluidStack(Fluids.HEATINGOIL, napht_frac_heat), new FluidStack(Fluids.DIESEL, napht_frac_diesel)));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Pair(new FluidStack(Fluids.HEATINGOIL, ncrack_frac_heat), new FluidStack(Fluids.DIESEL_CRACK, ncrack_frac_diesel)));
|
||||
fractions.put(Fluids.LIGHTOIL, new Pair(new FluidStack(Fluids.DIESEL, light_frac_diesel), new FluidStack(Fluids.KEROSENE, light_frac_kero)));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, lcrack_frac_kero), new FluidStack(Fluids.PETROLEUM, lcrack_frac_petro)));
|
||||
fractions.put(Fluids.COALOIL, new Pair(new FluidStack(Fluids.COALGAS, coal_frac_coalgas), new FluidStack(Fluids.OIL, coal_frac_oil)));
|
||||
fractions.put(Fluids.COALCREOSOTE, new Pair(new FluidStack(Fluids.COALOIL, creo_frac_coaloil), new FluidStack(Fluids.BITUMEN, creo_frac_bitu)));
|
||||
fractions.put(Fluids.HEAVYOIL_VACUUM, new Pair(new FluidStack(Fluids.SMEAR, hvac_frac_smear), new FluidStack(Fluids.HEATINGOIL_VACUUM, hvac_frac_heat)));
|
||||
fractions.put(Fluids.REFORMATE, new Pair(new FluidStack(Fluids.AROMATICS, reform_frac_arom), new FluidStack(Fluids.XYLENE, reform_frac_xyle)));
|
||||
fractions.put(Fluids.LIGHTOIL_VACUUM, new Pair(new FluidStack(Fluids.KEROSENE, lvac_frac_kero), new FluidStack(Fluids.REFORMGAS, lvac_frac_gas)));
|
||||
fractions.put(Fluids.SOURGAS, new Pair(new FluidStack(Fluids.GAS, 30), new FluidStack(Fluids.PETROLEUM, 20)));
|
||||
fractions.put(Fluids.EGG, new Pair(new FluidStack(Fluids.CHOLESTEROL, 50), new FluidStack(Fluids.RADIOSOLVENT, 50)));
|
||||
fractions.put(Fluids.OIL_COKER, new Pair(new FluidStack(Fluids.CRACKOIL, 30), new FluidStack(Fluids.HEATINGOIL, 70)));
|
||||
fractions.put(Fluids.NAPHTHA_COKER, new Pair(new FluidStack(Fluids.NAPHTHA_CRACK, 75), new FluidStack(Fluids.LIGHTOIL_CRACK, 25)));
|
||||
fractions.put(Fluids.GAS_COKER, new Pair(new FluidStack(Fluids.AROMATICS, 25), new FluidStack(Fluids.CARBONDIOXIDE, 75)));
|
||||
fractions.put(Fluids.CHLOROCALCITE_MIX, new Pair(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 50), new FluidStack(Fluids.COLLOID, 50)));
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, 30), new FluidStack(Fluids.SMEAR, 70)));
|
||||
fractions.put(Fluids.HEAVYOIL_VACUUM, new Pair(new FluidStack(Fluids.SMEAR, 40), new FluidStack(Fluids.HEATINGOIL_VACUUM, 60)));
|
||||
fractions.put(Fluids.SMEAR, new Pair(new FluidStack(Fluids.HEATINGOIL, 60), new FluidStack(Fluids.LUBRICANT, 40)));
|
||||
fractions.put(Fluids.NAPHTHA, new Pair(new FluidStack(Fluids.HEATINGOIL, 40), new FluidStack(Fluids.DIESEL, 60)));
|
||||
fractions.put(Fluids.NAPHTHA_DS, new Pair(new FluidStack(Fluids.XYLENE, 60), new FluidStack(Fluids.DIESEL_REFORM, 40)));
|
||||
fractions.put(Fluids.NAPHTHA_CRACK, new Pair(new FluidStack(Fluids.HEATINGOIL, 30), new FluidStack(Fluids.DIESEL_CRACK, 70)));
|
||||
fractions.put(Fluids.LIGHTOIL, new Pair(new FluidStack(Fluids.DIESEL, 40), new FluidStack(Fluids.KEROSENE, 60)));
|
||||
fractions.put(Fluids.LIGHTOIL_DS, new Pair(new FluidStack(Fluids.DIESEL_REFORM, 60), new FluidStack(Fluids.KEROSENE_REFORM, 40)));
|
||||
fractions.put(Fluids.LIGHTOIL_CRACK, new Pair(new FluidStack(Fluids.KEROSENE, 70), new FluidStack(Fluids.PETROLEUM, 30)));
|
||||
fractions.put(Fluids.COALOIL, new Pair(new FluidStack(Fluids.COALGAS, 30), new FluidStack(Fluids.OIL, 70)));
|
||||
fractions.put(Fluids.COALCREOSOTE, new Pair(new FluidStack(Fluids.COALOIL, 10), new FluidStack(Fluids.BITUMEN, 90)));
|
||||
fractions.put(Fluids.REFORMATE, new Pair(new FluidStack(Fluids.AROMATICS, 40), new FluidStack(Fluids.XYLENE, 60)));
|
||||
fractions.put(Fluids.LIGHTOIL_VACUUM, new Pair(new FluidStack(Fluids.KEROSENE, 70), new FluidStack(Fluids.REFORMGAS, 30)));
|
||||
fractions.put(Fluids.EGG, new Pair(new FluidStack(Fluids.CHOLESTEROL, 50), new FluidStack(Fluids.RADIOSOLVENT, 50)));
|
||||
fractions.put(Fluids.OIL_COKER, new Pair(new FluidStack(Fluids.CRACKOIL, 30), new FluidStack(Fluids.HEATINGOIL, 70)));
|
||||
fractions.put(Fluids.NAPHTHA_COKER, new Pair(new FluidStack(Fluids.NAPHTHA_CRACK, 75), new FluidStack(Fluids.LIGHTOIL_CRACK, 25)));
|
||||
fractions.put(Fluids.GAS_COKER, new Pair(new FluidStack(Fluids.AROMATICS, 25), new FluidStack(Fluids.CARBONDIOXIDE, 75)));
|
||||
fractions.put(Fluids.CHLOROCALCITE_MIX, new Pair(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 50), new FluidStack(Fluids.COLLOID, 50)));
|
||||
}
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getFractions(FluidType oil) {
|
||||
|
||||
@ -0,0 +1,119 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class HydrotreatingRecipes extends SerializableRecipe {
|
||||
|
||||
private static HashMap<FluidType, Triplet<FluidStack, FluidStack, FluidStack>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
recipes.put(Fluids.OIL, new Triplet(
|
||||
new FluidStack(Fluids.HYDROGEN, 5, 1),
|
||||
new FluidStack(Fluids.OIL_DS, 90),
|
||||
new FluidStack(Fluids.SOURGAS, 15)
|
||||
));
|
||||
|
||||
recipes.put(Fluids.CRACKOIL, new Triplet(
|
||||
new FluidStack(Fluids.HYDROGEN, 5, 1),
|
||||
new FluidStack(Fluids.CRACKOIL_DS, 90),
|
||||
new FluidStack(Fluids.SOURGAS, 15)
|
||||
));
|
||||
|
||||
recipes.put(Fluids.GAS, new Triplet(
|
||||
new FluidStack(Fluids.HYDROGEN, 5, 1),
|
||||
new FluidStack(Fluids.PETROLEUM, 80),
|
||||
new FluidStack(Fluids.SOURGAS, 15)
|
||||
));
|
||||
|
||||
recipes.put(Fluids.DIESEL_CRACK, new Triplet(
|
||||
new FluidStack(Fluids.HYDROGEN, 10, 1),
|
||||
new FluidStack(Fluids.DIESEL, 80),
|
||||
new FluidStack(Fluids.SOURGAS, 30)
|
||||
));
|
||||
|
||||
recipes.put(Fluids.DIESEL_CRACK_REFORM, new Triplet(
|
||||
new FluidStack(Fluids.HYDROGEN, 10, 1),
|
||||
new FluidStack(Fluids.DIESEL_REFORM, 80),
|
||||
new FluidStack(Fluids.SOURGAS, 30)
|
||||
));
|
||||
|
||||
recipes.put(Fluids.COALOIL, new Triplet(
|
||||
new FluidStack(Fluids.HYDROGEN, 10, 1),
|
||||
new FluidStack(Fluids.COALGAS, 80),
|
||||
new FluidStack(Fluids.SOURGAS, 15)
|
||||
));
|
||||
}
|
||||
|
||||
public static Triplet<FluidStack, FluidStack, FluidStack> getOutput(FluidType type) {
|
||||
return recipes.get(type);
|
||||
}
|
||||
|
||||
public static HashMap<Object, Object[]> getRecipes() {
|
||||
|
||||
HashMap<Object, Object[]> map = new HashMap<Object, Object[]>();
|
||||
|
||||
for(Entry<FluidType, Triplet<FluidStack, FluidStack, FluidStack>> recipe : recipes.entrySet()) {
|
||||
map.put(new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getKey(), 1000),
|
||||
ItemFluidIcon.make(recipe.getValue().getX().type, recipe.getValue().getX().fill * 10) },
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getValue().getY().type, recipe.getValue().getY().fill * 10),
|
||||
ItemFluidIcon.make(recipe.getValue().getZ().type, recipe.getValue().getZ().fill * 10) });
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmHydrotreating.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
FluidType input = Fluids.fromName(obj.get("input").getAsString());
|
||||
FluidStack hydrogen = this.readFluidStack(obj.get("hydrogen").getAsJsonArray());
|
||||
FluidStack output1 = this.readFluidStack(obj.get("output1").getAsJsonArray());
|
||||
FluidStack output2 = this.readFluidStack(obj.get("output2").getAsJsonArray());
|
||||
|
||||
recipes.put(input, new Triplet(hydrogen, output1, output2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, Triplet<FluidStack, FluidStack, FluidStack>> rec = (Entry<FluidType, Triplet<FluidStack, FluidStack, FluidStack>>) recipe;
|
||||
|
||||
writer.name("input").value(rec.getKey().getName());
|
||||
writer.name("hydrogen"); this.writeFluidStack(rec.getValue().getX(), writer);
|
||||
writer.name("output1"); this.writeFluidStack(rec.getValue().getY(), writer);
|
||||
writer.name("output2"); this.writeFluidStack(rec.getValue().getZ(), writer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import static com.hbm.inventory.OreDictManager.*;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LemegetonRecipes {
|
||||
|
||||
public static HashMap<AStack, ItemStack> recipes = new HashMap();
|
||||
|
||||
public static void register() {
|
||||
recipes.put(new OreDictStack(IRON.ingot()), new ItemStack(ModItems.ingot_steel));
|
||||
recipes.put(new OreDictStack(STEEL.ingot()), new ItemStack(ModItems.ingot_dura_steel));
|
||||
recipes.put(new OreDictStack(DURA.ingot()), new ItemStack(ModItems.ingot_tcalloy));
|
||||
recipes.put(new OreDictStack(TCALLOY.ingot()), new ItemStack(ModItems.ingot_combine_steel));
|
||||
recipes.put(new OreDictStack(CMB.ingot()), new ItemStack(ModItems.ingot_dineutronium));
|
||||
|
||||
recipes.put(new OreDictStack(TI.ingot()), new ItemStack(ModItems.ingot_saturnite));
|
||||
recipes.put(new OreDictStack(BIGMT.ingot()), new ItemStack(ModItems.ingot_starmetal));
|
||||
|
||||
recipes.put(new OreDictStack(CU.ingot()), new ItemStack(ModItems.ingot_red_copper));
|
||||
recipes.put(new OreDictStack(MINGRADE.ingot()), new ItemStack(ModItems.ingot_advanced_alloy));
|
||||
recipes.put(new OreDictStack(ALLOY.ingot()), new ItemStack(ModItems.ingot_desh));
|
||||
|
||||
recipes.put(new OreDictStack(PB.ingot()), new ItemStack(Items.gold_ingot));
|
||||
recipes.put(new OreDictStack(GOLD.ingot()), new ItemStack(ModItems.ingot_bismuth));
|
||||
recipes.put(new OreDictStack(BI.ingot()), new ItemStack(ModItems.ingot_osmiridium));
|
||||
|
||||
recipes.put(new OreDictStack(TH232.ingot()), new ItemStack(ModItems.ingot_uranium));
|
||||
recipes.put(new OreDictStack(U.ingot()), new ItemStack(ModItems.ingot_u238));
|
||||
recipes.put(new OreDictStack(U238.ingot()), new ItemStack(ModItems.ingot_u235));
|
||||
recipes.put(new OreDictStack(U235.ingot()), new ItemStack(ModItems.ingot_plutonium));
|
||||
recipes.put(new OreDictStack(PU.ingot()), new ItemStack(ModItems.ingot_pu238));
|
||||
recipes.put(new OreDictStack(PU238.ingot()), new ItemStack(ModItems.ingot_pu239));
|
||||
recipes.put(new OreDictStack(PU239.ingot()), new ItemStack(ModItems.ingot_pu240));
|
||||
recipes.put(new OreDictStack(PU240.ingot()), new ItemStack(ModItems.ingot_pu241));
|
||||
recipes.put(new OreDictStack(PU241.ingot()), new ItemStack(ModItems.ingot_am241));
|
||||
recipes.put(new OreDictStack(AM241.ingot()), new ItemStack(ModItems.ingot_am242));
|
||||
|
||||
recipes.put(new OreDictStack(RA226.ingot()), new ItemStack(ModItems.ingot_polonium));
|
||||
recipes.put(new OreDictStack(PO210.ingot()), new ItemStack(ModItems.ingot_technetium));
|
||||
|
||||
recipes.put(new OreDictStack(POLYMER.ingot()), new ItemStack(ModItems.ingot_pc));
|
||||
recipes.put(new OreDictStack(BAKELITE.ingot()), new ItemStack(ModItems.ingot_pvc));
|
||||
recipes.put(new OreDictStack(LATEX.ingot()), new ItemStack(ModItems.ingot_rubber));
|
||||
|
||||
recipes.put(new OreDictStack(COAL.gem()), new ItemStack(ModItems.ingot_graphite));
|
||||
recipes.put(new OreDictStack(GRAPHITE.ingot()), new ItemStack(Items.diamond));
|
||||
recipes.put(new OreDictStack(DIAMOND.gem()), new ItemStack(ModItems.ingot_cft));
|
||||
|
||||
recipes.put(new OreDictStack(F.dust()), new ItemStack(ModItems.gem_sodalite));
|
||||
recipes.put(new OreDictStack(SODALITE.gem()), new ItemStack(ModItems.gem_volcanic));
|
||||
recipes.put(new OreDictStack(VOLCANIC.gem()), new ItemStack(ModItems.gem_rad));
|
||||
recipes.put(new ComparableStack(ModItems.gem_rad), new ItemStack(ModItems.gem_alexandrite));
|
||||
|
||||
recipes.put(new OreDictStack(KEY_SAND), new ItemStack(ModItems.ingot_fiberglass));
|
||||
recipes.put(new OreDictStack(FIBER.ingot()), new ItemStack(ModItems.ingot_asbestos));
|
||||
}
|
||||
|
||||
public static ItemStack getRecipe(ItemStack ingredient) {
|
||||
|
||||
for(Entry<AStack, ItemStack> entry : recipes.entrySet()) {
|
||||
if(entry.getKey().matchesRecipe(ingredient, true)) {
|
||||
return entry.getValue().copy();
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -73,9 +73,9 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
register(Fluids.SYNGAS, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.COALOIL, 500)).setStack2(new FluidStack(Fluids.STEAM, 500)));
|
||||
register(Fluids.OXYHYDROGEN, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.HYDROGEN, 500)).setStack2(new FluidStack(Fluids.OXYGEN, 500)));
|
||||
|
||||
register(Fluids.PETROIL_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.PETROIL, 10_000)).setSolid(new ComparableStack(ModItems.antiknock)));
|
||||
register(Fluids.GASOLINE_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.GASOLINE, 10_000)).setSolid(new ComparableStack(ModItems.antiknock)));
|
||||
register(Fluids.COALGAS_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.COALGAS, 10_000)).setSolid(new ComparableStack(ModItems.antiknock)));
|
||||
register(Fluids.PETROIL_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.PETROIL, 10_000)).setSolid(new ComparableStack(ModItems.fuel_additive, 1, 0)));
|
||||
register(Fluids.GASOLINE_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.GASOLINE, 10_000)).setSolid(new ComparableStack(ModItems.fuel_additive, 1, 0)));
|
||||
register(Fluids.COALGAS_LEADED, new MixerRecipe(12_000, 40).setStack1(new FluidStack(Fluids.COALGAS, 10_000)).setSolid(new ComparableStack(ModItems.fuel_additive, 1, 0)));
|
||||
|
||||
register(Fluids.DIESEL_REFORM, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.DIESEL, 900)).setStack2(new FluidStack(Fluids.REFORMATE, 100)));
|
||||
register(Fluids.DIESEL_CRACK_REFORM, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.DIESEL_CRACK, 900)).setStack2(new FluidStack(Fluids.REFORMATE, 100)));
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
import com.hbm.util.Tuple.Quartet;
|
||||
import com.hbm.util.Tuple.Quintet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -28,16 +29,26 @@ public class RefineryRecipes {
|
||||
public static final int crack_frac_aroma = 15;
|
||||
public static final int crack_frac_unsat = 15;
|
||||
|
||||
public static final int oilds_frac_heavy = 30;
|
||||
public static final int oilds_frac_naph = 35;
|
||||
public static final int oilds_frac_light = 20;
|
||||
public static final int oilds_frac_unsat = 15;
|
||||
public static final int crackds_frac_naph = 35;
|
||||
public static final int crackds_frac_light = 35;
|
||||
public static final int crackds_frac_aroma = 15;
|
||||
public static final int crackds_frac_unsat = 15;
|
||||
|
||||
public static final int vac_frac_heavy = 40;
|
||||
public static final int vac_frac_reform = 25;
|
||||
public static final int vac_frac_light = 20;
|
||||
public static final int vac_frac_sour = 15;
|
||||
|
||||
private static Map<FluidType, Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack>> refinery = new HashMap();
|
||||
private static Map<FluidType, Quartet<FluidStack, FluidStack, FluidStack, FluidStack>> vacuum = new HashMap();
|
||||
|
||||
public static Map<Object, Object[]> getRefineryRecipe() {
|
||||
public static HashMap<Object, Object[]> getRefineryRecipe() {
|
||||
|
||||
Map<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
HashMap<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
|
||||
for(Entry<FluidType, Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack>> recipe : refinery.entrySet()) {
|
||||
|
||||
@ -55,15 +66,21 @@ public class RefineryRecipes {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public static HashMap<Object, Object[]> getVacuumRecipe() {
|
||||
public static HashMap getVacuumRecipe() {
|
||||
|
||||
HashMap<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
recipes.put(ItemFluidIcon.make(Fluids.OIL, 1000, 2),
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(Fluids.HEAVYOIL_VACUUM, vac_frac_heavy * 10),
|
||||
ItemFluidIcon.make(Fluids.REFORMATE, vac_frac_reform * 10),
|
||||
ItemFluidIcon.make(Fluids.LIGHTOIL_VACUUM, vac_frac_light * 10),
|
||||
ItemFluidIcon.make(Fluids.SOURGAS, vac_frac_sour * 10) });
|
||||
|
||||
for(Entry<FluidType, Quartet<FluidStack, FluidStack, FluidStack, FluidStack>> recipe : vacuum.entrySet()) {
|
||||
|
||||
Quartet<FluidStack, FluidStack, FluidStack, FluidStack> fluids = recipe.getValue();
|
||||
|
||||
recipes.put(ItemFluidIcon.make(recipe.getKey(), 1000, 2),
|
||||
new ItemStack[] {
|
||||
ItemFluidIcon.make(fluids.getW().type, fluids.getW().fill * 10),
|
||||
ItemFluidIcon.make(fluids.getX().type, fluids.getX().fill * 10),
|
||||
ItemFluidIcon.make(fluids.getY().type, fluids.getY().fill * 10),
|
||||
ItemFluidIcon.make(fluids.getZ().type, fluids.getZ().fill * 10) });
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
@ -83,9 +100,40 @@ public class RefineryRecipes {
|
||||
new FluidStack(Fluids.UNSATURATEDS, crack_frac_unsat),
|
||||
DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRACK)
|
||||
));
|
||||
refinery.put(Fluids.HOTOIL_DS, new Quintet(
|
||||
new FluidStack(Fluids.HEAVYOIL, oilds_frac_heavy),
|
||||
new FluidStack(Fluids.NAPHTHA_DS, oilds_frac_naph),
|
||||
new FluidStack(Fluids.LIGHTOIL_DS, oilds_frac_light),
|
||||
new FluidStack(Fluids.UNSATURATEDS, oilds_frac_unsat),
|
||||
DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN)
|
||||
));
|
||||
refinery.put(Fluids.HOTCRACKOIL_DS, new Quintet(
|
||||
new FluidStack(Fluids.NAPHTHA_DS, crackds_frac_naph),
|
||||
new FluidStack(Fluids.LIGHTOIL_DS, crackds_frac_light),
|
||||
new FluidStack(Fluids.AROMATICS, crackds_frac_aroma),
|
||||
new FluidStack(Fluids.UNSATURATEDS, crackds_frac_unsat),
|
||||
DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN)
|
||||
));
|
||||
|
||||
vacuum.put(Fluids.OIL, new Quartet(
|
||||
new FluidStack(Fluids.HEAVYOIL_VACUUM, vac_frac_heavy),
|
||||
new FluidStack(Fluids.REFORMATE, vac_frac_reform),
|
||||
new FluidStack(Fluids.LIGHTOIL_VACUUM, vac_frac_light),
|
||||
new FluidStack(Fluids.SOURGAS, vac_frac_sour)
|
||||
));
|
||||
vacuum.put(Fluids.OIL_DS, new Quartet(
|
||||
new FluidStack(Fluids.HEAVYOIL_VACUUM, vac_frac_heavy),
|
||||
new FluidStack(Fluids.REFORMATE, vac_frac_reform),
|
||||
new FluidStack(Fluids.LIGHTOIL_VACUUM, vac_frac_light),
|
||||
new FluidStack(Fluids.REFORMGAS, vac_frac_sour)
|
||||
));
|
||||
}
|
||||
|
||||
public static Quintet<FluidStack, FluidStack, FluidStack, FluidStack, ItemStack> getRefinery(FluidType oil) {
|
||||
return refinery.get(oil);
|
||||
}
|
||||
|
||||
public static Quartet<FluidStack, FluidStack, FluidStack, FluidStack> getVacuum(FluidType oil) {
|
||||
return vacuum.get(oil);
|
||||
}
|
||||
}
|
||||
|
||||
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