This commit is contained in:
CovertJaguar 2013-05-19 02:48:02 -07:00
commit 3cf74d7986
33 changed files with 186 additions and 56 deletions

View file

@ -310,9 +310,11 @@ public class BuildCraftBuilders {
new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), new ItemStack(Item.dyePowder, 1, 11), 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 }); Character.valueOf('c'), Block.workbench, Character.valueOf('g'), BuildCraftCore.goldGearItem, Character.valueOf('C'), Block.chest });
/*
CoreProxy.proxy.addCraftingRecipe(new ItemStack(builderBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'), 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), 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 }); Character.valueOf('c'), Block.workbench, Character.valueOf('g'), BuildCraftCore.diamondGearItem, Character.valueOf('C'), Block.chest });
*/
CoreProxy.proxy.addCraftingRecipe(new ItemStack(architectBlock, 1), new Object[] { "btb", "ycy", "gCg", Character.valueOf('b'), 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), new ItemStack(Item.dyePowder, 1, 0), Character.valueOf('t'), markerBlock, Character.valueOf('y'), new ItemStack(Item.dyePowder, 1, 11),

View file

@ -8,12 +8,15 @@
package buildcraft; package buildcraft;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.Configuration; import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
@ -58,9 +61,6 @@ import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry; import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.world.biome.BiomeGenBase;
@Mod(name = "BuildCraft Energy", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE) @Mod(name = "BuildCraft Energy", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true) @NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)

View file

@ -42,6 +42,7 @@ import buildcraft.factory.BptBlockTank;
import buildcraft.factory.FactoryProxy; import buildcraft.factory.FactoryProxy;
import buildcraft.factory.FactoryProxyClient; import buildcraft.factory.FactoryProxyClient;
import buildcraft.factory.GuiHandler; import buildcraft.factory.GuiHandler;
import buildcraft.factory.PumpDimensionList;
import buildcraft.factory.TileAutoWorkbench; import buildcraft.factory.TileAutoWorkbench;
import buildcraft.factory.TileHopper; import buildcraft.factory.TileHopper;
import buildcraft.factory.TileMiningWell; import buildcraft.factory.TileMiningWell;
@ -83,6 +84,8 @@ public class BuildCraftFactory {
public static boolean allowMining = true; public static boolean allowMining = true;
public static PumpDimensionList pumpDimensionList;
@Instance("BuildCraft|Factory") @Instance("BuildCraft|Factory")
public static BuildCraftFactory instance; public static BuildCraftFactory instance;
@ -156,6 +159,8 @@ public class BuildCraftFactory {
public void initialize(FMLPreInitializationEvent evt) { public void initialize(FMLPreInitializationEvent evt) {
allowMining = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "mining.enabled", true).getBoolean(true); allowMining = BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "mining.enabled", true).getBoolean(true);
pumpDimensionList = new PumpDimensionList(BuildCraftCore.mainConfiguration.get(Configuration.CATEGORY_GENERAL, "pumping.controlList", DefaultProps.PUMP_DIMENSION_LIST).getString());
Property miningWellId = BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID); Property miningWellId = BuildCraftCore.mainConfiguration.getBlock("miningWell.id", DefaultProps.MINING_WELL_ID);
Property plainPipeId = BuildCraftCore.mainConfiguration.getBlock("drill.id", DefaultProps.DRILL_ID); Property plainPipeId = BuildCraftCore.mainConfiguration.getBlock("drill.id", DefaultProps.DRILL_ID);
Property autoWorkbenchId = BuildCraftCore.mainConfiguration.getBlock("autoWorkbench.id", DefaultProps.AUTO_WORKBENCH_ID); Property autoWorkbenchId = BuildCraftCore.mainConfiguration.getBlock("autoWorkbench.id", DefaultProps.AUTO_WORKBENCH_ID);

View file

@ -41,7 +41,7 @@ public class BlockBuilder extends BlockContainer {
public BlockBuilder(int i) { public BlockBuilder(int i) {
super(i, Material.iron); super(i, Material.iron);
setHardness(0.7F); setHardness(0.7F);
setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); //setCreativeTab(CreativeTabBuildCraft.tabBuildCraft);
} }
@Override @Override

View file

@ -89,6 +89,6 @@ public class BlockIndex implements Comparable<BlockIndex> {
@Override @Override
public int hashCode() { public int hashCode() {
return i + j << 8 + k << 16; return (i * 37 + j) * 37 + k;
} }
} }

View file

