Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Hod do i call from the tileentity screen a class in the tileentity tile?


TheTrueSCP
 Share

Recommended Posts

Oh gosh, how simple.

Oh boy howdy, how easy.

If only the documentation matched. Oh wait it does.

(I will note that I haven't messed with the code in like 3 years and I am sending and not verifying the TE pos)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Sorry for the late reply but I've tried it now. However, the game crashes when i press the button with the following error

1:22:08] [Render thread/FATAL] [minecraft/Minecraft]: Reported exception thrown!
net.minecraft.crash.ReportedException: mouseClicked event handler
	at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:434) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.mouseButtonCallback(MouseHelper.java:90) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:191) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:86) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.MouseHelper.lambda$registerCallbacks$5(MouseHelper.java:190) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
	at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] {}
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
	at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:89) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MainWindow.flipFrame(MainWindow.java:305) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1022) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-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.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_202] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-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:108) [forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}
Caused by: java.lang.NullPointerException
	at net.the_goldbeards.lootdebugs.screen.PubScreen.lambda$init$0(PubScreen.java:56) ~[main/:?] {re:classloading}
	at net.minecraft.client.gui.widget.button.Button.onPress(Button.java:26) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.widget.button.AbstractButton.onClick(AbstractButton.java:18) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.widget.Widget.mouseClicked(Widget.java:136) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.INestedGuiEventHandler.mouseClicked(INestedGuiEventHandler.java:31) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.mouseClicked(ContainerScreen.java:299) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:92) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:427) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	... 23 more

 

and this is my Screenclass:

package net.the_goldbeards.lootdebugs.screen;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.gui.screen.inventory.CraftingScreen;
import net.minecraft.client.gui.screen.inventory.FurnaceScreen;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.gui.widget.button.ImageButton;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.network.NetworkHooks;
import net.minecraftforge.fml.network.simple.SimpleChannel;
import net.the_goldbeards.lootdebugs.LootDebugsMain;
import net.the_goldbeards.lootdebugs.Server.PacketHandler;
import net.the_goldbeards.lootdebugs.Server.ToServerFilterCheck;
import net.the_goldbeards.lootdebugs.container.PubContainer;
import net.the_goldbeards.lootdebugs.tileentity.PubTile;
import org.apache.logging.log4j.Level;


public class PubScreen extends ContainerScreen<PubContainer>
{
   PubTile pubTile;
    private MatrixStack matrixStack;
    private static int i;
    private static int j;
    private static final ResourceLocation GUI = new ResourceLocation(LootDebugsMain.MOD_ID, "textures/gui/pub_gui.png");
    private static final ResourceLocation CONTINUE_BUTTON = new ResourceLocation(LootDebugsMain.MOD_ID, "textures/gui/recipe_button.png");



    public PubScreen(PubContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
        super(screenContainer, inv, titleIn);
     //   pubTile = (PubTile)screenContainer.
    }

    @Override
    protected void init() {
        super.init();
        this.addButton(new ImageButton(this.guiLeft + 140, this.height / 2 - 30, 20, 18, 0, 0, 19, CONTINUE_BUTTON, (button) -> {
            System.out.println("BUtton PReeess" +
                    "ssd");
            //PacketHandler.CHANNEL.sendToServer();
System.out.println("hi");


                PacketHandler.sendToServer(new ToServerFilterCheck(pubTile.getPos()));

           ((ImageButton)button).setPosition(this.guiLeft + 140, this.height / 2 - 30);
        }));
        this.titleX = (this.xSize - this.font.getStringPropertyWidth(this.title)) / 2;
    }


    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        this.renderBackground(matrixStack);
        super.render(matrixStack, mouseX, mouseY, partialTicks);
        this.renderHoveredTooltip(matrixStack, mouseX, mouseY);
        for(int i = 0; i < this.buttons.size(); ++i)
        {
            this.buttons.get(i).render(matrixStack,mouseX,mouseY,partialTicks);
        }


    }



    @Override
    protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y)
    {


        RenderSystem.color4f(1f,1f,1f,1f);
        this.minecraft.getTextureManager().bindTexture(GUI);
        int i = this.guiLeft;
        int j = this.guiTop;
        this.matrixStack = matrixStack;
        this.j= j;
        this.i = i;
        this.blit(matrixStack, i,j,0,0,this.xSize, this.ySize);

        if(false)
        {
            /*this.blit(matrixStack, i+55,j+13,183,2,28,0);//Water-emty
            this.blit(matrixStack, i+55,j+13,183,2,28,3);//Water-1
            this.blit(matrixStack, i+55,j+13,183,2,38,5);//Water-2
            this.blit(matrixStack, i+55,j+13,183,2,48,5);//Water-3
            this.blit(matrixStack, i+55,j+13,183,2,64,12);//Water-4
            this.blit(matrixStack, i+55,j+13,183,2,66,21);//Water-Full*/



        }





    }


   /* protected void actionPerformed(Button button) {
        ExpandedIndustry.LOGGER.log(Level.DEBUG, "Button clicked");
        if(button instanceof ImageButton) {
            ImageButton lb = (ImageButton)button;
            EnumAcceptType t = lb.cycleType();
            tileEntity.setEnumType(t);
            PacketHandler.sendToServer(new ToServerFilterClick(0, tileEntity.getPos(), t.ordinal()));
        }
    }*/


}

 

Link to comment
Share on other sites

public class PubScreen extends ContainerScreen<PubContainer>
{
   PubTile pubTile;
    private MatrixStack matrixStack;
    private static int i;
    private static int j;
    private static final ResourceLocation GUI = new ResourceLocation(LootDebugsMain.MOD_ID, "textures/gui/pub_gui.png");
    private static final ResourceLocation CONTINUE_BUTTON = new ResourceLocation(LootDebugsMain.MOD_ID, "textures/gui/recipe_button.png");



