Merge branch '6.5.x' of github.com:BuildCraft/BuildCraft into 7.1.x

This commit is contained in:
Adrian 2015-08-07 11:25:09 +02:00
commit 404510b4f1
60 changed files with 103 additions and 191 deletions

View file

@ -44,7 +44,7 @@ public final class CropManager {
return true;
}
}
return defaultHandler.canSustainPlant(world, seed, x, y, z);
return defaultHandler.isSeed(seed) && defaultHandler.canSustainPlant(world, seed, x, y, z);
}
public static boolean plantCrop(World world, EntityPlayer player, ItemStack seed, int x, int y,
@ -69,14 +69,15 @@ public final class CropManager {
}
public static boolean harvestCrop(World world, int x, int y, int z, List<ItemStack> drops) {
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
for (ICropHandler cropHandler : handlers) {
Block block = world.getBlock(x, y, z);
int meta = world.getBlockMetadata(x, y, z);
if (cropHandler.isMature(world, block, meta, x, y, z)) {
return cropHandler.harvestCrop(world, x, y, z, drops);
}
}
return defaultHandler.harvestCrop(world, x, y, z, drops);
return defaultHandler.isMature(world, block, meta, x, y, z)
&& defaultHandler.harvestCrop(world, x, y, z, drops);
}
}

View file

@ -22,7 +22,7 @@ apply plugin: 'forge' // adds the forge dependency
apply plugin: 'maven' // for uploading to a maven repo
apply plugin: 'checkstyle'
version = "7.1.0"
version = "7.1.1"
group= "com.mod-buildcraft"
archivesBaseName = "buildcraft" // the name that all artifacts will use as a base. artifacts names follow this pattern: [baseName]-[appendix]-[version]-[classifier].[extension]

View file

@ -0,0 +1,3 @@
Bugs fixed:
* Quarry/Mining Well no longer connecting to front for some users O_O (asie)

View file

@ -0,0 +1,6 @@
Bugs fixed:
* Creative Only blueprints partially working in Survival worlds (asie)
* Incorrect behaviour with Forestry/RailCraft engines (asie - workaround, actually bug on their side)
* Logistics Pipes VerifyError crash (asie)
* Overly dark water with non-sky lighting (asie)

View file

@ -1,3 +1,3 @@
1.6.4:BuildCraft:4.2.2
1.7.2:BuildCraft:6.0.16
1.7.10:BuildCraft:7.0.18
1.7.10:BuildCraft:7.0.20

View file

