• 0

    posted a message on Animated gui overlay

    Just a small thought here.

    Forewarning, I've never done an animated one before :/

    If you have the tileentity update a counter and every say, 25 ticks or whatever is a decent number for the animation, have it cycle the gui picture, you could get something "animated" with multiple pictures. I think this is probably something similar to how they do it in vanilla, because there are multiple icon tiles for fire, block breaking, etc.

    I think you would reference the tileentity from the gui and then get the public int count, and whenever it hits the target number to switch, reset the count to 0 as well. I don't know if this helps :/


    EDITED, READ NEXT POST

    Posted in: Modification Development
  • 0

    posted a message on [Solved] Update block texture from inside it's TileEntity? / Packet help.

    Ignore what was here before.

    Posted in: Modification Development
  • 0

    posted a message on Can i make a theme park through MCreator?If dont,what should i use?

    Try playing on HyPixel. You don't need mods, and you can play most of those games or variations of those and more. What you are talking about aren't really mods, but plugins / minigames for multiplayer.

    mc.hypixel.net <--- that is the server IP by the way.

    As for the "roller coasters", just make your own rail designs. Actually, look up some sand duplication methods (if there are any anymore, I haven't done it in years) and create your entire spleef themepark with roller coasters, etc. Make a really awesome map, and try to advertise it in the maps section and see if people download it and make servers for it. If you do that, then maybe, just maybe, you will be able to have some fun online in your own creation.

    Basically, no one wants to make the mod you suggested because plugins have already done that, and a lot of it is vanilla minecraft anyways. You just need to build.

    Posted in: Modification Development
  • 0

    posted a message on [Solved] Update block texture from inside it's TileEntity? / Packet help.

    Basically, I have my machine created and it all works great, except for one feature I have been trying to add. I want to be able to input a "circuit" to dictate whether a side can import or export. I have all the functionality set up except for a block specific texture update. I had it coded inside the block class (CarbonCondenser), but then it was updating ALL instances of my machine. So I thought to move it into the TileEntity for two reasons. First, a new instance is created each time a block is placed, so values changing should keep it separated, correct? Secondly, having it inside of there, I was now able to add 5 slots to put the items inside of and then check and change the texture based on which item is inside.

    So what I have now is a slot (we'll say one for now, and I'll duplicate and change as needed for the other slots)
    I want to check for an item in it (Completed already)
    Then based on which of the two items, or no item, it will change the texture to 1 of three textures.

    How do I access the textures of the block from inside the TileEntity?

    private void ChangeTextures()
    {
    if (this.getStackInSlot(4).getItem() == Construct.circuitImport)
    {

    }
    else if (this.getStackInSlot(4).getItem() == Construct.circuitExport)
    {

    }
    else if (this.getStackInSlot(4).getItem() == null)
    {

    }
    }

    Posted in: Modification Development
  • 0

    posted a message on [SOLVED] Use Array for selecting specific metadatas?
    Quote from master801»
    Use a for loop. Note, this does everything existing in the array wildcard.

     for(int i = 0; i < wildcard.length, i++) {
    GameRegistry.addShapelessRecipe(new ItemStack(Items.coal, 1), new ItemStack(LimpCraft2.orbCarbonLightCharged, 1, wildcard), LimpCraft2.oreFuzzium, Items.gunpowder);
    }

    Thank you so much master801, this worked perfectly (except there needed a semicolon after length instead of comma :D) Such a simple tool in java to get exactly what I wanted to get done, done! Now I can continue with all the similar recipes :)
     
    Posted in: Modification Development
  • 0

    posted a message on [SOLVED] Use Array for selecting specific metadatas?
    Hours of googling has led me to no answers... is there even a way to select a certain group of numbers from an array to use as the metadata? I basically want an OR logic in place of the metadata, but can't figure out how to get it there. I want to use item, quantity, META1 or META2 or META3 or META4 or META5 but NOT META6 (my item has only 6 values). I know I can type each one individually, but that takes up a lot of space and is inefficient in the long run, especially when I plan on adding more recipes (ALOT MORE) requiring various metadatas. I could use OreDictionary.WILDCARD_VALUE but I don't want to allow the last value!
    Posted in: Modification Development
  • 0

    posted a message on Thor's hammer
    Look at how the command "/weather clear" works and I'm sure you can figure out how to get a storm. I can't tell you exactly where that is because my eclipse is broke at the moment and I can't view vanilla classes!
    Posted in: Modification Development
  • 0

    posted a message on [SOLVED] Use Array for selecting specific metadatas?
    I'm trying to select specific metadatas from an array for my objects' crafting. I am planning to have a few of these so typing every metadata available in the crafting recipe would be time consuming and bulky, especially if I add more. Basically, I have an item that has damage on it and I want you to be able to use it up to a certain point until it isn't "charged" enough for the recipe. It's kinda weird to explain, so maybe the code will clarify by what it looks like i'm trying to do. So in the example code of mine, I have an orb that crafts stuff and decreases (technically increasing damage) uses on it until it gets to the last use, in which case it is able to be used indefinitely (because of how i coded it). I want to eliminate the last metadata from available crafting recipes so it can't be used in crafting at that state.

     int wildcard[] = new int[5];
     wildcard[0] = 0;
     wildcard[1] = 1;
     wildcard[2] = 2;
     wildcard[3] = 3;
     wildcard[4] = 4;
     
     GameRegistry.addShapelessRecipe(new ItemStack(Items.coal, 1), 
     new Object[]{new ItemStack(LimpCraft2.orbCarbonLightCharged, 1, wildcard[choose0-5]), LimpCraft2.oreFuzzium, Items.gunpowder});




    I admit, I am new to arrays and more technical things in coding and probably should take time to learn more, but I don't want to put halt on my mod while doing that.

    EDIT* "I want to eliminate the last metadata from available crafting recipes so it can't be used in crafting at that state." But still have it available to recharge the item!
    Posted in: Modification Development
  • 0

    posted a message on [1.5 days, no responses...] custom enchantable shears help [forge, mc1.6.4]
    Quote from countnoobula

    As far as I know, you actually set the enchantability of it in your material. What is your material defined as?


    No, it is not a tool, shears aren't a EnumToolMaterial---They get enchanted directly in EnchantmentUntouching class

    I want to take that same line of code and put it in my shears class so I don't have to reinvent the whole enchanting system :P but just implement my shears into the line of code instead of the vanilla shears. The problem is it uses super.canApply(par1ItemStack) where super refers to EnchantmentUntouching, but I need to replace that and make it still implement that enchantment.

    public boolean canApply(ItemStack par1ItemStack)
    {
    return par1ItemStack.getItem().itemID == Item.shears.itemID ? true : super.canApply(par1ItemStack);
    }

    That is the code from the EnchantmentUntouching class, I want it in my shears so I tried this, but it didn't work

    public boolean canApply(ItemStack par1ItemStack, Enchantment par1Enchantment)
    {
    Enchantment EnchantmentUntouching = par1Enchantment;
    return par1ItemStack.getItem().itemID == limpBase.shearsLimpiumGiga.itemID ? true : par1Enchantment.canApply(par1ItemStack);
    }
    But obviously since it isn't working, i want to know how to get it to work. Thanks for completely ignoring what I had written above...
    Posted in: Modification Development
  • 0

    posted a message on [1.5 days, no responses...] custom enchantable shears help [forge, mc1.6.4]
    I don't know why this bugged out and made all my " " marks or appostrophes some form of " or '
    Posted in: Modification Development
  • 0

    posted a message on [1.5 days, no responses...] custom enchantable shears help [forge, mc1.6.4]
    Quote from name='»
    What are you trying to do exactly? Enchant your shears with silk touch? Why do you need a mod for this
    No, in my code it has my custom shears there, they are just a better form of standard shears but using my custom materials. I am trying to make mine enchantable with silk touch because they aren't at the moment. I looked at how the original shears were enchanted, but that is done in the actual enchantment, and I'm trying to find a way to add my shears to be able to enchant. I wrote this late at night and had kinda been waiting for a response; but right now i thought maybe to extend the ItemShears instead of just items. I'll try that now

    Edit* Just checked, they already extend ItemShears

    Also, I just want to be able to add specifically "silk touch". I don't want to make it enchantable with all of them and I have tried making it similar to how books get enchanted, but changing the array from "enchantmentList" to the specific enchantment, but it didn't work--unless i did something wrong, but now i just have the code stated above and would like to know if anyone has a fix for making it work.

    my shears code just in case

    package limpcraft.common;
    
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.Random;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    
    import net.minecraft.block.Block;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.enchantment.Enchantment;
    import net.minecraft.enchantment.EnchantmentData;
    import net.minecraft.enchantment.EnchantmentHelper;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemShears;
    import net.minecraft.item.ItemStack;
    import net.minecraft.stats.StatList;
    import net.minecraft.world.World;
    
    import net.minecraftforge.common.IShearable;
    
    //Basic SHEARS class
    public class limpToolShears extends ItemShears
    {
        public limpToolShears(int par1)
        {
            super(par1);
            this.setMaxStackSize(1);
            this.setMaxDamage(800);
            this.setCreativeTab(limpCreativeTab.tabLimpCraft);
        }
    
        public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLiving par7EntityLiving)
        {
            if (par3 != Block.leaves.blockID && par3 != Block.web.blockID && par3 != Block.tallGrass.blockID && par3 != Block.vine.blockID && par3 != Block.tripWire.blockID && !(Block.blocksList[par3] instanceof IShearable))
            {
                return super.onBlockDestroyed(par1ItemStack, par2World, par3, par4, par5, par6, par7EntityLiving);
            }
            else
            {
                return true;
            } 
        }
    
        //Returns if the item (tool) can harvest results from the block type.
    
        public boolean canHarvestBlock(Block par1Block)
        {
            return par1Block.blockID == Block.web.blockID || par1Block.blockID == Block.redstoneWire.blockID || par1Block.blockID == Block.tripWire.blockID;
        }
    
        //Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
        //sword
    
        public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
        {
            return par2Block.blockID != Block.web.blockID && par2Block.blockID != Block.leaves.blockID ? (par2Block.blockID == Block.cloth.blockID ? 5.0F : super.getStrVsBlock(par1ItemStack, par2Block)) : 15.0F;
        }
    
        @Override
        public boolean itemInteractionForEntity(ItemStack itemstack, EntityPlayer player, EntityLivingBase entity)
        {
            if (entity.worldObj.isRemote)
            {
                return false;
            }
            if (entity instanceof IShearable)
            {
                IShearable target = (IShearable)entity;
                if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ))
                {
                    ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ,
                            EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
    
                    Random rand = new Random();
                    for(ItemStack stack : drops)
                    {
                        EntityItem ent = entity.entityDropItem(stack, 1.0F);
                        ent.motionY += rand.nextFloat() * 0.05F;
                        ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
                        ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
                    }
                    itemstack.damageItem(1, entity);
                }
                return true;
            }
            return false;
        }
    
        @Override
        public boolean onBlockStartBreak(ItemStack itemstack, int x, int y, int z, EntityPlayer player) 
        {
            if (player.worldObj.isRemote)
            {
                return false;
            }
            int id = player.worldObj.getBlockId(x, y, z);
            if (Block.blocksList[id] instanceof IShearable)
            {
                IShearable target = (IShearable)Block.blocksList[id];
                if (target.isShearable(itemstack, player.worldObj, x, y, z))
                {
                    ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z,
                            EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
                    Random rand = new Random();
    
                    for(ItemStack stack : drops)
                    {
                        float f = 0.7F;
                        double d  = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
                        double d1 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
                        double d2 = (double)(rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
                        EntityItem entityitem = new EntityItem(player.worldObj, (double)x + d, (double)y + d1, (double)z + d2, stack);
                        entityitem.delayBeforeCanPickup = 10;
                        player.worldObj.spawnEntityInWorld(entityitem);
                    }
    
                    itemstack.damageItem(1, player);
                    player.addStat(StatList.mineBlockStatArray[id], 1);
                }
            }
            return false;
        }
    
        public boolean canApply(ItemStack par1ItemStack, Enchantment par1Enchantment)
        {
         Enchantment EnchantmentUntouching = par1Enchantment;
            return par1ItemStack.getItem().itemID == limpBase.shearsLimpiumGiga.itemID ? true : par1Enchantment.canApply(par1ItemStack);
        }
    
        @SideOnly(Side.CLIENT)
        public void registerIcons(IconRegister par1IconRegister)
        {
            this.itemIcon = par1IconRegister.registerIcon(limpBase.modid + ":" + (this.getUnlocalizedName().substring(5)));
        }
    }

    Posted in: Modification Development
  • 0

    posted a message on [1.6.2] [forge] Drinkable Bucket
    Also, to go off of what ExclamationMark said, make it a bucket to place, a "bottle" (aka, standard potion or food) to drink, and a splash potion type item for throwing it and having a source block of it spawn and be able to add splash effects through there.
    Posted in: Modification Development
  • 0

    posted a message on [1.5 days, no responses...] custom enchantable shears help [forge, mc1.6.4]
    I want to make my custom shears to be able to be enchanted with the silk touch enchantment only --- Here is the code in the EnchantmentUntouching file (the silk touch class) and the part regarding making the regular shears enchantable:
    public boolean canApply(ItemStack par1ItemStack)
    {
    return par1ItemStack.getItem().itemID == Item.shears.itemID ? true : super.canApply(par1ItemStack);
    }


    I know I could add my own in there, but I DONT want to edit the base classes. Is there an override that I can do to allow mine to also be enchanted?

    I was trying inside of my custom shears class something along the lines of

    public boolean canApply(ItemStack par1ItemStack, Enchantment par1Enchantment)
    {
    Enchantment EnchantmentUntouching = par1Enchantment;
    return par1ItemStack.getItem().itemID == limpBase.shearsLimpiumGiga.itemID ? true : par1Enchantment.canApply(par1ItemStack);
    }


    No errors, can run game fine, but still doesn't work :/ Any ideas?
    Posted in: Modification Development
  • To post a comment, please or register a new account.