Merge master into builder

This commit is contained in:
CovertJaguar 2013-11-14 02:04:40 -08:00
commit 39d869a993
224 changed files with 4276 additions and 2432 deletions

View file

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="common"/>
<classpathentry kind="src" path="common"/>
<classpathentry kind="src" path="buildcraft_resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry combineaccessrules="false" kind="src" path="/Forge"/>
<classpathentry combineaccessrules="false" kind="src" path="/Forge"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -14,4 +14,11 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>common/assets</name>
<type>2</type>
<locationURI>PROJECT_LOC/buildcraft_resources/assets</locationURI>
</link>
</linkedResources>
</projectDescription>

View file

@ -4,6 +4,9 @@
If you wish to submit a pull request to fix bugs or broken behaviour feel free to do so. If you would like to add
features or change existing behaviour or balance, please discuss it with Sengir or Krapht before submiting the pull request.
Do not submit pull requests which solely "fix" formatting. As these kinds of changes are usually very intrusive in commit history and everyone has their own idea what "proper formatting" is, they should be done by one of the main contributors.
Please only submit "code cleanup", if the changes actually have a substantial impact on readability.
### Reporting issues
* Before reporting an issue, please check that it has not been reported before.
* Issues are for bugs/crashes, please do not use them to ask general questions.
@ -12,6 +15,8 @@ If you don't, we might assume that you are using latest-greatest and waste a bun
a problem that might have fixed been already. Such things makes for very grumpy devs. Grumpy devs spend
less time coding and more time doing stuff that makes them less grumpy.
* If the issues occurs on a server, be sure it's a vanilla forge server and <b>not</b> a mcpc+ server.
* Issues with any logs mentioning Optifine will be closed on sight! Remove Optifine before reporting any issue.
* Issues with any logs mentioning MineFactoryReloaded or PowerCrystalsCore will be closed on sight! They are modifying our code using core mods!
#### Frequently reported
* java.lang.AbstractMethodError - Incompatibility between BC/Forge/Mod using BC API. Usually not a BC issue

View file

@ -18,8 +18,8 @@
<property name="mcpsrc.dir" value="${mcp.dir}/src"/>
<property name="mc.version" value="1.6.2"/>
<property name="forge.version" value="9.10.0.800"/>
<property name="mc.version" value="1.6.4"/>
<property name="forge.version" value="9.11.1.949"/>
<!-- <property name="project.version" value="0.0.0"/>-->
<property name="buildcraft.name" value="buildcraft"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 285 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

View file

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Fri Aug 09 09:44:46 CEST 2013
build.number=39
#Sun Oct 27 08:22:33 PDT 2013
build.number=49

View file

@ -0,0 +1,17 @@
#4.1.0
- New: Added Iron Kinesis Pipe. (CovertJaguar)
- New: Added Non-Round Robin mode to Emerald Item Pipe. (Flow86)
- New: Pipes have tool tips now. (CovertJaguar)
- New: Added config option for update check (Prototik)
- New: Added config option for Oil Well proclivity. (sadris)
- New: Added config options for various Quarry/Mining Well tweaks/nerfs. (CovertJaguar)
- New: Added config options for Colorblind mode. (Krapht)
- Change: Reworked Combustion Engine heat mechanics. (CovertJaguar)
- Fix: Fixed Quarries in the Nether (cpw)
- Fix: Autarchic Gate single pulses are now more reliable. (cpw)
- Fix: Laser's hadWork trigger should work correctly now. (CovertJaguar)
- Fix: Refineries no longer forget their filters. (CovertJaguar)
- Fix: Pumps can now pump Oil out of Oceans again. (CovertJaguar)
- And: Various other small fixes/tweaks.

View file

@ -0,0 +1,11 @@
#4.1.1
- New: Massive rework of Pipe/Player interactions with improvements to selection, Gate/Wire/Facade/Plug placement and removal, Facade rendering and more. (CovertJaguar)
- New: Added config options for fluid fuel values. (CovertJaguar)
- Change: Move Gate/Wire rending to the Pipe TESR, should improve fps when lots of Gates are used. (CovertJaguar)
- Change: Reduce burn time of fluid fuels. (Player)
- Change: Fuel/Oil explode if placed in the Nether. (CovertJaguar)
- Fix: Fix version check so it isn't giving wrong results. (CovertJaguar)
- Fix: Add missing zero to Wooden Engine pump speed. (CovertJaguar)
- Fix: Increase Gate response time. (CovertJaguar)

View file

@ -0,0 +1,6 @@
#4.1.2
- Change: Filtered Buffer Triggers can now be applied to any inventory. (CovertJaguar)
- Fix: Fix tiny derp that was causing massive net spam and chunk rerenders on pipes with plugs. (Player/CovertJaguar)
- Fix: Optimize Pipe World Renderer to render less faces. (Player)

View file

@ -1,8 +1,10 @@
# Master language file
chat.pipe.power.iron.mode=Switched to %d MJ/t limit
gate.pipe.empty=Pipe Empty
gate.pipe.containsItems=Items Traversing
gate.pipe.containsLiquids=Liquid Traversing
gate.pipe.containsFluids=Fluid Traversing
gate.pipe.containsEnergy=Power Traversing
gate.pipe.requestsEnergy=Power Requested
gate.pipe.tooMuchEnergy=Power Overloaded
@ -24,6 +26,10 @@ gui.heat=Heat
gui.assemblyRate=Energy Rate
gui.assemblyCurrentRequired=Energy Required
gui.clickcraft=-Click to Craft-
gui.pipes.emerald.blocking=Blocking
gui.pipes.emerald.blocking.tip=Extraction is blocked if one element in filter is missing
gui.pipes.emerald.nonblocking=Non Blocking
gui.pipes.emerald.nonblocking.tip=Extraction continues with the next element in filter if one element is missing
item.bucketFuel=Fuel Bucket
item.bucketOil=Oil Bucket
item.woodenGearItem=Wood Gear
@ -33,7 +39,6 @@ item.goldGearItem=Gold Gear
item.diamondGearItem=Diamond Gear
item.templateItem=Template
item.wrenchItem=Wrench
item.fuel=Fuel
item.pipeWaterproof=Pipe Sealant
item.pipeGate.0=Gate
item.pipeGate.1=Iron AND Gate
@ -80,6 +85,7 @@ item.PipePowerWood=Wooden Kinesis Pipe
item.PipePowerCobblestone=Cobblestone Kinesis Pipe
item.PipePowerStone=Stone Kinesis Pipe
item.PipePowerQuartz=Quartz Kinesis Pipe
item.PipePowerIron=Iron Kinesis Pipe
item.PipePowerGold=Golden Kinesis Pipe
item.PipePowerDiamond=Diamond Kinesis Pipe
item.PipeItemsStripes=Stripes Transport Pipe
@ -90,6 +96,10 @@ item.PipeItemsSandstone=Sandstone Transport Pipe
item.PipeFluidsSandstone=Sandstone Fluid Pipe
item.Facade=Facade
item.PipePlug=Pipe Plug
tab.machines=Buildcraft Machines
tab.facades=Buildcraft Facades
tile.miningWellBlock=Mining Well
tile.plainPipeBlock=Mining Pipe
tile.autoWorkbenchBlock=Auto Workbench
@ -112,8 +122,33 @@ tile.floodGateBlock=Flood Gate
tile.engineWood=Redstone Engine
tile.engineStone=Stirling Engine
tile.engineIron=Combustion Engine
tile.oilStill=Oil
tile.blockOil=Oil
tile.blockFuel=Fuel
tile.spring.water=Water Spring
tile.spring.oil=Oil Spring
tile.oilMoving=Oil
tile.filteredBufferBlock=Filtered Buffer
tip.PipeFluidsCobblestone=Basic pipe, 10 mB/t\nWon't connect to Stone
tip.PipeFluidsEmerald=Extraction pipe, 40 mB/t
tip.PipeFluidsGold=Basic pipe, 40 mB/t
tip.PipeFluidsIron=Valve pipe, 10 mB/t
tip.PipeFluidsSandstone=Only connects to other pipes, 10 mB/t
tip.PipeFluidsStone=Basic pipe, 10 mB/t\nWon't connect to Cobblestone
tip.PipeFluidsVoid=Destroys fluids, 10 mB/t
tip.PipeFluidsWood=Extraction pipe, 10 mB/t
tip.PipeItemsCobblestone=Basic pipe, high drag\nWon't connect to Stone or Quartz
tip.PipeItemsDaizuli=Routes painted items
tip.PipeItemsDiamond=Sorts items
tip.PipeItemsEmerald=Round-robin extraction pipe
tip.PipeItemsGold=Speeds up items
tip.PipeItemsIron=Routes items
tip.PipeItemsLapis=Paints items
tip.PipeItemsObsidian=Sucks up items
tip.PipeItemsQuartz=Basic pipe, low drag\nWon't connect to Cobblestone or Stone
tip.PipeItemsSandstone=Only connects to other pipes
tip.PipeItemsStone=Basic pipe, medium drag\nWon't connect to Cobblestone or Quartz
tip.PipeItemsVoid=Destroys items
tip.PipeItemsWood=Extraction pipe
tip.PipePowerWood=Power Input Pipe
tip.PipePowerIron=Selectable Limiter Pipe
tip.PipeStructureCobblestone=Support pipe

View file

@ -3,10 +3,10 @@
"modid": "BuildCraft|Core",
"name": "BuildCraft",
"version": "@VERSION@",
"mcversion": "",
"mcversion": "@MC_VERSION@",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more!",
"credits": "Created by SpaceToad",
"logoFile": "/gfx/buildcraft/logo.png",
"logoFile": "/assets/buildcraft/logo.png",
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "BuildCraft Team" ],
@ -20,10 +20,10 @@
"modid": "BuildCraft|Builders",
"name": "BC Builders",
"version": "@VERSION@",
"mcversion": "",
"mcversion": "@MC_VERSION@",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Builders Component)",
"credits": "Created by SpaceToad",
"logoFile": "/gfx/buildcraft/logo.png",
"logoFile": "/assets/buildcraft/logo.png",
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "BuildCraft Team" ],
@ -37,10 +37,10 @@
"modid": "BuildCraft|Energy",
"name": "BC Energy",
"version": "@VERSION@",
"mcversion": "",
"mcversion": "@MC_VERSION@",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Energy Component)",
"credits": "Created by SpaceToad",
"logoFile": "/gfx/buildcraft/logo.png",
"logoFile": "/assets/buildcraft/logo.png",
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "BuildCraft Team" ],
@ -54,10 +54,10 @@
"modid": "BuildCraft|Factory",
"name": "BC Factory",
"version": "@VERSION@",
"mcversion": "",
"mcversion": "@MC_VERSION@",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Factory Component)",
"credits": "Created by SpaceToad",
"logoFile": "/gfx/buildcraft/logo.png",
"logoFile": "/assets/buildcraft/logo.png",
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "BuildCraft Team" ],
@ -71,10 +71,10 @@
"modid": "BuildCraft|Silicon",
"name": "BC Silicon",
"version": "@VERSION@",
"mcversion": "",
"mcversion": "@MC_VERSION@",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Silicon Component)",
"credits": "Created by SpaceToad",
"logoFile": "/gfx/buildcraft/logo.png",
"logoFile": "/assets/buildcraft/logo.png",
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "BuildCraft Team" ],
@ -88,10 +88,10 @@
"modid": "BuildCraft|Transport",
"name": "BC Transport",
"version": "@VERSION@",
"mcversion": "",
"mcversion": "@MC_VERSION@",
"description": "Extending Minecraft with pipes, auto-crafting, quarries, engines and much more! (Transport Component)",
"credits": "Created by SpaceToad",
"logoFile": "/gfx/buildcraft/logo.png",
"logoFile": "/assets/buildcraft/logo.png",
"url": "http://www.mod-buildcraft.com/",
"updateUrl": "",
"authors": [ "SpaceToad", "BuildCraft Team" ],

View file

