Jump to content

A few general questions


c-ab-o-o-s-e

Recommended Posts

So I'm mainly looking for responses to point me into the right direction. Not asking for code, just ideas and theories on how to accomplish the tasks.

 

1. How would I update a container in real time. My plan is you have an inventory then you use a button to switch and it denies use of certain slots. So wouldn't I need to make the container adjust to keep those slots from being used, draw it back out and update it?

 

2. Custom rendered armor. I've done Blocks, and I've looked at Modular Powersuits, but that also has Scala written into it right? Or am I just being stupid and looking at the wrong parts.

 

3. Is there a good place to look to see how to setup repositories for eclipse regarding the pushing to github. I have Git and github all setup, but grabbing the files from eclipse is being weird. Is there a better way to do it without using eclipse?

 

Link to comment
Share on other sites

I think I can help you with 1 and 3:

 

1. I don't know if I fully understand this, but I'll give it a try. The function updateEntity() might be able to do what you want, or else some of those onNeighborChange() functions, or the equivalent function for redstone

 

2. Sorry. So far I never tried rendering my own armor, have you been able to find tuts on these?

 

3. When I tried using integrated git in eclipse, I couldn't get it to work, so instead my buddy and I used Terminal/Commandprompt/app git. Requires an extra window on our desktop but it was way easier...

 

Hope it helps out.

Link to comment
Share on other sites

1) I like that solution for -999.  I have done this in the past by putting a bogus item like a big red X in the slots I didn't want used.  If the container saw the player put somethign there, it moved it back to their inventory and replaced the X.  If the X was in their inventory it destroyed it, ect.  Just another option for you, but as I said, i like the -999 better.

 

2) I can help you with the render armor.  What is it you want to know?

 

3) can't help at all with that.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

you just have to make sure that you do it on client & server at the same time.

 

So this is telling me that I need to do something different for the calls? At the moment I'm doing the standard handler for the container and GUI. It makes sense on why I have to do it, just not sure if it requires different ways of doing it.

 

3) Don't use the eclipse  integrated git client. I highly recommend using SourceTree (if you're not willing to switch to Intellij :P), that makes Git very easy to use.

 

I may think about dong that. I been doing a lot of talking with IChun lately and he uses that and said he prefers it. The main reason I don't switch is because I have to learn a new IDE, but I guess on the grand scheme of things it wouldn't be that bad. Is the concept the same when it comes to setting up run configurations/ src code importing and exporting?

 

2) I can help you with the render armor.  What is it you want to know?

 

Pretty much I want to make custom modeled armor. For example I want to make some goggles that you put on that looks similar to this as reference:

http://gizmochunk.com/wp-content/uploads/2012/08/Steampunk-Goggles-Goth-Industrial-Brass-Cosplay-LARP-Telescope-BLK.jpg

 

Like I said, I've done blocks before, but no idea on how to do armor. I've looked at other place for some info, but they all seem to be just the standard model re-textured with the values tweaked. 

Link to comment
Share on other sites

To get a custom armor, create a armor item.  Usually this is for 4 items, but in this case I just made a hat.  Without some of my other classes, this won't work as it is shown, but you should be able to figure out what you need to do it from it.

 

 

 

public class HighWizardArmor extends MyItemArmor {

 

    // setup References

    Custom_NPC instance = Custom_NPC.instance;

 

    // Setup regular variables

 

    public HighWizardArmor(ItemArmor.ArmorMaterial material, int myslot) {

        super(material, myslot, 0);

       

        // Set Tab for use

        //this.setCreativeTab(CreativeTabs.tabCombat);

        this.setCreativeTab(CreativeTabs.tabCombat);

       

    }

 

    @SideOnly(Side.CLIENT)

    @Override

    public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {

   

        //instance.logger.log(Level.INFO, "armor model slot  = " + armorSlot);

        if (armorSlot == 0) {

       

            return new ModelWizardHat();

           

        } else if (armorSlot == 1) {

       

            //return new ModelWizardChest();

       

        } else if (armorSlot == 2) {

       

            //return new ModelWizardLegs();

           

        } else if (armorSlot == 3) {

       

            //return new ModelWizardBoots();

           

        }

 

        //instance.logger.log(Level.INFO, "got to default");

        // Default

        return null;

    }

 

    @SideOnly(Side.CLIENT)

    @Override

    public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) {

   

    // Setup Variables

        String path;

 

        if (slot == 0) {

       

            path = instance.modid + ":" + instance.textures().textures.get("HIGHWIZARDHAT.PNG");

            return path;

           

        } else if (slot == 1) {

       

            //path = instance.modid + ":" + instance.textures().textures.get("EBONYCHEST.PNG");

            //return path;

           

        } else if (slot == 2) {

       

            //path = instance.modid + ":" + instance.textures().textures.get("EBONYLEGS.PNG");

            //return path;

           

        } else if (slot == 3) {

       

            //path = instance.modid + ":" + instance.textures().textures.get("EBONYBOOTS.PNG");

            //return path;

           

        }

 

        // Default

        return null;

    }

   

    @Override

    public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {

   

    // Ensure that it is a player

    if (player != null) {

   

    // Check to see if hat

    if (itemStack.getItem().equals(instance.highwizardhat)) {

   

    // Apply Night Vision

    player.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 20, 1, true));

       

    }

   

    }

   

    }

       

}

 

 

 

Then you need to make a model.  I use Tecne for this, but there are other ways.  There are plenty of tutorials out there on it.

Long time Bukkit & Forge Programmer

Happy to try and help

Link to comment
Share on other sites

Alright then. I think I understand what you guys are trying to say. If I don't I'll be here again.

 

One more question. I made another post couple days ago that ties in with these questions, no response on that one.

 

http://www.minecraftforge.net/forum/index.php/topic,19937.0.html

 

I'm confused because I modified to loops just like I did for the shaped and the shaped recipes work fine for me as far as my testing went, but the shapeless will only work in a 3x3.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.