This commit is contained in:
2021-11-30 23:03:51 +01:00
parent 72ef6c5a07
commit 6ee5bb8957
7 changed files with 46 additions and 40 deletions

View File

@ -1,10 +1,10 @@
plugins {
id 'fabric-loom' version '0.8-SNAPSHOT'
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'maven-publish'
}
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name
version = project.mod_version

View File

@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.17.1
yarn_mappings=1.17.1+build.63
loader_version=0.12.5
minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.12.7
# Mod Properties
mod_version = 1.17.1.6
mod_version = 1.18.0
maven_group = de.jottyfan.minecraft
archives_base_name = quickiefabric
# Dependencies
fabric_version=0.42.1+1.17
fabric_version=0.43.1+1.18

View File

@ -82,12 +82,11 @@ public class ItemHoarderBlockEntity extends LootableContainerBlockEntity {
}
@Override
public NbtCompound writeNbt(NbtCompound nbt) {
public void writeNbt(NbtCompound nbt) {
super.writeNbt(nbt);
if (!this.serializeLootTable(nbt)) {
Inventories.writeNbt(nbt, this.stacks);
}
return nbt;
}
@Override

View File

@ -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);
}
/**

View File

@ -8,8 +8,8 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import net.minecraft.world.biome.GenerationSettings;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.DefaultBiomeFeatures;
import net.minecraft.world.gen.feature.PlacedFeature;
/**
*
@ -21,14 +21,14 @@ public class FeatureConfigMixin {
@Inject(at = @At("TAIL"), method = "addMineables(Lnet/minecraft/world/biome/GenerationSettings$Builder;)V")
private static void addMineables(GenerationSettings.Builder builder, CallbackInfo ci) {
for (ConfiguredFeature<?, ?> configuredFeature : RegistryManager.FEATURE_QUICKIE_ORES) {
for (PlacedFeature configuredFeature : RegistryManager.FEATURE_QUICKIE_ORES) {
builder.feature(GenerationStep.Feature.UNDERGROUND_ORES, configuredFeature);
}
}
@Inject(at = @At("TAIL"), method = "addNetherMineables(Lnet/minecraft/world/biome/GenerationSettings$Builder;)V")
private static void addNetherMineables(GenerationSettings.Builder builder, CallbackInfo ci) {
for (ConfiguredFeature<?, ?> configuredFeature : RegistryManager.FEATURE_QUICKIE_NETHERORES) {
for (PlacedFeature configuredFeature : RegistryManager.FEATURE_QUICKIE_NETHERORES) {
builder.feature(GenerationStep.Feature.UNDERGROUND_ORES, configuredFeature);
}
}

View File

@ -26,10 +26,10 @@
"quickiefabric.mixins.json"
],
"depends": {
"fabricloader": ">=0.11.3",
"fabricloader": ">=0.12.7",
"fabric": "*",
"minecraft": "1.17.x",
"java": ">=16"
"minecraft": "1.18",
"java": ">=17"
},
"suggests": {
"flamingo": "*"

View File

@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "de.jottyfan.minecraft.quickiefabric.mixin",
"compatibilityLevel": "JAVA_16",
"compatibilityLevel": "JAVA_17",
"mixins": [
"FeatureConfigMixin",
"BlockBreakMixin"