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
13625e3019
25
changelog
25
changelog
@ -1,7 +1,16 @@
|
||||
## Added
|
||||
* Large Radar
|
||||
* A giant version of the radar with 3x the scan range
|
||||
* Strand caster
|
||||
* Watercooled foundry basin that processes large amounts of material at once
|
||||
|
||||
## Changed
|
||||
* Nuclear craters have been reworked
|
||||
* The fallout effect no longer creates dead grass, instead it converts the area into three new biomes, the outer crater, crater and inner crater
|
||||
* The entire crater is now slaked sellafite which now has texture variance to look more like debris, as well as getting darker towards the center
|
||||
* The biomes being overridden means that nukes are now a solution to thaumcraft taint. Yay!
|
||||
* There are now new ore variants for the block conversions which match the surrounding sellafite
|
||||
* Beryllium ore now has a 100% chance of being converted into emerald
|
||||
* The watz now cools up to 20% of its current heat level instead of 10%, making reactors a lot cooler and therefore react faster, which means more energy and faster depletion rates
|
||||
* Mud production rates have been halved, to prevent currently working setups from exploding instantly
|
||||
* This is your reminder that you can achieve more power, mud and depletion by building larger watz powerplants, i.e. stacking more watz segments on top of each other. Your tiny poo reactors make me sick.
|
||||
@ -9,6 +18,22 @@
|
||||
* Adjusted the nuclear flash's intensity, the flash will now deal less and less radiation the longer it goes on
|
||||
* The nuclear flash now bypasses radiation resistance, being only affected by blocks and distance
|
||||
* Mushroom clouds' initial scale is now based on the total scale instead of all spawning roughly at the same size, causing fireballs to be comically small for huge bombs
|
||||
* Removed the old mining drill, combustion generator, old watz core, structure marker, all old large reactor parts and CMB furnace for good
|
||||
* Chemical plants will now eject all their outputs within a single tick if possible, increasing the throughput of fast recipes with many outputs, like asphalt
|
||||
* Hitting CTRL + ALT when hovering over an item now displays a preview of that item. Useful if you want to get authentic renders for a wiki, or just like staring at things.
|
||||
* 256k tanks and BAT9000s can now output comparator signals from their fluid ports
|
||||
* Trenchmaster general damage multiplier has been halved, making it twice as strong
|
||||
* Updated generation rules for layers like schist and hematite, they will now only replace things tagged as stone, just like most ores
|
||||
* Mushroom clouds now have two additional outer condensation rings, those are not entirely finished and are still subject to change
|
||||
* Small radars are now a lot cheaper
|
||||
* Increased crucible pouring speed by 50%
|
||||
|
||||
## Fixed
|
||||
* Fixed a rare crash caused by radars force-loading chunks conflicting with certain mods' chunk loading changes
|
||||
* Fixed PWR fuel rods not having any radiation value assigned to them
|
||||
* Fixed trenchmaster helmet not having gas mask protection
|
||||
* Fixed large thermobaric artillery rocket still using the wrong slag block
|
||||
* Fixed some of the assembly templates having broken names due to using the wrong way of translating the output
|
||||
* Fixed the soyuz launcher's NEI construction recipe showing the wrong amount of blocks
|
||||
* Fixed molten meteorite cobble dropping itself in addition to turning into lava
|
||||
* Fixed S~Cola RAD not being radish-colored
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=4837
|
||||
mod_build_number=4844
|
||||
|
||||
credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
|
||||
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\
|
||||
@ -16,4 +16,4 @@ 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), Maksymisio (polish localization) Ice-Arrow (research reactor tweaks)
|
||||
\ 70k (textures, glyphid AI, strand caster), Maksymisio (polish localization) Ice-Arrow (research reactor tweaks)
|
||||
|
||||
@ -11,4 +11,7 @@ public interface IBlockMultiPass {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
public default boolean shouldRenderItemMulti() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -534,12 +534,10 @@ public class ModBlocks {
|
||||
|
||||
public static Block sellafield_slaked;
|
||||
public static Block sellafield;
|
||||
/*public static Block sellafield_0;
|
||||
public static Block sellafield_1;
|
||||
public static Block sellafield_2;
|
||||
public static Block sellafield_3;
|
||||
public static Block sellafield_4;
|
||||
public static Block sellafield_core;*/
|
||||
public static Block ore_sellafield_diamond;
|
||||
public static Block ore_sellafield_emerald;
|
||||
public static Block ore_sellafield_uranium_scorched;
|
||||
public static Block ore_sellafield_schrabidium;
|
||||
|
||||
public static Block geysir_water;
|
||||
public static Block geysir_chlorine;
|
||||
@ -631,8 +629,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block tesla;
|
||||
|
||||
public static Block marker_structure;
|
||||
|
||||
public static Block muffler;
|
||||
|
||||
public static Block sat_mapper;
|
||||
@ -693,6 +689,7 @@ public class ModBlocks {
|
||||
public static Block foundry_channel;
|
||||
public static Block foundry_tank;
|
||||
public static Block foundry_outlet;
|
||||
public static Block machine_strand_caster;
|
||||
public static Block foundry_slagtap;
|
||||
public static Block slag;
|
||||
|
||||
@ -783,8 +780,6 @@ public class ModBlocks {
|
||||
public static Block capacitor_tantalium;
|
||||
public static Block capacitor_schrabidate;
|
||||
|
||||
@Deprecated public static Block machine_coal_off;
|
||||
@Deprecated public static Block machine_coal_on;
|
||||
public static Block machine_wood_burner;
|
||||
|
||||
public static Block red_wire_coated;
|
||||
@ -908,14 +903,6 @@ public class ModBlocks {
|
||||
public static Block pwr_port;
|
||||
public static Block pwr_controller;
|
||||
public static Block pwr_block;
|
||||
|
||||
@Deprecated public static Block reactor_element;
|
||||
@Deprecated public static Block reactor_control;
|
||||
@Deprecated public static Block reactor_hatch;
|
||||
@Deprecated public static Block reactor_ejector;
|
||||
@Deprecated public static Block reactor_inserter;
|
||||
@Deprecated public static Block reactor_conductor;
|
||||
@Deprecated public static Block reactor_computer;
|
||||
|
||||
public static Block fusion_conductor;
|
||||
public static Block fusion_center;
|
||||
@ -935,9 +922,7 @@ public class ModBlocks {
|
||||
public static Block watz_control;
|
||||
public static Block watz_cooler;
|
||||
public static Block watz_end;
|
||||
public static Block watz_hatch;
|
||||
public static Block watz_conductor;
|
||||
public static Block watz_core;
|
||||
|
||||
public static Block fwatz_conductor;
|
||||
public static Block fwatz_cooler;
|
||||
@ -976,8 +961,6 @@ public class ModBlocks {
|
||||
public static Block machine_shredder_large;
|
||||
public static final int guiID_machine_shredder_large = 76;
|
||||
|
||||
public static Block machine_combine_factory;
|
||||
|
||||
public static Block machine_teleporter;
|
||||
public static Block teleanchor;
|
||||
public static Block field_disturber;
|
||||
@ -1035,10 +1018,7 @@ public class ModBlocks {
|
||||
public static Block machine_deaerator;
|
||||
public static final int guiID_machine_deaerator = 74;
|
||||
|
||||
public static Block machine_drill;
|
||||
public static Block drill_pipe;
|
||||
public static Block machine_excavator;
|
||||
|
||||
public static Block machine_autosaw;
|
||||
|
||||
public static Block machine_mining_laser;
|
||||
@ -1067,6 +1047,7 @@ public class ModBlocks {
|
||||
public static Block soyuz_launcher;
|
||||
|
||||
public static Block machine_radar;
|
||||
public static Block machine_radar_large;
|
||||
public static Block radar_screen;
|
||||
|
||||
public static Block machine_turbofan;
|
||||
@ -1260,8 +1241,6 @@ public class ModBlocks {
|
||||
|
||||
public static Block volcano_core;
|
||||
|
||||
public static Block dummy_block_drill;
|
||||
public static Block dummy_port_drill;
|
||||
public static Block dummy_block_ams_limiter;
|
||||
public static Block dummy_port_ams_limiter;
|
||||
public static Block dummy_block_ams_emitter;
|
||||
@ -1286,8 +1265,6 @@ public class ModBlocks {
|
||||
public static Block pink_double_slab;
|
||||
public static Block pink_stairs;
|
||||
|
||||
public static Block ff;
|
||||
|
||||
public static Material materialGas = new MaterialGas();
|
||||
|
||||
private static void initializeBlock() {
|
||||
@ -1778,12 +1755,10 @@ public class ModBlocks {
|
||||
|
||||
sellafield_slaked = new BlockSellafieldSlaked(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked");
|
||||
sellafield = new BlockSellafield(Material.rock).setBlockName("sellafield").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
|
||||
/*sellafield_0 = new BlockHazard(Material.rock).setBlockName("sellafield_0").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
|
||||
sellafield_1 = new BlockHazard(Material.rock).setBlockName("sellafield_1").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_1");
|
||||
sellafield_2 = new BlockHazard(Material.rock).setBlockName("sellafield_2").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_2");
|
||||
sellafield_3 = new BlockHazard(Material.rock).setBlockName("sellafield_3").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_3");
|
||||
sellafield_4 = new BlockHazard(Material.rock).setBlockName("sellafield_4").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_4");
|
||||
sellafield_core = new BlockHazard(Material.rock).setBlockName("sellafield_core").setStepSound(Block.soundTypeStone).setHardness(10.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_core");*/
|
||||
ore_sellafield_diamond = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_diamond").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_diamond");
|
||||
ore_sellafield_emerald = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_emerald").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_emerald");
|
||||
ore_sellafield_uranium_scorched = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_uranium_scorched").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_uranium_scorched");
|
||||
ore_sellafield_schrabidium = new BlockSellafieldOre(Material.rock).setBlockName("ore_sellafield_schrabidium").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":ore_overlay_schrabidium");
|
||||
|
||||
geysir_water = new BlockGeysir(Material.rock).setBlockName("geysir_water").setStepSound(Block.soundTypeStone).setHardness(5.0F);
|
||||
geysir_chlorine = new BlockGeysir(Material.rock).setBlockName("geysir_chlorine").setStepSound(Block.soundTypeStone).setHardness(5.0F);
|
||||
@ -1856,6 +1831,7 @@ public class ModBlocks {
|
||||
machine_stirling_steel = new MachineStirling().setBlockName("machine_stirling_steel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_stirling_creative = new MachineStirling().setBlockName("machine_stirling_creative").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_sawmill = new MachineSawmill().setBlockName("machine_sawmill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_strand_caster = new MachineStrandCaster().setBlockName("machine_strand_caster").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
machine_crucible = new MachineCrucible().setBlockName("machine_crucible").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":brick_fire");
|
||||
machine_boiler = new MachineHeatBoiler().setBlockName("machine_boiler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
machine_industrial_boiler = new MachineHeatBoilerIndustrial().setBlockName("machine_industrial_boiler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
@ -1948,18 +1924,13 @@ public class ModBlocks {
|
||||
capacitor_tantalium = new MachineCapacitor(Material.iron, 150_000_000L, "tantalium").setBlockName("capacitor_tantalium").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_tantalium");
|
||||
capacitor_schrabidate = new MachineCapacitor(Material.iron, 50_000_000_000L, "schrabidate").setBlockName("capacitor_schrabidate").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_schrabidate");
|
||||
|
||||
machine_coal_off = new MachineCoal(false).setBlockName("machine_coal_off").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
machine_coal_on = new MachineCoal(true).setBlockName("machine_coal_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
machine_wood_burner = new MachineWoodBurner(Material.iron).setBlockName("machine_wood_burner").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
machine_diesel = new MachineDiesel().setBlockName("machine_diesel").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_combustion_engine = new MachineCombustionEngine().setBlockName("machine_combustion_engine").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
machine_shredder = new MachineShredder(Material.iron).setBlockName("machine_shredder").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_shredder_large = new MachineShredderLarge(Material.iron).setBlockName("machine_shredder_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
|
||||
machine_combine_factory = new MachineCMBFactory(Material.iron).setBlockName("machine_combine_factory").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null);
|
||||
|
||||
machine_teleporter = new MachineTeleporter(Material.iron).setBlockName("machine_teleporter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
teleanchor = new MachineTeleanchor().setBlockName("teleanchor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
field_disturber = new MachineFieldDisturber().setBlockName("field_disturber").setHardness(5.0F).setResistance(200.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":field_disturber");
|
||||
@ -2090,14 +2061,6 @@ public class ModBlocks {
|
||||
pwr_port = new BlockGenericPWR(Material.iron).setBlockName("pwr_port").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pwr_port");
|
||||
pwr_controller = new MachinePWRController(Material.iron).setBlockName("pwr_controller").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":pwr_casing_blank");
|
||||
pwr_block = new BlockPWR(Material.iron).setBlockName("pwr_block").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pwr_block");
|
||||
|
||||
reactor_element = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_element_top", RefStrings.MODID + ":reactor_element_base").setBlockName("reactor_element").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_element_side");
|
||||
reactor_control = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_control_top").setBlockName("reactor_control").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_control_side");
|
||||
reactor_hatch = new ReactorHatch(Material.iron).setBlockName("reactor_hatch").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_ejector = new BlockRotatable(Material.iron).setBlockName("reactor_ejector").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_inserter = new BlockRotatable(Material.iron).setBlockName("reactor_inserter").setHardness(5.0F).setResistance(1000.0F).setBlockTextureName(RefStrings.MODID + ":brick_concrete");
|
||||
reactor_conductor = new BlockPillar(Material.iron, RefStrings.MODID + ":reactor_conductor_top").setBlockName("reactor_conductor").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_conductor_side");
|
||||
reactor_computer = new ReactorCore(Material.iron).setBlockName("reactor_computer").setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":reactor_computer");
|
||||
|
||||
fusion_conductor = new BlockToolConversionPillar(Material.iron).addVariant("_welded").setBlockName("fusion_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_conductor");
|
||||
fusion_center = new BlockPillar(Material.iron, RefStrings.MODID + ":fusion_center_top_alt").setBlockName("fusion_center").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":fusion_center_side_alt");
|
||||
@ -2112,9 +2075,7 @@ public class ModBlocks {
|
||||
watz_control = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_control_top").setBlockName("watz_control").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_control_side");
|
||||
watz_cooler = new BlockPillar(Material.iron, RefStrings.MODID + ":watz_cooler_top").setBlockName("watz_cooler").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_cooler_side");
|
||||
watz_end = new BlockToolConversion(Material.iron).addVariant("_bolted").setBlockName("watz_end").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":watz_casing");
|
||||
watz_hatch = new WatzHatch(Material.iron).setBlockName("watz_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":watz_hatch");
|
||||
watz_conductor = new BlockCableConnect(Material.iron).setBlockName("watz_conductor").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":watz_conductor_top");
|
||||
watz_core = new WatzCore(Material.iron).setBlockName("watz_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":watz_computer");
|
||||
watz = new Watz().setBlockName("watz").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
watz_pump = new WatzPump().setBlockName("watz_pump").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
@ -2179,12 +2140,11 @@ public class ModBlocks {
|
||||
|
||||
tesla = new MachineTesla(Material.iron).setBlockName("tesla").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":tesla");
|
||||
|
||||
marker_structure = new BlockMarker(Material.iron).setBlockName("marker_structure").setHardness(0.1F).setResistance(0.1F).setLightLevel(1.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":marker_structure");
|
||||
|
||||
muffler = new BlockGeneric(Material.cloth).setBlockName("muffler").setHardness(0.8F).setStepSound(Block.soundTypeCloth).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":muffler");
|
||||
|
||||
launch_pad = new LaunchPad(Material.iron).setBlockName("launch_pad").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":launch_pad");
|
||||
machine_radar = new MachineRadar(Material.iron).setBlockName("machine_radar").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_radar");
|
||||
machine_radar_large = new MachineRadarLarge(Material.iron).setBlockName("machine_radar_large").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
radar_screen = new MachineRadarScreen(Material.iron).setBlockName("radar_screen").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
|
||||
machine_missile_assembly = new MachineMissileAssembly(Material.iron).setBlockName("machine_missile_assembly").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.missileTab).setBlockTextureName(RefStrings.MODID + ":machine_missile_assembly");
|
||||
@ -2295,9 +2255,7 @@ public class ModBlocks {
|
||||
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_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_drill = new MachineMiningDrill(Material.iron).setBlockName("machine_drill").setHardness(5.0F).setResistance(100.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":machine_drill");
|
||||
machine_excavator = new MachineExcavator().setBlockName("machine_excavator").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe");
|
||||
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");
|
||||
barricade = new BlockNoDrop(Material.sand).setBlockName("barricade").setHardness(1.0F).setResistance(2.5F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":barricade");
|
||||
machine_assembler = new MachineAssembler(Material.iron).setBlockName("machine_assembler").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_assembler");
|
||||
@ -2446,8 +2404,6 @@ public class ModBlocks {
|
||||
Fluid liquidConcrete = new GenericFluid("concrete_liquid").setViscosity(2000);
|
||||
concrete_liquid = new GenericFiniteFluid(liquidConcrete, Material.rock, "concrete_liquid", "concrete_liquid_flowing").setQuantaPerBlock(4).setBlockName("concrete_liquid").setResistance(500F);
|
||||
|
||||
dummy_block_drill = new DummyBlockDrill(Material.iron, false).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
dummy_port_drill = new DummyBlockDrill(Material.iron, true).setBlockName("dummy_port_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
dummy_block_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_block_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_port_ams_limiter = new DummyBlockAMSLimiter(Material.iron).setBlockName("dummy_port_ams_limiter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
dummy_block_ams_emitter = new DummyBlockAMSEmitter(Material.iron).setBlockName("dummy_block_ams_emitter").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_copper");
|
||||
@ -2471,8 +2427,6 @@ public class ModBlocks {
|
||||
pink_slab = new BlockPinkSlab(false, Material.wood).setBlockName("pink_slab").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks");
|
||||
pink_double_slab = new BlockPinkSlab(true, Material.wood).setBlockName("pink_double_slab").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks");
|
||||
pink_stairs = new BlockGenericStairs(pink_planks, 0).setBlockName("pink_stairs").setStepSound(Block.soundTypeWood).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":pink_planks");
|
||||
|
||||
ff = new BlockFF(Material.iron).setBlockName("ff").setHardness(0.5F).setStepSound(Block.soundTypeGravel).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":code");
|
||||
}
|
||||
|
||||
private static void registerBlock() {
|
||||
@ -2975,7 +2929,11 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(impact_dirt, impact_dirt.getUnlocalizedName());
|
||||
|
||||
//RAD
|
||||
GameRegistry.registerBlock(sellafield_slaked, sellafield_slaked.getUnlocalizedName());
|
||||
register(sellafield_slaked);
|
||||
register(ore_sellafield_diamond);
|
||||
register(ore_sellafield_emerald);
|
||||
register(ore_sellafield_uranium_scorched);
|
||||
register(ore_sellafield_schrabidium);
|
||||
GameRegistry.registerBlock(sellafield, ItemBlockNamedMeta.class, sellafield.getUnlocalizedName());
|
||||
|
||||
//Geysirs
|
||||
@ -3158,6 +3116,7 @@ public class ModBlocks {
|
||||
register(machine_stirling_creative);
|
||||
register(machine_sawmill);
|
||||
register(machine_crucible);
|
||||
register(machine_strand_caster);
|
||||
register(machine_boiler);
|
||||
register(machine_industrial_boiler);
|
||||
register(foundry_mold);
|
||||
@ -3184,8 +3143,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(machine_nuke_furnace_on, machine_nuke_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_rtg_furnace_off, machine_rtg_furnace_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_rtg_furnace_on, machine_rtg_furnace_on.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_coal_off, machine_coal_off.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_coal_on, machine_coal_on.getUnlocalizedName());
|
||||
register(machine_wood_burner);
|
||||
register(machine_diesel);
|
||||
register(machine_selenium);
|
||||
@ -3399,7 +3356,6 @@ public class ModBlocks {
|
||||
register(machine_catalytic_cracker);
|
||||
register(machine_catalytic_reformer);
|
||||
register(machine_coker);
|
||||
register(machine_drill);
|
||||
register(machine_autosaw);
|
||||
register(machine_excavator);
|
||||
register(machine_mining_laser);
|
||||
@ -3407,7 +3363,6 @@ public class ModBlocks {
|
||||
register(machine_turbofan);
|
||||
register(machine_turbinegas);
|
||||
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_combine_factory, machine_combine_factory.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(teleanchor, teleanchor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(field_disturber, field_disturber.getUnlocalizedName());
|
||||
@ -3418,9 +3373,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(radiorec, radiorec.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(radiobox, radiobox.getUnlocalizedName());
|
||||
|
||||
//Multiblock Helpers
|
||||
GameRegistry.registerBlock(marker_structure, marker_structure.getUnlocalizedName());
|
||||
|
||||
//The muffler
|
||||
GameRegistry.registerBlock(muffler, muffler.getUnlocalizedName());
|
||||
|
||||
@ -3473,20 +3425,11 @@ public class ModBlocks {
|
||||
register(pwr_block);
|
||||
|
||||
//Multiblock Generators
|
||||
GameRegistry.registerBlock(reactor_element, reactor_element.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_control, reactor_control.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_hatch, reactor_hatch.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_ejector, reactor_ejector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_inserter, reactor_inserter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_conductor, reactor_conductor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(reactor_computer, reactor_computer.getUnlocalizedName());
|
||||
|
||||
register(fusion_conductor);
|
||||
GameRegistry.registerBlock(fusion_center, fusion_center.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fusion_motor, fusion_motor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fusion_heater, fusion_heater.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fusion_hatch, fusion_hatch.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(fusion_core, fusion_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(plasma, ItemBlockLore.class, plasma.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(iter, iter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(plasma_heater, plasma_heater.getUnlocalizedName());
|
||||
@ -3495,9 +3438,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(watz_control, watz_control.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_cooler, watz_cooler.getUnlocalizedName());
|
||||
register(watz_end);
|
||||
GameRegistry.registerBlock(watz_hatch, watz_hatch.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_conductor, watz_conductor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_core, watz_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz, watz.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(watz_pump, watz_pump.getUnlocalizedName());
|
||||
|
||||
@ -3537,6 +3478,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(sat_dock, sat_dock.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(soyuz_capsule, soyuz_capsule.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_radar, machine_radar.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_radar_large, machine_radar_large.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(radar_screen, radar_screen.getUnlocalizedName());
|
||||
|
||||
//Guide
|
||||
@ -3594,8 +3536,6 @@ public class ModBlocks {
|
||||
//GameRegistry.registerBlock(concrete_liquid, concrete_liquid.getUnlocalizedName());
|
||||
|
||||
//Multiblock Dummy Blocks
|
||||
GameRegistry.registerBlock(dummy_block_drill, dummy_block_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_drill, dummy_port_drill.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_ams_limiter, dummy_block_ams_limiter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_port_ams_limiter, dummy_port_ams_limiter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(dummy_block_ams_emitter, dummy_block_ams_emitter.getUnlocalizedName());
|
||||
@ -3614,7 +3554,6 @@ public class ModBlocks {
|
||||
|
||||
//Other Technical Blocks
|
||||
GameRegistry.registerBlock(oil_pipe, oil_pipe.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(drill_pipe, drill_pipe.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(vent_chlorine, vent_chlorine.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(vent_cloud, vent_cloud.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(vent_pink_cloud, vent_pink_cloud.getUnlocalizedName());
|
||||
@ -3645,7 +3584,6 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(pink_slab, pink_slab.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(pink_double_slab, pink_double_slab.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(pink_stairs, pink_stairs.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ff, ff.getUnlocalizedName());
|
||||
}
|
||||
|
||||
private static void register(Block b) {
|
||||
|
||||
@ -124,7 +124,7 @@ public class BlockCrate extends BlockFalling {
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_difurnace_off), 9);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_reactor_breeding), 6);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_nuke_furnace_off), 7);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_coal_off), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_wood_burner), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_diesel), 8);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_selenium), 7);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_rtg_grey), 4);
|
||||
@ -134,7 +134,6 @@ public class BlockCrate extends BlockFalling {
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 8);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_assembler), 10);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_fluidtank), 7);
|
||||
BlockCrate.addToListWithWeight(metalList, Item.getItemFromBlock(ModBlocks.machine_drill), 4);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.centrifuge_element, 6);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.motor, 8);
|
||||
BlockCrate.addToListWithWeight(metalList, ModItems.coil_tungsten, 7);
|
||||
|
||||
@ -1,159 +0,0 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityStructureMarker;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockMarker extends BlockContainer {
|
||||
|
||||
public BlockMarker(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityStructureMarker();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
private boolean func_150107_m(World p_150107_1_, int p_150107_2_, int p_150107_3_, int p_150107_4_) {
|
||||
if(World.doesBlockHaveSolidTopSurface(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_)) {
|
||||
return true;
|
||||
} else {
|
||||
Block block = p_150107_1_.getBlock(p_150107_2_, p_150107_3_, p_150107_4_);
|
||||
return block.canPlaceTorchOnTop(p_150107_1_, p_150107_2_, p_150107_3_, p_150107_4_);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World p_149742_1_, int p_149742_2_, int p_149742_3_, int p_149742_4_) {
|
||||
return func_150107_m(p_149742_1_, p_149742_2_, p_149742_3_ - 1, p_149742_4_);
|
||||
}
|
||||
|
||||
@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, 6, 2);
|
||||
}
|
||||
if(i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 7, 2);
|
||||
}
|
||||
if(i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 8, 2);
|
||||
}
|
||||
if(i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 9, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {
|
||||
super.updateTick(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_, p_149674_5_);
|
||||
|
||||
if(p_149674_1_.getBlockMetadata(p_149674_2_, p_149674_3_, p_149674_4_) == 0) {
|
||||
this.onBlockAdded(p_149674_1_, p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_) {
|
||||
this.func_150108_b(p_149695_1_, p_149695_2_, p_149695_3_, p_149695_4_, p_149695_5_);
|
||||
}
|
||||
|
||||
protected boolean func_150108_b(World p_150108_1_, int p_150108_2_, int p_150108_3_, int p_150108_4_, Block p_150108_5_) {
|
||||
if(this.func_150109_e(p_150108_1_, p_150108_2_, p_150108_3_, p_150108_4_)) {
|
||||
boolean flag = false;
|
||||
|
||||
if(!this.func_150107_m(p_150108_1_, p_150108_2_, p_150108_3_ - 1, p_150108_4_)) {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
if(flag) {
|
||||
this.dropBlockAsItem(p_150108_1_, p_150108_2_, p_150108_3_, p_150108_4_, p_150108_1_.getBlockMetadata(p_150108_2_, p_150108_3_, p_150108_4_), 0);
|
||||
p_150108_1_.setBlockToAir(p_150108_2_, p_150108_3_, p_150108_4_);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean func_150109_e(World p_150109_1_, int p_150109_2_, int p_150109_3_, int p_150109_4_) {
|
||||
if(!this.canPlaceBlockAt(p_150109_1_, p_150109_2_, p_150109_3_, p_150109_4_)) {
|
||||
if(p_150109_1_.getBlock(p_150109_2_, p_150109_3_, p_150109_4_) == this) {
|
||||
this.dropBlockAsItem(p_150109_1_, p_150109_2_, p_150109_3_, p_150109_4_, p_150109_1_.getBlockMetadata(p_150109_2_, p_150109_3_, p_150109_4_), 0);
|
||||
p_150109_1_.setBlockToAir(p_150109_2_, p_150109_3_, p_150109_4_);
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace(World p_149731_1_, int p_149731_2_, int p_149731_3_, int p_149731_4_, Vec3 p_149731_5_, Vec3 p_149731_6_) {
|
||||
float f = 0.15F;
|
||||
f = 0.1F;
|
||||
this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.6F, 0.5F + f);
|
||||
|
||||
return super.collisionRayTrace(p_149731_1_, p_149731_2_, p_149731_3_, p_149731_4_, p_149731_5_, p_149731_6_);
|
||||
}
|
||||
|
||||
@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) {
|
||||
int i = ((TileEntityStructureMarker) world.getTileEntity(x, y, z)).type + 1;
|
||||
if(i > 2) i -= 3;
|
||||
if(i == 0) player.addChatMessage(new ChatComponentText("[Structure Marker] Set template: Nuclear Reactor"));
|
||||
if(i == 1) player.addChatMessage(new ChatComponentText("[Structure Marker] Set template: Watz Power Plant"));
|
||||
if(i == 2) player.addChatMessage(new ChatComponentText("[Structure Marker] Set template: Fusionary Watz Plant"));
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
if(world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileEntityStructureMarker) {
|
||||
((TileEntityStructureMarker) world.getTileEntity(x, y, z)).type++;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -127,7 +127,7 @@ public class BlockOre extends Block {
|
||||
case 23:
|
||||
return Item.getItemFromBlock(ModBlocks.fusion_conductor);
|
||||
case 24:
|
||||
return Item.getItemFromBlock(ModBlocks.reactor_computer);
|
||||
return Item.getItemFromBlock(ModBlocks.pwr_fuel);
|
||||
case 25:
|
||||
return Item.getItemFromBlock(ModBlocks.machine_diesel);
|
||||
case 26:
|
||||
@ -205,6 +205,9 @@ public class BlockOre extends Block {
|
||||
if(this == ModBlocks.ore_cobalt || this == ModBlocks.ore_nether_cobalt) {
|
||||
return ModItems.fragment_cobalt;
|
||||
}
|
||||
if(this == ModBlocks.block_meteor_molten) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
@ -345,8 +348,7 @@ public class BlockOre extends Block {
|
||||
public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int i) {
|
||||
|
||||
if(this == ModBlocks.block_meteor_molten) {
|
||||
if(!world.isRemote)
|
||||
world.setBlock(x, y, z, Blocks.lava);
|
||||
if(!world.isRemote) world.setBlock(x, y, z, Blocks.lava);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,11 +8,14 @@ import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.render.icon.RGBMutatorInterpolatedComponentRemap;
|
||||
import com.hbm.render.icon.TextureAtlasSpriteMutatable;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@ -20,12 +23,17 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSellafield extends BlockHazard {
|
||||
|
||||
//Sellafite blocks should probably be entirely metadata, but removing them now might mess with shit
|
||||
//...Ah, fuck it! Noone cares anyway.
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon[][] icons;
|
||||
|
||||
public static final int SELLAFITE_LEVELS = 6;
|
||||
public static final int TEXTURE_VARIANTS = 4;
|
||||
|
||||
public BlockSellafield(Material mat) {
|
||||
super(mat);
|
||||
this.setCreativeTab(MainRegistry.blockTab);
|
||||
@ -56,10 +64,6 @@ public class BlockSellafield extends BlockHazard {
|
||||
}
|
||||
|
||||
@Override public void onBlockAdded(World world, int x, int y, int z) { }
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon[] icons;
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
@ -69,24 +73,62 @@ public class BlockSellafield extends BlockHazard {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List list) {
|
||||
for(byte i = 0; i < 6; i++) {
|
||||
for(byte i = 0; i < SELLAFITE_LEVELS; i++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
icons = new IIcon[6];
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
super.registerBlockIcons(reg);
|
||||
icons = new IIcon[SELLAFITE_LEVELS][TEXTURE_VARIANTS];
|
||||
String[] names = new String[] {
|
||||
RefStrings.MODID + ":sellafield_slaked",
|
||||
RefStrings.MODID + ":sellafield_slaked_1",
|
||||
RefStrings.MODID + ":sellafield_slaked_2",
|
||||
RefStrings.MODID + ":sellafield_slaked_3"
|
||||
};
|
||||
|
||||
for(byte i = 0; i < 6; i++)
|
||||
icons[i] = iconRegister.registerIcon(RefStrings.MODID + ":sellafield_" + i);
|
||||
if(reg instanceof TextureMap) {
|
||||
TextureMap map = (TextureMap) reg;
|
||||
|
||||
int[][] colors = new int[][] {
|
||||
{0x4C7939, 0x41463F},
|
||||
{0x418223, 0x3E443B},
|
||||
{0x338C0E, 0x3B5431},
|
||||
{0x1C9E00, 0x394733},
|
||||
{0x02B200, 0x37492F},
|
||||
{0x00D300, 0x324C26}
|
||||
};
|
||||
|
||||
for(int level = 0; level < SELLAFITE_LEVELS; level++) {
|
||||
int[] tint = colors[level];
|
||||
|
||||
for(int subtype = 0; subtype < TEXTURE_VARIANTS; subtype++) {
|
||||
String texName = names[subtype];
|
||||
String placeholderName = texName + "-" + level + "-" + subtype;
|
||||
TextureAtlasSpriteMutatable mutableIcon = new TextureAtlasSpriteMutatable(placeholderName, new RGBMutatorInterpolatedComponentRemap(0x858384, 0x434343, tint[0], tint[1])).setBlockAtlas();
|
||||
map.setTextureEntry(placeholderName, mutableIcon);
|
||||
icons[level][subtype] = mutableIcon;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
long l = (long) (x * 3129871) ^ (long)y * 116129781L ^ (long)z;
|
||||
l = l * l * 42317861L + l * 11L;
|
||||
int i = (int)(l >> 16 & 3L);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
return icons[(int)(Math.abs(meta) % SELLAFITE_LEVELS)][(int)(Math.abs(i) % TEXTURE_VARIANTS)];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return this.icons[meta % this.icons.length];
|
||||
return this.icons[(int) Math.abs(meta) % this.icons.length][0];
|
||||
}
|
||||
}
|
||||
|
||||
105
src/main/java/com/hbm/blocks/generic/BlockSellafieldOre.java
Normal file
105
src/main/java/com/hbm/blocks/generic/BlockSellafieldOre.java
Normal file
@ -0,0 +1,105 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class BlockSellafieldOre extends BlockSellafieldSlaked implements IBlockMultiPass {
|
||||
|
||||
public BlockSellafieldOre(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
this.blockIcon = reg.registerIcon(this.getTextureName());
|
||||
super.registerBlockIcons(reg);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return IBlockMultiPass.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
if(RenderBlockMultipass.currentPass == 1) return this.blockIcon;
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(RenderBlockMultipass.currentPass == 1) return this.blockIcon;
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
if(RenderBlockMultipass.currentPass == 1) return 0xffffff;
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPasses() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRenderItemMulti() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
if(this == ModBlocks.ore_sellafield_diamond) return Items.diamond;
|
||||
if(this == ModBlocks.ore_sellafield_emerald) return Items.emerald;
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random rand) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int fortune, Random rand) {
|
||||
if(fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, rand, fortune)) {
|
||||
int j = rand.nextInt(fortune + 2) - 1;
|
||||
if(j < 0) j = 0;
|
||||
return this.quantityDropped(rand) * (j + 1);
|
||||
} else {
|
||||
return this.quantityDropped(rand);
|
||||
}
|
||||
}
|
||||
|
||||
private Random rand = new Random();
|
||||
|
||||
@Override
|
||||
public int getExpDrop(IBlockAccess world, int meta, int fortune) {
|
||||
if(this.getItemDropped(meta, rand, fortune) != Item.getItemFromBlock(this)) {
|
||||
int j1 = 0;
|
||||
|
||||
if(this == ModBlocks.ore_sellafield_diamond) j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7);
|
||||
if(this == ModBlocks.ore_sellafield_emerald) j1 = MathHelper.getRandomIntegerInRange(rand, 3, 7);
|
||||
|
||||
return j1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ public class BlockSellafieldSlaked extends Block {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return icons[meta % icons.length];
|
||||
return icons[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,23 +1,15 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import api.hbm.fluid.IFluidConnectorBlock;
|
||||
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.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockPillar extends Block implements IFluidConnectorBlock {
|
||||
public class BlockPillar extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
@ -37,18 +29,13 @@ public class BlockPillar extends Block implements IFluidConnectorBlock {
|
||||
textureAlt = bottom;
|
||||
}
|
||||
|
||||
public Block setBlockTextureName(String name) {
|
||||
|
||||
if(textureTop.isEmpty())
|
||||
textureTop = name;
|
||||
|
||||
if(textureAlt.isEmpty())
|
||||
textureAlt = name;
|
||||
|
||||
this.textureName = name;
|
||||
|
||||
return this;
|
||||
}
|
||||
public Block setBlockTextureName(String name) {
|
||||
|
||||
if(textureTop.isEmpty()) textureTop = name;
|
||||
if(textureAlt.isEmpty()) textureAlt = name;
|
||||
this.textureName = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@ -62,37 +49,6 @@ public class BlockPillar extends Block implements IFluidConnectorBlock {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
|
||||
if(this == ModBlocks.reactor_element && metadata == 1)
|
||||
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.iconAlt);
|
||||
|
||||
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if(this != ModBlocks.reactor_element)
|
||||
return super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
|
||||
|
||||
if(player.isSneaking())
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 1, 3);
|
||||
} else {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 0, 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
if(this != ModBlocks.reactor_conductor) return false;
|
||||
return type == Fluids.WATER || type == Fluids.COOLANT || type == Fluids.STEAM || type == Fluids.HOTSTEAM || type == Fluids.SUPERHOTSTEAM || type == Fluids.ULTRAHOTSTEAM;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
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.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockRotatable extends Block {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
public BlockRotatable(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
|
||||
if(this == ModBlocks.reactor_ejector) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":reactor_ejector");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_concrete");
|
||||
}
|
||||
if(this == ModBlocks.reactor_inserter) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":reactor_inserter");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_concrete");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class DummyBlockDrill extends DummyOldBase {
|
||||
|
||||
public DummyBlockDrill(Material p_i45386_1_, boolean port) {
|
||||
super(p_i45386_1_, port);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityDummy();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getItem(World world, int x, int y, int z)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_drill);
|
||||
}
|
||||
|
||||
@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())
|
||||
{
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if(te != null && te instanceof TileEntityDummy) {
|
||||
int a = ((TileEntityDummy)te).targetX;
|
||||
int b = ((TileEntityDummy)te).targetY;
|
||||
int c = ((TileEntityDummy)te).targetZ;
|
||||
|
||||
TileEntityMachineMiningDrill entity = (TileEntityMachineMiningDrill) world.getTileEntity(a, b, c);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, a, b, c);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -129,13 +129,21 @@ public class MachineBigAssTank9000 extends BlockDummyable implements IPersistent
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityMachineBAT9000))
|
||||
return 0;
|
||||
|
||||
TileEntityMachineBAT9000 tank = (TileEntityMachineBAT9000) te;
|
||||
return tank.getComparatorPower();
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(meta >= 6) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return 0;
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityMachineBAT9000))
|
||||
return 0;
|
||||
|
||||
TileEntityMachineBAT9000 tank = (TileEntityMachineBAT9000) te;
|
||||
return tank.getComparatorPower();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,131 +0,0 @@
|
||||
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.TileEntityMachineCMBFactory;
|
||||
|
||||
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.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineCMBFactory extends BlockContainer {
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconTop;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconTop = iconRegister.registerIcon(RefStrings.MODID + ":machine_cmb_top");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":machine_cmb_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 1 ? this.iconTop : (side == 0 ? this.iconTop : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return Item.getItemFromBlock(ModBlocks.machine_combine_factory);
|
||||
}
|
||||
|
||||
public MachineCMBFactory(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineCMBFactory();
|
||||
}
|
||||
|
||||
@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())
|
||||
{
|
||||
TileEntityMachineCMBFactory entity = (TileEntityMachineCMBFactory) world.getTileEntity(x, y, z);
|
||||
if(entity != null)
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
TileEntityMachineCMBFactory tileentityfurnace = (TileEntityMachineCMBFactory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCoal;
|
||||
|
||||
@Deprecated
|
||||
public class MachineCoal extends BlockContainer {
|
||||
|
||||
public MachineCoal(boolean blockState) {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineCoal();
|
||||
}
|
||||
}
|
||||
@ -169,13 +169,21 @@ public class MachineFluidTank extends BlockDummyable implements IPersistentInfoP
|
||||
@Override
|
||||
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityMachineFluidTank))
|
||||
return 0;
|
||||
|
||||
TileEntityMachineFluidTank tank = (TileEntityMachineFluidTank) te;
|
||||
return tank.getComparatorPower();
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
if(meta >= 6) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return 0;
|
||||
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
|
||||
if(!(te instanceof TileEntityMachineFluidTank))
|
||||
return 0;
|
||||
|
||||
TileEntityMachineFluidTank tank = (TileEntityMachineFluidTank) te;
|
||||
return tank.getComparatorPower();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,232 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.MultiblockHandler;
|
||||
import com.hbm.interfaces.IMultiblock;
|
||||
import com.hbm.tileentity.machine.TileEntityDummy;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineMiningDrill extends BlockContainer implements IMultiblock {
|
||||
|
||||
public MachineMiningDrill(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityMachineMiningDrill();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_drill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@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, 5, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
|
||||
|
||||
//
|
||||
DummyBlockDrill.safeBreak = true;
|
||||
world.setBlock(x + 1, y, z, ModBlocks.dummy_port_drill);
|
||||
TileEntity te = world.getTileEntity(x + 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z, ModBlocks.dummy_port_drill);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockDrill.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 1) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
|
||||
|
||||
//
|
||||
DummyBlockDrill.safeBreak = true;
|
||||
world.setBlock(x, y, z + 1, ModBlocks.dummy_port_drill);
|
||||
TileEntity te = world.getTileEntity(x, y, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x, y, z - 1, ModBlocks.dummy_port_drill);
|
||||
TileEntity te2 = world.getTileEntity(x, y, z - 1);
|
||||
if(te2 instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockDrill.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 2) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
|
||||
|
||||
//
|
||||
DummyBlockDrill.safeBreak = true;
|
||||
world.setBlock(x + 1, y, z, ModBlocks.dummy_port_drill);
|
||||
TileEntity te = world.getTileEntity(x + 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x - 1, y, z, ModBlocks.dummy_port_drill);
|
||||
TileEntity te2 = world.getTileEntity(x - 1, y, z);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockDrill.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
if (i == 3) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
if(MultiblockHandler.checkSpace(world, x, y, z, MultiblockHandler.drillDimension)) {
|
||||
MultiblockHandler.fillUp(world, x, y, z, MultiblockHandler.drillDimension, ModBlocks.dummy_block_drill);
|
||||
|
||||
//
|
||||
DummyBlockDrill.safeBreak = true;
|
||||
world.setBlock(x, y, z + 1, ModBlocks.dummy_port_drill);
|
||||
TileEntity te = world.getTileEntity(x, y, z + 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
world.setBlock(x, y, z - 1, ModBlocks.dummy_port_drill);
|
||||
TileEntity te2 = world.getTileEntity(x, y, z - 1);
|
||||
if(te instanceof TileEntityDummy) {
|
||||
TileEntityDummy dummy = (TileEntityDummy)te2;
|
||||
dummy.targetX = x;
|
||||
dummy.targetY = y;
|
||||
dummy.targetZ = z;
|
||||
}
|
||||
DummyBlockDrill.safeBreak = false;
|
||||
//
|
||||
|
||||
} else
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
|
||||
private final Random field_149933_a = new Random();
|
||||
private static boolean keepInventory;
|
||||
|
||||
@Override
|
||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||
}
|
||||
}
|
||||
98
src/main/java/com/hbm/blocks/machine/MachineRadarLarge.java
Normal file
98
src/main/java/com/hbm/blocks/machine/MachineRadarLarge.java
Normal file
@ -0,0 +1,98 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarLarge;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class MachineRadarLarge extends BlockDummyable {
|
||||
|
||||
public MachineRadarLarge(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineRadarLarge();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().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) {
|
||||
|
||||
if(y < TileEntityMachineRadarNT.radarAltitude) {
|
||||
if(world.isRemote)
|
||||
player.addChatMessage(new ChatComponentText("[Radar] Error: Radar altitude not sufficient.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
return true;
|
||||
}
|
||||
|
||||
if(world.isRemote && !player.isSneaking()) {
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if(pos == null) return false;
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, pos[0], pos[1], pos[2]);
|
||||
return true;
|
||||
} else if(!player.isSneaking()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {4, 0, 1, 1, 1, 1};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
this.makeExtra(world, x + 1, y, z);
|
||||
this.makeExtra(world, x - 1, y, z);
|
||||
this.makeExtra(world, x, y, z + 1);
|
||||
this.makeExtra(world, x, y, z - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int m) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if(meta >= 6) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(m);
|
||||
TileEntity tile = world.getTileEntity(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
|
||||
if(tile instanceof TileEntityMachineRadarNT) {
|
||||
TileEntityMachineRadarNT entity = (TileEntityMachineRadarNT) tile;
|
||||
return entity.getRedPower();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingStrongPower(IBlockAccess world, int x, int y, int z, int m) {
|
||||
return isProvidingWeakPower(world, x, y, z, m);
|
||||
}
|
||||
}
|
||||
232
src/main/java/com/hbm/blocks/machine/MachineStrandCaster.java
Normal file
232
src/main/java/com/hbm/blocks/machine/MachineStrandCaster.java
Normal file
@ -0,0 +1,232 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import api.hbm.block.IToolable;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMold;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.TileEntityCrucible;
|
||||
import com.hbm.tileentity.machine.TileEntityFoundryCastingBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineStrandCaster;
|
||||
import com.hbm.util.I18nUtil;
|
||||
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.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.ItemTool;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class MachineStrandCaster extends BlockDummyable implements ICrucibleAcceptor, ILookOverlay, IToolable {
|
||||
|
||||
public MachineStrandCaster() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
//reminder, if the machine is a solid brick, get dimensions will already handle it without the need to use fillSapce
|
||||
//the order is up, down, forward, backward, left, right
|
||||
//x is for left(-)/right(+), z is for forward(+)/backward(-), y you already know
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[]{0, 0, 6, 0, 1, 0};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if (meta >= 12) return new TileEntityMachineStrandCaster();
|
||||
if (meta >= 6) return new TileEntityProxyCombo(true, false, true).moltenMetal();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
//up,down;forward,backward;left,right
|
||||
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[]{2, 0, 1, 0, 1, 0}, this, dir);
|
||||
//Fluid ports
|
||||
this.makeExtra(world, x + rot.offsetX - dir.offsetX, y, z + rot.offsetZ - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX * 5, y, z - dir.offsetZ * 5);
|
||||
this.makeExtra(world, x + rot.offsetX - dir.offsetX * 5, y, z + rot.offsetZ - dir.offsetZ * 5);
|
||||
//Molten slop ports
|
||||
this.makeExtra(world, x + rot.offsetX - dir.offsetX, y + 2, z + rot.offsetZ - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX, y + 2, z - dir.offsetZ);
|
||||
this.makeExtra(world, x + rot.offsetX, y + 2, z + rot.offsetZ);
|
||||
this.makeExtra(world, x, y + 2, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
|
||||
TileEntity poured = world.getTileEntity(x, y, z);
|
||||
if (!(poured instanceof TileEntityProxyCombo && ((TileEntityProxyCombo) poured).moltenMetal)) return false;
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if (pos == null) return false;
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if (!(tile instanceof TileEntityMachineStrandCaster)) return false;
|
||||
TileEntityMachineStrandCaster caster = (TileEntityMachineStrandCaster) tile;
|
||||
|
||||
return caster.canAcceptPartialPour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mats.MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
|
||||
TileEntity poured = world.getTileEntity(x, y, z);
|
||||
if (!(poured instanceof TileEntityProxyCombo && ((TileEntityProxyCombo) poured).moltenMetal)) return stack;
|
||||
|
||||
int[] pos = this.findCore(world, x, y, z);
|
||||
if (pos == null) return stack;
|
||||
TileEntity tile = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||
if (!(tile instanceof TileEntityMachineStrandCaster)) return stack;
|
||||
TileEntityMachineStrandCaster caster = (TileEntityMachineStrandCaster) tile;
|
||||
|
||||
return caster.pour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mats.MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
int[] coords = findCore(world, x, y, z);
|
||||
TileEntityMachineStrandCaster cast = (TileEntityMachineStrandCaster) world.getTileEntity(coords[0], coords[1], coords[2]);
|
||||
if (cast != null) {
|
||||
//insert mold
|
||||
if (player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.mold && cast.slots[0] == null) {
|
||||
cast.slots[0] = player.getHeldItem().copy();
|
||||
cast.slots[0].stackSize = 1;
|
||||
player.getHeldItem().stackSize--;
|
||||
world.playSoundEffect(x + 0.5, y + 0.5, z + 0.5, "hbm:item.upgradePlug", 1.0F, 1.0F);
|
||||
cast.markDirty();
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemTool && player.getHeldItem().getItem().getToolClasses(player.getHeldItem()).contains("shovel")) {
|
||||
if (cast.amount > 0) {
|
||||
ItemStack scrap = ItemScraps.create(new Mats.MaterialStack(cast.type, cast.amount));
|
||||
if (!player.inventory.addItemStackToInventory(scrap)) {
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
|
||||
world.spawnEntityInWorld(item);
|
||||
} else {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
cast.amount = 0;
|
||||
cast.type = null;
|
||||
cast.markDirty();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block b, int i) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileEntityMachineStrandCaster) {
|
||||
TileEntityMachineStrandCaster cast = (TileEntityMachineStrandCaster) te;
|
||||
|
||||
if (cast.amount > 0) {
|
||||
ItemStack scrap = ItemScraps.create(new Mats.MaterialStack(cast.type, cast.amount));
|
||||
EntityItem item = new EntityItem(world, x + 0.5, y + this.maxY, z + 0.5, scrap);
|
||||
world.spawnEntityInWorld(item);
|
||||
cast.amount = 0; //just for safety
|
||||
}
|
||||
}
|
||||
super.breakBlock(world, x, y, z, b, i);
|
||||
}
|
||||
|
||||
public void printHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z) {
|
||||
int[] coords = findCore(world, x, y, z);
|
||||
if (coords == null) return;
|
||||
|
||||
TileEntityMachineStrandCaster cast = (TileEntityMachineStrandCaster) world.getTileEntity(coords[0], coords[1], coords[2]);
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
if (cast != null) {
|
||||
if (cast.slots[0] == null) {
|
||||
text.add(EnumChatFormatting.RED + I18nUtil.resolveKey("foundry.noCast"));
|
||||
} else if (cast.slots[0].getItem() == ModItems.mold) {
|
||||
ItemMold.Mold mold = ((ItemMold) cast.slots[0].getItem()).getMold(cast.slots[0]);
|
||||
text.add(EnumChatFormatting.BLUE + mold.getTitle());
|
||||
}
|
||||
}
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(this.getUnlocalizedName() + ".name"), 0xFF4000, 0x401000, text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
x += dir.offsetX * o;
|
||||
z += dir.offsetZ * o;
|
||||
|
||||
if (!MultiblockHandlerXR.checkSpace(world, x, y, z, getDimensions(), x, y, z, dir)) return false;
|
||||
return MultiblockHandlerXR.checkSpace(world, x, y, z, new int[]{2, 0, 1, 0, 1, 0}, x, y, z, dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||
if (tool != ToolType.SCREWDRIVER)
|
||||
return false;
|
||||
|
||||
int[] coords = findCore(world, x, y, z);
|
||||
TileEntityMachineStrandCaster cast = (TileEntityMachineStrandCaster) world.getTileEntity(coords[0], coords[1], coords[2]);
|
||||
|
||||
if (cast.slots[0] == null)
|
||||
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());
|
||||
world.spawnEntityInWorld(item);
|
||||
} else {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
}
|
||||
|
||||
cast.markDirty();
|
||||
|
||||
cast.slots[0] = null;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ReactorCore extends BlockContainer {
|
||||
|
||||
public boolean keepInventory = false;
|
||||
public Random field_149933_a = new Random();
|
||||
|
||||
public ReactorCore(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -1,158 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
|
||||
import api.hbm.fluid.IFluidConnectorBlock;
|
||||
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.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.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class ReactorHatch extends Block implements IFluidConnectorBlock {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
public ReactorHatch(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":reactor_hatch");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":brick_concrete");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
//this.setDefaultDirection(world, x, y, z);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
@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())
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 2)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z + 2) instanceof TileEntityMachineReactorLarge)
|
||||
{
|
||||
if(((TileEntityMachineReactorLarge)world.getTileEntity(x, y, z + 2)).checkBody())
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z + 2);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 3)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z - 2) instanceof TileEntityMachineReactorLarge)
|
||||
{
|
||||
if(((TileEntityMachineReactorLarge)world.getTileEntity(x, y, z - 2)).checkBody())
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z - 2);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 4)
|
||||
{
|
||||
if(world.getTileEntity(x + 2, y, z) instanceof TileEntityMachineReactorLarge)
|
||||
{
|
||||
if(((TileEntityMachineReactorLarge)world.getTileEntity(x + 2, y, z)).checkBody())
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x + 2, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 5)
|
||||
{
|
||||
if(world.getTileEntity(x - 2, y, z) instanceof TileEntityMachineReactorLarge)
|
||||
{
|
||||
if(((TileEntityMachineReactorLarge)world.getTileEntity(x - 2, y, z)).checkBody())
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x - 2, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Nuclear Reactor Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
return type == Fluids.WATER || type == Fluids.COOLANT || type == Fluids.STEAM || type == Fluids.HOTSTEAM || type == Fluids.SUPERHOTSTEAM || type == Fluids.ULTRAHOTSTEAM;
|
||||
}
|
||||
}
|
||||
@ -209,13 +209,15 @@ public class SoyuzLauncher extends BlockDummyable {
|
||||
}
|
||||
}
|
||||
|
||||
for(int l = 0; l < 10; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_launcher, 38)));
|
||||
for(int l = 0; l < 8; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.concrete_smooth, 41)));
|
||||
for(int l = 0; l < 6; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_launcher, 64)));
|
||||
for(int l = 0; l < 4; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.concrete_smooth, 64)));
|
||||
for(int l = 0; l < 6; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 64)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 53)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_launcher, 30)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 63)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.concrete_smooth, 38)));
|
||||
|
||||
world.func_147453_f(x, y, z, p_149749_5_);
|
||||
}
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class WatzCore extends BlockContainer {
|
||||
|
||||
public WatzCore(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityWatzCore();
|
||||
}
|
||||
}
|
||||
@ -1,158 +0,0 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
||||
|
||||
import api.hbm.fluid.IFluidConnectorBlock;
|
||||
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.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.util.ChatComponentText;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class WatzHatch extends Block implements IFluidConnectorBlock {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
|
||||
public WatzHatch(Material p_i45394_1_) {
|
||||
super(p_i45394_1_);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":watz_hatch");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":reinforced_brick");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
||||
{
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
super.onBlockAdded(world, x, y, z);
|
||||
//this.setDefaultDirection(world, x, y, z);
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
||||
@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())
|
||||
{
|
||||
if(world.getBlockMetadata(x, y, z) == 2)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z + 3) instanceof TileEntityWatzCore)
|
||||
{
|
||||
if(((TileEntityWatzCore)world.getTileEntity(x, y, z + 3)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z + 3);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 3)
|
||||
{
|
||||
if(world.getTileEntity(x, y, z - 3) instanceof TileEntityWatzCore)
|
||||
{
|
||||
if(((TileEntityWatzCore)world.getTileEntity(x, y, z - 3)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z - 3);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 4)
|
||||
{
|
||||
if(world.getTileEntity(x + 3, y, z) instanceof TileEntityWatzCore)
|
||||
{
|
||||
if(((TileEntityWatzCore)world.getTileEntity(x + 3, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x + 3, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
if(world.getBlockMetadata(x, y, z) == 5)
|
||||
{
|
||||
if(world.getTileEntity(x - 3, y, z) instanceof TileEntityWatzCore)
|
||||
{
|
||||
if(((TileEntityWatzCore)world.getTileEntity(x - 3, y, z)).isStructureValid(world))
|
||||
{
|
||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x - 3, y, z);
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Structure not valid!"));
|
||||
}
|
||||
} else {
|
||||
player.addChatMessage(new ChatComponentText("[Watz Power Plant] Error: Reactor Core not found!"));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir) {
|
||||
return type == Fluids.WATZ;
|
||||
}
|
||||
}
|
||||
@ -75,22 +75,24 @@ public class FalloutConfigJSON {
|
||||
entries.add(new FalloutEntry() .mB(Blocks.leaves2) .prim(new Triplet(ModBlocks.waste_leaves, 0, 1)) .min(woodEffectRange));
|
||||
|
||||
entries.add(new FalloutEntry().mB(Blocks.mossy_cobblestone).prim(new Triplet(Blocks.coal_ore, 0, 1)));
|
||||
entries.add(new FalloutEntry().mB(Blocks.coal_ore).prim(new Triplet(Blocks.diamond_ore, 0, 3), new Triplet(Blocks.emerald_ore, 0, 2)).c(0.5));
|
||||
entries.add(new FalloutEntry().mB(ModBlocks.ore_lignite).prim(new Triplet(Blocks.diamond_ore, 0, 1)).c(0.2));
|
||||
entries.add(new FalloutEntry().mB(ModBlocks.ore_uranium).prim(new Triplet(ModBlocks.ore_schrabidium, 0, 1), new Triplet(ModBlocks.ore_uranium_scorched, 0, 99)));
|
||||
entries.add(new FalloutEntry().mB(ModBlocks.ore_nether_uranium).prim(new Triplet(ModBlocks.ore_nether_schrabidium, 0, 1), new Triplet(ModBlocks.ore_nether_uranium_scorched, 0, 99)));
|
||||
entries.add(new FalloutEntry().mB(ModBlocks.ore_gneiss_uranium).prim(new Triplet(ModBlocks.ore_gneiss_schrabidium, 0, 1), new Triplet(ModBlocks.ore_gneiss_uranium_scorched, 0, 99)));
|
||||
|
||||
Block deepslate = Compat.tryLoadBlock(Compat.MOD_EF, "deepslate");
|
||||
Block stone = Compat.tryLoadBlock(Compat.MOD_EF, "stone");
|
||||
|
||||
for(int i = 1; i <= 10; i++) {
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.rock));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(Blocks.gravel));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.ground));
|
||||
if(i <= 9) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mMa(Material.grass));
|
||||
if(deepslate != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(deepslate));
|
||||
if(stone != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, 10 - i, 1)).max(i * 5).sol(true).mB(stone));
|
||||
int m = 10 - i;
|
||||
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_diamond, m, 3), new Triplet(ModBlocks.ore_sellafield_emerald, m, 2)) .c(0.5) .max(i * 5).sol(true).mB(Blocks.coal_ore));
|
||||
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_diamond, m, 1)) .c(0.2) .max(i * 5).sol(true).mB(ModBlocks.ore_lignite));
|
||||
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_emerald, m, 1)) .max(i * 5).sol(true).mB(ModBlocks.ore_beryllium));
|
||||
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_schrabidium, m, 1), new Triplet(ModBlocks.ore_sellafield_uranium_scorched, m, 99)) .max(i * 5).sol(true).mB(ModBlocks.ore_uranium));
|
||||
entries.add(new FalloutEntry().prim(new Triplet(ModBlocks.ore_sellafield_schrabidium, m, 1), new Triplet(ModBlocks.ore_sellafield_uranium_scorched, m, 99)) .max(i * 5).sol(true).mB(ModBlocks.ore_gneiss_uranium));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mMa(Material.rock));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mMa(Material.sand));
|
||||
entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mMa(Material.ground));
|
||||
if(i <= 9) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mMa(Material.grass));
|
||||
if(deepslate != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mB(deepslate));
|
||||
if(stone != null) entries.add(new FalloutEntry() .prim(new Triplet(ModBlocks.sellafield_slaked, m, 1)).max(i * 5).sol(true).mB(stone));
|
||||
}
|
||||
|
||||
//entries.add(new FalloutEntry().mB(Blocks.grass).prim(new Triplet(ModBlocks.waste_earth, 0, 1)));
|
||||
|
||||
@ -111,6 +111,10 @@ public class WorldConfig {
|
||||
public static int craterBiomeId = 80;
|
||||
public static int craterBiomeInnerId = 81;
|
||||
public static int craterBiomeOuterId = 82;
|
||||
public static float craterBiomeRad = 5F;
|
||||
public static float craterBiomeInnerRad = 25F;
|
||||
public static float craterBiomeOuterRad = 0.5F;
|
||||
public static float craterBiomeWaterMult = 5F;
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
@ -223,9 +227,13 @@ public class WorldConfig {
|
||||
meteorShowerDuration = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.05_meteorShowerDuration", "Max duration of meteor shower in ticks", 20 * 60 * 30);
|
||||
|
||||
final String CATEGORY_BIOMES = CommonConfig.CATEGORY_BIOMES;
|
||||
craterBiomeId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.00_craterBiomeId", "The numeric ID for the crater biome", 80);
|
||||
craterBiomeInnerId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.01_craterBiomeInnerId", "The numeric ID for the inner crater biome", 81);
|
||||
craterBiomeOuterId = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "17.02_craterBiomeOuterId", "The numeric ID for the outer crater biome", 82);
|
||||
craterBiomeId = CommonConfig.createConfigInt(config, CATEGORY_BIOMES, "17.B00_craterBiomeId", "The numeric ID for the crater biome", 80);
|
||||
craterBiomeInnerId = CommonConfig.createConfigInt(config, CATEGORY_BIOMES, "17.B01_craterBiomeInnerId", "The numeric ID for the inner crater biome", 81);
|
||||
craterBiomeOuterId = CommonConfig.createConfigInt(config, CATEGORY_BIOMES, "17.B02_craterBiomeOuterId", "The numeric ID for the outer crater biome", 82);
|
||||
craterBiomeRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R00_craterBiomeRad", "RAD/s for the crater biome", 5D);
|
||||
craterBiomeInnerRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R01_craterBiomeInnerRad", "RAD/s for the inner crater biome", 25D);
|
||||
craterBiomeOuterRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R02_craterBiomeOuterRad", "RAD/s for the outer crater biome", 0.5D);
|
||||
craterBiomeWaterMult = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R03_craterBiomeWaterMult", "Multiplier for RAD/s in crater biomes when in water", 5D);
|
||||
|
||||
radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
|
||||
antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000);
|
||||
|
||||
@ -164,8 +164,8 @@ public class ConsumableRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_polonium, 1), new Object[] { "DPD", "PSP", "DPD", 'D', ModItems.ducttape, 'P', IRON.plate(), 'S', PO210.block() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_era, 1), new Object[] { "DPD", "PSP", "DPD", 'D', ModItems.ducttape, 'P', IRON.plate(), 'S', ModItems.ingot_semtex });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_kevlar, 1), new Object[] { "KIK", "IDI", "KIK", 'K', ModItems.plate_kevlar, 'I', ANY_RUBBER.ingot(), 'D', ModItems.ducttape });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_sapi, 1), new Object[] { "PKP", "DPD", "PKP", 'P', POLYMER.ingot(), 'K', ModItems.insert_kevlar, 'D', ModItems.ducttape });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_esapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', POLYMER.ingot(), 'K', ModItems.insert_sapi, 'D', ModItems.ducttape, 'S', BIGMT.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_sapi, 1), new Object[] { "PKP", "DPD", "PKP", 'P', ANY_PLASTIC.ingot(), 'K', ModItems.insert_kevlar, 'D', ModItems.ducttape });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_esapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ANY_PLASTIC.ingot(), 'K', ModItems.insert_sapi, 'D', ModItems.ducttape, 'S', BIGMT.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_xsapi, 1), new Object[] { "PKP", "DSD", "PKP", 'P', ASBESTOS.ingot(), 'K', ModItems.insert_esapi, 'D', ModItems.ducttape, 'S', ModItems.ingot_meteorite_forged });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.insert_yharonite, 1), new Object[] { "YIY", "IYI", "YIY", 'Y', ModItems.billet_yharonite, 'I', ModItems.insert_du });
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ public class WeaponRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "TPS", "HHR", " L", 'T', STEEL.bolt(), 'P', STEEL.plate(), 'S', STEEL.ingot(), 'H', ModItems.hull_small_steel, 'R', ModItems.mechanism_rifle_1, 'L', ANY_PLASTIC.ingot()});
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_glass_cannon, 1), new Object[] { "GGC", "GTM", 'G', Item.getItemFromBlock(ModBlocks.glass_quartz), 'C', ModItems.battery_lithium_cell, 'T', ModItems.crt_display, 'M', ModItems.mechanism_special });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_remington, 1), new Object[] { "PPM", "S L", 'P', STEEL.plate(), 'M', ModItems.mechanism_rifle_1, 'S', KEY_SLAB, 'L', KEY_LOG });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_benelli), new Object[] { "HHP", "SSM", "AAP", 'H', ModItems.ingot_dura_steel, 'S', ModItems.hull_small_steel, 'A', ModItems.hull_small_aluminium, 'P', ModItems.ingot_polymer, 'M', ModItems.mechanism_rifle_2 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_benelli), new Object[] { "HHP", "SSM", "AAP", 'H', ModItems.ingot_dura_steel, 'S', ModItems.hull_small_steel, 'A', ModItems.hull_small_aluminium, 'P', ANY_PLASTIC.ingot(), 'M', ModItems.mechanism_rifle_2 });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_lunatic_marksman), new Object[] { " GN", "SSM", " A", 'G', KEY_ANYPANE, 'N', ModItems.powder_nitan_mix, 'S', BIGMT.plate(), 'M', ModItems.mechanism_special, 'A', ANY_RESISTANTALLOY.plateCast() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_coilgun), new Object[] { "CCC", "SSM", " P", 'C', ModBlocks.capacitor_copper, 'S', BIGMT.plate(), 'M', ModItems.mechanism_special, 'P', ANY_PLASTIC.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_coilgun, 16, 0), new Object[] { " T ", "TST", " T ", 'T', W.ingot(), 'S', BIGMT.ingot() });
|
||||
|
||||
@ -117,7 +117,7 @@ public class EntityNukeTorex extends Entity {
|
||||
// spawn condensation clouds
|
||||
if(ticksExisted > 200 && ticksExisted < 600) {
|
||||
|
||||
for(int i = 0; i < 50; i++) {
|
||||
for(int i = 0; i < 20; i++) {
|
||||
for(int j = 0; j < 4; j++) {
|
||||
float angle = (float) (Math.PI * 2 * rand.nextDouble());
|
||||
Vec3 vec = Vec3.createVectorHelper(torusWidth + rollerSize * 3, 0, 0);
|
||||
@ -131,7 +131,7 @@ public class EntityNukeTorex extends Entity {
|
||||
}
|
||||
if(ticksExisted > 300 && ticksExisted < 600) {
|
||||
|
||||
for(int i = 0; i < 50; i++) {
|
||||
for(int i = 0; i < 20; i++) {
|
||||
for(int j = 0; j < 4; j++) {
|
||||
float angle = (float) (Math.PI * 2 * rand.nextDouble());
|
||||
Vec3 vec = Vec3.createVectorHelper(torusWidth + rollerSize * 2, 0, 0);
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Random;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.config.WorldConfig;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
@ -30,6 +31,7 @@ import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
import com.hbm.world.biome.BiomeGenCraterBase;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
@ -48,6 +50,7 @@ import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class EntityEffectHandler {
|
||||
|
||||
@ -57,6 +60,17 @@ public class EntityEffectHandler {
|
||||
HbmLivingProps.setRadBuf(entity, HbmLivingProps.getRadEnv(entity));
|
||||
HbmLivingProps.setRadEnv(entity, 0);
|
||||
}
|
||||
|
||||
if(entity instanceof EntityPlayer && entity == MainRegistry.proxy.me()) {
|
||||
EntityPlayer player = MainRegistry.proxy.me();
|
||||
if(player != null) {
|
||||
BiomeGenBase biome = player.worldObj.getBiomeGenForCoords((int) Math.floor(player.posX), (int) Math.floor(player.posZ));
|
||||
if(biome == BiomeGenCraterBase.craterBiome || biome == BiomeGenCraterBase.craterInnerBiome) {
|
||||
Random rand = player.getRNG();
|
||||
for(int i = 0; i < 3; i++) player.worldObj.spawnParticle("townaura", player.posX + rand.nextGaussian() * 3, player.posY + rand.nextGaussian() * 2, player.posZ + rand.nextGaussian() * 3, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(entity instanceof EntityPlayerMP) {
|
||||
HbmLivingProps props = HbmLivingProps.getData(entity);
|
||||
@ -89,6 +103,18 @@ public class EntityEffectHandler {
|
||||
if(GeneralConfig.enable528 && entity instanceof EntityLivingBase && !entity.isImmuneToFire() && entity.worldObj.provider.isHellWorld) {
|
||||
entity.setFire(5);
|
||||
}
|
||||
|
||||
BiomeGenBase biome = entity.worldObj.getBiomeGenForCoords((int) Math.floor(entity.posX), (int) Math.floor(entity.posZ));
|
||||
float radiation = 0;
|
||||
if(biome == BiomeGenCraterBase.craterOuterBiome) radiation = WorldConfig.craterBiomeOuterRad;
|
||||
if(biome == BiomeGenCraterBase.craterBiome) radiation = WorldConfig.craterBiomeRad;
|
||||
if(biome == BiomeGenCraterBase.craterInnerBiome) radiation = WorldConfig.craterBiomeInnerRad;
|
||||
|
||||
if(entity.isWet()) radiation *= WorldConfig.craterBiomeWaterMult;
|
||||
|
||||
if(radiation > 0) {
|
||||
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, radiation / 20F);
|
||||
}
|
||||
}
|
||||
|
||||
handleContamination(entity);
|
||||
|
||||
@ -83,12 +83,12 @@ public class ConstructionHandler extends NEIUniversalHandler {
|
||||
|
||||
/* SOYUZ LAUNCHER */
|
||||
ItemStack[] soysauce = new ItemStack[] {
|
||||
new ItemStack(ModBlocks.struct_launcher, 60),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.struct_launcher, 320), EnumChatFormatting.RED + "5x64"),
|
||||
new ItemStack(ModBlocks.struct_scaffold, 53),
|
||||
new ItemStack(ModBlocks.struct_launcher, 30),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.struct_launcher, 384), EnumChatFormatting.RED + "6x64"),
|
||||
new ItemStack(ModBlocks.struct_scaffold, 63),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.struct_scaffold, 384), EnumChatFormatting.RED + "6x64"),
|
||||
new ItemStack(ModBlocks.concrete_smooth, 8),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.concrete_smooth, 320), EnumChatFormatting.RED + "5x64"),};
|
||||
new ItemStack(ModBlocks.concrete_smooth, 38),
|
||||
ItemStackUtil.addTooltipToStack(new ItemStack(ModBlocks.concrete_smooth, 320), EnumChatFormatting.RED + "4x64"),};
|
||||
|
||||
bufferedRecipes.put(soysauce, new ItemStack(ModBlocks.soyuz_launcher));
|
||||
bufferedTools.put(soysauce, new ItemStack(ModBlocks.struct_soyuz_core));
|
||||
|
||||
@ -13,6 +13,7 @@ import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBreedingRod.BreedingRodType;
|
||||
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
|
||||
import com.hbm.items.machine.ItemRTGPelletDepleted.DepletedRTGMaterial;
|
||||
import com.hbm.items.machine.ItemWatzPellet.EnumWatzType;
|
||||
import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType;
|
||||
@ -442,6 +443,22 @@ public class HazardRegistry {
|
||||
HazardSystem.register(DictFrame.fromOne(ModItems.watz_pellet, EnumWatzType.DU), makeData(RADIATION, u238 * ingot * 4));
|
||||
HazardSystem.register(DictFrame.fromOne(ModItems.watz_pellet, EnumWatzType.NQD), makeData(RADIATION, u235 * ingot * 4));
|
||||
HazardSystem.register(DictFrame.fromOne(ModItems.watz_pellet, EnumWatzType.NQR), makeData(RADIATION, pu239 * ingot * 4));
|
||||
|
||||
registerPWRFuel(EnumPWRFuel.MEU, uf * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HEU233, u233 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HEU235, u235 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.MEN, npf * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HEN237, np237 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.MOX, mox * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.MEP, purg * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HEP239, pu239 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HEP241, pu241 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.MEA, amrg * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HEA242, am242 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HES326, sa326 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.HES327, sa327 * billet * 2);
|
||||
registerPWRFuel(EnumPWRFuel.BFB_AM_MIX, amrg * billet);
|
||||
registerPWRFuel(EnumPWRFuel.BFB_PU241, pu241 * billet);
|
||||
|
||||
HazardSystem.register(powder_yellowcake, makeData(RADIATION, yc * powder));
|
||||
HazardSystem.register(block_yellowcake, makeData(RADIATION, yc * block * powder_mult));
|
||||
@ -535,6 +552,12 @@ public class HazardRegistry {
|
||||
private static HazardData makeData(HazardTypeBase hazard, float level) { return new HazardData().addEntry(hazard, level); }
|
||||
private static HazardData makeData(HazardTypeBase hazard, float level, boolean override) { return new HazardData().addEntry(hazard, level, override); }
|
||||
|
||||
private static void registerPWRFuel(EnumPWRFuel fuel, float baseRad) {
|
||||
HazardSystem.register(DictFrame.fromOne(ModItems.pwr_fuel, fuel), makeData(RADIATION, baseRad));
|
||||
HazardSystem.register(DictFrame.fromOne(ModItems.pwr_fuel_hot, fuel), makeData(RADIATION, baseRad * 10).addEntry(HOT, 5));
|
||||
HazardSystem.register(DictFrame.fromOne(ModItems.pwr_fuel_depleted, fuel), makeData(RADIATION, baseRad * 10));
|
||||
}
|
||||
|
||||
private static void registerRBMKPellet(Item pellet, float base, float dep) { registerRBMKPellet(pellet, base, dep, false, 0F, 0F); }
|
||||
private static void registerRBMKPellet(Item pellet, float base, float dep, boolean linear) { registerRBMKPellet(pellet, base, dep, linear, 0F, 0F); }
|
||||
private static void registerRBMKPellet(Item pellet, float base, float dep, boolean linear, float blinding, float digamma) {
|
||||
|
||||
@ -314,13 +314,13 @@ public class OreDictManager {
|
||||
GOLD.plate(plate_gold).dust(powder_gold).ore(ore_gneiss_gold);
|
||||
LAPIS.dust(powder_lapis);
|
||||
NETHERQUARTZ.gem(Items.quartz).dust(powder_quartz).ore(Blocks.quartz_ore);
|
||||
DIAMOND.dust(powder_diamond).ore(gravel_diamond);
|
||||
EMERALD.dust(powder_emerald);
|
||||
DIAMOND.dust(powder_diamond).ore(gravel_diamond, ore_sellafield_diamond);
|
||||
EMERALD.dust(powder_emerald, ore_sellafield_emerald);
|
||||
|
||||
/*
|
||||
* RADIOACTIVE
|
||||
*/
|
||||
U .rad(HazardRegistry.u) .nugget(nugget_uranium) .billet(billet_uranium) .ingot(ingot_uranium) .dust(powder_uranium) .block(block_uranium) .ore(ore_uranium, ore_uranium_scorched, ore_gneiss_uranium, ore_gneiss_uranium_scorched, ore_nether_uranium, ore_nether_uranium_scorched, ore_meteor_uranium) .oreNether(ore_nether_uranium, ore_nether_uranium_scorched);
|
||||
U .rad(HazardRegistry.u) .nugget(nugget_uranium) .billet(billet_uranium) .ingot(ingot_uranium) .dust(powder_uranium) .block(block_uranium) .ore(ore_uranium, ore_uranium_scorched, ore_gneiss_uranium, ore_gneiss_uranium_scorched, ore_nether_uranium, ore_nether_uranium_scorched, ore_meteor_uranium, ore_sellafield_uranium_scorched) .oreNether(ore_nether_uranium, ore_nether_uranium_scorched);
|
||||
U233 .rad(HazardRegistry.u233) .nugget(nugget_u233) .billet(billet_u233) .ingot(ingot_u233) .block(block_u233);
|
||||
U235 .rad(HazardRegistry.u235) .nugget(nugget_u235) .billet(billet_u235) .ingot(ingot_u235) .block(block_u235);
|
||||
U238 .rad(HazardRegistry.u238) .nugget(nugget_u238) .billet(billet_u238) .ingot(ingot_u238) .block(block_u238);
|
||||
@ -342,7 +342,7 @@ public class OreDictManager {
|
||||
CO60 .rad(HazardRegistry.co60) .hot(1) .nugget(nugget_co60) .billet(billet_co60) .ingot(ingot_co60) .dust(powder_co60);
|
||||
AU198 .rad(HazardRegistry.au198) .hot(5) .nugget(nugget_au198) .billet(billet_au198) .ingot(ingot_au198) .dust(powder_au198);
|
||||
PB209 .rad(HazardRegistry.pb209) .blinding(50F) .hot(7) .nugget(nugget_pb209) .billet(billet_pb209) .ingot(ingot_pb209);
|
||||
SA326 .rad(HazardRegistry.sa326) .blinding(50F) .nugget(nugget_schrabidium) .billet(billet_schrabidium) .ingot(ingot_schrabidium) .dust(powder_schrabidium).plate(plate_schrabidium).plateCast(Mats.MAT_SCHRABIDIUM.make(plate_cast)).block(block_schrabidium).ore(ore_schrabidium, ore_gneiss_schrabidium, ore_nether_schrabidium) .oreNether(ore_nether_schrabidium);
|
||||
SA326 .rad(HazardRegistry.sa326) .blinding(50F) .nugget(nugget_schrabidium) .billet(billet_schrabidium) .ingot(ingot_schrabidium) .dust(powder_schrabidium).plate(plate_schrabidium).plateCast(Mats.MAT_SCHRABIDIUM.make(plate_cast)).block(block_schrabidium).ore(ore_schrabidium, ore_gneiss_schrabidium, ore_nether_schrabidium, ore_sellafield_schrabidium) .oreNether(ore_nether_schrabidium);
|
||||
SA327 .rad(HazardRegistry.sa327) .blinding(50F) .nugget(nugget_solinium) .billet(billet_solinium) .ingot(ingot_solinium) .block(block_solinium);
|
||||
SBD .rad(HazardRegistry.sb) .blinding(50F) .ingot(ingot_schrabidate) .dust(powder_schrabidate) .block(block_schrabidate);
|
||||
SRN .rad(HazardRegistry.sr) .blinding(50F) .ingot(ingot_schraranium) .block(block_schraranium);
|
||||
|
||||
@ -1,115 +0,0 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.inventory.SlotTakeOnly;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCMBFactory;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineCMBFactory extends Container {
|
||||
|
||||
private TileEntityMachineCMBFactory diFurnace;
|
||||
private int progress;
|
||||
|
||||
public ContainerMachineCMBFactory(InventoryPlayer invPlayer, TileEntityMachineCMBFactory tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 62 + 9, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 80 + 9, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 62 + 9, 53));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 80 + 9, 53));
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 4, 134 + 9, 35));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 5, 62 - 9, 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 void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.process);
|
||||
}
|
||||
|
||||
@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 <= 5) {
|
||||
if (!this.mergeItemStack(var5, 6, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!this.mergeItemStack(var5, 0, 4, false))
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.progress != this.diFurnace.process)
|
||||
{
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.process);
|
||||
}
|
||||
}
|
||||
|
||||
this.progress = this.diFurnace.process;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 1)
|
||||
{
|
||||
diFurnace.process = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,116 +0,0 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerMachineMiningDrill extends Container {
|
||||
|
||||
private TileEntityMachineMiningDrill nukeBoy;
|
||||
|
||||
private int warning;
|
||||
|
||||
public ContainerMachineMiningDrill(InventoryPlayer invPlayer, TileEntityMachineMiningDrill tedf) {
|
||||
|
||||
nukeBoy = tedf;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 44, 53));
|
||||
//Outputs
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 80, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 98, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 116, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 80, 35));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 98, 35));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 116, 35));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 80, 53));
|
||||
this.addSlotToContainer(new Slot(tedf, 8, 98, 53));
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 116, 53));
|
||||
//Upgrades
|
||||
this.addSlotToContainer(new Slot(tedf, 10, 152, 17));
|
||||
this.addSlotToContainer(new Slot(tedf, 11, 152, 35));
|
||||
this.addSlotToContainer(new Slot(tedf, 12, 152, 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));
|
||||
}
|
||||
|
||||
this.detectAndSendChanges();
|
||||
}
|
||||
|
||||
@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 <= 12) {
|
||||
if (!this.mergeItemStack(var5, 13, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(var5, 0, 13, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return nukeBoy.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++) {
|
||||
ICrafting par1 = (ICrafting) this.crafters.get(i);
|
||||
|
||||
if(this.warning != this.nukeBoy.warning) {
|
||||
par1.sendProgressBarUpdate(this, 1, this.nukeBoy.warning);
|
||||
}
|
||||
}
|
||||
|
||||
this.warning = this.nukeBoy.warning;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 1) {
|
||||
nukeBoy.warning = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotCraftingOutput;
|
||||
import com.hbm.inventory.SlotNonRetarded;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineStrandCaster;
|
||||
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;
|
||||
|
||||
public class ContainerMachineStrandCaster extends Container {
|
||||
|
||||
protected TileEntityMachineStrandCaster caster;
|
||||
|
||||
public ContainerMachineStrandCaster(InventoryPlayer invPlayer, TileEntityMachineStrandCaster caster) {
|
||||
this.caster = caster;
|
||||
|
||||
//the wretched mold
|
||||
this.addSlotToContainer(new SlotNonRetarded(this.caster, 0, 57, 62));
|
||||
|
||||
//output
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, this.caster, j + i * 2 + 1, 125 + j * 18, 26 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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, 132 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 190));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack stack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
ItemStack originalStack = slot.getStack();
|
||||
stack = originalStack.copy();
|
||||
|
||||
if (index <= 6) {
|
||||
if (!InventoryUtil.mergeItemStack(this.inventorySlots, originalStack, 7, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onSlotChange(originalStack, stack);
|
||||
|
||||
} else if (!InventoryUtil.mergeItemStack(this.inventorySlots, originalStack, 1, 2, false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (originalStack.stackSize == 0) {
|
||||
slot.putStack(null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return caster.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -1,88 +0,0 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotTakeOnly;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
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 ContainerReactorMultiblock extends Container {
|
||||
|
||||
private TileEntityMachineReactorLarge diFurnace;
|
||||
|
||||
public ContainerReactorMultiblock(InventoryPlayer invPlayer, TileEntityMachineReactorLarge tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
//Water in
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 90));
|
||||
//Water out
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 1, 8, 108));
|
||||
//Coolant in
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 26, 90));
|
||||
//Coolant out
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 3, 26, 108));
|
||||
|
||||
//Fuel in
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 80, 36));
|
||||
//Fuel out
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 5, 80, 72));
|
||||
//Waste in
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 152, 36));
|
||||
//Waste out
|
||||
this.addSlotToContainer(new SlotTakeOnly(tedf, 7, 152, 72));
|
||||
|
||||
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++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@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 <= 7) {
|
||||
if (!this.mergeItemStack(var5, 8, this.inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -1,138 +0,0 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.WatzFuel;
|
||||
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
||||
|
||||
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.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerWatzCore extends Container {
|
||||
|
||||
private TileEntityWatzCore diFurnace;
|
||||
|
||||
public ContainerWatzCore(InventoryPlayer invPlayer, TileEntityWatzCore tedf) {
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 8, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 26, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 2, 44, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 3, 62, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 4, 80, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 5, 98, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 6, 8, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 7, 26, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 8, 44, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 9, 62, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 10, 80, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 11, 98, 36));
|
||||
this.addSlotToContainer(new Slot(tedf, 12, 8, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 13, 26, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 14, 44, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 15, 62, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 16, 80, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 17, 98, 54));
|
||||
this.addSlotToContainer(new Slot(tedf, 18, 8, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 19, 26, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 20, 44, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 21, 62, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 22, 80, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 23, 98, 72));
|
||||
this.addSlotToContainer(new Slot(tedf, 24, 8, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 25, 26, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 26, 44, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 27, 62, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 28, 80, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 29, 98, 90));
|
||||
this.addSlotToContainer(new Slot(tedf, 30, 8, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 31, 26, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 32, 44, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 33, 62, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 34, 80, 108));
|
||||
this.addSlotToContainer(new Slot(tedf, 35, 98, 108));
|
||||
//Mud Input
|
||||
this.addSlotToContainer(new Slot(tedf, 36, 134, 108 - 18));
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tedf, 37, 152, 108 - 18));
|
||||
//Filter
|
||||
this.addSlotToContainer(new Slot(tedf, 38, 116, 63));
|
||||
//Mud Output
|
||||
this.addSlotToContainer(new Slot(tedf, 39, 134, 108));
|
||||
|
||||
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++)
|
||||
{
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142 + 56));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
}
|
||||
|
||||
@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 <= 39) {
|
||||
if(!this.mergeItemStack(var5, 40, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if(var5.getItem() == ModItems.titanium_filter) {
|
||||
if(!this.mergeItemStack(var5, 38, 39, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(var5.getItem() instanceof WatzFuel) {
|
||||
if(!this.mergeItemStack(var5, 0, 36, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if(var5.getItem() instanceof IBatteryItem) {
|
||||
if(!this.mergeItemStack(var5, 37, 38, false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 36, 37, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
|
||||
var4.onPickupFromSlot(p_82846_1_, var5);
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
@ -1,59 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineCMBFactory;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineCMBFactory;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineCMBFactory extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_cmb_manufactory.png");
|
||||
private TileEntityMachineCMBFactory diFurnace;
|
||||
|
||||
public GUIMachineCMBFactory(InventoryPlayer invPlayer, TileEntityMachineCMBFactory tedf) {
|
||||
super(new ContainerMachineCMBFactory(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 69 - 52, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 106 - 88, 16, 88, diFurnace.power, diFurnace.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
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);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = (int)diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i);
|
||||
}
|
||||
|
||||
int j1 = diFurnace.getProgressScaled(24);
|
||||
drawTexturedModalRect(guiLeft + 101 + 9, guiTop + 34, 208, 0, j1 + 1, 16);
|
||||
|
||||
diFurnace.tank.renderTank(guiLeft + 26, guiTop + 69, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
@ -1,69 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineMiningDrill;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIMachineMiningDrill extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_drill.png");
|
||||
private TileEntityMachineMiningDrill diFurnace;
|
||||
|
||||
public GUIMachineMiningDrill(InventoryPlayer invPlayer, TileEntityMachineMiningDrill tedf) {
|
||||
super(new ContainerMachineMiningDrill(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 166;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 69 - 52, 16, 52, diFurnace.power, diFurnace.maxPower);
|
||||
|
||||
String[] upgradeText = new String[4];
|
||||
upgradeText[0] = I18nUtil.resolveKey("desc.gui.upgrade");
|
||||
upgradeText[1] = I18nUtil.resolveKey("desc.gui.upgrade.speed");
|
||||
upgradeText[2] = I18nUtil.resolveKey("desc.gui.upgrade.effectiveness");
|
||||
upgradeText[3] = I18nUtil.resolveKey("desc.gui.upgrade.power");
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 141, guiTop + 39, 8, 8, guiLeft + 100, guiTop + 39 + 16 + 8, upgradeText);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
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);
|
||||
|
||||
if(diFurnace.power > 0) {
|
||||
int i = (int)diFurnace.getPowerScaled(52);
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 69 - i, 176, 52 - i, 16, i);
|
||||
}
|
||||
|
||||
int k = diFurnace.warning;
|
||||
if(k == 2)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 192, 0, 16, 16);
|
||||
if(k == 1)
|
||||
drawTexturedModalRect(guiLeft + 44, guiTop + 17, 208, 0, 16, 16);
|
||||
|
||||
this.drawInfoPanel(guiLeft + 141, guiTop + 39, 8, 8, 8);
|
||||
}
|
||||
}
|
||||
@ -94,8 +94,8 @@ public class GUIMachineRadarNT extends GuiScreen {
|
||||
|
||||
if(!radar.entries.isEmpty()) {
|
||||
for(RadarEntry m : radar.entries) {
|
||||
int x = guiLeft + (int)((m.posX - radar.xCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D)) + 108;
|
||||
int z = guiTop + (int)((m.posZ - radar.zCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D)) + 117;
|
||||
int x = guiLeft + (int)((m.posX - radar.xCoord) / ((double) radar.getRange() * 2 + 1) * (200D - 8D)) + 108;
|
||||
int z = guiTop + (int)((m.posZ - radar.zCoord) / ((double) radar.getRange() * 2 + 1) * (200D - 8D)) + 117;
|
||||
|
||||
if(mouseX + 5 > x && mouseX - 4 <= x && mouseY + 5 > z && mouseY - 4 <= z) {
|
||||
|
||||
@ -107,8 +107,8 @@ public class GUIMachineRadarNT extends GuiScreen {
|
||||
}
|
||||
|
||||
if(checkClick(mouseX, mouseY, 8, 17, 200, 200)) {
|
||||
int tX = (int) ((lastMouseX - guiLeft - 108) * ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) / 192D + radar.xCoord);
|
||||
int tZ = (int) ((lastMouseY - guiTop - 117) * ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) / 192D + radar.zCoord);
|
||||
int tX = (int) ((lastMouseX - guiLeft - 108) * ((double) radar.getRange() * 2 + 1) / 192D + radar.xCoord);
|
||||
int tZ = (int) ((lastMouseY - guiTop - 117) * ((double) radar.getRange() * 2 + 1) / 192D + radar.zCoord);
|
||||
this.func_146283_a(Arrays.asList(tX + " / " + tZ), lastMouseX, lastMouseY);
|
||||
}
|
||||
}
|
||||
@ -190,8 +190,8 @@ public class GUIMachineRadarNT extends GuiScreen {
|
||||
|
||||
if(!radar.entries.isEmpty()) {
|
||||
for(RadarEntry m : radar.entries) {
|
||||
double x = (m.posX - radar.xCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D) - 4D;
|
||||
double z = (m.posZ - radar.zCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D) - 4D;
|
||||
double x = (m.posX - radar.xCoord) / ((double) radar.getRange() * 2 + 1) * (200D - 8D) - 4D;
|
||||
double z = (m.posZ - radar.zCoord) / ((double) radar.getRange() * 2 + 1) * (200D - 8D) - 4D;
|
||||
int t = m.blipLevel;
|
||||
drawTexturedModalRectDouble(guiLeft + 108 + x, guiTop + 117 + z, 216, 8 * t, 8, 8);
|
||||
}
|
||||
@ -226,8 +226,8 @@ public class GUIMachineRadarNT extends GuiScreen {
|
||||
|
||||
if(!radar.entries.isEmpty()) {
|
||||
for(RadarEntry m : radar.entries) {
|
||||
int x = guiLeft + (int) ((m.posX - radar.xCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D)) + 108;
|
||||
int z = guiTop + (int) ((m.posZ - radar.zCoord) / ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) * (200D - 8D)) + 117;
|
||||
int x = guiLeft + (int) ((m.posX - radar.xCoord) / ((double) radar.getRange() * 2 + 1) * (200D - 8D)) + 108;
|
||||
int z = guiTop + (int) ((m.posZ - radar.zCoord) / ((double) radar.getRange() * 2 + 1) * (200D - 8D)) + 117;
|
||||
|
||||
if(lastMouseX + 5 > x && lastMouseX - 4 <= x && lastMouseY + 5 > z && lastMouseY - 4 <= z) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
@ -239,8 +239,8 @@ public class GUIMachineRadarNT extends GuiScreen {
|
||||
}
|
||||
}
|
||||
|
||||
int tX = (int) ((lastMouseX - guiLeft - 108) * ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) / 192D + radar.xCoord);
|
||||
int tZ = (int) ((lastMouseY - guiTop - 117) * ((double) TileEntityMachineRadarNT.radarRange * 2 + 1) / 192D + radar.zCoord);
|
||||
int tX = (int) ((lastMouseX - guiLeft - 108) * ((double) radar.getRange() * 2 + 1) / 192D + radar.xCoord);
|
||||
int tZ = (int) ((lastMouseY - guiTop - 117) * ((double) radar.getRange() * 2 + 1) / 192D + radar.zCoord);
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("launchPosX", tX);
|
||||
data.setInteger("launchPosZ", tZ);
|
||||
|
||||
@ -52,6 +52,7 @@ public class GUIMachineRadarNTSlots extends GuiInfoContainer {
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.radar.hasCustomInventoryName() ? this.radar.getInventoryName() : I18n.format(this.radar.getInventoryName());
|
||||
if(MainRegistry.polaroidID == 11) name = "Reda";
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import com.hbm.inventory.container.ContainerMachineStrandCaster;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineStrandCaster;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class GUIMachineStrandCaster extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_strand_caster.png");
|
||||
private TileEntityMachineStrandCaster caster;
|
||||
|
||||
public GUIMachineStrandCaster(InventoryPlayer invPlayer, TileEntityMachineStrandCaster tedf) {
|
||||
super(new ContainerMachineStrandCaster(invPlayer, tedf));
|
||||
caster = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 214;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float interp) {
|
||||
super.drawScreen(x, y, interp);
|
||||
|
||||
drawStackInfo(x, y, 16, 17);
|
||||
|
||||
caster.water.renderTankInfo(this, x, y, guiLeft + 82, guiTop + 14, 16, 24);
|
||||
caster.steam.renderTankInfo(this, x, y, guiLeft + 82, guiTop + 65, 16, 24);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.caster.hasCustomInventoryName() ? this.caster.getInventoryName() : I18n.format(this.caster.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 4, 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);
|
||||
|
||||
if(caster.amount != 0) {
|
||||
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
|
||||
int targetHeight = Math.min((caster.amount) * 79 / caster.getCapacity(), 92);
|
||||
|
||||
int hex = caster.type.moltenColor;
|
||||
// hex = 0xC18336;
|
||||
Color color = new Color(hex);
|
||||
GL11.glColor3f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
|
||||
drawTexturedModalRect(guiLeft + 17, guiTop + 93 - targetHeight, 176, 89 - targetHeight, 34, targetHeight);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glColor4f(1F, 1F, 1F, 0.3F);
|
||||
drawTexturedModalRect(guiLeft + 17, guiTop + 93 - targetHeight, 176, 89 - targetHeight, 34, targetHeight);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
}
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor3f(255, 255, 255);
|
||||
|
||||
caster.water.renderTank(guiLeft + 82, guiTop + 38, this.zLevel, 16, 24);
|
||||
caster.steam.renderTank(guiLeft + 82, guiTop + 89, this.zLevel, 16, 24);
|
||||
|
||||
}
|
||||
|
||||
protected void drawStackInfo(int mouseX, int mouseY, int x, int y) {
|
||||
|
||||
List<String> list = new ArrayList();
|
||||
|
||||
if(caster.type == null)
|
||||
list.add(EnumChatFormatting.RED + "Empty");
|
||||
else
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey(caster.type.getUnlocalizedName()) + ": " + Mats.formatAmount(caster.amount, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + x, guiTop + y, 36, 81, mouseX, mouseY, list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,189 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerReactorMultiblock;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.AuxButtonPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
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.util.ResourceLocation;
|
||||
|
||||
public class GUIReactorMultiblock extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_reactor_large_experimental.png");
|
||||
private TileEntityMachineReactorLarge diFurnace;
|
||||
|
||||
public GUIReactorMultiblock(InventoryPlayer invPlayer, TileEntityMachineReactorLarge tedf) {
|
||||
super(new ContainerReactorMultiblock(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 222;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
diFurnace.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 88 - 52, 16, 52);
|
||||
diFurnace.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 88 - 52, 16, 52);
|
||||
diFurnace.tanks[2].renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 108, 88, 4);
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 114, 88, 4, new String[] { "Hull Temperature:", " " + Math.round((diFurnace.hullHeat) * 0.00001 * 980 + 20) + "°C" });
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 120, 88, 4, new String[] { "Core Temperature:", " " + Math.round((diFurnace.coreHeat) * 0.00002 * 980 + 20) + "°C" });
|
||||
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 115, guiTop + 17, 18, 90, new String[] { "Operating Level: " + diFurnace.rods + "%" });
|
||||
|
||||
String fuel = "";
|
||||
|
||||
switch(diFurnace.type) {
|
||||
case URANIUM:
|
||||
fuel = "Uranium";
|
||||
break;
|
||||
case MOX:
|
||||
fuel = "MOX";
|
||||
break;
|
||||
case PLUTONIUM:
|
||||
fuel = "Plutonium";
|
||||
break;
|
||||
case SCHRABIDIUM:
|
||||
fuel = "Schrabidium";
|
||||
break;
|
||||
case THORIUM:
|
||||
fuel = "Thorium";
|
||||
break;
|
||||
default:
|
||||
fuel = "ERROR";
|
||||
break;
|
||||
}
|
||||
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 98, guiTop + 18, 16, 88, new String[] { fuel + ": " + (diFurnace.fuel / diFurnace.fuelMult) + "/" + (diFurnace.maxFuel / diFurnace.fuelMult) + "ng" });
|
||||
this.drawCustomInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 18, 16, 88, new String[] { "Depleted " + fuel + ": " + (diFurnace.waste / diFurnace.fuelMult) + "/" + (diFurnace.maxWaste / diFurnace.fuelMult) + "ng" });
|
||||
|
||||
String[] text0 = new String[] { diFurnace.rods > 0 ? "Reactor is ON" : "Reactor is OFF"};
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 52, guiTop + 53, 18, 18, mouseX, mouseY, text0);
|
||||
|
||||
String s = "0";
|
||||
|
||||
FluidType type = diFurnace.tanks[2].getTankType();
|
||||
if(type == Fluids.STEAM) s = "1x";
|
||||
if(type == Fluids.HOTSTEAM) s = "10x";
|
||||
if(type == Fluids.SUPERHOTSTEAM) s = "100x";
|
||||
|
||||
String[] text4 = new String[] { "Steam compression switch",
|
||||
"Current compression level: " + s};
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 63, guiTop + 107, 14, 18, mouseX, mouseY, text4);
|
||||
}
|
||||
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 115 <= x && guiLeft + 115 + 18 > x && guiTop + 17 < y && guiTop + 17 + 90 >= y) {
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
|
||||
int rods = (y - (guiTop + 24)) * 100 / 76;
|
||||
|
||||
if(rods < 0)
|
||||
rods = 0;
|
||||
|
||||
if(rods > 100)
|
||||
rods = 100;
|
||||
|
||||
rods = 100 - rods;
|
||||
|
||||
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord, rods, 0));
|
||||
}
|
||||
|
||||
if(guiLeft + 63 <= x && guiLeft + 63 + 14 > x && guiTop + 107 < y && guiTop + 107 + 18 >= y) {
|
||||
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
int c = 0;
|
||||
|
||||
FluidType type = diFurnace.tanks[2].getTankType();
|
||||
if(type == Fluids.STEAM) c = 0;
|
||||
if(type == Fluids.HOTSTEAM) c = 1;
|
||||
if(type == Fluids.SUPERHOTSTEAM) c = 2;
|
||||
|
||||
PacketDispatcher.wrapper.sendToServer(new AuxButtonPacket(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord, c, 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
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 k = diFurnace.rods;
|
||||
drawTexturedModalRect(guiLeft + 115, guiTop + 107 - 14 - (k * 76 / 100), 208, 36, 18, 14);
|
||||
|
||||
if(diFurnace.rods > 0)
|
||||
drawTexturedModalRect(guiLeft + 52, guiTop + 53, 212, 0, 18, 18);
|
||||
|
||||
int q = diFurnace.getFuelScaled(88);
|
||||
drawTexturedModalRect(guiLeft + 98, guiTop + 106 - q, 176, 124 - q, 16, q);
|
||||
|
||||
int j = diFurnace.getWasteScaled(88);
|
||||
drawTexturedModalRect(guiLeft + 134, guiTop + 106 - j, 192, 124 - j, 16, j);
|
||||
|
||||
int s = diFurnace.size;
|
||||
|
||||
if(s < 8)
|
||||
drawTexturedModalRect(guiLeft + 50, guiTop + 17, 208, 50 + s * 18, 22, 18);
|
||||
else
|
||||
drawTexturedModalRect(guiLeft + 50, guiTop + 17, 230, 50 + (s - 8) * 18, 22, 18);
|
||||
|
||||
|
||||
FluidType type = diFurnace.tanks[2].getTankType();
|
||||
if(type == Fluids.STEAM) drawTexturedModalRect(guiLeft + 63, guiTop + 107, 176, 18, 14, 18);
|
||||
if(type == Fluids.HOTSTEAM) drawTexturedModalRect(guiLeft + 63, guiTop + 107, 190, 18, 14, 18);
|
||||
if(type == Fluids.SUPERHOTSTEAM) drawTexturedModalRect(guiLeft + 63, guiTop + 107, 204, 18, 14, 18);
|
||||
|
||||
if(diFurnace.hasHullHeat()) {
|
||||
int i = diFurnace.getHullHeatScaled(88);
|
||||
|
||||
i = (int) Math.min(i, 160);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 114, 0, 226, i, 4);
|
||||
}
|
||||
|
||||
if(diFurnace.hasCoreHeat()) {
|
||||
int i = diFurnace.getCoreHeatScaled(88);
|
||||
|
||||
i = (int) Math.min(i, 160);
|
||||
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 120, 0, 230, i, 4);
|
||||
}
|
||||
|
||||
if(diFurnace.tanks[2].getFill() > 0) {
|
||||
int i = diFurnace.getSteamScaled(88);
|
||||
|
||||
//i = (int) Math.min(i, 160);
|
||||
|
||||
int offset = 234;
|
||||
|
||||
if(type == Fluids.HOTSTEAM) offset += 4;
|
||||
if(type == Fluids.SUPERHOTSTEAM) offset += 8;
|
||||
|
||||
drawTexturedModalRect(guiLeft + 80, guiTop + 108, 0, offset, i, 4);
|
||||
}
|
||||
|
||||
diFurnace.tanks[0].renderTank(guiLeft + 8, guiTop + 88, this.zLevel, 16, 52);
|
||||
diFurnace.tanks[1].renderTank(guiLeft + 26, guiTop + 88, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
110
src/main/java/com/hbm/inventory/gui/GUIScreenPreview.java
Normal file
110
src/main/java/com/hbm/inventory/gui/GUIScreenPreview.java
Normal file
@ -0,0 +1,110 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIScreenPreview extends GuiScreen {
|
||||
|
||||
protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/nei/gui_nei.png");
|
||||
protected ItemStack preview;
|
||||
protected int zoom = 1;
|
||||
|
||||
public GUIScreenPreview(ItemStack stack) {
|
||||
this.preview = stack;
|
||||
}
|
||||
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
|
||||
if(this.mc.theWorld != null) {
|
||||
this.drawRect(0, 0, this.width, this.height, 0xFFC6C6C6);
|
||||
} else {
|
||||
this.drawBackground(0);
|
||||
}
|
||||
|
||||
if(!Mouse.isButtonDown(0) && !Mouse.isButtonDown(1) && Mouse.next()) {
|
||||
int scroll = Mouse.getEventDWheel();
|
||||
|
||||
if(scroll < 0 && this.zoom > 1) this.zoom--;
|
||||
if(scroll > 0 && this.zoom < 15) this.zoom++;
|
||||
}
|
||||
|
||||
this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.drawGuiContainerForegroundLayer(mouseX, mouseY);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
}
|
||||
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.mc.getTextureManager().bindTexture(texture);
|
||||
ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
|
||||
GL11.glScaled(zoom, zoom, zoom);
|
||||
this.drawTexturedModalRect(res.getScaledWidth_double() / 2D / zoom - 9D, res.getScaledHeight_double() / 2D / zoom - 9D, 5, 87, 18, 18);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
this.fontRendererObj.drawString("Zoom: " + zoom, 2, this.height - 20, 0xff0000);
|
||||
this.fontRendererObj.drawString("Windows Scale: " + res.getScaleFactor(), 2, this.height - 10, 0xff0000);
|
||||
}
|
||||
|
||||
public void drawTexturedModalRect(double x, double y, int sourceX, int sourceY, int sizeX, int sizeY) {
|
||||
double f = 0.00390625D;
|
||||
double f1 = 0.00390625D;
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV((double) (x + 0), (double) (y + sizeY), (double) this.zLevel, (double) ((float) (sourceX + 0) * f), (double) ((float) (sourceY + sizeY) * f1));
|
||||
tessellator.addVertexWithUV((double) (x + sizeX), (double) (y + sizeY), (double) this.zLevel, (double) ((float) (sourceX + sizeX) * f), (double) ((float) (sourceY + sizeY) * f1));
|
||||
tessellator.addVertexWithUV((double) (x + sizeX), (double) (y + 0), (double) this.zLevel, (double) ((float) (sourceX + sizeX) * f), (double) ((float) (sourceY + 0) * f1));
|
||||
tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0), (double) this.zLevel, (double) ((float) (sourceX + 0) * f), (double) ((float) (sourceY + 0) * f1));
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
|
||||
|
||||
if(preview == null) return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
GL11.glScaled(zoom, zoom, zoom);
|
||||
|
||||
ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
|
||||
GL11.glTranslated(res.getScaledWidth_double() / 2D / zoom, res.getScaledHeight_double() / 2D / zoom, -200);
|
||||
|
||||
this.zLevel = 200.0F;
|
||||
itemRender.zLevel = 200.0F;
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), preview, -8, -8);
|
||||
itemRender.renderItemOverlayIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), preview, -8, -8, null);
|
||||
|
||||
itemRender.zLevel = 0.0F;
|
||||
this.zLevel = 0.0F;
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int key) {
|
||||
if(key == 1 || key == this.mc.gameSettings.keyBindInventory.getKeyCode()) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,61 +0,0 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerWatzCore;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityWatzCore;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIWatzCore extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_watz_multiblock.png");
|
||||
private TileEntityWatzCore diFurnace;
|
||||
|
||||
public GUIWatzCore(InventoryPlayer invPlayer, TileEntityWatzCore tedf) {
|
||||
super(new ContainerWatzCore(invPlayer, tedf));
|
||||
diFurnace = tedf;
|
||||
|
||||
this.xSize = 176;
|
||||
//this.ySize = 222;
|
||||
this.ySize = 256;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
diFurnace.tank.renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 106 - 18 - 70, 16, 70);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 106 - 70, 16, 70 - 18, diFurnace.power, diFurnace.maxPower);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = this.diFurnace.hasCustomInventoryName() ? this.diFurnace.getInventoryName() : I18n.format(this.diFurnace.getInventoryName());
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory")/* + String.valueOf(diFurnace.powerList)*/, 8, this.ySize - 96 + 2 - 34, 4210752);
|
||||
this.fontRendererObj.drawString(String.valueOf(diFurnace.powerList + " HE/tick"), 8, this.ySize - 50 + 2 + 13, 4210752);
|
||||
this.fontRendererObj.drawString(String.valueOf(diFurnace.heatList + " heat"), 8, this.ySize - 50 + 2 + 22, 4210752);
|
||||
this.fontRendererObj.drawString(String.valueOf((diFurnace.decayMultiplier * diFurnace.heat)/100 /100 + " waste/tick"), 8, this.ySize - 50 + 2 + 31, 4210752);
|
||||
this.fontRendererObj.drawString(String.valueOf(diFurnace.powerMultiplier + "% power"), 100, this.ySize - 50 + 2 + 13, 4210752);
|
||||
this.fontRendererObj.drawString(String.valueOf(diFurnace.heatMultiplier + "% heat"), 100, this.ySize - 50 + 2 + 22, 4210752);
|
||||
this.fontRendererObj.drawString(String.valueOf(diFurnace.decayMultiplier + "% decay"), 100, this.ySize - 50 + 2 + 31, 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 l = (int)diFurnace.getPowerScaled(70);
|
||||
drawTexturedModalRect(guiLeft + 152, guiTop + 106 - 18 - l, 192, 70 - l, 16, l);
|
||||
|
||||
diFurnace.tank.renderTank(guiLeft + 134, guiTop + 106 - 18, this.zLevel, 16, 70);
|
||||
}
|
||||
}
|
||||
@ -361,7 +361,8 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.ams_limiter, 1), new AStack[] {new ComparableStack(ModItems.board_copper, 6), new OreDictStack(STEEL.plate(), 24), new ComparableStack(ModBlocks.steel_scaffold, 20), new ComparableStack(ModItems.crystal_diamond, 1)}, 600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.ams_emitter, 1), new AStack[] {new ComparableStack(ModItems.board_copper, 24), new OreDictStack(STEEL.plate(), 32), new ComparableStack(ModBlocks.steel_scaffold, 40), new ComparableStack(ModItems.crystal_redstone, 5), new ComparableStack(ModBlocks.machine_lithium_battery)}, 600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.ams_base, 1), new AStack[] {new ComparableStack(ModItems.board_copper, 12), new OreDictStack(STEEL.plate(), 28), new ComparableStack(ModBlocks.steel_scaffold, 30), new ComparableStack(ModBlocks.steel_grate, 8), new ComparableStack(ModBlocks.barrel_steel, 2)}, 600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radar, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 16), new OreDictStack(ANY_PLASTIC.ingot(), 8), new OreDictStack(ANY_RUBBER.ingot(), 8), new ComparableStack(ModItems.magnetron, 10), new ComparableStack(ModItems.motor, 3), new ComparableStack(ModItems.circuit_gold, 4), new ComparableStack(ModItems.coil_copper, 12), new ComparableStack(ModItems.crt_display, 4), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radar, 1), new AStack[] {new OreDictStack(STEEL.plate528(), 8), new OreDictStack(ANY_PLASTIC.ingot(), 8), new OreDictStack(ANY_RUBBER.ingot(), 8), new ComparableStack(ModItems.magnetron, 3), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.circuit_gold, 1), new ComparableStack(ModItems.coil_copper, 12), new ComparableStack(ModItems.crt_display, 4), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_radar_large, 1), new AStack[] {new OreDictStack(STEEL.plateWelded(), 6), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 4), new OreDictStack(ANY_PLASTIC.ingot(), 16), new OreDictStack(ANY_RUBBER.ingot(), 16), new ComparableStack(ModItems.magnetron, 12), new ComparableStack(ModItems.motor_desh, 1), new ComparableStack(ModItems.circuit_gold, 2), new ComparableStack(ModItems.coil_copper, 32), new ComparableStack(ModItems.crt_display, 4), },600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_forcefield, 1), new AStack[] {new OreDictStack(ALLOY.plate528(), 8), new ComparableStack(ModItems.plate_desh, 4), new ComparableStack(ModItems.coil_gold_torus, 6), new ComparableStack(ModItems.coil_magnetized_tungsten, 12), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.upgrade_radius, 1), new ComparableStack(ModItems.upgrade_health, 1), new ComparableStack(ModItems.circuit_targeting_tier5, 1), new ComparableStack(ModBlocks.machine_transformer, 1), },1000);
|
||||
makeRecipe(new ComparableStack(ModItems.mp_thruster_10_kerosene, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new ComparableStack(ModBlocks.deco_pipe_quad, 1), new OreDictStack(W.ingot(), 4), new OreDictStack(STEEL.plate(), 4), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.mp_thruster_10_solid, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new ComparableStack(ModItems.coil_tungsten, 1), new OreDictStack(DURA.ingot(), 4), new OreDictStack(STEEL.plate(), 4), },100);
|
||||
@ -446,6 +447,15 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.wire_red_copper, 24),
|
||||
new ComparableStack(ModItems.circuit_copper, 1)
|
||||
}, 300);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_strand_caster, 1), new AStack[] {
|
||||
new ComparableStack(ModItems.ingot_firebrick, 12),
|
||||
new OreDictStack(STEEL.plateCast(), 6),
|
||||
new OreDictStack(CU.plateWelded(), 2),
|
||||
new ComparableStack(ModItems.tank_steel, 2),
|
||||
new OreDictStack(ANY_CONCRETE.any(), 8)
|
||||
}, 100);
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.piston_set, 1, EnumPistonType.STEEL.ordinal()), new AStack[] {
|
||||
new OreDictStack(STEEL.plate(), 16),
|
||||
new OreDictStack(CU.plate(), 4),
|
||||
|
||||
@ -95,7 +95,7 @@ public class MagicRecipes {
|
||||
recipes.add(new MagicRecipe(new ItemStack(ModItems.gun_darter),
|
||||
new OreDictStack(STEEL.plate()),
|
||||
new OreDictStack(STEEL.plate()),
|
||||
new ComparableStack(ModItems.ingot_polymer),
|
||||
new OreDictStack(ANY_PLASTIC.ingot()),
|
||||
new OreDictStack(GOLD.plate())));
|
||||
|
||||
recipes.add(new MagicRecipe(new ItemStack(ModItems.ammo_dart, 4, ItemAmmoEnums.AmmoDart.NUCLEAR.ordinal()),
|
||||
|
||||
@ -4979,7 +4979,7 @@ public class ModItems {
|
||||
|
||||
ArmorMaterial aMatTrench = EnumHelper.addArmorMaterial("HBM_TRENCH", 150, new int[] { 3, 8, 6, 3 }, 100);
|
||||
aMatTrench.customCraftingMaterial = ModItems.plate_iron;
|
||||
trenchmaster_helmet = new ArmorTrenchmaster(aMatTrench, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png").setMod(0.25F).setThreshold(5.0F)
|
||||
trenchmaster_helmet = new ArmorTrenchmaster(aMatTrench, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png").setMod(0.125F).setThreshold(5.0F)
|
||||
.addEffect(new PotionEffect(Potion.damageBoost.id, 20, 2))
|
||||
.addEffect(new PotionEffect(Potion.digSpeed.id, 20, 1))
|
||||
.addEffect(new PotionEffect(Potion.jump.id, 20, 1))
|
||||
|
||||
@ -106,7 +106,7 @@ public class ItemAssemblyTemplate extends Item {
|
||||
return EnumChatFormatting.RED + "Broken Template" + EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
String s1 = ("" + StatCollector.translateToLocal(out.getUnlocalizedName() + ".name")).trim();
|
||||
String s1 = out.getDisplayName().trim();
|
||||
|
||||
if(s1 != null) {
|
||||
s = s + " " + s1;
|
||||
|
||||
@ -215,7 +215,7 @@ public class ItemStarterKit extends Item {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_lithium, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_potato, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.screwdriver, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_coal_off, 3));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_excavator, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_diesel, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_selenium, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.red_cable, 64));
|
||||
|
||||
@ -4,8 +4,6 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.world.machine.FWatz;
|
||||
import com.hbm.world.machine.NuclearReactor;
|
||||
import com.hbm.world.machine.Watz;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
@ -19,10 +17,8 @@ public class ItemWandS extends Item {
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean bool)
|
||||
{
|
||||
list.add("Creative-only item");
|
||||
list.add("\"Instant structures for everyone!\"");
|
||||
list.add("(Cycle with shift-right click,");
|
||||
list.add("spawn structures with right click!)");
|
||||
list.add("DEPRECATED");
|
||||
|
||||
if(itemstack.stackTagCompound != null)
|
||||
{
|
||||
switch(itemstack.stackTagCompound.getInteger("building"))
|
||||
@ -58,10 +54,8 @@ public class ItemWandS extends Item {
|
||||
switch(stack.stackTagCompound.getInteger("building"))
|
||||
{
|
||||
case 0:
|
||||
new NuclearReactor().generate(world, rand, x, up ? y : y - 4, z);
|
||||
break;
|
||||
case 1:
|
||||
new Watz().generate(world, rand, x, up ? y : y - 12, z);
|
||||
break;
|
||||
case 2:
|
||||
new FWatz().generateHull(world, rand, x, up ? y : y - 18, z);
|
||||
|
||||
@ -216,7 +216,7 @@ public class ItemAmmoHIMARS extends Item {
|
||||
|
||||
this.itemTypes[LARGE_TB] = new HIMARSRocket("single_tb", "himars_single_tb", 1) {
|
||||
public void onImpact(EntityArtilleryRocket rocket, MovingObjectPosition mop) {
|
||||
standardExplosion(rocket, mop, 50F, 12F, true, ModBlocks.slag, 1);
|
||||
standardExplosion(rocket, mop, 50F, 12F, true, ModBlocks.block_slag, 1);
|
||||
ExplosionLarge.spawnShrapnels(rocket.worldObj, (int) mop.hitVec.xCoord, (int) mop.hitVec.yCoord, (int) mop.hitVec.zCoord, 30);
|
||||
standardMush(rocket, mop, 35);
|
||||
}};
|
||||
|
||||
@ -76,6 +76,8 @@ public class Library {
|
||||
public static String Barnaby99_x = "b04cf173-cff0-4acd-aa19-3d835224b43d";
|
||||
public static String Ma118 = "1121cb7a-8773-491f-8e2b-221290c93d81";
|
||||
public static String Adam29Adam29 = "bbae7bfa-0eba-40ac-a0dd-f3b715e73e61";
|
||||
public static String Alcater = "0b399a4a-8545-45a1-be3d-ece70d7d48e9";
|
||||
public static String ege444 = "42ee978c-442a-4cd8-95b6-29e469b6df10";
|
||||
|
||||
public static Set<String> contributors = Sets.newHashSet(new String[] {
|
||||
"06ab7c03-55ce-43f8-9d3c-2850e3c652de", //mustang_rudolf
|
||||
@ -164,10 +166,7 @@ public class Library {
|
||||
return true;
|
||||
if((tileentity != null && (tileentity instanceof IFluidAcceptor ||
|
||||
tileentity instanceof IFluidSource)) ||
|
||||
world.getBlock(x, y, z) == ModBlocks.reactor_hatch ||
|
||||
world.getBlock(x, y, z) == ModBlocks.reactor_conductor ||
|
||||
world.getBlock(x, y, z) == ModBlocks.fusion_hatch ||
|
||||
world.getBlock(x, y, z) == ModBlocks.watz_hatch ||
|
||||
world.getBlock(x, y, z) == ModBlocks.fwatz_hatch ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_limiter ||
|
||||
world.getBlock(x, y, z) == ModBlocks.dummy_port_ams_emitter ||
|
||||
@ -390,23 +389,6 @@ public class Library {
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
TileEntity tileentity = worldObj.getTileEntity(x, y, z);
|
||||
|
||||
//Large Nuclear Reactor
|
||||
if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x, y, z + 2) == ModBlocks.reactor_computer)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x, y, z + 2);
|
||||
}
|
||||
if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x, y, z - 2) == ModBlocks.reactor_computer)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x, y, z - 2);
|
||||
}
|
||||
if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x + 2, y, z) == ModBlocks.reactor_computer)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x + 2, y, z);
|
||||
}
|
||||
if(block == ModBlocks.reactor_hatch && worldObj.getBlock(x - 2, y, z) == ModBlocks.reactor_computer)
|
||||
{
|
||||
tileentity = worldObj.getTileEntity(x - 2, y, z);
|
||||
}
|
||||
//FWatz Reactor
|
||||
if(block == ModBlocks.fwatz_hatch && worldObj.getBlock(x, y + 11, z + 9) == ModBlocks.fwatz_core)
|
||||
{
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
||||
public class RefStrings {
|
||||
public static final String MODID = "hbm";
|
||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||
public static final String VERSION = "1.0.27 BETA (4837)";
|
||||
public static final String VERSION = "1.0.27 BETA (4844)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -223,7 +223,6 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineGasFlare.class, new RenderGasFlare());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChimneyBrick.class, new RenderChimneyBrick());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityChimneyIndustrial.class, new RenderChimneyIndustrial());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningDrill.class, new RenderMiningDrill());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineMiningLaser.class, new RenderLaserMiner());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssembler.class, new RenderAssembler());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineAssemfac.class, new RenderAssemfac());
|
||||
@ -243,6 +242,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadarNT.class, new RenderRadar());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadarLarge.class, new RenderRadarLarge());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadarScreen.class, new RenderRadarScreen());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineSeleniumEngine.class, new RenderSelenium());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityReactorResearch.class, new RenderSmallReactor());
|
||||
@ -306,6 +306,7 @@ public class ClientProxy extends ServerProxy {
|
||||
//Foundry
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryBasin.class, new RenderFoundry());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFoundryMold.class, new RenderFoundry());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineStrandCaster.class, new RenderStrandCaster());
|
||||
//AMS
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSBase.class, new RenderAMSBase());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAMSEmitter.class, new RenderAMSEmitter());
|
||||
@ -338,7 +339,6 @@ public class ClientProxy extends ServerProxy {
|
||||
//DecoContainer
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityFileCabinet.class, new RenderFileCabinet());
|
||||
//multiblocks
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityStructureMarker.class, new RenderStructureMaker());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMultiblock.class, new RenderMultiblock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySoyuzStruct.class, new RenderSoyuzMultiblock());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityITERStruct.class, new RenderITERMultiblock());
|
||||
|
||||
@ -107,8 +107,6 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModItems.plate_polymer, 4), new Object[] { "BB", 'B', "ingotBrick" });
|
||||
addRecipeAuto(new ItemStack(ModItems.plate_polymer, 4), new Object[] { "BB", 'B', "ingotNetherBrick" });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.marker_structure, 1), new Object[] { "L", "G", "R", 'L', LAPIS.dust(), 'G', Items.glowstone_dust, 'R', Blocks.redstone_torch });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.circuit_raw, 1), new Object[] { "A", "R", "S", 'S', STEEL.plate(), 'R', REDSTONE.dust(), 'A', ModItems.wire_aluminium });
|
||||
addRecipeAuto(new ItemStack(ModItems.circuit_bismuth_raw, 1), new Object[] { "RPR", "ABA", "RPR", 'R', REDSTONE.dust(), 'P', ANY_PLASTIC.ingot(), 'A', (GeneralConfig.enable528 ? ModItems.circuit_tantalium : ASBESTOS.ingot()), 'B', ModItems.ingot_bismuth });
|
||||
addRecipeAuto(new ItemStack(ModItems.circuit_tantalium_raw, 1), new Object[] { "RWR", "PTP", "RWR", 'R', REDSTONE.dust(), 'W', ModItems.wire_gold, 'P', CU.plate(), 'T', TA.nugget() });
|
||||
@ -1081,6 +1079,8 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.ore_nether_uranium, 8), new Object[] { "OOO", "OBO", "OOO", 'O', ModBlocks.ore_nether_uranium_scorched, 'B', Items.water_bucket });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.ore_gneiss_uranium, 1), new Object[] { ModBlocks.ore_gneiss_uranium_scorched, Items.water_bucket });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.ore_gneiss_uranium, 8), new Object[] { "OOO", "OBO", "OOO", 'O', ModBlocks.ore_gneiss_uranium_scorched, 'B', Items.water_bucket });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.ore_uranium, 1), new Object[] { ModBlocks.ore_sellafield_uranium_scorched, Items.water_bucket });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.ore_uranium, 8), new Object[] { "OOO", "OBO", "OOO", 'O', ModBlocks.ore_sellafield_uranium_scorched, 'B', Items.water_bucket });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.plate_iron, 4), new Object[] { "##", "##", '#', IRON.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.plate_gold, 4), new Object[] { "##", "##", '#', GOLD.ingot() });
|
||||
|
||||
@ -43,7 +43,6 @@ import com.hbm.saveddata.satellites.Satellite;
|
||||
import com.hbm.tileentity.TileMappings;
|
||||
import com.hbm.tileentity.bomb.TileEntityLaunchPad;
|
||||
import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
import com.hbm.util.*;
|
||||
@ -864,7 +863,6 @@ public class MainRegistry {
|
||||
ArmorUtil.register();
|
||||
HazmatRegistry.registerHazmats();
|
||||
FluidContainerRegistry.register();
|
||||
TileEntityMachineReactorLarge.registerAll();
|
||||
BlockToolConversion.registerRecipes();
|
||||
AchievementHandler.register();
|
||||
|
||||
@ -1194,6 +1192,24 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:item.bolt_dura_steel");
|
||||
ignoreMappings.add("hbm:tile.rail_large_curve_wide");
|
||||
ignoreMappings.add("hbm:tile.nuke_n45");
|
||||
ignoreMappings.add("hbm:tile.machine_coal_off");
|
||||
ignoreMappings.add("hbm:tile.machine_coal_on");
|
||||
ignoreMappings.add("hbm:tile.machine_drill");
|
||||
ignoreMappings.add("hbm:tile.drill_pipe");
|
||||
ignoreMappings.add("hbm:tile.dummy_block_drill");
|
||||
ignoreMappings.add("hbm:tile.dummy_port_drill");
|
||||
ignoreMappings.add("hbm:tile.machine_combine_factory");
|
||||
ignoreMappings.add("hbm:tile.watz_core");
|
||||
ignoreMappings.add("hbm:tile.watz_hatch");
|
||||
ignoreMappings.add("hbm:tile.marker_structure");
|
||||
ignoreMappings.add("hbm:tile.reactor_element");
|
||||
ignoreMappings.add("hbm:tile.reactor_control");
|
||||
ignoreMappings.add("hbm:tile.reactor_hatch");
|
||||
ignoreMappings.add("hbm:tile.reactor_ejector");
|
||||
ignoreMappings.add("hbm:tile.reactor_inserter");
|
||||
ignoreMappings.add("hbm:tile.reactor_conductor");
|
||||
ignoreMappings.add("hbm:tile.reactor_computer");
|
||||
ignoreMappings.add("hbm:tile.ff");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -34,6 +34,7 @@ import com.hbm.interfaces.IItemHUD;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.gui.GUIArmorTable;
|
||||
import com.hbm.inventory.gui.GUIScreenPreview;
|
||||
import com.hbm.items.ISyncButtons;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.armor.ArmorFSB;
|
||||
@ -931,40 +932,28 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
if(mc.currentScreen instanceof GuiContainer && Keyboard.isKeyDown(Keyboard.KEY_F1)) {
|
||||
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
int width = scaledresolution.getScaledWidth();
|
||||
int height = scaledresolution.getScaledHeight();
|
||||
int mouseX = Mouse.getX() * width / mc.displayWidth;
|
||||
int mouseY = height - Mouse.getY() * height / mc.displayHeight - 1;
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_F1)) {
|
||||
|
||||
GuiContainer container = (GuiContainer) mc.currentScreen;
|
||||
|
||||
for(Object o : container.inventorySlots.inventorySlots) {
|
||||
Slot slot = (Slot) o;
|
||||
|
||||
if(slot.getHasStack()) {
|
||||
try {
|
||||
Method isMouseOverSlot = ReflectionHelper.findMethod(GuiContainer.class, container, new String[] {"func_146981_a", "isMouseOverSlot"}, Slot.class, int.class, int.class);
|
||||
|
||||
if((boolean) isMouseOverSlot.invoke(container, slot, mouseX, mouseY)) {
|
||||
|
||||
ComparableStack comp = new ComparableStack(slot.getStack()).makeSingular();
|
||||
CanneryBase cannery = Jars.canneries.get(comp);
|
||||
|
||||
if(cannery != null) {
|
||||
FMLCommonHandler.instance().showGuiScreen(new GuiWorldInAJar(cannery.createScript(), cannery.getName(), cannery.getIcon(), cannery.seeAlso()));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
} catch(Exception ex) { }
|
||||
ItemStack stack = getMouseOverStack();
|
||||
if(stack != null) {
|
||||
ComparableStack comp = new ComparableStack(stack).makeSingular();
|
||||
CanneryBase cannery = Jars.canneries.get(comp);
|
||||
if(cannery != null) {
|
||||
FMLCommonHandler.instance().showGuiScreen(new GuiWorldInAJar(cannery.createScript(), cannery.getName(), cannery.getIcon(), cannery.seeAlso()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && Keyboard.isKeyDown(Keyboard.KEY_LMENU)) {
|
||||
|
||||
ItemStack stack = getMouseOverStack();
|
||||
if(stack != null) {
|
||||
stack = stack.copy();
|
||||
stack.stackSize = 1;
|
||||
FMLCommonHandler.instance().showGuiScreen(new GUIScreenPreview(stack));
|
||||
}
|
||||
}
|
||||
|
||||
if(event.phase == Phase.START) {
|
||||
EntityPlayer player = mc.thePlayer;
|
||||
|
||||
@ -985,6 +974,38 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
public static ItemStack getMouseOverStack() {
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(mc.currentScreen instanceof GuiContainer) {
|
||||
|
||||
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
|
||||
int width = scaledresolution.getScaledWidth();
|
||||
int height = scaledresolution.getScaledHeight();
|
||||
int mouseX = Mouse.getX() * width / mc.displayWidth;
|
||||
int mouseY = height - Mouse.getY() * height / mc.displayHeight - 1;
|
||||
|
||||
GuiContainer container = (GuiContainer) mc.currentScreen;
|
||||
|
||||
for(Object o : container.inventorySlots.inventorySlots) {
|
||||
Slot slot = (Slot) o;
|
||||
|
||||
if(slot.getHasStack()) {
|
||||
try {
|
||||
Method isMouseOverSlot = ReflectionHelper.findMethod(GuiContainer.class, container, new String[] {"func_146981_a", "isMouseOverSlot"}, Slot.class, int.class, int.class);
|
||||
|
||||
if((boolean) isMouseOverSlot.invoke(container, slot, mouseX, mouseY)) {
|
||||
return slot.getStack();
|
||||
}
|
||||
|
||||
} catch(Exception ex) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onClientTickLast(ClientTickEvent event) {
|
||||
|
||||
@ -21,6 +21,7 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.client.settings.GameSettings;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.EnumAction;
|
||||
@ -28,14 +29,16 @@ import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||
import net.minecraftforge.client.event.EntityViewRenderEvent.FogColors;
|
||||
import net.minecraftforge.client.event.EntityViewRenderEvent.FogDensity;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
|
||||
public class ModEventHandlerRenderer {
|
||||
|
||||
@ -374,14 +377,10 @@ public class ModEventHandlerRenderer {
|
||||
public void tintFog(FogColors event) {
|
||||
|
||||
EntityPlayer player = MainRegistry.proxy.me();
|
||||
BiomeGenBase biome = player.worldObj.getBiomeGenForCoords((int) Math.floor(player.posX), (int) Math.floor(player.posZ));
|
||||
|
||||
if(biome instanceof BiomeGenCraterBase) {
|
||||
int color = ForgeHooksClient.getSkyBlendColour(player.worldObj, (int) Math.floor(player.posX), (int) Math.floor(player.posY), (int) Math.floor(player.posZ));
|
||||
event.red = ((color & 0xff0000) >> 16) / 255F;
|
||||
event.green = ((color & 0x00ff00) >> 8) / 255F;
|
||||
event.blue = (color & 0x0000ff) / 255F;
|
||||
}
|
||||
Vec3 color = getFogBlendColor(player.worldObj, (int) Math.floor(player.posX), (int) Math.floor(player.posZ), event.renderPartialTicks);
|
||||
event.red = (float) color.xCoord;
|
||||
event.green = (float) color.yCoord;
|
||||
event.blue = (float) color.zCoord;
|
||||
|
||||
float soot = (float) (renderSoot - RadiationConfig.sootFogThreshold);
|
||||
float sootColor = 0.15F;
|
||||
@ -404,4 +403,71 @@ public class ModEventHandlerRenderer {
|
||||
GL11.glTranslated(horizontal * mult, vertical * mult, 0);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean fogInit = false;
|
||||
private static int fogX;
|
||||
private static int fogZ;
|
||||
private static Vec3 fogRGBMultiplier;
|
||||
|
||||
/** Same procedure as getting the blended sky color but for fog */
|
||||
public static Vec3 getFogBlendColor(World world, int playerX, int playerZ, double partialTicks) {
|
||||
|
||||
if(playerX == fogX && playerZ == fogZ && fogInit) return fogRGBMultiplier;
|
||||
|
||||
fogInit = true;
|
||||
GameSettings settings = Minecraft.getMinecraft().gameSettings;
|
||||
int[] ranges = ForgeModContainer.blendRanges;
|
||||
int distance = 0;
|
||||
|
||||
if(settings.fancyGraphics && settings.renderDistanceChunks >= 0 && settings.renderDistanceChunks < ranges.length) {
|
||||
distance = ranges[settings.renderDistanceChunks];
|
||||
}
|
||||
|
||||
float r = 0F;
|
||||
float g = 0F;
|
||||
float b = 0F;
|
||||
|
||||
int divider = 0;
|
||||
|
||||
for(int x = -distance; x <= distance; x++) {
|
||||
for(int z = -distance; z <= distance; z++) {
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(playerX + x, playerZ + z);
|
||||
Vec3 color = getBiomeFogColors(world, biome, partialTicks);
|
||||
r += color.xCoord;
|
||||
g += color.yCoord;
|
||||
b += color.zCoord;
|
||||
divider++;
|
||||
}
|
||||
}
|
||||
|
||||
fogX = playerX;
|
||||
fogZ = playerZ;
|
||||
|
||||
fogRGBMultiplier = Vec3.createVectorHelper(r / divider, g / divider, b / divider);
|
||||
return fogRGBMultiplier;
|
||||
}
|
||||
|
||||
/** Returns the current biome's fog color adjusted for brightness if in a crater, or the world's cached fog color if not */
|
||||
public static Vec3 getBiomeFogColors(World world, BiomeGenBase biome, double partialTicks) {
|
||||
|
||||
Vec3 worldFog = world.getFogColor((float) partialTicks);
|
||||
double r = worldFog.xCoord;
|
||||
double g = worldFog.yCoord;
|
||||
double b = worldFog.zCoord;
|
||||
|
||||
if(biome instanceof BiomeGenCraterBase) {
|
||||
int color = biome.getSkyColorByTemp(biome.temperature);
|
||||
r = ((color & 0xff0000) >> 16) / 255F;
|
||||
g = ((color & 0x00ff00) >> 8) / 255F;
|
||||
b = (color & 0x0000ff) / 255F;
|
||||
|
||||
float celestialAngle = world.getCelestialAngle((float) partialTicks);
|
||||
float skyBrightness = MathHelper.clamp_float(MathHelper.cos(celestialAngle * (float) Math.PI * 2.0F) * 2.0F + 0.5F, 0F, 1F);
|
||||
r *= skyBrightness;
|
||||
g *= skyBrightness;
|
||||
b *= skyBrightness;
|
||||
}
|
||||
|
||||
return Vec3.createVectorHelper(r, g, b);
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,7 +88,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(ItemBattery.getEmptyBattery(ModItems.memory));
|
||||
API.hideItem(ItemBattery.getFullBattery(ModItems.memory));
|
||||
|
||||
API.hideItem(new ItemStack(ModBlocks.machine_coal_on));
|
||||
API.hideItem(new ItemStack(ModBlocks.machine_electric_furnace_on));
|
||||
API.hideItem(new ItemStack(ModBlocks.machine_difurnace_on));
|
||||
API.hideItem(new ItemStack(ModBlocks.machine_nuke_furnace_on));
|
||||
@ -110,7 +109,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModItems.burnt_bark));
|
||||
API.hideItem(new ItemStack(ModItems.ams_core_thingy));
|
||||
}
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_drill));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_base));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_emitter));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_ams_limiter));
|
||||
@ -118,7 +116,6 @@ public class NEIConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_blast));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_uf6));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_block_puf6));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_drill));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_base));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_emitter));
|
||||
API.hideItem(new ItemStack(ModBlocks.dummy_port_ams_limiter));
|
||||
|
||||
@ -50,7 +50,10 @@ public class ResourceManager {
|
||||
public static final IModelCustom boiler_burst = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/boiler_burst.obj"));
|
||||
public static final IModelCustom boiler_industrial = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/industrial_boiler.obj"));
|
||||
public static final IModelCustom hephaestus = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/hephaestus.obj"));
|
||||
|
||||
|
||||
//Caster o' Strands
|
||||
public static final IModelCustom strand_caster = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/strand_caster.obj"));
|
||||
|
||||
//Furnaces
|
||||
public static final IModelCustom furnace_iron = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/furnace_iron.obj"));
|
||||
public static final IModelCustom furnace_steel = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/furnace_steel.obj"));
|
||||
@ -245,6 +248,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom radar_body = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/radar_base.obj"));
|
||||
public static final IModelCustom radar_head = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/radar_head.obj"));
|
||||
public static final IModelCustom radar = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/radar.obj"));
|
||||
public static final IModelCustom radar_large = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/radar_large.obj"));
|
||||
public static final IModelCustom radar_screen = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/machines/radar_screen.obj"));
|
||||
|
||||
//Forcefield
|
||||
@ -447,7 +451,10 @@ public class ResourceManager {
|
||||
public static final ResourceLocation boiler_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/boiler.png");
|
||||
public static final ResourceLocation boiler_industrial_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/industrial_boiler.png");
|
||||
public static final ResourceLocation hephaestus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/hephaestus.png");
|
||||
|
||||
|
||||
//Strand Caster
|
||||
public static final ResourceLocation strand_caster_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/strand_caster.png");
|
||||
|
||||
//Furnaces
|
||||
public static final ResourceLocation furnace_iron_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/furnace_iron.png");
|
||||
public static final ResourceLocation furnace_steel_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/furnace_steel.png");
|
||||
@ -661,6 +668,7 @@ public class ResourceManager {
|
||||
public static final ResourceLocation radar_head_tex = new ResourceLocation(RefStrings.MODID, "textures/models/radar_head.png");
|
||||
public static final ResourceLocation radar_base_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/radar_base.png");
|
||||
public static final ResourceLocation radar_dish_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/radar_dish.png");
|
||||
public static final ResourceLocation radar_large_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/radar_large.png");
|
||||
public static final ResourceLocation radar_screen_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/radar_screen.png");
|
||||
|
||||
//Forcefield
|
||||
|
||||
@ -13,7 +13,6 @@ import com.hbm.tileentity.machine.TileEntityCoreStabilizer;
|
||||
import com.hbm.tileentity.machine.TileEntityForceField;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningLaser;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMissileAssembly;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge;
|
||||
import com.hbm.tileentity.machine.TileEntitySoyuzLauncher;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityBarrel;
|
||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||
@ -85,30 +84,6 @@ public class AuxButtonPacket implements IMessage {
|
||||
field.isOn = !field.isOn;
|
||||
}
|
||||
|
||||
if (te instanceof TileEntityMachineReactorLarge) {
|
||||
TileEntityMachineReactorLarge reactor = (TileEntityMachineReactorLarge)te;
|
||||
|
||||
if(m.id == 0)
|
||||
reactor.rods = m.value;
|
||||
|
||||
if(m.id == 1) {
|
||||
FluidType type = Fluids.STEAM;
|
||||
int fill = reactor.tanks[2].getFill();
|
||||
|
||||
switch(m.value) {
|
||||
case 0: type = Fluids.HOTSTEAM; fill = (int)Math.floor(fill / 10D); break;
|
||||
case 1: type = Fluids.SUPERHOTSTEAM; fill = (int)Math.floor(fill / 10D); break;
|
||||
case 2: type = Fluids.STEAM; fill = (int)Math.floor(fill * 100); break;
|
||||
}
|
||||
|
||||
if(fill > reactor.tanks[2].getMaxFill())
|
||||
fill = reactor.tanks[2].getMaxFill();
|
||||
|
||||
reactor.tanks[2].setTankType(type);
|
||||
reactor.tanks[2].setFill(fill);
|
||||
}
|
||||
}
|
||||
|
||||
if (te instanceof TileEntityMachineMissileAssembly) {
|
||||
TileEntityMachineMissileAssembly assembly = (TileEntityMachineMissileAssembly)te;
|
||||
|
||||
|
||||
@ -54,18 +54,6 @@ public class LoopedSoundPacket implements IMessage {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IMessage onMessage(LoopedSoundPacket m, MessageContext ctx) {
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
if (te != null && te instanceof TileEntityMachineMiningDrill) {
|
||||
|
||||
boolean flag = true;
|
||||
for(int i = 0; i < SoundLoopMiner.list.size(); i++) {
|
||||
if(SoundLoopMiner.list.get(i).getTE() == te && !SoundLoopMiner.list.get(i).isDonePlaying())
|
||||
flag = false;
|
||||
}
|
||||
|
||||
if(flag && te.getWorldObj().isRemote && ((TileEntityMachineMiningDrill)te).torque > 0.2F)
|
||||
Minecraft.getMinecraft().getSoundHandler().playSound(new SoundLoopMiner(new ResourceLocation("hbm:block.minerOperate"), te));
|
||||
}
|
||||
|
||||
if (te != null && te instanceof TileEntityMachineAssembler) {
|
||||
|
||||
|
||||
@ -15,10 +15,6 @@ public class PacketDispatcher {
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
//Machine type for marker rendering
|
||||
wrapper.registerMessage(TEStructurePacket.Handler.class, TEStructurePacket.class, i++, Side.CLIENT);
|
||||
//Mining drill rotation for rendering
|
||||
wrapper.registerMessage(TEDrillPacket.Handler.class, TEDrillPacket.class, i++, Side.CLIENT);
|
||||
//Fluid packet for GUI
|
||||
wrapper.registerMessage(TEFluidPacket.Handler.class, TEFluidPacket.class, i++, Side.CLIENT);
|
||||
//Sound packet that keeps client and server separated
|
||||
|
||||
@ -1,67 +0,0 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TEDrillPacket implements IMessage {
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
float spin;
|
||||
float torque;
|
||||
|
||||
public TEDrillPacket()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TEDrillPacket(int x, int y, int z, float spin, float torque)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.spin = spin;
|
||||
this.torque = torque;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
spin = buf.readFloat();
|
||||
torque = buf.readFloat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeFloat(spin);
|
||||
buf.writeFloat(torque);
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<TEDrillPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(TEDrillPacket m, MessageContext ctx) {
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
if (te != null && te instanceof TileEntityMachineMiningDrill) {
|
||||
|
||||
TileEntityMachineMiningDrill gen = (TileEntityMachineMiningDrill) te;
|
||||
gen.rotation = m.spin;
|
||||
gen.torque = m.torque;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,62 +0,0 @@
|
||||
package com.hbm.packet;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityStructureMarker;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TEStructurePacket implements IMessage {
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int type;
|
||||
|
||||
public TEStructurePacket()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public TEStructurePacket(int x, int y, int z, int type)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
type = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeInt(type);
|
||||
}
|
||||
|
||||
public static class Handler implements IMessageHandler<TEStructurePacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(TEStructurePacket m, MessageContext ctx) {
|
||||
TileEntity te = Minecraft.getMinecraft().theWorld.getTileEntity(m.x, m.y, m.z);
|
||||
|
||||
if (te != null && te instanceof TileEntityStructureMarker) {
|
||||
|
||||
TileEntityStructureMarker marker = (TileEntityStructureMarker) te;
|
||||
marker.type = m.type;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -41,31 +41,35 @@ public class RenderBlockMultipass implements ISimpleBlockRenderingHandler {
|
||||
renderer.setRenderBoundsFromBlock(block);
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
IBlockMultiPass multi = (IBlockMultiPass) block;
|
||||
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
|
||||
tessellator.draw();
|
||||
for(int i = 0; i < (multi.shouldRenderItemMulti() ? multi.getPasses() : 1); i++) {
|
||||
this.currentPass = i;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, -1.0F, 0.0F);
|
||||
renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 0, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 1.0F, 0.0F);
|
||||
renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 1, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, -1.0F);
|
||||
renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 2, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(0.0F, 0.0F, 1.0F);
|
||||
renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 3, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 4, metadata));
|
||||
tessellator.draw();
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.setNormal(1.0F, 0.0F, 0.0F);
|
||||
renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, renderer.getBlockIconFromSideAndMetadata(block, 5, metadata));
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
/** terrible hack to make this shit work */
|
||||
if(block == ModBlocks.ore_random) {
|
||||
|
||||
@ -291,7 +291,9 @@ public class ItemRenderLibrary {
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glTranslatef(0, 0, 3);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.pumpjack_tex); ResourceManager.pumpjack.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}});
|
||||
|
||||
@ -322,19 +324,6 @@ public class ItemRenderLibrary {
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_drill), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
bindTexture(ResourceManager.drill_body_tex); ResourceManager.drill_body.renderAll();
|
||||
bindTexture(ResourceManager.drill_bolt_tex); ResourceManager.drill_bolt.renderAll();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_mining_laser), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -0.5, 0);
|
||||
@ -351,7 +340,7 @@ public class ItemRenderLibrary {
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.machine_turbofan), new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glScaled(2, 2, 2);
|
||||
GL11.glScaled(2.25, 2.25, 2.25);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
@ -1150,7 +1139,9 @@ public class ItemRenderLibrary {
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.25, 0.25, 0.25);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
bindTexture(ResourceManager.fracking_tower_tex); ResourceManager.fracking_tower.renderAll();
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
|
||||
|
||||
@ -1,68 +0,0 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderMiningDrill extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 2:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 4:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 3:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
case 5:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.drill_body_tex);
|
||||
|
||||
ResourceManager.drill_body.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderTileEntityAt2(tileEntity, x, y, z, f);
|
||||
}
|
||||
|
||||
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 2:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
GL11.glRotatef(((TileEntityMachineMiningDrill)tileEntity).rotation, 0F, 1F, 0F);
|
||||
|
||||
bindTexture(ResourceManager.drill_bolt_tex);
|
||||
ResourceManager.drill_bolt.renderAll();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderRadarLarge extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
|
||||
bindTexture(ResourceManager.radar_large_tex);
|
||||
ResourceManager.radar_large.renderPart("Radar");
|
||||
|
||||
TileEntityMachineRadarNT radar = (TileEntityMachineRadarNT) tileEntity;
|
||||
GL11.glRotatef(radar.prevRotation + (radar.rotation - radar.prevRotation) * f, 0F, -1F, 0F);
|
||||
|
||||
ResourceManager.radar_large.renderPart("Dish");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_radar_large);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommonWithStack(ItemStack item) {
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
bindTexture(ResourceManager.radar_large_tex);
|
||||
ResourceManager.radar_large.renderPart("Radar");
|
||||
GL11.glRotated(System.currentTimeMillis() % 3600 * 0.1D, 0, -1, 0);
|
||||
ResourceManager.radar_large.renderPart("Dish");
|
||||
}};
|
||||
}
|
||||
}
|
||||
@ -56,6 +56,7 @@ public class RenderRadarScreen extends TileEntitySpecialRenderer implements IIte
|
||||
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
tess.draw();
|
||||
|
||||
124
src/main/java/com/hbm/render/tileentity/RenderStrandCaster.java
Normal file
124
src/main/java/com/hbm/render/tileentity/RenderStrandCaster.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineStrandCaster;
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.nio.DoubleBuffer;
|
||||
|
||||
public class RenderStrandCaster extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
public static final ResourceLocation lava = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lava_gray.png");
|
||||
private static DoubleBuffer buf = null;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
|
||||
TileEntityMachineStrandCaster caster = (TileEntityMachineStrandCaster) te;
|
||||
|
||||
if(buf == null){
|
||||
buf = GLAllocation.createDirectByteBuffer(8*4).asDoubleBuffer();
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
switch(te.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 4: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 2: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
GL11.glTranslated( 0.5, 0, 0.5);
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
bindTexture(ResourceManager.strand_caster_tex);
|
||||
ResourceManager.strand_caster.renderPart("caster");
|
||||
|
||||
|
||||
if (caster.amount != 0 && caster.getInstalledMold() != null) {
|
||||
|
||||
double level = ((double) caster.amount / (double) caster.getCapacity()) * 0.675D;
|
||||
double offset = ((double) caster.amount / (double) caster.getInstalledMold().getCost()) * 0.375D;
|
||||
|
||||
int color = caster.type.moltenColor;
|
||||
|
||||
int r = color >> 16 & 0xFF;
|
||||
int g = color >> 8 & 0xFF;
|
||||
int b = color & 0xFF;
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor3f( r/ 255F, g/ 255F, b/ 255F);
|
||||
GL11.glEnable(GL11.GL_CLIP_PLANE0);
|
||||
buf.put(new double[] { 0, 0, -1, 0.5} );
|
||||
buf.rewind();
|
||||
GL11.glClipPlane(GL11.GL_CLIP_PLANE0, buf);
|
||||
GL11.glTranslated(0,0,Math.max(-offset + 3.4, 0));
|
||||
ResourceManager.strand_caster.renderPart("plate");
|
||||
GL11.glDisable(GL11.GL_CLIP_PLANE0);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
Tessellator tess = Tessellator.instance;
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorOpaque_F(r / 255F, g / 255F, b / 255F);
|
||||
bindTexture(lava);
|
||||
tess.startDrawingQuads();
|
||||
tess.addVertexWithUV(-0.9, 2.3 + level, -0.999, 0, 0);
|
||||
tess.addVertexWithUV(-0.9, 2.3 + level, 0.999, 0, 1);
|
||||
tess.addVertexWithUV(0.9, 2.3 + level, 0.999, 1, 1);
|
||||
tess.addVertexWithUV(0.9, 2.3 + level, -0.999, 1, 0);
|
||||
tess.draw();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_strand_caster);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(2, 0, 2);
|
||||
GL11.glScaled( 2, 2, 2);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(1, 1, 1);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.strand_caster_tex); ResourceManager.strand_caster.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,239 +0,0 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL14;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.TileEntityStructureMarker;
|
||||
import com.hbm.world.machine.FWatz;
|
||||
import com.hbm.world.machine.NuclearReactor;
|
||||
import com.hbm.world.machine.Watz;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderStructureMaker extends TileEntitySpecialRenderer {
|
||||
|
||||
float pixel = 1F/16F;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
GL11.glRotatef(180, 0F, 0F, 1F);
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL14.glBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ZERO);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL14.glBlendEquation(GL14.GL_FUNC_ADD);
|
||||
GL11.glColor4f(0.5f, 0.25f, 1.0f, 1f);
|
||||
this.renderBlocks((int)x, (int)y, (int)z, ((TileEntityStructureMarker)tileentity).type, tileentity.getWorldObj().getBlockMetadata(tileentity.xCoord, tileentity.yCoord, tileentity.zCoord));
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public void renderBlocks(int x, int y, int z, int type, int meta) {
|
||||
int offsetX = 0;
|
||||
int offsetZ = 0;
|
||||
if(type == 0) {
|
||||
|
||||
if(meta == 6) {
|
||||
offsetZ = 3;
|
||||
}
|
||||
if(meta == 7) {
|
||||
offsetX = 3;
|
||||
}
|
||||
if(meta == 8) {
|
||||
offsetZ = -3;
|
||||
}
|
||||
if(meta == 9) {
|
||||
offsetX = -3;
|
||||
}
|
||||
|
||||
GL11.glTranslatef(-2 + offsetX, -3, -2 + offsetZ);
|
||||
for(int a = 0; a < 5; a++) {
|
||||
for(int b = 0; b < 5; b++) {
|
||||
for(int c = 0; c < 5; c++) {
|
||||
|
||||
Block block = Blocks.air;
|
||||
if(NuclearReactor.array2[b][a].substring(c, c + 1).equals("R"))
|
||||
block = ModBlocks.reactor_element;
|
||||
if(NuclearReactor.array2[b][a].substring(c, c + 1).equals("#"))
|
||||
block = ModBlocks.reactor_computer;
|
||||
if(NuclearReactor.array2[b][a].substring(c, c + 1).equals("C"))
|
||||
block = ModBlocks.reactor_control;
|
||||
if(NuclearReactor.array2[b][a].substring(c, c + 1).equals("A"))
|
||||
block = ModBlocks.reactor_hatch;
|
||||
if(NuclearReactor.array2[b][a].substring(c, c + 1).equals("I"))
|
||||
block = ModBlocks.reactor_conductor;
|
||||
//if(NuclearReactor.array2[b][a].substring(c, c + 1).equals("B"))
|
||||
// block = ModBlocks.brick_concrete;
|
||||
if(block != Blocks.air) {
|
||||
RenderBlocks rb = RenderBlocks.getInstance();
|
||||
ResourceLocation loc1 = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + rb.getBlockIconFromSide(block, 1).getIconName().substring(4, rb.getBlockIconFromSide(block, 1).getIconName().length()) + ".png");
|
||||
ResourceLocation loc2 = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + rb.getBlockIconFromSide(block, 3).getIconName().substring(4, rb.getBlockIconFromSide(block, 3).getIconName().length()) + ".png");
|
||||
renderSmolBlockAt(loc1, loc2, a, b, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(type == 1) {
|
||||
|
||||
if(meta == 6) {
|
||||
offsetZ = 4;
|
||||
}
|
||||
if(meta == 7) {
|
||||
offsetX = 4;
|
||||
}
|
||||
if(meta == 8) {
|
||||
offsetZ = -4;
|
||||
}
|
||||
if(meta == 9) {
|
||||
offsetX = -4;
|
||||
}
|
||||
|
||||
GL11.glTranslatef(-3 + offsetX, -12, -3 + offsetZ);
|
||||
for(int a = 0; a < 7; a++) {
|
||||
for(int b = 0; b < 13; b++) {
|
||||
for(int c = 0; c < 7; c++) {
|
||||
|
||||
Block block = Blocks.air;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("C"))
|
||||
block = ModBlocks.reinforced_brick;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("A"))
|
||||
block = ModBlocks.watz_hatch;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("R"))
|
||||
block = ModBlocks.watz_control;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("S"))
|
||||
block = ModBlocks.watz_end;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("I"))
|
||||
block = ModBlocks.watz_conductor;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("#"))
|
||||
block = ModBlocks.watz_core;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("K"))
|
||||
block = ModBlocks.watz_cooler;
|
||||
if(Watz.array[b][a].substring(c, c + 1).equals("W"))
|
||||
block = ModBlocks.watz_element;
|
||||
if(block != Blocks.air) {
|
||||
RenderBlocks rb = RenderBlocks.getInstance();
|
||||
ResourceLocation loc1 = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + rb.getBlockIconFromSide(block, 1).getIconName().substring(4, rb.getBlockIconFromSide(block, 1).getIconName().length()) + ".png");
|
||||
ResourceLocation loc2 = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + rb.getBlockIconFromSide(block, 3).getIconName().substring(4, rb.getBlockIconFromSide(block, 3).getIconName().length()) + ".png");
|
||||
renderSmolBlockAt(loc1, loc2, a, b, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(type == 2) {
|
||||
|
||||
if(meta == 6) {
|
||||
offsetZ = 10;
|
||||
}
|
||||
if(meta == 7) {
|
||||
offsetX = 10;
|
||||
}
|
||||
if(meta == 8) {
|
||||
offsetZ = -10;
|
||||
}
|
||||
if(meta == 9) {
|
||||
offsetX = -10;
|
||||
}
|
||||
|
||||
GL11.glTranslatef(-9 + offsetX, -18, -9 + offsetZ);
|
||||
for(int a = 0; a < 19; a++) {
|
||||
for(int b = 0; b < 19; b++) {
|
||||
for(int c = 0; c < 19; c++) {
|
||||
|
||||
Block block = Blocks.air;
|
||||
if(FWatz.fwatz[18 - b][a].substring(c, c + 1).equals("X"))
|
||||
block = ModBlocks.fwatz_scaffold;
|
||||
if(FWatz.fwatz[18 - b][a].substring(c, c + 1).equals("H"))
|
||||
block = ModBlocks.fwatz_hatch;
|
||||
if(FWatz.fwatz[18 - b][a].substring(c, c + 1).equals("S"))
|
||||
block = ModBlocks.fwatz_cooler;
|
||||
if(FWatz.fwatz[18 - b][a].substring(c, c + 1).equals("T"))
|
||||
block = ModBlocks.fwatz_tank;
|
||||
if(FWatz.fwatz[18 - b][a].substring(c, c + 1).equals("M"))
|
||||
block = ModBlocks.fwatz_conductor;
|
||||
if(FWatz.fwatz[18 - b][a].substring(c, c + 1).equals("C"))
|
||||
block = ModBlocks.fwatz_computer;
|
||||
if(FWatz.fwatz[18 - b][a].substring(c, c + 1).equals("#"))
|
||||
block = ModBlocks.fwatz_core;
|
||||
if(block != Blocks.air) {
|
||||
RenderBlocks rb = RenderBlocks.getInstance();
|
||||
ResourceLocation loc1 = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + rb.getBlockIconFromSide(block, 1).getIconName().substring(4, rb.getBlockIconFromSide(block, 1).getIconName().length()) + ".png");
|
||||
ResourceLocation loc2 = new ResourceLocation(RefStrings.MODID + ":textures/blocks/" + rb.getBlockIconFromSide(block, 3).getIconName().substring(4, rb.getBlockIconFromSide(block, 3).getIconName().length()) + ".png");
|
||||
renderSmolBlockAt(loc1, loc2, a, b, c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void renderSmolBlockAt(ResourceLocation loc1, ResourceLocation loc2, int x, int y, int z) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glRotatef(180, 0F, 0F, 1F);
|
||||
Tessellator tesseract = Tessellator.instance;
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
this.bindTexture(loc2);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 1);
|
||||
this.bindTexture(loc2);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 1);
|
||||
this.bindTexture(loc2);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
this.bindTexture(loc2);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
this.bindTexture(loc1);
|
||||
tesseract.draw();
|
||||
|
||||
tesseract.startDrawingQuads();
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 1, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 11 * pixel / 2, 0, 0);
|
||||
tesseract.addVertexWithUV(1 - 11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 0, 1);
|
||||
tesseract.addVertexWithUV(11 * pixel / 2, 11 * pixel / 2, 1 - 11 * pixel / 2, 1, 1);
|
||||
this.bindTexture(loc1);
|
||||
tesseract.draw();
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -44,6 +44,8 @@ public class RenderAccessoryUtility {
|
||||
private static ResourceLocation pheo = new ResourceLocation(RefStrings.MODID + ":textures/models/capes/CapePheo.png");
|
||||
private static ResourceLocation vaer = new ResourceLocation(RefStrings.MODID + ":textures/models/capes/CapeVaer.png");
|
||||
private static ResourceLocation adam = new ResourceLocation(RefStrings.MODID + ":textures/models/capes/CapeAdam.png");
|
||||
private static ResourceLocation alcater = new ResourceLocation(RefStrings.MODID + ":textures/models/capes/CapeAlcater.png");
|
||||
private static ResourceLocation jame = new ResourceLocation(RefStrings.MODID + ":textures/models/capes/CapeJame.png");
|
||||
|
||||
public static ResourceLocation getCloakFromPlayer(EntityPlayer player) {
|
||||
|
||||
@ -51,7 +53,7 @@ public class RenderAccessoryUtility {
|
||||
String name = player.getDisplayName();
|
||||
|
||||
if(uuid.equals(Library.HbMinecraft)) {
|
||||
return (MainRegistry.polaroidID == 11 ? hbm : hbm2);
|
||||
return (MainRegistry.polaroidID == 11 ? hbm2 : hbm);
|
||||
}
|
||||
|
||||
if(uuid.equals(Library.Drillgon)) {
|
||||
@ -123,6 +125,12 @@ public class RenderAccessoryUtility {
|
||||
if(uuid.equals(Library.Adam29Adam29)) {
|
||||
return adam;
|
||||
}
|
||||
if(uuid.equals(Library.Alcater)) {
|
||||
return alcater;
|
||||
}
|
||||
if(uuid.equals(Library.ege444)) {
|
||||
return jame;
|
||||
}
|
||||
if(Library.contributors.contains(uuid)) {
|
||||
return wiki;
|
||||
}
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
package com.hbm.sound;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityMachineMiningDrill;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class SoundLoopMiner extends SoundLoopMachine {
|
||||
|
||||
public static List<SoundLoopMiner> list = new ArrayList<SoundLoopMiner>();
|
||||
|
||||
public SoundLoopMiner(ResourceLocation path, TileEntity te) {
|
||||
super(path, te);
|
||||
list.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
|
||||
if(te instanceof TileEntityMachineMiningDrill) {
|
||||
TileEntityMachineMiningDrill drill = (TileEntityMachineMiningDrill)te;
|
||||
|
||||
if(this.volume != 3)
|
||||
volume = 3;
|
||||
|
||||
if(drill.torque <= 0.5F)
|
||||
this.donePlaying = true;
|
||||
}
|
||||
}
|
||||
|
||||
public TileEntity getTE() {
|
||||
return te;
|
||||
}
|
||||
|
||||
}
|
||||
@ -5,9 +5,11 @@ import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.BufPacket;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -221,4 +223,27 @@ public abstract class TileEntityMachineBase extends TileEntityLoadedBase impleme
|
||||
|
||||
return Math.max(volume, 0);
|
||||
}
|
||||
|
||||
public void updateRedstoneConnection(DirPos pos) {
|
||||
|
||||
int x = pos.getX();
|
||||
int y = pos.getY();
|
||||
int z = pos.getZ();
|
||||
ForgeDirection dir = pos.getDir();
|
||||
Block block1 = worldObj.getBlock(x, y, z);
|
||||
|
||||
block1.onNeighborChange(worldObj, x, y, z, xCoord, yCoord, zCoord);
|
||||
block1.onNeighborBlockChange(worldObj, x, y, z, this.getBlockType());
|
||||
if(block1.isNormalCube(worldObj, x, y, z)) {
|
||||
x += dir.offsetX;
|
||||
y += dir.offsetY;
|
||||
z += dir.offsetZ;
|
||||
Block block2 = worldObj.getBlock(x, y, z);
|
||||
|
||||
if(block2.getWeakChanges(worldObj, x, y, z)) {
|
||||
block2.onNeighborChange(worldObj, x, y, z, xCoord, yCoord, zCoord);
|
||||
block2.onNeighborBlockChange(worldObj, x, y, z, this.getBlockType());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -9,20 +10,23 @@ import api.hbm.energy.IEnergyConnector;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidConnector;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergyUser, IFluidAcceptor, ISidedInventory, IFluidConnector, IHeatSource {
|
||||
public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergyUser, IFluidAcceptor, ISidedInventory, IFluidConnector, IHeatSource, ICrucibleAcceptor {
|
||||
|
||||
TileEntity tile;
|
||||
boolean inventory;
|
||||
boolean power;
|
||||
boolean fluid;
|
||||
boolean heat;
|
||||
public boolean moltenMetal;
|
||||
|
||||
public TileEntityProxyCombo() { }
|
||||
|
||||
@ -41,7 +45,10 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
this.power = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TileEntityProxyCombo moltenMetal() {
|
||||
this.moltenMetal = true;
|
||||
return this;
|
||||
}
|
||||
public TileEntityProxyCombo fluid() {
|
||||
this.fluid = true;
|
||||
return this;
|
||||
@ -425,6 +432,7 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
this.inventory = nbt.getBoolean("inv");
|
||||
this.power = nbt.getBoolean("power");
|
||||
this.fluid = nbt.getBoolean("fluid");
|
||||
this.moltenMetal = nbt.getBoolean("metal");
|
||||
this.heat = nbt.getBoolean("heat");
|
||||
}
|
||||
|
||||
@ -435,6 +443,7 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
nbt.setBoolean("inv", inventory);
|
||||
nbt.setBoolean("power", power);
|
||||
nbt.setBoolean("fluid", fluid);
|
||||
nbt.setBoolean("metal", moltenMetal);
|
||||
nbt.setBoolean("heat", heat);
|
||||
}
|
||||
|
||||
@ -497,4 +506,36 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
((IHeatSource)getTile()).useUpHeat(heat);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
if(this.moltenMetal && getTile() instanceof ICrucibleAcceptor){
|
||||
return ((ICrucibleAcceptor)getTile()).canAcceptPartialPour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mats.MaterialStack pour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
if(this.moltenMetal && getTile() instanceof ICrucibleAcceptor){
|
||||
return ((ICrucibleAcceptor)getTile()).pour(world, x, y, z, dX, dY, dZ, side, stack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialFlow(World world, int x, int y, int z, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
if(this.moltenMetal && getTile() instanceof ICrucibleAcceptor){
|
||||
return ((ICrucibleAcceptor)getTile()).canAcceptPartialFlow(world, x, y, z, side, stack);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mats.MaterialStack flow(World world, int x, int y, int z, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
if(this.moltenMetal && getTile() instanceof ICrucibleAcceptor){
|
||||
return ((ICrucibleAcceptor)getTile()).flow(world, x, y, z, side, stack);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -82,9 +82,7 @@ public class TileMappings {
|
||||
put(TileEntityConverterRfHe.class, "tileentity_converter_rfhe");
|
||||
put(TileEntityMachineSchrabidiumTransmutator.class, "tileentity_schrabidium_transmutator");
|
||||
put(TileEntityMachineDiesel.class, "tileentity_diesel_generator");
|
||||
put(TileEntityWatzCore.class, "tileentity_watz_multiblock");
|
||||
put(TileEntityMachineShredder.class, "tileentity_machine_shredder");
|
||||
put(TileEntityMachineCMBFactory.class, "tileentity_machine_cmb");
|
||||
put(TileEntityFWatzCore.class, "tileentity_fwatz_multiblock");
|
||||
put(TileEntityMachineTeleporter.class, "tileentity_teleblock");
|
||||
put(TileEntityHatch.class, "tileentity_seal_lid");
|
||||
@ -94,8 +92,6 @@ public class TileMappings {
|
||||
put(TileEntityMachineCyclotron.class, "tileentity_cyclotron");
|
||||
put(TileEntityMachineExposureChamber.class, "tileentity_exposure_chamber");
|
||||
put(TileEntityMachineRTG.class, "tileentity_machine_rtg");
|
||||
put(TileEntityStructureMarker.class, "tileentity_structure_marker");
|
||||
put(TileEntityMachineMiningDrill.class, "tileentity_mining_drill");
|
||||
put(TileEntityMachineExcavator.class, "tileentity_ntm_excavator");
|
||||
put(TileEntityFluidDuctSimple.class, "tileentity_universal_duct_simple");
|
||||
put(TileEntityFluidDuct.class, "tileentity_universal_duct");
|
||||
@ -116,6 +112,7 @@ public class TileMappings {
|
||||
put(TileEntityMachineRadGen.class, "tileentity_radgen");
|
||||
put(TileEntityMachineTransformer.class, "tileentity_transformer");
|
||||
put(TileEntityMachineRadarNT.class, "tileentity_radar");
|
||||
put(TileEntityMachineRadarLarge.class, "tileentity_radar_large");
|
||||
put(TileEntityMachineRadarScreen.class, "tileentity_radar_screen");
|
||||
put(TileEntityBroadcaster.class, "tileentity_pink_cloud_broadcaster");
|
||||
put(TileEntityMachineSeleniumEngine.class, "tileentity_selenium_engine");
|
||||
@ -139,7 +136,6 @@ public class TileMappings {
|
||||
put(TileEntityMachineShredderLarge.class, "tileentity_machine_big_shredder");
|
||||
put(TileEntityRFDuct.class, "tileentity_hbm_rfduct");
|
||||
put(TileEntityReactorControl.class, "tileentity_reactor_remote_control");
|
||||
put(TileEntityMachineReactorLarge.class, "tileentity_large_reactor");
|
||||
put(TileEntityWasteDrum.class, "tileentity_waste_drum");
|
||||
put(TileEntityDecon.class, "tileentity_decon");
|
||||
put(TileEntityMachineSatDock.class, "tileentity_miner_dock");
|
||||
@ -296,6 +292,7 @@ public class TileMappings {
|
||||
put(TileEntityFoundryOutlet.class, "tileentity_foundry_outlet");
|
||||
put(TileEntityFoundrySlagtap.class, "tileentity_foundry_slagtap");
|
||||
put(TileEntitySlag.class, "tileentity_foundry_slag");
|
||||
put(TileEntityMachineStrandCaster.class, "tileentity_strand_caster");
|
||||
|
||||
put(TileEntityMachineAutocrafter.class, "tileentity_autocrafter");
|
||||
put(TileEntityMachineFunnel.class, "tileentity_funnel");
|
||||
|
||||
@ -158,7 +158,7 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset).getOpposite();
|
||||
Vec3 impact = Vec3.createVectorHelper(0, 0, 0);
|
||||
MaterialStack didPour = CrucibleUtil.pourFullStack(worldObj, xCoord + 0.5D + dir.offsetX * 1.875D, yCoord + 0.25D, zCoord + 0.5D + dir.offsetZ * 1.875D, 6, true, this.wasteStack, MaterialShapes.NUGGET.q(2), impact);
|
||||
MaterialStack didPour = CrucibleUtil.pourFullStack(worldObj, xCoord + 0.5D + dir.offsetX * 1.875D, yCoord + 0.25D, zCoord + 0.5D + dir.offsetZ * 1.875D, 6, true, this.wasteStack, MaterialShapes.NUGGET.q(3), impact);
|
||||
|
||||
if(didPour != null) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
@ -198,7 +198,7 @@ public class TileEntityCrucible extends TileEntityMachineBase implements IGUIPro
|
||||
}
|
||||
|
||||
Vec3 impact = Vec3.createVectorHelper(0, 0, 0);
|
||||
MaterialStack didPour = CrucibleUtil.pourFullStack(worldObj, xCoord + 0.5D + dir.offsetX * 1.875D, yCoord + 0.25D, zCoord + 0.5D + dir.offsetZ * 1.875D, 6, true, toCast, MaterialShapes.NUGGET.q(2), impact);
|
||||
MaterialStack didPour = CrucibleUtil.pourFullStack(worldObj, xCoord + 0.5D + dir.offsetX * 1.875D, yCoord + 0.25D, zCoord + 0.5D + dir.offsetZ * 1.875D, 6, true, toCast, MaterialShapes.NUGGET.q(3), impact);
|
||||
|
||||
if(didPour != null) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
@ -7,7 +7,11 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityFoundryBasin extends TileEntityFoundryCastingBase implements IRenderFoundry {
|
||||
|
||||
|
||||
public TileEntityFoundryBasin() {
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.items.machine.ItemMold.Mold;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@ -19,10 +20,12 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
*
|
||||
*/
|
||||
public abstract class TileEntityFoundryCastingBase extends TileEntityFoundryBase implements ISidedInventory {
|
||||
|
||||
public ItemStack slots[] = new ItemStack[2];
|
||||
public ItemStack[] slots;
|
||||
public TileEntityFoundryCastingBase(int slotCount) {
|
||||
slots = new ItemStack[slotCount];
|
||||
}
|
||||
public int cooloff = 100;
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
@ -3,7 +3,11 @@ package com.hbm.tileentity.machine;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
|
||||
public class TileEntityFoundryMold extends TileEntityFoundryCastingBase implements IRenderFoundry {
|
||||
|
||||
|
||||
public TileEntityFoundryMold() {
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
|
||||
@ -1,385 +0,0 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.container.ContainerMachineCMBFactory;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIMachineCMBFactory;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineCMBFactory extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver, IGUIProvider {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
public long power = 0;
|
||||
public int process = 0;
|
||||
public int soundCycle = 0;
|
||||
public static final long maxPower = 100000000;
|
||||
public static final int processSpeed = 200;
|
||||
public FluidTank tank;
|
||||
|
||||
private static final int[] slots_top = new int[] {1, 3};
|
||||
private static final int[] slots_bottom = new int[] {0, 2, 4};
|
||||
private static final int[] slots_side = new int[] {0, 2};
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityMachineCMBFactory() {
|
||||
slots = new ItemStack[6];
|
||||
tank = new FluidTank(Fluids.WATZ, 8000, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.machineCMB";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <=64;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
switch(i)
|
||||
{
|
||||
case 0:
|
||||
if(stack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
break;
|
||||
case 1:
|
||||
if(stack.getItem() == ModItems.ingot_magnetized_tungsten || stack.getItem() == ModItems.powder_magnetized_tungsten)
|
||||
return true;
|
||||
break;
|
||||
case 2:
|
||||
if(stack.getItem() == ModItems.bucket_mud)
|
||||
return true;
|
||||
break;
|
||||
case 3:
|
||||
if(stack.getItem() == ModItems.ingot_advanced_alloy || stack.getItem() == ModItems.powder_advanced_alloy)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].stackSize <= j)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if (slots[i].stackSize == 0)
|
||||
{
|
||||
slots[i] = null;
|
||||
}
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
power = nbt.getLong("power");
|
||||
tank.readFromNBT(nbt, "watz");
|
||||
process = nbt.getShort("process");
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length)
|
||||
{
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
tank.writeToNBT(nbt, "watz");
|
||||
nbt.setShort("process", (short) process);
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
slots[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_)
|
||||
{
|
||||
return p_94128_1_ == 0 ? slots_bottom : (p_94128_1_ == 1 ? slots_top : slots_side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
if(i == 4)
|
||||
return true;
|
||||
if(i == 0)
|
||||
if (itemStack.getItem() instanceof IBatteryItem && ((IBatteryItem)itemStack.getItem()).getCharge(itemStack) == 0)
|
||||
return true;
|
||||
if(i == 2)
|
||||
if(itemStack.getItem() == Items.bucket)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public long getPowerScaled(long i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
public int getProgressScaled(int i) {
|
||||
return (process * i) / processSpeed;
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
|
||||
boolean b = false;
|
||||
|
||||
if(tank.getFill() >= 1 && power >= 100000 && slots[1] != null && slots[3] != null && (slots[4] == null || slots[4].stackSize <= 60))
|
||||
{
|
||||
boolean flag0 = slots[1].getItem() == ModItems.ingot_magnetized_tungsten || slots[1].getItem() == ModItems.powder_magnetized_tungsten;
|
||||
boolean flag1 = slots[3].getItem() == ModItems.ingot_advanced_alloy || slots[3].getItem() == ModItems.powder_advanced_alloy;
|
||||
|
||||
b = flag0 && flag1;
|
||||
}
|
||||
|
||||
return b;
|
||||
}
|
||||
|
||||
public boolean isProcessing() {
|
||||
return process > 0;
|
||||
}
|
||||
|
||||
public void process() {
|
||||
tank.setFill(tank.getFill() - 1);
|
||||
power -= 100000;
|
||||
|
||||
process++;
|
||||
|
||||
if(process >= processSpeed) {
|
||||
|
||||
slots[1].stackSize--;
|
||||
if (slots[1].stackSize == 0) {
|
||||
slots[1] = null;
|
||||
}
|
||||
|
||||
slots[3].stackSize--;
|
||||
if (slots[3].stackSize == 0) {
|
||||
slots[3] = null;
|
||||
}
|
||||
|
||||
if(slots[4] == null)
|
||||
{
|
||||
slots[4] = new ItemStack(ModItems.ingot_combine_steel, 4);
|
||||
} else {
|
||||
|
||||
slots[4].stackSize += 4;
|
||||
}
|
||||
|
||||
process = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if (!worldObj.isRemote) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
tank.loadTank(2, 5, slots);
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
|
||||
if (canProcess()) {
|
||||
process();
|
||||
if(soundCycle == 0)
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "minecart.base", 1.0F, 1.5F);
|
||||
soundCycle++;
|
||||
|
||||
if(soundCycle >= 25)
|
||||
soundCycle = 0;
|
||||
} else {
|
||||
process = 0;
|
||||
}
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
}
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
this.updateStandardConnections(worldObj, this);
|
||||
this.subscribeToAllAround(tank.getTankType(), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineCMBFactory(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineCMBFactory(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@ -428,41 +428,50 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
|
||||
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
||||
int[] access = sided != null ? sided.getAccessibleSlotsFromSide(dir.ordinal()) : null;
|
||||
|
||||
for(int i = 5; i <= 8; i++) {
|
||||
|
||||
ItemStack out = slots[i];
|
||||
|
||||
if(out != null) {
|
||||
boolean shouldOutput = true;
|
||||
|
||||
while(shouldOutput) {
|
||||
shouldOutput = false;
|
||||
outer:
|
||||
for(int i = 5; i <= 8; i++) {
|
||||
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
ItemStack out = slots[i];
|
||||
|
||||
if(out != null) {
|
||||
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
|
||||
ItemStack target = inv.getStackInSlot(slot);
|
||||
|
||||
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < target.getMaxStackSize()) {
|
||||
this.decrStackSize(i, 1);
|
||||
target.stackSize++;
|
||||
return;
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
|
||||
ItemStack target = inv.getStackInSlot(slot);
|
||||
|
||||
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < Math.min(target.getMaxStackSize(), inv.getInventoryStackLimit())) {
|
||||
int toDec = Math.min(out.stackSize, Math.min(target.getMaxStackSize(), inv.getInventoryStackLimit()) - target.stackSize);
|
||||
this.decrStackSize(i, toDec);
|
||||
target.stackSize += toDec;
|
||||
shouldOutput = true;
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
|
||||
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, dir.ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
||||
ItemStack copy = out.copy();
|
||||
copy.stackSize = 1;
|
||||
inv.setInventorySlotContents(slot, copy);
|
||||
this.decrStackSize(i, 1);
|
||||
return;
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
|
||||
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, dir.ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
||||
ItemStack copy = out.copy();
|
||||
copy.stackSize = 1;
|
||||
inv.setInventorySlotContents(slot, copy);
|
||||
this.decrStackSize(i, 1);
|
||||
shouldOutput = true;
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -271,42 +271,50 @@ public abstract class TileEntityMachineChemplantBase extends TileEntityMachineBa
|
||||
IInventory inv = (IInventory) te;
|
||||
ISidedInventory sided = inv instanceof ISidedInventory ? (ISidedInventory) inv : null;
|
||||
int[] access = sided != null ? sided.getAccessibleSlotsFromSide(coord.getDir().ordinal()) : null;
|
||||
|
||||
for(int i = indices[2]; i <= indices[3]; i++) {
|
||||
|
||||
ItemStack out = slots[i];
|
||||
|
||||
if(out != null) {
|
||||
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
boolean shouldOutput = true;
|
||||
while(shouldOutput) {
|
||||
shouldOutput = false;
|
||||
outer:
|
||||
for(int i = indices[2]; i <= indices[3]; i++) {
|
||||
|
||||
ItemStack out = slots[i];
|
||||
|
||||
if(out != null) {
|
||||
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
|
||||
ItemStack target = inv.getStackInSlot(slot);
|
||||
|
||||
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < target.getMaxStackSize() && target.stackSize < inv.getInventoryStackLimit()) {
|
||||
this.decrStackSize(i, 1);
|
||||
target.stackSize++;
|
||||
return;
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
|
||||
ItemStack target = inv.getStackInSlot(slot);
|
||||
|
||||
if(InventoryUtil.doesStackDataMatch(out, target) && target.stackSize < target.getMaxStackSize() && target.stackSize < inv.getInventoryStackLimit()) {
|
||||
int toDec = Math.min(out.stackSize, Math.min(target.getMaxStackSize(), inv.getInventoryStackLimit()) - target.stackSize);
|
||||
this.decrStackSize(i, toDec);
|
||||
target.stackSize += toDec;
|
||||
shouldOutput = true;
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
|
||||
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, coord.getDir().ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
||||
ItemStack copy = out.copy();
|
||||
copy.stackSize = 1;
|
||||
inv.setInventorySlotContents(slot, copy);
|
||||
this.decrStackSize(i, 1);
|
||||
return;
|
||||
for(int j = 0; j < (access != null ? access.length : inv.getSizeInventory()); j++) {
|
||||
|
||||
int slot = access != null ? access[j] : j;
|
||||
|
||||
if(!inv.isItemValidForSlot(slot, out))
|
||||
continue;
|
||||
|
||||
if(inv.getStackInSlot(slot) == null && (sided != null ? sided.canInsertItem(slot, out, coord.getDir().ordinal()) : inv.isItemValidForSlot(slot, out))) {
|
||||
ItemStack copy = out.copy();
|
||||
copy.stackSize = 1;
|
||||
inv.setInventorySlotContents(slot, copy);
|
||||
this.decrStackSize(i, 1);
|
||||
shouldOutput = true;
|
||||
break outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,495 +0,0 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerMachineMiningDrill;
|
||||
import com.hbm.inventory.gui.GUIMachineMiningDrill;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.LoopedSoundPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEDrillPacket;
|
||||
import com.hbm.sound.SoundLoopMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import api.hbm.block.IDrillInteraction;
|
||||
import api.hbm.block.IMiningDrill;
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
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;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineMiningDrill extends TileEntityMachineBase implements IEnergyUser, IMiningDrill, IGUIProvider {
|
||||
|
||||
public long power;
|
||||
public int warning;
|
||||
public static final long maxPower = 100000;
|
||||
int age = 0;
|
||||
int timer = 50;
|
||||
int radius = 100;
|
||||
int consumption = 100;
|
||||
int fortune = 0;
|
||||
boolean flag = true;
|
||||
public float torque;
|
||||
public float rotation;
|
||||
SoundLoopMachine sound;
|
||||
|
||||
public TileEntityMachineMiningDrill() {
|
||||
super(13);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.miningDrill";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
if(i == 0)
|
||||
if(itemStack.getItem() instanceof IBatteryItem)
|
||||
return true;
|
||||
|
||||
if(i == 1)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
this.power = nbt.getLong("power");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setLong("power", power);
|
||||
}
|
||||
|
||||
public long getPowerScaled(long i) {
|
||||
return (power * i) / maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
this.consumption = 100;
|
||||
this.timer = 50;
|
||||
this.radius = 1;
|
||||
this.fortune = 0;
|
||||
|
||||
UpgradeManager.eval(slots, 10, 12);
|
||||
this.radius += Math.min(UpgradeManager.getLevel(UpgradeType.EFFECT), 3);
|
||||
this.consumption += Math.min(UpgradeManager.getLevel(UpgradeType.EFFECT), 3) * 80;
|
||||
|
||||
this.timer -= Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3) * 15;
|
||||
this.consumption += Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3) * 300;
|
||||
|
||||
this.consumption -= Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3) * 30;
|
||||
this.timer += Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3) * 5;
|
||||
|
||||
this.fortune += Math.min(UpgradeManager.getLevel(UpgradeType.FORTUNE), 3);
|
||||
this.timer += Math.min(UpgradeManager.getLevel(UpgradeType.FORTUNE), 3) * 15;
|
||||
|
||||
age++;
|
||||
if(age >= timer)
|
||||
age -= timer;
|
||||
|
||||
power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
|
||||
if(power >= consumption) {
|
||||
|
||||
//operation start
|
||||
|
||||
if(age == timer - 1) {
|
||||
warning = 0;
|
||||
|
||||
//warning 0, green: drill is operational
|
||||
//warning 1, red: drill is full, has no power or the drill is jammed
|
||||
//warning 2, yellow: drill has reached max depth
|
||||
|
||||
for(int i = this.yCoord - 1; i > this.yCoord - 1 - 100; i--) {
|
||||
|
||||
if(i <= 3) {
|
||||
//Code 2: The drilling ended
|
||||
warning = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
if(worldObj.getBlock(xCoord, i, zCoord) != ModBlocks.drill_pipe) {
|
||||
|
||||
if(worldObj.getBlock(xCoord, i, zCoord).isReplaceable(worldObj, xCoord, i, zCoord) || this.tryDrill(xCoord, i, zCoord)) {
|
||||
|
||||
if(worldObj.getBlock(xCoord, i, zCoord).isReplaceable(worldObj, xCoord, i, zCoord)) {
|
||||
worldObj.setBlock(xCoord, i, zCoord, ModBlocks.drill_pipe);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
} else {
|
||||
this.warning = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.drill(xCoord, i, zCoord, radius))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//operation end
|
||||
|
||||
power -= consumption;
|
||||
} else {
|
||||
warning = 1;
|
||||
}
|
||||
|
||||
int meta = worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
TileEntity te = null;
|
||||
if(meta == 2) {
|
||||
te = worldObj.getTileEntity(xCoord - 2, yCoord, zCoord);
|
||||
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
|
||||
}
|
||||
if(meta == 3) {
|
||||
te = worldObj.getTileEntity(xCoord + 2, yCoord, zCoord);
|
||||
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
|
||||
}
|
||||
if(meta == 4) {
|
||||
te = worldObj.getTileEntity(xCoord, yCoord, zCoord + 2);
|
||||
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
|
||||
}
|
||||
if(meta == 5) {
|
||||
te = worldObj.getTileEntity(xCoord, yCoord, zCoord - 2);
|
||||
//worldObj.setBlock(xCoord - 2, yCoord, zCoord, Blocks.dirt);
|
||||
}
|
||||
|
||||
if(te != null && te instanceof IInventory) {
|
||||
IInventory chest = (IInventory)te;
|
||||
|
||||
for(int i = 1; i < 10; i++)
|
||||
if(tryFillContainer(chest, i))
|
||||
break;
|
||||
}
|
||||
|
||||
if(warning == 0) {
|
||||
torque += 0.1;
|
||||
if(torque > (100/timer))
|
||||
torque = (100/timer);
|
||||
} else {
|
||||
torque -= 0.1F;
|
||||
if(torque < -(100/timer))
|
||||
torque = -(100/timer);
|
||||
}
|
||||
|
||||
if(torque < 0) {
|
||||
torque = 0;
|
||||
}
|
||||
rotation += torque;
|
||||
if(rotation >= 360)
|
||||
rotation -= 360;
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEDrillPacket(xCoord, yCoord, zCoord, rotation, torque), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 150));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new LoopedSoundPacket(xCoord, yCoord, zCoord), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
}
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
this.getBlockMetadata();
|
||||
|
||||
if(this.blockMetadata == 5 || this.blockMetadata == 4) {
|
||||
this.trySubscribe(worldObj, xCoord + 2, yCoord, zCoord, Library.POS_X);
|
||||
this.trySubscribe(worldObj, xCoord - 2, yCoord, zCoord, Library.NEG_X);
|
||||
|
||||
} else if(this.blockMetadata == 3 || this.blockMetadata == 2) {
|
||||
this.trySubscribe(worldObj, xCoord, yCoord, zCoord + 2, Library.POS_Z);
|
||||
this.trySubscribe(worldObj, xCoord, yCoord, zCoord - 2, Library.NEG_Z);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean tryFillContainer(IInventory inventory, int slot) {
|
||||
|
||||
int size = inventory.getSizeInventory();
|
||||
|
||||
for(int i = 0; i < size; i++) {
|
||||
if(inventory.getStackInSlot(i) != null) {
|
||||
|
||||
if(slots[slot] == null)
|
||||
return false;
|
||||
|
||||
ItemStack sta1 = inventory.getStackInSlot(i).copy();
|
||||
ItemStack sta2 = slots[slot].copy();
|
||||
|
||||
if(!inventory.isItemValidForSlot(i, sta2))
|
||||
continue;
|
||||
|
||||
if(sta1 != null && sta2 != null) {
|
||||
sta1.stackSize = 1;
|
||||
sta2.stackSize = 1;
|
||||
|
||||
if(ItemStack.areItemStacksEqual(sta1, sta2) && ItemStack.areItemStackTagsEqual(sta1, sta2) && inventory.getStackInSlot(i).stackSize < inventory.getStackInSlot(i).getMaxStackSize()) {
|
||||
slots[slot].stackSize--;
|
||||
|
||||
if(slots[slot].stackSize <= 0)
|
||||
slots[slot] = null;
|
||||
|
||||
ItemStack sta3 = inventory.getStackInSlot(i).copy();
|
||||
sta3.stackSize++;
|
||||
inventory.setInventorySlotContents(i, sta3);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int i = 0; i < size; i++) {
|
||||
|
||||
if(slots[slot] == null)
|
||||
return false;
|
||||
|
||||
ItemStack sta2 = slots[slot].copy();
|
||||
|
||||
if(!inventory.isItemValidForSlot(i, sta2))
|
||||
continue;
|
||||
|
||||
if(inventory.getStackInSlot(i) == null && sta2 != null) {
|
||||
sta2.stackSize = 1;
|
||||
slots[slot].stackSize--;
|
||||
|
||||
if(slots[slot].stackSize <= 0)
|
||||
slots[slot] = null;
|
||||
|
||||
inventory.setInventorySlotContents(i, sta2);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//Method: isOre
|
||||
//"make it oreo!"
|
||||
//"ok"
|
||||
public boolean isOreo(int x, int y, int z) {
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
float hardness = b.getBlockHardness(worldObj, x, y, z);
|
||||
|
||||
return hardness < 70 && hardness >= 0;
|
||||
}
|
||||
|
||||
public boolean isMinableOreo(int x, int y, int z) {
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
float hardness = b.getBlockHardness(worldObj, x, y, z);
|
||||
|
||||
return (hardness < 70 && hardness >= 0) || b instanceof IDrillInteraction;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if there has been a successful mining operation
|
||||
* returns false if no block could be mined and the drill is ready to extend
|
||||
* */
|
||||
public boolean drill(int x, int y, int z, int rad) {
|
||||
|
||||
if(!flag)
|
||||
return false;
|
||||
|
||||
for(int ix = x - rad; ix <= x + rad; ix++) {
|
||||
for(int iz = z - rad; iz <= z + rad; iz++) {
|
||||
|
||||
if(ix != x || iz != z)
|
||||
if(tryDrill(ix, y, iz))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if there has been a successful mining operation
|
||||
* returns false if no block could be mined, as it is either air or unmineable
|
||||
* */
|
||||
public boolean tryDrill(int x, int y, int z) {
|
||||
|
||||
if(worldObj.getBlock(x, y, z).isAir(worldObj, x, y, z) || !isMinableOreo(x, y, z))
|
||||
return false;
|
||||
if(worldObj.getBlock(x, y, z).getMaterial().isLiquid()) {
|
||||
worldObj.func_147480_a(x, y, z, false);
|
||||
return false;
|
||||
}
|
||||
|
||||
Block b = worldObj.getBlock(x, y, z);
|
||||
int meta = worldObj.getBlockMetadata(x, y, z);
|
||||
|
||||
if(b instanceof IDrillInteraction) {
|
||||
IDrillInteraction in = (IDrillInteraction) b;
|
||||
|
||||
ItemStack sta = in.extractResource(worldObj, x, y, z, meta, this);
|
||||
|
||||
if(sta != null && hasSpace(sta)) {
|
||||
this.addItemToInventory(sta);
|
||||
}
|
||||
|
||||
if(!in.canBreak(worldObj, x, y, z, meta, this))
|
||||
return true; //true because the block is still there and mining should continue
|
||||
}
|
||||
|
||||
ItemStack stack = new ItemStack(b.getItemDropped(meta, worldObj.rand, fortune), b.quantityDropped(meta, fortune, worldObj.rand), b.damageDropped(meta));
|
||||
|
||||
//yup that worked
|
||||
if(stack != null && stack.getItem() == null) {
|
||||
worldObj.func_147480_a(x, y, z, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if(hasSpace(stack)) {
|
||||
this.addItemToInventory(stack);
|
||||
worldObj.func_147480_a(x, y, z, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasSpace(ItemStack stack) {
|
||||
|
||||
ItemStack st = stack.copy();
|
||||
|
||||
if(st == null)
|
||||
return true;
|
||||
|
||||
for(int i = 1; i < 10; i++) {
|
||||
if(slots[i] == null)
|
||||
return true;
|
||||
}
|
||||
|
||||
st.stackSize = 1;
|
||||
|
||||
ItemStack[] fakeArray = slots.clone();
|
||||
boolean flag = true;
|
||||
for(int i = 0; i < stack.stackSize; i++) {
|
||||
if(!canAddItemToArray(st, fakeArray))
|
||||
flag = false;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
public void addItemToInventory(ItemStack stack) {
|
||||
|
||||
ItemStack st = stack.copy();
|
||||
|
||||
if(st == null)
|
||||
return;
|
||||
|
||||
int size = st.stackSize;
|
||||
st.stackSize = 1;
|
||||
|
||||
for(int i = 0; i < size; i++)
|
||||
canAddItemToArray(st, this.slots);
|
||||
|
||||
}
|
||||
|
||||
public boolean canAddItemToArray(ItemStack stack, ItemStack[] array) {
|
||||
|
||||
ItemStack st = stack.copy();
|
||||
|
||||
if(stack == null || st == null)
|
||||
return true;
|
||||
|
||||
for(int i = 1; i < 10; i++) {
|
||||
|
||||
if(array[i] != null) {
|
||||
ItemStack sta = array[i].copy();
|
||||
|
||||
if(stack == null || st == null)
|
||||
return true;
|
||||
|
||||
if(sta != null && sta.getItem() == st.getItem() && sta.stackSize < st.getMaxStackSize()) {
|
||||
array[i].stackSize++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 1; i < 10; i++) {
|
||||
if(array[i] == null) {
|
||||
array[i] = stack.copy();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
power = i;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return TileEntity.INFINITE_EXTENT_AABB;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared()
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DrillType getDrillTier() {
|
||||
return DrillType.INDUSTRIAL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDrillRating() {
|
||||
return 50;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineMiningDrill(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineMiningDrill(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
public class TileEntityMachineRadarLarge extends TileEntityMachineRadarNT {
|
||||
|
||||
@Override
|
||||
public int getRange() {
|
||||
return radarLargeRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DirPos[] getConPos() {
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + 2, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 2, yCoord, zCoord, Library.NEG_X),
|
||||
new DirPos(xCoord, yCoord, zCoord + 2, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 2, Library.NEG_Z),
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 5,
|
||||
yCoord,
|
||||
zCoord - 5,
|
||||
xCoord + 6,
|
||||
yCoord + 10,
|
||||
zCoord + 6
|
||||
);
|
||||
}
|
||||
|
||||
return bb;
|
||||
}
|
||||
}
|
||||
@ -19,6 +19,8 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.items.tool.ItemCoordinateBase;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.saveddata.SatelliteSavedData;
|
||||
import com.hbm.saveddata.satellites.Satellite;
|
||||
import com.hbm.saveddata.satellites.Satellite.Interfaces;
|
||||
@ -30,6 +32,7 @@ import com.hbm.tileentity.IRadarCommandReceiver;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.Tuple.Triplet;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
import com.hbm.world.WorldUtil;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -37,10 +40,12 @@ import api.hbm.entity.IRadarDetectable;
|
||||
import api.hbm.entity.IRadarDetectableNT;
|
||||
import api.hbm.entity.IRadarDetectableNT.RadarScanParams;
|
||||
import api.hbm.entity.RadarEntry;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@ -54,6 +59,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldServer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Now with SmЯt™ lag-free entity detection! (patent pending)
|
||||
@ -82,6 +88,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
public static int maxPower = 100_000;
|
||||
public static int consumption = 500;
|
||||
public static int radarRange = 1_000;
|
||||
public static int radarLargeRange = 3_000;
|
||||
public static int radarBuffer = 30;
|
||||
public static int radarAltitude = 55;
|
||||
public static int chunkLoadCap = 10;
|
||||
@ -102,6 +109,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
maxPower = IConfigurableMachine.grab(obj, "L:powerCap", maxPower);
|
||||
consumption = IConfigurableMachine.grab(obj, "L:consumption", consumption);
|
||||
radarRange = IConfigurableMachine.grab(obj, "I:radarRange", radarRange);
|
||||
radarLargeRange = IConfigurableMachine.grab(obj, "I:radarLargeRange", radarLargeRange);
|
||||
radarBuffer = IConfigurableMachine.grab(obj, "I:radarBuffer", radarBuffer);
|
||||
radarAltitude = IConfigurableMachine.grab(obj, "I:radarAltitude", radarAltitude);
|
||||
chunkLoadCap = IConfigurableMachine.grab(obj, "I:chunkLoadCap", chunkLoadCap);
|
||||
@ -113,6 +121,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
writer.name("L:powerCap").value(maxPower);
|
||||
writer.name("L:consumption").value(consumption);
|
||||
writer.name("I:radarRange").value(radarRange);
|
||||
writer.name("I:radarLargeRange").value(radarLargeRange);
|
||||
writer.name("I:radarBuffer").value(radarBuffer);
|
||||
writer.name("I:radarAltitude").value(radarAltitude);
|
||||
writer.name("B:generateChunks").value(generateChunks);
|
||||
@ -126,6 +135,10 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
public String getName() {
|
||||
return "container.radar";
|
||||
}
|
||||
|
||||
public int getRange() {
|
||||
return radarRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
@ -136,14 +149,19 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
|
||||
this.power = Library.chargeTEFromItems(slots, 9, power, maxPower);
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) this.updateStandardConnections(worldObj, xCoord, yCoord, zCoord);
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
for(DirPos pos : getConPos()) {
|
||||
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
this.power = Library.chargeTEFromItems(slots, 0, power, maxPower);
|
||||
this.jammed = false;
|
||||
allocateTargets();
|
||||
|
||||
if(this.lastPower != getRedPower()) {
|
||||
this.markDirty();
|
||||
this.markChanged();
|
||||
for(DirPos pos : getConPos()) this.updateRedstoneConnection(pos);
|
||||
}
|
||||
lastPower = getRedPower();
|
||||
|
||||
@ -161,11 +179,11 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
int chunkLoads = 0;
|
||||
for(int i = 0; i < 100; i++) {
|
||||
int index = (int) (worldObj.getTotalWorldTime() % 400) * 100 + i;
|
||||
int iX = (index % 200) * radarRange * 2 / 200;
|
||||
int iZ = index / 200 * radarRange * 2 / 200;
|
||||
int iX = (index % 200) * getRange() * 2 / 200;
|
||||
int iZ = index / 200 * getRange() * 2 / 200;
|
||||
|
||||
int x = xCoord - radarRange + iX;
|
||||
int z = zCoord - radarRange + iZ;
|
||||
int x = xCoord - getRange() + iX;
|
||||
int z = zCoord - getRange() + iZ;
|
||||
|
||||
if(worldObj.getChunkProvider().chunkExists(x >> 4, z >> 4)) {
|
||||
this.map[index] = (byte) MathHelper.clamp_int(worldObj.getHeightValue(x, z), 50, 128);
|
||||
@ -217,6 +235,15 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getConPos() {
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + 1, yCoord, zCoord, Library.POS_X),
|
||||
new DirPos(xCoord - 1, yCoord, zCoord, Library.NEG_X),
|
||||
new DirPos(xCoord, yCoord, zCoord + 1, Library.POS_Z),
|
||||
new DirPos(xCoord, yCoord, zCoord - 1, Library.NEG_Z),
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeLong(this.power);
|
||||
@ -341,7 +368,7 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
/// PROXIMITY ///
|
||||
if(redMode) {
|
||||
|
||||
double maxRange = WeaponConfig.radarRange * Math.sqrt(2D);
|
||||
double maxRange = this.getRange() * Math.sqrt(2D);
|
||||
int power = 0;
|
||||
|
||||
for(int i = 0; i < entries.size(); i++) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,332 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.inventory.container.ContainerMachineStrandCaster;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIMachineStrandCaster;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMold;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
//god thank you bob for this base class
|
||||
public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase implements IGUIProvider, ICrucibleAcceptor, ISidedInventory, IFluidStandardTransceiver, INBTPacketReceiver, IInventory {
|
||||
|
||||
public FluidTank water;
|
||||
public FluidTank steam;
|
||||
|
||||
public String getName() {
|
||||
return "container.machineStrandCaster";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
public TileEntityMachineStrandCaster() {
|
||||
super(7);
|
||||
water = new FluidTank(Fluids.WATER, 64_000);
|
||||
steam = new FluidTank(Fluids.SPENTSTEAM, 64_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(this.lastType != this.type || this.lastAmount != this.amount) {
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
this.lastType = this.type;
|
||||
this.lastAmount = this.amount;
|
||||
}
|
||||
|
||||
if(this.amount >= this.getCapacity()) {
|
||||
// In case of overfill problems, spit out the excess as scrap
|
||||
if(amount > getCapacity()) {
|
||||
ItemStack scrap = ItemScraps.create(new Mats.MaterialStack(type, amount));
|
||||
EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 2, zCoord + 0.5, scrap);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
this.amount = this.getCapacity();
|
||||
|
||||
}
|
||||
|
||||
if(this.amount == 0) {
|
||||
this.type = null;
|
||||
}
|
||||
|
||||
this.updateConnections();
|
||||
|
||||
ItemMold.Mold mold = this.getInstalledMold();
|
||||
|
||||
if(canProcess()) {
|
||||
|
||||
int itemsCasted = Math.min(amount / mold.getCost(), 9);
|
||||
|
||||
for(int j = 0; j < itemsCasted; j++) {
|
||||
this.amount -= mold.getCost();
|
||||
|
||||
ItemStack out = mold.getOutput(type);
|
||||
|
||||
for(int i = 1; i < 7; i++) {
|
||||
if(slots[i] == null) {
|
||||
slots[i] = out.copy();
|
||||
break;
|
||||
}
|
||||
|
||||
if(slots[i].isItemEqual(out) && slots[i].stackSize + out.stackSize <= out.getMaxStackSize()) {
|
||||
slots[i].stackSize += out.stackSize;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
markChanged();
|
||||
|
||||
water.setFill(water.getFill() - getWaterRequired() * itemsCasted);
|
||||
steam.setFill(steam.getFill() + getWaterRequired() * itemsCasted);
|
||||
}
|
||||
}
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
water.writeToNBT(data, "w");
|
||||
steam.writeToNBT(data, "s");
|
||||
|
||||
this.networkPack(data, 150);
|
||||
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
ItemMold.Mold mold = this.getInstalledMold();
|
||||
if(type != null && mold != null && this.amount >= mold.getCost() * 9 && mold.getOutput(type) != null) {
|
||||
for(int i = 1; i < 7; i++) {
|
||||
if(slots[i] == null || slots[i].isItemEqual(mold.getOutput(type)) && slots[i].stackSize + mold.getOutput(type).stackSize <= mold.getOutput(type).getMaxStackSize())
|
||||
return water.getFill() >= getWaterRequired() && steam.getFill() < steam.getMaxFill();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public DirPos[] getFluidConPos() {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + rot.offsetX * 2 - dir.offsetX, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ, rot),
|
||||
new DirPos(xCoord - rot.offsetX - dir.offsetX, yCoord, zCoord - rot.offsetZ - dir.offsetZ, rot.getOpposite()),
|
||||
new DirPos(xCoord + rot.offsetX * 2 - dir.offsetX * 5, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ * 5, rot),
|
||||
new DirPos(xCoord - rot.offsetX - dir.offsetX * 5, yCoord, zCoord - rot.offsetZ + dir.offsetZ * 5, rot.getOpposite())
|
||||
};
|
||||
}
|
||||
|
||||
public int[][] getMetalPourPos() {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new int[][] {
|
||||
new int[] { xCoord + rot.offsetX - dir.offsetX, yCoord + 2, zCoord + rot.offsetZ - dir.offsetZ },
|
||||
new int[] { xCoord - dir.offsetX, yCoord + 2, zCoord - dir.offsetZ },
|
||||
new int[] { xCoord + rot.offsetX, yCoord + 2, zCoord + rot.offsetZ },
|
||||
new int[] { xCoord, yCoord + 2, zCoord }
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemMold.Mold getInstalledMold() {
|
||||
if(slots[0] == null)
|
||||
return null;
|
||||
|
||||
if(slots[0].getItem() == ModItems.mold) {
|
||||
return ((ItemMold) slots[0].getItem()).getMold(slots[0]);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMoldSize() {
|
||||
return getInstalledMold().size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptPartialPour(World world, int x, int y, int z, double dX, double dY, double dZ, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
|
||||
if(side != ForgeDirection.UP)
|
||||
return false;
|
||||
for(int[] pos : getMetalPourPos()) {
|
||||
if(pos[0] == x && pos[1] == y && pos[2] == z) {
|
||||
return this.standardCheck(world, x, y, z, side, stack);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean standardCheck(World world, int x, int y, int z, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
if(this.type != null && this.type != stack.material)
|
||||
return false;
|
||||
return !(this.amount >= this.getCapacity() || getInstalledMold() == null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
ItemMold.Mold mold = this.getInstalledMold();
|
||||
return mold == null ? 50000 : mold.getCost() * 10;
|
||||
}
|
||||
|
||||
private int getWaterRequired() {
|
||||
return getInstalledMold() != null ? 5 * getInstalledMold().getCost() : 50;
|
||||
}
|
||||
|
||||
private void updateConnections() {
|
||||
for(DirPos pos : getFluidConPos()) {
|
||||
this.trySubscribe(water.getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
for(DirPos pos : getFluidConPos()) {
|
||||
sendFluid(steam, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] { steam };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { water };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] { water, steam };
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineStrandCaster(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineStrandCaster(player.inventory, this);
|
||||
}
|
||||
|
||||
public void networkPack(NBTTagCompound nbt, int range) {
|
||||
if(!worldObj.isRemote)
|
||||
PacketDispatcher.wrapper.sendToAllAround(new NBTPacket(nbt, xCoord, yCoord, zCoord), new NetworkRegistry.TargetPoint(this.worldObj.provider.dimensionId, xCoord, yCoord, zCoord, range));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
water.readFromNBT(nbt, "w");
|
||||
steam.readFromNBT(nbt, "s");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
water.writeToNBT(nbt, "w");
|
||||
steam.writeToNBT(nbt, "s");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
water.readFromNBT(nbt, "w");
|
||||
steam.readFromNBT(nbt, "s");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
if(i == 0) {
|
||||
return stack.getItem() == ModItems.mold;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int meta) {
|
||||
return new int[] { 1, 2, 3, 4, 5, 6 };
|
||||
}
|
||||
|
||||
public void markChanged() {
|
||||
this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this) {
|
||||
return false;
|
||||
} else {
|
||||
return player.getDistanceSq(xCoord + 0.5D, yCoord + 0.5D, zCoord + 0.5D) <= 128;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack itemStack, int side) {
|
||||
return this.isItemValidForSlot(slot, itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int slot, ItemStack itemStack, int side) {
|
||||
return !this.isItemValidForSlot(slot, itemStack);
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 7,
|
||||
yCoord,
|
||||
zCoord - 7,
|
||||
xCoord + 7,
|
||||
yCoord + 3,
|
||||
zCoord + 7);
|
||||
}
|
||||
return bb;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEStructurePacket;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityStructureMarker extends TileEntity {
|
||||
|
||||
//0: Nuclear Reactor
|
||||
//1: Watz Power Plant
|
||||
//2: Fusionary Watz Plant
|
||||
public int type = 0;
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(this.type > 2)
|
||||
type -= 3;
|
||||
|
||||
if(!worldObj.isRemote)
|
||||
PacketDispatcher.wrapper.sendToAllAround(new TEStructurePacket(xCoord, yCoord, zCoord, type), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 250));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
type = nbt.getInteger("type");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
nbt.setInteger("type", type);
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,787 +0,0 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.entity.effect.EntityCloudFleija;
|
||||
import com.hbm.entity.logic.EntityNukeExplosionMK3;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.interfaces.IReactor;
|
||||
import com.hbm.inventory.container.ContainerWatzCore;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIWatzCore;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.special.WatzFuel;
|
||||
import com.hbm.items.tool.ItemTitaniumFilter;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Deprecated
|
||||
public class TileEntityWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidSource, IFluidStandardSender, IGUIProvider {
|
||||
|
||||
public long power;
|
||||
public final static long maxPower = 100000000;
|
||||
public int heat;
|
||||
|
||||
public int heatMultiplier;
|
||||
public int powerMultiplier;
|
||||
public int decayMultiplier;
|
||||
|
||||
public int heatList;
|
||||
public int wasteList;
|
||||
public int powerList;
|
||||
|
||||
Random rand = new Random();
|
||||
|
||||
private ItemStack slots[];
|
||||
public int age = 0;
|
||||
public List<IFluidAcceptor> list1 = new ArrayList();
|
||||
public FluidTank tank;
|
||||
|
||||
private String customName;
|
||||
|
||||
public TileEntityWatzCore() {
|
||||
slots = new ItemStack[40];
|
||||
tank = new FluidTank(Fluids.WATZ, 64000, 0);
|
||||
}
|
||||
@Override
|
||||
public int getSizeInventory() {
|
||||
return slots.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlot(int i) {
|
||||
return slots[i];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int i) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int i, ItemStack itemStack) {
|
||||
slots[i] = itemStack;
|
||||
if(itemStack != null && itemStack.stackSize > getInventoryStackLimit())
|
||||
{
|
||||
itemStack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return this.hasCustomInventoryName() ? this.customName : "container.watzPowerplant";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return this.customName != null && this.customName.length() > 0;
|
||||
}
|
||||
|
||||
public void setCustomName(String name) {
|
||||
this.customName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 64;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer player) {
|
||||
if(worldObj.getTileEntity(xCoord, yCoord, zCoord) != this)
|
||||
{
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory() {}
|
||||
|
||||
@Override
|
||||
public void closeInventory() {}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int i, int j) {
|
||||
if(slots[i] != null)
|
||||
{
|
||||
if(slots[i].stackSize <= j)
|
||||
{
|
||||
ItemStack itemStack = slots[i];
|
||||
slots[i] = null;
|
||||
return itemStack;
|
||||
}
|
||||
ItemStack itemStack1 = slots[i].splitStack(j);
|
||||
if (slots[i].stackSize == 0)
|
||||
{
|
||||
slots[i] = null;
|
||||
}
|
||||
|
||||
return itemStack1;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int p_94128_1_) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int p_102007_1_, ItemStack p_102007_2_, int p_102007_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int p_102008_1_, ItemStack p_102008_2_, int p_102008_3_) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
NBTTagList list = nbt.getTagList("items", 10);
|
||||
|
||||
power = nbt.getLong("power");
|
||||
tank.readFromNBT(nbt, "watz");
|
||||
|
||||
slots = new ItemStack[getSizeInventory()];
|
||||
|
||||
for(int i = 0; i < list.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound nbt1 = list.getCompoundTagAt(i);
|
||||
byte b0 = nbt1.getByte("slot");
|
||||
if(b0 >= 0 && b0 < slots.length)
|
||||
{
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
nbt.setLong("power", power);
|
||||
tank.writeToNBT(nbt, "watz");
|
||||
|
||||
NBTTagList list = new NBTTagList();
|
||||
|
||||
for(int i = 0; i < slots.length; i++)
|
||||
{
|
||||
if(slots[i] != null)
|
||||
{
|
||||
NBTTagCompound nbt1 = new NBTTagCompound();
|
||||
nbt1.setByte("slot", (byte)i);
|
||||
slots[i].writeToNBT(nbt1);
|
||||
list.appendTag(nbt1);
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isStructureValid(World world) {
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord - 1) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord + 1) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord - 2) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 2, this.yCoord + i, this.zCoord + 2) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord - 2) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord) != ModBlocks.watz_cooler)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord + 2) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 1, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord - 2) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_cooler)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_cooler)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 0, this.yCoord + i, this.zCoord + 2) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord - 2) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord) != ModBlocks.watz_cooler)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord + 2) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 1, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord - 2) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord - 1) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord) != ModBlocks.watz_control)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord + 1) != ModBlocks.watz_element)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 2, this.yCoord + i, this.zCoord + 2) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord - 1) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = -5; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord + 1) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
for(int i = -5; i <= -1; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord) != ModBlocks.watz_conductor)
|
||||
return false;
|
||||
}
|
||||
for(int i = 1; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord) != ModBlocks.watz_conductor)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = -5; i <= -1; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = 1; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = -5; i <= -1; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = 1; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord - 3, this.yCoord + i, this.zCoord) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = -5; i <= -1; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = 1; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord + 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(int i = -5; i <= -1; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
for(int i = 1; i <= 5; i++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord, this.yCoord + i, this.zCoord - 3) != ModBlocks.reinforced_brick)
|
||||
return false;
|
||||
}
|
||||
|
||||
if(world.getBlock(this.xCoord + 3, this.yCoord, this.zCoord) != ModBlocks.watz_hatch)
|
||||
return false;
|
||||
|
||||
if(world.getBlock(this.xCoord - 3, this.yCoord, this.zCoord) != ModBlocks.watz_hatch)
|
||||
return false;
|
||||
|
||||
if(world.getBlock(this.xCoord, this.yCoord, this.zCoord + 3) != ModBlocks.watz_hatch)
|
||||
return false;
|
||||
|
||||
if(world.getBlock(this.xCoord, this.yCoord, this.zCoord - 3) != ModBlocks.watz_hatch)
|
||||
return false;
|
||||
|
||||
for(int i = -3; i <= 3; i++)
|
||||
{
|
||||
for(int j = -3; j <= 3; j++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + i, this.yCoord + 6, this.zCoord + j) != ModBlocks.watz_end && world.getBlock(this.xCoord + i, this.yCoord + 6, this.zCoord + j) != ModBlocks.watz_conductor)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(int i = -3; i <= 3; i++)
|
||||
{
|
||||
for(int j = -3; j <= 3; j++)
|
||||
{
|
||||
if(world.getBlock(this.xCoord + i, this.yCoord - 6, this.zCoord + j) != ModBlocks.watz_end && world.getBlock(this.xCoord + i, this.yCoord - 6, this.zCoord + j) != ModBlocks.watz_conductor)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCoatingValid(World world) {
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasFuse() {
|
||||
return slots[38] != null && slots[38].getItem() == ModItems.titanium_filter && ItemTitaniumFilter.getDura(slots[38]) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWaterScaled(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPowerScaled(long i) {
|
||||
return (power/100 * i) / (maxPower/100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCoolantScaled(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeatScaled(int i) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(this.isStructureValid(this.worldObj)) {
|
||||
|
||||
powerMultiplier = 100;
|
||||
heatMultiplier = 100;
|
||||
decayMultiplier = 100;
|
||||
powerList = 0;
|
||||
heatList = 0;
|
||||
heat = 0;
|
||||
|
||||
if (hasFuse()) {
|
||||
|
||||
//Adds power and heat
|
||||
for (int i = 0; i < 36; i++) {
|
||||
surveyPellet(slots[i]);
|
||||
}
|
||||
//Calculates modifiers
|
||||
for (int i = 0; i < 36; i++) {
|
||||
surveyPelletAgain(slots[i]);
|
||||
}
|
||||
//Decays pellet by (DECAYMULTIPLIER * DEFAULTDECAY=100)/100 ticks
|
||||
for (int i = 0; i < 36; i++) {
|
||||
decayPellet(i);
|
||||
}
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
age++;
|
||||
if (age >= 20) {
|
||||
age = 0;
|
||||
}
|
||||
|
||||
this.sendPower(worldObj, xCoord, yCoord + 7, zCoord, ForgeDirection.UP);
|
||||
this.sendPower(worldObj, xCoord, yCoord - 7, zCoord, ForgeDirection.DOWN);
|
||||
|
||||
this.sendFluid(tank, worldObj, xCoord + 4, yCoord, zCoord, Library.POS_X);
|
||||
this.sendFluid(tank, worldObj, xCoord, yCoord, zCoord + 4, Library.POS_Z);
|
||||
this.sendFluid(tank, worldObj, xCoord - 4, yCoord, zCoord, Library.NEG_X);
|
||||
this.sendFluid(tank, worldObj, xCoord, yCoord, zCoord - 4, Library.NEG_Z);
|
||||
|
||||
if (age == 9 || age == 19) {
|
||||
fillFluidInit(tank.getTankType());
|
||||
}
|
||||
|
||||
//Only damages filter when heat is present (thus waste being created)
|
||||
if (heatList > 0) {
|
||||
ItemTitaniumFilter.setDura(slots[38], ItemTitaniumFilter.getDura(slots[38]) - 1);
|
||||
}
|
||||
|
||||
heatList *= heatMultiplier;
|
||||
heatList /= 100;
|
||||
heat = heatList;
|
||||
|
||||
powerList *= powerMultiplier;
|
||||
powerList /= 100;
|
||||
power += powerList;
|
||||
|
||||
tank.setFill(tank.getFill() + ((decayMultiplier * heat) / 100) / 100);
|
||||
|
||||
if(power > maxPower)
|
||||
power = maxPower;
|
||||
|
||||
//Gets rid of 1/4 of the total waste, if at least one access hatch is not occupied
|
||||
if(tank.getFill() > tank.getMaxFill())
|
||||
emptyWaste();
|
||||
|
||||
power = Library.chargeItemsFromTE(slots, 37, power, maxPower);
|
||||
|
||||
tank.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
|
||||
tank.unloadTank(36, 39, slots);
|
||||
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxElectricityPacket(xCoord, yCoord, zCoord, power), new TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 50));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void surveyPellet(ItemStack stack) {
|
||||
if(stack != null && stack.getItem() instanceof WatzFuel)
|
||||
{
|
||||
WatzFuel fuel = (WatzFuel)stack.getItem();
|
||||
this.powerList += fuel.power;
|
||||
this.heatList += fuel.heat;
|
||||
}
|
||||
}
|
||||
|
||||
public void surveyPelletAgain(ItemStack stack) {
|
||||
if(stack != null && stack.getItem() instanceof WatzFuel)
|
||||
{
|
||||
WatzFuel fuel = (WatzFuel)stack.getItem();
|
||||
this.powerMultiplier *= fuel.powerMultiplier;
|
||||
this.heatMultiplier *= fuel.heatMultiplier;
|
||||
this.decayMultiplier *= fuel.decayMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
public void decayPellet(int i) {
|
||||
if(slots[i] != null && slots[i].getItem() instanceof WatzFuel)
|
||||
{
|
||||
WatzFuel fuel = (WatzFuel)slots[i].getItem();
|
||||
WatzFuel.setLifeTime(slots[i], WatzFuel.getLifeTime(slots[i]) + this.decayMultiplier);
|
||||
WatzFuel.updateDamage(slots[i]);
|
||||
if(WatzFuel.getLifeTime(slots[i]) >= fuel.lifeTime)
|
||||
{
|
||||
if(slots[i].getItem() == ModItems.pellet_lead)
|
||||
slots[i] = new ItemStack(ModItems.powder_lead);
|
||||
else
|
||||
slots[i] = new ItemStack(ModItems.pellet_lead);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void emptyWaste() {
|
||||
tank.setFill(tank.getFill() / 4);
|
||||
tank.setFill(tank.getFill() * 3);
|
||||
if (!worldObj.isRemote) {
|
||||
if (this.worldObj.getBlock(this.xCoord + 4, this.yCoord, this.zCoord) == Blocks.air)
|
||||
{
|
||||
this.worldObj.setBlock(this.xCoord + 4, this.yCoord, this.zCoord, ModBlocks.mud_block);
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "game.neutral.swim.splash", 3.0F, 0.5F);
|
||||
}
|
||||
else if (this.worldObj.getBlock(this.xCoord - 4, this.yCoord, this.zCoord) == Blocks.air)
|
||||
{
|
||||
this.worldObj.setBlock(this.xCoord - 4, this.yCoord, this.zCoord, ModBlocks.mud_block);
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "game.neutral.swim.splash", 3.0F, 0.5F);
|
||||
}
|
||||
else if (this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord + 4) == Blocks.air)
|
||||
{
|
||||
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord + 4, ModBlocks.mud_block);
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "game.neutral.swim.splash", 3.0F, 0.5F);
|
||||
}
|
||||
else if (this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord - 4) == Blocks.air)
|
||||
{
|
||||
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord - 4, ModBlocks.mud_block);
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "game.neutral.swim.splash", 3.0F, 0.5F);
|
||||
}
|
||||
else {
|
||||
List<EntityPlayer> players = worldObj.getEntitiesWithinAABB(EntityPlayer.class,
|
||||
AxisAlignedBB.getBoundingBox(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5).expand(50, 50, 50));
|
||||
|
||||
for(EntityPlayer player : players) {
|
||||
player.triggerAchievement(MainRegistry.achWatzBoom);
|
||||
}
|
||||
|
||||
if (rand.nextInt(10) != 0) {
|
||||
for (int i = -3; i <= 3; i++)
|
||||
for (int j = -5; j <= 5; j++)
|
||||
for (int k = -3; k <= 3; k++)
|
||||
if (rand.nextInt(2) == 0)
|
||||
this.worldObj.setBlock(this.xCoord + i, this.yCoord + j, this.zCoord + k,
|
||||
ModBlocks.mud_block);
|
||||
this.worldObj.setBlock(this.xCoord, this.yCoord, this.zCoord, ModBlocks.mud_block);
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "game.neutral.swim.splash", 3.0F, 0.5F);
|
||||
this.worldObj.playSoundEffect(this.xCoord, this.yCoord, this.zCoord, "random.explode", 3.0F, 0.75F);
|
||||
} else {
|
||||
EntityNukeExplosionMK3 ex = EntityNukeExplosionMK3.statFacFleija(worldObj, xCoord, yCoord, zCoord, BombConfig.fleijaRadius);
|
||||
if(!ex.isDead) {
|
||||
worldObj.spawnEntityInWorld(ex);
|
||||
EntityCloudFleija cloud = new EntityCloudFleija(worldObj, BombConfig.fleijaRadius);
|
||||
cloud.posX = xCoord + 0.5;
|
||||
cloud.posY = yCoord + 0.5;
|
||||
cloud.posZ = zCoord + 0.6;
|
||||
worldObj.spawnEntityInWorld(cloud);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getTact() {
|
||||
if(age >= 0 && age < 10)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
this.power = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return this.maxPower;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluidInit(FluidType type) {
|
||||
fillFluid(this.xCoord + 4, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord - 4, this.yCoord, this.zCoord, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord + 4, getTact(), type);
|
||||
fillFluid(this.xCoord, this.yCoord, this.zCoord - 4, getTact(), type);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fillFluid(int x, int y, int z, boolean newTact, FluidType type) {
|
||||
Library.transmitFluid(x, y, z, newTact, this, worldObj, type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return list1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFluidList(FluidType type) {
|
||||
list1.clear();
|
||||
}
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getAllTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerWatzCore(player.inventory, this);
|
||||
}
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIWatzCore(player.inventory, this);
|
||||
}
|
||||
}
|
||||
@ -87,6 +87,7 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
public long transferFluid(FluidType type, int pressure, long fluid) {
|
||||
long toTransfer = Math.min(getDemand(type, pressure), fluid);
|
||||
tank.setFill(tank.getFill() + (int) toTransfer);
|
||||
this.markChanged();
|
||||
return fluid - toTransfer;
|
||||
}
|
||||
|
||||
@ -96,8 +97,10 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
byte comp = this.getComparatorPower(); //do comparator shenanigans
|
||||
if(comp != this.lastRedstone)
|
||||
if(comp != this.lastRedstone) {
|
||||
this.markDirty();
|
||||
for(DirPos pos : getConPos()) this.updateRedstoneConnection(pos);
|
||||
}
|
||||
this.lastRedstone = comp;
|
||||
|
||||
tank.setType(0, 1, slots);
|
||||
@ -109,12 +112,6 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
tank.setFill(transmitFluidFairly(worldObj, tank, this, tank.getFill(), this.mode == 0 || this.mode == 1, this.mode == 1 || this.mode == 2, getConPos()));
|
||||
this.sendingBrake = false;
|
||||
|
||||
age++;
|
||||
if(age >= 20) {
|
||||
age = 0;
|
||||
this.markChanged();
|
||||
}
|
||||
|
||||
if((mode == 1 || mode == 2) && (age == 9 || age == 19))
|
||||
fillFluidInit(tank.getTankType());
|
||||
|
||||
|
||||
@ -131,8 +131,10 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
byte comp = this.getComparatorPower(); //comparator shit
|
||||
if(comp != this.lastRedstone)
|
||||
if(comp != this.lastRedstone) {
|
||||
this.markDirty();
|
||||
for(DirPos pos : getConPos()) this.updateRedstoneConnection(pos);
|
||||
}
|
||||
this.lastRedstone = comp;
|
||||
|
||||
if(tank.getFill() > 0) {
|
||||
|
||||
@ -63,6 +63,7 @@ public class ArmorUtil {
|
||||
ArmorRegistry.registerHazard(ModItems.euphemium_helmet, HazardClass.PARTICLE_COARSE, HazardClass.PARTICLE_FINE, HazardClass.GAS_CHLORINE, HazardClass.BACTERIA, HazardClass.GAS_MONOXIDE, HazardClass.LIGHT, HazardClass.SAND);
|
||||
ArmorRegistry.registerHazard(ModItems.rpa_helmet, HazardClass.PARTICLE_COARSE, HazardClass.PARTICLE_FINE, HazardClass.GAS_CHLORINE, HazardClass.BACTERIA, HazardClass.GAS_MONOXIDE, HazardClass.LIGHT, HazardClass.SAND);
|
||||
ArmorRegistry.registerHazard(ModItems.envsuit_helmet, HazardClass.PARTICLE_COARSE, HazardClass.PARTICLE_FINE, HazardClass.GAS_CHLORINE, HazardClass.BACTERIA, HazardClass.GAS_MONOXIDE, HazardClass.LIGHT, HazardClass.SAND);
|
||||
ArmorRegistry.registerHazard(ModItems.trenchmaster_helmet, HazardClass.PARTICLE_COARSE, HazardClass.PARTICLE_FINE, HazardClass.GAS_CHLORINE, HazardClass.BACTERIA, HazardClass.GAS_MONOXIDE, HazardClass.LIGHT, HazardClass.SAND);
|
||||
|
||||
//Ob ihr wirklich richtig steht, seht ihr wenn das Licht angeht!
|
||||
registerIfExists(Compat.MOD_GT6, "gt.armor.hazmat.universal.head", HazardClass.PARTICLE_COARSE, HazardClass.PARTICLE_FINE, HazardClass.GAS_CHLORINE, HazardClass.BACTERIA, HazardClass.GAS_MONOXIDE, HazardClass.LIGHT, HazardClass.SAND);
|
||||
|
||||
@ -22,7 +22,7 @@ public class Spaceship extends WorldGenerator
|
||||
Block Block3 = ModBlocks.deco_steel;
|
||||
Block Block4 = ModBlocks.fusion_heater;
|
||||
Block Block5 = ModBlocks.block_meteor;
|
||||
Block Block6 = ModBlocks.reactor_element;
|
||||
Block Block6 = ModBlocks.pwr_fuel;
|
||||
Block Block7 = ModBlocks.cable_switch;
|
||||
Block Block8 = ModBlocks.fusion_hatch;
|
||||
Block Block9 = ModBlocks.reinforced_light;
|
||||
|
||||
@ -18,7 +18,7 @@ public class Spaceship2
|
||||
Block Block3 = ModBlocks.deco_steel;
|
||||
Block Block4 = ModBlocks.fusion_heater;
|
||||
Block Block5 = ModBlocks.block_meteor;
|
||||
Block Block6 = ModBlocks.reactor_element;
|
||||
Block Block6 = ModBlocks.pwr_fuel;
|
||||
Block Block8 = ModBlocks.fusion_hatch;
|
||||
Block Block9 = ModBlocks.reinforced_light;
|
||||
Block Block10 = ModBlocks.reinforced_glass;
|
||||
|
||||
@ -3,11 +3,11 @@ package com.hbm.world.feature;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockEnums.EnumBiomeType;
|
||||
import com.hbm.world.generator.DungeonToolbox;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.BiomeGenBase.TempCategory;
|
||||
@ -96,7 +96,7 @@ public class BiomeCave {
|
||||
private static void handleBiome(World world, int x, int y, int z, EnumBiomeType type) {
|
||||
Block target = world.getBlock(x, y, z);
|
||||
|
||||
if(target.isNormalCube() && DungeonToolbox.allowedToReplace(target)) {
|
||||
if(target.isNormalCube() && target.isReplaceableOreGen(world, x, y, z, Blocks.stone)) {
|
||||
|
||||
boolean shouldGen = false;
|
||||
|
||||
|
||||
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