Jump to content

kaydogz

Members
  • Posts

    106
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by kaydogz

  1. I currently have a forked repo on GH with a separate branch for my contribution to forge. I have cloned it into a folder on my PC, ran the gradle setup task, ran genIntelliJRuns, and finally ran the test client task. As soon as the early loading window pops up, the game crashes with the log: https://pastebin.com/aCNMSmuf . Here's what I know/have tried:
    -Deleting the local repo and recloning into a new folder

    -Changing gradle settings to use IntelliJ to build, run, and test

    -Cloning the original repo instead of mine, which works

    -I have ensured that my custom branch is up to date with the original 1.16.x branch

    -The commits to my custom branch all don't interfere with early loading

     

    Any help is greatly appreciated, as I have been having this issue for weeks.

  2. 7 minutes ago, kaiser_ said:

    Sorry for the late reply, I was trying to find a way to figure out my problem.

     

    So for example I want to save a list of objects, the object has two properties, one string and one int, but You can imagine any type of properties as well from strings to items or blocks.

    I've tried to store a list of objects like this, but this is not working. Am I missing something? Is this possible with the capability system?

     

    I would really be happy about anyone's answer. If this is a bad approach, let me know as well.

    It is most definitely possible with the capability system. In your storage class, you can write your capability instance's object list to a ListNBT.

  3. 8 hours ago, sciwhiz12 said:

    Looking at the code for World#playBroadcastSound leads to WorldRenderer#broadcastSound, which calculates coordinates based on the given position and the player's PoV pos (I think?), which eventually just calls ClientWorld#playSound.

     

    Based on this, I recommend that in your packet, change from ISound to SoundEvent (+ pitch & volume), and copy the coordinates code from WorldRenderer#broadcastSound, and calling ClientWorld#playSound(double, double, double, SoundEvent, SoundCategory, float, float, boolean).

    Thanks, this worked.

  4. 2 minutes ago, sciwhiz12 said:

    You are referencing the ISound class in your packet, which is only accessible from the physical client side.

    Looking and guessing from your posted code (please post your complete mod code to GitHub when requesting help), I assume you reference the class from SPlaySoundPacket.

    • Don't use client- or sever-only classes in common code (such as networking). Consider using SoundEvent.
    • Why do you need a packet for playing sounds? Can't you use World#playSound(PlayerEntity, BlockPos, SoundEvent, SoundCategory, float, float)?
    • If you really need to reference client- or server-only classes for any reason, reference them only in FMLClientSetupEvent or FMLDedicatedServerSetupEvent, and in a seperate class.

    I need to use a custom packet because I want to play a custom sound globally from a logical server, but World#playBroadcastSound doesn’t work since it requires a hard-coded sound type.

  5. [04Jun2020 22:28:17.891] [Server thread/DEBUG] [net.minecraftforge.fml.ModList/LOADING]: Dispatching parallel event LifecycleEvent:COMMON_SETUP
    [04Jun2020 22:28:17.894] [modloading-worker-1/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Firing event for modid forge : FMLCommonSetupEvent
    [04Jun2020 22:28:17.894] [modloading-worker-3/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Firing event for modid daboismod : FMLCommonSetupEvent
    [04Jun2020 22:28:17.942] [modloading-worker-3/FATAL] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/audio/ISound for invalid dist DEDICATED_SERVER
    [04Jun2020 22:28:17.946] [modloading-worker-3/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: Attempted to load class net/minecraft/client/audio/ISound for invalid dist DEDICATED_SERVER
    	Index: 1
    	Listeners:
    		0: NORMAL
    		1: net.minecraftforge.eventbus.EventBus$$Lambda$2660/977800848@3936f231
    java.lang.RuntimeException: Attempted to load class net/minecraft/client/audio/ISound for invalid dist DEDICATED_SERVER
    	at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71)
    	at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:103)
    	at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:85)
    	at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115)
    	at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:239)
    	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:126)
    	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:96)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    	at java.lang.invoke.MethodHandleNatives.resolve(Native Method)
    	at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975)
    	at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000)
    	at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394)
    	at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750)
    	at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477)
    	at com.github.kaydogz.daboismod.network.DBMPacketHandler.registerPackets(DBMPacketHandler.java:36)
    	at com.github.kaydogz.daboismod.DaBoisMod.onCommonSetup(DaBoisMod.java:84)
    	at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212)
    	at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204)
    	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258)
    	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106)
    	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
    	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65)
    	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112)
    	at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:135)
    	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
    	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
    	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    	at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291)
    	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731)
    	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
    	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
    	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
    	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
    
    [04Jun2020 22:28:17.948] [modloading-worker-3/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event FMLCommonSetupEvent dispatch for modid daboismod
    java.lang.RuntimeException: Attempted to load class net/minecraft/client/audio/ISound for invalid dist DEDICATED_SERVER
    	at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.15.2-31.2.8_mapped_snapshot_20200604-1.15.1-launcher.jar:31.2]
    	at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:103) ~[modlauncher-5.1.0.jar:5.1.0+69+master.79f13f7]
    	at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:85) ~[modlauncher-5.1.0.jar:?]
    	at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-5.1.0.jar:?]
    	at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:239) ~[modlauncher-5.1.0.jar:?]
    	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:126) ~[modlauncher-5.1.0.jar:?]
    	at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:96) ~[modlauncher-5.1.0.jar:?]
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_251]
    	at java.lang.invoke.MethodHandleNatives.resolve(Native Method) ~[?:1.8.0_251]
    	at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975) ~[?:1.8.0_251]
    	at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000) ~[?:1.8.0_251]
    	at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394) ~[?:1.8.0_251]
    	at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750) ~[?:1.8.0_251]
    	at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477) ~[?:1.8.0_251]
    	at com.github.kaydogz.daboismod.network.DBMPacketHandler.registerPackets(DBMPacketHandler.java:36) ~[main/:?]
    	at com.github.kaydogz.daboismod.DaBoisMod.onCommonSetup(DaBoisMod.java:84) ~[main/:?]
    	at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-2.2.0-service.jar:?]
    	at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-2.2.0-service.jar:?]
    	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.2.0-service.jar:?]
    	at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106) ~[?:31.2]
    	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_251]
    	at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_251]
    	at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?]
    	at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:135) ~[?:?]
    	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) [?:1.8.0_251]
    	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) [?:1.8.0_251]
    	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_251]
    	at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291) [?:1.8.0_251]
    	at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) [?:1.8.0_251]
    	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_251]
    	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_251]
    	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_251]
    	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) [?:1.8.0_251]
    [04Jun2020 22:28:18.031] [modloading-worker-1/DEBUG] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Fired event for modid forge : FMLCommonSetupEvent
    [04Jun2020 22:28:18.032] [Server thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event SETUP, 1 errors found
    [04Jun2020 22:28:18.033] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Starting version check at https://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json
    [04Jun2020 22:28:18.032] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception
    net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [
    	Da Bois Mod (daboismod) encountered an error during the common_setup event phase
    §7Attempted to load class net/minecraft/client/audio/ISound for invalid dist DEDICATED_SERVER
    ]
    	at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:218) ~[?:?]
    	at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:156) ~[?:?]
    	at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:46) ~[?:?]
    	at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:125) ~[?:?]
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:638) [?:?]
    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
    [04Jun2020 22:28:18.049] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: This crash report has been saved to: C:\Users\mrkdo\Desktop\Modding\DaBoisMod\run\.\crash-reports\crash-2020-06-04_22.28.18-server.txt
    [04Jun2020 22:28:18.065] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server
    [04Jun2020 22:28:18.066] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds
    [04Jun2020 22:28:18.066] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Exception stopping the server
    java.lang.RuntimeException: The server has failed to initialize correctly due to mod loading errors. Examine the crash report for more details.
    	at net.minecraftforge.common.DimensionManager.getWorld(DimensionManager.java:185) ~[?:?]
    	at net.minecraft.server.MinecraftServer.getWorld(MinecraftServer.java:1053) ~[?:?]
    	at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:552) ~[?:?]
    	at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:587) ~[?:?]
    	at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:602) ~[?:?]
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:701) [?:?]
    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
    [04Jun2020 22:28:18.071] [Server thread/DEBUG] [net.minecraftforge.fml.loading.FileUtils/CORE]: Found existing serverconfig directory : .\world\serverconfig
    [04Jun2020 22:28:18.071] [Server thread/DEBUG] [net.minecraftforge.fml.config.ConfigTracker/CONFIG]: Unloading configs type SERVER
    [04Jun2020 22:28:18.411] [Forge Version Check/DEBUG] [net.minecraftforge.fml.VersionChecker/]: [forge] Received version check data:
    {
      "homepage": "http://files.minecraftforge.net/maven/net/minecraftforge/forge/",
      "promos": {
        "1.1-latest": "1.3.2.6",
        "1.10-latest": "12.18.0.2000",
        "1.10.2-latest": "12.18.3.2511",
        "1.10.2-recommended": "12.18.3.2185",
        "1.11-latest": "13.19.1.2199",
        "1.11-recommended": "13.19.1.2189",
        "1.11.2-latest": "13.20.1.2588",
        "1.11.2-recommended": "13.20.1.2386",
        "1.12-latest": "14.21.1.2443",
        "1.12-recommended": "14.21.1.2387",
        "1.12.1-latest": "14.22.1.2485",
        "1.12.1-recommended": "14.22.1.2478",
        "1.12.2-latest": "14.23.5.2854",
        "1.12.2-recommended": "14.23.5.2854",
        "1.13.2-latest": "25.0.219",
        "1.14.2-latest": "26.0.63",
        "1.14.3-latest": "27.0.60",
        "1.14.4-latest": "28.2.18",
        "1.14.4-recommended": "28.2.0",
        "1.15-latest": "29.0.4",
        "1.15.1-latest": "30.0.51",
        "1.15.2-latest": "31.2.8",
        "1.15.2-recommended": "31.2.0",
        "1.5.2-latest": "7.8.1.738",
        "1.5.2-recommended": "7.8.1.737",
        "1.6.1-latest": "8.9.0.775",
        "1.6.2-latest": "9.10.1.871",
        "1.6.2-recommended": "9.10.1.871",
        "1.6.3-latest": "9.11.0.878",
        "1.6.4-latest": "9.11.1.1345",
        "1.6.4-recommended": "9.11.1.1345",
        "1.7.10-latest": "10.13.4.1614",
        "1.7.10-latest-1.7.10": "10.13.2.1343",
        "1.7.10-recommended": "10.13.4.1558",
        "1.7.2-latest": "10.12.2.1147",
        "1.7.2-recommended": "10.12.2.1121",
        "1.8-latest": "11.14.4.1577",
        "1.8-recommended": "11.14.4.1563",
        "1.8.8-latest": "11.15.0.1655",
        "1.8.9-latest": "11.15.1.2318",
        "1.8.9-recommended": "11.15.1.1722",
        "1.9-latest": "12.16.0.1942",
        "1.9-recommended": "12.16.1.1887",
        "1.9.4-latest": "12.17.0.2051",
        "1.9.4-recommended": "12.17.0.1976",
        "latest-1.7.10": "10.13.2.1343"
      }
    }
    [04Jun2020 22:28:18.414] [Forge Version Check/INFO] [net.minecraftforge.fml.VersionChecker/]: [forge] Found status: AHEAD Current: 31.2.8 Target: null

    ^Here is the crash part of the debug.log.

    Whenever I try to launch a server using runServer, the server crashes on startup during the FMLCommonSetupEvent, caused by referencing a client-only file on the dedicated server. The referencing of the client-only file is in the handler of a packet I am registering (server to client) during the event. I'm not sure why this is occurring, because the packet is only sent when a certain entity dies. How would I fix this? Registering of the packet: https://pastebin.com/Csb4cVVn  Packet Handling: https://pastebin.com/S71eimkr . Any help is appreciated.

  6. 4 minutes ago, AceOfSpades2370 said:

    Someone Please help, I was trying to get my textures animated and broke my mod, now none of the items show up in any of the tabs, there are no errors and the mod is loaded in Minecraft, please help!

    How were you trying to make your textures animated?

  7. 48 minutes ago, Turtledove said:

    I already have the cooldown set up as a capability serverside with IPlayerData, which is also where it's incremented every tick. In my server to client message handler, do I just set that variable in the same class (but on the client) and access it as normal in the event handling method? So I guess in that case there'd be a server and client version of my IPlayerData running at the same time, correct?

    Yes and remember you need to sync the values on each side.

  8. 24 minutes ago, Turtledove said:

    I'm overriding vanilla sword behavior, such that the player cannot swing their sword unless a certain amount of ticks have passed, which is determined by logic done on the server. I've got everything already setup, and the packets are successfully sent to client. However, I'm not sure how to retrieve this information within my input handler class's static mouse event, from my message handler. Is there a better way of doing this than creating a static member variable inside the event handler class?

    Don't create a static variable. Use a capability to keep track of the cooldown per player.

  9. 16 minutes ago, QuantumSoul said:

    I changed it to

    
        @SubscribeEvent
        public static void registerModDimensions(final RegistryEvent.Register<ModDimension> event)
        {
            event.getRegistry().register(new ModDimension() {
                @Override
                public BiFunction<World, DimensionType, ? extends Dimension> getFactory()
                {
                    return BinaryDimension::new;
                }
            }.setRegistryName(BinaryMod.MOD_ID + ":" + DIM_BINARY_ID));
        }

    And It still crashes with the same error.

    Use your resource location, not a concatenation of strings.

  10. 6 minutes ago, QuantumSoul said:

    Hey,

    I tried registering my custom dimension but it crashes, I checked different times but couldn't find why.

     

     DimensionMod: 

      Hide contents
    
    
    @ObjectHolder(BinaryMod.MOD_ID)
    @Mod.EventBusSubscriber(modid = BinaryMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD)
    public class DimensionMod
    {
        private final static String DIM_BINARY_ID = "binary_dimension";
        public static final ResourceLocation DIM_BINARY_RL = new ResourceLocation(BinaryMod.MOD_ID, DIM_BINARY_ID);
    
    
        // MODDIMENSION REGISTERING
        @ObjectHolder(DIM_BINARY_ID)
        public static final ModDimension DIM_BINARY_MOD = null;
    
        @SubscribeEvent
        public static void registerModDimensions(final RegistryEvent.Register<ModDimension> event)
        {
            event.getRegistry().register(new ModDimension() {
                @Override
                public BiFunction<World, DimensionType, ? extends Dimension> getFactory()
                {
                    return BinaryDimension::new;
                }
            }.setRegistryName(DIM_BINARY_ID));
        }
    
    
        // DIMENSION REGISTERING
        @Mod.EventBusSubscriber(modid = BinaryMod.MOD_ID, bus=Mod.EventBusSubscriber.Bus.FORGE)
        private static class ForgeEvents
        {
            @SubscribeEvent
            public static void onRegisterDimensionsEvent(RegisterDimensionsEvent event)
            {
                if(DimensionType.byName(DIM_BINARY_RL) == null)
                    DimensionManager.registerDimension(DIM_BINARY_RL, DIM_BINARY_MOD, null, true);
            }
        }
    }

     

    Crash report:

    https://pastebin.com/MsqtmeqS

    Your setRegistryName does not include a namespace.

  11. 21 minutes ago, Choonster said:

    I actually managed to get DeferredRegister working with a custom registry (created in RegistryEvent.NewRegistry) by using a lazy-loading IForgeRegistry wrapper class. You can see my implementation here.

     

    This is for 1.14.4, but I imagine it will work in 1.15.2 as well.

    This works perfectly, thanks! The only difference between 1.14.4 and 1.15.2 is that LazyLoadBase is now LazyValue.

×
×
  • Create New...

Important Information

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