diff --git a/resources/assets/enderio/config/VatRecipes_Core.xml b/resources/assets/enderio/config/VatRecipes_Core.xml index ab75e4e4..d6092d71 100644 --- a/resources/assets/enderio/config/VatRecipes_Core.xml +++ b/resources/assets/enderio/config/VatRecipes_Core.xml @@ -54,19 +54,29 @@ The vat always uses 1 MJ per tick, so energy cost also equates to duration. - - + - - - + + + - + + + + + + + + + + + + diff --git a/resources/assets/enderio/lang/en_US.lang b/resources/assets/enderio/lang/en_US.lang index a1b31acd..01d7ae48 100644 --- a/resources/assets/enderio/lang/en_US.lang +++ b/resources/assets/enderio/lang/en_US.lang @@ -44,7 +44,9 @@ enderio.phasedIronNugget.name=Pulsating Iron Nugget //Fluids fluid.nutrient_distillation=Nutrient Distillation fluid.hootch=Hootch -item.bucketNutrientdistillation.name=Nutrient Distillation Bucket +fluid.fire_water=Fire Water +fluid.rocket_fuel=Rocket Fuel +item.bucketNutrient_distillation.name=Nutrient Distillation Bucket item.bucketHootch.name=Hootch Bucket enderio.fluid.millibucket.abr=MB diff --git a/resources/assets/enderio/textures/blocks/fire_water_flow.png b/resources/assets/enderio/textures/blocks/fire_water_flow.png new file mode 100644 index 00000000..fb0aef9e Binary files /dev/null and b/resources/assets/enderio/textures/blocks/fire_water_flow.png differ diff --git a/resources/assets/enderio/textures/blocks/fire_water_flow.png.mcmeta b/resources/assets/enderio/textures/blocks/fire_water_flow.png.mcmeta new file mode 100644 index 00000000..1e64ff03 --- /dev/null +++ b/resources/assets/enderio/textures/blocks/fire_water_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} \ No newline at end of file diff --git a/resources/assets/enderio/textures/blocks/fire_water_still.png b/resources/assets/enderio/textures/blocks/fire_water_still.png new file mode 100644 index 00000000..5d922f9b Binary files /dev/null and b/resources/assets/enderio/textures/blocks/fire_water_still.png differ diff --git a/resources/assets/enderio/textures/blocks/fire_water_still.png.mcmeta b/resources/assets/enderio/textures/blocks/fire_water_still.png.mcmeta new file mode 100644 index 00000000..0645f48c --- /dev/null +++ b/resources/assets/enderio/textures/blocks/fire_water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/resources/assets/enderio/textures/blocks/rocket_fuel_flow.png b/resources/assets/enderio/textures/blocks/rocket_fuel_flow.png new file mode 100644 index 00000000..d763f8a1 Binary files /dev/null and b/resources/assets/enderio/textures/blocks/rocket_fuel_flow.png differ diff --git a/resources/assets/enderio/textures/blocks/rocket_fuel_flow.png.mcmeta b/resources/assets/enderio/textures/blocks/rocket_fuel_flow.png.mcmeta new file mode 100644 index 00000000..1e64ff03 --- /dev/null +++ b/resources/assets/enderio/textures/blocks/rocket_fuel_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} \ No newline at end of file diff --git a/resources/assets/enderio/textures/blocks/rocket_fuel_still.png b/resources/assets/enderio/textures/blocks/rocket_fuel_still.png new file mode 100644 index 00000000..e8a6fe9a Binary files /dev/null and b/resources/assets/enderio/textures/blocks/rocket_fuel_still.png differ diff --git a/resources/assets/enderio/textures/blocks/rocket_fuel_still.png.mcmeta b/resources/assets/enderio/textures/blocks/rocket_fuel_still.png.mcmeta new file mode 100644 index 00000000..0645f48c --- /dev/null +++ b/resources/assets/enderio/textures/blocks/rocket_fuel_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/resources/assets/enderio/textures/blocks/vatFront.png b/resources/assets/enderio/textures/blocks/vatFront.png index 662cb545..6823cd98 100644 Binary files a/resources/assets/enderio/textures/blocks/vatFront.png and b/resources/assets/enderio/textures/blocks/vatFront.png differ diff --git a/resources/assets/enderio/textures/blocks/vatFrontOn.png b/resources/assets/enderio/textures/blocks/vatFrontOn.png index 2fe648af..37374500 100644 Binary files a/resources/assets/enderio/textures/blocks/vatFrontOn.png and b/resources/assets/enderio/textures/blocks/vatFrontOn.png differ diff --git a/resources/assets/enderio/textures/blocks/vatFrontOn.png.mcmeta b/resources/assets/enderio/textures/blocks/vatFrontOn.png.mcmeta deleted file mode 100644 index ffc0e720..00000000 --- a/resources/assets/enderio/textures/blocks/vatFrontOn.png.mcmeta +++ /dev/null @@ -1 +0,0 @@ -{ "animation": { "frametime": 20, "frames": [ 0, 1, 2, 3, ] } } \ No newline at end of file diff --git a/resources/assets/enderio/textures/blocks/vatTop.png b/resources/assets/enderio/textures/blocks/vatTop.png new file mode 100644 index 00000000..7c8d188e Binary files /dev/null and b/resources/assets/enderio/textures/blocks/vatTop.png differ diff --git a/resources/assets/enderio/textures/fire_water_flow.png b/resources/assets/enderio/textures/fire_water_flow.png new file mode 100644 index 00000000..fb0aef9e Binary files /dev/null and b/resources/assets/enderio/textures/fire_water_flow.png differ diff --git a/resources/assets/enderio/textures/fire_water_flow.png.mcmeta b/resources/assets/enderio/textures/fire_water_flow.png.mcmeta new file mode 100644 index 00000000..1e64ff03 --- /dev/null +++ b/resources/assets/enderio/textures/fire_water_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} \ No newline at end of file diff --git a/resources/assets/enderio/textures/fire_water_still.png b/resources/assets/enderio/textures/fire_water_still.png new file mode 100644 index 00000000..5d922f9b Binary files /dev/null and b/resources/assets/enderio/textures/fire_water_still.png differ diff --git a/resources/assets/enderio/textures/fire_water_still.png.mcmeta b/resources/assets/enderio/textures/fire_water_still.png.mcmeta new file mode 100644 index 00000000..0645f48c --- /dev/null +++ b/resources/assets/enderio/textures/fire_water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/resources/assets/enderio/textures/items/bucketFire_water.png b/resources/assets/enderio/textures/items/bucketFire_water.png new file mode 100644 index 00000000..85cffc6a Binary files /dev/null and b/resources/assets/enderio/textures/items/bucketFire_water.png differ diff --git a/resources/assets/enderio/textures/items/bucketRocket_fuel.png b/resources/assets/enderio/textures/items/bucketRocket_fuel.png new file mode 100644 index 00000000..48de6970 Binary files /dev/null and b/resources/assets/enderio/textures/items/bucketRocket_fuel.png differ diff --git a/resources/assets/enderio/textures/rocket_fuel_flow.png b/resources/assets/enderio/textures/rocket_fuel_flow.png new file mode 100644 index 00000000..d763f8a1 Binary files /dev/null and b/resources/assets/enderio/textures/rocket_fuel_flow.png differ diff --git a/resources/assets/enderio/textures/rocket_fuel_flow.png.mcmeta b/resources/assets/enderio/textures/rocket_fuel_flow.png.mcmeta new file mode 100644 index 00000000..1e64ff03 --- /dev/null +++ b/resources/assets/enderio/textures/rocket_fuel_flow.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 3 + } +} \ No newline at end of file diff --git a/resources/assets/enderio/textures/rocket_fuel_still.png b/resources/assets/enderio/textures/rocket_fuel_still.png new file mode 100644 index 00000000..e8a6fe9a Binary files /dev/null and b/resources/assets/enderio/textures/rocket_fuel_still.png differ diff --git a/resources/assets/enderio/textures/rocket_fuel_still.png.mcmeta b/resources/assets/enderio/textures/rocket_fuel_still.png.mcmeta new file mode 100644 index 00000000..0645f48c --- /dev/null +++ b/resources/assets/enderio/textures/rocket_fuel_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/java/crazypants/enderio/ClientProxy.java b/src/main/java/crazypants/enderio/ClientProxy.java index 5a297587..52b46094 100644 --- a/src/main/java/crazypants/enderio/ClientProxy.java +++ b/src/main/java/crazypants/enderio/ClientProxy.java @@ -54,6 +54,8 @@ import crazypants.enderio.machine.power.CapBankRenderer2; import crazypants.enderio.machine.power.CapacitorBankRenderer; import crazypants.enderio.machine.reservoir.ReservoirRenderer; import crazypants.enderio.machine.reservoir.TileReservoir; +import crazypants.enderio.machine.still.BlockVat; +import crazypants.enderio.machine.still.VatRenderer; import crazypants.enderio.material.BlockFusedQuartz; import crazypants.enderio.material.FusedQuartzFrameRenderer; import crazypants.enderio.material.FusedQuartzRenderer; @@ -67,12 +69,12 @@ public class ClientProxy extends CommonProxy { // @formatter:off public static int[][] sideAndFacingToSpriteOffset = new int[][] { - { 3, 2, 0, 0, 0, 0 }, - { 2, 3, 1, 1, 1, 1 }, - { 1, 1, 3, 2, 5, 4 }, - { 0, 0, 2, 3, 4, 5 }, - { 4, 5, 4, 5, 3, 2 }, - { 5, 4, 5, 4, 2, 3 } }; + { 3, 2, 0, 0, 0, 0 }, + { 2, 3, 1, 1, 1, 1 }, + { 1, 1, 3, 2, 5, 4 }, + { 0, 0, 2, 3, 4, 5 }, + { 4, 5, 4, 5, 3, 2 }, + { 5, 4, 5, 4, 2, 3 } }; // @formatter:on static { @@ -117,12 +119,16 @@ public class ClientProxy extends CommonProxy { BlockFusedQuartz.renderId = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new FusedQuartzRenderer()); - + BlockCombustionGenerator.renderId = RenderingRegistry.getNextAvailableRenderId(); CombustionGeneratorRenderer cr = new CombustionGeneratorRenderer(); RenderingRegistry.registerBlockHandler(cr); ClientRegistry.bindTileEntitySpecialRenderer(TileCombustionGenerator.class, cr); + BlockVat.renderId = RenderingRegistry.getNextAvailableRenderId(); + VatRenderer vr = new VatRenderer(); + RenderingRegistry.registerBlockHandler(vr); + FusedQuartzFrameRenderer fqfr = new FusedQuartzFrameRenderer(); MinecraftForgeClient.registerItemRenderer(EnderIO.itemFusedQuartzFrame, fqfr); diff --git a/src/main/java/crazypants/enderio/Config.java b/src/main/java/crazypants/enderio/Config.java index 9a2f682f..e103798c 100644 --- a/src/main/java/crazypants/enderio/Config.java +++ b/src/main/java/crazypants/enderio/Config.java @@ -107,7 +107,11 @@ public final class Config { public static float darkSteelPickEffeciencyBoostWhenPowered = 2; public static int hootchPowerPerCycle = 6; - public static int hootchPowerTotalBurnTime = 25000; + public static int hootchPowerTotalBurnTime = 12000; + public static int rocketFuelPowerPerCycle = 9; + public static int rocketFuelPowerTotalBurnTime = 12000; + public static int fireWaterPowerPerCycle = 12; + public static int fireWaterPowerTotalBurnTime = 12000; public static void load(FMLPreInitializationEvent event) { configDirectory = new File(event.getModConfigurationDirectory(), "enderio"); @@ -151,7 +155,7 @@ public final class Config { conduitScale = config.get("Settings", "conduitScale", DEFAULT_CONDUIT_SCALE, "Valid values are between 0-1, smallest conduits at 0, largest at 1.\n" + - "In SMP, all clients must be using the same value as the server.").getDouble(DEFAULT_CONDUIT_SCALE); + "In SMP, all clients must be using the same value as the server.").getDouble(DEFAULT_CONDUIT_SCALE); conduitScale = VecmathUtil.clamp(conduitScale, 0, 1); fluidConduitExtractRate = config.get("Settings", "fluidConduitExtractRate", fluidConduitExtractRate, @@ -184,7 +188,7 @@ public final class Config { "perInterfacePowerTrackingEnabled", detailedPowerTrackingEnabled, "Enable per tick sampling on individual power inputs and outputs. This allows slightly more detailed messages from the MJ Reader but has a negative impact on server performance.") - .getBoolean(detailedPowerTrackingEnabled); + .getBoolean(detailedPowerTrackingEnabled); useSneakMouseWheelYetaWrench = config.get("Settings", "useSneakMouseWheelYetaWrench", useSneakMouseWheelYetaWrench, "If true, shift-mouse wheel will change the conduit display mode when the YetaWrench is eqipped.") @@ -240,8 +244,8 @@ public final class Config { .get("Settings", "travelStaffBlinkThroughClearBlocksEnabled", travelStaffBlinkThroughClearBlocksEnabled, "If travelStaffBlinkThroughSolidBlocksEnabled is set to false and this is true, the travel " + "staff can only be used to blink through transparent or partial blocks (e.g. torches). " + - "If both are false, only air blocks may be teleported through.") - .getBoolean(travelStaffBlinkThroughClearBlocksEnabled); + "If both are false, only air blocks may be teleported through.") + .getBoolean(travelStaffBlinkThroughClearBlocksEnabled); enderIoRange = config.get("Settings", "enderIoRange", enderIoRange, "Range accessable (in blocks) when using the Ender IO.").getInt(enderIoRange); @@ -253,7 +257,7 @@ public final class Config { "When true, correct lighting is recalculated (client side) for conduit bundles when transitioning to" + " from being hidden behind a facade. This produces " + "better quality rendering but can result in frame stutters when switching to/from a wrench.") - .getBoolean(updateLightingWhenHidingFacades); + .getBoolean(updateLightingWhenHidingFacades); darkSteelLeggingWalkModifier = config.get("Settings", "darkSteelLeggingWalkModifier", darkSteelLeggingWalkModifier, "Speed modifier applied when walking in the Dark Steel Boots.").getDouble(darkSteelLeggingWalkModifier); @@ -278,22 +282,22 @@ public final class Config { "The base chance a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(darkSteelSwordSkullChance); darkSteelSwordSkullLootingModifier = (float) config.get("Settings", "darkSteelSwordSkullLootingModifier", darkSteelSwordSkullLootingModifier, "The chance per looting level that a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( - darkSteelSwordSkullLootingModifier); + darkSteelSwordSkullLootingModifier); darkSteelSwordWitherSkullChance = (float) config.get("Settings", "darkSteelSwordWitherSkullChance", darkSteelSwordWitherSkullChance, "The base chance a wither skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( - darkSteelSwordWitherSkullChance); + darkSteelSwordWitherSkullChance); darkSteelSwordWitherSkullLootingModifier = (float) config.get("Settings", "darkSteelSwordWitherSkullLootingModifie", darkSteelSwordWitherSkullLootingModifier, "The chance per looting level that a wither skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( - darkSteelSwordWitherSkullLootingModifier); + darkSteelSwordWitherSkullLootingModifier); vanillaSwordSkullLootingModifier = (float) config.get("Settings", "vanillaSwordSkullLootingModifier", vanillaSwordSkullLootingModifier, "The chance per looting level that a skull will be dropped when using a non-dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( - vanillaSwordSkullLootingModifier); + vanillaSwordSkullLootingModifier); darkSteelSwordPowerUsePerHit = config.get("Settings", "darkSteelSwordPowerUsePerHit", darkSteelSwordPowerUsePerHit, "The amount of power (RF) used per hit.").getInt(darkSteelSwordPowerUsePerHit); darkSteelSwordEnderPearlDropChance = config.get("Settings", "darkSteelSwordEnderPearlDropChance", darkSteelSwordEnderPearlDropChance, "The chance that an ender pearl will be dropped when using a dark steel sword (0 = no chance, 1 = 100% chance)").getDouble( - darkSteelSwordEnderPearlDropChance); + darkSteelSwordEnderPearlDropChance); darkSteelSwordEnderPearlDropChancePerLooting = config.get("Settings", "darkSteelSwordEnderPearlDropChancePerLooting", darkSteelSwordEnderPearlDropChancePerLooting, "The chance for each looting level that an additional ender pearl will be dropped when using a dark steel sword (0 = no chance, 1 = 100% chance)") @@ -314,6 +318,20 @@ public final class Config { hootchPowerTotalBurnTime = config.get("Settings", "hootchPowerTotalBurnTime", hootchPowerTotalBurnTime, "The total burn time. Examples: BC Oil = 5000, BC Fuel = 25000").getInt(hootchPowerTotalBurnTime); + rocketFuelPowerPerCycle = config.get("Settings", "rocketFuelPowerPerCycle", rocketFuelPowerPerCycle, + "The amount of power generated per BC engine cycle. Examples: BC Oil = 3, BC Fuel = 6").getInt(rocketFuelPowerPerCycle); + rocketFuelPowerTotalBurnTime = config.get("Settings", "rocketFuelPowerTotalBurnTime", rocketFuelPowerTotalBurnTime, + "The total burn time. Examples: BC Oil = 5000, BC Fuel = 25000").getInt(rocketFuelPowerTotalBurnTime); + + + + + fireWaterPowerPerCycle = config.get("Settings", "fireWaterPowerPerCycle", fireWaterPowerPerCycle, + "The amount of power generated per BC engine cycle. Examples: BC Oil = 3, BC Fuel = 6").getInt(fireWaterPowerPerCycle); + fireWaterPowerTotalBurnTime = config.get("Settings", "fireWaterPowerTotalBurnTime", fireWaterPowerTotalBurnTime, + "The total burn time. Examples: BC Oil = 5000, BC Fuel = 25000").getInt(fireWaterPowerTotalBurnTime); + + //TODO: Debug renderCapBankGauge = config.get("Debug", "renderCapBankGauge", renderCapBankGauge, "If not true capacitor banks will not render the level gauge at all.") .getBoolean(renderCapBankGauge); diff --git a/src/main/java/crazypants/enderio/EnderIO.java b/src/main/java/crazypants/enderio/EnderIO.java index 0e760d05..387209d1 100644 --- a/src/main/java/crazypants/enderio/EnderIO.java +++ b/src/main/java/crazypants/enderio/EnderIO.java @@ -152,6 +152,14 @@ public class EnderIO { public static BlockFluidEio blocHootch; public static ItemBucketEio itemBucketHootch; + public static Fluid fluidRocketFuel; + public static BlockFluidEio blockRocketFuel; + public static ItemBucketEio itemBucketRocketFuel; + + public static Fluid fluidFireWater; + public static BlockFluidEio blockFireWater; + public static ItemBucketEio itemBucketFireWater; + // Items public static ItemYetaWrench itemYetaWench; public static ItemConduitProbe itemConduitProbe; @@ -163,6 +171,8 @@ public class EnderIO { public static ItemDarkSteelSword itemDarkSteelSword; public static ItemDarkSteelPickaxe itemDarkSteelPickaxe; + + // public static ITrigger triggerNoEnergy; // public static ITrigger triggerHasEnergy; // public static ITrigger triggerFullEnergy; @@ -204,41 +214,56 @@ public class EnderIO { blockElectricLight = BlockElectricLight.create(); blockLightNode = BlockLightNode.create(); blockReservoir = BlockReservoir.create(); - + blockFusedQuartz = BlockFusedQuartz.create(); itemFusedQuartzFrame = ItemFusedQuartzFrame.create(); blockConduitBundle = BlockConduitBundle.create(); blockConduitFacade = BlockConduitFacade.create(); - itemConduitFacade = ItemConduitFacade.create(); + itemConduitFacade = ItemConduitFacade.create(); itemRedstoneConduit = ItemRedstoneConduit.create(); itemPowerConduit = ItemPowerConduit.create(); itemLiquidConduit = ItemLiquidConduit.create(); itemItemConduit = ItemItemConduit.create(); - + Fluid f = new Fluid(Fluids.NUTRIENT_DISTILLATION_NAME).setDensity(1500).setViscosity(3000); FluidRegistry.registerFluid(f); fluidNutrientDistillation = FluidRegistry.getFluid(f.getName()); blockNutrientDistillation = BlockFluidEio.create(fluidNutrientDistillation, new MaterialLiquid(MapColor.brownColor)); - + f = new Fluid(Fluids.HOOTCH_NAME).setDensity(900).setViscosity(1000); FluidRegistry.registerFluid(f); fluidHootch = FluidRegistry.getFluid(f.getName()); blocHootch = BlockFluidEio.create(fluidHootch, new MaterialLiquid(MapColor.grayColor)); - IronEngineFuel.addFuel("hootch", Config.hootchPowerPerCycle, Config.hootchPowerTotalBurnTime); - + IronEngineFuel.addFuel(Fluids.HOOTCH_NAME, Config.hootchPowerPerCycle, Config.hootchPowerTotalBurnTime); + + + f = new Fluid(Fluids.ROCKET_FUEL_NAME).setDensity(900).setViscosity(1000); + FluidRegistry.registerFluid(f); + fluidRocketFuel = FluidRegistry.getFluid(f.getName()); + blockRocketFuel = BlockFluidEio.create(fluidRocketFuel, new MaterialLiquid(MapColor.grayColor)); + IronEngineFuel.addFuel(Fluids.ROCKET_FUEL_NAME, Config.rocketFuelPowerPerCycle, Config.rocketFuelPowerTotalBurnTime); + + + f = new Fluid(Fluids.FIRE_WATER_NAME).setDensity(900).setViscosity(1000); + FluidRegistry.registerFluid(f); + fluidFireWater = FluidRegistry.getFluid(f.getName()); + blockFireWater = BlockFluidEio.create(fluidFireWater, new MaterialLiquid(MapColor.grayColor)); + IronEngineFuel.addFuel(Fluids.FIRE_WATER_NAME, Config.fireWaterPowerPerCycle, Config.fireWaterPowerTotalBurnTime); + itemBasicCapacitor = ItemCapacitor.create(); itemMachinePart = ItemMachinePart.create(); itemMaterial = ItemMaterial.create(); itemAlloy = ItemAlloy.create(); itemPowderIngot = ItemPowderIngot.create(); - + itemBucketNutrientDistillation = ItemBucketEio.create(fluidNutrientDistillation); itemBucketHootch = ItemBucketEio.create(fluidHootch); - + itemBucketRocketFuel = ItemBucketEio.create(fluidRocketFuel); + itemYetaWench = ItemYetaWrench.create(); itemEnderface = ItemEnderface.create(); itemTravelStaff = ItemTravelStaff.create(); @@ -271,7 +296,7 @@ public class EnderIO { ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem( new WeightedRandomChestContent(new ItemStack(EnderIO.itemAlloy, 1, Alloy.ELECTRICAL_STEEL.ordinal()), 1, 3, 60)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST) - .addItem(new WeightedRandomChestContent(new ItemStack(EnderIO.itemYetaWench, 1, 0), 1, 1, 15)); + .addItem(new WeightedRandomChestContent(new ItemStack(EnderIO.itemYetaWench, 1, 0), 1, 1, 15)); ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(EnderIO.itemConduitProbe, 1, 0), 1, 1, 1)); ItemStack staff = new ItemStack(EnderIO.itemTravelStaff, 1, 0); diff --git a/src/main/java/crazypants/enderio/fluid/Fluids.java b/src/main/java/crazypants/enderio/fluid/Fluids.java index ad2592db..69968d4d 100644 --- a/src/main/java/crazypants/enderio/fluid/Fluids.java +++ b/src/main/java/crazypants/enderio/fluid/Fluids.java @@ -1,24 +1,28 @@ package crazypants.enderio.fluid; -import crazypants.util.Lang; import net.minecraftforge.fluids.IFluidTank; +import crazypants.util.Lang; public class Fluids { public static final String NUTRIENT_DISTILLATION_NAME = "nutrient_distillation"; public static final String HOOTCH_NAME = "hootch"; - + + public static final String ROCKET_FUEL_NAME = "rocket_fuel"; + + public static final String FIRE_WATER_NAME = "fire_water"; + public static String toCapactityString(IFluidTank tank) { if(tank == null) { - return "0/0 " + MB(); - } + return "0/0 " + MB(); + } return tank.getFluidAmount() + "/" + tank.getCapacity() + " " + MB(); } - + public static String MB() { return Lang.localize("fluid.millibucket.abr"); } - + } diff --git a/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java b/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java index 7c8b3886..f8da61bc 100644 --- a/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java +++ b/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java @@ -2,16 +2,24 @@ package crazypants.enderio.machine.generator; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; import crazypants.enderio.GuiHandler; import crazypants.enderio.ModObject; import crazypants.enderio.machine.AbstractMachineBlock; +import crazypants.util.Util; public class BlockCombustionGenerator extends AbstractMachineBlock { public static int renderId; - + protected IIcon frontOn; protected IIcon frontOff; @@ -21,19 +29,53 @@ public class BlockCombustionGenerator extends AbstractMachineBlock= fluid.amount) { + gen.fill(ForgeDirection.UP, fluid, true); + if(!entityPlayer.capabilities.isCreativeMode) { + entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, Util.consumeItem(item)); + } + return true; + } + } + + return super.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9); } @Override @@ -52,22 +94,20 @@ public class BlockCombustionGenerator extends AbstractMachineBlock { + public static int renderId; + + + public static BlockVat create() { BlockVat res = new BlockVat(); res.init(); return res; } + protected IIcon onIcon; + protected IIcon topIcon; + public BlockVat() { super(ModObject.blockVat, TileVat.class); } + @Override + public void registerBlockIcons(IIconRegister iIconRegister) { + blockIcon = iIconRegister.registerIcon("enderio:vatFront"); + onIcon = iIconRegister.registerIcon("enderio:vatFrontOn"); + topIcon = iIconRegister.registerIcon("enderio:vatTop"); + } + + @Override + public IIcon getIcon(IBlockAccess world, int x, int y, int z, int blockSide) { + // used to render the block in the world + TileEntity te = world.getTileEntity(x, y, z); + boolean on = false; + if(te instanceof AbstractMachineEntity) { + AbstractMachineEntity me = (AbstractMachineEntity) te; + on = me.isActive(); + } + + if(blockSide == ForgeDirection.UP.ordinal() || blockSide == ForgeDirection.DOWN.ordinal()) { + return topIcon; + } + + if(on) { + return onIcon; + } else { + return blockIcon; + } + } + + @Override + public IIcon getIcon(int blockSide, int blockMeta) { + if(blockSide == ForgeDirection.UP.ordinal() || blockSide == ForgeDirection.DOWN.ordinal()) { + return topIcon; + } + return blockIcon; + } + @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) { @@ -86,9 +132,9 @@ public class BlockVat extends AbstractMachineBlock { entityPlayer.inventory.setInventorySlotContents(entityPlayer.inventory.currentItem, item); for (int i = 0; i < entityPlayer.inventory.mainInventory.length; i++) { if(entityPlayer.inventory.mainInventory[i] == null) { - entityPlayer.inventory.setInventorySlotContents(i, res); + entityPlayer.inventory.setInventorySlotContents(i, res); return true; - } + } } if(!world.isRemote) { Util.dropItems(world, res, x, y, z, true); @@ -104,7 +150,24 @@ public class BlockVat extends AbstractMachineBlock { return super.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9); } - + + @Override + public int getRenderType() { + return renderId; + } + + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + + @Override + public boolean isOpaqueCube() { + return false; + } + @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { diff --git a/src/main/java/crazypants/enderio/machine/still/TileVat.java b/src/main/java/crazypants/enderio/machine/still/TileVat.java index a3a43466..549b2fd7 100644 --- a/src/main/java/crazypants/enderio/machine/still/TileVat.java +++ b/src/main/java/crazypants/enderio/machine/still/TileVat.java @@ -47,12 +47,16 @@ public class TileVat extends AbstractPoweredTaskEntity implements IFluidHandler @Override protected boolean isMachineItemValidForSlot(int i, ItemStack itemstack) { - return VatRecipeManager.getInstance().isValidInput(new MachineRecipeInput(i, itemstack)); + MachineRecipeInput[] inputs = getInputs(); + inputs[i] = new MachineRecipeInput(i, itemstack); + + //return VatRecipeManager.getInstance().isValidInput(new MachineRecipeInput(i, itemstack)); + return VatRecipeManager.getInstance().isValidInput(inputs); } @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - if(resource == null || !resource.isFluidEqual(WATER)) { + if(resource == null || !canFill(from, resource.getFluid())) { return 0; } tanksDirty = true; @@ -115,10 +119,17 @@ public class TileVat extends AbstractPoweredTaskEntity implements IFluidHandler @Override public boolean canFill(ForgeDirection from, Fluid fluid) { - if(fluid == null || fluid.getID() != WATER.getFluid().getID()) { + + if(fluid == null || (inputTank.getFluid() != null && inputTank.getFluid().getFluid().getID() != fluid.getID())) { return false; } - return true; + + MachineRecipeInput[] inputs = getInputs(); + if(inputTank.getFluidAmount() <= 0) { + inputs[inputs.length - 1] = new MachineRecipeInput(0, new FluidStack(fluid, 1)); + } + + return VatRecipeManager.getInstance().isValidInput(inputs); } @Override diff --git a/src/main/java/crazypants/enderio/machine/still/VatRecipeManager.java b/src/main/java/crazypants/enderio/machine/still/VatRecipeManager.java index 7a2204a2..dcc67931 100644 --- a/src/main/java/crazypants/enderio/machine/still/VatRecipeManager.java +++ b/src/main/java/crazypants/enderio/machine/still/VatRecipeManager.java @@ -101,4 +101,25 @@ public class VatRecipeManager { return false; } + public boolean isValidInput(MachineRecipeInput[] inputs) { + for (IRecipe recipe : recipes) { + boolean allValid = true; + String name = recipe.getOutputs()[0].getFluidOutput().getFluid().getName(); + for(MachineRecipeInput input : inputs) { + if(input.item != null) { + allValid = recipe.isValidInput(input.slotNumber, input.item); + } else if(input.fluid != null) { + allValid = recipe.isValidInput(input.fluid); + } + if(!allValid) { + break; + } + } + if(allValid) { + return true; + } + } + return false; + } + } diff --git a/src/main/java/crazypants/enderio/machine/still/VatRenderer.java b/src/main/java/crazypants/enderio/machine/still/VatRenderer.java new file mode 100644 index 00000000..de3d10b5 --- /dev/null +++ b/src/main/java/crazypants/enderio/machine/still/VatRenderer.java @@ -0,0 +1,136 @@ +package crazypants.enderio.machine.still; + +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import crazypants.enderio.EnderIO; +import crazypants.enderio.machine.generator.TileCombustionGenerator; +import crazypants.render.BoundingBox; +import crazypants.render.CubeRenderer; +import crazypants.render.RenderUtil; +import crazypants.render.VertexTransform; +import crazypants.vecmath.Vector3d; +import crazypants.vecmath.Vector3f; + +public class VatRenderer implements ISimpleBlockRenderingHandler { + + private VertXForm xform = new VertXForm(); + + @Override + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + + short facing = 3; + boolean active = false; + if(world != null) { + TileEntity te = world.getTileEntity(x, y, z); + if(te instanceof TileCombustionGenerator) { + TileCombustionGenerator gen = (TileCombustionGenerator) te; + facing = gen.facing; + active = gen.isActive(); + } + } + + + IIcon[] textures = new IIcon[6]; + if(world != null) { + textures[0] = EnderIO.blockVat.getIcon(world, x, y, z, ForgeDirection.NORTH.ordinal()); + textures[1] = EnderIO.blockVat.getIcon(world, x, y, z, ForgeDirection.NORTH.ordinal()); + textures[2] = EnderIO.blockVat.getIcon(world, x, y, z, ForgeDirection.UP.ordinal()); + textures[3] = EnderIO.blockVat.getIcon(world, x, y, z, ForgeDirection.DOWN.ordinal()); + textures[4] = EnderIO.blockVat.getIcon(world, x, y, z, ForgeDirection.NORTH.ordinal()); + textures[5] = EnderIO.blockVat.getIcon(world, x, y, z, ForgeDirection.NORTH.ordinal()); + } else { + textures[0] = EnderIO.blockVat.getIcon(3, 0); + textures[1] = EnderIO.blockVat.getIcon(3, 0); + textures[2] = EnderIO.blockVat.getIcon(1, 0); + textures[3] = EnderIO.blockVat.getIcon(0, 0); + textures[4] = EnderIO.blockVat.getIcon(3, 0); + textures[5] = EnderIO.blockVat.getIcon(3, 0); + } + + float b = 1; + if(world instanceof World) { + b = RenderUtil.claculateTotalBrightnessForLocation((World) world, x, y, z); + } + + float[] cols = new float[6]; + for (int i = 0; i < 6; i++) { + float m = RenderUtil.getColorMultiplierForFace(ForgeDirection.values()[i]); + cols[i] = b * m; + } + + //-x side + BoundingBox bb = BoundingBox.UNIT_CUBE.scale(0.333, 1,1); + bb = bb.translate(0.5f - (0.3f/2),0,0); + xform.set(x, y, z); + CubeRenderer.render(bb, textures, xform, cols); + + bb = BoundingBox.UNIT_CUBE.scale(0.4, 1,1); + xform.set(x, y, z); + CubeRenderer.render(bb, textures, xform, cols); + + bb = BoundingBox.UNIT_CUBE.scale(0.333, 1,1); + bb = bb.translate(-0.5f + (0.3f/2),0,0); + xform.set(x, y, z); + CubeRenderer.render(bb, textures, xform, cols); + + return true; + } + + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + Tessellator tes = Tessellator.instance; + tes.startDrawingQuads(); + renderWorldBlock(null, 0, 0, 0, block, 0, renderer); + tes.draw(); + } + + @Override + public int getRenderId() { + return BlockVat.renderId; + } + + private static class VertXForm implements VertexTransform { + + int x; + int y; + int z; + + public VertXForm() { + } + + void set(int x, int y, int z) { + this.x = x; + this.y = y; + this.z = z; + } + + @Override + public void apply(Vector3d vec) { + if(vec.x > 0.9 || vec.x < 0.1) { + + vec.z -= 0.5; + vec.z *= 0.4; + vec.z += 0.5; + } + vec.add(x, y, z); + } + + @Override + public void applyToNormal(Vector3f vec) { + } + + } +}