@ -56,6 +56,7 @@ import buildcraft.builders.TileMarker;
import buildcraft.builders.TilePathMarker;
import buildcraft.builders.network.PacketHandlerBuilders;
import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.Version;
import buildcraft.core.blueprints.BptPlayerIndex;
import buildcraft.core.blueprints.BptRootIndex;
@ -64,6 +65,7 @@ import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
import cpw.mods.fml.common.network.NetworkMod;
@ -240,10 +242,12 @@ public class BuildCraftBuilders {
templateItem = new ItemBptTemplate(templateItemId.getInt());
templateItem.setUnlocalizedName("templateItem");
LanguageRegistry.addName(templateItem, "Template");
CoreProxy.proxy.registerItem(templateItem);
blueprintItem = new ItemBptBluePrint(blueprintItemId.getInt());
blueprintItem.setUnlocalizedName("blueprintItem");
LanguageRegistry.addName(blueprintItem, "Blueprint");
CoreProxy.proxy.registerItem(blueprintItem);
markerBlock = new BlockMarker(markerId.getInt());
CoreProxy.proxy.registerBlock(markerBlock.setUnlocalizedName("markerBlock"));
@ -293,33 +297,33 @@ public class BuildCraftBuilders {
public static void loadRecipes() {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(templateItem, 1), new Object[]{"ppp", "pip", "ppp", Character.valueOf('i'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('p'), Item.paper});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(templateItem, 1), new Object[]{"ppp", "pip", "ppp", 'i',
new ItemStack(Item.dyePowder, 1, 0), 'p', Item.paper});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(blueprintItem, 1), new Object[]{"ppp", "pip", "ppp", Character.valueOf('i'),
// new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('p'), Item.paper});
// CoreProxy.proxy.addCraftingRecipe(new ItemStack(blueprintItem, 1), new Object[]{"ppp", "pip", "ppp", 'i',
// new ItemStack(Item.dyePowder, 1, 4), 'p', Item.paper});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), new Object[]{"l ", "r ", Character.valueOf('l'),
new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('r'), Block.torchRedstoneActive});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(markerBlock, 1), new Object[]{"l ", "r ", 'l',
new ItemStack(Item.dyePowder, 1, 4), 'r', Block.torchRedstoneActive});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), new Object[]{"l ", "r ", Character.valueOf('l'),
new ItemStack(Item.dyePowder, 1, 2), Character.valueOf('r'), Block.torchRedstoneActive});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(pathMarkerBlock, 1), new Object[]{"l ", "r ", 'l',
new ItemStack(Item.dyePowder, 1, 2), 'r', Block.torchRedstoneActive});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), new Object[]{"btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), new ItemStack(Item.dyePowder, 1, 11),
Character.valueOf('c'), Block.workbench, Character.valueOf('g'), BuildCraftCore.goldGearItem, Character.valueOf('C'), Block.chest});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(fillerBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
'c', Block.workbench, 'g', BuildCraftCore.goldGearItem, 'C', Block.chest});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), new Object[]{"btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), new ItemStack(Item.dyePowder, 1, 11),
Character.valueOf('c'), Block.workbench, Character.valueOf('g'), BuildCraftCore.diamondGearItem, Character.valueOf('C'), Block.chest});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
'c', Block.workbench, 'g', BuildCraftCore.diamondGearItem, 'C', Block.chest});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(architectBlock, 1), new Object[]{"btb", "ycy", "gCg", Character.valueOf('b'),
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), new ItemStack(Item.dyePowder, 1, 11),
Character.valueOf('c'), Block.workbench, Character.valueOf('g'), BuildCraftCore.diamondGearItem, Character.valueOf('C'),
CoreProxy.proxy.addCraftingRecipe(new ItemStack(architectBlock, 1), new Object[]{"btb", "ycy", "gCg", 'b',
new ItemStack(Item.dyePowder, 1, 0), 't', markerBlock, 'y', new ItemStack(Item.dyePowder, 1, 11),
'c', Block.workbench, 'g', BuildCraftCore.diamondGearItem, 'C',
new ItemStack(templateItem, 1)});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(libraryBlock, 1), new Object[]{"bbb", "bBb", "bbb", Character.valueOf('b'),
new ItemStack(blueprintItem), Character.valueOf('B'), Block.bookShelf});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(libraryBlock, 1), new Object[]{"bbb", "bBb", "bbb", 'b',
new ItemStack(blueprintItem), 'B', Block.bookShelf});
// / INIT FILLER PATTERNS
@ -332,6 +336,11 @@ public class BuildCraftBuilders {
FillerManager.registry.addRecipe(new FillerFillStairs(), new Object[]{" b", " bb", "bbb", 'g', Block.glass, 'b', Block.brick});
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
InterModComms.processIMC(event);
}
public static BptPlayerIndex getPlayerIndex(String name) {
BptRootIndex rootIndex = getBptRootIndex();

View file

@ -9,6 +9,23 @@
package buildcraft;
import java.io.File;
import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.entity.EntityList;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.fluids.IFluidBlock;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.IIconProvider;
import buildcraft.api.gates.ActionManager;
@ -22,6 +39,7 @@ import buildcraft.core.DefaultProps;
import buildcraft.core.EntityEnergyLaser;
import buildcraft.core.EntityPowerLaser;
import buildcraft.core.EntityRobot;
import buildcraft.core.InterModComms;
import buildcraft.core.ItemBuildCraft;
import buildcraft.core.ItemSpring;
import buildcraft.core.ItemWrench;
@ -43,42 +61,27 @@ import buildcraft.core.triggers.DefaultActionProvider;
import buildcraft.core.triggers.DefaultTriggerProvider;
import buildcraft.core.triggers.TriggerFluidContainer;
import buildcraft.core.triggers.TriggerInventory;
import buildcraft.core.triggers.TriggerInventoryLevel;
import buildcraft.core.triggers.TriggerMachine;
import buildcraft.core.utils.BCLog;
import buildcraft.core.utils.Localization;
import buildcraft.transport.triggers.TriggerRedstoneInput;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.io.File;
import java.util.TreeMap;
import java.util.logging.Logger;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.entity.EntityList;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon;
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.fluids.IFluidBlock;
@Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", dependencies = "required-after:Forge@[9.10.0.800,)")
@Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", acceptedMinecraftVersions = "[1.6,1.7)", dependencies = "required-after:Forge@[9.10.0.800,)")
@NetworkMod(channels = { DefaultProps.NET_CHANNEL_NAME }, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
public class BuildCraftCore {
public static enum RenderMode {
@ -90,6 +93,7 @@ public class BuildCraftCore {
public static boolean debugMode = false;
public static boolean modifyWorld = false;
public static boolean trackNetworkUsage = false;
public static boolean colorBlindMode = false;
public static boolean dropBrokenBlocks = true; // Set to false to prevent the filler from dropping broken blocks.
@ -145,6 +149,10 @@ public class BuildCraftCore {
public static BCTrigger triggerFullFluid = new TriggerFluidContainer(DefaultProps.TRIGGER_FULL_LIQUID, TriggerFluidContainer.State.Full);
public static BCTrigger triggerRedstoneActive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_ACTIVE, true);
public static BCTrigger triggerRedstoneInactive = new TriggerRedstoneInput(DefaultProps.TRIGGER_REDSTONE_INACTIVE, false);
public static BCTrigger triggerInventoryBelow25 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_25);
public static BCTrigger triggerInventoryBelow50 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_50);
public static BCTrigger triggerInventoryBelow75 = new TriggerInventoryLevel(TriggerInventoryLevel.TriggerType.BELOW_75);
public static BCAction actionRedstone = new ActionRedstoneOutput(DefaultProps.ACTION_REDSTONE);
public static BCAction actionOn = new ActionMachineControl(DefaultProps.ACTION_ON, Mode.On);
@ -157,25 +165,24 @@ public class BuildCraftCore {
public static BptItem[] itemBptProps = new BptItem[Item.itemsList.length];
public static final Logger bcLog = Logger.getLogger("Buildcraft");
@Instance("BuildCraft|Core")
public static BuildCraftCore instance;
@EventHandler
public void loadConfiguration(FMLPreInitializationEvent evt) {
Version.check();
bcLog.setParent(FMLLog.getLogger());
bcLog.info("Starting BuildCraft " + Version.getVersion());
bcLog.info("Copyright (c) SpaceToad, 2011");
bcLog.info("http://www.mod-buildcraft.com");
BCLog.initLog();
BlueprintDatabase.configFolder = evt.getModConfigurationDirectory();
mainConfiguration = new BuildCraftConfiguration(new File(evt.getModConfigurationDirectory(), "buildcraft/main.conf"));
try {
mainConfiguration.load();
Property updateCheck = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "update.check", true);
updateCheck.comment = "set to true for version check on startup";
if (updateCheck.getBoolean(true)) {
Version.check();
}
Property continuousCurrent = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "current.continuous",
DefaultProps.CURRENT_CONTINUOUS);
@ -236,23 +243,32 @@ public class BuildCraftCore {
woodenGearItem = (new ItemBuildCraft(woodenGearId.getInt())).setUnlocalizedName("woodenGearItem");
LanguageRegistry.addName(woodenGearItem, "Wooden Gear");
CoreProxy.proxy.registerItem(woodenGearItem);
OreDictionary.registerOre("gearWood", new ItemStack(woodenGearItem));
stoneGearItem = (new ItemBuildCraft(stoneGearId.getInt())).setUnlocalizedName("stoneGearItem");
LanguageRegistry.addName(stoneGearItem, "Stone Gear");
CoreProxy.proxy.registerItem(stoneGearItem);
OreDictionary.registerOre("gearStone", new ItemStack(stoneGearItem));
ironGearItem = (new ItemBuildCraft(ironGearId.getInt())).setUnlocalizedName("ironGearItem");
LanguageRegistry.addName(ironGearItem, "Iron Gear");
CoreProxy.proxy.registerItem(ironGearItem);
OreDictionary.registerOre("gearIron", new ItemStack(ironGearItem));
goldGearItem = (new ItemBuildCraft(goldenGearId.getInt())).setUnlocalizedName("goldGearItem");
LanguageRegistry.addName(goldGearItem, "Gold Gear");
CoreProxy.proxy.registerItem(goldGearItem);
OreDictionary.registerOre("gearGold", new ItemStack(goldGearItem));
diamondGearItem = (new ItemBuildCraft(diamondGearId.getInt())).setUnlocalizedName("diamondGearItem");
LanguageRegistry.addName(diamondGearItem, "Diamond Gear");
CoreProxy.proxy.registerItem(diamondGearItem);
OreDictionary.registerOre("gearDiamond", new ItemStack(diamondGearItem));
Property colorBlindProp = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "client.colorblindmode", false);
colorBlindProp.comment = "Set to true to enable alternate textures";
colorBlindMode = colorBlindProp.getBoolean(false);
MinecraftForge.EVENT_BUS.register(this);
} finally {
@ -329,12 +345,17 @@ public class BuildCraftCore {
}
public void loadRecipes() {
GameRegistry.addRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), stoneGearItem);
GameRegistry.addRecipe(new ItemStack(woodenGearItem), " S ", "S S", " S ", Character.valueOf('S'), Item.stick);
GameRegistry.addRecipe(new ItemStack(stoneGearItem), " I ", "IGI", " I ", Character.valueOf('I'), Block.cobblestone, Character.valueOf('G'),
CoreProxy.proxy.addCraftingRecipe(new ItemStack(wrenchItem), "I I", " G ", " I ", 'I', Item.ingotIron, 'G', stoneGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(woodenGearItem), " S ", "S S", " S ", 'S', "stickWood");
CoreProxy.proxy.addCraftingRecipe(new ItemStack(stoneGearItem), " I ", "IGI", " I ", 'I', "cobblestone", 'G',
woodenGearItem);
GameRegistry.addRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", Character.valueOf('I'), Item.ingotIron, Character.valueOf('G'), stoneGearItem);
GameRegistry.addRecipe(new ItemStack(goldGearItem), " I ", "IGI", " I ", Character.valueOf('I'), Item.ingotGold, Character.valueOf('G'), ironGearItem);
GameRegistry.addRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", Character.valueOf('I'), Item.diamond, Character.valueOf('G'), goldGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(ironGearItem), " I ", "IGI", " I ", 'I', Item.ingotIron, 'G', stoneGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(goldGearItem), " I ", "IGI", " I ", 'I', Item.ingotGold, 'G', ironGearItem);
CoreProxy.proxy.addCraftingRecipe(new ItemStack(diamondGearItem), " I ", "IGI", " I ", 'I', Item.diamond, 'G', goldGearItem);
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
InterModComms.processIMC(event);
}
}

View file

@ -13,6 +13,7 @@ import buildcraft.api.recipes.RefineryRecipes;
import buildcraft.core.BlockIndex;
import buildcraft.core.BlockSpring;
import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.Version;
import buildcraft.core.network.PacketHandler;
import buildcraft.core.proxy.CoreProxy;
@ -44,8 +45,6 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.item.Item;
@ -81,6 +80,7 @@ public class BuildCraftEnergy {
public static Item bucketFuel;
public static Item fuel;
public static boolean canOilBurn;
public static double oilWellScalar;
public static TreeMap<BlockIndex, Integer> saturationStored = new TreeMap<BlockIndex, Integer>();
public static BCTrigger triggerBlueEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_BLUE_ENGINE_HEAT, EnergyStage.BLUE, "buildcraft.engine.stage.blue");
public static BCTrigger triggerGreenEngineHeat = new TriggerEngineHeat(DefaultProps.TRIGGER_GREEN_ENGINE_HEAT, EnergyStage.GREEN, "buildcraft.engine.stage.green");
@ -107,6 +107,10 @@ public class BuildCraftEnergy {
int oilDesertBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "oilDesert", DefaultProps.BIOME_OIL_DESERT).getInt(DefaultProps.BIOME_OIL_DESERT);
int oilOceanBiomeId = BuildCraftCore.mainConfiguration.get("biomes", "oilOcean", DefaultProps.BIOME_OIL_OCEAN).getInt(DefaultProps.BIOME_OIL_OCEAN);
canOilBurn = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "burnOil", true, "Can oil burn?").getBoolean(true);
oilWellScalar = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "oilWellGenerationRate", 1.0, "Probability of oil well generation").getDouble(1.0);
double fuelOilMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.oil.combustion", 1.0F, "adjust energy value of Oil in Combustion Engines").getDouble(1.0F);
double fuelFuelMultiplier = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "fuel.fuel.combustion", 1.0F, "adjust energy value of Fuel in Combustion Engines").getDouble(1.0F);
BuildCraftCore.mainConfiguration.save();
class BiomeIdException extends RuntimeException {
@ -185,6 +189,7 @@ public class BuildCraftEnergy {
bucketOil = new ItemBucketBuildcraft(bucketOilId, blockOil.blockID);
bucketOil.setUnlocalizedName("bucketOil").setContainerItem(Item.bucketEmpty);
LanguageRegistry.addName(bucketOil, "Oil Bucket");
CoreProxy.proxy.registerItem(bucketOil);
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("oil", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketOil), new ItemStack(Item.bucketEmpty));
}
@ -192,6 +197,7 @@ public class BuildCraftEnergy {
bucketFuel = new ItemBucketBuildcraft(bucketFuelId, blockFuel.blockID);
bucketFuel.setUnlocalizedName("bucketFuel").setContainerItem(Item.bucketEmpty);
LanguageRegistry.addName(bucketFuel, "Fuel Bucket");
CoreProxy.proxy.registerItem(bucketFuel);
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketFuel), new ItemStack(Item.bucketEmpty));
}
@ -202,9 +208,9 @@ public class BuildCraftEnergy {
RefineryRecipes.addRecipe(new FluidStack(fluidOil, 1), new FluidStack(fluidFuel, 1), 12, 1);
// Iron Engine Fuels
IronEngineFuel.addFuel("lava", 1, 20000);
IronEngineFuel.addFuel("oil", 3, 20000);
IronEngineFuel.addFuel("fuel", 6, 100000);
// IronEngineFuel.addFuel("lava", 1, 20000);
IronEngineFuel.addFuel("oil", 3, (int) (5000 * fuelOilMultiplier));
IronEngineFuel.addFuel("fuel", 6, (int) (25000 * fuelFuelMultiplier));
// Iron Engine Coolants
IronEngineCoolant.addCoolant(FluidRegistry.getFluid("water"), 0.0023F);
@ -245,47 +251,17 @@ public class BuildCraftEnergy {
public static void loadRecipes() {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 0),
new Object[]{"www", " g ", "GpG", Character.valueOf('w'), "plankWood", Character.valueOf('g'), Block.glass, Character.valueOf('G'),
BuildCraftCore.woodenGearItem, Character.valueOf('p'), Block.pistonBase});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 1), new Object[]{"www", " g ", "GpG", Character.valueOf('w'), Block.cobblestone,
Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.stoneGearItem, Character.valueOf('p'), Block.pistonBase});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2), new Object[]{"www", " g ", "GpG", Character.valueOf('w'), Item.ingotIron,
Character.valueOf('g'), Block.glass, Character.valueOf('G'), BuildCraftCore.ironGearItem, Character.valueOf('p'), Block.pistonBase});
new Object[]{"www", " g ", "GpG", 'w', "plankWood", 'g', Block.glass, 'G',
BuildCraftCore.woodenGearItem, 'p', Block.pistonBase});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 1), new Object[]{"www", " g ", "GpG", 'w', "cobblestone",
'g', Block.glass, 'G', BuildCraftCore.stoneGearItem, 'p', Block.pistonBase});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(engineBlock, 1, 2), new Object[]{"www", " g ", "GpG", 'w', Item.ingotIron,
'g', Block.glass, 'G', BuildCraftCore.ironGearItem, 'p', Block.pistonBase});
}
@Mod.IMCCallback
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage m : event.getMessages()) {
if (m.key.equals("oil-lake-biome")) {
try {
String biomeID = m.getStringValue().trim();
int id = Integer.valueOf(biomeID);
if (id >= BiomeGenBase.biomeList.length) {
throw new IllegalArgumentException("Biome ID must be less than " + BiomeGenBase.biomeList.length);
}
OilPopulate.INSTANCE.surfaceDepositBiomes.add(id);
} catch (Exception ex) {
Logger.getLogger("Buildcraft").log(Level.WARNING,
String.format("Received an invalid oil-lake-biome request %s from mod %s", m.getStringValue(), m.getSender()));
}
Logger.getLogger("Buildcraft").log(Level.INFO,
String.format("Received an successfull oil-lake-biome request %s from mod %s", m.getStringValue(), m.getSender()));
} else if (m.key.equals("oil-gen-exclude")) {
try {
String biomeID = m.getStringValue().trim();
int id = Integer.valueOf(biomeID);
if (id >= BiomeGenBase.biomeList.length) {
throw new IllegalArgumentException("Biome ID must be less than " + BiomeGenBase.biomeList.length);
}
OilPopulate.INSTANCE.excludedBiomes.add(id);
} catch (Exception ex) {
Logger.getLogger("Buildcraft").log(Level.WARNING,
String.format("Received an invalid oil-gen-exclude request %s from mod %s", m.getStringValue(), m.getSender()));
}
Logger.getLogger("Buildcraft").log(Level.INFO,
String.format("Received an successfull oil-gen-exclude request %s from mod %s", m.getStringValue(), m.getSender()));
}
}
InterModComms.processIMC(event);
}
// public static int createPollution (World world, int i, int j, int k, int
// saturation) {

