Merge branch '6.5.x' of github.com:BuildCraft/BuildCraft
This commit is contained in:
commit
8a3e499507
50 changed files with 76 additions and 152 deletions
5
buildcraft_resources/changelog/7.0.20
Normal file
5
buildcraft_resources/changelog/7.0.20
Normal file
|
@ -0,0 +1,5 @@
|
|||
Bugs fixed:
|
||||
|
||||
* Creative Only blueprints partially working in Survival worlds (asie)
|
||||
* Incorrect behaviour with Forestry/RailCraft engines (asie - workaround, actually bug on their side)
|
||||
* Overly dark water with non-sky lighting (asie)
|
|
@ -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");
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||
|
||||
import buildcraft.BuildCraftBuilders;
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.api.blueprints.BuildingPermission;
|
||||
import buildcraft.api.core.BCLog;
|
||||
import buildcraft.api.core.BlockIndex;
|
||||
import buildcraft.api.core.IInvSlot;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ public class RecursiveBlueprintReader {
|
|||
private float computingTime = 0;
|
||||
|
||||
private boolean done = false;
|
||||
private boolean saveInItem = false;
|
||||
|
||||
private BlueprintBase parentBlueprint;
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ 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;
|
||||
private int sbPosition, sbLength;
|
||||
|
@ -40,7 +39,6 @@ public class GuiBuilder extends GuiAdvancedInterface {
|
|||
|
||||
public GuiBuilder(IInventory playerInventory, TileBuilder builder) {
|
||||
super(new ContainerBuilder(playerInventory, builder), builder, BLUEPRINT_TEXTURE);
|
||||
this.playerInventory = playerInventory;
|
||||
this.builder = builder;
|
||||
xSize = 256;
|
||||
ySize = 225;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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("*")) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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.world.World;
|
||||
|
@ -101,13 +100,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() {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
@ -107,7 +105,6 @@ public class GuiTablet extends GuiScreen {
|
|||
} else if (buttonState == 2) {
|
||||
if (isButton(x, y)) {
|
||||
buttonState = ENABLE_HIGHLIGHT ? 0 : 1;
|
||||
System.out.println("PRESS");
|
||||
} else {
|
||||
buttonState = 1;
|
||||
}
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -416,14 +416,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());
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -576,12 +576,4 @@ public abstract class Pipe<T extends PipeTransport> implements IDropControlInven
|
|||
|
||||
return gates[side.ordinal()];
|
||||
}
|
||||
|
||||
private void pushActionState(ActionState state) {
|
||||
actionStates.add(state);
|
||||
}
|
||||
|
||||
private Collection<ActionState> getActionStates() {
|
||||
return actionStates;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -34,10 +34,7 @@ public class PipeTriggerProvider implements ITriggerProvider {
|
|||
return result;
|
||||
}
|
||||
|
||||
boolean containsGate = false;
|
||||
|
||||
if (container instanceof Gate) {
|
||||
containsGate = true;
|
||||
((Gate) container).addTriggers(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ import java.util.Map;
|
|||
|
||||
import com.google.common.collect.MapMaker;
|
||||
|
||||
import net.minecraft.client.renderer.GLAllocation;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -308,6 +309,15 @@ public class TravelingItem {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void finalize() {
|
||||
// Nasty hack.
|
||||
if (hasDisplayList) {
|
||||
GLAllocation.deleteDisplayLists(displayList);
|
||||
hasDisplayList = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TravelingItem: " + id;
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -19,7 +19,8 @@ public class PipePowerEmerald extends PipePowerWood {
|
|||
|
||||
solidIconIndex = PipeIconProvider.TYPE.PipeAllEmerald_Solid.ordinal();
|
||||
|
||||
battery = new RFBattery(2560 * 50, 2560, 0);
|
||||
battery = new RFBattery(2560 * 50, 2560 * 50, 0);
|
||||
receiveLimit = 2560;
|
||||
|
||||
transport.initFromPipe(this.getClass());
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
|
|||
protected int standardIconIndex = PipeIconProvider.TYPE.PipePowerWood_Standard.ordinal();
|
||||
protected int solidIconIndex = PipeIconProvider.TYPE.PipeAllWood_Solid.ordinal();
|
||||
protected RFBattery battery;
|
||||
protected int receiveLimit;
|
||||
|
||||
private int requestedEnergy, sources, lastRequestedEnergy;
|
||||
private boolean allowExtraction = false;
|
||||
|
@ -46,8 +47,9 @@ public class PipePowerWood extends Pipe<PipeTransportPower> implements IPipeTran
|
|||
public PipePowerWood(Item item) {
|
||||
super(new PipeTransportPower(), item);
|
||||
|
||||
battery = new RFBattery(320 * 50, 320, 0);
|
||||
battery = new RFBattery(320 * 50, 320 * 50, 0);
|
||||
transport.initFromPipe(getClass());
|
||||
receiveLimit = 320;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -104,7 +106,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(receiveLimit, battery.getMaxEnergyStored() - battery.getEnergyStored());
|
||||
energyMaxExtract /= sources;
|
||||
|
||||
for (ForgeDirection o : ForgeDirection.VALID_DIRECTIONS) {
|
||||
|
@ -197,7 +199,13 @@ 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);
|
||||
/* Non-simulate is technically supposed to cap to maxReceive, but Forestry and RailCraft have a bug which causes
|
||||
them to push energy and void it. Therefore, if a non-RF-compliant mod requests energy WITHOUT simulation, we just
|
||||
accept everything verbatim.
|
||||
|
||||
This should be removed but probably won't. */
|
||||
int maxEnergyReceive = simulate ? Math.min(receiveLimit, lastRequestedEnergy) : battery.getMaxEnergyStored();
|
||||
return battery.receiveEnergy(maxEnergyReceive, simulate);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
@ -111,8 +113,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);
|
||||
|
@ -136,7 +139,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;
|
||||
|
||||
|
@ -749,6 +752,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;
|
||||
|
||||
|
@ -765,7 +769,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
continue;
|
||||
}
|
||||
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, skylight,
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, skylight, blocklight,
|
||||
fluidRenderData.flags, pipe.container.getWorldObj());
|
||||
|
||||
if (d == null) {
|
||||
|
@ -809,7 +813,7 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
|||
FluidRenderData fluidRenderData = trans.renderCache;
|
||||
|
||||
if (fluidRenderData.amount[6] > 0) {
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, skylight,
|
||||
DisplayFluidList d = getDisplayFluidLists(fluidRenderData.fluidID, skylight, blocklight,
|
||||
fluidRenderData.flags, pipe.container.getWorldObj());
|
||||
|
||||
if (d != null) {
|
||||
|
@ -836,7 +840,8 @@ 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 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());
|
||||
|
||||
int count = 0;
|
||||
for (TravelingItem item : pipe.transport.items) {
|
||||
|
@ -847,15 +852,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, skylight, blocklight, 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, int skylight, int blocklight, EnumColor color) {
|
||||
if (travellingItem == null || travellingItem.getItemStack() == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -866,6 +878,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 {
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue