• 0

    posted a message on Items/Blocks are being duplicated when shift left click/shift right click in my own GUI

    Updated gist with the GuiHandler class. The GuiHandler class is registered in the ClientProxy's init whose parent interface's init method is called in the init phase of my @Mod class. Wait a minute, now that I think of it, is the GuiHandler supposed to be registered in common method or client-side method?

    Posted in: Modification Development
  • 0

    posted a message on Making an overlay appear on screen when the player uses my item?

    Yes, it's pretty much the same code you use to render an image such as a GUI (crafting table) or a book.

    Take a look at how I did it here: https://github.com/Spyeedy/Spiderman-Mod/blob/master/java/com/spyeedy/spiderman/client/gui/GuiOverlay.java


    What I did was I had my class extend GUI and then I created a method where I did the drawing of my images. After that I created another method that would subscribe to the RenderGameOverlayEvent. Bear in mind that in the parameter of the same method, you will need to call Pre or Post from the RenderGameOverlay or else your overlay may do weird stuffs to the Minecraft's overlay and that would not be what we want. The rest you can figure out. If you got questions, post back here. 😀

    Posted in: Modification Development
  • 0

    posted a message on Items/Blocks are being duplicated when shift left click/shift right click in my own GUI

    Hmm, that's weird, I can't open my GUI in multiplayer even though I'm sending a packet to the server to open the gui. The packet is registered in the main class's init method and the KeyHandler is registered in my ClientProxy.

    Updated code here now includes my KeyHandler and the packet I'm sending.

    Posted in: Modification Development
  • 0

    posted a message on Items/Blocks are being duplicated when shift left click/shift right click in my own GUI

    Oops, i forgot to test in multiplayer. My observations were made in single player. I will test in multiplayer when I reach home in a few hours time.

    Posted in: Modification Development
  • 0

    posted a message on Items/Blocks are being duplicated when shift left click/shift right click in my own GUI

    I've successfully made a GUI that will be opened with a keybind. The specific item, which allows any swords, in the slot is being saved with my capability.
    Ok, so that's the overview of what my GUI is about.

    The problem is that when the player shift clicks another item, not a sword, let's say an iron door in the hotbar, the iron door will be duplicated IN the hotbar, and if I shift left click/shift right click, the iron door will be duplicated again. The iron door can be duplicated till it reaches 64 x iron door.
    Note that the iron door cannot be duplicated when in the inventory slots, NOT hotbar slots.

    Another problem is that for some reason, when I drag my sword or shift left/right click into the slot, the sword is being duplicated in the specific slot (NOTE: the sword in it's orignal slot, the hotbar or inventory remains there). But when I shift left/right click the sword in the slot, the sword in the slot disappears and the sword in the original slot, hotbar or inventory slot remains in it's own place even though I shift clicked.

    Code's link here contains my Inventory, Container, Slot and my Capability.

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    Thanks Choonster.

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    Oh right, hehe, I forgot to make the changes in my [i]PreRegistryHandler[/i] after I made the move.


    1. "Use PlayerTickEvent[/i] instead of LivingUpdateEvent[/i], making sure to check TickEvent#phase[/i]" - I assume this code change is to be done in my [i]AbilitiesHandler[/i] and above my check for whether the event's entity field is instanceof [i]EntityPlayer[/i]?
    2. "Only check for armour sets and add/remove attribute modifiers on the logical server (when World#isRemote[/i] is false[/i])" - This code change is to be in my [i]KeyBindAbilities[/i] packet and in my [i]AbilitiesHandler[/i]?
    3. "Always call [i]IAttributeInstance#removeModifier[/i] for each of your modifiers at the start of the method, regardless of whether or not the player is wearing armour. Remove the [i]IAttributeInstance#removeModifier[/i] calls from the individual armour set checks." - This code change is, again, to be in my [i]KeyBindAbilities[/i] packet and in my [i]AbilitiesHandler[/i]?
    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    I have just updated my Github Repository. Click on me.

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    I see. Back on topic, how do I solve the issue of my increased health and increased strength (attack damage) and health regeneration not appearing in Multiplayer?

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    Well actually, it appears that a method in my Helper class calls the Particle class, but I don't use the method. Hm, about the suggestions on moving the model registration and particle spawning methods, I should probably do that. Is it possible to add the SideOnly annotation to a class that will contain client-only methods?

    I commented out the method in which the Particle class is called and my speed can be toggled.

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    So I moved my speed toggle code into a packet and then added the sending packets to the server method in my KeyBindingEvents class. So when I played in single player, I can toggle my speed, but when I am in the multiplayer, I can't toggle speed. I'm not so sure why my console is spitting out errors that Particle class can't be found on server when my methods involved ain't calling the Particle class or it's subclasses.

    Code here. My Main class (where I register my packets), KeyBindingEvents class, AbilitiesHandler clas, my packet class and my Helper class(where my checks for the armor is on) are in the gist.


    Note: I commented out the speed toggle code in my AbilitiesHandler class.


    Console's errors on Multiplayer.


    [21:27:45] [Server thread/FATAL]: Error executing task
    java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: net/minecraft/client/particle/Particle
    at java.util.concurrent.FutureTask.report(Unknown Source) ~[?:1.8.0_111]
    at java.util.concurrent.FutureTask.get(Unknown Source) ~[?:1.8.0_111]
    at net.minecraft.util.Util.runTask(Util.java:26) [Util.class:?]
    at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:742) [MinecraftServer.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:408) [DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) [MinecraftServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) [MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_111]
    Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/particle/Particle
    at com.spyeedy.spiderman.common.network.KeyBindAbilities$Runner.run(KeyBindAbilities.java:68) ~[KeyBindAbilities$Runner.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_111]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_111]
    at net.minecraft.util.Util.runTask(Util.java:25) ~[Util.class:?]
    ... 5 more
    Caused by: java.lang.ClassNotFoundException: net.minecraft.client.particle.Particle
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_111]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_111]
    at com.spyeedy.spiderman.common.network.KeyBindAbilities$Runner.run(KeyBindAbilities.java:68) ~[KeyBindAbilities$Runner.class:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_111]
    at java.util.concurrent.FutureTask.run(Unknown Source) ~[?:1.8.0_111]
    at net.minecraft.util.Util.runTask(Util.java:25) ~[Util.class:?]
    ... 5 more

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    So I still got to send a packet containing info on when the toggling of the speed modifier?

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    Um, I didn't say this in my first post but my increased speed is the only attribute that appears in multiplayer. Any reasons as to why my speed attribute appears but the rest of my attributes doesn't?

    Posted in: Modification Development
  • 0

    posted a message on Attributes not appearing on player in multiplayer

    Oh I see. So I will need to send a packet on which keys are to be pressed? Or I will need to send a packet containing info on the action that is to take place when the keybinding is pressed?

    Posted in: Modification Development
  • To post a comment, please .