|
|
|
@ -41,18 +41,19 @@ import net.minecraft.loot.entry.ItemEntry;
|
|
|
|
|
import net.minecraft.loot.provider.number.ConstantLootNumberProvider;
|
|
|
|
|
import net.minecraft.screen.ScreenHandlerType;
|
|
|
|
|
import net.minecraft.structure.rule.BlockMatchRuleTest;
|
|
|
|
|
import net.minecraft.structure.rule.TagMatchRuleTest;
|
|
|
|
|
import net.minecraft.tag.BlockTags;
|
|
|
|
|
import net.minecraft.util.ActionResult;
|
|
|
|
|
import net.minecraft.util.Identifier;
|
|
|
|
|
import net.minecraft.util.registry.BuiltinRegistries;
|
|
|
|
|
import net.minecraft.util.registry.Registry;
|
|
|
|
|
import net.minecraft.util.registry.RegistryKey;
|
|
|
|
|
import net.minecraft.world.gen.YOffset;
|
|
|
|
|
import net.minecraft.world.gen.decorator.Decorator;
|
|
|
|
|
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
|
|
|
|
|
import net.minecraft.world.gen.decorator.CountPlacementModifier;
|
|
|
|
|
import net.minecraft.world.gen.decorator.SquarePlacementModifier;
|
|
|
|
|
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
|
|
|
|
import net.minecraft.world.gen.feature.Feature;
|
|
|
|
|
import net.minecraft.world.gen.feature.OreFeatureConfig;
|
|
|
|
|
import net.minecraft.world.gen.heightprovider.UniformHeightProvider;
|
|
|
|
|
import net.minecraft.world.gen.feature.PlacedFeature;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
@ -68,39 +69,45 @@ public class RegistryManager {
|
|
|
|
|
public static final ScreenHandlerType<BackpackScreenHandler> BACKPACK_SCREEN_HANDLER = ScreenHandlerRegistry
|
|
|
|
|
.registerExtended(RegistryManager.BACKPACK_IDENTIFIER, BackpackScreenHandler::new);
|
|
|
|
|
|
|
|
|
|
public static final ConfiguredFeature<?, ?> FEATURE_ORENETHERSULPHOR = Feature.ORE
|
|
|
|
|
.configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_NETHER,
|
|
|
|
|
public static final PlacedFeature FEATURE_ORENETHERSULPHOR = Feature.ORE
|
|
|
|
|
.configure(new OreFeatureConfig(new TagMatchRuleTest(BlockTags.BASE_STONE_OVERWORLD),
|
|
|
|
|
QuickieBlocks.ORE_NETHER_SULPHOR.getDefaultState(), 24))
|
|
|
|
|
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(0)))).spreadHorizontally().repeat(10));
|
|
|
|
|
.withPlacement(new SquarePlacementModifier());
|
|
|
|
|
// .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(0)))).spreadHorizontally().repeat(10));
|
|
|
|
|
|
|
|
|
|
public static final ConfiguredFeature<?, ?> FEATURE_ORESALPETER = Feature.ORE
|
|
|
|
|
.configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
|
|
|
|
|
public static final PlacedFeature FEATURE_ORESALPETER = Feature.ORE
|
|
|
|
|
.configure(new OreFeatureConfig(new TagMatchRuleTest(BlockTags.BASE_STONE_OVERWORLD),
|
|
|
|
|
QuickieBlocks.ORE_SALPETER.getDefaultState(), 12))
|
|
|
|
|
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeat(10);
|
|
|
|
|
.withPlacement(CountPlacementModifier.of(10));
|
|
|
|
|
// .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeat(10);
|
|
|
|
|
|
|
|
|
|
public static final ConfiguredFeature<?, ?> FEATURE_ORESULPHOR = Feature.ORE
|
|
|
|
|
.configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD,
|
|
|
|
|
public static final PlacedFeature FEATURE_ORESULPHOR = Feature.ORE
|
|
|
|
|
.configure(new OreFeatureConfig(new TagMatchRuleTest(BlockTags.BASE_STONE_OVERWORLD),
|
|
|
|
|
QuickieBlocks.ORE_SULPHOR.getDefaultState(), 16))
|
|
|
|
|
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeat(7);
|
|
|
|
|
.withPlacement(CountPlacementModifier.of(7));
|
|
|
|
|
// .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeat(7);
|
|
|
|
|
|
|
|
|
|
public static final ConfiguredFeature<?, ?> FEATURE_DIRTSALPETER = Feature.ORE
|
|
|
|
|
public static final PlacedFeature FEATURE_DIRTSALPETER = Feature.ORE
|
|
|
|
|
.configure(
|
|
|
|
|
new OreFeatureConfig(new BlockMatchRuleTest(Blocks.DIRT), QuickieBlocks.DIRT_SALPETER.getDefaultState(), 3))
|
|
|
|
|
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeatRandomly(4);
|
|
|
|
|
.withPlacement(CountPlacementModifier.of(4));
|
|
|
|
|
// .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeatRandomly(4);
|
|
|
|
|
|
|
|
|
|
public static final ConfiguredFeature<?, ?> FEATURE_SANDSALPETER = Feature.ORE
|
|
|
|
|
public static final PlacedFeature FEATURE_SANDSALPETER = Feature.ORE
|
|
|
|
|
.configure(
|
|
|
|
|
new OreFeatureConfig(new BlockMatchRuleTest(Blocks.SAND), QuickieBlocks.SAND_SALPETER.getDefaultState(), 3))
|
|
|
|
|
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeatRandomly(4);
|
|
|
|
|
.withPlacement(CountPlacementModifier.of(4));
|
|
|
|
|
// .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeatRandomly(4);
|
|
|
|
|
|
|
|
|
|
public static final ConfiguredFeature<?, ?> FEATURE_ORESANDSALPETER = Feature.ORE
|
|
|
|
|
public static final PlacedFeature FEATURE_ORESANDSALPETER = Feature.ORE
|
|
|
|
|
.configure(new OreFeatureConfig(new BlockMatchRuleTest(Blocks.SANDSTONE),
|
|
|
|
|
QuickieBlocks.ORE_SAND_SALPETER.getDefaultState(), 3))
|
|
|
|
|
.decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeatRandomly(4);
|
|
|
|
|
.withPlacement(CountPlacementModifier.of(4));
|
|
|
|
|
// .decorate(Decorator.RANGE.configure(new RangeDecoratorConfig(UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.belowTop(64))))).spreadHorizontally().repeatRandomly(4);
|
|
|
|
|
|
|
|
|
|
public static final List<ConfiguredFeature<?, ?>> FEATURE_QUICKIE_ORES = Arrays.asList(FEATURE_ORESALPETER,
|
|
|
|
|
public static final List<PlacedFeature> FEATURE_QUICKIE_ORES = Arrays.asList(FEATURE_ORESALPETER,
|
|
|
|
|
FEATURE_ORESULPHOR, FEATURE_DIRTSALPETER, FEATURE_SANDSALPETER, FEATURE_ORESANDSALPETER);
|
|
|
|
|
public static final List<ConfiguredFeature<?, ?>> FEATURE_QUICKIE_NETHERORES = Arrays
|
|
|
|
|
public static final List<PlacedFeature> FEATURE_QUICKIE_NETHERORES = Arrays
|
|
|
|
|
.asList(FEATURE_ORENETHERSULPHOR);
|
|
|
|
|
|
|
|
|
|
public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroupBuilder
|
|
|
|
@ -278,9 +285,9 @@ public class RegistryManager {
|
|
|
|
|
* @param name the name for the identifier
|
|
|
|
|
* @param feature the feature
|
|
|
|
|
*/
|
|
|
|
|
private static final void registerFeature(String name, ConfiguredFeature<?, ?> feature) {
|
|
|
|
|
private static final void registerFeature(String name, PlacedFeature feature) {
|
|
|
|
|
RegistryKey<ConfiguredFeature<?, ?>> identifier = RegistryKey.of(Registry.CONFIGURED_FEATURE_KEY, new Identifier(QUICKIEFABRIC, name));
|
|
|
|
|
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, identifier.getValue(), feature);
|
|
|
|
|
Registry.register(BuiltinRegistries.PLACED_FEATURE, identifier.getValue(), feature);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|