This commit is contained in:
gnembon committed 2020-05-27 00:46:44 -03:00
1 parent 571a77ce64
commit 243c3290ae
6 files changed
+13 -13

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx1G
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
# or better: https://modmuss50.me/fabric.html # or better: https://modmuss50.me/fabric.html
minecraft_version=20w21a minecraft_version=20w21a
yarn_mappings=20w21a+build.10 yarn_mappings=20w21a+build.16
loader_version=0.8.4+build.198 loader_version=0.8.4+build.198
# Mod Properties # Mod Properties
@@ -1,9 +1,9 @@
package carpet.fakes; package carpet.fakes;
import net.minecraft.class_5312; import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
import net.minecraft.world.gen.feature.StructureFeature; import net.minecraft.world.gen.feature.StructureFeature;
public interface BiomeInterface public interface BiomeInterface
{ {
class_5312<?, ?> getConfiguredFeature(StructureFeature<?> arg); ConfiguredStructureFeature<?, ?> getConfiguredFeature(StructureFeature<?> arg);
} }
@@ -6,7 +6,6 @@ import carpet.fakes.StructureFeatureInterface;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.class_5312;
import net.minecraft.class_5314; import net.minecraft.class_5314;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.structure.StructureManager; import net.minecraft.structure.StructureManager;
@@ -32,6 +31,7 @@ import net.minecraft.world.gen.decorator.BeehiveTreeDecorator;
import net.minecraft.world.gen.feature.BastionRemnantFeatureConfig; import net.minecraft.world.gen.feature.BastionRemnantFeatureConfig;
import net.minecraft.world.gen.feature.BoulderFeatureConfig; import net.minecraft.world.gen.feature.BoulderFeatureConfig;
import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.FeatureConfig; import net.minecraft.world.gen.feature.FeatureConfig;
@@ -140,7 +140,7 @@ public class FeatureGenerator
ChunkRandom chunkRandom = new ChunkRandom(); ChunkRandom chunkRandom = new ChunkRandom();
ChunkPos chunkPos = new ChunkPos(pos); ChunkPos chunkPos = new ChunkPos(pos);
Biome biome = biomeAccess.getBiome(new BlockPos(chunkPos.getStartX() + 9, 0, chunkPos.getStartZ() + 9)); Biome biome = biomeAccess.getBiome(new BlockPos(chunkPos.getStartX() + 9, 0, chunkPos.getStartZ() + 9));
class_5312<?, ?> configuredFeature = ((BiomeInterface)biome).getConfiguredFeature(structure); ConfiguredStructureFeature<?, ?> configuredFeature = ((BiomeInterface)biome).getConfiguredFeature(structure);
if (configuredFeature == null) return null; if (configuredFeature == null) return null;
ChunkPos chunkPos2 = structure.method_27218(params, seed, chunkRandom, chunkPos.x, chunkPos.z); //find some chunk I guess ChunkPos chunkPos2 = structure.method_27218(params, seed, chunkRandom, chunkPos.x, chunkPos.z); //find some chunk I guess
if (chunkPos.x == chunkPos2.x && chunkPos.z == chunkPos2.z && ((StructureFeatureInterface)structure).shouldStartPublicAt(generator, generator.getBiomeSource(), seed, chunkRandom, chunkPos.x, chunkPos.z, biome, chunkPos, configuredFeature.field_24836)) // should start at if (chunkPos.x == chunkPos2.x && chunkPos.z == chunkPos2.z && ((StructureFeatureInterface)structure).shouldStartPublicAt(generator, generator.getBiomeSource(), seed, chunkRandom, chunkPos.x, chunkPos.z, biome, chunkPos, configuredFeature.field_24836)) // should start at
@@ -1,8 +1,8 @@
package carpet.mixins; package carpet.mixins;
import carpet.fakes.BiomeInterface; import carpet.fakes.BiomeInterface;
import net.minecraft.class_5312;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
import net.minecraft.world.gen.feature.StructureFeature; import net.minecraft.world.gen.feature.StructureFeature;
import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
@@ -13,10 +13,10 @@ import java.util.Map;
@Mixin(Biome.class) @Mixin(Biome.class)
public class Biome_scarpetMixin implements BiomeInterface public class Biome_scarpetMixin implements BiomeInterface
{ {
@Shadow @Final private Map<StructureFeature<?>, class_5312<?, ?>> structureFeatures; @Shadow @Final private Map<StructureFeature<?>, ConfiguredStructureFeature<?, ?>> structureFeatures;
@Override @Override
public class_5312<?, ?> getConfiguredFeature(StructureFeature<?> arg) public ConfiguredStructureFeature<?, ?> getConfiguredFeature(StructureFeature<?> arg)
{ {
return structureFeatures.get(arg); return structureFeatures.get(arg);
} }
@@ -44,11 +44,11 @@ public abstract class CoralBlockMixin implements Fertilizable
CoralFeature coral; CoralFeature coral;
int variant = random.nextInt(3); int variant = random.nextInt(3);
if (variant == 0) if (variant == 0)
coral = new CoralClawFeature(DefaultFeatureConfig.field_24893); coral = new CoralClawFeature(DefaultFeatureConfig.CODEC);
else if (variant == 1) else if (variant == 1)
coral = new CoralTreeFeature(DefaultFeatureConfig.field_24893); coral = new CoralTreeFeature(DefaultFeatureConfig.CODEC);
else else
coral = new CoralMushroomFeature(DefaultFeatureConfig.field_24893); coral = new CoralMushroomFeature(DefaultFeatureConfig.CODEC);
MaterialColor color = blockUnder.getTopMaterialColor(worldIn, pos); MaterialColor color = blockUnder.getTopMaterialColor(worldIn, pos);
BlockState proper_block = blockUnder; BlockState proper_block = blockUnder;
@@ -1195,7 +1195,7 @@ public class CarpetExpression
String reqString = requested.getString(); String reqString = requested.getString();
String structureName = FeatureGenerator.featureToStructure.get(reqString); String structureName = FeatureGenerator.featureToStructure.get(reqString);
if (structureName == null) throw new InternalExpressionException("Unknown structure: " + reqString); if (structureName == null) throw new InternalExpressionException("Unknown structure: " + reqString);
structure = StructureFeature.field_24842.get(structureName.toLowerCase(Locale.ROOT)); structure = StructureFeature.STRUCTURES.get(structureName.toLowerCase(Locale.ROOT));
if (structure == null) throw new InternalExpressionException("Unsupported structure: " + structureName); if (structure == null) throw new InternalExpressionException("Unsupported structure: " + structureName);
} }
if (lv.size() > locator.offset+1) if (lv.size() > locator.offset+1)
@@ -1212,7 +1212,7 @@ public class CarpetExpression
return (_c, _t) -> ret; return (_c, _t) -> ret;
} }
Map<Value, Value> ret = new HashMap<>(); Map<Value, Value> ret = new HashMap<>();
for(StructureFeature<?> str : StructureFeature.field_24842.values()) for(StructureFeature<?> str : StructureFeature.STRUCTURES.values())
{ {
StructureStart start = FeatureGenerator.shouldStructureStartAt(world, pos, str, needSize); StructureStart start = FeatureGenerator.shouldStructureStartAt(world, pos, str, needSize);
if (start == null) continue; if (start == null) continue;