Skip to content

Instantly share code, notes, and snippets.

View TelepathicGrunt's full-sized avatar
🦎
Just chilling around!

TelepathicGrunt TelepathicGrunt

🦎
Just chilling around!
View GitHub Profile
public static List<BlockPos> matchingBlocksOfKindInRange(Level level, BlockPos centerPos, int radius, Predicate<BlockState> predicate) {
List<BlockPos> validPos = new ObjectArrayList<>();
// Figure out how many chunk radius we need to search outward to encompass the radius properly
ChunkPos maxChunkPos = new ChunkPos(
SectionPos.blockToSectionCoord(centerPos.getX() + radius),
SectionPos.blockToSectionCoord(centerPos.getZ() + radius)
);
ChunkPos minChunkPos = new ChunkPos(

NOTE: Gist contents is moved to this repo for easier maintaining and record-keeping: https://github.com/neoforged/.github/tree/main/changes/technical_changes

A small selection of changes that were done in NeoForge since it's creation. This is not all of them. Most changes can be seen in PRs and Commits on the NeoForged GitHub organization's repositories.


Mod Loader

  1. Multiple mod entry points allowed now. Can even specify an entry point to be client only for better client code separation.
    https://docs.neoforged.net/docs/concepts/sides#mod

  2. Capability refactor to split it into Data Attachment and Capabilities separately and cleaner.https://docs.neoforged.net/docs/datastorage/attachmentshttps://docs.neoforged.net/docs/datastorage/capabilities
public class StructureBiomeCheckCommand {
public static void createCommand(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext buildContext) {
String commandString = "checkvalidstructurebiomes";
LiteralCommandNode<CommandSourceStack> source = dispatcher.register(Commands.literal(commandString)
.requires((permission) -> permission.hasPermission(2))
.executes(cs -> {
checkBiomesForStructures(cs);
return 1;
}));