-
Posts
11 -
Joined
-
Last visited
Everything posted by Deadzoke
-
Before anything else, thank you for the response! I've already searched there, and I've managed to add the bars for each boss but I can't seem to get rid of them, because the event doesn't seem to update after the boss death... I don't have the code I used because I already changed thing a bit, but the method was something like this:
-
Well... I didn't know I had to regen the runs... 😒 Thank you for the solution and the suggestion! ☺️
-
Hello! I'm trying to add support for Enhanced Celestials in my HUD mod, so i add it to the build.gradle, as an runtimeOnly dependency. But when i run the client, the error "Mixin apply failed" appears... Anyone knows how to fix this? This also happens with other mods with Mixins. build.gradle: Error: Thanks!
-
Hello!! I'm developing a mod for 1.19/1.19.3 that changes the vanilla HUD completely. I'm trying to get the boss bars but without any success... The only class that had such information is net.minecraft.client.gui.components.BossHealthOverlay, the "events" field... However, it is private. Is there a way to get the spawned bosses? Do I have to use Mixins? Thanks!!!
-
Weapon with Max and Min Damage and Crit Chance
Deadzoke replied to Deadzoke's topic in Modder Support
I just use this class for the swords: https://pastebin.com/sP5hsHRd -
Ok, so... I did all the coding related to it (maybe its bad as s**t, but works :P), but I have a little problem. So, when the weapon is loaded 1st time into the game, i made it beggin with the attackDamageMin (lets say 20 damage). When i hit an entity this should go between attackDamageMin and attackDamageMax (like 20 - 40), but that only happens when i press Esc key and return to game. Any idea? Oh, and a little question. How can i hide the "When in main hand: x Attack speed x Attack Damage"? Much thanks!!
-
So, I rewrited the code for the Proxies and now it is cleaner and without the CommonProxy class. The events are separeted from the CapabilityHandler class and are now in the EventHandler class, turns out that there was a @EventBusSubscriber missing there. Now it works just fine with the events in the EventHandler class with the @EventBusSubscriber, and much more clean! Many many thanks! About the rest of the code, i will try to improve my codding skills in Java (this is not my main area). I'm here to learn!
-
Well, I dont know how GitHub works, but here it go https://github.com/guilhermejardim11/Ignite
-
So, answering to your questions: I call the syncronize() method in my CapabilityHandler class (that is called in preInit method, before anything else) in the onPlayerLoggedIn event: @SubscribeEvent public static void onPlayerLoggedIn(PlayerLoggedInEvent event) { // Mana if(event.player.hasCapability(CAP_MANA, null)) { ICapMana capMana1 = event.player.getCapability(CAP_MANA, null); capMana1.synchronize(); } // Skill Points if(event.player.hasCapability(CAP_SP, null)) { ICapSP capSP1 = event.player.getCapability(CAP_SP, null); capSP1.synchronize(); } } This are my message classes (Message and MessageHandler): public class MessageSP implements IMessage { private int SPtU; private int curSPiT; private int maxSPiT; public MessageSP() { } public MessageSP(int SPtU, int curSPiT, int maxSPiT) { this.SPtU = SPtU; this.curSPiT = curSPiT; this.maxSPiT = maxSPiT; } @Override public void fromBytes(ByteBuf buf) { this.SPtU = buf.readInt(); this.curSPiT = buf.readInt(); this.maxSPiT = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(this.SPtU); buf.writeInt(this.curSPiT); buf.writeInt(this.maxSPiT); } public int getSPtU() { return this.SPtU; } public int getcurSPiT() { return this.curSPiT; } public int getmaxSPiT() { return this.maxSPiT; } } public class MessageSPHandler implements IMessageHandler<MessageSP, IMessage> { @Override public IMessage onMessage(MessageSP message, MessageContext ctx) { Runnable action = new Runnable() { @Override public void run() { SkillTreeGui.SPtU = message.getSPtU(); SkillTreeGui.curSPiT = message.getcurSPiT(); SkillTreeGui.maxSPiT = message.getmaxSPiT(); } }; Ignite.proxy.getThreadListener(ctx).addScheduledTask(action); return null; } } This is my capability: public class CapSP implements ICapSP { public static final ResourceLocation ID = new ResourceLocation(Ignite.MODID, "CapSP"); private EntityPlayer player; // Skill Points to Use private int SPtU = 0; // Skill Points in Tree private int curSPiT = 0; private int maxSPiT = 20; public CapSP(EntityPlayer player) { this.player = player; } @Override public void addSPtU(int amount) { this.setSPtU(this.getSPtU() + amount); } @Override public void remSPtU(int amount) { this.setSPtU(this.getSPtU() - amount); } @Override public void setSPtU(int amount) { if(amount <= 0) { this.SPtU = 0; } else { this.SPtU = amount; } this.synchronize(); } @Override public int getSPtU() { return this.SPtU; } //----------// @Override public void addSPiT(int amount) { this.setCurSPiT(getCurSPiT() + amount); } @Override public void remSPiT(int amount) { this.setCurSPiT(getCurSPiT() - amount); } @Override public void setCurSPiT(int amount) { } @Override public int getCurSPiT() { return this.curSPiT; } @Override public void setMaxSPiT(int amount) { } @Override public int getMaxSPiT() { return this.maxSPiT; } @Override public NBTBase writeNBT(EnumFacing facing) { NBTTagCompound nbt = new NBTTagCompound(); nbt.setInteger("SPtU", this.getSPtU()); nbt.setInteger("CurrentSPiT", this.getCurSPiT()); nbt.setInteger("MaximumSPiT", this.getMaxSPiT()); return nbt; } @Override public void readNBT(NBTBase nbt) { this.SPtU = (((NBTTagCompound)nbt).getInteger("SPtU")); this.curSPiT = (((NBTTagCompound)nbt).getInteger("CurrentSPiT")); this.maxSPiT = (((NBTTagCompound)nbt).getInteger("MaximumSPiT")); } @Override public ResourceLocation getID() { return this.ID; } @Override public void synchronize() { Ignite.network.sendTo(new MessageSP(this.getSPtU(), this.getCurSPiT(), this.getMaxSPiT()), (EntityPlayerMP)this.player); } } I call it in my GUI by linking the int SPt, the int curSPiT and the int maxSPiT int the MessageHandler.
-
Thats the problem, i'm already doing that. At 1st i tought it was because i have 2 capabilities with the same id in the registerMessage method (smartass), but was the same. In my preInit event: Ignite.network = NetworkRegistry.INSTANCE.newSimpleChannel(Ignite.MODID); Ignite.network.registerMessage(MessageSPHandler.class, MessageSP.class, 1, Side.CLIENT); In my capability class: @Override public void synchronize() { Ignite.network.sendTo(new MessageSP(this.getSPtU(), this.getCurSPiT(), this.getMaxSPiT()), (EntityPlayerMP)this.player); }
-
Hello! I'm new here but not so new to modding! I'm having a little headhake at this capability 'thing' that maybe u guys can help me. Basicly my capability its working just fine (death, world restart, sleep and many other things). Just 1 little problem: I have my GUI with the capability value in it, normal values (like "50 Money") and it stays like that at restarting the world and dying, but when i restart my minecraft and open the world, the value just go to the zeros (like "0 Money"). I hope you guys could give me a hand at this. Thanks!