1.18-pre4
This commit is contained in:
1 parent
59e0a9ebaf
commit
90964e2e57
5 files changed
+15
-17
No files matched your search
+3
-3
@@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# 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=1.18-pre2
|
minecraft_version=1.18-pre4
|
||||||
yarn_mappings=1.18-pre2+build.1
|
yarn_mappings=1.18-pre4+build.2
|
||||||
loader_version=0.12.5
|
loader_version=0.12.5
|
||||||
fabric_version=0.42.4+1.18
|
fabric_version=0.42.6+1.18
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.53
|
mod_version = 1.4.53
|
||||||
|
|||||||
@@ -13,5 +13,4 @@ import net.minecraft.world.gen.feature.FeatureConfig;
|
|||||||
public interface StructureFeatureInterface<C extends FeatureConfig>
|
public interface StructureFeatureInterface<C extends FeatureConfig>
|
||||||
{
|
{
|
||||||
boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly,Biome biome, C config);
|
boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly,Biome biome, C config);
|
||||||
boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,7 @@ package carpet.mixins;
|
|||||||
import carpet.CarpetSettings;
|
import carpet.CarpetSettings;
|
||||||
import carpet.fakes.StructureFeatureInterface;
|
import carpet.fakes.StructureFeatureInterface;
|
||||||
import com.google.common.collect.ImmutableMultimap;
|
import com.google.common.collect.ImmutableMultimap;
|
||||||
|
import net.minecraft.class_6834;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.structure.StructurePiecesCollector;
|
import net.minecraft.structure.StructurePiecesCollector;
|
||||||
import net.minecraft.structure.StructurePiecesGenerator;
|
import net.minecraft.structure.StructurePiecesGenerator;
|
||||||
@@ -32,6 +33,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||||||
import org.spongepowered.asm.mixin.Shadow;
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
@@ -45,12 +47,14 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
|||||||
//@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos chunkPos, Biome biome, ChunkPos chunkPos2, C featureConfig, HeightLimitView heightLimitView);
|
//@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos chunkPos, Biome biome, ChunkPos chunkPos2, C featureConfig, HeightLimitView heightLimitView);
|
||||||
|
|
||||||
//@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos pos, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
//@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, ChunkPos pos, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
||||||
@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
//@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
||||||
|
|
||||||
//@Shadow @Final private class_6622<C> field_34929;
|
//@Shadow @Final private class_6622<C> field_34929;
|
||||||
|
|
||||||
|
|
||||||
@Shadow @Final private StructurePiecesGenerator<C> piecesGenerator;
|
//@Shadow @Final private StructurePiecesGenerator<C> piecesGenerator;
|
||||||
|
|
||||||
|
@Shadow @Final private class_6834<C> piecesGenerator;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly, Biome biome, C config)
|
public boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly, Biome biome, C config)
|
||||||
@@ -138,9 +142,10 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
|||||||
|
|
||||||
//if (config == null)
|
//if (config == null)
|
||||||
// config = (C) new DefaultFeatureConfig();
|
// config = (C) new DefaultFeatureConfig();
|
||||||
|
Optional<StructurePiecesGenerator<C>> optional = piecesGenerator.createGenerator(new class_6834.class_6835<C>(generator, generator.getBiomeSource(), worldIn.getSeed(), chunkpos, config, worldIn, b -> true, worldIn.getStructureManager(), worldIn.getRegistryManager()));
|
||||||
|
if (optional.isEmpty()) return (StructureStart<C>) StructureStart.DEFAULT;
|
||||||
StructurePiecesCollector lv = new StructurePiecesCollector();
|
StructurePiecesCollector lv = new StructurePiecesCollector();
|
||||||
piecesGenerator.generatePieces(lv, config, new StructurePiecesGenerator.Context(worldIn.getRegistryManager(), generator, worldIn.getStructureManager(), chunkpos, b -> true, worldIn, Util.make(new ChunkRandom(new AtomicSimpleRandom(RandomSeed.getSeed())), (chunkRandomx) -> {
|
optional.get().generatePieces(lv, new StructurePiecesGenerator.Context<C>(config, generator, worldIn.getStructureManager(), chunkpos, worldIn, Util.make(new ChunkRandom(new AtomicSimpleRandom(RandomSeed.getSeed())), (chunkRandomx) -> {
|
||||||
chunkRandomx.setCarverSeed(worldIn.getSeed(), chunkpos.x, chunkpos.z);
|
chunkRandomx.setCarverSeed(worldIn.getSeed(), chunkpos.x, chunkpos.z);
|
||||||
}), worldIn.getSeed()));
|
}), worldIn.getSeed()));
|
||||||
StructureStart<C> structurestart1 = new StructureStart<>(thiss, chunkpos, 0, lv.toList());
|
StructureStart<C> structurestart1 = new StructureStart<>(thiss, chunkpos, 0, lv.toList());
|
||||||
@@ -159,10 +164,4 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
|||||||
//long2objectmap.put(packedChunkPos, structurestart);
|
//long2objectmap.put(packedChunkPos, structurestart);
|
||||||
return structurestart1;
|
return structurestart1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView)
|
|
||||||
{
|
|
||||||
return shouldStartAt(chunkGenerator, biomeSource, l, chunkPos, featureConfig, heightLimitView);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ public class WorldTools
|
|||||||
if (region == null) return false;
|
if (region == null) return false;
|
||||||
return region.hasChunk(chpos);
|
return region.hasChunk(chpos);
|
||||||
}
|
}
|
||||||
Path regionPath = new File(((MinecraftServerInterface )world.getServer()).getCMSession().getWorldDirectory(world.getRegistryKey()), "region").toPath();
|
Path regionPath = new File(((MinecraftServerInterface )world.getServer()).getCMSession().getWorldDirectory(world.getRegistryKey()).toFile(), "region").toPath();
|
||||||
Path regionFilePath = regionPath.resolve(currentRegionName);
|
Path regionFilePath = regionPath.resolve(currentRegionName);
|
||||||
File regionFile = regionFilePath.toFile();
|
File regionFile = regionFilePath.toFile();
|
||||||
if (!regionFile.exists())
|
if (!regionFile.exists())
|
||||||
@@ -65,7 +65,7 @@ public class WorldTools
|
|||||||
if (!deepcheck) return true; // not using cache in this case.
|
if (!deepcheck) return true; // not using cache in this case.
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
RegionFile region = new RegionFile(regionFile, regionPath.toFile(), true);
|
RegionFile region = new RegionFile(regionFile.toPath(), regionPath, true);
|
||||||
if (regionCache != null) regionCache.put(currentRegionName, region);
|
if (regionCache != null) regionCache.put(currentRegionName, region);
|
||||||
return region.hasChunk(chpos);
|
return region.hasChunk(chpos);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -564,7 +564,7 @@ public class SettingsManager
|
|||||||
smartSuggestionList.add(listItem);
|
smartSuggestionList.add(listItem);
|
||||||
}
|
}
|
||||||
// Regular prefix matching, reference: CommandSource.suggestMatching
|
// Regular prefix matching, reference: CommandSource.suggestMatching
|
||||||
if (CommandSource.method_27136(query, listItem.toLowerCase())) {
|
if (CommandSource.shouldSuggest(query, listItem.toLowerCase())) {
|
||||||
regularSuggestionList.add(listItem);
|
regularSuggestionList.add(listItem);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user