package net.minecraft.world.level.block; import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.mojang.serialization.codecs.RecordCodecBuilder.Instance; import net.minecraft.world.item.DyeColor; import net.minecraft.world.level.block.state.BlockBehaviour; public class StainedGlassPaneBlock extends IronBarsBlock implements BeaconBeamBlock { public static final MapCodec CODEC = RecordCodecBuilder.mapCodec( p_360453_ -> p_360453_.group(DyeColor.CODEC.fieldOf("color").forGetter(StainedGlassPaneBlock::getColor), propertiesCodec()) .apply(p_360453_, StainedGlassPaneBlock::new) ); private final DyeColor color; @Override public MapCodec codec() { return CODEC; } public StainedGlassPaneBlock(DyeColor p_56838_, BlockBehaviour.Properties p_56839_) { super(p_56839_); this.color = p_56838_; this.registerDefaultState( this.stateDefinition .any() .setValue(NORTH, false) .setValue(EAST, false) .setValue(SOUTH, false) .setValue(WEST, false) .setValue(WATERLOGGED, false) ); } @Override public DyeColor getColor() { return this.color; } }