Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Content Count

  • Joined

  • Last visited

Everything posted by Meldexun

  1. Ok, i'm sorry that really is a bad description... So the GUI shows up with all the normal inventory slots of the player and i can use them normally. But when i hover over my extra slot it makes that white overlay. So the slot is there but i can't put any item in it. What other code do you want to see? I have also thought that but when i change the ID to 0 my extra slot is just a copy of the vanilla inventory slot with the ID 0.
  2. I made an entity which can be ridden. But when the player turns to the left or to the right to body of the player isn't fixed to the rotation of the head/entity which is ridden. How can i achieve that the body of a player is rotating the same. You can compare a Minecart and a Boat from vanilla. With a boat the rotation of the body of the player is fixed.
  3. Ok i now added a model to my entity and the movement is looking good now. I don't really understand why it's working with a real model instead of such a white cube.
  4. Thanks for the explanation. But i now tried to set the frequency higher/lower with updates true/false with no difference. I can change that. Yes my code is often messy and buggy with the server/client side stuff. I usually clean that when my stuff works probably. Or when i forget that i normally try my mod in singleplayer and on a dedicated server and then when something crashes i go and clean the code. (Thanks anyway) Edit: Also the entity moves a bit faster than the player who rides it.
  5. I'm extending my class the Entity class directly so i have to call it myself since it's not called in the Entity class. But that's no my issue anymore. Now i have this code to update the movement: @Override public void onUpdate() { super.onUpdate(); if (this.world.isRemote) { if (this.getControllingPassenger() instanceof EntityPlayer) { GameSettings settings = Minecraft.getMinecraft().gameSettings; this.inputForward = settings.keyBindForward.isKeyDown(); this.inputRight = settings.keyBindRight.isKeyDown(); this.inputBack = settings.keyBindB
  6. So i have created a custom entity which can be ridden but when i ride the entity it stops moving and it won't move in any way. That's my entity class: public boolean inputForward = false; public boolean inputRight = false; public boolean inputBack = false; public boolean inputLeft = false; public boolean inputUp = false; public boolean inputDown = false; private int debug = 0; public EntitySeamoth(World worldIn) { super(worldIn); setSize(1.0f, 1.0f); isImmuneToFire = true; } @Override public boolean canBeCollidedWith() { return !this.isDead; } @Override p
  7. I want to create an extra inventory slot for the player. But i can't use the slot when the GUI is opened. I think it has to do with how i use the capability. Also I'm not that much familiar with capabilities . Provider: Attach Capabilies: Container: Any help is appreciated.
  8. I have created a config with the @Config annotation but the categories always remain unsorted. Is there a way to sort them? Issue:
  9. How would i check if a player has small arms. Because my custom armor isn't moving properly when a player uses a skin with small arms.
  10. This parameter does not exist in the onBlockActivated method.
  11. The onBlockActivated method exists in the Block class. So extending your class with Block should work. Maybe post how you tried overriding the method in your class.
  12. Now i got this: private static final Gson GSON_INSTANCE = (new GsonBuilder()).registerTypeAdapter(RandomValueRange.class, new RandomValueRange.Serializer()).registerTypeAdapter(LootPool.class, new LootPool.Serializer()).registerTypeAdapter(LootTable.class, new LootTable.Serializer()).registerTypeHierarchyAdapter(LootEntry.class, new LootEntry.Serializer()).registerTypeHierarchyAdapter(LootFunction.class, new LootFunctionManager.Serializer()).registerTypeHierarchyAdapter(LootCondition.class, new LootConditionManager.Serializer()).registerTypeHierarchyAdapter(LootContext.EntityTarget.class,
  13. The event seems to work but i don't know how i can get a LootTable from a String. I mean i have the content of the loot_table.json file in the config folder as String but how can i generate a LootTable out of it?
  14. I want to generate a chest with my loot table. This works fine when i use a loot table from my assets. But is there a way to spawn a chest with a loot table from the config folder? Edit: I just found the LootTableLoadEvent. Could i just pass the loot table from the config folder when the loot table from my mod is loaded?
  15. Thank you. I tried to pass something likesrc/main/resources/foo/bar/baz.png. Now it works.
  16. I always get null returned when using one of these methods. I have my CrystalicVoid Class in src/main/java/meldexun/crystalicVoid and i want to get a file in src/main/resources/assets/crystalicVoid. When using CrystalicVoid.class.getResource("") it gives me the path to that class. I just don't know how to use the method properly. (also changed the \)
  17. How could i copy a file from my assets to the config folder? I currently have this in FMLPreInitializationEvent: File source = new File(/*assets folder of my mod*/, "tower.nbt"); File destination = new File(event.getModConfigurationDirectory().getPath() + "\\CrystalicVoidStructures", "tower.nbt"); try { Files.copy(source.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { e.printStackTrace(); } But i don't know how to get the file in my assets folder.
  18. It looks like i have to open the GUI server side. I'm using a GuiHandler and when calling player#openGui at the end of my packet handler on the client side it seems to create a broken gui. So what i now try to do is: When the block is right clicked on server side it will send a packet to the client which tells him to update the tile entity with the data sent from the server. As an answer the client then sends a packet which requests the server to open the gui. When received on the server it checks if the player is in creative mode and then opens the gui.
  19. I thought vanilla sends more packets. But that doesn't matter. You are right. I will change it so it only sends a packet from server to client when the block is right clicked. Often opening the gui will cause much traffic but when not opening the gui it causes zero traffic. Seems the best option.
  20. But then it always sends a packet from server to the client when the block is right clicked. When you right click the block it 3 times in a short period of time it sends 3 packets. Currently it sends only a packet when the tile entity is loaded. So it sends just 1 packet. I don't understand how a new second packet solves this issue. I could check when the packet is received server side if the sender is in creative mode.
  21. I need the data for opening the gui. It should display the data from the server. I have read that i should create my own packet and handler to sync my tile entity most efficiently. And my tile entity should just sync when someone interactes with it. I think vanilla always syncs the tile entities and that would create much network traffic (i just think so. Correct me when i'm wrong) It should be kind of cheating. The block is creative only and the client should say "This is the new data, use it from now on"
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.