    public PubScreen(PubContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
        super(screenContainer, inv, titleIn);
        pubTile = (PubTile)screenContainer.tileEntity;
     //   pubTile = (PubTile)screenContainer.
    }

    @Override
    protected void init() {
        super.init();
        this.addButton(new ImageButton(this.guiLeft + 140, this.height / 2 - 30, 20, 18, 0, 0, 19, CONTINUE_BUTTON, (button) -> {
            System.out.println("BUtton PReeess" +
                    "ssd");
            //PacketHandler.CHANNEL.sendToServer();
System.out.println("hi");


                PacketHandler.sendToServer(new ToServerFilterCheck(pubTile.getPos()));

           ((ImageButton)button).setPosition(this.guiLeft + 140, this.height / 2 - 30);
        }));
        this.titleX = (this.xSize - this.font.getStringPropertyWidth(this.title)) / 2;
    }


    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        this.renderBackground(matrixStack);
        super.render(matrixStack, mouseX, mouseY, partialTicks);
        this.renderHoveredTooltip(matrixStack, mouseX, mouseY);
        for(int i = 0; i < this.buttons.size(); ++i)
        {
            this.buttons.get(i).render(matrixStack,mouseX,mouseY,partialTicks);
        }


    }



    @Override
    protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y)
    {


        RenderSystem.color4f(1f,1f,1f,1f);
        this.minecraft.getTextureManager().bindTexture(GUI);
        int i = this.guiLeft;
        int j = this.guiTop;
        this.matrixStack = matrixStack;
        this.j= j;
        this.i = i;
        this.blit(matrixStack, i,j,0,0,this.xSize, this.ySize);

        if(false)
        {
            /*this.blit(matrixStack, i+55,j+13,183,2,28,0);//Water-emty
            this.blit(matrixStack, i+55,j+13,183,2,28,3);//Water-1
            this.blit(matrixStack, i+55,j+13,183,2,38,5);//Water-2
            this.blit(matrixStack, i+55,j+13,183,2,48,5);//Water-3
            this.blit(matrixStack, i+55,j+13,183,2,64,12);//Water-4
            this.blit(matrixStack, i+55,j+13,183,2,66,21);//Water-Full*/



        }





    }


   /* protected void actionPerformed(Button button) {
        ExpandedIndustry.LOGGER.log(Level.DEBUG, "Button clicked");
        if(button instanceof ImageButton) {
            ImageButton lb = (ImageButton)button;
            EnumAcceptType t = lb.cycleType();
            tileEntity.setEnumType(t);
            PacketHandler.sendToServer(new ToServerFilterClick(0, tileEntity.getPos(), t.ordinal()));
        }
    }*/


}

 

Link to comment
Share on other sites

4 hours ago, TheTrueSCP said:
new ToServerFilterCheck(pubTile.getPos())

  Cough.

On 10/23/2021 at 7:01 AM, diesieben07 said:

