Skip to content

Commit

Permalink
Update for 1.16.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorrell committed Sep 16, 2020
1 parent 0f51039 commit bb7b993
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ archives_base_name = skyblock

# Fabric Properties
# see https://modmuss50.me/fabric.html
minecraft_version=1.16.2
yarn_mappings=1.16.2+build.1
loader_version=0.9.1+build.205
fabric_api_version=0.17.2+build.396-1.16
minecraft_version=1.16.3
yarn_mappings=1.16.3+build.7
loader_version=0.9.3+build.207
fabric_api_version=0.20.2+build.402-1.16

# see https://masa.dy.fi/maven/carpet/fabric-carpet/
carpet_core_version=1.16.2-1.4.8+v200811
carpet_core_version=1.16.3-1.4.11+v200910
10 changes: 5 additions & 5 deletions src/main/java/skyblock/SkyBlockUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@
public class SkyBlockUtils {
public static SimpleRegistry<DimensionOptions> getSkyblockSimpleRegistry(Registry<DimensionType> dimensionTypeRegistry, Registry<Biome> biomeRegistry, Registry<ChunkGeneratorSettings> settingsRegistry, long seed) {
SimpleRegistry<DimensionOptions> simpleRegistry = new SimpleRegistry<>(Registry.DIMENSION_OPTIONS, Lifecycle.experimental());
simpleRegistry.add(DimensionOptions.NETHER, new DimensionOptions(() -> dimensionTypeRegistry.method_31140(DimensionType.THE_NETHER_REGISTRY_KEY), SkyBlockUtils.createNetherGenerator(biomeRegistry, settingsRegistry, seed)), Lifecycle.stable());
simpleRegistry.add(DimensionOptions.END, new DimensionOptions(() -> dimensionTypeRegistry.method_31140(DimensionType.THE_END_REGISTRY_KEY), SkyBlockUtils.createEndGenerator(biomeRegistry, settingsRegistry, seed)), Lifecycle.stable());
simpleRegistry.add(DimensionOptions.NETHER, new DimensionOptions(() -> dimensionTypeRegistry.get(DimensionType.THE_NETHER_REGISTRY_KEY), SkyBlockUtils.createNetherGenerator(biomeRegistry, settingsRegistry, seed)), Lifecycle.stable());
simpleRegistry.add(DimensionOptions.END, new DimensionOptions(() -> dimensionTypeRegistry.get(DimensionType.THE_END_REGISTRY_KEY), SkyBlockUtils.createEndGenerator(biomeRegistry, settingsRegistry, seed)), Lifecycle.stable());
return simpleRegistry;
}

public static SkyblockChunkGenerator createOverworldGenerator(Registry<Biome> biomeRegistry, Registry<ChunkGeneratorSettings> settingsRegistry, long seed) {
return new SkyblockChunkGenerator(seed, new VanillaLayeredBiomeSource(seed, false, false, biomeRegistry), () -> settingsRegistry.method_31140(ChunkGeneratorSettings.OVERWORLD));
return new SkyblockChunkGenerator(seed, new VanillaLayeredBiomeSource(seed, false, false, biomeRegistry), () -> settingsRegistry.get(ChunkGeneratorSettings.OVERWORLD));
}

public static SkyblockChunkGenerator createNetherGenerator(Registry<Biome> biomeRegistry, Registry<ChunkGeneratorSettings> settingsRegistry, long seed) {
return new SkyblockChunkGenerator(seed, MultiNoiseBiomeSource.Preset.NETHER.getBiomeSource(biomeRegistry, seed), () -> settingsRegistry.method_31140(ChunkGeneratorSettings.NETHER));
return new SkyblockChunkGenerator(seed, MultiNoiseBiomeSource.Preset.NETHER.getBiomeSource(biomeRegistry, seed), () -> settingsRegistry.get(ChunkGeneratorSettings.NETHER));
}

public static SkyblockChunkGenerator createEndGenerator(Registry<Biome> biomeRegistry, Registry<ChunkGeneratorSettings> settingsRegistry, long seed) {
return new SkyblockChunkGenerator(seed, new TheEndBiomeSource(biomeRegistry, seed), () -> settingsRegistry.method_31140(ChunkGeneratorSettings.END));
return new SkyblockChunkGenerator(seed, new TheEndBiomeSource(biomeRegistry, seed), () -> settingsRegistry.get(ChunkGeneratorSettings.END));
}
}
4 changes: 2 additions & 2 deletions src/main/java/skyblock/SkyblockChunkGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void carve(long seed, BiomeAccess access, Chunk chunk, GenerationStep.Car
@Override
public void generateFeatures(ChunkRegion region, StructureAccessor accessor) {
ChunkPos chunkPos = new ChunkPos(region.getCenterChunkX(), region.getCenterChunkZ());
BlockPos pos = chunkPos.getCenterBlockPos();
BlockPos pos = new BlockPos(chunkPos.getStartX() + 8, 0, chunkPos.getStartZ() + 8);

accessor.getStructuresWithChildren(ChunkSectionPos.from(pos), Registry.STRUCTURE_FEATURE.get(new Identifier("minecraft:stronghold"))).forEach((structureStart) -> {
for (StructurePiece piece : structureStart.getChildren()) {
Expand Down Expand Up @@ -201,7 +201,7 @@ private static void generateStrongholdPortal(ServerWorldAccess world, BlockPos p
fillRelativeBlock(world, endPortal, pos, 4, 3, 9, 6, 3, 11);
}

int spawnerPositionOption = random.nextInt() % 4;
int spawnerPositionOption = random.nextInt(4);
int x, y = 4, z;
switch (spawnerPositionOption) {
case 0:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/skyblock/mixin/GeneratorTypeMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private static void addSkyblockGenerator(CallbackInfo ci) {
VALUES.add(skyblockGeneratorType);
}

@Inject(method = "method_29077", at = @At("TAIL"), cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT)
@Inject(method = "createDefaultOptions", at = @At("TAIL"), cancellable = true, locals = LocalCapture.CAPTURE_FAILSOFT)
@SuppressWarnings("unused")
private void setToSkyblockChunkGenerator(DynamicRegistryManager.Impl impl, long seed, boolean generateStructures, boolean bonusChest, CallbackInfoReturnable<GeneratorOptions> cir, Registry<Biome> biomeRegistry, Registry<DimensionType> dimensionTypeRegistry, Registry<ChunkGeneratorSettings> settingsRegistry) {
if (this.isSkyblock()) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/skyblock/mixin/LevelPropertiesMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public abstract class LevelPropertiesMixin {

// Removes the annoying "This is experimental; Thar Be Dragons" message before starting any world with a skyblock chunk generator
@Environment(EnvType.CLIENT)
@Inject(method = "method_29588", at = @At("HEAD"), cancellable = true)
@Inject(method = "getLifecycle", at = @At("HEAD"), cancellable = true)
@SuppressWarnings("unused")
private void markAsStable(CallbackInfoReturnable<Lifecycle> cir) {
if (this.generatorOptions.getChunkGenerator() instanceof SkyblockChunkGenerator) {
Expand Down

0 comments on commit bb7b993

Please sign in to comment.