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.

blueDude-owo

Members
  • Joined

  • Last visited

Everything posted by blueDude-owo

  1. i need help with changing the blockstate of my block when a certain block is near it here's the code: package net.blub.blub_mod.block; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.state.BooleanProperty; import net.minecraft.state.StateContainer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.IWorldReader; public class BluestoneWire extends Block { public static final BooleanProperty NORTH = BooleanProperty.create("north"); public static final BooleanProperty SOUTH = BooleanProperty.create("south"); public static final BooleanProperty EAST = BooleanProperty.create("east"); public static final BooleanProperty WEST = BooleanProperty.create("west"); public BluestoneWire(Properties properties) { super(properties); this.registerDefaultState(this.stateDefinition.any().setValue(NORTH, false).setValue(SOUTH, false).setValue(EAST, false).setValue(WEST, false)); } @Override public void onNeighborChange(BlockState state, IWorldReader world, BlockPos pos, BlockPos neighbor) { int x = pos.getX(); int nx = pos.getX()-1; int y = pos.getY(); int ny = pos.getY()-1; int z = pos.getZ(); int nz = pos.getZ()-1; BlockPos posnz = new BlockPos(x, y, nz); if ((world.getBlockState(posnz).getBlock()) == Blocks.ANDESITE) { state.setValue(NORTH, true); } else { state.setValue(NORTH, false); } super.onNeighborChange(state, world, pos, neighbor); } protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> stateContainer) { stateContainer.add(NORTH, SOUTH, EAST, WEST); } }

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.