• 0

    posted a message on 1.15.2 keybinding issues

    I posted this on forge forums already, but they are not very helpful so:


    I was following tutorials and post and i cant figure out why my game keeps crashing when i adda custom key value. Heres the code:


    public class key {
    
    
            private final int key;
    
            public key(int keyIn) {
                this.key = keyIn;
            }
    
            public static void encode(key msg, PacketBuffer buf) {
                buf.writeInt(msg.key);
            }
    
            public static key decode(PacketBuffer buf) {
                return new key(buf.readInt());
            }
    
            public static void handle(key msg, Supplier<NetworkEvent.Context> ctx) {
                if(msg.key==0) {
                    ctx.get().enqueueWork(() -> {
                        ServerPlayerEntity sender = ctx.get().getSender();
                        sender.addPotionEffect(new EffectInstance(Effect.get(5),20)); });
                }
                ctx.get().setPacketHandled(true);
            }
        }


    @Mod.EventBusSubscriber(modid = DungeonWars.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
    public class keyBind {
        static KeyBinding[] keyBindings = new KeyBinding[]{new KeyBinding("key.strong", KeyConflictContext.UNIVERSAL, InputMappings.Type.KEYSYM, 33, "key.categories.strong")};
    
    
       static Boolean keyPress = false;
    
        @SubscribeEvent
        public static void onTick(TickEvent.ClientTickEvent event) {
            if (keyPress && !keyBindings[0].isKeyDown()) {
                keyPress = false;
            }
        }
    
        @SubscribeEvent
        public static void onInput(InputEvent.KeyInputEvent event) {
            if (event.getKey() == keyBindings[0].getKey().getKeyCode() ) {
               // CrudeTechMod.log("pressed");
                Packets.INSTANCE.sendToServer(new key(0));
                keyPress = true;
            }
        }
    
        public static void registerKeyBindings() {
            for (int i = 0; i < keyBindings.length; i++) {
                ClientRegistry.registerKeyBinding(keyBindings[i]);
            }
        }


    public class Packets {
        private static final String PROTOCOL_VERSION = "1";
        public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel(
                new ResourceLocation(DungeonWars.MOD_ID, "main"),
                () -> PROTOCOL_VERSION,
                PROTOCOL_VERSION::equals,
                PROTOCOL_VERSION::equals
        );
        public static int i=0;
    }


    //(Main)
    
        private void setup(final FMLCommonSetupEvent event)
        {
            // some preinit code
            Packets.INSTANCE.registerMessage(Packets.i++, key.class, key::encode, key::decode, key::handle);
         }
    
        private void doClientStuff(final FMLClientSetupEvent event) {
            // do something that can only be done on the client
            keyBind.registerKeyBindings();
            //ClientRegistry.registerKeyBinding(keybinding);
    
        }

    and the log:


    java.lang.RuntimeException: Why did the advancements not load yet?!
    	at net.minecraftforge.common.AdvancementLoadFix.loadVisibility(AdvancementLoadFix.java:51) ~[?:?] {re:classloading}
    	at net.minecraft.advancements.PlayerAdvancements.load(PlayerAdvancements.java:157) ~[?:?] {re:classloading}
    	at net.minecraft.advancements.PlayerAdvancements.<init>(PlayerAdvancements.java:65) ~[?:?] {re:classloading}
    	at net.minecraft.server.management.PlayerList.getPlayerAdvancements(PlayerList.java:806) ~[?:?] {re:classloading}
    	at net.minecraft.entity.player.ServerPlayerEntity.<init>(ServerPlayerEntity.java:167) ~[?:?] {re:classloading,pl:accesstransformer:B}
    	at net.minecraft.server.management.PlayerList.createPlayerForUser(PlayerList.java:395) ~[?:?] {re:classloading}
    	at net.minecraft.network.login.ServerLoginNetHandler.tryAcceptPlayer(ServerLoginNetHandler.java:120) ~[?:?] {re:classloading}
    	at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:64) ~[?:?] {re:classloading}
    	at net.minecraft.network.NetworkManager.tick(NetworkManager.java:246) ~[?:?] {re:classloading}
    	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:152) ~[?:?] {re:classloading}
    	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:903) ~[?:?] {re:classloading,pl:accesstransformer:B}
    	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:821) ~[?:?] {re:classloading,pl:accesstransformer:B}
    	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:662) [?:?] {re:classloading,pl:accesstransformer:B}
    	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251] {}
    
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- Head --
    Thread: Server thread
    Stacktrace:
    	at net.minecraftforge.common.AdvancementLoadFix.loadVisibility(AdvancementLoadFix.java:51)
    	at net.minecraft.advancements.PlayerAdvancements.load(PlayerAdvancements.java:157)
    	at net.minecraft.advancements.PlayerAdvancements.<init>(PlayerAdvancements.java:65)
    	at net.minecraft.server.management.PlayerList.getPlayerAdvancements(PlayerList.java:806)
    	at net.minecraft.entity.player.ServerPlayerEntity.<init>(ServerPlayerEntity.java:167)
    	at net.minecraft.server.management.PlayerList.createPlayerForUser(PlayerList.java:395)
    	at net.minecraft.network.login.ServerLoginNetHandler.tryAcceptPlayer(ServerLoginNetHandler.java:120)
    	at net.minecraft.network.login.ServerLoginNetHandler.tick(ServerLoginNetHandler.java:64)
    	at net.minecraft.network.NetworkManager.tick(NetworkManager.java:246)
    
    -- Ticking connection --
    Details:
    	Connection: [email protected]
    Stacktrace:
    	at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:152)
    	at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:903)
    	at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:821)
    	at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:662)
    	at java.lang.Thread.run(Thread.java:748)
    
    -- System Details --
    Details:
    	Minecraft Version: 1.15.2
    	Minecraft Version ID: 1.15.2
    	Operating System: Windows 10 (amd64) version 10.0
    	Java Version: 1.8.0_251, Oracle Corporation
    	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    	Memory: 762228824 bytes (726 MB) / 2077753344 bytes (1981 MB) up to 3799515136 bytes (3623 MB)
    	CPUs: 8
    	JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
    	ModLauncher: 5.1.0+69+master.79f13f7
    	ModLauncher launch target: fmluserdevclient
    	ModLauncher naming: mcp
    	ModLauncher services: 
    		/eventbus-2.2.0-service.jar eventbus PLUGINSERVICE 
    		/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar object_holder_definalize PLUGINSERVICE 
    		/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar runtime_enum_extender PLUGINSERVICE 
    		/accesstransformers-2.1.1-shadowed.jar accesstransformer PLUGINSERVICE 
    		/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar capability_inject_definalize PLUGINSERVICE 
    		/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar runtimedistcleaner PLUGINSERVICE 
    		/forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-launcher.jar fml TRANSFORMATIONSERVICE 
    	FML: 31.2
    	Forge: net.minecraftforge:31.2.0
    	FML Language Providers: 
    		[email protected]
    		[email protected]
    	Mod List: 
    		client-extra.jar Minecraft {[email protected] DONE}
    		forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar Forge {[email protected] DONE}
    		main Minecraft World War: Dungeon Wars {[email protected] DONE}
    	Player Count: 0 / 8; []
    	Data Packs: vanilla, mod:forge (incompatible), mod:mwwdungeonwars
    	Type: Integrated Server (map_client.txt)

    any help would be very appreciated!

    Posted in: Modification Development
  • 0

    posted a message on Friends minecraft crashes using linux

    Bump anyone

    Posted in: Java Edition Support
  • 0

    posted a message on Friends minecraft crashes using linux
    OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
    Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/isaac/.minecraft/versions/1.12.2/1.12.2-natives-1174799630298/liblwjgl.so: /home/isaac/.minecraft/versions/1.12.2/1.12.2-natives-1174799630298/liblwjgl.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)
        at java.lang.Runtime.loadLibrary0(Runtime.java:870)
        at java.lang.System.loadLibrary(System.java:1122)
        at org.lwjgl.Sys$1.run(Sys.java:72)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
        at org.lwjgl.Sys.loadLibrary(Sys.java:96)
        at org.lwjgl.Sys.<clinit>(Sys.java:117)
        at bib.I(SourceFile:2825)
        at net.minecraft.client.main.Main.main(SourceFile:38)

    Hes using A fanless quad-core MediaTek processor M8173C powers the Acer Chromebook R13.

    Posted in: Java Edition Support
  • 0

    posted a message on Looking for RPG mods

    Bump?

    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on Looking for RPG mods

    if anyone remembers hack/mine they had a good class and skill based system. If anyone knows a Mod that can add at least skills that users can level that would be helpful. I need it for 1.7.10


    Another mod I need is one that adds Mob levels to Minecraft. For example if you’re a certain distance away from Spawn then a mobs level is higher and is customizable. Although for that I’m thinking of just configuration for simple scaling mods I have already found.


    Lastly I am looking for mods where I could possibly customize dungeon loot. And not just underground dungeons but potentially battle towers and rogue like as well?

    Thank you!!

    Posted in: Requests / Ideas For Mods
  • To post a comment, please or register a new account.