fixed last compilation errors
This commit is contained in:
parent
6692683e4f
commit
4dacb568ba
48 changed files with 232 additions and 226 deletions
|
@ -94,7 +94,7 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", acceptedMinecraftVersions = "[1.6.4,1.7)", dependencies = "required-after:Forge@[9.11.1.953,)")
|
||||
@Mod(name = "BuildCraft", version = Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", acceptedMinecraftVersions = "[1.7.2,1.8)", dependencies = "required-after:Forge@[9.11.1.953,)")
|
||||
public class BuildCraftCore extends BuildCraftMod {
|
||||
public static enum RenderMode {
|
||||
Full, NoDynamic
|
||||
|
@ -132,7 +132,6 @@ public class BuildCraftCore extends BuildCraftMod {
|
|||
public static int blockByEntityModel;
|
||||
public static int legacyPipeModel;
|
||||
public static int markerModel;
|
||||
public static int oilModel;
|
||||
public static BCTrigger triggerMachineActive = new TriggerMachine(true);
|
||||
public static BCTrigger triggerMachineInactive = new TriggerMachine(false);
|
||||
public static BCTrigger triggerEmptyInventory = new TriggerInventory(TriggerInventory.State.Empty);
|
||||
|
|
|
@ -19,6 +19,11 @@ public class BuildCraftMod {
|
|||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL);
|
||||
channels.get(Side.SERVER).writeOutbound(packet);
|
||||
}
|
||||
|
||||
public void sendToPlayers(BuildCraftPacket 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);
|
||||
}
|
||||
|
||||
public void sendToPlayer(EntityPlayer entityplayer, BuildCraftPacket packet) {
|
||||
channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER);
|
||||
|
|
|
@ -45,6 +45,7 @@ import buildcraft.transport.ItemPipeWire;
|
|||
import buildcraft.transport.gates.GateExpansionRedstoneFader;
|
||||
import buildcraft.transport.gates.GateExpansionTimer;
|
||||
import buildcraft.transport.network.PacketHandlerTransport;
|
||||
import buildcraft.transport.network.PacketPipeTransportTraveler;
|
||||
import buildcraft.transport.pipes.PipeFluidsCobblestone;
|
||||
import buildcraft.transport.pipes.PipeFluidsEmerald;
|
||||
import buildcraft.transport.pipes.PipeFluidsGold;
|
||||
|
@ -212,14 +213,17 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
|
||||
int meta = world.getBlockMetadata(i, j, k);
|
||||
|
||||
for (String excluded : excludedBlocks) {
|
||||
// TODO: the exculded list is not taken into account. This probably
|
||||
// needs to be migrated to an implementation based on names instead
|
||||
// of ids, low priority for now.
|
||||
/*for (String excluded : excludedBlocks) {
|
||||
if (excluded.equals(block.getUnlocalizedName()))
|
||||
return false;
|
||||
|
||||
String[] tokens = excluded.split(":");
|
||||
if (tokens[0].equals(Integer.toString(id)) && (tokens.length == 1 || tokens[1].equals(Integer.toString(meta))))
|
||||
return false;
|
||||
}
|
||||
}*/
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -473,4 +477,5 @@ public class BuildCraftTransport extends BuildCraftMod {
|
|||
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package buildcraft.api.core;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
/**
|
||||
|
@ -25,7 +26,10 @@ public class StackWrapper {
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 67 * hash + stack.itemID;
|
||||
|
||||
// TODO: this may have a speed impact. To be checked.
|
||||
hash = 67 * hash + Item.itemRegistry.getIDForObject(stack.getItem());
|
||||
|
||||
hash = 67 * hash + stack.getItemDamage();
|
||||
if (stack.stackTagCompound != null)
|
||||
hash = 67 * hash + stack.stackTagCompound.hashCode();
|
||||
|
|
|
@ -33,7 +33,7 @@ public class BlockMarker extends BlockContainer {
|
|||
public BlockMarker() {
|
||||
super(Material.circuits);
|
||||
|
||||
setLightValue(0.5F);
|
||||
setLightLevel(0.5F);
|
||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||
}
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
|||
for (BlockIndex b : path) {
|
||||
worldObj.setBlock(b.x, b.y, b.z, null);
|
||||
|
||||
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.x, b.y, b.z, BuildCraftBuilders.pathMarkerBlock, 0);
|
||||
BuildCraftBuilders.pathMarkerBlock.dropBlockAsItem(worldObj, b.x, b.y, b.z, 0, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -196,8 +196,11 @@ public abstract class FillerPattern implements IFillerPattern {
|
|||
|
||||
private static void breakBlock(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block != null)
|
||||
world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
if (block != null) {
|
||||
// TODO: fix sound
|
||||
//world.playSoundEffect(x + 0.5F, y + 0.5F, z + 0.5F, block.stepSound.getPlaceSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
|
||||
}
|
||||
|
||||
if (BuildCraftBuilders.fillerDestroy) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
} else if (BlockUtil.isToughBlock(world, x, y, z)) {
|
||||
|
|
|
@ -46,7 +46,10 @@ public class BlockSpring extends Block {
|
|||
super(Material.rock);
|
||||
setBlockUnbreakable();
|
||||
setResistance(6000000.0F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
|
||||
// TODO: set proper sound
|
||||
//setStepSound(soundStoneFootstep);
|
||||
|
||||
disableStats();
|
||||
setTickRandomly(true);
|
||||
setCreativeTab(CreativeTabBuildCraft.MACHINES.get());
|
||||
|
@ -98,7 +101,7 @@ public class BlockSpring extends Block {
|
|||
|
||||
// Prevents updates on chunk generation
|
||||
@Override
|
||||
public boolean func_82506_l() {
|
||||
public boolean func_149698_L () {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import buildcraft.core.utils.StringUtils;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -48,7 +49,7 @@ public class ItemBuildCraft extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldPassSneakingClickToBlock(World par2World, int par4, int par5, int par6) {
|
||||
public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
|
||||
return passSneakClick;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldPassSneakingClickToBlock(World par2World, int par4, int par5, int par6) {
|
||||
public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import cpw.mods.fml.common.gameevent.TickEvent.PlayerTickEvent;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
|
||||
public class TickHandlerCoreClient {
|
||||
|
||||
|
@ -28,12 +29,16 @@ public class TickHandlerCoreClient {
|
|||
// if(!Config.disableVersionCheck) {
|
||||
|
||||
if (Version.needsUpdateNoticeAndMarkAsSeen()) {
|
||||
player.addChatMessage(String.format("\u00A7cNew version of BuildCraft available: %s for Minecraft %s", Version.getRecommendedVersion(),
|
||||
CoreProxy.proxy.getMinecraftVersion()));
|
||||
player.addChatMessage(new ChatComponentText(
|
||||
String.format(
|
||||
"\u00A7cNew version of BuildCraft available: %s for Minecraft %s",
|
||||
Version.getRecommendedVersion(),
|
||||
CoreProxy.proxy.getMinecraftVersion())));
|
||||
for (String updateLine : Version.getChangelog()) {
|
||||
player.addChatMessage("\u00A79" + updateLine);
|
||||
player.addChatMessage(new ChatComponentText("\u00A79" + updateLine));
|
||||
}
|
||||
player.addChatMessage("\u00A7cThis message only displays once. Type '/buildcraft version' if you want to see it again.");
|
||||
player.addChatMessage(new ChatComponentText(
|
||||
"\u00A7cThis message only displays once. Type '/buildcraft version' if you want to see it again."));
|
||||
}
|
||||
|
||||
// }
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
*/
|
||||
package buildcraft.core;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.BuildCraftMod;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.core.network.BuildCraftPacket;
|
||||
import buildcraft.core.network.ISynchronizedTile;
|
||||
import buildcraft.core.network.PacketPayload;
|
||||
import buildcraft.core.network.PacketPayloadArrays;
|
||||
|
@ -98,7 +100,11 @@ public abstract class TileBuildCraft extends TileEntity implements ISynchronized
|
|||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
return new PacketTileUpdate(this).getPacket();
|
||||
// TODO: The description packet mechanism seems to have completely be replaced by other means, e.g.
|
||||
// the update packet. If confirmed, remove the buffer packet mechanism in Utils as well, that is
|
||||
// BuildCraftCore.bufferedDescriptions.
|
||||
//return new PacketTileUpdate(this).getPacket();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -107,14 +113,15 @@ public abstract class TileBuildCraft extends TileEntity implements ISynchronized
|
|||
}
|
||||
|
||||
@Override
|
||||
public Packet getUpdatePacket() {
|
||||
return new PacketTileUpdate(this).getPacket();
|
||||
public BuildCraftPacket getUpdatePacket() {
|
||||
return new PacketTileUpdate(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleDescriptionPacket(PacketUpdate packet) throws IOException {
|
||||
if (packet.payload instanceof PacketPayloadArrays)
|
||||
if (packet.payload instanceof PacketPayloadArrays) {
|
||||
descriptionPacket.fromPayload(this, (PacketPayloadArrays) packet.payload);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -140,11 +147,6 @@ public abstract class TileBuildCraft extends TileEntity implements ISynchronized
|
|||
owner = nbt.getString("owner");
|
||||
}
|
||||
|
||||
public boolean isInvNameLocalized() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return worldObj;
|
||||
}
|
||||
|
|
|
@ -7,15 +7,22 @@
|
|||
*/
|
||||
package buildcraft.core.gui;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.core.gui.slots.IPhantomSlot;
|
||||
import buildcraft.core.gui.slots.SlotBase;
|
||||
import buildcraft.core.gui.widgets.Widget;
|
||||
import buildcraft.core.inventory.StackHelper;
|
||||
import buildcraft.core.network.PacketGuiWidget;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufInputStream;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
|
@ -47,11 +54,18 @@ public abstract class BuildCraftContainer extends Container {
|
|||
|
||||
public void sendWidgetDataToClient(Widget widget, ICrafting player, byte[] data) {
|
||||
PacketGuiWidget pkt = new PacketGuiWidget(windowId, widgets.indexOf(widget), data);
|
||||
PacketDispatcher.sendPacketToPlayer(pkt.getPacket(), (Player) player);
|
||||
BuildCraftCore.instance.sendToPlayer((EntityPlayer) player, pkt);
|
||||
}
|
||||
|
||||
public void handleWidgetClientData(int widgetId, DataInputStream data) throws IOException {
|
||||
widgets.get(widgetId).handleClientPacketData(data);
|
||||
public void handleWidgetClientData(int widgetId, ByteBuf data) {
|
||||
InputStream input = new ByteBufInputStream (data);
|
||||
DataInputStream stream = new DataInputStream(input);
|
||||
|
||||
try {
|
||||
widgets.get(widgetId).handleClientPacketData(stream);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,10 +67,10 @@ public abstract class GuiAdvancedInterface extends GuiBuildCraft {
|
|||
int cornerX = (width - xSize) / 2;
|
||||
int cornerY = (height - ySize) / 2;
|
||||
|
||||
itemRenderer.zLevel = 200F;
|
||||
itemRenderer.renderItemAndEffectIntoGUI(fontRendererObj, mc.renderEngine, item, cornerX + x, cornerY + y);
|
||||
itemRenderer.renderItemOverlayIntoGUI(fontRendererObj, mc.renderEngine, item, cornerX + x, cornerY + y);
|
||||
itemRenderer.zLevel = 0.0F;
|
||||
itemRender.zLevel = 200F;
|
||||
itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.renderEngine, item, cornerX + x, cornerY + y);
|
||||
itemRender.renderItemOverlayIntoGUI(fontRendererObj, mc.renderEngine, item, cornerX + x, cornerY + y);
|
||||
itemRender.zLevel = 0.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
|
|||
}
|
||||
|
||||
this.zLevel = 300.0F;
|
||||
itemRendererObj.zLevel = 300.0F;
|
||||
itemRender.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);
|
||||
|
@ -259,7 +259,7 @@ public abstract class GuiBuildCraft extends GuiContainer {
|
|||
}
|
||||
|
||||
this.zLevel = 0.0F;
|
||||
itemRenderer.zLevel = 0.0F;
|
||||
itemRender.zLevel = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ public class InvUtils {
|
|||
public static ItemStack consumeItem(ItemStack stack) {
|
||||
if (stack.stackSize == 1) {
|
||||
if (stack.getItem().hasContainerItem()) {
|
||||
return stack.getItem().getContainerItemStack(stack);
|
||||
return stack.getItem().getContainerItem(stack);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -20,13 +20,13 @@ public abstract class InventoryWrapper implements ISidedInventory {
|
|||
@Override public ItemStack getStackInSlotOnClosing(int slotIndex) { return inventory.getStackInSlotOnClosing(slotIndex); }
|
||||
@Override public void setInventorySlotContents(int slotIndex, ItemStack itemstack) { inventory.setInventorySlotContents(slotIndex, itemstack); }
|
||||
@Override public String getInventoryName() { return inventory.getInventoryName(); }
|
||||
@Override public boolean isInvNameLocalized() { return inventory.isInvNameLocalized(); }
|
||||
@Override public int getInventoryStackLimit() { return inventory.getInventoryStackLimit(); }
|
||||
@Override public void markDirty() { inventory.markDirty(); }
|
||||
@Override public boolean isUseableByPlayer(EntityPlayer entityplayer) { return inventory.isUseableByPlayer(entityplayer); }
|
||||
@Override public void openInventory() { inventory.openInventory(); }
|
||||
@Override public void closeInventory() { inventory.closeInventory(); }
|
||||
@Override public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) { return inventory.isItemValidForSlot(slotIndex, itemstack); }
|
||||
@Override public boolean hasCustomInventoryName() { return inventory.hasCustomInventoryName(); };
|
||||
|
||||
/* STATIC HELPER */
|
||||
public static ISidedInventory getWrappedInventory(Object inventory) {
|
||||
|
|
|
@ -28,13 +28,4 @@ public class InventoryWrapperSimple extends InventoryWrapper {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ public interface ISynchronizedTile {
|
|||
|
||||
public void postPacketHandling(PacketUpdate packet);
|
||||
|
||||
public Packet getUpdatePacket();
|
||||
public BuildCraftPacket getUpdatePacket();
|
||||
|
||||
public Packet getDescriptionPacket();
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.io.DataInputStream;
|
|||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -87,7 +88,7 @@ public class PacketGuiReturn extends BuildCraftPacket {
|
|||
}
|
||||
|
||||
public void sendPacket() {
|
||||
PacketDispatcher.sendPacketToServer(getPacket());
|
||||
BuildCraftCore.instance.sendToServer(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -40,7 +40,7 @@ public class PacketGuiWidget extends BuildCraftPacket {
|
|||
public void writeData(ByteBuf data) {
|
||||
data.writeByte(windowId);
|
||||
data.writeByte(widgetId);
|
||||
data.write(payload);
|
||||
data.writeBytes(payload);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,8 +50,9 @@ public class PacketGuiWidget extends BuildCraftPacket {
|
|||
|
||||
EntityClientPlayerMP player = FMLClientHandler.instance().getClient().thePlayer;
|
||||
|
||||
if (player.openContainer instanceof BuildCraftContainer && player.openContainer.windowId == windowId)
|
||||
if (player.openContainer instanceof BuildCraftContainer && player.openContainer.windowId == windowId) {
|
||||
((BuildCraftContainer) player.openContainer).handleWidgetClientData(widgetId, data);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.io.DataInputStream;
|
|||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import buildcraft.core.utils.Utils;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
|
@ -26,53 +27,17 @@ public class PacketSlotChange extends PacketCoordinates {
|
|||
|
||||
@Override
|
||||
public void writeData(ByteBuf data) {
|
||||
|
||||
super.writeData(data);
|
||||
|
||||
data.writeInt(slot);
|
||||
if (stack != null) {
|
||||
data.writeInt(Item.itemRegistry.getIDForObject(stack.getItem()));
|
||||
data.writeInt(stack.stackSize);
|
||||
data.writeInt(stack.getItemDamage());
|
||||
|
||||
if(stack.hasTagCompound()) {
|
||||
byte[] compressed = CompressedStreamTools.compress(stack.getTagCompound());
|
||||
data.writeShort(compressed.length);
|
||||
data.write(compressed);
|
||||
} else {
|
||||
data.writeShort(0);
|
||||
}
|
||||
|
||||
} else {
|
||||
data.writeInt(0);
|
||||
}
|
||||
Utils.writeStack(data, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readData(ByteBuf data) {
|
||||
|
||||
super.readData(data);
|
||||
|
||||
this.slot = data.readInt();
|
||||
int id = data.readInt();
|
||||
|
||||
if (id != 0) {
|
||||
Item item = Item.getItemById(id);
|
||||
stack = new ItemStack(item, data.readInt(), data.readInt());
|
||||
|
||||
// Yes, this stuff may indeed have NBT and don't you forget it.
|
||||
short length = data.readShort();
|
||||
|
||||
if(length > 0) {
|
||||
byte[] compressed = new byte[length];
|
||||
data.readFully(compressed);
|
||||
stack.setTagCompound(CompressedStreamTools.decompress(compressed));
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
stack = null;
|
||||
}
|
||||
stack = Utils.readStack(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class PacketTileState extends PacketCoordinates {
|
|||
private List<StateWithId> stateList = new LinkedList<StateWithId>();
|
||||
|
||||
/**
|
||||
* Default constructor for incomming packets
|
||||
* Default constructor for incoming packets
|
||||
*/
|
||||
public PacketTileState() {
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ import java.io.File;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -35,6 +37,7 @@ import net.minecraft.network.NetHandlerPlayServer;
|
|||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
@ -138,10 +141,6 @@ public class CoreProxy {
|
|||
return 0;
|
||||
}
|
||||
|
||||
public void TakenFromCrafting(EntityPlayer thePlayer, ItemStack itemstack, IInventory craftMatrix) {
|
||||
GameRegistry.onItemCrafted(thePlayer, itemstack, craftMatrix);
|
||||
}
|
||||
|
||||
public Random createNewRandom(World world) {
|
||||
return new Random(world.getSeed());
|
||||
}
|
||||
|
@ -154,9 +153,9 @@ public class CoreProxy {
|
|||
}
|
||||
|
||||
private EntityPlayer createNewPlayer(World world) {
|
||||
EntityPlayer player = new EntityPlayer(world, "[BuildCraft]") {
|
||||
EntityPlayer player = new EntityPlayer(world, new GameProfile (null, "[BuildCraft]")) {
|
||||
@Override
|
||||
public void sendChatToPlayer(ChatMessageComponent var1) {
|
||||
public void addChatMessage(IChatComponent var1) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -173,11 +172,11 @@ public class CoreProxy {
|
|||
}
|
||||
|
||||
private EntityPlayer createNewPlayer(World world, int x, int y, int z) {
|
||||
EntityPlayer player = new EntityPlayer(world, "[BuildCraft]") {
|
||||
EntityPlayer player = new EntityPlayer(world, new GameProfile (null, "[BuildCraft]")) {
|
||||
@Override
|
||||
public void sendChatToPlayer(ChatMessageComponent var1) {
|
||||
public void addChatMessage(IChatComponent var1) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canCommandSenderUseCommand(int var1, String var2) {
|
||||
return false;
|
||||
|
@ -186,7 +185,7 @@ public class CoreProxy {
|
|||
@Override
|
||||
public ChunkCoordinates getPlayerCoordinates() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
};
|
||||
player.posX = x;
|
||||
player.posY = y;
|
||||
|
|
|
@ -21,7 +21,6 @@ import buildcraft.core.render.RenderLaser;
|
|||
import buildcraft.core.render.RenderRobot;
|
||||
import buildcraft.core.render.RenderingEntityBlocks;
|
||||
import buildcraft.core.render.RenderingMarkers;
|
||||
import buildcraft.core.render.RenderingOil;
|
||||
import buildcraft.transport.render.TileEntityPickupFX;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
@ -30,6 +29,8 @@ import cpw.mods.fml.common.registry.LanguageRegistry;
|
|||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.WorldClient;
|
||||
|
@ -45,6 +46,7 @@ import net.minecraft.network.NetHandlerPlayServer;
|
|||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class CoreProxyClient extends CoreProxy {
|
||||
|
@ -115,11 +117,9 @@ public class CoreProxyClient extends CoreProxy {
|
|||
BuildCraftCore.blockByEntityModel = RenderingRegistry.getNextAvailableRenderId();
|
||||
BuildCraftCore.legacyPipeModel = RenderingRegistry.getNextAvailableRenderId();
|
||||
BuildCraftCore.markerModel = RenderingRegistry.getNextAvailableRenderId();
|
||||
BuildCraftCore.oilModel = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
RenderingRegistry.registerBlockHandler(new RenderingEntityBlocks());
|
||||
RenderingRegistry.registerBlockHandler(BuildCraftCore.legacyPipeModel, new RenderingEntityBlocks());
|
||||
RenderingRegistry.registerBlockHandler(new RenderingOil());
|
||||
RenderingRegistry.registerBlockHandler(new RenderingMarkers());
|
||||
}
|
||||
|
||||
|
@ -131,12 +131,6 @@ public class CoreProxyClient extends CoreProxy {
|
|||
RenderingRegistry.registerEntityRenderingHandler(EntityRobot.class, new RenderRobot());
|
||||
}
|
||||
|
||||
/* NETWORKING */
|
||||
@Override
|
||||
public void sendToServer(Packet packet) {
|
||||
FMLClientHandler.instance().getClient().getNetHandler().addToSendQueue(packet);
|
||||
}
|
||||
|
||||
/* BUILDCRAFT PLAYER */
|
||||
@Override
|
||||
public String playerName() {
|
||||
|
@ -144,9 +138,9 @@ public class CoreProxyClient extends CoreProxy {
|
|||
}
|
||||
|
||||
private EntityPlayer createNewPlayer(World world) {
|
||||
EntityPlayer player = new EntityPlayer(world, "[BuildCraft]") {
|
||||
EntityPlayer player = new EntityPlayer(world, new GameProfile(null, "[BuildCraft]")) {
|
||||
@Override
|
||||
public void sendChatToPlayer(ChatMessageComponent var1) {
|
||||
public void addChatMessage(IChatComponent var1) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -159,6 +153,7 @@ public class CoreProxyClient extends CoreProxy {
|
|||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
return player;
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,9 @@ public class RenderEntityBlock extends Render {
|
|||
if (blockAccess == null)
|
||||
doLight = false;
|
||||
|
||||
if (doTessellating && !tessellator.isDrawing)
|
||||
// TODO: needs to cancel the test because the variable is now private... May need to
|
||||
// duplicate the tessellator code.
|
||||
//if (doTessellating && !tessellator.isDrawing)
|
||||
tessellator.startDrawingQuads();
|
||||
|
||||
float light = 0;
|
||||
|
@ -253,7 +255,9 @@ public class RenderEntityBlock extends Render {
|
|||
if (info.renderSide[5])
|
||||
renderBlocks.renderFaceXPos(info.baseBlock, x, y, z, info.getBlockTextureFromSide(5));
|
||||
|
||||
if (doTessellating && tessellator.isDrawing)
|
||||
// TODO: needs to cancel the test because the variable is now private... May need to
|
||||
// duplicate the tessellator code.
|
||||
//if (doTessellating && tessellator.isDrawing)
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
package buildcraft.core.render;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderingOil implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
if (block.getRenderType() != BuildCraftCore.oilModel)
|
||||
return true;
|
||||
|
||||
renderer.renderBlockFluids(block, x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BuildCraftCore.oilModel;
|
||||
}
|
||||
}
|
|
@ -22,7 +22,9 @@ public class BCLog {
|
|||
public static final Logger logger = Logger.getLogger("Buildcraft");
|
||||
|
||||
public static void initLog() {
|
||||
logger.setParent(FMLLog.getLogger());
|
||||
// TODO: check if the code below is still useful and remove otherwise.
|
||||
//logger.setParent(FMLLog.getLogger());
|
||||
|
||||
logger.info("Starting BuildCraft " + Version.getVersion());
|
||||
logger.info("Copyright (c) SpaceToad, 2011");
|
||||
logger.info("http://www.mod-buildcraft.com");
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.play.server.S27PacketExplosion;
|
||||
import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -190,7 +191,7 @@ public class BlockUtil {
|
|||
continue;
|
||||
|
||||
if (player.getDistanceSq(x, y, z) < 4096) {
|
||||
((EntityPlayerMP) player).playerNetServerHandler.sendPacketToPlayer(new Packet60Explosion(x + .5, y + .5, z + .5, 3f, explosion.affectedBlockPositions, null));
|
||||
((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S27PacketExplosion(x + .5, y + .5, z + .5, 3f, explosion.affectedBlockPositions, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,22 +75,22 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int getFireSpreadSpeed(World world, int x, int y, int z, int metadata, ForgeDirection face) {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return flammable ? 300 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face) {
|
||||
public int getFlammability(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return flammability;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, int metadata, ForgeDirection face) {
|
||||
public boolean isFlammable(IBlockAccess world, int x, int y, int z, ForgeDirection face) {
|
||||
return flammable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFireSource(World world, int x, int y, int z, int metadata, ForgeDirection side) {
|
||||
public boolean isFireSource(World world, int x, int y, int z, ForgeDirection side) {
|
||||
return flammable && flammability == 0;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,10 @@ public class BlockBuildcraftFluid extends BlockFluidClassic {
|
|||
public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
super.randomDisplayTick(world, x, y, z, rand);
|
||||
|
||||
if (rand.nextInt(10) == 0 && world.doesBlockHaveSolidTopSurface(x, y - 1, z) && !world.getBlock(x, y - 2, z).getMaterial().blocksMovement()) {
|
||||
if (rand.nextInt(10) == 0
|
||||
&& World.doesBlockHaveSolidTopSurface(world, x, y - 1, z)
|
||||
&& !world.getBlock(x, y - 2, z).getMaterial().blocksMovement()) {
|
||||
|
||||
double px = (double) ((float) x + rand.nextFloat());
|
||||
double py = (double) y - 1.05D;
|
||||
double pz = (double) ((float) z + rand.nextFloat());
|
||||
|
|
|
@ -3,6 +3,7 @@ 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.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -80,10 +81,16 @@ public class EntityDropParticleFX extends EntityFX {
|
|||
this.motionZ *= 0.699999988079071D;
|
||||
}
|
||||
|
||||
Material material = this.worldObj.getBlock(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)).getMaterial();
|
||||
int x = MathHelper.floor_double(this.posX);
|
||||
int y = MathHelper.floor_double(this.posY);
|
||||
int z = MathHelper.floor_double(this.posZ);
|
||||
Block block = worldObj.getBlock(x, y, z);
|
||||
|
||||
Material material = block.getMaterial();
|
||||
|
||||
if (material.isLiquid() || material.isSolid()) {
|
||||
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))));
|
||||
double d0 = (double) ((float) (MathHelper.floor_double(this.posY) + 1) - ((BlockFluidBase) block)
|
||||
.getFilledPercentage(worldObj, x, y, z));
|
||||
|
||||
if (this.posY < d0) {
|
||||
this.setDead();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package buildcraft.energy.worldgen;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.BiomeGenDesert;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
|
@ -9,6 +10,8 @@ import net.minecraftforge.common.BiomeDictionary;
|
|||
*/
|
||||
public class BiomeGenOilDesert extends BiomeGenDesert {
|
||||
|
||||
protected static final BiomeGenBase.Height height_OilDesert = new BiomeGenBase.Height(0.1F, 0.2F);
|
||||
|
||||
public static BiomeGenOilDesert makeBiome(int id) {
|
||||
BiomeGenOilDesert biome = new BiomeGenOilDesert(id);
|
||||
BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.DESERT);
|
||||
|
@ -23,6 +26,6 @@ public class BiomeGenOilDesert extends BiomeGenDesert {
|
|||
setBiomeName("Desert Oil Field");
|
||||
setDisableRain();
|
||||
setTemperatureRainfall(2.0F, 0.0F);
|
||||
setMinMaxHeight(0.1F, 0.2F);
|
||||
setHeight(height_OilDesert);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package buildcraft.energy.worldgen;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.biome.BiomeGenOcean;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
|
@ -9,6 +10,8 @@ import net.minecraftforge.common.BiomeDictionary;
|
|||
*/
|
||||
public class BiomeGenOilOcean extends BiomeGenOcean {
|
||||
|
||||
protected static final BiomeGenBase.Height height_OilOcean = new BiomeGenBase.Height(0.1F, 0.2F);
|
||||
|
||||
public static BiomeGenOilOcean makeBiome(int id) {
|
||||
BiomeGenOilOcean biome = new BiomeGenOilOcean(id);
|
||||
BiomeDictionary.registerBiomeType(biome, BiomeDictionary.Type.WATER);
|
||||
|
@ -21,6 +24,6 @@ public class BiomeGenOilOcean extends BiomeGenOcean {
|
|||
super(id);
|
||||
setBiomeName("Ocean Oil Field");
|
||||
setColor(112);
|
||||
setMinMaxHeight(-1.0F, 0.4F);
|
||||
setHeight(height_Oceans);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType
|
|||
import net.minecraftforge.event.terraingen.TerrainGen;
|
||||
import net.minecraftforge.fluids.BlockFluidBase;
|
||||
import net.minecraftforge.fluids.IFluidBlock;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
public class OilPopulate {
|
||||
|
||||
|
@ -279,15 +280,17 @@ public class OilPopulate {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (block.isGenMineableReplaceable(world, x, y, z, Blocks.stone)) {
|
||||
return true;
|
||||
}
|
||||
// TODO: The code below doesn't seem to have been replaced by something
|
||||
// in 1.7.2 - to update or remove.
|
||||
//if (block.isGenMineableReplaceable(world, x, y, z, Blocks.stone)) {
|
||||
// return true;
|
||||
//}
|
||||
|
||||
if (block instanceof BlockFlower) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!world.isBlockOpaqueCube(x, y, z)) {
|
||||
if (!block.isOpaqueCube()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,9 @@ public class BlockMiningWell extends BlockBuildCraft {
|
|||
|
||||
setHardness(5F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundStoneFootstep);
|
||||
|
||||
// TODO: set proper sound
|
||||
//setStepSound(soundStoneFootstep);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,7 +43,8 @@ public class BlockQuarry extends BlockBuildCraft {
|
|||
|
||||
setHardness(10F);
|
||||
setResistance(10F);
|
||||
setStepSound(soundAnvilFootstep);
|
||||
// TODO: set proper sound
|
||||
//setStepSound(soundAnvilFootstep);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -197,12 +198,6 @@ public class BlockQuarry extends BlockBuildCraft {
|
|||
return false;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Override
|
||||
public void addCreativeItems(ArrayList itemList) {
|
||||
itemList.add(new ItemStack(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister par1IconRegister) {
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
*/
|
||||
package buildcraft.factory;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import buildcraft.core.TileBuildCraft;
|
||||
import buildcraft.core.inventory.InvUtils;
|
||||
import buildcraft.core.inventory.InventoryConcatenator;
|
||||
|
@ -62,7 +64,7 @@ public class TileAutoWorkbench extends TileBuildCraft implements ISidedInventory
|
|||
private final class InternalPlayer extends EntityPlayer {
|
||||
|
||||
public InternalPlayer() {
|
||||
super(TileAutoWorkbench.this.worldObj, "[BuildCraft]");
|
||||
super(TileAutoWorkbench.this.worldObj, new GameProfile(null, "[BuildCraft]"));
|
||||
posX = TileAutoWorkbench.this.xCoord;
|
||||
posY = TileAutoWorkbench.this.yCoord + 1;
|
||||
posZ = TileAutoWorkbench.this.zCoord;
|
||||
|
@ -278,11 +280,6 @@ public class TileAutoWorkbench extends TileBuildCraft implements ISidedInventory
|
|||
public void closeInventory() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
if (slot == SLOT_RESULT)
|
||||
|
|
|
@ -12,11 +12,14 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.world.ChunkCoordIntPair;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
|
@ -429,7 +432,8 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
|
|||
}
|
||||
}
|
||||
|
||||
worldObj.playAuxSFXAtEntity(null, 2001, i, j, k, blockId + (worldObj.getBlockMetadata(i, j, k) << 12));
|
||||
// FIXME: fix sound here
|
||||
//worldObj.playAuxSFXAtEntity(null, 2001, i, j, k, blockId + (worldObj.getBlockMetadata(i, j, k) << 12));
|
||||
worldObj.setBlockToAir(i, j, k);
|
||||
}
|
||||
|
||||
|
@ -527,9 +531,11 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
|
|||
if (chunkTicket == null) {
|
||||
isAlive = false;
|
||||
if (placedBy != null && CoreProxy.proxy.isSimulating(worldObj)) {
|
||||
PacketDispatcher.sendPacketToPlayer(
|
||||
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);
|
||||
((EntityPlayerMP) placedBy)
|
||||
.addChatMessage(new ChatComponentText(
|
||||
String.format(
|
||||
"[BUILDCRAFT] The quarry at %d, %d, %d will not work because there are no more chunkloaders available",
|
||||
xCoord, yCoord, zCoord)));
|
||||
}
|
||||
sendNetworkUpdate(BuildCraftFactory.instance);
|
||||
return;
|
||||
|
@ -556,10 +562,14 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
|
|||
|
||||
if (xSize < 3 || zSize < 3 || ((xSize * zSize) >> 8) >= chunkTicket.getMaxChunkListDepth()) {
|
||||
if (placedBy != null) {
|
||||
PacketDispatcher.sendPacketToPlayer(
|
||||
new Packet3Chat(ChatMessageComponent.createFromText(String.format("Quarry size is outside of chunkloading bounds or too small %d %d (%d)", xSize, zSize,
|
||||
chunkTicket.getMaxChunkListDepth()))), (Player) placedBy);
|
||||
((EntityPlayerMP) placedBy)
|
||||
.addChatMessage(new ChatComponentText(
|
||||
String.format(
|
||||
"Quarry size is outside of chunkloading bounds or too small %d %d (%d)",
|
||||
xSize, zSize,
|
||||
chunkTicket.getMaxChunkListDepth())));
|
||||
}
|
||||
|
||||
a = new DefaultAreaProvider(xCoord, yCoord, zCoord, xCoord + 10, yCoord + 4, zCoord + 10);
|
||||
|
||||
useDefault = true;
|
||||
|
@ -845,11 +855,15 @@ public class TileQuarry extends TileBuildCraft implements IMachine, IPowerRecept
|
|||
chunks.add(chunk);
|
||||
}
|
||||
}
|
||||
|
||||
if (placedBy != null) {
|
||||
PacketDispatcher.sendPacketToPlayer(
|
||||
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);
|
||||
((EntityPlayerMP) placedBy)
|
||||
.addChatMessage(new ChatComponentText(
|
||||
String.format(
|
||||
"[BUILDCRAFT] The quarry at %d %d %d will keep %d chunks loaded",
|
||||
xCoord, yCoord, zCoord, chunks.size())));
|
||||
}
|
||||
|
||||
sendNetworkUpdate(BuildCraftFactory.instance);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import buildcraft.core.utils.StringUtils;
|
|||
import buildcraft.core.utils.Utils;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.EnumSet;
|
||||
|
@ -140,7 +141,7 @@ public class TileAdvancedCraftingTable extends TileLaserTableBase implements IIn
|
|||
private final class InternalPlayer extends EntityPlayer {
|
||||
|
||||
public InternalPlayer() {
|
||||
super(TileAdvancedCraftingTable.this.getWorldObj(), "[BuildCraft]");
|
||||
super(TileAdvancedCraftingTable.this.getWorldObj(), new GameProfile(null, "[BuildCraft]"));
|
||||
posX = TileAdvancedCraftingTable.this.xCoord;
|
||||
posY = TileAdvancedCraftingTable.this.yCoord + 1;
|
||||
posZ = TileAdvancedCraftingTable.this.zCoord;
|
||||
|
@ -441,12 +442,6 @@ public class TileAdvancedCraftingTable extends TileLaserTableBase implements IIn
|
|||
return action == BuildCraftCore.actionOn || action == BuildCraftCore.actionOff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return SLOTS;
|
||||
|
|
|
@ -305,11 +305,6 @@ public class TileAssemblyTable extends TileLaserTableBase implements IMachine, I
|
|||
return currentRecipe != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInvNameLocalized() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||
return true;
|
||||
|
|
|
@ -45,7 +45,8 @@ public class ItemFacade extends ItemBuildCraft {
|
|||
setCreativeTab(CreativeTabBuildCraft.FACADES.get());
|
||||
}
|
||||
|
||||
@Override
|
||||
//TODO: how to control name of items?
|
||||
/*@Override
|
||||
public String getItemDisplayName(ItemStack itemstack) {
|
||||
String name = super.getItemDisplayName(itemstack);
|
||||
Block decodedBlock = ItemFacade.getBlock(itemstack);
|
||||
|
@ -60,7 +61,7 @@ public class ItemFacade extends ItemBuildCraft {
|
|||
name += " < BROKEN (" + decodedBlock.getLocalizedName() + ":" + decodedMeta + " )>";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemstack) {
|
||||
|
@ -156,7 +157,7 @@ public class ItemFacade extends ItemBuildCraft {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldPassSneakingClickToBlock(World worldObj, int x, int y, int z) {
|
||||
public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
|
||||
// Simply send shift click to the pipe / mod block.
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -80,10 +80,13 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe {
|
|||
|
||||
if (BlockGenericPipe.placePipe(pipe, world, i, j, k, block, 0)) {
|
||||
block.onBlockPlacedBy(world, i, j, k, entityplayer, itemstack);
|
||||
world.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F,
|
||||
block.stepSound.getPlaceSound(),
|
||||
(block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
block.stepSound.getPitch() * 0.8F);
|
||||
|
||||
// TODO: Fix sound
|
||||
//world.playSoundEffect(i + 0.5F, j + 0.5F, k + 0.5F,
|
||||
// block.stepSound.getPlaceSound(),
|
||||
// (block.stepSound.getVolume() + 1.0F) / 2.0F,
|
||||
// block.stepSound.getPitch() * 0.8F);
|
||||
|
||||
itemstack.stackSize--;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import buildcraft.core.ItemBuildCraft;
|
|||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -44,7 +45,7 @@ public class ItemPlug extends ItemBuildCraft {
|
|||
// }
|
||||
|
||||
@Override
|
||||
public boolean shouldPassSneakingClickToBlock(World worldObj, int x, int y, int z ) {
|
||||
public boolean doesSneakBypassUse(World world, int x, int y, int z, EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -424,7 +424,7 @@ public class PipeTransportItems extends PipeTransport {
|
|||
items.add(item);
|
||||
|
||||
if (packet.forceStackRefresh() || item.getItemStack() == null) {
|
||||
PacketDispatcher.sendPacketToServer(new PacketPipeTransportItemStackRequest(packet.getTravelingEntityId()).getPacket());
|
||||
BuildCraftTransport.instance.sendToServer(new PacketPipeTransportItemStackRequest(packet.getTravelingEntityId()));
|
||||
}
|
||||
|
||||
item.setPosition(packet.getItemX(), packet.getItemY(), packet.getItemZ());
|
||||
|
@ -440,8 +440,7 @@ public class PipeTransportItems extends PipeTransport {
|
|||
|
||||
private void sendTravelerPacket(TravelingItem data, boolean forceStackRefresh) {
|
||||
PacketPipeTransportTraveler packet = new PacketPipeTransportTraveler(data, forceStackRefresh);
|
||||
int dimension = container.getWorldObj().provider.dimensionId;
|
||||
PacketDispatcher.sendPacketToAllAround(container.xCoord, container.yCoord, container.zCoord, DefaultProps.PIPE_CONTENTS_RENDER_DIST, dimension, packet.getPacket());
|
||||
BuildCraftTransport.instance.sendToPlayers(packet, container.getWorldObj(), container.xCoord, container.yCoord, container.zCoord, DefaultProps.PIPE_CONTENTS_RENDER_DIST);
|
||||
}
|
||||
|
||||
public int getNumberOfStacks() {
|
||||
|
|
|
@ -221,16 +221,18 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
|
|||
if (provider != null)
|
||||
provider.update();
|
||||
|
||||
if (sendClientUpdate) {
|
||||
// TODO: pipe synchronization with 1.7.2 needs to be reviewed.
|
||||
/*if (sendClientUpdate) {
|
||||
sendClientUpdate = false;
|
||||
if (worldObj instanceof WorldServer) {
|
||||
WorldServer world = (WorldServer) worldObj;
|
||||
PlayerInstance playerInstance = world.getPlayerManager().getOrCreateChunkWatcher(xCoord >> 4, zCoord >> 4, false);
|
||||
|
||||
if (playerInstance != null) {
|
||||
playerInstance.sendToAllPlayersWatchingChunk(getDescriptionPacket());
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// PRECONDITION: worldObj must not be null
|
||||
|
@ -389,6 +391,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
|
|||
|
||||
PacketTileState packet = new PacketTileState(this.xCoord, this.yCoord, this.zCoord);
|
||||
coreState.expansions.clear();
|
||||
|
||||
if (pipe != null && pipe.gate != null) {
|
||||
coreState.gateMaterial = pipe.gate.material.ordinal();
|
||||
coreState.gateLogic = pipe.gate.logic.ordinal();
|
||||
|
@ -405,9 +408,15 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
|
|||
|
||||
packet.addStateForSerialization((byte) 0, coreState);
|
||||
packet.addStateForSerialization((byte) 1, renderState);
|
||||
if (pipe instanceof IClientState)
|
||||
|
||||
if (pipe instanceof IClientState) {
|
||||
packet.addStateForSerialization((byte) 2, (IClientState) pipe);
|
||||
return packet.getPacket();
|
||||
}
|
||||
|
||||
// TODO: pipe synchronization with 1.7.2 needs to be reviewed.
|
||||
//return packet.getPacket();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void sendUpdateToClient() {
|
||||
|
@ -713,8 +722,8 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, IFlui
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRefresh(int oldID, int newID, int oldMeta, int newMeta, World world, int x, int y, int z) {
|
||||
return oldID != newID;
|
||||
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) {
|
||||
return oldBlock != newBlock;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -104,7 +104,7 @@ public class PacketHandlerTransport extends BuildCraftChannelHandler {
|
|||
break;
|
||||
|
||||
case PacketIds.PIPE_ITEMSTACK_REQUEST: {
|
||||
// action will have happened already at read time
|
||||
((PacketPipeTransportItemStackRequest) packet).sendDataToPlayer((EntityPlayer) player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package buildcraft.transport.network;
|
||||
|
||||
import buildcraft.BuildCraftTransport;
|
||||
import buildcraft.core.network.BuildCraftPacket;
|
||||
import buildcraft.core.network.PacketIds;
|
||||
import buildcraft.transport.TravelingItem;
|
||||
|
@ -9,15 +10,13 @@ import java.io.DataInputStream;
|
|||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class PacketPipeTransportItemStackRequest extends BuildCraftPacket {
|
||||
|
||||
public int travelerID;
|
||||
public Player player;
|
||||
|
||||
public PacketPipeTransportItemStackRequest(Player player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
TravelingItem item;
|
||||
|
||||
public PacketPipeTransportItemStackRequest(int travelerID) {
|
||||
this.travelerID = travelerID;
|
||||
}
|
||||
|
@ -31,12 +30,18 @@ public class PacketPipeTransportItemStackRequest extends BuildCraftPacket {
|
|||
public void readData(ByteBuf data) {
|
||||
travelerID = data.readShort();
|
||||
TravelingItem.TravelingItemCache cache = TravelingItem.serverCache;
|
||||
TravelingItem item = cache.get(travelerID);
|
||||
if (item == null)
|
||||
return;
|
||||
PacketDispatcher.sendPacketToPlayer(new PacketPipeTransportItemStack(travelerID, item.getItemStack()).getPacket(), player);
|
||||
item = cache.get(travelerID);
|
||||
}
|
||||
|
||||
public void sendDataToPlayer (EntityPlayer player) {
|
||||
if (item != null) {
|
||||
BuildCraftTransport.instance.sendToPlayer(
|
||||
player,
|
||||
new PacketPipeTransportItemStack(travelerID, item
|
||||
.getItemStack()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getID() {
|
||||
return PacketIds.PIPE_ITEMSTACK_REQUEST;
|
||||
|
|
|
@ -18,10 +18,13 @@ import buildcraft.transport.PipeTransportPower;
|
|||
import buildcraft.transport.triggers.ActionPowerLimiter;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class PipePowerIron extends Pipe<PipeTransportPower> {
|
||||
|
@ -76,7 +79,9 @@ public class PipePowerIron extends Pipe<PipeTransportPower> {
|
|||
setMode(getMode().getNext());
|
||||
}
|
||||
if (getWorld().isRemote)
|
||||
player.addChatMessage(String.format(StringUtils.localize("chat.pipe.power.iron.mode"), getMode().maxPower));
|
||||
player.addChatMessage(new ChatComponentText(String.format(
|
||||
StringUtils.localize("chat.pipe.power.iron.mode"),
|
||||
getMode().maxPower)));
|
||||
|
||||
((IToolWrench) equipped).wrenchUsed(player, container.xCoord, container.yCoord, container.zCoord);
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue