• 0

    posted a message on Redstone Power by Coordinates
    Quote from CoderDane

    Are you talking about placing down a redstone torch and having its effect apply to a different coordinate? If this is the case then you could change locations in the public void onBlockAdded inside of the redstone torch class.

    Or something else, if you could be clearer.


    That could work, so would I just add that function to the block that emits the signal, or do I need to add some other functions, like isProvidingWeakPower?
    Posted in: Modification Development
  • 0

    posted a message on Redstone Power by Coordinates
    That sucks :(. Thanks anyway.
    Posted in: Modification Development
  • 0

    posted a message on Redstone Power by Coordinates
    Sorry for the bump, I have not found anything.
    Posted in: Modification Development
  • 0

    posted a message on Redstone Power by Coordinates
    Anyone know?
    Posted in: Modification Development
  • 0

    posted a message on Redstone Power by Coordinates
    Quote from tigertomd

    It depends what you mean.

    If you mean you want to power something at a certain location, simply place a redstone torch there.
    If you mean that you want to power an area when a player enters the area, or another area, you must place a redstone clock hooked up to a command block with the testfor command. Coming out of the back you will need to place a comparator. For every player found by the command block the comparator will give out a signal strength of one. You will need to enter the command as follows: /testfor <x> <y> <z> where x, y and z are the co-ordinates or /testfor <username> where the username is for the username of the player you are searching for.


    I meant in a mod, using eclipse in java, not in-game.
    Posted in: Modification Development
  • 0

    posted a message on Redstone Power by Coordinates
    Is there a way to supply redstone power to a specific location when given the coordinates?
    Posted in: Modification Development
  • 0

    posted a message on 1.5.2 Forge Gui Error
    Anyone have any idea?
    Posted in: Modification Development
  • 0

    posted a message on 1.5.2 Forge Gui Error
    Hi, I am relatively new to using Forge and I am attempting to make a custom furnace. I do not understand forge guis at all so I had to use a tutorial which was very vague. Whenever I click on the furnace, it crashes and all the error report says is that it crashed when I opened it.

    Thanks in advance

    Here is my code:

    GuiFireFurnace


    package Lumicraft;

    import net.minecraft.client.gui.inventory.GuiContainer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.util.StatCollector;

    import org.lwjgl.opengl.GL11;
    public class GuiFireFurnace extends GuiContainer
    {
    private TileEntityFireFurnace goldInventory;

    public GuiFireFurnace(InventoryPlayer inventory, TileEntityFireFurnace gold)
    {
    super(new ContainerFireFurnace(inventory, gold));
    goldInventory = gold;
    }

    /**
    * Draw the foreground layer for the GuiContainer (everythin in front of the items)
    */
    protected void drawGuiContainerForegroundLayer(int par1, int par2)
    {
    fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, (ySize - 96) + 2, 0xffffff);
    }

    /**
    * Draw the background layer for the GuiContainer (everything behind the items)
    */
    protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
    {
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture("/gui/furnace.png");
    int var4 = (this.width - this.xSize) / 2;
    int var5 = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(var4, var5, 0, 0, this.xSize, this.ySize);
    int var6;

    if (goldInventory.isBurning())
    {
    var6 = goldInventory.getBurnTimeRemainingScaled(12);
    this.drawTexturedModalRect(var4 + 56, var5 + 36 + 12 - var6, 176, 12 - var6, 14, var6 + 2);
    }

    var6 = goldInventory.getCookProgressScaled(24);
    this.drawTexturedModalRect(var4 + 79, var5 + 34, 176, 14, var6 + 1, 16);
    }
    }

    ContainerFireFurnace:


    package Lumicraft;

    import java.util.Iterator;
    import java.util.List;

    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.ICrafting;
    import net.minecraft.inventory.Slot;
    import net.minecraft.item.ItemStack;

    public class ContainerFireFurnace extends Container
    {
    private TileEntityFireFurnace goldOven;
    private int lastGoldOvenCookTime;
    private int lastGoldOvenBurnTime;
    private int lastGoldOvenItemBurnTime;

    public ContainerFireFurnace(InventoryPlayer par1InventoryPlayer, TileEntityFireFurnace par2TileEntityGoldOven)
    {
    lastGoldOvenCookTime = 0;
    lastGoldOvenBurnTime = 0;
    lastGoldOvenItemBurnTime = 0;
    goldOven = par2TileEntityGoldOven;
    addSlotToContainer(new Slot(par2TileEntityGoldOven, 0, 90, 56));
    addSlotToContainer(new Slot(par2TileEntityGoldOven, 1, 54, 56));
    addSlotToContainer(new SlotFireFurnace(par1InventoryPlayer.player, par2TileEntityGoldOven, 2, 51, 17));

    for (int i = 0; i < 3; i++)
    {
    for (int k = 0; k < 9; k++)
    {
    addSlotToContainer(new Slot(par1InventoryPlayer, k + i * 9 + 9, 8 + k * 18, 84 + i * 18));
    }
    }

    for (int j = 0; j < 9; j++)
    {
    addSlotToContainer(new Slot(par1InventoryPlayer, j, 8 + j * 18, 142));
    }
    }

    /**
    * Updates crafting matrix; called from onCraftMatrixChanged. Args: none
    */
    public void detectAndSendChanges()
    {
    super.detectAndSendChanges();
    Iterator var1 = this.crafters.iterator();
    while (var1.hasNext())
    {
    ICrafting var2 = (ICrafting)var1.next();
    if (this.lastGoldOvenCookTime != this.goldOven.goldCookTime)
    {
    var2.sendProgressBarUpdate(this, 0, this.goldOven.goldCookTime);
    }
    if (this.lastGoldOvenBurnTime != this.goldOven.goldBurnTime)
    {
    var2.sendProgressBarUpdate(this, 1, this.goldOven.goldBurnTime);
    }
    if (this.lastGoldOvenItemBurnTime != this.goldOven.goldItemBurnTime)
    {
    var2.sendProgressBarUpdate(this, 2, this.goldOven.goldItemBurnTime);
    }
    }
    this.lastGoldOvenCookTime = this.goldOven.goldCookTime;
    this.lastGoldOvenBurnTime = this.goldOven.goldBurnTime;
    this.lastGoldOvenItemBurnTime = this.goldOven.goldItemBurnTime;
    }

    public void updateProgressBar(int par1, int par2)
    {
    if (par1 == 0)
    {
    goldOven.goldCookTime = par2;
    }

    if (par1 == 1)
    {
    goldOven.goldBurnTime = par2;
    }

    if (par1 == 2)
    {
    goldOven.goldItemBurnTime = par2;
    }
    }

    public boolean canInteractWith(EntityPlayer par1EntityPlayer)
    {
    return goldOven.isUseableByPlayer(par1EntityPlayer);
    }

    /**
    * Called to transfer a stack from one inventory to the other eg. when shift clicking.
    */
    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int slotnumber)
    {
    ItemStack itemstack = null;
    Slot slot = (Slot)inventorySlots.get(slotnumber);

    if (slot != null && slot.getHasStack())
    {
    ItemStack itemstack1 = slot.getStack();
    itemstack = itemstack1.copy();

    if (slotnumber == 2)
    {
    if (!mergeItemStack(itemstack1, 3, 39, true))
    {
    return null;
    }

    slot.onSlotChange(itemstack1, itemstack);
    }
    else if (slotnumber == 1 || slotnumber == 0)
    {
    if (!mergeItemStack(itemstack1, 3, 39, false))
    {
    return null;
    }
    }
    else if (RecipesFireFurnace.smelting().getSmeltingResult(itemstack1.getItem().itemID) != null)
    {
    if (!mergeItemStack(itemstack1, 0, 1, false))
    {
    return null;
    }
    }
    else if (TileEntityFireFurnace.isItemFuel(itemstack1))
    {
    if (!mergeItemStack(itemstack1, 1, 2, false))
    {
    return null;
    }
    }
    else if (slotnumber >= 3 && slotnumber < 30)
    {
    if (!mergeItemStack(itemstack1, 30, 39, false))
    {
    return null;
    }
    }
    else if (slotnumber >= 30 && slotnumber < 39 && !mergeItemStack(itemstack1, 3, 30, false))
    {
    return null;
    }

    if (itemstack1.stackSize == 0)
    {
    slot.putStack(null);
    }
    else
    {
    slot.onSlotChanged();
    }

    if (itemstack1.stackSize == itemstack.stackSize)
    {
    return null;
    }

    slot.onPickupFromSlot(player, itemstack);
    }

    return itemstack;
    }
    }

    BlockFurnaceFire


    package Lumicraft;


    import java.util.Random;

    import net.minecraft.block.Block;
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.src.ModLoader;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.Icon;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.World;
    public class BlockFurnaceFire extends BlockContainer
    {

    private static boolean keepInventory = false;

    //TEXTUREN
    public static Icon FireFurnaceBottom = (Icon) null;
    public static Icon FireFurnaceTop = (Icon) null;
    public static Icon FireFurnaceSide = (Icon) null;
    public static Icon FireFurnaceFront = (Icon) null;
    private int FireFurnaceFrontActive = 45;


    /**
    * Is the random generator used by furnace to drop the inventory contents in random directions.
    */
    private Random goldRand;

    protected BlockFurnaceFire(int id, Material material, boolean active)
    {
    super(id, material);
    goldRand = new Random();
    }
    @Override
    public TileEntity createNewTileEntity(World world)
    {
    return new TileEntityFireFurnace();
    }

    /**
    * Called whenever the block is added into the world. Args: world, x, y, z
    */
    public void onBlockAdded(World par1World, int x, int y, int z)
    {
    super.onBlockAdded(par1World, x, y, z);
    setDefaultDirection(par1World, x, y, z);
    par1World.markBlockForUpdate(x, y, z);
    }

    /**
    * set a blocks direction
    */
    private void setDefaultDirection(World par1World, int x, int y, int z)
    {
    TileEntity blockEntity = par1World.getBlockTileEntity(x, y, z);
    if (par1World.isRemote)
    {
    return;
    }

    int i = par1World.getBlockId(x, y, z - 1);
    int j = par1World.getBlockId(x, y, z + 1);
    int k = par1World.getBlockId(x - 1, y, z);
    int l = par1World.getBlockId(x + 1, y, z);
    byte byte0 = 3;

    if (Block.opaqueCubeLookup[i] && !Block.opaqueCubeLookup[j])
    {
    byte0 = 3;
    }
    if (Block.opaqueCubeLookup[j] && !Block.opaqueCubeLookup[i])
    {
    byte0 = 2;
    }
    if (Block.opaqueCubeLookup[k] && !Block.opaqueCubeLookup[l])
    {
    byte0 = 5;
    }
    if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[k])
    {
    byte0 = 4;
    }
    ((TileEntityFireFurnace)blockEntity).setFrontDirection(byte0);
    }

    /**
    * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
    * @return
    */

    public Icon getBlockTexture(IBlockAccess access, int x, int y, int z, int side)
    {
    int front = 0;

    TileEntity tile = ModLoader.getMinecraftInstance().getIntegratedServer().worldServers[0].getBlockTileEntity(x, y, z);

    if(tile != null)
    {
    front = ((TileEntityFireFurnace)tile).getFrontDirection();
    }
    else
    {
    ModLoader.getMinecraftInstance().getIntegratedServer().worldServers[0].markBlockForUpdate(x, y, z);
    }

    switch(side)
    {
    case 0: return FireFurnaceBottom;
    case 1: return FireFurnaceTop;
    default :
    if(side == front)
    {
    return (Icon) (((TileEntityFireFurnace)tile).isActive() ? FireFurnaceFrontActive : FireFurnaceFront);
    }
    else
    {
    return FireFurnaceSide;
    }

    }
    }

    /**
    * Returns the block texture based on the side being looked at. Args: side
    */



    /**
    * called everytime the player right clicks this block
    */
    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float a, float b, float c)
    {
    TileEntityFireFurnace gold = (TileEntityFireFurnace)world.getBlockTileEntity(x, y, z);


    player.openGui(mod_lumicraft.instance, 0, world, x, y, z);

    return true;
    }

    /**
    * Called when the block is placed in the world.
    */
    public void onBlockPlacedBy(World w, int x, int y, int z, EntityLiving entity)
    {
    int var = MathHelper.floor_double((double)(entity.rotationYaw *4.0F / 360.0F) + 0.5D) & 3;

    TileEntity blockEntity = (TileEntity) w.getBlockTileEntity(x, y, z);
    switch(var)
    {
    case 0: ((TileEntityFireFurnace)blockEntity).setFrontDirection(2);break;

    case 1: ((TileEntityFireFurnace)blockEntity).setFrontDirection(5);break;

    case 2: ((TileEntityFireFurnace)blockEntity).setFrontDirection(3);break;

    case 3: ((TileEntityFireFurnace)blockEntity).setFrontDirection(4);break;

    }

    }

    /**
    * ejects contained items into the world, and notifies neighbours of an update, as appropriate
    */
    public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
    {
    if (!keepInventory)
    {
    TileEntityFireFurnace gold = (TileEntityFireFurnace)par1World.getBlockTileEntity(par2, par3, par4);
    if (gold != null)
    {
    for (int var8 = 0; var8 < gold.getSizeInventory(); ++var8)
    {
    ItemStack item = gold.getStackInSlot(var8);
    if (item != null)
    {
    float var10 = this.goldRand.nextFloat() * 0.8F + 0.1F;
    float var11 = this.goldRand.nextFloat() * 0.8F + 0.1F;
    float var12 = this.goldRand.nextFloat() * 0.8F + 0.1F;
    while (item.stackSize > 0)
    {
    int var13 = this.goldRand.nextInt(21) + 10;
    if (var13 > item.stackSize)
    {
    var13 = item.stackSize;
    }
    item.stackSize -= var13;
    EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(item.itemID, var13, item.getItemDamage()));
    if (item.hasTagCompound())
    {
    var14.getEntityItem().setTagCompound((NBTTagCompound)item.getTagCompound().copy());
    }
    float var15 = 0.05F;
    var14.motionX = (double)((float)this.goldRand.nextGaussian() * var15);
    var14.motionY = (double)((float)this.goldRand.nextGaussian() * var15 + 0.2F);
    var14.motionZ = (double)((float)this.goldRand.nextGaussian() * var15);
    par1World.spawnEntityInWorld(var14);
    }
    }
    }
    }
    }
    super.breakBlock(par1World, par2, par3, par4, par5, par6);
    }
    }

    mod_lumicraft


    package Lumicraft;

    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.Item;
    import net.minecraft.src.ModLoader;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.Init;
    import cpw.mods.fml.common.Mod.Instance;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.network.NetworkMod;
    import cpw.mods.fml.common.network.NetworkRegistry;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.common.registry.LanguageRegistry;

    @Mod(modid = mod_lumicraft.modid, name = "Lumicraft", version = "0.1")
    @NetworkMod(clientSideRequired = true, serverSideRequired = false)
    public class mod_lumicraft {
    @SidedProxy(clientSide = "Lumicraft.ClientProxy", serverSide = "Lumicraft.CommonProxy")
    public static ClientProxy proxy;
    @Instance()
    public static mod_lumicraft instance;


    public static final String modid = "ironarcher_lumicraft";


    public static Block machineBasic;
    public static Block furnaceFire;
    public static final int fireID = 0;


    @Init
    public void load(FMLInitializationEvent event)
    {
    NetworkRegistry.instance().registerGuiHandler(this, this.proxy);
    instance = this;
    machineBasic = new Block(500, Material.iron).setUnlocalizedName("machineBasic");
    GameRegistry.registerBlock(machineBasic, modid + machineBasic.getUnlocalizedName2());
    LanguageRegistry.addName(machineBasic, "Machine Core");
    GameRegistry.addRecipe(new ItemStack(machineBasic, 1), "xxx", "xfx", "xxx",
    'x', Item.ingotIron, 'f', Block.furnaceIdle);

    furnaceFire = new BlockFurnaceFire(501, Material.rock, false).setUnlocalizedName("furnaceFire");
    GameRegistry.registerBlock(furnaceFire, modid + furnaceFire.getUnlocalizedName2());
    LanguageRegistry.addName(furnaceFire, "Fire Furnace");
    GameRegistry.addRecipe(new ItemStack(furnaceFire, 1), "xxx", "xmx", "xfx",
    'x', Block.brick, 'f', Item.flintAndSteel, 'm', mod_lumicraft.machineBasic);
    GameRegistry.registerTileEntity(TileEntityFireFurnace.class, "furnaceFire");

    }
    }

    ClientProxy:


    package Lumicraft;

    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.world.World;

    public class ClientProxy extends CommonProxy
    {
    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
    TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
    if (tileEntity != null)
    {
    switch(ID)
    {
    case 0:
    return new ContainerFireFurnace(player.inventory, (TileEntityFireFurnace) tileEntity);
    }
    }
    return null;

    }
    }

    CommonProxy:


    package Lumicraft;

    import net.minecraft.block.Block;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.ItemStack;
    import net.minecraft.src.ModLoader;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.world.World;
    import cpw.mods.fml.common.network.IGuiHandler;

    public class CommonProxy implements IGuiHandler
    {
    @Override
    public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
    return null;
    }
    @Override
    public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
    {
    TileEntity tileEntity = world.getBlockTileEntity(x, y, z);


    if(tileEntity != null)
    {

    switch(ID)
    {
    case 0:

    return new GuiFireFurnace(player.inventory, (TileEntityFireFurnace) tileEntity);

    }
    }
    return null;
    }
    }
    Posted in: Modification Development
  • 0

    posted a message on Arcticraft - An Icy New Dimension (Maybe we'll release it)
    It would be cool if you could add some sort of Arctic Boss mob, like maybe Bigfoot or something. Also, what about a freeze enchantment for tools? Like the sword with Ice Aspect in Thaumcraft, which slows down mobs.
    Posted in: WIP Mods
  • 0

    posted a message on Arcticraft - An Icy New Dimension (Maybe we'll release it)
    Why not add a way for the player to freeze if not careful? Like to keep your house warm a furnace needs to be running. Or if you could add bears that drop fur, which would make fur clothing that the player could wear to stay warm. Also a freeze enchantment for a bow would be really cool.
    Posted in: WIP Mods
  • 0

    posted a message on Left 4 Blocks - A conversion mod for Minecraft!
    Quote from Adam543i

    Left 4 Blocks
    A Minecraft conversion mod.
    (If you can make good logos, and want to make one, send me a pm) Also, If you have ideas, talk to me on IRC (details below). Website is currently down due to dns issues.


    Left 4 Blocks basically makes Minecraft more like Left 4 Dead. However the gameplay will be changed quite a bit. A list of features is below:
    • Stats, see whats logged below
    • Server browser - Favourites, server hiding
    • Friends - Chat, join their game
    • Lobby system
    • Waves with increasing enemy difficulty per wave and a boss at the end
    • Matchmaking - Games are hosted on our servers or approved hosts, to minimize lag.
    • Home hosting - For lans only
    Public hosting will be avaliable, however the changes will be limited. (see faq below)

    Got questions, ideas or want to help? Talk to me on IRC, irc.esper.net #Left4Blocks or send me a tweet @Adam543i!



    Statistics - Whats Logged
    Global: (Basically everyones stats added together)
    • Deaths
    • Kills
    • Boss Kills
    • Purchases
    • Money Spent
    • Team kills
    • Potions used
    • Weapons broken
    • Weapons enchanted
    Per-Player: (Shown on their profile)
    • Kills
    • Deaths
    • K/D Ratio
    • Boss Kills
    • Game Wins/Losses
    • Game W/L Ratio
    • Purchases
    • Money Spent
    • Team Kills
    • XP Gained + XP Level
    • Potions used
    • Weapons broken
    • Weapons enchanted


    FAQ:
    Q: Can I host a server at home?
    A: Yes, however it wont show up on the server lists and have stats. Also will only run on the local network, outside users won't be able to connect.

    Q: Will it be possible to host my own public server?
    A: Possibly. However you won't be able to add plugins and change the Left 4 Blocks configuration. However you can change server name/motd/owner and be able to kick/ban/mute and etc.

    Q: What do I do if someone is hacking?
    A: Report them, use /report <user> <reason>. All their movements/chat messages and other info will be sent to the moderation staff.

    Q: I'm globally banned 0.o. What does that mean?
    A: On all public servers, a global banning system will be enforced. If you are reported cheating, and you get banned because of that, you will not be able to connect to any public servers (Unless you are added to the ban-whitelist on a custom public server)

    Q: Can I help with the plugin?
    A: Yes. Contact me on IRC (Adam543i) on esper.net #Left4Blocks. You need to be a bukkit plugin dev to ask, dont ask if you're not. Show me any plugins that you've made, and agree to the developer tos.

    Q: When will it be available?
    A: Not for a few months, however the website may be up before then, though statistics wont be there.


    I'm not an expert with minecraft forum but I think this belongs in WIP Mods.
    Posted in: Modification Development
  • 0

    posted a message on Item Subname/Postfix Help
    Quote from Gonfa

    Use :
    public void addInformation(ItemStack par1ItemStack, List par2List)
    {
    }
    And to add a new line use :
    par2List.add("§bThis adds hunger");


    Thanks! My code works now.
    Posted in: Modification Development
  • 0

    posted a message on Item Subname/Postfix Help
    How would I create a subname for an item, like how a potion has an extra tooltip under the name. I tried looking in the ItemPotion code and found soemthing to do with postfix but I stil can't get it to work. Does anybody know how?
    Posted in: Modification Development
  • 0

    posted a message on NBTTagCompound for Item
    I am trying to make an item that has properties, like a forestry bee. I need these properties to stay when closing minecraft. I know I need to use an NBTTagCompound and I know how to with a block but how do you with an item?
    Posted in: Modification Development
  • 0

    posted a message on TileEntity/Unique item Help
    The problem is that with what I am doing there are too many combinations and I think I need to use a TileEntity
    Posted in: Modification Development
  • To post a comment, please .