Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I made a pedestal, you right click items on and off of it, or shift right click to open the gui. most of it works fine except when you right click an item off the pedestal it still renders there until you log out or open the gui. I am at a loss as to what to do.

 

Pedestal Block Code

Pedestal TE Code

Pedestal TESR

You need to sync the inventory using markDirty() meaning call markDirty() after removing/adding the item.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

public void setStack(ItemStack stack) 
{
        this.stack = stack;
        this.markDirty();
        if (worldObj != null)
        {
            IBlockState state = worldObj.getBlockState(getPos());
            worldObj.notifyBlockUpdate(getPos(), state, state, 3);
        }    
    }

 

Is it suppose to be somewhere else? because it doesn't work. -_-

public void setStack(ItemStack stack) 
{
        this.stack = stack;
        this.markDirty();
        if (worldObj != null)
        {
            IBlockState state = worldObj.getBlockState(getPos());
            worldObj.notifyBlockUpdate(getPos(), state, state, 3);
        }    
    }

 

Is it suppose to be somewhere else? because it doesn't work. -_-

Did you override getUpdatePacket(...) and handleUpdatePacket(...) or something like that.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

  • Author

Is this what you mean?

    @Override
    public SPacketUpdateTileEntity getUpdatePacket()
    {
        NBTTagCompound nbtTag = new NBTTagCompound();
        this.writeToNBT(nbtTag);
        return new SPacketUpdateTileEntity(getPos(), 1, nbtTag);
    }

    @Override
    public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet)
    {
        this.readFromNBT(packet.getNbtCompound());
    }

I've been trying to figure this out for a while, the proper way of calling a TileEntity sync. I knew how to do it back in 1.8 by calling markBlockForUpdate(BlockPos) and markDirty() which would immediately trigger a call to getDescriptionPacket(). After removal of the first function I don't know how to do it any more as calling markDirty() alone doesn't seem to do anything or am I missing something... Does anyone know how we're suppose to do it in 1.10?

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

I've been trying to figure this out for a while, the proper way of calling a TileEntity sync. I knew how to do it back in 1.8 by calling markBlockForUpdate(BlockPos) and markDirty() which would immediately trigger a call to getDescriptionPacket(). After removal of the first function I don't know how to do it any more as calling markDirty() alone doesn't seem to do anything or am I missing something... Does anyone know how we're suppose to do it in 1.10?

 

Call

World#notifyBlockUpdate

on the server to send the

TileEntity

's update packet and re-render the chunk containing it.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Call

World#notifyBlockUpdate

on the server to send the

TileEntity

's update packet and re-render the chunk containing it.

 

Do I actually need to provide two different BlockStates? I would like to call an instant entity sync without actually changing the BlockState. And what about the flags, any idea what I should enter there?

I still haven't published a mod because I can never get that in-dev version just right to warrant a public release. And yes, after two years of mod development I am still learning to speak Java.

 

Follow me on GitHub: https://github.com/yooksi

Contact me on Twitter: https://twitter.com/yooksi

Read my Minecraft blog: https://yooksidoesminecraft.blogspot.de/

Do I actually need to provide two different BlockStates? I would like to call an instant entity sync without actually changing the BlockState.

 

No, the two

IBlockState

arguments can be (and usually are) the same.

 

 

And what about the flags, any idea what I should enter there?

 

The flags are completely ignored by

ServerWorldEventHandler

(the server-side

IWorldEventListener

instance).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.