Jump to content

xanderindalzone

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by xanderindalzone

  1. oh! dammit, i forgot to remove that extra line XD thx for realizing XD that fixed it :3
  2. Hi, I'm new to capabilities, I followed a few tutorials on how to create your own, and after creating the interfaces, capability classes, storage, providers and registering them and attatching them to entities, I'm getting an exception crash saying I'm registering capabilities multiple times, I dont see where. Main Mod class Capability package with providers Event that attatches capabilities to the player I know I'm doing 1 capability per variable, I've seen that you can have multiple variables in 1 capability, I just wanted to make them as simpler as posible for start.
  3. (Sorry I wasnt active) What do you mean by saving them? And how could I do this? I had that event because I was trying another thing before, I'll change it now, thx for noticing XD
  4. Hi, I just wanted to ask a few questions about some code I made to know if it's not broken or anything. At the moment its working just fine in client, but I'm not sure if its ok for servers. INGAME FOOTAGE - https://gyazo.com/0f0986ab65446078ea545b52fb2a876e 1. First, in my Gun class, when I shoot the bullet, since I'm creating a new bullet entity object everytime I shoot a bullet, is it ok to use dynamic variables that change along the way(in the PistolBulletEntity class)? PROJECTILE ENTITY CLASS - all the variables are modified at some point(not all of them atm) GUN CLASS - shootGun method creates the projectile entity object: 2. To make the Gun render in Aim position I'm using NBT tags, but since its the first time i'm using them i wanted to know if they're well implemented. I'm also using static dynamic variables in the client event class to tell the code when the player is aiming etc etc, to apply sensitivity and fov changes when aiming, but i dont 100% know if thats ok, i supposed it was ok because it was a client only event handler. The event that handles aiming sends a packet to server to add an NBT value to the Gun ItemStack with the key ("property_gun_is_aiming") which then is used in the Gun override property to change the model ingame. I learned addPropertyOverride by checking the code from the Bow class. CLIENT KEY EVENT CLASS And thats all, I would love to know if its ok so I can continue. If its not ok, how could I fix it? thx.
  5. it changes speed and FOV, and while using the item it doenst appear to be affecting the speed, but I cant really tell because the FOV effect alters the perspective
  6. https://i.gyazo.com/2ef1deed8715a60c47b2f532028dfb8b.mp4 it still bugs, same result.
  7. ok lol, i was editing the player's abbilities instead of the attributes XD. thx. i'll try that in a bit.
  8. I've already tried that, the automatic slowness overrides it
  9. I finally figured out how to make my Gun semi auto by overriding the getUseDuration() from the Item Class, but for some reason it adds a slowness effect when holding right click(continously using the item). How could I remove this slowness when using/holding right click with the Gun Item?
  10. Does that run in every tick? if it does, wouldn't that be more spammy than the InputEvent that runs when the player presses any controls? I could be wrong, it's the first time I heard of ClientTickEvent XD
  11. Ok so I've now finished the packet implementation, its working as expected but I wanted to know your thoughts to know if its fine. Mod class packet handler registration PacketHandler: Client-Side Event: Message Class: Gun Reload Method:
  12. Thx a lot This is my first time with packets anyway XD, I'll give it a try this afternoon. Yeah, I'm aware of this, I just needed the message class.
  13. After reading a few posts and wikis etc etc, I started with the packet thing, but when I tried to make the Message class, it appears I cant implement from IMessage. Is this a bug? or does this interface doesnt exist anymore?
  14. Previously I was calling the key variable from 2 places: 1.A client event from the client-side only event-handler like you said now. 2.A private method (reload) in the Gun class. I guess I'll have to make that reload method (2.) an event in the same event-handler as (1.), right?
  15. I believe I have to put some sort of annotation on top of the class/variable to specify its only a client class/variable. But from what I read from the Javadoc, this wouldn't work with initializers I think, right? What do I have to put to specify that this class/variable only runs in client, if this isn't it? Or no annotation at all, like you said here?
  16. I had this before in the mod class... but diesieben07 told me that KeyBinding was a Client-Only class so I removed it.
  17. I just have this left to do to fix Client-Side Only issues i think. I've directly created the KeyBinding object inside the register method in the client event, also removing the static init I had, but now I cannot access the key from outside to check for example, if that key is being pressed. Is there a way to check that key status? or a better way to register the key without violating the Client-Side Only code thing, and being able to access it by other methods?
  18. I've been a bit busy this weekend but now I'm working with the mod again.... Is this the proper way of registering stuff now? This is what I saw in a DeferredRegister tutorial. I asume the way to access the Objects in code is with "InitItems.BULLET_CAL_45.get()" because it's at least working normally. But correct me if i'm wrong.
  19. I had it previously in FMLCommonSetupEvent. So...... FMLClientSetupEvent is only ran in client-side, right? so its safe to put the glass code there, right?
  20. If there's a way of doing it once in a Client-Only event, I'm open for suggestions
  21. I've done 2, 3 and 4 from the list atm, but I dont know if this alternative for the transparent glass is appropiate.
  22. Thank you for taking your time to analize my code, I'll start fixing stuff when I have a moment.
  23. Also, have this in mind, I have custom key settings for my minecraft, so the mod keybinding "R" is not actually my current reload Key(but it is R by default) it currently just says "Press R to Reload" in the message when the gun has no ammo because thats the default key of that new KeyBinding.
  24. my bad, it should be public now
×
×
  • Create New...

Important Information

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