progress with 1.7.2 port

This commit is contained in:
SpaceToad 2014-02-08 16:04:03 +01:00
parent 2bc0a85bbe
commit 20d08f393a
69 changed files with 408 additions and 361 deletions

View file

@ -74,7 +74,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStoppingEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
@ -95,7 +95,6 @@ import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.event.ForgeSubscribe;
@Mod(name = "BuildCraft Builders", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Builders", dependencies = DefaultProps.DEPENDENCY_CORE)
public class BuildCraftBuilders extends BuildCraftMod {
@ -377,15 +376,15 @@ public class BuildCraftBuilders extends BuildCraftMod {
return rootBptIndex;
}
/*public static ItemStack getBptItemStack(int id, int damage, String name) {
ItemStack stack = new ItemStack(id, 1, damage);
public static ItemStack getBptItemStack(Item item, int damage, String name) {
ItemStack stack = new ItemStack(item, 1, damage);
NBTTagCompound nbt = new NBTTagCompound();
if (name != null && !"".equals(name)) {
nbt.setString("BptName", name);
stack.setTagCompound(nbt);
}
return stack;
}*/
}
public static void addHook(IBuilderHook hook) {
if (!hooks.contains(hook)) {
@ -398,10 +397,10 @@ public class BuildCraftBuilders extends BuildCraftMod {
TilePathMarker.clearAvailableMarkersList();
}
@ForgeSubscribe
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre evt) {
if (evt.map.textureType == 0) {
if (evt.map.getTextureType() == 0) {
for (FillerPattern pattern : FillerPattern.patterns) {
pattern.registerIcon(evt.map);
}

View file

@ -14,7 +14,6 @@ import java.util.EnumMap;
import java.util.TreeMap;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFluid;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
@ -30,8 +29,8 @@ import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.IPlantable;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.IFluidBlock;
import buildcraft.api.core.BuildCraftAPI;
import buildcraft.api.core.IIconProvider;
@ -86,6 +85,7 @@ import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.FMLEmbeddedChannel;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
@ -299,7 +299,7 @@ public class BuildCraftCore extends BuildCraftMod {
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
for (Block block : Block.blocksList) {
if (block instanceof BlockFluid || block instanceof IFluidBlock || block instanceof IPlantable) {
if (block instanceof BlockFluidBase || block instanceof IFluidBlock || block instanceof IPlantable) {
BuildCraftAPI.softBlocks[block.blockID] = true;
}
}
@ -316,14 +316,14 @@ public class BuildCraftCore extends BuildCraftMod {
event.registerServerCommand(new CommandBuildCraft());
}
@ForgeSubscribe
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Pre event) {
if (event.map.textureType == 1) {
if (event.map.getTextureType() == 1) {
iconProvider = new CoreIconProvider();
iconProvider.registerIcons(event.map);
ActionTriggerIconProvider.INSTANCE.registerIcons(event.map);
} else if (event.map.textureType == 0) {
} else if (event.map.getTextureType() == 0) {
BuildCraftCore.redLaserTexture = event.map.registerIcon("buildcraft:blockRedLaser");
BuildCraftCore.blueLaserTexture = event.map.registerIcon("buildcraft:blockBlueLaser");
BuildCraftCore.stripesLaserTexture = event.map.registerIcon("buildcraft:blockStripesLaser");

View file

@ -40,6 +40,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
@ -58,7 +59,6 @@ import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
@ -233,10 +233,10 @@ public class BuildCraftEnergy extends BuildCraftMod {
}
}
@ForgeSubscribe
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void textureHook(TextureStitchEvent.Post event) {
if (event.map.textureType == 0) {
if (event.map.getTextureType() == 0) {
buildcraftFluidOil.setIcons(blockOil.getBlockTextureFromSide(1), blockOil.getBlockTextureFromSide(2));
buildcraftFluidFuel.setIcons(blockFuel.getBlockTextureFromSide(1), blockFuel.getBlockTextureFromSide(2));
}

View file

@ -50,7 +50,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -70,7 +70,6 @@ import net.minecraftforge.common.ForgeChunkManager;
import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Property;
import net.minecraftforge.event.ForgeSubscribe;
@Mod(name = "BuildCraft Factory", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Factory", dependencies = DefaultProps.DEPENDENCY_CORE)
public class BuildCraftFactory extends BuildCraftMod {
@ -122,8 +121,8 @@ public class BuildCraftFactory extends BuildCraftMod {
int quarryY = ticket.getModData().getInteger("quarryY");
int quarryZ = ticket.getModData().getInteger("quarryZ");
int blId = world.getBlockId(quarryX, quarryY, quarryZ);
if (blId == quarryBlock.blockID) {
Block block = world.getBlock(quarryX, quarryY, quarryZ);
if (block == quarryBlock) {
validTickets.add(ticket);
}
}
@ -326,10 +325,10 @@ public class BuildCraftFactory extends BuildCraftMod {
InterModComms.processIMC(event);
}
@ForgeSubscribe
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void loadTextures(TextureStitchEvent.Pre evt) {
if (evt.map.textureType == 0) {
if (evt.map.getTextureType() == 0) {
TextureMap terrainTextures = evt.map;
FactoryProxyClient.pumpTexture = terrainTextures.registerIcon("buildcraft:pump_tube");
FactoryProxyClient.drillTexture = terrainTextures.registerIcon("buildcraft:blockDrillTexture");

View file

@ -15,7 +15,7 @@ import buildcraft.core.network.BuildCraftPacket;
public class BuildCraftMod {
public EnumMap<Side, FMLEmbeddedChannel> channels;
public void sendToPlayers(BuildCraftPacket packet, World world, int x, int y, int z, int maxDistance) {
public void sendToPlayers(Packet packet, World world, int x, int y, int z, int maxDistance) {
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
channels.get(Side.SERVER).writeOutbound(packet);
}

View file

@ -116,7 +116,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.common.config.Property;
@Mod(version = Version.VERSION, modid = "BuildCraft|Transport", name = "Buildcraft Transport", dependencies = DefaultProps.DEPENDENCY_CORE)
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandlerTransport.class, connectionHandler = TransportConnectionHandler.class)
public class BuildCraftTransport extends BuildCraftMod {
public static BlockGenericPipe genericPipeBlock;
@ -207,9 +206,8 @@ public class BuildCraftTransport extends BuildCraftMod {
return testStrings(liquids, world, i, j, k);
}
private boolean testStrings(String[] excludedBlocks, World world, int i, int j, int k) {
int id = world.getBlockId(i, j, k);
Block block = Block.blocksList[id];
private boolean testStrings(String[] excludedBlocks, World world, int i, int j, int k) {
Block block = world.getBlock(i, j, k);
if (block == null)
return false;
@ -305,7 +303,7 @@ public class BuildCraftTransport extends BuildCraftMod {
pipePowerGold = buildPipe(DefaultProps.PIPE_POWER_GOLD_ID, PipePowerGold.class, "Golden Kinesis Pipe", Items.redstone, pipeItemsGold);
pipePowerDiamond = buildPipe(DefaultProps.PIPE_POWER_DIAMOND_ID, PipePowerDiamond.class, "Diamond Kinesis Pipe", Items.redstone, pipeItemsDiamond);
pipeStructureCobblestone = buildPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class, "Cobblestone Structure Pipe", Block.gravel, pipeItemsCobblestone);
pipeStructureCobblestone = buildPipe(DefaultProps.PIPE_STRUCTURE_COBBLESTONE_ID, PipeStructureCobblestone.class, "Cobblestone Structure Pipe", Blocks.gravel, pipeItemsCobblestone);
// Fix the recipe
// pipeItemsStipes = createPipe(DefaultProps.PIPE_ITEMS_STRIPES_ID, PipeItemsStripes.class, "Stripes Transport Pipe", new ItemStack(Item.dyePowder,

View file

@ -9,13 +9,13 @@
package buildcraft.builders;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.WorldEvent;
public class EventHandlerBuilders {
@ForgeSubscribe
@SubscribeEvent
public void handleWorldLoad(WorldEvent.Load event) {
// Temporary solution
// Please remove the world Load event when world Unload event gets implimented
@ -24,7 +24,7 @@ public class EventHandlerBuilders {
}
}
@ForgeSubscribe
@SubscribeEvent
public void handleWorldUnload(WorldEvent.Unload event) {
// When a world unloads clean from the list of available markers the ones
// that were on the unloaded world

View file

@ -47,7 +47,7 @@ public abstract class ItemBptBase extends ItemBuildCraft {
if (CoreProxy.proxy.isSimulating(world)) {
BptBase bpt = BuildCraftBuilders.getBptRootIndex().getBluePrint(itemStack.getItemDamage());
if (bpt != null)
return BuildCraftBuilders.getBptItemStack(itemStack.itemID, itemStack.getItemDamage(), bpt.getName());
return BuildCraftBuilders.getBptItemStack(itemStack.getItem(), itemStack.getItemDamage(), bpt.getName());
}
return itemStack;
}

View file

@ -72,7 +72,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
box.createLasers(worldObj, LaserKind.Stripes);
}
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
public void createBpt() {
@ -116,10 +116,10 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
ItemStack stack;
if (result.equals(BuildCraftBuilders.getBptRootIndex().getBluePrint(lastBptId))) {
result = BuildCraftBuilders.getBptRootIndex().getBluePrint(lastBptId);
stack = BuildCraftBuilders.getBptItemStack(items[0].itemID, lastBptId, result.getName());
stack = BuildCraftBuilders.getBptItemStack(items[0].getItem(), lastBptId, result.getName());
} else {
int bptId = BuildCraftBuilders.getBptRootIndex().storeBluePrint(result);
stack = BuildCraftBuilders.getBptItemStack(items[0].itemID, bptId, result.getName());
stack = BuildCraftBuilders.getBptItemStack(items[0].getItem(), bptId, result.getName());
lastBptId = bptId;
}
@ -179,7 +179,7 @@ public class TileArchitect extends TileBuildCraft implements IInventory {
name += c;
}
}
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
@Override

View file

@ -105,7 +105,7 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
for (int i = currentPage.size(); i < currentNames.length; i++) {
currentNames[i] = "";
}
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
public ArrayList<BptBase> getCurrentPage() {
@ -282,9 +282,9 @@ public class TileBlueprintLibrary extends TileBuildCraft implements IInventory {
if (progressOut == 100 && stack[3] == null) {
if (selected > -1 && selected < currentPage.size()) {
BptBase bpt = currentPage.get(selected);
setInventorySlotContents(3, BuildCraftBuilders.getBptItemStack(stack[2].itemID, bpt.position, bpt.getName()));
setInventorySlotContents(3, BuildCraftBuilders.getBptItemStack(stack[2].getItem(), bpt.position, bpt.getName()));
} else {
setInventorySlotContents(3, BuildCraftBuilders.getBptItemStack(stack[2].itemID, 0, null));
setInventorySlotContents(3, BuildCraftBuilders.getBptItemStack(stack[2].getItem(), 0, null));
}
setInventorySlotContents(2, null);
}

View file

@ -189,9 +189,9 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
path = ((TilePathMarker) tile).getPath();
for (BlockIndex b : path) {
worldObj.setBlock(b.x, b.y, b.z, 0);
worldObj.setBlock(b.x, b.y, b.z, null);
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.x, b.y, b.z, BuildCraftBuilders.pathMarkerBlock.blockID, 0);
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.x, b.y, b.z, BuildCraftBuilders.pathMarkerBlock, 0);
}
break;
@ -567,7 +567,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
box.reset();
if (CoreProxy.proxy.isSimulating(worldObj)) {
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
return;

View file

@ -7,6 +7,7 @@
*/
package buildcraft.builders;
import buildcraft.BuildCraftBuilders;
import buildcraft.BuildCraftCore;
import buildcraft.api.core.IAreaProvider;
import buildcraft.api.core.LaserKind;
@ -35,9 +36,11 @@ import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.triggers.ActionMachineControl;
import buildcraft.core.triggers.ActionMachineControl.Mode;
import buildcraft.core.utils.Utils;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@ -83,7 +86,7 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
if (!CoreProxy.proxy.isRenderWorld(worldObj) && box.isInitialized()) {
box.createLasers(worldObj, LaserKind.Stripes);
}
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
}
}
@ -135,7 +138,7 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
if (done) {
patternIterator = null;
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
} else if (powerHandler.getEnergyStored() >= POWER_USAGE) {
doWork(workProvider);
}
@ -235,7 +238,7 @@ public class TileFiller extends TileBuildCraft implements IInventory, IPowerRece
currentPattern = pattern;
patternIterator = null;
done = false;
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
}

View file

@ -93,7 +93,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
public void updateSignals() {
if (CoreProxy.proxy.isSimulating(worldObj)) {
showSignals = worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord);
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
}
@ -162,7 +162,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
}
}
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
void setVect(int n) {
@ -391,7 +391,7 @@ public class TileMarker extends TileBuildCraft implements IAreaProvider {
signals = null;
if (CoreProxy.proxy.isSimulating(worldObj) && markerOrigin != null && markerOrigin != this) {
markerOrigin.sendNetworkUpdate();
markerOrigin.sendNetworkUpdate(BuildCraftBuilders.instance);
}
}

View file

@ -1,5 +1,6 @@
package buildcraft.builders;
import buildcraft.BuildCraftBuilders;
import buildcraft.api.core.Position;
import buildcraft.core.BlockIndex;
import buildcraft.core.EntityLaser;
@ -7,10 +8,12 @@ import buildcraft.core.EntityPowerLaser;
import buildcraft.core.network.PacketUpdate;
import buildcraft.core.network.TileNetworkData;
import buildcraft.core.proxy.CoreProxy;
import java.io.IOException;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.TreeSet;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
@ -98,7 +101,7 @@ public class TilePathMarker extends TileMarker {
return;
tryingToConnect = !tryingToConnect; // Allow the user to stop the path marker from searching for new path markers to connect
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
@Override
@ -114,7 +117,7 @@ public class TilePathMarker extends TileMarker {
if (nearestPathMarker != null) {
createLaserAndConnect(nearestPathMarker);
tryingToConnect = false;
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftBuilders.instance);
}
}
}

View file

@ -79,7 +79,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
// fontRenderer.drawString(library.owner + "'s Library", 6, 6,
// 0x404040);
String title = StringUtils.localize("tile.libraryBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
int c = 0;
String[] currentNames = library.currentNames;
@ -98,7 +98,7 @@ public class GuiBlueprintLibrary extends GuiBuildCraft {
drawGradientRect(l1, i2 + 9 * c, l1 + 88, i2 + 9 * (c + 1), 0x80ffffff, 0x80ffffff);
}
fontRenderer.drawString(name, 9, 25 + 9 * c, 0x404040);
fontRendererObj.drawString(name, 9, 25 + 9 * c, 0x404040);
c++;
}
}

View file

@ -45,12 +45,12 @@ public class GuiBuilder extends GuiAdvancedInterface {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtils.localize("tile.builderBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 12, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.building.resources"), 8, 60, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
fontRendererObj.drawString(title, getCenteredOffset(title), 12, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.building.resources"), 8, 60, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
if (builder.isBuildingBlueprint()) {
fontRenderer.drawString(StringUtils.localize("gui.needed"), 185, 7, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.needed"), 185, 7, 0x404040);
}
drawForegroundSelection(par1, par2);

View file

@ -61,9 +61,9 @@ public class GuiFiller extends GuiBuildCraft {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.fillerBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.filling.resources"), 8, 74, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, 142, 0x404040);
GuiTools.drawCenteredString(fontRenderer, filler.currentPattern.getDisplayName(), 56);
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.filling.resources"), 8, 74, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, 142, 0x404040);
GuiTools.drawCenteredString(fontRendererObj, filler.currentPattern.getDisplayName(), 56);
}
}

View file

@ -43,13 +43,13 @@ public class GuiTemplate extends GuiBuildCraft {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.architectBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 152, 0x404040);
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 152, 0x404040);
if (editMode && ((new Date()).getTime() / 100) % 8 >= 4) {
fontRenderer.drawString(template.name + "|", 51, 62, 0x404040);
fontRendererObj.drawString(template.name + "|", 51, 62, 0x404040);
} else {
fontRenderer.drawString(template.name, 51, 62, 0x404040);
fontRendererObj.drawString(template.name, 51, 62, 0x404040);
}
}

View file

@ -1,5 +1,6 @@
package buildcraft.builders.network;
import buildcraft.BuildCraftBuilders;
import buildcraft.builders.TileArchitect;
import buildcraft.builders.TileBlueprintLibrary;
import buildcraft.core.network.BuildCraftChannelHandler;
@ -71,7 +72,7 @@ public class PacketHandlerBuilders extends BuildCraftChannelHandler {
break;
case TileBlueprintLibrary.COMMAND_LOCK_UPDATE:
tbl.locked = !tbl.locked;
tbl.sendNetworkUpdate();
tbl.sendNetworkUpdate(BuildCraftBuilders.instance);
break;
case TileBlueprintLibrary.COMMAND_NEXT:
tbl.setCurrentPage(true);
@ -91,7 +92,7 @@ public class PacketHandlerBuilders extends BuildCraftChannelHandler {
if (ySlot < tbl.getCurrentPage().size()) {
tbl.selected = ySlot;
}
tbl.sendNetworkUpdate();
tbl.sendNetworkUpdate(BuildCraftBuilders.instance);
}
}

View file

@ -35,8 +35,7 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench {
@Override
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
int blockId = world.getBlockId(x, y, z);
Block block = Block.blocksList[blockId];
Block block = world.getBlock(x, y, z);
if(block == null)
return false;

View file

@ -8,17 +8,20 @@
package buildcraft.core;
import buildcraft.BuildCraftCore;
import java.util.Random;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.TerrainGen;
public class SpringPopulate {
@ForgeSubscribe
@SubscribeEvent
public void populate(PopulateChunkEvent.Post event) {
boolean doGen = TerrainGen.populate(event.chunkProvider, event.world, event.rand, event.chunkX, event.chunkX, event.hasVillageGenerated, PopulateChunkEvent.Populate.EventType.CUSTOM);
@ -49,15 +52,15 @@ public class SpringPopulate {
int posZ = z + random.nextInt(16);
for(int i = 0; i < 5; i++) {
int candidate = world.getBlockId(posX, i, posZ);
if(candidate != Block.bedrock.blockID)
Block candidate = world.getBlock(posX, i, posZ);
if(candidate != Blocks.bedrock)
continue;
world.setBlock(posX, i + 1, posZ, BuildCraftCore.springBlock.blockID);
world.setBlock(posX, i + 1, posZ, BuildCraftCore.springBlock);
for(int j = i + 2; j < world.getActualHeight() - 10; j++) {
if(!boreToSurface(world, posX, j, posZ)) {
if(world.isAirBlock(posX, j, posZ))
world.setBlock(posX, j, posZ, Block.waterStill.blockID);
world.setBlock(posX, j, posZ, Blocks.water);
break;
}
}
@ -69,14 +72,14 @@ public class SpringPopulate {
if(world.isAirBlock(x, y, z))
return false;
int existing = world.getBlockId(x, y, z);
if(existing != Block.stone.blockID
&& existing != Block.dirt.blockID
&& existing != Block.gravel.blockID
&& existing != Block.grass.blockID)
Block existing = world.getBlock(x, y, z);
if(existing != Blocks.stone
&& existing != Blocks.dirt
&& existing != Blocks.gravel
&& existing != Blocks.grass)
return false;
world.setBlock(x, y, z, Block.waterStill.blockID);
world.setBlock(x, y, z, Blocks.water);
return true;
}
}

View file

@ -33,26 +33,26 @@ import net.minecraft.tileentity.TileEntity;
public class BptBlueprint extends BptBase {
private int[] idMapping = new int[Item.itemsList.length];
//private int[] idMapping = new int[Item.itemsList.length];
TreeSet<Integer> idsToMap = new TreeSet<Integer>();
public BptBlueprint() {
for (int i = 0; i < idMapping.length; ++i) {
idMapping[i] = i;
}
//for (int i = 0; i < idMapping.length; ++i) {
// idMapping[i] = i;
//}
}
public BptBlueprint(int sizeX, int sizeY, int sizeZ) {
super(sizeX, sizeY, sizeZ);
for (int i = 0; i < idMapping.length; ++i) {
idMapping[i] = i;
}
//for (int i = 0; i < idMapping.length; ++i) {
// idMapping[i] = i;
//}
}
public void readFromWorld(IBptContext context, TileEntity anchorTile, int x, int y, int z) {
BptSlot slot = new BptSlot();
/*BptSlot slot = new BptSlot();
slot.x = (int) (x - context.surroundingBox().pMin().x);
slot.y = (int) (y - context.surroundingBox().pMin().y);
@ -78,12 +78,12 @@ public class BptBlueprint extends BptBase {
t.printStackTrace();
BCLog.logger.throwing("BptBlueprint", "readFromWorld", t);
}
}*/
}
@Override
public void saveAttributes(BufferedWriter writer) throws IOException {
writer.write("sizeX:" + sizeX);
/*writer.write("sizeX:" + sizeX);
writer.newLine();
writer.write("sizeY:" + sizeY);
writer.newLine();
@ -188,12 +188,12 @@ public class BptBlueprint extends BptBase {
}
writer.write(":requirements");
writer.newLine();
writer.newLine();*/
}
@Override
public void loadAttribute(BufferedReader reader, String attr, String val) throws IOException, BptError {
if ("3.1.0".equals(version))
/*if ("3.1.0".equals(version))
throw new BptError("Blueprint format 3.1.0 is not supported anymore, can't load " + file);
// blockMap is still tested for being able to load pre 3.1.2 bpts
@ -321,7 +321,7 @@ public class BptBlueprint extends BptBase {
}
}
}
}
}*/
}
@Override
@ -333,15 +333,17 @@ public class BptBlueprint extends BptBase {
}
public ItemStack mapItemStack(ItemStack bptItemStack) {
ItemStack newStack = bptItemStack.copy();
//ItemStack newStack = bptItemStack.copy();
newStack.itemID = idMapping[newStack.itemID];
//newStack.itemID = idMapping[newStack.itemID];
return newStack;
//return newStack;
return null;
}
public int mapWorldId(int bptWorldId) {
return idMapping[bptWorldId];
//return idMapping[bptWorldId];
return 0;
}
public void storeId(int worldId) {
@ -370,6 +372,6 @@ public class BptBlueprint extends BptBase {
@Override
protected void copyTo(BptBase bpt) {
((BptBlueprint) bpt).idMapping = idMapping.clone();
//((BptBlueprint) bpt).idMapping = idMapping.clone();
}
}

View file

@ -21,7 +21,6 @@ import java.util.TreeSet;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.EnumGameType;
import net.minecraft.world.World;
public class BptBuilderBlueprint extends BptBuilderBase {
@ -40,10 +39,10 @@ public class BptBuilderBlueprint extends BptBuilderBase {
return -1;
else if (o1.stackSize < o2.stackSize)
return 1;
else if (o1.itemID > o2.itemID)
return -1;
else if (o1.itemID < o2.itemID)
return 1;
//else if (o1.itemID > o2.itemID)
// return -1;
//else if (o1.itemID < o2.itemID)
// return 1;
else if (o1.getItemDamage() > o2.getItemDamage())
return -1;
else if (o1.getItemDamage() < o2.getItemDamage())
@ -108,11 +107,11 @@ public class BptBuilderBlueprint extends BptBuilderBase {
slot.mode = Mode.Build;
if (slot.blockId != 0 && Block.blocksList[slot.blockId].isOpaqueCube()) {
/*if (slot.blockId != 0 && Block.blocksList[slot.blockId].isOpaqueCube()) {
primaryList.add(slot);
} else {
secondaryList.add(slot);
}
}*/
if (slot.blockId != 0) {
postProcessingList.add(slot.clone());
@ -190,7 +189,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
getNext = false;
}
if (getNext)
/*if (getNext)
if (slot.mode == Mode.ClearIfInvalid) {
if (!BlockUtil.isSoftBlock(world, slot.x, slot.y, slot.z)) {
result = slot;
@ -210,6 +209,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
} else {
failSlots.add(slot);
}
*/
}
list.addAll(failSlots);
@ -246,7 +246,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
}
}
for (ItemStack reqStk : tmpReq) {
/*for (ItemStack reqStk : tmpReq) {
for (ItemStack invStk : tmpInv) {
if (invStk != null && reqStk.itemID == invStk.itemID && invStk.stackSize > 0) {
@ -271,7 +271,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
if (reqStk.stackSize != 0)
return false;
}
}*/
return true;
}
@ -308,7 +308,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
ItemStack invStk = inv.getStackInSlot(i);
if (invStk != null && reqStk.itemID == invStk.itemID && invStk.stackSize > 0) {
/*if (invStk != null && reqStk.itemID == invStk.itemID && invStk.stackSize > 0) {
if (!invStk.isItemStackDamageable() && (reqStk.getItemDamage() != invStk.getItemDamage())) {
continue;
@ -331,7 +331,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
if (reqStk.stackSize == 0) {
break;
}
}
}*/
}
if (reqStk.stackSize != 0)
@ -347,7 +347,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
public void recomputeNeededItems() {
neededItems.clear();
TreeMap<ItemStack, Integer> computeStacks = new TreeMap<ItemStack, Integer>(new Comparator<ItemStack>() {
/*TreeMap<ItemStack, Integer> computeStacks = new TreeMap<ItemStack, Integer>(new Comparator<ItemStack>() {
@Override
public int compare(ItemStack o1, ItemStack o2) {
@ -362,7 +362,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
return 0;
}
});
});*/
for (BptSlot slot : primaryList) {
@ -376,7 +376,7 @@ public class BptBuilderBlueprint extends BptBuilderBase {
BCLog.logger.throwing("BptBuilderBlueprint", "recomputeIfNeeded", t);
}
for (ItemStack stack : stacks) {
/*for (ItemStack stack : stacks) {
if (stack == null || stack.itemID == 0) {
continue;
}
@ -390,13 +390,13 @@ public class BptBuilderBlueprint extends BptBuilderBase {
computeStacks.put(stack, num);
}
}
}*/
}
for (BptSlot slot : secondaryList) {
LinkedList<ItemStack> stacks = slot.getRequirements(context);
for (ItemStack stack : stacks) {
/*for (ItemStack stack : stacks) {
if (stack == null || stack.itemID <= 0 || stack.itemID >= Item.itemsList.length || stack.stackSize == 0 || stack.getItem() == null) {
continue;
}
@ -410,15 +410,16 @@ public class BptBuilderBlueprint extends BptBuilderBase {
computeStacks.put(stack, num);
}
}
}*/
}
for (ItemStack stack : computeStacks.keySet())
/*for (ItemStack stack : computeStacks.keySet())
if (stack.isItemStackDamageable()) {
neededItems.add(new ItemStack(stack.getItem()));
} else {
neededItems.add(new ItemStack(stack.itemID, computeStacks.get(stack), stack.getItemDamage()));
}
*/
}
@Override

View file

@ -121,7 +121,7 @@ public class BptBuilderTemplate extends BptBuilderBase {
BptSlot slot = list.getFirst();
// Note from CJ: I have no idea what this code is supposed to do, so I'm not touching it.
if (slot.blockId == world.getBlockId(slot.x, slot.y, slot.z)) {
/*if (slot.blockId == world.getBlockId(slot.x, slot.y, slot.z)) {
list.removeFirst();
} else if (slot.mode == Mode.ClearIfInvalid) {
result = slot;
@ -145,7 +145,7 @@ public class BptBuilderTemplate extends BptBuilderBase {
}
break;
}
}*/
}
return result;

View file

@ -17,40 +17,43 @@ public class BptSlot extends BptSlotInfo {
public ItemStack stackToUse;
public boolean isValid(IBptContext context) {
return BlueprintManager.blockBptProps[blockId].isValid(this, context);
//return BlueprintManager.blockBptProps[blockId].isValid(this, context);
return false;
}
public void rotateLeft(IBptContext context) {
BlueprintManager.blockBptProps[blockId].rotateLeft(this, context);
//BlueprintManager.blockBptProps[blockId].rotateLeft(this, context);
}
public boolean ignoreBuilding() {
return BlueprintManager.blockBptProps[blockId].ignoreBuilding(this);
//return BlueprintManager.blockBptProps[blockId].ignoreBuilding(this);
return false;
}
public void initializeFromWorld(IBptContext context, int xs, int ys, int zs) {
BlueprintManager.blockBptProps[blockId].initializeFromWorld(this, context, xs, ys, zs);
//BlueprintManager.blockBptProps[blockId].initializeFromWorld(this, context, xs, ys, zs);
}
public void postProcessing(IBptContext context) {
BlueprintManager.blockBptProps[blockId].postProcessing(this, context);
//BlueprintManager.blockBptProps[blockId].postProcessing(this, context);
}
public LinkedList<ItemStack> getRequirements(IBptContext context) {
LinkedList<ItemStack> res = new LinkedList<ItemStack>();
BlueprintManager.blockBptProps[blockId].addRequirements(this, context, res);
//BlueprintManager.blockBptProps[blockId].addRequirements(this, context, res);
return res;
}
public final void buildBlock(IBptContext context) {
BlueprintManager.blockBptProps[blockId].buildBlock(this, context);
//BlueprintManager.blockBptProps[blockId].buildBlock(this, context);
}
// returns what was used
public ItemStack useItem(IBptContext context, ItemStack req, ItemStack stack) {
return BlueprintManager.blockBptProps[blockId].useItem(this, context, req, stack);
//return BlueprintManager.blockBptProps[blockId].useItem(this, context, req, stack);
return null;
}
@SuppressWarnings("unchecked")

View file

@ -5,6 +5,7 @@ import buildcraft.core.inventory.InvUtils;
import buildcraft.core.utils.Utils;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
@ -70,12 +71,12 @@ public class FluidUtils {
return false;
}
public static int getFluidBlockId(Fluid fluid, boolean moving) {
public static Block getFluidBlock(Fluid fluid, boolean moving) {
if (fluid == FluidRegistry.WATER)
return moving ? Block.waterMoving.blockID : Block.waterStill.blockID;
return moving ? Blocks.flowing_lava : Blocks.water;
if (fluid == FluidRegistry.LAVA)
return moving ? Block.lavaMoving.blockID : Block.lavaStill.blockID;
return fluid.getBlockID();
return moving ? Blocks.flowing_lava : Blocks.lava;
return fluid.getBlock();
}
public static void pushFluidToConsumers(IFluidTank tank, int flowCap, TileBuffer[] tileBuffer) {

View file

@ -68,8 +68,8 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
int cornerY = (height - ySize) / 2;
itemRenderer.zLevel = 200F;
itemRenderer.renderItemAndEffectIntoGUI(fontRenderer, mc.renderEngine, item, cornerX + x, cornerY + y);
itemRenderer.renderItemOverlayIntoGUI(fontRenderer, mc.renderEngine, item, cornerX + x, cornerY + y);
itemRenderer.renderItemAndEffectIntoGUI(fontRendererObj, mc.renderEngine, item, cornerX + x, cornerY + y);
itemRenderer.renderItemOverlayIntoGUI(fontRendererObj, mc.renderEngine, item, cornerX + x, cornerY + y);
itemRenderer.zLevel = 0.0F;
}
}

View file

@ -46,7 +46,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
}
public FontRenderer getFontRenderer() {
return fontRenderer;
return fontRendererObj;
}
protected void initLedgers(IInventory inventory) {
@ -129,7 +129,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
}
protected int getCenteredOffset(String string, int xWidth) {
return (xWidth - fontRenderer.getStringWidth(string)) / 2;
return (xWidth - fontRendererObj.getStringWidth(string)) / 2;
}
/**
@ -214,7 +214,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
int y;
for (ToolTipLine tip : toolTips) {
y = this.fontRenderer.getStringWidth(tip.text);
y = this.fontRendererObj.getStringWidth(tip.text);
if (y > lenght) {
lenght = y;
@ -230,7 +230,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
}
this.zLevel = 300.0F;
itemRenderer.zLevel = 300.0F;
itemRendererObj.zLevel = 300.0F;
int var15 = -267386864;
this.drawGradientRect(x - 3, y - 4, x + lenght + 3, y - 3, var15, var15);
this.drawGradientRect(x - 3, y + var14 + 3, x + lenght + 3, y + var14 + 4, var15, var15);
@ -253,7 +253,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
line = "\u00a7" + Integer.toHexString(tip.color) + line;
}
this.fontRenderer.drawStringWithShadow(line, x, y, -1);
this.fontRendererObj.drawStringWithShadow(line, x, y, -1);
y += 10 + tip.getSpacing();
}
@ -331,9 +331,9 @@ public abstract class GuiBuildCraft extends GuiContainer {
int startY = mouseY - ((gui.height - gui.ySize) / 2) - 12;
String tooltip = ledger.getTooltip();
int textWidth = fontRenderer.getStringWidth(tooltip);
int textWidth = fontRendererObj.getStringWidth(tooltip);
drawGradientRect(startX - 3, startY - 3, startX + textWidth + 3, startY + 8 + 3, 0xc0000000, 0xc0000000);
fontRenderer.drawStringWithShadow(tooltip, startX, startY, -1);
fontRendererObj.drawStringWithShadow(tooltip, startX, startY, -1);
}
}

View file

@ -88,7 +88,7 @@ public class StackHelper {
int idBase = OreDictionary.getOreID(base);
if (idBase >= 0) {
for (ItemStack itemstack : OreDictionary.getOres(idBase)) {
if (comparison.itemID == itemstack.itemID && (itemstack.getItemDamage() == OreDictionary.WILDCARD_VALUE || comparison.getItemDamage() == itemstack.getItemDamage()))
if (comparison.getItem() == itemstack.getItem() && (itemstack.getItemDamage() == OreDictionary.WILDCARD_VALUE || comparison.getItemDamage() == itemstack.getItemDamage()))
return true;
}
}
@ -100,7 +100,7 @@ public class StackHelper {
public boolean isCraftingEquivalent(int oreID, ItemStack comparison) {
if (oreID >= 0) {
for (ItemStack itemstack : OreDictionary.getOres(oreID)) {
if (comparison.itemID == itemstack.itemID && (itemstack.getItemDamage() == OreDictionary.WILDCARD_VALUE || comparison.getItemDamage() == itemstack.getItemDamage()))
if (comparison.getItem() == itemstack.getItem() && (itemstack.getItemDamage() == OreDictionary.WILDCARD_VALUE || comparison.getItemDamage() == itemstack.getItemDamage()))
return true;
}
}
@ -134,7 +134,7 @@ public class StackHelper {
if (a == null || b == null) {
return false;
}
if (a.itemID != b.itemID) {
if (a.getItem() != b.getItem()) {
return false;
}
if (matchDamage && a.getHasSubtypes()) {

View file

@ -78,7 +78,7 @@ public class CoreProxy {
/* WRAPPER */
@SuppressWarnings("rawtypes")
public void feedSubBlocks(int id, CreativeTabs tab, List itemList) {
public void feedSubBlocks(Block block, CreativeTabs tab, List itemList) {
}
/* LOCALIZATION */

View file

@ -66,19 +66,19 @@ public class CoreProxyClient extends CoreProxy {
public void removeEntity(Entity entity) {
super.removeEntity(entity);
if (isRenderWorld(entity.getWorldObj())) {
((WorldClient) entity.getWorldObj()).removeEntityFromWorld(entity.entityId);
if (isRenderWorld(entity.worldObj)) {
((WorldClient) entity.worldObj).removeEntityFromWorld(entity.getEntityId());
}
}
/* WRAPPER */
@SuppressWarnings("rawtypes")
@Override
public void feedSubBlocks(int id, CreativeTabs tab, List itemList) {
if (Block.blocksList[id] == null)
public void feedSubBlocks(Block block, CreativeTabs tab, List itemList) {
if (block == null)
return;
Block.blocksList[id].getSubBlocks(id, tab, itemList);
block.getSubBlocks(Item.getItemFromBlock(block), tab, itemList);
}
/* LOCALIZATION */
@ -99,10 +99,10 @@ public class CoreProxyClient extends CoreProxy {
@Override
public String getItemDisplayName(ItemStack stack) {
if (Item.itemsList[stack.itemID] == null)
if (stack.getItem() == null)
return "";
return Item.itemsList[stack.itemID].getItemDisplayName(stack);
return stack.getDisplayName();
}
/* GFX */

View file

@ -23,7 +23,7 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
Tessellator tessellator = Tessellator.instance;
float f = block.getMixedBrightnessForBlock(world, x, y, z);
if (Block.lightValue[block.blockID] > 0) {
if (block.getLightValue() > 0) {
f = 1.0F;
}
tessellator.setColorOpaque_F(f, f, f);
@ -174,8 +174,6 @@ public class RenderingMarkers implements ISimpleBlockRenderingHandler {
}
i = block.getBlockTexture(iblockaccess, xCoord, yCoord, zCoord, 0);
minU = i.getMinU();
maxU = i.getMaxU();

View file

@ -28,6 +28,7 @@ import net.minecraft.world.ChunkPosition;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidRegistry;
@ -37,7 +38,7 @@ import net.minecraftforge.fluids.IFluidBlock;
public class BlockUtil {
public static List<ItemStack> getItemStackFromBlock(World world, int i, int j, int k) {
Block block = Block.blocksList[world.getBlockId(i, j, k)];
Block block = world.getBlock(i, j, k);
if (block == null)
return null;
@ -112,7 +113,7 @@ public class BlockUtil {
}
public static boolean isSoftBlock(World world, int x, int y, int z) {
return isSoftBlock(world.getBlockId(x, y, z), world, x, y, z);
return isSoftBlock(world.getBlock(x, y, z), world, x, y, z);
}
public static boolean isSoftBlock(Block block, World world, int x, int y, int z) {
@ -123,16 +124,15 @@ public class BlockUtil {
* Returns true if a block cannot be harvested without a tool.
*/
public static boolean isToughBlock(World world, int x, int y, int z) {
return !world.getBlockMaterial(x, y, z).isToolNotRequired();
return !world.getBlock(x, y, z).getMaterial().isToolNotRequired();
}
public static boolean isFullFluidBlock(World world, int x, int y, int z) {
return isFullFluidBlock(world.getBlockId(x, y, z), world, x, y, z);
return isFullFluidBlock(world.getBlock(x, y, z), world, x, y, z);
}
public static boolean isFullFluidBlock(int blockId, World world, int x, int y, int z) {
Block block = Block.blocksList[blockId];
if (block instanceof BlockFluid || block instanceof IFluidBlock)
public static boolean isFullFluidBlock(Block block, World world, int x, int y, int z) {
if (block instanceof BlockFluidBase || block instanceof IFluidBlock)
return world.getBlockMetadata(x, y, z) == 0;
return false;
}

View file

@ -40,9 +40,9 @@ public class CraftingHelper {
}
}
if (itemNum == 2 && item1.itemID == item2.itemID && item1.stackSize == 1 && item2.stackSize == 1 && Item.itemsList[item1.itemID].isRepairable())
if (itemNum == 2 && item1.getItem() == item2.getItem() && item1.stackSize == 1 && item2.stackSize == 1 && item1.getItem().isRepairable())
{
Item itemBase = Item.itemsList[item1.itemID];
Item itemBase = item1.getItem();
int item1Durability = itemBase.getMaxDamage() - item1.getItemDamageForDisplay();
int item2Durability = itemBase.getMaxDamage() - item2.getItemDamageForDisplay();
int repairAmt = item1Durability + item2Durability + itemBase.getMaxDamage() * 5 / 100;
@ -56,7 +56,7 @@ public class CraftingHelper {
ArrayList ingredients = new ArrayList<ItemStack>(2);
ingredients.add(item1);
ingredients.add(item2);
return new ShapelessRecipes(new ItemStack(item1.itemID, 1, newDamage),ingredients);
return new ShapelessRecipes(new ItemStack(item1.getItem(), 1, newDamage),ingredients);
}
// End repair recipe handler
else

View file

@ -356,8 +356,8 @@ public class Utils {
public static boolean checkLegacyPipesConnections(IBlockAccess blockAccess, int x1, int y1, int z1, int x2, int y2, int z2) {
Block b1 = Block.blocksList[blockAccess.getBlockId(x1, y1, z1)];
Block b2 = Block.blocksList[blockAccess.getBlockId(x2, y2, z2)];
Block b1 = blockAccess.getBlock(x1, y1, z1);
Block b2 = blockAccess.getBlock(x2, y2, z2);
if (!(b1 instanceof IFramePipeConnection) && !(b2 instanceof IFramePipeConnection)) {
return false;

View file

@ -8,15 +8,17 @@
package buildcraft.energy;
import buildcraft.BuildCraftEnergy;
import java.util.HashMap;
import java.util.Map;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.player.FillBucketEvent;
public class BucketHandler {
@ -27,7 +29,7 @@ public class BucketHandler {
private BucketHandler() {
}
@ForgeSubscribe
@SubscribeEvent
public void onBucketFill(FillBucketEvent event) {
ItemStack result = fillCustomBucket(event.world, event.target);
@ -43,7 +45,7 @@ public class BucketHandler {
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
Item bucket = buckets.get(Block.blocksList[blockID]);
Item bucket = Item.getItemFromBlock(block);
if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, null);
return new ItemStack(bucket);

View file

@ -15,6 +15,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.ForgeDirection;
import buildcraft.BuildCraftBuilders;
import buildcraft.BuildCraftEnergy;
import buildcraft.api.gates.IOverrideDefaultTriggers;
import buildcraft.api.gates.ITrigger;
@ -110,7 +111,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
if (energyStage != newStage) {
energyStage = newStage;
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftEnergy.instance);
}
}
@ -260,7 +261,7 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
return;
this.isPumping = isActive;
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftEnergy.instance);
}
public boolean isOrientationValid() {

View file

@ -7,6 +7,7 @@
*/
package buildcraft.energy;
import buildcraft.BuildCraftEnergy;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
@ -28,7 +29,7 @@ public class TileEngineLegacy extends TileEngine {
TileEntity newTile = worldObj.getTileEntity(xCoord, yCoord, zCoord);
if (newTile instanceof TileEngine) {
newTile.readFromNBT(nbt);
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftEnergy.instance);
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
}
}

View file

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

View file

@ -41,13 +41,13 @@ public abstract class GuiEngine extends GuiBuildCraft {
if (!isFullyOpened())
return;
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.energy"), x + 22, y + 8, headerColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.currentOutput") + ":", x + 22, y + 20, subheaderColour);
fontRenderer.drawString(String.format("%.1f MJ/t", engine.currentOutput), x + 22, y + 32, textColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour);
fontRenderer.drawString(String.format("%.1f MJ", engine.getEnergyStored()), x + 22, y + 56, textColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.heat") + ":", x + 22, y + 68, subheaderColour);
fontRenderer.drawString(String.format("%.2f \u00B0C", engine.getHeat()), x + 22, y + 80, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.energy"), x + 22, y + 8, headerColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.currentOutput") + ":", x + 22, y + 20, subheaderColour);
fontRendererObj.drawString(String.format("%.1f MJ/t", engine.currentOutput), x + 22, y + 32, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour);
fontRendererObj.drawString(String.format("%.1f MJ", engine.getEnergyStored()), x + 22, y + 56, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.heat") + ":", x + 22, y + 68, subheaderColour);
fontRendererObj.drawString(String.format("%.2f \u00B0C", engine.getHeat()), x + 22, y + 80, textColour);
}

View file

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

View file

@ -3,10 +3,10 @@ package buildcraft.energy.render;
import net.minecraft.client.particle.*;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.BlockFluid;
import net.minecraft.block.material.Material;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase;
@SideOnly(Side.CLIENT)
public class EntityDropParticleFX extends EntityFX {
@ -83,7 +83,7 @@ public class EntityDropParticleFX extends EntityFX {
Material material = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial();
if (material.isLiquid() || material.isSolid()) {
double d0 = (double) ((float) (MathHelper.floor_double(this.posY) + 1) - BlockFluid.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))));
double d0 = (double) ((float) (MathHelper.floor_double(this.posY) + 1) - BlockFluidBase.getFluidHeightPercent(this.worldObj.getBlockMetadata(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))));
if (this.posY < d0) {
this.setDead();

View file

@ -1,7 +1,7 @@
package buildcraft.energy.worldgen;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import buildcraft.BuildCraftEnergy;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.terraingen.WorldTypeEvent;
/**
@ -13,7 +13,7 @@ public class BiomeInitializer {
public BiomeInitializer() {
}
@ForgeSubscribe
@SubscribeEvent
public void initBiomes(WorldTypeEvent.InitBiomeGens event) {
if (BuildCraftEnergy.biomeOilDesert != null) {
event.newBiomeGens[0] = new GenLayerAddOilDesert(event.seed, 1500L, event.newBiomeGens[0]);

View file

@ -13,10 +13,12 @@ import buildcraft.BuildCraftEnergy;
import java.util.HashSet;
import java.util.Random;
import java.util.Set;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.block.BlockFlower;
import net.minecraft.block.BlockFluid;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.chunk.Chunk;
@ -27,10 +29,10 @@ import static net.minecraftforge.common.BiomeDictionary.Type.FROZEN;
import static net.minecraftforge.common.BiomeDictionary.Type.WASTELAND;
import net.minecraftforge.common.EnumHelper;
import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.terraingen.PopulateChunkEvent;
import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType;
import net.minecraftforge.event.terraingen.TerrainGen;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.IFluidBlock;
public class OilPopulate {
@ -57,7 +59,7 @@ public class OilPopulate {
excludedBiomes.add(BiomeGenBase.hell.biomeID);
}
@ForgeSubscribe
@SubscribeEvent
public void populate(PopulateChunkEvent.Pre event) {
boolean doGen = TerrainGen.populate(event.chunkProvider, event.world, event.rand, event.chunkX, event.chunkX, event.hasVillageGenerated, EVENT_TYPE);
@ -150,7 +152,7 @@ public class OilPopulate {
int distance = poolX * poolX + poolY * poolY + poolZ * poolZ;
if (distance <= radiusSq) {
world.setBlock(poolX + wellX, poolY + wellY, poolZ + wellZ, BuildCraftEnergy.blockOil.blockID, 0, distance == radiusSq ? 3 : 2);
world.setBlock(poolX + wellX, poolY + wellY, poolZ + wellZ, BuildCraftEnergy.blockOil, 0, distance == radiusSq ? 3 : 2);
}
}
}
@ -178,19 +180,19 @@ public class OilPopulate {
baseY = wellY;
}
if (makeSpring && world.getBlockId(wellX, baseY, wellZ) == Block.bedrock.blockID) {
world.setBlock(wellX, baseY, wellZ, BuildCraftCore.springBlock.blockID, 1, 3);
if (makeSpring && world.getBlock(wellX, baseY, wellZ) == Blocks.bedrock) {
world.setBlock(wellX, baseY, wellZ, BuildCraftCore.springBlock, 1, 3);
}
for (int y = baseY + 1; y <= maxHeight; ++y) {
world.setBlock(wellX, y, wellZ, BuildCraftEnergy.blockOil.blockID);
world.setBlock(wellX, y, wellZ, BuildCraftEnergy.blockOil);
}
if (type == GenType.LARGE) {
for (int y = wellY; y <= maxHeight - wellHeight / 2; ++y) {
world.setBlock(wellX + 1, y, wellZ, BuildCraftEnergy.blockOil.blockID);
world.setBlock(wellX - 1, y, wellZ, BuildCraftEnergy.blockOil.blockID);
world.setBlock(wellX, y, wellZ + 1, BuildCraftEnergy.blockOil.blockID);
world.setBlock(wellX, y, wellZ - 1, BuildCraftEnergy.blockOil.blockID);
world.setBlock(wellX + 1, y, wellZ, BuildCraftEnergy.blockOil);
world.setBlock(wellX - 1, y, wellZ, BuildCraftEnergy.blockOil);
world.setBlock(wellX, y, wellZ + 1, BuildCraftEnergy.blockOil);
world.setBlock(wellX, y, wellZ - 1, BuildCraftEnergy.blockOil);
}
}
@ -200,8 +202,8 @@ public class OilPopulate {
int lakeZ = z;
int lakeY = groundLevel;
int blockId = world.getBlockId(lakeX, lakeY, lakeZ);
if (blockId == biome.topBlock) {
Block block = world.getBlock(lakeX, lakeY, lakeZ);
if (block == biome.topBlock) {
generateSurfaceDeposit(world, rand, biome, lakeX, lakeY, lakeZ, 5 + rand.nextInt(10));
}
}
@ -253,38 +255,43 @@ public class OilPopulate {
}
}
private boolean isReplaceableFluid(World world, int x, int y, int z) {
int blockId = world.getBlockId(x, y, z);
Block block = Block.blocksList[blockId];
return (block instanceof BlockFluid || block instanceof IFluidBlock) && block.blockMaterial != Material.lava;
private boolean isReplaceableFluid(World world, int x, int y, int z) {
Block block = world.getBlock(x, y, z);
return (block instanceof BlockFluidBase || block instanceof IFluidBlock) && block.getMaterial() != Material.lava;
}
private boolean isOil(World world, int x, int y, int z) {
int blockId = world.getBlockId(x, y, z);
return (blockId == BuildCraftEnergy.blockOil.blockID);
Block block = world.getBlock(x, y, z);
return (block == BuildCraftEnergy.blockOil);
}
private boolean isReplaceableForLake(World world, BiomeGenBase biome, int x, int y, int z) {
int blockId = world.getBlockId(x, y, z);
if (blockId == 0) {
Block block = world.getBlock(x, y, z);
if (block == null) {
return true;
}
if (blockId == biome.fillerBlock || blockId == biome.topBlock) {
if (block == biome.fillerBlock || block == biome.topBlock) {
return true;
}
Block block = Block.blocksList[blockId];
if (!block.blockMaterial.blocksMovement()) {
if (!block.getMaterial().blocksMovement()) {
return true;
}
if (block.isGenMineableReplaceable(world, x, y, z, Block.stone.blockID)) {
return true;
}
if (block instanceof BlockFlower) {
return true;
}
if (!world.isBlockOpaqueCube(x, y, z)) {
return true;
}
return false;
}
@ -303,7 +310,7 @@ public class OilPopulate {
}
private void setOilWithProba(World world, BiomeGenBase biome, Random rand, float proba, int x, int y, int z, int depth) {
if (rand.nextFloat() <= proba && world.getBlockId(x, y - depth - 1, z) != 0) {
if (rand.nextFloat() <= proba && world.getBlock(x, y - depth - 1, z) != null) {
if (isOilAdjacent(world, x, y, z)) {
setOilColumnForLake(world, biome, x, y, z, depth, 3);
}
@ -315,20 +322,20 @@ public class OilPopulate {
if (!world.isAirBlock(x, y + 2, z)) {
return;
}
if (isReplaceableFluid(world, x, y, z) || world.isBlockSolidOnSide(x, y - 1, z, ForgeDirection.UP)) {
world.setBlock(x, y, z, BuildCraftEnergy.blockOil.blockID, 0, update);
if (isReplaceableFluid(world, x, y, z) || world.isSideSolid(x, y - 1, z, ForgeDirection.UP)) {
world.setBlock(x, y, z, BuildCraftEnergy.blockOil, 0, update);
} else {
return;
}
if (!world.isAirBlock(x, y + 1, z)) {
world.setBlock(x, y + 1, z, 0, 0, update);
world.setBlock(x, y + 1, z, null, 0, update);
}
for (int d = 1; d <= depth - 1; d++) {
if (isReplaceableFluid(world, x, y - d, z) || !world.isBlockSolidOnSide(x, y - d - 1, z, ForgeDirection.UP)) {
if (isReplaceableFluid(world, x, y - d, z) || !world.isSideSolid(x, y - d - 1, z, ForgeDirection.UP)) {
return;
}
world.setBlock(x, y - d, z, BuildCraftEnergy.blockOil.blockID, 0, 2);
world.setBlock(x, y - d, z, BuildCraftEnergy.blockOil, 0, 2);
}
}
}
@ -341,23 +348,28 @@ public class OilPopulate {
int trimmedZ = z & 15;
for (; y > 0; --y) {
int blockId = chunk.getBlockID(trimmedX, y, trimmedZ);
Block block = Block.blocksList[blockId];
if (blockId == 0) {
Block block = chunk.getBlock(trimmedX, y, trimmedZ);
if (block == null) {
continue;
}
if (block instanceof BlockFluid) {
if (block instanceof BlockFluidBase) {
return y;
}
if (block instanceof IFluidBlock) {
return y;
}
if (!block.blockMaterial.blocksMovement()) {
if (!block.getMaterial().blocksMovement()) {
continue;
}
if (block instanceof BlockFlower) {
continue;
}
return y - 1;
}

View file

@ -192,7 +192,7 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler {
}
private boolean canPlaceFluidAt(Block block, int x, int y, int z) {
return BlockUtil.isSoftBlock(block, worldObj, x, y, z) && !BlockUtil.isFullFluidBlock(blockId, worldObj, x, y, z);
return BlockUtil.isSoftBlock(block, worldObj, x, y, z) && !BlockUtil.isFullFluidBlock(block, worldObj, x, y, z);
}
public void onNeighborBlockChange(Block block) {

View file

@ -8,6 +8,7 @@
package buildcraft.factory;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftEnergy;
import buildcraft.BuildCraftFactory;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.gates.IAction;
@ -101,7 +102,7 @@ public class TilePump extends TileBuildCraft implements IMachine, IPowerReceptor
if (tube.posY - aimY > 0.01) {
tubeY = tube.posY - 0.01;
setTubePosition();
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
return;
}
@ -150,7 +151,7 @@ public class TilePump extends TileBuildCraft implements IMachine, IPowerReceptor
if (powered != p) {
powered = p;
if(!worldObj.isRemote)
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
}
}
@ -192,7 +193,7 @@ public class TilePump extends TileBuildCraft implements IMachine, IPowerReceptor
worldObj.spawnEntityInWorld(tube);
if (!worldObj.isRemote)
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
}
}

View file

@ -161,7 +161,7 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
}
if (CoreProxy.proxy.isSimulating(worldObj) && inProcess) {
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
}
if (inProcess || !isDigging)
return;
@ -536,7 +536,7 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
new Packet3Chat(ChatMessageComponent.createFromText(String.format("[BUILDCRAFT] The quarry at %d, %d, %d will not work because there are no more chunkloaders available",
xCoord, yCoord, zCoord))), (Player) placedBy);
}
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
return;
}
chunkTicket.getModData().setInteger("quarryX", xCoord);
@ -674,7 +674,7 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
createUtilsIfNeeded();
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
}
public void reinitalize() {
@ -855,7 +855,7 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
new Packet3Chat(ChatMessageComponent.createFromText(String.format("[BUILDCRAFT] The quarry at %d %d %d will keep %d chunks loaded", xCoord, yCoord, zCoord, chunks.size()))),
(Player) placedBy);
}
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
}
@Override

View file

@ -8,6 +8,7 @@
package buildcraft.factory;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.gates.IAction;
import buildcraft.api.power.IPowerReceptor;
@ -24,9 +25,11 @@ import buildcraft.core.network.PacketPayload;
import buildcraft.core.network.PacketPayloadStream;
import buildcraft.core.network.PacketUpdate;
import buildcraft.core.proxy.CoreProxy;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
@ -126,7 +129,7 @@ public class TileRefinery extends TileBuildCraft implements IFluidHandler, IPowe
}
if (updateNetworkTime.markTimeIfDelay(worldObj, BuildCraftCore.updateFactor))
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
isActive = false;

View file

@ -8,6 +8,7 @@
package buildcraft.factory;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.fluids.Tank;
@ -16,9 +17,11 @@ import buildcraft.core.network.PacketPayload;
import buildcraft.core.network.PacketPayloadStream;
import buildcraft.core.network.PacketUpdate;
import buildcraft.core.proxy.CoreProxy;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.EnumSkyBlock;
@ -56,7 +59,7 @@ public class TileTank extends TileBuildCraft implements IFluidHandler {
}
if (hasUpdate && tracker.markTimeIfDelay(worldObj, 2 * BuildCraftCore.updateFactor)) {
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftFactory.instance);
hasUpdate = false;
}
}

View file

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

View file

@ -43,10 +43,10 @@ public class GuiRefinery extends GuiAdvancedInterface {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.refineryBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString("->", 63, 59, 0x404040);
fontRenderer.drawString("<-", 106, 59, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString("->", 63, 59, 0x404040);
fontRendererObj.drawString("<-", 106, 59, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, (ySize - 96) + 2, 0x404040);
drawForegroundSelection(par1, par2);
}

View file

@ -137,7 +137,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
ItemStack stack = ItemStack.loadItemStackFromNBT(cpt);
for (AssemblyRecipe r : AssemblyRecipeManager.INSTANCE.getRecipes()) {
if (r.output.itemID == stack.itemID && r.output.getItemDamage() == stack.getItemDamage()) {
if (r.output.getItem() == stack.getItem() && r.output.getItemDamage() == stack.getItemDamage()) {
plannedOutput.add(r);
break;
}
@ -148,7 +148,7 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
ItemStack stack = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("recipe"));
for (AssemblyRecipe r : plannedOutput) {
if (r.output.itemID == stack.itemID && r.output.getItemDamage() == stack.getItemDamage()) {
if (r.output.getItem() == stack.getItem() && r.output.getItemDamage() == stack.getItemDamage()) {
setCurrentRecipe(r);
break;
}

View file

@ -9,6 +9,9 @@ package buildcraft.silicon;
import buildcraft.api.power.ILaserTarget;
import buildcraft.BuildCraftCore;
import buildcraft.BuildCraftFactory;
import buildcraft.BuildCraftMod;
import buildcraft.BuildCraftSilicon;
import buildcraft.api.core.Position;
import buildcraft.api.core.SafeTimeTracker;
import buildcraft.api.gates.IAction;
@ -22,8 +25,10 @@ import buildcraft.core.IMachine;
import buildcraft.core.TileBuildCraft;
import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.triggers.ActionMachineControl;
import java.util.LinkedList;
import java.util.List;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
@ -102,7 +107,7 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor, IAction
onPowerSent(power);
sendNetworkUpdate();
sendNetworkUpdate(BuildCraftSilicon.instance);
}
protected float getMaxPowerSent() {
@ -247,9 +252,9 @@ public class TileLaser extends TileBuildCraft implements IPowerReceptor, IAction
}
@Override
public void sendNetworkUpdate() {
public void sendNetworkUpdate(BuildCraftMod mod) {
if (networkTracker.markTimeIfDelay(worldObj)) {
super.sendNetworkUpdate();
super.sendNetworkUpdate(mod);
}
}

View file

@ -60,13 +60,13 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
if (!isFullyOpened())
return;
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.energy"), x + 22, y + 8, headerColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.assemblyCurrentRequired") + ":", x + 22, y + 20, subheaderColour);
fontRenderer.drawString(String.format("%2.1f MJ", table.clientRequiredEnergy), x + 22, y + 32, textColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour);
fontRenderer.drawString(String.format("%2.1f MJ", table.getEnergy()), x + 22, y + 56, textColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.assemblyRate") + ":", x + 22, y + 68, subheaderColour);
fontRenderer.drawString(String.format("%3.2f MJ/t", table.getRecentEnergyAverage() / 100.0f), x + 22, y + 80, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.energy"), x + 22, y + 8, headerColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.assemblyCurrentRequired") + ":", x + 22, y + 20, subheaderColour);
fontRendererObj.drawString(String.format("%2.1f MJ", table.clientRequiredEnergy), x + 22, y + 32, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour);
fontRendererObj.drawString(String.format("%2.1f MJ", table.getEnergy()), x + 22, y + 56, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.assemblyRate") + ":", x + 22, y + 68, subheaderColour);
fontRendererObj.drawString(String.format("%3.2f MJ/t", table.getRecentEnergyAverage() / 100.0f), x + 22, y + 80, textColour);
}
@ -138,8 +138,8 @@ public class GuiAssemblyTable extends GuiAdvancedInterface {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = StringUtils.localize("tile.assemblyTableBlock");
fontRenderer.drawString(title, getCenteredOffset(title), 15, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
fontRendererObj.drawString(title, getCenteredOffset(title), 15, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
drawForegroundSelection(par1, par2);
}

View file

@ -39,13 +39,13 @@ public abstract class GuiLaserTable extends GuiBuildCraft {
if (!isFullyOpened())
return;
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.energy"), x + 22, y + 8, headerColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.assemblyCurrentRequired") + ":", x + 22, y + 20, subheaderColour);
fontRenderer.drawString(String.format("%2.1f MJ", table.clientRequiredEnergy), x + 22, y + 32, textColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour);
fontRenderer.drawString(String.format("%2.1f MJ", table.getEnergy()), x + 22, y + 56, textColour);
fontRenderer.drawStringWithShadow(StringUtils.localize("gui.assemblyRate") + ":", x + 22, y + 68, subheaderColour);
fontRenderer.drawString(String.format("%3.2f MJ/t", table.getRecentEnergyAverage() / 100.0f), x + 22, y + 80, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.energy"), x + 22, y + 8, headerColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.assemblyCurrentRequired") + ":", x + 22, y + 20, subheaderColour);
fontRendererObj.drawString(String.format("%2.1f MJ", table.clientRequiredEnergy), x + 22, y + 32, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.stored") + ":", x + 22, y + 44, subheaderColour);
fontRendererObj.drawString(String.format("%2.1f MJ", table.getEnergy()), x + 22, y + 56, textColour);
fontRendererObj.drawStringWithShadow(StringUtils.localize("gui.assemblyRate") + ":", x + 22, y + 68, subheaderColour);
fontRendererObj.drawString(String.format("%3.2f MJ/t", table.getRecentEnergyAverage() / 100.0f), x + 22, y + 80, textColour);
}
@ -65,8 +65,8 @@ public abstract class GuiLaserTable extends GuiBuildCraft {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
super.drawGuiContainerForegroundLayer(par1, par2);
String title = table.getInventoryName();
fontRenderer.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
fontRendererObj.drawString(title, getCenteredOffset(title), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
}
@Override

View file

@ -1067,7 +1067,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
if (pipe == null)
return false;
Icon icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
IIcon icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
int sideHit = target.sideHit;
@ -1128,7 +1128,7 @@ public class BlockGenericPipe extends BlockBuildCraft {
if (pipe == null)
return false;
Icon icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
IIcon icon = pipe.getIconProvider().getIcon(pipe.getIconIndexForItem());
byte its = 4;
for (int i = 0; i < its; ++i) {

View file

@ -6,19 +6,24 @@ import buildcraft.api.recipes.BuildcraftRecipes;
import buildcraft.core.CreativeTabBuildCraft;
import buildcraft.core.ItemBuildCraft;
import buildcraft.core.proxy.CoreProxy;
import com.google.common.base.Strings;
import com.google.common.collect.Sets;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@ -65,7 +70,7 @@ public class ItemFacade extends ItemBuildCraft {
@SuppressWarnings({"unchecked", "rawtypes"})
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) {
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) {
// Do not call super, that would add a 0:0 facade
for (ItemStack stack : allFacades) {
itemList.add(stack.copy());
@ -103,15 +108,15 @@ public class ItemFacade extends ItemBuildCraft {
continue;
}
if (!(b.blockID == 20)) { //Explicitly allow glass
if (b.blockID == 7 //Bedrock
|| b.blockID == 2 //Grass block
|| b.blockID == 18 //Oak leaves
|| b.blockID == 19 //Sponge
|| b.blockID == 95 //Locked chest
|| b.blockID == Block.redstoneLampIdle.blockID
|| b.blockID == Block.redstoneLampActive.blockID
|| b.blockID == Block.pumpkinLantern.blockID) {
if (!(b == Blocks.glass)) {
if (b == Blocks.bedrock
|| b == Blocks.grass
|| b == Blocks.leaves
|| b == Blocks.sponge
|| b == Blocks.chest
|| b == Blocks.redstone_lamp
|| b == Blocks.lit_redstone_lamp
|| b == Blocks.lit_pumpkin) {
continue;
}
if (!b.isOpaqueCube() || b.hasTileEntity(0) || !b.renderAsNormalBlock()) {
@ -153,7 +158,7 @@ public class ItemFacade extends ItemBuildCraft {
}
public static void addFacade(ItemStack itemStack) {
ItemStack facade = getStack(itemStack.itemID, itemStack.getItemDamage());
ItemStack facade = getStack(Block.getBlockFromItem(itemStack.getItem()), itemStack.getItemDamage());
allFacades.add(facade);
ItemStack facade6 = facade.copy();
@ -161,19 +166,24 @@ public class ItemFacade extends ItemBuildCraft {
// 3 Structurepipes + this block makes 6 facades
BuildcraftRecipes.assemblyTable.addRecipe(8000, facade6, new ItemStack(BuildCraftTransport.pipeStructureCobblestone, 3), itemStack);
if (itemStack.itemID < Block.blocksList.length && Block.blocksList[itemStack.itemID] != null) {
Block bl = Block.blocksList[itemStack.itemID];
Block bl = Block.getBlockFromItem(itemStack.getItem());
// Special handling for logs
if (bl.getRenderType() == 31) {
ItemStack rotLog1 = getStack(itemStack.itemID, itemStack.getItemDamage() | 4);
ItemStack rotLog2 = getStack(itemStack.itemID, itemStack.getItemDamage() | 8);
allFacades.add(rotLog1);
allFacades.add(rotLog2);
}
}
// Special handling for logs
if (bl != null && bl.getRenderType() == 31) {
ItemStack rotLog1 = getStack(
Block.getBlockFromItem(itemStack.getItem()),
itemStack.getItemDamage() | 4);
ItemStack rotLog2 = getStack(
Block.getBlockFromItem(itemStack.getItem()),
itemStack.getItemDamage() | 8);
allFacades.add(rotLog1);
allFacades.add(rotLog2);
}
}
private static final ItemStack NO_MATCH = new ItemStack(0, 0, 0);
private static final Block NULL_BLOCK = null;
private static final ItemStack NO_MATCH = new ItemStack(NULL_BLOCK, 0, 0);
public class FacadeRecipe implements IRecipe {
@ -182,7 +192,7 @@ public class ItemFacade extends ItemBuildCraft {
ItemStack slotmatch = null;
for (int i = 0; i < inventorycrafting.getSizeInventory(); i++) {
ItemStack slot = inventorycrafting.getStackInSlot(i);
if (slot != null && slot.itemID == ItemFacade.this.itemID && slotmatch == null) {
if (slot != null && slot.getItem() == ItemFacade.this.itemID && slotmatch == null) {
slotmatch = slot;
} else if (slot != null) {
slotmatch = NO_MATCH;
@ -201,7 +211,7 @@ public class ItemFacade extends ItemBuildCraft {
ItemStack slotmatch = null;
for (int i = 0; i < inventorycrafting.getSizeInventory(); i++) {
ItemStack slot = inventorycrafting.getStackInSlot(i);
if (slot != null && slot.itemID == ItemFacade.this.itemID && slotmatch == null) {
if (slot != null && slot.getItem() == ItemFacade.this.itemID && slotmatch == null) {
slotmatch = slot;
} else if (slot != null) {
slotmatch = NO_MATCH;
@ -250,10 +260,6 @@ public class ItemFacade extends ItemBuildCraft {
}
public static ItemStack getStack(Block block, int metadata) {
return getStack(block.blockID, metadata);
}
public static ItemStack getStack(int blockID, int metadata) {
ItemStack stack = new ItemStack(BuildCraftTransport.facadeItem, 1, 0);
NBTTagCompound nbt = new NBTTagCompound("tag");
nbt.setInteger("meta", metadata);

View file

@ -6,15 +6,18 @@ import buildcraft.silicon.ItemRedstoneChipset.Chipset;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class ItemPipeWire extends ItemBuildCraft {
private Icon[] icons;
private IIcon[] icons;
public ItemPipeWire() {
super();
@ -37,7 +40,7 @@ public class ItemPipeWire extends ItemBuildCraft {
@SuppressWarnings({"rawtypes", "unchecked"})
@Override
@SideOnly(Side.CLIENT)
public void getSubItems(int id, CreativeTabs tab, List itemList) {
public void getSubItems(Item item, CreativeTabs tab, List itemList) {
for (PipeWire pipeWire : PipeWire.VALUES) {
itemList.add(pipeWire.getStack());
}
@ -46,7 +49,7 @@ public class ItemPipeWire extends ItemBuildCraft {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister) {
icons = new Icon[PipeWire.VALUES.length];
icons = new IIcon[PipeWire.VALUES.length];
for (PipeWire pipeWire : PipeWire.VALUES) {
icons[pipeWire.ordinal()] = par1IconRegister.registerIcon("buildcraft:" + pipeWire.getTag());
}

View file

@ -31,43 +31,43 @@ public class TransportProxyClient extends TransportProxy {
@Override
public void registerRenderers() {
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsWood.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsCobblestone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsQuartz.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsIron.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsGold.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDiamond.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsObsidian.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsEmerald.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsLapis.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDaizuli.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsEmzuli.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsWood, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsCobblestone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsQuartz, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsIron, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsGold, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDiamond, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsObsidian, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsEmerald, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsLapis, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsDaizuli, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsEmzuli, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsWood.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsCobblestone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsStone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsIron.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsGold.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsEmerald.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsWood, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsCobblestone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsStone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsIron, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsGold, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsEmerald, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerWood.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerCobblestone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerStone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerQuartz.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerIron.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerGold.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerDiamond.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeStructureCobblestone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerWood, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerCobblestone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerStone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerQuartz, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerIron, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerGold, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipePowerDiamond, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeStructureCobblestone, pipeItemRenderer);
// MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsStipes.shiftedIndex, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsVoid.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsVoid.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsSandstone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsSandstone.itemID, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsVoid, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsVoid, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeItemsSandstone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeFluidsSandstone, pipeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.facadeItem.itemID, facadeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.plugItem.itemID, plugItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeGate.itemID, gateItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.facadeItem, facadeItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.plugItem, plugItemRenderer);
MinecraftForgeClient.registerItemRenderer(BuildCraftTransport.pipeGate, gateItemRenderer);
TransportProxy.pipeModel = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(pipeWorldRenderer);

View file

@ -231,7 +231,7 @@ public final class TravelingItem {
}
public boolean isCorrupted() {
return itemStack == null || itemStack.stackSize <= 0 || Item.itemsList[itemStack.itemID] == null;
return itemStack == null || itemStack.stackSize <= 0 || itemStack.getItem() == null;
}
public boolean canBeGroupedWith(TravelingItem otherItem) {

View file

@ -32,7 +32,7 @@ public class BptBlockPipe extends BptBlock {
public void addRequirements(BptSlotInfo slot, IBptContext context, LinkedList<ItemStack> requirements) {
int pipeId = slot.cpt.getInteger("pipeId");
requirements.add(new ItemStack(pipeId, 1, 0));
//requirements.add(new ItemStack(pipeId, 1, 0));
// if (slot.cpt.hasKey("wire0")) {
// requirements.add(new ItemStack(BuildCraftTransport.pipeWire));
@ -59,9 +59,9 @@ public class BptBlockPipe extends BptBlock {
// }
// }
if (BuildCraftCore.itemBptProps[pipeId] != null) {
BuildCraftCore.itemBptProps[pipeId].addRequirements(slot, requirements);
}
//if (BuildCraftCore.itemBptProps[pipeId] != null) {
// BuildCraftCore.itemBptProps[pipeId].addRequirements(slot, requirements);
//}
}
@Override
@ -78,9 +78,9 @@ public class BptBlockPipe extends BptBlock {
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
int pipeId = slot.cpt.getInteger("pipeId");
if (BuildCraftCore.itemBptProps[pipeId] != null) {
BuildCraftCore.itemBptProps[pipeId].rotateLeft(slot, context);
}
//if (BuildCraftCore.itemBptProps[pipeId] != null) {
// BuildCraftCore.itemBptProps[pipeId].rotateLeft(slot, context);
//}
}
@Override
@ -125,11 +125,11 @@ public class BptBlockPipe extends BptBlock {
// }
// }
BlockGenericPipe.placePipe(pipe, context.world(), slot.x, slot.y, slot.z, slot.blockId, slot.meta);
//BlockGenericPipe.placePipe(pipe, context.world(), slot.x, slot.y, slot.z, slot.blockId, slot.meta);
if (BuildCraftCore.itemBptProps[pipeId] != null) {
BuildCraftCore.itemBptProps[pipeId].buildBlock(slot, context);
}
//if (BuildCraftCore.itemBptProps[pipeId] != null) {
// BuildCraftCore.itemBptProps[pipeId].buildBlock(slot, context);
//}
}
@Override
@ -169,9 +169,9 @@ public class BptBlockPipe extends BptBlock {
// }
// }
if (BuildCraftCore.itemBptProps[pipe.itemID] != null) {
BuildCraftCore.itemBptProps[pipe.itemID].initializeFromWorld(bptSlot, context, x, y, z);
}
//if (BuildCraftCore.itemBptProps[pipe.itemID] != null) {
// BuildCraftCore.itemBptProps[pipe.itemID].initializeFromWorld(bptSlot, context, x, y, z);
//}
}
}
@ -179,9 +179,9 @@ public class BptBlockPipe extends BptBlock {
public void postProcessing(BptSlotInfo slot, IBptContext context) {
int pipeId = slot.cpt.getInteger("pipeId");
if (BuildCraftCore.itemBptProps[pipeId] != null) {
BuildCraftCore.itemBptProps[pipeId].postProcessing(slot, context);
}
//if (BuildCraftCore.itemBptProps[pipeId] != null) {
// BuildCraftCore.itemBptProps[pipeId].postProcessing(slot, context);
//}
}
@Override

View file

@ -42,8 +42,8 @@ public class GuiDiamondPipe extends GuiBuildCraft {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRenderer.drawString(filterInventory.getInventoryName(), getCenteredOffset(filterInventory.getInventoryName()), 6, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
fontRendererObj.drawString(filterInventory.getInventoryName(), getCenteredOffset(filterInventory.getInventoryName()), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
}
@Override

View file

@ -62,8 +62,8 @@ public class GuiEmeraldPipe extends GuiBuildCraft {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
fontRenderer.drawString(filterInventory.getInventoryName(), getCenteredOffset(filterInventory.getInventoryName()), 6, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 93, 0x404040);
fontRendererObj.drawString(filterInventory.getInventoryName(), getCenteredOffset(filterInventory.getInventoryName()), 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 93, 0x404040);
}
@Override

View file

@ -39,7 +39,7 @@ public class GuiEmzuliPipe extends GuiBuildCraft {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("gui.pipes.emzuli.title");
fontRenderer.drawString(title, (xSize - fontRenderer.getStringWidth(title)) / 2, 6, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 93, 0x404040);
fontRendererObj.drawString(title, (xSize - fontRendererObj.getStringWidth(title)) / 2, 6, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 93, 0x404040);
}
}

View file

@ -57,7 +57,7 @@ public class GuiFilteredBuffer extends GuiContainer {
@Override
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String title = StringUtils.localize("tile.filteredBufferBlock");
int xPos = (xSize - fontRenderer.getStringWidth(title)) / 2;
fontRenderer.drawString(title, xPos, 10, 0x404040);
int xPos = (xSize - fontRendererObj.getStringWidth(title)) / 2;
fontRendererObj.drawString(title, xPos, 10, 0x404040);
}
}

View file

@ -228,8 +228,8 @@ public class GuiGateInterface extends GuiAdvancedInterface {
protected void drawGuiContainerForegroundLayer(int par1, int par2) {
String name = _container.getGateName();
fontRenderer.drawString(name, getCenteredOffset(name), 10, 0x404040);
fontRenderer.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
fontRendererObj.drawString(name, getCenteredOffset(name), 10, 0x404040);
fontRendererObj.drawString(StringUtils.localize("gui.inventory"), 8, ySize - 97, 0x404040);
drawForegroundSelection(par1, par2);
}

View file

@ -81,8 +81,8 @@ public class PipeItemsDiamond extends Pipe<PipeTransportItems> implements IClien
@Override
public boolean blockActivated(EntityPlayer entityplayer) {
if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID < Block.blocksList.length)
if (Block.blocksList[entityplayer.getCurrentEquippedItem().itemID] instanceof BlockGenericPipe)
if (entityplayer.getCurrentEquippedItem() != null)
if (Block.getBlockFromItem(entityplayer.getCurrentEquippedItem().getItem()) instanceof BlockGenericPipe)
return false;
if (!CoreProxy.proxy.isRenderWorld(container.getWorldObj())) {

View file

@ -83,8 +83,8 @@ public class PipeItemsEmerald extends PipeItemsWood implements IClientState, IGu
@Override
public boolean blockActivated(EntityPlayer entityplayer) {
if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID < Block.blocksList.length) {
if (Block.blocksList[entityplayer.getCurrentEquippedItem().itemID] instanceof BlockGenericPipe) {
if (entityplayer.getCurrentEquippedItem() != null) {
if (Block.getBlockFromItem(entityplayer.getCurrentEquippedItem().getItem()) instanceof BlockGenericPipe) {
return false;
}
}

View file

@ -57,8 +57,8 @@ public class PipeItemsEmzuli extends PipeItemsWood implements IGuiReturnHandler
@Override
public boolean blockActivated(EntityPlayer entityplayer) {
if (entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID < Block.blocksList.length) {
if (Block.blocksList[entityplayer.getCurrentEquippedItem().itemID] instanceof BlockGenericPipe) {
if (entityplayer.getCurrentEquippedItem() != null) {
if (Block.getBlockFromItem(entityplayer.getCurrentEquippedItem().getItem()) instanceof BlockGenericPipe) {
return false;
}
}