21w05a
This commit is contained in:
1 parent
71a8dcc31e
commit
50eae09c17
5 files changed
+18
-13
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=21w03a
|
minecraft_version=21w05a
|
||||||
yarn_mappings=21w03a+build.1
|
yarn_mappings=21w05a+build.1
|
||||||
loader_version=0.11.1
|
loader_version=0.11.1
|
||||||
fabric_version=0.29.4+1.16
|
fabric_version=0.30.0+1.17
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.4.24
|
mod_version = 1.4.24
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package carpet.fakes;
|
|||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.ChunkPos;
|
import net.minecraft.util.math.ChunkPos;
|
||||||
|
import net.minecraft.world.HeightLimitView;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.source.BiomeSource;
|
import net.minecraft.world.biome.source.BiomeSource;
|
||||||
import net.minecraft.world.gen.ChunkRandom;
|
import net.minecraft.world.gen.ChunkRandom;
|
||||||
@@ -12,5 +13,5 @@ import net.minecraft.world.gen.feature.FeatureConfig;
|
|||||||
public interface StructureFeatureInterface<C>
|
public interface StructureFeatureInterface<C>
|
||||||
{
|
{
|
||||||
boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly,Biome biome, FeatureConfig config);
|
boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly,Biome biome, FeatureConfig config);
|
||||||
boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, int i, int j, Biome biome, ChunkPos chunkPos, C featureConfig);
|
boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, int i, int j, Biome biome, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView);
|
||||||
}
|
}
|
||||||
@@ -156,12 +156,14 @@ public class FeatureGenerator
|
|||||||
ConfiguredStructureFeature<?, ?> configuredFeature = biome.getGenerationSettings().method_30978(structure.configure(null));
|
ConfiguredStructureFeature<?, ?> configuredFeature = biome.getGenerationSettings().method_30978(structure.configure(null));
|
||||||
if (configuredFeature == null || configuredFeature.config == null) return null;
|
if (configuredFeature == null || configuredFeature.config == null) return null;
|
||||||
ChunkPos chunkPos2 = structure.getStartChunk(params, seed, chunkRandom, chunkPos.x, chunkPos.z); //find some chunk I guess
|
ChunkPos chunkPos2 = structure.getStartChunk(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.config)) // should start at
|
// using here world for heightview, rather than chunk since we - unlike vanilla, want to avoid creating any chunks even on the
|
||||||
|
// structure starts level - lets see where would that take us.
|
||||||
|
if (chunkPos.x == chunkPos2.x && chunkPos.z == chunkPos2.z && ((StructureFeatureInterface)structure).shouldStartPublicAt(generator, generator.getBiomeSource(), seed, chunkRandom, chunkPos.x, chunkPos.z, biome, chunkPos, configuredFeature.config, world)) // should start at
|
||||||
{
|
{
|
||||||
if (!computeBox) return StructureStart.DEFAULT;
|
if (!computeBox) return StructureStart.DEFAULT;
|
||||||
StructureManager manager = world.getStructureManager();
|
StructureManager manager = world.getStructureManager();
|
||||||
StructureStart<T> structureStart3 = structure.getStructureStartFactory().create((StructureFeature<T>) configuredFeature.feature, chunkPos.x, chunkPos.z, BlockBox.empty(), 0, seed);
|
StructureStart<T> structureStart3 = structure.getStructureStartFactory().create((StructureFeature<T>) configuredFeature.feature, chunkPos.x, chunkPos.z, BlockBox.empty(), 0, seed);
|
||||||
structureStart3.init(world.getRegistryManager(), generator, manager, chunkPos.x, chunkPos.z, biome, (T) configuredFeature.config);
|
structureStart3.init(world.getRegistryManager(), generator, manager, chunkPos.x, chunkPos.z, biome, (T) configuredFeature.config, world);
|
||||||
if (!structureStart3.hasChildren()) return null;
|
if (!structureStart3.hasChildren()) return null;
|
||||||
return structureStart3;
|
return structureStart3;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ import carpet.utils.WoolTool;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.CarpetBlock;
|
import net.minecraft.block.CarpetBlock;
|
||||||
|
import net.minecraft.class_5815;
|
||||||
import net.minecraft.item.ItemPlacementContext;
|
import net.minecraft.item.ItemPlacementContext;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
|
||||||
@Mixin(CarpetBlock.class)
|
@Mixin(class_5815.class) // WoolCarpetBlock
|
||||||
public abstract class CarpetBlockMixin extends Block
|
public abstract class CarpetBlockMixin extends Block
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -21,8 +22,8 @@ public abstract class CarpetBlockMixin extends Block
|
|||||||
{
|
{
|
||||||
BlockState state = super.getPlacementState(context);
|
BlockState state = super.getPlacementState(context);
|
||||||
if (context.getPlayer() != null && !context.getWorld().isClient)
|
if (context.getPlayer() != null && !context.getWorld().isClient)
|
||||||
{
|
{ // getColor()
|
||||||
WoolTool.carpetPlacedAction(((CarpetBlock)(Object)this).getColor(), context.getPlayer(), context.getBlockPos(), (ServerWorld) context.getWorld());
|
WoolTool.carpetPlacedAction(((class_5815)(Object)this).method_33635(), context.getPlayer(), context.getBlockPos(), (ServerWorld) context.getWorld());
|
||||||
}
|
}
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import net.minecraft.structure.StructureStart;
|
|||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.ChunkPos;
|
import net.minecraft.util.math.ChunkPos;
|
||||||
import net.minecraft.util.math.BlockBox;
|
import net.minecraft.util.math.BlockBox;
|
||||||
|
import net.minecraft.world.HeightLimitView;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.biome.source.BiomeSource;
|
import net.minecraft.world.biome.source.BiomeSource;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
import net.minecraft.world.chunk.Chunk;
|
||||||
@@ -28,7 +29,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
|||||||
|
|
||||||
@Shadow public abstract StructureFeature.StructureStartFactory getStructureStartFactory();
|
@Shadow public abstract StructureFeature.StructureStartFactory getStructureStartFactory();
|
||||||
|
|
||||||
@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, int i, int j, Biome biome, ChunkPos chunkPos, C featureConfig);
|
@Shadow protected abstract boolean shouldStartAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long worldSeed, ChunkRandom random, int chunkX, int chunkZ, Biome biome, ChunkPos chunkPos, C config, HeightLimitView heightLimitView);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly, Biome biome, FeatureConfig config)
|
public boolean plopAnywhere(ServerWorld world, BlockPos pos, ChunkGenerator generator, boolean wireOnly, Biome biome, FeatureConfig config)
|
||||||
@@ -107,7 +108,7 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
|||||||
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, BlockBox.empty(),0,worldIn.getSeed());
|
StructureStart structurestart1 = getStructureStartFactory().create((StructureFeature)(Object)this, chunkpos.x, chunkpos.z, BlockBox.empty(),0,worldIn.getSeed());
|
||||||
if (config == null)
|
if (config == null)
|
||||||
config = new DefaultFeatureConfig();
|
config = new DefaultFeatureConfig();
|
||||||
structurestart1.init(worldIn.getRegistryManager(), generator, worldIn.getStructureManager() , chunkpos.x, chunkpos.z, biome_1, config);
|
structurestart1.init(worldIn.getRegistryManager(), generator, worldIn.getStructureManager() , chunkpos.x, chunkpos.z, biome_1, config, ichunk);
|
||||||
structurestart = structurestart1.hasChildren() ? structurestart1 : StructureStart.DEFAULT;
|
structurestart = structurestart1.hasChildren() ? structurestart1 : StructureStart.DEFAULT;
|
||||||
|
|
||||||
if (structurestart.hasChildren())
|
if (structurestart.hasChildren())
|
||||||
@@ -120,8 +121,8 @@ public abstract class StructureFeatureMixin<C extends FeatureConfig> implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, int i, int j, Biome biome, ChunkPos chunkPos, C featureConfig)
|
public boolean shouldStartPublicAt(ChunkGenerator chunkGenerator, BiomeSource biomeSource, long l, ChunkRandom chunkRandom, int i, int j, Biome biome, ChunkPos chunkPos, C featureConfig, HeightLimitView heightLimitView)
|
||||||
{
|
{
|
||||||
return shouldStartAt(chunkGenerator, biomeSource, l, chunkRandom, i, j, biome, chunkPos, featureConfig);
|
return shouldStartAt(chunkGenerator, biomeSource, l, chunkRandom, i, j, biome, chunkPos, featureConfig, heightLimitView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user