@ -1,16 +1,16 @@
package buildcraft.core; package buildcraft.core;
import java.util.List;
import java.util.Random; import java.util.Random;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class BlockSpring extends Block { public class BlockSpring extends Block {

View file

@ -32,6 +32,8 @@ public class DefaultProps {
public static final String DEFAULT_LANGUAGE = "en_US"; public static final String DEFAULT_LANGUAGE = "en_US";
public static String PUMP_DIMENSION_LIST = "+/*/*,+/-1/Lava";
public static int WOODEN_GEAR_ID = 19100; public static int WOODEN_GEAR_ID = 19100;
public static int STONE_GEAR_ID = 19101; public static int STONE_GEAR_ID = 19101;
public static int IRON_GEAR_ID = 19102; public static int IRON_GEAR_ID = 19102;

View file

@ -10,6 +10,7 @@
package buildcraft.core; package buildcraft.core;
import java.util.Locale; import java.util.Locale;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class ItemSpring extends ItemBlockBuildCraft { public class ItemSpring extends ItemBlockBuildCraft {

View file

@ -1,11 +1,11 @@
package buildcraft.core; package buildcraft.core;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
import buildcraft.api.tools.IToolWrench;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import buildcraft.api.tools.IToolWrench;
public class ItemWrench extends ItemBuildCraft implements IToolWrench { public class ItemWrench extends ItemBuildCraft implements IToolWrench {

View file

@ -13,7 +13,6 @@ import java.util.LinkedList;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.core.IBuilderInventory; import buildcraft.core.IBuilderInventory;
import buildcraft.core.blueprints.BptSlot.Mode; import buildcraft.core.blueprints.BptSlot.Mode;

View file

@ -3,6 +3,8 @@ package buildcraft.core.gui;
import java.util.ArrayList; import java.util.ArrayList;
import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
@ -14,8 +16,6 @@ import buildcraft.core.gui.buttons.GuiBetterButton;
import buildcraft.core.gui.tooltips.ToolTip; import buildcraft.core.gui.tooltips.ToolTip;
import buildcraft.core.gui.tooltips.ToolTipLine; import buildcraft.core.gui.tooltips.ToolTipLine;
import buildcraft.core.utils.SessionVars; import buildcraft.core.utils.SessionVars;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.player.InventoryPlayer;
public abstract class GuiBuildCraft extends GuiContainer { public abstract class GuiBuildCraft extends GuiContainer {

View file

@ -1,12 +1,14 @@
package buildcraft.core.gui.buttons; package buildcraft.core.gui.buttons;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import org.lwjgl.opengl.GL11;
import buildcraft.core.gui.tooltips.ToolTip; import buildcraft.core.gui.tooltips.ToolTip;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import org.lwjgl.opengl.GL11;
/** /**
* *

View file

@ -1,10 +1,12 @@
package buildcraft.core.gui.buttons; package buildcraft.core.gui.buttons;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import org.lwjgl.opengl.GL11;
/** /**
* *

View file

@ -1,9 +1,10 @@
package buildcraft.core.gui.tooltips; package buildcraft.core.gui.tooltips;
import com.google.common.collect.ForwardingList;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.google.common.collect.ForwardingList;
/** /**
* *
* @author CovertJaguar <http://www.railcraft.info/> * @author CovertJaguar <http://www.railcraft.info/>

View file

@ -1,10 +1,10 @@
package buildcraft.core.inventory; package buildcraft.core.inventory;
import buildcraft.core.utils.Utils;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import buildcraft.core.utils.Utils;
public abstract class InventoryWrapper implements ISidedInventory { public abstract class InventoryWrapper implements ISidedInventory {

View file

@ -1,8 +1,8 @@
package buildcraft.core.inventory; package buildcraft.core.inventory;
import buildcraft.core.utils.Utils;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import buildcraft.core.utils.Utils;
public class InventoryWrapperForge extends InventoryWrapper { public class InventoryWrapperForge extends InventoryWrapper {

View file

@ -1,8 +1,8 @@
package buildcraft.core.inventory; package buildcraft.core.inventory;
import buildcraft.core.utils.Utils;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import buildcraft.core.utils.Utils;
public class InventoryWrapperSimple extends InventoryWrapper { public class InventoryWrapperSimple extends InventoryWrapper {

View file

@ -19,6 +19,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet;
@ -33,7 +34,6 @@ import buildcraft.core.network.BuildCraftPacket;
import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.ItemBlock;
public class CoreProxy { public class CoreProxy {

View file

@ -7,19 +7,21 @@
*/ */
package buildcraft.core.render; package buildcraft.core.render;
import buildcraft.core.render.RenderEntityBlock.BlockInterface;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.liquids.LiquidDictionary; import net.minecraftforge.liquids.LiquidDictionary;
import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11;
import buildcraft.core.render.RenderEntityBlock.BlockInterface;
/** /**
* *

View file

@ -6,6 +6,7 @@ import net.minecraft.block.Block;
import net.minecraft.inventory.IInventory; import net.minecraft.inventory.IInventory;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection; import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquidTank;
import net.minecraftforge.liquids.ITankContainer; import net.minecraftforge.liquids.ITankContainer;
import buildcraft.BuildCraftCore; import buildcraft.BuildCraftCore;
import buildcraft.api.gates.IOverrideDefaultTriggers; import buildcraft.api.gates.IOverrideDefaultTriggers;
@ -13,7 +14,6 @@ import buildcraft.api.gates.ITrigger;
import buildcraft.api.gates.ITriggerProvider; import buildcraft.api.gates.ITriggerProvider;
import buildcraft.api.transport.IPipe; import buildcraft.api.transport.IPipe;
import buildcraft.core.IMachine; import buildcraft.core.IMachine;
import net.minecraftforge.liquids.ILiquidTank;
public class DefaultTriggerProvider implements ITriggerProvider { public class DefaultTriggerProvider implements ITriggerProvider {

View file

@ -14,14 +14,14 @@ import net.minecraft.block.BlockFlowing;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquid; import net.minecraftforge.liquids.ILiquid;
import buildcraft.BuildCraftCore; import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy; import buildcraft.BuildCraftEnergy;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.ForgeDirection;
public class BlockOilFlowing extends BlockFlowing implements ILiquid { public class BlockOilFlowing extends BlockFlowing implements ILiquid {

View file

@ -11,14 +11,14 @@ import net.minecraft.block.BlockStationary;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.util.Icon; import net.minecraft.util.Icon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.liquids.ILiquid; import net.minecraftforge.liquids.ILiquid;
import buildcraft.BuildCraftCore; import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy; import buildcraft.BuildCraftEnergy;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.ForgeDirection;
public class BlockOilStill extends BlockStationary implements ILiquid { public class BlockOilStill extends BlockStationary implements ILiquid {

View file

@ -7,20 +7,20 @@
*/ */
package buildcraft.energy; package buildcraft.energy;
import java.util.HashSet;
import java.util.Random; import java.util.Random;
import java.util.Set;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.ForgeDirection;
import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen; import net.minecraftforge.event.terraingen.TerrainGen;
import buildcraft.BuildCraftCore; import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy; import buildcraft.BuildCraftEnergy;
import java.util.HashSet;
import java.util.Set;
import net.minecraft.block.BlockFlower;
import net.minecraftforge.common.ForgeDirection;
public class OilPopulate { public class OilPopulate {

View file

@ -7,6 +7,12 @@
*/ */
package buildcraft.energy.render; package buildcraft.energy.render;
import static net.minecraftforge.common.ForgeDirection.DOWN;
import static net.minecraftforge.common.ForgeDirection.EAST;
import static net.minecraftforge.common.ForgeDirection.NORTH;
import static net.minecraftforge.common.ForgeDirection.SOUTH;
import static net.minecraftforge.common.ForgeDirection.UP;
import static net.minecraftforge.common.ForgeDirection.WEST;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
@ -23,7 +29,6 @@ import buildcraft.core.IInventoryRenderer;
import buildcraft.energy.Engine; import buildcraft.energy.Engine;
import buildcraft.energy.Engine.EnergyStage; import buildcraft.energy.Engine.EnergyStage;
import buildcraft.energy.IEngineProvider; import buildcraft.energy.IEngineProvider;
import static net.minecraftforge.common.ForgeDirection.*;
public class RenderEngine extends TileEntitySpecialRenderer implements IInventoryRenderer { public class RenderEngine extends TileEntitySpecialRenderer implements IInventoryRenderer {

View file

@ -0,0 +1,86 @@
package buildcraft.factory;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import net.minecraftforge.liquids.LiquidDictionary;
import net.minecraftforge.liquids.LiquidStack;
public class PumpDimensionList {
public PumpDimensionList(String string) {
entries = new LinkedList<Entry>();
for(String entryString : string.trim().split(",")) {
Entry e = new Entry();
if(entryString.startsWith("+/")) {
e.isWhitelist = true;
} else if(entryString.startsWith("-/")) {
e.isWhitelist = false;
} else
throw new RuntimeException("Malformed pumping.controlList entry: "+entryString+" (must start with +/ or -/)");
entryString = entryString.substring(2);
int i = entryString.indexOf('/');
if(i < 0)
throw new RuntimeException("Malformed pumping.controlList entry: "+entryString+" (missing second /)");
String dimIDString = entryString.substring(0, i);
if(dimIDString.equals("*"))
e.matchAnyDim = true;
else
e.dimID = Integer.parseInt(dimIDString);
e.liquidName = entryString.substring(i + 1);
if(e.liquidName.equals("*"))
e.matchAnyLiquid = true;
entries.add(0, e);
}
entries = new ArrayList<Entry>(entries);
}
private class Entry {
boolean isWhitelist;
LiquidStack liquidStack;
String liquidName;
int dimID;
boolean matchAnyLiquid;
boolean matchAnyDim;
private void initLiquidStack() {
liquidStack = LiquidDictionary.getLiquid(liquidName, 1);
if(liquidStack == null)
throw new RuntimeException("Configuration error: unknown liquid "+liquidName+" in pumping.controlList");
}
boolean matches(LiquidStack liquid, int dim) {
if(!matchAnyLiquid) {
if(liquidStack == null)
initLiquidStack();
if(!liquidStack.isLiquidEqual(liquid))
return false;
}
if(!matchAnyDim && dimID != dim)
return false;
return true;
}
}
private List<Entry> entries;
public boolean isLiquidAllowed(LiquidStack liquid, int dim) {
for(Entry e : entries)
if(e.matches(liquid, dim))
return e.isWhitelist;
return false;
}
}

View file

@ -25,6 +25,7 @@ import net.minecraftforge.liquids.LiquidContainerRegistry;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.liquids.LiquidTank; import net.minecraftforge.liquids.LiquidTank;
import buildcraft.BuildCraftCore; import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
import buildcraft.api.core.Position; import buildcraft.api.core.Position;
import buildcraft.api.power.IPowerProvider; import buildcraft.api.power.IPowerProvider;
import buildcraft.api.power.IPowerReceptor; import buildcraft.api.power.IPowerReceptor;
@ -211,6 +212,8 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor, I
addToPumpIfLiquid(new BlockIndex(x, y, z), markedBlocks, lastFound, pumpList, liquidId); addToPumpIfLiquid(new BlockIndex(x, y, z), markedBlocks, lastFound, pumpList, liquidId);
long timeoutTime = System.currentTimeMillis() + 1000;
while (lastFound.size() > 0) { while (lastFound.size() > 0) {
TreeSet<BlockIndex> visitIteration = new TreeSet<BlockIndex>(lastFound); TreeSet<BlockIndex> visitIteration = new TreeSet<BlockIndex>(lastFound);
lastFound.clear(); lastFound.clear();
@ -228,6 +231,9 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor, I
pumpList = blocksToPump.get(index.j + 1); pumpList = blocksToPump.get(index.j + 1);
addToPumpIfLiquid(new BlockIndex(index.i, index.j + 1, index.k), markedBlocks, lastFound, pumpList, liquidId); addToPumpIfLiquid(new BlockIndex(index.i, index.j + 1, index.k), markedBlocks, lastFound, pumpList, liquidId);
if(System.currentTimeMillis() > timeoutTime)
return;
} }
} }
} }
@ -257,7 +263,14 @@ public class TilePump extends TileMachine implements IMachine, IPowerReceptor, I
} }
private boolean isLiquid(BlockIndex index) { private boolean isLiquid(BlockIndex index) {
return index != null && (Utils.liquidFromBlockId(worldObj.getBlockId(index.i, index.j, index.k)) != null); if(index == null)
return false;
LiquidStack liquid = Utils.liquidFromBlockId(worldObj.getBlockId(index.i, index.j, index.k));
if(liquid == null)
return false;
return BuildCraftFactory.pumpDimensionList.isLiquidAllowed(liquid, worldObj.provider.dimensionId);
} }
@Override @Override

View file

@ -12,6 +12,7 @@ import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer; import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
@ -19,7 +20,6 @@ import buildcraft.core.DefaultProps;
import buildcraft.core.IInventoryRenderer; import buildcraft.core.IInventoryRenderer;
import buildcraft.core.render.LiquidRenderer; import buildcraft.core.render.LiquidRenderer;
import buildcraft.factory.TileRefinery; import buildcraft.factory.TileRefinery;
import net.minecraftforge.liquids.LiquidStack;
public class RenderRefinery extends TileEntitySpecialRenderer implements IInventoryRenderer { public class RenderRefinery extends TileEntitySpecialRenderer implements IInventoryRenderer {

View file

@ -7,13 +7,13 @@
*/ */
package buildcraft.factory.render; package buildcraft.factory.render;
import buildcraft.core.render.LiquidRenderer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.liquids.LiquidStack; import net.minecraftforge.liquids.LiquidStack;
import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL11;
import buildcraft.core.render.LiquidRenderer;
import buildcraft.factory.TileTank; import buildcraft.factory.TileTank;
public class RenderTank extends TileEntitySpecialRenderer { public class RenderTank extends TileEntitySpecialRenderer {

View file

@ -10,9 +10,11 @@
package buildcraft.transport; package buildcraft.transport;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random; import java.util.Random;
import java.util.TreeMap;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer; import net.minecraft.block.BlockContainer;
@ -47,9 +49,6 @@ import buildcraft.transport.render.PipeWorldRenderer;
import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
public class BlockGenericPipe extends BlockContainer { public class BlockGenericPipe extends BlockContainer {
static enum Part { static enum Part {

View file

@ -104,8 +104,13 @@ public class ItemFacade extends ItemBuildCraft {
continue; continue;
} }
if (!(b.blockID == 20)){ if (!(b.blockID == 20)){ //Explicitly allow glass
if (b.blockID == 7 || b.blockID == 18 || b.blockID == 19 || b.blockID == 95) { if (b.blockID == 7 //Bedrock
|| b.blockID == 2 //Grass block
|| b.blockID == 18 //Oak leaves
|| b.blockID == 19 //Sponge
|| b.blockID == 95 //Locked chest
) {
continue; continue;
} }
if (!b.isOpaqueCube() || b.hasTileEntity(0) || !b.renderAsNormalBlock()) { if (!b.isOpaqueCube() || b.hasTileEntity(0) || !b.renderAsNormalBlock()) {

View file

@ -9,6 +9,8 @@
package buildcraft.transport; package buildcraft.transport;
import java.util.logging.Level;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -23,7 +25,6 @@ import buildcraft.core.IItemPipe;
import buildcraft.core.ItemBuildCraft; import buildcraft.core.ItemBuildCraft;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import java.util.logging.Level;
public class ItemPipe extends ItemBuildCraft implements IItemPipe { public class ItemPipe extends ItemBuildCraft implements IItemPipe {

View file

@ -210,8 +210,11 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
nbttagcompound.setBoolean("wireSet[" + i + "]", wireSet[i]); nbttagcompound.setBoolean("wireSet[" + i + "]", wireSet[i]);
nbttagcompound.setBoolean("wireState[" + i + "]", broadcastSignal[i]);
} }
nbttagcompound.setBoolean("redstoneState", broadcastRedstone);
for (int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
nbttagcompound.setInteger("action[" + i + "]", activatedActions[i] != null ? activatedActions[i].getId() : 0); nbttagcompound.setInteger("action[" + i + "]", activatedActions[i] != null ? activatedActions[i].getId() : 0);
nbttagcompound.setInteger("trigger[" + i + "]", activatedTriggers[i] != null ? activatedTriggers[i].getId() : 0); nbttagcompound.setInteger("trigger[" + i + "]", activatedTriggers[i] != null ? activatedTriggers[i].getId() : 0);
@ -245,8 +248,11 @@ public abstract class Pipe implements IPipe, IDropControlInventory {
for (int i = 0; i < 4; ++i) { for (int i = 0; i < 4; ++i) {
wireSet[i] = nbttagcompound.getBoolean("wireSet[" + i + "]"); wireSet[i] = nbttagcompound.getBoolean("wireSet[" + i + "]");
broadcastSignal[i] = nbttagcompound.getBoolean("wireState[" + i + "]");
} }
broadcastRedstone = nbttagcompound.getBoolean("redstoneState");
for (int i = 0; i < 8; ++i) { for (int i = 0; i < 8; ++i) {
activatedActions[i] = ActionManager.actions[nbttagcompound.getInteger("action[" + i + "]")]; activatedActions[i] = ActionManager.actions[nbttagcompound.getInteger("action[" + i + "]")];
activatedTriggers[i] = ActionManager.triggers[nbttagcompound.getInteger("trigger[" + i + "]")]; activatedTriggers[i] = ActionManager.triggers[nbttagcompound.getInteger("trigger[" + i + "]")];

View file

@ -12,7 +12,6 @@ package buildcraft.transport.render;
import java.util.HashMap; import java.util.HashMap;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation; import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RenderManager;