View file

@ -8,8 +8,10 @@
package buildcraft;
import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.ConfigUtils;
import buildcraft.factory.BlockAutoWorkbench;
import buildcraft.factory.BlockFloodGate;
import buildcraft.factory.BlockFrame;
@ -42,6 +44,7 @@ import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
@ -59,12 +62,14 @@ import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
import net.minecraftforge.event.ForgeSubscribe;
@Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerFactory.class, clientSideRequired = true, serverSideRequired = true)
public class BuildCraftFactory {
public static final int MINING_MJ_COST_PER_BLOCK = 64;
public static BlockQuarry quarryBlock;
public static BlockMiningWell miningWellBlock;
public static BlockAutoWorkbench autoWorkbenchBlock;
@ -75,8 +80,10 @@ public class BuildCraftFactory {
public static BlockTank tankBlock;
public static BlockRefinery refineryBlock;
public static BlockHopper hopperBlock;
public static boolean hopperDisabled;
public static boolean allowMining = true;
public static boolean quarryOneTimeUse = false;
public static float miningMultiplier = 1;
public static int miningDepth = 256;
public static PumpDimensionList pumpDimensionList;
@Instance("BuildCraft|Factory")
public static BuildCraftFactory instance;
@ -131,10 +138,7 @@ public class BuildCraftFactory {
CoreProxy.proxy.registerTileEntity(TileFloodGate.class, "net.minecraft.src.buildcraft.factory.TileFloodGate");
CoreProxy.proxy.registerTileEntity(TileTank.class, "net.minecraft.src.buildcraft.factory.TileTank");
CoreProxy.proxy.registerTileEntity(TileRefinery.class, "net.minecraft.src.buildcraft.factory.Refinery");
if (!hopperDisabled) {
CoreProxy.proxy.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper");
}
CoreProxy.proxy.registerTileEntity(TileHopper.class, "net.minecraft.src.buildcraft.factory.TileHopper");
FactoryProxy.proxy.initializeTileEntities();
@ -150,9 +154,19 @@ public class BuildCraftFactory {
@EventHandler
public void initialize(FMLPreInitializationEvent evt) {
allowMining = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "mining.enabled", true).getBoolean(true);
ConfigUtils genCat = new ConfigUtils(BuildCraftCore.mainConfiguration, Configuration.CATEGORY_GENERAL);
pumpDimensionList = new PumpDimensionList(BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pumping.controlList", DefaultProps.PUMP_DIMENSION_LIST).getString());
allowMining = genCat.get("mining.enabled", true, "disables the recipes for automated mining machines");
quarryOneTimeUse = genCat.get("quarry.one.time.use", false, "Quarry cannot be picked back up after placement");
miningMultiplier = genCat.get("mining.cost.multipler", 1F, 1F, 10F, "cost multiplier for mining operations, range (1.0 - 10.0)\nhigh values may render engines incapable of powering machines directly");
miningDepth = genCat.get("mining.depth", 2, 256, 256, "how far below the machine can mining machines dig, range (2 - 256), default 256");
Property pumpList = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pumping.controlList", DefaultProps.PUMP_DIMENSION_LIST);
pumpList.comment = "Allows admins to whitelist or blacklist pumping of specific fluids in specific dimensions.\n"
+ "Eg. \"-/-1/Lava\" will disable lava in the nether. \"-/*/Lava\" will disable lava in any dimension. \"+/0/*\" will enable any fluid in the overworld.\n"
+ "Entries are comma seperated, banned fluids have precedence over allowed ones."
+ "Default is \"+/*/*,+/-1/Lava\" - the second redundant entry (\"+/-1/lava\") is there to show the format.";
pumpDimensionList = new PumpDimensionList(pumpList.getString());
int miningWellId = BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID).getInt(DefaultProps.MINING_WELL_ID);
int plainPipeId = BuildCraftCore.mainConfiguration.getBlock("drill.id", DefaultProps.DRILL_ID).getInt(DefaultProps.DRILL_ID);
@ -317,6 +331,11 @@ public class BuildCraftFactory {
'G', BuildCraftCore.ironGearItem,
'F', new ItemStack(Block.fenceIron));
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
InterModComms.processIMC(event);
}
@ForgeSubscribe
@SideOnly(Side.CLIENT)

View file

@ -11,6 +11,7 @@ import buildcraft.api.bptblocks.BptBlockInventory;
import buildcraft.api.bptblocks.BptBlockRotateMeta;
import buildcraft.api.recipes.AssemblyRecipe;
import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.ItemRedstoneChipset;
import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy;
@ -27,6 +28,7 @@ import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.network.NetworkRegistry;
@ -40,7 +42,7 @@ import net.minecraftforge.common.Property;
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerSilicon.class, clientSideRequired = true, serverSideRequired = true)
public class BuildCraftSilicon {
public static Item redstoneChipset;
public static ItemRedstoneChipset redstoneChipset;
public static BlockLaser laserBlock;
public static BlockLaserTable assemblyTableBlock;
@Instance("BuildCraft|Silicon")
@ -68,7 +70,8 @@ public class BuildCraftSilicon {
redstoneChipset = new ItemRedstoneChipset(redstoneChipsetId.getInt());
redstoneChipset.setUnlocalizedName("redstoneChipset");
CoreProxy.proxy.registerItem(redstoneChipset);
redstoneChipset.registerItemStacks();
}
@EventHandler
@ -91,14 +94,14 @@ public class BuildCraftSilicon {
public static void loadRecipes() {
CoreProxy.proxy.addCraftingRecipe(new ItemStack(laserBlock),
new Object[]{"ORR", "DDR", "ORR", Character.valueOf('O'), Block.obsidian, Character.valueOf('R'), Item.redstone, Character.valueOf('D'),
new Object[]{"ORR", "DDR", "ORR", 'O', Block.obsidian, 'R', Item.redstone, 'D',
Item.diamond,});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 0), new Object[]{"ORO", "ODO", "OGO", Character.valueOf('O'), Block.obsidian,
Character.valueOf('R'), Item.redstone, Character.valueOf('D'), Item.diamond, Character.valueOf('G'), BuildCraftCore.diamondGearItem,});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 0), new Object[]{"ORO", "ODO", "OGO", 'O', Block.obsidian,
'R', Item.redstone, 'D', Item.diamond, 'G', BuildCraftCore.diamondGearItem,});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 1), new Object[]{"OWO", "OCO", "ORO", Character.valueOf('O'), Block.obsidian,
Character.valueOf('W'), Block.workbench, Character.valueOf('C'), Block.chest, Character.valueOf('R'), new ItemStack(redstoneChipset, 1, 0),});
CoreProxy.proxy.addCraftingRecipe(new ItemStack(assemblyTableBlock, 1, 1), new Object[]{"OWO", "OCO", "ORO", 'O', Block.obsidian,
'W', Block.workbench, 'C', Block.chest, 'R', new ItemStack(redstoneChipset, 1, 0),});
// Add reverse recipies for all gates
// Iron
@ -224,4 +227,9 @@ public class BuildCraftSilicon {
CoreProxy.proxy.addName(new ItemStack(BuildCraftTransport.pipeGateAutarchic, 1, 6), "Autarchic Diamond OR Gate");
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
InterModComms.processIMC(event);
}
}

View file

