remove science book/technology code, close #2088
This commit is contained in:
parent
95427776d4
commit
6085945d9a
26 changed files with 38 additions and 2421 deletions
|
@ -128,8 +128,6 @@ import buildcraft.core.builders.patterns.PatternHorizon;
|
|||
import buildcraft.core.builders.patterns.PatternPyramid;
|
||||
import buildcraft.core.builders.patterns.PatternStairs;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.core.science.TechnoSimpleItem;
|
||||
import buildcraft.core.science.Tier;
|
||||
|
||||
@Mod(name = "BuildCraft Builders", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Builders", dependencies = DefaultProps.DEPENDENCY_CORE)
|
||||
public class BuildCraftBuilders extends BuildCraftMod {
|
||||
|
@ -152,17 +150,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
|||
public static ItemBlueprintTemplate templateItem;
|
||||
public static ItemBlueprintStandard blueprintItem;
|
||||
|
||||
public static TechnoSimpleItem technoMarkerBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPathMarkerBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoConstructionMarkerBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoFillerBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoBuilderBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoArchitectBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoLibraryBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoUrbanistBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoTemplateItem = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoBlueprintItem = new TechnoSimpleItem();
|
||||
|
||||
public static ActionFiller[] fillerActions;
|
||||
|
||||
public static BlueprintDatabase serverDB;
|
||||
|
@ -501,63 +488,6 @@ public class BuildCraftBuilders extends BuildCraftMod {
|
|||
StatementManager.registerActionProvider(new BuildersActionProvider());
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void loadTechnology(FMLPostInitializationEvent evt) {
|
||||
// technoBuildToolBlock
|
||||
|
||||
technoFillerBlock.initialize(
|
||||
Tier.GoldenGear,
|
||||
fillerBlock,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 10)
|
||||
/* Machines Technology */
|
||||
/* Building Technology */);
|
||||
|
||||
technoMarkerBlock.initialize(
|
||||
Tier.GoldenGear,
|
||||
markerBlock,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5)
|
||||
/* Localisation Technology */);
|
||||
|
||||
technoPathMarkerBlock.initialize(
|
||||
Tier.DiamondGear,
|
||||
pathMarkerBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem, 2),
|
||||
technoMarkerBlock
|
||||
/* Localisation Technology */);
|
||||
|
||||
// technoConstructionMarkerBlock;
|
||||
|
||||
technoBuilderBlock.initialize(
|
||||
Tier.DiamondGear,
|
||||
builderBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem, 5),
|
||||
technoFillerBlock);
|
||||
|
||||
technoTemplateItem.initialize(
|
||||
Tier.DiamondGear,
|
||||
templateItem,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem, 2),
|
||||
technoBuilderBlock);
|
||||
|
||||
technoBlueprintItem.initialize(
|
||||
Tier.DiamondGear,
|
||||
blueprintItem,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem, 5),
|
||||
technoTemplateItem);
|
||||
|
||||
technoArchitectBlock.initialize(
|
||||
Tier.EmeraldGear,
|
||||
architectBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* emerald gear */, 8),
|
||||
technoBuilderBlock);
|
||||
|
||||
technoLibraryBlock.initialize(
|
||||
Tier.RedstoneCrystalGear,
|
||||
libraryBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* redstone gear */, 2),
|
||||
technoArchitectBlock);
|
||||
}
|
||||
|
||||
public static void loadRecipes() {
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(templateItem, 1), "ppp", "pip", "ppp", 'i',
|
||||
new ItemStack(Items.dye, 1, 0), 'p', Items.paper);
|
||||
|
|
|
@ -78,7 +78,6 @@ import buildcraft.core.InterModComms;
|
|||
import buildcraft.core.ItemGear;
|
||||
import buildcraft.core.ItemList;
|
||||
import buildcraft.core.ItemMapLocation;
|
||||
import buildcraft.core.ItemScienceBook;
|
||||
import buildcraft.core.ItemSpring;
|
||||
import buildcraft.core.ItemWrench;
|
||||
import buildcraft.core.SpringPopulate;
|
||||
|
@ -95,14 +94,9 @@ import buildcraft.core.recipes.IntegrationRecipeManager;
|
|||
import buildcraft.core.recipes.RefineryRecipeManager;
|
||||
import buildcraft.core.render.BlockHighlightHandler;
|
||||
import buildcraft.core.robots.EntityRobot;
|
||||
import buildcraft.core.science.TechnoField;
|
||||
import buildcraft.core.science.TechnoSimpleItem;
|
||||
import buildcraft.core.science.TechnoStatement;
|
||||
import buildcraft.core.science.Technology;
|
||||
import buildcraft.core.science.Tier;
|
||||
import buildcraft.core.triggers.ActionMachineControl;
|
||||
import buildcraft.core.triggers.ActionMachineControl.Mode;
|
||||
import buildcraft.core.triggers.ActionParameterDirection;
|
||||
import buildcraft.core.triggers.StatementParameterDirection;
|
||||
import buildcraft.core.triggers.ActionRedstoneOutput;
|
||||
import buildcraft.core.triggers.DefaultActionProvider;
|
||||
import buildcraft.core.triggers.DefaultTriggerProvider;
|
||||
|
@ -235,29 +229,6 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
|
||||
public static GameProfile gameProfile = new GameProfile(UUID.nameUUIDFromBytes("buildcraft.core".getBytes()), "[BuildCraft]");
|
||||
|
||||
public static TechnoField technoTransport = new TechnoField();
|
||||
public static TechnoField technoEnergy = new TechnoField();
|
||||
public static TechnoField technoLiquid = new TechnoField();
|
||||
public static TechnoField technoCrafting = new TechnoField();
|
||||
public static TechnoField technoMining = new TechnoField();
|
||||
public static TechnoField technoBuilding = new TechnoField();
|
||||
public static TechnoField technoSilicon = new TechnoField();
|
||||
public static TechnoField technoRobotics = new TechnoField();
|
||||
public static TechnoField technoCommander = new TechnoField();
|
||||
|
||||
public static TechnoSimpleItem technoWrenchItem = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoMapLocation = new TechnoSimpleItem();
|
||||
|
||||
public static TechnoStatement technoTriggerMachineActive = new TechnoStatement();
|
||||
public static TechnoStatement technoTriggerEnergyHigh = new TechnoStatement();
|
||||
public static TechnoStatement technoTriggerContainsInventory = new TechnoStatement();
|
||||
public static TechnoStatement technoTriggerContainsFluid = new TechnoStatement();
|
||||
public static TechnoStatement technoTriggerRedstoneActive = new TechnoStatement();
|
||||
public static TechnoStatement technoTriggerInventoryBelow25 = new TechnoStatement();
|
||||
public static TechnoStatement technoTriggerFluidContainerBelow25 = new TechnoStatement();
|
||||
public static TechnoStatement technoActionRedstone = new TechnoStatement();
|
||||
public static TechnoStatement technoActionOn = new TechnoStatement();
|
||||
|
||||
private static FloatBuffer modelviewF;
|
||||
private static FloatBuffer projectionF;
|
||||
private static IntBuffer viewport;
|
||||
|
@ -331,28 +302,23 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
consumeWaterSources = consumeWater.getBoolean(consumeWaterSources);
|
||||
consumeWater.comment = "set to true if the Pump should consume water";
|
||||
|
||||
if (!NONRELEASED_BLOCKS) {
|
||||
scienceBookItem = (new ItemScienceBook()).setUnlocalizedName("scienceBook");
|
||||
CoreProxy.proxy.registerItem(scienceBookItem);
|
||||
}
|
||||
|
||||
woodenGearItem = (new ItemGear(10 * 20)).setUnlocalizedName("woodenGearItem");
|
||||
woodenGearItem = (new ItemGear()).setUnlocalizedName("woodenGearItem");
|
||||
CoreProxy.proxy.registerItem(woodenGearItem);
|
||||
OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
|
||||
|
||||
stoneGearItem = (new ItemGear(20 * 20)).setUnlocalizedName("stoneGearItem");
|
||||
stoneGearItem = (new ItemGear()).setUnlocalizedName("stoneGearItem");
|
||||
CoreProxy.proxy.registerItem(stoneGearItem);
|
||||
OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
|
||||
|
||||
ironGearItem = (new ItemGear(40 * 20)).setUnlocalizedName("ironGearItem");
|
||||
ironGearItem = (new ItemGear()).setUnlocalizedName("ironGearItem");
|
||||
CoreProxy.proxy.registerItem(ironGearItem);
|
||||
OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
|
||||
|
||||
goldGearItem = (new ItemGear(80 * 20)).setUnlocalizedName("goldGearItem");
|
||||
goldGearItem = (new ItemGear()).setUnlocalizedName("goldGearItem");
|
||||
CoreProxy.proxy.registerItem(goldGearItem);
|
||||
OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
|
||||
|
||||
diamondGearItem = (new ItemGear(160 * 20)).setUnlocalizedName("diamondGearItem");
|
||||
diamondGearItem = (new ItemGear()).setUnlocalizedName("diamondGearItem");
|
||||
CoreProxy.proxy.registerItem(diamondGearItem);
|
||||
OreDictionary.registerOre("gearDiamond", new ItemStack(diamondGearItem));
|
||||
|
||||
|
@ -377,7 +343,7 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
|
||||
StatementManager.registerParameterClass("buildcraft:stackTrigger", TriggerParameterItemStack.class);
|
||||
StatementManager.registerParameterClass("buildcraft:stackAction", ActionParameterItemStack.class);
|
||||
StatementManager.registerParameterClass("buildcraft:pipeActionDirection", ActionParameterDirection.class);
|
||||
StatementManager.registerParameterClass("buildcraft:pipeActionDirection", StatementParameterDirection.class);
|
||||
StatementManager.registerTriggerProvider(new DefaultTriggerProvider());
|
||||
StatementManager.registerActionProvider(new DefaultActionProvider());
|
||||
|
||||
|
@ -452,10 +418,6 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
iconProvider.registerIcons(event.map);
|
||||
StatementIconProvider.INSTANCE.registerIcons(event.map);
|
||||
EnumColor.registerIcons(event.map);
|
||||
|
||||
for (Technology t : Technology.technologies.values()) {
|
||||
t.registerIcons(event.map);
|
||||
}
|
||||
} else if (event.map.getTextureType() == 0) {
|
||||
BuildCraftCore.redLaserTexture = event.map.registerIcon("buildcraft:blockRedLaser");
|
||||
BuildCraftCore.blueLaserTexture = event.map.registerIcon("buildcraft:blockBlueLaser");
|
||||
|
@ -465,145 +427,6 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void loadTechnology(FMLPostInitializationEvent evt) {
|
||||
Tier.initializeTechnologies();
|
||||
|
||||
// Technology Clusters
|
||||
|
||||
technoTransport.initialize(
|
||||
Tier.WoodenGear,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Transport",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoEnergy.initialize(
|
||||
Tier.WoodenGear,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Energy",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoLiquid.initialize(
|
||||
Tier.WoodenGear,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Liquid",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoCrafting.initialize(
|
||||
Tier.WoodenGear,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Crafting",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoMining.initialize(
|
||||
Tier.IronGear,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Mining",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoBuilding.initialize(
|
||||
Tier.GoldenGear,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Building",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoSilicon.initialize(
|
||||
Tier.RedstoneCrystalGear,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Silicon",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoRobotics.initialize(
|
||||
Tier.DiamondChipset,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Robotics",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
technoCommander.initialize(
|
||||
Tier.RedstoneCrystalChipset,
|
||||
"buildcraft:unknown",
|
||||
"technology.field.Commander",
|
||||
new ItemStack(woodenGearItem, 15));
|
||||
|
||||
// Items
|
||||
|
||||
technoWrenchItem.initialize(
|
||||
Tier.StoneGear,
|
||||
wrenchItem,
|
||||
new ItemStack(stoneGearItem, 10));
|
||||
|
||||
technoMapLocation.initialize(
|
||||
Tier.DiamondChipset,
|
||||
mapLocationItem,
|
||||
new ItemStack(stoneGearItem, 10),
|
||||
technoRobotics);
|
||||
|
||||
// Statements
|
||||
|
||||
technoTriggerMachineActive.initialize(
|
||||
Tier.Chipset,
|
||||
triggerMachineActive,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoTriggerEnergyHigh.initialize(
|
||||
Tier.Chipset,
|
||||
triggerEnergyHigh,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoTriggerContainsInventory.initialize(
|
||||
Tier.Chipset,
|
||||
triggerContainsInventory,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoTriggerContainsFluid.initialize(
|
||||
Tier.Chipset,
|
||||
triggerContainsFluid,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoTriggerRedstoneActive.initialize(
|
||||
Tier.Chipset,
|
||||
triggerRedstoneActive,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoTriggerInventoryBelow25.initialize(
|
||||
Tier.Chipset,
|
||||
triggerInventoryBelow25,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoTriggerFluidContainerBelow25.initialize(
|
||||
Tier.Chipset,
|
||||
triggerFluidContainerBelow25,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoActionRedstone.initialize(
|
||||
Tier.Chipset,
|
||||
actionRedstone,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
|
||||
technoActionOn.initialize(
|
||||
Tier.Chipset,
|
||||
actionOn,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
technoSilicon);
|
||||
}
|
||||
|
||||
public void loadRecipes() {
|
||||
if (!NONRELEASED_BLOCKS) {
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(scienceBookItem), "R ", "B ", 'R', Blocks.redstone_torch, 'B',
|
||||
|
@ -611,20 +434,20 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
}
|
||||
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", 'I', Items.iron_ingot, 'G', stoneGearItem);
|
||||
CoreProxy.proxy.addCraftingRecipe(Tier.WoodenGear.getTechnology(), new ItemStack(woodenGearItem), " S ", "S S",
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(woodenGearItem), " S ", "S S",
|
||||
" S ", 'S',
|
||||
"stickWood");
|
||||
CoreProxy.proxy.addCraftingRecipe(Tier.StoneGear.getTechnology(), new ItemStack(stoneGearItem), " I ", "IGI",
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(stoneGearItem), " I ", "IGI",
|
||||
" I ", 'I',
|
||||
"cobblestone", 'G',
|
||||
woodenGearItem);
|
||||
CoreProxy.proxy.addCraftingRecipe(Tier.IronGear.getTechnology(), new ItemStack(ironGearItem), " I ", "IGI",
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(ironGearItem), " I ", "IGI",
|
||||
" I ", 'I',
|
||||
Items.iron_ingot, 'G', stoneGearItem);
|
||||
CoreProxy.proxy.addCraftingRecipe(Tier.GoldenGear.getTechnology(), new ItemStack(goldGearItem), " I ", "IGI",
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(goldGearItem), " I ", "IGI",
|
||||
" I ", 'I',
|
||||
Items.gold_ingot, 'G', ironGearItem);
|
||||
CoreProxy.proxy.addCraftingRecipe(Tier.DiamondGear.getTechnology(),
|
||||
CoreProxy.proxy.addCraftingRecipe(
|
||||
new ItemStack(diamondGearItem), " I ", "IGI", " I ", 'I', Items.diamond, 'G', goldGearItem);
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(mapLocationItem), "ppp", "pYp", "ppp", 'p', Items.paper, 'Y', new ItemStack(Items.dye, 1, 11));
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(listItem), "ppp", "pYp", "ppp", 'p', Items.paper, 'Y',
|
||||
|
|
|
@ -57,9 +57,6 @@ import buildcraft.core.InterModComms;
|
|||
import buildcraft.core.Version;
|
||||
import buildcraft.core.network.BuildCraftChannelHandler;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.core.science.TechnoSimpleItem;
|
||||
import buildcraft.core.science.TechnoStatement;
|
||||
import buildcraft.core.science.Tier;
|
||||
import buildcraft.energy.BlockBuildcraftFluid;
|
||||
import buildcraft.energy.BlockEnergyEmitter;
|
||||
import buildcraft.energy.BlockEnergyReceiver;
|
||||
|
@ -119,12 +116,6 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
public static ITrigger triggerYellowEngineHeat = new TriggerEngineHeat(EnergyStage.YELLOW);
|
||||
public static ITrigger triggerRedEngineHeat = new TriggerEngineHeat(EnergyStage.RED);
|
||||
|
||||
public static TechnoSimpleItem technoRedstoneEngine = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoStoneEngine = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoIronEngine = new TechnoSimpleItem();
|
||||
|
||||
public static TechnoStatement technologyTriggerRedEngineHeat = new TechnoStatement();
|
||||
|
||||
private static Fluid buildcraftFluidOil;
|
||||
private static Fluid buildcraftFluidFuel;
|
||||
private static Fluid buildcraftFluidRedPlasma;
|
||||
|
@ -366,35 +357,15 @@ public class BuildCraftEnergy extends BuildCraftMod {
|
|||
}
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void loadTechnology(FMLPostInitializationEvent evt) {
|
||||
technoRedstoneEngine.initialize(Tier.WoodenGear, new ItemStack(engineBlock, 1, 0),
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5));
|
||||
|
||||
technoStoneEngine.initialize(Tier.StoneGear, new ItemStack(engineBlock, 1, 1),
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 10), technoRedstoneEngine);
|
||||
|
||||
technoIronEngine.initialize(Tier.IronGear, new ItemStack(engineBlock, 1, 2),
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 20), technoStoneEngine);
|
||||
|
||||
technologyTriggerRedEngineHeat.initialize(
|
||||
Tier.IronChipset,
|
||||
triggerRedEngineHeat,
|
||||
"",
|
||||
Chipset.IRON.getStack(5),
|
||||
BuildCraftCore.technoSilicon);
|
||||
}
|
||||
|
||||
public static void loadRecipes() {
|
||||
CoreProxy.proxy.addCraftingRecipe(technoRedstoneEngine,
|
||||
new ItemStack(engineBlock, 1, 0),
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 0),
|
||||
"www", " g ", "GpG", 'w', "plankWood", 'g', Blocks.glass, 'G',
|
||||
BuildCraftCore.woodenGearItem, 'p', Blocks.piston);
|
||||
CoreProxy.proxy.addCraftingRecipe(technoStoneEngine,
|
||||
new ItemStack(engineBlock, 1, 1), "www", " g ", "GpG", 'w', "cobblestone",
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 1),
|
||||
"www", " g ", "GpG", 'w', "cobblestone",
|
||||
'g', Blocks.glass, 'G', BuildCraftCore.stoneGearItem, 'p', Blocks.piston);
|
||||
CoreProxy.proxy.addCraftingRecipe(technoIronEngine,
|
||||
new ItemStack(engineBlock, 1, 2), "www", " g ", "GpG", 'w', Items.iron_ingot,
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2),
|
||||
"www", " g ", "GpG", 'w', Items.iron_ingot,
|
||||
'g', Blocks.glass, 'G', BuildCraftCore.ironGearItem, 'p', Blocks.piston);
|
||||
|
||||
if (blockEnergyConverter != null) {
|
||||
|
|
|
@ -43,8 +43,6 @@ import buildcraft.core.InterModComms;
|
|||
import buildcraft.core.Version;
|
||||
import buildcraft.core.network.BuildCraftChannelHandler;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.core.science.TechnoSimpleItem;
|
||||
import buildcraft.core.science.Tier;
|
||||
import buildcraft.core.utils.ConfigUtils;
|
||||
import buildcraft.factory.BlockAutoWorkbench;
|
||||
import buildcraft.factory.BlockFloodGate;
|
||||
|
@ -91,15 +89,6 @@ public class BuildCraftFactory extends BuildCraftMod {
|
|||
public static BlockRefinery refineryBlock;
|
||||
public static BlockHopper hopperBlock;
|
||||
|
||||
public static TechnoSimpleItem technoQuarryBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoMiningWellBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoAutoWorkbench = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPumpBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoFloodGateBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoTankBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem techoRefineryBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoHopperBlock = new TechnoSimpleItem();
|
||||
|
||||
public static boolean allowMining = true;
|
||||
public static boolean quarryOneTimeUse = false;
|
||||
public static float miningMultiplier = 1;
|
||||
|
@ -235,61 +224,6 @@ public class BuildCraftFactory extends BuildCraftMod {
|
|||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void loadTechnology(FMLPostInitializationEvent evt) {
|
||||
technoAutoWorkbench.initialize(
|
||||
Tier.WoodenGear,
|
||||
autoWorkbenchBlock,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 10),
|
||||
BuildCraftEnergy.technoRedstoneEngine,
|
||||
BuildCraftTransport.technoPipeItemsWood);
|
||||
|
||||
technoTankBlock.initialize(
|
||||
Tier.WoodenGear,
|
||||
tankBlock,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 15));
|
||||
|
||||
technoHopperBlock.initialize(
|
||||
Tier.StoneGear,
|
||||
hopperBlock,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 10),
|
||||
BuildCraftTransport.technoPipeItemsStone);
|
||||
|
||||
technoMiningWellBlock.initialize(
|
||||
Tier.IronGear,
|
||||
miningWellBlock,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
BuildCraftTransport.technoPipeItemsIron);
|
||||
|
||||
technoPumpBlock.initialize(
|
||||
Tier.IronGear,
|
||||
pumpBlock,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
BuildCraftTransport.technoPipeFluidsIron,
|
||||
technoMiningWellBlock);
|
||||
|
||||
technoFloodGateBlock.initialize(
|
||||
Tier.IronGear,
|
||||
floodGateBlock,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 10),
|
||||
BuildCraftTransport.technoPipeFluidsStone);
|
||||
|
||||
techoRefineryBlock.initialize(
|
||||
Tier.DiamondGear,
|
||||
refineryBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem, 2),
|
||||
technoPumpBlock,
|
||||
technoTankBlock);
|
||||
|
||||
technoQuarryBlock.initialize(
|
||||
Tier.DiamondGear,
|
||||
quarryBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem, 5),
|
||||
technoMiningWellBlock,
|
||||
BuildCraftTransport.technoPipeStructureCobblestone
|
||||
/* TODO: add generic building here */);
|
||||
}
|
||||
|
||||
public static void loadRecipes() {
|
||||
if (allowMining) {
|
||||
if (miningWellBlock != null) {
|
||||
|
@ -340,7 +274,7 @@ public class BuildCraftFactory extends BuildCraftMod {
|
|||
}
|
||||
|
||||
if (autoWorkbenchBlock != null) {
|
||||
CoreProxy.proxy.addCraftingRecipe(technoAutoWorkbench, new ItemStack(autoWorkbenchBlock),
|
||||
CoreProxy.proxy.addCraftingRecipe(new ItemStack(autoWorkbenchBlock),
|
||||
" g ",
|
||||
"gwg",
|
||||
" g ",
|
||||
|
|
|
@ -57,10 +57,6 @@ import buildcraft.core.robots.boards.BoardRobotPickerNBT;
|
|||
import buildcraft.core.robots.boards.BoardRobotPlanterNBT;
|
||||
import buildcraft.core.robots.boards.BoardRobotPumpNBT;
|
||||
import buildcraft.core.robots.boards.BoardRobotShovelmanNBT;
|
||||
import buildcraft.core.science.TechnoRobot;
|
||||
import buildcraft.core.science.TechnoSimpleItem;
|
||||
import buildcraft.core.science.TechnoStatement;
|
||||
import buildcraft.core.science.Tier;
|
||||
import buildcraft.silicon.BlockLaser;
|
||||
import buildcraft.silicon.BlockLaserTable;
|
||||
import buildcraft.silicon.GuiHandler;
|
||||
|
@ -124,38 +120,6 @@ public class BuildCraftSilicon extends BuildCraftMod {
|
|||
public static IAction actionStationDropInPipe = new ActionStationAcceptItemsPipe();
|
||||
public static IAction actionStationMachineRequestItems = new ActionStationRequestItemsMachine();
|
||||
|
||||
public static TechnoSimpleItem technoRedstoneBoard = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoLaserBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoAssemblyTableBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoAdvancedCraftingTableBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoIntegrationTableBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoZonePlanBlock = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoRedstoneCrystal = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoRobotItem = new TechnoSimpleItem();
|
||||
|
||||
public static TechnoStatement technoTriggerRobotSleep = new TechnoStatement();
|
||||
public static TechnoStatement technoActionRobotGotoStation = new TechnoStatement();
|
||||
public static TechnoStatement technoActionRobotWakeUp = new TechnoStatement();
|
||||
public static TechnoStatement technoActionRobotWorkInArea = new TechnoStatement();
|
||||
public static TechnoStatement technoActionRobotFilter = new TechnoStatement();
|
||||
public static TechnoStatement technoActionStationRequestItems = new TechnoStatement();
|
||||
public static TechnoStatement technoActionStationForbidRobot = new TechnoStatement();
|
||||
public static TechnoStatement technoActionStationDropInPipe = new TechnoStatement();
|
||||
|
||||
public static TechnoRobot technoRobotPicker = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotCarrier = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotLumberjack = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotHarvester = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotMiner = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotPlanter = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotFarmer = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotLeaveCutter = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotButcher = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotShovelman = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotKnight = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotBomber = new TechnoRobot();
|
||||
public static TechnoRobot technoRobotBuilder = new TechnoRobot();
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent evt) {
|
||||
SchematicRegistry.declareBlueprintSupport("BuildCraft|Silicon");
|
||||
|
@ -247,190 +211,6 @@ public class BuildCraftSilicon extends BuildCraftMod {
|
|||
SiliconProxy.proxy.registerRenderers();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void loadTechnology(FMLPostInitializationEvent evt) {
|
||||
// Items and blocks
|
||||
|
||||
technoLaserBlock.initialize(
|
||||
Tier.EmeraldGear,
|
||||
laserBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* emerald */, 5));
|
||||
|
||||
technoAssemblyTableBlock.initialize(
|
||||
Tier.EmeraldGear,
|
||||
new ItemStack(assemblyTableBlock, 1, 0),
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* emerald */, 5));
|
||||
|
||||
technoRedstoneCrystal.initialize(
|
||||
Tier.EmeraldGear,
|
||||
redstoneCrystal,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* emerald */, 10));
|
||||
|
||||
technoAdvancedCraftingTableBlock.initialize(
|
||||
Tier.RedstoneCrystalGear,
|
||||
new ItemStack(assemblyTableBlock, 1, 1),
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* emerald */, 5));
|
||||
|
||||
technoIntegrationTableBlock.initialize(
|
||||
Tier.RedstoneCrystalGear,
|
||||
new ItemStack(assemblyTableBlock, 1, 2),
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* emerald */, 5));
|
||||
|
||||
technoRedstoneBoard.initialize(
|
||||
Tier.DiamondChipset,
|
||||
redstoneBoard,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* */, 5));
|
||||
|
||||
technoRobotItem.initialize(
|
||||
Tier.DiamondChipset,
|
||||
robotItem,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* */, 5));
|
||||
|
||||
technoZonePlanBlock.initialize(
|
||||
Tier.RedstoneCrystalChipset,
|
||||
zonePlanBlock,
|
||||
new ItemStack(BuildCraftCore.diamondGearItem /* */, 5));
|
||||
|
||||
// Statements
|
||||
|
||||
technoTriggerRobotSleep.initialize(
|
||||
Tier.DiamondChipset,
|
||||
triggerRobotSleep,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoActionRobotGotoStation.initialize(
|
||||
Tier.DiamondChipset,
|
||||
actionRobotGotoStation,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoActionRobotWakeUp.initialize(
|
||||
Tier.DiamondChipset,
|
||||
actionRobotWakeUp,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoActionRobotWorkInArea.initialize(
|
||||
Tier.EmeraldChipset,
|
||||
actionRobotWorkInArea,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoActionRobotFilter.initialize(
|
||||
Tier.EmeraldChipset,
|
||||
actionRobotFilter,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoActionStationRequestItems.initialize(
|
||||
Tier.DiamondChipset,
|
||||
actionStationRequestItems,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoActionStationForbidRobot.initialize(
|
||||
Tier.EmeraldChipset,
|
||||
actionStationForbidRobot,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoActionStationDropInPipe.initialize(
|
||||
Tier.DiamondChipset,
|
||||
actionStationDropInPipe,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
// Robots
|
||||
|
||||
technoRobotPicker.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotPickerNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotCarrier.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotCarrierNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotLumberjack.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotLumberjackNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotHarvester.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotHarvesterNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotMiner.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotMinerNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotPlanter.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotPlanterNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotFarmer.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotFarmerNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotLeaveCutter.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotLeaveCutterNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotButcher.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotButcherNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotShovelman.initialize(
|
||||
Tier.DiamondChipset,
|
||||
BoardRobotShovelmanNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotBuilder.initialize(
|
||||
Tier.EmeraldChipset,
|
||||
BoardRobotBuilderNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotKnight.initialize(
|
||||
Tier.EmeraldChipset,
|
||||
BoardRobotKnightNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
technoRobotBomber.initialize(
|
||||
Tier.EmeraldChipset,
|
||||
BoardRobotBomberNBT.instance,
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoRobotics);
|
||||
|
||||
}
|
||||
|
||||
public static void loadRecipes() {
|
||||
|
||||
// TABLES
|
||||
|
@ -512,7 +292,7 @@ public class BuildCraftSilicon extends BuildCraftMod {
|
|||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
|
||||
public void processRequests(FMLInterModComms.IMCEvent event) {
|
||||
InterModComms.processIMC(event);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,9 +53,6 @@ import buildcraft.core.PowerMode;
|
|||
import buildcraft.core.Version;
|
||||
import buildcraft.core.network.BuildCraftChannelHandler;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.core.science.TechnoSimpleItem;
|
||||
import buildcraft.core.science.TechnoStatement;
|
||||
import buildcraft.core.science.Tier;
|
||||
import buildcraft.silicon.ItemRedstoneChipset.Chipset;
|
||||
import buildcraft.transport.BlockFilteredBuffer;
|
||||
import buildcraft.transport.BlockGenericPipe;
|
||||
|
@ -215,51 +212,7 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
public static IAction actionExtractionPresetBlue = new ActionExtractionPreset(EnumColor.BLUE);
|
||||
public static IAction actionExtractionPresetGreen = new ActionExtractionPreset(EnumColor.GREEN);
|
||||
public static IAction actionExtractionPresetYellow = new ActionExtractionPreset(EnumColor.YELLOW);
|
||||
public static IAction[] actionValve = new IAction[4];
|
||||
|
||||
public static TechnoSimpleItem technoPipeItemsWood = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsEmerald = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsStone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsCobblestone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsIron = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsQuartz = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsGold = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsDiamond = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsObsidian = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsLapis = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsDaizuli = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsVoid = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsSandstone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsEmzuli = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeItemsStripes = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeStructureCobblestone = new TechnoSimpleItem();
|
||||
|
||||
public static TechnoSimpleItem technoPipeFluidsWood = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsCobblestone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsStone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsQuartz = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsIron = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsGold = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsVoid = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsSandstone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipeFluidsEmerald = new TechnoSimpleItem();
|
||||
|
||||
public static TechnoSimpleItem technoPipePowerWood = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipePowerCobblestone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipePowerStone = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipePowerQuartz = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipePowerIron = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipePowerGold = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipePowerDiamond = new TechnoSimpleItem();
|
||||
public static TechnoSimpleItem technoPipePowerEmerald = new TechnoSimpleItem();
|
||||
|
||||
public static TechnoStatement technoTriggerPipe = new TechnoStatement();
|
||||
public static TechnoStatement technoTriggerPipeWireActive = new TechnoStatement();
|
||||
public static TechnoStatement technoActionPipeWire = new TechnoStatement();
|
||||
public static TechnoStatement technoActionPipeColor = new TechnoStatement();
|
||||
public static TechnoStatement technoActionPipeDirection = new TechnoStatement();
|
||||
public static TechnoStatement technoActionPowerLimiter = new TechnoStatement();
|
||||
public static TechnoStatement technoActionExtractionPresetRed = new TechnoStatement();
|
||||
public static IAction[] actionValve = new IAction[4];
|
||||
|
||||
private static LinkedList<PipeRecipe> pipeRecipes = new LinkedList<PipeRecipe>();
|
||||
|
||||
|
@ -558,281 +511,6 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
facadeItem.initialize();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void loadTechnology(FMLPostInitializationEvent evt) {
|
||||
// Item pipes
|
||||
|
||||
technoPipeItemsWood.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeItemsWood,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5));
|
||||
|
||||
technoPipeItemsCobblestone.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeItemsCobblestone,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsWood);
|
||||
|
||||
technoPipeItemsStone.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeItemsStone,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsWood);
|
||||
|
||||
technoPipeItemsSandstone.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeItemsSandstone,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsWood);
|
||||
|
||||
technoPipeItemsQuartz.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeItemsQuartz,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsWood);
|
||||
|
||||
technoPipeStructureCobblestone.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeStructureCobblestone,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsCobblestone);
|
||||
|
||||
technoPipeItemsIron.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeItemsIron,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsStone);
|
||||
|
||||
technoPipeItemsGold.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeItemsGold,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsStone);
|
||||
|
||||
technoPipeItemsObsidian.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeItemsObsidian,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsStone);
|
||||
|
||||
technoPipeItemsVoid.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeItemsVoid,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsObsidian);
|
||||
|
||||
technoPipeItemsDiamond.initialize(
|
||||
Tier.IronGear,
|
||||
pipeItemsDiamond,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
technoPipeItemsIron);
|
||||
|
||||
technoPipeItemsDaizuli.initialize(
|
||||
Tier.IronGear,
|
||||
pipeItemsDaizuli,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
technoPipeItemsDiamond);
|
||||
|
||||
technoPipeItemsLapis.initialize(
|
||||
Tier.IronGear,
|
||||
pipeItemsLapis,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
technoPipeItemsDiamond);
|
||||
|
||||
technoPipeItemsEmerald.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipeItemsEmerald,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5),
|
||||
technoPipeItemsDiamond);
|
||||
|
||||
technoPipeItemsStripes.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipeItemsStripes,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5),
|
||||
technoPipeItemsObsidian);
|
||||
|
||||
technoPipeItemsEmzuli.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipeItemsEmzuli,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5),
|
||||
technoPipeItemsDiamond);
|
||||
|
||||
// Fluid pipes
|
||||
|
||||
technoPipeFluidsWood.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeFluidsWood,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsWood,
|
||||
BuildCraftFactory.technoTankBlock);
|
||||
|
||||
technoPipeFluidsCobblestone.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeFluidsCobblestone,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsCobblestone,
|
||||
technoPipeFluidsWood);
|
||||
|
||||
technoPipeFluidsStone.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeFluidsStone,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsStone,
|
||||
technoPipeFluidsWood);
|
||||
|
||||
technoPipeFluidsSandstone.initialize(
|
||||
Tier.WoodenGear,
|
||||
pipeFluidsSandstone,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 5),
|
||||
technoPipeItemsSandstone,
|
||||
technoPipeFluidsWood);
|
||||
|
||||
technoPipeFluidsQuartz.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeFluidsQuartz,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsQuartz,
|
||||
technoPipeFluidsStone);
|
||||
|
||||
technoPipeFluidsIron.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeFluidsIron,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsIron,
|
||||
technoPipeFluidsStone);
|
||||
|
||||
technoPipeFluidsGold.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeFluidsGold,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsGold,
|
||||
technoPipeFluidsStone);
|
||||
|
||||
technoPipeFluidsVoid.initialize(
|
||||
Tier.StoneGear,
|
||||
pipeFluidsVoid,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 5),
|
||||
technoPipeItemsVoid,
|
||||
technoPipeFluidsStone);
|
||||
|
||||
technoPipeFluidsEmerald.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipeFluidsEmerald,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 2),
|
||||
technoPipeItemsDiamond,
|
||||
technoPipeFluidsStone);
|
||||
|
||||
// Power pipes
|
||||
|
||||
technoPipePowerWood.initialize(
|
||||
Tier.IronGear,
|
||||
pipePowerWood,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
technoPipeItemsWood);
|
||||
|
||||
technoPipePowerCobblestone.initialize(
|
||||
Tier.IronGear,
|
||||
pipePowerCobblestone,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
technoPipeItemsWood,
|
||||
technoPipePowerWood);
|
||||
|
||||
technoPipePowerStone.initialize(
|
||||
Tier.IronGear,
|
||||
pipePowerStone,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
technoPipeItemsStone,
|
||||
technoPipePowerWood);
|
||||
|
||||
technoPipePowerQuartz.initialize(
|
||||
Tier.IronGear,
|
||||
pipePowerQuartz,
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 5),
|
||||
technoPipeItemsQuartz,
|
||||
technoPipePowerWood);
|
||||
|
||||
technoPipePowerIron.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipePowerIron,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5),
|
||||
technoPipeItemsIron,
|
||||
technoPipePowerWood);
|
||||
|
||||
technoPipePowerGold.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipePowerGold,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5),
|
||||
technoPipeItemsGold,
|
||||
technoPipePowerWood);
|
||||
|
||||
technoPipePowerDiamond.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipePowerDiamond,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5),
|
||||
technoPipeItemsDiamond,
|
||||
technoPipePowerWood);
|
||||
|
||||
technoPipePowerEmerald.initialize(
|
||||
Tier.GoldenGear,
|
||||
pipePowerEmerald,
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5),
|
||||
technoPipeItemsEmerald,
|
||||
technoPipePowerWood);
|
||||
|
||||
// Statements
|
||||
|
||||
technoTriggerPipe.initialize(
|
||||
Tier.Chipset,
|
||||
triggerPipe [0],
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoSilicon);
|
||||
|
||||
technoTriggerPipeWireActive.initialize(
|
||||
Tier.Chipset,
|
||||
triggerPipeWireActive[0],
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoSilicon);
|
||||
|
||||
technoActionPipeWire.initialize(
|
||||
Tier.Chipset,
|
||||
actionPipeWire[0],
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoSilicon);
|
||||
|
||||
technoActionPipeColor.initialize(
|
||||
Tier.Chipset,
|
||||
actionPipeColor[0],
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoSilicon);
|
||||
|
||||
technoActionPipeDirection.initialize(
|
||||
Tier.Chipset,
|
||||
actionPipeDirection[0],
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoSilicon,
|
||||
BuildCraftTransport.technoPipeItemsIron);
|
||||
|
||||
technoActionPowerLimiter.initialize(
|
||||
Tier.Chipset,
|
||||
actionPowerLimiter[1],
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoSilicon,
|
||||
BuildCraftTransport.technoPipePowerIron);
|
||||
|
||||
technoActionExtractionPresetRed.initialize(
|
||||
Tier.Chipset,
|
||||
actionExtractionPresetRed,
|
||||
"",
|
||||
Chipset.RED.getStack(5),
|
||||
BuildCraftCore.technoSilicon);
|
||||
}
|
||||
|
||||
public void loadRecipes() {
|
||||
// Add base recipe for pipe waterproof.
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(pipeWaterproof, 1), new ItemStack(Items.dye, 1, 2));
|
||||
|
|
|
@ -14,17 +14,13 @@ import net.minecraft.world.World;
|
|||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
import buildcraft.core.gui.ContainerList;
|
||||
import buildcraft.core.gui.ContainerScienceBook;
|
||||
import buildcraft.core.gui.GuiList;
|
||||
import buildcraft.core.science.GuiScienceBook;
|
||||
|
||||
public class GuiHandler implements IGuiHandler {
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if (id == GuiIds.SCIENCE_BOOK) {
|
||||
return new GuiScienceBook(player);
|
||||
} else if (id == GuiIds.LIST) {
|
||||
if (id == GuiIds.LIST) {
|
||||
return new GuiList(player);
|
||||
}
|
||||
|
||||
|
@ -33,9 +29,7 @@ public class GuiHandler implements IGuiHandler {
|
|||
|
||||
@Override
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if (id == GuiIds.SCIENCE_BOOK) {
|
||||
return new ContainerScienceBook(player);
|
||||
} else if (id == GuiIds.LIST) {
|
||||
if (id == GuiIds.LIST) {
|
||||
return new ContainerList(player);
|
||||
}
|
||||
|
||||
|
|
|
@ -8,19 +8,10 @@
|
|||
*/
|
||||
package buildcraft.core;
|
||||
|
||||
import buildcraft.core.science.IItemTechnologyProvider;
|
||||
public class ItemGear extends ItemBuildCraft {
|
||||
|
||||
public class ItemGear extends ItemBuildCraft implements IItemTechnologyProvider {
|
||||
public ItemGear() {
|
||||
|
||||
private int processTime;
|
||||
|
||||
public ItemGear(int iProcessTime) {
|
||||
processTime = iProcessTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int timeToProcess() {
|
||||
return processTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,43 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
|
||||
public class ItemScienceBook extends ItemBuildCraft {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = par1IconRegister.registerIcon("buildcraft:science_book");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemStackLimit(ItemStack stack) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World world, EntityPlayer entityPlayer) {
|
||||
if (!world.isRemote) {
|
||||
entityPlayer.openGui(BuildCraftCore.instance, GuiIds.SCIENCE_BOOK, world, 0, 0, 0);
|
||||
}
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
}
|
|
@ -20,7 +20,6 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.core.science.TechnologyNBT;
|
||||
import buildcraft.core.utils.NBTUtils;
|
||||
|
||||
public class TickHandlerCore {
|
||||
|
@ -53,7 +52,7 @@ public class TickHandlerCore {
|
|||
CoreProxy.proxy.getMinecraftVersion()));
|
||||
player.addChatMessage(new ChatComponentTranslation("bc_update.download"));
|
||||
|
||||
// TODD This takes too much realstate. See how to improve
|
||||
// TODO: This takes too much realstate. See how to improve
|
||||
// Version.displayChangelog(player);
|
||||
|
||||
player.addChatMessage(new ChatComponentTranslation("bc_update.once"));
|
||||
|
@ -64,23 +63,4 @@ public class TickHandlerCore {
|
|||
|
||||
nagged = true;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void updateScienceBooks(PlayerTickEvent evt) {
|
||||
if (evt.player.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (IInvSlot slot : InventoryIterator.getIterable(evt.player.inventory)) {
|
||||
if (slot.getStackInSlot() != null
|
||||
&& slot.getStackInSlot().getItem() instanceof ItemScienceBook) {
|
||||
|
||||
ItemStack stack = slot.getStackInSlot();
|
||||
|
||||
TechnologyNBT techno = TechnologyNBT.getTechnology(evt.player, stack);
|
||||
techno.update();
|
||||
techno.writeToNBT(NBTUtils.getItemData(stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,92 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.gui;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
|
||||
import buildcraft.core.gui.slots.SlotHidden;
|
||||
import buildcraft.core.gui.slots.SlotUntouchable;
|
||||
import buildcraft.core.network.RPC;
|
||||
import buildcraft.core.network.RPCHandler;
|
||||
import buildcraft.core.network.RPCSide;
|
||||
import buildcraft.core.science.Technology;
|
||||
import buildcraft.core.science.TechnologyNBT;
|
||||
import buildcraft.core.utils.NBTUtils;
|
||||
|
||||
public class ContainerScienceBook extends BuildCraftContainer {
|
||||
|
||||
public float progress = 0;
|
||||
|
||||
public TechnologyNBT book;
|
||||
private EntityPlayer player;
|
||||
|
||||
public ContainerScienceBook(EntityPlayer iPlayer) {
|
||||
super(iPlayer.inventory.getSizeInventory());
|
||||
|
||||
player = iPlayer;
|
||||
|
||||
book = TechnologyNBT.getTechnology(player, player.getHeldItem());
|
||||
|
||||
for (int sy = 0; sy < 3; sy++) {
|
||||
for (int sx = 0; sx < 9; sx++) {
|
||||
addSlotToContainer(new SlotHidden(player.inventory, sx + sy * 9 + 9, 19 + sx * 18, 101 + sy * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int sx = 0; sx < 9; sx++) {
|
||||
addSlotToContainer(new SlotHidden(player.inventory, sx, 19 + sx * 18, 159));
|
||||
}
|
||||
|
||||
for (int sx = 0; sx < 3; sx++) {
|
||||
addSlotToContainer(new Slot(book.inventory, sx, 198 + sx * 18, 99));
|
||||
}
|
||||
|
||||
for (int sx = 0; sx < 3; sx++) {
|
||||
addSlotToContainer(new SlotUntouchable(book.leftToCompute, sx, 198 + sx * 18, 54));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
if (player.worldObj.getTotalWorldTime() % 5 == 0) {
|
||||
RPCHandler.rpcPlayer(player, this, "updateProgress", book.getProgress());
|
||||
}
|
||||
}
|
||||
|
||||
@RPC(RPCSide.CLIENT)
|
||||
private void updateProgress(float iProgress) {
|
||||
progress = iProgress;
|
||||
|
||||
book.loadFromNBT(NBTUtils.getItemData(player.getHeldItem()));
|
||||
}
|
||||
|
||||
public void startResearch(Technology t) {
|
||||
RPCHandler.rpcServer(this, "rpcStartResearch", t.getID());
|
||||
}
|
||||
|
||||
@RPC(RPCSide.SERVER)
|
||||
private void rpcStartResearch(String id) {
|
||||
Technology t = Technology.getTechnology(id);
|
||||
book.startResearch(t);
|
||||
book.writeToNBT(NBTUtils.getItemData(player.getHeldItem()));
|
||||
}
|
||||
}
|
|
@ -40,8 +40,6 @@ import buildcraft.api.core.ICoreProxy;
|
|||
import buildcraft.core.EntityBlock;
|
||||
import buildcraft.core.ItemBlockBuildCraft;
|
||||
import buildcraft.core.LaserKind;
|
||||
import buildcraft.core.recipes.BuildCraftRecipe;
|
||||
import buildcraft.core.science.Technology;
|
||||
|
||||
public class CoreProxy implements ICoreProxy {
|
||||
|
||||
|
@ -110,17 +108,6 @@ public class CoreProxy implements ICoreProxy {
|
|||
stack.onCrafting(world, player, stack.stackSize);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addCraftingRecipe(Technology techno, ItemStack result, Object... recipe) {
|
||||
String name = Item.itemRegistry.getNameForObject(result.getItem());
|
||||
|
||||
if (BuildCraftCore.recipesBlacklist.contains(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new BuildCraftRecipe(techno, result, recipe));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void addCraftingRecipe(ItemStack result, Object... recipe) {
|
||||
String name = Item.itemRegistry.getNameForObject(result.getItem());
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.recipes;
|
||||
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
import buildcraft.core.science.Technology;
|
||||
|
||||
public class BuildCraftRecipe extends ShapedOreRecipe {
|
||||
|
||||
Technology techno;
|
||||
|
||||
public BuildCraftRecipe(Technology iTechno, ItemStack result, Object[] recipe) {
|
||||
super(result, recipe);
|
||||
|
||||
techno = iTechno;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
/*
|
||||
* This code is an experiment for forbidding crafting a recipe if the
|
||||
* player doesn't have a given attribute.
|
||||
*
|
||||
* try { Field f =
|
||||
* InventoryCrafting.class.getDeclaredField("eventHandler");
|
||||
*
|
||||
* if (!f.isAccessible()) { f.setAccessible(true); }
|
||||
*
|
||||
* Container container = (Container) f.get(inv);
|
||||
*
|
||||
* f = Container.class.getDeclaredField("crafters");
|
||||
*
|
||||
* if (!f.isAccessible()) { f.setAccessible(true); }
|
||||
*
|
||||
* List crafters = (List) f.get(container);
|
||||
*
|
||||
* for (Object p : crafters) { EntityPlayer player = (EntityPlayer) p; }
|
||||
* } catch (Throwable e) { e.printStackTrace(); }
|
||||
*/
|
||||
|
||||
return super.matches(inv, world);
|
||||
}
|
||||
}
|
|
@ -1,405 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.gui.AdvancedSlot;
|
||||
import buildcraft.core.gui.ContainerScienceBook;
|
||||
import buildcraft.core.gui.GuiAdvancedInterface;
|
||||
import buildcraft.core.gui.ItemSlot;
|
||||
import buildcraft.core.gui.slots.SlotHidden;
|
||||
|
||||
public class GuiScienceBook extends GuiAdvancedInterface {
|
||||
|
||||
private static final ResourceLocation TEXTURE_BASE = new ResourceLocation(
|
||||
"buildcraft", DefaultProps.TEXTURE_PATH_GUI + "/science_gui.png");
|
||||
private static final ResourceLocation TEXTURE_FOCUS = new ResourceLocation(
|
||||
"buildcraft", DefaultProps.TEXTURE_PATH_GUI + "/science_focus_gui.png");
|
||||
private static final ResourceLocation TEXTURE_INFO = new ResourceLocation(
|
||||
"buildcraft", DefaultProps.TEXTURE_PATH_GUI + "/science_blank.png");
|
||||
|
||||
private static final ResourceLocation TEXTURE_ICONS = new ResourceLocation(
|
||||
"buildcraft", DefaultProps.TEXTURE_PATH_GUI + "/science_icons.png");
|
||||
private static final ResourceLocation TEXTURE_TAB = new ResourceLocation(
|
||||
"buildcraft", DefaultProps.TEXTURE_PATH_GUI + "/science_tab.png");
|
||||
|
||||
private static final int EXTRA_ADVANCED_SLOTS = 1;
|
||||
|
||||
private Tier currentTier = null;
|
||||
|
||||
private Technology inFocus = null;
|
||||
|
||||
private GuiButton startResearch;
|
||||
private GuiButton wiki;
|
||||
private ArrayList<String> infoText = new ArrayList<String>();
|
||||
|
||||
static class EmptySlot extends AdvancedSlot {
|
||||
public EmptySlot(GuiAdvancedInterface gui, int x, int y) {
|
||||
super(gui, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
static class TechnologySlot extends AdvancedSlot {
|
||||
private Technology techno;
|
||||
|
||||
public TechnologySlot(GuiAdvancedInterface gui, int x, int y, Technology iTechno) {
|
||||
super(gui, x, y);
|
||||
|
||||
techno = iTechno;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return techno.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
return techno.getStackToDisplay();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return techno.getLocalizedName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawSprite(int cornerX, int cornerY) {
|
||||
super.drawSprite(cornerX, cornerY);
|
||||
|
||||
if (!getBook().isKnown(techno)) {
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
int j1 = cornerX + x;
|
||||
int k1 = cornerY + y;
|
||||
GL11.glColorMask(true, true, true, false);
|
||||
|
||||
int color;
|
||||
|
||||
if (getBook().canBeResearched(techno)) {
|
||||
color = 0x550000FF;
|
||||
} else {
|
||||
color = 0x55FF0000;
|
||||
}
|
||||
|
||||
((GuiScienceBook) gui).drawGradientRect(j1, k1, j1 + 16, k1 + 16, color, color);
|
||||
GL11.glColorMask(true, true, true, true);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
}
|
||||
}
|
||||
|
||||
public TechnologyNBT getBook() {
|
||||
return ((ContainerScienceBook) gui.getContainer()).book;
|
||||
}
|
||||
}
|
||||
|
||||
static class ResearchedSlot extends AdvancedSlot {
|
||||
public ResearchedSlot(GuiAdvancedInterface gui, int x, int y) {
|
||||
super(gui, x, y);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
Technology t = getResearchedTechnology();
|
||||
|
||||
if (t != null) {
|
||||
return t.getIcon();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItemStack() {
|
||||
Technology t = getResearchedTechnology();
|
||||
|
||||
if (t != null) {
|
||||
return t.getStackToDisplay();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
Technology t = getResearchedTechnology();
|
||||
|
||||
if (t != null) {
|
||||
return t.getLocalizedName();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Technology getResearchedTechnology() {
|
||||
return ((ContainerScienceBook) gui.getContainer()).book.getResearchedTechnology();
|
||||
}
|
||||
}
|
||||
|
||||
public GuiScienceBook(EntityPlayer player) {
|
||||
super(new ContainerScienceBook(player), player.inventory, TEXTURE_BASE);
|
||||
|
||||
xSize = 256;
|
||||
ySize = 181;
|
||||
|
||||
resetNullSlots(50);
|
||||
|
||||
setTier(Tier.WoodenGear);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
startResearch = new GuiButton(0, guiLeft + 10, guiTop + 145, 70, 20, "Start");
|
||||
wiki = new GuiButton(0, guiLeft + 115, guiTop + 145, 70, 20, "Wiki");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
|
||||
bindTexture(TEXTURE_ICONS);
|
||||
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
if (inFocus != null || currentTier.ordinal() != i) {
|
||||
drawTexturedModalRect(guiLeft + 28 * i, guiTop - 28, 28 * i, 1, 29, 32);
|
||||
}
|
||||
|
||||
if (inFocus != null || currentTier.ordinal() != i + 7) {
|
||||
drawTexturedModalRect(guiLeft + 28 * i, guiTop + ySize - 4, 28 * i, 62, 29, 32);
|
||||
}
|
||||
}
|
||||
|
||||
bindTexture(TEXTURE_TAB);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
|
||||
|
||||
bindTexture(TEXTURE_ICONS);
|
||||
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
if (inFocus == null && currentTier.ordinal() == i) {
|
||||
drawTexturedModalRect(guiLeft + 28 * i, guiTop - 28, 28 * i, 32, 29, 32);
|
||||
}
|
||||
|
||||
if (inFocus == null && currentTier.ordinal() == i + 7) {
|
||||
drawTexturedModalRect(guiLeft + 28 * i, guiTop + ySize - 4, 28 * i, 96, 29, 32);
|
||||
}
|
||||
}
|
||||
|
||||
int arrowHeight = (int) (22 * getContainer().progress);
|
||||
drawTexturedModalRect(
|
||||
guiLeft + 215,
|
||||
guiTop + 73 + (22 - arrowHeight),
|
||||
0,
|
||||
128 + (22 - arrowHeight),
|
||||
16,
|
||||
arrowHeight);
|
||||
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
drawStack(Tier.values()[i].getStackToDisplay(), guiLeft + 28 * i + 6, guiTop - 28 + 9);
|
||||
|
||||
drawStack(Tier.values()[i + 7].getStackToDisplay(), guiLeft + 28 * i + 6, guiTop + ySize - 4 + 7);
|
||||
}
|
||||
|
||||
drawBackgroundSlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
|
||||
super.drawGuiContainerForegroundLayer(par1, par2);
|
||||
|
||||
if (infoText != null) {
|
||||
for (int i = 0; i < infoText.size(); ++i) {
|
||||
fontRendererObj.drawString(infoText.get(i), 10, 25 + i * 10, 0x404040);
|
||||
}
|
||||
}
|
||||
|
||||
drawTooltipForSlotAt(par1, par2);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton button) {
|
||||
if (button == startResearch) {
|
||||
getContainer().startResearch(inFocus);
|
||||
} else if (button == wiki) {
|
||||
try {
|
||||
java.awt.Desktop.getDesktop().browse(
|
||||
java.net.URI.create(inFocus.getWikiLink()));
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) {
|
||||
super.mouseClicked(mouseX, mouseY, mouseButton);
|
||||
|
||||
for (int i = 0; i < 7; ++i) {
|
||||
int x1 = guiLeft + 28 * i;
|
||||
int x2 = x1 + 29;
|
||||
int y1 = guiTop - 30;
|
||||
int y2 = y1 + 32;
|
||||
|
||||
if (mouseX >= x1 && mouseX <= x2 && mouseY >= y1 && mouseY <= y2) {
|
||||
setTier(Tier.values()[i]);
|
||||
return;
|
||||
}
|
||||
|
||||
y1 = guiTop + ySize - 2;
|
||||
y2 = y1 + 32;
|
||||
|
||||
if (mouseX >= x1 && mouseX <= x2 && mouseY >= y1 && mouseY <= y2) {
|
||||
setTier(Tier.values()[i + 7]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void slotClicked(AdvancedSlot slot, int mouseButton) {
|
||||
super.slotClicked(slot, mouseButton);
|
||||
|
||||
if (slot instanceof TechnologySlot) {
|
||||
setFocus(((TechnologySlot) slot).techno);
|
||||
}
|
||||
}
|
||||
|
||||
private void setTier(Tier newTier) {
|
||||
texture = TEXTURE_BASE;
|
||||
|
||||
if (inFocus != null || newTier != currentTier) {
|
||||
resetNullSlots(50);
|
||||
|
||||
currentTier = newTier;
|
||||
|
||||
int id = 0;
|
||||
|
||||
Collection<Technology> technos = Technology.getTechnologies(currentTier);
|
||||
|
||||
for (Technology t : technos) {
|
||||
int j = id / 10;
|
||||
int i = id - j * 10;
|
||||
|
||||
slots.set(id, new TechnologySlot(this, 9 + i * 18, 7 + j * 18, t));
|
||||
id++;
|
||||
}
|
||||
|
||||
while (id < 50) {
|
||||
int j = id / 10;
|
||||
int i = id - j * 10;
|
||||
|
||||
slots.set(id, new EmptySlot(this, 9 + i * 18, 7 + j * 18));
|
||||
id++;
|
||||
}
|
||||
}
|
||||
|
||||
inFocus = null;
|
||||
|
||||
for (Object s : container.inventorySlots) {
|
||||
if (s instanceof SlotHidden) {
|
||||
SlotHidden h = (SlotHidden) s;
|
||||
|
||||
h.show();
|
||||
}
|
||||
}
|
||||
|
||||
buttonList.clear();
|
||||
|
||||
setExtraAdvancedSlots();
|
||||
}
|
||||
|
||||
private void setFocus(Technology techno) {
|
||||
inFocus = techno;
|
||||
texture = TEXTURE_FOCUS;
|
||||
|
||||
for (Object s : container.inventorySlots) {
|
||||
if (s instanceof SlotHidden) {
|
||||
SlotHidden h = (SlotHidden) s;
|
||||
|
||||
h.hide();
|
||||
}
|
||||
}
|
||||
|
||||
slots.clear();
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
if (techno.getPrerequisites().size() > i
|
||||
&& techno.getPrerequisites().get(i) != null) {
|
||||
slots.add(new TechnologySlot(this, 33, 43 + 18 * i, techno.getPrerequisites().get(i)));
|
||||
} else {
|
||||
slots.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
if (techno.getRequirements() != null) {
|
||||
slots.add(new ItemSlot(this, 71 + 18 * i, 115, techno.getRequirements()[i]));
|
||||
} else {
|
||||
slots.add(null);
|
||||
}
|
||||
}
|
||||
|
||||
slots.add(new TechnologySlot(this, 89, 79, techno));
|
||||
|
||||
for (int i = 0; i < 5; ++i) {
|
||||
for (int j = 0; j < 2; ++j) {
|
||||
int followupId = i * 2 + j;
|
||||
if (techno.getFollowups().size() > followupId
|
||||
&& techno.getFollowups().get(followupId) != null) {
|
||||
slots.add(new TechnologySlot(this, 145 + 18 * j, 43 + 18 * i, techno.getFollowups().get(
|
||||
followupId)));
|
||||
} else {
|
||||
slots.add(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
buttonList.clear();
|
||||
|
||||
if (getContainer().book.canBeResearched(techno)) {
|
||||
buttonList.add(startResearch);
|
||||
}
|
||||
|
||||
if (wiki != null) {
|
||||
buttonList.add(wiki);
|
||||
}
|
||||
|
||||
setExtraAdvancedSlots();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ContainerScienceBook getContainer() {
|
||||
return (ContainerScienceBook) super.getContainer();
|
||||
}
|
||||
|
||||
public void setExtraAdvancedSlots() {
|
||||
slots.add(new ResearchedSlot(this, 216, 28));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGradientRect(int p1, int p2, int p3, int p4, int p5, int p6) {
|
||||
super.drawGradientRect(p1, p2, p3, p4, p5, p6);
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
/**
|
||||
* This interface is implemented by items that provide specific research points.
|
||||
* In particular, it gives how many cycles are required to process the items
|
||||
*/
|
||||
public interface IItemTechnologyProvider {
|
||||
|
||||
int timeToProcess();
|
||||
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class TechnoField extends Technology {
|
||||
|
||||
IIcon icon;
|
||||
String iconResource;
|
||||
String unlocalizedName;
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
String iconResource,
|
||||
String unlocalizedName,
|
||||
ItemStack requirement,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, iconResource, unlocalizedName, requirement, null, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
String iconResource,
|
||||
String unlocalizedName,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, iconResource, unlocalizedName, requirement1, requirement2, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
String iIconResource,
|
||||
String iUnlocalizedName,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
ItemStack requirement3,
|
||||
Technology... iPrerequisites) {
|
||||
|
||||
super.initialize("field:" + iUnlocalizedName,
|
||||
iTier, requirement1, requirement2, requirement3, iPrerequisites);
|
||||
|
||||
unlocalizedName = iUnlocalizedName;
|
||||
iconResource = iIconResource;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
return unlocalizedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public static ItemStack toStack(Object obj) {
|
||||
if (obj instanceof ItemStack) {
|
||||
return (ItemStack) obj;
|
||||
} else if (obj instanceof Item) {
|
||||
return new ItemStack((Item) obj);
|
||||
} else if (obj instanceof Block) {
|
||||
return new ItemStack((Block) obj);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = register.registerIcon(iconResource);
|
||||
}
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import buildcraft.BuildCraftSilicon;
|
||||
import buildcraft.api.boards.RedstoneBoardRobotNBT;
|
||||
import buildcraft.core.ItemRobot;
|
||||
import buildcraft.core.utils.NBTUtils;
|
||||
|
||||
public class TechnoRobot extends Technology {
|
||||
|
||||
ItemStack robotItem;
|
||||
RedstoneBoardRobotNBT robot;
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
RedstoneBoardRobotNBT robot,
|
||||
ItemStack requirement,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, robot, requirement, null, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
RedstoneBoardRobotNBT robot,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, robot, requirement1, requirement2, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
RedstoneBoardRobotNBT iRobot,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
ItemStack requirement3,
|
||||
Technology... iPrerequisites) {
|
||||
|
||||
super.initialize("robot:" + iRobot.getID(),
|
||||
iTier, requirement1, requirement2, requirement3, iPrerequisites);
|
||||
|
||||
robot = iRobot;
|
||||
ItemStack robotStack = new ItemStack(BuildCraftSilicon.robotItem);
|
||||
NBTTagCompound nbt = NBTUtils.getItemData(robotStack);
|
||||
robot.createBoard(nbt);
|
||||
robotItem = ItemRobot.createRobotStack(robotStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackToDisplay() {
|
||||
return robotItem;
|
||||
}
|
||||
}
|
|
@ -1,63 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TechnoSimpleItem extends Technology {
|
||||
|
||||
private ItemStack itemToDisplay;
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
Object iItemToDisplay,
|
||||
ItemStack requirement,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, iItemToDisplay, requirement, null, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
Object iItemToDisplay,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, iItemToDisplay, requirement1, requirement2, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
Object iItemToDisplay,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
ItemStack requirement3,
|
||||
Technology... iPrerequisites) {
|
||||
|
||||
super.initialize("item:" + toStack(iItemToDisplay).getUnlocalizedName(),
|
||||
iTier, requirement1, requirement2, requirement3, iPrerequisites);
|
||||
|
||||
itemToDisplay = toStack(iItemToDisplay);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackToDisplay() {
|
||||
return itemToDisplay;
|
||||
}
|
||||
|
||||
public static ItemStack toStack(Object obj) {
|
||||
if (obj instanceof ItemStack) {
|
||||
return (ItemStack) obj;
|
||||
} else if (obj instanceof Item) {
|
||||
return new ItemStack((Item) obj);
|
||||
} else if (obj instanceof Block) {
|
||||
return new ItemStack((Block) obj);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import buildcraft.api.gates.IStatement;
|
||||
|
||||
public class TechnoStatement extends Technology {
|
||||
|
||||
private IStatement statementToDisplay;
|
||||
private String unlocalizedName;
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
IStatement statementToDisplay,
|
||||
String unlocalizedName,
|
||||
ItemStack requirement,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, statementToDisplay, unlocalizedName, requirement, null, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
IStatement statementToDisplay,
|
||||
String unlocalizedName,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, statementToDisplay, unlocalizedName, requirement1, requirement2, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
IStatement iStatementToDisplay,
|
||||
String unlocalizedName,
|
||||
ItemStack requirement1,
|
||||
ItemStack requirement2,
|
||||
ItemStack requirement3,
|
||||
Technology... iPrerequisites) {
|
||||
|
||||
super.initialize("statement:" + iStatementToDisplay.getUniqueTag(),
|
||||
iTier, requirement1, requirement2, requirement3, iPrerequisites);
|
||||
|
||||
statementToDisplay = iStatementToDisplay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return statementToDisplay.getIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
return unlocalizedName;
|
||||
}
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class TechnoTier extends Technology {
|
||||
|
||||
private Tier technoTier;
|
||||
private ItemStack itemToDisplay;
|
||||
private Technology[] prerequisites;
|
||||
private ItemStack[] requirements;
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, null, null, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
Object requirement,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, requirement, null, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
Object requirement1,
|
||||
Object requirement2,
|
||||
Technology... iPrerequisites) {
|
||||
initialize(iTier, requirement1, requirement2, null, iPrerequisites);
|
||||
}
|
||||
|
||||
public void initialize(Tier iTier,
|
||||
Object requirement1,
|
||||
Object requirement2,
|
||||
Object requirement3,
|
||||
Technology... iPrerequisites) {
|
||||
|
||||
super.initialize(
|
||||
"tier:" + iTier.ordinal(),
|
||||
Tier.values()[iTier.ordinal() > 0 ? iTier.ordinal() - 1 : 0],
|
||||
requirement1,
|
||||
requirement2,
|
||||
requirement3);
|
||||
|
||||
itemToDisplay = toStack(iTier.getStackToDisplay());
|
||||
|
||||
prerequisites = iPrerequisites;
|
||||
|
||||
technoTier = iTier;
|
||||
|
||||
if (iTier.ordinal() > 0) {
|
||||
Tier.values()[iTier.ordinal() - 1].getTechnology().followups.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackToDisplay() {
|
||||
return itemToDisplay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLocalizedName() {
|
||||
return "Tier " + (technoTier.ordinal() + 1) + " (" + itemToDisplay.getDisplayName() + ")";
|
||||
}
|
||||
}
|
|
@ -1,128 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class Technology {
|
||||
|
||||
public static final HashMap<String, Technology> technologies = new HashMap<String, Technology>();
|
||||
private static final LinkedList[] registry = new LinkedList[Tier.values().length];
|
||||
|
||||
protected ArrayList<Technology> followups = new ArrayList<Technology>();
|
||||
|
||||
private Tier tier;
|
||||
private ItemStack[] requirements;
|
||||
private ArrayList<Technology> prerequisites = new ArrayList<Technology>();
|
||||
private String id;
|
||||
|
||||
protected void initialize(String iId,
|
||||
Tier iTier,
|
||||
Object requirement1,
|
||||
Object requirement2,
|
||||
Object requirement3,
|
||||
Technology... iPrerequisites) {
|
||||
getTechnologies(iTier).add(this);
|
||||
technologies.put(iId, this);
|
||||
|
||||
id = iId;
|
||||
|
||||
tier = iTier;
|
||||
|
||||
requirements = new ItemStack[]
|
||||
{toStack(requirement1),
|
||||
toStack(requirement2),
|
||||
toStack(requirement3)};
|
||||
|
||||
prerequisites.add(iTier.getTechnology());
|
||||
|
||||
for (Technology t : iPrerequisites) {
|
||||
prerequisites.add(t);
|
||||
t.followups.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getStackToDisplay() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getLocalizedName() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final ArrayList<Technology> getPrerequisites() {
|
||||
return prerequisites;
|
||||
}
|
||||
|
||||
public final ArrayList<Technology> getFollowups() {
|
||||
return followups;
|
||||
}
|
||||
|
||||
public final ItemStack[] getRequirements() {
|
||||
return requirements;
|
||||
}
|
||||
|
||||
public final Tier getTier() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
public static Collection<Technology> getTechnologies(Tier tier) {
|
||||
if (registry[tier.ordinal()] == null) {
|
||||
registry[tier.ordinal()] = new LinkedList();
|
||||
}
|
||||
|
||||
return registry[tier.ordinal()];
|
||||
}
|
||||
|
||||
public static Technology getTechnology(String id) {
|
||||
return technologies.get(id);
|
||||
}
|
||||
|
||||
public static ItemStack toStack(Object obj) {
|
||||
if (obj instanceof ItemStack) {
|
||||
return (ItemStack) obj;
|
||||
} else if (obj instanceof Item) {
|
||||
return new ItemStack((Item) obj);
|
||||
} else if (obj instanceof Block) {
|
||||
return new ItemStack((Block) obj);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public final String getID() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
|
||||
}
|
||||
|
||||
public String getWikiLink() {
|
||||
return "http://www.mod-buildcraft.com/wiki/doku.php?id=techno:" + getID().replaceAll(":", "_");
|
||||
}
|
||||
}
|
|
@ -1,258 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package buildcraft.core.science;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
|
||||
import net.minecraftforge.common.util.Constants;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
import buildcraft.core.inventory.InventoryIterator;
|
||||
import buildcraft.core.inventory.SimpleInventory;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
import buildcraft.core.utils.NBTUtils;
|
||||
|
||||
public final class TechnologyNBT {
|
||||
|
||||
private static HashMap<String, TechnologyNBT> technologyBooksClient = new HashMap<String, TechnologyNBT>();
|
||||
private static HashMap<String, TechnologyNBT> technologyBooksServer = new HashMap<String, TechnologyNBT>();
|
||||
private static int globalId = 0;
|
||||
|
||||
private static int DEFAULT_PROCESS_TIME = 10 * 20;
|
||||
|
||||
public SimpleInventory inventory = new SimpleInventory(3, "mainInv", 999);
|
||||
public SimpleInventory leftToCompute = new SimpleInventory(3, "leftInv", 999);
|
||||
|
||||
private HashSet<String> foundTechnologies = new HashSet<String>();
|
||||
private String researchedTechnology;
|
||||
private ItemStack itemInComputation;
|
||||
|
||||
private int progress = 0;
|
||||
private int processTime = 0;
|
||||
private String id;
|
||||
|
||||
private TechnologyNBT(NBTTagCompound nbt) {
|
||||
loadFromNBT(nbt);
|
||||
|
||||
if (!foundTechnologies.contains(Tier.WoodenGear.getTechnology().getID())) {
|
||||
foundTechnologies.add(Tier.WoodenGear.getTechnology().getID());
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isKnown(Technology t) {
|
||||
return foundTechnologies.contains(t.getID());
|
||||
}
|
||||
|
||||
public boolean canBeResearched(Technology t) {
|
||||
if (foundTechnologies.contains(t.getID())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Technology p : t.getPrerequisites()) {
|
||||
if (!isKnown(p)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void update() {
|
||||
if (researchedTechnology != null) {
|
||||
if (itemInComputation != null) {
|
||||
if (progress < processTime) {
|
||||
progress++;
|
||||
} else {
|
||||
for (IInvSlot slot : InventoryIterator.getIterable(leftToCompute, ForgeDirection.UNKNOWN)) {
|
||||
if (StackHelper.isMatchingItem(itemInComputation, slot.getStackInSlot())) {
|
||||
slot.decreaseStackInSlot(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
progress = 0;
|
||||
processTime = 0;
|
||||
itemInComputation = null;
|
||||
|
||||
boolean workToDo = false;
|
||||
|
||||
for (IInvSlot slot : InventoryIterator.getIterable(leftToCompute, ForgeDirection.UNKNOWN)) {
|
||||
if (slot.getStackInSlot() != null) {
|
||||
workToDo = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!workToDo) {
|
||||
foundTechnologies.add(researchedTechnology);
|
||||
researchedTechnology = null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (IInvSlot invSlot : InventoryIterator.getIterable(inventory, ForgeDirection.UNKNOWN)) {
|
||||
for (IInvSlot reqSlot : InventoryIterator.getIterable(leftToCompute, ForgeDirection.UNKNOWN)) {
|
||||
if (invSlot.getStackInSlot() != null
|
||||
&& reqSlot.getStackInSlot() != null
|
||||
&& StackHelper.isMatchingItem(invSlot.getStackInSlot(), reqSlot.getStackInSlot())) {
|
||||
|
||||
itemInComputation = invSlot.decreaseStackInSlot(1);
|
||||
progress = 0;
|
||||
|
||||
if (itemInComputation.getItem() instanceof IItemTechnologyProvider) {
|
||||
processTime = ((IItemTechnologyProvider) itemInComputation.getItem()).timeToProcess();
|
||||
} else {
|
||||
processTime = DEFAULT_PROCESS_TIME;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (itemInComputation != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
NBTTagList foundNBT = new NBTTagList();
|
||||
|
||||
for (String s : foundTechnologies) {
|
||||
foundNBT.appendTag(new NBTTagString(s));
|
||||
}
|
||||
|
||||
nbt.setTag("foundTechnologies", foundNBT);
|
||||
|
||||
if (researchedTechnology != null) {
|
||||
nbt.setString("researchedTechnology", researchedTechnology);
|
||||
}
|
||||
|
||||
NBTTagCompound inventoryNBT = new NBTTagCompound();
|
||||
inventory.writeToNBT(inventoryNBT);
|
||||
nbt.setTag("inventory", inventoryNBT);
|
||||
|
||||
NBTTagCompound leftToComputeNBT = new NBTTagCompound();
|
||||
leftToCompute.writeToNBT(leftToComputeNBT);
|
||||
nbt.setTag("leftTocompute", leftToComputeNBT);
|
||||
|
||||
if (itemInComputation != null) {
|
||||
NBTTagCompound itemInComputationNBT = new NBTTagCompound();
|
||||
itemInComputation.writeToNBT(itemInComputationNBT);
|
||||
nbt.setTag("itemInComputation", itemInComputationNBT);
|
||||
}
|
||||
|
||||
nbt.setInteger("progress", progress);
|
||||
nbt.setInteger("processTime", processTime);
|
||||
|
||||
nbt.setString("id", id);
|
||||
}
|
||||
|
||||
public void loadFromNBT(NBTTagCompound nbt) {
|
||||
NBTTagList foundNBT = nbt.getTagList("foundTechnologies", Constants.NBT.TAG_STRING);
|
||||
|
||||
for (int i = 0; i < foundNBT.tagCount(); ++i) {
|
||||
foundTechnologies.add(foundNBT.getStringTagAt(i));
|
||||
}
|
||||
|
||||
if (nbt.hasKey("researchedTechnology")) {
|
||||
researchedTechnology = nbt.getString("researchedTechnology");
|
||||
} else {
|
||||
researchedTechnology = null;
|
||||
}
|
||||
|
||||
inventory.readFromNBT(nbt.getCompoundTag("inventory"));
|
||||
|
||||
leftToCompute.readFromNBT(nbt.getCompoundTag("leftTocompute"));
|
||||
|
||||
if (nbt.hasKey("itemInComputation")) {
|
||||
itemInComputation = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("itemInComputation"));
|
||||
} else {
|
||||
itemInComputation = null;
|
||||
}
|
||||
|
||||
progress = nbt.getInteger("progress");
|
||||
processTime = nbt.getInteger("processTime");
|
||||
|
||||
id = nbt.getString("id");
|
||||
}
|
||||
|
||||
public float getProgress() {
|
||||
if (processTime == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return (float) progress / (float) processTime;
|
||||
}
|
||||
}
|
||||
|
||||
public static TechnologyNBT getTechnology(EntityPlayer holder, ItemStack stack) {
|
||||
HashMap<String, TechnologyNBT> technologyBooks;
|
||||
|
||||
if (holder.worldObj.isRemote) {
|
||||
technologyBooks = technologyBooksClient;
|
||||
} else {
|
||||
technologyBooks = technologyBooksServer;
|
||||
}
|
||||
|
||||
NBTTagCompound nbt = NBTUtils.getItemData(stack);
|
||||
|
||||
if (!nbt.hasKey("id")
|
||||
|| "".equals(nbt.getString("id"))) {
|
||||
String id = holder.getDisplayName() + "-"
|
||||
+ Long.toHexString((new Date()).getTime())
|
||||
+ "-" + globalId++;
|
||||
|
||||
nbt.setString("id", id);
|
||||
|
||||
TechnologyNBT techno = new TechnologyNBT(nbt);
|
||||
technologyBooks.put(id, techno);
|
||||
|
||||
return techno;
|
||||
} else {
|
||||
String id = nbt.getString("id");
|
||||
|
||||
if (technologyBooks.containsKey(id)) {
|
||||
return technologyBooks.get(id);
|
||||
} else {
|
||||
TechnologyNBT techno = new TechnologyNBT(nbt);
|
||||
technologyBooks.put(id, techno);
|
||||
|
||||
return techno;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void startResearch(Technology t) {
|
||||
researchedTechnology = t.getID();
|
||||
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
if (t.getRequirements()[i] != null) {
|
||||
leftToCompute.setInventorySlotContents(i, t.getRequirements()[i].copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Technology getResearchedTechnology() {
|
||||
if (researchedTechnology != null) {
|
||||
return Technology.getTechnology(researchedTechnology);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) 2011-2014, SpaceToad and the BuildCraft Team
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package buildcraft.core.science;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.silicon.ItemRedstoneChipset;
|
||||
|
||||
public enum Tier {
|
||||
WoodenGear,
|
||||
StoneGear,
|
||||
IronGear,
|
||||
GoldenGear,
|
||||
DiamondGear,
|
||||
EmeraldGear,
|
||||
RedstoneCrystalGear,
|
||||
|
||||
Chipset,
|
||||
IronChipset,
|
||||
GoldenChipset,
|
||||
DiamondChipset,
|
||||
EmeraldChipset,
|
||||
RedstoneCrystalChipset,
|
||||
Unrevealed;
|
||||
|
||||
private static ItemStack[] stacksToDisplay;
|
||||
|
||||
private static TechnoTier[] technologies;
|
||||
|
||||
public ItemStack getStackToDisplay () {
|
||||
if (stacksToDisplay == null) {
|
||||
stacksToDisplay = new ItemStack[Tier.values().length];
|
||||
|
||||
stacksToDisplay[WoodenGear.ordinal()] = new ItemStack(BuildCraftCore.woodenGearItem);
|
||||
stacksToDisplay[StoneGear.ordinal()] = new ItemStack(BuildCraftCore.stoneGearItem);
|
||||
stacksToDisplay[IronGear.ordinal()] = new ItemStack(BuildCraftCore.ironGearItem);
|
||||
stacksToDisplay[GoldenGear.ordinal()] = new ItemStack(BuildCraftCore.goldGearItem);
|
||||
stacksToDisplay[DiamondGear.ordinal()] = new ItemStack(BuildCraftCore.diamondGearItem);
|
||||
stacksToDisplay[EmeraldGear.ordinal()] = new ItemStack(Blocks.bedrock);
|
||||
stacksToDisplay[RedstoneCrystalGear.ordinal()] = new ItemStack(Blocks.bedrock);
|
||||
stacksToDisplay[Chipset.ordinal()] = ItemRedstoneChipset.Chipset.RED.getStack();
|
||||
stacksToDisplay[IronChipset.ordinal()] = ItemRedstoneChipset.Chipset.IRON.getStack();
|
||||
stacksToDisplay[GoldenChipset.ordinal()] = ItemRedstoneChipset.Chipset.GOLD.getStack();
|
||||
stacksToDisplay[DiamondChipset.ordinal()] = ItemRedstoneChipset.Chipset.DIAMOND.getStack();
|
||||
stacksToDisplay[EmeraldChipset.ordinal()] = ItemRedstoneChipset.Chipset.EMERALD.getStack();
|
||||
stacksToDisplay[RedstoneCrystalChipset.ordinal()] = new ItemStack(Blocks.bedrock);
|
||||
stacksToDisplay[Unrevealed.ordinal()] = new ItemStack(Blocks.bedrock);
|
||||
}
|
||||
|
||||
return stacksToDisplay[ordinal()];
|
||||
}
|
||||
|
||||
public Technology getTechnology() {
|
||||
return technologies[ordinal()];
|
||||
}
|
||||
|
||||
public static void initializeTechnologies() {
|
||||
technologies[WoodenGear.ordinal()].initialize(
|
||||
WoodenGear);
|
||||
technologies[StoneGear.ordinal()].initialize(
|
||||
StoneGear,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 50));
|
||||
technologies[IronGear.ordinal()].initialize(
|
||||
IronGear,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 75),
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 50));
|
||||
technologies[GoldenGear.ordinal()].initialize(
|
||||
GoldenGear,
|
||||
new ItemStack(BuildCraftCore.woodenGearItem, 125),
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 75),
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 10));
|
||||
technologies[DiamondGear.ordinal()].initialize(
|
||||
DiamondGear,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 125),
|
||||
new ItemStack(BuildCraftCore.ironGearItem, 15),
|
||||
new ItemStack(BuildCraftCore.goldGearItem, 5));
|
||||
technologies[EmeraldGear.ordinal()].initialize(
|
||||
EmeraldGear,
|
||||
new ItemStack(BuildCraftCore.stoneGearItem, 200));
|
||||
technologies[RedstoneCrystalGear.ordinal()].initialize(
|
||||
RedstoneCrystalGear);
|
||||
technologies[Chipset.ordinal()].initialize(
|
||||
Chipset);
|
||||
technologies[IronChipset.ordinal()].initialize(
|
||||
IronChipset);
|
||||
technologies[GoldenChipset.ordinal()].initialize(
|
||||
GoldenChipset);
|
||||
technologies[DiamondChipset.ordinal()].initialize(
|
||||
DiamondChipset);
|
||||
technologies[EmeraldChipset.ordinal()].initialize(
|
||||
EmeraldChipset);
|
||||
technologies[RedstoneCrystalChipset.ordinal()].initialize(
|
||||
RedstoneCrystalChipset);
|
||||
technologies[Unrevealed.ordinal()].initialize(
|
||||
Unrevealed);
|
||||
}
|
||||
|
||||
static {
|
||||
technologies = new TechnoTier[Tier.values().length];
|
||||
|
||||
for (int i = 0; i < technologies.length; ++i) {
|
||||
technologies[i] = new TechnoTier();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,16 +17,17 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import buildcraft.api.core.NetworkData;
|
||||
import buildcraft.api.gates.IActionParameter;
|
||||
import buildcraft.api.gates.IStatement;
|
||||
import buildcraft.api.gates.ITriggerParameter;
|
||||
import buildcraft.api.transport.IPipeTile;
|
||||
|
||||
public class ActionParameterDirection implements IActionParameter {
|
||||
public class StatementParameterDirection implements IActionParameter, ITriggerParameter {
|
||||
|
||||
// static IIcon[] icons = new IIcon[ForgeDirection.values().length];
|
||||
|
||||
@NetworkData
|
||||
public ForgeDirection direction = ForgeDirection.UNKNOWN;
|
||||
|
||||
public ActionParameterDirection() {
|
||||
public StatementParameterDirection() {
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -81,8 +82,8 @@ public class ActionParameterDirection implements IActionParameter {
|
|||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (object instanceof ActionParameterDirection) {
|
||||
ActionParameterDirection param = (ActionParameterDirection) object;
|
||||
if (object instanceof StatementParameterDirection) {
|
||||
StatementParameterDirection param = (StatementParameterDirection) object;
|
||||
return param.direction == this.direction;
|
||||
}
|
||||
return false;
|
|
@ -29,10 +29,10 @@ public class TriggerRedstoneInput extends BCTrigger {
|
|||
|
||||
@Override
|
||||
public boolean isTriggerActive(IGate gate, ITriggerParameter[] parameters) {
|
||||
return !(active ^ isBeingPowered((Pipe<?>) gate.getPipe()));
|
||||
return !(active ^ isBeingPowered(parameters, (Pipe<?>) gate.getPipe()));
|
||||
}
|
||||
|
||||
private boolean isBeingPowered(Pipe<?> pipe) {
|
||||
private boolean isBeingPowered(ITriggerParameter[] parameters, Pipe<?> pipe) {
|
||||
return pipe.container.redstoneInput > 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||
import buildcraft.api.gates.IActionParameter;
|
||||
import buildcraft.api.gates.IGate;
|
||||
import buildcraft.api.transport.IPipe;
|
||||
import buildcraft.core.triggers.ActionParameterDirection;
|
||||
import buildcraft.core.triggers.StatementParameterDirection;
|
||||
import buildcraft.core.triggers.BCActionActive;
|
||||
import buildcraft.core.utils.StringUtils;
|
||||
import buildcraft.transport.Pipe;
|
||||
|
@ -72,7 +72,7 @@ public class ActionValve extends BCActionActive {
|
|||
IActionParameter param = null;
|
||||
|
||||
if (index == 0) {
|
||||
param = new ActionParameterDirection();
|
||||
param = new StatementParameterDirection();
|
||||
}
|
||||
|
||||
return param;
|
||||
|
@ -84,8 +84,8 @@ public class ActionValve extends BCActionActive {
|
|||
|
||||
if (pipe != null && pipe instanceof Pipe) {
|
||||
PipeTransport transport = ((Pipe) pipe).transport;
|
||||
if (parameters[0] != null && parameters[0] instanceof ActionParameterDirection) {
|
||||
ForgeDirection side = ((ActionParameterDirection) parameters[0]).direction;
|
||||
if (parameters[0] != null && parameters[0] instanceof StatementParameterDirection) {
|
||||
ForgeDirection side = ((StatementParameterDirection) parameters[0]).direction;
|
||||
|
||||
if (side != ForgeDirection.UNKNOWN) {
|
||||
transport.allowInput(side, state.inputOpen);
|
||||
|
|
Loading…
Reference in a new issue