Update for 1.4

This commit is contained in:
Christian 2012-10-21 23:58:00 -04:00
parent 39572b281d
commit 8c0696b73f
34 changed files with 109 additions and 90 deletions

View file

@ -55,7 +55,7 @@ public class ContainerFiller extends BuildCraftContainer {
}
@Override
public ItemStack transferStackInSlot(int i) {
public ItemStack func_82846_b(EntityPlayer pl, int i) {
ItemStack itemstack = null;
Slot slot = (Slot) inventorySlots.get(i);
if (slot != null && slot.getHasStack()) {

View file

@ -80,7 +80,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
// fontRenderer.drawString(library.owner + "'s Library", 6, 6,
// 0x404040);
String title = StringUtil.localize("tile.libraryBlock");

View file

@ -41,8 +41,8 @@ public class GuiBuilder extends GuiAdvancedInterface {
}
@Override
protected void drawGuiContainerForegroundLayer() {
super.drawGuiContainerForegroundLayer();
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtil.localize("tile.builderBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 12, 0x404040);

View file

@ -32,7 +32,7 @@ public class GuiFiller extends GuiBuildCraft {
}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtil.localize("tile.fillerBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.filling.resources"), 8, 74, 0x404040);

View file

@ -40,7 +40,7 @@ public class GuiTemplate extends GuiBuildCraft {
}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtil.localize("tile.architectBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 152, 0x404040);

View file

@ -4,7 +4,7 @@ import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import buildcraft.builders.TileArchitect;
@ -17,7 +17,7 @@ import cpw.mods.fml.common.network.Player;
public class PacketHandlerBuilders implements IPacketHandler {
@Override
public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player) {
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(packet.data));
try {

View file

@ -10,6 +10,7 @@
package buildcraft.core.gui;
import net.minecraft.src.Container;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.ItemStack;
import net.minecraft.src.Slot;
@ -22,7 +23,7 @@ public abstract class BuildCraftContainer extends Container {
}
@Override
public ItemStack transferStackInSlot(int i) {
public ItemStack func_82846_b(EntityPlayer pl, int i) {
ItemStack itemstack = null;
Slot slot = (Slot) inventorySlots.get(i);
if (slot != null && slot.getHasStack()) {

View file

@ -237,7 +237,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
protected void initLedgers(IInventory inventory) {}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
ledgerManager.drawLedgers(mouseX, mouseY);
}

View file

@ -4,7 +4,7 @@ import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
@ -29,7 +29,7 @@ public class PacketHandler implements IPacketHandler {
}
@Override
public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player) {
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(packet.data));
try {

View file

@ -20,6 +20,7 @@ import buildcraft.core.ItemBlockBuildCraft;
import buildcraft.core.network.BuildCraftPacket;
import net.minecraft.src.Block;
import net.minecraft.src.ChunkCoordinates;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityItem;
@ -144,10 +145,15 @@ public class CoreProxy {
}
@Override
public boolean canCommandSenderUseCommand(String var1) {
public boolean canCommandSenderUseCommand(int var1, String var2) {
return false;
}
@Override
public ChunkCoordinates func_82114_b() {
return null;
}
};
}

View file

@ -33,6 +33,7 @@ import buildcraft.transport.render.TileEntityPickupFX;
import net.minecraft.client.Minecraft;
import net.minecraft.src.Block;
import net.minecraft.src.ChunkCoordinates;
import net.minecraft.src.CreativeTabs;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityItem;
@ -145,7 +146,14 @@ public class CoreProxyClient extends CoreProxy {
private EntityPlayer createNewPlayer(World world) {
return new EntityPlayer(world) {
@Override public void sendChatToPlayer(String var1) {}
@Override public boolean canCommandSenderUseCommand(String var1) { return false; }
@Override
public boolean canCommandSenderUseCommand(int var1, String var2) {
return false;
}
@Override
public ChunkCoordinates func_82114_b() {
return null;
}
};
}

View file

@ -115,7 +115,7 @@ public class BlockEngine extends BlockContainer {
}
@Override
protected int damageDropped(int i) {
public int damageDropped(int i) {
return i;
}

View file

@ -93,7 +93,7 @@ public abstract class Engine {
energy += addition;
if (getEnergyStage() == EnergyStage.Explosion) {
tile.worldObj.createExplosion(null, tile.xCoord, tile.yCoord, tile.zCoord, explosionRange());
tile.worldObj.createExplosion(null, tile.xCoord, tile.yCoord, tile.zCoord, explosionRange(), true);
}
if (energy > maxEnergy) {

View file

@ -29,8 +29,8 @@ public class GuiCombustionEngine extends GuiEngine {
}
@Override
protected void drawGuiContainerForegroundLayer() {
super.drawGuiContainerForegroundLayer();
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtil.localize("tile.engineIron");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);

View file

@ -24,8 +24,8 @@ public class GuiSteamEngine extends GuiEngine {
}
@Override
protected void drawGuiContainerForegroundLayer() {
super.drawGuiContainerForegroundLayer();
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtil.localize("tile.engineStone");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);

View file

@ -139,7 +139,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
craftMatrix.setInventorySlotContents(i, stack);
}
ItemStack recipe = CraftingManager.getInstance().findMatchingRecipe(craftMatrix);
ItemStack recipe = CraftingManager.getInstance().func_82787_a(craftMatrix, worldObj);
return recipe;
}
@ -179,7 +179,7 @@ public class TileAutoWorkbench extends TileEntity implements ISpecialInventory {
craftMatrix.setInventorySlotContents(i, stack);
}
ItemStack resultStack = CraftingManager.getInstance().findMatchingRecipe(craftMatrix);
ItemStack resultStack = CraftingManager.getInstance().func_82787_a(craftMatrix, worldObj);
if (resultStack == null || !doRemove) {
resetPointers(pointerList);

View file

@ -46,7 +46,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer {
}
@Override
public void onPickupFromSlot(ItemStack itemstack) {
public void func_82870_a(EntityPlayer pl, ItemStack itemstack) {
CoreProxy.proxy.onCraftingPickup(thePlayer.worldObj, thePlayer, itemstack);
if (itemstack.itemID == Block.workbench.blockID) {
thePlayer.addStat(AchievementList.buildWorkBench, 1);
@ -112,7 +112,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer {
}
@Override
public ItemStack slotClick(int i, int j, boolean flag, EntityPlayer entityplayer) {
public ItemStack slotClick(int i, int j, int flag, EntityPlayer entityplayer) {
// This call ensures that the ouptut is correctly computed
craftResult.setInventorySlotContents(0, tile.findRecipe());
@ -128,7 +128,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer {
}
@Override
public ItemStack transferStackInSlot(int i) {
public ItemStack func_82846_b(EntityPlayer pl, int i) {
ItemStack itemstack = null;
Slot slot = (Slot) inventorySlots.get(i);
if (slot != null && slot.getHasStack()) {
@ -155,7 +155,7 @@ public class ContainerAutoWorkbench extends BuildCraftContainer {
slot.onSlotChanged();
}
if (itemstack1.stackSize != itemstack.stackSize) {
slot.onPickupFromSlot(itemstack1);
slot.func_82870_a(pl, itemstack1);
} else {
return null;
}

View file

@ -32,7 +32,7 @@ public class GuiAutoCrafting extends GuiBuildCraft {
}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtil.localize("tile.autoWorkbenchBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);

View file

@ -26,8 +26,8 @@ public class GuiHopper extends GuiContainer {
}
@Override
protected void drawGuiContainerForegroundLayer() {
super.drawGuiContainerForegroundLayer();
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
}
}

View file

@ -42,7 +42,7 @@ public class GuiRefinery extends GuiAdvancedInterface {
}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtil.localize("tile.refineryBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString("->", 63, 59, 0x404040);

View file

@ -9,7 +9,7 @@ import buildcraft.factory.TileRefinery;
import cpw.mods.fml.common.network.IPacketHandler;
import cpw.mods.fml.common.network.Player;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
@ -17,7 +17,7 @@ import net.minecraft.src.World;
public class PacketHandlerFactory implements IPacketHandler {
@Override
public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player) {
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(packet.data));
try {

View file

@ -259,7 +259,7 @@ public class TileAssemblyAdvancedWorkbench extends TileEntity implements IInvent
}
private void updateCraftingResults() {
outputSlot = CraftingManager.getInstance().findMatchingRecipe(new InventoryCrafting(
outputSlot = CraftingManager.getInstance().func_82787_a(new InventoryCrafting(
new Container() {
@Override
public boolean canInteractWith(EntityPlayer var1) {
@ -271,7 +271,7 @@ public class TileAssemblyAdvancedWorkbench extends TileEntity implements IInvent
public ItemStack getStackInSlot(int par1) {
return craftingSlots.getStackInSlot(par1);
}
});
},worldObj);
onInventoryChanged();
}

View file

@ -104,8 +104,8 @@ public class GuiAssemblyAdvancedWorkbench extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerForegroundLayer() {
super.drawGuiContainerForegroundLayer();
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtil.localize("tile.assemblyWorkbenchBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);

View file

@ -126,8 +126,8 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
}
@Override
protected void drawGuiContainerForegroundLayer() {
super.drawGuiContainerForegroundLayer();
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtil.localize("tile.assemblyTableBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 15, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);

View file

@ -17,7 +17,7 @@ import buildcraft.silicon.gui.ContainerAssemblyTable;
import net.minecraft.src.Container;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
@ -25,7 +25,7 @@ import net.minecraft.src.World;
public class PacketHandlerSilicon implements IPacketHandler {
@Override
public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player player) {
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(packet.data));
try {

View file

@ -533,7 +533,7 @@ public class BlockGenericPipe extends BlockContainer {
}
@Override
public boolean isIndirectlyPoweringTo(World world, int i, int j, int k, int l) {
public boolean isIndirectlyPoweringTo(IBlockAccess world, int i, int j, int k, int l) {
Pipe pipe = getPipe(world, i, j, k);
if (isValid(pipe))

View file

@ -52,7 +52,7 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
if (itemstack.stackSize == 0)
return false;
if (entityplayer.canPlayerEdit(i, j, k)
if (entityplayer.func_82246_f(i, j, k)
&& world.canPlaceEntityOnSide(blockID, i, j, k, false, side, entityplayer)) {
Pipe pipe = BlockGenericPipe.createPipe(shiftedIndex);

View file

@ -108,7 +108,7 @@ public class PipeTransportItems extends PipeTransport {
groupEntities();
if (travelingEntities.size() > BuildCraftTransport.maxItemsInPipes)
worldObj.createExplosion(null, xCoord, yCoord, zCoord, 1);
worldObj.createExplosion(null, xCoord, yCoord, zCoord, 1, false);
}
}

View file

@ -179,7 +179,7 @@ public class PipeTransportPower extends PipeTransport {
internalNextPower[from.ordinal()] += val;
if (internalNextPower[from.ordinal()] >= 1000)
worldObj.createExplosion(null, xCoord, yCoord, zCoord, 2);
worldObj.createExplosion(null, xCoord, yCoord, zCoord, 2, true);
}
}

View file

@ -14,6 +14,9 @@ import java.io.DataOutputStream;
import java.io.IOException;
import java.util.LinkedList;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.asm.SideOnly;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftTransport;
import buildcraft.api.core.Orientations;
@ -622,7 +625,8 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
}
@Override
public double getRenderDistance() {
return 24;
@SideOnly(Side.CLIENT)
public double func_82115_m() {
return 24 * 24;
}
}

View file

@ -45,7 +45,7 @@ public class GuiDiamondPipe extends GuiAdvancedInterface {
}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRenderer.drawString(filterInventory.getInvName(), getCenteredOffset(filterInventory.getInvName()), 6, 0x404040);
fontRenderer.drawString(StringUtil.localize("gui.inventory"), 8, ySize - 97, 0x404040);

View file

@ -237,7 +237,7 @@ public class GuiGateInterface extends GuiAdvancedInterface {
}
@Override
protected void drawGuiContainerForegroundLayer() {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String name = _container.getGateName();
fontRenderer.drawString(name, getCenteredOffset(name), 15, 0x404040);

View file

@ -6,7 +6,7 @@ import java.io.DataInputStream;
import net.minecraft.src.Container;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.EntityPlayerMP;
import net.minecraft.src.NetworkManager;
import net.minecraft.src.INetworkManager;
import net.minecraft.src.Packet250CustomPayload;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
@ -27,7 +27,7 @@ import cpw.mods.fml.common.network.Player;
public class PacketHandlerTransport implements IPacketHandler {
@Override
public void onPacketData(NetworkManager manager, Packet250CustomPayload packet2, Player player) {
public void onPacketData(INetworkManager manager, Packet250CustomPayload packet2, Player player) {
DataInputStream data = new DataInputStream(new ByteArrayInputStream(packet2.data));
try {
//NetClientHandler net = (NetClientHandler) network.getNetHandler();

View file

@ -488,7 +488,7 @@ public class RenderPipe extends TileEntitySpecialRenderer {
float scale = 1.0F;
if (true) {
int itemColour = Item.itemsList[itemstack.itemID].getColorFromDamage(itemstack.getItemDamage(), i);
int itemColour = Item.itemsList[itemstack.itemID].func_82790_a(itemstack, i);
float var18 = (itemColour >> 16 & 255) / 255.0F;
float var19 = (itemColour >> 8 & 255) / 255.0F;
float var20 = (itemColour & 255) / 255.0F;