The block position is also known on the server, sending it again only allows for cheats (if you don't validate it on the server, at which point you might as well just not send it at all).

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Container Registration

package net.the_goldbeards.lootdebugs.init;

import net.minecraft.inventory.container.ContainerType;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.extensions.IForgeContainerType;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.the_goldbeards.lootdebugs.LootDebugsMain;
import net.the_goldbeards.lootdebugs.container.PubContainer;

public class ModContainers
{
    public static DeferredRegister<ContainerType<?>> CONTAINERS
            = DeferredRegister.create(ForgeRegistries.CONTAINERS, LootDebugsMain.MOD_ID);

    public static final RegistryObject<ContainerType<PubContainer>> PUB
            =CONTAINERS.register("pub",
            () -> IForgeContainerType.create(((windowId, inv, data) -> {
                BlockPos pos = data.readBlockPos();
                World world = inv.player.getEntityWorld();

                return new PubContainer(windowId,world, pos, inv,inv.player);
            })));


    public static void register(IEventBus eventBus)
    {
        CONTAINERS.register(eventBus);
    }
}

PubContainer

package net.the_goldbeards.lootdebugs.container;

import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IWorldPosCallable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;
import net.minecraftforge.items.wrapper.InvWrapper;
import net.the_goldbeards.lootdebugs.init.ModBlocks;
import net.the_goldbeards.lootdebugs.init.ModContainers;
import net.the_goldbeards.lootdebugs.tileentity.PubTile;

public class PubContainer extends Container
{


    public final TileEntity tileEntity;
    private final PlayerEntity playerEntity;
    private final IItemHandler playerInventory;
    private int getBrewingState = 0;



    public PubContainer(int windowid, World world, BlockPos pos, PlayerInventory playerInventory, PlayerEntity player) {
        super(ModContainers.PUB.get(), windowid);
        this.tileEntity = world.getTileEntity(pos);
        playerEntity = player;
        this.playerInventory = new InvWrapper(playerInventory);

        layoutPlayerInventorySlots(8, 86);

        if(tileEntity != null)
        {
            tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h ->
            {
                addSlot(new SlotItemHandler(h, 0,80,8));

                addSlot(new SlotItemHandler(h, 1,48,35));

                addSlot(new SlotItemHandler(h, 2,69,35));

                addSlot(new SlotItemHandler(h, 3,90,35));

                addSlot(new SlotItemHandler(h, 4,111,35));

                addSlot(new SlotItemHandler(h, 5,80,65));
            });
        }


    }

    @Override
    public boolean canInteractWith(PlayerEntity playerIn) {
        return isWithinUsableDistance(IWorldPosCallable.of(tileEntity.getWorld(), tileEntity.getPos()),
                playerIn, ModBlocks.PUB.get());
    }

    public boolean point()
    {
        return true;
    }

    private int addSlotRange(IItemHandler handler, int index, int x, int y, int amount, int dx) {
        for (int i = 0; i < amount; i++) {
            addSlot(new SlotItemHandler(handler, index, x, y));
            x += dx;
            index++;
        }

        return index;
    }

    private int addSlotBox(IItemHandler handler, int index, int x, int y, int horAmount, int dx, int verAmount, int dy) {
        for (int j = 0; j < verAmount; j++) {
            index = addSlotRange(handler, index, x, y, horAmount, dx);
            y += dy;
        }

        return index;
    }

    private void layoutPlayerInventorySlots(int leftCol, int topRow) {
        addSlotBox(playerInventory, 9, leftCol, topRow, 9, 18, 3, 18);

        topRow += 58;
        addSlotRange(playerInventory, 0, leftCol, topRow, 9, 18);
    }


    private static final int HOTBAR_SLOT_COUNT = 9;
    private static final int PLAYER_INVENTORY_ROW_COUNT = 3;
    private static final int PLAYER_INVENTORY_COLUMN_COUNT = 9;
    private static final int PLAYER_INVENTORY_SLOT_COUNT = PLAYER_INVENTORY_COLUMN_COUNT * PLAYER_INVENTORY_ROW_COUNT;
    private static final int VANILLA_SLOT_COUNT = HOTBAR_SLOT_COUNT + PLAYER_INVENTORY_SLOT_COUNT;
    private static final int VANILLA_FIRST_SLOT_INDEX = 0;
    private static final int TE_INVENTORY_FIRST_SLOT_INDEX = VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT;
    private static final int TE_INVENTORY_SLOT_COUNT = 2;  // must match TileEntityInventoryBasic.NUMBER_OF_SLOTS

    @Override
    public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) {
        Slot sourceSlot = inventorySlots.get(index);
        if (sourceSlot == null || !sourceSlot.getHasStack()) return ItemStack.EMPTY;  //EMPTY_ITEM
        ItemStack sourceStack = sourceSlot.getStack();
        ItemStack copyOfSourceStack = sourceStack.copy();
        
        if (index < VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT) {
            if (!mergeItemStack(sourceStack, TE_INVENTORY_FIRST_SLOT_INDEX, TE_INVENTORY_FIRST_SLOT_INDEX
                    + TE_INVENTORY_SLOT_COUNT, false)) {
                return ItemStack.EMPTY;  // EMPTY_ITEM
            }
        } else if (index < TE_INVENTORY_FIRST_SLOT_INDEX + TE_INVENTORY_SLOT_COUNT) {
            if (!mergeItemStack(sourceStack, VANILLA_FIRST_SLOT_INDEX, VANILLA_FIRST_SLOT_INDEX + VANILLA_SLOT_COUNT, false)) {
                return ItemStack.EMPTY;
            }
        } else {
            System.out.println("Invalid slotIndex:" + index);
            return ItemStack.EMPTY;
        }
        if (sourceStack.getCount() == 0) {
            sourceSlot.putStack(ItemStack.EMPTY);
        } else {
            sourceSlot.onSlotChanged();
        }
        sourceSlot.onTake(playerEntity, sourceStack);
        return copyOfSourceStack;
    }





}

 

Link to comment
Share on other sites

ToServerCheck

package net.the_goldbeards.lootdebugs.Server;

import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.network.NetworkEvent;
import net.the_goldbeards.lootdebugs.tileentity.PubTile;

import java.util.function.Supplier;

public final class ToServerCheck {

    private BlockPos pos;




    public ToServerCheck(BlockPos pos) {

        this.pos = pos;


    }

    public static void encode(ToServerCheck msg, PacketBuffer buf) {

        buf.writeInt(msg.pos.getX());
        buf.writeInt(msg.pos.getY());
        buf.writeInt(msg.pos.getZ());

    }

    public static ToServerCheck decode(PacketBuffer buf) {

        int posx = buf.readInt();
        int posy = buf.readInt();
        int posz = buf.readInt();

        BlockPos p = new BlockPos(posx,posy,posz);

        return new ToServerCheck(p);
    }

    public static class Handler {
        public static void handle(final ToServerCheck message, Supplier<NetworkEvent.Context> ctx) {
            ctx.get().enqueueWork(() -> {
                TileEntity te = ctx.get().getSender().getServerWorld().getTileEntity(message.pos);
                if(te instanceof PubTile) {
                    //System.out.println("TE updated");
                    ((PubTile)te).brewBlackout();
                }
                else {
                    //System.out.println("No TE!?");
                }
            });
        }
    }
}

PacketHandler

package net.the_goldbeards.lootdebugs.Server;

import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.util.FakePlayer;
import net.minecraftforge.fml.network.NetworkDirection;
import net.minecraftforge.fml.network.NetworkRegistry;
import net.minecraftforge.fml.network.simple.SimpleChannel;
import net.the_goldbeards.lootdebugs.LootDebugsMain;

public class PacketHandler {
    public static class EffectsIDs {
        public static int PROSPECTING = 1;
    }
    private static final String PROTOCOL_VERSION = Integer.toString(1);
    private static final SimpleChannel HANDLER = NetworkRegistry.ChannelBuilder
            .named(new ResourceLocation(LootDebugsMain.MOD_ID, "main_channel"))
            .clientAcceptedVersions(PROTOCOL_VERSION::equals)
            .serverAcceptedVersions(PROTOCOL_VERSION::equals)
            .networkProtocolVersion(() -> PROTOCOL_VERSION)
            .simpleChannel();



