Increase water cauldron block entity compatibility

This commit is contained in:
tibs 2022-08-18 23:31:19 -04:00
parent 25527412e5
commit d87d2e2bd0
Signed by untrusted user who does not match committer: tibs
GPG key ID: 047833989F50F88F
3 changed files with 13 additions and 6 deletions

View file

@ -1,19 +1,24 @@
package me.tibinonest.mods.cauldron_dyeing.mixin;
import me.tibinonest.mods.cauldron_dyeing.block.WaterCauldronBlockEntity;
import net.minecraft.block.AbstractCauldronBlock;
import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockState;
import net.minecraft.block.LeveledCauldronBlock;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.fluid.Fluids;
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 {
@Mixin(AbstractCauldronBlock.class)
public class AbstractCauldronBlockMixin 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;
if (state.getBlock() instanceof AbstractCauldronBlock cauldron && cauldron.canBeFilledByDripstone(Fluids.WATER)) {
return new WaterCauldronBlockEntity(pos, state);
}
return null;
}
}

View file

@ -1,3 +1,5 @@
accessWidener v1 named
accessible method net/minecraft/block/AbstractCauldronBlock canBeFilledByDripstone (Lnet/minecraft/fluid/Fluid;)Z
accessible field net/minecraft/item/DyeItem DYES Ljava/util/Map;

View file

@ -3,8 +3,8 @@
"required": true,
"compatibilityLevel": "JAVA_17",
"mixins": [
"CauldronBehaviorMixin",
"LeveledCauldronBlockMixin"
"AbstractCauldronBlockMixin",
"CauldronBehaviorMixin"
],
"client": [
"BiomeColorsMixin",