Port to 1.18.2

This commit is contained in:
tibs 2022-03-15 20:15:37 -04:00
parent 147186d089
commit 5e49440291
Signed by untrusted user who does not match committer: tibs
GPG key ID: 047833989F50F88F
8 changed files with 35 additions and 63 deletions

View file

@ -1,7 +1,7 @@
plugins { plugins {
id 'fabric-loom' version '0.10.+' id 'fabric-loom' version '0.11.+'
id 'io.github.juuxel.loom-quiltflower-mini' version '1.2.1' id 'io.github.juuxel.loom-quiltflower' version '1.6.0'
id 'org.ajoberstar.grgit' version '4.1.0' id 'org.ajoberstar.grgit' version '5.0.0'
} }
sourceCompatibility = '17' sourceCompatibility = '17'
@ -23,11 +23,9 @@ repositories {
var apiModules = [ var apiModules = [
"fabric-api-base", "fabric-api-base",
"fabric-tool-attribute-api-v1", "fabric-networking-api-v1",
"fabric-mining-level-api-v1", "fabric-object-builder-api-v1",
"fabric-resource-loader-v0", "fabric-registry-sync-v0",
"fabric-tag-extensions-v0",
"fabric-object-builder-api-v1"
] ]
dependencies { dependencies {

View file

@ -2,11 +2,11 @@
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
# Fabric Properties # Fabric Properties
# check these on https://modmuss50.me/fabric.html # check these on https://fabricmc.net/develop/
minecraft_version=1.18.1 minecraft_version=1.18.2
yarn_mappings=1.18.1+build.22 yarn_mappings=1.18.2+build.2
loader_version=0.12.12 loader_version=0.13.3
fabric_version=0.46.2+1.18 fabric_version=0.48.0+1.18.2
# Mod Properties # Mod Properties
mod_version=1.0.1 mod_version=1.0.1
@ -14,4 +14,4 @@ maven_group=me.tibinonest.mods
archives_base_name=cauldron-dyeing archives_base_name=cauldron-dyeing
# Dependencies # Dependencies
sodium_version=mc1.18.1-0.4.0-alpha6 sodium_version=mc1.18.2-0.4.1

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.3.3-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View file

@ -1,24 +0,0 @@
package me.tibinonest.mods.cauldron_dyeing.block;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockState;
import net.minecraft.block.LeveledCauldronBlock;
import net.minecraft.block.cauldron.CauldronBehavior;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.Item;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.biome.Biome;
import java.util.Map;
import java.util.function.Predicate;
public class WaterCauldronBlock extends LeveledCauldronBlock implements BlockEntityProvider {
public WaterCauldronBlock(Settings settings, Predicate<Biome.Precipitation> precipitationPredicate, Map<Item, CauldronBehavior> behaviorMap) {
super(settings, precipitationPredicate, behaviorMap);
}
@Override
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
return new WaterCauldronBlockEntity(pos, state);
}
}

View file

@ -79,9 +79,7 @@ public class WaterCauldronBlockEntity extends BlockEntity {
@Override @Override
public NbtCompound toInitialChunkDataNbt() { public NbtCompound toInitialChunkDataNbt() {
var nbt = new NbtCompound(); return createNbt();
nbt.putIntArray("color", color);
return nbt;
} }
@Nullable @Nullable

View file

@ -1,19 +0,0 @@
package me.tibinonest.mods.cauldron_dyeing.mixin;
import me.tibinonest.mods.cauldron_dyeing.block.WaterCauldronBlock;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.cauldron.CauldronBehavior;
import net.minecraft.util.registry.Registry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(Blocks.class)
public class BlocksMixin {
@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/Blocks;register(Ljava/lang/String;Lnet/minecraft/block/Block;)Lnet/minecraft/block/Block;", ordinal = 271))
private static Block redirectWaterCauldron(String id, Block block) {
return Registry.register(Registry.BLOCK, id, new WaterCauldronBlock(AbstractBlock.Settings.copy(Blocks.CAULDRON), WaterCauldronBlock.RAIN_PREDICATE, CauldronBehavior.WATER_CAULDRON_BEHAVIOR));
}
}

View file

@ -0,0 +1,19 @@
package me.tibinonest.mods.cauldron_dyeing.mixin;
import me.tibinonest.mods.cauldron_dyeing.block.WaterCauldronBlockEntity;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockState;
import net.minecraft.block.LeveledCauldronBlock;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.util.math.BlockPos;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
@Mixin(LeveledCauldronBlock.class)
public class LeveledCauldronBlockMixin implements BlockEntityProvider {
@Nullable
@Override
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
return state.getBlock().getLootTableId().getPath().equals("blocks/water_cauldron") ? new WaterCauldronBlockEntity(pos, state) : null;
}
}

View file

@ -3,9 +3,9 @@
"required": true, "required": true,
"compatibilityLevel": "JAVA_17", "compatibilityLevel": "JAVA_17",
"mixins": [ "mixins": [
"BlocksMixin",
"CauldronBehaviorMixin", "CauldronBehaviorMixin",
"DyeItemAccessor" "DyeItemAccessor",
"LeveledCauldronBlockMixin"
], ],
"client": [ "client": [
"BiomeColorsMixin" "BiomeColorsMixin"