Jump to content

Recommended Posts

Posted

Hi,

 

I'm having trouble with opening my GUI, as the tile entity (extending ITickableTileEntity, among others) will erase all stored variables, retrieved from NBT. So this isn't a problem with NBT. Also, this is a 1.15 problem.

I've tracked down the exact time that the variables reset, and it's when the GUI's screen is opened, createTileEntity() is triggered in the Block class, recreating the tile entity and overwriting the variables.

Is there a way to stop this?

 

Here's a snippet from my block's class.

@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
  return TileEntityTypes.TILE.get().create();
}

@Override
public boolean hasTileEntity(BlockState state) {
  return true;
}

 

Thanks for your help in advance, I'd be willing to send more code snippets and answer any questions.

Posted
  On 9/24/2020 at 10:07 PM, Jack Richard said:

I'm having trouble with opening my GUI, as the tile entity (extending ITickableTileEntity, among others) will erase all stored variables

Expand  

It's like there are two sides of the game that need to be synchronized, hmmmmmmmmmmmmm.

 

The client and server will not be synchronized under normal conditions, you must specify which variable you would like to sync and when (most likely in your container).

Posted
  On 9/24/2020 at 10:26 PM, ChampionAsh5357 said:

It's like there are two sides of the game that need to be synchronized, hmmmmmmmmmmmmm.

 

The client and server will not be synchronized under normal conditions, you must specify which variable you would like to sync and when (most likely in your container).

Expand  

Does it help to say when I add...

@Override
public void tick() {
	System.out.println(variable);
}

...I always get the result, whether or not world.isRemote()?

 

I use...

@Override
public CompoundNBT getUpdateTag() {
  CompoundNBT tagCompound = new CompoundNBT();
  tagCompound.putString("variable", variable);
  return tagCompound;
}

@Override
public void handleUpdateTag(CompoundNBT tag) {
  this.read(tag);
}

@Override
public void read(CompoundNBT compound)
{
  super.read(compound);
  this.inventory = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
  ItemStackHelper.loadAllItems(compound, this.inventory);
  setVariable(compound.getString("variable"));
}

@Override
public CompoundNBT write(CompoundNBT compound)
{
  super.write(compound);
  ItemStackHelper.saveAllItems(compound, this.inventory);
  compound.putString("variable", getVariable());

  return compound;
}

to synchronize the data.

 

Thanks.

Posted
  On 9/24/2020 at 11:11 PM, Jack Richard said:

this.inventory = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY); ItemStackHelper.loadAllItems(compound, this.inventory);

Expand  

This looks like copy and paste of an IInventory class, use the IItemHandler instead. You should not use the vanilla method to create your inventory.

 

  On 9/24/2020 at 11:11 PM, Jack Richard said:

@Override public CompoundNBT getUpdateTag() { CompoundNBT tagCompound = new CompoundNBT(); tagCompound.putString("variable", variable); return tagCompound; } @Override public void handleUpdateTag(CompoundNBT tag) { this.read(tag); }

Expand  

Ah yes, synchronization on block update. Something completely unnecessary when it comes to GUI. Those are synced through slots. This should only be used if you have a TER present.

  On 9/24/2020 at 11:11 PM, Jack Richard said:

...I always get the result, whether or not world.isRemote()?

Expand  

Then you fell into a trap of confirmation bias. Just because you get the same result doesn't mean it was synced correctly. It just means you probably executed the same code on both sides when it should only be on one and then synced.

Posted
  On 9/24/2020 at 11:37 PM, ChampionAsh5357 said:

Ah yes, synchronization on block update. Something completely unnecessary when it comes to GUI. Those are synced through slots. This should only be used if you have a TER present.

Then you fell into a trap of confirmation bias. Just because you get the same result doesn't mean it was synced correctly. It just means you probably executed the same code on both sides when it should only be on one and then synced.

Expand  

I forgot to mention I send Messages from the client to the server, so I am doing some syncing, I believe.

Posted
  On 9/24/2020 at 11:59 PM, Jack Richard said:

I forgot to mention I send Messages from the client to the server, so I am doing some syncing, I believe.

Expand  

Yes. Synchronization the wrong direction. Always good.

 

I doubt you need to synchronize from the client->server as this probably just uses a standard inventory and primitives.  In that case, you only need to sync from server->client. Which, you are still neglecting to listen and do.

 

Please show your entire tile entity, block, container, and screen code. I am curious on what you're doing and how you're doing it since I'm pretty sure it's some variation of vanilla code which will not work in most cases.

Posted
  On 9/25/2020 at 1:07 AM, ChampionAsh5357 said:

Yes. Synchronization the wrong direction. Always good.

 

I doubt you need to synchronize from the client->server as this probably just uses a standard inventory and primitives.  In that case, you only need to sync from server->client. Which, you are still neglecting to listen and do.

 

Please show your entire tile entity, block, container, and screen code. I am curious on what you're doing and how you're doing it since I'm pretty sure it's some variation of vanilla code which will not work in most cases.

Expand  
public class ServerContainer extends Container {

    public ServerTileEntity entity;

    public ServerContainer(final int windowId, final PlayerInventory playerInventory, final PacketBuffer data) {
        this(windowId, playerInventory, getTileEntity(playerInventory, data));
    }

    public ServerContainer(final int windowId, final PlayerInventory playerInventory,
                           final TileEntity tileEntity) {
        super(ContainerTypes.SERVER.get(), windowId);

        this.entity = (ServerTileEntity) tileEntity;

        int startX = 8;
        int startY = 84;
        int slotSizePlus2 = 18;

        for (int row = 0; row < 3; ++row) {
            for (int column = 0; column < 9; ++column) {
                this.addSlot(new Slot(playerInventory, 9 + (row * 9) + column, startX + (column * slotSizePlus2),
                        startY + (row * slotSizePlus2)));
            }
        }

        int hotbarY = 142;
        for (int column = 0; column < 9; ++column) {
            this.addSlot(new Slot(playerInventory, column, startX + (column * slotSizePlus2), hotbarY));
        }

        this.addSlot(new CustomSlot(entity, 0, 7, 35));
    }

