
Mew
Members-
Posts
567 -
Joined
-
Last visited
Everything posted by Mew
-
Function problem-- Screwed up the datawatcher, or lack of a packet?(SOLVED)
Mew replied to Cyan's topic in Modder Support
Ahh. I see now I may use this more often now... Thanks for that mate -
Function problem-- Screwed up the datawatcher, or lack of a packet?(SOLVED)
Mew replied to Cyan's topic in Modder Support
I wasn't saying use a packet for EVERYTHING, I was saying that I use a packet to update the client from its "dumb" stage to a slightly knowledgable level so that the client displays correct data. I am not entirely sure about datawatchers and if they update the client or not... -
Function problem-- Screwed up the datawatcher, or lack of a packet?(SOLVED)
Mew replied to Cyan's topic in Modder Support
Actually, a packet that is sent from the server to the client everytime the player "relogs" the world (logs in again) containing the information wanted is all you need. (I think... I am pretty sure its that) -
Well I just found that method I wanted. inventoryInstance.getInventorySlotContainItem(ModBase.ItemWanted.itemID); that returns the slot number for the item that contains it. Will do more work later, i have to go for now.
-
And you tell which slot they put it in... how? There is a method that returns the slot number that a certain item is in. But you could always go: inventoryInstance.consumeInventoryItem(ModBase.RandomIngot.itemID); inventoryInstance.addItemStackToInventory(new ItemStack(Item.ingotIron.itemID, 1)); Though that would only work for one. But I am working on a method that will find the slot it is in and such What if they pull it out of the output and eject it into the world? Or put it into a different inventory? Or do something with it that another mod would define? No. You probably don't want to use an ICraftingHandler, which doesn't seem to be called until you pick up the item (or maybe you do, I don't know.) Unfortunately there does not seem to be much of an alternative. There should be a GameRegistry overloaded function for this, similar to addRecipe(IRecipe) but for furnaces. To the Suggestions board! I agree. But I am still working on a workaround for the time being. Its fun!
-
And you tell which slot they put it in... how? There is a method that returns the slot number that a certain item is in. But you could always go: inventoryInstance.consumeInventoryItem(ModBase.RandomIngot.itemID); inventoryInstance.addItemStackToInventory(new ItemStack(Item.ingotIron.itemID, 1)); Though that would only work for one. But I am working on a method that will find the slot it is in and such
-
Except for the fact you have used python code again... You should probably try to fix that. Writing in Python I mean. Oh. Lol. But, but, it's such a better language! While some of my friends tend to agree with that statement, I only agree that is better when it comes to its runtime speed. Much faster than java. But I do like the java syntax so much more...
-
Except for the fact you have used python code again... You should probably try to fix that. Writing in Python I mean. @OP try this: public boolean onBlockDestroyed(ItemStack stack, World w, int id, int x, int y, int z, EntityLiving entity){ super.onBlockDestroyed(...) for(int i = -1; i < 2; ++i) { for(int j = -1; j < 2; ++j) { w.setBlock(x + i, y, z + j, 00); return true; } } }
-
Bump. Can someone please help me? I am really wanting to learn this...
-
I believe he means something like this: { // first mod info stuff "version": "1.0" "name": "RANDOM" }, { // second mod info stuff "version": "1.0" "name": "RANDOM 2" }, { // third mod info stuff "version": "1.0" "name": "RANDOM" } At least thats what I got from the question...
-
In my mod I am wanting to implement shields and I want to have modelled armor as well. I also want to have duel wielding, and have inactive weapons "attached" to the players back. So I was wondering, is there a way to either catch the armor rendering call, and then direct it to render my models onto the player, or is there an easier way? And as for the shields, is it possible to make a new slot in the players inventory that can hold a shield item and render the shield onto the player? Then there is the duel wielding and "inactive" weapons. Duel wielding should be self explanatory, but the inactive weapons may need more explaining. So say, after 3 seconds of not using an item, it renders on the players back as if he is carrying it and the players hand gets rendered instead of the item, but the item is still being "held" (as in it is still the current item in the hotbar). But then, as soon as the player starts using it again, it renders in the players hand and disappears from his back. Thanks for any help able to be given to me. - Mew
-
[SOLVED]How to send render specific information to client?
Mew replied to Busti's topic in Modder Support
Is a tile entity attached to the block? If not, make one for it. I am guessing you have done that because how else would you store the variable? You make a packet that obtains the information yada yada. I think you should know how to do it? -
[SOLVED]How to send render specific information to client?
Mew replied to Busti's topic in Modder Support
You just send the information to the player. I suggest following this tutorial: http://www.minecraftforge.net/wiki/Advanced_Packet_Handling I use it myself. I even use it for small packet handling... I just find it easy to use. -
Quite logical! And I have looked into that. It is not as straightforward as the keyboard stuff. Thus I asked here. Well then.. I have no idea Try looking through source code... But have fun with that.
-
I have never looked into this myself.... But wouldn't it be logical (if the keybindings use Keyboard) to assume that it would be Mouse.nameOfVariable?
-
Probably a stupid question, but function for getting a player's username.
Mew replied to Cyan's topic in Modder Support
Just think about this for one minute... wait, make that a string of minutes. That is not the kind of error that is "easily overlooked". It is basic programming to know that you are wanting a String to return, not an EntityPlayer. If you want a string, the method is a String method! Also, once again, basic programming. The reason someone face-palms (albeit sometimes in a rude way, [sorry Draco, it is rude, even if I would do it too ]) is because someone does something either A) Stupid (like the case sort of is here), or B) Missed something so obvious it should have killed them... -
Okay. (Sorry about that, had a run in with a teacher at school ) Do you have your source code anywhere? That way we can help a lot more. Can I see your Block code (where you activate the trap), and your current Pitfall generator?
-
you can do so by obtaining the players X, Y, and Z spawn coords. The can be found in WorldInfo. I think its something like this to obtain them... Minecraft.getMinecraft().theWorld.getWorldInfo().getSpawnY(); Or at least something like that
-
My point is: You need to learn the basics before you can mod minecraft. By not understanding that you needed to replace one set of loops with another set of loops and how to convert the pseudocode I posted into actual code, you have demonstrated that you have no idea what your doing. ^^^ Agreed...
-
change your constructor from this: public PitfallHandler(World world, int x, int y, int z) { this.world = world; // the world this.x = i; // X axis this.y = j; // Y axis this.z = k; // Z axis } to this: public PitfallHandler(World world, int x, int y, int z) { this.world = world; // the world this.x = x; // X axis this.y = y; // Y axis this.z = z; // Z axis } because at the moment you are still using null variables. but only with the location variables. the world variable is correct though
-
the problem is you have but in double variables into int variable placeholders. Try casting them all to int's or just make them ints in the first place
-
Try something like this: And if you are wanting to change the life points, you just have to call pi.increaseLifePoints(amountToIncrease) or pi.decreaseLifePoints(amountToDecrease) or pi.setLifePoints(amountToSetTo) (the variable pi was taken from your event handler variable of it [Edit] Also in your main class, you register your event handler twice... So I think if you are wanting to keep with my code, delete that first registry of it then keep the last two
-
try this: [EDIT oops forgot the link ] No. All I was trying to do was make a core mod that did nothing, just so I could then build from there