mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-11-24 03:27:19 -05:00
Port to 1.18.2
This commit is contained in:
parent
147186d089
commit
5e49440291
8 changed files with 35 additions and 63 deletions
14
build.gradle
14
build.gradle
|
@ -1,7 +1,7 @@
|
|||
plugins {
|
||||
id 'fabric-loom' version '0.10.+'
|
||||
id 'io.github.juuxel.loom-quiltflower-mini' version '1.2.1'
|
||||
id 'org.ajoberstar.grgit' version '4.1.0'
|
||||
id 'fabric-loom' version '0.11.+'
|
||||
id 'io.github.juuxel.loom-quiltflower' version '1.6.0'
|
||||
id 'org.ajoberstar.grgit' version '5.0.0'
|
||||
}
|
||||
|
||||
sourceCompatibility = '17'
|
||||
|
@ -23,11 +23,9 @@ repositories {
|
|||
|
||||
var apiModules = [
|
||||
"fabric-api-base",
|
||||
"fabric-tool-attribute-api-v1",
|
||||
"fabric-mining-level-api-v1",
|
||||
"fabric-resource-loader-v0",
|
||||
"fabric-tag-extensions-v0",
|
||||
"fabric-object-builder-api-v1"
|
||||
"fabric-networking-api-v1",
|
||||
"fabric-object-builder-api-v1",
|
||||
"fabric-registry-sync-v0",
|
||||
]
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.18.1
|
||||
yarn_mappings=1.18.1+build.22
|
||||
loader_version=0.12.12
|
||||
fabric_version=0.46.2+1.18
|
||||
# check these on https://fabricmc.net/develop/
|
||||
minecraft_version=1.18.2
|
||||
yarn_mappings=1.18.2+build.2
|
||||
loader_version=0.13.3
|
||||
fabric_version=0.48.0+1.18.2
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.0.1
|
||||
|
@ -14,4 +14,4 @@ maven_group=me.tibinonest.mods
|
|||
archives_base_name=cauldron-dyeing
|
||||
|
||||
# Dependencies
|
||||
sodium_version=mc1.18.1-0.4.0-alpha6
|
||||
sodium_version=mc1.18.2-0.4.1
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
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
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -79,9 +79,7 @@ public class WaterCauldronBlockEntity extends BlockEntity {
|
|||
|
||||
@Override
|
||||
public NbtCompound toInitialChunkDataNbt() {
|
||||
var nbt = new NbtCompound();
|
||||
nbt.putIntArray("color", color);
|
||||
return nbt;
|
||||
return createNbt();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -3,9 +3,9 @@
|
|||
"required": true,
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"BlocksMixin",
|
||||
"CauldronBehaviorMixin",
|
||||
"DyeItemAccessor"
|
||||
"DyeItemAccessor",
|
||||
"LeveledCauldronBlockMixin"
|
||||
],
|
||||
"client": [
|
||||
"BiomeColorsMixin"
|
||||
|
|
Loading…
Reference in a new issue