port: MC 1.21.4

This commit is contained in:
Martin Prokoph
2025-01-27 14:31:46 +01:00
parent ecc50e77e2
commit 0a9f7ea0a1
19 changed files with 106 additions and 17 deletions

View File

@@ -1,11 +1,10 @@
package eu.midnightdust.betterbeds.mixin;
import net.minecraft.block.*;
import net.minecraft.block.BedBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.HorizontalFacingBlock;
import net.minecraft.util.math.Direction;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@Mixin(value = BedBlock.class, priority = 2000)
public abstract class MixinBedBlock extends HorizontalFacingBlock {
@@ -14,13 +13,7 @@ public abstract class MixinBedBlock extends HorizontalFacingBlock {
super(settings);
}
@Inject(at = @At("RETURN"), method = "getRenderType", cancellable = true)
private void getRenderType(BlockState state, CallbackInfoReturnable<BlockRenderType> cir) {
cir.setReturnValue(BlockRenderType.MODEL);
}
@Override
@SuppressWarnings("deprecation")
public boolean isSideInvisible(BlockState state, BlockState neighborState, Direction offset) {
return neighborState.getBlock() instanceof BedBlock;
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/black_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/blue_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/brown_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/cyan_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/gray_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/green_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/light_blue_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/light_gray_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/lime_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/magenta_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/orange_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/pink_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/purple_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/red_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/white_bed"
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/yellow_bed"
}
}