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

Nofraag

Members
  • Joined

  • Last visited

Everything posted by Nofraag

  1. no, no it does get reached the problem it's that chunk.getHeight for some reason returns -64 instead of the actual highest block on that position (the line System.out.println("block: " + state.getBlock() + ", height: " + highestY);) keeps printing block: minecraft:void_air, height: -64
  2. @SubscribeEvent public void onChunkLoad(ChunkEvent.Load event) { if (!(event.getLevel() instanceof Level level) || !event.isNewChunk()) return; if (level.isClientSide()) { ChunkAccess chunk = event.getChunk(); ChunkPos pos = chunk.getPos(); Vector2i coordinatesToWorld = new Vector2i(pos.x * 16, pos.z * 16); Vector2i chunk_origin = new Vector2i( Math.floorMod(coordinatesToWorld.x, 512), Math.floorMod(coordinatesToWorld.y, 512) ); Vector2i region_coordinates = new Vector2i( pos.getRegionX(), pos.getRegionZ() ); int[] colors_data = new int[256]; for (int z = 0; z < 16; z++) { for (int x = 0; x < 16; x++) { int highestY = chunk.getHeight( Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, x, z ); BlockPos blockPos = pos.getBlockAt(x, highestY-1, z); BlockState state = level.getBlockState(blockPos); int colorsValue = getColorsValue(state); System.out.println("block: " + state.getBlock() + ", height: " + highestY); colors_data[z * 16 + x] = colorsValue; } } MinecraftServer server = ServerLifecycleHooks.getCurrentServer(); if (server != null) { ExampleMod.MOD_FOLDER.AttemptToModifyRegionArea( chunk_origin.x, chunk_origin.y, 16, 16, colors_data, new RegionRecord( level.dimension().location().toString(), server.getWorldData().getLevelName(), region_coordinates ) ); } } }

Account

Navigation

Search

Search

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.