@ -13,8 +13,8 @@ import buildcraft.api.recipes.AssemblyRecipe;
import buildcraft.api.transport.IExtractionHandler;
import buildcraft.api.transport.IPipe;
import buildcraft.api.transport.PipeManager;
import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.DefaultProps;
import buildcraft.core.InterModComms;
import buildcraft.core.ItemBuildCraft;
import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy;
@ -64,6 +64,8 @@ import buildcraft.transport.pipes.PipeItemsWood;
import buildcraft.transport.pipes.PipePowerCobblestone;
import buildcraft.transport.pipes.PipePowerDiamond;
import buildcraft.transport.pipes.PipePowerGold;
import buildcraft.transport.pipes.PipePowerIron;
import buildcraft.transport.pipes.PipePowerIron.PowerMode;
import buildcraft.transport.pipes.PipePowerQuartz;
import buildcraft.transport.pipes.PipePowerStone;
import buildcraft.transport.pipes.PipePowerWood;
@ -71,21 +73,17 @@ import buildcraft.transport.pipes.PipeStructureCobblestone;
import buildcraft.transport.triggers.ActionEnergyPulser;
import buildcraft.transport.triggers.ActionPipeColor;
import buildcraft.transport.triggers.ActionPipeDirection;
import buildcraft.transport.triggers.ActionPowerLimiter;
import buildcraft.transport.triggers.ActionSignalOutput;
import buildcraft.transport.triggers.ActionSingleEnergyPulse;
import buildcraft.transport.triggers.TriggerFilteredBufferInventoryLevel;
import buildcraft.transport.triggers.TriggerPipeContents;
import buildcraft.transport.triggers.TriggerPipeContents.Kind;
import buildcraft.transport.triggers.TriggerPipeSignal;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.common.primitives.Ints;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
@ -93,8 +91,6 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import java.util.LinkedList;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
@ -142,6 +138,7 @@ public class BuildCraftTransport {
public static Item pipePowerCobblestone;
public static Item pipePowerStone;
public static Item pipePowerQuartz;
public static Item pipePowerIron;
public static Item pipePowerGold;
public static Item pipePowerDiamond;
public static ItemFacade facadeItem;
@ -164,9 +161,6 @@ public class BuildCraftTransport {
public static BCTrigger triggerGreenSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_GREEN_SIGNAL_INACTIVE, false, IPipe.WireColor.Green);
public static BCTrigger triggerYellowSignalActive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_ACTIVE, true, IPipe.WireColor.Yellow);
public static BCTrigger triggerYellowSignalInactive = new TriggerPipeSignal(DefaultProps.TRIGGER_YELLOW_SIGNAL_INACTIVE, false, IPipe.WireColor.Yellow);
public static BCTrigger triggerInventoryBelow25 = new TriggerFilteredBufferInventoryLevel(DefaultProps.TRIGGER_INVENTORY_LEVEL_BELOW25, TriggerFilteredBufferInventoryLevel.State.Below25);
public static BCTrigger triggerInventoryBelow50 = new TriggerFilteredBufferInventoryLevel(DefaultProps.TRIGGER_INVENTORY_LEVEL_BELOW50, TriggerFilteredBufferInventoryLevel.State.Below50);
public static BCTrigger triggerInventoryBelow75 = new TriggerFilteredBufferInventoryLevel(DefaultProps.TRIGGER_INVENTORY_LEVEL_BELOW75, TriggerFilteredBufferInventoryLevel.State.Below75);
public static BCAction actionRedSignal = new ActionSignalOutput(DefaultProps.ACTION_RED_SIGNAL, IPipe.WireColor.Red);
public static BCAction actionBlueSignal = new ActionSignalOutput(DefaultProps.ACTION_BLUE_SIGNAL, IPipe.WireColor.Blue);
public static BCAction actionGreenSignal = new ActionSignalOutput(DefaultProps.ACTION_GREEN_SIGNAL, IPipe.WireColor.Green);
@ -175,6 +169,7 @@ public class BuildCraftTransport {
public static BCAction actionSingleEnergyPulse = new ActionSingleEnergyPulse(DefaultProps.ACTION_SINGLE_ENERGY_PULSE);
public static BCAction[] actionPipeColor = new BCAction[16];
public static BCAction[] actionPipeDirection = new BCAction[16];
public static BCAction[] actionPowerLimiter = new BCAction[7];
@Instance("BuildCraft|Transport")
public static BuildCraftTransport instance;
public IIconProvider pipeIconProvider = new PipeIconProvider();
@ -269,16 +264,17 @@ public class BuildCraftTransport {
pipeWaterproof = new ItemBuildCraft(pipeWaterproofId.getInt());
pipeWaterproof.setUnlocalizedName("pipeWaterproof");
pipeWaterproof.setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
LanguageRegistry.addName(pipeWaterproof, "Pipe Waterproof");
LanguageRegistry.addName(pipeWaterproof, "Pipe Sealant");
CoreProxy.proxy.registerItem(pipeWaterproof);
genericPipeBlock = new BlockGenericPipe(genericPipeId.getInt());
CoreProxy.proxy.registerBlock(genericPipeBlock.setUnlocalizedName("pipeBlock"), ItemBlock.class);
// Fixing retro-compatiblity
pipeItemsWood = buildPipe(DefaultProps.PIPE_ITEMS_WOOD_ID, PipeItemsWood.class, "Wooden Transport Pipe", "plankWood", Block.glass, "plankWood");
pipeItemsEmerald = buildPipe(DefaultProps.PIPE_ITEMS_EMERALD_ID, PipeItemsEmerald.class, "Emerald Transport Pipe", Item.emerald, Block.glass, Item.emerald);
pipeItemsCobblestone = buildPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", Block.cobblestone, Block.glass, Block.cobblestone);
pipeItemsStone = buildPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", Block.stone, Block.glass, Block.stone);
pipeItemsCobblestone = buildPipe(DefaultProps.PIPE_ITEMS_COBBLESTONE_ID, PipeItemsCobblestone.class, "Cobblestone Transport Pipe", "cobblestone", Block.glass, "cobblestone");
pipeItemsStone = buildPipe(DefaultProps.PIPE_ITEMS_STONE_ID, PipeItemsStone.class, "Stone Transport Pipe", "stone", Block.glass, "stone");
pipeItemsQuartz = buildPipe(DefaultProps.PIPE_ITEMS_QUARTZ_ID, PipeItemsQuartz.class, "Quartz Transport Pipe", Block.blockNetherQuartz, Block.glass, Block.blockNetherQuartz);
pipeItemsIron = buildPipe(DefaultProps.PIPE_ITEMS_IRON_ID, PipeItemsIron.class, "Iron Transport Pipe", Item.ingotIron, Block.glass, Item.ingotIron);
pipeItemsGold = buildPipe(DefaultProps.PIPE_ITEMS_GOLD_ID, PipeItemsGold.class, "Golden Transport Pipe", Item.ingotGold, Block.glass, Item.ingotGold);
@ -298,12 +294,13 @@ public class BuildCraftTransport {
pipeFluidsSandstone = buildPipe(DefaultProps.PIPE_LIQUIDS_SANDSTONE_ID, PipeFluidsSandstone.class, "Sandstone Waterproof Pipe", pipeWaterproof, pipeItemsSandstone);
pipeFluidsVoid = buildPipe(DefaultProps.PIPE_LIQUIDS_VOID_ID, PipeFluidsVoid.class, "Void Waterproof Pipe", pipeWaterproof, pipeItemsVoid);
pipePowerWood = buildPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Conductive Pipe", Item.redstone, pipeItemsWood);
pipePowerCobblestone = buildPipe(DefaultProps.PIPE_POWER_COBBLESTONE_ID, PipePowerCobblestone.class, "Cobblestone Conductive Pipe", Item.redstone, pipeItemsCobblestone);
pipePowerStone = buildPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Conductive Pipe", Item.redstone, pipeItemsStone);
pipePowerQuartz = buildPipe(DefaultProps.PIPE_POWER_QUARTZ_ID, PipePowerQuartz.class, "Quartz Conductive Pipe", Item.redstone, pipeItemsQuartz);
pipePowerGold = buildPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Conductive Pipe", Item.redstone, pipeItemsGold);
pipePowerDiamond = buildPipe(DefaultProps.PIPE_POWER_DIAMOND_ID, PipePowerDiamond.class, "Diamond Conductive Pipe", Item.redstone, pipeItemsDiamond);
pipePowerWood = buildPipe(DefaultProps.PIPE_POWER_WOOD_ID, PipePowerWood.class, "Wooden Kinesis Pipe", Item.redstone, pipeItemsWood);
pipePowerCobblestone = buildPipe(DefaultProps.PIPE_POWER_COBBLESTONE_ID, PipePowerCobblestone.class, "Cobblestone Kinesis Pipe", Item.redstone, pipeItemsCobblestone);
pipePowerStone = buildPipe(DefaultProps.PIPE_POWER_STONE_ID, PipePowerStone.class, "Stone Kinesis Pipe", Item.redstone, pipeItemsStone);
pipePowerQuartz = buildPipe(DefaultProps.PIPE_POWER_QUARTZ_ID, PipePowerQuartz.class, "Quartz Kinesis Pipe", Item.redstone, pipeItemsQuartz);
pipePowerIron = buildPipe(DefaultProps.PIPE_POWER_IRON_ID, PipePowerIron.class, "Iron Kinesis Pipe", Item.redstone, pipeItemsIron);
pipePowerGold = buildPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Kinesis Pipe", Item.redstone, pipeItemsGold);
pipePowerDiamond = buildPipe(DefaultProps.PIPE_POWER_DIAMOND_ID, PipePowerDiamond.class, "Diamond Kinesis Pipe", Item.redstone, pipeItemsDiamond);
pipeStructureCobblestone = buildPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class, "Cobblestone Structure Pipe", Block.gravel, pipeItemsCobblestone);
@ -312,49 +309,57 @@ public class BuildCraftTransport {
// 1, 0), Block.glass, new ItemStack(Item.dyePowder, 1, 11));
Property redPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "redPipeWire.id", DefaultProps.RED_PIPE_WIRE);
redPipeWire = new ItemBuildCraft(redPipeWireId.getInt());
redPipeWire = new ItemBuildCraft(redPipeWireId.getInt()).setPassSneakClick(true);
redPipeWire.setUnlocalizedName("redPipeWire");
LanguageRegistry.addName(redPipeWire, "Red Pipe Wire");
CoreProxy.proxy.registerItem(redPipeWire);
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[]{new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1)}, 500, new ItemStack(redPipeWire, 8)));
Property bluePipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "bluePipeWire.id", DefaultProps.BLUE_PIPE_WIRE);
bluePipeWire = new ItemBuildCraft(bluePipeWireId.getInt());
bluePipeWire = new ItemBuildCraft(bluePipeWireId.getInt()).setPassSneakClick(true);
bluePipeWire.setUnlocalizedName("bluePipeWire");
LanguageRegistry.addName(bluePipeWire, "Blue Pipe Wire");
CoreProxy.proxy.registerItem(bluePipeWire);
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[]{new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1)}, 500, new ItemStack(bluePipeWire, 8)));
Property greenPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "greenPipeWire.id", DefaultProps.GREEN_PIPE_WIRE);
greenPipeWire = new ItemBuildCraft(greenPipeWireId.getInt());
greenPipeWire = new ItemBuildCraft(greenPipeWireId.getInt()).setPassSneakClick(true);
greenPipeWire.setUnlocalizedName("greenPipeWire");
LanguageRegistry.addName(greenPipeWire, "Green Pipe Wire");
CoreProxy.proxy.registerItem(greenPipeWire);
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[]{new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1)}, 500, new ItemStack(greenPipeWire, 8)));
Property yellowPipeWireId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "yellowPipeWire.id", DefaultProps.YELLOW_PIPE_WIRE);
yellowPipeWire = new ItemBuildCraft(yellowPipeWireId.getInt());
yellowPipeWire = new ItemBuildCraft(yellowPipeWireId.getInt()).setPassSneakClick(true);
yellowPipeWire.setUnlocalizedName("yellowPipeWire");
LanguageRegistry.addName(yellowPipeWire, "Yellow Pipe Wire");
CoreProxy.proxy.registerItem(yellowPipeWire);
AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[]{new ItemStack(Item.dyePowder, 1, 11), new ItemStack(Item.redstone, 1),
new ItemStack(Item.ingotIron, 1)}, 500, new ItemStack(yellowPipeWire, 8)));
Property pipeGateId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGate.id", DefaultProps.GATE_ID);
pipeGate = new ItemGate(pipeGateId.getInt(), 0);
pipeGate.setUnlocalizedName("pipeGate");
CoreProxy.proxy.registerItem(pipeGate);
Property pipeGateAutarchicId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeGateAutarchic.id",
DefaultProps.GATE_AUTARCHIC_ID);
pipeGateAutarchic = new ItemGate(pipeGateAutarchicId.getInt(), 1);
pipeGateAutarchic.setUnlocalizedName("pipeGateAutarchic");
CoreProxy.proxy.registerItem(pipeGateAutarchic);
Property pipeFacadeId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipeFacade.id", DefaultProps.PIPE_FACADE_ID);
facadeItem = new ItemFacade(pipeFacadeId.getInt());
facadeItem.setUnlocalizedName("pipeFacade");
CoreProxy.proxy.registerItem(facadeItem);
Property pipePlugId = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_ITEM, "pipePlug.id", DefaultProps.PIPE_PLUG_ID);
plugItem = new ItemPlug(pipePlugId.getInt());
plugItem.setUnlocalizedName("pipePlug");
CoreProxy.proxy.registerItem(plugItem);
Property filteredBufferId = BuildCraftCore.mainConfiguration.getBlock("filteredBuffer.id", DefaultProps.FILTERED_BUFFER_ID);
filteredBufferBlock = new BlockFilteredBuffer(filteredBufferId.getInt());
@ -417,6 +422,10 @@ public class BuildCraftTransport {
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
actionPipeDirection[direction.ordinal()] = new ActionPipeDirection(-1, direction);
}
for (PowerMode limit : PowerMode.VALUES) {
actionPowerLimiter[limit.ordinal()] = new ActionPowerLimiter(-1, limit);
}
}
public void loadRecipes() {
@ -427,15 +436,15 @@ public class BuildCraftTransport {
// Add pipe recipes
for (PipeRecipe pipe : pipeRecipes) {
if (pipe.isShapeless) {
GameRegistry.addShapelessRecipe(pipe.result, pipe.input);
CoreProxy.proxy.addShapelessRecipe(pipe.result, pipe.input);
} else {
CoreProxy.proxy.addCraftingRecipe(pipe.result, pipe.input);
}
}
CoreProxy.proxy.addCraftingRecipe(new ItemStack(filteredBufferBlock, 1),
new Object[]{"wdw", "wcw", "wpw", Character.valueOf('w'), "plankWood", Character.valueOf('d'),
BuildCraftTransport.pipeItemsDiamond, Character.valueOf('c'), Block.chest, Character.valueOf('p'),
new Object[]{"wdw", "wcw", "wpw", 'w', "plankWood", 'd',
BuildCraftTransport.pipeItemsDiamond, 'c', Block.chest, 'p',
Block.pistonBase});
//Facade turning helper
@ -443,26 +452,8 @@ public class BuildCraftTransport {
}
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event) {
Splitter splitter = Splitter.on("@").trimResults();
for (IMCMessage m : event.getMessages()) {
if ("add-facade".equals(m.key)) {
String[] array = Iterables.toArray(splitter.split(m.getStringValue()), String.class);
if (array.length != 2) {
Logger.getLogger("Buildcraft").log(Level.INFO,
String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
continue;
}
Integer blId = Ints.tryParse(array[0]);
Integer metaId = Ints.tryParse(array[1]);
if (blId == null || metaId == null) {
Logger.getLogger("Buildcraft").log(Level.INFO,
String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
continue;
}
ItemFacade.addFacade(new ItemStack(blId, 1, metaId));
}
}
public void processIMCRequests(IMCEvent event) {
InterModComms.processIMC(event);
}
public static Item buildPipe(int defaultID, Class<? extends Pipe> clas, String descr, Object... ingredients) {
@ -480,7 +471,7 @@ public class BuildCraftTransport {
if (ingredients.length == 3) {
recipe.result = new ItemStack(res, 8);
recipe.input = new Object[]{"ABC", Character.valueOf('A'), ingredients[0], Character.valueOf('B'), ingredients[1], Character.valueOf('C'), ingredients[2]};
recipe.input = new Object[]{"ABC", 'A', ingredients[0], 'B', ingredients[1], 'C', ingredients[2]};
pipeRecipes.add(recipe);
} else if (ingredients.length == 2) {

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|blueprints")
package buildcraft.api.blueprints;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|blueprints",provides="BuildCraftAPI|bptblocks")
package buildcraft.api.bptblocks;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraft|Core",provides="BuildCraftAPI|core")
package buildcraft.api.core;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|filler")
package buildcraft.api.filler;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|fuels")
package buildcraft.api.fuels;
import cpw.mods.fml.common.API;

View file

@ -19,12 +19,12 @@ public class ActionManager {
triggerProviders.add(provider);
}
}
public static void registerTrigger(ITrigger trigger){
public static void registerTrigger(ITrigger trigger) {
triggers.put(trigger.getUniqueTag(), trigger);
}
public static void registerAction(IAction action){
public static void registerAction(IAction action) {
actions.put(action.getUniqueTag(), action);
}
@ -52,6 +52,7 @@ public class ActionManager {
}
}
//TODO: Use sets not lists
public static LinkedList<IAction> getNeighborActions(Block block, TileEntity entity) {
LinkedList<IAction> actions = new LinkedList<IAction>();
@ -87,18 +88,18 @@ public class ActionManager {
return triggers;
}
public static ITrigger getTriggerFromLegacyId(int legacyId){
for(ITrigger trigger : triggers.values()){
if(trigger.getLegacyId() == legacyId)
public static ITrigger getTriggerFromLegacyId(int legacyId) {
for (ITrigger trigger : triggers.values()) {
if (trigger.getLegacyId() == legacyId)
return trigger;
}
return null;
}
public static IAction getActionFromLegacyId(int legacyId){
for(IAction action : actions.values()){
if(action.getLegacyId() == legacyId)
public static IAction getActionFromLegacyId(int legacyId) {
for (IAction action : actions.values()) {
if (action.getLegacyId() == legacyId)
return action;
}
return null;

View file

@ -28,6 +28,11 @@ public interface ITrigger {
*/
boolean hasParameter();
/**
* Return true if this trigger requires a parameter
*/
boolean requiresParameter();
/**
* Return the trigger description in the UI
*/

View file

@ -13,6 +13,7 @@ public interface ITriggerParameter {
public abstract void readFromNBT(NBTTagCompound compound);
@Deprecated
public abstract ItemStack getItem();
}

View file

@ -66,12 +66,8 @@ public class TriggerParameter implements ITriggerParameter {
}
}
/*
* (non-Javadoc)
*
* @see net.minecraft.src.buildcraft.api.gates.ITriggerParameter#getItem()
*/
@Override
@Deprecated
public ItemStack getItem() {
return stack;
}

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|gates")
package buildcraft.api.gates;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|inventory")
package buildcraft.api.inventory;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraft|Core",provides="BuildCraftAPI|core")
package buildcraft.api;
import cpw.mods.fml.common.API;

View file

@ -7,7 +7,6 @@
*/
package buildcraft.api.power;
import buildcraft.api.power.PowerHandler.PowerReceiver;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
@ -31,7 +30,7 @@ public interface IPowerReceptor {
* @param side
* @return
*/
public PowerReceiver getPowerReceiver(ForgeDirection side);
public PowerHandler.PowerReceiver getPowerReceiver(ForgeDirection side);
/**
* Call back from the PowerHandler that is called when the stored power

View file

@ -11,6 +11,24 @@ import buildcraft.api.core.SafeTimeTracker;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.ForgeDirection;
/**
* The PowerHandler is similar to FluidTank in that it holds your power and
* allows standardized interaction between machines.
*
* To receive power to your machine you needs create an instance of PowerHandler
* and implement IPowerReceptor on the TileEntity.
*
* If you plan emit power, you need only implement IPowerEmitter. You do not
* need a PowerHandler. Engines have a PowerHandler because they can also
* receive power from other Engines.
*
* See TileRefinery for a simple example of a power using machine.
*
* @see IPowerReceptor
* @see IPowerEmitter
*
* @author CovertJaguar <http://www.railcraft.info/>
*/
public final class PowerHandler {
public static enum Type {
@ -23,7 +41,7 @@ public final class PowerHandler {
case STORAGE:
return true;
default:
return false;
return false;
}
}
@ -33,11 +51,16 @@ public final class PowerHandler {
case STORAGE:
return true;
default:
return false;
return false;
}
}
}
/**
* Extend this class to create custom Perdition algorithms (its not final).
*
* NOTE: It is not possible to create a Zero perdition algorithm.
*/
public static class PerditionCalculator {
public static final float DEFAULT_POWERLOSS = 1F;
@ -48,6 +71,11 @@ public final class PowerHandler {
powerLoss = DEFAULT_POWERLOSS;
}
/**
* Simple constructor for simple Perdition per tick.
*
* @param powerLoss power loss per tick
*/
public PerditionCalculator(float powerLoss) {
if (powerLoss < MIN_POWERLOSS) {
powerLoss = MIN_POWERLOSS;
@ -66,12 +94,25 @@ public final class PowerHandler {
* @return
*/
public float applyPerdition(PowerHandler powerHandler, float current, long ticksPassed) {
// float prev = current;
current -= powerLoss * ticksPassed;
if (current < 0) {
current = 0;
}
// powerHandler.totalLostPower += prev - current;
return current;
}
/**
* Taxes a flat rate on all incoming power.
*
* Defaults to 0% tax rate.
*
* @return percent of input to tax
*/
public float getTaxPercent() {
return 0;
}
}
public static final PerditionCalculator DEFAULT_PERDITION = new PerditionCalculator();
private float minEnergyReceived;
@ -87,6 +128,11 @@ public final class PowerHandler {
private PerditionCalculator perdition;
private final PowerReceiver receiver;
private final Type type;
// Debug
// private double totalLostPower = 0;
// private double totalReceivedPower = 0;
// private double totalUsedPower = 0;
// private long startTime = -1;
public PowerHandler(IPowerReceptor receptor, Type type) {
this.receptor = receptor;
@ -147,6 +193,16 @@ public final class PowerHandler {
this.activationEnergy = activationEnergy;
}
/**
* Allows you define perdition in terms of loss/ticks.
*
* This function is mostly for legacy implementations. See
* PerditionCalculator for more complex perdition formulas.
*
* @param powerLoss
* @param powerLossRegularity
* @see PerditionCalculator
*/
public void configurePowerPerdition(int powerLoss, int powerLossRegularity) {
if (powerLoss == 0 || powerLossRegularity == 0) {
perdition = new PerditionCalculator(0);
@ -186,6 +242,13 @@ public final class PowerHandler {
* design around this though if you are aware of the limitations.
*/
public void update() {
// if (startTime == -1)
// startTime = receptor.getWorld().getTotalWorldTime();
// else {
// long duration = receptor.getWorld().getTotalWorldTime() - startTime;
// System.out.printf("Power Stats: %s - Stored: %.2f Gained: %.2f - %.2f/t Lost: %.2f - %.2f/t Used: %.2f - %.2f/t%n", receptor.getClass().getSimpleName(), energyStored, totalReceivedPower, totalReceivedPower / duration, totalLostPower, totalLostPower / duration, totalUsedPower, totalUsedPower / duration);
// }
applyPerdition();
applyWork();
validateEnergy();
@ -254,6 +317,9 @@ public final class PowerHandler {
validateEnergy();
// if (doUse)
// totalUsedPower += result;
return result;
}
@ -322,6 +388,8 @@ public final class PowerHandler {
/**
* Add power to the PowerReceiver from an external source.
*
* IPowerEmitters are responsible for calling this themselves.
*
* @param quantity
* @param from
* @return the amount of power used
@ -338,14 +406,18 @@ public final class PowerHandler {
updateSources(from);
used -= used * getPerdition().getTaxPercent();
used = addEnergy(used);
applyWork();
if (source == Type.ENGINE && type.eatsEngineExcess()) {
return Math.min(quantity, maxEnergyReceived);
used = Math.min(quantity, maxEnergyReceived);
}
// totalReceivedPower += used;
return used;
}
}

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|power")
package buildcraft.api.power;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|recipes")
package buildcraft.api.recipes;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|tools")
package buildcraft.api.tools;
import cpw.mods.fml.common.API;

View file

@ -0,0 +1,3 @@
@API(apiVersion="1.0",owner="BuildCraftAPI|core",provides="BuildCraftAPI|transport")
package buildcraft.api.transport;
import cpw.mods.fml.common.API;

View file

@ -41,8 +41,8 @@ public class BlockArchitect extends BlockContainer {
public BlockArchitect(int i) {
super(i, Material.iron);
setHardness(0.5F);
//setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setHardness(5F);
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@Override

View file

@ -32,8 +32,8 @@ public class BlockBlueprintLibrary extends BlockContainer {
public BlockBlueprintLibrary(int i) {
super(i, Material.wood);
//setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setHardness(0.7F);
//setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
setHardness(5F);
}
@Override

View file

@ -37,8 +37,8 @@ public class BlockBuilder extends BlockContainer {
public BlockBuilder(int i) {
super(i, Material.iron);
setHardness(0.7F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setHardness(5F);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@Override

View file

@ -38,8 +38,8 @@ public class BlockFiller extends BlockContainer {
public BlockFiller(int i) {
super(i, Material.iron);
setHardness(0.5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setHardness(5F);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@Override

View file

@ -31,7 +31,7 @@ public class BlockMarker extends BlockContainer {
super(i, Material.circuits);
setLightValue(0.5F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
private AxisAlignedBB getBoundingBox(int meta) {

View file

@ -27,7 +27,7 @@ public abstract class ItemBptBase extends ItemBuildCraft {
super(i);
maxStackSize = 1;
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@SuppressWarnings({ "all" })

View file

@ -10,6 +10,7 @@ package buildcraft.builders.blueprints;
import buildcraft.BuildCraftCore;
import buildcraft.api.builder.BlockHandler;
import buildcraft.core.inventory.StackHelper;
import buildcraft.core.utils.BCLog;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
@ -78,8 +79,8 @@ public class Blueprint {
setSchematic(x, y, z, schematic);
}
} catch (Throwable error) {
BuildCraftCore.bcLog.severe(String.format("Error while trying to save block [%s:%d] to blueprint, skipping.", block.getUnlocalizedName(), block.blockID));
BuildCraftCore.bcLog.throwing(getClass().getCanonicalName(), "setBlock", error);
BCLog.logger.severe(String.format("Error while trying to save block [%s:%d] to blueprint, skipping.", block.getUnlocalizedName(), block.blockID));
BCLog.logger.throwing(getClass().getCanonicalName(), "setBlock", error);
}
}
@ -94,8 +95,8 @@ public class Blueprint {
setSchematic(x, y, z, schematic);
}
} catch (Throwable error) {
BuildCraftCore.bcLog.severe(String.format("Error while trying to save item [%s:%d] to blueprint, skipping.", item.getItem().getUnlocalizedName(), item.itemID));
BuildCraftCore.bcLog.throwing(getClass().getCanonicalName(), "setBlock", error);
BCLog.logger.severe(String.format("Error while trying to save item [%s:%d] to blueprint, skipping.", item.getItem().getUnlocalizedName(), item.itemID));
BCLog.logger.throwing(getClass().getCanonicalName(), "setBlock", error);
}
}

View file

@ -106,7 +106,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_110577_a(TEXTURE);
mc.renderEngine.bindTexture(TEXTURE);
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;

View file

@ -64,10 +64,10 @@ public class GuiBuilder extends GuiAdvancedInterface {
int realXSize = 0;
if (builder.isBuildingBlueprint()) {
mc.renderEngine.func_110577_a(BLUEPRINT_TEXTURE);
mc.renderEngine.bindTexture(BLUEPRINT_TEXTURE);
realXSize = 256;
} else {
mc.renderEngine.func_110577_a(TEXTURE);
mc.renderEngine.bindTexture(TEXTURE);
realXSize = 176;
}

View file

@ -19,7 +19,7 @@ import org.lwjgl.opengl.GL11;
public class GuiFiller extends GuiBuildCraft {
private static final ResourceLocation TEXTURE = new ResourceLocation("buildcraft", DefaultProps.TEXTURE_PATH_GUI + "/filler.png");
private static final ResourceLocation BLOCK_TEXTURE = TextureMap.field_110575_b;
private static final ResourceLocation BLOCK_TEXTURE = TextureMap.locationBlocksTexture;
IInventory playerInventory;
TileFiller filler;
@ -47,12 +47,12 @@ public class GuiFiller extends GuiBuildCraft {
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_110577_a(TEXTURE);
mc.renderEngine.bindTexture(TEXTURE);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (filler.currentPattern != null) {
mc.renderEngine.func_110577_a(BLOCK_TEXTURE);
mc.renderEngine.bindTexture(BLOCK_TEXTURE);
drawTexturedModelRectFromIcon(guiLeft + patternSymbolX, guiTop + patternSymbolY, filler.currentPattern.getTexture(), 16, 16);
}

View file

@ -52,7 +52,7 @@ public class GuiTemplate extends GuiBuildCraft {
@Override
protected void drawGuiContainerBackgroundLayer(float f, int x, int y) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
mc.renderEngine.func_110577_a(TEXTURE);
mc.renderEngine.bindTexture(TEXTURE);
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);

View file

@ -14,7 +14,7 @@ public abstract class BlockBuildCraft extends BlockContainer {
protected BlockBuildCraft(int id, Material material) {
super(id, material);
this.rand = new Random();
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@Override

View file

@ -45,7 +45,7 @@ public class BlockSpring extends Block {
setStepSound(soundStoneFootstep);
disableStats();
setTickRandomly(true);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@Override
@ -92,6 +92,12 @@ public class BlockSpring extends Block {
world.setBlock(x, y + 1, z, spring.liquidBlock.blockID);
}
// Prevents updates on chunk generation
@Override
public boolean func_82506_l() {
return false;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {

View file

@ -46,9 +46,9 @@ public class CommandBuildCraft extends CommandBase {
commandVersion(sender, arguments);
return;
} else if (arguments[0].matches("help")) {
sender.sendChatToPlayer(ChatMessageComponent.func_111066_d("Format: '" + this.getCommandName() + " <command> <arguments>'"));
sender.sendChatToPlayer(ChatMessageComponent.func_111066_d("Available commands:"));
sender.sendChatToPlayer(ChatMessageComponent.func_111066_d("- version : Version information."));
sender.sendChatToPlayer(ChatMessageComponent.createFromText("Format: '" + this.getCommandName() + " <command> <arguments>'"));
sender.sendChatToPlayer(ChatMessageComponent.createFromText("Available commands:"));
sender.sendChatToPlayer(ChatMessageComponent.createFromText("- version : Version information."));
return;
}
@ -58,11 +58,11 @@ public class CommandBuildCraft extends CommandBase {
private void commandVersion(ICommandSender sender, String[] arguments) {
String colour = Version.isOutdated() ? "\u00A7c" : "\u00A7a";
sender.sendChatToPlayer(ChatMessageComponent.func_111066_d(String.format(colour + "BuildCraft %s for Minecraft %s (Latest: %s).", Version.getVersion(),
sender.sendChatToPlayer(ChatMessageComponent.createFromText(String.format(colour + "BuildCraft %s for Minecraft %s (Latest: %s).", Version.getVersion(),
CoreProxy.proxy.getMinecraftVersion(), Version.getRecommendedVersion())));
if (Version.isOutdated()) {
for (String updateLine : Version.getChangelog()) {
sender.sendChatToPlayer(ChatMessageComponent.func_111066_d("\u00A79" + updateLine));
sender.sendChatToPlayer(ChatMessageComponent.createFromText("\u00A79" + updateLine));
}
}
}

View file

@ -0,0 +1,19 @@
/*
* Copyright (c) SpaceToad, 2011-2012
* 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;
/**
*
* @author CovertJaguar <http://www.railcraft.info/>
*/
public class CoreConstants {
public static final float PIPE_MIN_POS = 0.25F;
public static final float PIPE_MAX_POS = 0.75F;
}

View file

@ -1,24 +1,59 @@
package buildcraft.core;
import buildcraft.BuildCraftCore;
import buildcraft.core.utils.Localization;
import buildcraft.transport.ItemFacade;
import java.util.Locale;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class CreativeTabBuildCraft extends CreativeTabs {
public enum CreativeTabBuildCraft {
public static final CreativeTabs tabBuildCraft = new CreativeTabBuildCraft("buildcraft");
public CreativeTabBuildCraft(String label) {
super(label);
MACHINES,
FACADES;
private final CreativeTabs tab;
private CreativeTabBuildCraft() {
tab = new Tab();
}
@Override
public ItemStack getIconItemStack() {
return new ItemStack(BuildCraftCore.diamondGearItem);
public CreativeTabs get() {
return tab;
}
@Override
public String getTranslatedTabLabel() {
return "BuildCraft";
private String getLabel() {
return "buildcraft." + name().toLowerCase(Locale.ENGLISH);
}
private String translate() {
return Localization.get("tab." + name().toLowerCase(Locale.ENGLISH));
}
private ItemStack getItem() {
switch (this) {
case FACADES:
return ItemFacade.getStack(Block.stoneBrick, 0);
default:
return new ItemStack(BuildCraftCore.diamondGearItem);
}
}
private class Tab extends CreativeTabs {
private Tab() {
super(getLabel());
}
@Override
public ItemStack getIconItemStack() {
return getItem();
}
@Override
public String getTranslatedTabLabel() {
return translate();
}
}
}

View file

@ -127,6 +127,7 @@ public class DefaultProps {
public static final int FILLER_LIFESPAN_TOUGH = 20;
public static final int FILLER_LIFESPAN_NORMAL = 6000;
// These are only till here for Legacy support, new Triggers/Action don't need them
public static int TRIGGER_REDSTONE_ACTIVE = 1;
public static int TRIGGER_REDSTONE_INACTIVE = 2;
public static int TRIGGER_MACHINE_ACTIVE = 3;
@ -157,9 +158,6 @@ public class DefaultProps {
public static int TRIGGER_RED_ENGINE_HEAT = 28;
public static int TRIGGER_PIPE_REQUESTS_ENERGY = 29;
public static int TRIGGER_PIPE_TOO_MUCH_ENERGY = 30;
public static int TRIGGER_INVENTORY_LEVEL_BELOW25 = 31;
public static int TRIGGER_INVENTORY_LEVEL_BELOW50 = 32;
public static int TRIGGER_INVENTORY_LEVEL_BELOW75 = 33;
public static int ACTION_REDSTONE = 1;
public static int ACTION_RED_SIGNAL = 2;

View file

@ -7,10 +7,13 @@
*/
package buildcraft.core;
import buildcraft.BuildCraftCore;
import buildcraft.builders.blueprints.BlueprintBuilder.SchematicBuilder;
import buildcraft.api.core.Position;
import buildcraft.builders.blueprints.BlueprintBuilder.SchematicBuilder;
import buildcraft.core.blueprints.BptSlot.Mode;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BCLog;
import buildcraft.core.utils.BlockUtil;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput;
@ -182,6 +185,7 @@ public class EntityRobot extends Entity implements IEntityAdditionalSpawnData {
targets.pop();
} else if (BlockUtil.canChangeBlock(worldObj, target.getX(), target.getY(), target.getZ())) {
//System.out.printf("RobotChanging %d %d %d %s\n",target.x, target.y, target.z, target.mode);
if (!worldObj.isAirBlock(target.getX(), target.getY(), target.getZ())) {
BlockUtil.breakBlock(worldObj, target.getX(), target.getY(), target.getZ());
} else {
@ -193,7 +197,7 @@ public class EntityRobot extends Entity implements IEntityAdditionalSpawnData {
targets.pop();
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("EntityRobot", "update", t);
BCLog.logger.throwing("EntityRobot", "update", t);
}
if (!target.isComplete()) {
targets.addLast(target);

View file

@ -0,0 +1,87 @@
/**
* BuildCraft is open-source. It is distributed under the terms of the
* BuildCraft Open Source License. It grants rights to read, modify, compile or
* run the code. It does *NOT* grant the right to redistribute this software or
* its modifications in any form, binary or source, except if expressively
* granted by the copyright holder.
*/
package buildcraft.core;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import buildcraft.energy.worldgen.OilPopulate;
import buildcraft.transport.ItemFacade;
import com.google.common.base.Splitter;
import com.google.common.collect.Iterables;
import com.google.common.primitives.Ints;
import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
public class InterModComms {
public static void processIMC(IMCEvent event) {
for (IMCMessage m : event.getMessages()) {
if ("add-facade".equals(m.key)) {
processFacadeIMC(event, m);
} else if (m.key.equals("oil-lake-biome")) {
processOilLakeBiomeIMC(event, m);
} else if (m.key.equals("oil-gen-exclude")) {
processOilGenExcludeIMC(event, m);
}
}
}
public static void processFacadeIMC(IMCEvent event, IMCMessage m) {
try {
Splitter splitter = Splitter.on("@").trimResults();
String[] array = Iterables.toArray(splitter.split(m.getStringValue()), String.class);
if (array.length != 2) {
Logger.getLogger("Buildcraft").log(Level.INFO, String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
} else {
Integer blId = Ints.tryParse(array[0]);
Integer metaId = Ints.tryParse(array[1]);
if (blId == null || metaId == null) {
Logger.getLogger("Buildcraft").log(Level.INFO, String.format("Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender()));
} else {
ItemFacade.addFacade(new ItemStack(blId, 1, metaId));
}
}
} catch (Exception ex) {
}
}
public static void processOilLakeBiomeIMC(IMCEvent event, IMCMessage m) {
try {
String biomeID = m.getStringValue().trim();
int id = Integer.valueOf(biomeID);
if (id >= BiomeGenBase.biomeList.length) {
throw new IllegalArgumentException("Biome ID must be less than " + BiomeGenBase.biomeList.length);
}
OilPopulate.INSTANCE.surfaceDepositBiomes.add(id);
} catch (Exception ex) {
Logger.getLogger("Buildcraft").log(Level.WARNING, String.format("Received an invalid oil-lake-biome request %s from mod %s", m.getStringValue(), m.getSender()));
}
Logger.getLogger("Buildcraft").log(Level.INFO, String.format("Received an successfull oil-lake-biome request %s from mod %s", m.getStringValue(), m.getSender()));
}
public static void processOilGenExcludeIMC(IMCEvent event, IMCMessage m) {
try {
String biomeID = m.getStringValue().trim();
int id = Integer.valueOf(biomeID);
if (id >= BiomeGenBase.biomeList.length) {
throw new IllegalArgumentException("Biome ID must be less than " + BiomeGenBase.biomeList.length);
}
OilPopulate.INSTANCE.excludedBiomes.add(id);
} catch (Exception ex) {
Logger.getLogger("Buildcraft").log(Level.WARNING, String.format("Received an invalid oil-gen-exclude request %s from mod %s", m.getStringValue(), m.getSender()));
}
Logger.getLogger("Buildcraft").log(Level.INFO, String.format("Received an successfull oil-gen-exclude request %s from mod %s", m.getStringValue(), m.getSender()));
}
}

View file

@ -1,12 +1,10 @@
/**
* Copyright (c) SpaceToad, 2011
* http://www.mod-buildcraft.com
* Copyright (c) SpaceToad, 2011 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
* 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 buildcraft.core.utils.StringUtils;
@ -15,13 +13,16 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class ItemBuildCraft extends Item {
private String iconName;
private boolean passSneakClick = false;
public ItemBuildCraft(int i) {
super(i);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
}
@Override
@ -36,9 +37,18 @@ public class ItemBuildCraft extends Item {
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
this.itemIcon = par1IconRegister.registerIcon("buildcraft:" + iconName);
}
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister) {
this.itemIcon = par1IconRegister.registerIcon("buildcraft:" + iconName);
}
public Item setPassSneakClick(boolean passClick) {
this.passSneakClick = passClick;
return this;
}
@Override
public boolean shouldPassSneakingClickToBlock(World par2World, int par4, int par5, int par6) {
return passSneakClick;
}
}

View file

@ -1,5 +1,6 @@
package buildcraft.core;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
@ -10,8 +11,8 @@ import net.minecraft.util.Icon;
public class ItemRedstoneChipset extends ItemBuildCraft {
@SideOnly(Side.CLIENT)
private Icon[] icons;
@SideOnly(Side.CLIENT)
private Icon[] icons;
public ItemRedstoneChipset(int i) {
super(i);
@ -20,10 +21,10 @@ public class ItemRedstoneChipset extends ItemBuildCraft {
setMaxDamage(0);
}
@SuppressWarnings({ "all" })
@SuppressWarnings({"all"})
@Override
public Icon getIconFromDamage(int i) {
return i < icons.length ? icons[i] : null;
return i < icons.length ? icons[i] : null;
}
@Override
@ -31,7 +32,7 @@ public class ItemRedstoneChipset extends ItemBuildCraft {
return (new StringBuilder()).append(super.getUnlocalizedName()).append(".").append(itemstack.getItemDamage()).toString();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
@ -39,16 +40,21 @@ public class ItemRedstoneChipset extends ItemBuildCraft {
itemList.add(new ItemStack(this, 1, i));
}
}
private static String[] chipsetNames = {"redstone_red", "redstone_iron", "redstone_gold", "redstone_diamond", "redstone_pulsating"};
private static String[] chipsetNames = { "redstone_red", "redstone_iron", "redstone_gold", "redstone_diamond", "redstone_pulsating" };
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister par1IconRegister)
{
icons = new Icon[chipsetNames.length];
int i = 0;
for (String csName : chipsetNames) {
icons[i++] = par1IconRegister.registerIcon("buildcraft:"+csName+"_chipset");
}
public void registerIcons(IconRegister par1IconRegister) {
icons = new Icon[chipsetNames.length];
int i = 0;
for (String csName : chipsetNames) {
icons[i++] = par1IconRegister.registerIcon("buildcraft:" + csName + "_chipset");
}
}
public void registerItemStacks() {
for (int i = 0; i < 5; i++) {
GameRegistry.registerCustomItemStack(chipsetNames[i] + "_chipset", new ItemStack(this, 1, i));
}
}
}

View file

@ -5,6 +5,7 @@ import java.util.HashSet;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.block.BlockButton;
import net.minecraft.block.BlockChest;
import net.minecraft.block.BlockLever;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -20,6 +21,7 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench {
setFull3D();
shiftRotations.add(BlockLever.class);
shiftRotations.add(BlockButton.class);
shiftRotations.add(BlockChest.class);
}
private boolean isShiftRotation(Class<? extends Block> cls) {

View file

@ -2,6 +2,7 @@ package buildcraft.core;
import buildcraft.BuildCraftCore;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BCLog;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
@ -11,23 +12,20 @@ import net.minecraftforge.common.Property;
public class Version implements Runnable {
private static Version instance = new Version();
private static Version instance = new Version();
public enum EnumUpdateState {
CURRENT, OUTDATED, CONNECTION_ERROR
}
public static final String VERSION = "@VERSION@";
public static final String BUILD_NUMBER = "@BUILD_NUMBER@";
private static final String REMOTE_VERSION_FILE = "http://bit.ly/buildcraftver";
private static final String REMOTE_CHANGELOG_ROOT = "https://dl.dropbox.com/u/44760587/buildcraft/changelog/";
private static final String REMOTE_VERSION_FILE = "http://bit.ly/buildcraftversion";
private static final String REMOTE_CHANGELOG_ROOT = "https://dl.dropboxusercontent.com/u/38558957/Minecraft/Buildcraft/changelogs/";
public static EnumUpdateState currentVersion = EnumUpdateState.CURRENT;
public static final int FORGE_VERSION_MAJOR = 4;
public static final int FORGE_VERSION_MINOR = 0;
public static final int FORGE_VERSION_PATCH = 0;
private static String recommendedVersion;
private static String[] cachedChangelog;
@ -62,40 +60,38 @@ public class Version implements Runnable {
public static void versionCheck() {
try {
if ("0.0.0".equals(VERSION)) return;
if ("0.0.0".equals(VERSION))
return;
String location = REMOTE_VERSION_FILE;
HttpURLConnection conn = null;
while (location != null && !location.isEmpty()) {
URL url = new URL(location);
if(conn != null)
if (conn != null)
conn.disconnect();
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)");
conn.connect();
location = conn.getHeaderField("Location");
}
if(conn == null)
if (conn == null)
throw new NullPointerException();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
conn.disconnect();
String line = null;
String line;
String mcVersion = CoreProxy.proxy.getMinecraftVersion();
while ((line = reader.readLine()) != null) {
if (line.startsWith(mcVersion)) {
if (line.contains(DefaultProps.MOD)) {
String[] tokens = line.split(":");
recommendedVersion = tokens[2];
if (line.endsWith(VERSION)) {
BuildCraftCore.bcLog.finer("Using the latest version [" + getVersion() + "] for Minecraft " + mcVersion);
String[] tokens = line.split(":");
if (mcVersion.matches(tokens[0])) {
if (DefaultProps.MOD.matches(tokens[1])) {
if (VERSION.matches(tokens[2])) {
recommendedVersion = tokens[2];
BCLog.logger.finer("Using the latest version [" + getVersion() + "] for Minecraft " + mcVersion);
currentVersion = EnumUpdateState.CURRENT;
return;
}
@ -103,13 +99,15 @@ public class Version implements Runnable {
}
}
BuildCraftCore.bcLog.warning("Using outdated version [" + VERSION + " (build:" + BUILD_NUMBER + ")] for Minecraft " + mcVersion
BCLog.logger.warning("Using outdated version [" + VERSION + " (build:" + BUILD_NUMBER + ")] for Minecraft " + mcVersion
+ ". Consider updating.");
currentVersion = EnumUpdateState.OUTDATED;
conn.disconnect();
reader.close();
} catch (Exception e) {
BuildCraftCore.bcLog.warning("Unable to read from remote version authority.");
BuildCraftCore.bcLog.warning(e.toString());
BCLog.logger.warning("Unable to read from remote version authority.");
BCLog.logger.warning(e.toString());
currentVersion = EnumUpdateState.CONNECTION_ERROR;
}
}
@ -130,20 +128,20 @@ public class Version implements Runnable {
HttpURLConnection conn = null;
while (location != null && !location.isEmpty()) {
URL url = new URL(location);
if(conn != null)
if (conn != null)
conn.disconnect();
conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent",
"Mozilla/5.0 (Windows; U; Windows NT 6.0; ru; rv:1.9.0.11) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)");
conn.connect();
location = conn.getHeaderField("Location");
}
if(conn == null)
if (conn == null)
throw new NullPointerException();
BufferedReader reader = new BufferedReader(new InputStreamReader(conn.getInputStream()));
conn.disconnect();
@ -164,44 +162,42 @@ public class Version implements Runnable {
} catch (Exception ex) {
ex.printStackTrace();
BuildCraftCore.bcLog.warning("Unable to read changelog from remote site.");
BCLog.logger.warning("Unable to read changelog from remote site.");
}
return new String[] { String.format("Unable to retrieve changelog for %s %s", DefaultProps.MOD, version) };
return new String[]{String.format("Unable to retrieve changelog for %s %s", DefaultProps.MOD, version)};
}
@Override
public void run() {
@Override
public void run() {
int count = 0;
currentVersion = null;
int count = 0;
currentVersion = null;
BuildCraftCore.bcLog.info("Beginning version check");
BCLog.logger.info("Beginning version check");
try {
while ((count < 3) && ((currentVersion == null) || (currentVersion == EnumUpdateState.CONNECTION_ERROR))) {
versionCheck();
count++;
try {
while ((count < 3) && ((currentVersion == null) || (currentVersion == EnumUpdateState.CONNECTION_ERROR))) {
versionCheck();
count++;
if (currentVersion == EnumUpdateState.CONNECTION_ERROR) {
BuildCraftCore.bcLog.info("Version check attempt " + count + " failed, trying again in 10 seconds");
Thread.sleep(10000);
}
}
}
catch (InterruptedException e) {
e.printStackTrace();
}
if (currentVersion == EnumUpdateState.CONNECTION_ERROR) {
BCLog.logger.info("Version check attempt " + count + " failed, trying again in 10 seconds");
Thread.sleep(10000);
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
if (currentVersion == EnumUpdateState.CONNECTION_ERROR) {
BuildCraftCore.bcLog.info("Version check failed");
}
if (currentVersion == EnumUpdateState.CONNECTION_ERROR) {
BCLog.logger.info("Version check failed");
}
}
}
public static void check() {
new Thread(instance).start();
}
public static void check() {
new Thread(instance).start();
}
}

View file

@ -13,6 +13,7 @@ import buildcraft.BuildCraftCore;
import buildcraft.core.Box;
import buildcraft.core.Version;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BCLog;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@ -81,7 +82,7 @@ public abstract class BptBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBase", "rotateLeft", t);
BCLog.logger.throwing("BptBase", "rotateLeft", t);
}
}
}

View file

@ -9,7 +9,6 @@
package buildcraft.core.blueprints;
import buildcraft.BuildCraftCore;
import buildcraft.api.blueprints.BlockSignature;
import buildcraft.api.blueprints.BlueprintManager;
import buildcraft.api.blueprints.BptBlock;
@ -17,6 +16,7 @@ import buildcraft.api.blueprints.BptSlotInfo;
import buildcraft.api.blueprints.IBptContext;
import buildcraft.api.blueprints.ItemSignature;
import buildcraft.core.IBptContributor;
import buildcraft.core.utils.BCLog;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
@ -76,7 +76,7 @@ public class BptBlueprint extends BptBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBlueprint", "readFromWorld", t);
BCLog.logger.throwing("BptBlueprint", "readFromWorld", t);
}
}

View file

@ -9,9 +9,9 @@
package buildcraft.core.blueprints;
import buildcraft.BuildCraftCore;
import buildcraft.core.IBuilderInventory;
import buildcraft.core.blueprints.BptSlot.Mode;
import buildcraft.core.utils.BCLog;
import buildcraft.core.utils.BlockUtil;
import java.util.Comparator;
import java.util.LinkedList;
@ -186,7 +186,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBuilderBlueprint", "internalGetBlock", t);
BCLog.logger.throwing("BptBuilderBlueprint", "internalGetBlock", t);
getNext = false;
}
@ -232,7 +232,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBuilderBlueprint", "checkRequirements", t);
BCLog.logger.throwing("BptBuilderBlueprint", "checkRequirements", t);
}
int size = inv.getSizeInventory();
@ -260,7 +260,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBuilderBlueprint", "checkRequirements", t);
BCLog.logger.throwing("BptBuilderBlueprint", "checkRequirements", t);
}
if (reqStk.stackSize == 0) {
@ -290,7 +290,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBuilderBlueprint", "useRequirements", t);
BCLog.logger.throwing("BptBuilderBlueprint", "useRequirements", t);
}
@ -319,7 +319,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBuilderBlueprint", "useRequirements", t);
BCLog.logger.throwing("BptBuilderBlueprint", "useRequirements", t);
}
if (invStk.stackSize == 0) {
@ -373,7 +373,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBuilderBlueprint", "recomputeIfNeeded", t);
BCLog.logger.throwing("BptBuilderBlueprint", "recomputeIfNeeded", t);
}
for (ItemStack stack : stacks) {
@ -429,7 +429,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BuildCraftCore.bcLog.throwing("BptBuilderBlueprint", "postProcessing", t);
BCLog.logger.throwing("BptBuilderBlueprint", "postProcessing", t);
}
}
}

View file

@ -9,7 +9,7 @@
package buildcraft.core.blueprints;
import buildcraft.BuildCraftCore;
import buildcraft.core.utils.BCLog;
public class BptError extends Exception {
@ -21,7 +21,7 @@ public class BptError extends Exception {
public BptError(String str) {
super(str);
BuildCraftCore.bcLog.fine("BLUEPRINT ERROR:" + str);
BCLog.logger.fine("BLUEPRINT ERROR:" + str);
}

View file

@ -8,6 +8,7 @@
*/
package buildcraft.core.fluids;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
@ -19,8 +20,8 @@ public class RestrictedTank extends Tank {
private final Fluid[] acceptedFluids;
public RestrictedTank(String name, int capacity, Fluid... acceptedFluids) {
super(name, capacity);
public RestrictedTank(String name, int capacity, TileEntity tile, Fluid... acceptedFluids) {
super(name, capacity, tile);
this.acceptedFluids = acceptedFluids;
}

View file

@ -9,10 +9,10 @@
package buildcraft.core.fluids;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.FluidTank;
/**
*
@ -22,8 +22,8 @@ public class SingleUseTank extends Tank {
private Fluid acceptedFluid;
public SingleUseTank(String name, int capacity) {
super(name, capacity);
public SingleUseTank(String name, int capacity, TileEntity tile) {
super(name, capacity, tile);
}
@Override
@ -50,17 +50,15 @@ public class SingleUseTank extends Tank {
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
public void writeTankToNBT(NBTTagCompound nbt) {
super.writeTankToNBT(nbt);
if (acceptedFluid != null)
nbt.setString("acceptedFluid", acceptedFluid.getName());
return nbt;
}
@Override
public FluidTank readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
public void readTankFromNBT(NBTTagCompound nbt) {
super.readTankFromNBT(nbt);
acceptedFluid = FluidRegistry.getFluid(nbt.getString("acceptedFluid"));
return this;
}
}

View file

@ -12,6 +12,7 @@ import buildcraft.core.gui.tooltips.ToolTip;
import buildcraft.core.gui.tooltips.ToolTipLine;
import java.util.Locale;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidTank;
@ -23,9 +24,10 @@ public class Tank extends FluidTank {
private final String name;
public Tank(String name, int capacity) {
public Tank(String name, int capacity, TileEntity tile) {
super(capacity);
this.name = name;
this.tile = tile;
}
public boolean isEmpty() {
@ -41,22 +43,30 @@ public class Tank extends FluidTank {
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
public final NBTTagCompound writeToNBT(NBTTagCompound nbt) {
NBTTagCompound tankData = new NBTTagCompound();
super.writeToNBT(tankData);
writeTankToNBT(tankData);
nbt.setCompoundTag(name, tankData);
return nbt;
}
@Override
public FluidTank readFromNBT(NBTTagCompound nbt) {
public final FluidTank readFromNBT(NBTTagCompound nbt) {
if (nbt.hasKey(name)) {
NBTTagCompound tankData = nbt.getCompoundTag(name);
super.readFromNBT(tankData);
readTankFromNBT(tankData);
}
return this;
}
public void writeTankToNBT(NBTTagCompound nbt) {
}
public void readTankFromNBT(NBTTagCompound nbt) {
}
public ToolTip getToolTip() {
return toolTip;
}

View file

@ -112,7 +112,7 @@ public class TankManager<T extends Tank> extends ForwardingList<T> implements IF
public void writeData(DataOutputStream data) throws IOException {
for (Tank tank : tanks) {
FluidStack fluidStack = tank.getFluid();
if (fluidStack != null) {
if (fluidStack != null && fluidStack.getFluid() != null) {
data.writeShort(fluidStack.getFluid().getID());
data.writeInt(fluidStack.amount);
} else {

View file

@ -36,7 +36,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
}
public ResourceLocation getTexture() {
return TextureMap.field_110576_c;
return TextureMap.locationItemsTexture;
}
public ItemStack getItemStack() {
@ -54,7 +54,7 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
if (getItemStack() != null) {
drawStack(getItemStack());
} else if (getIcon() != null) {
mc.renderEngine.func_110577_a(getTexture());
mc.renderEngine.bindTexture(getTexture());
//System.out.printf("Drawing advanced sprite %s (%d,%d) at %d %d\n", getIcon().getIconName(), getIcon().getOriginX(),getIcon().getOriginY(),cornerX + x, cornerY + y);
drawTexturedModelRectFromIcon(cornerX + x, cornerY + y, getIcon(), 16, 16);
}

View file

@ -2,7 +2,9 @@ package buildcraft.core.gui;
import buildcraft.core.DefaultProps;
import buildcraft.core.gui.buttons.GuiBetterButton;
import buildcraft.core.gui.slots.IPhantomSlot;
import buildcraft.core.gui.slots.SlotBase;
import buildcraft.core.gui.slots.SlotPhantom;
import buildcraft.core.gui.tooltips.ToolTip;
import buildcraft.core.gui.tooltips.ToolTipLine;
import buildcraft.core.utils.SessionVars;
@ -209,7 +211,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
GL11.glColor4f(colorR, colorG, colorB, 1.0F);
mc.renderEngine.func_110577_a(LEDGER_TEXTURE);
mc.renderEngine.bindTexture(LEDGER_TEXTURE);
drawTexturedModalRect(x, y, 0, 256 - currentHeight, 4, currentHeight);
drawTexturedModalRect(x + 4, y, 256 - currentWidth + 4, 0, currentWidth - 4, 4);
// Add in top left corner again
@ -335,6 +337,23 @@ public abstract class GuiBuildCraft extends GuiContainer {
ledgerManager.handleMouseClicked(par1, par2, mouseButton);
}
@Override
protected void mouseClickMove(int x, int y, int mouseButton, long time) {
Slot slot = getSlotAtPosition(x, y);
if (mouseButton == 1 && slot instanceof IPhantomSlot)
return;
super.mouseClickMove(x, y, mouseButton, time);
}
public Slot getSlotAtPosition(int x, int y) {
for (int slotIndex = 0; slotIndex < this.inventorySlots.inventorySlots.size(); ++slotIndex) {
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(slotIndex);
if (isMouseOverSlot(slot, x, y))
return slot;
}
return null;
}
private void drawToolTips(ToolTip toolTips, int mouseX, int mouseY) {
if (toolTips.size() > 0) {
int left = this.guiLeft;

View file

@ -57,7 +57,7 @@ public class GuiBetterButton extends GuiButton {
}
protected void bindButtonTextures(Minecraft minecraft) {
minecraft.renderEngine.func_110577_a(BUTTON_TEXTURES);
minecraft.renderEngine.bindTexture(BUTTON_TEXTURES);
}
@Override

View file

@ -1,13 +1,16 @@
package buildcraft.core.gui.buttons;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import org.lwjgl.opengl.GL11;
import buildcraft.core.gui.tooltips.ToolTip;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
/**
*
*
* @author CovertJaguar <railcraft.wikispaces.com>
*/
@SideOnly(Side.CLIENT)
@ -68,4 +71,13 @@ public class GuiMultiButton extends GuiBetterButton {
public MultiButtonController getController() {
return control;
}
@Override
public ToolTip getToolTip() {
ToolTip tip = this.control.getButtonState().getToolTip();
if (tip != null) {
return tip;
}
return super.getToolTip();
}
}

View file

@ -1,7 +1,9 @@
package buildcraft.core.gui.buttons;
import buildcraft.core.gui.tooltips.ToolTip;
/**
*
*
* @author CovertJaguar <railcraft.wikispaces.com>
*/
public interface IMultiButtonState {
@ -11,4 +13,6 @@ public interface IMultiButtonState {
public String name();
public IButtonTextureSet getTextureSet();
public ToolTip getToolTip();
}

View file

@ -1,13 +1,14 @@
package buildcraft.core.gui.buttons;
import buildcraft.core.gui.tooltips.ToolTip;
/**
*
*
* @author CovertJaguar <http://www.railcraft.info/>
*/
public enum LockButtonState implements IMultiButtonState {
UNLOCKED(new ButtonTextureSet(224, 0, 16, 16)),
LOCKED(new ButtonTextureSet(240, 0, 16, 16));
UNLOCKED(new ButtonTextureSet(224, 0, 16, 16)), LOCKED(new ButtonTextureSet(240, 0, 16, 16));
public static final LockButtonState[] VALUES = values();
private final IButtonTextureSet texture;
@ -24,4 +25,9 @@ public enum LockButtonState implements IMultiButtonState {
public IButtonTextureSet getTextureSet() {
return texture;
}
@Override
public ToolTip getToolTip() {
return null;
}
}

View file

@ -0,0 +1,20 @@
package buildcraft.core.network;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
/**
*
* @author CovertJaguar <railcraft.wikispaces.com>
*/
public abstract interface IGuiReturnHandler {
public World getWorld();
public void writeGuiData(DataOutputStream paramDataOutputStream) throws IOException;
public void readGuiData(DataInputStream paramDataInputStream, EntityPlayer paramEntityPlayer) throws IOException;
}

View file

@ -0,0 +1,89 @@
package buildcraft.core.network;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager;
import cpw.mods.fml.common.network.PacketDispatcher;
/**
*
* @author CovertJaguar <railcraft.wikispaces.com>
*/
public class PacketGuiReturn extends BuildCraftPacket {
private EntityPlayer sender;
private IGuiReturnHandler obj;
private byte[] extraData;
public PacketGuiReturn(EntityPlayer sender) {
this.sender = sender;
}
public PacketGuiReturn(IGuiReturnHandler obj) {
this.obj = obj;
this.extraData = null;
}
public PacketGuiReturn(IGuiReturnHandler obj, byte[] extraData) {
this.obj = obj;
this.extraData = extraData;
}
@Override
public void writeData(DataOutputStream data) throws IOException {
data.writeInt(obj.getWorld().provider.dimensionId);
if (obj instanceof TileEntity) {
TileEntity tile = (TileEntity) obj;
data.writeBoolean(true);
data.writeInt(tile.xCoord);
data.writeInt(tile.yCoord);
data.writeInt(tile.zCoord);
} else if (obj instanceof Entity) {
Entity entity = (Entity) obj;
data.writeBoolean(false);
data.writeInt(entity.entityId);
} else
return;
obj.writeGuiData(data);
if (extraData != null)
data.write(extraData);
}
@Override
public void readData(DataInputStream data) throws IOException {
int dim = data.readInt();
World world = DimensionManager.getWorld(dim);
boolean tileReturn = data.readBoolean();
if (tileReturn) {
int x = data.readInt();
int y = data.readInt();
int z = data.readInt();
TileEntity t = world.getBlockTileEntity(x, y, z);
if (t instanceof IGuiReturnHandler)
((IGuiReturnHandler) t).readGuiData(data, sender);
} else {
int entityId = data.readInt();
Entity entity = world.getEntityByID(entityId);
if (entity instanceof IGuiReturnHandler)
((IGuiReturnHandler) entity).readGuiData(data, sender);
}
}
public void sendPacket() {
PacketDispatcher.sendPacketToServer(getPacket());
}
@Override
public int getID() {
return PacketIds.GUI_RETURN;
}
}

View file

@ -1,15 +1,16 @@
package buildcraft.core.network;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.INetworkManager;
import net.minecraft.network.packet.Packet250CustomPayload;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
public class PacketHandler implements IPacketHandler {
@ -35,13 +36,14 @@ public class PacketHandler implements IPacketHandler {
int packetID = data.read();
switch (packetID) {
case PacketIds.TILE_UPDATE:
case PacketIds.TILE_UPDATE: {
PacketTileUpdate packetT = new PacketTileUpdate();
packetT.readData(data);
onTileUpdate((EntityPlayer) player, packetT);
break;
}
case PacketIds.STATE_UPDATE:
case PacketIds.STATE_UPDATE: {
PacketTileState inPacket = new PacketTileState();
inPacket.readData(data);
World world = ((EntityPlayer) player).worldObj;
@ -50,6 +52,14 @@ public class PacketHandler implements IPacketHandler {
inPacket.applyStates(data, (ISyncedTile) tile);
}
break;
}
case PacketIds.GUI_RETURN: {
PacketGuiReturn packet1 = new PacketGuiReturn((EntityPlayer) player);
packet1.readData(data);
// onGuiReturn((EntityPlayer) player, packet1);
break;
}
}
} catch (Exception ex) {
ex.printStackTrace();

View file

@ -3,32 +3,39 @@ package buildcraft.core.network;
public class PacketIds {
public static final int TILE_UPDATE = 0;
// public static final int PIPE_DESCRIPTION = 1;
// public static final int PIPE_DESCRIPTION = 1;
public static final int PIPE_CONTENTS = 2;
public static final int PIPE_LIQUID = 3;
public static final int PIPE_POWER = 4;
public static final int REQUEST_ITEM_NBT = 5;
public static final int PIPE_ITEM_NBT = 6;
public static final int SELECTION_ASSEMBLY_GET = 20;
/** Packet sent to server when a recipe is clicked on in the assembly table */
public static final int SELECTION_ASSEMBLY = 21;
/** Packet to send recipes to client */
public static final int SELECTION_ASSEMBLY_SEND = 22;
public static final int DIAMOND_PIPE_SELECT = 31;
public static final int EMERALD_PIPE_SELECT = 32;
public static final int GATE_ACTIONS = 40;
public static final int GATE_REQUEST_INIT = 41;
public static final int GATE_REQUEST_SELECTION = 42;
public static final int GATE_SELECTION = 43;
public static final int GATE_SELECTION_CHANGE = 44;
public static final int GATE_TRIGGERS = 45;
public static final int REFINERY_FILTER_SET = 50;
public static final int ARCHITECT_NAME = 60;
public static final int LIBRARY_ACTION = 61;
public static final int LIBRARY_SELECT = 62;
public static final int STATE_UPDATE = 100;
public static final int ADVANCED_WORKBENCH_SETSLOT = 70;
public static final int SELECTION_ADVANCED_WORKBENCH = 71;
public static final int GUI_RETURN = 80;
public static final int STATE_UPDATE = 100;
}

View file

@ -34,6 +34,7 @@ import net.minecraft.util.ChatMessageComponent;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
public class CoreProxy {
@ -126,7 +127,8 @@ public class CoreProxy {
}
public void addShapelessRecipe(ItemStack result, Object... recipe) {
GameRegistry.addShapelessRecipe(result, recipe);
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result, recipe));
//GameRegistry.addShapelessRecipe(result, recipe);
}
public void sendToPlayers(Packet packet, World world, int x, int y, int z, int maxDistance) {

View file

@ -79,7 +79,7 @@ public class CoreProxyClient extends CoreProxy {
/* LOCALIZATION */
@Override
public String getCurrentLanguage() {
return Minecraft.getMinecraft().func_135016_M().func_135041_c().func_135034_a();
return Minecraft.getMinecraft().getLanguageManager().getCurrentLanguage().getLanguageCode();
}
@Override

View file

@ -7,7 +7,7 @@
*/
package buildcraft.core.render;
import buildcraft.core.render.RenderEntityBlock.BlockInterface;
import buildcraft.core.render.RenderEntityBlock.RenderInfo;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
@ -27,11 +27,11 @@ import org.lwjgl.opengl.GL11;
*/
public class FluidRenderer {
private static final ResourceLocation BLOCK_TEXTURE = TextureMap.field_110575_b;
private static final ResourceLocation BLOCK_TEXTURE = TextureMap.locationBlocksTexture;
private static Map<Fluid, int[]> flowingRenderCache = new HashMap<Fluid, int[]>();
private static Map<Fluid, int[]> stillRenderCache = new HashMap<Fluid, int[]>();
public static final int DISPLAY_STAGES = 100;
private static final BlockInterface liquidBlock = new BlockInterface();
private static final RenderInfo liquidBlock = new RenderInfo();
public static Icon getFluidTexture(FluidStack fluidStack, boolean flowing) {
if (fluidStack == null) {
@ -46,7 +46,7 @@ public class FluidRenderer {
}
Icon icon = flowing ? fluid.getFlowingIcon() : fluid.getStillIcon();
if (icon == null) {
icon = ((TextureMap) Minecraft.getMinecraft().func_110434_K().func_110581_b(TextureMap.field_110575_b)).func_110572_b("missingno");
icon = ((TextureMap) Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
}
return icon;
}

View file

@ -8,6 +8,7 @@
package buildcraft.core.render;
import buildcraft.core.EntityBlock;
import java.util.Arrays;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
@ -20,15 +21,15 @@ import net.minecraft.world.World;
import org.lwjgl.opengl.GL11;
public class RenderEntityBlock extends Render {
public static RenderEntityBlock INSTANCE = new RenderEntityBlock();
@Override
protected ResourceLocation func_110775_a(Entity entity) {
protected ResourceLocation getEntityTexture(Entity entity) {
throw new UnsupportedOperationException("Not supported yet.");
}
public static class BlockInterface {
public static class RenderInfo {
public double minX;
public double minY;
@ -38,17 +39,81 @@ public class RenderEntityBlock extends Render {
public double maxZ;
public Block baseBlock = Block.sand;
public Icon texture = null;
public Icon[] textureArray = null;
public boolean[] renderSide = new boolean[6];
public float light = -1f;
public int brightness = -1;
public Icon getBlockTextureFromSide(int i) {
if (texture == null)
return baseBlock.getBlockTextureFromSide(i);
else
return texture;
public RenderInfo() {
setRenderAllSides();
}
public RenderInfo(Block template, Icon[] texture) {
this();
this.baseBlock = template;
this.textureArray = texture;
}
public RenderInfo(float minX, float minY, float minZ, float maxX, float maxY, float maxZ) {
this();
setBounds(minX, minY, minZ, maxX, maxY, maxZ);
}
public float getBlockBrightness(IBlockAccess iblockaccess, int i, int j, int k) {
return baseBlock.getBlockBrightness(iblockaccess, i, j, k);
}
public final void setBounds(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
this.minX = minX;
this.minY = minY;
this.minZ = minZ;
this.maxX = maxX;
this.maxY = maxY;
this.maxZ = maxZ;
}
public final void setRenderSingleSide(int side) {
Arrays.fill(renderSide, false);
renderSide[side] = true;
}
public final void setRenderAllSides() {
Arrays.fill(renderSide, true);
}
public void rotate() {
double temp = minX;
minX = minZ;
minZ = temp;
temp = maxX;
maxX = maxZ;
maxZ = temp;
}
public void reverseX() {
double temp = minX;
minX = 1 - maxX;
maxX = 1 - temp;
}
public void reverseZ() {
double temp = minZ;
minZ = 1 - maxZ;
maxZ = 1 - temp;
}
public Icon getBlockTextureFromSide(int i) {
if (texture != null)
return texture;
if (textureArray == null || textureArray.length == 0)
return baseBlock.getBlockTextureFromSide(i);
else {
if (i >= textureArray.length)
i = 0;
return textureArray[i];
}
}
}
private RenderEntityBlock() {
@ -65,9 +130,9 @@ public class RenderEntityBlock extends Render {
shadowSize = entity.shadowSize;
World world = entity.worldObj;
BlockInterface util = new BlockInterface();
RenderInfo util = new RenderInfo();
util.texture = entity.texture;
func_110776_a(TextureMap.field_110575_b);
bindTexture(TextureMap.locationBlocksTexture);
for (int iBase = 0; iBase < entity.iSize; ++iBase) {
for (int jBase = 0; jBase < entity.jSize; ++jBase) {
@ -99,7 +164,7 @@ public class RenderEntityBlock extends Render {
lightZ = (int) (Math.floor(entity.posZ) + kBase);
GL11.glDisable(2896 /* GL_LIGHTING */);
renderBlock(util, world, lightX, lightY, lightZ, false, true);
renderBlock(util, world, 0, 0, 0, lightX, lightY, lightZ, false, true);
GL11.glEnable(2896 /* GL_LIGHTING */);
GL11.glPopMatrix();
@ -108,92 +173,169 @@ public class RenderEntityBlock extends Render {
}
}
public void renderBlock(BlockInterface block, IBlockAccess blockAccess, int i, int j, int k, boolean doLight, boolean doTessellating) {
float f = 0.5F;
float f1 = 1.0F;
float f2 = 0.8F;
float f3 = 0.6F;
renderBlocks.renderMaxX = block.maxX;
renderBlocks.renderMinX = block.minX;
renderBlocks.renderMaxY = block.maxY;
renderBlocks.renderMinY = block.minY;
renderBlocks.renderMaxZ = block.maxZ;
renderBlocks.renderMinZ = block.minZ;
renderBlocks.enableAO = false;
public void renderBlock(RenderInfo info, IBlockAccess blockAccess, int x, int y, int z, boolean doLight, boolean doTessellating) {
renderBlock(info, blockAccess, x, y, z, x, y, z, doLight, doTessellating);
}
public void renderBlock(RenderInfo info, IBlockAccess blockAccess, double x, double y, double z, int lightX, int lightY, int lightZ, boolean doLight, boolean doTessellating) {
float lightBottom = 0.5F;
float lightTop = 1.0F;
float lightEastWest = 0.8F;
float lightNorthSouth = 0.6F;
Tessellator tessellator = Tessellator.instance;
if (doTessellating) {
if (blockAccess == null)
doLight = false;
if (doTessellating && !tessellator.isDrawing)
tessellator.startDrawingQuads();
}
float f4 = 0, f5 = 0;
float light = 0;
if (doLight) {
f4 = block.getBlockBrightness(blockAccess, i, j, k);
f5 = block.getBlockBrightness(blockAccess, i, j, k);
if (f5 < f4) {
f5 = f4;
}
tessellator.setColorOpaque_F(f * f5, f * f5, f * f5);
if (info.light < 0) {
light = info.baseBlock.getBlockBrightness(blockAccess, (int) lightX, (int) lightY, (int) lightZ);
light = light + ((1.0f - light) * 0.4f);
} else
light = info.light;
int brightness = 0;
if (info.brightness < 0)
brightness = info.baseBlock.getMixedBrightnessForBlock(blockAccess, lightX, lightY, lightZ);
else
brightness = info.brightness;
tessellator.setBrightness(brightness);
tessellator.setColorOpaque_F(lightBottom * light, lightBottom * light, lightBottom * light);
} else {
// tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
if (info.brightness >= 0)
tessellator.setBrightness(info.brightness);
}
renderBlocks.renderFaceYNeg(null, 0, 0, 0, block.getBlockTextureFromSide(0));
renderBlocks.setRenderBounds(info.minX, info.minY, info.minZ, info.maxX, info.maxY, info.maxZ);
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
if (f5 < f4) {
f5 = f4;
}
tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5);
}
if (info.renderSide[0])
renderBlocks.renderFaceYNeg(info.baseBlock, x, y, z, info.getBlockTextureFromSide(0));
renderBlocks.renderFaceYPos(null, 0, 0, 0, block.getBlockTextureFromSide(1));
if (doLight)
tessellator.setColorOpaque_F(lightTop * light, lightTop * light, lightTop * light);
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
if (f5 < f4) {
f5 = f4;
}
tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
}
if (info.renderSide[1])
renderBlocks.renderFaceYPos(info.baseBlock, x, y, z, info.getBlockTextureFromSide(1));
renderBlocks.renderFaceZNeg(null, 0, 0, 0, block.getBlockTextureFromSide(2));
if (doLight)
tessellator.setColorOpaque_F(lightEastWest * light, lightEastWest * light, lightEastWest * light);
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
if (f5 < f4) {
f5 = f4;
}
tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
}
if (info.renderSide[2])
renderBlocks.renderFaceZNeg(info.baseBlock, x, y, z, info.getBlockTextureFromSide(2));
renderBlocks.renderFaceZPos(null, 0, 0, 0, block.getBlockTextureFromSide(3));
if (doLight)
tessellator.setColorOpaque_F(lightEastWest * light, lightEastWest * light, lightEastWest * light);
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
if (f5 < f4) {
f5 = f4;
}
tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
}
if (info.renderSide[3])
renderBlocks.renderFaceZPos(info.baseBlock, x, y, z, info.getBlockTextureFromSide(3));
renderBlocks.renderFaceXNeg(null, 0, 0, 0, block.getBlockTextureFromSide(4));
if (doLight)
tessellator.setColorOpaque_F(lightNorthSouth * light, lightNorthSouth * light, lightNorthSouth * light);
if (doLight) {
f5 = block.getBlockBrightness(blockAccess, i, j, k);
if (f5 < f4) {
f5 = f4;
}
tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
}
if (info.renderSide[4])
renderBlocks.renderFaceXNeg(info.baseBlock, x, y, z, info.getBlockTextureFromSide(4));
renderBlocks.renderFaceXPos(null, 0, 0, 0, block.getBlockTextureFromSide(5));
if (doLight)
tessellator.setColorOpaque_F(lightNorthSouth * light, lightNorthSouth * light, lightNorthSouth * light);
if (doTessellating) {
if (info.renderSide[5])
renderBlocks.renderFaceXPos(info.baseBlock, x, y, z, info.getBlockTextureFromSide(5));
if (doTessellating && tessellator.isDrawing)
tessellator.draw();
}
}
//
// public void renderBlock(RenderInfo block, IBlockAccess blockAccess, int i, int j, int k, boolean doLight, boolean doTessellating) {
// float f = 0.5F;
// float f1 = 1.0F;
// float f2 = 0.8F;
// float f3 = 0.6F;
//
// renderBlocks.renderMaxX = block.maxX;
// renderBlocks.renderMinX = block.minX;
// renderBlocks.renderMaxY = block.maxY;
// renderBlocks.renderMinY = block.minY;
// renderBlocks.renderMaxZ = block.maxZ;
// renderBlocks.renderMinZ = block.minZ;
// renderBlocks.enableAO = false;
//
//
// Tessellator tessellator = Tessellator.instance;
//
// if (doTessellating) {
// tessellator.startDrawingQuads();
// }
//
// float f4 = 0, f5 = 0;
//
// if (doLight) {
// f4 = block.getBlockBrightness(blockAccess, i, j, k);
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f * f5, f * f5, f * f5);
// }
//
// renderBlocks.renderFaceYNeg(null, 0, 0, 0, block.getBlockTextureFromSide(0));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f1 * f5, f1 * f5, f1 * f5);
// }
//
// renderBlocks.renderFaceYPos(null, 0, 0, 0, block.getBlockTextureFromSide(1));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
// }
//
// renderBlocks.renderFaceZNeg(null, 0, 0, 0, block.getBlockTextureFromSide(2));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f2 * f5, f2 * f5, f2 * f5);
// }
//
// renderBlocks.renderFaceZPos(null, 0, 0, 0, block.getBlockTextureFromSide(3));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
// }
//
// renderBlocks.renderFaceXNeg(null, 0, 0, 0, block.getBlockTextureFromSide(4));
//
// if (doLight) {
// f5 = block.getBlockBrightness(blockAccess, i, j, k);
// if (f5 < f4) {
// f5 = f4;
// }
// tessellator.setColorOpaque_F(f3 * f5, f3 * f5, f3 * f5);
// }
//
// renderBlocks.renderFaceXPos(null, 0, 0, 0, block.getBlockTextureFromSide(5));
//
// if (doTessellating) {
// tessellator.draw();
// }
// }
}

View file

@ -46,7 +46,7 @@ public class RenderLaser extends Render {
GL11.glRotatef((float) laser.angleZ, 0, 1, 0);
GL11.glRotatef((float) laser.angleY, 0, 0, 1);
renderManager.renderEngine.func_110577_a(laser.getTexture());
renderManager.renderEngine.bindTexture(laser.getTexture());
float factor = (float) (1.0 / 16.0);
@ -78,7 +78,7 @@ public class RenderLaser extends Render {
}
@Override
protected ResourceLocation func_110775_a(Entity entity) {
protected ResourceLocation getEntityTexture(Entity entity) {
return ((EntityLaser) entity).getTexture();
}
}

Some files were not shown because too many files have changed in this diff Show more