
Asweez
Forge Modder-
Posts
421 -
Joined
-
Last visited
Everything posted by Asweez
-
What about the models?
-
There is a 1.2.5 mod that I want to deobfuscate and it doesn't have any of the gradle stuff like the newer versions. I tried BON and that didn't work. The files weren't deobfuscated. I think this is because it doesn't have the same file structure that BON was looking for. How do I get this mod's source code? Or if I can't do the whole thing at once, is there any program that will deobfuscate individual files?
-
The ground is the closest block downwards from the player.
-
I want to find how far the player is from the ground
-
I'm assuming I should use rayTraceBlocks but I'm not sure how to use it. Can anyone help?
-
Ok that helps a lot. So would it be better to either store the module data in the item nbt and use the same instance of the module for every item OR create a new instance of the module for every item and store the data in the module itself?
-
What I'm saying is: Can you have individual data for each instance of some class?
-
Ok you're right but how does the ItemStack do it?
-
Good idea. However (and this is mostly hypothetical), I am wondering how I could have individualized data completely disregarding the item. How does NBT do it so each item can have its own set of data?
-
Yeah that's what I thought at first. Is it possible without using the item, though?
-
I have modules for my armor that I stir in the armor's nbt. I write the id of the module to the NBT and then read it whenever. Each module has a class that defines which armor piece its for, the id, what it does, and the name. I want to add a timer to the module so the player can't spam it. However, if I add a timer to the class, all instances of that module will have the same cool down timer. How would I add timer for specific instances of the modules? For example Player1 has 10 seconds cool down but Player2 has 20 seconds for the same module. Thanks
-
Oh wow all it was was that there was a for loop that was making it run multiple times. My bad. Thank you for helping, though.
-
Ok this is really weird. When I press the key, even with your code: if(Keyboard.getEventKey() == HTAKeys.attack1.getKeyCode() && Keyboard.getEventKeyState()){ if(Minecraft.getMinecraft().inGameHasFocus){ HTANetwork.net.sendToServer(new AttackKeyPackage.KeyMessage(1)); } } It will constantly put out "key pressed" in the console, even when I quit the world it keeps going. What is going on?
-
Code: package com.apmods.hta.handler; import com.apmods.hta.key.HTAKeys; import com.apmods.hta.network.AttackKeyPackage; import com.apmods.hta.network.HTANetwork; import net.minecraft.client.Minecraft; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent; public class HTAKeyHandler { @SubscribeEvent public void keyDown(KeyInputEvent event){ if(HTAKeys.attack1.isPressed()){ if(Minecraft.getMinecraft().inGameHasFocus){ HTANetwork.net.sendToServer(new AttackKeyPackage.KeyMessage(1)); } } else if(HTAKeys.attack2.isPressed()){ if(Minecraft.getMinecraft().inGameHasFocus){ HTANetwork.net.sendToServer(new AttackKeyPackage.KeyMessage(2)); } } } } And when I press it and let go of the key, it just keeps calling the method
-
Ok did some testing it turns out that when I press the key (only once) the method is called a LOT and keeps getting called over and over. What could make this happen?
-
Ok I have a key handler that sends a packet to the server and the server receives that packet and calls the onKeyPress method. This keyPress method is part of the module classes we were talking about earlier
-
I'm trying the spawn in an arrow and this is the error: Here is the method: @Override public void onKeyPress(EntityPlayer player) { if(!player.worldObj.isRemote){ EntityArrow arrow = new EntityArrow(player.worldObj, player, 2); player.worldObj.spawnEntityInWorld(arrow); } } This method is called by my KeyEventHandler which provides an EntityPlayerMP for the player. What am I doing wrong?
-
How would you get the module from the id? Would you store the id and the module in a hashmap on registry and then retrieve it from there?
-
What is common syntax for this, how do I generate one, and how to a read a String Id to get what it stands for? Thanks in advance
-
Custom modules on my armor; Best way of going about it
Asweez replied to Asweez's topic in Modder Support
Ok just to make sure I know what you mean: the adapter basically removes the abstract methods you don't need. For example since ModuleFoo didn't need any update stuff, the adapter provided a stub method so ModuleFoo wouldn't have a blank onUpdate method. Is that right? Anyways, thanks for that I'll definitely use that advice -
Custom modules on my armor; Best way of going about it
Asweez replied to Asweez's topic in Modder Support
Thanks, I'm a little confused on what you mean on number 2. So you're saying that the method within the module itself is the best way to do it? And what do you mean by an adapter class and how would I use it? -
So I have armor that will have different modules on it that do different things (i.e. underwater breathing or shooting arrows). What is the best way of 1) saving the modules to the armor and 2) making the modules take effect 1) What I have right now is and ID based system in which the armor saves the id of the module to NBT and then loads it back up whenever it needs to. Is this a good way of doing it or is there a better way? 2) How would I do this? Would I do a bunch of if statements? For example if(module1 is whatever){ take effect } else if(module1 is something else){ take effect } However this seems really inefficient. I could also make the Module have a method that enacts its ability, but there is a wide range of stuff the modules will do so it would have to have a few methods to encompass all of the times when it could be used. What is a better way to do this? Thanks in advance!
-
How do I make my mods check if there is a newer version of that mod available?
-
On the item tooltip and a GUI
-
How would I do so? I want to make a red-orange color that isn't already in Minecraft.