mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-20 20:22:12 +00:00
Added 1.12 content
This commit is contained in:
1 parent
11077c38a8
commit
15d7f7405b
281 files changed
+4376
-706
No files matched your search
@@ -49,6 +49,7 @@ import crazypants.enderio.conduit.oc.OCConduitRenderer;
|
||||
import crazypants.enderio.conduit.oc.OCUtil;
|
||||
import crazypants.enderio.conduit.power.PowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitRenderer;
|
||||
import crazypants.enderio.conduit.power.endergy.PowerConduitEndergy;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduitRenderer;
|
||||
import crazypants.enderio.conduit.redstone.RedstoneConduit;
|
||||
@@ -151,12 +152,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
|
||||
|
||||
@@ -201,13 +202,14 @@ public class ClientProxy extends CommonProxy {
|
||||
public void setCbr(ConduitBundleRenderer cbr) {
|
||||
this.cbr = cbr;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void loadIcons() {
|
||||
RedstoneConduit.initIcons();
|
||||
InsulatedRedstoneConduit.initIcons();
|
||||
RedstoneSwitch.initIcons();
|
||||
PowerConduit.initIcons();
|
||||
PowerConduitEndergy.initIcons();
|
||||
LiquidConduit.initIcons();
|
||||
AdvancedLiquidConduit.initIcons();
|
||||
EnderLiquidConduit.initIcons();
|
||||
@@ -295,6 +297,8 @@ public class ClientProxy extends CommonProxy {
|
||||
ZombieGeneratorRenderer zgr = new ZombieGeneratorRenderer();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileZombieGenerator.class, zgr);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockZombieGenerator), zgr);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockFrankenZombieGenerator), zgr);
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockEnderGenerator), zgr);
|
||||
|
||||
KillerJoeRenderer kjr = new KillerJoeRenderer();
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileKillerJoe.class, kjr);
|
||||
@@ -333,6 +337,7 @@ public class ClientProxy extends CommonProxy {
|
||||
ItemConduitRenderer itemConRenderer = new ItemConduitRenderer();
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemLiquidConduit, itemConRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemPowerConduit, itemConRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemPowerConduitEndergy, itemConRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemRedstoneConduit, itemConRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemItemConduit, itemConRenderer);
|
||||
MinecraftForgeClient.registerItemRenderer(EnderIO.itemGasConduit, itemConRenderer);
|
||||
|
||||
@@ -48,6 +48,7 @@ import crazypants.enderio.conduit.item.ItemExtractSpeedUpgrade;
|
||||
import crazypants.enderio.conduit.item.ItemFunctionUpgrade;
|
||||
import crazypants.enderio.conduit.item.ItemItemConduit;
|
||||
import crazypants.enderio.conduit.item.filter.ItemBasicItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemBigItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemExistingItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemModItemFilter;
|
||||
import crazypants.enderio.conduit.item.filter.ItemPowerItemFilter;
|
||||
@@ -55,6 +56,7 @@ import crazypants.enderio.conduit.liquid.ItemLiquidConduit;
|
||||
import crazypants.enderio.conduit.me.ItemMEConduit;
|
||||
import crazypants.enderio.conduit.oc.ItemOCConduit;
|
||||
import crazypants.enderio.conduit.power.ItemPowerConduit;
|
||||
import crazypants.enderio.conduit.power.endergy.ItemPowerConduitEndergy;
|
||||
import crazypants.enderio.conduit.redstone.ConduitBundledRedstoneProvider;
|
||||
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
|
||||
import crazypants.enderio.conduit.redstone.ItemRedstoneConduit;
|
||||
@@ -92,6 +94,8 @@ import crazypants.enderio.machine.farm.FarmersRegistry;
|
||||
import crazypants.enderio.machine.generator.combustion.BlockCombustionGenerator;
|
||||
import crazypants.enderio.machine.generator.stirling.BlockStirlingGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockEnderGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockFrankenZombieGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.PacketNutrientTank;
|
||||
import crazypants.enderio.machine.hypercube.BlockHyperCube;
|
||||
import crazypants.enderio.machine.hypercube.HyperCubeRegister;
|
||||
@@ -134,18 +138,24 @@ import crazypants.enderio.machine.vat.BlockVat;
|
||||
import crazypants.enderio.machine.vat.VatRecipeManager;
|
||||
import crazypants.enderio.machine.wireless.BlockWirelessCharger;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.BlockDarkIronBars;
|
||||
import crazypants.enderio.material.BlockDarkSteelBars;
|
||||
import crazypants.enderio.material.BlockDarkSteelBars.BlockEndSteelBars;
|
||||
import crazypants.enderio.material.BlockDarkSteelBars.BlockSoulariumBars;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.BlockIngotStorage;
|
||||
import crazypants.enderio.material.ItemAlloy;
|
||||
import crazypants.enderio.material.ItemCapacitor;
|
||||
import crazypants.enderio.material.ItemFrankenSkull;
|
||||
import crazypants.enderio.material.ItemFusedQuartzFrame;
|
||||
import crazypants.enderio.material.ItemGrindingBall;
|
||||
import crazypants.enderio.material.ItemMachinePart;
|
||||
import crazypants.enderio.material.ItemMaterial;
|
||||
import crazypants.enderio.material.ItemPowderIngot;
|
||||
import crazypants.enderio.material.MaterialRecipes;
|
||||
import crazypants.enderio.material.OreDictionaryPreferences;
|
||||
import crazypants.enderio.material.endergy.BlockIngotStorageEndergy;
|
||||
import crazypants.enderio.material.endergy.ItemAlloyEndergy;
|
||||
import crazypants.enderio.material.endergy.ItemGrindingBallEndergy;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.rail.BlockEnderRail;
|
||||
import crazypants.enderio.teleport.ItemTravelStaff;
|
||||
@@ -189,13 +199,19 @@ public class EnderIO {
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
public static ItemAlloy itemAlloy;
|
||||
public static ItemGrindingBall itemGrindingBall;
|
||||
public static ItemAlloyEndergy itemAlloyEndergy;
|
||||
public static ItemGrindingBallEndergy itemGrindingBallEndergy;
|
||||
public static BlockFusedQuartz blockFusedQuartz;
|
||||
public static ItemFusedQuartzFrame itemFusedQuartzFrame;
|
||||
public static ItemMachinePart itemMachinePart;
|
||||
public static ItemPowderIngot itemPowderIngot;
|
||||
public static ItemMaterial itemMaterial;
|
||||
public static BlockIngotStorage blockIngotStorage;
|
||||
public static BlockDarkIronBars blockDarkIronBars;
|
||||
public static BlockIngotStorageEndergy blockIngotStorageEndergy;
|
||||
public static BlockDarkSteelBars blockDarkIronBars;
|
||||
public static BlockSoulariumBars blockSoulariumBars;
|
||||
public static BlockEndSteelBars blockEndSteelBars;
|
||||
public static ItemEnderFood itemEnderFood;
|
||||
|
||||
// Enderface
|
||||
@@ -225,12 +241,14 @@ public class EnderIO {
|
||||
public static ItemConduitFacade itemConduitFacade;
|
||||
public static ItemRedstoneConduit itemRedstoneConduit;
|
||||
public static ItemPowerConduit itemPowerConduit;
|
||||
public static ItemPowerConduitEndergy itemPowerConduitEndergy;
|
||||
public static ItemLiquidConduit itemLiquidConduit;
|
||||
public static ItemItemConduit itemItemConduit;
|
||||
public static ItemGasConduit itemGasConduit;
|
||||
public static ItemMEConduit itemMEConduit;
|
||||
public static ItemOCConduit itemOCConduit;
|
||||
public static ItemBasicItemFilter itemBasicFilterUpgrade;
|
||||
public static ItemBigItemFilter itemBigFilterUpgrade;
|
||||
public static ItemExistingItemFilter itemExistingItemFilter;
|
||||
public static ItemModItemFilter itemModItemFilter;
|
||||
public static ItemPowerItemFilter itemPowerItemFilter;
|
||||
@@ -241,6 +259,8 @@ public class EnderIO {
|
||||
public static BlockStirlingGenerator blockStirlingGenerator;
|
||||
public static BlockCombustionGenerator blockCombustionGenerator;
|
||||
public static BlockZombieGenerator blockZombieGenerator;
|
||||
public static BlockFrankenZombieGenerator blockFrankenZombieGenerator;
|
||||
public static BlockEnderGenerator blockEnderGenerator;
|
||||
public static BlockSolarPanel blockSolarPanel;
|
||||
public static BlockReservoir blockReservoir;
|
||||
public static BlockAlloySmelter blockAlloySmelter;
|
||||
@@ -299,19 +319,27 @@ public class EnderIO {
|
||||
public static Fluid fluidFireWater;
|
||||
public static BlockFluidEio blockFireWater;
|
||||
public static ItemBucketEio itemBucketFireWater;
|
||||
|
||||
public static Fluid fluidLiquidSunshine;
|
||||
public static Fluid fluidCloudSeed;
|
||||
public static Fluid fluidCloudSeedConcentrated;
|
||||
|
||||
public static BlockFluidEio blockLiquidSunshine;
|
||||
public static BlockFluidEio blockCloudSeed;
|
||||
public static BlockFluidEio blockCloudSeedConcentrated;
|
||||
|
||||
public static Fluid fluidLiquidSunshine;
|
||||
public static BlockFluidEio blockLiquidSunshine;
|
||||
public static ItemBucketEio itemBucketLiquidSunshine;
|
||||
|
||||
public static Fluid fluidCloudSeed;
|
||||
public static BlockFluidEio blockCloudSeed;
|
||||
public static ItemBucketEio itemBucketCloudSeed;
|
||||
|
||||
public static Fluid fluidCloudSeedConcentrated;
|
||||
public static BlockFluidEio blockCloudSeedConcentrated;
|
||||
public static ItemBucketEio itemBucketCloudSeedConcentrated;
|
||||
|
||||
|
||||
public static Fluid fluidEnderDistillation;
|
||||
public static BlockFluidEio blockEnderDistillation;
|
||||
public static ItemBucketEio itemBucketEnderDistillation;
|
||||
|
||||
public static Fluid fluidVapourOfLevity;
|
||||
public static BlockFluidEio blockVapourOfLevity;
|
||||
public static ItemBucketEio itemBucketVapourOfLevity;
|
||||
|
||||
//Open block compatable liquid XP
|
||||
public static Fluid fluidXpJuice;
|
||||
public static ItemBucketEio itemBucketXpJuice;
|
||||
@@ -328,11 +356,11 @@ public class EnderIO {
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
|
||||
|
||||
EnderIOCrashCallable.create();
|
||||
|
||||
Config.load(event);
|
||||
|
||||
|
||||
proxy.loadIcons();
|
||||
|
||||
ConduitGeometryUtil.setupBounds((float) Config.conduitScale);
|
||||
@@ -340,6 +368,8 @@ public class EnderIO {
|
||||
blockStirlingGenerator = BlockStirlingGenerator.create();
|
||||
blockCombustionGenerator = BlockCombustionGenerator.create();
|
||||
blockZombieGenerator = BlockZombieGenerator.create();
|
||||
blockFrankenZombieGenerator = BlockFrankenZombieGenerator.create();
|
||||
blockEnderGenerator = BlockEnderGenerator.create();
|
||||
blockSolarPanel = BlockSolarPanel.create();
|
||||
|
||||
blockCrusher = BlockCrusher.create();
|
||||
@@ -415,6 +445,7 @@ public class EnderIO {
|
||||
|
||||
itemRedstoneConduit = ItemRedstoneConduit.create();
|
||||
itemPowerConduit = ItemPowerConduit.create();
|
||||
itemPowerConduitEndergy = ItemPowerConduitEndergy.create();
|
||||
itemLiquidConduit = ItemLiquidConduit.create();
|
||||
itemItemConduit = ItemItemConduit.create();
|
||||
itemGasConduit = ItemGasConduit.create();
|
||||
@@ -422,6 +453,7 @@ public class EnderIO {
|
||||
itemOCConduit = ItemOCConduit.create();
|
||||
|
||||
itemBasicFilterUpgrade = ItemBasicItemFilter.create();
|
||||
itemBigFilterUpgrade = ItemBigItemFilter.create();
|
||||
itemExistingItemFilter = ItemExistingItemFilter.create();
|
||||
itemModItemFilter = ItemModItemFilter.create();
|
||||
itemPowerItemFilter = ItemPowerItemFilter.create();
|
||||
@@ -432,6 +464,9 @@ public class EnderIO {
|
||||
itemMachinePart = ItemMachinePart.create();
|
||||
itemMaterial = ItemMaterial.create();
|
||||
itemAlloy = ItemAlloy.create();
|
||||
itemGrindingBall = ItemGrindingBall.create();
|
||||
itemAlloyEndergy = ItemAlloyEndergy.create();
|
||||
itemGrindingBallEndergy = ItemGrindingBallEndergy.create();
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
|
||||
registerFluids();
|
||||
@@ -446,9 +481,13 @@ public class EnderIO {
|
||||
itemSoulVessel = ItemSoulVessel.create();
|
||||
|
||||
blockIngotStorage = BlockIngotStorage.create();
|
||||
blockIngotStorageEndergy = BlockIngotStorageEndergy.create();
|
||||
|
||||
blockDarkIronBars = BlockDarkSteelBars.create();
|
||||
blockSoulariumBars = BlockSoulariumBars.create();
|
||||
blockEndSteelBars = BlockEndSteelBars.create();
|
||||
|
||||
|
||||
blockDarkIronBars = BlockDarkIronBars.create();
|
||||
|
||||
itemEnderFood = ItemEnderFood.create();
|
||||
|
||||
DarkSteelItems.createDarkSteelArmorItems();
|
||||
@@ -467,52 +506,63 @@ public class EnderIO {
|
||||
}
|
||||
|
||||
private void registerFluids() {
|
||||
Fluid f = new Fluid(Fluids.NUTRIENT_DISTILLATION_NAME).setDensity(1500).setViscosity(3000);
|
||||
Fluid f = new Fluid(Fluids.NUTRIENT_DISTILLATION).setDensity(1500).setViscosity(3000);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidNutrientDistillation = FluidRegistry.getFluid(f.getName());
|
||||
blockNutrientDistillation = BlockFluidEio.create(fluidNutrientDistillation, Material.water);
|
||||
blockNutrientDistillation = BlockFluidEio.NutrientDistillation.create(fluidNutrientDistillation, Material.water);
|
||||
|
||||
PacketHandler.INSTANCE.registerMessage(PacketNutrientTank.class, PacketNutrientTank.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
|
||||
f = new Fluid(Fluids.HOOTCH_NAME).setDensity(900).setViscosity(1000);
|
||||
f = new Fluid(Fluids.HOOTCH).setDensity(900).setViscosity(1000);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidHootch = FluidRegistry.getFluid(f.getName());
|
||||
blockHootch = BlockFluidEio.create(fluidHootch, Material.water);
|
||||
blockHootch = BlockFluidEio.Hootch.create(fluidHootch, Material.water);
|
||||
FluidFuelRegister.instance.addFuel(f, Config.hootchPowerPerCycleRF, Config.hootchPowerTotalBurnTime);
|
||||
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.HOOTCH_NAME + "@"
|
||||
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.HOOTCH + "@"
|
||||
+ (Config.hootchPowerPerCycleRF / 10 * Config.hootchPowerTotalBurnTime));
|
||||
|
||||
f = new Fluid(Fluids.ROCKET_FUEL_NAME).setDensity(900).setViscosity(1000);
|
||||
f = new Fluid(Fluids.ROCKET_FUEL).setDensity(900).setViscosity(1000);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidRocketFuel = FluidRegistry.getFluid(f.getName());
|
||||
blockRocketFuel = BlockFluidEio.create(fluidRocketFuel, Material.water);
|
||||
blockRocketFuel = BlockFluidEio.RocketFuel.create(fluidRocketFuel, Material.water);
|
||||
FluidFuelRegister.instance.addFuel(f, Config.rocketFuelPowerPerCycleRF, Config.rocketFuelPowerTotalBurnTime);
|
||||
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.ROCKET_FUEL_NAME + "@"
|
||||
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.ROCKET_FUEL + "@"
|
||||
+ (Config.rocketFuelPowerPerCycleRF / 10 * Config.rocketFuelPowerTotalBurnTime));
|
||||
|
||||
f = new Fluid(Fluids.FIRE_WATER_NAME).setDensity(900).setViscosity(1000).setTemperature(FluidRegistry.LAVA.getTemperature() * 2);
|
||||
f = new Fluid(Fluids.FIRE_WATER).setDensity(900).setViscosity(1000).setTemperature(FluidRegistry.LAVA.getTemperature() * 2);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidFireWater = FluidRegistry.getFluid(f.getName());
|
||||
blockFireWater = BlockFluidEio.create(fluidFireWater, Material.lava);
|
||||
blockFireWater = BlockFluidEio.FireWater.create(fluidFireWater, Material.lava);
|
||||
FluidFuelRegister.instance.addFuel(f, Config.fireWaterPowerPerCycleRF, Config.fireWaterPowerTotalBurnTime);
|
||||
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.FIRE_WATER_NAME + "@"
|
||||
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.FIRE_WATER + "@"
|
||||
+ (Config.fireWaterPowerPerCycleRF / 10 * Config.fireWaterPowerTotalBurnTime));
|
||||
|
||||
f = new Fluid(Fluids.LIQUID_SUNSHINE_NAME).setDensity(200).setViscosity(400);
|
||||
f = new Fluid(Fluids.LIQUID_SUNSHINE).setDensity(200).setViscosity(400);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidLiquidSunshine = FluidRegistry.getFluid(f.getName());
|
||||
blockLiquidSunshine = BlockFluidEio.create(fluidLiquidSunshine, Material.water);
|
||||
|
||||
f = new Fluid(Fluids.CLOUD_SEED_NAME).setDensity(500).setViscosity(800);
|
||||
f = new Fluid(Fluids.CLOUD_SEED).setDensity(500).setViscosity(800);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidCloudSeed = FluidRegistry.getFluid(f.getName());
|
||||
blockCloudSeed = BlockFluidEio.create(fluidCloudSeed, Material.water);
|
||||
|
||||
f = new Fluid(Fluids.CLOUD_SEED_CONCENTRATED_NAME).setDensity(1000).setViscosity(1200);
|
||||
|
||||
f = new Fluid(Fluids.CLOUD_SEED_CONCENTRATED).setDensity(1000).setViscosity(1200);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidCloudSeedConcentrated = FluidRegistry.getFluid(f.getName());
|
||||
blockCloudSeedConcentrated = BlockFluidEio.create(fluidCloudSeedConcentrated, Material.water);
|
||||
|
||||
blockCloudSeedConcentrated = BlockFluidEio.CloudSeedConcentrated.create(fluidCloudSeedConcentrated, Material.water);
|
||||
|
||||
f = new Fluid(Fluids.ENDER_DISTILLATION).setDensity(200).setViscosity(1000).setTemperature(175);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidEnderDistillation = FluidRegistry.getFluid(f.getName());
|
||||
blockEnderDistillation = BlockFluidEio.create(fluidEnderDistillation, Material.water);
|
||||
|
||||
f = new Fluid(Fluids.VAPOR_OF_LEVITY).setDensity(-10).setViscosity(100).setTemperature(5).setGaseous(true);
|
||||
FluidRegistry.registerFluid(f);
|
||||
fluidVapourOfLevity = FluidRegistry.getFluid(f.getName());
|
||||
blockVapourOfLevity = BlockFluidEio.VapourOfLevity.create(fluidVapourOfLevity, Material.water);
|
||||
FluidFuelRegister.instance.addCoolant(f, 0.0314f);
|
||||
|
||||
if (!Loader.isModLoaded("OpenBlocks")) {
|
||||
Log.info("XP Juice registered by Ender IO.");
|
||||
fluidXpJuice = new Fluid(Config.xpJuiceName).setLuminosity(10).setDensity(800).setViscosity(1500).setUnlocalizedName("eio.xpjuice");
|
||||
@@ -529,6 +579,9 @@ public class EnderIO {
|
||||
itemBucketLiquidSunshine = ItemBucketEio.create(fluidLiquidSunshine);
|
||||
itemBucketCloudSeed = ItemBucketEio.create(fluidCloudSeed);
|
||||
itemBucketCloudSeedConcentrated = ItemBucketEio.create(fluidCloudSeedConcentrated);
|
||||
itemBucketEnderDistillation = ItemBucketEio.create(fluidEnderDistillation);
|
||||
itemBucketVapourOfLevity = ItemBucketEio.create(fluidVapourOfLevity);
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -617,7 +670,7 @@ public class EnderIO {
|
||||
ItemRecipes.addRecipes();
|
||||
TeleportRecipes.addRecipes();
|
||||
EE3Util.registerMiscRecipes();
|
||||
|
||||
|
||||
proxy.load();
|
||||
}
|
||||
|
||||
@@ -628,7 +681,7 @@ public class EnderIO {
|
||||
|
||||
//Regsiter the enchants
|
||||
Enchantments.getInstance();
|
||||
|
||||
|
||||
//This must be loaded before parsing the recipes so we get the preferred outputs
|
||||
OreDictionaryPreferences.loadConfig();
|
||||
|
||||
@@ -641,7 +694,7 @@ public class EnderIO {
|
||||
SoulBinderRecipeManager.getInstance().addDefaultRecipes();
|
||||
PaintSourceValidator.instance.loadConfig();
|
||||
|
||||
if(fluidXpJuice == null) { //should have been registered by open blocks
|
||||
if(fluidXpJuice == null) { //should have been registered by open blocks
|
||||
fluidXpJuice = FluidRegistry.getFluid(getXPJuiceName());
|
||||
if(fluidXpJuice == null) {
|
||||
Log.error("Liquid XP Juice registration left to open blocks but could not be found.");
|
||||
@@ -667,7 +720,7 @@ public class EnderIO {
|
||||
}
|
||||
|
||||
addModIntegration();
|
||||
|
||||
|
||||
//Register villagers
|
||||
FMLInterModComms.sendMessage("EnderStructures", "addResourcePath", "/assets/enderio/villagers");
|
||||
FMLInterModComms.sendMessage("EnderStructures", "registerVillageGenerator", "enderioMobDropVillager");
|
||||
@@ -714,7 +767,7 @@ public class EnderIO {
|
||||
Log.info("Failed to registered Capacitor Banks as Tinkers Construct Flux Upgrades");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ThaumcraftCompat.load();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,8 +13,9 @@ public enum ModObject {
|
||||
itemItemConduit,
|
||||
itemGasConduit,
|
||||
itemMEConduit,
|
||||
itemOCConduit,
|
||||
itemOCConduit,
|
||||
itemBasicFilterUpgrade,
|
||||
itemBigFilterUpgrade,
|
||||
itemExistingItemFilter,
|
||||
itemModItemFilter,
|
||||
itemPowerItemFilter,
|
||||
@@ -23,6 +24,7 @@ public enum ModObject {
|
||||
|
||||
// Power
|
||||
itemPowerConduit,
|
||||
itemPowerConduitEndergy,
|
||||
|
||||
// Liquid
|
||||
itemLiquidConduit,
|
||||
@@ -30,17 +32,24 @@ public enum ModObject {
|
||||
// Materials
|
||||
itemBasicCapacitor,
|
||||
itemAlloy,
|
||||
itemAlloyEndergy,
|
||||
itemGrindingBall,
|
||||
itemGrindingBallEndergy,
|
||||
itemMaterial,
|
||||
itemMachinePart,
|
||||
itemPowderIngot,
|
||||
blockFusedQuartz,
|
||||
itemFusedQuartzFrame,
|
||||
blockDarkIronBars,
|
||||
blockSoulariumBars,
|
||||
blockEndSteelBars,
|
||||
|
||||
// Machines
|
||||
blockStirlingGenerator,
|
||||
blockCombustionGenerator,
|
||||
blockZombieGenerator,
|
||||
blockFrankenzombieGenerator,
|
||||
blockEnderGenerator,
|
||||
blockReservoir,
|
||||
blockAlloySmelter,
|
||||
blockSolarPanel,
|
||||
@@ -82,6 +91,7 @@ public enum ModObject {
|
||||
blockDarkSteelLadder,
|
||||
blockReinforcedObsidian,
|
||||
blockIngotStorage,
|
||||
blockIngotStorageEndergy,
|
||||
|
||||
// Painter
|
||||
blockPainter,
|
||||
@@ -104,12 +114,12 @@ public enum ModObject {
|
||||
itemTravelStaff,
|
||||
itemMagnet,
|
||||
itemGliderWing,
|
||||
blockEndermanSkull,
|
||||
itemSoulVessel,
|
||||
itemFrankenSkull,
|
||||
|
||||
blockEndermanSkull,
|
||||
itemSoulVessel,
|
||||
itemFrankenSkull,
|
||||
|
||||
blockEnderRail,
|
||||
|
||||
|
||||
itemEnderFood;
|
||||
|
||||
public final String unlocalisedName;
|
||||
|
||||
@@ -4,6 +4,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import appeng.api.AEApi;
|
||||
import cpw.mods.fml.common.Optional.Method;
|
||||
@@ -20,8 +21,10 @@ import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.material.BlockFusedQuartz;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.Material;
|
||||
|
||||
import static crazypants.enderio.ModObject.blockPainter;
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.enderio.material.Material.*;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
@@ -35,6 +38,13 @@ public class ConduitRecipes {
|
||||
ItemStack fusedQuartz = new ItemStack(EnderIO.blockFusedQuartz, 1, 0);
|
||||
ItemStack fusedGlass = new ItemStack(EnderIO.blockFusedQuartz, 1, BlockFusedQuartz.Type.GLASS.ordinal());
|
||||
|
||||
String crudeSteel = CRUDE_STEEL.getOreIngot();
|
||||
String energeticSilver = ENERGETIC_SILVER.getOreIngot();
|
||||
String crystallineAlloy = CRYSTALLINE_ALLOY.getOreIngot();
|
||||
String crystallinePinkSlime = CRYSTALLINE_PINK_SLIME.getOreIngot();
|
||||
String melodicAlloy = MELODIC_ALLOY.getOreIngot();
|
||||
String stellarAlloy = STELLAR_ALLOY.getOreIngot();
|
||||
|
||||
String electricalSteel = ELECTRICAL_STEEL.getOreIngot();
|
||||
String phasedGold = PHASED_GOLD.getOreIngot();
|
||||
String conductiveIron = CONDUCTIVE_IRON.getOreIngot();
|
||||
@@ -45,6 +55,7 @@ public class ConduitRecipes {
|
||||
String binder = CONDUIT_BINDER.oreDict;
|
||||
|
||||
ItemStack zombieController = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.ZOMBIE_CONTROLLER.ordinal());
|
||||
ItemStack skeletalContractor = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.SKELETAL_CONTRACTOR.ordinal());
|
||||
|
||||
//Recipes
|
||||
addShaped(new ItemStack(EnderIO.itemConduitFacade, 1, FacadeType.BASIC.ordinal()), "bbb", "b b", "bbb", 'b', binder);
|
||||
@@ -55,13 +66,92 @@ public class ConduitRecipes {
|
||||
addShaped(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 0), "bbb", "###", "bbb", 'b', binder, '#', fusedGlass);
|
||||
addShaped(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 1), "bbb", "###", "bbb", 'b', binder, '#', fusedQuartz);
|
||||
addShaped(new ItemStack(EnderIO.itemLiquidConduit, numConduits, 2), "bbb", "#p#", "bbb", 'b', binder, '#', fusedQuartz, 'p', phasedGold);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 0), "bbb", "###", "bbb", 'b', binder, '#', conductiveIron);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 1), "bbb", "###", "bbb", 'b', binder, '#', energeticGold);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 2), "bbb", "###", "bbb", 'b', binder, '#', phasedGold);
|
||||
addShaped(new ItemStack(EnderIO.itemRedstoneConduit, numConduits, 0), "###", '#', redstoneAlloy);
|
||||
addShaped(new ItemStack(EnderIO.itemRedstoneConduit, 1, 1), "lbl", "bcb", "lbl", 'b', binder, 'c', redstoneConduit, 'l', Blocks.lever);
|
||||
addShaped(new ItemStack(EnderIO.itemRedstoneConduit, numConduits, 2), "bbb", "###", "bbb", 'b', binder, '#', redstoneAlloy);
|
||||
|
||||
if(Config.useHardRecipes) {
|
||||
|
||||
ItemStack lastTier;
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 0), "bbb", "###", "bbb", 'b', binder, '#', crudeSteel);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 0);
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 1), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', "ingotIron");
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 1);
|
||||
|
||||
if(OreDictionary.doesOreNameExist("ingotAluminum")||OreDictionary.doesOreNameExist("ingotAluminium")) {
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 2), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', "ingotAluminum");
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 2), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', "ingotAluminium");
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 2);
|
||||
}
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 3), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', "ingotGold");
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 3);
|
||||
|
||||
if(OreDictionary.doesOreNameExist("ingotCopper") && OreDictionary.getOres("ingotCopper").size()>0) {
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 4), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', "ingotCopper");
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 4);
|
||||
}
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 0), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', conductiveIron);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduit, 1, 0);
|
||||
|
||||
if(OreDictionary.doesOreNameExist("ingotSilver")) {
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 5), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', "ingotSilver");
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 5);
|
||||
}
|
||||
|
||||
if(OreDictionary.doesOreNameExist("ingotElectrum")) {
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 6), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', "ingotElectrum");
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 6);
|
||||
}
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 1), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', energeticGold);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduit, 1, 1);
|
||||
|
||||
if(OreDictionary.doesOreNameExist("ingotSilver")) {
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 7), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', energeticSilver);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 7);
|
||||
}
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 2), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', phasedGold);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduit, 1, 2);
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 8), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', crystallineAlloy);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 8);
|
||||
|
||||
if(OreDictionary.doesOreNameExist("slimeballPink")) {
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 9), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', crystallinePinkSlime);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 9);
|
||||
}
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 10), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', melodicAlloy);
|
||||
lastTier = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, 10);
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 11), "b#b", "ccc", "b#b", 'c', lastTier, 'b', binder, '#', stellarAlloy);
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 0), "bbb", "###", "bbb", 'b', binder, '#', conductiveIron);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 1), "bbb", "###", "bbb", 'b', binder, '#', energeticGold);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduit, numConduits, 2), "bbb", "###", "bbb", 'b', binder, '#', phasedGold);
|
||||
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 0), "bbb", "###", "bbb", 'b', binder, '#', crudeSteel);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 1), "bbb", "###", "bbb", 'b', binder, '#', "ingotIron");
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 2), "bbb", "###", "bbb", 'b', binder, '#', "ingotAluminum");
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 3), "bbb", "###", "bbb", 'b', binder, '#', "ingotGold");
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 4), "bbb", "###", "bbb", 'b', binder, '#', "ingotCopper");
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 5), "bbb", "###", "bbb", 'b', binder, '#', "ingotSilver");
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 6), "bbb", "###", "bbb", 'b', binder, '#', "ingotElectrum");
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 7), "bbb", "###", "bbb", 'b', binder, '#', energeticSilver);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 8), "bbb", "###", "bbb", 'b', binder, '#', crystallineAlloy);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 9), "bbb", "###", "bbb", 'b', binder, '#', crystallinePinkSlime);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 10), "bbb", "###", "bbb", 'b', binder, '#', melodicAlloy);
|
||||
addShaped(new ItemStack(EnderIO.itemPowerConduitEndergy, numConduits, 11), "bbb", "###", "bbb", 'b', binder, '#', stellarAlloy);
|
||||
|
||||
}
|
||||
if (GasUtil.isGasConduitEnabled()) {
|
||||
addShaped(new ItemStack(EnderIO.itemGasConduit, numConduits, 0), "bbb", "#g#", "bbb", 'b', binder, '#', electricalSteel, 'g', fusedGlass);
|
||||
}
|
||||
@@ -78,6 +168,12 @@ public class ConduitRecipes {
|
||||
ItemStack advFilter = new ItemStack(EnderIO.itemBasicFilterUpgrade, 1, 1);
|
||||
addShaped(advFilter, "rpr", "pzp", "rpr", 'p', Items.paper, 'z', zombieController, 'r', "dustRedstone");
|
||||
|
||||
ItemStack bigFilter = new ItemStack(EnderIO.itemBigFilterUpgrade, 1, 0);
|
||||
addShaped(bigFilter, "opo", "psp", "opo", 'p', Items.paper, 's', skeletalContractor, 'o', "dustObsidian");
|
||||
|
||||
ItemStack bigAdvFilter = new ItemStack(EnderIO.itemBigFilterUpgrade, 1, 1);
|
||||
addShaped(bigAdvFilter, "eme", "mfm", "eme", 'm', melodicAlloy, 'f', bigFilter, 'e', END_STEEL.getOreIngot());
|
||||
|
||||
ItemStack modFilter = new ItemStack(EnderIO.itemModItemFilter, 1, 0);
|
||||
addShaped(modFilter, " p ", "pwp", " p ", 'p', Items.paper, 'w', EnderIO.itemYetaWench);
|
||||
|
||||
|
||||
@@ -66,8 +66,8 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
slotLocations.add(new Point(x, y));
|
||||
bgSlots.add(new GhostBackgroundItemSlot(EnderIO.itemBasicFilterUpgrade, slotInputFilterUpgrades));
|
||||
|
||||
x = 28;
|
||||
y = 47;
|
||||
x = 10;
|
||||
y = 83;
|
||||
slotSpeedUpgrades = addSlotToContainer(new Slot(getInv(), 0, x, y) {
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
@@ -108,7 +108,7 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
public Point getPlayerInventoryOffset() {
|
||||
return new Point(23, 113);
|
||||
}
|
||||
|
||||
|
||||
public void addFilterListener(FilterChangeListener list) {
|
||||
filterListeners.add(list);
|
||||
}
|
||||
@@ -279,7 +279,7 @@ public class ExternalConnectionContainer extends ContainerEnder<InventoryUpgrade
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return inventory.isItemValidForSlot(getSlotIndex(), par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package crazypants.enderio.conduit.gui.item;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.GuiContainerBase;
|
||||
import com.enderio.core.client.gui.button.CycleButton;
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.item.filter.FuzzyMode;
|
||||
import crazypants.enderio.conduit.item.filter.ItemFilter;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
|
||||
public class BigItemFilterGui implements IItemFilterGui {
|
||||
|
||||
private static final int ID_WHITELIST = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_NBT = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_META = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_ORE_DICT = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_STICKY = GuiExternalConnection.nextButtonId();
|
||||
private static final int ID_FUZZY = GuiExternalConnection.nextButtonId();
|
||||
|
||||
private final GuiContainerBaseEIO gui;
|
||||
|
||||
private final ToggleButton useMetaB;
|
||||
private final ToggleButton useNbtB;
|
||||
private final IconButton whiteListB;
|
||||
private final ToggleButton useOreDictB;
|
||||
private final ToggleButton stickyB;
|
||||
private final CycleButton<FuzzyMode> fuzzyB;
|
||||
|
||||
final boolean isAdvanced;
|
||||
final boolean isStickyModeAvailable;
|
||||
|
||||
private final IItemFilterContainer filterContainer;
|
||||
private final ItemFilter filter;
|
||||
|
||||
private int buttonIdOffset;
|
||||
private int xOffset;
|
||||
private int yOffset;
|
||||
|
||||
public BigItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer, boolean isStickyModeAvailable) {
|
||||
this(gui, filterContainer, isStickyModeAvailable, 32, 48, 0);
|
||||
}
|
||||
|
||||
public BigItemFilterGui(GuiContainerBaseEIO gui, IItemFilterContainer filterContainer, boolean isStickyModeAvailable,
|
||||
int xOffset, int yOffset,
|
||||
int buttonIdOffset) {
|
||||
this.gui = gui;
|
||||
this.isStickyModeAvailable = isStickyModeAvailable;
|
||||
this.filterContainer = filterContainer;
|
||||
this.xOffset = xOffset;
|
||||
this.yOffset = yOffset;
|
||||
this.buttonIdOffset = buttonIdOffset;
|
||||
|
||||
filter = filterContainer.getItemFilter();
|
||||
|
||||
isAdvanced = filter.isAdvanced();
|
||||
|
||||
int butLeft = xOffset + 92+ 54;
|
||||
int x = butLeft;
|
||||
int y = yOffset + 40;
|
||||
whiteListB = new IconButton(gui, ID_WHITELIST + buttonIdOffset, x, y, IconEIO.FILTER_WHITELIST);
|
||||
whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.whitelist"));
|
||||
|
||||
y -= 20;
|
||||
useMetaB = new ToggleButton(gui, ID_META + buttonIdOffset, x, y, IconEIO.FILTER_META_OFF, IconEIO.FILTER_META);
|
||||
useMetaB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchMetaData"));
|
||||
useMetaB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreMetaData"));
|
||||
useMetaB.setPaintSelectedBorder(false);
|
||||
|
||||
stickyB = new ToggleButton(gui, ID_STICKY + buttonIdOffset, x, y, IconEIO.FILTER_STICKY_OFF, IconEIO.FILTER_STICKY);
|
||||
stickyB.setSelectedToolTip(EnderIO.lang.localizeList("gui.conduit.item.stickyEnabled"));
|
||||
stickyB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.stickyDisbaled"));
|
||||
stickyB.setPaintSelectedBorder(false);
|
||||
|
||||
y -= 20;
|
||||
useOreDictB = new ToggleButton(gui, ID_ORE_DICT + buttonIdOffset, x, y, IconEIO.FILTER_ORE_DICT_OFF, IconEIO.FILTER_ORE_DICT);
|
||||
useOreDictB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicEnabled"));
|
||||
useOreDictB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.oreDicDisabled"));
|
||||
useOreDictB.setPaintSelectedBorder(false);
|
||||
|
||||
y -= 20;
|
||||
useNbtB = new ToggleButton(gui, ID_NBT + buttonIdOffset, x, y, IconEIO.FILTER_NBT_OFF, IconEIO.FILTER_NBT);
|
||||
useNbtB.setSelectedToolTip(EnderIO.lang.localize("gui.conduit.item.matchNBT"));
|
||||
useNbtB.setUnselectedToolTip(EnderIO.lang.localize("gui.conduit.item.ignoreNBT"));
|
||||
useNbtB.setPaintSelectedBorder(false);
|
||||
|
||||
y -= 20;
|
||||
fuzzyB = new CycleButton(gui, ID_FUZZY + buttonIdOffset, x, y, FuzzyMode.class);
|
||||
}
|
||||
|
||||
public void createFilterSlots() {
|
||||
filter.createGhostSlots(gui.getGhostSlots(), xOffset+1, yOffset+1, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sendFilterChange();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int x, int y, int par3) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateButtons() {
|
||||
ItemFilter activeFilter = filter;
|
||||
|
||||
if(isAdvanced) {
|
||||
useNbtB.onGuiInit();
|
||||
useNbtB.setSelected(activeFilter.isMatchNBT());
|
||||
|
||||
useOreDictB.onGuiInit();
|
||||
useOreDictB.setSelected(activeFilter.isUseOreDict());
|
||||
|
||||
if(isStickyModeAvailable) {
|
||||
stickyB.onGuiInit();
|
||||
stickyB.setSelected(activeFilter.isSticky());
|
||||
}
|
||||
|
||||
fuzzyB.onGuiInit();
|
||||
fuzzyB.setMode(activeFilter.getFuzzyMode());
|
||||
}
|
||||
|
||||
useMetaB.onGuiInit();
|
||||
useMetaB.setSelected(activeFilter.isMatchMeta());
|
||||
|
||||
whiteListB.onGuiInit();
|
||||
if(activeFilter.isBlacklist()) {
|
||||
whiteListB.setIcon(IconEIO.FILTER_BLACKLIST);
|
||||
whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.blacklist"));
|
||||
} else {
|
||||
whiteListB.setIcon(IconEIO.FILTER_WHITELIST);
|
||||
whiteListB.setToolTip(EnderIO.lang.localize("gui.conduit.item.whitelist"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void actionPerformed(GuiButton guiButton) {
|
||||
|
||||
if(guiButton.id == ID_META + buttonIdOffset) {
|
||||
filter.setMatchMeta(useMetaB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if(guiButton.id == ID_NBT + buttonIdOffset) {
|
||||
filter.setMatchNBT(useNbtB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if(guiButton.id == ID_STICKY + buttonIdOffset) {
|
||||
filter.setSticky(stickyB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if(guiButton.id == ID_ORE_DICT + buttonIdOffset) {
|
||||
filter.setUseOreDict(useOreDictB.isSelected());
|
||||
sendFilterChange();
|
||||
} else if(guiButton.id == ID_FUZZY + buttonIdOffset) {
|
||||
filter.setFuzzyMode(fuzzyB.getMode());
|
||||
sendFilterChange();
|
||||
} else if(guiButton.id == ID_WHITELIST + buttonIdOffset) {
|
||||
filter.setBlacklist(!filter.isBlacklist());
|
||||
sendFilterChange();
|
||||
}
|
||||
}
|
||||
|
||||
private void sendFilterChange() {
|
||||
updateButtons();
|
||||
filterContainer.onFilterChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deactivate() {
|
||||
useNbtB.detach();
|
||||
useMetaB.detach();
|
||||
useOreDictB.detach();
|
||||
whiteListB.detach();
|
||||
stickyB.detach();
|
||||
fuzzyB.detach();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderCustomOptions(int top, float par1, int par2, int par3) {
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
gui.bindGuiTexture(1);
|
||||
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset + 54, gui.getGuiTop() + yOffset, 0, 238, 18 * 5, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset, gui.getGuiTop() + yOffset, 0, 238, 18 * 5, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset + 54, gui.getGuiTop() + yOffset + 20, 0, 238, 18 * 5, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset, gui.getGuiTop() + yOffset + 20, 0, 238, 18 * 5, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset + 54, gui.getGuiTop() + yOffset + 40, 0, 238, 18 * 5, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + xOffset, gui.getGuiTop() + yOffset + 40, 0, 238, 18 * 5, 18);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
private final RedstoneModeButton rsB;
|
||||
private final ColorButton colorB;
|
||||
|
||||
|
||||
private ColorButton channelB;
|
||||
|
||||
boolean inOutShowIn = false;
|
||||
@@ -98,18 +98,18 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
nextFilterB = MultiIconButton.createRightArrowButton(gui, NEXT_FILTER_ID, x, y);
|
||||
|
||||
x = 66;
|
||||
x = 66;
|
||||
channelB = new ColorButton(gui, ID_CHANNEL, x, y);
|
||||
channelB.setColorIndex(0);
|
||||
channelB.setToolTipHeading(EnderIO.lang.localize("gui.conduit.item.channel"));
|
||||
|
||||
|
||||
filterUpgradeTooltip = new GuiToolTip(new Rectangle(x - 21 - 18 * 2, customTop + 3 + 16, 18, 18), EnderIO.lang.localize("gui.conduit.item.filterupgrade")) {
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasFilterUpgrades(isInputVisible()) && super.shouldDraw();
|
||||
}
|
||||
};
|
||||
speedUpgradeTooltip = new GuiToolTip(new Rectangle(x - 21 - 18, customTop + 3 + 16, 18, 18), EnderIO.lang.localize("gui.conduit.item.speedupgrade"), EnderIO.lang.localize("gui.conduit.item.speedupgrade2")) {
|
||||
speedUpgradeTooltip = new GuiToolTip(new Rectangle(x - 21 - 18*2, customTop + 3 + 16 + 36, 18, 18), EnderIO.lang.localize("gui.conduit.item.speedupgrade"), EnderIO.lang.localize("gui.conduit.item.speedupgrade2")) {
|
||||
@Override
|
||||
public boolean shouldDraw() {
|
||||
return !gui.getContainer().hasSpeedUpgrades() && super.shouldDraw();
|
||||
@@ -130,7 +130,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
x += channelB.getWidth() + 4;
|
||||
priLeft = x - 8;
|
||||
|
||||
|
||||
rsB = new RedstoneModeButton(gui, ID_REDSTONE_BUTTON, x, y, new IRedstoneModeControlable() {
|
||||
|
||||
@Override
|
||||
@@ -167,8 +167,8 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
loopB.setPaintSelectedBorder(false);
|
||||
|
||||
priorityTooltip = new GuiToolTip(new Rectangle(priLeft + 9, y, priWidth, 16), EnderIO.lang.localize("gui.conduit.item.priority"));
|
||||
|
||||
x = priLeft + priWidth + 9;
|
||||
|
||||
x = priLeft + priWidth + 9;
|
||||
priUpB = MultiIconButton.createAddButton(gui, ID_PRIORITY_UP, x, y);
|
||||
priDownB = MultiIconButton.createMinusButton(gui, ID_PRIORITY_DOWN, x, y+8);
|
||||
|
||||
@@ -212,7 +212,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
|
||||
ConnectionMode mode = con.getConnectionMode(gui.getDir());
|
||||
if(mode == ConnectionMode.INPUT) {
|
||||
showInput = true;
|
||||
showInput = true;
|
||||
} else if(mode == ConnectionMode.OUTPUT) {
|
||||
showOutput = true;
|
||||
} else if(mode == ConnectionMode.IN_OUT) {
|
||||
@@ -257,7 +257,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
return;
|
||||
}
|
||||
boolean outputActive = (mode == ConnectionMode.IN_OUT && !inOutShowIn) || (mode == ConnectionMode.OUTPUT);
|
||||
|
||||
|
||||
if(!outputActive) {
|
||||
|
||||
rsB.onGuiInit();
|
||||
@@ -286,12 +286,12 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
priDownB.onGuiInit();
|
||||
gui.addToolTip(priorityTooltip);
|
||||
}
|
||||
|
||||
|
||||
int chanCol;
|
||||
if(!outputActive) {
|
||||
chanCol = itemConduit.getInputColor(gui.getDir()).ordinal();
|
||||
} else {
|
||||
chanCol = itemConduit.getOutputColor(gui.getDir()).ordinal();
|
||||
chanCol = itemConduit.getInputColor(gui.getDir()).ordinal();
|
||||
} else {
|
||||
chanCol = itemConduit.getOutputColor(gui.getDir()).ordinal();
|
||||
}
|
||||
channelB.onGuiInit();
|
||||
channelB.setColorIndex(chanCol);
|
||||
@@ -324,12 +324,12 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
sendFilterChange();
|
||||
} else if(guiButton.id == ID_CHANNEL) {
|
||||
|
||||
DyeColor col = DyeColor.values()[channelB.getColorIndex()];
|
||||
DyeColor col = DyeColor.values()[channelB.getColorIndex()];
|
||||
if(isInputVisible()) {
|
||||
itemConduit.setInputColor(gui.getDir(), col);
|
||||
} else {
|
||||
itemConduit.setOutputColor(gui.getDir(), col);
|
||||
}
|
||||
}
|
||||
sendFilterChange();
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int x, int y, int par3) {
|
||||
public void mouseClicked(int x, int y, int par3) {
|
||||
super.mouseClicked(x, y, par3);
|
||||
if(filterGui != null) {
|
||||
filterGui.mouseClicked(x, y, par3);
|
||||
@@ -351,7 +351,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
}
|
||||
|
||||
private boolean isInputVisible() {
|
||||
ConnectionMode mode = con.getConnectionMode(gui.getDir());
|
||||
ConnectionMode mode = con.getConnectionMode(gui.getDir());
|
||||
return (mode == ConnectionMode.IN_OUT && inOutShowIn) || (mode == ConnectionMode.INPUT);
|
||||
}
|
||||
|
||||
@@ -388,9 +388,9 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
//draw speed upgrade slot
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
gui.bindGuiTexture(1);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + 9 + 18, gui.getGuiTop() + 46, 94, 238, 18, 18);
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + 9, gui.getGuiTop() + 46 +18 +18, 94, 238, 18, 18);
|
||||
}
|
||||
|
||||
|
||||
//filter upgrade slot
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
gui.bindGuiTexture(1);
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemBigItemFilter extends ItemBasicItemFilter {
|
||||
|
||||
public static ItemBigItemFilter create() {
|
||||
ItemBigItemFilter result = new ItemBigItemFilter();
|
||||
result.init();
|
||||
return result;
|
||||
}
|
||||
|
||||
private final IIcon[] icons;
|
||||
|
||||
protected ItemBigItemFilter() {
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemBigFilterUpgrade.unlocalisedName);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setMaxStackSize(64);
|
||||
icons = new IIcon[2];
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemBigFilterUpgrade.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemFilter createFilterFromStack(ItemStack stack) {
|
||||
int damage = MathHelper.clamp_int(stack.getItemDamage(), 0, 1);
|
||||
ItemFilter filter;
|
||||
if(damage == 0) {
|
||||
filter = new ItemFilterBig(24, false);
|
||||
} else {
|
||||
filter = new ItemFilterBig(24, true);
|
||||
}
|
||||
if(stack.stackTagCompound != null && stack.stackTagCompound.hasKey("filter")) {
|
||||
filter.readFromNBT(stack.stackTagCompound.getCompoundTag("filter"));
|
||||
}
|
||||
return filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
icons[0] = IIconRegister.registerIcon("enderio:filterUpgradeBig");
|
||||
icons[1] = IIconRegister.registerIcon("enderio:filterUpgradeBigAdvanced");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 1);
|
||||
return i == 0 ? "enderio.filterUpgradeBig" : "enderio.filterUpgradeBigAdvanced";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,11 +45,12 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
boolean sticky = false;
|
||||
FuzzyMode fuzzyMode = FuzzyMode.DISABLED;
|
||||
|
||||
int numItems;
|
||||
ItemStack[] items;
|
||||
|
||||
final List<int[]> oreIds;
|
||||
|
||||
private boolean isAdvanced;
|
||||
private boolean isAdvanced;
|
||||
|
||||
public void copyFrom(ItemFilter o) {
|
||||
isBlacklist = o.isBlacklist;
|
||||
@@ -67,13 +68,14 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
public ItemFilter() {
|
||||
this(5, false);
|
||||
}
|
||||
|
||||
|
||||
public ItemFilter(boolean advanced) {
|
||||
this(advanced ? 10 : 5, advanced);
|
||||
}
|
||||
|
||||
private ItemFilter(int numItems, boolean isAdvanced) {
|
||||
public ItemFilter(int numItems, boolean isAdvanced) {
|
||||
this.isAdvanced = isAdvanced;
|
||||
this.numItems = numItems;
|
||||
items = new ItemStack[numItems];
|
||||
oreIds = new ArrayList<int[]>(numItems);
|
||||
for(int i=0;i<numItems;i++) {
|
||||
@@ -119,7 +121,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
matched = false;
|
||||
} else if(matchNBT && !isNBTMatch(item, it)) {
|
||||
matched = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!matched && useOreDict && isOreDicMatch(i, item)) {
|
||||
matched = true;
|
||||
@@ -147,10 +149,10 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private boolean isNBTMatch(ItemStack filter, ItemStack item)
|
||||
{
|
||||
if (filter.stackTagCompound == null && item.stackTagCompound == null) return true;
|
||||
@@ -163,7 +165,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
return filterTag.equals(itemTag);
|
||||
}
|
||||
|
||||
private int[] getCachedIds(int filterItemIndex) {
|
||||
private int[] getCachedIds(int filterItemIndex) {
|
||||
int[] res = oreIds.get(filterItemIndex);
|
||||
if(res == null) {
|
||||
ItemStack item = items[filterItemIndex];
|
||||
@@ -248,6 +250,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
nbtRoot.setBoolean("sticky", sticky);
|
||||
nbtRoot.setBoolean("isAdvanced", isAdvanced);
|
||||
nbtRoot.setByte("fuzzyMode", (byte) fuzzyMode.ordinal());
|
||||
nbtRoot.setInteger("numItems", numItems);
|
||||
|
||||
int i = 0;
|
||||
for (ItemStack item : items) {
|
||||
@@ -279,14 +282,17 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
sticky = nbtRoot.getBoolean("sticky");
|
||||
isAdvanced = nbtRoot.getBoolean("isAdvanced");
|
||||
fuzzyMode = FuzzyMode.values()[nbtRoot.getByte("fuzzyMode") & 255];
|
||||
numItems = nbtRoot.getInteger("numItems");
|
||||
|
||||
if(numItems<10 && isAdvanced) numItems = 10;
|
||||
else if(numItems<5 && !isAdvanced) numItems = 5;
|
||||
|
||||
int numItems = isAdvanced ? 10 : 5;
|
||||
items = new ItemStack[numItems];
|
||||
oreIds.clear();
|
||||
for(int i=0;i<numItems;i++) {
|
||||
oreIds.add(null);
|
||||
}
|
||||
for (int i = 0; i < numItems; i++) {
|
||||
for (int i = 0; i < numItems; i++) {
|
||||
NBTBase tag = nbtRoot.getTag("item" + i);
|
||||
if(tag instanceof NBTTagCompound) {
|
||||
items[i] = ItemStack.loadItemStackFromNBT((NBTTagCompound) tag);
|
||||
@@ -366,7 +372,7 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
public void markDirty() {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -391,8 +397,8 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
public void createGhostSlots(List<GhostSlot> slots, int xOffset, int yOffset, Runnable cb) {
|
||||
int topY = yOffset;
|
||||
int leftX = xOffset;
|
||||
int index = 0;
|
||||
int numRows = isAdvanced ? 2 : 1;
|
||||
int index = 0;
|
||||
int numRows = (int) Math.ceil(items.length/5);
|
||||
for (int row = 0; row < numRows; ++row) {
|
||||
for (int col = 0; col < 5; ++col) {
|
||||
int x = leftX + col * 18;
|
||||
@@ -404,14 +410,14 @@ public class ItemFilter implements IInventory, IItemFilter {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotCount() {
|
||||
public int getSlotCount() {
|
||||
return getSizeInventory();
|
||||
}
|
||||
|
||||
public boolean isAdvanced() {
|
||||
public boolean isAdvanced() {
|
||||
return isAdvanced;
|
||||
}
|
||||
|
||||
|
||||
public boolean isDefault() {
|
||||
return !isAdvanced && !isValid() && isBlacklist == DEFAULT_BLACKLIST &&
|
||||
matchMeta == DEFAULT_META &&
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
package crazypants.enderio.conduit.item.filter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.enderio.core.client.gui.widget.GhostSlot;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.conduit.gui.GuiExternalConnection;
|
||||
import crazypants.enderio.conduit.gui.item.BasicItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.BigItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.IItemFilterGui;
|
||||
import crazypants.enderio.conduit.gui.item.ItemConduitFilterContainer;
|
||||
import crazypants.enderio.conduit.item.IItemConduit;
|
||||
|
||||
public class ItemFilterBig extends ItemFilter {
|
||||
|
||||
public ItemFilterBig() {
|
||||
this(24,false);
|
||||
}
|
||||
|
||||
public ItemFilterBig(int numItems, boolean isAdvanced) {
|
||||
super(numItems, isAdvanced);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return "Big Item Filter";
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IItemFilterGui getGui(GuiExternalConnection gui, IItemConduit itemConduit, boolean isInput) {
|
||||
ItemConduitFilterContainer cont = new ItemConduitFilterContainer(itemConduit, gui.getDir(), isInput);
|
||||
BigItemFilterGui bigItemFilterGui = new BigItemFilterGui(gui, cont, !isInput);
|
||||
bigItemFilterGui.createFilterSlots();
|
||||
return bigItemFilterGui;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createGhostSlots(List<GhostSlot> slots, int xOffset, int yOffset, Runnable cb) {
|
||||
int topY = yOffset;
|
||||
int leftX = xOffset;
|
||||
int index = 0;
|
||||
int numRows = (int) Math.ceil(items.length/8);
|
||||
for (int row = 0; row < numRows; ++row) {
|
||||
for (int col = 0; col < 8; ++col) {
|
||||
int x = leftX + col * 18;
|
||||
int y = topY + row * 20;
|
||||
slots.add(new ItemFilterGhostSlot(index, x, y, cb));
|
||||
index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlotCount() {
|
||||
return getSizeInventory();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// return "ItemFilter [isBlacklist=" + isBlacklist + ", matchMeta=" + matchMeta + ", matchNBT=" + matchNBT + ", useOreDict=" + useOreDict + ", sticky="
|
||||
// + sticky + ", items=" + Arrays.toString(items) + ", oreIds=" + Arrays.toString(oreIds) + ", isAdvanced=" + isAdvanced + "]";
|
||||
return "Big"+super.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduit.name(), "enderio:itemPowerConduit"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduit.name() + "Enhanced", "enderio:itemPowerConduitEnhanced"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduit.name() + "Ender", "enderio:itemPowerConduitEnder")
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduit.name() + "Ender", "enderio:itemPowerConduitEnder"),
|
||||
};
|
||||
|
||||
public static ItemPowerConduit create() {
|
||||
@@ -35,6 +35,10 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
super(ModObject.itemPowerConduit, subtypes);
|
||||
}
|
||||
|
||||
protected ItemPowerConduit(ModObject modObject, ItemConduitSubtype[] subtypes) {
|
||||
super(modObject, subtypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IPowerConduit.class;
|
||||
@@ -56,7 +60,7 @@ public class ItemPowerConduit extends AbstractItemConduit {
|
||||
ICapacitor cap = PowerConduit.getCapacitors()[itemStack.getItemDamage()];
|
||||
list.add(PREFIX + PowerDisplayUtil.formatPower(cap.getMaxEnergyExtracted()) + POSTFIX);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
|
||||
@@ -47,22 +47,22 @@ import crazypants.enderio.tool.ToolUtil;
|
||||
public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
|
||||
|
||||
private static ICapacitor[] capacitors;
|
||||
|
||||
static final String[] POSTFIX = new String[] { "", "Enhanced", "Ender" };
|
||||
static final String[] POSTFIX = new String[] { "", "Enhanced", "Ender"};
|
||||
|
||||
static ICapacitor[] getCapacitors() {
|
||||
if(capacitors == null) {
|
||||
capacitors = new BasicCapacitor[] {
|
||||
new BasicCapacitor(Config.powerConduitTierOneRF, Config.powerConduitTierOneRF),
|
||||
new BasicCapacitor(Config.powerConduitTierTwoRF, Config.powerConduitTierTwoRF),
|
||||
new BasicCapacitor(Config.powerConduitTierThreeRF, Config.powerConduitTierThreeRF)
|
||||
new BasicCapacitor(Config.powerConduitTierThreeRF, Config.powerConduitTierThreeRF),
|
||||
};
|
||||
}
|
||||
return capacitors;
|
||||
}
|
||||
|
||||
|
||||
static ItemStack createItemStackForSubtype(int subtype) {
|
||||
ItemStack result = new ItemStack(EnderIO.itemPowerConduit, 1, subtype);
|
||||
return result;
|
||||
@@ -75,8 +75,8 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (String pf : POSTFIX) {
|
||||
ICONS.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
ICONS.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT + pf));
|
||||
ICONS.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT + pf));
|
||||
ICONS.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
}
|
||||
ICONS.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
@@ -199,13 +199,13 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.values()[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void writeTypeSettingsToNbt(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
dataRoot.setShort("extractionSignalColor", (short)getExtractionSignalColor(dir).ordinal());
|
||||
@@ -240,9 +240,9 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
if(nbtRoot.hasKey("energyStored")) {
|
||||
nbtRoot.setInteger("energyStoredRF", (int)(nbtRoot.getFloat("energyStored") * 10));
|
||||
|
||||
|
||||
}
|
||||
setEnergyStored(nbtRoot.getInteger("energyStoredRF"));
|
||||
setEnergyStored(nbtRoot.getInteger("energyStoredRF"));
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "pRsMode." + dir.name();
|
||||
@@ -263,7 +263,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {
|
||||
public void onTick() {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -273,10 +273,10 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
@Override
|
||||
public void setEnergyStored(int energyStored) {
|
||||
energyStoredRF = MathHelper.clamp_int(energyStored, 0, getMaxEnergyStored());
|
||||
energyStoredRF = MathHelper.clamp_int(energyStored, 0, getMaxEnergyStored());
|
||||
}
|
||||
|
||||
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
@@ -293,8 +293,8 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
boolean res;
|
||||
if(mode == RedstoneControlMode.OFF) {
|
||||
//if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
res = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
//if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal) || (col == DyeColor.RED && mode.isConditionMet(mode, exSig));
|
||||
}
|
||||
@@ -375,7 +375,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
int freeSpace = getMaxEnergyStored() - getEnergyStored();
|
||||
int result = (int) Math.min(maxReceive, freeSpace);
|
||||
if(!simulate && result > 0) {
|
||||
setEnergyStored(getEnergyStored() + result);
|
||||
setEnergyStored(getEnergyStored() + result);
|
||||
|
||||
if(getBundle() != null) {
|
||||
if(recievedTicks == null) {
|
||||
@@ -422,10 +422,10 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
@Override
|
||||
public boolean canConnectToExternal(ForgeDirection direction, boolean ignoreDisabled) {
|
||||
IPowerInterface rec = getExternalPowerReceptor(direction);
|
||||
|
||||
|
||||
return rec != null && rec.canConduitConnect(direction);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canConnectToConduit(ForgeDirection direction, IConduit conduit) {
|
||||
boolean res = super.canConnectToConduit(direction, conduit);
|
||||
@@ -438,7 +438,7 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
if( !(conduit instanceof IPowerConduit)) {
|
||||
return false;
|
||||
}
|
||||
IPowerConduit pc = (IPowerConduit)conduit;
|
||||
IPowerConduit pc = (IPowerConduit)conduit;
|
||||
return pc.getMaxEnergyStored() == getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@@ -502,12 +502,12 @@ public class PowerConduit extends AbstractConduit implements IPowerConduit {
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForInputMode() {
|
||||
return ICONS.get(ICON_KEY_INPUT + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_KEY_INPUT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForOutputMode() {
|
||||
return ICONS.get(ICON_KEY_OUTPUT + POSTFIX[subtype]);
|
||||
return ICONS.get(ICON_KEY_OUTPUT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ public class PowerConduitNetwork extends AbstractConduitNetwork<IPowerConduit, I
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
NetworkPowerManager powerManager;
|
||||
public NetworkPowerManager powerManager;
|
||||
|
||||
private final Map<ReceptorKey, ReceptorEntry> powerReceptors = new HashMap<ReceptorKey, ReceptorEntry>();
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
package crazypants.enderio.conduit.power.endergy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.ItemPowerConduit;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
|
||||
public class ItemPowerConduitEndergy extends ItemPowerConduit {
|
||||
|
||||
private static String PREFIX;
|
||||
private static String POSTFIX;
|
||||
|
||||
static ItemConduitSubtype[] subtypes = new ItemConduitSubtype[] {
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Crude", "enderio:itemPowerConduitCrude"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Iron", "enderio:itemPowerConduitIron"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Aluminum", "enderio:itemPowerConduitAluminum"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Gold", "enderio:itemPowerConduitGold"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Copper", "enderio:itemPowerConduitCopper"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Silver", "enderio:itemPowerConduitSilver"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Electrum", "enderio:itemPowerConduitElectrum"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "EnergeticSilver", "enderio:itemPowerConduitEnergeticSilver"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Crystalline", "enderio:itemPowerConduitCrystalline"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "CrystallinePinkSlime", "enderio:itemPowerConduitCrystallinePinkSlime"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Melodic", "enderio:itemPowerConduitMelodic"),
|
||||
new ItemConduitSubtype(ModObject.itemPowerConduitEndergy.name() + "Stellar", "enderio:itemPowerConduitStellar"),
|
||||
|
||||
};
|
||||
|
||||
public static ItemPowerConduitEndergy create() {
|
||||
ItemPowerConduitEndergy result = new ItemPowerConduitEndergy();
|
||||
result.init();
|
||||
return result;
|
||||
}
|
||||
|
||||
protected ItemPowerConduitEndergy() {
|
||||
super(ModObject.itemPowerConduitEndergy, subtypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IPowerConduit.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IConduit createConduit(ItemStack stack, EntityPlayer player) {
|
||||
return new PowerConduitEndergy(stack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer par2EntityPlayer, List list, boolean par4) {
|
||||
if(PREFIX == null) {
|
||||
POSTFIX = " " + PowerDisplayUtil.abrevation() + PowerDisplayUtil.perTickStr();
|
||||
PREFIX = EnderIO.lang.localize("power.maxOutput") + " ";
|
||||
}
|
||||
ICapacitor cap = PowerConduitEndergy.getCapacitors()[itemStack.getItemDamage()];
|
||||
list.add(PREFIX + PowerDisplayUtil.formatPower(cap.getMaxEnergyExtracted()) + POSTFIX);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldHideFacades(ItemStack stack, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,559 @@
|
||||
package crazypants.enderio.conduit.power.endergy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumMap;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.common.util.DyeColor;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.AbstractConduit;
|
||||
import crazypants.enderio.conduit.AbstractConduitNetwork;
|
||||
import crazypants.enderio.conduit.ConduitUtil;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.IConduitBundle;
|
||||
import crazypants.enderio.conduit.RaytraceResult;
|
||||
import crazypants.enderio.conduit.geom.CollidableCache.CacheKey;
|
||||
import crazypants.enderio.conduit.geom.CollidableComponent;
|
||||
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduit;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.PacketConduitProbe;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.IPowerInterface;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
|
||||
import static crazypants.enderio.config.Config.powerConduitEndergyTiers;
|
||||
|
||||
public class PowerConduitEndergy extends PowerConduit {
|
||||
|
||||
static final Map<String, IIcon> ICONS = new HashMap<String, IIcon>();
|
||||
|
||||
private static ICapacitor[] capacitors;
|
||||
|
||||
static final String[] POSTFIX = new String[] { "Crude", "Iron", "Aluminum", "Gold", "Copper", "Silver", "Electrum", "EnergeticSilver", "Crystalline", "CrystallinePinkSlime", "Melodic", "Stellar"};
|
||||
|
||||
static ICapacitor[] getCapacitors() {
|
||||
if(capacitors == null) {
|
||||
capacitors = new BasicCapacitor[] {
|
||||
|
||||
new BasicCapacitor(powerConduitEndergyTiers[0]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[1]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[2]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[3]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[4]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[5]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[6]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[7]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[8]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[9]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[10]),
|
||||
new BasicCapacitor(powerConduitEndergyTiers[11])
|
||||
};
|
||||
}
|
||||
return capacitors;
|
||||
}
|
||||
|
||||
static ItemStack createItemStackForSubtype(int subtype) {
|
||||
ItemStack result = new ItemStack(EnderIO.itemPowerConduitEndergy, 1, subtype);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void initIcons() {
|
||||
IconUtil.addIconProvider(new IconUtil.IIconProvider() {
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (String pf : POSTFIX) {
|
||||
ICONS.put(ICON_KEY + pf, register.registerIcon(ICON_KEY + pf));
|
||||
ICONS.put(ICON_KEY_INPUT + pf, register.registerIcon(ICON_KEY_INPUT));
|
||||
ICONS.put(ICON_KEY_OUTPUT + pf, register.registerIcon(ICON_KEY_OUTPUT));
|
||||
ICONS.put(ICON_CORE_KEY + pf, register.registerIcon(ICON_CORE_KEY + pf));
|
||||
}
|
||||
ICONS.put(ICON_TRANSMISSION_KEY, register.registerIcon(ICON_TRANSMISSION_KEY));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTextureType() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public static final float WIDTH = 0.075f;
|
||||
public static final float HEIGHT = 0.075f;
|
||||
|
||||
public static final Vector3d MIN = new Vector3d(0.5f - WIDTH, 0.5 - HEIGHT, 0.5 - WIDTH);
|
||||
public static final Vector3d MAX = new Vector3d(MIN.x + WIDTH, MIN.y + HEIGHT, MIN.z + WIDTH);
|
||||
|
||||
public static final BoundingBox BOUNDS = new BoundingBox(MIN, MAX);
|
||||
|
||||
protected PowerConduitNetwork network;
|
||||
|
||||
private int energyStoredRF;
|
||||
|
||||
private int subtype;
|
||||
|
||||
protected final EnumMap<ForgeDirection, RedstoneControlMode> rsModes = new EnumMap<ForgeDirection, RedstoneControlMode>(ForgeDirection.class);
|
||||
protected final EnumMap<ForgeDirection, DyeColor> rsColors = new EnumMap<ForgeDirection, DyeColor>(ForgeDirection.class);
|
||||
|
||||
protected EnumMap<ForgeDirection, Long> recievedTicks;
|
||||
|
||||
private final Map<ForgeDirection, Integer> externalRedstoneSignals = new HashMap<ForgeDirection, Integer>();
|
||||
|
||||
private boolean redstoneStateDirty = true;
|
||||
|
||||
public PowerConduitEndergy() {
|
||||
}
|
||||
|
||||
public PowerConduitEndergy(int meta) {
|
||||
this.subtype = meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getConnectionsDirty() {
|
||||
return connectionsDirty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(EntityPlayer player, RaytraceResult res, List<RaytraceResult> all) {
|
||||
DyeColor col = DyeColor.getColorFromDye(player.getCurrentEquippedItem());
|
||||
if(ConduitUtil.isProbeEquipped(player)) {
|
||||
if(!player.worldObj.isRemote) {
|
||||
new PacketConduitProbe().sendInfoMessage(player, this);
|
||||
}
|
||||
return true;
|
||||
} else if(col != null && res.component != null && isColorBandRendered(res.component.dir)) {
|
||||
setExtractionSignalColor(res.component.dir, col);
|
||||
return true;
|
||||
} else if(ToolUtil.isToolEquipped(player)) {
|
||||
if(!getBundle().getEntity().getWorldObj().isRemote) {
|
||||
if(res != null && res.component != null) {
|
||||
ForgeDirection connDir = res.component.dir;
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(res.movingObjectPosition.sideHit);
|
||||
if(connDir == ForgeDirection.UNKNOWN || connDir == faceHit) {
|
||||
if(getConnectionMode(faceHit) == ConnectionMode.DISABLED) {
|
||||
setConnectionMode(faceHit, getNextConnectionMode(faceHit));
|
||||
return true;
|
||||
}
|
||||
// Attempt to join networks
|
||||
return ConduitUtil.joinConduits(this, faceHit);
|
||||
} else if(externalConnections.contains(connDir)) {
|
||||
setConnectionMode(connDir, getNextConnectionMode(connDir));
|
||||
return true;
|
||||
} else if(containsConduitConnection(connDir)) {
|
||||
ConduitUtil.disconectConduits(this, connDir);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isColorBandRendered(ForgeDirection dir) {
|
||||
return getConnectionMode(dir) != ConnectionMode.DISABLED && getExtractionRedstoneMode(dir) != RedstoneControlMode.IGNORE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapacitor getCapacitor() {
|
||||
return getCapacitors()[subtype];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionRedstoneMode(RedstoneControlMode mode, ForgeDirection dir) {
|
||||
rsModes.put(dir, mode);
|
||||
setClientStateDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneControlMode getExtractionRedstoneMode(ForgeDirection dir) {
|
||||
RedstoneControlMode res = rsModes.get(dir);
|
||||
if(res == null) {
|
||||
res = RedstoneControlMode.IGNORE;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionSignalColor(ForgeDirection dir, DyeColor col) {
|
||||
rsColors.put(dir, col);
|
||||
setClientStateDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DyeColor getExtractionSignalColor(ForgeDirection dir) {
|
||||
DyeColor res = rsColors.get(dir);
|
||||
if(res == null) {
|
||||
res = DyeColor.RED;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readTypeSettings(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
setExtractionSignalColor(dir, DyeColor.values()[dataRoot.getShort("extractionSignalColor")]);
|
||||
setExtractionRedstoneMode(RedstoneControlMode.values()[dataRoot.getShort("extractionRedstoneMode")], dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeTypeSettingsToNbt(ForgeDirection dir, NBTTagCompound dataRoot) {
|
||||
dataRoot.setShort("extractionSignalColor", (short)getExtractionSignalColor(dir).ordinal());
|
||||
dataRoot.setShort("extractionRedstoneMode", (short)getExtractionRedstoneMode(dir).ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtRoot) {
|
||||
super.writeToNBT(nbtRoot);
|
||||
nbtRoot.setShort("subtype", (short) subtype);
|
||||
nbtRoot.setInteger("energyStoredRF", energyStoredRF);
|
||||
|
||||
for (Entry<ForgeDirection, RedstoneControlMode> entry : rsModes.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("pRsMode." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
|
||||
for (Entry<ForgeDirection, DyeColor> entry : rsColors.entrySet()) {
|
||||
if(entry.getValue() != null) {
|
||||
short ord = (short) entry.getValue().ordinal();
|
||||
nbtRoot.setShort("pRsCol." + entry.getKey().name(), ord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtRoot, short nbtVersion) {
|
||||
super.readFromNBT(nbtRoot, nbtVersion);
|
||||
subtype = nbtRoot.getShort("subtype");
|
||||
|
||||
if(nbtRoot.hasKey("energyStored")) {
|
||||
nbtRoot.setInteger("energyStoredRF", (int)(nbtRoot.getFloat("energyStored") * 10));
|
||||
|
||||
}
|
||||
setEnergyStored(nbtRoot.getInteger("energyStoredRF"));
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
String key = "pRsMode." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if(ord >= 0 && ord < RedstoneControlMode.values().length) {
|
||||
rsModes.put(dir, RedstoneControlMode.values()[ord]);
|
||||
}
|
||||
}
|
||||
key = "pRsCol." + dir.name();
|
||||
if(nbtRoot.hasKey(key)) {
|
||||
short ord = nbtRoot.getShort(key);
|
||||
if(ord >= 0 && ord < DyeColor.values().length) {
|
||||
rsColors.put(dir, DyeColor.values()[ord]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored() {
|
||||
return energyStoredRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnergyStored(int energyStored) {
|
||||
energyStoredRF = MathHelper.clamp_int(energyStored, 0, getMaxEnergyStored());
|
||||
}
|
||||
|
||||
|
||||
private boolean isRedstoneEnabled(ForgeDirection dir) {
|
||||
boolean result;
|
||||
RedstoneControlMode mode = getExtractionRedstoneMode(dir);
|
||||
if(mode == RedstoneControlMode.NEVER) {
|
||||
return false;
|
||||
}
|
||||
if(mode == RedstoneControlMode.IGNORE) {
|
||||
return true;
|
||||
}
|
||||
|
||||
DyeColor col = getExtractionSignalColor(dir);
|
||||
int signal = ConduitUtil.getInternalSignalForColor(getBundle(), col);
|
||||
int exSig = getExternalRedstoneSignalForDir(dir);
|
||||
boolean res;
|
||||
if(mode == RedstoneControlMode.OFF) {
|
||||
//if checking for no signal, must be no signal from both
|
||||
res = mode.isConditionMet(mode, signal) && (col != DyeColor.RED || mode.isConditionMet(mode, exSig));
|
||||
} else {
|
||||
//if checking for a signal, either is fine
|
||||
res = mode.isConditionMet(mode, signal) || (col == DyeColor.RED && mode.isConditionMet(mode, exSig));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private int getExternalRedstoneSignalForDir(ForgeDirection dir) {
|
||||
if(redstoneStateDirty) {
|
||||
externalRedstoneSignals.clear();
|
||||
redstoneStateDirty = false;
|
||||
}
|
||||
Integer cached = externalRedstoneSignals.get(dir);
|
||||
int result;
|
||||
if(cached == null) {
|
||||
TileEntity te = getBundle().getEntity();
|
||||
result = te.getWorldObj().getStrongestIndirectPower(te.xCoord, te.yCoord, te.zCoord);
|
||||
externalRedstoneSignals.put(dir, result);
|
||||
} else {
|
||||
result = cached;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyRecieved(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConnectionMode(dir);
|
||||
if(mode == ConnectionMode.OUTPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
}
|
||||
return getCapacitor().getMaxEnergyReceived();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyExtracted(ForgeDirection dir) {
|
||||
ConnectionMode mode = getConnectionMode(dir);
|
||||
if(mode == ConnectionMode.INPUT || mode == ConnectionMode.DISABLED || !isRedstoneEnabled(dir)) {
|
||||
return 0;
|
||||
}
|
||||
if(recievedRfThisTick(dir)) {
|
||||
return 0;
|
||||
}
|
||||
return getCapacitor().getMaxEnergyExtracted();
|
||||
}
|
||||
|
||||
private boolean recievedRfThisTick(ForgeDirection dir) {
|
||||
if(recievedTicks == null || dir == null || recievedTicks.get(dir) == null || getBundle() == null || getBundle().getWorld() == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
long curTick = getBundle().getWorld().getTotalWorldTime();
|
||||
long recT = recievedTicks.get(dir);
|
||||
if(curTick - recT <= 5) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onNeighborBlockChange(Block blockId) {
|
||||
redstoneStateDirty = true;
|
||||
if(network != null && network.powerManager != null) {
|
||||
network.powerManager.receptorsChanged();
|
||||
}
|
||||
return super.onNeighborBlockChange(blockId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setConnectionMode(ForgeDirection dir, ConnectionMode mode) {
|
||||
super.setConnectionMode(dir, mode);
|
||||
recievedTicks = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ForgeDirection from, int maxReceive, boolean simulate) {
|
||||
if(getMaxEnergyRecieved(from) == 0 || maxReceive <= 0) {
|
||||
return 0;
|
||||
}
|
||||
int freeSpace = getMaxEnergyStored() - getEnergyStored();
|
||||
int result = (int) Math.min(maxReceive, freeSpace);
|
||||
if(!simulate && result > 0) {
|
||||
setEnergyStored(getEnergyStored() + result);
|
||||
|
||||
if(getBundle() != null) {
|
||||
if(recievedTicks == null) {
|
||||
recievedTicks = new EnumMap<ForgeDirection, Long>(ForgeDirection.class);
|
||||
}
|
||||
recievedTicks.put(from, getBundle().getWorld().getTotalWorldTime());
|
||||
}
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectEnergy(ForgeDirection from) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ForgeDirection from) {
|
||||
return getEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractConduitNetwork<?, ?> getNetwork() {
|
||||
return network;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setNetwork(AbstractConduitNetwork<?, ?> network) {
|
||||
this.network = (PowerConduitNetwork) network;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToExternal(ForgeDirection direction, boolean ignoreDisabled) {
|
||||
IPowerInterface rec = getExternalPowerReceptor(direction);
|
||||
|
||||
return rec != null && rec.canConduitConnect(direction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectToConduit(ForgeDirection direction, IConduit conduit) {
|
||||
boolean res = super.canConnectToConduit(direction, conduit);
|
||||
if(!res) {
|
||||
return false;
|
||||
}
|
||||
if(Config.powerConduitCanDifferentTiersConnect) {
|
||||
return res;
|
||||
}
|
||||
if( !(conduit instanceof IPowerConduit)) {
|
||||
return false;
|
||||
}
|
||||
IPowerConduit pc = (IPowerConduit)conduit;
|
||||
return pc.getMaxEnergyStored() == getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionAdded(ForgeDirection direction) {
|
||||
super.externalConnectionAdded(direction);
|
||||
if(network != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
network.powerReceptorAdded(this, direction, te.xCoord + direction.offsetX, te.yCoord + direction.offsetY, te.zCoord + direction.offsetZ,
|
||||
getExternalPowerReceptor(direction));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void externalConnectionRemoved(ForgeDirection direction) {
|
||||
super.externalConnectionRemoved(direction);
|
||||
if(network != null) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
network.powerReceptorRemoved(te.xCoord + direction.offsetX, te.yCoord + direction.offsetY, te.zCoord + direction.offsetZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPowerInterface getExternalPowerReceptor(ForgeDirection direction) {
|
||||
TileEntity te = bundle.getEntity();
|
||||
World world = te.getWorldObj();
|
||||
if(world == null) {
|
||||
return null;
|
||||
}
|
||||
TileEntity test = world.getTileEntity(te.xCoord + direction.offsetX, te.yCoord + direction.offsetY, te.zCoord + direction.offsetZ);
|
||||
if(test == null) {
|
||||
return null;
|
||||
}
|
||||
if(test instanceof IConduitBundle) {
|
||||
return null;
|
||||
}
|
||||
return PowerHandlerUtil.create(test);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack createItem() {
|
||||
return createItemStackForSubtype(subtype);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IConduit> getBaseConduitType() {
|
||||
return IPowerConduit.class;
|
||||
}
|
||||
|
||||
// Rendering
|
||||
@Override
|
||||
public IIcon getTextureForState(CollidableComponent component) {
|
||||
if(component.dir == ForgeDirection.UNKNOWN) {
|
||||
return ICONS.get(ICON_CORE_KEY + POSTFIX[subtype]);
|
||||
}
|
||||
if(COLOR_CONTROLLER_ID.equals(component.data)) {
|
||||
return IconUtil.whiteTexture;
|
||||
}
|
||||
return ICONS.get(ICON_KEY + POSTFIX[subtype]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForInputMode() {
|
||||
return ICONS.get(ICON_KEY_INPUT + POSTFIX[subtype]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTextureForOutputMode() {
|
||||
return ICONS.get(ICON_KEY_OUTPUT + POSTFIX[subtype]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getTransmitionTextureForState(CollidableComponent component) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<CollidableComponent> createCollidables(CacheKey key) {
|
||||
Collection<CollidableComponent> baseCollidables = super.createCollidables(key);
|
||||
if(key.dir == ForgeDirection.UNKNOWN) {
|
||||
return baseCollidables;
|
||||
}
|
||||
|
||||
BoundingBox bb = ConduitGeometryUtil.instance.createBoundsForConnectionController(key.dir, key.offset);
|
||||
CollidableComponent cc = new CollidableComponent(IPowerConduit.class, bb, key.dir, COLOR_CONTROLLER_ID);
|
||||
|
||||
List<CollidableComponent> result = new ArrayList<CollidableComponent>();
|
||||
result.addAll(baseCollidables);
|
||||
result.add(cc);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored() {
|
||||
return getCapacitors()[subtype].getMaxEnergyStored();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean displayPower() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public final class Config {
|
||||
public static boolean useSneakMouseWheelYetaWrench = true;
|
||||
public static boolean useSneakRightClickYetaWrench = false;
|
||||
public static int yetaWrenchOverlayMode = 0;
|
||||
|
||||
|
||||
public static boolean itemConduitUsePhyscialDistance = false;
|
||||
|
||||
public static int enderFluidConduitExtractRate = 200;
|
||||
@@ -157,11 +157,13 @@ public final class Config {
|
||||
public static int enderIoRange = 8;
|
||||
public static boolean enderIoMeAccessEnabled = true;
|
||||
|
||||
public static double[] darkSteelPowerDamgeAbsorptionRatios = {0.5, 0.6, 0.75, 0.95};
|
||||
public static double[] darkSteelPowerDamgeAbsorptionRatios = {0.5, 0.6, 0.7, 0.85, 0.95};
|
||||
public static int darkSteelPowerStorageBase = 100000;
|
||||
public static int darkSteelPowerStorageLevelOne = 150000;
|
||||
public static int darkSteelPowerStorageLevelTwo = 250000;
|
||||
public static int darkSteelPowerStorageLevelThree = 1000000;
|
||||
public static int darkSteelPowerStorageLevelFour = 2500000;
|
||||
|
||||
|
||||
public static float darkSteelSpeedOneWalkModifier = 0.1f;
|
||||
public static float darkSteelSpeedTwoWalkMultiplier = 0.2f;
|
||||
@@ -225,6 +227,7 @@ public final class Config {
|
||||
public static int darkSteelUpgradePowerOneCost = 10;
|
||||
public static int darkSteelUpgradePowerTwoCost = 15;
|
||||
public static int darkSteelUpgradePowerThreeCost = 20;
|
||||
public static int darkSteelUpgradePowerFourCost = 25;
|
||||
|
||||
public static int darkSteelGliderCost = 10;
|
||||
public static double darkSteelGliderHorizontalSpeed = 0.03;
|
||||
@@ -250,6 +253,9 @@ public final class Config {
|
||||
public static int darkSteelSolarOneCost = 15;
|
||||
public static int darkSteelSolarTwoGen = 40;
|
||||
public static int darkSteelSolarTwoCost = 30;
|
||||
public static int darkSteelSolarThreeGen = 160;
|
||||
public static int darkSteelSolarThreeCost = 40;
|
||||
|
||||
public static boolean darkSteelSolarChargeOthers = true;
|
||||
|
||||
public static float darkSteelAnvilDamageChance = 0.024f;
|
||||
@@ -266,9 +272,19 @@ public final class Config {
|
||||
|
||||
public static int maxPhotovoltaicOutputRF = 10;
|
||||
public static int maxPhotovoltaicAdvancedOutputRF = 40;
|
||||
public static int maxPhotovoltaicVibrantOutputRF = 160;
|
||||
|
||||
public static int zombieGeneratorRfPerTick = 80;
|
||||
public static int zombieGeneratorTicksPerBucketFuel = 10000;
|
||||
public static int zombieGeneratorTicksPerBucketFuel = 12000;
|
||||
|
||||
public static int frankenzombieGeneratorRfPerTick = 120;
|
||||
public static int frankenzombieGeneratorTicksPerBucketFuel = 12000;
|
||||
|
||||
public static int enderGeneratorRfPerTick = 360;
|
||||
public static int enderGeneratorTicksPerBucketFuel = 96000;
|
||||
|
||||
public static double[] zombieGeneratorsEnergyMultipliers = {1f,2f,3f,5f,8f,13f,21f};
|
||||
public static double[] zombieGeneratorsBurnTimeMultipliers = {0.5f,1f/1.5f};
|
||||
|
||||
public static int stirlingGeneratorBaseRfPerTick = 20;
|
||||
public static float stirlingGeneratorEnergyMultiplierT1 = 1f;
|
||||
@@ -278,6 +294,10 @@ public final class Config {
|
||||
public static float stirlingGeneratorBurnTimeMultiplierT2 = 1f / 1.5f;
|
||||
public static float stirlingGeneratorBurnTimeMultiplierT3 = 1f / 1.5f;
|
||||
|
||||
public static double[] stirlingGeneratorEnergyMultipliers = {1f,2f,3f,5f,8f,13f,21f};
|
||||
public static double[] stirlingGeneratorBurnTimeMultipliers = {0.5f,1f/1.5f};
|
||||
|
||||
|
||||
public static boolean combustionGeneratorUseOpaqueModel = true;
|
||||
|
||||
public static boolean addFuelTooltipsToAllFluidContainers = true;
|
||||
@@ -336,7 +356,7 @@ public final class Config {
|
||||
public static boolean magnetAllowDeactivatedInBaublesSlot = false;
|
||||
public static boolean magnetAllowPowerExtraction = false;
|
||||
public static String magnetBaublesType = "AMULET";
|
||||
|
||||
|
||||
public static boolean useCombustionGenModel = false;
|
||||
|
||||
public static int crafterRfPerCraft = 2500;
|
||||
@@ -417,6 +437,8 @@ public final class Config {
|
||||
public static int soulBinderReanimationLevels = 10;
|
||||
public static int soulBinderEnderCystalRF = 100000;
|
||||
public static int soulBinderEnderCystalLevels = 10;
|
||||
public static int soulBinderPrecientCystalRF = 100000;
|
||||
public static int soulBinderPrecientCystalLevels = 10;
|
||||
public static int soulBinderAttractorCystalRF = 100000;
|
||||
public static int soulBinderAttractorCystalLevels = 10;
|
||||
public static int soulBinderEnderRailRF = 100000;
|
||||
@@ -427,6 +449,7 @@ public final class Config {
|
||||
public static int powerConduitTierOneRF = 640;
|
||||
public static int powerConduitTierTwoRF = 5120;
|
||||
public static int powerConduitTierThreeRF = 20480;
|
||||
public static int[] powerConduitEndergyTiers = {20, 40, 80, 160, 320, 1280, 2560, 10240, 40960, 81920, 327680, 2000000000};
|
||||
public static boolean powerConduitOutputMJ = true;
|
||||
|
||||
public static int sliceAndSpliceLevelOnePowerPerTickRF = 80;
|
||||
@@ -505,7 +528,8 @@ public final class Config {
|
||||
public static float inventoryPanelExtractCostPerItem = 12.0f;
|
||||
public static float inventoryPanelExtractCostPerOperation = 32.0f;
|
||||
|
||||
|
||||
|
||||
|
||||
public static void load(FMLPreInitializationEvent event) {
|
||||
PacketHandler.INSTANCE.registerMessage(PacketConfigSync.class, PacketConfigSync.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
|
||||
@@ -597,6 +621,9 @@ public final class Config {
|
||||
.getInt(powerConduitTierTwoRF);
|
||||
powerConduitTierThreeRF = config.get(sectionPower.name, "powerConduitTierThreeRF", powerConduitTierThreeRF, "The maximum IO for the tier 3 power conduit")
|
||||
.getInt(powerConduitTierThreeRF);
|
||||
powerConduitEndergyTiers = config.get(sectionPower.name, "powerConduitTiersEndergy", powerConduitEndergyTiers, "The maximum IO for the endergy power conduit")
|
||||
.getIntList();
|
||||
|
||||
powerConduitCanDifferentTiersConnect = config
|
||||
.getBoolean("powerConduitCanDifferentTiersConnect", sectionPower.name, powerConduitCanDifferentTiersConnect,
|
||||
"If set to false power conduits of different tiers cannot be connected. in this case a block such as a cap. bank is needed to bridge different tiered networks");
|
||||
@@ -816,6 +843,8 @@ public final class Config {
|
||||
"Amount of power stored by dark steel items with a level 2 upgrade.").getInt(darkSteelPowerStorageLevelTwo);
|
||||
darkSteelPowerStorageLevelThree = config.get(sectionDarkSteel.name, "darkSteelPowerStorageLevelThree", darkSteelPowerStorageLevelThree,
|
||||
"Amount of power stored by dark steel items with a level 3 upgrade.").getInt(darkSteelPowerStorageLevelThree);
|
||||
darkSteelPowerStorageLevelFour = config.get(sectionDarkSteel.name, "darkSteelPowerStorageLevelFour", darkSteelPowerStorageLevelFour,
|
||||
"Amount of power stored by dark steel items with a level 4 upgrade.").getInt(darkSteelPowerStorageLevelFour);
|
||||
|
||||
darkSteelUpgradeVibrantCost = config.get(sectionDarkSteel.name, "darkSteelUpgradeVibrantCost", darkSteelUpgradeVibrantCost,
|
||||
"Number of levels required for the 'Empowered.").getInt(darkSteelUpgradeVibrantCost);
|
||||
@@ -825,6 +854,8 @@ public final class Config {
|
||||
"Number of levels required for the 'Power 2.").getInt(darkSteelUpgradePowerTwoCost);
|
||||
darkSteelUpgradePowerThreeCost = config.get(sectionDarkSteel.name, "darkSteelUpgradePowerThreeCost", darkSteelUpgradePowerThreeCost,
|
||||
"Number of levels required for the 'Power 3' upgrade.").getInt(darkSteelUpgradePowerThreeCost);
|
||||
darkSteelUpgradePowerFourCost = config.get(sectionDarkSteel.name, "darkSteelUpgradePowerFourCost", darkSteelUpgradePowerFourCost,
|
||||
"Number of levels required for the 'Power 4' upgrade.").getInt(darkSteelUpgradePowerFourCost);
|
||||
|
||||
darkSteelJumpOneCost = config.get(sectionDarkSteel.name, "darkSteelJumpOneCost", darkSteelJumpOneCost,
|
||||
"Number of levels required for the 'Jump 1' upgrade.").getInt(darkSteelJumpOneCost);
|
||||
@@ -1030,22 +1061,46 @@ public final class Config {
|
||||
zombieGeneratorTicksPerBucketFuel = config.get(sectionPower.name, "zombieGeneratorTicksPerMbFuel", zombieGeneratorTicksPerBucketFuel,
|
||||
"The number of ticks one bucket of fuel lasts.").getInt(zombieGeneratorTicksPerBucketFuel);
|
||||
|
||||
frankenzombieGeneratorRfPerTick = config.get(sectionPower.name, "frankenzombieGeneratorRfPerTick", frankenzombieGeneratorRfPerTick,
|
||||
"The amount of power generated per tick.").getInt(frankenzombieGeneratorRfPerTick);
|
||||
frankenzombieGeneratorTicksPerBucketFuel = config.get(sectionPower.name, "frankenzombieGeneratorTicksPerMbFuel", frankenzombieGeneratorTicksPerBucketFuel,
|
||||
"The number of ticks one bucket of fuel lasts.").getInt(frankenzombieGeneratorTicksPerBucketFuel);
|
||||
|
||||
enderGeneratorRfPerTick = config.get(sectionPower.name, "enderGeneratorRfPerTick", enderGeneratorRfPerTick,
|
||||
"The amount of power generated per tick.").getInt(enderGeneratorRfPerTick);
|
||||
enderGeneratorTicksPerBucketFuel = config.get(sectionPower.name, "enderGeneratorTicksPerMbFuel", enderGeneratorTicksPerBucketFuel,
|
||||
"The number of ticks one bucket of fuel lasts.").getInt(enderGeneratorTicksPerBucketFuel);
|
||||
|
||||
zombieGeneratorsEnergyMultipliers = config.get(sectionPower.name, "zombieGeneratorsEnergyMultipliers",
|
||||
zombieGeneratorsEnergyMultipliers, "Energy multipliers for the Zombie-Type Generators").getDoubleList();
|
||||
|
||||
zombieGeneratorsBurnTimeMultipliers = config.get(sectionPower.name, "zombieGeneratorsBurnTimeMultipliers",
|
||||
zombieGeneratorsBurnTimeMultipliers, "Burn time multipliers for the Zombie-Type Generators").getDoubleList();
|
||||
|
||||
|
||||
stirlingGeneratorBaseRfPerTick = config.get(sectionPower.name, "stirlingGeneratorBaseRfPerTick", stirlingGeneratorBaseRfPerTick,
|
||||
"The amount of power generated per tick.").getInt(stirlingGeneratorBaseRfPerTick);
|
||||
|
||||
stirlingGeneratorEnergyMultiplierT1 = (float) config.get(sectionPower.name, "stirlingGeneratorEnergyMultiplierT1",
|
||||
stirlingGeneratorEnergyMultiplierT1, "Energy multiplier for the Stirling Generator, Tier 1 machine").getDouble();
|
||||
stirlingGeneratorEnergyMultiplierT1, "[Deprecated]Energy multiplier for the Stirling Generator, Tier 1 machine").getDouble();
|
||||
stirlingGeneratorEnergyMultiplierT2 = (float) config.get(sectionPower.name, "stirlingGeneratorEnergyMultiplierT2",
|
||||
stirlingGeneratorEnergyMultiplierT2, "Energy multiplier for the Stirling Generator, Tier 2 machine").getDouble();
|
||||
stirlingGeneratorEnergyMultiplierT2, "[Deprecated]Energy multiplier for the Stirling Generator, Tier 2 machine").getDouble();
|
||||
stirlingGeneratorEnergyMultiplierT3 = (float) config.get(sectionPower.name, "stirlingGeneratorEnergyMultiplierT3",
|
||||
stirlingGeneratorEnergyMultiplierT3, "Energy multiplier for the Stirling Generator, Tier 3 machine").getDouble();
|
||||
stirlingGeneratorEnergyMultiplierT3, "[Deprecated]Energy multiplier for the Stirling Generator, Tier 3 machine").getDouble();
|
||||
|
||||
stirlingGeneratorEnergyMultipliers = config.get(sectionPower.name, "stirlingGeneratorEnergyMultipliers",
|
||||
stirlingGeneratorEnergyMultipliers, "Energy multipliers for the Stirling Generator").getDoubleList();
|
||||
|
||||
stirlingGeneratorBurnTimeMultiplierT1 = (float) config.get(sectionPower.name, "stirlingGeneratorBurnTimeMultiplierT1",
|
||||
stirlingGeneratorBurnTimeMultiplierT1, "Burn time multiplier for the Stirling Generator, Tier 1 machine").getDouble();
|
||||
stirlingGeneratorBurnTimeMultiplierT1, "[Deprecated]Burn time multiplier for the Stirling Generator, Tier 1 machine").getDouble();
|
||||
stirlingGeneratorBurnTimeMultiplierT2 = (float) config.get(sectionPower.name, "stirlingGeneratorBurnTimeMultiplierT2",
|
||||
stirlingGeneratorBurnTimeMultiplierT2, "Burn time multiplier for the Stirling Generator, Tier 2 machine").getDouble();
|
||||
stirlingGeneratorBurnTimeMultiplierT2, "[Deprecated]Burn time multiplier for the Stirling Generator, Tier 2 machine").getDouble();
|
||||
stirlingGeneratorBurnTimeMultiplierT3 = (float) config.get(sectionPower.name, "stirlingGeneratorBurnTimeMultiplierT3",
|
||||
stirlingGeneratorBurnTimeMultiplierT3, "Burn time multiplier for the Stirling Generator, Tier 3 machine").getDouble();
|
||||
stirlingGeneratorBurnTimeMultiplierT3, "[Deprecated]Burn time multiplier for the Stirling Generator, Tier 3 machine").getDouble();
|
||||
|
||||
stirlingGeneratorBurnTimeMultipliers = config.get(sectionPower.name, "stirlingGeneratorBurnTimeMultipliers",
|
||||
stirlingGeneratorBurnTimeMultipliers, "Burn time multipliers for the Stirling Generator").getDoubleList();
|
||||
|
||||
|
||||
addFuelTooltipsToAllFluidContainers = config.get(sectionPersonal.name, "addFuelTooltipsToAllFluidContainers", addFuelTooltipsToAllFluidContainers,
|
||||
"If true, the RF/t and burn time of the fuel will be displayed in all tooltips for fluid containers with fuel.").getBoolean(
|
||||
@@ -1097,7 +1152,7 @@ public final class Config {
|
||||
"The amount of saplings the farm has to have in reserve to switch to shearing all leaves. If there are less " +
|
||||
"saplings in store, it will only shear part the leaves and break the others for spalings. Set this to 0 to " +
|
||||
"always shear all leaves.").getInt(farmSaplingReserveAmount);
|
||||
|
||||
|
||||
combustionGeneratorUseOpaqueModel = config.get(sectionAesthetic.name, "combustionGeneratorUseOpaqueModel", combustionGeneratorUseOpaqueModel,
|
||||
"If set to true: fluid will not be shown in combustion generator tanks. Improves FPS. ").getBoolean(combustionGeneratorUseOpaqueModel);
|
||||
|
||||
@@ -1115,18 +1170,18 @@ public final class Config {
|
||||
|
||||
magnetAllowInMainInventory = config.get(sectionMagnet.name, "magnetAllowInMainInventory", magnetAllowInMainInventory,
|
||||
"If true the magnet will also work in the main inventory, not just the hotbar").getBoolean(magnetAllowInMainInventory);
|
||||
|
||||
|
||||
magnetAllowInBaublesSlot = config.get(sectionMagnet.name, "magnetAllowInBaublesSlot", magnetAllowInBaublesSlot,
|
||||
"If true the magnet can be put into the 'amulet' Baubles slot (requires Baubles to be installed)").getBoolean(magnetAllowInBaublesSlot);
|
||||
magnetAllowDeactivatedInBaublesSlot = config.get(sectionMagnet.name, "magnetAllowDeactivatedInBaublesSlot", magnetAllowDeactivatedInBaublesSlot,
|
||||
"If true the magnet can be put into the 'amulet' Baubles slot even if switched off (requires Baubles to be installed and magnetAllowInBaublesSlot to be on)").getBoolean(magnetAllowDeactivatedInBaublesSlot);
|
||||
|
||||
|
||||
magnetAllowPowerExtraction = config.get(sectionMagnet.name, "magnetAllowPowerExtraction", magnetAllowPowerExtraction,
|
||||
"If true the magnet can be used as a battery.").getBoolean(magnetAllowPowerExtraction);
|
||||
|
||||
magnetBaublesType = config.get(sectionMagnet.name, "magnetBaublesType", magnetBaublesType,
|
||||
"The BaublesType the magnet should be, 'AMULET', 'RING' or 'BELT' (requires Baubles to be installed and magnetAllowInBaublesSlot to be on)").getString();
|
||||
|
||||
|
||||
useCombustionGenModel = config.get(sectionAesthetic.name, "useCombustionGenModel", useCombustionGenModel,
|
||||
"If set to true: WIP Combustion Generator model will be used").getBoolean(useCombustionGenModel);
|
||||
|
||||
@@ -1206,7 +1261,7 @@ public final class Config {
|
||||
"Allows OC conduits. Only has an effect with OpenComputers installed.");
|
||||
enableOCConduitsAnimatedTexture = config.getBoolean("enableOCConduitsAnimatedTexture", sectionItems.name,
|
||||
enableOCConduitsAnimatedTexture, "Use the animated texture for OC conduits.");
|
||||
|
||||
|
||||
soulVesselBlackList = config.getStringList("soulVesselBlackList", sectionSoulBinder.name, soulVesselBlackList,
|
||||
"Entities listed here will can not be captured in a Soul Vial");
|
||||
|
||||
@@ -1225,6 +1280,8 @@ public final class Config {
|
||||
"The number of RF required to to re-animated a mob head.").getInt(soulBinderReanimationRF);
|
||||
soulBinderEnderCystalRF = config.get(sectionSoulBinder.name, "soulBinderEnderCystalRF", soulBinderEnderCystalRF,
|
||||
"The number of RF required to create an ender crystal.").getInt(soulBinderEnderCystalRF);
|
||||
soulBinderPrecientCystalRF = config.get(sectionSoulBinder.name, "soulBinderPrecientCystalRF", soulBinderPrecientCystalRF,
|
||||
"The number of RF required to create an precient crystal.").getInt(soulBinderPrecientCystalRF);
|
||||
soulBinderAttractorCystalRF = config.get(sectionSoulBinder.name, "soulBinderAttractorCystalRF", soulBinderAttractorCystalRF,
|
||||
"The number of RF required to create an attractor crystal.").getInt(soulBinderAttractorCystalRF);
|
||||
soulBinderEnderRailRF = config.get(sectionSoulBinder.name, "soulBinderEnderRailRF", soulBinderEnderRailRF,
|
||||
@@ -1234,6 +1291,8 @@ public final class Config {
|
||||
"The number of levels required to create an attractor crystal.").getInt(soulBinderAttractorCystalLevels);
|
||||
soulBinderEnderCystalLevels = config.get(sectionSoulBinder.name, "soulBinderEnderCystalLevels", soulBinderEnderCystalLevels,
|
||||
"The number of levels required to create an ender crystal.").getInt(soulBinderEnderCystalLevels);
|
||||
soulBinderPrecientCystalLevels = config.get(sectionSoulBinder.name, "soulBinderPrecientCystalLevels", soulBinderPrecientCystalLevels,
|
||||
"The number of levels required to create an precient crystal.").getInt(soulBinderPrecientCystalLevels);
|
||||
soulBinderReanimationLevels = config.get(sectionSoulBinder.name, "soulBinderReanimationLevels", soulBinderReanimationLevels,
|
||||
"The number of levels required to re-animate a mob head.").getInt(soulBinderReanimationLevels);
|
||||
soulBinderBrokenSpawnerLevels = config.get(sectionSoulBinder.name, "soulBinderBrokenSpawnerLevels", soulBinderBrokenSpawnerLevels,
|
||||
|
||||
@@ -89,7 +89,7 @@ public class EnchantmentSoulBound extends Enchantment implements IAdvancedEnchan
|
||||
// wait for that because gravestone mods also listen to this event. So we have
|
||||
// to fetch Baubles items ourselves here.
|
||||
// For the same reason we cannot put the items into Baubles slots.
|
||||
IInventory baubles = BaublesUtil.instance().getBaubles(evt.entityPlayer);
|
||||
/*IInventory baubles = BaublesUtil.instance().getBaubles(evt.entityPlayer);
|
||||
if (baubles != null) {
|
||||
for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
ItemStack item = baubles.getStackInSlot(i);
|
||||
@@ -99,7 +99,7 @@ public class EnchantmentSoulBound extends Enchantment implements IAdvancedEnchan
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// Galacticraft. Again we are too early for those items. We just dump the
|
||||
// stuff into the normal inventory to not have to keep a separate list.
|
||||
|
||||
@@ -1,28 +1,203 @@
|
||||
package crazypants.enderio.fluid;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import java.util.Random;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class BlockFluidEio extends BlockFluidClassic {
|
||||
|
||||
public static class FireWater extends BlockFluidEio {
|
||||
|
||||
protected FireWater(Fluid fluid, Material material) {
|
||||
super(fluid, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if (!world.isRemote){
|
||||
entity.setFire(50);
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 60;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class Hootch extends BlockFluidEio {
|
||||
|
||||
protected Hootch(Fluid fluid, Material material) {
|
||||
super(fluid, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if (!world.isRemote && entity instanceof EntityLivingBase)
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 150, 0, true));
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 60;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class RocketFuel extends BlockFluidEio {
|
||||
|
||||
protected RocketFuel(Fluid fluid, Material material) {
|
||||
super(fluid, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if (!world.isRemote && entity instanceof EntityLivingBase)
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.jump.id, 150, 3, true));
|
||||
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return 60;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class NutrientDistillation extends BlockFluidEio {
|
||||
|
||||
private static final String EIO_LAST_FOOD_BOOST = "eioLastFoodBoost";
|
||||
|
||||
protected NutrientDistillation(Fluid fluid, Material material) {
|
||||
super(fluid, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if (!world.isRemote && entity instanceof EntityLivingBase) {
|
||||
long time = entity.worldObj.getTotalWorldTime();
|
||||
EntityPlayerMP player = (EntityPlayerMP) entity;
|
||||
if(time % Config.nutrientFoodBoostDelay == 0 && player.getEntityData().getLong(EIO_LAST_FOOD_BOOST) != time) {
|
||||
player.getFoodStats().addStats(1, 0.1f);
|
||||
player.getEntityData().setLong(EIO_LAST_FOOD_BOOST, time);
|
||||
}
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class CloudSeedConcentrated extends BlockFluidEio {
|
||||
|
||||
protected CloudSeedConcentrated(Fluid fluid, Material material) {
|
||||
super(fluid, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if (!world.isRemote && entity instanceof EntityLivingBase) {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.blindness.id, 40, 0, true));
|
||||
}
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class VapourOfLevity extends BlockFluidEio {
|
||||
|
||||
private static final int[] COLORS = { 0x0c82d0, 0x90c8ec, 0x5174ed, 0x0d2f65, 0x4accee };
|
||||
|
||||
protected VapourOfLevity(Fluid fluid, Material material, int fogColor) {
|
||||
super(fluid, material);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
if (entity instanceof EntityPlayer || (!world.isRemote && entity instanceof EntityLivingBase)) {
|
||||
((EntityLivingBase) entity).motionY += 0.1;
|
||||
}
|
||||
super.onEntityCollidedWithBlock(world, x, y, z, entity);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if (rand.nextFloat() < .5f) {
|
||||
int col = COLORS[rand.nextInt(COLORS.length)];
|
||||
world.spawnParticle("reddust", x, y, z, (col >> 16 & 255) / 255d, (col >> 8 & 255) / 255d, (col & 255) / 255d);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static BlockFluidEio create(Fluid fluid, Material material) {
|
||||
BlockFluidEio res = new BlockFluidEio(fluid, material);
|
||||
res.init();
|
||||
@@ -76,28 +251,4 @@ public class BlockFluidEio extends BlockFluidClassic {
|
||||
return super.displaceIfPossible(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity) {
|
||||
if(entity.worldObj.isRemote) {
|
||||
super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, entity);
|
||||
return;
|
||||
}
|
||||
|
||||
if(this == EnderIO.blockFireWater) {
|
||||
entity.setFire(50);
|
||||
} else if(this == EnderIO.blockRocketFuel && entity instanceof EntityLivingBase) {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.jump.id, 150, 3, true));
|
||||
} else if(this == EnderIO.blockNutrientDistillation && entity instanceof EntityPlayerMP) {
|
||||
long time = entity.worldObj.getTotalWorldTime();
|
||||
EntityPlayerMP player = (EntityPlayerMP) entity;
|
||||
if(time % Config.nutrientFoodBoostDelay == 0 && player.getEntityData().getLong("eioLastFoodBoost") != time) {
|
||||
player.getFoodStats().addStats(1, 0.1f);
|
||||
player.getEntityData().setLong("eioLastFoodBoost", time);
|
||||
}
|
||||
} else if (this == EnderIO.blockHootch && entity instanceof EntityLivingBase) {
|
||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 150, 0, true));
|
||||
}
|
||||
|
||||
super.onEntityCollidedWithBlock(p_149670_1_, p_149670_2_, p_149670_3_, p_149670_4_, entity);
|
||||
}
|
||||
}
|
||||
@@ -1,32 +1,29 @@
|
||||
package crazypants.enderio.fluid;
|
||||
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
public class Fluids {
|
||||
|
||||
public static final String NUTRIENT_DISTILLATION_NAME = "nutrient_distillation";
|
||||
public static final String NUTRIENT_DISTILLATION = "nutrient_distillation";
|
||||
public static final String HOOTCH = "hootch";
|
||||
public static final String ROCKET_FUEL = "rocket_fuel";
|
||||
public static final String FIRE_WATER = "fire_water";
|
||||
public static final String LIQUID_SUNSHINE = "liquid_sunshine";
|
||||
public static final String CLOUD_SEED = "cloud_seed";
|
||||
public static final String CLOUD_SEED_CONCENTRATED = "cloud_seed_concentrated";
|
||||
public static final String ENDER_DISTILLATION = "ender_distillation";
|
||||
public static final String VAPOR_OF_LEVITY = "vapor_of_levity";
|
||||
|
||||
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 final String LIQUID_SUNSHINE_NAME = "liquid_sunshine";
|
||||
public static final String CLOUD_SEED_NAME = "cloud_seed";
|
||||
public static final String CLOUD_SEED_CONCENTRATED_NAME = "cloud_seed_concentrated";
|
||||
|
||||
public static String toCapactityString(IFluidTank tank) {
|
||||
if(tank == null) {
|
||||
return "0/0 " + MB();
|
||||
}
|
||||
return tank.getFluidAmount() + "/" + tank.getCapacity() + " " + MB();
|
||||
}
|
||||
|
||||
public static String MB() {
|
||||
return EnderIO.lang.localize("fluid.millibucket.abr");
|
||||
}
|
||||
public static String toCapactityString(IFluidTank tank) {
|
||||
if(tank == null) {
|
||||
return "0/0 " + MB();
|
||||
}
|
||||
return tank.getFluidAmount() + "/" + tank.getCapacity() + " " + MB();
|
||||
}
|
||||
|
||||
public static String MB() {
|
||||
return EnderIO.lang.localize("fluid.millibucket.abr");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -7,9 +7,11 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.MachinePart;
|
||||
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.enderio.material.Material.VIBRANT_CYSTAL;
|
||||
import static crazypants.util.RecipeUtil.addShaped;
|
||||
|
||||
@@ -17,12 +19,16 @@ public class ItemRecipes {
|
||||
|
||||
public static void addRecipes() {
|
||||
ItemStack basicGear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
ItemStack diode = new ItemStack(EnderIO.itemFrankenSkull,1,FrankenSkull.GUARDIAN_DIODE.ordinal());
|
||||
ItemStack sentient = new ItemStack(EnderIO.itemFrankenSkull,1,FrankenSkull.SENTIENT_ENDER.ordinal());
|
||||
String electricalSteel = ELECTRICAL_STEEL.getOreIngot();
|
||||
String conductiveIron = CONDUCTIVE_IRON.getOreIngot();
|
||||
String vibCry = VIBRANT_CYSTAL.oreDict;
|
||||
String enAlloy = ENERGETIC_ALLOY.getOreIngot();
|
||||
String darkSteel = DARK_STEEL.getOreIngot();
|
||||
String soularium = SOULARIUM.getOreIngot();
|
||||
String endSteel = END_STEEL.getOreIngot();
|
||||
String stellarAlloy = STELLAR_ALLOY.getOreIngot();
|
||||
|
||||
// Wrench
|
||||
ItemStack wrench = new ItemStack(EnderIO.itemYetaWench, 1, 0);
|
||||
@@ -39,6 +45,18 @@ public class ItemRecipes {
|
||||
addShaped(DarkSteelItems.itemDarkSteelLeggings.createItemStack(), "sss", "s s", "s s", 's', darkSteel);
|
||||
addShaped(DarkSteelItems.itemDarkSteelBoots.createItemStack(), "s s", "s s", 's', darkSteel);
|
||||
|
||||
//End Steel
|
||||
addShaped(DarkSteelItems.itemEndSteelHelmet.createItemStack(), "sss", "sds", 's', endSteel, 'd', diode);
|
||||
addShaped(DarkSteelItems.itemEndSteelChestplate.createItemStack(), "sds", "sss", "sss", 's', endSteel, 'd', diode);
|
||||
addShaped(DarkSteelItems.itemEndSteelLeggings.createItemStack(), "sss", "sds", "s s", 's', endSteel, 'd', diode);
|
||||
addShaped(DarkSteelItems.itemEndSteelBoots.createItemStack(), "s s", "sds", 's', endSteel, 'd', diode);
|
||||
|
||||
//Stellar
|
||||
addShaped(DarkSteelItems.itemStellarHelmet.createItemStack(), "sss", "sds", 's', stellarAlloy, 'd', sentient);
|
||||
addShaped(DarkSteelItems.itemStellarChestplate.createItemStack(), "sds", "sss", "sss", 's', stellarAlloy, 'd', sentient);
|
||||
addShaped(DarkSteelItems.itemStellarLeggings.createItemStack(), "sss", "sds", "s s", 's', stellarAlloy, 'd', sentient);
|
||||
addShaped(DarkSteelItems.itemStellarBoots.createItemStack(), "s s", "sds", 's', stellarAlloy, 'd', sentient);
|
||||
|
||||
ItemStack wing = new ItemStack(DarkSteelItems.itemGliderWing, 1, 0);
|
||||
addShaped(wing, " s", " sl", "sll", 's', darkSteel, 'l', Items.leather);
|
||||
addShaped(new ItemStack(DarkSteelItems.itemGliderWing, 1, 1), " s ", "wsw", " ", 's', darkSteel, 'w', wing);
|
||||
@@ -58,6 +76,7 @@ public class ItemRecipes {
|
||||
//XP Rod
|
||||
addShaped(new ItemStack(EnderIO.itemXpTransfer), " s", " v ", "s ", 's', soularium, 'v', enAlloy);
|
||||
|
||||
|
||||
// DS Tools
|
||||
addShaped(DarkSteelItems.itemDarkSteelSword.createItemStack(), " s ", " s ", " w ", 's', darkSteel, 'w', "stickWood");
|
||||
addShaped(DarkSteelItems.itemDarkSteelSword.createItemStack(), " s ", " s ", " w ", 's', darkSteel, 'w', "woodStick");
|
||||
@@ -65,5 +84,21 @@ public class ItemRecipes {
|
||||
addShaped(DarkSteelItems.itemDarkSteelPickaxe.createItemStack(), "sss", " w ", " w ", 's', darkSteel, 'w', "woodStick");
|
||||
addShaped(DarkSteelItems.itemDarkSteelAxe.createItemStack(), "ss ", "sw ", " w ", 's', darkSteel, 'w', "woodStick");
|
||||
addShaped(DarkSteelItems.itemDarkSteelAxe.createItemStack(), "ss ", "sw ", " w ", 's', darkSteel, 'w', "stickWood");
|
||||
|
||||
// ES Tools
|
||||
addShaped(DarkSteelItems.itemEndSteelSword.createItemStack(), " s ", " s ", " w ", 's', endSteel, 'w', "stickDarkSteel");
|
||||
addShaped(DarkSteelItems.itemEndSteelSword.createItemStack(), " s ", " s ", " w ", 's', endSteel, 'w', "itemDarkSteelRod");
|
||||
addShaped(DarkSteelItems.itemEndSteelPickaxe.createItemStack(), "sss", " w ", " w ", 's', endSteel, 'w', "stickDarkSteel");
|
||||
addShaped(DarkSteelItems.itemEndSteelPickaxe.createItemStack(), "sss", " w ", " w ", 's', endSteel, 'w', "itemDarkSteelRod");
|
||||
addShaped(DarkSteelItems.itemEndSteelAxe.createItemStack(), "ss ", "sw ", " w ", 's', endSteel, 'w', "stickDarkSteel");
|
||||
addShaped(DarkSteelItems.itemEndSteelAxe.createItemStack(), "ss ", "sw ", " w ", 's', endSteel, 'w', "itemDarkSteelRod");
|
||||
|
||||
// Stellar Tools
|
||||
addShaped(DarkSteelItems.itemStellarSword.createItemStack(), " s ", " s ", " e ", 's', stellarAlloy,'e', sentient, 'w', "itemDarkSteelRod");
|
||||
addShaped(DarkSteelItems.itemStellarPickaxe.createItemStack(), "sss", " e ", " w ", 's', stellarAlloy,'e', sentient, 'w', "stickDarkSteel");
|
||||
addShaped(DarkSteelItems.itemStellarPickaxe.createItemStack(), "sss", " e ", " w ", 's', stellarAlloy,'e', sentient, 'w', "itemDarkSteelRod");
|
||||
addShaped(DarkSteelItems.itemStellarAxe.createItemStack(), "ss ", "se ", " w ", 's', stellarAlloy,'e', sentient, 'w', "stickDarkSteel");
|
||||
addShaped(DarkSteelItems.itemStellarAxe.createItemStack(), "ss ", "se ", " w ", 's', stellarAlloy,'e', sentient, 'w', "itemDarkSteelRod");
|
||||
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ public class KeyTracker {
|
||||
}
|
||||
if(gogglesKey.isPressed()) {
|
||||
boolean isActive = !DarkSteelItems.itemDarkSteelHelmet.isGogglesUgradeActive();
|
||||
sendEnabledChatMessage("darksteel.upgrade.goggles", isActive);
|
||||
sendEnabledChatMessage("darksteel.upgrade.gogglesOfRevealing", isActive);
|
||||
DarkSteelItems.itemDarkSteelHelmet.setGogglesUgradeActive(isActive);
|
||||
}
|
||||
}
|
||||
@@ -223,7 +223,7 @@ public class KeyTracker {
|
||||
|
||||
private void handleNightVision() {
|
||||
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
|
||||
if(!DarkSteelController.instance.isNightVisionUpgradeEquipped(player)){
|
||||
if(!DarkSteelController.instance.isNightVisionUpgradeOrEnchEquipped(player)){
|
||||
return;
|
||||
}
|
||||
if(nightVisionKey.isPressed()) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.UUID;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.client.particle.EntityReddustFX;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.ai.attributes.IAttributeInstance;
|
||||
@@ -16,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -66,7 +68,7 @@ public class DarkSteelController {
|
||||
private final AttributeModifier[] sprintModifiers = new AttributeModifier[] {
|
||||
new AttributeModifier(new UUID(12879874982l, 320981923), "generic.movementSpeed", SpeedUpgrade.SPRINT_MULTIPLIERS[0], 1),
|
||||
new AttributeModifier(new UUID(12879874982l, 320981923), "generic.movementSpeed", SpeedUpgrade.SPRINT_MULTIPLIERS[1], 1),
|
||||
new AttributeModifier(new UUID (12879874982l, 320981923), "generic.movementSpeed", SpeedUpgrade.SPRINT_MULTIPLIERS[2], 1),
|
||||
new AttributeModifier(new UUID(12879874982l, 320981923), "generic.movementSpeed", SpeedUpgrade.SPRINT_MULTIPLIERS[2], 1),
|
||||
};
|
||||
|
||||
private final AttributeModifier swordDamageModifierPowered = new AttributeModifier(new UUID(63242325, 320981923), "Weapon modifier",
|
||||
@@ -119,19 +121,19 @@ public class DarkSteelController {
|
||||
public boolean isGlideActive(EntityPlayer player) {
|
||||
return isActive(player, Type.GLIDE);
|
||||
}
|
||||
|
||||
|
||||
public boolean isSpeedActive(EntityPlayer player) {
|
||||
return isActive(player, Type.SPEED);
|
||||
}
|
||||
|
||||
|
||||
public boolean isStepAssistActive(EntityPlayer player) {
|
||||
return isActive(player, Type.STEP_ASSIST);
|
||||
}
|
||||
|
||||
|
||||
public boolean isJumpActive(EntityPlayer player) {
|
||||
return isActive(player, Type.JUMP);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onPlayerTick(TickEvent.PlayerTickEvent event) {
|
||||
EntityPlayer player = event.player;
|
||||
@@ -149,9 +151,9 @@ public class DarkSteelController {
|
||||
updateGlide(player);
|
||||
|
||||
updateSwim(player);
|
||||
|
||||
|
||||
updateSolar(player);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -161,18 +163,18 @@ public class DarkSteelController {
|
||||
if (player.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ItemStack helm = player.getEquipmentInSlot(4);
|
||||
SolarUpgrade upgrade = SolarUpgrade.loadFromItem(helm);
|
||||
if(upgrade == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int RFperSecond = Math.round((float) upgrade.getRFPerSec() * TileEntitySolarPanel.calculateLightRatio(player.worldObj, MathHelper.floor_double(player.posX), MathHelper.floor_double(player.posY + 1), MathHelper.floor_double(player.posZ)));
|
||||
|
||||
|
||||
int leftover = RFperSecond % 20;
|
||||
boolean addExtraRF = player.worldObj.getTotalWorldTime() % 20 < leftover;
|
||||
|
||||
|
||||
int toAdd = (RFperSecond / 20) + (addExtraRF ? 1 : 0);
|
||||
|
||||
if(toAdd != 0) {
|
||||
@@ -186,7 +188,7 @@ public class DarkSteelController {
|
||||
}
|
||||
nextIndex = (nextIndex + 1) % 4;
|
||||
}
|
||||
|
||||
|
||||
player.getEntityData().setInteger("dsarmor:solar", nextIndex);
|
||||
}
|
||||
}
|
||||
@@ -284,7 +286,7 @@ public class DarkSteelController {
|
||||
|
||||
ItemStack leggings = player.getEquipmentInSlot(2);
|
||||
SpeedUpgrade speedUpgrade = SpeedUpgrade.loadFromItem(leggings);
|
||||
if(leggings != null && leggings.getItem() == DarkSteelItems.itemDarkSteelLeggings && speedUpgrade != null && isSpeedActive(player)) {
|
||||
if(leggings != null && DarkSteelItems.isArmorPart(leggings.getItem(),2) && speedUpgrade != null && isSpeedActive(player)) {
|
||||
|
||||
double horzMovement = Math.abs(player.distanceWalkedModified - player.prevDistanceWalkedModified);
|
||||
double costModifier = player.isSprinting() ? Config.darkSteelSprintPowerCost : Config.darkSteelWalkPowerCost;
|
||||
@@ -306,7 +308,7 @@ public class DarkSteelController {
|
||||
private void updateStepHeightAndFallDistance(EntityPlayer player) {
|
||||
ItemStack boots = player.getEquipmentInSlot(1);
|
||||
|
||||
if(boots != null && boots.getItem() == DarkSteelItems.itemDarkSteelBoots && !player.capabilities.allowFlying) {
|
||||
if(boots != null && DarkSteelItems.isArmorPart(boots.getItem(), 3) && !player.capabilities.allowFlying) {
|
||||
int costedDistance = (int) player.fallDistance;
|
||||
if(costedDistance > 0) {
|
||||
int energyCost = costedDistance * Config.darkSteelFallDistanceCost;
|
||||
@@ -319,7 +321,7 @@ public class DarkSteelController {
|
||||
}
|
||||
|
||||
JumpUpgrade jumpUpgrade = JumpUpgrade.loadFromItem(boots);
|
||||
if(jumpUpgrade != null && boots != null && boots.getItem() == DarkSteelItems.itemDarkSteelBoots && isStepAssistActive(player)) {
|
||||
if(jumpUpgrade != null && boots != null && DarkSteelItems.isArmorPart(boots.getItem(), 3) && isStepAssistActive(player)) {
|
||||
player.stepHeight = 1.0023F;
|
||||
} else if(player.stepHeight == 1.0023F) {
|
||||
player.stepHeight = 0.5001F;
|
||||
@@ -337,7 +339,7 @@ public class DarkSteelController {
|
||||
IEnergyContainerItem cont = (IEnergyContainerItem) stack.getItem();
|
||||
int used = cont.extractEnergy(stack, remaining, false);
|
||||
remaining -= used;
|
||||
if(remaining <= 0) {
|
||||
if(remaining <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -368,7 +370,7 @@ public class DarkSteelController {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onStartTracking(PlayerEvent.StartTracking event) {
|
||||
if (event.target instanceof EntityPlayerMP) {
|
||||
@@ -460,11 +462,11 @@ public class DarkSteelController {
|
||||
if (!isJumpActive(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
ItemStack boots = player.getEquipmentInSlot(1);
|
||||
JumpUpgrade jumpUpgrade = JumpUpgrade.loadFromItem(boots);
|
||||
|
||||
if(jumpUpgrade == null || boots == null || boots.getItem() != DarkSteelItems.itemDarkSteelBoots) {
|
||||
if(jumpUpgrade == null || boots == null || !DarkSteelItems.isArmorPart(boots.getItem(), 3)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -488,13 +490,13 @@ public class DarkSteelController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void updateNightvision(EntityPlayer player) {
|
||||
if(isNightVisionUpgradeEquipped(player) && nightVisionActive) {
|
||||
if(isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
|
||||
player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 210, 0, true));
|
||||
}
|
||||
if(!isNightVisionUpgradeEquipped(player) && nightVisionActive) {
|
||||
}
|
||||
if(!isNightVisionUpgradeOrEnchEquipped(player) && nightVisionActive) {
|
||||
nightVisionActive = false;
|
||||
removeNightvision = true;
|
||||
}
|
||||
@@ -504,16 +506,49 @@ public class DarkSteelController {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isNightVisionUpgradeEquipped(EntityPlayer player) {
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
return NightVisionUpgrade.loadFromItem(helmet) != null;
|
||||
// --- Thaumic Exploration Night Vision enchant support
|
||||
|
||||
private static int nightVisionEnchID = -6;
|
||||
|
||||
public static int getNightVisionEnchID() {
|
||||
if (nightVisionEnchID == -6) setNightVisionEnchID();
|
||||
return nightVisionEnchID;
|
||||
}
|
||||
|
||||
private static void setNightVisionEnchID() {
|
||||
for (Enchantment ench : Enchantment.enchantmentsList) {
|
||||
if (ench != null && ench.getName().equals("enchantment.nightVision")) {
|
||||
nightVisionEnchID = ench.effectId;
|
||||
return;
|
||||
}
|
||||
} nightVisionEnchID = -1;
|
||||
}
|
||||
|
||||
public boolean isNightVisionEnch(ItemStack helmet) {
|
||||
if (helmet == null) return false;
|
||||
NBTTagList stackEnch = helmet.getEnchantmentTagList();
|
||||
if (getNightVisionEnchID () >= 0 && stackEnch != null) {
|
||||
for (int i = 0; i < stackEnch.tagCount(); i++) {
|
||||
int id = stackEnch.getCompoundTagAt(i).getInteger("id");
|
||||
if (id == getNightVisionEnchID())
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---
|
||||
|
||||
public boolean isNightVisionUpgradeOrEnchEquipped(EntityPlayer player) {
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
return (NightVisionUpgrade.loadFromItem(helmet) != null || isNightVisionEnch(helmet));
|
||||
}
|
||||
|
||||
public void setNightVisionActive(boolean isNightVisionActive) {
|
||||
if(nightVisionActive && !isNightVisionActive) {
|
||||
removeNightvision = true;
|
||||
}
|
||||
this.nightVisionActive = isNightVisionActive;
|
||||
this.nightVisionActive = isNightVisionActive;
|
||||
}
|
||||
|
||||
public boolean isNightVisionActive() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
@@ -22,6 +23,22 @@ public class DarkSteelItems {
|
||||
public static ItemDarkSteelAxe itemDarkSteelAxe;
|
||||
public static ItemDarkSteelShears itemDarkSteelShears;
|
||||
|
||||
public static ItemEndSteelArmor itemEndSteelHelmet;
|
||||
public static ItemEndSteelArmor itemEndSteelChestplate;
|
||||
public static ItemEndSteelArmor itemEndSteelLeggings;
|
||||
public static ItemEndSteelArmor itemEndSteelBoots;
|
||||
public static ItemEndSteelSword itemEndSteelSword;
|
||||
public static ItemEndSteelPickaxe itemEndSteelPickaxe;
|
||||
public static ItemEndSteelAxe itemEndSteelAxe;
|
||||
|
||||
public static ItemStellarArmor itemStellarHelmet;
|
||||
public static ItemStellarArmor itemStellarChestplate;
|
||||
public static ItemStellarArmor itemStellarLeggings;
|
||||
public static ItemStellarArmor itemStellarBoots;
|
||||
public static ItemStellarSword itemStellarSword;
|
||||
public static ItemStellarPickaxe itemStellarPickaxe;
|
||||
public static ItemStellarAxe itemStellarAxe;
|
||||
|
||||
public static ItemMagnet itemMagnet;
|
||||
|
||||
private DarkSteelItems() {
|
||||
@@ -40,7 +57,36 @@ public class DarkSteelItems {
|
||||
itemDarkSteelAxe = ItemDarkSteelAxe.create();
|
||||
itemDarkSteelShears = ItemDarkSteelShears.create();
|
||||
|
||||
itemEndSteelHelmet = ItemEndSteelArmor.create(0);
|
||||
itemEndSteelChestplate = ItemEndSteelArmor.create(1);
|
||||
itemEndSteelLeggings = ItemEndSteelArmor.create(2);
|
||||
itemEndSteelBoots = ItemEndSteelArmor.create(3);
|
||||
|
||||
itemEndSteelSword = ItemEndSteelSword.create();
|
||||
itemEndSteelPickaxe = ItemEndSteelPickaxe.create();
|
||||
itemEndSteelAxe = ItemEndSteelAxe.create();
|
||||
|
||||
itemStellarHelmet = ItemStellarArmor.create(0);
|
||||
itemStellarChestplate = ItemStellarArmor.create(1);
|
||||
itemStellarLeggings = ItemStellarArmor.create(2);
|
||||
itemStellarBoots = ItemStellarArmor.create(3);
|
||||
|
||||
itemStellarSword = ItemStellarSword.create();
|
||||
itemStellarPickaxe = ItemStellarPickaxe.create();
|
||||
itemStellarAxe = ItemStellarAxe.create();
|
||||
|
||||
itemMagnet = ItemMagnet.create();
|
||||
|
||||
}
|
||||
|
||||
public static boolean isArmorPart(Item item, int type){
|
||||
switch(type){
|
||||
case 0:return item == itemDarkSteelHelmet||item == itemEndSteelHelmet||item == itemStellarHelmet;
|
||||
case 1:return item == itemDarkSteelChestplate||item == itemEndSteelChestplate||item == itemStellarChestplate;
|
||||
case 2:return item == itemDarkSteelLeggings||item == itemEndSteelLeggings||item == itemStellarLeggings;
|
||||
case 3:return item == itemDarkSteelBoots||item == itemEndSteelBoots||item == itemStellarBoots;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void addLoot() {
|
||||
@@ -70,5 +116,21 @@ public class DarkSteelItems {
|
||||
MinecraftForgeClient.registerItemRenderer(itemDarkSteelPickaxe, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemDarkSteelAxe, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemDarkSteelShears, dsr);
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(itemEndSteelBoots, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemEndSteelLeggings, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemEndSteelChestplate, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemEndSteelHelmet, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemEndSteelSword, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemEndSteelPickaxe, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemEndSteelAxe, dsr);
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(itemStellarBoots, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemStellarLeggings, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemStellarChestplate, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemStellarHelmet, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemStellarSword, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemStellarPickaxe, dsr);
|
||||
MinecraftForgeClient.registerItemRenderer(itemStellarAxe, dsr);
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,8 @@ import com.google.common.collect.ImmutableList;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IStellarItem;
|
||||
import crazypants.enderio.item.darksteel.upgrade.ApiaristArmorUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.GliderUpgrade;
|
||||
@@ -34,6 +36,7 @@ import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SwimUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.material.Alloy;
|
||||
import crazypants.enderio.material.endergy.AlloyEndergy;
|
||||
import crazypants.enderio.thaumcraft.ThaumcraftCompat;
|
||||
|
||||
public class DarkSteelRecipeManager {
|
||||
@@ -47,6 +50,7 @@ public class DarkSteelRecipeManager {
|
||||
upgrades.add(EnergyUpgrade.EMPOWERED_TWO);
|
||||
upgrades.add(EnergyUpgrade.EMPOWERED_THREE);
|
||||
upgrades.add(EnergyUpgrade.EMPOWERED_FOUR);
|
||||
upgrades.add(EnergyUpgrade.EMPOWERED_FIVE);
|
||||
upgrades.add(JumpUpgrade.JUMP_ONE);
|
||||
upgrades.add(JumpUpgrade.JUMP_TWO);
|
||||
upgrades.add(JumpUpgrade.JUMP_THREE);
|
||||
@@ -61,6 +65,7 @@ public class DarkSteelRecipeManager {
|
||||
upgrades.add(SpoonUpgrade.INSTANCE);
|
||||
upgrades.add(SolarUpgrade.SOLAR_ONE);
|
||||
upgrades.add(SolarUpgrade.SOLAR_TWO);
|
||||
upgrades.add(SolarUpgrade.SOLAR_THREE);
|
||||
if(Loader.isModLoaded("Thaumcraft")) {
|
||||
ThaumcraftCompat.loadUpgrades(upgrades);
|
||||
}
|
||||
@@ -79,9 +84,19 @@ public class DarkSteelRecipeManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if(evt.left.getItem() instanceof IDarkSteelItem && OreDictionaryHelper.hasName(evt.right, Alloy.DARK_STEEL.getOreIngot())) {
|
||||
if(evt.left.getItem() instanceof IStellarItem && OreDictionaryHelper.hasName(evt.right, AlloyEndergy.STELLAR_ALLOY.getOreIngot())) {
|
||||
handleRepair(evt);
|
||||
}
|
||||
|
||||
else if(evt.left.getItem() instanceof IEndSteelItem && OreDictionaryHelper.hasName(evt.right, Alloy.END_STEEL.getOreIngot())) {
|
||||
handleRepair(evt);
|
||||
}
|
||||
|
||||
else if(evt.left.getItem() instanceof IDarkSteelItem && OreDictionaryHelper.hasName(evt.right, Alloy.DARK_STEEL.getOreIngot())) {
|
||||
handleRepair(evt);
|
||||
} else {
|
||||
}
|
||||
|
||||
else {
|
||||
handleUpgrade(evt);
|
||||
}
|
||||
}
|
||||
@@ -89,23 +104,23 @@ public class DarkSteelRecipeManager {
|
||||
private void handleRepair(AnvilUpdateEvent evt) {
|
||||
ItemStack targetStack = evt.left;
|
||||
ItemStack ingots = evt.right;
|
||||
|
||||
|
||||
//repair event
|
||||
IDarkSteelItem targetItem = (IDarkSteelItem)targetStack.getItem();
|
||||
int maxIngots = targetItem.getIngotsRequiredForFullRepair();
|
||||
|
||||
|
||||
double damPerc = (double)targetStack.getItemDamage()/ targetStack.getMaxDamage();
|
||||
int requiredIngots = (int)Math.ceil(damPerc * maxIngots);
|
||||
if(ingots.stackSize > requiredIngots) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int damageAddedPerIngot = (int)Math.ceil((double)targetStack.getMaxDamage()/maxIngots);
|
||||
int totalDamageRemoved = damageAddedPerIngot * ingots.stackSize;
|
||||
|
||||
|
||||
ItemStack resultStack = targetStack.copy();
|
||||
resultStack.setItemDamage(Math.max(0, resultStack.getItemDamage() - totalDamageRemoved));
|
||||
|
||||
|
||||
evt.output = resultStack;
|
||||
evt.cost = ingots.stackSize + (int)Math.ceil(getEnchantmentRepairCost(resultStack)/2);
|
||||
}
|
||||
|
||||
@@ -3,5 +3,13 @@ package crazypants.enderio.item.darksteel;
|
||||
public interface IDarkSteelItem {
|
||||
|
||||
int getIngotsRequiredForFullRepair();
|
||||
|
||||
|
||||
public interface IEndSteelItem extends IDarkSteelItem {
|
||||
|
||||
}
|
||||
|
||||
public interface IStellarItem extends IEndSteelItem {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -99,24 +99,30 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
}
|
||||
|
||||
public static ItemDarkSteelArmor create(int armorType) {
|
||||
ItemDarkSteelArmor res = new ItemDarkSteelArmor(armorType);
|
||||
ItemDarkSteelArmor res = new ItemDarkSteelArmor(armorType);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
private final int powerPerDamagePoint;
|
||||
|
||||
protected ItemDarkSteelArmor(int armorType) {
|
||||
super(MATERIAL, 0, armorType);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
|
||||
String str = "darkSteel_" + NAMES[armorType];
|
||||
setUnlocalizedName(str);
|
||||
setTextureName(EnderIO.DOMAIN+ ":" + str);
|
||||
protected int powerPerDamagePoint;
|
||||
protected String name;
|
||||
|
||||
public ItemDarkSteelArmor(int armorType) {
|
||||
this(MATERIAL, "darkSteel", armorType);
|
||||
powerPerDamagePoint = Config.darkSteelPowerStorageBase / MATERIAL.getDurability(armorType);
|
||||
|
||||
}
|
||||
|
||||
public ItemDarkSteelArmor(ArmorMaterial mat, String name, int armorType) {
|
||||
super(mat, 0, armorType);
|
||||
this.name = name;
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
String str = name + "_" + NAMES[armorType];
|
||||
setUnlocalizedName(str);
|
||||
setTextureName(EnderIO.DOMAIN+ ":" + str);
|
||||
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
}
|
||||
@@ -131,7 +137,7 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FOUR.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
|
||||
|
||||
Iterator<IDarkSteelUpgrade> iter = DarkSteelRecipeManager.instance.recipeIterator();
|
||||
while (iter.hasNext()) {
|
||||
IDarkSteelUpgrade upgrade = iter.next();
|
||||
@@ -139,7 +145,7 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
upgrade.writeToItem(is);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
@@ -178,11 +184,11 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
list.add(str);
|
||||
}
|
||||
if(EnergyUpgrade.itemHasAnyPowerUpgrade(itemstack)) {
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item.darkSteel_armor.tooltip.line1"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item.darkSteel_armor.tooltip.line2"));
|
||||
if(itemstack.getItem() == DarkSteelItems.itemDarkSteelBoots) {
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item.darkSteel_boots.tooltip.line1"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item.darkSteel_boots.tooltip.line2"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item."+name+"_armor.tooltip.line1"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item."+name+"_armor.tooltip.line2"));
|
||||
if(DarkSteelItems.isArmorPart(itemstack.getItem(), 3)) {
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item."+name+"_boots.tooltip.line1"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item."+name+"_boots.tooltip.line2"));
|
||||
}
|
||||
}
|
||||
DarkSteelRecipeManager.instance.addAdvancedTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
@@ -196,9 +202,9 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
@Override
|
||||
public String getArmorTexture(ItemStack itemStack, Entity entity, int slot, String layer) {
|
||||
if(armorType == 2) {
|
||||
return "enderio:textures/models/armor/darkSteel_layer_2.png";
|
||||
return "enderio:textures/models/armor/"+name+"_layer_2.png";
|
||||
}
|
||||
return "enderio:textures/models/armor/darkSteel_layer_1.png";
|
||||
return "enderio:textures/models/armor/"+name+"_layer_1.png";
|
||||
}
|
||||
|
||||
public ItemStack createItemStack() {
|
||||
@@ -287,7 +293,7 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
@Override
|
||||
@Method(modid = "Thaumcraft")
|
||||
public int getVisDiscount(ItemStack stack, EntityPlayer player, Aspect aspect) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelHelmet) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0)) {
|
||||
return 0;
|
||||
}
|
||||
return GogglesOfRevealingUpgrade.isUpgradeEquipped(player) ? 5 : 0;
|
||||
@@ -312,7 +318,7 @@ public class ItemDarkSteelArmor extends ItemArmor implements IEnergyContainerIte
|
||||
@Override
|
||||
@Method(modid = "Forestry")
|
||||
public boolean canSeePollination(EntityPlayer player, ItemStack armor, boolean doSee) {
|
||||
if(armor == null || armor.getItem() != DarkSteelItems.itemDarkSteelHelmet) {
|
||||
if(armor == null || DarkSteelItems.isArmorPart(armor.getItem(), 0)) {
|
||||
return false;
|
||||
}
|
||||
return NaturalistEyeUpgrade.isUpgradeEquipped(player);
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ItemDarkSteelAxe extends ItemAxe implements IEnergyContainerItem, I
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemDarkSteelAxe;
|
||||
return equipped.getItem() instanceof ItemDarkSteelAxe;
|
||||
}
|
||||
|
||||
public static boolean isEquippedAndPowered(EntityPlayer player, int requiredPower) {
|
||||
@@ -71,34 +71,41 @@ public class ItemDarkSteelAxe extends ItemAxe implements IEnergyContainerItem, I
|
||||
return res;
|
||||
}
|
||||
|
||||
private int logOreId = -1;
|
||||
private final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
|
||||
protected int logOreId = -1;
|
||||
protected final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
protected String name;
|
||||
|
||||
|
||||
protected ItemDarkSteelAxe() {
|
||||
super(ItemDarkSteelSword.MATERIAL);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
String str = "darkSteel_axe";
|
||||
setUnlocalizedName(str);
|
||||
setTextureName(EnderIO.DOMAIN + ":" + str);
|
||||
this("darkSteel",ItemDarkSteelSword.MATERIAL);
|
||||
}
|
||||
|
||||
protected ItemDarkSteelAxe(String name, ToolMaterial mat) {
|
||||
super(mat);
|
||||
this.name = name;
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
String str = name+"_axe";
|
||||
setUnlocalizedName(str);
|
||||
setTextureName(EnderIO.DOMAIN + ":" + str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIngotsRequiredForFullRepair() {
|
||||
return 3;
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FOUR.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isDamaged(ItemStack stack) {
|
||||
return false;
|
||||
@@ -134,17 +141,17 @@ public class ItemDarkSteelAxe extends ItemAxe implements IEnergyContainerItem, I
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean doMultiHarvest(EntityPlayer player, World worldObj, BlockCoord bc, Block refBlock, int refMeta) {
|
||||
|
||||
private boolean doMultiHarvest(EntityPlayer player, World worldObj, BlockCoord bc, Block refBlock, int refMeta) {
|
||||
|
||||
Block block = worldObj.getBlock(bc.x, bc.y, bc.z);
|
||||
int meta = worldObj.getBlockMetadata(bc.x, bc.y, bc.z);
|
||||
ItemStack held = player.getCurrentEquippedItem();
|
||||
|
||||
|
||||
ArrayList<ItemStack> itemDrops = block.getDrops(worldObj, bc.x, bc.y, bc.z, meta, 0);
|
||||
float chance = ForgeEventFactory.fireBlockHarvesting(itemDrops, worldObj, refBlock, bc.x, bc.y, bc.z, refMeta,
|
||||
float chance = ForgeEventFactory.fireBlockHarvesting(itemDrops, worldObj, refBlock, bc.x, bc.y, bc.z, refMeta,
|
||||
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, held), 1,
|
||||
EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, held) != 0, player);
|
||||
|
||||
|
||||
worldObj.setBlockToAir(bc.x, bc.y, bc.z);
|
||||
boolean usedPower = false;
|
||||
if (itemDrops != null) {
|
||||
@@ -190,7 +197,7 @@ public class ItemDarkSteelAxe extends ItemAxe implements IEnergyContainerItem, I
|
||||
super.setDamage(stack, newDamage);
|
||||
} else {
|
||||
int damage = newDamage - oldDamage;
|
||||
|
||||
|
||||
if (!absorbDamageWithEnergy(stack, damage * Config.darkSteelAxePowerUsePerDamagePoint)) {
|
||||
super.setDamage(stack, newDamage);
|
||||
}
|
||||
@@ -221,7 +228,7 @@ public class ItemDarkSteelAxe extends ItemAxe implements IEnergyContainerItem, I
|
||||
|
||||
private boolean isLog(Block block, int meta) {
|
||||
if(logOreId == -1) {
|
||||
logOreId = OreDictionary.getOreID("logWood");
|
||||
logOreId = OreDictionary.getOreID("logWood");
|
||||
}
|
||||
int targetOreId = OreDictionary.getOreID(new ItemStack(block, 1, meta));
|
||||
//NB: Specifying the wildcard as meta is a work around for forge issue #1103
|
||||
@@ -279,9 +286,9 @@ public class ItemDarkSteelAxe extends ItemAxe implements IEnergyContainerItem, I
|
||||
list.add(str);
|
||||
}
|
||||
if(EnergyUpgrade.itemHasAnyPowerUpgrade(itemstack)) {
|
||||
list.add(EnderIO.lang.localize("item.darkSteel_axe.tooltip.multiHarvest"));
|
||||
list.add(EnderIO.lang.localize("item."+name+"_axe.tooltip.multiHarvest"));
|
||||
list.add(EnumChatFormatting.WHITE + "+" + Config.darkSteelAxeEffeciencyBoostWhenPowered + " "
|
||||
+ EnderIO.lang.localize("item.darkSteel_pickaxe.tooltip.effPowered"));
|
||||
+ EnderIO.lang.localize("item."+name+"_pickaxe.tooltip.effPowered"));
|
||||
}
|
||||
DarkSteelRecipeManager.instance.addAdvancedTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe implements IEnergyContaine
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemDarkSteelPickaxe;
|
||||
return equipped.getItem() instanceof ItemDarkSteelPickaxe;
|
||||
}
|
||||
|
||||
public static boolean isEquippedAndPowered(EntityPlayer player, int requiredPower) {
|
||||
@@ -65,15 +65,21 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe implements IEnergyContaine
|
||||
}
|
||||
|
||||
private long lastBlickTick = -1;
|
||||
protected String name;
|
||||
|
||||
public ItemDarkSteelPickaxe() {
|
||||
super(ItemDarkSteelSword.MATERIAL);
|
||||
public ItemDarkSteelPickaxe(String name, ToolMaterial mat) {
|
||||
super(mat);
|
||||
this.name = name;
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
String str = "darkSteel_pickaxe";
|
||||
String str = name+"_pickaxe";
|
||||
setUnlocalizedName(str);
|
||||
setTextureName(EnderIO.DOMAIN + ":" + str);
|
||||
}
|
||||
|
||||
public ItemDarkSteelPickaxe(){
|
||||
this("darkSteel",ItemDarkSteelSword.MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
@@ -153,7 +159,7 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe implements IEnergyContaine
|
||||
super.setDamage(stack, newDamage);
|
||||
} else {
|
||||
int damage = newDamage - oldDamage;
|
||||
|
||||
|
||||
if (!absorbDamageWithEnergy(stack, damage * Config.darkSteelPickPowerUsePerDamagePoint)) {
|
||||
super.setDamage(stack, newDamage);
|
||||
}
|
||||
@@ -171,7 +177,7 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe implements IEnergyContaine
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canHarvestBlock(Block block, ItemStack item) {
|
||||
if(hasSpoonUpgrade(item) && getEnergyStored(item) > 0) {
|
||||
@@ -283,10 +289,10 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe implements IEnergyContaine
|
||||
}
|
||||
if(EnergyUpgrade.itemHasAnyPowerUpgrade(itemstack)) {
|
||||
list.add(EnumChatFormatting.WHITE + "+" + Config.darkSteelPickEffeciencyBoostWhenPowered + " "
|
||||
+ EnderIO.lang.localize("item.darkSteel_pickaxe.tooltip.effPowered"));
|
||||
+ EnderIO.lang.localize("item."+name+"_pickaxe.tooltip.effPowered"));
|
||||
list.add(EnumChatFormatting.WHITE + "+" + Config.darkSteelPickEffeciencyObsidian + " "
|
||||
+ EnderIO.lang.localize("item.darkSteel_pickaxe.tooltip.effObs") + " ");
|
||||
list.add(EnumChatFormatting.WHITE + " " + "(" + EnderIO.lang.localize("item.darkSteel_pickaxe.tooltip.cost") + " "
|
||||
+ EnderIO.lang.localize("item."+name+"_pickaxe.tooltip.effObs") + " ");
|
||||
list.add(EnumChatFormatting.WHITE + " " + "(" + EnderIO.lang.localize("item."+name+"_pickaxe.tooltip.cost") + " "
|
||||
+ PowerDisplayUtil.formatPower(Config.darkSteelPickPowerUseObsidian) + " "
|
||||
+ PowerDisplayUtil.abrevation() + ")");
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class ItemDarkSteelShears extends ItemShears implements IEnergyContainerI
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemDarkSteelShears;
|
||||
return equipped.getItem() instanceof ItemDarkSteelShears;
|
||||
}
|
||||
|
||||
public static boolean isEquippedAndPowered(EntityPlayer player, int requiredPower) {
|
||||
@@ -66,18 +66,24 @@ public class ItemDarkSteelShears extends ItemShears implements IEnergyContainerI
|
||||
return res;
|
||||
}
|
||||
|
||||
private final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
private final EntityComparator entityComparator = new EntityComparator();
|
||||
protected final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
protected final EntityComparator entityComparator = new EntityComparator();
|
||||
protected String name;
|
||||
|
||||
protected ItemDarkSteelShears() {
|
||||
protected ItemDarkSteelShears(String name) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.setMaxDamage(this.getMaxDamage() * Config.darkSteelShearsDurabilityFactor);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
String str = "darkSteel_shears";
|
||||
String str = name+"_shears";
|
||||
setUnlocalizedName(str);
|
||||
setTextureName("enderIO:" + str);
|
||||
}
|
||||
|
||||
protected ItemDarkSteelShears() {
|
||||
this("darkSteel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIngotsRequiredForFullRepair() {
|
||||
return 2;
|
||||
@@ -265,9 +271,9 @@ public class ItemDarkSteelShears extends ItemShears implements IEnergyContainerI
|
||||
list.add(str);
|
||||
}
|
||||
if(EnergyUpgrade.itemHasAnyPowerUpgrade(itemstack)) {
|
||||
list.add(EnderIO.lang.localize("item.darkSteel_shears.tooltip.multiHarvest"));
|
||||
list.add(EnderIO.lang.localize("item."+name+"_shears.tooltip.multiHarvest"));
|
||||
list.add(EnumChatFormatting.WHITE + "+" + Config.darkSteelShearsEffeciencyBoostWhenPowered + " "
|
||||
+ EnderIO.lang.localize("item.darkSteel_pickaxe.tooltip.effPowered"));
|
||||
+ EnderIO.lang.localize("item."+name+"_pickaxe.tooltip.effPowered"));
|
||||
}
|
||||
DarkSteelRecipeManager.instance.addAdvancedTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemDarkSteelSword;
|
||||
return equipped.getItem() instanceof ItemDarkSteelSword;
|
||||
}
|
||||
|
||||
public static boolean isEquippedAndPowered(EntityPlayer player, int requiredPower) {
|
||||
@@ -74,18 +74,24 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte
|
||||
return res;
|
||||
}
|
||||
|
||||
private final int powerPerDamagePoint = Config.darkSteelPowerStorageBase / MATERIAL.getMaxUses();
|
||||
private long lastBlickTick = -1;
|
||||
protected final int powerPerDamagePoint = Config.darkSteelPowerStorageBase / MATERIAL.getMaxUses();
|
||||
protected long lastBlickTick = -1;
|
||||
protected String name;
|
||||
|
||||
public ItemDarkSteelSword() {
|
||||
super(MATERIAL);
|
||||
public ItemDarkSteelSword(String name, ToolMaterial mat) {
|
||||
super(mat);
|
||||
this.name = name;
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
|
||||
String str = "darkSteel_sword";
|
||||
String str = name+"_sword";
|
||||
setUnlocalizedName(str);
|
||||
setTextureName(EnderIO.DOMAIN + ":" + str);
|
||||
}
|
||||
|
||||
public ItemDarkSteelSword() {
|
||||
this("darkSteel",MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
@@ -116,7 +122,7 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte
|
||||
}
|
||||
}
|
||||
|
||||
//Set priorty to lowest in the hope any other mod adding head drops will have already added them
|
||||
//Set priorty to lowest in the hope any other mod adding head drops will have already added them
|
||||
//by the time this is called to prevent multiple head drops
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onEntityDrop(LivingDropsEvent evt) {
|
||||
@@ -355,10 +361,10 @@ public class ItemDarkSteelSword extends ItemSword implements IEnergyContainerIte
|
||||
if(str != null) {
|
||||
list.add(str);
|
||||
}
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item.darkSteel_sword.tooltip.line1"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item."+name+"_sword.tooltip.line1"));
|
||||
if(EnergyUpgrade.itemHasAnyPowerUpgrade(itemstack)) {
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item.darkSteel_sword.tooltip.line2"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item.darkSteel_sword.tooltip.line3"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item."+name+"_sword.tooltip.line2"));
|
||||
list.add(EnumChatFormatting.WHITE + EnderIO.lang.localize("item."+name+"_sword.tooltip.line3"));
|
||||
}
|
||||
DarkSteelRecipeManager.instance.addAdvancedTooltipEntries(itemstack, entityplayer, list, flag);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class ItemEndSteelArmor extends ItemDarkSteelArmor implements IEndSteelItem {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper.addArmorMaterial("endSteel", 50, new int[] { 4, 7, 10, 5 }, 25);
|
||||
|
||||
public ItemEndSteelArmor(int armorType) {
|
||||
super(MATERIAL, "endSteel", armorType);
|
||||
|
||||
}
|
||||
|
||||
public static ItemEndSteelArmor create(int armorType) {
|
||||
ItemEndSteelArmor res = new ItemEndSteelArmor(armorType);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
public static ItemEndSteelArmor forArmorType(int armorType) {
|
||||
switch (armorType) {
|
||||
case 0: return DarkSteelItems.itemEndSteelHelmet;
|
||||
case 1: return DarkSteelItems.itemEndSteelChestplate;
|
||||
case 2: return DarkSteelItems.itemEndSteelLeggings;
|
||||
case 3: return DarkSteelItems.itemEndSteelBoots;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getPoweredProtectionIncrease(int armorType) {
|
||||
switch (armorType) {
|
||||
case 0: return 1;
|
||||
case 1: return 2;
|
||||
case 2:
|
||||
case 3: return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
|
||||
Iterator<IDarkSteelUpgrade> iter = DarkSteelRecipeManager.instance.recipeIterator();
|
||||
while (iter.hasNext()) {
|
||||
IDarkSteelUpgrade upgrade = iter.next();
|
||||
if (!(upgrade instanceof EnergyUpgrade) && upgrade.canAddToItem(is)) {
|
||||
upgrade.writeToItem(is);
|
||||
}
|
||||
}
|
||||
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class ItemEndSteelAxe extends ItemDarkSteelAxe implements IEndSteelItem {
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemEndSteelAxe;
|
||||
}
|
||||
|
||||
public static ItemEndSteelAxe create() {
|
||||
ItemEndSteelAxe res = new ItemEndSteelAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public ItemEndSteelAxe() {
|
||||
super("endSteel", ItemEndSteelSword.MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
TravelUpgrade.INSTANCE.writeToItem(is);
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class ItemEndSteelPickaxe extends ItemDarkSteelPickaxe implements IEndSteelItem {
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemEndSteelPickaxe;
|
||||
}
|
||||
|
||||
public static ItemEndSteelPickaxe create() {
|
||||
ItemEndSteelPickaxe res = new ItemEndSteelPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public ItemEndSteelPickaxe() {
|
||||
super("endSteel", ItemEndSteelSword.MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
TravelUpgrade.INSTANCE.writeToItem(is);
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class ItemEndSteelSword extends ItemDarkSteelSword implements IEndSteelItem {
|
||||
|
||||
static final ToolMaterial MATERIAL = EnumHelper.addToolMaterial("endSteel", Config.darkSteelPickMinesTiCArdite ? 5 : 3, 2000, 12, 5, 30);
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemEndSteelSword;
|
||||
}
|
||||
|
||||
|
||||
public static ItemEndSteelSword create() {
|
||||
ItemEndSteelSword res = new ItemEndSteelSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public ItemEndSteelSword() {
|
||||
super("endSteel",MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
TravelUpgrade.INSTANCE.writeToItem(is);
|
||||
par3List.add(is);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IStellarItem;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.IDarkSteelUpgrade;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class ItemStellarArmor extends ItemDarkSteelArmor implements IStellarItem {
|
||||
|
||||
public static final ArmorMaterial MATERIAL = EnumHelper.addArmorMaterial("stellarAlloy", 75, new int[] {8, 14, 18, 7}, 25);
|
||||
|
||||
public ItemStellarArmor(int armorType) {
|
||||
super(MATERIAL, "stellar", armorType);
|
||||
|
||||
}
|
||||
|
||||
public static ItemStellarArmor create(int armorType) {
|
||||
ItemStellarArmor res = new ItemStellarArmor(armorType);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
public static ItemStellarArmor forArmorType(int armorType) {
|
||||
switch (armorType) {
|
||||
case 0: return DarkSteelItems.itemStellarHelmet;
|
||||
case 1: return DarkSteelItems.itemStellarChestplate;
|
||||
case 2: return DarkSteelItems.itemStellarLeggings;
|
||||
case 3: return DarkSteelItems.itemStellarBoots;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getPoweredProtectionIncrease(int armorType) {
|
||||
switch (armorType) {
|
||||
case 0: return 2;
|
||||
case 1: return 1;
|
||||
case 2: return 4;
|
||||
case 3: return 3;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
|
||||
Iterator<IDarkSteelUpgrade> iter = DarkSteelRecipeManager.instance.recipeIterator();
|
||||
while (iter.hasNext()) {
|
||||
IDarkSteelUpgrade upgrade = iter.next();
|
||||
if (!(upgrade instanceof EnergyUpgrade) && upgrade.canAddToItem(is)) {
|
||||
upgrade.writeToItem(is);
|
||||
}
|
||||
}
|
||||
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IStellarItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class ItemStellarAxe extends ItemDarkSteelAxe implements IStellarItem {
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemStellarAxe;
|
||||
}
|
||||
|
||||
public static ItemStellarAxe create() {
|
||||
ItemStellarAxe res = new ItemStellarAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public ItemStellarAxe() {
|
||||
super("stellar", ItemStellarSword.MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
TravelUpgrade.INSTANCE.writeToItem(is);
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IStellarItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class ItemStellarPickaxe extends ItemDarkSteelPickaxe implements IStellarItem {
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemStellarPickaxe;
|
||||
}
|
||||
|
||||
public static ItemStellarPickaxe create() {
|
||||
ItemStellarPickaxe res = new ItemStellarPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public ItemStellarPickaxe() {
|
||||
super("stellar", ItemStellarSword.MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
TravelUpgrade.INSTANCE.writeToItem(is);
|
||||
par3List.add(is);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package crazypants.enderio.item.darksteel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IStellarItem;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class ItemStellarSword extends ItemDarkSteelSword implements IStellarItem {
|
||||
|
||||
static final ToolMaterial MATERIAL = EnumHelper.addToolMaterial("stellarAlloy", Config.darkSteelPickMinesTiCArdite ? 5 : 3, 5000, 16, 11, 25);
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
if(player == null) {
|
||||
return false;
|
||||
}
|
||||
ItemStack equipped = player.getCurrentEquippedItem();
|
||||
if(equipped == null) {
|
||||
return false;
|
||||
}
|
||||
return equipped.getItem() == DarkSteelItems.itemStellarSword;
|
||||
}
|
||||
|
||||
|
||||
public static ItemStellarSword create() {
|
||||
ItemStellarSword res = new ItemStellarSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public ItemStellarSword() {
|
||||
super("stellar",MATERIAL);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
ItemStack is = new ItemStack(this);
|
||||
par3List.add(is);
|
||||
|
||||
is = new ItemStack(this);
|
||||
EnergyUpgrade.EMPOWERED_FIVE.writeToItem(is);
|
||||
EnergyUpgrade.setPowerFull(is);
|
||||
TravelUpgrade.INSTANCE.writeToItem(is);
|
||||
par3List.add(is);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelArmor;
|
||||
import crazypants.enderio.item.darksteel.ItemEndSteelArmor;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.ItemDarkSteelArmor;
|
||||
|
||||
public class ApiaristArmorUpgrade extends AbstractUpgrade {
|
||||
|
||||
@@ -56,7 +58,7 @@ public class ApiaristArmorUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != ItemDarkSteelArmor.forArmorType(slot) || getUpgradeItem() == null) {
|
||||
if(stack == null || ! DarkSteelItems.isArmorPart(stack.getItem(), slot) || getUpgradeItem() == null) {
|
||||
return false;
|
||||
}
|
||||
ApiaristArmorUpgrade up = loadFromItem(stack);
|
||||
@@ -65,7 +67,7 @@ public class ApiaristArmorUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
public boolean hasUpgrade(ItemStack stack) {
|
||||
return super.hasUpgrade(stack) && stack.getItem() == ItemDarkSteelArmor.forArmorType(slot);
|
||||
return super.hasUpgrade(stack) && DarkSteelItems.isArmorPart(stack.getItem(), slot);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.material.Material;
|
||||
|
||||
@@ -45,6 +46,12 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
Config.darkSteelPowerStorageLevelThree,
|
||||
Config.darkSteelPowerStorageLevelThree / 100);
|
||||
|
||||
public static final AbstractUpgrade EMPOWERED_FIVE = new EnergyUpgrade(
|
||||
"enderio.darksteel.upgrade.empowered_five", Config.darkSteelUpgradePowerFourCost,
|
||||
new ItemStack(EnderIO.itemBasicCapacitor, 1, 3),
|
||||
Config.darkSteelPowerStorageLevelFour,
|
||||
Config.darkSteelPowerStorageLevelFour / 100);
|
||||
|
||||
private static final String UPGRADE_NAME = "energyUpgrade";
|
||||
private static final String KEY_CAPACITY = "capacity";
|
||||
private static final String KEY_ENERGY = "energy";
|
||||
@@ -54,7 +61,7 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
|
||||
|
||||
private static final Random RANDOM = new Random();
|
||||
|
||||
|
||||
public static EnergyUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -81,6 +88,8 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
return EMPOWERED_THREE;
|
||||
} else if(upgrade.unlocName.equals(EMPOWERED_THREE.unlocName)) {
|
||||
return EMPOWERED_FOUR;
|
||||
} else if(upgrade.unlocName.equals(EMPOWERED_FOUR.unlocName)) {
|
||||
return EMPOWERED_FIVE;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -108,7 +117,7 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public static void setPowerLevel(ItemStack item, int amount) {
|
||||
if(item == null || !itemHasAnyPowerUpgrade(item)) {
|
||||
return;
|
||||
@@ -118,13 +127,13 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
eu.setEnergy(amount);
|
||||
eu.writeToItem(item);
|
||||
}
|
||||
|
||||
|
||||
public static void setPowerFull(ItemStack item) {
|
||||
if(item == null || !itemHasAnyPowerUpgrade(item)) {
|
||||
return;
|
||||
}
|
||||
EnergyUpgrade eu = loadFromItem(item);
|
||||
eu.setEnergy(eu.getCapacity());
|
||||
EnergyUpgrade eu = loadFromItem(item);
|
||||
eu.setEnergy(eu.getCapacity());
|
||||
eu.writeToItem(item);
|
||||
}
|
||||
|
||||
@@ -153,7 +162,7 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
protected int capacity;
|
||||
protected int energy;
|
||||
protected int energy;
|
||||
|
||||
protected int maxInRF;
|
||||
protected int maxOutRF;
|
||||
@@ -169,7 +178,7 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
public EnergyUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
capacity = tag.getInteger(KEY_CAPACITY);
|
||||
energy = tag.getInteger(KEY_ENERGY);
|
||||
energy = tag.getInteger(KEY_ENERGY);
|
||||
maxInRF = tag.getInteger(KEY_MAX_IN);
|
||||
maxOutRF = tag.getInteger(KEY_MAX_OUT);
|
||||
}
|
||||
@@ -195,6 +204,10 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
if(up == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!(stack.getItem() instanceof IEndSteelItem) && up.unlocName.equals(EMPOWERED_FIVE.unlocName))
|
||||
return false;
|
||||
|
||||
return up.unlocName.equals(unlocName);
|
||||
}
|
||||
|
||||
@@ -222,7 +235,7 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
upgradeRoot.setInteger(KEY_CAPACITY, capacity);
|
||||
upgradeRoot.setInteger(KEY_ENERGY, energy);
|
||||
|
||||
|
||||
upgradeRoot.setInteger(KEY_MAX_IN, maxInRF);
|
||||
upgradeRoot.setInteger(KEY_MAX_OUT, maxOutRF);
|
||||
}
|
||||
@@ -241,6 +254,8 @@ public class EnergyUpgrade extends AbstractUpgrade {
|
||||
index = 2;
|
||||
} else if (upgrade.unlocName.equals(EMPOWERED_FOUR.unlocName)) {
|
||||
index = 3;
|
||||
} else if (upgrade.unlocName.equals(EMPOWERED_FIVE.unlocName)) {
|
||||
index = 4;
|
||||
}
|
||||
return Config.darkSteelPowerDamgeAbsorptionRatios[index];
|
||||
}
|
||||
|
||||
@@ -22,12 +22,12 @@ import static org.lwjgl.opengl.GL11.glDepthMask;
|
||||
public class GliderUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "glide";
|
||||
|
||||
|
||||
public static final GliderUpgrade INSTANCE = new GliderUpgrade();
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private Render render;
|
||||
|
||||
|
||||
public static GliderUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -40,19 +40,19 @@ public class GliderUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return new GliderUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public GliderUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public GliderUpgrade() {
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.glider", new ItemStack(DarkSteelItems.itemGliderWing,1,1), Config.darkSteelGliderCost);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelChestplate) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 1)) {
|
||||
return false;
|
||||
}
|
||||
GliderUpgrade up = loadFromItem(stack);
|
||||
|
||||
@@ -20,10 +20,10 @@ public class JumpUpgrade extends AbstractUpgrade {
|
||||
private short level;
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
ItemStack boots = player.getEquipmentInSlot(1);
|
||||
ItemStack boots = player.getEquipmentInSlot(1);
|
||||
return loadFromItem(boots) != null;
|
||||
}
|
||||
|
||||
|
||||
public static JumpUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -49,7 +49,7 @@ public class JumpUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelBoots || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 3) || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
return false;
|
||||
}
|
||||
JumpUpgrade up = loadFromItem(stack);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
public class NaturalistEyeUpgrade extends AbstractUpgrade {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class NaturalistEyeUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelHelmet || getUpgradeItem() == null) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0) || getUpgradeItem() == null) {
|
||||
return false;
|
||||
}
|
||||
NaturalistEyeUpgrade up = loadFromItem(stack);
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
public class NightVisionUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "nightVision";
|
||||
|
||||
|
||||
public static final NightVisionUpgrade INSTANCE = new NightVisionUpgrade();
|
||||
|
||||
|
||||
public static NightVisionUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -25,26 +25,26 @@ public class NightVisionUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return new NightVisionUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
|
||||
private static ItemStack createUpgradeItem() {
|
||||
ItemStack pot = new ItemStack(Items.potionitem, 1, 0);
|
||||
int res = PotionHelper.applyIngredient(0, Items.nether_wart.getPotionEffect(new ItemStack(Items.nether_wart)));
|
||||
res = PotionHelper.applyIngredient(res, PotionHelper.goldenCarrotEffect);
|
||||
res = PotionHelper.applyIngredient(res, PotionHelper.goldenCarrotEffect);
|
||||
pot.setItemDamage(res);
|
||||
return pot;
|
||||
}
|
||||
|
||||
|
||||
public NightVisionUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public NightVisionUpgrade() {
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.nightVision", createUpgradeItem(), Config.darkSteelNightVisionCost);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelHelmet) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0)) {
|
||||
return false;
|
||||
}
|
||||
NightVisionUpgrade up = loadFromItem(stack);
|
||||
@@ -55,6 +55,6 @@ public class NightVisionUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,6 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
import static org.lwjgl.opengl.GL11.glDepthMask;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -18,18 +11,23 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
import static org.lwjgl.opengl.GL11.glDepthMask;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
public class SolarUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static final String KEY_LEVEL = "level";
|
||||
|
||||
|
||||
private static final String UPGRADE_NAME = "speedBoost";
|
||||
|
||||
|
||||
public static final SolarUpgrade SOLAR_ONE = new SolarUpgrade("enderio.darksteel.upgrade.solar_one", (byte) 1, Config.darkSteelSolarOneCost);
|
||||
public static final SolarUpgrade SOLAR_TWO = new SolarUpgrade("enderio.darksteel.upgrade.solar_two", (byte) 2, Config.darkSteelSolarTwoCost);
|
||||
|
||||
public static final SolarUpgrade SOLAR_THREE = new SolarUpgrade("enderio.darksteel.upgrade.solar_three", (byte) 3, Config.darkSteelSolarThreeCost);
|
||||
|
||||
private Render render;
|
||||
|
||||
public static SolarUpgrade loadFromItem(ItemStack stack) {
|
||||
@@ -45,14 +43,10 @@ public class SolarUpgrade extends AbstractUpgrade {
|
||||
return new SolarUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
private static ItemStack createUpgradeItem() {
|
||||
ItemStack pot = new ItemStack(Items.potionitem, 1, 0);
|
||||
int res = PotionHelper.applyIngredient(0, Items.nether_wart.getPotionEffect(new ItemStack(Items.nether_wart)));
|
||||
res = PotionHelper.applyIngredient(res, PotionHelper.sugarEffect);
|
||||
pot.setItemDamage(res);
|
||||
return pot;
|
||||
private static ItemStack createUpgradeItem(int level) {
|
||||
return new ItemStack(EnderIO.blockSolarPanel,1,level-1);
|
||||
}
|
||||
|
||||
|
||||
private byte level;
|
||||
|
||||
public SolarUpgrade(NBTTagCompound tag) {
|
||||
@@ -61,13 +55,13 @@ public class SolarUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
public SolarUpgrade(String unlocName, byte level, int levelCost) {
|
||||
super(UPGRADE_NAME, unlocName, createUpgradeItem(), levelCost);
|
||||
super(UPGRADE_NAME, unlocName, createUpgradeItem(level), levelCost);
|
||||
this.level = (byte) level;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelHelmet || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0)|| !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
return false;
|
||||
}
|
||||
SolarUpgrade up = loadFromItem(stack);
|
||||
@@ -76,7 +70,7 @@ public class SolarUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return up.level == level - 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasUpgrade(ItemStack stack) {
|
||||
if(!super.hasUpgrade(stack)) {
|
||||
@@ -88,7 +82,7 @@ public class SolarUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return up.unlocName.equals(unlocName);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getUpgradeItem() {
|
||||
return new ItemStack(EnderIO.blockSolarPanel, 1, level - 1);
|
||||
@@ -100,9 +94,12 @@ public class SolarUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
public int getRFPerSec() {
|
||||
return level == 1 ? Config.darkSteelSolarOneGen : Config.darkSteelSolarTwoGen;
|
||||
if(level==0) return Config.darkSteelSolarOneGen;
|
||||
if(level==1) return Config.darkSteelSolarTwoGen;
|
||||
else return Config.darkSteelSolarThreeGen;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IRenderUpgrade getRender() {
|
||||
@@ -113,8 +110,6 @@ public class SolarUpgrade extends AbstractUpgrade {
|
||||
private class Render implements IRenderUpgrade {
|
||||
|
||||
private EntityItem item = new EntityItem(Minecraft.getMinecraft().theWorld);
|
||||
private ItemStack panel1 = new ItemStack(EnderIO.blockSolarPanel, 1, 0);
|
||||
private ItemStack panel2 = new ItemStack(EnderIO.blockSolarPanel, 1, 1);
|
||||
|
||||
@Override
|
||||
public void render(RenderPlayerEvent event, ItemStack stack, boolean head) {
|
||||
@@ -127,7 +122,7 @@ public class SolarUpgrade extends AbstractUpgrade {
|
||||
GL11.glRotated(180, 1, 0, 0);
|
||||
GL11.glScalef(2.1f, 2.1f, 2.1f);
|
||||
byte level = loadFromItem(stack).level;
|
||||
item.setEntityItemStack(level == 0 ? panel1 : panel2);
|
||||
item.setEntityItemStack(new ItemStack(EnderIO.blockSolarPanel, 1, level-1));
|
||||
RenderManager.instance.renderEntityWithPosYaw(item, 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
public class SoundDetectorUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "soundDetector";
|
||||
|
||||
|
||||
public static final SoundDetectorUpgrade INSTANCE = new SoundDetectorUpgrade();
|
||||
|
||||
|
||||
public static SoundDetectorUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -24,19 +24,19 @@ public class SoundDetectorUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return new SoundDetectorUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public SoundDetectorUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public SoundDetectorUpgrade() {
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.sound", new ItemStack(Blocks.noteblock), Config.darkSteelSoundLocatorCost);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelHelmet) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0)) {
|
||||
return false;
|
||||
}
|
||||
SoundDetectorUpgrade up = loadFromItem(stack);
|
||||
@@ -47,6 +47,6 @@ public class SoundDetectorUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
}
|
||||
}
|
||||
@@ -37,10 +37,10 @@ public class SpeedUpgrade extends AbstractUpgrade {
|
||||
protected float sprintMultiplier;
|
||||
|
||||
public static boolean isEquipped(EntityPlayer player) {
|
||||
ItemStack legs = player.getEquipmentInSlot(2);
|
||||
ItemStack legs = player.getEquipmentInSlot(2);
|
||||
return loadFromItem(legs) != null;
|
||||
}
|
||||
|
||||
|
||||
public static SpeedUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -57,7 +57,7 @@ public class SpeedUpgrade extends AbstractUpgrade {
|
||||
private static ItemStack createUpgradeItem() {
|
||||
ItemStack pot = new ItemStack(Items.potionitem, 1, 0);
|
||||
int res = PotionHelper.applyIngredient(0, Items.nether_wart.getPotionEffect(new ItemStack(Items.nether_wart)));
|
||||
res = PotionHelper.applyIngredient(res, PotionHelper.sugarEffect);
|
||||
res = PotionHelper.applyIngredient(res, PotionHelper.sugarEffect);
|
||||
pot.setItemDamage(res);
|
||||
return pot;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class SpeedUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelLeggings || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 2) || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
return false;
|
||||
}
|
||||
SpeedUpgrade up = loadFromItem(stack);
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
public class SpoonUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "spoon";
|
||||
|
||||
|
||||
public static final SpoonUpgrade INSTANCE = new SpoonUpgrade();
|
||||
|
||||
|
||||
public static SpoonUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -24,19 +24,19 @@ public class SpoonUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return new SpoonUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public SpoonUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public SpoonUpgrade() {
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.spoon", new ItemStack(Items.diamond_shovel), Config.darkSteelSpoonCost);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelPickaxe || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
if(stack == null || (stack.getItem() != DarkSteelItems.itemDarkSteelPickaxe && stack.getItem() != DarkSteelItems.itemEndSteelPickaxe) || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
return false;
|
||||
}
|
||||
SpoonUpgrade up = loadFromItem(stack);
|
||||
@@ -47,7 +47,7 @@ public class SpoonUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
|
||||
public class SwimUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "swim";
|
||||
|
||||
|
||||
public static final SwimUpgrade INSTANCE = new SwimUpgrade();
|
||||
|
||||
|
||||
public static SwimUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -24,19 +24,19 @@ public class SwimUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return new SwimUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public SwimUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public SwimUpgrade() {
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.swim", new ItemStack(Blocks.waterlily), Config.darkSteelSwimCost);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelBoots) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 3)) {
|
||||
return false;
|
||||
}
|
||||
SwimUpgrade up = loadFromItem(stack);
|
||||
@@ -47,7 +47,7 @@ public class SwimUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package crazypants.enderio.item.darksteel.upgrade;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TravelUpgrade extends AbstractUpgrade {
|
||||
|
||||
private static String UPGRADE_NAME = "travel";
|
||||
|
||||
|
||||
public static final TravelUpgrade INSTANCE = new TravelUpgrade();
|
||||
|
||||
|
||||
public static TravelUpgrade loadFromItem(ItemStack stack) {
|
||||
if(stack == null) {
|
||||
return null;
|
||||
@@ -25,19 +25,19 @@ public class TravelUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return new TravelUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public TravelUpgrade(NBTTagCompound tag) {
|
||||
super(UPGRADE_NAME, tag);
|
||||
super(UPGRADE_NAME, tag);
|
||||
}
|
||||
|
||||
public TravelUpgrade() {
|
||||
super(UPGRADE_NAME, "enderio.darksteel.upgrade.travel", new ItemStack(EnderIO.itemMaterial,1,Material.ENDER_CRYSTAL.ordinal()), Config.darkSteelTravelCost);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || (stack.getItem() != DarkSteelItems.itemDarkSteelSword && stack.getItem() != DarkSteelItems.itemDarkSteelPickaxe) || !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
if(stack == null || (stack.getItem() != DarkSteelItems.itemDarkSteelSword && stack.getItem() != DarkSteelItems.itemEndSteelPickaxe && stack.getItem() != DarkSteelItems.itemEndSteelSword && stack.getItem() != DarkSteelItems.itemDarkSteelPickaxe)|| !EnergyUpgrade.itemHasAnyPowerUpgrade(stack)) {
|
||||
return false;
|
||||
}
|
||||
TravelUpgrade up = loadFromItem(stack);
|
||||
@@ -48,7 +48,7 @@ public class TravelUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
public void writeUpgradeToNBT(NBTTagCompound upgradeRoot) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,24 +8,26 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import com.enderio.core.common.vecmath.VecmathUtil;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.material.ItemCapacitor;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.ICapacitorItem;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public abstract class AbstractPoweredMachineEntity extends AbstractMachineEntity implements IInternalPoweredTile {
|
||||
|
||||
// Power
|
||||
private Capacitors capacitorType;
|
||||
private ICapacitor capacitor;
|
||||
private Capacitors capacitorType = Capacitors.BASIC_CAPACITOR;
|
||||
private ICapacitor capacitor = Capacitors.BASIC_CAPACITOR.capacitor;
|
||||
|
||||
private int storedEnergyRF;
|
||||
private int storedEnergyRF = 0;
|
||||
protected float lastSyncPowerStored = -1;
|
||||
|
||||
protected AbstractPoweredMachineEntity(SlotDefinition slotDefinition) {
|
||||
super(slotDefinition);
|
||||
capacitorType = Capacitors.BASIC_CAPACITOR;
|
||||
setCapacitor(Capacitors.BASIC_CAPACITOR);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,7 +97,20 @@ public abstract class AbstractPoweredMachineEntity extends AbstractMachineEntity
|
||||
}
|
||||
|
||||
public ICapacitor getCapacitor() {
|
||||
return capacitor != null ? capacitor : capacitorType.capacitor;
|
||||
|
||||
if(capacitor != null) {
|
||||
return capacitor;
|
||||
}
|
||||
|
||||
else if(capacitorType == Capacitors.TOTEMIC_CAPACITOR) {
|
||||
ItemStack contents = inventory[slotDefinition.minUpgradeSlot];
|
||||
if(contents != null && contents.getItem() == EnderIO.itemBasicCapacitor) {
|
||||
return EnderIO.itemBasicCapacitor.getCapacitor(contents);
|
||||
}
|
||||
}
|
||||
|
||||
return capacitorType.capacitor;
|
||||
|
||||
}
|
||||
|
||||
public int getEnergyStoredScaled(int scale) {
|
||||
@@ -111,7 +126,18 @@ public abstract class AbstractPoweredMachineEntity extends AbstractMachineEntity
|
||||
|
||||
public void setCapacitor(Capacitors capacitorType) {
|
||||
this.capacitorType = capacitorType;
|
||||
this.capacitor = null;
|
||||
|
||||
if(capacitorType == Capacitors.TOTEMIC_CAPACITOR) {
|
||||
ItemStack contents = inventory[slotDefinition.minUpgradeSlot];
|
||||
if(contents != null && contents.getItem() == EnderIO.itemBasicCapacitor) {
|
||||
setCapacitor(EnderIO.itemBasicCapacitor.getCapacitor(contents));
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
this.capacitor = capacitorType.capacitor;
|
||||
}
|
||||
|
||||
onCapacitorTypeChange();
|
||||
//Force a check that the new value is in bounds
|
||||
setEnergyStored(getEnergyStored());
|
||||
|
||||
@@ -42,12 +42,14 @@ public class MachineRecipes {
|
||||
ItemStack sentientEnder = new ItemStack(EnderIO.itemFrankenSkull, 1, FrankenSkull.SENTIENT_ENDER.ordinal());
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian);
|
||||
|
||||
String redstoneAlloy = REDSTONE_ALLOY.getOreIngot();
|
||||
String electricalSteel = ELECTRICAL_STEEL.getOreIngot();
|
||||
String darkSteel = DARK_STEEL.getOreIngot();
|
||||
String energeticAlloy = ENERGETIC_ALLOY.getOreIngot();
|
||||
String phasedGold = PHASED_GOLD.getOreIngot();
|
||||
String phasedIron = PHASED_IRON.getOreIngot();
|
||||
String soularium = SOULARIUM.getOreIngot();
|
||||
String endSteel = END_STEEL.getOreIngot();
|
||||
|
||||
String vibCry = VIBRANT_CYSTAL.oreDict;
|
||||
String pulCry = PULSATING_CYSTAL.oreDict;
|
||||
@@ -73,6 +75,14 @@ public class MachineRecipes {
|
||||
ItemStack zg = new ItemStack(EnderIO.blockZombieGenerator, 1, 0);
|
||||
addShaped(zg, "eee", "qzq", "qqq", 'e', electricalSteel, 'q', fusedQuartz, 'z', new ItemStack(EnderIO.itemFrankenSkull, 1, 0));
|
||||
|
||||
//FrankenzombieGen
|
||||
ItemStack fg = new ItemStack(EnderIO.blockFrankenZombieGenerator, 1, 0);
|
||||
addShaped(fg, "eee", "qzq", "qqq", 'e', soularium, 'q', fusedQuartz, 'z', new ItemStack(EnderIO.itemFrankenSkull, 1, 2));
|
||||
|
||||
//EnderGen
|
||||
ItemStack eg = new ItemStack(EnderIO.blockEnderGenerator, 1, 0);
|
||||
addShaped(eg, "eee", "qzq", "qqq", 'e', endSteel, 'q', fusedQuartz, 'z', new ItemStack(EnderIO.itemFrankenSkull, 1, 3));
|
||||
|
||||
//KillerJoe
|
||||
ItemStack kj = new ItemStack(EnderIO.blockKillerJoe, 1, 0);
|
||||
addShaped(kj, "sss", "qzq", "qqq", 's', darkSteel, 'q', fusedQuartz, 'z', frankenZombie);
|
||||
@@ -97,7 +107,7 @@ public class MachineRecipes {
|
||||
addShaped(poweredSpawner, "ese", "eme", "vzv", 'e', electricalSteel, 's', "itemSkull", 'v', vibCry, 'm', machineChassi, 'z', zombieBit);
|
||||
|
||||
if (Config.reservoirEnabled) {
|
||||
//reservoir
|
||||
//reservoir
|
||||
ItemStack reservoir = new ItemStack(EnderIO.blockReservoir, 2, 0);
|
||||
Object glassSides;
|
||||
if (Config.useHardRecipes) {
|
||||
@@ -185,14 +195,17 @@ public class MachineRecipes {
|
||||
|
||||
ItemStack solarPanel = new ItemStack(EnderIO.blockSolarPanel, 1, 0);
|
||||
ItemStack advSolarPanel = new ItemStack(EnderIO.blockSolarPanel, 1, 1);
|
||||
ItemStack vibSolarPanel = new ItemStack(EnderIO.blockSolarPanel, 1, 2);
|
||||
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(solarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', "blockGlassHardened", 'c', capacitor, 'e', energeticAlloy, 'p',
|
||||
phasedGold);
|
||||
addShaped(solarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', "blockGlassHardened", 'c', capacitor, 'e', energeticAlloy, 'p', phasedGold);
|
||||
addShaped(advSolarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', enlightedQuartz, 'c', capacitor2, 'e', phasedIron, 'p', phasedGold);
|
||||
addShaped(vibSolarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', enlightedQuartz, 'c', capacitor3, 'e', endSteel, 'p', phasedGold);
|
||||
} else {
|
||||
addShaped(solarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', "blockGlassHardened", 'p', silicon, 'e', energeticAlloy, 'c',
|
||||
electricalSteel);
|
||||
addShaped(advSolarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', enlightedQuartz, 'p', vibCry, 'e', phasedGold, 'c', phasedIron);
|
||||
addShaped(solarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', "blockGlassHardened", 'p', silicon, 'e', energeticAlloy, 'c', redstoneAlloy);
|
||||
addShaped(advSolarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', enlightedQuartz, 'p', pulCry, 'e', phasedIron, 'c', electricalSteel);
|
||||
addShaped(vibSolarPanel, "efe", "pfp", "cdc", 'd', Blocks.daylight_detector, 'f', enlightedQuartz, 'p', vibCry, 'e', phasedGold, 'c', endSteel);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ public class TileCrafter extends AbstractPowerConsumerEntity implements IItemBuf
|
||||
private boolean bufferStacks = true;
|
||||
|
||||
private long ticksSinceLastCraft = 0;
|
||||
|
||||
|
||||
private FakePlayer playerInst;
|
||||
|
||||
public TileCrafter() {
|
||||
super(new SlotDefinition(9, 1));
|
||||
containerItems = new ArrayList<ItemStack>();
|
||||
containerItems = new ArrayList<ItemStack>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -51,7 +51,7 @@ public class TileCrafter extends AbstractPowerConsumerEntity implements IItemBuf
|
||||
ICapacitor refCap = getCapacitor();
|
||||
int maxUse = getPowerUsePerTick(getCapacitorType());
|
||||
int io = Math.max(maxUse, refCap.getMaxEnergyExtracted());
|
||||
setCapacitor(new BasicCapacitor(io * 4, refCap.getMaxEnergyStored(), io));
|
||||
setCapacitor(new BasicCapacitor(0, io * 4, refCap.getMaxEnergyStored(), io));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -115,9 +115,9 @@ public class TileCrafter extends AbstractPowerConsumerEntity implements IItemBuf
|
||||
public int getPowerUsePerTick() {
|
||||
return getPowerUsePerTick(getCapacitorType());
|
||||
}
|
||||
|
||||
|
||||
public int getPowerUsePerTick(Capacitors type) {
|
||||
int ticks = getTicksPerCraft(type);
|
||||
int ticks = getTicksPerCraft(type);
|
||||
return (int)Math.ceil(Config.crafterRfPerCraft / (double)ticks);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class TileCrafter extends AbstractPowerConsumerEntity implements IItemBuf
|
||||
return 10;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static boolean compareDamageable(ItemStack stack, ItemStack req) {
|
||||
@@ -156,7 +156,7 @@ public class TileCrafter extends AbstractPowerConsumerEntity implements IItemBuf
|
||||
}, 3, 3);
|
||||
|
||||
int[] usedItems = new int[9];
|
||||
|
||||
|
||||
for (int j = 0; j < 9; j++) {
|
||||
ItemStack req = craftingGrid.getStackInSlot(j);
|
||||
if (req != null) {
|
||||
|
||||
@@ -34,6 +34,7 @@ import crazypants.enderio.machine.farm.farmers.IHarvestResult;
|
||||
import crazypants.enderio.machine.farm.farmers.RubberTreeFarmerIC2;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.BasicCapacitor;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.tool.ArrayMappingTool;
|
||||
|
||||
public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
@@ -129,7 +130,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
public static final int maxFirtSlot = maxToolSlot + NUM_FERTILIZER_SLOTS;
|
||||
|
||||
public static final int NUM_SUPPLY_SLOTS = 4;
|
||||
|
||||
|
||||
public static final int minSupSlot = maxFirtSlot + 1;
|
||||
public static final int maxSupSlot = maxFirtSlot + NUM_SUPPLY_SLOTS;
|
||||
|
||||
@@ -195,7 +196,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
if(inventory[upg] == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return Config.farmBonusSize * inventory[upg].getItemDamage();
|
||||
return Config.farmBonusSize * EnderIO.itemBasicCapacitor.getCapacitor(inventory[upg]).getTier();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,7 +487,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
}
|
||||
|
||||
private int bonemealCooldown = 5; // no need to persist this
|
||||
|
||||
|
||||
private boolean hasBonemeal() {
|
||||
if (inventory[minFirtSlot] != null) {
|
||||
return true;
|
||||
@@ -519,7 +520,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
|
||||
/*
|
||||
* Returns a fuzzy boolean:
|
||||
*
|
||||
*
|
||||
* <=0 - break no leaves for saplings
|
||||
* 50 - break half the leaves for saplings
|
||||
* 90 - break 90% of the leaves for saplings
|
||||
@@ -527,7 +528,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
public int isLowOnSaplings(BlockCoord bc) {
|
||||
int slot = getSupplySlotForCoord(bc);
|
||||
ItemStack inv = inventory[slot];
|
||||
|
||||
|
||||
return 90 * (Config.farmSaplingReserveAmount - (inv == null ? 0 : inv.stackSize)) / Config.farmSaplingReserveAmount;
|
||||
}
|
||||
|
||||
@@ -614,7 +615,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
for (int j = minSupSlot; j < slot; j++) {
|
||||
slots[k++] = j;
|
||||
}
|
||||
|
||||
|
||||
int origSize = stack.stackSize;
|
||||
stack = stack.copy();
|
||||
|
||||
@@ -709,14 +710,16 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
int ppt = calcPowerUsePerTick();
|
||||
switch (getCapacitorType()) {
|
||||
case BASIC_CAPACITOR:
|
||||
setCapacitor(new BasicCapacitor(ppt * 40, 250000, ppt));
|
||||
setCapacitor(new BasicCapacitor(0, ppt * 40, 250000, ppt));
|
||||
break;
|
||||
case ACTIVATED_CAPACITOR:
|
||||
setCapacitor(new BasicCapacitor(ppt * 40, 500000, ppt));
|
||||
setCapacitor(new BasicCapacitor(0, ppt * 40, 500000, ppt));
|
||||
break;
|
||||
case ENDER_CAPACITOR:
|
||||
setCapacitor(new BasicCapacitor(ppt * 40, 1000000, ppt));
|
||||
setCapacitor(new BasicCapacitor(0, ppt * 40, 1000000, ppt));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
currentTask = createTask();
|
||||
}
|
||||
@@ -781,6 +784,8 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
return 32;
|
||||
case ENDER_CAPACITOR:
|
||||
return 64;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 64;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class RubberTreeFarmerIC2 extends TreeFarmer {
|
||||
private ItemStack stickyResin;
|
||||
|
||||
public RubberTreeFarmerIC2() {
|
||||
super(GameRegistry.findBlock("IC2", "blockRubSapling"), GameRegistry.findBlock("IC2", "blockRubWood"));
|
||||
super(true, GameRegistry.findBlock("IC2", "blockRubSapling"), GameRegistry.findBlock("IC2", "blockRubWood"));
|
||||
Item item = GameRegistry.findItem("IC2", "itemTreetap");
|
||||
if(item != null) {
|
||||
treeTap = item.getClass();
|
||||
@@ -37,19 +37,24 @@ public class RubberTreeFarmerIC2 extends TreeFarmer {
|
||||
|
||||
@Override
|
||||
public boolean prepareBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
|
||||
for(int x=-1;x<2;x++) {
|
||||
for(int z=-1;z<2;z++) {
|
||||
Block blk = farm.getBlock(bc.x + x, bc.y, bc.z + z);
|
||||
if(isWood(blk) || sapling == blk) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(!farm.hasAxe()) {
|
||||
for(int x=-1;x<2;x++) {
|
||||
for(int z=-1;z<2;z++) {
|
||||
Block blk = farm.getBlock(bc.x + x, bc.y, bc.z + z);
|
||||
if(isWood(blk) || sapling == blk) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.prepareBlock(farm, bc, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IHarvestResult harvestBlock(TileFarmStation farm, BlockCoord bc, Block block, int meta) {
|
||||
if(farm.hasAxe()) {
|
||||
return super.harvestBlock(farm, bc, block, meta);
|
||||
}
|
||||
HarvestResult res = new HarvestResult();
|
||||
int y = bc.y;
|
||||
boolean done = false;
|
||||
|
||||
+5
-5
@@ -45,12 +45,12 @@ public class GuiStirlingGenerator extends GuiPoweredMachineBase<TileEntityStirli
|
||||
addProgressTooltip(80, 52, 14, 14);
|
||||
}
|
||||
|
||||
private static float getFactor(Capacitors upgrade) {
|
||||
return TileEntityStirlingGenerator.getEnergyMultiplier(upgrade) *
|
||||
TileEntityStirlingGenerator.getBurnTimeMultiplier(upgrade);
|
||||
private float getFactor(Capacitors upgrade) {
|
||||
return getTileEntity().getEnergyMultiplier() *
|
||||
getTileEntity().getBurnTimeMultiplier();
|
||||
}
|
||||
|
||||
private static String formatUpgrade(MessageFormat fmt, Capacitors upgrade) {
|
||||
private String formatUpgrade(MessageFormat fmt, Capacitors upgrade) {
|
||||
float efficiency = getFactor(upgrade) / getFactor(Capacitors.BASIC_CAPACITOR);
|
||||
Object[] args = new Object[] {
|
||||
EnderIO.lang.localizeExact(upgrade.unlocalisedName.concat(".name")),
|
||||
@@ -113,7 +113,7 @@ public class GuiStirlingGenerator extends GuiPoweredMachineBase<TileEntityStirli
|
||||
fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, y, ColorUtil.getRGB(Color.WHITE));
|
||||
|
||||
txt = String.format("%s %d%%", EnderIO.lang.localize("stirlingGenerator.burnRate"),
|
||||
Math.round(getTileEntity().getBurnTimeMultiplier() / Config.stirlingGeneratorBurnTimeMultiplierT1 * 100));
|
||||
Math.round(getTileEntity().getBurnTimeMultiplier() / Config.stirlingGeneratorBurnTimeMultipliers[0] * 100));
|
||||
sw = fr.getStringWidth(txt);
|
||||
y += fr.FONT_HEIGHT + 3;
|
||||
fr.drawStringWithShadow(txt, guiLeft + xSize / 2 - sw / 2, y, ColorUtil.getRGB(Color.WHITE));
|
||||
|
||||
+18
-31
@@ -6,11 +6,13 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.api.common.util.IProgressTile;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.SlotDefinition;
|
||||
@@ -29,9 +31,9 @@ public class TileEntityStirlingGenerator extends AbstractGeneratorEntity impleme
|
||||
public int totalBurnTime;
|
||||
|
||||
private PowerDistributor powerDis;
|
||||
|
||||
|
||||
public TileEntityStirlingGenerator() {
|
||||
super(new SlotDefinition(1, 0));
|
||||
super(new SlotDefinition(1, 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -86,12 +88,12 @@ public class TileEntityStirlingGenerator extends AbstractGeneratorEntity impleme
|
||||
public TileEntity getTileEntity() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getSoundName() {
|
||||
return SOUND_NAME;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound nbtRoot) {
|
||||
super.readCustomNBT(nbtRoot);
|
||||
@@ -127,13 +129,13 @@ public class TileEntityStirlingGenerator extends AbstractGeneratorEntity impleme
|
||||
protected boolean processTasks(boolean redstoneCheckPassed) {
|
||||
boolean needsUpdate = false;
|
||||
boolean sendBurnTimePacket = false;
|
||||
|
||||
|
||||
if(burnTime > 0) {
|
||||
if(getEnergyStored() < getMaxEnergyStored()) {
|
||||
setEnergyStored(getEnergyStored() + getPowerUsePerTick());
|
||||
setEnergyStored(getEnergyStored() + getPowerUsePerTick());
|
||||
}
|
||||
burnTime--;
|
||||
sendBurnTimePacket = shouldDoWorkThisTick(20,-1) || burnTime == 0;
|
||||
sendBurnTimePacket = shouldDoWorkThisTick(20,-1) || burnTime == 0;
|
||||
}
|
||||
|
||||
transmitEnergy();
|
||||
@@ -183,32 +185,17 @@ public class TileEntityStirlingGenerator extends AbstractGeneratorEntity impleme
|
||||
return doPush(dir, te, 0, 0);
|
||||
}
|
||||
|
||||
public static float getEnergyMultiplier(Capacitors capacitorType) {
|
||||
if(capacitorType == Capacitors.ACTIVATED_CAPACITOR) {
|
||||
return Config.stirlingGeneratorEnergyMultiplierT2;
|
||||
} else if(capacitorType == Capacitors.ENDER_CAPACITOR) {
|
||||
return Config.stirlingGeneratorEnergyMultiplierT3;
|
||||
}
|
||||
return Config.stirlingGeneratorEnergyMultiplierT1;
|
||||
}
|
||||
|
||||
private float getEnergyMultiplier() {
|
||||
return getEnergyMultiplier(getCapacitorType());
|
||||
}
|
||||
|
||||
public static float getBurnTimeMultiplier(Capacitors capacitorType) {
|
||||
if(capacitorType == Capacitors.ACTIVATED_CAPACITOR) {
|
||||
return Config.stirlingGeneratorBurnTimeMultiplierT2;
|
||||
} else if(capacitorType == Capacitors.ENDER_CAPACITOR) {
|
||||
return Config.stirlingGeneratorBurnTimeMultiplierT3;
|
||||
}
|
||||
return Config.stirlingGeneratorBurnTimeMultiplierT1;
|
||||
public float getEnergyMultiplier() {
|
||||
int tier = MathHelper.clamp_int(getCapacitor().getTier(), 1, Config.stirlingGeneratorEnergyMultipliers.length);
|
||||
return (float)Config.stirlingGeneratorEnergyMultipliers[tier-1];
|
||||
}
|
||||
|
||||
public float getBurnTimeMultiplier() {
|
||||
return getBurnTimeMultiplier(getCapacitorType());
|
||||
int tier = MathHelper.clamp_int(getCapacitor().getTier(), 1, Config.stirlingGeneratorBurnTimeMultipliers.length);
|
||||
return (float)Config.stirlingGeneratorBurnTimeMultipliers[tier-1];
|
||||
}
|
||||
|
||||
|
||||
//private PowerDistributor powerDis;
|
||||
private boolean transmitEnergy() {
|
||||
if(powerDis == null) {
|
||||
@@ -219,7 +206,7 @@ public class TileEntityStirlingGenerator extends AbstractGeneratorEntity impleme
|
||||
return false;
|
||||
}
|
||||
int transmitted = powerDis.transmitEnergy(worldObj, canTransmit);
|
||||
setEnergyStored(getEnergyStored() - transmitted);
|
||||
setEnergyStored(getEnergyStored() - transmitted);
|
||||
return transmitted > 0;
|
||||
}
|
||||
|
||||
@@ -227,6 +214,6 @@ public class TileEntityStirlingGenerator extends AbstractGeneratorEntity impleme
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+48
-1
@@ -18,9 +18,48 @@ import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator.TileFrankenZombieGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator.TileEnderGenerator;
|
||||
|
||||
|
||||
public class BlockZombieGenerator extends AbstractMachineBlock<TileZombieGenerator> {
|
||||
|
||||
public static class BlockFrankenZombieGenerator extends BlockZombieGenerator {
|
||||
|
||||
public BlockFrankenZombieGenerator() {
|
||||
super(ModObject.blockFrankenzombieGenerator, TileFrankenZombieGenerator.class);
|
||||
}
|
||||
|
||||
public static BlockFrankenZombieGenerator create() {
|
||||
BlockFrankenZombieGenerator gen = new BlockFrankenZombieGenerator();
|
||||
gen.init();
|
||||
return gen;
|
||||
}
|
||||
|
||||
public GeneratorType getGeneratorType(){
|
||||
return GeneratorType.FRANKENZOMBIE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class BlockEnderGenerator extends BlockZombieGenerator {
|
||||
|
||||
public BlockEnderGenerator() {
|
||||
super(ModObject.blockEnderGenerator, TileEnderGenerator.class);
|
||||
}
|
||||
|
||||
public static BlockEnderGenerator create() {
|
||||
BlockEnderGenerator gen = new BlockEnderGenerator();
|
||||
gen.init();
|
||||
return gen;
|
||||
}
|
||||
|
||||
public GeneratorType getGeneratorType(){
|
||||
return GeneratorType.ENDER;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static BlockZombieGenerator create() {
|
||||
BlockZombieGenerator gen = new BlockZombieGenerator();
|
||||
gen.init();
|
||||
@@ -28,7 +67,11 @@ public class BlockZombieGenerator extends AbstractMachineBlock<TileZombieGenerat
|
||||
}
|
||||
|
||||
protected BlockZombieGenerator() {
|
||||
super(ModObject.blockZombieGenerator, TileZombieGenerator.class, Material.anvil);
|
||||
this(ModObject.blockZombieGenerator, TileZombieGenerator.class);
|
||||
}
|
||||
|
||||
protected BlockZombieGenerator(ModObject obj, Class<? extends TileZombieGenerator> clazz) {
|
||||
super(obj, (Class<TileZombieGenerator>) clazz, Material.anvil);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -117,4 +160,8 @@ public class BlockZombieGenerator extends AbstractMachineBlock<TileZombieGenerat
|
||||
}
|
||||
}
|
||||
|
||||
public GeneratorType getGeneratorType(){
|
||||
return GeneratorType.ZOMBIE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package crazypants.enderio.machine.generator.zombie;
|
||||
|
||||
public enum GeneratorType {
|
||||
|
||||
ZOMBIE("enderio:models/ZombieJar.png"),
|
||||
FRANKENZOMBIE("enderio:models/FrankenzombieJar.png"),
|
||||
ENDER("enderio:models/EnderJar.png");
|
||||
|
||||
String texturePath;
|
||||
|
||||
GeneratorType(String texture){
|
||||
this.texturePath = texture;
|
||||
}
|
||||
|
||||
|
||||
public String getTexture(){
|
||||
return texturePath;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ import com.enderio.core.client.render.RenderUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator.TileEnderGenerator;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
|
||||
@@ -22,13 +23,13 @@ public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerato
|
||||
|
||||
public GuiZombieGenerator(InventoryPlayer inventory, final TileZombieGenerator tileEntity) {
|
||||
super(tileEntity, new ContainerZombieGenerator(inventory, tileEntity), "zombieGenerator");
|
||||
|
||||
|
||||
addToolTip(new GuiToolTip(new Rectangle(80, 21, 15, 47), "") {
|
||||
|
||||
@Override
|
||||
protected void updateText() {
|
||||
text.clear();
|
||||
String heading = EnderIO.lang.localize("zombieGenerator.fuelTank");
|
||||
String heading = (tileEntity instanceof TileEnderGenerator) ? EnderIO.lang.localize("enderGenerator.fuelTank") : EnderIO.lang.localize("zombieGenerator.fuelTank");
|
||||
text.add(heading);
|
||||
text.add(Fluids.toCapactityString(getTileEntity().fuelTank));
|
||||
if(tileEntity.fuelTank.getFluidAmount() < tileEntity.getActivationAmount()) {
|
||||
@@ -70,7 +71,7 @@ public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerato
|
||||
FontRenderer fr = getFontRenderer();
|
||||
int output = 0;
|
||||
if(gen.isActive()) {
|
||||
output = gen.outputPerTick;
|
||||
output = gen.getOutputPerTick();
|
||||
}
|
||||
String txt = EnderIO.lang.localize("combustionGenerator.output") + " " + PowerDisplayUtil.formatPower(output) + " " + PowerDisplayUtil.abrevation()
|
||||
+ PowerDisplayUtil.perTickStr();
|
||||
@@ -94,19 +95,4 @@ public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerato
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPowerX() {
|
||||
return 15;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPowerY() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getPowerHeight() {
|
||||
return 48;
|
||||
}
|
||||
|
||||
}
|
||||
+75
-19
@@ -3,6 +3,7 @@ package crazypants.enderio.machine.generator.zombie;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -27,12 +28,44 @@ import crazypants.enderio.tool.SmartTank;
|
||||
|
||||
public class TileZombieGenerator extends AbstractGeneratorEntity implements IFluidHandler, ITankAccess, IHasNutrientTank {
|
||||
|
||||
public static class TileFrankenZombieGenerator extends TileZombieGenerator {
|
||||
|
||||
public TileFrankenZombieGenerator() {
|
||||
baseOutputPerTick = Config.frankenzombieGeneratorRfPerTick;
|
||||
tickPerBucketOfFuel = Config.frankenzombieGeneratorTicksPerBucketFuel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockFrankenzombieGenerator.unlocalisedName;
|
||||
}
|
||||
}
|
||||
|
||||
public static class TileEnderGenerator extends TileZombieGenerator {
|
||||
|
||||
public TileEnderGenerator() {
|
||||
baseOutputPerTick = Config.enderGeneratorRfPerTick;
|
||||
tickPerBucketOfFuel = Config.enderGeneratorTicksPerBucketFuel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockEnderGenerator.unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Fluid getFluidType() {
|
||||
return EnderIO.fluidEnderDistillation;
|
||||
}
|
||||
}
|
||||
|
||||
private static int IO_MB_TICK = 250;
|
||||
|
||||
final SmartTank fuelTank = new SmartTank(EnderIO.fluidNutrientDistillation, FluidContainerRegistry.BUCKET_VOLUME * 2);
|
||||
final SmartTank fuelTank;
|
||||
|
||||
int outputPerTick = Config.zombieGeneratorRfPerTick;
|
||||
int tickPerBucketOfFuel = Config.zombieGeneratorTicksPerBucketFuel;
|
||||
int baseOutputPerTick;
|
||||
int tickPerBucketOfFuel;
|
||||
int minimumTankLevel;
|
||||
|
||||
private boolean tanksDirty;
|
||||
private boolean active = false;
|
||||
@@ -42,9 +75,14 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
|
||||
private boolean inPause;
|
||||
|
||||
public TileZombieGenerator() {
|
||||
super(new SlotDefinition(0, 0, 0));
|
||||
super(new SlotDefinition(0, 0, 1));
|
||||
fuelTank = new SmartTank(getFluidType(), FluidContainerRegistry.BUCKET_VOLUME * 2);
|
||||
baseOutputPerTick = Config.zombieGeneratorRfPerTick;
|
||||
tickPerBucketOfFuel = Config.zombieGeneratorTicksPerBucketFuel;
|
||||
minimumTankLevel = (int) (fuelTank.getCapacity()*0.7F);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
return ModObject.blockZombieGenerator.unlocalisedName;
|
||||
@@ -88,7 +126,7 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
|
||||
|
||||
@Override
|
||||
public int getPowerUsePerTick() {
|
||||
return outputPerTick;
|
||||
return getOutputPerTick();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,28 +184,28 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
|
||||
|
||||
//once full, don't start again until we have drained 10 seconds worth of power to prevent
|
||||
//flickering on and off constantly when powering a machine that draws less than this produces
|
||||
if (inPause && getEnergyStored() >= (getMaxEnergyStored() - (outputPerTick * 200)) && getEnergyStored() > (getMaxEnergyStored() / 8)) {
|
||||
if (inPause && getEnergyStored() >= (getMaxEnergyStored() - (getOutputPerTick() * 200)) && getEnergyStored() > (getMaxEnergyStored() / 8)) {
|
||||
return false;
|
||||
}
|
||||
inPause = false;
|
||||
|
||||
if(fuelTank.getFluidAmount() < getActivationAmount()) {
|
||||
if(fuelTank.getFluidAmount() < getActivationAmount()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
ticksRemaingFuel--;
|
||||
|
||||
|
||||
ticksRemaingFuel--;
|
||||
if(ticksRemaingFuel <= 0) {
|
||||
fuelTank.drain(1, true);
|
||||
ticksRemaingFuel = tickPerBucketOfFuel/1000;
|
||||
ticksRemaingFuel = tickPerBucketOfFuel/1000;
|
||||
tanksDirty = true;
|
||||
}
|
||||
setEnergyStored(getEnergyStored() + outputPerTick);
|
||||
}
|
||||
setEnergyStored(getEnergyStored() + getOutputPerTick());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int getActivationAmount() {
|
||||
return (int) (fuelTank.getCapacity() * 0.7f);
|
||||
return minimumTankLevel;
|
||||
}
|
||||
|
||||
private boolean transmitEnergy() {
|
||||
@@ -177,8 +215,8 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
|
||||
if(powerDis == null) {
|
||||
powerDis = new PowerDistributor(new BlockCoord(this));
|
||||
}
|
||||
int transmitted = powerDis.transmitEnergy(worldObj, Math.min(outputPerTick * 2, getEnergyStored()));
|
||||
setEnergyStored(getEnergyStored() - transmitted);
|
||||
int transmitted = powerDis.transmitEnergy(worldObj, Math.min(getOutputPerTick() * 2, getEnergyStored()));
|
||||
setEnergyStored(getEnergyStored() - transmitted);
|
||||
return transmitted > 0;
|
||||
}
|
||||
|
||||
@@ -219,7 +257,7 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
|
||||
public int getFluidStored(ForgeDirection from) {
|
||||
return fuelTank.getFluidAmount();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readCustomNBT(NBTTagCompound nbtRoot) {
|
||||
super.readCustomNBT(nbtRoot);
|
||||
@@ -257,7 +295,7 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
|
||||
|
||||
@Override
|
||||
public FluidTank getInputTank(FluidStack forFluidType) {
|
||||
if (forFluidType != null && forFluidType.getFluid() == EnderIO.fluidNutrientDistillation) {
|
||||
if (forFluidType != null && forFluidType.getFluid() == getFluidType()) {
|
||||
return fuelTank;
|
||||
}
|
||||
return null;
|
||||
@@ -278,4 +316,22 @@ public class TileZombieGenerator extends AbstractGeneratorEntity implements IFlu
|
||||
return fuelTank;
|
||||
}
|
||||
|
||||
protected Fluid getFluidType() {
|
||||
return EnderIO.fluidNutrientDistillation;
|
||||
}
|
||||
|
||||
public int getTicksPerBucketOfFuel() {
|
||||
return tickPerBucketOfFuel;
|
||||
}
|
||||
|
||||
public GeneratorType getGeneratorType(){
|
||||
return ((BlockZombieGenerator) worldObj.getBlock(xCoord, yCoord, zCoord)).getGeneratorType();
|
||||
}
|
||||
|
||||
public int getOutputPerTick(){
|
||||
int tier = MathHelper.clamp_int(getCapacitor().getTier(), 1, Config.zombieGeneratorsEnergyMultipliers.length);
|
||||
return (int)(baseOutputPerTick*Config.zombieGeneratorsEnergyMultipliers[tier-1]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+23
-21
@@ -1,18 +1,5 @@
|
||||
package crazypants.enderio.machine.generator.zombie;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
@@ -23,13 +10,27 @@ import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockFrankenZombieGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockEnderGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator.TileEnderGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator.TileFrankenZombieGenerator;
|
||||
import crazypants.util.RenderPassHelper;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ZombieGeneratorRenderer extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||
|
||||
private static final String TEXTURE = "enderio:models/ZombieJar.png";
|
||||
|
||||
private ModelZombieJar model = new ModelZombieJar();
|
||||
|
||||
@Override
|
||||
@@ -48,7 +49,7 @@ public class ZombieGeneratorRenderer extends TileEntitySpecialRenderer implement
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
if (RenderPassHelper.getEntityRenderPass() == 0) {
|
||||
renderModel(gen.facing);
|
||||
renderModel(gen.getGeneratorType(), gen.facing);
|
||||
} else if (RenderPassHelper.getEntityRenderPass() == 1) {
|
||||
renderFluid(gen);
|
||||
}
|
||||
@@ -106,7 +107,7 @@ public class ZombieGeneratorRenderer extends TileEntitySpecialRenderer implement
|
||||
}
|
||||
}
|
||||
|
||||
private void renderModel(int facing) {
|
||||
private void renderModel(GeneratorType gen, int facing) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
@@ -123,7 +124,7 @@ public class ZombieGeneratorRenderer extends TileEntitySpecialRenderer implement
|
||||
}
|
||||
GL11.glRotatef(facing * -90F, 0F, 1F, 0F);
|
||||
|
||||
RenderUtil.bindTexture(TEXTURE);
|
||||
RenderUtil.bindTexture(gen.getTexture());
|
||||
model.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
|
||||
GL11.glTranslatef(-0.5F, 0, -0.5F);
|
||||
@@ -143,15 +144,16 @@ public class ZombieGeneratorRenderer extends TileEntitySpecialRenderer implement
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
renderItem(0, 0, 0);
|
||||
renderItem(((BlockZombieGenerator) Block.getBlockFromItem(item.getItem())).getGeneratorType(),0,0,0);
|
||||
|
||||
}
|
||||
|
||||
private void renderItem(float x, float y, float z) {
|
||||
private void renderItem(GeneratorType gen, float x, float y, float z) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
renderModel(ForgeDirection.SOUTH.ordinal());
|
||||
renderModel(gen,ForgeDirection.SOUTH.ordinal());
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@@ -22,17 +22,20 @@ import crazypants.enderio.power.Capacitors;
|
||||
public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
|
||||
public static final int POWER_PER_TICK_ONE = Config.sliceAndSpliceLevelOnePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor(POWER_PER_TICK_ONE * 2,
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor(0,
|
||||
POWER_PER_TICK_ONE * 2,
|
||||
Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
POWER_PER_TICK_ONE);
|
||||
|
||||
public static final int POWER_PER_TICK_TWO = Config.sliceAndSpliceLevelTwoPowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor(POWER_PER_TICK_TWO * 2,
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor(0,
|
||||
POWER_PER_TICK_TWO * 2,
|
||||
Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
POWER_PER_TICK_TWO);
|
||||
|
||||
public static final int POWER_PER_TICK_THREE = Config.sliceAndSpliceLevelThreePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor(POWER_PER_TICK_THREE * 2,
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor(0,
|
||||
POWER_PER_TICK_THREE * 2,
|
||||
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored(),
|
||||
POWER_PER_TICK_THREE);
|
||||
|
||||
@@ -66,6 +69,8 @@ public class TileSliceAndSplice extends AbstractPoweredTaskEntity {
|
||||
case ENDER_CAPACITOR:
|
||||
setCapacitor(CAP_THREE);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,9 +38,9 @@ public class BlockItemSolarPanel extends ItemBlockWithMetadata implements IAdvan
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
String result = super.getUnlocalizedName(par1ItemStack);
|
||||
if(meta == 1) {
|
||||
result += ".advanced";
|
||||
}
|
||||
if(meta == 1) result += ".advanced";
|
||||
if(meta == 2) result += ".vibrant";
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,8 @@ public class BlockItemSolarPanel extends ItemBlockWithMetadata implements IAdvan
|
||||
par3List.add(stack);
|
||||
stack = new ItemStack(this, 1,1);
|
||||
par3List.add(stack);
|
||||
stack = new ItemStack(this, 1,2);
|
||||
par3List.add(stack);
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
@@ -70,9 +72,11 @@ public class BlockItemSolarPanel extends ItemBlockWithMetadata implements IAdvan
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack);
|
||||
int prod = Config.maxPhotovoltaicOutputRF;
|
||||
if(itemstack.getItemDamage() == 1) {
|
||||
if(itemstack.getItemDamage() == 1)
|
||||
prod = Config.maxPhotovoltaicAdvancedOutputRF;
|
||||
}
|
||||
if(itemstack.getItemDamage() == 2)
|
||||
prod = Config.maxPhotovoltaicVibrantOutputRF;
|
||||
|
||||
list.add(EnderIO.lang.localize("maxSolorProduction") + " " + PowerDisplayUtil.formatPowerPerTick(prod));
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@ public class BlockSolarPanel extends BlockEio implements IResourceTooltipProvide
|
||||
IIcon borderIcon;
|
||||
IIcon advancedBorderIcon;
|
||||
|
||||
IIcon vibrantIcon;
|
||||
IIcon vibrantSideIcon;
|
||||
IIcon vibrantBorderIcon;
|
||||
|
||||
private BlockSolarPanel() {
|
||||
super(ModObject.blockSolarPanel.unlocalisedName, TileEntitySolarPanel.class);
|
||||
if(!Config.photovoltaicCellEnabled) {
|
||||
@@ -80,13 +84,28 @@ public class BlockSolarPanel extends BlockEio implements IResourceTooltipProvide
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
if(side == ForgeDirection.UP.ordinal()) {
|
||||
return meta == 0 ? blockIcon : advancedIcon;
|
||||
switch(meta){
|
||||
case 0:return blockIcon;
|
||||
case 1:return advancedIcon;
|
||||
case 2:return vibrantIcon;
|
||||
default: return blockIcon;
|
||||
}
|
||||
}
|
||||
return meta == 0 ? sideIcon : advancedSideIcon;
|
||||
switch(meta){
|
||||
case 0:return sideIcon;
|
||||
case 1:return advancedSideIcon;
|
||||
case 2:return vibrantSideIcon;
|
||||
default: return sideIcon;
|
||||
}
|
||||
}
|
||||
|
||||
public IIcon getBorderIcon(int i, int meta) {
|
||||
return meta == 0 ? borderIcon : advancedBorderIcon;
|
||||
switch(meta){
|
||||
case 0:return borderIcon;
|
||||
case 1:return advancedBorderIcon;
|
||||
case 2:return vibrantBorderIcon;
|
||||
default: return borderIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,10 +126,14 @@ public class BlockSolarPanel extends BlockEio implements IResourceTooltipProvide
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
blockIcon = register.registerIcon("enderio:solarPanelTop");
|
||||
advancedIcon = register.registerIcon("enderio:solarPanelAdvancedTop");
|
||||
vibrantIcon = register.registerIcon("enderio:solarPanelVibrantTop");
|
||||
sideIcon = register.registerIcon("enderio:solarPanelSide");
|
||||
advancedSideIcon = register.registerIcon("enderio:solarPanelAdvancedSide");
|
||||
vibrantSideIcon = register.registerIcon("enderio:solarPanelVibrantSide");
|
||||
borderIcon = register.registerIcon("enderio:solarPanelBorder");
|
||||
advancedBorderIcon = register.registerIcon("enderio:solarPanelAdvancedBorder");
|
||||
vibrantBorderIcon = register.registerIcon("enderio:solarPanelVibrantBorder");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,24 +25,24 @@ import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.waila.IWailaNBTProvider;
|
||||
|
||||
public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowerProvider, IWailaNBTProvider {
|
||||
|
||||
|
||||
private final List<Receptor> receptors = new ArrayList<Receptor>();
|
||||
private ListIterator<Receptor> receptorIterator = receptors.listIterator();
|
||||
private boolean receptorsDirty = true;
|
||||
|
||||
private int lastCollectionValue = -1;
|
||||
|
||||
|
||||
private static final int CHECK_INTERVAL = 100;
|
||||
|
||||
|
||||
EnergyStorage destroyedNetworkBuffer = null;
|
||||
|
||||
|
||||
protected SolarPanelNetwork network = new SolarPanelNetwork();
|
||||
|
||||
public void onNeighborBlockChange() {
|
||||
receptorsDirty = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// RF Power
|
||||
|
||||
@@ -65,7 +65,7 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
public int getMaxEnergyStored(ForgeDirection from) {
|
||||
return getMaxEnergyStored();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyRecieved(ForgeDirection dir) {
|
||||
return 0;
|
||||
@@ -93,7 +93,7 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
}
|
||||
collectEnergy();
|
||||
transmitEnergy();
|
||||
|
||||
|
||||
if (network.isValid()) {
|
||||
if (destroyedNetworkBuffer != null) {
|
||||
network.addBuffer(destroyedNetworkBuffer);
|
||||
@@ -101,12 +101,12 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
}
|
||||
network.onUpdate(this);
|
||||
}
|
||||
|
||||
|
||||
if (!network.isValid() || (shouldDoWorkThisTick(20, 1) && network.addToNetwork(this))) {
|
||||
findNetwork();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
network.removeFromNetwork(this);
|
||||
@@ -147,16 +147,17 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
|
||||
private int getEnergyPerTick() {
|
||||
int meta = getBlockMetadata();
|
||||
if(meta == 0) {
|
||||
if(meta == 0)
|
||||
return Config.maxPhotovoltaicOutputRF;
|
||||
}
|
||||
return Config.maxPhotovoltaicAdvancedOutputRF;
|
||||
if(meta == 1)
|
||||
return Config.maxPhotovoltaicAdvancedOutputRF;
|
||||
return Config.maxPhotovoltaicVibrantOutputRF;
|
||||
}
|
||||
|
||||
float calculateLightRatio() {
|
||||
return calculateLightRatio(worldObj, xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
|
||||
boolean canSeeSun() {
|
||||
return worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord);
|
||||
}
|
||||
@@ -211,7 +212,7 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
appliedCount++;
|
||||
}
|
||||
|
||||
setEnergyStored(getEnergyStored() - transmitted);
|
||||
setEnergyStored(getEnergyStored() - transmitted);
|
||||
|
||||
return transmitted > 0;
|
||||
|
||||
@@ -269,7 +270,7 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
readFromNBT(pkt.func_148857_g());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean displayPower() {
|
||||
return true;
|
||||
@@ -278,7 +279,7 @@ public class TileEntitySolarPanel extends TileEntityEio implements IInternalPowe
|
||||
public void setNetwork(SolarPanelNetwork network) {
|
||||
this.network = network;
|
||||
}
|
||||
|
||||
|
||||
public boolean isMaster() {
|
||||
return network.getMaster() == this;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package crazypants.enderio.machine.soul;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.material.Material;
|
||||
|
||||
public class SoulBinderPrecientCystalRecipe extends AbstractSoulBinderRecipe {
|
||||
|
||||
public static SoulBinderPrecientCystalRecipe instance = new SoulBinderPrecientCystalRecipe();
|
||||
|
||||
private SoulBinderPrecientCystalRecipe() {
|
||||
super(Config.soulBinderPrecientCystalRF, Config.soulBinderPrecientCystalLevels, "SoulBinderPrecientCystalRecipe", "SpecialMobs.SpecialEnderman", "Enderman");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getInputStack() {
|
||||
return new ItemStack(EnderIO.itemMaterial, 1, Material.PULSATING_CYSTAL.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getOutputStack() {
|
||||
return new ItemStack(EnderIO.itemMaterial, 1, Material.PRECIENT_CRYSTAL.ordinal());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,6 +30,7 @@ public class SoulBinderRecipeManager {
|
||||
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderSentientRecipe.instance);
|
||||
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderEnderCystalRecipe.instance);
|
||||
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderAttractorCystalRecipe.instance);
|
||||
MachineRecipeRegistry.instance.registerRecipe(ModObject.blockSoulBinder.unlocalisedName, SoulBinderPrecientCystalRecipe.instance);
|
||||
|
||||
//Ender Rail
|
||||
if(Config.transceiverEnabled && Config.enderRailEnabled) {
|
||||
@@ -40,7 +41,7 @@ public class SoulBinderRecipeManager {
|
||||
}
|
||||
|
||||
// Example of how to add a recipe:
|
||||
//
|
||||
//
|
||||
// NBTTagCompound root = new NBTTagCompound();
|
||||
// root.setString(SoulBinderRecipeManager.KEY_RECIPE_UID, "diamondToWood");
|
||||
// root.setInteger(SoulBinderRecipeManager.KEY_REQUIRED_ENERGY, 50000);
|
||||
@@ -54,14 +55,14 @@ public class SoulBinderRecipeManager {
|
||||
// stackRoot = new NBTTagCompound();
|
||||
// is.writeToNBT(stackRoot);
|
||||
// root.setTag(SoulBinderRecipeManager.KEY_OUTPUT_STACK, stackRoot);
|
||||
//
|
||||
//
|
||||
// SoulBinderRecipeManager.getInstance().addRecipeFromNBT(root);
|
||||
// FMLInterModComms.sendMessage("EnderIO", "recipe:soulbinder", root);
|
||||
|
||||
//@formatter:off
|
||||
/**
|
||||
* Example of how to add a recipe:
|
||||
*
|
||||
*
|
||||
* NBTTagCompound root = new NBTTagCompound();
|
||||
* root.setString(SoulBinderRecipeManager.KEY_RECIPE_UID, "diamondToWood");
|
||||
* root.setInteger(SoulBinderRecipeManager.KEY_REQUIRED_ENERGY, 50000);
|
||||
@@ -75,10 +76,10 @@ public class SoulBinderRecipeManager {
|
||||
* stackRoot = new NBTTagCompound();
|
||||
* is.writeToNBT(stackRoot);
|
||||
* root.setTag(SoulBinderRecipeManager.KEY_OUTPUT_STACK, stackRoot);
|
||||
*
|
||||
*
|
||||
* SoulBinderRecipeManager.getInstance().addRecipeFromNBT(root);
|
||||
* FMLInterModComms.sendMessage("EnderIO", "recipe:soulbinder", root);
|
||||
*
|
||||
*
|
||||
* @param root
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -32,17 +32,17 @@ import crazypants.enderio.xp.XpUtil;
|
||||
public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveExperience, IFluidHandler, ITankAccess {
|
||||
|
||||
public static final int POWER_PER_TICK_ONE = Config.soulBinderLevelOnePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor(POWER_PER_TICK_ONE * 2,
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor(0,POWER_PER_TICK_ONE * 2,
|
||||
Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored(), POWER_PER_TICK_ONE);
|
||||
|
||||
public static final int POWER_PER_TICK_TWO = Config.soulBinderLevelTwoPowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor(POWER_PER_TICK_TWO * 2,
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor(0,POWER_PER_TICK_TWO * 2,
|
||||
Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored(), POWER_PER_TICK_TWO);
|
||||
|
||||
public static final int POWER_PER_TICK_THREE = Config.soulBinderLevelThreePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor(POWER_PER_TICK_THREE * 2,
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor(0,POWER_PER_TICK_THREE * 2,
|
||||
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored(), POWER_PER_TICK_THREE);
|
||||
|
||||
|
||||
private final ExperienceContainer xpCont = new ExperienceContainer(XpUtil.getExperienceForLevel(Config.soulBinderMaxXpLevel));
|
||||
|
||||
public TileSoulBinder() {
|
||||
@@ -50,20 +50,20 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExperienceContainer getContainer() {
|
||||
public ExperienceContainer getContainer() {
|
||||
return xpCont;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMachineName() {
|
||||
public String getMachineName() {
|
||||
return ModObject.blockSoulBinder.unlocalisedName;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean processTasks(boolean redstoneChecksPassed) {
|
||||
if(xpCont.isDirty()) {
|
||||
@@ -115,7 +115,7 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
}
|
||||
return ((ISoulBinderRecipe)nextRecipe).getExperienceLevelsRequired();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean startNextTask(IMachineRecipe nextRecipe, float chance) {
|
||||
@@ -136,17 +136,17 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
return false;
|
||||
}
|
||||
MachineRecipeInput newInput = new MachineRecipeInput(slot, item);
|
||||
int otherSlot = slot == 0 ? 1 : 0;
|
||||
int otherSlot = slot == 0 ? 1 : 0;
|
||||
if(inventory[otherSlot] == null) {
|
||||
List<IMachineRecipe> recipes = MachineRecipeRegistry.instance.getRecipesForInput(getMachineName(), newInput);
|
||||
if(recipes.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(IMachineRecipe rec : recipes) {
|
||||
if(rec != null && rec.isValidInput(newInput)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MachineRecipeInput[] inputs = new MachineRecipeInput[] {
|
||||
newInput,
|
||||
@@ -169,6 +169,22 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
case ENDER_CAPACITOR:
|
||||
setCapacitor(CAP_THREE);
|
||||
break;
|
||||
case CRYSTALLINE_CAPACITOR:
|
||||
break;
|
||||
case ENDERGETIC_CAPACITOR:
|
||||
break;
|
||||
case ENDERGISED_CAPACITOR:
|
||||
break;
|
||||
case MELODIC_CAPACITOR:
|
||||
break;
|
||||
case SILVER_CAPACITOR:
|
||||
break;
|
||||
case STELLAR_CAPACITOR:
|
||||
break;
|
||||
case TOTEMIC_CAPACITOR:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +197,7 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean doPush(ForgeDirection dir) {
|
||||
boolean res = super.doPush(dir);
|
||||
@@ -195,7 +211,7 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
/**
|
||||
* Determines how much stored XP can/should be removed because it is not
|
||||
* needed for the next recipe.
|
||||
*
|
||||
*
|
||||
* @return A number between 0 and the amount of stored XP
|
||||
*/
|
||||
private int getExcessXP() {
|
||||
@@ -209,10 +225,10 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid) {
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid) {
|
||||
return xpCont.canFill(from, fluid);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
|
||||
int max = XpUtil.experienceToLiquid(getXPRequired());
|
||||
@@ -240,17 +256,17 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) {
|
||||
return xpCont.drain(from, Math.min(XpUtil.experienceToLiquid(getExcessXP()), maxDrain), doDrain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid) {
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid) {
|
||||
return xpCont.canDrain(from, fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from) {
|
||||
return xpCont.getTankInfo(from);
|
||||
}
|
||||
|
||||
@@ -261,11 +277,11 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeCommon(NBTTagCompound nbtRoot) {
|
||||
public void writeCommon(NBTTagCompound nbtRoot) {
|
||||
super.writeCommon(nbtRoot);
|
||||
xpCont.writeToNBT(nbtRoot);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public FluidTank getInputTank(FluidStack forFluidType) {
|
||||
return xpCont;
|
||||
@@ -280,5 +296,5 @@ public class TileSoulBinder extends AbstractPoweredTaskEntity implements IHaveEx
|
||||
public void setTanksDirty() {
|
||||
xpCont.setDirty(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -25,14 +25,14 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
public static final int MAX_SPAWN_DELAY_BASE = Config.poweredSpawnerMaxDelayTicks;
|
||||
|
||||
public static final int POWER_PER_TICK_ONE = Config.poweredSpawnerLevelOnePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor((int) (POWER_PER_TICK_ONE * 1.25), Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored());
|
||||
private static final BasicCapacitor CAP_ONE = new BasicCapacitor(0, (int) (POWER_PER_TICK_ONE * 1.25), Capacitors.BASIC_CAPACITOR.capacitor.getMaxEnergyStored());
|
||||
|
||||
public static final int POWER_PER_TICK_TWO = Config.poweredSpawnerLevelTwoPowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor((int) (POWER_PER_TICK_TWO * 1.25),
|
||||
private static final BasicCapacitor CAP_TWO = new BasicCapacitor(0,(int) (POWER_PER_TICK_TWO * 1.25),
|
||||
Capacitors.ACTIVATED_CAPACITOR.capacitor.getMaxEnergyStored());
|
||||
|
||||
public static final int POWER_PER_TICK_THREE = Config.poweredSpawnerLevelThreePowerPerTickRF;
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor((int) (POWER_PER_TICK_THREE * 1.25),
|
||||
private static final BasicCapacitor CAP_THREE = new BasicCapacitor(0,(int) (POWER_PER_TICK_THREE * 1.25),
|
||||
Capacitors.ENDER_CAPACITOR.capacitor.getMaxEnergyStored());
|
||||
|
||||
public static final int MIN_PLAYER_DISTANCE = Config.poweredSpawnerMaxPlayerDistance;
|
||||
@@ -226,7 +226,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
|
||||
&& worldObj.getCollidingBoundingBoxes(entityliving, entityliving.boundingBox).isEmpty()
|
||||
&& (!worldObj.isAnyLiquid(entityliving.boundingBox) || entityliving.isCreatureType(EnumCreatureType.waterCreature, false));
|
||||
if(spaceClear && USE_VANILLA_SPAWN_CHECKS) {
|
||||
//Full checks for lighting, dimension etc
|
||||
//Full checks for lighting, dimension etc
|
||||
spaceClear = entityliving.getCanSpawnHere();
|
||||
}
|
||||
return spaceClear;
|
||||
|
||||
@@ -48,7 +48,6 @@ public class TileTransceiver extends AbstractPoweredTaskEntity implements IFluid
|
||||
private final SetMultimap<ChannelType, Channel> sendChannels = MultimapBuilder.enumKeys(ChannelType.class).hashSetValues().build();
|
||||
private final SetMultimap<ChannelType, Channel> recieveChannels = MultimapBuilder.enumKeys(ChannelType.class).hashSetValues().build();
|
||||
|
||||
private ICapacitor capacitor = new BasicCapacitor(Config.transceiverMaxIoRF * 2, 500000, Config.transceiverMaxIoRF);
|
||||
private boolean sendChannelsDirty = false;
|
||||
private boolean recieveChannelsDirty = false;
|
||||
private boolean registered = false;
|
||||
@@ -69,12 +68,12 @@ public class TileTransceiver extends AbstractPoweredTaskEntity implements IFluid
|
||||
|
||||
public TileTransceiver() {
|
||||
super(new SlotDefinition(8, 8, 0));
|
||||
|
||||
currentTask = new ContinuousTask(Config.transceiverUpkeepCostRF);
|
||||
railController = new EnderRailController(this);
|
||||
|
||||
sendItemFilter = new ItemFilter(true);
|
||||
recieveItemFilter = new ItemFilter(true);
|
||||
setCapacitor(new BasicCapacitor(0,Config.transceiverMaxIoRF * 2, 500000, Config.transceiverMaxIoRF));
|
||||
}
|
||||
|
||||
public EnderRailController getRailController() {
|
||||
@@ -161,11 +160,6 @@ public class TileTransceiver extends AbstractPoweredTaskEntity implements IFluid
|
||||
return hasPower();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapacitor getCapacitor() {
|
||||
return capacitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPowerUsePerTick() {
|
||||
return Config.transceiverUpkeepCostRF;
|
||||
@@ -260,7 +254,7 @@ public class TileTransceiver extends AbstractPoweredTaskEntity implements IFluid
|
||||
|
||||
static void readChannels(NBTTagCompound nbtRoot, SetMultimap<ChannelType, Channel> channels, String key) {
|
||||
channels.clear();
|
||||
|
||||
|
||||
if(!nbtRoot.hasKey(key)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,9 @@ public enum Alloy {
|
||||
CONDUCTIVE_IRON("conductiveIron", 5.2f),
|
||||
PHASED_IRON("phasedIron", 7.0f, "pulsatingIron"),
|
||||
DARK_STEEL("darkSteel", 10.0f),
|
||||
SOULARIUM("soularium", 10.0f);
|
||||
SOULARIUM("soularium", 10.0f),
|
||||
END_STEEL("endSteel", 10.0f);
|
||||
|
||||
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
@@ -54,6 +56,10 @@ public enum Alloy {
|
||||
return new ItemStack(EnderIO.itemAlloy, size, ordinal());
|
||||
}
|
||||
|
||||
public ItemStack getStackBall(int size) {
|
||||
return new ItemStack(EnderIO.itemGrindingBall, size, ordinal());
|
||||
}
|
||||
|
||||
public ItemStack getStackBlock() {
|
||||
return getStackBlock(1);
|
||||
}
|
||||
@@ -77,4 +83,5 @@ public enum Alloy {
|
||||
public List<String> getOreBlocks() {
|
||||
return oreBlocks;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import net.minecraft.block.BlockPane;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class BlockDarkSteelBars extends BlockPane {
|
||||
|
||||
public static class BlockSoulariumBars extends BlockDarkSteelBars {
|
||||
|
||||
public BlockSoulariumBars() {
|
||||
super(ModObject.blockSoulariumBars, "blockSoulariumBars");
|
||||
setBlockName(ModObject.blockSoulariumBars.unlocalisedName);
|
||||
}
|
||||
|
||||
public static BlockSoulariumBars create() {
|
||||
BlockSoulariumBars res = new BlockSoulariumBars();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class BlockEndSteelBars extends BlockDarkSteelBars {
|
||||
|
||||
public BlockEndSteelBars() {
|
||||
super(ModObject.blockEndSteelBars, "blockEndSteelBars");
|
||||
setBlockName(ModObject.blockEndSteelBars.unlocalisedName);
|
||||
}
|
||||
|
||||
public static BlockEndSteelBars create() {
|
||||
BlockEndSteelBars res = new BlockEndSteelBars();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static BlockDarkSteelBars create() {
|
||||
BlockDarkSteelBars res = new BlockDarkSteelBars();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
ModObject modObj;
|
||||
|
||||
public BlockDarkSteelBars(ModObject obj, String name) {
|
||||
super("enderio:"+name, "enderio:"+name, Material.iron, true);
|
||||
this.modObj = obj;
|
||||
setResistance(2000.0F); //TNT Proof
|
||||
setHardness(5.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setBlockName(obj.unlocalisedName);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
}
|
||||
|
||||
public BlockDarkSteelBars() {
|
||||
this(ModObject.blockDarkIronBars,"blockDarkIronBars");
|
||||
}
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(this, BlockItemDarkIronBars.class, modObj.unlocalisedName);
|
||||
OreDictionary.registerOre("barsIron", this);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,20 +6,23 @@ public enum FrankenSkull {
|
||||
ZOMBIE_CONTROLLER("skullZombieController", false),
|
||||
FRANKEN_ZOMBIE("skullZombieFrankenstien", "enderio:skullZombieController", true),
|
||||
ENDER_RESONATOR("skullEnderResonator", "enderio:skullEnderResonator", false),
|
||||
SENTIENT_ENDER("skullSentientEnder", "enderio:skullEnderResonator", true);
|
||||
|
||||
SENTIENT_ENDER("skullSentientEnder", "enderio:skullEnderResonator", true),
|
||||
SKELETAL_CONTRACTOR("skullSkeletalContractor", "enderio:skullSkeletalContractor", false),
|
||||
GUARDIAN_DIODE("skullGuardianDiode", "enderio:skullGuardianDiode", false);
|
||||
|
||||
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
public final boolean isAnimated;
|
||||
|
||||
|
||||
private FrankenSkull(String unlocalisedName, String iconKey, boolean isAnimated) {
|
||||
this.unlocalisedName = unlocalisedName;
|
||||
this.iconKey = iconKey;
|
||||
this.isAnimated = isAnimated;
|
||||
}
|
||||
|
||||
|
||||
private FrankenSkull(String unlocalisedName, boolean isAnimated) {
|
||||
this(unlocalisedName, "enderio:" + unlocalisedName, isAnimated);
|
||||
this(unlocalisedName, "enderio:" + unlocalisedName, isAnimated);
|
||||
}
|
||||
|
||||
public String getUnlocalisedName() {
|
||||
@@ -29,5 +32,5 @@ public enum FrankenSkull {
|
||||
public String getIconKey() {
|
||||
return iconKey;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -18,8 +18,8 @@ public class ItemAlloy extends Item {
|
||||
|
||||
static final boolean useNuggets = false;
|
||||
|
||||
private final IIcon[] icons;
|
||||
private final int numItems;
|
||||
protected final IIcon[] icons;
|
||||
protected final int numItems;
|
||||
|
||||
public static ItemAlloy create() {
|
||||
ItemAlloy alloy = new ItemAlloy();
|
||||
@@ -27,7 +27,7 @@ public class ItemAlloy extends Item {
|
||||
return alloy;
|
||||
}
|
||||
|
||||
private ItemAlloy() {
|
||||
protected ItemAlloy() {
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
|
||||
@@ -4,6 +4,8 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -76,15 +78,26 @@ public class ItemCapacitor extends Item implements ICapacitorItem {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < Capacitors.values().length; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
if(Capacitors.values()[j] == Capacitors.TOTEMIC_CAPACITOR) {
|
||||
ItemStack stack = new ItemStack(par1, 1, j);
|
||||
stack.addEnchantment(Enchantment.efficiency, 5);
|
||||
par3List.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapacitor getCapacitor(ItemStack stack) {
|
||||
int damage = MathHelper.clamp_int(stack.getItemDamage(), 0, Capacitors.values().length - 1);
|
||||
|
||||
if(Capacitors.values()[damage] == Capacitors.TOTEMIC_CAPACITOR) {
|
||||
damage = MathHelper.clamp_int(EnchantmentHelper.getEnchantmentLevel(Enchantment.efficiency.effectId, stack)+1, 1, Capacitors.TOTEMIC_CAPACITOR.ordinal());
|
||||
}
|
||||
|
||||
return Capacitors.values()[damage].capacitor;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.ModObject;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemGrindingBall extends ItemAlloy {
|
||||
|
||||
public static ItemGrindingBall create() {
|
||||
ItemGrindingBall ball = new ItemGrindingBall();
|
||||
ball.init();
|
||||
return ball;
|
||||
}
|
||||
|
||||
private ItemGrindingBall() {
|
||||
setUnlocalizedName(ModObject.itemGrindingBall.unlocalisedName);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemGrindingBall.unlocalisedName);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, numItems - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
int numAlloys = Alloy.values().length;
|
||||
for (int i = 0; i < numAlloys; i++)
|
||||
icons[i] = IIconRegister.registerIcon(Alloy.values()[i].iconKey+"GrindingBall");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, numItems - 1);
|
||||
return Alloy.values()[i].unlocalisedName+"_ball";
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,10 @@ import org.apache.commons.lang3.StringUtils;
|
||||
public enum MachinePart {
|
||||
|
||||
MACHINE_CHASSI("machineChassi"),
|
||||
BASIC_GEAR("basicGear");
|
||||
BASIC_GEAR("basicGear"),
|
||||
SOUL_MACHINE_CHASSIS("soulMachineChassi"),
|
||||
END_STEEL_MACHINE_CHASSIS("endSteelMachineChassi");
|
||||
|
||||
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
@@ -20,7 +23,7 @@ public enum MachinePart {
|
||||
this.iconKey = "enderio:" + unlocalisedName;
|
||||
this.oreDict = "item" + StringUtils.capitalize(unlocalisedName);
|
||||
}
|
||||
|
||||
|
||||
public static void registerOres(Item item) {
|
||||
for (MachinePart m : values()) {
|
||||
OreDictionary.registerOre(m.oreDict, new ItemStack(item, 1, m.ordinal()));
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MachinePartRenderer implements IItemRenderer {
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
if(item != null && item.getItemDamage() == MachinePart.MACHINE_CHASSI.ordinal()) {
|
||||
if(item != null && item.getItemDamage() != MachinePart.BASIC_GEAR.ordinal()) {
|
||||
return type == ItemRenderType.ENTITY || type == ItemRenderType.EQUIPPED || type == ItemRenderType.INVENTORY
|
||||
|| type == ItemRenderType.EQUIPPED_FIRST_PERSON;
|
||||
} else {
|
||||
|
||||
@@ -20,7 +20,17 @@ public enum Material {
|
||||
DARK_GRINDING_BALL("darkGrindingBall"),
|
||||
ENDER_CRYSTAL("enderCrystal", true),
|
||||
ATTRACTOR_CRYSTAL("attractorCrystal", true),
|
||||
WEATHER_CRYSTAL("weatherCrystal", true);
|
||||
WEATHER_CRYSTAL("weatherCrystal", true),
|
||||
END_STEEL_NUGGET("endSteelNugget"),
|
||||
DARK_STEEL_ROD("darkSteelRod"),
|
||||
PRECIENT_CRYSTAL("precientCrystal",true),
|
||||
PULSATING_POWDER("pulsatingPowder", true),
|
||||
VIBRANT_POWDER("vibrantPowder", true),
|
||||
ENDER_POWDER("enderCrystalPowder", true),
|
||||
PRECIENT_POWDER("precientPowder",true);
|
||||
|
||||
|
||||
|
||||
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
@@ -47,7 +57,7 @@ public enum Material {
|
||||
public ItemStack getStack() {
|
||||
return getStack(1);
|
||||
}
|
||||
|
||||
|
||||
public ItemStack getStack(int size) {
|
||||
return new ItemStack(EnderIO.itemMaterial, size, ordinal());
|
||||
}
|
||||
|
||||
@@ -14,11 +14,14 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.ItemEnderFood.EnderFood;
|
||||
import crazypants.enderio.material.endergy.AlloyEndergy;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
|
||||
import static crazypants.enderio.power.Capacitors.*;
|
||||
import static com.enderio.core.common.util.OreDictionaryHelper.*;
|
||||
import static crazypants.enderio.EnderIO.itemBasicCapacitor;
|
||||
import static crazypants.enderio.material.Alloy.*;
|
||||
import static crazypants.enderio.material.Material.*;
|
||||
import static crazypants.enderio.material.endergy.AlloyEndergy.*;
|
||||
import static crazypants.util.RecipeUtil.*;
|
||||
|
||||
public class MaterialRecipes {
|
||||
@@ -41,7 +44,11 @@ public class MaterialRecipes {
|
||||
OreDictionary.registerOre(powder.oreDictName, new ItemStack(EnderIO.itemPowderIngot, 1, powder.ordinal()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(Capacitors capacitor: Capacitors.values()){
|
||||
OreDictionary.registerOre(capacitor.getOreTag(), new ItemStack(EnderIO.itemBasicCapacitor,1,capacitor.ordinal()));
|
||||
}
|
||||
|
||||
for (Alloy alloy : Alloy.values()) {
|
||||
boolean isPrimaryName = true;
|
||||
for (String oreDictName : alloy.getOreIngots()) {
|
||||
@@ -66,8 +73,33 @@ public class MaterialRecipes {
|
||||
}
|
||||
}
|
||||
|
||||
for (AlloyEndergy alloy : AlloyEndergy.values()) {
|
||||
boolean isPrimaryName = true;
|
||||
for (String oreDictName : alloy.getOreIngots()) {
|
||||
OreDictionary.registerOre(oreDictName, alloy.getStackIngot());
|
||||
if (isPrimaryName) {
|
||||
isPrimaryName = false;
|
||||
} else {
|
||||
// Allow free conversion of additional/legacy oreDict name items into
|
||||
// our item because we only register recipes for the primary oreDict
|
||||
// name. Use a 2-to-2 recipe because the 1-to-n is already in use.
|
||||
addShapeless(alloy.getStackIngot(2), oreDictName, oreDictName);
|
||||
}
|
||||
}
|
||||
isPrimaryName = true;
|
||||
for (String oreDictName : alloy.getOreBlocks()) {
|
||||
OreDictionary.registerOre(oreDictName, alloy.getStackBlock());
|
||||
if (isPrimaryName) {
|
||||
isPrimaryName = false;
|
||||
} else {
|
||||
addShapeless(alloy.getStackBlock(2), oreDictName, oreDictName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OreDictionary.registerOre("nuggetPulsatingIron", new ItemStack(EnderIO.itemMaterial, 1, Material.PHASED_IRON_NUGGET.ordinal()));
|
||||
OreDictionary.registerOre("nuggetVibrantAlloy", new ItemStack(EnderIO.itemMaterial, 1, Material.VIBRANT_NUGGET.ordinal()));
|
||||
OreDictionary.registerOre("nuggetEndSteel", new ItemStack(EnderIO.itemMaterial, 1, Material.END_STEEL_NUGGET.ordinal()));
|
||||
|
||||
OreDictionary.registerOre("glass", Blocks.glass);
|
||||
OreDictionary.registerOre("stickWood", Items.stick);
|
||||
@@ -106,8 +138,54 @@ public class MaterialRecipes {
|
||||
String phasedGold = PHASED_GOLD.getOreIngot();
|
||||
String phasedIron = PHASED_IRON.getOreIngot();
|
||||
String darkSteel = DARK_STEEL.getOreIngot();
|
||||
String soularium = SOULARIUM.getOreIngot();
|
||||
String endSteel = END_STEEL.getOreIngot();
|
||||
|
||||
ItemStack capacitor = new ItemStack(itemBasicCapacitor, 1, 0);
|
||||
String energeticSilver = ENERGETIC_SILVER.getOreIngot();
|
||||
String vividAlloy = VIVID_ALLOY.getOreIngot();
|
||||
String crystallineAlloy = CRYSTALLINE_ALLOY.getOreIngot();
|
||||
String melodicAlloy = MELODIC_ALLOY.getOreIngot();
|
||||
String stellarAlloy = STELLAR_ALLOY.getOreIngot();
|
||||
|
||||
String capacitor = Capacitors.BASIC_CAPACITOR.getOreTag();
|
||||
String capacitorAdv = Capacitors.ACTIVATED_CAPACITOR.getOreTag();
|
||||
String capacitorEnder = Capacitors.ENDER_CAPACITOR.getOreTag();
|
||||
String capacitorCrystal = Capacitors.CRYSTALLINE_CAPACITOR.getOreTag();
|
||||
String capacitorMelodic = Capacitors.MELODIC_CAPACITOR.getOreTag();
|
||||
|
||||
String ingotCopper = OreDictionary.doesOreNameExist("ingotCopper") && Config.useModMetals ? "ingotCopper": "ingotIron";
|
||||
|
||||
//Capacitors
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(BASIC_CAPACITOR.getItemStack(), " gr", "gig", "rg ", 'r', "dustRedstone", 'g', "ingotGold", 'i', ingotCopper);
|
||||
addShaped(ACTIVATED_CAPACITOR.getItemStack(), "iii", "cCc", "iii", 'i', energeticAlloy, 'c', BASIC_CAPACITOR.getItemStack(), 'C', "dustCoal");
|
||||
addShaped(ENDER_CAPACITOR.getItemStack(), "iii", "cCc", "iii", 'i', phasedGold, 'c', ACTIVATED_CAPACITOR.getItemStack(), 'C', "glowstone");
|
||||
|
||||
String prismarine = OreDictionary.doesOreNameExist("shardPrismarine") ? "shardPrismarine": "itemPulsatingCrystal";
|
||||
addShaped(CRYSTALLINE_CAPACITOR.getItemStack(), "iii", "cCc", "iii", 'i', crystallineAlloy, 'c', capacitorEnder, 'C', prismarine);
|
||||
addShaped(MELODIC_CAPACITOR.getItemStack(), "iii", "cCc", "iii", 'i', melodicAlloy, 'c', CRYSTALLINE_CAPACITOR.getItemStack(), 'C', endSteel);
|
||||
addShaped(STELLAR_CAPACITOR.getItemStack(), "iii", "cCc", "iii", 'i', stellarAlloy, 'c', MELODIC_CAPACITOR.getItemStack(), 'C', PRECIENT_CRYSTAL.oreDict);
|
||||
|
||||
addShaped(SILVER_CAPACITOR.getItemStack(), " sr", "sis", "rs ", 'r', "dustRedstone", 's', "ingotSilver", 'i', "ingotLead");
|
||||
addShaped(ENDERGETIC_CAPACITOR.getItemStack(), "iii", "cCc", "iii", 'i', energeticSilver, 'c', SILVER_CAPACITOR.getItemStack(), 'C', "dustCoal");
|
||||
addShaped(ENDERGISED_CAPACITOR.getItemStack(), "iii", "cCc", "iii", 'i', vividAlloy, 'c', ENDERGETIC_CAPACITOR.getItemStack(), 'C', "glowstone");
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
addShaped(BASIC_CAPACITOR.getItemStack(), " gr", "gig", "rg ", 'r', "dustRedstone", 'g', "ingotGold", 'i', ingotCopper);
|
||||
addShaped(ACTIVATED_CAPACITOR.getItemStack(), " i ", "cCc", " i ", 'i', energeticAlloy, 'c', BASIC_CAPACITOR.getItemStack(), 'C', "dustCoal");
|
||||
addShaped(ENDER_CAPACITOR.getItemStack(), " i ", "cCc", " i ", 'i', phasedGold, 'c', ACTIVATED_CAPACITOR.getItemStack(), 'C', "glowstone");
|
||||
|
||||
String prismarine = OreDictionary.doesOreNameExist("shardPrismarine") ? "shardPrismarine": "itemPulsatingCrystal";
|
||||
addShaped(CRYSTALLINE_CAPACITOR.getItemStack(), " i ", "cCc", " i ", 'i', crystallineAlloy, 'c', capacitorEnder, 'C', prismarine);
|
||||
addShaped(MELODIC_CAPACITOR.getItemStack(), " i ", "cCc", " i ", 'i', melodicAlloy, 'c', CRYSTALLINE_CAPACITOR.getItemStack(), 'C', endSteel);
|
||||
addShaped(STELLAR_CAPACITOR.getItemStack(), " i ", "cCc", " i ", 'i', stellarAlloy, 'c', MELODIC_CAPACITOR.getItemStack(), 'C', PRECIENT_CRYSTAL.oreDict);
|
||||
|
||||
addShaped(SILVER_CAPACITOR.getItemStack(), " sr", "sis", "rs ", 'r', "dustRedstone", 's', "ingotSilver", 'i', "ingotLead");
|
||||
addShaped(ENDERGETIC_CAPACITOR.getItemStack(), " i ", "cCc", " i ", 'i', energeticSilver, 'c', SILVER_CAPACITOR.getItemStack(), 'C', "dustCoal");
|
||||
addShaped(ENDERGISED_CAPACITOR.getItemStack(), " i ", "cCc", " i ", 'i', vividAlloy, 'c', ENDERGETIC_CAPACITOR.getItemStack(), 'C', "glowstone");
|
||||
}
|
||||
|
||||
//Conduit Binder
|
||||
ItemStack cbc = BINDER_COMPOSITE.getStack(8);
|
||||
@@ -131,6 +209,12 @@ public class MaterialRecipes {
|
||||
vibrantNugget.stackSize = 1;
|
||||
addShaped(PHASED_GOLD.getStackIngot(), "eee", "eee", "eee", 'e', vibrantNugget);
|
||||
|
||||
ItemStack endSteelNugget = new ItemStack(EnderIO.itemMaterial, 9, Material.END_STEEL_NUGGET.ordinal());
|
||||
addShapeless(endSteelNugget, endSteel);
|
||||
endSteelNugget = endSteelNugget.copy();
|
||||
endSteelNugget.stackSize = 1;
|
||||
addShaped(END_STEEL.getStackIngot(), "eee", "eee", "eee", 'e', endSteelNugget);
|
||||
|
||||
//Crystals
|
||||
ItemStack pulsCry = new ItemStack(EnderIO.itemMaterial, 1, Material.PULSATING_CYSTAL.ordinal());
|
||||
addShaped(pulsCry, "nnn", "ngn", "nnn", 'n', phasedIronNugget, 'g', "gemDiamond");
|
||||
@@ -138,10 +222,6 @@ public class MaterialRecipes {
|
||||
ItemStack vibCry = new ItemStack(EnderIO.itemMaterial, 1, Material.VIBRANT_CYSTAL.ordinal());
|
||||
addShaped(vibCry, "nnn", "ngn", "nnn", 'n', vibrantNugget, 'g', "gemEmerald");
|
||||
|
||||
//Balls
|
||||
ItemStack darkBall = new ItemStack(EnderIO.itemMaterial, 5, Material.DARK_GRINDING_BALL.ordinal());
|
||||
addShaped(darkBall, " s ", "sss", " s ", 's', darkSteel);
|
||||
|
||||
//Smelting
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
@@ -159,6 +239,14 @@ public class MaterialRecipes {
|
||||
ItemStack diBars = new ItemStack(EnderIO.blockDarkIronBars, 16, 0);
|
||||
addShaped(diBars, "ddd", "ddd", 'd', darkSteel);
|
||||
|
||||
//Dark Iron Bars
|
||||
ItemStack soBars = new ItemStack(EnderIO.blockSoulariumBars, 16, 0);
|
||||
addShaped(soBars, "ddd", "ddd", 'd', soularium);
|
||||
|
||||
//Dark Iron Bars
|
||||
ItemStack esBars = new ItemStack(EnderIO.blockEndSteelBars, 16, 0);
|
||||
addShaped(esBars, "ddd", "ddd", 'd', endSteel);
|
||||
|
||||
// Fused Quartz Frame
|
||||
addShaped(fusedQuartzFrame, "bsb", "s s", "bsb", 'b', conduitBinder, 's', "stickWood");
|
||||
addShaped(fusedQuartzFrame, "bsb", "s s", "bsb", 'b', conduitBinder, 's', "woodStick");
|
||||
@@ -171,20 +259,18 @@ public class MaterialRecipes {
|
||||
String mat = Config.useSteelInChassi == true && steelIngots != null && !steelIngots.isEmpty() ? "ingotSteel" : "ingotIron";
|
||||
addShaped(chassis, "fif", "ici", "fif", 'f', Blocks.iron_bars, 'i', mat, 'c', capacitor);
|
||||
|
||||
ItemStack soulchassis = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.SOUL_MACHINE_CHASSIS.ordinal());
|
||||
addShaped(soulchassis, "fif", "ici", "fif", 'f', EnderIO.blockSoulariumBars, 'i', Alloy.SOULARIUM.getOreIngot(), 'c', capacitor);
|
||||
|
||||
ItemStack endchassis = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.END_STEEL_MACHINE_CHASSIS.ordinal());
|
||||
addShaped(endchassis, "fif", "ici", "fif", 'f', EnderIO.blockEndSteelBars, 'i', Alloy.END_STEEL.getOreIngot(), 'c', capacitor);
|
||||
|
||||
|
||||
// Basic Gear
|
||||
ItemStack gear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
addShaped(gear, "scs", "c c", "scs", 's', "stickWood", 'c', "cobblestone");
|
||||
addShaped(gear, "scs", "c c", "scs", 's', "woodStick", 'c', "cobblestone");
|
||||
|
||||
//Ender Capacitor
|
||||
ItemStack enderCapacitor = new ItemStack(EnderIO.itemBasicCapacitor, 1, 2);
|
||||
ItemStack activatedCapacitor = new ItemStack(EnderIO.itemBasicCapacitor, 1, 1);
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(enderCapacitor, "eee", "cgc", "eee", 'e', phasedGold, 'c', activatedCapacitor, 'g', "glowstone");
|
||||
} else {
|
||||
addShaped(enderCapacitor, " e ", "cgc", " e ", 'e', phasedGold, 'c', activatedCapacitor, 'g', "glowstone");
|
||||
}
|
||||
|
||||
// Weather Crystal
|
||||
ItemStack main = Config.useHardRecipes ? new ItemStack(EnderIO.itemMaterial, 1, Material.VIBRANT_CYSTAL.ordinal()) : new ItemStack(Items.diamond);
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(EnderIO.itemMaterial, 1, Material.WEATHER_CRYSTAL.ordinal()), main /* TODO figure out new weather crystal recipe */));
|
||||
@@ -204,46 +290,38 @@ public class MaterialRecipes {
|
||||
|
||||
for (Alloy alloy : Alloy.values()) {
|
||||
addShaped(alloy.getStackBlock(), "iii", "iii", "iii", 'i', alloy.getOreIngot());
|
||||
addShaped(alloy.getStackBall(5), " i ", "iii", " i ", 'i', alloy.getOreIngot());
|
||||
addShapeless(alloy.getStackIngot(9), alloy.getOreBlock());
|
||||
}
|
||||
|
||||
for (AlloyEndergy alloy : AlloyEndergy.values()) {
|
||||
addShaped(alloy.getStackBlock(), "iii", "iii", "iii", 'i', alloy.getOreIngot());
|
||||
addShaped(alloy.getStackBall(5), " i ", "iii", " i ", 'i', alloy.getOreIngot());
|
||||
addShapeless(alloy.getStackIngot(9), alloy.getOreBlock());
|
||||
}
|
||||
|
||||
//DS Rod
|
||||
ItemStack darkRod = new ItemStack(EnderIO.itemMaterial, 1, Material.DARK_STEEL_ROD.ordinal());
|
||||
addShaped(darkRod, " ns", "nsn", "sn ", 's', darkSteel,'n', endSteelNugget);
|
||||
|
||||
//Food
|
||||
ItemStack flour = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack bread = new ItemStack(Items.bread, 1, 0);
|
||||
|
||||
GameRegistry.addSmelting(flour, bread, 0.35f);
|
||||
|
||||
|
||||
ItemStack enderios = EnderFood.ENDERIOS.getStack();
|
||||
addShapeless(enderios, Items.bowl, Items.milk_bucket, "cropWheat", "dustEnderPearl");
|
||||
|
||||
if (hasCopper()) {
|
||||
ItemStack dustCopper = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COPPER.ordinal());
|
||||
ItemStack ingotCopper = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCopper, 0);
|
||||
ItemStack ingotCoppper = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCoppper, 0);
|
||||
}
|
||||
if (hasTin()) {
|
||||
ItemStack dustTin = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_TIN.ordinal());
|
||||
ItemStack ingotTin = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_TIN);
|
||||
GameRegistry.addSmelting(dustTin, ingotTin, 0);
|
||||
}
|
||||
|
||||
ArrayList<ItemStack> copperIngots = OreDictionary.getOres("ingotCopper");
|
||||
String gold;
|
||||
if (Config.useHardRecipes) {
|
||||
gold = "ingotGold";
|
||||
} else {
|
||||
gold = "nuggetGold";
|
||||
}
|
||||
if (copperIngots != null && !copperIngots.isEmpty() && Config.useModMetals) {
|
||||
addShaped(capacitor, " gr", "gcg", "rg ", 'r', "dustRedstone", 'g', gold, 'c', "ingotCopper");
|
||||
} else {
|
||||
addShaped(capacitor, " gr", "gig", "rg ", 'r', "dustRedstone", 'g', gold, 'i', "ingotIron");
|
||||
}
|
||||
|
||||
if (Config.useHardRecipes) {
|
||||
addShaped(activatedCapacitor, "eee", "cCc", "eee", 'e', energeticAlloy, 'c', capacitor, 'C', "dustCoal");
|
||||
} else {
|
||||
addShaped(activatedCapacitor, " e ", "cCc", " e ", 'e', energeticAlloy, 'c', capacitor, 'C', "dustCoal");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
public enum AlloyEndergy {
|
||||
|
||||
CRUDE_STEEL("crudeSteel", 2.0f),
|
||||
CRYSTALLINE_ALLOY("crystallineAlloy", 6.0f),
|
||||
MELODIC_ALLOY("melodicAlloy", 5.0f),
|
||||
STELLAR_ALLOY("stellarAlloy", 10.0f),
|
||||
CRYSTALLINE_PINK_SLIME("crystallinePinkSlime", 7.0f),
|
||||
ENERGETIC_SILVER("energeticSilver", 7.0f),
|
||||
VIVID_ALLOY("vividAlloy", 4.0f);
|
||||
|
||||
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
private final List<String> oreIngots = new ArrayList<String>();
|
||||
private final List<String> oreBlocks = new ArrayList<String>();
|
||||
private final float hardness;
|
||||
|
||||
private AlloyEndergy(String baseName, float hardness, String oreDictName) {
|
||||
this.unlocalisedName = "enderio." + baseName;
|
||||
this.iconKey = "enderio:" + baseName;
|
||||
if(oreDictName != null) {
|
||||
this.oreIngots.add("ingot" + StringUtils.capitalize(oreDictName));
|
||||
this.oreBlocks.add("block" + StringUtils.capitalize(oreDictName));
|
||||
}
|
||||
this.oreIngots.add("ingot" + StringUtils.capitalize(baseName));
|
||||
this.oreBlocks.add("block" + StringUtils.capitalize(baseName));
|
||||
this.hardness = hardness;
|
||||
}
|
||||
|
||||
private AlloyEndergy(String baseName, float hardness) {
|
||||
this(baseName, hardness, null);
|
||||
}
|
||||
|
||||
public float getHardness() {
|
||||
return hardness;
|
||||
}
|
||||
|
||||
public ItemStack getStackIngot() {
|
||||
return getStackIngot(1);
|
||||
}
|
||||
|
||||
public ItemStack getStackIngot(int size) {
|
||||
return new ItemStack(EnderIO.itemAlloyEndergy, size, ordinal());
|
||||
}
|
||||
|
||||
public ItemStack getStackBall(int size) {
|
||||
return new ItemStack(EnderIO.itemGrindingBallEndergy, size, ordinal());
|
||||
}
|
||||
|
||||
public ItemStack getStackBlock() {
|
||||
return getStackBlock(1);
|
||||
}
|
||||
|
||||
public ItemStack getStackBlock(int size) {
|
||||
return new ItemStack(EnderIO.blockIngotStorageEndergy, size, ordinal());
|
||||
}
|
||||
|
||||
public String getOreIngot() {
|
||||
return oreIngots.get(0);
|
||||
}
|
||||
|
||||
public String getOreBlock() {
|
||||
return oreBlocks.get(0);
|
||||
}
|
||||
|
||||
public List<String> getOreIngots() {
|
||||
return oreIngots;
|
||||
}
|
||||
|
||||
public List<String> getOreBlocks() {
|
||||
return oreBlocks;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class BlockIngotStorageEndergy extends BlockEio implements IAdvancedTooltipProvider {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon[] icons;
|
||||
|
||||
public static BlockIngotStorageEndergy create() {
|
||||
BlockIngotStorageEndergy res = new BlockIngotStorageEndergy();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
private BlockIngotStorageEndergy() {
|
||||
super(ModObject.blockIngotStorageEndergy.unlocalisedName, null, Material.iron);
|
||||
setStepSound(soundTypeMetal);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
GameRegistry.registerBlock(this, BlockItemIngotStorageEndergy.class, ModObject.blockIngotStorageEndergy.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
icons = new IIcon[AlloyEndergy.values().length];
|
||||
for (AlloyEndergy alloy : AlloyEndergy.values()) {
|
||||
icons[alloy.ordinal()] = register.registerIcon(alloy.iconKey + "Block");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
meta = MathHelper.clamp_int(meta, 0, AlloyEndergy.values().length - 1);
|
||||
return icons[meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamageValue(World world, int x, int y, int z) {
|
||||
return world.getBlockMetadata(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBlockHardness(World world, int x, int y, int z) {
|
||||
return AlloyEndergy.values()[world.getBlockMetadata(x, y, z)].getHardness();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX, double explosionY, double explosionZ) {
|
||||
return getBlockHardness(world, x, y, z) * 2.0f; // vanilla default is / 5.0f, this means hardness*2 = resistance
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean shouldWrench(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
list.add(EnderIO.lang.localize("tooltip.isBeaconBase"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List list, boolean flag) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class BlockItemIngotStorageEndergy extends ItemBlock {
|
||||
|
||||
public BlockItemIngotStorageEndergy(Block block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
return "tile." + AlloyEndergy.values()[stack.getItemDamage()].unlocalisedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage) {
|
||||
return damage;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (AlloyEndergy alloy : AlloyEndergy.values()) {
|
||||
list.add(new ItemStack(this, 1, alloy.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
|
||||
public class ItemAlloyEndergy extends Item {
|
||||
|
||||
static final boolean useNuggets = false;
|
||||
|
||||
protected final IIcon[] icons;
|
||||
protected final int numItems;
|
||||
|
||||
public static ItemAlloyEndergy create() {
|
||||
ItemAlloyEndergy alloy = new ItemAlloyEndergy();
|
||||
alloy.init();
|
||||
return alloy;
|
||||
}
|
||||
|
||||
protected ItemAlloyEndergy() {
|
||||
setHasSubtypes(true);
|
||||
setMaxDamage(0);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
setUnlocalizedName(ModObject.itemAlloyEndergy.unlocalisedName);
|
||||
|
||||
numItems = AlloyEndergy.values().length;
|
||||
if(useNuggets) {
|
||||
numItems = numItems * 2;
|
||||
}
|
||||
icons = new IIcon[numItems];
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemAlloyEndergy.unlocalisedName);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, numItems - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
int numAlloys = AlloyEndergy.values().length;
|
||||
for (int i = 0; i < numAlloys; i++) {
|
||||
icons[i] = IIconRegister.registerIcon(AlloyEndergy.values()[i].iconKey);
|
||||
}
|
||||
if(useNuggets) {
|
||||
for (int i = 0; i < numAlloys; i++) {
|
||||
icons[i + numAlloys] = IIconRegister.registerIcon(AlloyEndergy.values()[i].iconKey + "Nugget");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, numItems - 1);
|
||||
if(i < AlloyEndergy.values().length) {
|
||||
return AlloyEndergy.values()[i].unlocalisedName;
|
||||
} else {
|
||||
return AlloyEndergy.values()[i - AlloyEndergy.values().length].unlocalisedName + "Nugget";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (int j = 0; j < numItems; ++j) {
|
||||
par3List.add(new ItemStack(par1, 1, j));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package crazypants.enderio.material.endergy;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.ModObject;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class ItemGrindingBallEndergy extends ItemAlloyEndergy {
|
||||
|
||||
public static ItemGrindingBallEndergy create() {
|
||||
ItemGrindingBallEndergy ball = new ItemGrindingBallEndergy();
|
||||
ball.init();
|
||||
return ball;
|
||||
}
|
||||
|
||||
private ItemGrindingBallEndergy() {
|
||||
setUnlocalizedName(ModObject.itemGrindingBallEndergy.unlocalisedName);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
GameRegistry.registerItem(this, ModObject.itemGrindingBallEndergy.unlocalisedName);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
damage = MathHelper.clamp_int(damage, 0, numItems - 1);
|
||||
return icons[damage];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister IIconRegister) {
|
||||
int numAlloys = AlloyEndergy.values().length;
|
||||
for (int i = 0; i < numAlloys; i++)
|
||||
icons[i] = IIconRegister.registerIcon(AlloyEndergy.values()[i].iconKey+"GrindingBall");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, numItems - 1);
|
||||
return AlloyEndergy.values()[i].unlocalisedName+"GrindingBall";
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,36 @@
|
||||
package crazypants.enderio.power;
|
||||
|
||||
public class BasicCapacitor implements ICapacitor {
|
||||
|
||||
|
||||
private int maxEnergyReceived = 40;
|
||||
private int maxEnergyStored = 100000;
|
||||
private int maxEnergyStored = 100000;
|
||||
private int maxEnergyExtracted = 20;
|
||||
private int tier = 1;
|
||||
|
||||
public BasicCapacitor() {
|
||||
}
|
||||
|
||||
public BasicCapacitor(int maxEnergyIO) {
|
||||
this(0, maxEnergyIO, maxEnergyIO, maxEnergyIO);
|
||||
}
|
||||
|
||||
public BasicCapacitor(int maxEnergyIO, int maxEnergyStored) {
|
||||
this(maxEnergyIO, maxEnergyStored, maxEnergyIO);
|
||||
this(0, maxEnergyIO, maxEnergyStored, maxEnergyIO);
|
||||
}
|
||||
|
||||
public BasicCapacitor(int maxEnergyIn, int maxEnergyStored, int maxEnergyOut) {
|
||||
configure(maxEnergyIn, maxEnergyStored, maxEnergyOut);
|
||||
public BasicCapacitor(int tier, int maxEnergyIO, int maxEnergyStored) {
|
||||
this(tier, maxEnergyIO, maxEnergyStored, maxEnergyIO);
|
||||
}
|
||||
|
||||
|
||||
protected void configure(int maxEnergyReceived, int maxEnergyStored, int maxEnergyExtracted) {
|
||||
public BasicCapacitor(int tier, int maxEnergyIn, int maxEnergyStored, int maxEnergyOut) {
|
||||
configure(tier, maxEnergyIn, maxEnergyStored, maxEnergyOut);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
protected void configure(int tier, int maxEnergyReceived, int maxEnergyStored, int maxEnergyExtracted) {
|
||||
this.tier = tier;
|
||||
this.maxEnergyReceived = maxEnergyReceived;
|
||||
this.maxEnergyStored = maxEnergyStored;
|
||||
this.maxEnergyExtracted = maxEnergyExtracted;
|
||||
@@ -42,10 +54,15 @@ public class BasicCapacitor implements ICapacitor {
|
||||
protected void setMaxEnergyStored(int maxEnergyStored) {
|
||||
this.maxEnergyStored = maxEnergyStored;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyExtracted() {
|
||||
return maxEnergyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,25 +6,69 @@ import crazypants.enderio.EnderIO;
|
||||
public enum Capacitors {
|
||||
|
||||
BASIC_CAPACITOR(
|
||||
new BasicCapacitor(80, 100000, 20),
|
||||
"basicCapacitor"),
|
||||
new BasicCapacitor(1, 80, 100000, 20),
|
||||
"basicCapacitor",
|
||||
"Basic"),
|
||||
|
||||
ACTIVATED_CAPACITOR(
|
||||
new BasicCapacitor(240, 200000, 60),
|
||||
"activatedCapacitor"),
|
||||
new BasicCapacitor(2, 240, 200000, 60),
|
||||
"activatedCapacitor",
|
||||
"Advanced"),
|
||||
|
||||
ENDER_CAPACITOR(
|
||||
new BasicCapacitor(400, 500000, 100),
|
||||
"enderCapacitor");
|
||||
new BasicCapacitor(3, 400, 500000, 100),
|
||||
"enderCapacitor",
|
||||
"Ender"),
|
||||
|
||||
CRYSTALLINE_CAPACITOR(
|
||||
new BasicCapacitor(4, 840, 1000000, 260),
|
||||
"crystallineCapacitor",
|
||||
"Crystalline"),
|
||||
|
||||
MELODIC_CAPACITOR(
|
||||
new BasicCapacitor(5, 1640, 2000000, 460),
|
||||
"melodicCapacitor",
|
||||
"Melodic"),
|
||||
|
||||
STELLAR_CAPACITOR(
|
||||
new BasicCapacitor(6, 3320, 5000000, 980),
|
||||
"stellarCapacitor",
|
||||
"Stellar"),
|
||||
|
||||
TOTEMIC_CAPACITOR(
|
||||
new BasicCapacitor(7, 6600, 10000000, 1900),
|
||||
"totemicCapacitor",
|
||||
"Totemic"),
|
||||
|
||||
SILVER_CAPACITOR(
|
||||
new BasicCapacitor(1, 80, 100000, 20),
|
||||
"silverCapacitor",
|
||||
"Basic"),
|
||||
|
||||
ENDERGETIC_CAPACITOR(
|
||||
new BasicCapacitor(2, 240, 200000, 60),
|
||||
"endergeticCapacitor",
|
||||
"Advanced"),
|
||||
|
||||
ENDERGISED_CAPACITOR(
|
||||
new BasicCapacitor(3, 400, 500000, 100),
|
||||
"endergisedCapacitor",
|
||||
"Ender");
|
||||
|
||||
public final ICapacitor capacitor;
|
||||
public final String unlocalisedName;
|
||||
public final String iconKey;
|
||||
public final String oreDict;
|
||||
|
||||
private Capacitors(ICapacitor capacitor, String unlocalisedName) {
|
||||
private Capacitors(ICapacitor capacitor, String unlocalisedName, String oreDict) {
|
||||
this.capacitor = capacitor;
|
||||
this.unlocalisedName = "enderio." + unlocalisedName;
|
||||
this.iconKey = "enderio:" + unlocalisedName;
|
||||
this.oreDict = oreDict;
|
||||
}
|
||||
|
||||
public String getOreTag() {
|
||||
return "capacitor"+oreDict;
|
||||
}
|
||||
|
||||
public ItemStack getItemStack() {
|
||||
|
||||
@@ -8,4 +8,6 @@ public interface ICapacitor {
|
||||
|
||||
int getMaxEnergyExtracted();
|
||||
|
||||
int getTier();
|
||||
|
||||
}
|
||||
@@ -35,10 +35,10 @@ public class GogglesOfRevealingUpgrade extends AbstractUpgrade {
|
||||
}
|
||||
return new GogglesOfRevealingUpgrade((NBTTagCompound) stack.stackTagCompound.getTag(KEY_UPGRADE_PREFIX + UPGRADE_NAME));
|
||||
}
|
||||
|
||||
|
||||
public static boolean isUpgradeEquipped(EntityPlayer player) {
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
return GogglesOfRevealingUpgrade.loadFromItem(helmet) != null;
|
||||
ItemStack helmet = player.getEquipmentInSlot(4);
|
||||
return GogglesOfRevealingUpgrade.loadFromItem(helmet) != null;
|
||||
}
|
||||
|
||||
public GogglesOfRevealingUpgrade(NBTTagCompound tag) {
|
||||
@@ -51,7 +51,7 @@ public class GogglesOfRevealingUpgrade extends AbstractUpgrade {
|
||||
|
||||
@Override
|
||||
public boolean canAddToItem(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() != DarkSteelItems.itemDarkSteelHelmet || getGoggles() == null) {
|
||||
if(stack == null || !DarkSteelItems.isArmorPart(stack.getItem(), 0) || getGoggles() == null) {
|
||||
return false;
|
||||
}
|
||||
GogglesOfRevealingUpgrade up = loadFromItem(stack);
|
||||
|
||||
Reference in new issue
Block a user