    @Override
    public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) {
        ItemStack itemstack = ItemStack.EMPTY;
        Slot slot = this.inventorySlots.get(index);
        if (slot != null && slot.getHasStack()) {
            ItemStack itemstack1 = slot.getStack();
            itemstack = itemstack1.copy();
            if (index < 36) {
                if (!this.mergeItemStack(itemstack1, 36, this.inventorySlots.size(), true)) {
                    return ItemStack.EMPTY;
                }
            } else if (!this.mergeItemStack(itemstack1, 0, 36, false)) {
                return ItemStack.EMPTY;
            }

            if (itemstack1.isEmpty()) {
                slot.putStack(ItemStack.EMPTY);
            } else {
                slot.onSlotChanged();
            }
        }
        return itemstack;
    }

    @Override
    public boolean canInteractWith(PlayerEntity playerIn) {
        return true;
    }

    private static ServerTileEntity getTileEntity(final PlayerInventory playerInventory,
                                                 final PacketBuffer data) {
        Objects.requireNonNull(playerInventory, "playerInventory cannot be null");
        Objects.requireNonNull(data, "data cannot be null");
        final TileEntity tileAtPos = playerInventory.player.world.getTileEntity(data.readBlockPos());

        if (tileAtPos instanceof ServerTileEntity) {
            return (ServerTileEntity) tileAtPos;
        }
        throw new IllegalStateException("Tile entity is not correct! " + tileAtPos);
    }

}
@OnlyIn(Dist.CLIENT)
public class ServerScreen extends ContainerScreen<ServerContainer> {

    private static final ResourceLocation TEXTURES = new ResourceLocation("modid:textures/gui/server.png");
    private final PlayerInventory player;
    private ServerTileEntity entity;
    private TextFieldWidget carrierName;

    public ServerScreen(ServerContainer container, PlayerInventory player, ITextComponent title) {
        super(container, player, title);
        this.player = player;
        this.entity = getTileEntity(player, container);
        this.guiLeft = 0;
        this.guiTop = 0;
        this.xSize = 176;
        this.ySize = 166;
    }

    @Override
    protected void init() {
        super.init();

        int x = (this.width - this.xSize) / 2;
        int y = (this.height - this.ySize) / 2;

        this.carrierName = new TextFieldWidget(font, x + 84, y + 11, 86, 18, "Carrier Name");
        this.carrierName.setMaxStringLength(13);
        this.carrierName.setEnableBackgroundDrawing(false);
        this.carrierName.setVisible(true);
        this.carrierName.setTextColor(16777215);
        this.carrierName.setText(this.entity.getCarrierName());
        System.out.println(this.entity.getCarrierName());
        System.out.println("Above set");
    }

    private static ServerTileEntity getTileEntity(final PlayerInventory playerInventory, final ServerContainer container) {
        Objects.requireNonNull(playerInventory, "playerInventory cannot be null");
        final TileEntity tileAtPos = playerInventory.player.world.getTileEntity(container.entity.getPos());

        if (tileAtPos instanceof ServerTileEntity) {
            return (ServerTileEntity) tileAtPos;
        }
        throw new IllegalStateException("Tile entity is not correct! " + tileAtPos);
    }

    @Override
    public void render(final int mouseX, final int mouseY, final float partialTicks) {
        this.renderBackground();
        this.carrierName.render(mouseX, mouseY, partialTicks);
        super.render(mouseX, mouseY, partialTicks);
        this.renderHoveredToolTip(mouseX, mouseY);
    }

    @Override
    public boolean mouseClicked(double p_mouseClicked_1_, double p_mouseClicked_3_, int p_mouseClicked_5_) {
        this.carrierName.mouseClicked(p_mouseClicked_1_, p_mouseClicked_3_, p_mouseClicked_5_);
        return super.mouseClicked(p_mouseClicked_1_, p_mouseClicked_3_, p_mouseClicked_5_);
    }

    @Override
    protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) {
        RenderSystem.color4f(1.0f, 1.0f, 1.0f, 1.0f);
        this.getMinecraft().getTextureManager().bindTexture(TEXTURES);

        int x = (this.width - this.xSize) / 2;
        int y = (this.height - this.ySize) / 2;

        this.blit(x, y, 0, 0, 176, 166);
        this.font.drawString("Server", x + 10, y + 10, 16777215);

        this.entity.setCarrierName(carrierName.getText());
        ModClass.INSTANCE.sendToServer(new CarrierServerSync(carrierName.getText(), this.entity.getPos()));
    }

    @Override
    protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
        super.drawGuiContainerForegroundLayer(mouseX, mouseY);

        int x = (this.width - this.xSize) / 2;
        int y = (this.height - this.ySize) / 2;

        this.addButton(new Button(x + 30, y + 33, 50, 20, "Register", new Button.IPressable() {
            @Override
            public void onPress(Button p_onPress_1_) {
                System.out.println("pressed");
                if (!entity.getStackInSlot(0).isEmpty()) {
                    System.out.println("not empty");
                    if (entity.getStackInSlot(0).getStack().getTag() != null) {
                        System.out.println("not null");
                        CompoundNBT compoundNBT = entity.getStackInSlot(0).getTag().copy();
                        compoundNBT.putString("carrier", carrierName.getText());
                        entity.getStackInSlot(0).setTag(compoundNBT);
                    } else {
                        System.out.println("null");
                        CompoundNBT compoundNBT = new CompoundNBT();
                        compoundNBT.putString("carrier", carrierName.getText());
                        entity.getStackInSlot(0).getStack().setTag(compoundNBT);
                    }
                }
            }
        }));

        this.addButton(carrierName);
    }

}
public class ServerTileEntity extends TileEntity implements INamedContainerProvider, ITickableTileEntity, IInventory {

    private NonNullList<ItemStack> inventory = NonNullList.<ItemStack>withSize(1, ItemStack.EMPTY);
    private IItemHandlerModifiable items = createHandler();
    private LazyOptional<IItemHandlerModifiable> itemHandler = LazyOptional.of(() -> items);
    private String carrierName = "";

