1.18 update

This commit is contained in:
Agatha Lovelace 2021-12-18 23:06:33 +02:00
parent ae2f0b6929
commit 499bdd39db
9 changed files with 47 additions and 29 deletions

1
.gitignore vendored
View File

@ -31,3 +31,4 @@ bin/
# fabric # fabric
run/ run/
remappedSrc/

View File

@ -1,10 +1,10 @@
plugins { plugins {
id 'fabric-loom' version '0.9-SNAPSHOT' id 'fabric-loom' version '0.10-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
} }
sourceCompatibility = JavaVersion.VERSION_16 sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_16 targetCompatibility = JavaVersion.VERSION_17
archivesBaseName = project.archives_base_name archivesBaseName = project.archives_base_name
version = project.mod_version + "-" + project.minecraft_version version = project.mod_version + "-" + project.minecraft_version
@ -72,7 +72,7 @@ processResources {
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile).configureEach { tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8" it.options.encoding = "UTF-8"
it.options.release = 16 it.options.release = 17
} }
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task

View File

@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://fabricmc.net/use # check these on https://fabricmc.net/use
minecraft_version=1.17.1 minecraft_version=1.18.1
yarn_mappings=1.17.1+build.59 yarn_mappings=1.18.1+build.5
loader_version=0.11.6 loader_version=0.12.12
# Mod Properties # Mod Properties
mod_version = 1.2 mod_version = 1.2
@ -14,7 +14,7 @@ org.gradle.jvmargs=-Xmx1G
# Dependencies # Dependencies
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.40.0+1.17 fabric_version=0.44.0+1.18
modmenu_version=2.0.10 modmenu_version=3.0.1
cca_version=3.1.1 cca_version=4.0.1
cloth_version=5.0.38 cloth_version=6.1.48

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@ -9,7 +9,6 @@ import net.fabricmc.fabric.api.biome.v1.BiomeModifications;
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.Material; import net.minecraft.block.Material;
import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffectInstance;
@ -28,13 +27,15 @@ import net.minecraft.util.registry.Registry;
import net.minecraft.util.registry.RegistryKey; import net.minecraft.util.registry.RegistryKey;
import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.YOffset;
import net.minecraft.world.gen.decorator.RangeDecoratorConfig; import net.minecraft.world.gen.decorator.CountPlacementModifier;
import net.minecraft.world.gen.decorator.HeightRangePlacementModifier;
import net.minecraft.world.gen.decorator.SquarePlacementModifier;
import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.OreConfiguredFeatures;
import net.minecraft.world.gen.feature.OreFeatureConfig; import net.minecraft.world.gen.feature.OreFeatureConfig;
import net.minecraft.world.gen.heightprovider.UniformHeightProvider; import net.minecraft.world.gen.feature.PlacedFeature;
@SuppressWarnings("deprecation")
public class AsbestosRegistry { public class AsbestosRegistry {
// block/item definitions // block/item definitions
public static final Item ASBESTOS_FIBERS = new Item(new FabricItemSettings().group(ItemGroup.MATERIALS) public static final Item ASBESTOS_FIBERS = new Item(new FabricItemSettings().group(ItemGroup.MATERIALS)
@ -47,10 +48,10 @@ public class AsbestosRegistry {
FabricBlockSettings.of(Material.WOOL).hardness(1.0f).sounds(BlockSoundGroup.WOOL), 40); FabricBlockSettings.of(Material.WOOL).hardness(1.0f).sounds(BlockSoundGroup.WOOL), 40);
public static final CarcinogenicBlock SERPENTINITE_BLOCK = new CarcinogenicBlock(FabricBlockSettings public static final CarcinogenicBlock SERPENTINITE_BLOCK = new CarcinogenicBlock(FabricBlockSettings
.of(Material.STONE).hardness(3.0f).breakByTool(FabricToolTags.PICKAXES).requiresTool(), 20); .of(Material.STONE).hardness(3.0f).requiresTool(), 20);
public static final CarcinogenicBlock POPCORN_CEILING_BLOCK = new CarcinogenicBlock(FabricBlockSettings public static final CarcinogenicBlock POPCORN_CEILING_BLOCK = new CarcinogenicBlock(FabricBlockSettings
.of(Material.WOOD).hardness(2.0f).breakByTool(FabricToolTags.AXES).sounds(BlockSoundGroup.WOOD), .of(Material.WOOD).hardness(2.0f).sounds(BlockSoundGroup.WOOD),
20); 20);
public static final CarcinogenicBlock ASBESTOS_TILE_BLOCK = new CarcinogenicBlock( public static final CarcinogenicBlock ASBESTOS_TILE_BLOCK = new CarcinogenicBlock(
@ -78,11 +79,13 @@ public class AsbestosRegistry {
// serpentinite worldgen // serpentinite worldgen
private static ConfiguredFeature<?, ?> SERPENTINITE_OVERWORLD = Feature.ORE private static ConfiguredFeature<?, ?> SERPENTINITE_OVERWORLD = Feature.ORE
.configure(new OreFeatureConfig(OreFeatureConfig.Rules.BASE_STONE_OVERWORLD, .configure(new OreFeatureConfig(OreConfiguredFeatures.DEEPSLATE_ORE_REPLACEABLES,
SERPENTINITE_BLOCK.getDefaultState(), 5)) SERPENTINITE_BLOCK.getDefaultState(), 5));
.range(new RangeDecoratorConfig(
UniformHeightProvider.create(YOffset.aboveBottom(0), YOffset.fixed(32)))) public static PlacedFeature SERPENTINITE_PLACED_FEATURE = SERPENTINITE_OVERWORLD.withPlacement(
.spreadHorizontally().repeat(10); CountPlacementModifier.of(20),
SquarePlacementModifier.of(),
HeightRangePlacementModifier.uniform(YOffset.getBottom(), YOffset.fixed(0)));
public static void register() { public static void register() {
// asbestos fibers item // asbestos fibers item
@ -118,11 +121,13 @@ public class AsbestosRegistry {
ASBESTOS_ROOF_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS))); ASBESTOS_ROOF_BLOCK, new Item.Settings().group(ItemGroup.BUILDING_BLOCKS)));
// serpentinite worldgen // serpentinite worldgen
RegistryKey<ConfiguredFeature<?, ?>> serpentiniteOverworld = RegistryKey.of( RegistryKey<PlacedFeature> serpentiniteOverworld = RegistryKey.of(
Registry.CONFIGURED_FEATURE_KEY, new Identifier("asbestos", "serpentinite_overworld")); Registry.PLACED_FEATURE_KEY, new Identifier("asbestos", "serpentinite_overworld"));
Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, serpentiniteOverworld.getValue(), Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, serpentiniteOverworld.getValue(),
SERPENTINITE_OVERWORLD); SERPENTINITE_OVERWORLD);
Registry.register(BuiltinRegistries.PLACED_FEATURE, serpentiniteOverworld.getValue(),
SERPENTINITE_PLACED_FEATURE);
BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(),
GenerationStep.Feature.UNDERGROUND_ORES, serpentiniteOverworld); GenerationStep.Feature.UNDERGROUND_ORES, serpentiniteOverworld);

View File

@ -1,7 +1,6 @@
package dev.agatharose.asbestos.config; package dev.agatharose.asbestos.config;
import me.shedaniel.autoconfig.ConfigData; import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
import me.shedaniel.autoconfig.annotation.*; import me.shedaniel.autoconfig.annotation.*;
@Config(name = "asbestos") @Config(name = "asbestos")

View File

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"asbestos:popcorn_ceiling_block"
]
}

View File

@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"asbestos:serpentinite_block",
"asbestos:asbestos_roof_block"
]
}

View File

@ -31,10 +31,10 @@
] ]
}, },
"depends": { "depends": {
"fabricloader": ">=0.11.3", "fabricloader": ">=0.12.0",
"fabric": "*", "fabric": "*",
"minecraft": "1.17.x", "minecraft": "1.18.x",
"java": ">=16" "java": ">=17"
}, },
"suggests": { "suggests": {
"modmenu": "*" "modmenu": "*"