Jump to content

matthew123

Members
  • Posts

    132
  • Joined

  • Last visited

Everything posted by matthew123

  1. I know about Minecraft.hitResult, but that is client-sided. How may I get the block the player is looking at from the server?
  2. You should change your types to "boolean", so you can't get problems like these in the future.
  3. I am calling it on the CLIENT. That method returns the World field of the entity. The server also gets a packet when this should be called, so playing it on the server could be possible.
  4. I am trying to play sounds with: playerEntity.getCommandSenderWorld().playSound(playerEntity, BlockPos.ZERO, ModSounds.ACTIVATE_JUTSU_BASIC.get(), SoundCategory.PLAYERS,1f, 1f); , called on the client. This is how my sounds are registered: [the logger gets called] the sounds.json file: { "activate_jutsu_basic": { "subtitle": "narutomod.subtitle.activate_jutsu_basic", "sounds": [ "narutomod:jutsu/activate_jutsu_basic" ] } } I aim for this:
  5. the mod looks like it's working now. But do remember to fix the structure, and use packets for synchronization.
  6. Actually, now that I look at this, there is another type called boolean, which is what you probably want.
  7. Also, your resourcelocations are broken. You cannot use capital letters in resource locations. For example, your caused forge to not load the mod. Replace it with puretitan in all occurences. Your NBT is failing to save because you did not assign a default value to the PureTitan boolean in the constructor, so the boolean is null. Coming from a C# background, I actually blame java for allowing booleans to be nullable.
  8. Also, your repo's structure is messed up. You missed the gradle files.
  9. Even though I have quite limited experience, why did you split your item registry into a package called "core"? that is confusing. It should be located where the rest of the item classes are, in common. Also, your PlayerSize class is in common. But the graphics transformations are client-sided. Let me explain the structure I use: Common package, for anything that is needed on both the client and server items Item classes Item registry class blocks Block classes Block registry class network Packet classes Network manager class Client package, for anything that can only run on the client gui overlay Overlay classes Overlay renderer and so on. You need to send a packet to other clients (tracking entities) when doing the transformation. See the forge documentation on Simple Channel.
  10. What happens if a player e.g teleports to another player which is using an ability? wouldn't that break the system?
  11. This answer does not help me. Is sending a packet to the server, then the server sending a packet to all the other clients ultimately the best way of doing it? Would it complicate rendering effects on other players? Has it been done before? How do I know which players to send the packet to (other players which can see the player executing the ability)?
  12. The player uses a keybind+click to activate an ability.
  13. My mod adds abilities. These abilities range from spawning entities, spawning blocks, to changing the player's renderer and such. I am not sure how to implement it for multi-player. I believe I can send a packet from the client to the server indicating that the ability has been executed, the server checks if the player can use the ability (to prevent cheating), and then sends that same packet to the other players that are in range (?). What do you think? Is this the optimal way to do it?
  14. It was never an issue with serialization, networking, ... . It was an issue with the capability class! It was updating only ONE of the 2 collections here: We both missed it.
  15. https://github.com/empireu/NarutoMod
  16. What is up with the JSON files? Is there any way to load GLSL shaders?
  17. I added logging to the storage class. I am not sure I understand.
  18. An issue still persists. It appears as if the power level is the only thing that is not serializing. The selected nature AND selected jutsu seems to be synchronizing fine, but the power level does not, even though it is clearly updated: The selected jutsu seems to work fine, as indicated by that bool and in-game testing. Thus, I added logging in the exact place the jutsu serializes it's power level: And then after updating values: What the hell is going on?! I am at a loss. Why is everything else working but that integer?
  19. I would like to add effects over the rendered image. I believe this must be done with a shader, but I am not sure. I only want to make a simple grayscale filter for the game at the moment. What should I learn? How would I approach this? I don't know of any other mods that do this, else I would have inspected them for answers.
  20. I think I am onto something! I started analyzing ItemStackHandler, and I found that they were using ListNBT. This satisfies all my needs. I guess vanilla code is the best learning resource.
  21. I am not sure how to serialize all of it to NBT. When my data was only using integers, I used an integer array, but that is not possible now. Could you show me how? Also, do you have recommendations on the capability? I believe that my current approach is very messy.
  22. You can find the capability in common/capability/player.
  23. https://github.com/empireu/NarutoMod
  24. Would a git repo of my mod do any better?
×
×
  • Create New...

Important Information

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