Jump to content

Meldexun

Members
  • Posts

    184
  • Joined

  • Last visited

Everything posted by Meldexun

  1. I think it is predictable. It's a custom oxygen system so whenever you are in water it goes down and outside it goes up. So should i calculate the oxygen on both sides and only send a packet every second or so? I know that. You can look at my client proxy and see that i first save the last value and then write the new one.
  2. Ok i now managed to draw the circles as i want. But i have a problem animating my gui. I know that i have to work with partialTick to get a smooth animation. So as far as i know Minecraft.getMinecraft().getRenderPartialTicks() returns a float between 0 and 1. For the animation i need an integer from the server (packet is sent every tick) and the PartialTick. The problem is that the PartialTick already returns a number close to 0 (but greater than 0. something like 0.2) but the integer is not synced already. Maybe i can explain it better with an table: Integer from Server: Partial Tick: 1240 0.18 1250 0.44 1250 0.68 1250 0.94 1250 0.18 1260 0.44 When i work with these values it won't give me a smooth animation because the integer from the server is updated too late. So is there anything i can do against this? Capability: Message: Message Handler: ClientProxy:
  3. I'm currently using the @Config annotation to create a config gui. And now i want to add an undefined amount of categories to the config gui. Similiar to adding an array of integers i tried this: public static Category[] test = new Category[] {new Category()}; The problem is that when i open the category test nothing is in there. I also created a single instance of the category to test if it is working. So is there a way to add an undefined amount of categories? Or would i have to create my own gui screen? (I know of the IModGuiFactory but i don't know what to do with it.)
  4. I think it's called antialiased. So the border of the cirlce should be more smooth.
  5. I'm trying to draw a smooth circle on the screen with opengl. But the problem is that it isn't smooth. Is there a way to smooth the circle? An image of the problem:
  6. I already searched for debugger eclipse. But i wasn't sure if that is what he meant. I thought he maybe meant something minecraft or forge specific. Thanks for clarification.
  7. So i would like to edit some vanilla classes and insert some System.out.println() methods for some testing. Is there a way to do this? It's only for getting some information about some calculation that are done. I do not want to build a mod with that forge version.
  8. Then you misunderstood me. The player and the entity are loaded server side. Then an event is fired and sends a packet from the server side to the client side. The packet is received on the client side but the entity is NOT loaded on the client side. So nothing can be done.
  9. Yes, i tried this too. But the problem is that still the entity is loaded on the server but not on the client. -> nothing can synchronize. The only solution i see could be to send a packet from the client and then send an answer packet from the server.
  10. Sure. EventHandler class: Entity class: Packet class: PacketHandler class: ClientProxy class: When i start the game it prints null in the console.
  11. But i tested it and it doesn't work. Minecraft.getMinecraft().world.getEntityByID(message.getEntityId()) still returns null.
  12. Maybe i didn't described my issue good enough. So lets say you start a singleplayer world and spawn my custom entity. Then you put an item in the inventory of the entity. After that you start riding the entity. And while you are still riding the entity you are leaving the world and go in the main menu. Now you join the world again. The problem is that every event i'm trying to use to send a packet is called to early on the server. So in the end the client receives a packet but the entity isn't there already so nothing can be synchronized. In java the problem is: Minecraft.getMinecraft().world.getEntityByID(message.getEntityId()) returns null because the entity isn't created on the client.
  13. So i'm now sending a packet when the item stack changes while the entity is being ridden and when a player starts riding. But what should i do when the player is riding the entity while the world is loaded. I tried sending a packet inside the onAddedToWorld method of my entity but then the entity isn't loaded client side and nothing will get synchronized.
  14. Hey there, I need to synchronize the inventory of my custom entity (not the player) with the client. How can i do this? So i'm attaching a CapabilityItemHandler to my entity and when the player is riding the entity he should get information from the inventory of the entity displayed. But i currently have to open the inventory once and only then the player can see the information from the inventory of the entity.
  15. You need to add minecraft to your recipe type because now it searches for the recipe type "YOURMODID:crafting_shapeless". Also an error should be printed in the console when starting the game.
  16. The healthStatCap variable in your HealthStat event is always 0 at the beginning. When your event gets called the first time it sets the value of healthStat from your capability to healthStatCap + 1 (0 + 1 = 1).
  17. Can you post your main class and your mods.toml file. Because it says your main class with the @Mod annotation has "assets" as the modid parameter.
  18. So i get the issue when i try to use a config value. For example i use: BetterDivingConfig.GENERAL.test.get() And when looking into the ConfigValue#get() method that it calls Preconditions#checkNotNull() with spec.childConfig as an argument to check and because in my config the childConfig field is null i get the error.
  19. Hi there, I'm trying to setup my config but everytime i try to use it i get that issue: Cannot get config value without assigned Config object present Mod class: @Mod(BetterDiving.MOD_ID) public class BetterDiving { public static final String MOD_ID = "better_diving"; public BetterDiving() { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, BetterDivingConfig.SPEC); } } Config class: public class BetterDivingConfig { private static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder(); public static final General GENERAL = new General(); public static final ForgeConfigSpec SPEC = BUILDER.build(); public static class General { public ConfigValue<Boolean> test; public General() { BUILDER.push("General"); test = BUILDER.comment("Test!").define("test", false); BUILDER.pop(); } } }
  20. Hi there, I wan't to render custom fog and i noticed that the sky is rendered weirdly. To best describe it i have made screenshots. So here is the first screenshot where i disabled fog completely. Can anyone explain me why the sky has these 3 color zones? This leads to a problem when i enable fog. Then the middle dark blue zone ignores the fog. So the sky wouldn't be a problem as long as it is be covered by fog. Does anyone know how to fix this? Also i would like to know which class handles the sky rendering. Thanks for the help.
  21. Just create a .bat file in your server folder and edit it and paste this in: "[PATH_TO_YOUR_JAVA]" -Xms[MINIMUM_RAM]G -Xmx[MAXIMUM_RAM]G -jar "[PATH_TO_YOUR_SERVER]" An example: "C:\Program Files\Java\jre1.8.0_201\bin\java.exe" -Xms1G -Xmx1G -jar "forge-1.12.2-14.23.5.2836-universal.jar" and open that file to start the server instead of the forge universal jar. (There are MAAANY tutorials in the internet on how to do this. Just search for somthing like "minecraft server more ram")
  22. I would say you need a model class and pass an instance of that class in the Item#getArmorModel method of your item class. If you still need help you need to post your classes.
×
×
  • Create New...

Important Information

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