Jump to content

hugo_the_dwarf

Members
  • Posts

    334
  • Joined

  • Last visited

Everything posted by hugo_the_dwarf

  1. Thinking about it you might not even need a new class (unless you want it to have custom properties/functions) Static Block newGlassPane; newGlassPane = new BlockPane("glass", "glass_pane_top", Material.glass, false); //First String 'glass' is the side textures, Second String 'glass_pane_top' is the top and bottom, maybe even rims, then the Material, the boolean i'm not sure but leave it as false. I haven't looked into the class too much to see it's use. so you could so your own with this: Static Block myPaneClone; myPaneClone = new BlockPane("stone", "cobblestone", Material.rock, false).setHardness(1.5F).setResistance(10.0F).setStepSound(soundTypePiston).setBlockName("stoneSheet"); but like I said if you need to have custom functionality you can create a new class that "extends BlockPane" and overwrite the methods you need
  2. Would it not be easier to extend GlassPane and just overwrite the material and texture?
  3. Fixed it, somehow the client was getting a version of the tileEntity messing it (update server, update client. Different values) so I just made the update work with (!getWorldObj.isRemote) and now renders fine with changing the textures. Thank you Jabelar for the code shortener.
  4. Ah that makes it easier, the reason why I had all those complicated else ifs (would have used a switch, but your way is much more compact and efficient), if you are wondering why I have cd1 & cd 2 (cooldown 1 and 2) is entities update every tick which is what, 100 ticks a second if not more or less. And this tileEntity looks for chests in a range (triple for loops) to try to increase or repair itemstacks (can see this being a issue with other mods the repair that is) and since it searches in a wide range and I'm thinking of server wise where there can be many players making many of these and I can see the system getting bogged down with 20+ entities updating every tick (lets say 100 per second) and that there are 30 entities. I'm sure the overhead will get over the top if 30 * 100 * (14 * 14 * 6), unless these run fairly low budget I just don't want these things to kill a server (PvP, Team Mod) Also watching my console I get this: Charge: 27.614689 Mana: 44.183502/160.0 Metadata: 4 ---------- Charge: 29.674688 Mana: 47.4795/160.0 Metadata: 4 ---------- now it's all fine and dandy, but this is from one update (only one entity in exsistance) it double updated, not only that I think the "writeNBT" is going nuts and activating randomly (which I think it should be doing?) it's also reading too, and for some reason it keeps resetting it's values (mana = 0, cd's) not only that it's also making its texture mess up (switching from one to the other meta instantly twice in one go) What the heck did I do?
  5. Has how tileEntites work changed drastically since 1.6.4?
  6. Could it just be updating a server and client side at the same time? make one request, update the gui and object?
  7. What kind of problem? Are you having an issue getting to the NBT? or just using it? Could you post the Item?
  8. I'm trying to make a device that will slowly charge up and change it's physical appearance based on its current charge. However when it gets above a certain threshold (around 30 - 45) it messes up changing the blocks metadata and it's own charge resets to 0, then back again, it's just a mess. Block TileEntity Did I define them wrong? making the updates in the wrong places?
  9. Do you have to tell a dimension what mobs it can spawn? I think when it goes to spawn mobs it gets an empty list when it goes to randomly pick one to spawn "Random.nextInt(value)" I'm just reading your errorlog and the stacktrace seems to lead to what TGG suggested.
  10. Where in your code are you using "Random.nextInt(Unknown Source)" when using nextInt you have to use a postive and greater then 0 value (because it returns a random between 0 and value) that is the only issue, then it crawls up from spawnAnimals to your populate function line 467. What is that line btw, can you just post that segment for me?
  11. My Bad, I forgot to register them... My tileEntities keep giving this in my console Is there something new from 1.6.4 -> 1.7.2 with Tile Entities or how NBT reading/writing works? Block that holds the tileEntity: tileEntity: or am I making this comepletely wrong? it works fine in 1.6.4. Is it because I removed IInventory from my tileEntity? Also it refuses even with enough mana to increase the itemStacks in nearby chests.
  12. Thanks, can't believe I was that Dense >.> by that I mean not adding a .name to see if it would clear it up. And I guess I have to wait or make a new thread about packets. I know the tutorials subboard has something about IMessages and that they "could" be used to send info from the player to tileEntity. But that is with a different packet thingy, so hopefully someone can tell me the correct way of doing so or lead me to the right direction. Thanks for your help. Much appreciated.
  13. Ok got multi texturedm subset blocks working, but I noticed with my mana items the names show up, but have a ".name" on them in game. How do I remove that? I have a lang file which I believe is working, but why does looking at the item give me "Mana Crystal.name"? ItemMana Lang File tile.testBlock.name=Test item.manaConverter.name=Mana Converter item.relicRepair.name=Key of Mending item.gunpowderInfuser.name=Gunpowder Infuser item.relicHeal.name=Locket of Life item.relicLife.name=Brooch of the Scarab item.manaCrystal.manaCrystal=Mana Crystal item.manaCrystal.manaShard=Mana Shard item.manaCrystal.manaFoci=Mana Focus itemGroup.RoT=Rise of Tristram Also I don't know if I should make a new thread or I can ask here. But I have the PacketPipeLine setup using AbstractPackets which I used for this tutorial Event Handlers and IExtendedProperties for mana but it goes off and uses the DataWatcher (which of course is better) but I don't know where to go to find out how to use packets, and use them properly. I have some ideas for tileEntities but I need to send data from a Gui to them, and thus idk how to use a packet to do that. A simple tutorial or a exsisting thread explaining/showing this would be nice, or explain it here for me would be great. PS. The tileEntities are not a simple inventory one, else i'd be fine with the current Container transfer of itemStacks.
  14. Thanks all of those did the trick, can't believe I accidentally made a black hole. And I see now, tried it out, hasSubtypes allows that, thanks. Now to play around with subtyped and multi textured blocks.
  15. Seemed to work fine without "hasSubtypes(true) and setMaxDamage(0)" but I added them in for the sake of suggestion(and proper use) @TheGreyGhost Didn't know I could use itemStacks in the crafting prams, got that working fine and dandy now thanks. However following ItemColored I get a crash when I hover over my item now. The crash report is a stackoverflow (oh no!) and it is caused on the line that returns the unlocalized name. Is it because ItemColored is ItemBlock and not Item? my Code: ItemColored Code: Having the crafting work and having that bit of info that I can use Itemstacks is great. So that's one of my problems down (1 of many) now I just need the naming. Edit: oh and how can I have them stack with only the same damaged subset? I know I forced the stackSize to 1 only because I when I picked up one of them theyd merged and become the same as the first one in inventory (have crystal in first slot, pick up shard, now have two crystals) what is the way to get around this? or is single stacks the way to go?
  16. I was wondering what is the best way to make an item with subsets (ItemMana is composed of Mana Crystal, Mana Shard, Mana Foci) Right now Im using the item's damage to make the subsets, but then I ran into the issue of "How do I name each one differently?" So, what is the proper way of doing this? And also if using ItemDamage can I check that for crafting recipes that's another big concern because I want 4 shard = 1 crystal, and 4 crystals + 4 diamond = foci. I would ask about blocks but I googled (and searched this forum) and found this http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/modification-development/1437838-1-7-2-forge-metadata-blocks-and-items so I figure I can use that as my starter for blocks. Edit: to add the current class
  17. Ah right derp, I haven't used subString for a long time now so forgot how it actually works. My bad. And the reason why I tossed .toLowerCase() in is because some of my custom items I use camel case like itemRelic and if I wanted to compare "itemRelic" to "itemrelic" it won't work (or would it?) so I just make them both lowercase to be safe.
  18. have you tried outputting the name to the console so you know what value to use? String theitem = player.getHeldItem().getUnlocalizedName().substring(5); System.out.println(theitem);? also remember you are using "substring(5)" so you probably want if (theitem.toLowerCase().equals("diamo"))
  19. Why grab the name? just use the item itself like if(player.getHeldItem().equals(new ItemStack(Items.diamond)))
  20. have you tried making your own method to look for runes and the amount of them and return a boolean? then you would call it with: public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(MagicGui.SelectedSpell == "DestroyUndead") { if (checkForItemsAndAmounts(new ItemStack[]{CombatOverhaul.LifeRune,CombatOverhaul.EarthRune}, new int[]{2,2}, par3EntityPlayer.inventory)) { if(par3EntityPlayer.capabilities.isCreativeMode||(par3EntityPlayer.inventory.consumeInventoryItem(CombatOverhaul.LifeRune.itemID)&& par3EntityPlayer.inventory.consumeInventoryItem(CombatOverhaul.LifeRune.itemID)&& par3EntityPlayer.inventory.consumeInventoryItem(CombatOverhaul.EarthRune.itemID)&& par3EntityPlayer.inventory.consumeInventoryItem(CombatOverhaul.EarthRune.itemID))) { par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); //change to custom sound later if (!par2World.isRemote) { par2World.spawnEntityInWorld(new EntityDestroyUndead(par2World, par3EntityPlayer)); } } } } return par1ItemStack; } You might have to tweak it here and there but the basic idea of the new method (posted in spoiler) is that it checks first before you use consumeInventoryItem (because that method when used does just eat an item if it can, so bad idea to run it in a IF statement)
  21. Give it a max damge "setMaxDamage(int);" I think if you extend the Tool class you can use the method "damageItem" if not you might have to make your own public method that does that for you something like: public void damageItem(Itemstack is, int dmg) { setDamage(is, is.getDamage(is) - dmg); } then in your method you'd have: @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer player) { if(Minecraft.getMinecraft().objectMouseOver!=null) { int xm=Minecraft.getMinecraft().objectMouseOver.blockX; int ym=Minecraft.getMinecraft().objectMouseOver.blockY; int zm=Minecraft.getMinecraft().objectMouseOver.blockZ; player.setPositionAndUpdate(xm, ym, zm); player.fallDistance=0F; //par1ItemStack.damageItem(1, player); //with this command it should be take damage damageItem(par1ItemStack,1); } return par1ItemStack; } Of course in the end all you probably need is a maxDamage on your item if you haven't set that yet.
  22. Seems one of your crafting recipes have gone and malfunctioned, I'll post a few working recipes and hopefully you can check between them to fix your issue. EDIT: Let me look through I think you just coded it wrong. Ok it looks like you just had a mishap on your item, your recipe: GameRegistry.addRecipe(new ItemStack(myItem, 10), new Object[] { // Letter = Block, Space = Nothing " A ", " A ", " B ", 'A', Items.potato, 'B', Items.stick } ); is using myItem which is not defined as anything public static Item myItem; //public static // myItem2; //public static // myItem3; //public static // myItem4; //public static // myItem5; Item blasterRifle = new ItemBlasterRifle(); so you want to use "blasterRifle" not "myItem" as your return. That you make public static Item myItem = new ItemBlasterRifle(); or define "myItem" as bullets as I think that is what you are going for with that recipe.
  23. gradlew? like getting it to make your environment so you can actually start modding? It's easier to just make a .BAT file (if you use windows, I think it's a shell for mac) and in the same folder with "gradlew.bat" you want to make a bat file (I called it run) and inside you just need "gradlew.bat eclipse" save it and run it. Should start the process of downloading and setting up your enviroment. Also this should help you http://www.minecraftforge.net/forum/index.php/topic,14048.0.html I'm just going by this statment here
  24. Taking a stab here but "entityplayer.getDisplayName();" if you really wanted to I guess you could pass the whole Player instance into the block (might be a bit overkill but then the block if you have it tick can use or effect the owner, probably wrong there still a bit new to this) I'm interested in this as I want to mod owned blocks too. where only owner/creative/admin can edit/use it
  25. Ok, so I guess I can try to muck around with NBTTagCompunds and see if I can mash a Vector3f in them, might have to make my own Class thinking on it if I want to store a Block ID:Meta with a location aswell (so if I make a new class for that what would I have to Extend/Implement?) Oh? Packets are something that are still a mystery to me I had *assumed* since the GUI class gets passed and instance of the TileEntity that it was being altered in realtime, I know my tests allow me to use commands and make changes in the TileEntity from the GUI so somehow my wrong way is partially working (hit and miss) And here is the entire GUI class, the stuff I snipped out before was two methods, I don't even know if I need the Mouse Clicked method, I was looking at someones GUI tutorial trying to find how to add buttons and use them. All of the GuiClass excluding imports* public class GuiBaseBuilder extends GuiContainer { public static final ResourceLocation texture = new ResourceLocation(Main.MODID.toLowerCase(), "textures/gui/blankGui.png"); private TileEntityBaseBuilder bb; private int cw = 15; //control Width private int ch = 15; //control Height private int x = 0; private int y = 0; private int z = 0; public GuiBaseBuilder(Container par1Container) { super(par1Container); } public GuiBaseBuilder(InventoryPlayer invPlayer, TileEntityBaseBuilder entity) { super(new ContainerBaseBuilder(invPlayer, entity)); xSize = 176; ySize = 165; bb = entity; } @Override protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { int posX = (this.width) / 2;//middle of the GUI image int posY = (this.height) / 2;//middle of the GUI image int xBuffer = 29;//just my own margin for drawing buttons GL11.glColor4f(1F, 1F, 1F, 1F); Minecraft.getMinecraft().renderEngine.bindTexture(texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); this.buttonList.clear(); //Start with main control buttons this.buttonList.add(new GuiButton(0, posX + xBuffer - 60, posY - 80, 60, 20, "Start/Stop")); //right now does nothing, as it was hit and miss this.buttonList.add(new GuiButton(1, posX + xBuffer, posY - 80, 25, 20, "Add")); //Adds the location based on x,y,z this.buttonList.add(new GuiButton(8, posX + xBuffer + 25, posY - 80, 25, 20, "Clear")); //Clears all the locations //Location controls this.buttonList.add(new GuiButton(2, posX + xBuffer, posY - 50, cw, ch, "<"));//X left this.buttonList.add(new GuiButton(3, posX + xBuffer + cw, posY - 50, cw, ch, ">"));//X right this.buttonList.add(new GuiButton(6, posX + xBuffer, posY - 35, cw, ch, "Y+"));//Y up this.buttonList.add(new GuiButton(7, posX + xBuffer + cw, posY - 35, cw, ch, "Y-"));//Y down this.buttonList.add(new GuiButton(4, posX + xBuffer, posY - 20, cw, ch, "^"));//Z up confusing should be 'forward' this.buttonList.add(new GuiButton(5, posX + xBuffer + cw, posY - 20, cw, ch, "v"));//Z down confusing should be 'back' //Visual information on location this.drawString(fontRenderer, "X: "+(x+bb.xCoord)+" offSet: "+x, posX + xBuffer - 90, posY - 38, 0xFFFFFF); this.drawString(fontRenderer, "Y: "+(y+bb.yCoord)+" offSet: "+y, posX + xBuffer - 90, posY - 28, 0xFFFFFF); this.drawString(fontRenderer, "Z: "+(z+bb.zCoord)+" offSet: "+z, posX + xBuffer - 90, posY - 18, 0xFFFFFF); } @Override protected void mouseClicked(int par1, int par2, int par3) { super.mouseClicked(par1, par2, par3); } @Override protected void actionPerformed(GuiButton button) { switch (button.id) { case 0: bb.switchOnOff(); break; case 1: bb.addLocation(x, y, z); break; case 2: x--; break; case 3: x++; break; case 4: z--; break; case 5: z++; break; case 6: y++; break; case 7: y--; break; case 8: bb.clearList(); break; } }
×
×
  • Create New...

Important Information

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