    public ServerTileEntity(TileEntityType<?> tileEntityTypeIn) {
        super(tileEntityTypeIn);
    }

    public ServerTileEntity(){
        super(TileEntityTypes.SERVER.get());
    }

    @Override
    public ITextComponent getDisplayName() {
        return new TranslationTextComponent("container.server");
    }

    @Override
    public Container createMenu(int p_createMenu_1_, PlayerInventory p_createMenu_2_, PlayerEntity p_createMenu_3_) {
        return new ServerContainer(p_createMenu_1_, p_createMenu_2_, this);
    }

    @Override
    public void tick() {
        
    }

    @Override
    public SUpdateTileEntityPacket getUpdatePacket() {
        CompoundNBT tagCompound = new CompoundNBT();
        tagCompound.putString("carrier", carrierName);
        this.write(tagCompound);
        SUpdateTileEntityPacket pack = new SUpdateTileEntityPacket(pos, 0, tagCompound);
        return pack;
    }

    @Override
    public void onDataPacket(NetworkManager net, SUpdateTileEntityPacket pkt) {
        this.read(pkt.getNbtCompound());
    }

    @Override
    public CompoundNBT getUpdateTag() {
        CompoundNBT tagCompound = new CompoundNBT();
        tagCompound.putString("carrier", carrierName);
        return tagCompound;
    }

    @Override
    public void handleUpdateTag(CompoundNBT tag) {
        this.read(tag);
    }

    public void setCarrierName(String carrierName) {
        this.carrierName = carrierName;
    }

    public String getCarrierName() {
        return this.carrierName;
    }

    @Override
    public int getSizeInventory() {
        return inventory.size();
    }

    @Override
    public boolean isEmpty() {
        for(ItemStack stack : this.inventory) {
            if(!stack.isEmpty()) return false;
        }
        return true;
    }

    @Override
    public ItemStack getStackInSlot(int index) {
        return inventory.get(index);
    }

    @Override
    public ItemStack decrStackSize(int index, int count) {
        return ItemStackHelper.getAndSplit(this.inventory, index, count);
    }

    @Override
    public void setInventorySlotContents(int index, ItemStack stack) {
        this.inventory.set(index, stack);
    }

    @Override
    public ItemStack removeStackFromSlot(int index) {
        return ItemStackHelper.getAndRemove(this.inventory, index);
    }

    @Override
    public boolean isUsableByPlayer(PlayerEntity player) {
        return true;
    }

    @Override
    public void clear() {
        this.inventory.clear();
    }

    @Override
    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nonnull Direction side) {
        if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
            return itemHandler.cast();
        }
        return super.getCapability(cap, side);
    }

    @Override
    public void read(CompoundNBT compound)
    {
        super.read(compound);
        this.inventory = NonNullList.<ItemStack>withSize(this.getSizeInventory(), ItemStack.EMPTY);
        ItemStackHelper.loadAllItems(compound, this.inventory);
        setCarrierName(compound.getString("carrier"));
    }

    private IItemHandlerModifiable createHandler() {
        return new InvWrapper(this);
    }

    @Override
    public CompoundNBT write(CompoundNBT compound)
    {
        super.write(compound);
        ItemStackHelper.saveAllItems(compound, this.inventory);
        compound.putString("carrier", getCarrierName());

        return compound;
    }

}
public class Server extends Block {

    private static final VoxelShape SHAPE = Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 32.0D, 16.0D);

    public static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING;

    public Server(Properties properties) {
        super(properties);

        this.setDefaultState(this.getStateContainer().getBaseState().with(FACING, Direction.NORTH));
    }

    @Override
    public TileEntity createTileEntity(BlockState state, IBlockReader world) {
        return TileEntityTypes.SERVER.get().create();
    }

    @Override
    public boolean hasTileEntity(BlockState state) {
        return true;
    }

    @Override
    protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) {
        builder.add(FACING);
    }

    @Override
    public BlockState getStateForPlacement(BlockItemUseContext context) {
        return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite());
    }

    @Override
    public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) {
        return SHAPE;
    }

    @Override
    public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
        TileEntity te = worldIn.getTileEntity(pos);
        if (te != null && te instanceof ServerTileEntity && !worldIn.isRemote) {
            NetworkHooks.openGui((ServerPlayerEntity) player, (ServerTileEntity) te, pos);
        }

        return super.onBlockActivated(state, worldIn, pos, player, handIn, hit);
    }

}

 

My goal is to get the data from the TextFieldWidget, and save it in NBT tags, and be able to retreive it later, putting the text back in the field.

Yes, I know; most of this code won't be the "recommended way" of doing any of this, I've been really trying though.

 

Let me know if you need any more information.

Thanks.

Posted
  On 9/25/2020 at 1:17 AM, Jack Richard said:

TileEntity implements INamedContainerProvider, ITickableTileEntity, IInventory

Expand  

You are using IInventory. Go and fix that and properly attach it with capabilities. But I won't be so stingy since you have been trying and cooperating so apologies for my agressiveness.

 

As a precursor, try to avoid using Server or Client in your names, it confuses everyone.

  On 9/25/2020 at 1:17 AM, Jack Richard said:

tagCompound.putString("carrier", carrierName); this.write(tagCompound);

Expand  

You're writing the carrier name twice?

  On 9/25/2020 at 1:17 AM, Jack Richard said:

ModClass.INSTANCE.sendToServer(new CarrierServerSync(carrierName.getText(), this.entity.getPos()));

Expand  

You're doing this every tick, only send it when the button is pressed.

  On 9/25/2020 at 1:17 AM, Jack Richard said:

if (entity.getStackInSlot(0).getStack().getTag() != null) { System.out.println("not null"); CompoundNBT compoundNBT = entity.getStackInSlot(0).getTag().copy(); compoundNBT.putString("carrier", carrierName.getText()); entity.getStackInSlot(0).setTag(compoundNBT); } else { System.out.println("null"); CompoundNBT compoundNBT = new CompoundNBT(); compoundNBT.putString("carrier", carrierName.getText()); entity.getStackInSlot(0).getStack().setTag(compoundNBT); }