	/*
	public static void sendNonLocal(IMessage msg, EntityPlayerMP player)
	{
		if (player.server.isDedicatedServer() || !player.getName().equals(player.server.getServerOwner()))
		{
			HANDLER.sendTo(msg, player.connection.netManager, NetworkDirection.PLAY_TO_CLIENT);
		}
	}*/

    /**
     * Sends a packet to the server.<br>
     * Must be called Client side.
     */
    public static <MSG> void sendToServer(MSG msg)
    {
        HANDLER.sendToServer(msg);
    }

    /**
     * Send a packet to a specific player.<br>
     * Must be called Server side.
     */
    public static <MSG> void sendTo(MSG msg, ServerPlayerEntity player)
    {
        if (!(player instanceof FakePlayer))
        {
            HANDLER.sendTo(msg, player.connection.netManager, NetworkDirection.PLAY_TO_CLIENT);
        }
    }
}

PubScreen

package net.the_goldbeards.lootdebugs.screen;

import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
import net.minecraft.client.gui.widget.button.ImageButton;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.the_goldbeards.lootdebugs.LootDebugsMain;
import net.the_goldbeards.lootdebugs.Server.PacketHandler;
import net.the_goldbeards.lootdebugs.Server.ToServerCheck;
import net.the_goldbeards.lootdebugs.container.PubContainer;
import net.the_goldbeards.lootdebugs.tileentity.PubTile;


public class PubScreen extends ContainerScreen<PubContainer>
{
   PubTile pubTile;
    private MatrixStack matrixStack;
    private static int i;
    private static int j;
    private static final ResourceLocation GUI = new ResourceLocation(LootDebugsMain.MOD_ID, "textures/gui/pub_gui.png");
    private static final ResourceLocation CONTINUE_BUTTON = new ResourceLocation(LootDebugsMain.MOD_ID, "textures/gui/recipe_button.png");



    public PubScreen(PubContainer screenContainer, PlayerInventory inv, ITextComponent titleIn) {
        super(screenContainer, inv, titleIn);
        pubTile = (PubTile)screenContainer.tileEntity;
     //   pubTile = (PubTile)screenContainer.
    }

    @Override
    protected void init() {
        super.init();
        this.addButton(new ImageButton(this.guiLeft + 140, this.height / 2 - 30, 20, 18, 0, 0, 19, CONTINUE_BUTTON, (button) -> {
            System.out.println("BUtton PReeess" +
                    "ssd");
            //PacketHandler.CHANNEL.sendToServer();
System.out.println("hi");


                PacketHandler.sendToServer(new ToServerCheck(pubTile.getPos()));

           ((ImageButton)button).setPosition(this.guiLeft + 140, this.height / 2 - 30);
        }));
        this.titleX = (this.xSize - this.font.getStringPropertyWidth(this.title)) / 2;
    }


    @Override
    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        this.renderBackground(matrixStack);
        super.render(matrixStack, mouseX, mouseY, partialTicks);
        this.renderHoveredTooltip(matrixStack, mouseX, mouseY);
        for(int i = 0; i < this.buttons.size(); ++i)
        {
            this.buttons.get(i).render(matrixStack,mouseX,mouseY,partialTicks);
        }


    }



    @Override
    protected void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, float partialTicks, int x, int y)
    {


        RenderSystem.color4f(1f,1f,1f,1f);
        this.minecraft.getTextureManager().bindTexture(GUI);
        int i = this.guiLeft;
        int j = this.guiTop;
        this.matrixStack = matrixStack;
        this.j= j;
        this.i = i;
        this.blit(matrixStack, i,j,0,0,this.xSize, this.ySize);

        if(false)
        {
            /*this.blit(matrixStack, i+55,j+13,183,2,28,0);//Water-emty
            this.blit(matrixStack, i+55,j+13,183,2,28,3);//Water-1
            this.blit(matrixStack, i+55,j+13,183,2,38,5);//Water-2
            this.blit(matrixStack, i+55,j+13,183,2,48,5);//Water-3
            this.blit(matrixStack, i+55,j+13,183,2,64,12);//Water-4
            this.blit(matrixStack, i+55,j+13,183,2,66,21);//Water-Full*/



        }





    }


   /* protected void actionPerformed(Button button) {
        ExpandedIndustry.LOGGER.log(Level.DEBUG, "Button clicked");
        if(button instanceof ImageButton) {
            ImageButton lb = (ImageButton)button;
            EnumAcceptType t = lb.cycleType();
            tileEntity.setEnumType(t);
            PacketHandler.sendToServer(new ToServerFilterClick(0, tileEntity.getPos(), t.ordinal()));
        }
    }*/


}

 

Link to comment
Share on other sites

What do you mean with screen Factory?
Here is the Error:

[17:27:16] [Render thread/FATAL] [minecraft/Minecraft]: Reported exception thrown!
net.minecraft.crash.ReportedException: mouseClicked event handler
	at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:434) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.mouseButtonCallback(MouseHelper.java:90) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.lambda$null$4(MouseHelper.java:191) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.util.concurrent.ThreadTaskExecutor.execute(ThreadTaskExecutor.java:86) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B}
	at net.minecraft.client.MouseHelper.lambda$registerCallbacks$5(MouseHelper.java:190) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
	at org.lwjgl.system.JNI.invokeV(Native Method) ~[lwjgl-3.2.2.jar:build 10] {}
	at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) ~[lwjgl-glfw-3.2.2.jar:build 10] {}
	at com.mojang.blaze3d.systems.RenderSystem.flipFrame(RenderSystem.java:89) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.MainWindow.flipFrame(MainWindow.java:305) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1022) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-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.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202] {}
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_202] {}
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_202] {}
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202] {}
	at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-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:108) [forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {}
Caused by: java.lang.ExceptionInInitializerError
	at net.the_goldbeards.lootdebugs.screen.PubScreen.lambda$init$0(PubScreen.java:44) ~[main/:?] {re:classloading}
	at net.minecraft.client.gui.widget.button.Button.onPress(Button.java:26) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.widget.button.AbstractButton.onClick(AbstractButton.java:18) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.widget.Widget.mouseClicked(Widget.java:136) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.INestedGuiEventHandler.mouseClicked(INestedGuiEventHandler.java:31) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.mouseClicked(ContainerScreen.java:299) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:92) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:427) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	... 23 more
