Merge branch '1.7.10'

This commit is contained in:
CrazyPants committed 2014-07-01 14:39:35 +08:00
commit 64ba3d0817
92 files changed
+544 -389

No files matched your search

@@ -36,6 +36,7 @@ import crazypants.enderio.conduit.render.ConduitBundleRenderer;
import crazypants.enderio.conduit.render.ConduitRenderer;
import crazypants.enderio.conduit.render.DefaultConduitRenderer;
import crazypants.enderio.conduit.render.ItemConduitRenderer;
import crazypants.enderio.config.Config;
import crazypants.enderio.enderface.EnderIoRenderer;
import crazypants.enderio.enderface.TileEnderIO;
import crazypants.enderio.gui.TooltipAddera;
@@ -191,7 +192,7 @@ public class ClientProxy extends CommonProxy {
BlockCapacitorBank.renderId = RenderingRegistry.getNextAvailableRenderId();
CapBankRenderer2 cbr2 = new CapBankRenderer2();
RenderingRegistry.registerBlockHandler(cbr2);
BlockVacuumChest.renderId = RenderingRegistry.getNextAvailableRenderId();
VacuumChestRenderer vcr = new VacuumChestRenderer();
RenderingRegistry.registerBlockHandler(vcr);
+24 -24
View File
@@ -1,5 +1,6 @@
package crazypants.enderio;
import static crazypants.enderio.EnderIO.*;
import net.minecraft.block.material.MapColor;
import net.minecraft.block.material.MaterialLiquid;
import net.minecraft.init.Items;
@@ -36,6 +37,7 @@ import crazypants.enderio.conduit.item.filter.ItemExistingItemFilter;
import crazypants.enderio.conduit.liquid.ItemLiquidConduit;
import crazypants.enderio.conduit.power.ItemPowerConduit;
import crazypants.enderio.conduit.redstone.ItemRedstoneConduit;
import crazypants.enderio.config.Config;
import crazypants.enderio.enderface.BlockEnderIO;
import crazypants.enderio.enderface.EnderfaceRecipes;
import crazypants.enderio.enderface.ItemEnderface;
@@ -101,10 +103,14 @@ import crazypants.enderio.teleport.BlockTravelAnchor;
import crazypants.enderio.teleport.ItemTravelStaff;
import crazypants.enderio.teleport.TeleportRecipes;
@Mod(modid = "EnderIO", name = "Ender IO", version = "2.0_beta", dependencies = "required-after:Forge@[10.12.1.1090,);required-after:FML@[5.0.5,)")
@Mod(modid = MODID, name = MOD_NAME, version = VERSION, dependencies = "required-after:[email protected]3.0.1150,);", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
public class EnderIO {
@Instance("EnderIO")
public static final String MODID = "EnderIO";
public static final String MOD_NAME = "Ender IO";
public static final String VERSION = "2.0_beta";
@Instance(MODID)
public static EnderIO instance;
@SidedProxy(clientSide = "crazypants.enderio.ClientProxy", serverSide = "crazypants.enderio.CommonProxy")
@@ -172,11 +178,10 @@ public class EnderIO {
public static BlockCrafter blockCrafter;
public static BlockPoweredSpawner blockPoweredSpawner;
public static ItemBrokenSpawner itemBrokenSpawner;
public static BlockVacuumChest blockVacuumChest;
public static BlockElectricLight blockElectricLight;
public static BlockLightNode blockLightNode;
//Blocks
public static BlockDarkSteelPressurePlate blockDarkSteelPressurePlate;
@@ -209,10 +214,9 @@ public class EnderIO {
public static ItemDarkSteelSword itemDarkSteelSword;
public static ItemDarkSteelPickaxe itemDarkSteelPickaxe;
public static ItemDarkSteelAxe itemDarkSteelAxe;
public static BlockVacuumChest blockVacuumChest;
public static ItemGliderWing itemGliderWing;
// public static ITrigger triggerNoEnergy;
// public static ITrigger triggerHasEnergy;
// public static ITrigger triggerFullEnergy;
@@ -223,7 +227,7 @@ public class EnderIO {
public void preInit(FMLPreInitializationEvent event) {
Config.load(event);
ConduitGeometryUtil.setupBounds((float) Config.conduitScale);
blockEnderIo = BlockEnderIO.create();
@@ -239,8 +243,8 @@ public class EnderIO {
blockAlloySmelter = BlockAlloySmelter.create();
blockVat = BlockVat.create();
blockPowerMonitor = BlockPowerMonitor.create();
blockFarmStation = BlockFarmStation.create();
blockCapacitorBank = BlockCapacitorBank.create();
blockFarmStation = BlockFarmStation.create();
blockCapacitorBank = BlockCapacitorBank.create();
blockPainter = BlockPainter.create();
blockPaintedFence = BlockPaintedFence.create();
@@ -261,7 +265,7 @@ public class EnderIO {
blockTank = BlockTank.create();
blockReservoir = BlockReservoir.create();
blockVacuumChest = BlockVacuumChest.create();
blockDarkSteelPressurePlate = BlockDarkSteelPressurePlate.create();
blockFusedQuartz = BlockFusedQuartz.create();
@@ -270,7 +274,7 @@ public class EnderIO {
blockConduitBundle = BlockConduitBundle.create();
blockConduitFacade = BlockConduitFacade.create();
itemConduitFacade = ItemConduitFacade.create();
blockPoweredSpawner = BlockPoweredSpawner.create();
itemBrokenSpawner = ItemBrokenSpawner.create();
@@ -278,7 +282,7 @@ public class EnderIO {
itemPowerConduit = ItemPowerConduit.create();
itemLiquidConduit = ItemLiquidConduit.create();
itemItemConduit = ItemItemConduit.create();
itemBasicFilterUpgrade = ItemBasicItemFilter.create();
itemExistingItemFilter = ItemExistingItemFilter.create();
itemExtractSpeedUpgrade = ItemExtractSpeedUpgrade.create();
@@ -288,7 +292,6 @@ public class EnderIO {
fluidNutrientDistillation = FluidRegistry.getFluid(f.getName());
blockNutrientDistillation = BlockFluidEio.create(fluidNutrientDistillation, new MaterialLiquid(MapColor.brownColor));
f = new Fluid(Fluids.HOOTCH_NAME).setDensity(900).setViscosity(1000);
FluidRegistry.registerFluid(f);
fluidHootch = FluidRegistry.getFluid(f.getName());
@@ -296,27 +299,26 @@ public class EnderIO {
IronEngineFuel.addFuel(Fluids.HOOTCH_NAME, Config.hootchPowerPerCycle, Config.hootchPowerTotalBurnTime);
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.HOOTCH_NAME + "@" + (Config.hootchPowerPerCycle * Config.hootchPowerTotalBurnTime));
f = new Fluid(Fluids.ROCKET_FUEL_NAME).setDensity(900).setViscosity(1000);
FluidRegistry.registerFluid(f);
fluidRocketFuel = FluidRegistry.getFluid(f.getName());
blockRocketFuel = BlockFluidEio.create(fluidRocketFuel, new MaterialLiquid(MapColor.grayColor));
IronEngineFuel.addFuel(Fluids.ROCKET_FUEL_NAME, Config.rocketFuelPowerPerCycle, Config.rocketFuelPowerTotalBurnTime);
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.ROCKET_FUEL_NAME + "@" + (Config.rocketFuelPowerPerCycle * Config.rocketFuelPowerTotalBurnTime));
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.ROCKET_FUEL_NAME + "@"
+ (Config.rocketFuelPowerPerCycle * Config.rocketFuelPowerTotalBurnTime));
f = new Fluid(Fluids.FIRE_WATER_NAME).setDensity(900).setViscosity(1000);
FluidRegistry.registerFluid(f);
fluidFireWater = FluidRegistry.getFluid(f.getName());
blockFireWater = BlockFluidEio.create(fluidFireWater, new MaterialLiquid(MapColor.grayColor));
IronEngineFuel.addFuel(Fluids.FIRE_WATER_NAME, Config.fireWaterPowerPerCycle, Config.fireWaterPowerTotalBurnTime);
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.FIRE_WATER_NAME + "@" + (Config.fireWaterPowerPerCycle * Config.fireWaterPowerTotalBurnTime));
FMLInterModComms.sendMessage("Railcraft", "boiler-fuel-liquid", Fluids.FIRE_WATER_NAME + "@"
+ (Config.fireWaterPowerPerCycle * Config.fireWaterPowerTotalBurnTime));
if(!IronEngineCoolant.isCoolant(FluidRegistry.getFluid("water"))) {
IronEngineCoolant.addCoolant(FluidRegistry.getFluid("water"), 0.0023F);
}
itemBasicCapacitor = ItemCapacitor.create();
itemMachinePart = ItemMachinePart.create();
itemMaterial = ItemMaterial.create();
@@ -332,9 +334,9 @@ public class EnderIO {
itemEnderface = ItemEnderface.create();
itemTravelStaff = ItemTravelStaff.create();
itemConduitProbe = ItemConduitProbe.create();
itemMagnet = ItemMagnet.create();
blockDarkIronBars = BlockDarkIronBars.create();
itemGliderWing = ItemGliderWing.create();
@@ -347,9 +349,7 @@ public class EnderIO {
itemDarkSteelSword = ItemDarkSteelSword.create();
itemDarkSteelPickaxe = ItemDarkSteelPickaxe.create();
itemDarkSteelAxe = ItemDarkSteelAxe.create();
MaterialRecipes.registerOresInDictionary();
}
@@ -368,7 +368,7 @@ public class EnderIO {
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(
new WeightedRandomChestContent(new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal()), 1, 3, 30));
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST)
.addItem(new WeightedRandomChestContent(new ItemStack(EnderIO.itemYetaWench, 1, 0), 1, 1, 15));
.addItem(new WeightedRandomChestContent(new ItemStack(EnderIO.itemYetaWench, 1, 0), 1, 1, 15));
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(EnderIO.itemConduitProbe, 1, 0), 1, 1, 10));
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(Items.quartz), 3, 16, 40));
@@ -4,25 +4,26 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import static crazypants.enderio.EnderIO.*;
public class EnderIOTab extends CreativeTabs {
public static final CreativeTabs tabEnderIO = new EnderIOTab();
public EnderIOTab() {
super("EnderIO");
super(MODID);
}
@Override
@SideOnly(Side.CLIENT)
public String getTabLabel() {
return "EnderIO";
return MODID;
}
@Override
@SideOnly(Side.CLIENT)
public String getTranslatedTabLabel() {
return "EnderIO";
return MODID;
}
@Override
@@ -39,7 +39,7 @@ public class GuiHandler implements IGuiHandler {
public static final int GUI_ID_CRAFTER = 87;
public static final int GUI_ID_ZOMBIE_GEN = 71;
public static final int GUI_ID_POWERED_SPAWNER = 88;
public static final int GUI_ID_VACUUM_CHEST = 89;
public static final int GUI_ID_VACUUM_CHEST = 89;
protected final Map<Integer, IGuiHandler> guiHandlers = new HashMap<Integer, IGuiHandler>();
+1 -1
View File
@@ -5,7 +5,7 @@ import cpw.mods.fml.common.FMLLog;
public final class Log {
public static final String CHANNEL = "EnderIO";
public static final String CHANNEL = EnderIO.MODID;
public static void warn(String msg) {
FMLLog.log(CHANNEL, org.apache.logging.log4j.Level.WARN, msg, (Object[])null);
@@ -47,7 +47,6 @@ public enum ModObject {
blockFarmStation,
blockTank,
blockCrafter,
blockVacuumChest,
blockPoweredSpawner,
itemBrokenSpawner,
@@ -75,8 +74,7 @@ public enum ModObject {
blockTravelAnchor,
itemTravelStaff,
itemMagnet,
itemGliderWing;
itemMagnet, itemGliderWing, blockVacuumChest;
public final String unlocalisedName;
@@ -6,9 +6,9 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.conduit.facade.ItemConduitFacade.FacadePainterRecipe;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.MachineRecipeRegistry;
import crazypants.enderio.material.Alloy;
import crazypants.enderio.material.BlockFusedQuartz;
@@ -19,7 +19,6 @@ import buildcraft.api.power.PowerHandler;
import buildcraft.api.power.PowerHandler.PowerReceiver;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.TileEntityEio;
import crazypants.enderio.conduit.geom.CollidableCache;
@@ -33,6 +32,7 @@ import crazypants.enderio.conduit.item.IItemConduit;
import crazypants.enderio.conduit.liquid.ILiquidConduit;
import crazypants.enderio.conduit.power.IPowerConduit;
import crazypants.enderio.conduit.redstone.InsulatedRedstoneConduit;
import crazypants.enderio.config.Config;
import crazypants.render.BoundingBox;
import crazypants.util.BlockCoord;
@@ -13,9 +13,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import crazypants.enderio.Config;
import crazypants.enderio.conduit.ConnectionMode;
import crazypants.enderio.conduit.item.filter.IItemFilter;
import crazypants.enderio.config.Config;
import crazypants.util.BlockCoord;
import crazypants.util.InventoryWrapper;
import crazypants.util.ItemUtil;
@@ -14,12 +14,12 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.conduit.AbstractConduitNetwork;
import crazypants.enderio.conduit.ConnectionMode;
import crazypants.enderio.conduit.IConduit;
import crazypants.enderio.conduit.geom.CollidableComponent;
import crazypants.enderio.config.Config;
import crazypants.render.IconUtil;
import crazypants.util.BlockCoord;
@@ -9,10 +9,10 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import crazypants.enderio.Config;
import crazypants.enderio.Log;
import crazypants.enderio.conduit.AbstractConduitNetwork;
import crazypants.enderio.conduit.ConnectionMode;
import crazypants.enderio.config.Config;
import crazypants.util.BlockCoord;
import crazypants.util.FluidUtil;
import crazypants.util.RoundRobinIterator;
@@ -6,11 +6,11 @@ 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.Config;
import crazypants.enderio.ModObject;
import crazypants.enderio.conduit.AbstractItemConduit;
import crazypants.enderio.conduit.IConduit;
import crazypants.enderio.conduit.ItemConduitSubtype;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IAdvancedTooltipProvider;
import crazypants.enderio.gui.TooltipAddera;
import crazypants.util.Lang;
@@ -19,13 +19,13 @@ import net.minecraftforge.fluids.IFluidHandler;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.conduit.AbstractConduitNetwork;
import crazypants.enderio.conduit.ConduitUtil;
import crazypants.enderio.conduit.ConnectionMode;
import crazypants.enderio.conduit.IConduit;
import crazypants.enderio.conduit.geom.CollidableComponent;
import crazypants.enderio.config.Config;
import crazypants.enderio.network.PacketHandler;
import crazypants.render.IconUtil;
import crazypants.util.BlockCoord;
@@ -12,12 +12,12 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.power.IPowerEmitter;
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
import crazypants.enderio.Config;
import crazypants.enderio.Log;
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
import crazypants.enderio.conduit.ConnectionMode;
import crazypants.enderio.conduit.power.PowerConduitNetwork.ReceptorEntry;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.power.TileCapacitorBank;
import crazypants.enderio.power.IPowerInterface;
import crazypants.enderio.power.PowerInterfaceRF;
@@ -1,6 +1,6 @@
package crazypants.enderio.conduit.redstone;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
import crazypants.render.BoundingBox;
import crazypants.render.VertexRotation;
import crazypants.render.VertexTransform;
@@ -21,7 +21,6 @@ import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.conduit.BlockConduitBundle;
import crazypants.enderio.conduit.ConduitDisplayMode;
@@ -33,6 +32,7 @@ import crazypants.enderio.conduit.IConduitBundle.FacadeRenderState;
import crazypants.enderio.conduit.facade.BlockConduitFacade;
import crazypants.enderio.conduit.geom.CollidableComponent;
import crazypants.enderio.conduit.geom.ConduitGeometryUtil;
import crazypants.enderio.config.Config;
import crazypants.render.BoundingBox;
import crazypants.render.CubeRenderer;
import crazypants.render.RenderUtil;
@@ -1,13 +1,62 @@
package crazypants.enderio;
package crazypants.enderio.config;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import crazypants.enderio.EnderIO;
import crazypants.enderio.Log;
import crazypants.vecmath.VecmathUtil;
public final class Config {
public static class Section {
public final String name;
public final String lang;
public Section(String name, String lang) {
this.name = name;
this.lang = lang;
register();
}
private void register() {
sections.add(this);
}
public String lc() {
return name.toLowerCase();
}
}
public static final List<Section> sections;
static {
sections = new ArrayList<Section>();
}
public static Configuration config;
public static final Section sectionPower = new Section("Power Settings", "power");
public static final Section sectionRecipe = new Section("Recipe Settings", "recipe");
public static final Section sectionItems = new Section("Item Enabling", "item");
public static final Section sectionEfficiency = new Section("Efficiency Settings", "efficiency");
public static final Section sectionPersonal = new Section("Personal Settings", "personal");
public static final Section sectionAnchor = new Section("Anchor Settings", "anchor");
public static final Section sectionStaff = new Section("Staff Settings", "staff");
public static final Section sectionDarkSteel = new Section("Dark Steel", "darksteel");
public static final Section sectionFarm = new Section("Farm Settings", "farm");
public static final Section sectionAesthetic = new Section("Aesthetic Settings", "aesthetic");
public static final Section sectionAdvanced = new Section("Advanced Settings", "advanced");
public static final Section sectionMagnet = new Section("Magnet Settings", "magnet");
public static final Section sectionSpawner = new Section("PoweredSpawner Settings", "spawner");
static int BID = 700;
static int IID = 8524;
@@ -172,347 +221,354 @@ public final class Config {
public static double vacuumChestRange = 6;
public static void load(FMLPreInitializationEvent event) {
configDirectory = new File(event.getModConfigurationDirectory(), "enderio");
FMLCommonHandler.instance().bus().register(new Config());
configDirectory = new File(event.getModConfigurationDirectory(), EnderIO.MODID.toLowerCase());
if(!configDirectory.exists()) {
configDirectory.mkdir();
}
File configFile = new File(configDirectory, "EnderIO.cfg");
Configuration cfg = new Configuration(configFile);
config = new Configuration(configFile);
syncConfig();
}
public static void syncConfig() {
try {
cfg.load();
Config.processConfig(cfg);
Config.processConfig(config);
} catch (Exception e) {
Log.error("EnderIO has a problem loading it's configuration");
} finally {
if(cfg.hasChanged()) {
cfg.save();
if(config.hasChanged()) {
config.save();
}
}
}
@SubscribeEvent
public void onConfigChanged(OnConfigChangedEvent event) {
if (event.modID.equals(EnderIO.MODID)) {
Log.info("Updating config...");
syncConfig();
}
}
public static void processConfig(Configuration config) {
useRfAsDefault = config.get("Power Settings", "displayPowerAsRedstoneFlux", useRfAsDefault, "If true, all power is displayed in RF, otherwise MJ is used.")
useRfAsDefault = config.get(sectionPower.name, "displayPowerAsRedstoneFlux", useRfAsDefault, "If true, all power is displayed in RF, otherwise MJ is used.")
.getBoolean(useRfAsDefault);
capacitorBankMaxIoMJ = config.get("Power Settings", "capacitorBankMaxIoMJ", capacitorBankMaxIoMJ, "The maximum IO for a single capacitor in MJ/t")
capacitorBankMaxIoMJ = config.get(sectionPower.name, "capacitorBankMaxIoMJ", capacitorBankMaxIoMJ, "The maximum IO for a single capacitor in MJ/t")
.getInt(capacitorBankMaxIoMJ);
capacitorBankMaxStorageMJ = config.get("Power Settings", "capacitorBankMaxStorageMJ", capacitorBankMaxStorageMJ,
capacitorBankMaxStorageMJ = config.get(sectionPower.name, "capacitorBankMaxStorageMJ", capacitorBankMaxStorageMJ,
"The maximum storage for a single capacitor in MJ")
.getInt(capacitorBankMaxStorageMJ);
useHardRecipes = config.get("Recipe Settings", "useHardRecipes", useHardRecipes, "When enabled machines cost significantly more.")
useHardRecipes = config.get(sectionRecipe.name, "useHardRecipes", useHardRecipes, "When enabled machines cost significantly more.")
.getBoolean(useHardRecipes);
useSteelInChassi = config.get("Recipe Settings", "useSteelInChassi", useSteelInChassi, "When enabled machine chassis will require steel instead of iron.")
useSteelInChassi = config.get(sectionRecipe.name, "useSteelInChassi", useSteelInChassi, "When enabled machine chassis will require steel instead of iron.")
.getBoolean(useSteelInChassi);
numConduitsPerRecipe = config.get("Recipe Settings", "numConduitsPerRecipe", numConduitsPerRecipe,
numConduitsPerRecipe = config.get(sectionRecipe.name, "numConduitsPerRecipe", numConduitsPerRecipe,
"The number of conduits crafted per recipe.").getInt(numConduitsPerRecipe);
photovoltaicCellEnabled = config.get("Item Enabling", "photovoltaicCellEnabled", photovoltaicCellEnabled,
photovoltaicCellEnabled = config.get(sectionItems.name, "photovoltaicCellEnabled", photovoltaicCellEnabled,
"If set to false: Photovoltaic Cells will not be craftable.")
.getBoolean(photovoltaicCellEnabled);
maxPhotovoltaicOutput = config.get("Power Settings", "maxPhotovoltaicOutput", maxPhotovoltaicOutput,
maxPhotovoltaicOutput = config.get(sectionPower.name, "maxPhotovoltaicOutput", maxPhotovoltaicOutput,
"Maximum output in MJ/t of the Photovoltaic Panels.").getDouble(maxPhotovoltaicOutput);
maxPhotovoltaicAdvancedOutput = config.get("Power Settings", "maxPhotovoltaicAdvancedOutput", maxPhotovoltaicAdvancedOutput,
maxPhotovoltaicAdvancedOutput = config.get(sectionPower.name, "maxPhotovoltaicAdvancedOutput", maxPhotovoltaicAdvancedOutput,
"Maximum output in MJ/t of the Advanced Photovoltaic Panels.").getDouble(maxPhotovoltaicAdvancedOutput);
useAlternateBinderRecipe = config.get("Recipe Settings", "useAlternateBinderRecipe", false, "Create conduit binder in crafting table instead of furnace")
useAlternateBinderRecipe = config.get(sectionRecipe.name, "useAlternateBinderRecipe", false, "Create conduit binder in crafting table instead of furnace")
.getBoolean(useAlternateBinderRecipe);
conduitScale = config.get("Aesthetic Settings", "conduitScale", DEFAULT_CONDUIT_SCALE,
conduitScale = config.get(sectionAesthetic.name, "conduitScale", DEFAULT_CONDUIT_SCALE,
"Valid values are between 0-1, smallest conduits at 0, largest at 1.\n" +
"In SMP, all clients must be using the same value as the server.").getDouble(DEFAULT_CONDUIT_SCALE);
conduitScale = VecmathUtil.clamp(conduitScale, 0, 1);
fluidConduitExtractRate = config.get("Efficiency Settings", "fluidConduitExtractRate", fluidConduitExtractRate,
fluidConduitExtractRate = config.get(sectionEfficiency.name, "fluidConduitExtractRate", fluidConduitExtractRate,
"Number of millibuckects per tick extracted by a fluid conduits auto extracting").getInt(fluidConduitExtractRate);
fluidConduitMaxIoRate = config.get("Efficiency Settings", "fluidConduitMaxIoRate", fluidConduitMaxIoRate,
fluidConduitMaxIoRate = config.get(sectionEfficiency.name, "fluidConduitMaxIoRate", fluidConduitMaxIoRate,
"Number of millibuckects per tick that can pass through a single connection to a fluid conduit.").getInt(fluidConduitMaxIoRate);
advancedFluidConduitExtractRate = config.get("Efficiency Settings", "advancedFluidConduitExtractRate", advancedFluidConduitExtractRate,
advancedFluidConduitExtractRate = config.get(sectionEfficiency.name, "advancedFluidConduitExtractRate", advancedFluidConduitExtractRate,
"Number of millibuckects per tick extracted by pressurised fluid conduits auto extracting").getInt(advancedFluidConduitExtractRate);
advancedFluidConduitMaxIoRate = config.get("Efficiency Settings", "advancedFluidConduitMaxIoRate", advancedFluidConduitMaxIoRate,
advancedFluidConduitMaxIoRate = config.get(sectionEfficiency.name, "advancedFluidConduitMaxIoRate", advancedFluidConduitMaxIoRate,
"Number of millibuckects per tick that can pass through a single connection to an pressurised fluid conduit.").getInt(advancedFluidConduitMaxIoRate);
enderFluidConduitExtractRate = config.get("Efficiency Settings", "enderFluidConduitExtractRate", enderFluidConduitExtractRate,
enderFluidConduitExtractRate = config.get(sectionEfficiency.name, "enderFluidConduitExtractRate", enderFluidConduitExtractRate,
"Number of millibuckects per tick extracted by ender fluid conduits auto extracting").getInt(enderFluidConduitExtractRate);
enderFluidConduitMaxIoRate = config.get("Efficiency Settings", "enderFluidConduitMaxIoRate", enderFluidConduitMaxIoRate,
enderFluidConduitMaxIoRate = config.get(sectionEfficiency.name, "enderFluidConduitMaxIoRate", enderFluidConduitMaxIoRate,
"Number of millibuckects per tick that can pass through a single connection to an ender fluid conduit.").getInt(enderFluidConduitMaxIoRate);
useAlternateTesseractModel = config.get("Aesthetic Settings", "useAlternateTransceiverModel", useAlternateTesseractModel,
useAlternateTesseractModel = config.get(sectionAesthetic.name, "useAlternateTransceiverModel", useAlternateTesseractModel,
"Use TheKazador's alternatice model for the Dimensional Transceiver")
.getBoolean(false);
transceiverEnergyLoss = config.get("Power Settings", "transceiverEnergyLoss", transceiverEnergyLoss,
transceiverEnergyLoss = config.get(sectionPower.name, "transceiverEnergyLoss", transceiverEnergyLoss,
"Amount of energy lost when transfered by Dimensional Transceiver; 0 is no loss, 1 is 100% loss").getDouble(transceiverEnergyLoss);
transceiverUpkeepCost = config.get("Power Settings", "transceiverUpkeepCost", transceiverUpkeepCost,
transceiverUpkeepCost = config.get(sectionPower.name, "transceiverUpkeepCost", transceiverUpkeepCost,
"Number of MJ/t required to keep a Dimensional Transceiver connection open").getDouble(transceiverUpkeepCost);
transceiverMaxIO = config.get("Power Settings", "transceiverMaxIO", transceiverMaxIO,
transceiverMaxIO = config.get(sectionPower.name, "transceiverMaxIO", transceiverMaxIO,
"Maximum MJ/t sent and recieved by a Dimensional Transceiver per tick. Input and output limits are not cumulative").getInt(transceiverMaxIO);
transceiverBucketTransmissionCost = config.get("Efficiency Settings", "transceiverBucketTransmissionCost", transceiverBucketTransmissionCost,
transceiverBucketTransmissionCost = config.get(sectionEfficiency.name, "transceiverBucketTransmissionCost", transceiverBucketTransmissionCost,
"The cost in MJ of transporting a bucket of fluid via a Dimensional Transceiver.").getDouble(transceiverBucketTransmissionCost);
vatPowerUserPerTick = (float) config.get("Power Settings", "vatPowerUserPerTick", vatPowerUserPerTick,
vatPowerUserPerTick = (float) config.get(sectionPower.name, "vatPowerUserPerTick", vatPowerUserPerTick,
"Power use (MJ/t) used by the vat.").getDouble(vatPowerUserPerTick);
detailedPowerTrackingEnabled = config
.get(
"Advanced Settings",
sectionAdvanced.name,
"perInterfacePowerTrackingEnabled",
detailedPowerTrackingEnabled,
"Enable per tick sampling on individual power inputs and outputs. This allows slightly more detailed messages from the MJ Reader but has a negative impact on server performance.")
.getBoolean(detailedPowerTrackingEnabled);
useSneakMouseWheelYetaWrench = config.get("Personal Settings", "useSneakMouseWheelYetaWrench", useSneakMouseWheelYetaWrench,
useSneakMouseWheelYetaWrench = config.get(sectionPersonal.name, "useSneakMouseWheelYetaWrench", useSneakMouseWheelYetaWrench,
"If true, shift-mouse wheel will change the conduit display mode when the YetaWrench is eqipped.")
.getBoolean(useSneakMouseWheelYetaWrench);
useSneakRightClickYetaWrench = config.get("Personal Settings", "useSneakRightClickYetaWrench", useSneakRightClickYetaWrench,
useSneakRightClickYetaWrench = config.get(sectionPersonal.name, "useSneakRightClickYetaWrench", useSneakRightClickYetaWrench,
"If true, shift-clicking the YetaWrench on a null or non wrenchable object will change the conduit display mode.")
.getBoolean(useSneakRightClickYetaWrench);
itemConduitUsePhyscialDistance = config.get("Efficiency Settings", "itemConduitUsePhyscialDistance", itemConduitUsePhyscialDistance, "If true, " +
itemConduitUsePhyscialDistance = config.get(sectionEfficiency.name, "itemConduitUsePhyscialDistance", itemConduitUsePhyscialDistance, "If true, " +
"'line of sight' distance rather than conduit path distance is used to calculate priorities.")
.getBoolean(itemConduitUsePhyscialDistance);
vacuumChestRange = config.get("Efficiency Settings", "vacumChestRange", vacuumChestRange, "The range of the vacuum chest").getDouble(vacuumChestRange);
vacuumChestRange = config.get(sectionEfficiency.name, "vacumChestRange", vacuumChestRange, "The range of the vacuum chest").getDouble(vacuumChestRange);
if(!useSneakMouseWheelYetaWrench && !useSneakRightClickYetaWrench) {
Log.warn("Both useSneakMouseWheelYetaWrench and useSneakRightClickYetaWrench are set to false. Enabling mouse wheel.");
useSneakMouseWheelYetaWrench = true;
}
travelAnchorEnabled = config.get("Item Enabling", "travelAnchorEnabled", travelAnchorEnabled,
travelAnchorEnabled = config.get(sectionItems.name, "travelAnchorEnabled", travelAnchorEnabled,
"When set to false: the travel anchor will not be craftable.").getBoolean(travelAnchorEnabled);
travelAnchorMaxDistance = config.get("Anchor Settings", "travelAnchorMaxDistance", travelAnchorMaxDistance,
travelAnchorMaxDistance = config.get(sectionAnchor.name, "travelAnchorMaxDistance", travelAnchorMaxDistance,
"Maximum number of blocks that can be traveled from one travel anchor to another.").getInt(travelAnchorMaxDistance);
travelStaffMaxDistance = config.get("Staff Settings", "travelStaffMaxDistance", travelStaffMaxDistance,
travelStaffMaxDistance = config.get(sectionStaff.name, "travelStaffMaxDistance", travelStaffMaxDistance,
"Maximum number of blocks that can be traveled using the Staff of the Traveling.").getInt(travelStaffMaxDistance);
travelStaffPowerPerBlockRF = (float) config.get("Staff Settings", "travelStaffPowerPerBlockRF", travelStaffPowerPerBlockRF,
travelStaffPowerPerBlockRF = (float) config.get(sectionStaff.name, "travelStaffPowerPerBlockRF", travelStaffPowerPerBlockRF,
"Number of MJ required per block travelled using the Staff of the Traveling.").getDouble(travelStaffPowerPerBlockRF);
travelStaffMaxBlinkDistance = config.get("Staff Settings", "travelStaffMaxBlinkDistance", travelStaffMaxBlinkDistance,
travelStaffMaxBlinkDistance = config.get(sectionStaff.name, "travelStaffMaxBlinkDistance", travelStaffMaxBlinkDistance,
"Max number of blocks teleported when shift clicking the staff.").getInt(travelStaffMaxBlinkDistance);
travelStaffBlinkPauseTicks = config.get("Staff Settings", "travelStaffBlinkPauseTicks", travelStaffBlinkPauseTicks,
travelStaffBlinkPauseTicks = config.get(sectionStaff.name, "travelStaffBlinkPauseTicks", travelStaffBlinkPauseTicks,
"Minimum number of ticks between 'blinks'. Values of 10 or less allow a limited sort of flight.").getInt(travelStaffBlinkPauseTicks);
travelStaffEnabled = config.get("Item Enabling", "travelStaffEnabled", travelAnchorEnabled,
travelStaffEnabled = config.get(sectionItems.name, "travelStaffEnabled", travelAnchorEnabled,
"If set to false: the travel staff will not be craftable.").getBoolean(travelStaffEnabled);
travelStaffBlinkEnabled = config.get("Item Enabling", "travelStaffBlinkEnabled", travelStaffBlinkEnabled,
travelStaffBlinkEnabled = config.get(sectionItems.name, "travelStaffBlinkEnabled", travelStaffBlinkEnabled,
"If set to false: the travel staff can not be used to shift-right click teleport, or blink.").getBoolean(travelStaffBlinkEnabled);
travelStaffBlinkThroughSolidBlocksEnabled = config.get("Item Enabling", "travelStaffBlinkThroughSolidBlocksEnabled",
travelStaffBlinkThroughSolidBlocksEnabled = config.get(sectionItems.name, "travelStaffBlinkThroughSolidBlocksEnabled",
travelStaffBlinkThroughSolidBlocksEnabled,
"If set to false: the travel staff can be used to blink through any block.").getBoolean(travelStaffBlinkThroughSolidBlocksEnabled);
travelStaffBlinkThroughClearBlocksEnabled = config
.get("Item Enabling", "travelStaffBlinkThroughClearBlocksEnabled", travelStaffBlinkThroughClearBlocksEnabled,
.get(sectionItems.name, "travelStaffBlinkThroughClearBlocksEnabled", travelStaffBlinkThroughClearBlocksEnabled,
"If travelStaffBlinkThroughSolidBlocksEnabled is set to false and this is true: the travel " +
"staff can only be used to blink through transparent or partial blocks (e.g. torches). " +
"If both are false: only air blocks may be teleported through.")
.getBoolean(travelStaffBlinkThroughClearBlocksEnabled);
enderIoRange = config.get("Efficiency Settings", "enderIoRange", enderIoRange,
enderIoRange = config.get(sectionEfficiency.name, "enderIoRange", enderIoRange,
"Range accessable (in blocks) when using the Ender IO.").getInt(enderIoRange);
enderIoMeAccessEnabled = config.get("Personal Settings", "enderIoMeAccessEnabled", enderIoMeAccessEnabled,
enderIoMeAccessEnabled = config.get(sectionPersonal.name, "enderIoMeAccessEnabled", enderIoMeAccessEnabled,
"If false: you will not be able to access a ME acess or crafting terminal using the Ender IO.").getBoolean(enderIoMeAccessEnabled);
updateLightingWhenHidingFacades = config.get("Efficiency Settings", "updateLightingWhenHidingFacades", updateLightingWhenHidingFacades,
updateLightingWhenHidingFacades = config.get(sectionEfficiency.name, "updateLightingWhenHidingFacades", updateLightingWhenHidingFacades,
"When true: correct lighting is recalculated (client side) for conduit bundles when transitioning to"
+ " from being hidden behind a facade. This produces "
+ "better quality rendering but can result in frame stutters when switching to/from a wrench.")
.getBoolean(updateLightingWhenHidingFacades);
darkSteelPowerStorageBase = config.get("Dark Steel", "darkSteelPowerStorageBase", darkSteelPowerStorageBase,
darkSteelPowerStorageBase = config.get(sectionDarkSteel.name, "darkSteelPowerStorageBase", darkSteelPowerStorageBase,
"Base amount of power stored by dark steel items.").getInt(darkSteelPowerStorageBase);
darkSteelPowerStorageLevelOne = config.get("Dark Steel", "darkSteelPowerStorageLevelOne", darkSteelPowerStorageLevelOne,
darkSteelPowerStorageLevelOne = config.get(sectionDarkSteel.name, "darkSteelPowerStorageLevelOne", darkSteelPowerStorageLevelOne,
"Amount of power stored by dark steel items with a level 1 upgrade.").getInt(darkSteelPowerStorageLevelOne);
darkSteelPowerStorageLevelTwo = config.get("Dark Steel", "darkSteelPowerStorageLevelTwo", darkSteelPowerStorageLevelTwo,
darkSteelPowerStorageLevelTwo = config.get(sectionDarkSteel.name, "darkSteelPowerStorageLevelTwo", darkSteelPowerStorageLevelTwo,
"Amount of power stored by dark steel items with a level 2 upgrade.").getInt(darkSteelPowerStorageLevelTwo);
darkSteelPowerStorageLevelThree = config.get("Dark Steel", "darkSteelPowerStorageLevelThree", darkSteelPowerStorageLevelThree,
darkSteelPowerStorageLevelThree = config.get(sectionDarkSteel.name, "darkSteelPowerStorageLevelThree", darkSteelPowerStorageLevelThree,
"Amount of power stored by dark steel items with a level 3 upgrade.").getInt(darkSteelPowerStorageLevelThree);
darkSteelUpgradeVibrantCost = config.get("Dark Steel", "darkSteelUpgradeVibrantCost", darkSteelUpgradeVibrantCost,
darkSteelUpgradeVibrantCost = config.get(sectionDarkSteel.name, "darkSteelUpgradeVibrantCost", darkSteelUpgradeVibrantCost,
"Number of levels required for the 'Vibrant' upgrade.").getInt(darkSteelUpgradeVibrantCost);
darkSteelUpgradePowerOneCost = config.get("Dark Steel", "darkSteelUpgradePowerOneCost", darkSteelUpgradePowerOneCost,
darkSteelUpgradePowerOneCost = config.get(sectionDarkSteel.name, "darkSteelUpgradePowerOneCost", darkSteelUpgradePowerOneCost,
"Number of levels required for the 'Vibrant' upgrade.").getInt(darkSteelUpgradePowerOneCost);
darkSteelUpgradePowerTwoCost = config.get("Dark Steel", "darkSteelUpgradePowerTwoCost", darkSteelUpgradePowerTwoCost,
darkSteelUpgradePowerTwoCost = config.get(sectionDarkSteel.name, "darkSteelUpgradePowerTwoCost", darkSteelUpgradePowerTwoCost,
"Number of levels required for the 'Vibrant' upgrade.").getInt(darkSteelUpgradePowerTwoCost);
darkSteelUpgradePowerThreeCost = config.get("Dark Steel", "darkSteelUpgradePowerThreeCost", darkSteelUpgradePowerThreeCost,
darkSteelUpgradePowerThreeCost = config.get(sectionDarkSteel.name, "darkSteelUpgradePowerThreeCost", darkSteelUpgradePowerThreeCost,
"Number of levels required for the 'Vibrant' upgrade.").getInt(darkSteelUpgradePowerThreeCost);
darkSteelSpeedOneWalkModifier = (float) config.get("Dark Steel", "darkSteelSpeedOneWalkModifier", darkSteelSpeedOneWalkModifier,
darkSteelSpeedOneWalkModifier = (float) config.get(sectionDarkSteel.name, "darkSteelSpeedOneWalkModifier", darkSteelSpeedOneWalkModifier,
"Speed modifier applied when walking in the Dark Steel Boots with Speed I.").getDouble(darkSteelSpeedOneWalkModifier);
darkSteelSpeedTwoWalkMultiplier = (float) config.get("Dark Steel", "darkSteelSpeedTwoWalkMultiplier", darkSteelSpeedTwoWalkMultiplier,
darkSteelSpeedTwoWalkMultiplier = (float) config.get(sectionDarkSteel.name, "darkSteelSpeedTwoWalkMultiplier", darkSteelSpeedTwoWalkMultiplier,
"Speed modifier applied when walking in the Dark Steel Boots with Speed I.").getDouble(darkSteelSpeedTwoWalkMultiplier);
darkSteelSpeedThreeWalkMultiplier = (float) config.get("Dark Steel", "darkSteelSpeedThreeWalkMultiplier", darkSteelSpeedThreeWalkMultiplier,
darkSteelSpeedThreeWalkMultiplier = (float) config.get(sectionDarkSteel.name, "darkSteelSpeedThreeWalkMultiplier", darkSteelSpeedThreeWalkMultiplier,
"Speed modifier applied when walking in the Dark Steel Boots with Speed I.").getDouble(darkSteelSpeedThreeWalkMultiplier);
darkSteelSpeedOneSprintModifier = (float) config.get("Dark Steel", "darkSteelSpeedOneSprintModifier", darkSteelSpeedOneSprintModifier,
darkSteelSpeedOneSprintModifier = (float) config.get(sectionDarkSteel.name, "darkSteelSpeedOneSprintModifier", darkSteelSpeedOneSprintModifier,
"Speed modifier applied when walking in the Dark Steel Boots with Speed I.").getDouble(darkSteelSpeedOneSprintModifier);
darkSteelSpeedTwoSprintMultiplier = (float) config.get("Dark Steel", "darkSteelSpeedTwoSprintMultiplier", darkSteelSpeedTwoSprintMultiplier,
darkSteelSpeedTwoSprintMultiplier = (float) config.get(sectionDarkSteel.name, "darkSteelSpeedTwoSprintMultiplier", darkSteelSpeedTwoSprintMultiplier,
"Speed modifier applied when walking in the Dark Steel Boots with Speed I.").getDouble(darkSteelSpeedTwoSprintMultiplier);
darkSteelSpeedThreeSprintMultiplier = (float) config.get("Dark Steel", "darkSteelSpeedThreeSprintMultiplier", darkSteelSpeedThreeSprintMultiplier,
darkSteelSpeedThreeSprintMultiplier = (float) config.get(sectionDarkSteel.name, "darkSteelSpeedThreeSprintMultiplier", darkSteelSpeedThreeSprintMultiplier,
"Speed modifier applied when walking in the Dark Steel Boots with Speed I.").getDouble(darkSteelSpeedThreeSprintMultiplier);
darkSteelBootsJumpModifier = config.get("Dark Steel", "darkSteelBootsJumpModifier", darkSteelBootsJumpModifier,
darkSteelBootsJumpModifier = config.get(sectionDarkSteel.name, "darkSteelBootsJumpModifier", darkSteelBootsJumpModifier,
"Jump height modifier applied when jumping with Dark Steel Boots equipped").getDouble(darkSteelBootsJumpModifier);
darkSteelPowerStorageBase = config.get("Dark Steel", "darkSteelPowerStorage", darkSteelPowerStorageBase,
darkSteelPowerStorageBase = config.get(sectionDarkSteel.name, "darkSteelPowerStorage", darkSteelPowerStorageBase,
"Amount of power stored (RF) per crystal in the armor items recipe.").getInt(darkSteelPowerStorageBase);
darkSteelWalkPowerCost = config.get("Dark Steel", "darkSteelWalkPowerCost", darkSteelWalkPowerCost,
darkSteelWalkPowerCost = config.get(sectionDarkSteel.name, "darkSteelWalkPowerCost", darkSteelWalkPowerCost,
"Amount of power stored (RF) per block walked when wearing the dark steel boots.").getInt(darkSteelWalkPowerCost);
darkSteelSprintPowerCost = config.get("Dark Steel", "darkSteelSprintPowerCost", darkSteelWalkPowerCost,
darkSteelSprintPowerCost = config.get(sectionDarkSteel.name, "darkSteelSprintPowerCost", darkSteelWalkPowerCost,
"Amount of power stored (RF) per block walked when wearing the dark stell boots.").getInt(darkSteelSprintPowerCost);
darkSteelDrainPowerFromInventory = config.get("Dark Steel", "darkSteelDrainPowerFromInventory", darkSteelDrainPowerFromInventory,
darkSteelDrainPowerFromInventory = config.get(sectionDarkSteel.name, "darkSteelDrainPowerFromInventory", darkSteelDrainPowerFromInventory,
"If true, dark steel armor will drain power stored (RF) in power containers in the players invenotry.").getBoolean(darkSteelDrainPowerFromInventory);
darkSteelBootsJumpPowerCost = config.get("Dark Steel", "darkSteelBootsJumpPowerCost", darkSteelBootsJumpPowerCost,
darkSteelBootsJumpPowerCost = config.get(sectionDarkSteel.name, "darkSteelBootsJumpPowerCost", darkSteelBootsJumpPowerCost,
"Base amount of power used per jump (RF) dark steel boots. The second jump in a 'double jump' uses 2x this etc").getInt(darkSteelBootsJumpPowerCost);
darkSteelFallDistanceCost = config.get("Dark Steel", "darkSteelFallDistanceCost", darkSteelFallDistanceCost,
"Amount of power used (RF) per block height of fall distance damage negated.").getInt(darkSteelFallDistanceCost);
darkSteelFallDistanceCost = config.get(sectionDarkSteel.name, "darkSteelFallDistanceCost", darkSteelFallDistanceCost,
"Amount of power used (RF) per block height of fall distance damage negated.").getInt(darkSteelFallDistanceCost);
darkSteelGliderCost = config.get("Dark Steel", "darkSteelGliderCost", darkSteelGliderCost,
darkSteelGliderCost = config.get(sectionDarkSteel.name, "darkSteelGliderCost", darkSteelGliderCost,
"Number of levels required for the 'Glider' upgrade.").getInt(darkSteelGliderCost);
darkSteelGliderHorizontalSpeed = config.get("Dark Steel", "darkSteelGliderHorizontalSpeed", darkSteelGliderHorizontalSpeed,
darkSteelGliderHorizontalSpeed = config.get(sectionDarkSteel.name, "darkSteelGliderHorizontalSpeed", darkSteelGliderHorizontalSpeed,
"Horizontal movement speed modifier when gliding.").getDouble(darkSteelGliderHorizontalSpeed);
darkSteelGliderVerticalSpeed = config.get("Dark Steel", "darkSteelGliderVerticalSpeed", darkSteelGliderVerticalSpeed,
darkSteelGliderVerticalSpeed = config.get(sectionDarkSteel.name, "darkSteelGliderVerticalSpeed", darkSteelGliderVerticalSpeed,
"Rate of altitude loss when gliding.").getDouble(darkSteelGliderVerticalSpeed);
darkSteelGliderVerticalSpeedSprinting = config.get("Dark Steel", "darkSteelGliderVerticalSpeedSprinting", darkSteelGliderVerticalSpeedSprinting,
"Rate of altitude loss when sprinting and gliding.").getDouble(darkSteelGliderVerticalSpeedSprinting);
darkSteelSwordSkullChance = (float) config.get("Dark Steel", "darkSteelSwordSkullChance", darkSteelSwordSkullChance,
"The base chance that a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
darkSteelSwordSkullChance);
darkSteelSwordSkullLootingModifier = (float) config.get("Dark Steel", "darkSteelSwordSkullLootingModifier", darkSteelSwordSkullLootingModifier,
darkSteelGliderVerticalSpeedSprinting = config.get(sectionDarkSteel.name, "darkSteelGliderVerticalSpeedSprinting", darkSteelGliderVerticalSpeedSprinting,
"Rate of altitude loss when sprinting and gliding.").getDouble(darkSteelGliderVerticalSpeedSprinting);
darkSteelSwordSkullLootingModifier = (float) config.get(sectionDarkSteel.name, "darkSteelSwordSkullLootingModifier", darkSteelSwordSkullLootingModifier,
"The chance per looting level that a skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
darkSteelSwordSkullLootingModifier);
darkSteelSwordWitherSkullChance = (float) config.get("Dark Steel", "darkSteelSwordWitherSkullChance", darkSteelSwordWitherSkullChance,
darkSteelSwordWitherSkullChance = (float) config.get(sectionDarkSteel.name, "darkSteelSwordWitherSkullChance", darkSteelSwordWitherSkullChance,
"The base chance that a wither skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
darkSteelSwordWitherSkullChance);
darkSteelSwordWitherSkullLootingModifier = (float) config.get("Dark Steel", "darkSteelSwordWitherSkullLootingModifie",
darkSteelSwordWitherSkullLootingModifier = (float) config.get(sectionDarkSteel.name, "darkSteelSwordWitherSkullLootingModifie",
darkSteelSwordWitherSkullLootingModifier,
"The chance per looting level that a wither skull will be dropped when using a powered dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
darkSteelSwordWitherSkullLootingModifier);
vanillaSwordSkullLootingModifier = (float) config.get("Personal Settings", "vanillaSwordSkullLootingModifier", vanillaSwordSkullLootingModifier,
vanillaSwordSkullLootingModifier = (float) config.get(sectionPersonal.name, "vanillaSwordSkullLootingModifier", vanillaSwordSkullLootingModifier,
"The chance per looting level that a skull will be dropped when using a non-dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
vanillaSwordSkullLootingModifier);
darkSteelSwordPowerUsePerHit = config.get("Dark Steel", "darkSteelSwordPowerUsePerHit", darkSteelSwordPowerUsePerHit,
darkSteelSwordPowerUsePerHit = config.get(sectionDarkSteel.name, "darkSteelSwordPowerUsePerHit", darkSteelSwordPowerUsePerHit,
"The amount of power (RF) used per hit.").getInt(darkSteelSwordPowerUsePerHit);
darkSteelSwordEnderPearlDropChance = config.get("Dark Steel", "darkSteelSwordEnderPearlDropChance", darkSteelSwordEnderPearlDropChance,
darkSteelSwordEnderPearlDropChance = config.get(sectionDarkSteel.name, "darkSteelSwordEnderPearlDropChance", darkSteelSwordEnderPearlDropChance,
"The chance that an ender pearl will be dropped when using a dark steel sword (0 = no chance, 1 = 100% chance)").getDouble(
darkSteelSwordEnderPearlDropChance);
darkSteelSwordEnderPearlDropChancePerLooting = config.get("Dark Steel", "darkSteelSwordEnderPearlDropChancePerLooting",
darkSteelSwordEnderPearlDropChancePerLooting = config.get(sectionDarkSteel.name, "darkSteelSwordEnderPearlDropChancePerLooting",
darkSteelSwordEnderPearlDropChancePerLooting,
"The chance for each looting level that an additional ender pearl will be dropped when using a dark steel sword (0 = no chance, 1 = 100% chance)")
.getDouble(
darkSteelSwordEnderPearlDropChancePerLooting);
darkSteelPickPowerUseObsidian = config.get("Dark Steel", "darkSteelPickPowerUseObsidian", darkSteelPickPowerUseObsidian,
darkSteelPickPowerUseObsidian = config.get(sectionDarkSteel.name, "darkSteelPickPowerUseObsidian", darkSteelPickPowerUseObsidian,
"The amount of power (RF) used to break an obsidian block.").getInt(darkSteelPickPowerUseObsidian);
darkSteelPickEffeciencyObsidian = config.get("Dark Steel", "darkSteelPickEffeciencyObsidian", darkSteelPickEffeciencyObsidian,
darkSteelPickEffeciencyObsidian = config.get(sectionDarkSteel.name, "darkSteelPickEffeciencyObsidian", darkSteelPickEffeciencyObsidian,
"The effeciency when breaking obsidian with a powered Dark Pickaxe.").getInt(darkSteelPickEffeciencyObsidian);
darkSteelPickPowerUsePerDamagePoint = config.get("Dark Steel", "darkSteelPickPowerUsePerDamagePoint", darkSteelPickPowerUsePerDamagePoint,
darkSteelPickPowerUsePerDamagePoint = config.get(sectionDarkSteel.name, "darkSteelPickPowerUsePerDamagePoint", darkSteelPickPowerUsePerDamagePoint,
"Power use (RF) per damage/durability point avoided.").getInt(darkSteelPickPowerUsePerDamagePoint);
darkSteelPickEffeciencyBoostWhenPowered = (float) config.get("Dark Steel", "darkSteelPickEffeciencyBoostWhenPowered",
darkSteelPickEffeciencyBoostWhenPowered = (float) config.get(sectionDarkSteel.name, "darkSteelPickEffeciencyBoostWhenPowered",
darkSteelPickEffeciencyBoostWhenPowered, "The increase in effciency when powered.").getDouble(darkSteelPickEffeciencyBoostWhenPowered);
darkSteelAxePowerUsePerDamagePoint = config.get("Dark Steel", "darkSteelAxePowerUsePerDamagePoint", darkSteelAxePowerUsePerDamagePoint,
darkSteelAxePowerUsePerDamagePoint = config.get(sectionDarkSteel.name, "darkSteelAxePowerUsePerDamagePoint", darkSteelAxePowerUsePerDamagePoint,
"Power use (RF) per damage/durability point avoided.").getInt(darkSteelAxePowerUsePerDamagePoint);
darkSteelAxePowerUsePerDamagePointMultiHarvest = config.get("Dark Steel", "darkSteelPickAxeUsePerDamagePointMultiHarvest",
darkSteelAxePowerUsePerDamagePointMultiHarvest = config.get(sectionDarkSteel.name, "darkSteelPickAxeUsePerDamagePointMultiHarvest",
darkSteelAxePowerUsePerDamagePointMultiHarvest,
"Power use (RF) per damage/durability point avoided when shift-harvesting multiple logs").getInt(darkSteelAxePowerUsePerDamagePointMultiHarvest);
darkSteelAxeSpeedPenaltyMultiHarvest = (float) config.get("Dark Steel", "darkSteelAxeSpeedPenaltyMultiHarvest", darkSteelAxeSpeedPenaltyMultiHarvest,
darkSteelAxeSpeedPenaltyMultiHarvest = (float) config.get(sectionDarkSteel.name, "darkSteelAxeSpeedPenaltyMultiHarvest", darkSteelAxeSpeedPenaltyMultiHarvest,
"How much slower shift-harvesting logs is.").getDouble(darkSteelAxeSpeedPenaltyMultiHarvest);
darkSteelAxeEffeciencyBoostWhenPowered = (float) config.get("Dark Steel", "darkSteelAxeEffeciencyBoostWhenPowered",
darkSteelAxeEffeciencyBoostWhenPowered = (float) config.get(sectionDarkSteel.name, "darkSteelAxeEffeciencyBoostWhenPowered",
darkSteelAxeEffeciencyBoostWhenPowered, "The increase in effciency when powered.").getDouble(darkSteelAxeEffeciencyBoostWhenPowered);
hootchPowerPerCycle = config.get("Power Settings", "hootchPowerPerCycle", hootchPowerPerCycle,
hootchPowerPerCycle = config.get(sectionPower.name, "hootchPowerPerCycle", hootchPowerPerCycle,
"The amount of power generated per BC engine cycle. Examples: BC Oil = 3, BC Fuel = 6").getInt(hootchPowerPerCycle);
hootchPowerTotalBurnTime = config.get("Power Settings", "hootchPowerTotalBurnTime", hootchPowerTotalBurnTime,
hootchPowerTotalBurnTime = config.get(sectionPower.name, "hootchPowerTotalBurnTime", hootchPowerTotalBurnTime,
"The total burn time. Examples: BC Oil = 5000, BC Fuel = 25000").getInt(hootchPowerTotalBurnTime);
rocketFuelPowerPerCycle = config.get("Power Settings", "rocketFuelPowerPerCycle", rocketFuelPowerPerCycle,
rocketFuelPowerPerCycle = config.get(sectionPower.name, "rocketFuelPowerPerCycle", rocketFuelPowerPerCycle,
"The amount of power generated per BC engine cycle. Examples: BC Oil = 3, BC Fuel = 6").getInt(rocketFuelPowerPerCycle);
rocketFuelPowerTotalBurnTime = config.get("Power Settings", "rocketFuelPowerTotalBurnTime", rocketFuelPowerTotalBurnTime,
rocketFuelPowerTotalBurnTime = config.get(sectionPower.name, "rocketFuelPowerTotalBurnTime", rocketFuelPowerTotalBurnTime,
"The total burn time. Examples: BC Oil = 5000, BC Fuel = 25000").getInt(rocketFuelPowerTotalBurnTime);
fireWaterPowerPerCycle = config.get("Power Settings", "fireWaterPowerPerCycle", fireWaterPowerPerCycle,
fireWaterPowerPerCycle = config.get(sectionPower.name, "fireWaterPowerPerCycle", fireWaterPowerPerCycle,
"The amount of power generated per BC engine cycle. Examples: BC Oil = 3, BC Fuel = 6").getInt(fireWaterPowerPerCycle);
fireWaterPowerTotalBurnTime = config.get("Power Settings", "fireWaterPowerTotalBurnTime", fireWaterPowerTotalBurnTime,
fireWaterPowerTotalBurnTime = config.get(sectionPower.name, "fireWaterPowerTotalBurnTime", fireWaterPowerTotalBurnTime,
"The total burn time. Examples: BC Oil = 5000, BC Fuel = 25000").getInt(fireWaterPowerTotalBurnTime);
zombieGeneratorMjPerTick = config.get("Power Settings", "zombieGeneratorMjPerTick", zombieGeneratorMjPerTick,
zombieGeneratorMjPerTick = config.get(sectionPower.name, "zombieGeneratorMjPerTick", zombieGeneratorMjPerTick,
"The amount of power generated per tick.").getDouble(zombieGeneratorMjPerTick);
zombieGeneratorTicksPerBucketFuel = config.get("Power Settings", "zombieGeneratorTicksPerMbFuel", zombieGeneratorTicksPerBucketFuel,
zombieGeneratorTicksPerBucketFuel = config.get(sectionPower.name, "zombieGeneratorTicksPerMbFuel", zombieGeneratorTicksPerBucketFuel,
"The number of ticks one bucket of fuel lasts.").getInt(zombieGeneratorTicksPerBucketFuel);
addFuelTooltipsToAllFluidContainers = config.get("Personal Settings", "addFuelTooltipsToAllFluidContainers", addFuelTooltipsToAllFluidContainers,
addFuelTooltipsToAllFluidContainers = config.get(sectionPersonal.name, "addFuelTooltipsToAllFluidContainers", addFuelTooltipsToAllFluidContainers,
"If true, the MJ/t and burn time of the fuel will be displayed in all tooltips for fluid containers with fuel.").getBoolean(
addFuelTooltipsToAllFluidContainers);
addDurabilityTootip = config.get("Personal Settings", "addDurabilityTootip", addFuelTooltipsToAllFluidContainers,
addDurabilityTootip = config.get(sectionPersonal.name, "addDurabilityTootip", addFuelTooltipsToAllFluidContainers,
"If true, adds durability tooltips to tools and armor").getBoolean(
addDurabilityTootip);
addFurnaceFuelTootip = config.get("Personal Settings", "addFurnaceFuelTootip", addFuelTooltipsToAllFluidContainers,
addFurnaceFuelTootip = config.get(sectionPersonal.name, "addFurnaceFuelTootip", addFuelTooltipsToAllFluidContainers,
"If true, adds burn duration tooltips to furnace fuels").getBoolean(addFurnaceFuelTootip);
farmContinuousEnergyUse = (float) config.get("Farm Settings", "farmContinuousEnergyUse", farmContinuousEnergyUse,
farmContinuousEnergyUse = (float) config.get(sectionFarm.name, "farmContinuousEnergyUse", farmContinuousEnergyUse,
"The amount of power used by a farm per tick ").getDouble(farmContinuousEnergyUse);
farmActionEnergyUse = (float) config.get("Farm Settings", "farmActionEnergyUse", farmActionEnergyUse,
farmActionEnergyUse = (float) config.get(sectionFarm.name, "farmActionEnergyUse", farmActionEnergyUse,
"The amount of power used by a farm per action (eg plant, till, harvest) ").getDouble(farmActionEnergyUse);
farmDefaultSize = config.get("Farm Settings", "farmDefaultSize", farmDefaultSize,
farmDefaultSize = config.get(sectionFarm.name, "farmDefaultSize", farmDefaultSize,
"The number of blocks a farm will extend from its center").getInt(farmDefaultSize);
farmAxeDamageOnLeafBreak = config.get("Farm Settings", "farmAxeDamageOnLeafBreak", farmAxeDamageOnLeafBreak,
"Should axes in a farm take damage when breaking leaves?").getBoolean(farmAxeDamageOnLeafBreak);
farmToolTakeDamageChance = (float) config.get("Farm Settings", "farmToolTakeDamageChance", farmToolTakeDamageChance,
"The chance that a tool in the farm will take damage.").getDouble(farmToolTakeDamageChance);
farmAxeDamageOnLeafBreak = config.get(sectionFarm.name, "farmAxeDamageOnLeafBreak", farmAxeDamageOnLeafBreak,
"Should axes in a farm take damage when breaking leaves?").getBoolean(farmAxeDamageOnLeafBreak);
farmToolTakeDamageChance = (float) config.get(sectionFarm.name, "farmToolTakeDamageChance", farmToolTakeDamageChance,
"The chance that a tool in the farm will take damage.").getDouble(farmToolTakeDamageChance);
combustionGeneratorUseOpaqueModel = config.get("Aesthetic Settings", "combustionGeneratorUseOpaqueModel", combustionGeneratorUseOpaqueModel,
combustionGeneratorUseOpaqueModel = config.get(sectionAesthetic.name, "combustionGeneratorUseOpaqueModel", combustionGeneratorUseOpaqueModel,
"If set to true: fluid will not be shown in combustion generator tanks. Improves FPS. ").getBoolean(combustionGeneratorUseOpaqueModel);
magnetPowerUsePerSecondRF = config.get("Magnet Settings", "magnetPowerUsePerTickRF", magnetPowerUsePerSecondRF,
magnetPowerUsePerSecondRF = config.get(sectionMagnet.name, "magnetPowerUsePerTickRF", magnetPowerUsePerSecondRF,
"The amount of RF power used per tick when the magnet is active").getInt(magnetPowerUsePerSecondRF);
magnetPowerCapacityRF = config.get("Magnet Settings", "magnetPowerCapacityRF", magnetPowerCapacityRF,
magnetPowerCapacityRF = config.get(sectionMagnet.name, "magnetPowerCapacityRF", magnetPowerCapacityRF,
"Amount of RF power stored in a fully charged magnet").getInt(magnetPowerCapacityRF);
magnetRange = config.get("Magnet Settings", "magnetRange", magnetRange,
magnetRange = config.get(sectionMagnet.name, "magnetRange", magnetRange,
"Range of the magnet in blocks.").getInt(magnetRange);
useCombustionGenModel = config.get("Aesthetic Settings", "useCombustionGenModel", useCombustionGenModel,
useCombustionGenModel = config.get(sectionAesthetic.name, "useCombustionGenModel", useCombustionGenModel,
"If set to true: WIP Combustion Generator model will be used").getBoolean(useCombustionGenModel);
crafterMjPerCraft = config.get("AutoCrafter Settings", "crafterMjPerCraft", crafterMjPerCraft,
"MJ used per autocrafted recipe").getInt(crafterMjPerCraft);
poweredSpawnerMinDelayTicks = config.get("PoweredSpawner Settings", "poweredSpawnerMinDelayTicks", poweredSpawnerMinDelayTicks,
"Min tick delay between spawns for a non-upgraded spawner").getInt(poweredSpawnerMinDelayTicks);
poweredSpawnerMaxDelayTicks = config.get("PoweredSpawner Settings", "poweredSpawnerMaxDelayTicks", poweredSpawnerMaxDelayTicks,
"Min tick delay between spawns for a non-upgraded spawner").getInt(poweredSpawnerMaxDelayTicks);
poweredSpawnerLevelOnePowerPerTick = (float) config.get("PoweredSpawner Settings", "poweredSpawnerLevelOnePowerPerTick",
poweredSpawnerLevelOnePowerPerTick,
poweredSpawnerMinDelayTicks = config.get(sectionSpawner.name, "poweredSpawnerMinDelayTicks", poweredSpawnerMinDelayTicks,
"Min tick delay between spawns for a non-upgraded spawner").getInt(poweredSpawnerMinDelayTicks);
poweredSpawnerMaxDelayTicks = config.get(sectionSpawner.name, "poweredSpawnerMaxDelayTicks", poweredSpawnerMaxDelayTicks,
"Min tick delay between spawns for a non-upgraded spawner").getInt(poweredSpawnerMaxDelayTicks);
poweredSpawnerLevelOnePowerPerTick = (float)config.get(sectionSpawner.name, "poweredSpawnerLevelOnePowerPerTick", poweredSpawnerLevelOnePowerPerTick,
"MJ per tick for a level 1 (non-upgraded) spawner").getDouble(poweredSpawnerLevelOnePowerPerTick);
poweredSpawnerLevelTwoPowerPerTick = (float) config.get("PoweredSpawner Settings", "poweredSpawnerLevelTwoPowerPerTick",
poweredSpawnerLevelTwoPowerPerTick,
poweredSpawnerLevelTwoPowerPerTick = (float)config.get(sectionSpawner.name, "poweredSpawnerLevelTwoPowerPerTick", poweredSpawnerLevelTwoPowerPerTick,
"MJ per tick for a level 2 spawner").getDouble(poweredSpawnerLevelTwoPowerPerTick);
poweredSpawnerLevelThreePowerPerTick = (float) config.get("PoweredSpawner Settings", "poweredSpawnerLevelThreePowerPerTick",
poweredSpawnerLevelThreePowerPerTick,
poweredSpawnerLevelThreePowerPerTick = (float)config.get(sectionSpawner.name, "poweredSpawnerLevelThreePowerPerTick", poweredSpawnerLevelThreePowerPerTick,
"MJ per tick for a level 3 spawner").getDouble(poweredSpawnerLevelThreePowerPerTick);
poweredSpawnerMaxPlayerDistance = config.get("PoweredSpawner Settings", "poweredSpawnerMaxPlayerDistance", poweredSpawnerMaxPlayerDistance,
poweredSpawnerMaxPlayerDistance = config.get(sectionSpawner.name, "poweredSpawnerMaxPlayerDistance", poweredSpawnerMaxPlayerDistance,
"Max distance of the closest player for the spawner to be active. A zero value will remove the player check").getInt(poweredSpawnerMaxPlayerDistance);
poweredSpawnerUseVanillaSpawChecks = config.get("PoweredSpawner Settings", "poweredSpawnerUseVanillaSpawChecks", poweredSpawnerUseVanillaSpawChecks,
poweredSpawnerUseVanillaSpawChecks = config.get(sectionSpawner.name, "poweredSpawnerUseVanillaSpawChecks", poweredSpawnerUseVanillaSpawChecks,
"If true, regular spawn checks such as lighting level and dimension will be made before spawning mobs").getBoolean(poweredSpawnerUseVanillaSpawChecks);
brokenSpawnerDropChance = (float) config.get("PoweredSpawner Settings", "brokenSpawnerDropChance", brokenSpawnerDropChance,
brokenSpawnerDropChance = (float)config.get(sectionSpawner.name, "brokenSpawnerDropChance", brokenSpawnerDropChance,
"The chance a brokne spawner will be dropped when a spawner is broken. 1 = 100% chance, 0 = 0% chance").getDouble(brokenSpawnerDropChance);
powerSpawnerAddSpawnerCost = config.get("PoweredSpawner Settings", "powerSpawnerAddSpawnerCost", powerSpawnerAddSpawnerCost,
powerSpawnerAddSpawnerCost = config.get(sectionSpawner.name, "powerSpawnerAddSpawnerCost", powerSpawnerAddSpawnerCost,
"The number of levels it costs to add a broken spawner").getInt(powerSpawnerAddSpawnerCost);
}
private Config() {
@@ -0,0 +1,30 @@
package crazypants.enderio.config;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import cpw.mods.fml.client.IModGuiFactory;
public class ConfigFactoryEIO implements IModGuiFactory{
@Override
public void initialize(Minecraft minecraftInstance) {
;
}
@Override
public Class<? extends GuiScreen> mainConfigGuiClass() {
return GuiConfigFactoryEIO.class;
}
@Override
public Set<RuntimeOptionCategoryElement> runtimeGuiCategories() {
return null;
}
@Override
public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement element) {
return null;
}
}
@@ -0,0 +1,36 @@
package crazypants.enderio.config;
import static crazypants.enderio.config.Config.*;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.ConfigElement;
import cpw.mods.fml.client.config.GuiConfig;
import cpw.mods.fml.client.config.IConfigElement;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config.Section;
import crazypants.util.Lang;
@SuppressWarnings({ "rawtypes" })
public class GuiConfigFactoryEIO extends GuiConfig {
public GuiConfigFactoryEIO(GuiScreen parentScreen)
{
super(parentScreen, getConfigElements(parentScreen), EnderIO.MODID, false, false, Lang.localize("config.title", true));
}
private static List<IConfigElement> getConfigElements(GuiScreen parent)
{
List<IConfigElement> list = new ArrayList<IConfigElement>();
String prefix = Lang.prefix + "config.";
for (Section section : Config.sections) {
list.add(new ConfigElement<ConfigCategory>(config.getCategory(section.lc()).setLanguageKey(prefix + section.lang)));
}
return list;
}
}
@@ -28,8 +28,8 @@ import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.network.PacketHandler;
import crazypants.enderio.teleport.TravelController;
import crazypants.render.RenderUtil;
@@ -346,7 +346,7 @@ public class GuiEnderface extends GuiScreen {
}
private boolean updateCamera(float partialTick) {
ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int vpx = guiLeft * scaledresolution.getScaleFactor();
int vpy = guiTop * scaledresolution.getScaleFactor();
int vpw = (int) ((float) gw / width * mc.displayWidth);
@@ -389,7 +389,7 @@ public class GuiEnderface extends GuiScreen {
private float portalFade = 1;
private void drawEffectOverlay(float partialTick) {
ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight);
ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(0.0D, scaledresolution.getScaledWidth_double(), scaledresolution.getScaledHeight_double(), 0.0D, 1000.0D, 3000.0D);
@@ -264,7 +264,7 @@ public class IoConfigRenderer {
private void renderOverlay(int mx, int my) {
Rectangle vp = camera.getViewport();
ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int vpx = vp.x / scaledresolution.getScaleFactor();
int vph = vp.height / scaledresolution.getScaleFactor();
@@ -26,7 +26,7 @@ import buildcraft.api.fuels.IronEngineFuel.Fuel;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
import crazypants.enderio.machine.crusher.IGrindingMultiplier;
import crazypants.enderio.machine.power.PowerDisplayUtil;
@@ -14,10 +14,10 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IResourceTooltipProvider;
import crazypants.enderio.machine.power.PowerDisplayUtil;
import crazypants.enderio.machine.power.PowerDisplayUtil.PowerType;
@@ -1,6 +1,5 @@
package crazypants.enderio.item;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
@@ -32,9 +31,6 @@ public class ItemRecipes {
GameRegistry.addShapedRecipe(EnderIO.itemDarkSteelLeggings.createItemStack(), "sss", "s s", "s s", 's', darkSteel);
GameRegistry.addShapedRecipe(EnderIO.itemDarkSteelBoots.createItemStack(), "s s", "s s", " ", 's', darkSteel);
GameRegistry.addShapedRecipe(EnderIO.itemDarkSteelBoots.createItemStack(), " ", "s s", "s s", 's', darkSteel);
ItemStack wing = new ItemStack(EnderIO.itemGliderWing,1,0);
GameRegistry.addShapedRecipe(wing, " s", " sl", "sll", 's', darkSteel, 'l', Items.leather);
GameRegistry.addShapedRecipe(new ItemStack(EnderIO.itemGliderWing,1,1), " s ", "wsw", " ", 's', darkSteel, 'w', wing);
ItemStack dspp = new ItemStack(EnderIO.blockDarkSteelPressurePlate);
GameRegistry.addShapedRecipe(dspp, "ss ", " ", " ", 's', darkSteel);
@@ -11,10 +11,10 @@ import buildcraft.api.tools.IToolWrench;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.conduit.ConduitDisplayMode;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IResourceTooltipProvider;
import crazypants.enderio.network.PacketHandler;
@@ -11,7 +11,7 @@ import net.minecraft.util.AxisAlignedBB;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
public class MagnetController implements IEntitySelector {
@@ -18,8 +18,8 @@ import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.network.PacketHandler;
import crazypants.util.Util;
import crazypants.vecmath.VecmathUtil;
@@ -167,7 +167,7 @@ public class DarkSteelController {
if(leggings != null && leggings.getItem() == EnderIO.itemDarkSteelLeggings && speedUpgrade != null) {
double horzMovement = Math.sqrt(player.motionX * player.motionX + player.motionZ * player.motionZ);
double costModifier = player.isSprinting() ? Config.darkSteelSprintPowerCost : Config.darkSteelWalkPowerCost;
double costModifier = player.isSprinting() ? Config.darkSteelSprintPowerCost : Config.darkSteelWalkPowerCost;
costModifier = costModifier + (costModifier * speedUpgrade.walkMultiplier);
int cost = (int) (horzMovement * costModifier);
@@ -185,7 +185,7 @@ public class DarkSteelController {
private void updateStepHeightAndFallDistance(EntityPlayer player) {
ItemStack boots = player.getEquipmentInSlot(1);
if(boots != null && boots.getItem() == EnderIO.itemDarkSteelBoots) {
int costedDistance = (int) player.fallDistance;
if(costedDistance > 0) {
@@ -194,17 +194,18 @@ public class DarkSteelController {
if(totalEnergy > 0 && totalEnergy >= energyCost) {
usePlayerEnergy(player, EnderIO.itemDarkSteelBoots, energyCost);
player.fallDistance -= costedDistance;
}
}
}
}
JumpUpgrade jumpUpgrade = JumpUpgrade.loadFromItem(boots);
if(jumpUpgrade != null && boots != null && boots.getItem() == EnderIO.itemDarkSteelBoots) {
player.stepHeight = 1.0023F;
} else if(player.stepHeight == 1.0023F) {
player.stepHeight = 0.5001F;
}
}
}
void usePlayerEnergy(EntityPlayer player, ItemDarkSteelArmor armor, int cost) {
if(cost == 0) {
@@ -7,8 +7,8 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.power.PowerDisplayUtil;
import crazypants.enderio.material.Material;
@@ -1,11 +1,9 @@
package crazypants.enderio.item.darksteel;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.material.Material;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
public class GliderUpgrade extends AbstractUpgrade {
@@ -19,9 +19,9 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IAdvancedTooltipProvider;
import crazypants.util.ItemUtil;
import crazypants.util.Lang;
@@ -29,9 +29,9 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IAdvancedTooltipProvider;
import crazypants.util.BlockCoord;
import crazypants.util.ItemUtil;
@@ -18,9 +18,9 @@ import cofh.api.energy.IEnergyContainerItem;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IAdvancedTooltipProvider;
import crazypants.enderio.machine.power.PowerDisplayUtil;
import crazypants.util.ItemUtil;
@@ -24,9 +24,9 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IAdvancedTooltipProvider;
import crazypants.util.ItemUtil;
import crazypants.util.Lang;
@@ -2,8 +2,8 @@ package crazypants.enderio.item.darksteel;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.material.Material;
public class SpeedUpgrade extends AbstractUpgrade {
@@ -68,7 +68,7 @@ public class GuiOverlayIoConfig implements IGuiOverlay {
RenderUtil.renderQuad2D(bounds.x, bounds.y, 0, bounds.width, bounds.height, ColorUtil.getRGB(Color.black));
Minecraft mc = Minecraft.getMinecraft();
ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
ScaledResolution scaledresolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int vpx = ( (screen.getGuiLeft() + bounds.x)* scaledresolution.getScaleFactor());
int vpy = (screen.getGuiTop() + 4) * scaledresolution.getScaleFactor();
@@ -10,8 +10,8 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.material.Alloy;
import crazypants.enderio.material.MachinePart;
import crazypants.enderio.material.Material;
@@ -130,10 +130,6 @@ public class MachineRecipes {
.addShapedRecipe(mJMonitor, "bmb", "bMb", "bcb", 'b', Blocks.stonebrick, 'e', Items.ender_eye, 'M', machineChassi, 'm', mJReader, 'p', powerConduit,
'r', redstoneConduit, 'c', capacitor);
//Vacuum Chest
ItemStack vacuumChest = new ItemStack(EnderIO.blockVacuumChest);
GameRegistry.addShapedRecipe(vacuumChest, "iii", "ici","ipi", 'i', Items.iron_ingot, 'c', Blocks.chest, 'p', pulCry);
}
public static void addOreDictionaryRecipes() {
@@ -9,9 +9,9 @@ import net.minecraft.item.ItemStack;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import crazypants.enderio.Config;
import crazypants.enderio.Log;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.MachineRecipeInput;
import crazypants.enderio.machine.MachineRecipeRegistry;
import crazypants.enderio.machine.recipe.CustomTagHandler;
@@ -10,8 +10,8 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.nbt.NBTTagCompound;
import crazypants.enderio.Config;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.AbstractMachineEntity;
import crazypants.enderio.machine.SlotDefinition;
import crazypants.enderio.power.Capacitors;
@@ -9,9 +9,9 @@ import java.util.Set;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import crazypants.enderio.Config;
import crazypants.enderio.Log;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.MachineRecipeInput;
import crazypants.enderio.machine.MachineRecipeRegistry;
import crazypants.enderio.machine.recipe.IRecipe;
@@ -1,5 +1,7 @@
package crazypants.enderio.machine.farm;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
@@ -17,8 +19,10 @@ import com.mojang.authlib.GameProfile;
import cpw.mods.fml.common.FMLCommonHandler;
public class FakeFarmPlayer extends EntityPlayerMP {
private static GameProfile DUMMY_PROFILE = new GameProfile("EioFarmerID", "[EioFarmer]");
private static final UUID uuid = UUID.fromString("c1ddfd7f-120a-4437-8b64-38660d3ec62d");
private static GameProfile DUMMY_PROFILE = new GameProfile(uuid, "[EioFarmer]");
public FakeFarmPlayer(WorldServer world) {
super(FMLCommonHandler.instance().getMinecraftServerInstance(), world, DUMMY_PROFILE, new ItemInWorldManager(world));
@@ -7,16 +7,16 @@ import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import crazypants.util.BlockCoord;
public class FarmersComune implements IFarmerJoe {
public class FarmersCommune implements IFarmerJoe {
public static FarmersComune instance = new FarmersComune();
public static FarmersCommune instance = new FarmersCommune();
public static void joinComune(IFarmerJoe joe) {
public static void joinCommune(IFarmerJoe joe) {
instance.farmers.add(joe);
}
public static void leaveComune(IFarmerJoe joe) {
throw new UnsupportedOperationException("As if this would be implemented. The comune is for life!");
public static void leaveCommune(IFarmerJoe joe) {
throw new UnsupportedOperationException("As if this would be implemented. The commune is for life!");
}
private List<IFarmerJoe> farmers = new ArrayList<IFarmerJoe>();
@@ -11,14 +11,14 @@ public final class FarmersRegistry {
public static void addFarmers() {
//vanilla
FarmersComune.instance.joinComune(new SeedFarmer(Blocks.potatoes, new ItemStack(Items.potato)));
FarmersComune.instance.joinComune(new SeedFarmer(Blocks.wheat, new ItemStack(Items.wheat_seeds)));
FarmersComune.instance.joinComune(new SeedFarmer(Blocks.carrots, new ItemStack(Items.carrot)));
FarmersComune.instance.joinComune(new NetherWartFarmer());
FarmersComune.instance.joinComune(new StemFarmer(Blocks.reeds, new ItemStack(Items.reeds)));
FarmersComune.instance.joinComune(new StemFarmer(Blocks.cactus, new ItemStack(Blocks.cactus)));
FarmersComune.instance.joinComune(new TreeFarmer(Blocks.sapling, Blocks.log));
FarmersComune.instance.joinComune(new TreeFarmer(Blocks.sapling, Blocks.log2));
FarmersCommune.instance.joinCommune(new SeedFarmer(Blocks.potatoes, new ItemStack(Items.potato)));
FarmersCommune.instance.joinCommune(new SeedFarmer(Blocks.wheat, new ItemStack(Items.wheat_seeds)));
FarmersCommune.instance.joinCommune(new SeedFarmer(Blocks.carrots, new ItemStack(Items.carrot)));
FarmersCommune.instance.joinCommune(new NetherWartFarmer());
FarmersCommune.instance.joinCommune(new StemFarmer(Blocks.reeds, new ItemStack(Items.reeds)));
FarmersCommune.instance.joinCommune(new StemFarmer(Blocks.cactus, new ItemStack(Blocks.cactus)));
FarmersCommune.instance.joinCommune(new TreeFarmer(Blocks.sapling, Blocks.log));
FarmersCommune.instance.joinCommune(new TreeFarmer(Blocks.sapling, Blocks.log2));
addExtraUtilities();
addNutura();
@@ -45,7 +45,7 @@ public final class FarmersRegistry {
if(cropBlock != null) {
Item seedItem = GameRegistry.findItem(mod, itemName);
if(seedItem != null) {
FarmersComune.instance.joinComune(new PickableFarmer(cropBlock, new ItemStack(seedItem)));
FarmersCommune.instance.joinCommune(new PickableFarmer(cropBlock, new ItemStack(seedItem)));
}
}
}
@@ -55,7 +55,7 @@ public final class FarmersRegistry {
if(cropBlock != null) {
Item seedItem = GameRegistry.findItem(mod, itemName);
if(seedItem != null) {
FarmersComune.instance.joinComune(new SeedFarmer(cropBlock, new ItemStack(seedItem)));
FarmersCommune.instance.joinCommune(new SeedFarmer(cropBlock, new ItemStack(seedItem)));
}
}
}
@@ -71,7 +71,7 @@ public final class FarmersRegistry {
for (int i = 0; i < 2; i++) {
PickableFarmer farmer = new NaturaBerryFarmer(cropBlock, i, 12 + i, new ItemStack(seedItem, 1, 8 + i));
farmer.setRequiresFarmland(false);
FarmersComune.instance.joinComune(farmer);
FarmersCommune.instance.joinCommune(farmer);
}
}
}
@@ -84,7 +84,7 @@ public final class FarmersRegistry {
for (int i = 0; i < 4; i++) {
PickableFarmer farmer = new NaturaBerryFarmer(cropBlock, i, 12 + i, new ItemStack(seedItem, 1, 8 + i));
farmer.setRequiresFarmland(false);
FarmersComune.instance.joinComune(farmer);
FarmersCommune.instance.joinCommune(farmer);
}
}
}
@@ -100,9 +100,9 @@ public final class FarmersRegistry {
Item seedItem = GameRegistry.findItem(mod, "barley.seed");
if(seedItem != null) {
//barley
FarmersComune.instance.joinComune(new SeedFarmer(cropBlock, 3, new ItemStack(seedItem)));
FarmersCommune.instance.joinCommune(new SeedFarmer(cropBlock, 3, new ItemStack(seedItem)));
// cotton
FarmersComune.instance.joinComune(new PickableFarmer(cropBlock, 4, 8, new ItemStack(seedItem, 1, 1)));
FarmersCommune.instance.joinCommune(new PickableFarmer(cropBlock, 4, 8, new ItemStack(seedItem, 1, 1)));
}
}
@@ -114,7 +114,7 @@ public final class FarmersRegistry {
for (int i = 0; i < 4; i++) {
PickableFarmer farmer = new NaturaBerryFarmer(cropBlock, i, 12 + i, new ItemStack(seedItem, 1, 12 + i));
farmer.setRequiresFarmland(false);
FarmersComune.instance.joinComune(farmer);
FarmersCommune.instance.joinCommune(farmer);
}
}
}
@@ -14,9 +14,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import buildcraft.api.power.PowerHandler.Type;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.AbstractPoweredTaskEntity;
import crazypants.enderio.machine.IMachineRecipe;
import crazypants.enderio.machine.IMachineRecipe.ResultStack;
@@ -217,7 +217,7 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*implements IEnt
(Util.isType(stack, ItemAxe.class) && !hasAxe()) ||
(getTool(stack.getItem().getClass()) == null && getLooting(stack) > 0);
}
return FarmersComune.instance.canPlant(stack);
return FarmersCommune.instance.canPlant(stack);
}
@Override
@@ -254,11 +254,11 @@ public class TileFarmStation extends AbstractPoweredTaskEntity /*implements IEnt
if(isOpen(bc)) {
FarmersComune.instance.prepareBlock(this, bc, block, meta);
FarmersCommune.instance.prepareBlock(this, bc, block, meta);
block = worldObj.getBlock(bc.x, bc.y, bc.z);
}
if(!isOpen(bc) && hasPower()) {
IHarvestResult harvest = FarmersComune.instance.harvestBlock(this, bc, block, meta);
IHarvestResult harvest = FarmersCommune.instance.harvestBlock(this, bc, block, meta);
if(harvest != null) {
if(harvest.getDrops() != null) {
PacketFarmAction pkt = new PacketFarmAction(harvest.getHarvestedBlocks());
@@ -16,7 +16,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
import crazypants.util.BlockCoord;
public class TreeFarmer implements IFarmerJoe {
@@ -16,8 +16,8 @@ import net.minecraftforge.fluids.FluidTank;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.AbstractMachineBlock;
import crazypants.enderio.machine.IoMode;
import crazypants.render.BoundingBox;
@@ -10,9 +10,9 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import buildcraft.api.power.IPowerEmitter;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.AbstractMachineEntity;
import crazypants.enderio.machine.IoMode;
import crazypants.enderio.machine.SlotDefinition;
@@ -3,6 +3,7 @@ package crazypants.enderio.machine.hypercube;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Random;
import java.util.UUID;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -158,7 +159,7 @@ public class BlockHyperCube extends BlockEio implements IGuiHandler, IResourceTo
tag.setString("channelName", chan.name);
tag.setBoolean("channelIsPublic", chan.isPublic());
if(!chan.isPublic()) {
tag.setString("channelUser", chan.user);
tag.setString("channelUser", chan.user.toString());
}
}
}
@@ -197,9 +198,9 @@ public class BlockHyperCube extends BlockEio implements IGuiHandler, IResourceTo
return null;
}
String user = null;
UUID user = null;
if(!tag.getBoolean("channelIsPublic")) {
user = tag.getString("channelUser");
user = UUID.fromString(tag.getString("channelUser"));
}
return new Channel(channelName, user);
@@ -1,13 +1,15 @@
package crazypants.enderio.machine.hypercube;
import java.util.UUID;
public class Channel {
final String name;
final String user;
final UUID user;
Channel(String name, String user) {
Channel(String name, UUID uuid) {
this.name = trim(name);
this.user = trim(user);
this.user = uuid;
}
public boolean isPublic() {
@@ -12,6 +12,7 @@ import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Properties;
import java.util.UUID;
import org.apache.commons.io.IOUtils;
@@ -32,7 +33,7 @@ public class HyperCubeConfig {
private final List<Channel> publicChannels = new ArrayList<Channel>();
private final Map<String, List<Channel>> userChannels = new HashMap<String, List<Channel>>();
private final Map<UUID, List<Channel>> userChannels = new HashMap<UUID, List<Channel>>();
private final File file;
@@ -52,11 +53,11 @@ public class HyperCubeConfig {
publicChannels.addAll(chans);
}
public Map<String, List<Channel>> getUserChannels() {
public Map<UUID, List<Channel>> getUserChannels() {
return userChannels;
}
public void setUserChannels(Map<String, List<Channel>> channels) {
public void setUserChannels(Map<UUID, List<Channel>> channels) {
userChannels.clear();
userChannels.putAll(channels);
}
@@ -67,16 +68,14 @@ public class HyperCubeConfig {
setChannelListProperty(KEY_PUBLIC_CHANNELS, publicChannels);
StringBuilder userListStr = new StringBuilder();
Iterator<Entry<String, List<Channel>>> itr = userChannels.entrySet().iterator();
Iterator<Entry<UUID, List<Channel>>> itr = userChannels.entrySet().iterator();
while (itr.hasNext()) {
Entry<String, List<Channel>> entry = itr.next();
String user = entry.getKey();
if(user != null) {
user = user.trim();
}
Entry<UUID, List<Channel>> entry = itr.next();
UUID user = entry.getKey();
List<Channel> channels = entry.getValue();
if(user != null && channels != null && !channels.isEmpty()) {
userListStr.append(user);
userListStr.append(user.toString());
setChannelListProperty(user + KEY_USER_CHANNEL, channels);
}
if(itr.hasNext()) {
@@ -135,18 +134,15 @@ public class HyperCubeConfig {
loadChannelList(KEY_PUBLIC_CHANNELS, null, publicChannels);
userChannels.clear();
List<String> users = new ArrayList<String>();
List<UUID> users = new ArrayList<UUID>();
String usersStr = props.getProperty(KEY_USERS, "");
String[] usersSplit = usersStr.split(DELIM);
for (String user : usersSplit) {
if(user != null) {
user = user.trim();
if(!user.isEmpty()) {
users.add(user);
}
users.add(UUID.fromString(user));
}
}
for (String user : users) {
for (UUID user : users) {
List<Channel> channels = new ArrayList<Channel>();
loadChannelList(user + KEY_USER_CHANNEL, user, channels);
if(!channels.isEmpty()) {
@@ -156,7 +152,7 @@ public class HyperCubeConfig {
}
private void loadChannelList(String key, String user, List<Channel> channels) {
private void loadChannelList(String key, UUID user, List<Channel> channels) {
String chans = props.getProperty(key, "");
//chans = chans.replaceAll(DELIM_ESC, DELIM);
String[] chanSplit = chans.split(DELIM);
@@ -6,6 +6,7 @@ import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import net.minecraftforge.common.DimensionManager;
import crazypants.enderio.Log;
@@ -23,7 +24,7 @@ public class HyperCubeRegister {
private final List<Channel> publicChannels = new ArrayList<Channel>();
private final List<Channel> publicChannelsRO = Collections.unmodifiableList(publicChannels);
private final Map<String, List<Channel>> userChannels = new HashMap<String, List<Channel>>();
private final Map<UUID, List<Channel>> userChannels = new HashMap<UUID, List<Channel>>();
//private Configuration config;
private HyperCubeConfig conf;
@@ -44,7 +45,7 @@ public class HyperCubeRegister {
userChannels.putAll(conf.getUserChannels());
}
public synchronized List<Channel> getChannelsForUser(String user) {
public synchronized List<Channel> getChannelsForUser(UUID user) {
List<Channel> result = userChannels.get(user);
if(result == null) {
result = new ArrayList<Channel>();
@@ -11,8 +11,8 @@ import net.minecraftforge.client.IItemRenderer;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.render.BoundingBox;
import crazypants.render.CubeRenderer;
import crazypants.render.RenderUtil;
@@ -1,5 +1,7 @@
package crazypants.enderio.machine.hypercube;
import java.util.UUID;
import io.netty.buffer.ByteBuf;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.ByteBufUtils;
@@ -28,7 +30,7 @@ public class PacketAddRemoveChannel implements IMessage, IMessageHandler<PacketA
buf.writeBoolean(channel.isPublic());
ByteBufUtils.writeUTF8String(buf, channel.name);
if(!channel.isPublic()) {
ByteBufUtils.writeUTF8String(buf, channel.user);
ByteBufUtils.writeUTF8String(buf, channel.user.toString());
}
}
@@ -42,7 +44,7 @@ public class PacketAddRemoveChannel implements IMessage, IMessageHandler<PacketA
if(!isPublic) {
user = ByteBufUtils.readUTF8String(data);
}
channel = new Channel(name, user);
channel = new Channel(name, user == null ? null : UUID.fromString(user));
}
@Override
@@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import cpw.mods.fml.common.network.ByteBufUtils;
@@ -15,7 +16,7 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
private boolean isPrivate;
private List<Channel> channels;
private String userId;
private UUID userId;
public PacketChannelList() {
}
@@ -24,16 +25,16 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
this(player.getGameProfile().getId(), isPrivate);
}
public PacketChannelList(String userId, boolean isPrivate) {
this.userId = userId;
public PacketChannelList(UUID uuid, boolean isPrivate) {
this.userId = uuid;
this.isPrivate = isPrivate;
if(isPrivate && userId == null || userId.trim().length() == 0) {
if(isPrivate && uuid == null) {
throw new RuntimeException("Null user ID.");
}
List<Channel> res;
if(isPrivate) {
res = HyperCubeRegister.instance.getChannelsForUser(userId);
res = HyperCubeRegister.instance.getChannelsForUser(uuid);
} else {
res = HyperCubeRegister.instance.getPublicChannels();
}
@@ -49,7 +50,7 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
public void toBytes(ByteBuf buffer) {
buffer.writeBoolean(isPrivate);
if(isPrivate) {
ByteBufUtils.writeUTF8String(buffer, userId);
ByteBufUtils.writeUTF8String(buffer, userId.toString());
}
buffer.writeInt(channels.size());
for (Channel channel : channels) {
@@ -62,7 +63,7 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
public void fromBytes(ByteBuf buffer) {
isPrivate = buffer.readBoolean();
if(isPrivate) {
userId = ByteBufUtils.readUTF8String(buffer);
userId = UUID.fromString(ByteBufUtils.readUTF8String(buffer));
} else {
userId = null;
}
@@ -71,7 +72,6 @@ public class PacketChannelList implements IMessage, IMessageHandler<PacketChanne
for (int i = 0; i < numChannels; i++) {
channels.add(new Channel(ByteBufUtils.readUTF8String(buffer), userId));
}
}
@Override
@@ -4,6 +4,7 @@ import io.netty.buffer.ByteBuf;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
@@ -50,7 +51,7 @@ public class PacketClientState implements IMessage, IMessageHandler<PacketClient
if(selectedChannel.isPublic()) {
ByteBufUtils.writeUTF8String(buf, "");
} else {
ByteBufUtils.writeUTF8String(buf, selectedChannel.user);
ByteBufUtils.writeUTF8String(buf, selectedChannel.user.toString());
}
}
@@ -70,7 +71,7 @@ public class PacketClientState implements IMessage, IMessageHandler<PacketClient
selectedChannel = null;
if(name != null && name.trim().length() > 0) {
if(user != null && user.trim().length() > 0) {
selectedChannel = new Channel(name, user);
selectedChannel = new Channel(name, UUID.fromString(user));
} else {
selectedChannel = new Channel(name, null);
}
@@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
import java.util.ListIterator;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -21,10 +22,10 @@ import net.minecraftforge.fluids.IFluidHandler;
import buildcraft.api.power.PowerHandler;
import buildcraft.api.power.PowerHandler.PowerReceiver;
import buildcraft.api.power.PowerHandler.Type;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.ModObject;
import crazypants.enderio.TileEntityEio;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.IRedstoneModeControlable;
import crazypants.enderio.machine.RedstoneControlMode;
import crazypants.enderio.power.BasicCapacitor;
@@ -34,6 +35,7 @@ import crazypants.enderio.power.PowerHandlerUtil;
import crazypants.util.BlockCoord;
import crazypants.util.ItemUtil;
import crazypants.util.Lang;
import crazypants.util.Util;
import crazypants.vecmath.VecmathUtil;
public class TileHyperCube extends TileEntityEio implements IInternalPowerReceptor, IFluidHandler, ISidedInventory, IRedstoneModeControlable {
@@ -120,7 +122,7 @@ public class TileHyperCube extends TileEntityEio implements IInternalPowerRecept
private Channel channel = null;
private Channel registeredChannel = null;
private String owner;
private UUID owner;
private boolean init = true;
@@ -184,7 +186,7 @@ public class TileHyperCube extends TileEntityEio implements IInternalPowerRecept
HyperCubeRegister.instance.register(this);
}
public void setOwner(String owner) {
public void setOwner(UUID owner) {
this.owner = owner;
}
@@ -839,12 +841,12 @@ public class TileHyperCube extends TileEntityEio implements IInternalPowerRecept
String channelName = nbtRoot.getString("channelName");
String channelUser = nbtRoot.getString("channelUser");
if(channelName != null && !channelName.isEmpty()) {
channel = new Channel(channelName, channelUser == null || channelUser.isEmpty() ? null : channelUser);
channel = new Channel(channelName, channelUser == null || channelUser.isEmpty() ? null : UUID.fromString(channelUser));
} else {
channel = null;
}
owner = nbtRoot.getString("owner");
owner = UUID.fromString(nbtRoot.getString("owner"));
for (SubChannel subChannel : SubChannel.values()) {
String key = "subChannel" + subChannel.ordinal();
@@ -868,11 +870,11 @@ public class TileHyperCube extends TileEntityEio implements IInternalPowerRecept
if(channel != null) {
nbtRoot.setString("channelName", channel.name);
if(channel.user != null) {
nbtRoot.setString("channelUser", channel.user);
nbtRoot.setString("channelUser", channel.user.toString());
}
}
if(owner != null && !(owner.isEmpty())) {
nbtRoot.setString("owner", owner);
if(owner != null) {
nbtRoot.setString("owner", owner.toString());
}
for (SubChannel subChannel : SubChannel.values()) {
@@ -355,7 +355,7 @@ public class BlockCapacitorBank extends BlockEio implements IGuiHandler, IAdvanc
min.z = Math.min(min.z, bc.z);
max.z = Math.max(max.z, bc.z + 1);
}
return AxisAlignedBB.getAABBPool().getAABB(min.x, min.y, min.z, max.x, max.y, max.z);
return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
}
}
@@ -4,7 +4,7 @@ import java.text.NumberFormat;
import net.minecraft.item.ItemStack;
import cofh.api.energy.IEnergyContainerItem;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
import crazypants.util.Lang;
public class PowerDisplayUtil {
@@ -20,12 +20,12 @@ import buildcraft.api.power.PowerHandler;
import buildcraft.api.power.PowerHandler.PowerReceiver;
import buildcraft.api.power.PowerHandler.Type;
import cofh.api.energy.IEnergyContainerItem;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.TileEntityEio;
import crazypants.enderio.conduit.ConnectionMode;
import crazypants.enderio.conduit.IConduitBundle;
import crazypants.enderio.conduit.power.IPowerConduit;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.IIoConfigurable;
import crazypants.enderio.machine.IoMode;
import crazypants.enderio.machine.RedstoneControlMode;
@@ -19,7 +19,7 @@ public class OreDictionaryRecipeInput extends RecipeInput {
}
public OreDictionaryRecipeInput(OreDictionaryRecipeInput copy) {
super(copy);
super(copy.getInput(), true, copy.getMulitplier(), copy.getSlotNumber());
oreId = copy.oreId;
}
@@ -18,8 +18,8 @@ import net.minecraft.item.ItemStack;
import org.apache.commons.io.IOUtils;
import crazypants.enderio.Config;
import crazypants.enderio.Log;
import crazypants.enderio.config.Config;
public class RecipeConfig {
@@ -162,7 +162,7 @@ public class BlockReservoir extends BlockContainer implements IResourceTooltipPr
min.z = Math.min(min.z, bc.z);
max.z = Math.max(max.z, bc.z + 1);
}
return AxisAlignedBB.getAABBPool().getAABB(min.x, min.y, min.z, max.x, max.y, max.z);
return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
}
@@ -8,9 +8,9 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlockWithMetadata;
import net.minecraft.item.ItemStack;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IAdvancedTooltipProvider;
import crazypants.enderio.gui.TooltipAddera;
import crazypants.enderio.machine.power.PowerDisplayUtil;
@@ -16,9 +16,9 @@ import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.tools.IToolWrench;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.BlockEio;
import crazypants.enderio.Config;
import crazypants.enderio.ModObject;
import crazypants.enderio.conduit.ConduitUtil;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IResourceTooltipProvider;
import crazypants.util.Util;
@@ -13,7 +13,7 @@ import buildcraft.api.power.IPowerEmitter;
import buildcraft.api.power.PowerHandler;
import buildcraft.api.power.PowerHandler.PowerReceiver;
import buildcraft.api.power.PowerHandler.Type;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
import crazypants.enderio.power.BasicCapacitor;
import crazypants.enderio.power.IInternalPowerReceptor;
import crazypants.enderio.power.IPowerInterface;
@@ -15,10 +15,10 @@ import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.AnvilUpdateEvent;
import net.minecraftforge.event.world.BlockEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.GuiHandler;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IAdvancedTooltipProvider;
import crazypants.enderio.gui.TooltipAddera;
import crazypants.enderio.machine.AbstractMachineBlock;
@@ -14,7 +14,6 @@ import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.gui.TooltipAddera;
public class ItemBrokenSpawner extends Item {
@@ -56,7 +55,7 @@ public class ItemBrokenSpawner extends Item {
setUnlocalizedName(ModObject.itemBrokenSpawner.unlocalisedName);
setHasSubtypes(true);
setMaxDamage(0);
setMaxStackSize(8);
setMaxStackSize(1);
}
@Override
@@ -92,11 +91,7 @@ public class ItemBrokenSpawner extends Item {
par3List.add(mobName);
}
}
if(TooltipAddera.showAdvancedTooltips()) {
TooltipAddera.addDetailedTooltipFromResources(par3List, par1ItemStack);
} else {
TooltipAddera.addShowDetailsTooltip(par3List);
}
}
}
@@ -1,6 +1,5 @@
package crazypants.enderio.machine.spawner;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
@@ -9,9 +8,9 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.AbstractPoweredTaskEntity;
import crazypants.enderio.machine.IMachineRecipe;
import crazypants.enderio.machine.IPoweredTask;
@@ -27,9 +26,9 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
public static final float POWER_PER_TICK_THREE = Config.poweredSpawnerLevelThreePowerPerTick;
public static final int MIN_PLAYER_DISTANCE = Config.poweredSpawnerMaxPlayerDistance;
public static final boolean USE_VANILLA_SPAWN_CHECKS = Config.poweredSpawnerUseVanillaSpawChecks;
private final MobSpawnerBaseLogic logic = new SpawnerLogic();
private static final String NULL_ENTITY_NAME = "None";
public TilePoweredSpawner() {
@@ -42,7 +41,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
@Override
protected void taskComplete() {
super.taskComplete();
logic.spawnDelay = 0;
logic.spawnDelay = 0;
}
@Override
@@ -74,8 +73,8 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
return POWER_PER_TICK_ONE;
} else if(capacitorType.ordinal() == 1) {
return POWER_PER_TICK_TWO;
}
return POWER_PER_TICK_THREE;
}
return POWER_PER_TICK_THREE;
}
@Override
@@ -84,19 +83,19 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
}
@Override
protected boolean canInsertResult(float chance, IMachineRecipe nextRecipe) {
protected boolean canInsertResult(float chance, IMachineRecipe nextRecipe) {
return true;
}
public void readCustomNBT(NBTTagCompound nbtRoot) {
super.readCustomNBT(nbtRoot);
logic.readFromNBT(nbtRoot);
super.readCustomNBT(nbtRoot);
logic.readFromNBT(nbtRoot);
}
public void writeCustomNBT(NBTTagCompound nbtRoot) {
super.writeCustomNBT(nbtRoot);
logic.writeToNBT(nbtRoot);
}
@Override
@@ -117,12 +116,12 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
BlockPoweredSpawner.writeMobTypeToNBT(nbtRoot, null);
} else {
BlockPoweredSpawner.writeMobTypeToNBT(nbtRoot, mobType);
}
}
}
public void updateEntity() {
logic.updateSpawner();
super.updateEntity();
super.updateEntity();
}
/**
@@ -132,23 +131,25 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
public boolean receiveClientEvent(int p_145842_1_, int p_145842_2_) {
return logic.setDelayToMin(p_145842_1_) ? true : super.receiveClientEvent(p_145842_1_, p_145842_2_);
}
protected IPoweredTask createTask(IMachineRecipe nextRecipe, float chance) {
PoweredTask res = new PoweredTask(nextRecipe, chance, getInputs());
int ticksDelay = TilePoweredSpawner.MIN_SPAWN_DELAY_BASE + (int)Math.round((TilePoweredSpawner.MAX_SPAWN_DELAY_BASE - TilePoweredSpawner.MIN_SPAWN_DELAY_BASE) * Math.random());
int ticksDelay = TilePoweredSpawner.MIN_SPAWN_DELAY_BASE
+ (int) Math.round((TilePoweredSpawner.MAX_SPAWN_DELAY_BASE - TilePoweredSpawner.MIN_SPAWN_DELAY_BASE) * Math.random());
if(capacitorType.ordinal() == 1) {
ticksDelay /= 2;
} else if(capacitorType.ordinal() == 2) {
ticksDelay /= 4;
}
int powerPerTick = (int)getPowerUsePerTick();
res.setRequiredEnergy(powerPerTick * ticksDelay);
int powerPerTick = (int) getPowerUsePerTick();
res.setRequiredEnergy(powerPerTick * ticksDelay);
return res;
}
protected boolean canSpawnEntity(EntityLiving entityliving) {
boolean spaceClear = worldObj.checkNoEntityCollision(entityliving.boundingBox) && worldObj.getCollidingBoundingBoxes(entityliving, entityliving.boundingBox).isEmpty() && !worldObj.isAnyLiquid(entityliving.boundingBox);
protected boolean canSpawnEntity(EntityLiving entityliving) {
boolean spaceClear = worldObj.checkNoEntityCollision(entityliving.boundingBox)
&& worldObj.getCollidingBoundingBoxes(entityliving, entityliving.boundingBox).isEmpty() && !worldObj.isAnyLiquid(entityliving.boundingBox);
if(spaceClear && USE_VANILLA_SPAWN_CHECKS) {
//Full checks for lighting, dimension etc
spaceClear = entityliving.getCanSpawnHere();
@@ -158,10 +159,10 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
class SpawnerLogic extends MobSpawnerBaseLogic {
private int spawnCount = 4;
private int spawnCount = 4;
private int maxNearbyEntities = 6;
private int spawnRange = 4;
public void func_98267_a(int par1) {
worldObj.addBlockEvent(xCoord, yCoord, zCoord, EnderIO.blockPoweredSpawner, par1, 0);
}
@@ -196,16 +197,17 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
public boolean isActivated() {
if(MIN_PLAYER_DISTANCE > 0) {
//TODO: Add this to main 'hasPower' like check so turn of the machine if the player is out of range?
boolean playerInRange = worldObj.getClosestPlayer((double)getSpawnerX() + 0.5D, (double)getSpawnerY() + 0.5D, (double)getSpawnerZ() + 0.5D, (double)MIN_PLAYER_DISTANCE) != null;
boolean playerInRange = worldObj.getClosestPlayer((double) getSpawnerX() + 0.5D, (double) getSpawnerY() + 0.5D, (double) getSpawnerZ() + 0.5D,
(double) MIN_PLAYER_DISTANCE) != null;
if(!playerInRange) {
return false;
}
}
return isActive();
return isActive();
}
public void updateSpawner() {
if(isActivated()) {
double d2;
@@ -224,7 +226,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
field_98284_d = field_98287_c;
field_98287_c = (field_98287_c + (double) (1000.0F / ((float) spawnDelay + 200.0F))) % 360.0D;
} else {
if(spawnDelay == -1) {
resetTimer();
}
@@ -236,7 +238,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
boolean doTimerReset = false;
for (int i = 0; i < spawnCount; ++i) {
Entity entity = EntityList.createEntityByName(getEntityNameToSpawn(), getSpawnerWorld());
if(entity == null) {
@@ -245,10 +247,8 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
int j = getSpawnerWorld().getEntitiesWithinAABB(
entity.getClass(),
AxisAlignedBB
.getAABBPool()
.getAABB((double) getSpawnerX(), (double) getSpawnerY(), (double) getSpawnerZ(), (double) (getSpawnerX() + 1),
(double) (getSpawnerY() + 1), (double) (getSpawnerZ() + 1)).expand((double) (spawnRange * 2), 4.0D, (double) (spawnRange * 2))).size();
AxisAlignedBB.getBoundingBox((double) getSpawnerX(), (double) getSpawnerY(), (double) getSpawnerZ(), (double) (getSpawnerX() + 1),
(double) (getSpawnerY() + 1), (double) (getSpawnerZ() + 1)).expand((double) (spawnRange * 2), 4.0D, (double) (spawnRange * 2))).size();
if(j >= maxNearbyEntities) {
resetTimer();
@@ -282,7 +282,7 @@ public class TilePoweredSpawner extends AbstractPoweredTaskEntity {
}
void resetTimer() {
spawnDelay = Integer.MAX_VALUE;
spawnDelay = Integer.MAX_VALUE;
}
}
@@ -10,8 +10,8 @@ import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
import net.minecraftforge.fluids.FluidTankInfo;
import net.minecraftforge.fluids.IFluidHandler;
import crazypants.enderio.Config;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.machine.AbstractPoweredTaskEntity;
import crazypants.enderio.machine.IMachineRecipe.ResultStack;
import crazypants.enderio.machine.IPoweredTask;
@@ -13,9 +13,8 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import crazypants.enderio.Config;
import crazypants.enderio.ModObject;
import crazypants.enderio.conduit.TileConduitBundle;
import crazypants.enderio.config.Config;
import crazypants.render.BoundingBox;
import crazypants.util.BlockCoord;
import crazypants.util.ItemUtil;
@@ -10,8 +10,8 @@ import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
public class MaterialRecipes {
@@ -3,8 +3,8 @@ package crazypants.enderio.nei;
import net.minecraft.item.ItemStack;
import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
public class NEIEnderIOConfig implements IConfigureNEI {
@@ -5,6 +5,7 @@ import io.netty.buffer.ByteBuf;
import java.io.IOException;
import net.minecraft.nbt.CompressedStreamTools;
import net.minecraft.nbt.NBTSizeTracker;
import net.minecraft.nbt.NBTTagCompound;
import cpw.mods.fml.common.FMLCommonHandler;
@@ -21,7 +22,8 @@ public class NetworkUtil {
} else {
byte[] buffer = new byte[size];
dataIn.readBytes(buffer);
return CompressedStreamTools.decompress(buffer);
// TODO I have no idea what I'm doing (byte = 8 bits = buffer.length * 8 ???)
return CompressedStreamTools.func_152457_a(buffer, new NBTSizeTracker(buffer.length * 8));
}
} catch (IOException e) {
FMLCommonHandler.instance().raiseException(e, "Custom Packet", true);
@@ -14,10 +14,10 @@ import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.IGuiHandler;
import cpw.mods.fml.relauncher.Side;
import crazypants.enderio.BlockEio;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.GuiHandler;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IResourceTooltipProvider;
import crazypants.enderio.network.PacketHandler;
import crazypants.enderio.teleport.packet.PacketAccessMode;
@@ -1,6 +1,7 @@
package crazypants.enderio.teleport;
import java.awt.Color;
import java.util.UUID;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
@@ -21,7 +22,7 @@ public class GuiTravelAuth extends GuiContainerBase {
private final String title;
private final ITravelAccessable ta;
private final String username;
private final UUID username;
private boolean failed = false;
private final EntityPlayer player;
@@ -1,5 +1,7 @@
package crazypants.enderio.teleport;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import crazypants.enderio.teleport.TileTravelAnchor.AccessMode;
@@ -29,7 +31,7 @@ public interface ITravelAccessable {
void setItemLabel(ItemStack lableIcon);
String getPlacedBy();
UUID getPlacedBy();
// void setPlacedBy(String placedBy);
@@ -16,10 +16,10 @@ import cofh.api.energy.ItemEnergyContainer;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.EnderIOTab;
import crazypants.enderio.ModObject;
import crazypants.enderio.config.Config;
import crazypants.enderio.gui.IResourceTooltipProvider;
import crazypants.enderio.machine.power.PowerDisplayUtil;
import crazypants.enderio.machine.power.PowerDisplayUtil.PowerType;
@@ -4,8 +4,8 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import cpw.mods.fml.common.registry.GameRegistry;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.config.Config;
import crazypants.enderio.material.Alloy;
import crazypants.enderio.material.Material;
import crazypants.enderio.power.Capacitors;
@@ -2,6 +2,7 @@ package crazypants.enderio.teleport;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@@ -28,9 +29,9 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
private ItemStack itemLabel;
private String placedBy;
private UUID placedBy;
private List<String> authorisedUsers = new ArrayList<String>();
private List<UUID> authorisedUsers = new ArrayList<UUID>();
@Override
public boolean canBlockBeAccessed(EntityPlayer playerName) {
@@ -131,7 +132,7 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
}
@Override
public String getPlacedBy() {
public UUID getPlacedBy() {
return placedBy;
}
@@ -165,10 +166,10 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
if(root.hasKey("accessMode")) {
accessMode = AccessMode.values()[root.getShort("accessMode")];
} else {
//keep behaviour the same for blocks placed prior to this update
//keep behavior the same for blocks placed prior to this update
accessMode = AccessMode.PUBLIC;
}
placedBy = root.getString("placedBy");
placedBy = UUID.fromString(root.getString("placedBy"));
for (int i = 0; i < password.length; i++) {
if(root.hasKey("password" + i)) {
NBTTagCompound stackRoot = (NBTTagCompound) root.getTag("password" + i);
@@ -185,7 +186,7 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
if(user != null) {
user = user.trim();
if(user.length() > 0) {
authorisedUsers.add(user);
authorisedUsers.add(UUID.fromString(user));
}
}
}
@@ -202,8 +203,8 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
@Override
protected void writeCustomNBT(NBTTagCompound root) {
root.setShort("accessMode", (short) accessMode.ordinal());
if(placedBy != null && placedBy.trim().length() > 0) {
root.setString("placedBy", placedBy);
if(placedBy != null) {
root.setString("placedBy", placedBy.toString());
}
for (int i = 0; i < password.length; i++) {
ItemStack stack = password[i];
@@ -214,9 +215,9 @@ public class TileTravelAnchor extends TileEntityEio implements ITravelAccessable
}
}
StringBuffer userStr = new StringBuffer();
for (String user : authorisedUsers) {
if(user != null && user.trim().length() > 0) {
userStr.append(user);
for (UUID user : authorisedUsers) {
if(user != null) {
userStr.append(user.toString());
userStr.append(",");
}
}
@@ -22,9 +22,9 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import crazypants.enderio.Config;
import crazypants.enderio.EnderIO;
import crazypants.enderio.GuiHandler;
import crazypants.enderio.config.Config;
import crazypants.enderio.enderface.TileEnderIO;
import crazypants.enderio.network.PacketHandler;
import crazypants.enderio.teleport.packet.PacketDrainStaff;
@@ -1,6 +1,6 @@
package crazypants.enderio.teleport;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
public enum TravelSource {
@@ -4,7 +4,7 @@ import io.netty.buffer.ByteBuf;
import cpw.mods.fml.common.network.simpleimpl.IMessage;
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
import crazypants.enderio.Config;
import crazypants.enderio.config.Config;
public class PacketConfigSync implements IMessage, IMessageHandler<PacketConfigSync, IMessage> {
@@ -177,7 +177,7 @@ public abstract class GuiScrollableList<T> {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_FOG);
ScaledResolution sr = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight);
ScaledResolution sr = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
int sx = minX * sr.getScaleFactor();
int sw = width * sr.getScaleFactor();
int sy = mc.displayHeight - (maxY * sr.getScaleFactor());
@@ -21,7 +21,7 @@ public class IconToggleButton extends IconButton {
}
@Override
protected int getHoverState(boolean par1) {
public int getHoverState(boolean par1) {
int result = 1;
if(!enabled || selected) {
result = 0;
@@ -30,5 +30,4 @@ public class IconToggleButton extends IconButton {
}
return result;
}
}
@@ -2,7 +2,6 @@ package crazypants.util;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3Pool;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.util.ForgeDirection;
@@ -32,11 +31,6 @@ public class IBlockAccessWrapper implements IBlockAccess {
return wrapped.isAirBlock(var1, var2, var3);
}
@Override
public Vec3Pool getWorldVec3Pool() {
return wrapped.getWorldVec3Pool();
}
@Override
public TileEntity getTileEntity(int var1, int var2, int var3) {
+3 -1
View File
@@ -3,6 +3,8 @@ package crazypants.util;
import net.minecraft.util.StatCollector;
public class Lang {
public static final String prefix = "enderio.";
public static String localize(String s) {
return localize(s, true);
@@ -10,7 +12,7 @@ public class Lang {
public static String localize(String s, boolean appendEIO) {
if(appendEIO) {
s = "enderio." + s;
s = prefix + s;
}
return StatCollector.translateToLocal(s);
}
+7 -8
View File
@@ -2,6 +2,7 @@ package crazypants.util;
import java.io.File;
import java.io.IOException;
import java.util.UUID;
import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
@@ -15,6 +16,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemPotion;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@@ -38,7 +40,7 @@ public class Util {
}
public static ItemStack consumeItem(ItemStack stack) {
if (stack.getItem() instanceof ItemPotion) {
if(stack.getItem() instanceof ItemPotion) {
if(stack.stackSize == 1) {
return new ItemStack(Items.glass_bottle);
} else {
@@ -76,11 +78,11 @@ public class Util {
// derived from ItemBlock.onItemUse
public static BlockCoord canPlaceItem(ItemStack itemUsed, Block blockIdToBePlaced, EntityPlayer player, World world, int x, int y, int z, int side) {
if(blockIdToBePlaced == null) {
return null;
}
Block block = world.getBlock(x, y, z);
if(block == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 7) < 1) {
@@ -163,7 +165,7 @@ public class Util {
}
public static void dropItems(World world, ItemStack stack, int x, int y, int z, boolean doRandomSpread) {
if(stack == null || stack.stackSize <= 0) {
if(stack.stackSize <= 0) {
return;
}
@@ -289,19 +291,16 @@ public class Util {
public static boolean isEquipped(EntityPlayer player, Class<? extends Item> class1) {
if(player == null || player.inventory == null || player.inventory.getCurrentItem() == null) {
return false;
return false;
}
//player.inventory.getCurrentItem().getClass().getItem().isAssignableFrom(class1)
return class1.isAssignableFrom(player.inventory.getCurrentItem().getItem().getClass());
}
public static boolean isType(ItemStack stack, Class<? extends Item> class1) {
if(stack == null || class1 == null) {
return false;
}
return class1.isAssignableFrom(stack.getItem().getClass());
}
}