Expand  

This should not really be handled on the client once again. This is not necessary if you send the information to the server. You will need to resync the values anyways whenever the inventory is opened regardless.

Finally, if your container is not registered using IForgeContainerType, then the packet information will never be sent to the client. You should also store the block pos and not the te itself. That's rather pointless to do as all it's used for sending the position back to the server. The tile entity will still not store the position anyways.

Posted
  On 9/25/2020 at 1:31 AM, ChampionAsh5357 said:

You are using IInventory. Go and fix that and properly attach it with capabilities. But I won't be so stingy since you have been trying and cooperating so apologies for my agressiveness.

Expand  

I understand that IInventory is not accepted, so I'll be working to fix that soon. No problem, I'm just happy with whatever you're able to contribute. 

 

  On 9/25/2020 at 1:31 AM, ChampionAsh5357 said:

As a precursor, try to avoid using Server or Client in your names, it confuses everyone.

Expand  

Yeah, that wasn't the best choice.

 

  On 9/25/2020 at 1:31 AM, ChampionAsh5357 said:

You're writing the carrier name twice?

Expand  

I guess so. I was a little confused once functions like getUpdatePacket() and onDataPacket() were used.

 

  On 9/25/2020 at 1:31 AM, ChampionAsh5357 said:

You're doing this every tick, only send it when the button is pressed.

This should not really be handled on the client once again. This is not necessary if you send the information to the server. You will need to resync the values anyways whenever the inventory is opened regardless.

Expand  

I'm sending the data every tick, the button writes the data to an item in the one slot of the GUI. Here's the code for the .sendtoServer() handler:

public static void handle(CarrierServerSync msg, Supplier<NetworkEvent.Context> ctx) {
        ctx.get().enqueueWork(() -> {
            PlayerEntity sender = ctx.get().getSender();
            ServerTileEntity server = getTileEntity(sender.inventory, msg.tileEntity);
            server.setCarrierName(msg.data);
        });
        ctx.get().setPacketHandled(true);
    }

    private static ServerTileEntity getTileEntity(final PlayerInventory playerInventory, final BlockPos tileEntity) {
        Objects.requireNonNull(playerInventory, "playerInventory cannot be null");
        final TileEntity tileAtPos = playerInventory.player.world.getTileEntity(tileEntity);

        if (tileAtPos instanceof ServerTileEntity) {
            return (ServerTileEntity) tileAtPos;
        }
        throw new IllegalStateException("Tile entity is not correct! " + tileAtPos);
    }

This is probably not the best way to do this...

 

  On 9/25/2020 at 1:31 AM, ChampionAsh5357 said:

This should not really be handled on the client once again. This is not necessary if you send the information to the server. You will need to resync the values anyways whenever the inventory is opened regardless.

Finally, if your container is not registered using IForgeContainerType, then the packet information will never be sent to the client. You should also store the block pos and not the te itself. That's rather pointless to do as all it's used for sending the position back to the server. The tile entity will still not store the position anyways.

Expand  

Luckily, I do have my container, messages, and tile entity registered. 

Looping back to my original theory, is Block#createTileEntity() run when you open a GUI?

 

Thanks again.

Posted
  On 9/25/2020 at 1:43 AM, Jack Richard said:

I'm sending the data every tick, the button writes the data to an item in the one slot of the GUI. Here's the code for the .sendtoServer() handler:

Expand  

That still makes no sense. You're just bottlenecking the network. The data doesn't change until you send it. Also, the button shouldn't be the one doing it. It should be handled on the server once again. NOTHING should be handled on the client itself. It all gets synchronized via the gui. Only thing that doesn't is the string which should be what you send on button click.

  On 9/25/2020 at 1:43 AM, Jack Richard said:

Luckily, I do have my container, messages, and tile entity registered. 

Expand  

You missed the part where I said IForgeContainerType. Doesn't matter if their registered. If it's not using the correct type it won't send the packet.

  On 9/25/2020 at 1:43 AM, Jack Richard said:

Looping back to my original theory, is Block#createTileEntity() run when you open a GUI?

Expand  

Not being rude, the original theory is wrong. The client doesn't hold data from the server. It will be reinitialized since it's pulling information from the empty client container.

Posted
  On 9/25/2020 at 1:53 AM, ChampionAsh5357 said:

That still makes no sense. You're just bottlenecking the network. The data doesn't change until you send it. Also, the button shouldn't be the one doing it. It should be handled on the server once again. NOTHING should be handled on the client itself. It all gets synchronized via the gui. Only thing that doesn't is the string which should be what you send on button click.

You missed the part where I said IForgeContainerType. Doesn't matter if their registered. If it's not using the correct type it won't send the packet.

Not being rude, the original theory is wrong. The client doesn't hold data from the server. It will be reinitialized since it's pulling information from the empty client container.

Expand  

I know, it's very confusing, and frankly, I might just rework the GUI if I can't get this to work, anyway.

Is it possible to get data from the Screen class to the TileEntity class? 

 

Also, should I implement IForgeContainerType in my Container class?

I understand, the original theory was a little far-fetched. So an empty client container could be it? Just trying to understand.

 

Thanks again.

Posted
  On 9/25/2020 at 2:04 AM, Jack Richard said:

Is it possible to get data from the Screen class to the TileEntity class? 

Expand  

Yes, that's the use of a packet through the network. But that should only be sent as needed as otherwise you just bottleneck the network creating more issues.

  On 9/25/2020 at 2:04 AM, Jack Richard said:

Also, should I implement IForgeContainerType in my Container class?

Expand  

No, that should be used in your registry instance for your ContainerType.

  On 9/25/2020 at 2:04 AM, Jack Richard said:

So an empty client container could be it? Just trying to understand.

Expand  

Imagine it like this. You have two instances, a server and the client. The server creates a container with a specific window id. The client creates a container with the same window id and a screen that can get information from the container. The server container sends default information to the client container which is read by the screen. A client screen clicks something, which gets sent as a packet to the server container, which updates the client container, which updates the screen. Note that the client creates a new instance of the container on open so the information needs to be synced. By default, only slots and tracked integers are synced. If you want to handle something else, you need to send it yourself.

