Jump to content

hugo_the_dwarf

Members
  • Posts

    334
  • Joined

  • Last visited

Everything posted by hugo_the_dwarf

  1. I guess if there is too many to render and such. why not have a green checkmark and a red x for "this item is not accepted" and since people know you need valueables hopefully they can guess that mods that have "gems" and "precious metals" will make those items as beacon tribute. If not they can toss items in willy nilly and see what works.
  2. I'm still a beginner modder, and I have done some more advanced stuff. Still a huge amount I need to learn still, but I wouldn't mind tossing in my coins in helping out. Even if it is here and there.
  3. Well judging by the error of: buildcraft.transport.TileGenericPipe cannot be cast to net.theepictekkit.generator.common.tileentity.TileEntityWindTurbine That somehow, somewhere a block or something that is taking a raw tileEntity (most likely from a world.getTileEntity()) is grabbing a pipe and then trying to cast it to your TileEntity. Try wrapping that part in a Try Catch, and in the catch have it output the coords into the console so you can go find the location and see what horrible sorrcery is happening with the pipes and windmills. That is if it still doesn't crash on you even with a try catch
  4. oh, I just thought you were referring to only the displays and somewhere in the back there was a list of "what is allowed in this slot, and be used" so modders would just need to add somewhere "beaconBase.getItemUseList.add(mycustomItem/new ItemStack(myCustomItem,1,0))" or what have you So apologies I thought the GUI was just displaying an IIcon from the list of accepted items.
  5. what if those items that could be used if list is > then default size cycle through the list of icons to display. //The four vanilla defaults 0 = emerald, 1 = diamond, 2 = gold ingot, 3 = iron ingot. 4 = custom ingot, 5 = custom gem, 6 = custom nugget Displays like this: 0,1,2,3 advance the list by one every few seconds , bot too fast 1,2,3,4 2,3,4,5 3,4,5,6 4,5,6,0 5,6,0,1 and then over and over, just keep cycling thought the list of what can be used. EDIT: hope my suggestion has not angered anyone with me butting in.
  6. I'm using this tutorial atm http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-1-7-2-1-6-4-custom-inventories-in-items-and it's about making what you wish for. Don't think there is that big of a difference from 1.7.2 to .10
  7. have you tried a CD int? you tried a counter loop, I think you had the right idea? or did exactly what I'm going to tell you: int CD_TIME = 45; int coolDown = CD_TIME; @Override public void updateEntity() { if (coolDown == 0) { coolDown = CD_TIME; //put delayed commands in here } else coolDown --; } I think someone asked me why I did that and it's because some of my tile Entities have some large CPU hungry commands that they don't need to run every tick, just every now and then (to make sure things are going ok) one day I'll re-factor to something nicer and more intelligent but I just use my manual counters, since a tile Entity and other entities update every tick (that's what 100 times a second?) so the delay would be every 45 ticks. This is just my really dumb workaround. Maybe someone will come along with a better more efficient solution
  8. since it is a click and a toggle you can just use button.get(i).enabled = !button.get(i).enabled; this is just a quicker way of toggling the code or you can use: button.get(i).enabled = button.get(i).enabled == true ? false : true; //You might be able to leave out the '==' since it is a boolean and you only need to say bool or !bool for true and false
  9. Looking at vanilla code (can't post it) the villagers "interact" event is what spurs the opening of the merchantGUI menu same method that lets you put saddles on pigs, milk cows.
  10. Yeah for making your buttons activate-able (im assuming you mean toggle-able, click it once its on, click again its off. Rinse and repeat) when you make your custom buttons just add in a Boolean called "active" and you can guess what the true and false states will do. then you can just access the button (if you save it as a list in your GUI) MyButton1.active and do your stuff based on its state. this is as far as I can help, i'm still tinkering with it myself.
  11. 20 for default buttons, if you want buttons that are a bit bigger, you're going to have to make your own guiButton, I know I just needed a button that had a few extra variables to store info in so I just extended GUIButton and added them.
  12. @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister ir) { icons = new IIcon[2]; icons[0] = ir.registerIcon(Main.MODID+":"+"ingot"); icons[1] = ir.registerIcon(Main.MODID+":"+"ingot"); } define the array as the size you want also I wonder if you can trick it by not using two by overriding @Override public int getRenderPasses(int metadata) { return 1; } so it only does one pass, that way it will most likely be less hungry for double rendering for no reason
  13. Odd, because it works for me: public class ItemCrossbowRepater extends Item { //A weapon that will use the player's stamina reserves to fire weak arrows //It has different functions with different effects //Will be reworked hard when a proper leveling system is created //See notes on this. private IIcon[] icons = new IIcon[2]; public ItemCrossbowRepater() { setFull3D(); setMaxDamage(0); } @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister ir) { /*for (int i = 0;i < textures.length; i++) { textures[i] = ir.registerIcon(Rot.MODID+":"+"relicLife_"+i); }*/ icons[0] = ir.registerIcon(Rot.MODID+":"+"cbr"); icons[1] = ir.registerIcon(Rot.MODID+":"+"cbr_overLay"); } @Override @SideOnly(Side.CLIENT) public int getColorFromItemStack(ItemStack par1ItemStack, int par2) { if (par2 == 0)return 0xFFFFFF; else { switch (par1ItemStack.getItemDamage()) { case 0: return 0xFFFFFF; case 1: return 0xFF622E; case 2: return 0x4DC9FF; case 3 : return 0xFFE263; default: return 0xFFFFFF; } } } @Override @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() { return true; } @Override public int getRenderPasses(int metadata) { // TODO Auto-generated method stub return 2; } @Override public IIcon getIcon(ItemStack stack, int pass) { // TODO Auto-generated method stub return icons[pass]; } Maybe it only works with multiple render passed items?
  14. there is a method for items called "getColorFromItemStack" you then return the hex value you want (or the decimal conversion if it, but I find it easier to just use 0xFFFFFF or the likes) the two params are itemstack and renderpass
  15. ok did some more digging and I found that renderBiped and renderPlayer are what call "getArmorTexture" from Item (which is used mainly in ItemArmor that extends Item) So I guess I need to know how to make a custom renderer for players wearing my armor so I can use more render passes to do my overlays?
  16. I know events help with this LivingHurtEvent event you can then get the damage amount from there and output it.
  17. I think he's just a little confused. I will assume (and I hope I'm correct) that your packet is registered for SERVER (GUIs are client side so only natural to receive those packets on the server) Your packet is what is loaded and sent from the client (modname.<instance of your network channel>.sendToServer(new MyMessage("information"))) this would be called or used in the GUI now your packetHandler (which is what the server is using) is listening for all packets of "MyMessage" (or in my mind it is) and it has one function "onMessage" This is where the packet is received, and what everyone is saying Is them saying "Inside your 'onMessage' method inside your handler extract the information from the passed 'MyMessage'" Just look at the example from the tutorial mainly System.out.println(String.format("Received %s from %s", message.text, ctx.getServerHandler().playerEntity.getDisplayName())); return null; the example 'message' has a public String text; field so that is why in the string format 'message.text' is being used as the first index. However yours you would probably have: MyMessage (int x, int, y, int z, int value) { this. x = x; this.y = y; this.z = z; this.value = value; } and your handler will find the world from the player and from the world the tileEntity te = (yourTileEntity)ctx.getServerHandler().playerEntity.getEntityWorld().getTileEntity(MyMessage.x, MyMessage.y, MyMessage.z); te.valueHolder = MyMessage.value; that's the basic idea you might also want to throw other things into it like catching for nulls or what have you. Hopefully this has increased your understanding of how it works if not then I failed horribly.
  18. Hopefully what im going to say helps clarify what they mean. the IMessageHandler is what the server gets (I only know how to use server side based packets like the example) so you send the entities coords (be it tile or what coolAlias said) you can then use "int x = message.x, y = message.y, z = message.z;" "ctx.getServerHandler().playerEntity.getEntityWorld().getTileEntity(x, y, z);" just as an example. so you'd probably send your new nickname() and the entities coords, have the server search for the entity and then use your setNickname(message.nickName) If I understand the general concept of what you're doing. I also hope I didn't just dish out a heap of rubbish, but I'm sure coolAlias and/or diesieben07 will clarify
  19. *Bump* Sorry if this seems like a really simple question but my google-fu has failed me. And nowhere do I see where I can override the render passes for the textures drawn on the player.
  20. I found this tutorial really helpful for setting up your container and the transfer stack code http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571390-1-6-2-advanced-minecraft-forge-modding-tutorial-2
  21. Hey so I'd like to make two armor classes "ItemArmorMyCustomArmor" and "ItemArmorMyCustomArmorWithOverlay" I found a tutorial on how to make the first armor class (so this means I know I need to look in "myModId:textures/model/armor/" for the layer_1 and 2.png) however it did not explain how to add overlays (I know how to do this for normal items) and looking in the ItemArmor class seems like only CLOTH or leather armor types get the overlays. How ever I do not want vanilla overlays or use CLOTH for all my armor types, I want to make suits of armor that can be customized by the owner (dying leather armor, only now can dye trim and armor base) here is my attempt at the normal armor: import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ee.rot.Rot; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; public class ItemArmorCustom extends ItemArmor { private String texturePath = Rot.MODID+":textures/model/armor/"; public ItemArmorCustom(ItemArmor.ArmorMaterial mat, int wornSlot, String type) { super(mat, 0, wornSlot); this.setMaxStackSize(1); this.setTextureName(type, wornSlot); } private void setTextureName(String type, int armorPart) { switch(armorType) { case 0: case 1: case 3: this.texturePath += type + "_layer_1.png"; break; case 2: this.texturePath += type + "_layer_2.png"; break; } } @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister ir) { this.itemIcon = ir.registerIcon(Rot.MODID+":"+this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf('.')+1)); super.registerIcons(ir); } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { return texturePath; } } If something is wrong or should be done differently being corrected and educated would be much appreciated the tutorial I watched was for 1.6.4 which shouldn't make a difference other then wondering why he made a separate method to set the texture location.
  22. what kindof error? is it crashing complaining about not being able to find class Side? what forge source are you using? I remember someone telling me that, so I hope someone can learn from my mistakes here is my thread on this very issue http://www.minecraftforge.net/forum/index.php/topic,22347.msg113330.html#msg113330 If that is not the issue I can show you how I use mine but just want to make sure that it's just a forge version error because I don't want to taint your learning by feeding you copy paste ready code.
  23. Well as far as I know (and don't take my word 100% and I hope someone will correct me if I'm wrong) single player is basically a server, client already (I think once they updated minecraft to let single player worlds open to LAN they made this happen, once again hope someone corrects me) I would say yes still works single player because my TileEntities save information this way. (just make sure the tileEntity is reading and writing to the NBT so it persists on server closing and loading)
  24. http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-1-7-2-1-6-4-custom-inventories-in-items-and May not be for "other entities" however it shows you how you would add an "inventory" I would then also suggest looking at zombies in vanilla minecraft but I ran through it and didn't find any idea how they hold armor and can pick up 1 item (shovel, sword, dropped item) So i'm not sure where can find a tutorial for non player entities having inventories and dropping them on death. But I know the posted one works for custom player inventories and hopefully you can get something out of that to get an understanding and maybe you can then play around with it?
  25. I had this issue too, You need to use packets. See the thing is is you are saving it but in the wrong place (clientSide) which is only a display (thus why GUIs are client side) This should help you get started also I suggest the latest 1.7.2 and up versions for this https://gist.github.com/CatDany/4a3df7fcb3c8270cf70b also check out the tutorials sub forum about the simpleMessageWrapper for a better understanding how to use the packets. TL;DR You need your GUI to send a packet to the Server, inwhich the server will handle the rest (aka find the tileentity in question and make the changes)
×
×
  • Create New...

Important Information

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