--- a/net/minecraft/world/entity/decoration/Painting.java
+++ b/net/minecraft/world/entity/decoration/Painting.java
@@ -4,6 +4,7 @@
 import com.mojang.serialization.MapCodec;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Objects;
 import java.util.Optional;
 import javax.annotation.Nullable;
 import net.minecraft.Util;
@@ -29,16 +30,16 @@
 import net.minecraft.world.item.ItemStack;
 import net.minecraft.world.item.Items;
 import net.minecraft.world.level.GameRules;
+import net.minecraft.world.level.ItemLike;
 import net.minecraft.world.level.Level;
 import net.minecraft.world.phys.AABB;
 import net.minecraft.world.phys.Vec3;
 
 public class Painting extends HangingEntity implements VariantHolder<Holder<PaintingVariant>> {
-    private static final EntityDataAccessor<Holder<PaintingVariant>> DATA_PAINTING_VARIANT_ID = SynchedEntityData.defineId(
-        Painting.class, EntityDataSerializers.PAINTING_VARIANT
-    );
+
+    private static final EntityDataAccessor<Holder<PaintingVariant>> DATA_PAINTING_VARIANT_ID = SynchedEntityData.defineId(Painting.class, EntityDataSerializers.PAINTING_VARIANT);
     public static final MapCodec<Holder<PaintingVariant>> VARIANT_MAP_CODEC = PaintingVariant.CODEC.fieldOf("variant");
-    public static final Codec<Holder<PaintingVariant>> VARIANT_CODEC = VARIANT_MAP_CODEC.codec();
+    public static final Codec<Holder<PaintingVariant>> VARIANT_CODEC = Painting.VARIANT_MAP_CODEC.codec();
     public static final float DEPTH = 0.0625F;
 
     public Painting(EntityType<? extends Painting> type, Level world) {
@@ -47,57 +48,64 @@
 
     @Override
     protected void defineSynchedData(SynchedEntityData.Builder builder) {
-        builder.define(DATA_PAINTING_VARIANT_ID, this.registryAccess().registryOrThrow(Registries.PAINTING_VARIANT).getAny().orElseThrow());
+        builder.define(Painting.DATA_PAINTING_VARIANT_ID, (Holder) this.registryAccess().registryOrThrow(Registries.PAINTING_VARIANT).getAny().orElseThrow());
     }
 
     @Override
     public void onSyncedDataUpdated(EntityDataAccessor<?> data) {
-        if (DATA_PAINTING_VARIANT_ID.equals(data)) {
+        if (Painting.DATA_PAINTING_VARIANT_ID.equals(data)) {
             this.recalculateBoundingBox();
         }
+
     }
 
-    @Override
     public void setVariant(Holder<PaintingVariant> variant) {
-        this.entityData.set(DATA_PAINTING_VARIANT_ID, variant);
+        this.entityData.set(Painting.DATA_PAINTING_VARIANT_ID, variant);
     }
 
     @Override
     public Holder<PaintingVariant> getVariant() {
-        return this.entityData.get(DATA_PAINTING_VARIANT_ID);
+        return (Holder) this.entityData.get(Painting.DATA_PAINTING_VARIANT_ID);
     }
 
     public static Optional<Painting> create(Level world, BlockPos pos, Direction facing) {
-        Painting painting = new Painting(world, pos);
-        List<Holder<PaintingVariant>> list = new ArrayList<>();
-        world.registryAccess().registryOrThrow(Registries.PAINTING_VARIANT).getTagOrEmpty(PaintingVariantTags.PLACEABLE).forEach(list::add);
+        Painting entitypainting = new Painting(world, pos);
+        List<Holder<PaintingVariant>> list = new ArrayList();
+        Iterable<Holder<PaintingVariant>> iterable = world.registryAccess().registryOrThrow(Registries.PAINTING_VARIANT).getTagOrEmpty(PaintingVariantTags.PLACEABLE); // CraftBukkit - decompile error
+
+        Objects.requireNonNull(list);
+        iterable.forEach(list::add);
         if (list.isEmpty()) {
             return Optional.empty();
         } else {
-            painting.setDirection(facing);
-            list.removeIf(variant -> {
-                painting.setVariant((Holder<PaintingVariant>)variant);
-                return !painting.survives();
+            entitypainting.setDirection(facing);
+            list.removeIf((holder) -> {
+                entitypainting.setVariant(holder);
+                return !entitypainting.survives();
             });
             if (list.isEmpty()) {
                 return Optional.empty();
             } else {
                 int i = list.stream().mapToInt(Painting::variantArea).max().orElse(0);
-                list.removeIf(variant -> variantArea((Holder<PaintingVariant>)variant) < i);
-                Optional<Holder<PaintingVariant>> optional = Util.getRandomSafe(list, painting.random);
+
+                list.removeIf((holder) -> {
+                    return Painting.variantArea(holder) < i;
+                });
+                Optional<Holder<PaintingVariant>> optional = Util.getRandomSafe(list, entitypainting.random);
+
                 if (optional.isEmpty()) {
                     return Optional.empty();
                 } else {
-                    painting.setVariant(optional.get());
-                    painting.setDirection(facing);
-                    return Optional.of(painting);
+                    entitypainting.setVariant((Holder) optional.get());
+                    entitypainting.setDirection(facing);
+                    return Optional.of(entitypainting);
                 }
             }
         }
     }
 
     private static int variantArea(Holder<PaintingVariant> variant) {
-        return variant.value().area();
+        return ((PaintingVariant) variant.value()).area();
     }
 
     private Painting(Level world, BlockPos pos) {
@@ -112,15 +120,16 @@
 
     @Override
     public void addAdditionalSaveData(CompoundTag nbt) {
-        VARIANT_CODEC.encodeStart(this.registryAccess().createSerializationContext(NbtOps.INSTANCE), this.getVariant())
-            .ifSuccess(tag -> nbt.merge((CompoundTag)tag));
-        nbt.putByte("facing", (byte)this.direction.get2DDataValue());
+        Painting.VARIANT_CODEC.encodeStart(this.registryAccess().createSerializationContext(NbtOps.INSTANCE), this.getVariant()).ifSuccess((nbtbase) -> {
+            nbt.merge((CompoundTag) nbtbase);
+        });
+        nbt.putByte("facing", (byte) this.direction.get2DDataValue());
         super.addAdditionalSaveData(nbt);
     }
 
     @Override
     public void readAdditionalSaveData(CompoundTag nbt) {
-        VARIANT_CODEC.parse(this.registryAccess().createSerializationContext(NbtOps.INSTANCE), nbt).ifSuccess(this::setVariant);
+        Painting.VARIANT_CODEC.parse(this.registryAccess().createSerializationContext(NbtOps.INSTANCE), nbt).ifSuccess(this::setVariant);
         this.direction = Direction.from2DDataValue(nbt.getByte("facing"));
         super.readAdditionalSaveData(nbt);
         this.setDirection(this.direction);
@@ -128,33 +137,48 @@
 
     @Override
     protected AABB calculateBoundingBox(BlockPos pos, Direction side) {
+        // CraftBukkit start
+        PaintingVariant paintingvariant = (PaintingVariant) this.getVariant().value();
+        return Painting.calculateBoundingBoxStatic(pos, side, paintingvariant.width(), paintingvariant.height());
+    }
+
+    public static AABB calculateBoundingBoxStatic(BlockPos blockposition, Direction enumdirection, int width, int height) {
+        // CraftBukkit end
         float f = 0.46875F;
-        Vec3 vec3 = Vec3.atCenterOf(pos).relative(side, -0.46875);
-        PaintingVariant paintingVariant = this.getVariant().value();
-        double d = this.offsetForPaintingSize(paintingVariant.width());
-        double e = this.offsetForPaintingSize(paintingVariant.height());
-        Direction direction = side.getCounterClockWise();
-        Vec3 vec32 = vec3.relative(direction, d).relative(Direction.UP, e);
-        Direction.Axis axis = side.getAxis();
-        double g = axis == Direction.Axis.X ? 0.0625 : (double)paintingVariant.width();
-        double h = (double)paintingVariant.height();
-        double i = axis == Direction.Axis.Z ? 0.0625 : (double)paintingVariant.width();
-        return AABB.ofSize(vec32, g, h, i);
+        Vec3 vec3d = Vec3.atCenterOf(blockposition).relative(enumdirection, -0.46875D);
+        // CraftBukkit start
+        double d0 = Painting.offsetForPaintingSize(width);
+        double d1 = Painting.offsetForPaintingSize(height);
+        // CraftBukkit end
+        Direction enumdirection1 = enumdirection.getCounterClockWise();
+        Vec3 vec3d1 = vec3d.relative(enumdirection1, d0).relative(Direction.UP, d1);
+        Direction.Axis enumdirection_enumaxis = enumdirection.getAxis();
+        // CraftBukkit start
+        double d2 = enumdirection_enumaxis == Direction.Axis.X ? 0.0625D : (double) width;
+        double d3 = (double) height;
+        double d4 = enumdirection_enumaxis == Direction.Axis.Z ? 0.0625D : (double) width;
+        // CraftBukkit end
+
+        return AABB.ofSize(vec3d1, d2, d3, d4);
     }
 
-    private double offsetForPaintingSize(int length) {
-        return length % 2 == 0 ? 0.5 : 0.0;
+    private static double offsetForPaintingSize(int length) { // CraftBukkit - static
+        return length % 2 == 0 ? 0.5D : 0.0D;
     }
 
     @Override
     public void dropItem(@Nullable Entity breaker) {
         if (this.level().getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
             this.playSound(SoundEvents.PAINTING_BREAK, 1.0F, 1.0F);
-            if (breaker instanceof Player player && player.hasInfiniteMaterials()) {
-                return;
+            if (breaker instanceof Player) {
+                Player entityhuman = (Player) breaker;
+
+                if (entityhuman.hasInfiniteMaterials()) {
+                    return;
+                }
             }
 
-            this.spawnAtLocation(Items.PAINTING);
+            this.spawnAtLocation((ItemLike) Items.PAINTING);
         }
     }
 