Caused by: java.lang.IllegalArgumentException: Registration of network channels is locked
	at net.minecraftforge.fml.network.NetworkRegistry.createInstance(NetworkRegistry.java:150) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraftforge.fml.network.NetworkRegistry.access$000(NetworkRegistry.java:49) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraftforge.fml.network.NetworkRegistry$ChannelBuilder.createNetworkInstance(NetworkRegistry.java:420) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
	at net.minecraftforge.fml.network.NetworkRegistry$ChannelBuilder.simpleChannel(NetworkRegistry.java:429) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading}
	at net.the_goldbeards.lootdebugs.Server.PacketHandler.<clinit>(PacketHandler.java:21) ~[main/:?] {re:classloading}
	at net.the_goldbeards.lootdebugs.screen.PubScreen.lambda$init$0(PubScreen.java:44) ~[main/:?] {re:classloading}
	at net.minecraft.client.gui.widget.button.Button.onPress(Button.java:26) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.widget.button.AbstractButton.onClick(AbstractButton.java:18) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.widget.Widget.mouseClicked(Widget.java:136) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.INestedGuiEventHandler.mouseClicked(INestedGuiEventHandler.java:31) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.inventory.ContainerScreen.mouseClicked(ContainerScreen.java:299) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
	at net.minecraft.client.MouseHelper.lambda$mouseButtonCallback$0(MouseHelper.java:92) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.client.gui.screen.Screen.wrapScreenError(Screen.java:427) ~[forge-1.16.5-36.2.8_mapped_snapshot_20210309-1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
	... 23 more
[17:27:17] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:130]: ---- Minecraft Crash Report ----
// Hi. I'm Minecraft, and I'm a crashaholic.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Tried that, The following crash occurred.   ---- Minecraft Crash Report ---- // Don't do that. Time: 25/1/22, 6:27 pm Description: Exception in server tick loop net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file forge-server.toml of type SERVER for modid forge at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:61) ~[fmlcore-1.18.1-39.0.45.jar%2365!/:?] {} at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:74) ~[fmlcore-1.18.1-39.0.45.jar%2365!/:?] {} at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:64) ~[fmlcore-1.18.1-39.0.45.jar%2365!/:?] {} at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {} at java.util.Collections$SynchronizedCollection.forEach(Collections.java:2131) ~[?:?] {} at net.minecraftforge.fml.config.ConfigTracker.loadConfigs(ConfigTracker.java:64) ~[fmlcore-1.18.1-39.0.45.jar%2365!/:?] {} at net.minecraftforge.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:94) ~[forge-1.18.1-39.0.45-universal.jar%2368!/:?] {re:classloading} at net.minecraft.server.dedicated.DedicatedServer.m_7038_(DedicatedServer.java:173) ~[server-1.18.1-20211210.034407-srg.jar%2364!/:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:644) ~[server-1.18.1-20211210.034407-srg.jar%2364!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:balm.mixins.json:MinecraftServerAccessor,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A} at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.18.1-20211210.034407-srg.jar%2364!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:balm.mixins.json:MinecraftServerAccessor,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A} at java.lang.Thread.run(Thread.java:833) [?:?] {} Caused by: com.electronwill.nightconfig.core.io.ParsingException: Not enough data available at com.electronwill.nightconfig.core.io.ParsingException.notEnoughData(ParsingException.java:22) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.ReaderInput.directReadChar(ReaderInput.java:36) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.AbstractInput.readChar(AbstractInput.java:49) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.AbstractInput.readCharsUntil(AbstractInput.java:123) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:166) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TableParser.parseDottedKey(TableParser.java:145) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:55) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:44) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.load(WriteSyncFileConfig.java:73) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.load(AutosaveCommentedFileConfig.java:85) ~[core-3.6.4.jar%237!/:?] {} at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:57) ~[fmlcore-1.18.1-39.0.45.jar%2365!/:?] {} ... 10 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.18.1 Minecraft Version ID: 1.18.1 Operating System: Windows 10 (amd64) version 10.0 Java Version: 17.0.2, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode, sharing), Oracle Corporation Memory: 5808388224 bytes (5539 MiB) / 7612661760 bytes (7260 MiB) up to 8589934592 bytes (8192 MiB) CPUs: 16 Processor Vendor: AuthenticAMD Processor Name: AMD Ryzen 7 2700 Eight-Core Processor Identifier: AuthenticAMD Family 23 Model 8 Stepping 2 Microarchitecture: Zen+ Frequency (GHz): 3.20 Number of physical packages: 1 Number of physical CPUs: 8 Number of logical CPUs: 16 Graphics card #0 name: NVIDIA GeForce GTX 1660 Ti Graphics card #0 vendor: NVIDIA (0x10de) Graphics card #0 VRAM (MB): 4095.00 Graphics card #0 deviceId: 0x2182 Graphics card #0 versionInfo: DriverVersion=30.0.14.7111 Memory slot #0 capacity (MB): 16384.00 Memory slot #0 clockSpeed (GHz): 2.40 Memory slot #0 type: DDR4 Memory slot #1 capacity (MB): 16384.00 Memory slot #1 clockSpeed (GHz): 2.40 Memory slot #1 type: DDR4 Virtual memory max (MB): 34765.36 Virtual memory used (MB): 19390.98 Swap memory total (MB): 2048.00 Swap memory used (MB): 0.00 JVM Flags: 2 total; -Xmx8G -Xms7G Server Running: true Player Count: 0 / 20; [] Data Packs: vanilla, mod:mcwbridges, mod:enchdesc, mod:swingthroughgrass, mod:jei (incompatible), mod:flywheel, mod:patchouli, mod:create, mod:createdeco (incompatible), mod:clumps (incompatible), mod:cookingforblockheads, mod:storagedrawers (incompatible), mod:naturescompass (incompatible), mod:tombstone, mod:naturesaura (incompatible), mod:balm (incompatible), mod:jeresources, mod:forge, mod:aquaculture (incompatible), mod:cosmeticarmorreworked (incompatible), mod:valhelsia_core, mod:forbidden_arcanus, mod:createaddition (incompatible), mod:betteradvancements, mod:starlight, mod:mahoutsukai Is Modded: Definitely; Server brand changed to 'forge' Type: Dedicated Server (map_server.txt) ModLauncher: 9.1.0+9.1.0+main.6690ee51 ModLauncher launch target: forgeserver ModLauncher naming: srg ModLauncher services: mixin PLUGINSERVICE eventbus PLUGINSERVICE object_holder_definalize PLUGINSERVICE runtime_enum_extender PLUGINSERVICE capability_token_subclass PLUGINSERVICE accesstransformer PLUGINSERVICE runtimedistcleaner PLUGINSERVICE mixin TRANSFORMATIONSERVICE fml TRANSFORMATIONSERVICE FML Language Providers: minecraft@1.0 javafml@null Mod List: server-1.18.1-20211210.034407-srg.jar |Minecraft |minecraft |1.18.1 |DONE |Manifest: NOSIGNATURE mcw-bridges-2.0.1-mc1.18.1.jar |Macaw's Bridges |mcwbridges |2.0.1 |DONE |Manifest: NOSIGNATURE EnchantmentDescriptions-Forge-1.18.1-9.0.9.jar |EnchantmentDescriptions |enchdesc |9.0.9 |DONE |Manifest: NOSIGNATURE swingthroughgrass-1.18.1-1.8.0.jar |SwingThroughGrass |swingthroughgrass |1.18.1-1.8.0 |DONE |Manifest: NOSIGNATURE jei-1.18.1-9.2.1.69.jar |Just Enough Items |jei |9.2.1.69 |DONE |Manifest: NOSIGNATURE flywheel-forge-1.18-0.5.1.jar |Flywheel |flywheel |1.18-0.5.1 |DONE |Manifest: NOSIGNATURE Patchouli-1.18.1-64.jar |Patchouli |patchouli |1.18.1-64 |DONE |Manifest: NOSIGNATURE create-mc1.18.1_v0.4c.jar |Create |create |0.4c |DONE |Manifest: NOSIGNATURE createdeco-1.2.3-1.18.jar |Create Deco |createdeco |1.2.3-1.18 |DONE |Manifest: NOSIGNATURE Clumps-forge-1.18.1-8.0.4.jar |Clumps |clumps |8.0.4 |DONE |Manifest: NOSIGNATURE cookingforblockheads-forge-1.18.1-11.1.0.jar |CookingForBlockheads |cookingforblockheads |11.1.0 |DONE |Manifest: NOSIGNATURE StorageDrawers-1.18.1-10.1.1.jar |Storage Drawers |storagedrawers |10.1.1 |DONE |Manifest: NOSIGNATURE NaturesCompass-1.18.1-1.9.4-forge.jar |Nature's Compass |naturescompass |1.18.1-1.9.4-forge |DONE |Manifest: NOSIGNATURE tombstone-7.3.5-1.18.jar |Corail Tombstone |tombstone |7.3.5 |DONE |Manifest: NOSIGNATURE NaturesAura-35.4.jar |Nature's Aura |naturesaura |35.4 |DONE |Manifest: NOSIGNATURE starlight-1.0.0+forge.8f9b922.Aeiou.jar |Starlight |starlight |1.0.0+forge.4fd2e63 |DONE |Manifest: NOSIGNATURE mahoutsukai-1.18.1-v1.34.0.jar |Mahou Tsukai |mahoutsukai |1.18.1-v1.34.0 |DONE |Manifest: NOSIGNATURE balm-2.4.1+0.jar |Balm |balm |2.4.1+0 |DONE |Manifest: NOSIGNATURE JustEnoughResources-1.18.1-0.13.1.141.jar |Just Enough Resources |jeresources |0.13.1.141 |DONE |Manifest: NOSIGNATURE forge-1.18.1-39.0.45-universal.jar |Forge |forge |39.0.45 |DONE |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90 Aquaculture-1.18.1-2.3.2.jar |Aquaculture 2 |aquaculture |1.18.1-2.3.2 |DONE |Manifest: NOSIGNATURE CosmeticArmorReworked-1.18.1-v1a.jar |CosmeticArmorReworked |cosmeticarmorreworked |1.18.1-v1a |DONE |Manifest: 5e:ed:25:99:e4:44:14:c0:dd:89:c1:a9:4c:10:b5:0d:e4:b1:52:50:45:82:13:d8:d0:32:89:67:56:57:01:53 valhelsia_core-1.18.1-0.3.2.jar |Valhelsia Core |valhelsia_core |1.18.1-0.3.2 |DONE |Manifest: NOSIGNATURE forbidden_arcanus-1.18.1-2.0.2.jar |Forbidden & Arcanus |forbidden_arcanus |1.18.1-2.0.2 |DONE |Manifest: NOSIGNATURE createaddition-1.18.1-20220111b.jar |Create Crafts & Additions |createaddition |1.18.1-20220111b |DONE |Manifest: NOSIGNATURE BetterAdvancements-1.18.1-0.1.2.122.jar |Better Advancements |betteradvancements |0.1.2.122 |DONE |Manifest: NOSIGNATURE Crash Report UUID: 14317a4f-c9f8-4bef-a141-d4ff36dd2b59 FML: 39.0 Forge: net.minecraftforge:39.0.45    
    • this there anyway i can fix it until the update? like could i delete the chunk its in ?
    • Delete this server config file if you have not modified it.
    • Yesterday our server crashed with little notice. Below are the crash logs. Anyone able to help out?   ---- Minecraft Crash Report ---- // Shall we play a game? Time: 25/1/22, 6:07 pm Description: Exception in server tick loop net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException: Failed loading config file travelersbackpack-server.toml of type SERVER for modid travelersbackpack at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:61) ~[fmlcore-1.18.1-39.0.45.jar%2366!/:?] {} at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:74) ~[fmlcore-1.18.1-39.0.45.jar%2366!/:?] {} at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:64) ~[fmlcore-1.18.1-39.0.45.jar%2366!/:?] {} at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {} at java.util.Collections$SynchronizedCollection.forEach(Collections.java:2131) ~[?:?] {} at net.minecraftforge.fml.config.ConfigTracker.loadConfigs(ConfigTracker.java:64) ~[fmlcore-1.18.1-39.0.45.jar%2366!/:?] {} at net.minecraftforge.server.ServerLifecycleHooks.handleServerAboutToStart(ServerLifecycleHooks.java:94) ~[forge-1.18.1-39.0.45-universal.jar%2369!/:?] {re:classloading} at net.minecraft.server.dedicated.DedicatedServer.m_7038_(DedicatedServer.java:173) ~[server-1.18.1-20211210.034407-srg.jar%2365!/:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:644) ~[server-1.18.1-20211210.034407-srg.jar%2365!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:balm.mixins.json:MinecraftServerAccessor,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A} at net.minecraft.server.MinecraftServer.m_177918_(MinecraftServer.java:258) ~[server-1.18.1-20211210.034407-srg.jar%2365!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:balm.mixins.json:MinecraftServerAccessor,pl:mixin:APP:balm.mixins.json:MinecraftServerMixin,pl:mixin:A} at java.lang.Thread.run(Thread.java:833) [?:?] {} Caused by: com.electronwill.nightconfig.core.io.ParsingException: Not enough data available at com.electronwill.nightconfig.core.io.ParsingException.notEnoughData(ParsingException.java:22) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.ReaderInput.directReadChar(ReaderInput.java:36) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.AbstractInput.readChar(AbstractInput.java:49) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.AbstractInput.readCharsUntil(AbstractInput.java:123) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:166) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TableParser.parseDottedKey(TableParser.java:145) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TableParser.parseNormal(TableParser.java:55) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:44) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37) ~[toml-3.6.4.jar%238!/:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.file.WriteSyncFileConfig.load(WriteSyncFileConfig.java:73) ~[core-3.6.4.jar%237!/:?] {} at com.electronwill.nightconfig.core.file.AutosaveCommentedFileConfig.load(AutosaveCommentedFileConfig.java:85) ~[core-3.6.4.jar%237!/:?] {} at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:57) ~[fmlcore-1.18.1-39.0.45.jar%2366!/:?] {} ... 10 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.18.1 Minecraft Version ID: 1.18.1 Operating System: Windows 10 (amd64) version 10.0 Java Version: 17.0.2, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode, sharing), Oracle Corporation Memory: 4789453312 bytes (4567 MiB) / 7662993408 bytes (7308 MiB) up to 8589934592 bytes (8192 MiB) CPUs: 16 Processor Vendor: AuthenticAMD Processor Name: AMD Ryzen 7 2700 Eight-Core Processor Identifier: AuthenticAMD Family 23 Model 8 Stepping 2 Microarchitecture: Zen+ Frequency (GHz): 3.20 Number of physical packages: 1 Number of physical CPUs: 8 Number of logical CPUs: 16 Graphics card #0 name: NVIDIA GeForce GTX 1660 Ti Graphics card #0 vendor: NVIDIA (0x10de) Graphics card #0 VRAM (MB): 4095.00 Graphics card #0 deviceId: 0x2182 Graphics card #0 versionInfo: DriverVersion=30.0.14.7111 Memory slot #0 capacity (MB): 16384.00 Memory slot #0 clockSpeed (GHz): 2.40 Memory slot #0 type: DDR4 Memory slot #1 capacity (MB): 16384.00 Memory slot #1 clockSpeed (GHz): 2.40 Memory slot #1 type: DDR4 Virtual memory max (MB): 34765.36 Virtual memory used (MB): 17914.00 Swap memory total (MB): 2048.00 Swap memory used (MB): 0.00 JVM Flags: 2 total; -Xmx8G -Xms7G Server Running: true Player Count: 0 / 20; [] Data Packs: vanilla, mod:mcwbridges, mod:enchdesc, mod:swingthroughgrass, mod:jei (incompatible), mod:flywheel, mod:patchouli, mod:create, mod:createdeco (incompatible), mod:clumps (incompatible), mod:cookingforblockheads, mod:storagedrawers (incompatible), mod:naturescompass (incompatible), mod:tombstone, mod:naturesaura (incompatible), mod:balm (incompatible), mod:jeresources, mod:forge, mod:aquaculture (incompatible), mod:cosmeticarmorreworked (incompatible), mod:valhelsia_core, mod:forbidden_arcanus, mod:createaddition (incompatible), mod:betteradvancements, mod:starlight, mod:mahoutsukai, mod:travelersbackpack Is Modded: Definitely; Server brand changed to 'forge' Type: Dedicated Server (map_server.txt) ModLauncher: 9.1.0+9.1.0+main.6690ee51 ModLauncher launch target: forgeserver ModLauncher naming: srg ModLauncher services: mixin PLUGINSERVICE eventbus PLUGINSERVICE object_holder_definalize PLUGINSERVICE runtime_enum_extender PLUGINSERVICE capability_token_subclass PLUGINSERVICE accesstransformer PLUGINSERVICE runtimedistcleaner PLUGINSERVICE mixin TRANSFORMATIONSERVICE fml TRANSFORMATIONSERVICE FML Language Providers: minecraft@1.0 javafml@null Mod List: server-1.18.1-20211210.034407-srg.jar |Minecraft |minecraft |1.18.1 |DONE |Manifest: NOSIGNATURE mcw-bridges-2.0.1-mc1.18.1.jar |Macaw's Bridges |mcwbridges |2.0.1 |DONE |Manifest: NOSIGNATURE EnchantmentDescriptions-Forge-1.18.1-9.0.9.jar |EnchantmentDescriptions |enchdesc |9.0.9 |DONE |Manifest: NOSIGNATURE swingthroughgrass-1.18.1-1.8.0.jar |SwingThroughGrass |swingthroughgrass |1.18.1-1.8.0 |DONE |Manifest: NOSIGNATURE jei-1.18.1-9.2.1.69.jar |Just Enough Items |jei |9.2.1.69 |DONE |Manifest: NOSIGNATURE flywheel-forge-1.18-0.5.1.jar |Flywheel |flywheel |1.18-0.5.1 |DONE |Manifest: NOSIGNATURE Patchouli-1.18.1-64.jar |Patchouli |patchouli |1.18.1-64 |DONE |Manifest: NOSIGNATURE create-mc1.18.1_v0.4c.jar |Create |create |0.4c |DONE |Manifest: NOSIGNATURE createdeco-1.2.3-1.18.jar |Create Deco |createdeco |1.2.3-1.18 |DONE |Manifest: NOSIGNATURE Clumps-forge-1.18.1-8.0.4.jar |Clumps |clumps |8.0.4 |DONE |Manifest: NOSIGNATURE cookingforblockheads-forge-1.18.1-11.1.0.jar |CookingForBlockheads |cookingforblockheads |11.1.0 |DONE |Manifest: NOSIGNATURE TravelersBackpack-1.18.1-7.0.1.jar |Traveler's Backpack |travelersbackpack |7.0.1 |DONE |Manifest: NOSIGNATURE StorageDrawers-1.18.1-10.1.1.jar |Storage Drawers |storagedrawers |10.1.1 |DONE |Manifest: NOSIGNATURE NaturesCompass-1.18.1-1.9.4-forge.jar |Nature's Compass |naturescompass |1.18.1-1.9.4-forge |DONE |Manifest: NOSIGNATURE tombstone-7.3.5-1.18.jar |Corail Tombstone |tombstone |7.3.5 |DONE |Manifest: NOSIGNATURE NaturesAura-35.4.jar |Nature's Aura |naturesaura |35.4 |DONE |Manifest: NOSIGNATURE starlight-1.0.0+forge.8f9b922.Aeiou.jar |Starlight |starlight |1.0.0+forge.4fd2e63 |DONE |Manifest: NOSIGNATURE mahoutsukai-1.18.1-v1.34.0.jar |Mahou Tsukai |mahoutsukai |1.18.1-v1.34.0 |DONE |Manifest: NOSIGNATURE balm-2.4.1+0.jar |Balm |balm |2.4.1+0 |DONE |Manifest: NOSIGNATURE JustEnoughResources-1.18.1-0.13.1.141.jar |Just Enough Resources |jeresources |0.13.1.141 |DONE |Manifest: NOSIGNATURE forge-1.18.1-39.0.45-universal.jar |Forge |forge |39.0.45 |DONE |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90 Aquaculture-1.18.1-2.3.2.jar |Aquaculture 2 |aquaculture |1.18.1-2.3.2 |DONE |Manifest: NOSIGNATURE CosmeticArmorReworked-1.18.1-v1a.jar |CosmeticArmorReworked |cosmeticarmorreworked |1.18.1-v1a |DONE |Manifest: 5e:ed:25:99:e4:44:14:c0:dd:89:c1:a9:4c:10:b5:0d:e4:b1:52:50:45:82:13:d8:d0:32:89:67:56:57:01:53 valhelsia_core-1.18.1-0.3.2.jar |Valhelsia Core |valhelsia_core |1.18.1-0.3.2 |DONE |Manifest: NOSIGNATURE forbidden_arcanus-1.18.1-2.0.2.jar |Forbidden & Arcanus |forbidden_arcanus |1.18.1-2.0.2 |DONE |Manifest: NOSIGNATURE createaddition-1.18.1-20220111b.jar |Create Crafts & Additions |createaddition |1.18.1-20220111b |DONE |Manifest: NOSIGNATURE BetterAdvancements-1.18.1-0.1.2.122.jar |Better Advancements |betteradvancements |0.1.2.122 |DONE |Manifest: NOSIGNATURE Crash Report UUID: 15ab4e22-c0b0-4e5f-8768-6c83dd01c93f FML: 39.0 Forge: net.minecraftforge:39.0.45  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.