Jump to content

jredfox

Members
  • Posts

    660
  • Joined

  • Last visited

Everything posted by jredfox

  1. Where is the language code stored at on the server I can get it on the client but, the server stores lang and stuff to so I need to know what language it's in. I already have a server only method ready I just need to know where it's stored
  2. but, the entity.getShadowSize() for ender dragon was like 1.5 or something. so I can't use that data for what I need anymore I will just hardcode it for 1.12.2+ thanks anyways.
  3. Ok it appears there is a major issue in 1.7.10 and below entity shadow size was always for vanilla mobs this.height/2. it is simply not the case here what should I be looking for in later versions? I used it in past for render like nei on mob spawners. I printed was that entity.height/2 == size it said false minecraft:ender_dragon:0.5 false
  4. I overlay the buttons to any gui so on button activated via forge event I save it same concept. The buttons next and previous are for the next gui in the array list of menus
  5. well they should have on mc close for data that doesn't want to constantly write to the disk. My client tick code failed twice out of 30 tests so I took your advice and every update write to the disk (unoptimized). The users might play with the gui buttons and change them 100 times in 20 seconds is what I am saying but, yes it saves to the disk every time now. Edit: what is forge doing that my ConfigBase isn't? It says 3-4ms alot of the times and my config base says 7-14ms. I use Files.readAllLines(utf-8) and Files.write(utf-8). Now I do parse lines and have checkers but, that's about it: https://github.com/jredfox/evilnotchlib/blob/master/src/main/java/com/EvilNotch/lib/util/Line/ConfigBase.java public static void saveMenuIndex() { long stamp = System.currentTimeMillis(); Configuration config = new Configuration(cfg); config.load(); Property prop = config.get("menulib", "CurrentMenuIndex", "minecraft:mainmenu"); ResourceLocation loc = MenuRegistry.getCurrentMenu().getId(); prop.set(loc.toString()); currentMenuIndex = loc; config.save(); JavaUtil.printTime(stamp, "Saved Current Menu:"); }
  6. if (world != null) net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.world.WorldEvent.Unload(world)); Forge specifically ignores minecraft unloading the game as null the only time it's ever called when null is minecraft game is saving and does nothing with it. This is stupid I can't properly write to the minecraft app on save if I can't detect if the world is null or not under minecraft shutdown Is this a reliable way to detect mc is closing it prints but, I don't know if it will print every time? @SubscribeEvent public void onCloseApp(ClientTickEvent event) { Boolean b = (Boolean) ReflectionUtil.getObject(Minecraft.getMinecraft(), Minecraft.class, FieldAcess.running); if(!b) { for(int i=0;i<2;i++) System.out.println("Minecraft Is shutting down isRunning:" + b); } }
  7. Well if that were to occur and if your like me menu saving would occur 100 times in 20 seconds but, I could make a gui to save the order. Aether menu test 1.12.2 also tested with my own panoramic menu
  8. How to: On Minecraft X/Quite Button Save Data? I see a on world save event but, what about the quit button? I store gui main menu data that needs to only be saved once the game closes how is this accomplished? Edit: I looked at the minecraft class the button says is running false and then next thing you know it calls a method to use System.exit() I see no forge hooks on saving app is there a work around for this?
  9. during post init those maps are always empty then? I should be grabbing them from the render manager during post init?
  10. So what am I suppose to do to get the entity shadow size I checked forges renders and none were registered??????
  11. well a mod could define a enum as having material.air for flying and then another enum might say flying and go through material of space or something so there is no set definition. I am thinking of enforcing enums to only be one name and put it on the actual modders to use their modid and replace all ":" with "_" for the best way of compatability. I think I am going with your idea since the alternative is a heavy process that would even confuse the users and it would be json hard for users to configure for something that I setup to be really simple.
  12. I don't know how else I would do it besides storing the values inside of the same file with same name but, multiple entries in that json and my line library was suppose to be getting away from json for easy configuration and less parsing errors.
  13. what should I use? For my mod people define new entities from strings for an enumcreature type when then adds a biome list entry based on that creature type? Should I be comparing deep values or just ignore the dupes?
  14. I was testing if dupes are allowed then got really confused when they are How am I suppose to determine what creature type is what if there is no .equals() and I write them to a file using the toString() as the name of the file. Looking up the enum with that string would always result in the one with the first name and not nessarly one written to the disk.
  15. I want to find all creature types of the enums but, I don't think there should be dupe variable names
  16. no but, it seems to be adding a duplicate variable name to the enum list. If I did this and tried to compile I would get an error so why no error checks here. This code below will have compile error enums are not meant to have dupe names public static enum A{ a(), b(), a(); }
  17. System.out.println(EnumCreatureType.values()); EnumHelper.addCreatureType("MONSTER", EntitySheep.class, 22, Material.CAKE, false, true); System.out.println(EnumCreatureType.values()); output: [17:06:47] [main/INFO] [STDOUT]: [com.EvilNotch.lib.main.MainJava:preinit:108]: [MONSTER, CREATURE, AMBIENT, WATER_CREATURE] [17:06:47] [main/INFO] [STDOUT]: [com.EvilNotch.lib.main.MainJava:preinit:110]: [MONSTER, CREATURE, AMBIENT, WATER_CREATURE, MONSTER] How is this possible to have variables with the same two names should I support this or be like nope throw error enum name duplicate for iterating through EnumCreatureTypes
  18. Don't register either of those dduring modelregistry event those are for blocks/items only. Register it once via your client proxy. Call the other on both server and client
  19. extend command base then only override what you need look at the /summon command on how to do this it's very easy
  20. don't register it with a global id that is for vanilla mod entities should never have ids. Register render in client proxy during init
  21. The renderer hashmaps even in post init appear to be empty I tried running this is my proxies post init and it printed for the hashMaps:"[ ]" public static void populateShadowSizes() { System.out.println("Cacheing Shadow Sizes"); RenderingRegistry rinstance = (RenderingRegistry) ReflectionUtil.getObject(null,RenderingRegistry.class, "INSTANCE"); Map<Class<? extends Entity>, Render<? extends Entity>> entityRenderersOld = (Map<Class<? extends Entity>, Render<? extends Entity>>)ReflectionUtil.getObject(rinstance, RenderingRegistry.class, "entityRenderersOld"); JavaUtil.printMap(entityRenderersOld); //populate list Map<Class<? extends Entity>, IRenderFactory<? extends Entity>> facRenders = (Map<Class<? extends Entity>, IRenderFactory<? extends Entity>>) ReflectionUtil.getObject(rinstance, RenderingRegistry.class, "entityRenderers"); RenderManager rmanager = Minecraft.getMinecraft().getRenderManager(); for(Class<? extends Entity> clazz : facRenders.keySet()) entityRenderersOld.put(clazz, facRenders.get(clazz).createRenderFor(rmanager)); for(Class clazz : entityRenderersOld.keySet()) { ResourceLocation loc = EntityList.getKey(clazz); Render render = entityRenderersOld.get(clazz); Float shadowSize = (Float) ReflectionUtil.getObject(render, Render.class, MCPMappings.getField(Render.class, "shadowSize")); entShadows.put(loc,shadowSize); } for(ResourceLocation loc : entShadows.keySet()) System.out.println(loc + " shadowSize:" + entShadows.get(loc)); }
  22. What class is the array of renders located at?
  23. yes I should register them during the register event via array it was just an example. The more proper way of doing this was looking at the 2d link where it stores an array to instantiate registers on client and server later
  24. create a class that extends block then have it register automatically: public class SimpleBlock extends Block{ public SimpleBlock(ResourceLocation loc,Material mat) { super(mat); this.setRegistryName(loc); ForgeRegistries.BLOCKS.register(this); ItemBlock item = new ItemBlock(this); ForgeRegistries.ITEMS.register(item); } } Then cleanup your main java by simply calling that. Yes you could store them in an array but, this will get you started. 1.8+ requires client proxy to have models unless you want your mod crashing on the server. If you plan on storing it on the array you can use the same array for both client proxy(models) and server(registeries). Do not register the array on the server proxy for some reason on dedicated servers it doesn't run at least I can't get it working. Unless you need to override specific methods for your object do not create more then one class. You can use this for any basic block. I have a more advanced example via my lib so any block properties can be instantiated without having more then one class. https://github.com/jredfox/evilnotchlib/blob/master/src/main/java/com/EvilNotch/lib/util/minecraft/content/blocks/BasicBlock.java
  25. I noticed IBaked models for fluids had a texture atlis sprite why is their's working and mine isn't?
×
×
  • Create New...

Important Information

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