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

  • Author

From the WirelessControllerGuiContainer, I send a packet to the Server with the Redstone-signal and the frequency. In the onMessage()-method, I iterate through the loadedEntityList, check for the frequency and if everything's correct, i change the redstonesignal in the TileEntity. That's all working for now.

 

In the WirelessReceiverTileEntity the setRedstoneSignal(bool) looks as follow:

 

 

public void setRedstonesignal(boolean redstonesignal)
    {
        this.redstonesignal = redstonesignal;
        this.markForUpdate();
        this.worldObj.markBlockForUpdate(xCoord,yCoord,zCoord);
    }

 

 

 

In the WirelessReceiver-Block-class, I implemented these two methods which get the Redstonesignal from the TileEntity and set it:

 

 

@Override
    public boolean canProvidePower()
    {
        return true;
    }

    @Override
    public int isProvidingWeakPower(IBlockAccess iba, int x, int y, int z, int p_149709_5_)
    {
        if(iba.getTileEntity(x,y,z) instanceof WirelessReceiverTileEntity)
        {
            WirelessReceiverTileEntity wrte = (WirelessReceiverTileEntity) iba.getTileEntity(x,y,z);
            return wrte.isRedstonesignal() ? 20:0;
        }

        return 0;
    }

 

 

I hope that i set up these methods correctly, otherwise it's going to be embarrassing :/

 

EDIT:

 

IT'S WORKING!!!!!

 

I had to call the method "notifyBlocksOfNeighborChange" in the TileEntity and call a few times the updateTick()-method.

 

Thanks for your help coolAlias,

you helped a lot. ;)

 

Julian

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.