Posted

You can send data from client (in this case screen), to the server (container/tileentity) using packets.

And no, please read what he said again:

  Quote

Finally, if your container is not registered using IForgeContainerType, then the packet information will never be sent to the client.

Expand  

 

 

Posted
  On 9/25/2020 at 2:18 AM, ChampionAsh5357 said:

Yes, that's the use of a packet through the network. But that should only be sent as needed as otherwise you just bottleneck the network creating more issues.

No, that should be used in your registry instance for your ContainerType.

Expand  

Got it, and got it.

 

  On 9/25/2020 at 2:18 AM, ChampionAsh5357 said:

Imagine it like this. You have two instances, a server and the client. The server creates a container with a specific window id. The client creates a container with the same window id and a screen that can get information from the container. The server container sends default information to the client container which is read by the screen. A client screen clicks something, which gets sent as a packet to the server container, which updates the client container, which updates the screen. Note that the client creates a new instance of the container on open so the information needs to be synced. By default, only slots and tracked integers are synced. If you want to handle something else, you need to send it yourself.

Expand  

Thanks for explaining it to me, I'll try to wrap my head around that, and send an update soon.

 

Thank you!

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Temu continues to reward loyal customers in the USA with exceptional savings opportunities through exclusive coupon codes designed specifically for existing users. The Temu coupon code $100 off remains one of the most popular discount offers available to returning customers who have already discovered the platform's incredible value proposition. Our featured Temu Coupon code (ACW472253) provides maximum benefits for people across the USA, Canada, and European nations, making it an ideal choice for USA shoppers seeking substantial savings.   Existing customers can take advantage of the comprehensive Temu coupon $100 offand Temu 100 off coupon code opportunities that extend well beyond first-time purchase incentives. These codes ensure that customer loyalty is rewarded with continued access to premium discounts and exclusive offers throughout the year.   What Is The Coupon Code For Temu $100 Off? Both new and existing customers can get amazing benefits if they use our $100 coupon code on the Temu app and website. The Temu coupon $100 offand $100 offTemu coupon provide substantial savings across thousands of product categories available on the platform. Our ACW472253 code offers multiple benefit structures designed to maximize customer value:   ACW472253 - Flat $100 offqualifying orders for immediate savings   ACW472253 - $100 coupon pack for multiple uses across different purchases   ACW472253 - $100 flat discount for new customers joining the platform   ACW472253 - Extra $100 promo code for existing customers continuing their shopping journey   ACW472253 - $100 coupon for USA/Canada users with worldwide shipping benefits   Temu Coupon Code $100 offFor New Users In 2025 New users can get the highest benefits if they use our coupon code on the Temu app. The Temu coupon $100 offand Temu coupon code $100 offprovide exceptional value for first-time shoppers exploring the platform's extensive product catalog. The ACW472253 code delivers comprehensive benefits specifically tailored for newcomers:   ACW472253 - Flat $100 discount for new users on qualifying first orders   ACW472253 - $100 coupon bundle for new customers enabling multiple discounted purchases   ACW472253 - Up to $100 coupon bundle for multiple uses across various product categories   ACW472253 - Free shipping to 68 countries ensuring global accessibility   ACW472253 - Extra 30% off on any purchase for first-time users maximizing initial savings   How To Redeem The Temu Coupon $100 offFor New Customers? The Temu $100 coupon and Temu $100 offcoupon code for new users can be easily applied through a straightforward redemption process. Follow these simple steps to maximize your savings:   Download the Temu app from your device's official app store or visit the Temu website   Create your new account using a valid email address and phone number   Browse through thousands of products and add desired items to your shopping cart   Proceed to checkout and locate the "Promo Code" or "Coupon Code" field   Enter ACW472253 exactly as shown and click "Apply"   Verify that your discount has been applied before completing your purchase   Complete your order using your preferred payment method   Temu Coupon $100 offFor Existing Customers Existing users can also get benefits if they use our coupon code on the Temu app. The Temu $100 coupon codes for existing users and Temu coupon $100 offfor existing customers free shipping ensure that customer loyalty is continuously rewarded with substantial savings opportunities. The ACW472253 code provides specialized benefits for returning customers:   ACW472253 - $100 extra discount for existing Temu users on qualified orders   ACW472253 - $100 coupon bundle for multiple purchases enabling extended savings   ACW472253 - Free gift with express shipping all over the USA/Canada region   ACW472253 - Extra 30% off on top of the existing discount for maximum value   ACW472253 - Free shipping to 68 countries with expedited delivery options   How To Use The Temu Coupon Code $100 offFor Existing Customers? The Temu coupon code $100 offand Temu coupon $100 offcode application process for existing customers follows a similar streamlined approach:   Log into your existing Temu account through the app or website   Add your desired products to the shopping cart   Navigate to the checkout page   Locate the promotional code entry field   Input ACW472253 and confirm the code application   Review your order summary to ensure the discount is properly applied   Complete your purchase with confidence   Latest Temu Coupon $100 offFirst Order Customers can get the highest benefits if they use our coupon code during the first order. The Temu coupon code $100 offfirst order, Temu coupon code first order, and Temu coupon code $100 offfirst time user provide exceptional value for initial platform experiences. The ACW472253 code offers comprehensive first-order benefits:   ACW472253 - Flat $100 discount for the first order on qualifying purchases   ACW472253 - $100 Temu coupon code for the first order with extended validity   ACW472253 - Up to $100 coupon for multiple uses across different product categories   ACW472253 - Free shipping to 68 countries ensuring global accessibility   ACW472253 - Extra 30% off on any purchase for the first order maximizing initial savings   How To Find The Temu Coupon Code $100 Off? The Temu coupon $100 offand Temu coupon $100 offReddit can be located through various reliable channels. Any user can get verified and tested coupons by signing up for the Temu newsletter, which provides regular updates on the latest promotional offers and exclusive discount codes. We also recommend visiting Temu's social media pages to get the latest coupons and promos, as the platform frequently shares time-sensitive offers across their official channels.   You can find the latest and working Temu coupon codes by visiting any trusted coupon site that specializes in verified promotional offers. These platforms regularly test and validate coupon codes to ensure customers receive legitimate savings opportunities.   Is Temu $100 offCoupon Legit? The Temu $100 offCoupon Legit and Temu 100 off coupon legit status is absolutely verified and confirmed. Our Temu coupon code ACW472253 is absolutely legit and has been tested across multiple user accounts and purchase scenarios. Any customers can safely use our Temu coupon code to get $100 offon the first order and then on the recurring orders without concerns about legitimacy or validity.   Our code is not only legit but also regularly tested and verified by our team to ensure consistent performance across different user scenarios. Our Temu coupon code is valid worldwide and doesn't have any expiration date, providing customers with flexible redemption opportunities regardless of timing or location.   How Does Temu $100 offCoupon Work? The Temu coupon code $100 offfirst-time user and Temu coupon codes 100 off operate through a straightforward discount application system that reduces your total order value by the specified coupon amount.   When you apply the ACW472253 coupon code at checkout, the system automatically calculates your eligibility based on your order value, account status, and product selection. The discount is then applied to qualifying items in your cart, reducing your total payment amount by up to $100 depending on your purchase value. For orders exceeding the minimum threshold, the full $100 discount is applied immediately, while smaller orders receive proportional discounts based on the total value. The system also accounts for any additional promotions or discounts that may be running simultaneously, ensuring you receive the maximum possible savings on your purchase.   How To Earn Temu $100 Coupons As A New Customer? The Temu coupon code $100 offand 100 off Temu coupon code can be earned through various customer engagement activities designed to reward platform participation and loyalty.   New customers can earn $100 coupons by downloading the official Temu mobile application, which provides access to exclusive in-app promotions and coupon offers not available through the website. Creating a complete user profile with verified contact information also unlocks additional coupon opportunities. Participating in Temu's referral program allows new users to earn coupon credits by inviting friends and family members to join the platform. Additionally, engaging with daily check-in features, spinning promotional wheels, and participating in limited-time games and challenges can generate coupon credits that accumulate toward $100 discount opportunities.   What Are The Advantages Of Using The Temu Coupon $100 Off? The Temu coupon code 100 off and Temu coupon code $100 offprovide numerous advantages for savvy shoppers:   $100 discount on the first order providing immediate substantial savings   $100 coupon bundle for multiple uses extending value across multiple purchases   70% discount on popular items when combined with existing promotions   Extra 30% off for existing Temu customers maximizing repeat purchase value   Up to 90% off in selected items during special promotional periods   Free gift for new users adding extra value to initial purchases   Free delivery to 68 countries ensuring global accessibility   Temu $100 Discount Code And Free Gift For New And Existing Customers The Temu $100 offcoupon code and $100 offTemu coupon code provide multiple benefits for customers regardless of their account status. There are multiple benefits to using our Temu coupon code that extend beyond simple price reductions:   ACW472253 - $100 discount for the first order with immediate application   ACW472253 - Extra 30% off on any item across all product categories   ACW472253 - Free gift for new Temu users adding tangible value   ACW472253 - Up to 70% discount on any item on the Temu app   ACW472253 - Free gift with free shipping in 68 countries including the USA and USA   Pros And Cons Of Using The Temu Coupon Code $100 offThis Month The Temu coupon $100 offcode and Temu 100 off coupon offer several advantages and considerations:   Pros:   Substantial immediate savings of up to $100 on qualifying orders   No expiration date providing flexible redemption timing   Valid for both new and existing customers ensuring inclusive access   Combines with other promotions for maximum savings potential   Free shipping benefits reducing overall order costs   Cons:   Minimum order requirements may apply to certain discount tiers   Limited to specific product categories during promotional periods   Terms And Conditions Of Using The Temu Coupon $100 offIn 2025 The Temu coupon code $100 offfree shipping and latest Temu coupon code $100 offoperate under specific terms and conditions designed to ensure fair usage:   Our coupon code doesn't have any expiration date allowing flexible redemption timing   Valid for both new and existing users in 68 countries worldwide providing global accessibility   No minimum purchase requirements for using our Temu coupon code ACW472253   Free returns within 90 days of purchase ensuring customer satisfaction   Price adjustment policy within 30 days protecting against price fluctuations   Free standard shipping on qualifying orders reducing additional costs   One-time use per customer account preventing multiple redemptions   Final Note: Use The Latest Temu Coupon Code $100 Off The Temu coupon code $100 offrepresents one of the most valuable savings opportunities available to USA customers shopping on the platform today. Whether you're a first-time user or a loyal existing customer, these substantial discounts provide genuine value across thousands of product categories.   Take advantage of the Temu coupon $100 offwhile these promotional offers remain available to maximize your shopping budget and discover why millions of customers worldwide trust Temu for their online shopping needs. The combination of substantial discounts, free shipping benefits, and comprehensive return policies makes this an ideal time to experience everything Temu has to offer.   FAQs Of Temu $100 offCoupon Q: How do I apply the Temu $100 offcoupon code? A: Enter the code ACW472253 at checkout in the promotional code field. The discount will be automatically applied to qualifying orders, reducing your total by up to $100 depending on your purchase value.   Q: Can existing customers use the $100 offTemu coupon? A: Yes, the ACW472253 coupon code is valid for both new and existing customers. Existing users can benefit from additional discounts and free shipping offers when using this code on qualifying orders.   Q: Is there a minimum order requirement for the Temu $100 coupon? A: No minimum purchase requirements apply when using our ACW472253 coupon code. However, the discount amount may vary based on your total order value and product selection at checkout.   Q: How long is the Temu $100 offcoupon valid? A: The ACW472253 coupon code does not have an expiration date, allowing customers to use it whenever convenient. This provides flexibility for both immediate purchases and future shopping plans on the platform.   Q: Can I combine the $100 Temu coupon with other offers? A: Yes, the ACW472253 coupon can often be combined with existing promotions, flash sales, and other discount offers to maximize your total savings. Check at checkout to see available stacking opportunities.  
    • Looking for a fantastic way to save big on your next Temu order? The acr639380 Temu coupon code is exactly what you need! Whether you're shopping from the USA, Canada, or Europe, this code offers unbeatable savings — up to $100 off your next purchase. If you’ve been eyeing something on Temu, now’s the perfect time to grab it with this exclusive offer!  What Is the Coupon Code for Temu $100 Off? Both new and existing customers can benefit from this incredible deal when shopping on the Temu app or website. Just use code acr639380 at checkout to unlock your $100 discount. Here’s what it offers: acr639380: Flat $100 off your next purchase.   acr639380: Receive a $100 coupon pack for multiple uses.   acr639380: New customers get an exclusive $100 off their first purchase.   acr639380: Existing customers can claim an extra $100 off future purchases.   acr639380: Valid in the USA, Canada, and across Europe.    Temu $100 Off Coupon for New Users in 2025 If you're new to Temu, this coupon code is perfect for you. It’s your chance to enjoy huge savings right from your very first order. Here’s what new customers get with acr639380: Flat $100 discount on your first order.   Access to a $100 coupon bundle for multiple purchases.   Stack up to $100 in discounts across various orders.   Free shipping to 68 countries, including the USA, Canada, and UK.   An additional 30% off any item on your first purchase.    How to Redeem the Temu $100 Off Coupon (For New Users) It’s simple! Follow these quick steps: Visit the Temu website or download the Temu app.   Create a new account.   Add your favorite products to your cart.   At checkout, enter the Temu $100 off coupon code: acr639380.   Apply the code, enjoy the savings, and complete your purchase!    Temu Coupon $100 Off for Existing Customers Good news — existing customers aren’t left out! Temu rewards loyal shoppers too. Perks for returning users with acr639380: Get an extra $100 off your next order.   A $100 coupon bundle for multiple future purchases.   Free gifts with express shipping (USA & Canada).   An additional 30% off on any purchase.   Free shipping to 68 countries globally.    How to Use Temu $100 Off Coupon (For Existing Customers) To redeem: Log into your Temu account.   Add your items to the cart.   At checkout, enter acr639380.   Apply the code and enjoy your savings!    Temu $100 Off Coupon for First Orders Your first Temu order just got better with acr639380: $100 off your initial purchase.   Access to exclusive first-time user discounts.   Up to $100 in savings on multiple items.   Free shipping to 68 countries.   Extra 30% off your first order.    Where to Find the Latest Temu $100 Off Coupon Looking for the newest and verified Temu coupon codes? Here’s where you can find them: Temu’s newsletter: Subscribe for email-exclusive deals.   Official Temu social media pages.   Trusted coupon websites.   Community threads like Temu coupon $100 off Reddit where users share legit codes.    Is the Temu $100 Off Coupon Legit? Absolutely — the acr639380 coupon is verified, tested, and 100% legit. It works for both new and existing customers worldwide, with no expiration date. Use it with confidence!  How Does the Temu $100 Off Coupon Work? Simple — enter acr639380 at checkout, and the discount is applied automatically. Whether it’s your first order or a repeat purchase, you’ll enjoy direct savings.  How to Earn Temu $100 Coupons as a New Customer New customers can score extra Temu savings by: Signing up for a new Temu account.   Making your first purchase using acr639380.   Watching for special promotions and email deals.   Checking Temu’s homepage for limited-time coupon bundles.    Advantages of Using the Temu $100 Off Coupon Here’s what makes this coupon so appealing: Flat $100 discount on first-time and future orders.   $100 coupon bundle for multiple uses.   Up to 90% off popular products.   Extra 30% off for existing customers.   Free gifts for new users.   Free shipping to 68 countries, including the USA, UK, and Canada.    Temu $100 Discount Code + Free Gift for Everyone Both new and existing customers get added perks: $100 off your first order.   An extra 30% off any product.   Free gifts on first purchases.   Up to 90% off select deals on the Temu app.   Free shipping to 68 countries.    Pros and Cons of Using the Temu Coupon Code $100 Off in 2025 Pros: Massive $100 discount.   Up to 90% off on select items.   Free global shipping to 68 countries.   30% off bonus for existing users.   Verified, legit, and no expiration date.   Cons: Free shipping limited to select countries.   Some exclusions may apply to already discounted items.    Terms and Conditions (2025) No expiration date.   Valid in 68 countries.   No minimum spend required.   Applicable for multiple purchases.   Some product exclusions may apply.    Final Note: Don’t Miss Out on the $100 Temu Coupon If you’re shopping on Temu, don’t leave money on the table. Use coupon code acr639380 to unlock $100 off, free shipping, extra discounts, and exclusive perks. It’s one of the easiest ways to make your shopping spree even more rewarding.  FAQs: Temu $100 Off Coupon Q: Is the $100 off coupon available for both new and existing customers? A: Yes! Both can use acr639380 for amazing discounts. Q: How do I redeem the Temu $100 coupon? A: Enter acr639380 at checkout to instantly save $100. Q: Does the Temu coupon expire? A: No — this coupon currently has no expiration date. Q: Can the coupon be used for multiple purchases? A: Yes, the $100 off coupon and bundle can apply to multiple orders. Q: Does it work for international users? A: Absolutely! It’s valid in 68 countries, including the USA, Canada, and Europe.
    • Go to the config folder and open the secretroomsmod.cfg   At the bottom, you will find:   # Check for mod updates on startup B:update_checker=true   Change it to false:   # Check for mod updates on startup B:update_checker=false  
    • The mod yetanotherchancebooster is conflicting or running into an issue with cobblemon Remove yetanotherchancebooster
    • Looking to save big on your next shopping spree? With our Temu coupon code $100 off, you can grab massive savings right from your first order! We bring you the verified acw696499 coupon code that unlocks exclusive discounts for shoppers in the USA, Canada, and across European countries. With this exclusive Temu coupon $100 off and Temu 100 off coupon code, you're not just shopping smart—you're shopping the best deal available. What Is The Coupon Code For Temu $100 Off? If you're searching for a way to make your Temu shopping even more affordable, look no further. Both new and existing users can enjoy amazing deals by using our Temu coupon $100 off and $100 off Temu coupon. acw696499: Get a flat $100 off on select orders for maximum savings. acw696499: Enjoy a $100 coupon pack you can redeem across multiple purchases. acw696499: Exclusive $100 flat discount available for first-time users. acw696499: Extra $100 promo value available even for returning users. acw696499: Get access to a $100 coupon tailored specifically for USA and Canada shoppers. Temu Coupon Code $100 Off For New Users In 2025 As a new user, you're entitled to enjoy incredible perks from your very first purchase. By using our Temu coupon $100 off and Temu coupon code $100 off, you get unmatched value. acw696499: Flat $100 discount for new Temu users across all eligible items. acw696499: Unlock a $100 coupon bundle that can be used for multiple orders. acw696499: Redeem up to $100 in coupons over your next few purchases. acw696499: Take advantage of free shipping to over 68 countries worldwide. acw696499: Get an additional 30% off on your entire first purchase. How To Redeem The Temu Coupon $100 Off For New Customers? Redeeming your Temu $100 coupon and Temu $100 off coupon code for new users is a simple, step-by-step process: Download the Temu app or visit the official Temu website. Create a new account using your email or phone number. Add your favorite products to the cart. At checkout, enter the coupon code acw696499. Hit apply and enjoy the $100 discount on your first order. Temu Coupon $100 Off For Existing Customers Great news! Existing customers can also reap rewards using our Temu $100 coupon codes for existing users and Temu coupon $100 off for existing customers free shipping. acw696499: Receive a $100 discount on your next Temu order. acw696499: Use the $100 coupon bundle over multiple purchases. acw696499: Enjoy free express shipping and surprise gifts in the USA/Canada. acw696499: Stack up with an additional 30% discount on current deals. acw696499: Access free shipping to 68 countries around the globe. How To Use The Temu Coupon Code $100 Off For Existing Customers? To redeem your Temu coupon code $100 off and Temu coupon $100 off code as an existing user: Log in to your existing Temu account. Add desired items to your shopping cart. Proceed to the checkout page. Enter the coupon code acw696499 in the promo code section. Apply the code and enjoy instant $100 off benefits. Latest Temu Coupon $100 Off First Order If you’re placing your first order, the timing couldn’t be better. Using the Temu coupon code $100 off first order, Temu coupon code first order, and Temu coupon code $100 off first time user, you unlock exclusive bonuses. acw696499: Flat $100 discount applied instantly at checkout. acw696499: Redeem a $100 coupon specifically for your first order. acw696499: Use up to $100 in coupons for multiple uses. acw696499: Enjoy free international shipping to 68 countries. acw696499: Grab an extra 30% discount on top of the $100 coupon. How To Find The Temu Coupon Code $100 Off? Finding a working Temu coupon $100 off and Temu coupon $100 off Reddit is easier than ever. Simply subscribe to the Temu newsletter and receive verified deals right in your inbox. You can also follow Temu on social media to stay updated on flash sales and fresh coupons. Lastly, always check reliable coupon-sharing websites like ours to get working and tested coupon codes like acw696499. Is Temu $100 Off Coupon Legit? Yes, the Temu $100 Off Coupon Legit and Temu 100 off coupon legit concerns can be put to rest. Our coupon code acw696499 is 100% legitimate and trusted by users worldwide. You can safely apply this code to get $100 off on your first purchase and also enjoy recurring discounts. It’s fully verified, tested, and available globally without any expiry date. How Does Temu $100 Off Coupon Work? The Temu coupon code $100 off first-time user and Temu coupon codes 100 off work like a digital voucher. Once you enter the code acw696499 during checkout, it automatically deducts up to $100 from your total order. The coupon can be redeemed on eligible products, and sometimes includes extra discounts, free shipping, or bonus items. How To Earn Temu $100 Coupons As A New Customer? To earn your Temu coupon code $100 off and 100 off Temu coupon code, you simply need to sign up as a new customer on the Temu platform. After registration, use the acw696499 code to immediately unlock $100 in coupon value, and continue to receive bonus discounts and perks via email or app notifications. What Are The Advantages Of Using The Temu Coupon $100 Off? Here are the major advantages of using our Temu coupon code 100 off and Temu coupon code $100 off: $100 discount on your first order. $100 coupon bundle redeemable across multiple purchases. Up to 70% discount on popular Temu products. Additional 30% discount for returning users. Up to 90% off on select items during promotions. Free gift included for new users. Free shipping to 68 countries including the USA, Canada, UK, and more. Temu $100 Discount Code And Free Gift For New And Existing Customers Our Temu $100 off coupon code and $100 off Temu coupon code don’t just offer discounts—they deliver value-packed shopping experiences. acw696499: $100 discount for your first Temu purchase. acw696499: Extra 30% off on all items sitewide. acw696499: Free surprise gift for new Temu shoppers. acw696499: Up to 70% off on trending products. acw696499: Free gift + free shipping to 68 countries including the USA and UK. Pros And Cons Of Using The Temu Coupon Code $100 Off This Month Here are the pros and cons of the Temu coupon $100 off code and Temu 100 off coupon: Pros: Verified and tested code: acw696499. Available for both new and returning users. Valid worldwide including USA, Canada, and Europe. Provides free shipping and gifts. No expiration date. Cons: Limited to select product categories. Cannot be combined with certain Temu internal promotions. Terms And Conditions Of Using The Temu Coupon $100 Off In 2025 Here are the Temu coupon code $100 off free shipping and latest Temu coupon code $100 off terms and conditions: The coupon code acw696499 does not have any expiration date. Valid for both new and existing users. Works in 68 countries including USA, Canada, and UK. No minimum purchase is required to activate the coupon. The coupon can be used multiple times for select offers. Shipping is free when the coupon is used. Final Note: Use The Latest Temu Coupon Code $100 Off Don't miss out on this incredible chance to save with the Temu coupon code $100 off. Your shopping journey with Temu just got a lot more affordable! Take advantage of this Temu coupon $100 off deal before it disappears. It's time to upgrade your cart without upgrading your expenses.
  • Topics

×
×
  • Create New...

Important Information

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