Skip to content

Commit

Permalink
[NeoForge] 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Dec 10, 2024
1 parent 655d5f1 commit 0b5986f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ antlr = "4.13.1"
fabric-api = "0.110.5+1.21.4"

neogradle = "7.0.171"
neoforge-minecraft = "1.21.3"
neoforge-minecraft = "1.21.4"

sponge-minecraft = "1.21.3"
# https://repo.spongepowered.org/service/rest/repository/browse/maven-public/org/spongepowered/spongeapi/
Expand Down Expand Up @@ -92,7 +92,7 @@ fabric-minecraft = "com.mojang:minecraft:1.21.4"
fabric-loader = "net.fabricmc:fabric-loader:0.16.9"
fabric-permissions-api = "me.lucko:fabric-permissions-api:0.3.1"

neoforge = "net.neoforged:neoforge:21.3.40-beta"
neoforge = "net.neoforged:neoforge:21.4.8-beta"

# Mojang-provided libraries, CHECK AGAINST MINECRAFT for versions
guava = "com.google.guava:guava:33.3.1-jre!!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
import net.minecraft.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.core.SectionPos;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.features.EndFeatures;
Expand Down Expand Up @@ -477,15 +478,16 @@ public boolean generateFeature(ConfiguredFeatureType type, EditSession editSessi
@Override
public boolean generateStructure(StructureType type, EditSession editSession, BlockVector3 position) {
ServerLevel world = getWorld();
Structure k = world.registryAccess().lookupOrThrow(Registries.STRUCTURE).getValue(ResourceLocation.tryParse(type.id()));
Registry<Structure> structureRegistry = world.registryAccess().lookupOrThrow(Registries.STRUCTURE);
Structure k = structureRegistry.getValue(ResourceLocation.tryParse(type.id()));
if (k == null) {
return false;
}

ServerChunkCache chunkManager = world.getChunkSource();
WorldGenLevel proxyLevel = NeoForgeServerLevelDelegateProxy.newInstance(editSession, world);
ChunkPos chunkPos = new ChunkPos(new BlockPos(position.x(), position.y(), position.z()));
StructureStart structureStart = k.generate(world.registryAccess(), chunkManager.getGenerator(), chunkManager.getGenerator().getBiomeSource(), chunkManager.randomState(), world.getStructureManager(), world.getSeed(), chunkPos, 0, proxyLevel, biome -> true);
StructureStart structureStart = k.generate(structureRegistry.wrapAsHolder(k), world.dimension(), world.registryAccess(), chunkManager.getGenerator(), chunkManager.getGenerator().getBiomeSource(), chunkManager.randomState(), world.getStructureManager(), world.getSeed(), chunkPos, 0, proxyLevel, biome -> true);

if (!structureStart.isValid()) {
return false;
Expand Down

0 comments on commit 0b5986f

Please sign in to comment.