Jump to content

oa10712

Members
  • Posts

    34
  • Joined

  • Last visited

Posts posted by oa10712

  1. Hey, not sure if this is the place to post it or not, but is there any way to track how much memory each mod is using? I'm working on a custom mod for use in a pack, but I'd like to see which mod(s) are taking up excess memory. I am using Netbeans as my IDE, but I can drop the code into another if they have better debug trackers.

  2. 1 hour ago, Animefan8888 said:

    If I remember correctly Forge doesn't have any Retrogen API so to say. I think the only way to do this would be to subscribe to the ChunkEvent.Load event and save that to the disk somehow and load chunks from that file into a List. Cross reference that list in the Load event and then generate the ores if it is not in that list.

    Should I be using the ChunkEvent.Load or ChunkDataEvent.Load? And what is the difference between the two? Also, does this event fire when a chunk is first generated?

  3. Hey again everyone, back with a question about retrogen. I already know how to setup my config to allow for it, but I have no idea what event to use. Currently, I have a rather laggy version setup in a entityEnterChunkEvent, that does work slowly, but I'm sure that there is a way to do this as soon as the server starts.

    So, two part question really,

    1. What event should I be firing the retrogen on

    2. How do I get a list of all existing chunks in the world?

  4. Just now, Choonster said:

     

    I said to create a method to get the client World, i.e. Minecraft#world. You can only reference Minecraft in the client proxy, you can throw an exception from the server proxy.

     

    I have an example of this in my mod's proxy classes.

    Ah, ok. I was hoping that it would be related to another issue that popped up when I had been using it that way, I'm now getting a 

    io.netty.handler.codec.DecoderException: The received string length is longer than maximum allowed (22 > 20)
    

    which I am guessing is from my packet handling somewhere. From what I have seen, this is usually due to scoreboards or entity names, but I don't use either.

  5. 20 hours ago, Choonster said:

    Since getExtendedState will usually be called with a ChunkCache as its IBlockAccess argument, you can't just cast it to World. Instead, create a method in your proxy classes to get the client World and use this to get the ore data. It's probably best to check if the IBlockAccess is a World first and use that directly, just in case someone calls the method with a World.

    How should I get access to a World instance in the first place then?

  6. Would DimensionManager be the way to get a copy on the server side? Thats the only place I am finding to get an instance of ServerWorld, since MinecraftServer doesn't have a getInstance method. Also, I am attempting to locate the previous threads, I may have had them on a different forum. People seemed very opposed to using TileEntities for ores.

  7. 7 hours ago, Choonster said:

    This would be a lot easier if you just used a TileEntity to store per-position block data.

     

    If you're going to stick with the current system, OreSavedData should use a Map with BlockPos keys instead of using nested Maps for each coordinate.

     

    Is there a reason you're storing everything as integers rather than storing the Material instances directly?

    When I had asked for help previously, I had been using tile entities, but the community reacted like I had personally kicked their childhood puppy, so I switched to using WorldSavedData. The reason I use nested maps is to help with networking, since it was the first way I thought of to reduce the size of the update packets, but I will take a look into merging them into a single map.

    As far as storing integers, I thought that it would reduce the RAM required, since this is being designed for a relatively large modpack, as well as that you can use CraftTweaker to add extra materials later on if needed.

  8. I have been working on a mod for the past month or two, and it has been running just fine in single player. However, I attempted to put it on a server for some group testing and I got the following error log: https://pastebin.com/gDeaDKd2

    However, this is the line that the error is supposedly at: https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/proxy/CommonProxy.java#L75

    and not only is there no reference to IStateMapper there, I don't have any direct usage of it in my mod at all. What am I doing wrong here?

  9. Not sure about the event, but the AI for breaking doors can be found in the minecraft source at net.minecraft.entity.ai.EntityAIBreakDoor; It looks like it just sets the door block to be air, I don't know what the associated event is called.

     

    As far as the slime, see the setDead() method in net.minecraft.entity.monster.EntitySlime; for 1.10.2 source it is line #212

  10. Hey again, this time it's a question about default APIs and libraries with development. Forge seems to be including a version of JEI when gradlew is getting set up, but it is not the most recent version, and another of the libraries I am using requires a newer version. Is there any way to change what version of JEI gets included?

  11. I now have recipes registering with JEI properly thanks to the MineTweakerAPI.ijeiRecipeRegistry.addRecipe() method, but new items are still not showing up in the item list. Any ideas/suggestions? Calling MineTweakerAPI.ijeiRecipeRegistry.reloadItemList() doesn't seem to be doing anything. They show up in the vanilla creative tabs, but not in JEI

  12. Ok, so by inserting 

    
    task DeobdeobfJar(type: Jar) {
        from sourceSets.main.output
        classifier = 'deobf'
    }
     
    task DeobsourceJar(type: Jar) {
        from sourceSets.main.allSource
        classifier = 'sources'
    }

    into my build.gradle, by IDE is now allowing me to build and implement all of the methods. However, now I get Caused by: java.lang.NoClassDefFoundError on a bunch of my files. Any suggestions?

    Here is my github repo for the sub-mod: https://github.com/16ColorGames/SuperTechProcessing

    and the repo for my library: https://github.com/16ColorGames/SuperTechTweaks

     

    Here is a specific case of one of the errors:

    net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Super Tech Processing (supertechprocessing)
    Caused by: java.lang.NoClassDefFoundError: com/sixteencolorgames/supertechprocessing/tileentities/TileEntityElectricExtruder
    	at com.sixteencolorgames.supertechprocessing.ModBlocks.init(ModBlocks.java:34)
    	at com.sixteencolorgames.supertechprocessing.proxy.CommonProxy.preInit(CommonProxy.java:39)
    	at com.sixteencolorgames.supertechprocessing.proxy.ClientProxy.preInit(ClientProxy.java:17)
    	at com.sixteencolorgames.supertechprocessing.SuperTechProcessingMod.preInit(SuperTechProcessingMod.java:29)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:618)
    	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:243)
    	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:145)
    	at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:624)
    	at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:259)
    	at net.minecraft.client.Minecraft.startGame(Minecraft.java:477)
    	at net.minecraft.client.Minecraft.run(Minecraft.java:386)
    	at net.minecraft.client.main.Main.main(Main.java:118)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
    	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.lang.reflect.Method.invoke(Method.java:498)
    	at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97)
    	at GradleStart.main(GradleStart.java:26)

     

  13. I currently have 2 mods, one of which is acting as a library for another. However, once compiled the library's methods seem to be obfuscated, and are unable to be accessed and overridden. For example:

    
        /**
         * Returns the stack in the given slot.
         */
        @Nullable
        @Override
        public ItemStack func_70301_a(int index) {
            return itemStacks[index];
        }

    instead of 

        /**
         * Returns the stack in the given slot.
         */
        @Nullable
        @Override
        public ItemStack getStackInSlot(int index) {
            return itemStacks[index];
        }

    Anyone have ideas on how to compile the jar without obfuscation?

  14. Hey again, back with some networking questions this time. I am attempting to send a data packet when a player changes their current chunk, but when I register a EntityEvent.EnteringChunk (I am checking for an instanceof EntityPlayer) the event doesn't seem to fire.

    Ii have my events here: https://github.com/16ColorGames/SuperTechTweaks/blob/WorldSavedData/src/main/java/com/sixteencolorgames/supertechtweaks/ServerEvents.java

    It is registered here: https://github.com/16ColorGames/SuperTechTweaks/blob/WorldSavedData/src/main/java/com/sixteencolorgames/supertechtweaks/proxy/ServerProxy.java#L31

    My network code is in this package if it is relevant: https://github.com/16ColorGames/SuperTechTweaks/tree/WorldSavedData/src/main/java/com/sixteencolorgames/supertechtweaks/network

     

    When I have this event firing on client side, it does fire, but then crashes due to not being able to send a packet to the client.

     

    If the EnteringChunk event cannot be fired from server side, is there an alternate I could use? I am using this to send ore data to clients, but sending the entirety of the ore data at once exceeds the max packet size.

  15. Hey again,

    I am testing out some alternate methods for some generation in my mod, and find myself needing a way to write nested arrays/hashmaps to NBTTags for use in the WorldSavedData extension I have created. In my case I am storing an integer array for specific world positions, so the array accessor would be data[X][Y][Z][], where the final array contains a list of the ordinals of my custom ores.

×
×
  • Create New...

Important Information

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