@ -94,8 +94,6 @@ public class BuildCraftFactory extends BuildCraftMod {
public void load(FMLInitializationEvent evt) {
NetworkRegistry.INSTANCE.registerGuiHandler(instance, new FactoryGuiHandler());
// EntityRegistry.registerModEntity(EntityMechanicalArm.class, "bcMechanicalArm", EntityIds.MECHANICAL_ARM, instance, 50, 1, true);
CoreProxy.proxy.registerTileEntity(TileMiningWell.class, "MiningWell");
CoreProxy.proxy.registerTileEntity(TileAutoWorkbench.class, "AutoWorkbench");
CoreProxy.proxy.registerTileEntity(TilePump.class, "net.minecraft.src.buildcraft.factory.TilePump");

View file

@ -25,8 +25,6 @@ public class EntityMechanicalArm extends Entity {
private double yRoot;
private double zRoot;
private boolean inProgressionXZ = false;
private boolean inProgressionY = false;
private int headX, headY, headZ;
private EntityBlock xArm, yArm, zArm, head;

View file

@ -597,9 +597,8 @@ public class TileBuilder extends TileAbstractBuilder implements IHasWork, IFluid
iterateBpt(false);
if (mode != Mode.Off) {
if (getWorldObj().getWorldInfo().getGameType() == GameType.CREATIVE) {
build();
} else if (getBattery().getEnergyStored() > POWER_ACTIVATION) {
if (getWorldObj().getWorldInfo().getGameType() == GameType.CREATIVE
|| getBattery().getEnergyStored() > POWER_ACTIVATION) {
build();
}
}

View file

@ -100,11 +100,12 @@ public class TileConstructionMarker extends TileBuildCraft implements IBuildingI
BlueprintBase bpt = ItemBlueprint.loadBlueprint(itemBlueprint);
if (bpt != null && bpt instanceof Blueprint) {
bpt = bpt.adjustToWorld(worldObj, xCoord, yCoord, zCoord, direction);
bluePrintBuilder = new BptBuilderBlueprint((Blueprint) bpt, worldObj, xCoord, yCoord, zCoord);
bptContext = bluePrintBuilder.getContext();
box.initialize(bluePrintBuilder);
sendNetworkUpdate();
if (bpt != null) {
bluePrintBuilder = new BptBuilderBlueprint((Blueprint) bpt, worldObj, xCoord, yCoord, zCoord);
bptContext = bluePrintBuilder.getContext();
box.initialize(bluePrintBuilder);
sendNetworkUpdate();
}
} else {
return;
}

View file

@ -28,7 +28,6 @@ import buildcraft.api.tiles.IHasWork;
import buildcraft.core.Box;
import buildcraft.core.Box.Kind;
import buildcraft.core.blueprints.BptBuilderTemplate;
import buildcraft.core.blueprints.BptContext;
import buildcraft.core.builders.TileAbstractBuilder;
import buildcraft.core.builders.patterns.FillerPattern;
import buildcraft.core.builders.patterns.PatternFill;
@ -47,7 +46,6 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro
public IStatementParameter[] patternParameters;
private BptBuilderTemplate currentTemplate;
private BptContext context;
private final Box box = new Box();
private boolean done = false;
@ -97,7 +95,6 @@ public class TileFiller extends TileAbstractBuilder implements IHasWork, IContro
private void initTemplate() {
if (currentPattern != null && box.isInitialized()) {
currentTemplate = currentPattern.getTemplateBuilder(box, getWorldObj(), patternParameters);
context = currentTemplate.getContext();
currentTemplate.blueprint.excavate = excavate;
}
}

View file

@ -891,9 +891,6 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI
@Override
public ConnectOverride overridePipeConnection(IPipeTile.PipeType type, ForgeDirection with) {
if (with.ordinal() == worldObj.getBlockMetadata(xCoord, yCoord, zCoord)) {
return ConnectOverride.DISCONNECT;
}
return type == IPipeTile.PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT;
}

View file

@ -47,7 +47,7 @@ public class RecursiveBlueprintBuilder {
public BptBuilderBase nextBuilder() {
if (!returnedThis) {
blueprint.adjustToWorld(world, x, y, z, dir);
blueprint = blueprint.adjustToWorld(world, x, y, z, dir);
returnedThis = true;

View file

@ -43,7 +43,6 @@ public class RecursiveBlueprintReader {
private float computingTime = 0;
private boolean done = false;
private boolean saveInItem = false;
private BlueprintBase parentBlueprint;

View file

@ -32,13 +32,11 @@ import buildcraft.core.lib.utils.StringUtils;
public class GuiBuilder extends GuiAdvancedInterface {
private static final ResourceLocation REGULAR_TEXTURE = new ResourceLocation("buildcraftbuilders:textures/gui/builder.png");
private static final ResourceLocation BLUEPRINT_TEXTURE = new ResourceLocation("buildcraftbuilders:textures/gui/builder_blueprint.png");
private IInventory playerInventory;
private TileBuilder builder;
private GuiButton selectedButton;
public GuiBuilder(IInventory playerInventory, TileBuilder builder) {
super(new ContainerBuilder(playerInventory, builder), builder, BLUEPRINT_TEXTURE);
this.playerInventory = playerInventory;
this.builder = builder;
xSize = 256;
ySize = 225;

View file

@ -61,14 +61,12 @@ public class GuiFiller extends GuiAdvancedInterface {
private static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftbuilders:textures/gui/filler.png");
private static final IButtonTextureSet EXCAVATE_OFF = new ButtonTextureSet(240, -16, 16, 16, TEXTURE);
private static final IButtonTextureSet EXCAVATE_ON = new ButtonTextureSet(224, -16, 16, 16, TEXTURE);
private final IInventory playerInventory;
private final TileFiller filler;
private final GuiFiller instance;
private final StatementSlot fakeStatementSlot;
public GuiFiller(IInventory playerInventory, TileFiller filler) {
super(new ContainerFiller(playerInventory, filler), filler, TEXTURE);
this.playerInventory = playerInventory;
this.filler = filler;
this.instance = this;
this.fakeStatementSlot = new StatementSlot(instance, -1, -1, 0) {

View file

@ -29,7 +29,6 @@ public class GuiUrbanist extends GuiAdvancedInterface {
public TileUrbanist urbanist;
public UrbanistTool[] tools = new UrbanistTool[10];
private IInventory playerInventory;
private int selectedTool = -1;
class ToolSlot extends AdvancedSlot {
@ -60,7 +59,6 @@ public class GuiUrbanist extends GuiAdvancedInterface {
xSize = width;
ySize = height;
this.playerInventory = playerInventory;
this.urbanist = urbanist;
urbanist.createUrbanistEntity();

View file

@ -19,12 +19,10 @@ import net.minecraft.item.ItemStack;
public class BCCreativeTab extends CreativeTabs {
private static final Map<String, BCCreativeTab> tabs = new HashMap<String, BCCreativeTab>();
private final String name;
private ItemStack icon;
public BCCreativeTab(String name) {
super("buildcraft." + name);
this.name = name;
tabs.put(name, this);
}

View file

@ -22,8 +22,6 @@ public final class DefaultProps {
public static String TEXTURE_PATH_ROBOTS = "buildcraftrobotics:textures/entities";
public static final String DEFAULT_LANGUAGE = "en_US";
public static String PUMP_DIMENSION_LIST = "+/*/*,+/-1/lava";
public static double PIPES_DURABILITY = 0.25D;

View file

@ -249,7 +249,6 @@ public class Version implements Runnable {
public static void displayChangelog(ICommandSender sender) {
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.GRAY + "" + EnumChatFormatting.BOLD
+ StatCollector.translateToLocalFormatted("command.buildcraft.changelog_header", getRecommendedVersion())));
int nb = 0;
for (String updateLine : Version.getChangelog()) {
String colour = "\u00A79";
if (updateLine.startsWith("*")) {

View file

@ -133,8 +133,6 @@ public abstract class BlueprintBase {
sub.setInteger("x", (int) np.x);
sub.setInteger("z", (int) np.z);
sub.setByte("dir", (byte) dir.ordinal());
NBTTagCompound bpt = sub.getCompoundTag("bpt");
}
context.rotateLeft();

View file

@ -120,8 +120,6 @@ public abstract class FillerPattern implements IFillerPattern {
* Generates an empty in a given area
*/
public static void empty(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, Template template) {
int lastX = Integer.MAX_VALUE, lastY = Integer.MAX_VALUE, lastZ = Integer.MAX_VALUE;
for (int y = yMax; y >= yMin; y--) {
for (int x = xMin; x <= xMax; ++x) {
for (int z = zMin; z <= zMax; ++z) {
@ -137,8 +135,6 @@ public abstract class FillerPattern implements IFillerPattern {
* Generates a flatten in a given area
*/
public static void flatten(int xMin, int yMin, int zMin, int xMax, int yMax, int zMax, Template template) {
int lastX = Integer.MAX_VALUE, lastY = Integer.MAX_VALUE, lastZ = Integer.MAX_VALUE;
for (int x = xMin; x <= xMax; ++x) {
for (int z = zMin; z <= zMax; ++z) {
for (int y = yMax; y >= yMin; --y) {

View file

@ -4,11 +4,15 @@ import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.api.crops.CropManager;
import buildcraft.api.crops.ICropHandler;
@ -21,7 +25,10 @@ public class CropHandlerReeds implements ICropHandler {
@Override
public boolean canSustainPlant(World world, ItemStack seed, int x, int y, int z) {
return CropManager.getDefaultHandler().canSustainPlant(world, seed, x, y, z);
Block block = world.getBlock(x, y, z);
return block.canSustainPlant(world, x, y, z, ForgeDirection.UP, (IPlantable) Blocks.reeds)
&& block != Blocks.reeds
&& world.isAirBlock(x, y + 1, z);
}
@Override

View file

@ -18,7 +18,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.network.INetHandler;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.tileentity.TileEntity;
@ -102,13 +101,12 @@ public class CoreProxy implements ICoreProxy {
stack.onCrafting(world, player, stack.stackSize);
}
@SuppressWarnings("unchecked")
public void addCraftingRecipe(ItemStack result, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(result, recipe));
GameRegistry.addRecipe(new ShapedOreRecipe(result, recipe));
}
public void addShapelessRecipe(ItemStack result, Object... recipe) {
CraftingManager.getInstance().getRecipeList().add(new ShapelessOreRecipe(result, recipe));
GameRegistry.addRecipe(new ShapelessOreRecipe(result, recipe));
}
public String playerName() {

View file

@ -49,7 +49,7 @@ public class AssemblyRecipeManager implements IAssemblyRecipeManager {
return assemblyRecipes.values();
}
public IFlexibleRecipe getRecipe(String id) {
public IFlexibleRecipe<ItemStack> getRecipe(String id) {
return assemblyRecipes.get(id);
}

View file

@ -23,16 +23,14 @@ public final class RefineryRecipeManager implements IRefineryRecipeManager {
public static final RefineryRecipeManager INSTANCE = new RefineryRecipeManager();
private HashMap<String, IFlexibleRecipe<FluidStack>> recipes = new HashMap<String, IFlexibleRecipe<FluidStack>>();
private ArrayList<FluidStack> validFluids1 = new ArrayList();
private ArrayList<FluidStack> validFluids2 = new ArrayList();
private ArrayList<FluidStack> validFluids1 = new ArrayList<FluidStack>();
private ArrayList<FluidStack> validFluids2 = new ArrayList<FluidStack>();
private RefineryRecipeManager() {
}
@Override
public void addRecipe(String id, FluidStack ingredient, FluidStack result, int energy, int delay) {
String name = result.getFluid().getName();
FlexibleRecipe<FluidStack> recipe = new FlexibleRecipe<FluidStack>(id, result, energy, delay, ingredient);
recipes.put(id, recipe);
validFluids1.add(ingredient);

View file

@ -27,7 +27,6 @@ public class GuiTablet extends GuiScreen {
private static final int X_SIZE = 142;
private static final int Y_SIZE = 180;
private final DynamicTextureBC display;
private final EntityPlayer player;
private final TabletThread tabletThread;
private final TabletClient tablet;
private int guiLeft, guiTop;
@ -41,7 +40,6 @@ public class GuiTablet extends GuiScreen {
this.tabletThread = TabletManagerClient.INSTANCE.get();
this.tablet = (TabletClient) tabletThread.getTablet();
this.lastDate = (new Date()).getTime();
this.player = player;
this.display = new DynamicTextureBC(tablet.getScreenWidth(), tablet.getScreenHeight());
tablet.updateGui(0.0F, this, true);

View file

@ -70,7 +70,6 @@ public final class TabletFont {
}
}
private String family;
private boolean isBold;
private boolean isItalic;
private int pointSize, maxW, maxH, ascent, descent;
@ -89,7 +88,7 @@ public final class TabletFont {
loaded += 8;
if ("FAMI".equals(section)) {
this.family = readString(stream, sectionLength);
readString(stream, sectionLength);
} else if ("WEIG".equals(section)) {
this.isBold = "bold".equals(readString(stream, sectionLength));
} else if ("SLAN".equals(section)) {

View file

@ -300,7 +300,7 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
// Fluid Fuel ID
case 15:
if (FluidRegistry.getFluid(value) != null) {
tankFuel.setFluid(new FluidStack(value, tankFuelAmountCache));
tankFuel.setFluid(new FluidStack(FluidRegistry.getFluid(value), tankFuelAmountCache));
} else {
tankFuel.setFluid(null);
}
@ -308,7 +308,7 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
// Fluid Coolant ID
case 16:
if (FluidRegistry.getFluid(value) != null) {
tankCoolant.setFluid(new FluidStack(value, tankCoolantAmountCache));
tankCoolant.setFluid(new FluidStack(FluidRegistry.getFluid(value), tankCoolantAmountCache));
} else {
tankCoolant.setFluid(null);
}

View file

@ -13,7 +13,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
@ -21,7 +20,6 @@ import buildcraft.api.tools.IToolWrench;
import buildcraft.core.lib.block.BlockBuildCraft;
public class BlockPump extends BlockBuildCraft {
private IIcon[] led;
public BlockPump() {
super(Material.iron);

View file

@ -149,9 +149,6 @@ public class TileMiningWell extends TileBuildCraft implements IHasWork, IPipeCon
@Override
public ConnectOverride overridePipeConnection(IPipeTile.PipeType type,
ForgeDirection with) {
if (with.ordinal() == worldObj.getBlockMetadata(xCoord, yCoord, zCoord)) {
return ConnectOverride.DISCONNECT;
}
return type == IPipeTile.PipeType.ITEM ? ConnectOverride.CONNECT : ConnectOverride.DEFAULT;
}

View file

@ -152,31 +152,6 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
}
}
private boolean containsInput(FluidStack ingredient) {
if (ingredient == null) {
return true;
}
return (tanks[0].getFluid() != null && tanks[0].getFluid().containsFluid(ingredient))
|| (tanks[1].getFluid() != null && tanks[1].getFluid().containsFluid(ingredient));
}
private boolean consumeInput(FluidStack liquid) {
if (liquid == null) {
return true;
}
if (tanks[0].getFluid() != null && tanks[0].getFluid().containsFluid(liquid)) {
tanks[0].drain(liquid.amount, true);
return true;
} else if (tanks[1].getFluid() != null && tanks[1].getFluid().containsFluid(liquid)) {
tanks[1].drain(liquid.amount, true);
return true;
}
return false;
}
@Override
public boolean hasWork() {
return isActive;
@ -328,7 +303,7 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IInve
currentRecipe = null;
craftingResult = null;
for (IFlexibleRecipe recipe : RefineryRecipeManager.INSTANCE.getRecipes()) {
for (IFlexibleRecipe<FluidStack> recipe : RefineryRecipeManager.INSTANCE.getRecipes()) {
craftingResult = recipe.craft(this, true);
if (craftingResult != null) {

View file

@ -414,14 +414,6 @@ public class EntityRobot extends EntityRobotBase implements
}
}
private void iterateBehaviorDocked() {
motionX = 0F;
motionY = 0F;
motionZ = 0F;
setNullBoundingBox();
}
@Override
public void writeSpawnData(ByteBuf data) {
data.writeByte(wearables.size());

View file

@ -24,7 +24,7 @@ import buildcraft.core.lib.utils.StringUtils;
public class BCBoardNBT extends RedstoneBoardRobotNBT {
public static final Map<String, BCBoardNBT> REGISTRY = new HashMap<String, BCBoardNBT>();
private final ResourceLocation texture;
private final String id, name, upperName, boardType;
private final String id, upperName, boardType;
private final Constructor<? extends RedstoneBoardRobot> boardInit;
@SideOnly(Side.CLIENT)
@ -32,7 +32,6 @@ public class BCBoardNBT extends RedstoneBoardRobotNBT {
public BCBoardNBT(String id, String name, Class<? extends RedstoneBoardRobot> board, String boardType) {
this.id = id;
this.name = name;
this.boardType = boardType;
this.upperName = name.substring(0, 1).toUpperCase() + name.substring(1);
this.texture = new ResourceLocation(

View file

@ -22,11 +22,8 @@ public class GuiRequester extends GuiAdvancedInterface {
private TileRequester requester;
private IInventory playerInventory;
private static class RequestSlot extends AdvancedSlot {
private ItemStack item;
private int index;
public RequestSlot(GuiAdvancedInterface gui, int iIndex, int x, int y) {
@ -38,12 +35,6 @@ public class GuiRequester extends GuiAdvancedInterface {
public void setItem(ItemStack itemStack) {
TileRequester requester = ((GuiRequester) gui).requester;
if (itemStack != null) {
item = itemStack.copy();
} else {
item = null;
}
requester.setRequest(index, itemStack);
((GuiRequester) gui).getContainer().getRequestList();
}
@ -66,7 +57,6 @@ public class GuiRequester extends GuiAdvancedInterface {
ySize = 181;
requester = iRequester;
playerInventory = iPlayerInventory;
for (int x = 0; x < 4; ++x) {
for (int y = 0; y < 5; ++y) {

View file

@ -21,7 +21,6 @@ import net.minecraft.world.chunk.Chunk;
import buildcraft.core.lib.utils.NBTUtils;
public class MapWorld {
private final World world;
private final LongHashMap regionMap;
private final HashMap<Chunk, Integer> timeToUpdate = new HashMap<Chunk, Integer>();
private final TLongLongHashMap regionUpdateTime;
@ -29,7 +28,6 @@ public class MapWorld {
private final File location;
public MapWorld(World world, File location) {
this.world = world;
regionMap = new LongHashMap();
regionUpdateTime = new TLongLongHashMap();
updatedChunks = new TLongHashSet();

View file

@ -78,7 +78,7 @@ public class BlockLaser extends BlockBuildCraft implements ICustomHighlight {
}
@Override
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void addCollisionBoxesToList(World wrd, int x, int y, int z, AxisAlignedBB mask, List list, Entity ent) {
AxisAlignedBB[] aabbs = boxes[wrd.getBlockMetadata(x, y, z)];
for (AxisAlignedBB aabb : aabbs) {

View file

@ -47,7 +47,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
public List<CraftingResult<ItemStack>> getPotentialOutputs() {
List<CraftingResult<ItemStack>> result = new LinkedList<CraftingResult<ItemStack>>();
for (IFlexibleRecipe recipe : AssemblyRecipeManager.INSTANCE.getRecipes()) {
for (IFlexibleRecipe<ItemStack> recipe : AssemblyRecipeManager.INSTANCE.getRecipes()) {
CraftingResult<ItemStack> r = recipe.craft(this, true);
if (r != null) {
@ -209,7 +209,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
}
}
public boolean isPlanned(IFlexibleRecipe recipe) {
public boolean isPlanned(IFlexibleRecipe<ItemStack> recipe) {
if (recipe == null) {
return false;
}
@ -217,7 +217,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IInventory,
return plannedOutput.contains(recipe.getId());
}
public boolean isAssembling(IFlexibleRecipe recipe) {
public boolean isAssembling(IFlexibleRecipe<ItemStack> recipe) {
return recipe != null && recipe == currentRecipe;
}

View file

@ -16,11 +16,9 @@ import buildcraft.silicon.TileChargingTable;
public class GuiChargingTable extends GuiLaserTable {
public static final ResourceLocation TEXTURE = new ResourceLocation("buildcraftsilicon:textures/gui/charging_table.png");
private final TileChargingTable table;
public GuiChargingTable(InventoryPlayer playerInventory, TileChargingTable chargingTable) {
super(playerInventory, new ContainerChargingTable(playerInventory, chargingTable), chargingTable, TEXTURE);
this.table = chargingTable;
xSize = 176;
ySize = 132;
}

View file

@ -15,12 +15,10 @@ public class PackageFontRenderer extends FontRenderer {
private static final RenderItem itemRender = new RenderItem();
private static final Minecraft mc = Minecraft.getMinecraft();
private static final FontRenderer realRenderer = mc.fontRenderer;
private final ItemStack packageStack;
private final NBTTagCompound pkgTag;
public PackageFontRenderer(ItemStack packageStack) {
super(mc.gameSettings, new ResourceLocation("textures/font/ascii.png"), mc.getTextureManager(), mc.fontRenderer.getUnicodeFlag());
this.packageStack = packageStack;
this.pkgTag = NBTUtils.getItemData(packageStack);
}
@ -57,8 +55,8 @@ public class PackageFontRenderer extends FontRenderer {
font = Minecraft.getMinecraft().fontRenderer;
}
itemRender.renderItemAndEffectIntoGUI(font, this.mc.getTextureManager(), slotStack, rx * 2, y * 2);
itemRender.renderItemOverlayIntoGUI(font, this.mc.getTextureManager(), slotStack, rx * 2, y * 2);
itemRender.renderItemAndEffectIntoGUI(font, mc.getTextureManager(), slotStack, rx * 2, y * 2);
itemRender.renderItemOverlayIntoGUI(font, mc.getTextureManager(), slotStack, rx * 2, y * 2);
itemRender.zLevel = 0.0F;
} else {
realRenderer.drawString("X", rx, y, 0xFF0000);

View file

@ -14,7 +14,6 @@ public class PipeColoringRecipe implements IRecipe {
ItemStack oneColorPipeStack = null;
ItemStack pipeStack = null;
boolean hasDifferentColorPipes = false;
boolean hasDifferentPipes = false;
boolean isBleach = false;
@ -35,11 +34,8 @@ public class PipeColoringRecipe implements IRecipe {
pipeStack.stackSize++;
if (oneColorPipeStack.getItemDamage() == oneColorPipeStack.getItemDamage()) {
oneColorPipeStack.stackSize++;
} else {
hasDifferentColorPipes = true;
}
} else {
hasDifferentColorPipes = true;
hasDifferentPipes = true;
}
}

View file

@ -81,7 +81,7 @@ public class PipeEventBus {
for (Method m: handler.getClass().getDeclaredMethods()) {
if ("eventHandler".equals(m.getName())) {
Class[] parameters = m.getParameterTypes();
Class<?>[] parameters = m.getParameterTypes();
if (parameters.length == 1 && PipeEvent.class.isAssignableFrom(parameters[0])) {
Class<? extends PipeEvent> eventType = (Class<? extends PipeEvent>) parameters[0];
List<EventHandler> eventHandlerList = getHandlerList(eventType);

View file

@ -280,6 +280,8 @@ public class PipeTransportItems extends PipeTransport implements IDebuggable {
case SOUTH:
item.movePosition(0, 0, item.getSpeed());
break;
default:
break;
}
if ((item.toCenter && middleReached(item)) || outOfBounds(item)) {

View file

@ -34,10 +34,7 @@ public class PipeTriggerProvider implements ITriggerProvider {
return result;
}
boolean containsGate = false;
if (container instanceof Gate) {
containsGate = true;
((Gate) container).addTriggers(result);
}

View file

@ -40,4 +40,7 @@ public class TransportProxy {
public void obsidianPipePickup(World world, EntityItem item, TileEntity tile) {
}
public void clearDisplayList(int displayList) {
}
}

View file

@ -8,6 +8,7 @@
*/
package buildcraft.transport;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
@ -44,6 +45,11 @@ public class TransportProxyClient extends TransportProxy {
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new TileEntityPickupFX(world, item, tile));
}
@Override
public void clearDisplayList(int displayList) {
GLAllocation.deleteDisplayLists(displayList);
}
@Override
public void registerRenderers() {
for (Item itemPipe : BlockGenericPipe.pipes.keySet()) {

View file

@ -99,7 +99,10 @@ public class TravelerSet extends ForwardingSet<TravelingItem> {
}
void removeScheduledItems() {
items.removeAll(toRemove);
for (TravelingItem i : toRemove) {
i.cleanup();
items.remove(i);
}
toRemove.clear();
}

View file

@ -308,6 +308,13 @@ public class TravelingItem {
return true;
}
public void cleanup() {
if (hasDisplayList) {
TransportProxy.proxy.clearDisplayList(displayList);
hasDisplayList = false;
}
}
@Override
public String toString() {
return "TravelingItem: " + id;

View file

@ -20,13 +20,11 @@ import buildcraft.transport.Pipe;
public class ContainerDiamondPipe extends BuildCraftContainer {
private final IDiamondPipe pipe;
private final IInventory playerInv;
private final IInventory filterInv;
public ContainerDiamondPipe(IInventory playerInventory, IDiamondPipe pipe) {
super(pipe.getFilters().getSizeInventory());
this.pipe = pipe;
this.playerInv = playerInventory;
this.filterInv = pipe.getFilters();
for (int y = 0; y < 6; y++) {

View file

@ -19,13 +19,11 @@ import buildcraft.transport.pipes.PipeFluidsEmerald;
public class ContainerEmeraldFluidPipe extends BuildCraftContainer {
private final PipeFluidsEmerald pipe;
private final IInventory playerInv;
private final IInventory filterInv;
public ContainerEmeraldFluidPipe(IInventory playerInventory, PipeFluidsEmerald pipe) {
super(pipe.getFilters().getSizeInventory());
this.pipe = pipe;
this.playerInv = playerInventory;
this.filterInv = pipe.getFilters();
addSlotToContainer(new SlotPhantom(filterInv, 0, 80, 18));

View file

@ -19,13 +19,11 @@ import buildcraft.transport.pipes.PipeItemsEmerald;
public class ContainerEmeraldPipe extends BuildCraftContainer {
private final PipeItemsEmerald pipe;
private final IInventory playerInv;
private final IInventory filterInv;
public ContainerEmeraldPipe(IInventory playerInventory, PipeItemsEmerald pipe) {
super(pipe.getFilters().getSizeInventory());
this.pipe = pipe;
this.playerInv = playerInventory;
this.filterInv = pipe.getFilters();
for (int i = 0; i < 9; i++) {

View file

@ -19,7 +19,7 @@ import buildcraft.transport.Pipe;
import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
public class PipeItemsCobblestone extends Pipe {
public class PipeItemsCobblestone extends Pipe<PipeTransportItems> {
public PipeItemsCobblestone(Item item) {
super(new PipeTransportItems(), item);

View file

@ -23,7 +23,7 @@ import buildcraft.transport.TransportConstants;
import buildcraft.transport.TravelingItem;
import buildcraft.transport.pipes.events.PipeEventItem;
public class PipeItemsGold extends Pipe {
public class PipeItemsGold extends Pipe<PipeTransportItems> {
public PipeItemsGold(Item item) {
super(new PipeTransportItems(), item);

View file

@ -22,7 +22,7 @@ import buildcraft.transport.TransportConstants;
import buildcraft.transport.TravelingItem;
import buildcraft.transport.pipes.events.PipeEventItem;
public class PipeItemsQuartz extends Pipe {
public class PipeItemsQuartz extends Pipe<PipeTransportItems> {
public PipeItemsQuartz(Item item) {
super(new PipeTransportItems(), item);

View file

@ -22,7 +22,7 @@ import buildcraft.transport.Pipe;
import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportItems;
public class PipeItemsSandstone extends Pipe implements IPipeConnectionForced {
public class PipeItemsSandstone extends Pipe<PipeTransportItems> implements IPipeConnectionForced {
public PipeItemsSandstone(Item item) {
super(new PipeTransportItems(), item);

View file

@ -22,7 +22,7 @@ import buildcraft.transport.TransportConstants;
import buildcraft.transport.TravelingItem;
import buildcraft.transport.pipes.events.PipeEventItem;
public class PipeItemsStone extends Pipe {
public class PipeItemsStone extends Pipe<PipeTransportItems> {
public PipeItemsStone(Item item) {
super(new PipeTransportItems(), item);

View file

@ -1,41 +1,16 @@
package buildcraft.transport.pipes;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.IIconProvider;
import buildcraft.core.lib.RFBattery;
import buildcraft.transport.PipeIconProvider;
public class PipePowerEmerald extends PipePowerWood {
public PipePowerEmerald(Item item) {
super(item);
standardIconIndex = PipeIconProvider.TYPE.PipePowerEmerald_Standard.ordinal();
solidIconIndex = PipeIconProvider.TYPE.PipeAllEmerald_Solid.ordinal();
battery = new RFBattery(2560 * 50, 2560, 0);
transport.initFromPipe(this.getClass());
}
@Override
@SideOnly(Side.CLIENT)
public IIconProvider getIconProvider() {
return BuildCraftTransport.instance.pipeIconProvider;
}
@Override
public int getIconIndex(ForgeDirection direction) {
if (direction != ForgeDirection.UNKNOWN && powerSources[direction.ordinal()]) {
return solidIconIndex;
} else {
return standardIconIndex;
}
}
}

View file

@ -40,13 +40,13 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllWood_Solid.ordinal();
protected RFBattery battery;
private int requestedEnergy, sources, lastRequestedEnergy;
private int requestedEnergy, lastRequestedEnergy, sources;
private boolean allowExtraction = false;
public PipePowerWood(Item item) {
super(new PipeTransportPower(), item);
battery = new RFBattery(320 * 50, 320, 0);
battery = new RFBattery(40960, 40960, 0);
transport.initFromPipe(getClass());
}
@ -104,7 +104,7 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
if (allowExtraction) {
allowExtraction = false;
int energyMaxExtract = Math.min(battery.getMaxEnergyExtract(), battery.getMaxEnergyStored() - battery.getEnergyStored());
int energyMaxExtract = Math.min(transport.maxPower, battery.getMaxEnergyStored() - battery.getEnergyStored());
energyMaxExtract /= sources;
for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
@ -197,7 +197,7 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
return maxReceive;
}
if (from.ordinal() < 6 && powerSources[from.ordinal()]) {
return battery.receiveEnergy(simulate ? Math.min(maxReceive, lastRequestedEnergy) : maxReceive, simulate);
return battery.receiveEnergy(simulate ? Math.min(maxReceive, lastRequestedEnergy) : Math.min(maxReceive, battery.getMaxEnergyStored() - battery.getEnergyStored()), simulate);
} else {
return 0;
}

View file

@ -19,7 +19,7 @@ import buildcraft.transport.Pipe;
import buildcraft.transport.PipeIconProvider;
import buildcraft.transport.PipeTransportStructure;
public class PipeStructureCobblestone extends Pipe {
public class PipeStructureCobblestone extends Pipe<PipeTransportStructure> {
public PipeStructureCobblestone(Item item) {
super(new PipeTransportStructure(), item);

View file

@ -10,6 +10,7 @@ package buildcraft.transport.render;
import org.lwjgl.opengl.GL11;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderBlocks;
@ -20,6 +21,7 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@ -112,8 +114,9 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
initialized = false;
}
private DisplayFluidList getDisplayFluidLists(int liquidId, int skylight, int flags, World world) {
int listId = (liquidId & 0x3FFFF) << 13 | flags << 5 | (skylight & 31);
private DisplayFluidList getDisplayFluidLists(int liquidId, int skylight, int blocklight, int flags, World world) {
int finalBlockLight = Math.max(flags & 31, blocklight);
int listId = (liquidId & 0x3FFFF) << 13 | (flags & 0xE0 | finalBlockLight) << 5 | (skylight & 31);
if (displayFluidLists.containsItem(listId)) {
return (DisplayFluidList) displayFluidLists.lookup(listId);
@ -137,7 +140,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
}
block.texture = fluid.getStillIcon();
block.brightness = skylight << 16 | flags & 31;
block.brightness = skylight << 16 | finalBlockLight;
float size = CoreConstants.PIPE_MAX_POS - CoreConstants.PIPE_MIN_POS;
@ -755,6 +758,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
GL11.glTranslatef((float) x, (float) y, (float) z);
int skylight = pipe.container.getWorld().getSkyBlockTypeBrightness(EnumSkyBlock.Sky, pipe.container.x(), pipe.container.y(), pipe.container.z());
int blocklight = pipe.container.getWorld().getSkyBlockTypeBrightness(EnumSkyBlock.Block, pipe.container.x(), pipe.container.y(), pipe.container.z());
boolean sides = false, above = false;
@ -769,7 +773,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
continue;
}
DisplayFluidList d = getDisplayFluidLists(renderData.fluidID, skylight,
DisplayFluidList d = getDisplayFluidLists(renderData.fluidID, skylight, blocklight,
renderData.flags, pipe.container.getWorldObj());
if (d == null) {
@ -811,7 +815,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
}
if (renderData.amount[6] > 0) {
DisplayFluidList d = getDisplayFluidLists(renderData.fluidID, skylight,
DisplayFluidList d = getDisplayFluidLists(renderData.fluidID, skylight, blocklight,
renderData.flags, pipe.container.getWorldObj());
if (d != null) {
@ -838,8 +842,6 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
private void renderSolids(Pipe<PipeTransportItems> pipe, double x, double y, double z, float f) {
GL11.glPushMatrix();
float light = pipe.container.getWorldObj().getLightBrightness(pipe.container.xCoord, pipe.container.yCoord, pipe.container.zCoord);
int count = 0;
for (TravelingItem item : pipe.transport.items) {
if (count >= MAX_ITEMS_TO_RENDER) {
@ -849,15 +851,22 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
Position motion = new Position(0, 0, 0, item.toCenter ? item.input : item.output);
motion.moveForwards(item.getSpeed() * f);
doRenderItem(item, x + item.xCoord - pipe.container.xCoord + motion.x, y + item.yCoord - pipe.container.yCoord + motion.y, z + item.zCoord - pipe.container.zCoord + motion.z, light, item.color);
doRenderItem(item, x + item.xCoord - pipe.container.xCoord + motion.x, y + item.yCoord - pipe.container.yCoord + motion.y, z + item.zCoord - pipe.container.zCoord + motion.z, 0.0F, item.color);
count++;
}
GL11.glPopMatrix();
}
public void doRenderItem(TravelingItem travellingItem, double x, double y, double z, float light, EnumColor color) {
private int getItemLightLevel(ItemStack stack) {
if (stack.getItem() instanceof ItemBlock) {
Block b = Block.getBlockFromItem(stack.getItem());
return b.getLightValue();
}
return 0;
}
public void doRenderItem(TravelingItem travellingItem, double x, double y, double z, float light, EnumColor color) {
if (travellingItem == null || travellingItem.getItemStack() == null) {
return;
}
@ -868,6 +877,8 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) y + 0.25F, (float) z);
//OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, skylight << 4, Math.max(blocklight, getItemLightLevel(itemstack)) << 4);
if (travellingItem.hasDisplayList) {
GL11.glCallList(travellingItem.displayList);
} else {

View file

@ -8,8 +8,6 @@
*/
package buildcraft.transport.utils;
import java.util.Set;
import io.netty.buffer.ByteBuf;
import net.minecraftforge.common.util.ForgeDirection;
@ -18,14 +16,7 @@ public class ConnectionMatrix {
private int mask = 0;
private boolean dirty = false;
private Set s;
public ConnectionMatrix() {
s = getSet();
}
public static Set getSet() {
return null;
}
public boolean isConnected(ForgeDirection direction) {