-
Posts
153 -
Joined
-
Last visited
Everything posted by WorldsEnder
-
The second parameter is in ticks I believe. Try something higher like 20 (which should correspond to ~1s). player.addPotionEffect(new PotionEffect(Potion.blindness.id, 20, 3));//1 replaces with 20
-
Just bumping this
-
Server Side Key Handler Crash [unsolved]
WorldsEnder replied to wookiederk's topic in Modder Support
The full error report would be appreciated. -
Hi guys, as of the new update for 1.6 some code changed. One of these changes is that the Entity-sensitive method getDamage(...) for example swords got removed. Also a new method, not deobfuscated yet, has been introduced. (Item#func_111205_h()). You return a Multimap<String, AttributeModifier>. The sword for example puts a new entry in there: .put("generic.attackDamage", new AttributeModifier(..., ..., (double)this.weaponDamage, 0). This means what you guess when first looking at it: The sword damages with its attackDamage (normal damage). Done. Easy. The problem now is that there is no way known to me that this is entity-sensitive. At first I thought that maybe all entries of the map are passed to the entity but no. Putting something else than "generic.attackDamage" in there doesn't seem to affect anything. Do you know any solution? Or is this something not implemented? Looking forward to your answers Ty
-
I think the function of this should be that a custom GUI can be rendered under everything else. This is at the moment not the case. I will quote the code in question: GuiIngameForge: line 101 if (pre(ALL)) return; fontrenderer = mc.fontRenderer; mc.entityRenderer.setupOverlayRendering(); GL11.glEnable(GL11.GL_BLEND); line 107 In my opinion the first line should be moved down to the bottom. This would let modders allow to render their Gui as Pre with type ALL. Currently the event is posted before setupOverlayRendering() which means that the screen is shifted and more.
-
[1.6.2] Some update issues (from 1.5.2)
WorldsEnder replied to WorldsEnder's topic in Modder Support
Ohhh man, this method is final. Hm, I think looking into Zombie or Skeleton should give me some hints. So normally I check for the class of the entity given and hand back the right location? I guess that would be how it's meant to work but I set the textures manually later on. Do you know if it would throw an exception if I return null? Attribute system? Can you explain that a little bit more, please? It's just that I returned different damage values if it was an entity written by myself (they have ~2000 life so can't slay them with a normal sword). -
Detecting if the character has a specific armor equiped
WorldsEnder replied to thib92's topic in Modder Support
You just need to subscribe to the Event "RenderPlayerEvent.Specials.Post". This will secure that your glow will be rendered AFTER (use .Pre if you want it before) everything else. You can do this like this: import cpw.mods.fml.common.Mod.EventHandler; import net.minecraftforge.client.event.RenderPlayerEvent.Post; class YourRenderer { @EventHandler public void renderGlow(Post renderEvent) { Player p = renderEvent.entityPlayer; boolean isHelmet = (p.getCurrentArmor(0).getItem() instanceof YourArmorClass); //etc... } } Put the method whereever you want, preferably in a new class that will handle all your rendering stuff or something. All you have to do is creating a new Instance of this class in your @Mod-class I guess (at least that's how I understood the @EventHandler thingy). This means in your @Mod file there is a variable declared: @Mod class bla { private YourRenderer myRenderer = new YourRenderer(); //Instance } That done myRenderer is now ready to receive events of type RenderPlayerEvent.Specials.Post. -
Hi guys I hope you can help me with some update-issues caused by deprecated code, etc. 1st issue: The easiest. The method EntityLiving#getMaxHealth() seems to has been removed. How do I do that now? 2nd issue: "The type RenderMinedom must implement the inherited abstract method Render.func_110775_a(Entity)". I don't know what this is there for... has the texture-variable been removed? What should I return? (ofc a ResourceLocation but what exactly is this?) 3rd issue: The method Item#getDamageVsEntity() is now deprecated. I loved how this worked and stuff... is this now meant to be decided at the entity only? I hope I get some feedback on how to upgrade my mod to the current version of forge. Thanks, community, in advance. Me
-
ItemStack gets placed twice into Container, not really though
WorldsEnder replied to WorldsEnder's topic in Modder Support
If any one has some sort of answer feel free to tell me -
ItemStack gets placed twice into Container, not really though
WorldsEnder replied to WorldsEnder's topic in Modder Support
Not quite. When I click, the itemStack gets placed two times into the container. NOT in two slots but it gets stacked intop of the other and if I have something in my hand I kinda duplicated the stack and 64 get placed into the container. No matter what when I then try to get them out of there I get nothing. Example: I have 34 items in my hand. I click a slot. Then in the slot there are 64 items and I have 4 items remaining in my hand. Example 2: In the slot there are n items. I click to pick them up. Then in the slot there is nothing and in my hand neither. Example 3: In the slots for the player's inventory there are 64 items. I shift click and then in the container there are 2 stacks of 64 items (on slot 1&2) Note that this whole thing only happens when I click into my own inventory and not when I click into the 9 binded slots of the player's inventory. -
ItemStack gets placed twice into Container, not really though
WorldsEnder replied to WorldsEnder's topic in Modder Support
Ah yes, I read through the tutorial but I can't use most of it as I have no TileEntity. Instead I have a Inventory for every player just like the ender inventory. I guess I will just post the classes: GuiHandler: http://paste.minecraftforge.net/view/7d1978a0 Inventory: http://paste.minecraftforge.net/view/436d1e2d Container: http://paste.minecraftforge.net/view/c8d66e74 the Gui: http://paste.minecraftforge.net/view/52628a8a and for completeness: the accessed MHStatsHolder: http://paste.minecraftforge.net/view/8dee3520 and the MHHunterStats: http://paste.minecraftforge.net/view/a9fe81f8 I guess that's all accessed classes. I know it's much to read through Thanks in advance Me -
Pretty much what's in the title. When I place something in the container it get's placed there twice and not updated. When I try to take it out again I get nothing. I copied all the methods in Container and Inventory class from the corresponding PlayerInventory-classes. If you want to see them pls tell me Though I already told you that I just took them from the playerInventory.
-
Items thrown out of inventory instead of being put into "hand"
WorldsEnder replied to WorldsEnder's topic in Modder Support
Actually it was a problem with the GUI. The GUIContainer class features a ySize-variable which defines wheter you have clicked "out of the GUI". If yes then the ItemStack you have in-hand is thrown away. As my GUI was a bit bigger than the default sitze of 176*166 I clicked "out of the Gui" and the items got thrown away. One mystery less in the world ^^ Appreciated your help Me -
Items thrown out of inventory instead of being put into "hand"
WorldsEnder replied to WorldsEnder's topic in Modder Support
Nope I tried it out and nothing I really tried to stick to this tutorial: http://www.minecraftforge.net/wiki/Containers_and_GUIs but well it seems not to work... -
Items thrown out of inventory instead of being put into "hand"
WorldsEnder replied to WorldsEnder's topic in Modder Support
Nothing has changed with the new, of c I changed the code to fulfill my expectations, code. Well I hope you (community) can keep the great support coming Me -
Items thrown out of inventory instead of being put into "hand"
WorldsEnder replied to WorldsEnder's topic in Modder Support
It's happening all the time no matter if I shift-click or click normally. Though I will try to put parts of your code in. Thanks for sharing If you have something against that please answer. Sincerely Me -
Hey guys. I have a problem which is exactly what the title says. I have made a Container and opening it up works fine. I have not tested putting something in and taking it out again because well I have bind player's Inventory and a custom inventory and try to let items be switched between them. I guess I have to override some method in the Container. Here are my 2 files: MHItemChestContainer: http://paste.minecraftforge.net/view/1c70ae3b InventoryMHItemChest: http://paste.minecraftforge.net/view/3d880296 If you need anything else, just ask for it Thanks for your time
-
Null pointer exception - help! :( -> another problem
WorldsEnder replied to DELTA_12's topic in Modder Support
Wrong! The thing that is not initialized is shipGen -> pastebin: http://pastebin.com/cphycLu5 +1line because there is one at the top. So you call the static variable shipGen which is, as no constructor or anything had to be called yet, not initialized. The field is null (default value of a variable which is not type int, float, double, etc.). That's why the Esception is called NULLPointerException. Next time something you wrote throws a NullPointerException please search for the line where is happens, enable debug-mode in Eclipse, put a breakpoint there and there you go. Inspect the values when the breakpoint triggers and you will surely find one or more variables which should execute some methods but are null. This is ofc not allowed so you get a NullPointerException. NP Me -
Just another thing I wanted to mention: Download this little progam: http://www.minecraftforum.net/topic/840677-nbtexplorer-nbt-editor-for-windows-and-mac/. It's a great tool to check if your NBTData has been saved or not. Just don't forget to reload.
-
Changing the color of an item programmatically
WorldsEnder replied to Boxtop5000's topic in Modder Support
Or you could use random.nextInt(16**6), or do an HSV-to-RGB conversion with values (random.nextInt(16**2),0,100). Ahm just a short question. What does the double-*-sign do? I have never seen that in any javacode yet. PS: keep them answers coming, the more, the better. And opne a possibility for me to ask something back just for the post-count -
Okay, like I pointed out a_class_that_can_store_your_values must be a real class. Maybe I just post the code on some external page. http://pastebin.com/XH8FuGNe This should work fine if you replace the Strings I marked to be replaced.