• Recently Browsing

    No registered users viewing this page.

  • Posts

    • The following is my packet registry. The Client->Server packets work just fine, it's just the Server->Client ones that complain about "Unknown custom packet identifier" so I'm certain I'm just missing something stupid:   public final class PacketRegistry { /** * The ID for the next packet registration. */ private static final String PROTOCOL_VERSION = Integer.toString(1); private byte nextPacketID = 0; /** * The internal network wrapper. */ private static final SimpleChannel wrapper = NetworkRegistry.ChannelBuilder .named(new ResourceLocation(Withernauts.MODID, "main_channel")) .clientAcceptedVersions(PROTOCOL_VERSION::equals) .serverAcceptedVersions(PROTOCOL_VERSION::equals) .networkProtocolVersion(() -> PROTOCOL_VERSION) .simpleChannel(); public void registerPackets() { //register packets going to the client registerServerToClient(MotionPlayerPacket.class, MotionPlayerPacket::encode, MotionPlayerPacket::decode, MotionPlayerPacket::handle); registerServerToClient(PlayerLoadingPacket.class, PlayerLoadingPacket::encode, PlayerLoadingPacket::decode, PlayerLoadingPacket::handle); //register packets going to the server registerClientToServer(CrouchSyncPacket.class, CrouchSyncPacket::encode, CrouchSyncPacket::decode, CrouchSyncPacket::handle); registerClientToServer(RunSyncPacket.class, RunSyncPacket::encode, RunSyncPacket::decode, RunSyncPacket::handle); registerClientToServer(AttackSyncPacket.class, AttackSyncPacket::encode, AttackSyncPacket::decode, AttackSyncPacket::handle); registerClientToServer(CombatActionPacket.class, CombatActionPacket::encode, CombatActionPacket::decode, CombatActionPacket::handle); registerClientToServer(ManaSyncPacket.class, ManaSyncPacket::encode, ManaSyncPacket::decode, ManaSyncPacket::handle); registerClientToServer(StaminaSyncPacket.class, StaminaSyncPacket::encode, StaminaSyncPacket::decode, StaminaSyncPacket::handle); } @SuppressWarnings({"unchecked", "rawtypes"}) protected <MESSAGE> void registerServerToClient(Class<MESSAGE> type, BiConsumer<MESSAGE, PacketBuffer> encoder, Function<PacketBuffer, MESSAGE> decoder, BiConsumer<MESSAGE, Supplier<NetworkEvent.Context>> consumer) { this.wrapper.registerMessage(nextPacketID++, type, encoder, decoder, consumer, Optional.of(NetworkDirection.PLAY_TO_CLIENT)); } @SuppressWarnings({"unchecked", "rawtypes"}) protected <MESSAGE> void registerClientToServer(Class<MESSAGE> type, BiConsumer<MESSAGE, PacketBuffer> encoder, Function<PacketBuffer, MESSAGE> decoder, BiConsumer<MESSAGE, Supplier<NetworkEvent.Context>> consumer) { this.wrapper.registerMessage(nextPacketID++, type, encoder, decoder, consumer, Optional.of(NetworkDirection.PLAY_TO_SERVER)); } /** * Sends the given packet to every client. * * @param message the packet to send. */ public<MESSAGE> void sendToAll(MESSAGE message) { this.wrapper.send(PacketDistributor.ALL.noArg(), message); } /** * Sends the given packet to the given player. * * @param message the packet to send. * @param player the player to send the packet to. */ public<MESSAGE> void sendTo(MESSAGE message, ServerPlayerEntity player) { if (player.connection != null) this.wrapper.sendTo(message, player.connection.getNetworkManager(), NetworkDirection.PLAY_TO_CLIENT); } /** * Sends the given packet to all players around the given target point. * * @param message the packet to send. * @param point the target point. */ public<MESSAGE> void sendToAllAround(MESSAGE message, PacketDistributor.TargetPoint point) { this.wrapper.send(PacketDistributor.NEAR.with(()->point), message); } /** * Sends the given packet to the server. * * @param message the packet to send. */ public<MESSAGE> void sendToServer(MESSAGE message) { this.wrapper.sendToServer(message); } public<MESSAGE> void sendToAllTracking(MESSAGE message, Entity entity) { this.wrapper.send(PacketDistributor.TRACKING_ENTITY.with(() -> entity), message); } }   This class is called in the FMLCommonSetupEvent event hook within my main file.
    • Hi, im using crident networks with the dino.gg panel to host a server im downloading there latest 1.16.4 forge server build and every time i attepmt to launch the server i recieve the same attach crash log. Ive downloaded the actual latest 1.16.4 forge server files onto my pc from forge directly, made a working server and uploaded them to the server host but then i recieve the same issue. I contacted crident support but after talking to one of the devs they told me that forge support was the place to seek help as it was out of their hands. Any help is massively appreciated. 2021-01-21-1.log
    • but when i try this to set the weather to thunder ((ServerWorld) world).func_241113_a_(0, world.rand.nextInt(1000), true, true);   i get an error: java.lang.ClassCastException: class net.minecraft.client.world.ClientWorld cannot be cast to class net.minecraft.world.server.ServerWorld (net.minecraft.client.world.ClientWorld and net.minecraft.world.server.ServerWorld are in unnamed module of loader cpw.mods.modlauncher.TransformingClassLoader @4cc36c19) at net.luis.cave.events.entity.OnEntityAttack.EntityAttack(OnEntityAttack.java:78) ~[main/:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_17_OnEntityAttack_EntityAttack_LivingAttackEvent.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.common.ForgeHooks.onLivingAttack(ForgeHooks.java:325) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraft.entity.LivingEntity.attackEntityFrom(LivingEntity.java:991) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraft.entity.passive.AnimalEntity.attackEntityFrom(AnimalEntity.java:80) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraft.entity.player.PlayerEntity.attackTargetEntityWithCurrentItem(PlayerEntity.java:1167) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.multiplayer.PlayerController.attackEntity(PlayerController.java:373) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1343) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:1688) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runTick(Minecraft.java:1507) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:979) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}  
    • Okay I made it work with this:   public static File getWorldFolder(ServerWorld world) throws NoSuchFieldException, IllegalAccessException { DimensionSavedDataManager savedData = world.getChunkProvider().getSavedData(); Field folderField = DimensionSavedDataManager.class.getDeclaredField("folder"); folderField.setAccessible(true); return ((File) folderField.get(savedData)).getParentFile(); } So I'm good now ^^
    • I wanted to make a new modded Server but then this error was spammed in the console:   java.net.preferIPv4Stack=true Found java version 1.8.0_275 Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.         at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)         at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)         at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)         at java.security.AccessController.doPrivileged(Native Method)         at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:74)         at java.lang.Class.forName0(Native Method)         at java.lang.Class.forName(Class.java:264)         at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)         at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)         at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:131)         at java.lang.Class.forName0(Native Method)         at java.lang.Class.forName(Class.java:264)         at java.awt.Toolkit$2.run(Toolkit.java:860)         at java.awt.Toolkit$2.run(Toolkit.java:855)         at java.security.AccessController.doPrivileged(Native Method)         at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)         at javax.swing.UIManager.getSystemLookAndFeelClassName(UIManager.java:611)         at net.minecraftforge.installer.SimpleInstaller.launchGui(SimpleInstaller.java:162)         at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:143)   System: Debian 10
  • Topics

  • Who's Online (See full list)