mirror of
https://github.com/TibiNonEst/cauldron-dyeing.git
synced 2024-11-24 03:27:19 -05:00
Increase water cauldron block entity compatibility
This commit is contained in:
parent
25527412e5
commit
d87d2e2bd0
3 changed files with 13 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
"required": true,
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"CauldronBehaviorMixin",
|
||||
"LeveledCauldronBlockMixin"
|
||||
"AbstractCauldronBlockMixin",
|
||||
"CauldronBehaviorMixin"
|
||||
],
|
||||
"client": [
|
||||
"BiomeColorsMixin",
|
||||
|
|
Loading…
Reference in a new issue