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

Posted

So i have added new ores similar to emeralds (rubies and sapphires) and of course storage blocks for them, now how to i make it so that those blocks can be used to power a beacon?

override

isBeaconBase

and return true

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

maybe I typed something wrong but this

@Override{
	isBeaconBase;
	return true;
}

is giving me errors

yes ... yes...

i would expect that

 

[lmgtfy]how to override a method in java[/lmgtfy]

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

I know HOW to override a method the problem is WHAT i have to override

then if you know how to override it shouldnt be a problem to understand what i said isBeaconBase is a method btw

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

*opens Block.java*

 

 

/**
     * Determines if this block can be used as the base of a beacon.
     *
     * @param world The current world
     * @param x X Position
     * @param y Y Position
     * @param z Z position
     * @param beaconX Beacons X Position
     * @param beaconY Beacons Y Position
     * @param beaconZ Beacons Z Position
     * @return True, to support the beacon, and make it active with this block.
     */
    public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
    {
        return (blockID == blockEmerald.blockID || blockID == blockGold.blockID || blockID == blockDiamond.blockID || blockID == blockIron.blockID);
    }

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

  • Author

yes i figured that out after i posted my previous one apparently i was trying to return the wrong value, derp, thanks for your help.

  • Author

Ok so here is what i've got

public boolean isBeaconBase; {
    return (blockID == PureBlock.blockID || blockID == RubyBlock.blockID || blockID == SapphireBlock.blockID);
}

but i am getting errors at the blockID's just before ==

I know HOW to override a method the problem is WHAT i have to override

really, are you sure

 

public boolean isBeaconBase; {
    return (blockID == PureBlock.blockID || blockID == RubyBlock.blockID || blockID == SapphireBlock.blockID);
}

thats not overriding a method

 

generic method

 

accessibility [static] [final] returnType methodname(arguments){
method body
}

 

public boolean isBeaconBase; {
    return (blockID == PureBlock.blockID || blockID == RubyBlock.blockID || blockID == SapphireBlock.blockID);
}

 

*input the "method" in my magic code claner/fixer/transformer*

public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
    return (blockID == PureBlock.blockID || blockID == RubyBlock.blockID || blockID == SapphireBlock.blockID);
}

 

*relive ancient times*

override

isBeaconBase

and return true

 

*second pass of magic transformation*

 

@Override
public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) {
    return true;
}

how to debug 101:http://www.minecraftforge.net/wiki/Debug_101

-hydroflame, author of the forge revolution-

Guest
This topic is now closed to further replies.

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.