mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
21w38a
This commit is contained in:
parent
f7f6de1ef6
commit
dc3d5c4769
15 changed files with 38 additions and 58 deletions
build.gradle
fabric-biome-api-v1
fabric-events-interaction-v0
build.gradle
src/main/java/net/fabricmc/fabric/mixin/event/interaction
fabric-renderer-api-v1
fabric-structure-api-v1
build.gradle
src/testmod/java/net/fabricmc/fabric/test/structure
|
@ -19,9 +19,9 @@ plugins {
|
|||
def ENV = System.getenv()
|
||||
|
||||
class Globals {
|
||||
static def baseVersion = "0.40.3"
|
||||
static def mcVersion = "21w37a"
|
||||
static def yarnVersion = "+build.10"
|
||||
static def baseVersion = "0.40.4"
|
||||
static def mcVersion = "21w38a"
|
||||
static def yarnVersion = "+build.1"
|
||||
static def loaderVersion = "0.11.7"
|
||||
static def preRelease = true
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-biome-api-v1"
|
||||
version = getSubprojectVersion(project, "4.0.0")
|
||||
version = getSubprojectVersion(project, "4.0.1")
|
||||
|
||||
loom {
|
||||
accessWidenerPath = file("src/main/resources/fabric-biome-api-v1.accesswidener")
|
||||
|
|
|
@ -41,12 +41,12 @@ public final class NetherBiomes {
|
|||
*/
|
||||
public static void addNetherBiome(RegistryKey<Biome> biome, MultiNoiseUtil.NoiseValuePoint mixedNoisePoint) {
|
||||
NetherBiomeData.addNetherBiome(biome, MultiNoiseUtil.createNoiseHypercube(
|
||||
mixedNoisePoint.getTemperatureNoise(),
|
||||
mixedNoisePoint.getHumidityNoise(),
|
||||
mixedNoisePoint.getContinentalnessNoise(),
|
||||
mixedNoisePoint.getErosionNoise(),
|
||||
mixedNoisePoint.getDepth(),
|
||||
mixedNoisePoint.getWeirdnessNoise(),
|
||||
mixedNoisePoint.temperatureNoise(),
|
||||
mixedNoisePoint.humidityNoise(),
|
||||
mixedNoisePoint.continentalnessNoise(),
|
||||
mixedNoisePoint.erosionNoise(),
|
||||
mixedNoisePoint.depth(),
|
||||
mixedNoisePoint.weirdnessNoise(),
|
||||
0
|
||||
));
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public class BiomeSelectionContextImpl implements BiomeSelectionContext {
|
|||
for (Map.Entry<RegistryKey<ChunkGeneratorSettings>, ChunkGeneratorSettings> entry : chunkGeneratorSettings.getEntries()) {
|
||||
StructuresConfig structuresConfig = entry.getValue().getStructuresConfig();
|
||||
|
||||
if (structuresConfig.method_38424(instance.feature).get(instance).contains(getBiomeKey())) {
|
||||
if (structuresConfig.getConfiguredStructureFeature(instance.feature).get(instance).contains(getBiomeKey())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,7 @@ public final class BiomeStructureStartsImpl {
|
|||
}
|
||||
|
||||
private static Map<StructureFeature<?>, Multimap<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>>> unfreeze(ChunkGeneratorSettings settings) {
|
||||
ImmutableMap<StructureFeature<?>, ImmutableMultimap<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>>> frozenMap = settings.getStructuresConfig().field_34696;
|
||||
ImmutableMap<StructureFeature<?>, ImmutableMultimap<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>>> frozenMap = settings.getStructuresConfig().configuredStructures;
|
||||
Map<StructureFeature<?>, Multimap<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>>> result = new HashMap<>(frozenMap.size());
|
||||
|
||||
for (Map.Entry<StructureFeature<?>, ImmutableMultimap<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>>> entry : frozenMap.entrySet()) {
|
||||
|
@ -144,7 +144,7 @@ public final class BiomeStructureStartsImpl {
|
|||
}
|
||||
|
||||
private static void freeze(ChunkGeneratorSettings settings, Map<StructureFeature<?>, Multimap<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>>> structureStarts) {
|
||||
settings.getStructuresConfig().field_34696 = structureStarts.entrySet().stream()
|
||||
settings.getStructuresConfig().configuredStructures = structureStarts.entrySet().stream()
|
||||
.collect(ImmutableMap.toImmutableMap(
|
||||
Map.Entry::getKey,
|
||||
e -> ImmutableMultimap.copyOf(e.getValue())
|
||||
|
|
|
@ -30,7 +30,7 @@ import net.minecraft.util.registry.RegistryKey;
|
|||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.source.TheEndBiomeSource;
|
||||
import net.minecraft.world.biome.source.util.MultiNoiseUtil;
|
||||
import net.minecraft.world.gen.ChunkRandom;
|
||||
import net.minecraft.world.gen.random.ChunkRandom;
|
||||
|
||||
import net.fabricmc.fabric.impl.biome.TheEndBiomeData;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
accessWidener v1 named
|
||||
accessible class net/minecraft/world/biome/Biome$Weather
|
||||
accessible field net/minecraft/world/gen/chunk/StructuresConfig field_34696 Lcom/google/common/collect/ImmutableMap;
|
||||
mutable field net/minecraft/world/gen/chunk/StructuresConfig field_34696 Lcom/google/common/collect/ImmutableMap;
|
||||
accessible field net/minecraft/world/gen/chunk/StructuresConfig configuredStructures Lcom/google/common/collect/ImmutableMap;
|
||||
mutable field net/minecraft/world/gen/chunk/StructuresConfig configuredStructures Lcom/google/common/collect/ImmutableMap;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-events-interaction-v0"
|
||||
version = getSubprojectVersion(project, "0.4.11")
|
||||
version = getSubprojectVersion(project, "0.4.12")
|
||||
|
||||
moduleDependencies(project, [
|
||||
'fabric-api-base'
|
||||
|
|
|
@ -68,7 +68,7 @@ public class MixinServerPlayerInteractionManager {
|
|||
BlockEntity blockEntity = world.getBlockEntity(pos);
|
||||
|
||||
if (blockEntity != null) {
|
||||
Packet<ClientPlayPacketListener> updatePacket = blockEntity.method_38235();
|
||||
Packet<ClientPlayPacketListener> updatePacket = blockEntity.toUpdatePacket();
|
||||
|
||||
if (updatePacket != null) {
|
||||
this.player.networkHandler.sendPacket(updatePacket);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-renderer-api-v1"
|
||||
version = getSubprojectVersion(project, "0.4.5")
|
||||
version = getSubprojectVersion(project, "0.4.6")
|
||||
|
||||
moduleDependencies(project, [
|
||||
'fabric-api-base'
|
||||
|
|
|
@ -88,8 +88,8 @@ public final class FrameBlockEntity extends BlockEntity implements RenderAttachm
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockEntityUpdateS2CPacket method_38235() {
|
||||
return BlockEntityUpdateS2CPacket.method_38585(this);
|
||||
public BlockEntityUpdateS2CPacket toUpdatePacket() {
|
||||
return BlockEntityUpdateS2CPacket.create(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
archivesBaseName = "fabric-structure-api-v1"
|
||||
version = getSubprojectVersion(project, "2.0.0")
|
||||
version = getSubprojectVersion(project, "2.0.1")
|
||||
moduleDependencies(project, [
|
||||
'fabric-lifecycle-events-v1',
|
||||
'fabric-api-base'
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
package net.fabricmc.fabric.test.structure;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
@ -25,27 +24,23 @@ import org.apache.logging.log4j.Logger;
|
|||
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.structure.StructureManager;
|
||||
import net.minecraft.structure.StructurePieceType;
|
||||
import net.minecraft.structure.ShiftableStructurePiece;
|
||||
import net.minecraft.structure.StructureStart;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.registry.DynamicRegistryManager;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.HeightLimitView;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.gen.feature.StructureFeature;
|
||||
import net.minecraft.class_6622;
|
||||
import net.minecraft.class_6626;
|
||||
|
||||
import net.fabricmc.fabric.api.structure.v1.FabricStructureBuilder;
|
||||
|
||||
|
@ -54,7 +49,7 @@ public class StructureTest {
|
|||
|
||||
public static final StructureFeature<DefaultFeatureConfig> STRUCTURE = new TestStructureFeature(DefaultFeatureConfig.CODEC);
|
||||
public static final ConfiguredStructureFeature<DefaultFeatureConfig, ? extends StructureFeature<DefaultFeatureConfig>> CONFIGURED_STRUCTURE = STRUCTURE.configure(new DefaultFeatureConfig());
|
||||
public static final StructurePieceType PIECE = TestStructureGenerator::new;
|
||||
public static final StructurePieceType.class_6615 PIECE = TestStructureGenerator::new;
|
||||
|
||||
static {
|
||||
LOGGER.info("Registering test structure");
|
||||
|
@ -69,29 +64,16 @@ public class StructureTest {
|
|||
|
||||
public static class TestStructureFeature extends StructureFeature<DefaultFeatureConfig> {
|
||||
public TestStructureFeature(Codec<DefaultFeatureConfig> codec) {
|
||||
super(codec);
|
||||
super(codec, TestStructureFeature::generate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StructureStartFactory<DefaultFeatureConfig> getStructureStartFactory() {
|
||||
return Start::new;
|
||||
}
|
||||
private static void generate(class_6626 arg, DefaultFeatureConfig defaultFeatureConfig, class_6622.class_6623 arg2) {
|
||||
int blockX = arg2.comp_127().getStartX();
|
||||
int blockZ = arg2.comp_127().getStartZ();
|
||||
int blockY = arg2.comp_125().getHeight(blockX, blockZ, Heightmap.Type.WORLD_SURFACE_WG, arg2.comp_129());
|
||||
|
||||
public static class Start extends StructureStart<DefaultFeatureConfig> {
|
||||
public Start(StructureFeature<DefaultFeatureConfig> feature, ChunkPos pos, int i, long l) {
|
||||
super(feature, pos, i, l);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(DynamicRegistryManager registryManager, ChunkGenerator chunkGenerator, StructureManager manager, ChunkPos chunkPos, DefaultFeatureConfig featureConfig, HeightLimitView heightLimitView, Predicate<Biome> predicate) {
|
||||
int blockX = chunkPos.getStartX();
|
||||
int blockZ = chunkPos.getStartZ();
|
||||
int blockY = chunkGenerator.getHeight(blockX, blockZ, Heightmap.Type.WORLD_SURFACE_WG, heightLimitView);
|
||||
|
||||
TestStructureGenerator generator = new TestStructureGenerator(random, blockX, blockY, blockZ);
|
||||
this.children.add(generator);
|
||||
setBoundingBoxFromChildren();
|
||||
}
|
||||
TestStructureGenerator generator = new TestStructureGenerator(arg2.comp_130(), blockX, blockY, blockZ);
|
||||
arg.addPiece(generator);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -100,12 +82,12 @@ public class StructureTest {
|
|||
super(PIECE, x, y, z, 0, 48, 16, getRandomHorizontalDirection(random));
|
||||
}
|
||||
|
||||
protected TestStructureGenerator(ServerWorld serverWorld, NbtCompound compoundTag) {
|
||||
super(PIECE, compoundTag);
|
||||
public TestStructureGenerator(NbtCompound nbtCompound) {
|
||||
super(PIECE, nbtCompound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess structureWorldAccess, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox boundingBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
public void generate(StructureWorldAccess structureWorldAccess, StructureAccessor structureAccessor, ChunkGenerator chunkGenerator, Random random, BlockBox boundingBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
for (int x = 0; x < 48; x++) {
|
||||
for (int z = 0; z < 48; z++) {
|
||||
for (int y = 0; y < 16; y++) {
|
||||
|
@ -113,8 +95,6 @@ public class StructureTest {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.spongepowered.asm.mixin.injection.Constant;
|
|||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
|
||||
import net.minecraft.nbt.NbtCompound;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.class_6625;
|
||||
import net.minecraft.world.ChunkSerializer;
|
||||
|
||||
@Mixin(ChunkSerializer.class)
|
||||
|
@ -30,7 +30,7 @@ abstract class ChunkSerializerMixin {
|
|||
* @reason Changes the logging message for the `unknown structure start` to describe which chunk the missing structure is located in for debugging purposes.
|
||||
*/
|
||||
@ModifyConstant(method = "readStructureStarts", constant = @Constant(stringValue = "Unknown structure start: {}"))
|
||||
private static String modifyErrorMessage(String original, ServerWorld serverWorld, NbtCompound tag, long worldSeed) {
|
||||
private static String modifyErrorMessage(String original, class_6625 class_6625, NbtCompound tag, long worldSeed) {
|
||||
// Use coordinates in tag to determine the position of the chunk
|
||||
final int xPos = tag.getInt("xPos");
|
||||
final int zPos = tag.getInt("zPos");
|
||||
|
|
|
@ -33,7 +33,7 @@ import net.fabricmc.fabric.test.structure.StructureTest;
|
|||
|
||||
@Mixin(ConfiguredStructureFeatures.class)
|
||||
public class MixinConfiguredStructureFeatures {
|
||||
@Inject(method = "method_38570", at = @At("TAIL"))
|
||||
@Inject(method = "registerAll", at = @At("TAIL"))
|
||||
private static void addStructuresToBiomes(BiConsumer<ConfiguredStructureFeature<?, ?>, RegistryKey<Biome>> consumer, CallbackInfo ci) {
|
||||
consumer.accept(StructureTest.CONFIGURED_STRUCTURE, BiomeKeys.PLAINS);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue