Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@
"ANNOTATION_REMOVED"
]
}
],
"Replaced by default method": [
{
"type": "com.sk89q.worldedit.bukkit.BukkitBlockRegistry",
"member": "Method com.sk89q.worldedit.bukkit.BukkitBlockRegistry.getMaterial(com.sk89q.worldedit.world.block.BlockType)",
"changes": [
"METHOD_REMOVED",
"ANNOTATION_REMOVED"
]
}
]
}
16 changes: 16 additions & 0 deletions verification/src/changes/accepted-core-public-api-changes.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.EditSession",
"member": "Method com.sk89q.worldedit.EditSession.makeCuboidFaces(com.sk89q.worldedit.regions.Region,int,com.sk89q.worldedit.function.pattern.Pattern)",
"changes": [
"METHOD_NOW_FINAL"
]
}
],
"Why on earth is this even an issue?": [
{
"type": "com.sk89q.worldedit.world.registry.BlockMaterial",
"member": "Method com.sk89q.worldedit.world.registry.BlockMaterial.isFullCube()",
"changes": [
"METHOD_ABSTRACT_NOW_DEFAULT"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
{
"Replaced by default method": [
{
"type": "com.sk89q.worldedit.sponge.SpongeBlockRegistry",
"member": "Method com.sk89q.worldedit.sponge.SpongeBlockRegistry.getMaterial(com.sk89q.worldedit.world.block.BlockType)",
"changes": [
"METHOD_REMOVED"
]
},
{
"type": "com.sk89q.worldedit.sponge.SpongeBlockMaterial",
"member": "Method com.sk89q.worldedit.sponge.SpongeBlockMaterial.isFullCube()",
"changes": [
"METHOD_REMOVED"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public void setBiome(Location location, BiomeType biome) {
return new PaperweightWorldNativeAccess(this, new WeakReference<>(((CraftWorld) world).getHandle()));
}

private static net.minecraft.core.Direction adapt(Direction face) {
public static net.minecraft.core.Direction adapt(Direction face) {
return switch (face) {
case NORTH -> net.minecraft.core.Direction.NORTH;
case SOUTH -> net.minecraft.core.Direction.SOUTH;
Expand Down Expand Up @@ -586,6 +586,11 @@ public BlockMaterial getBlockMaterial(BlockType blockType) {
return new PaperweightBlockMaterial(mcBlockState);
}

@Override
public BlockMaterial getBlockMaterial(BlockState blockState) {
return new PaperweightBlockMaterial(adapt(blockState));
}

@SuppressWarnings({ "unchecked", "rawtypes" })
private static final LoadingCache<net.minecraft.world.level.block.state.properties.Property, Property<?>> PROPERTY_CACHE = CacheBuilder.newBuilder().build(new CacheLoader<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@

package com.sk89q.worldedit.bukkit.adapter.impl.v1_21_11;

import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.blocks.ShapeType;
import com.sk89q.worldedit.internal.block.AbstractBlockMaterial;
import com.sk89q.worldedit.util.Direction;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Clearable;
import net.minecraft.world.level.EmptyBlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public class PaperweightBlockMaterial implements BlockMaterial {
public class PaperweightBlockMaterial extends AbstractBlockMaterial<VoxelShape> {

private final BlockState block;

Expand All @@ -42,8 +46,21 @@ public boolean isAir() {
}

@Override
public boolean isFullCube() {
return Block.isShapeFullBlock(block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
protected VoxelShape getShape(ShapeType shapeType) {
return switch (shapeType) {
case SHAPE -> block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
case VISUAL_SHAPE -> block.getVisualShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
};
}

@Override
protected boolean isShapeFullBlock(VoxelShape shape) {
return Block.isShapeFullBlock(shape);
}

@Override
protected boolean isFaceFull(VoxelShape shape, Direction face) {
return Block.isFaceFull(shape, PaperweightAdapter.adapt(face));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public void setBiome(Location location, BiomeType biome) {
return new PaperweightWorldNativeAccess(this, new WeakReference<>(((CraftWorld) world).getHandle()));
}

private static net.minecraft.core.Direction adapt(Direction face) {
public static net.minecraft.core.Direction adapt(Direction face) {
return switch (face) {
case NORTH -> net.minecraft.core.Direction.NORTH;
case SOUTH -> net.minecraft.core.Direction.SOUTH;
Expand Down Expand Up @@ -567,6 +567,11 @@ public BlockMaterial getBlockMaterial(BlockType blockType) {
return new PaperweightBlockMaterial(mcBlockState);
}

@Override
public BlockMaterial getBlockMaterial(BlockState blockState) {
return new PaperweightBlockMaterial(adapt(blockState));
}

@SuppressWarnings({ "unchecked", "rawtypes" })
private static final LoadingCache<net.minecraft.world.level.block.state.properties.Property, Property<?>> PROPERTY_CACHE = CacheBuilder.newBuilder().build(new CacheLoader<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@

package com.sk89q.worldedit.bukkit.adapter.impl.v1_21_4;

import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.blocks.ShapeType;
import com.sk89q.worldedit.internal.block.AbstractBlockMaterial;
import com.sk89q.worldedit.util.Direction;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Clearable;
import net.minecraft.world.level.EmptyBlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public class PaperweightBlockMaterial implements BlockMaterial {
public class PaperweightBlockMaterial extends AbstractBlockMaterial<VoxelShape> {

private final BlockState block;

Expand All @@ -42,8 +46,21 @@ public boolean isAir() {
}

@Override
public boolean isFullCube() {
return Block.isShapeFullBlock(block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
protected VoxelShape getShape(ShapeType shapeType) {
return switch (shapeType) {
case SHAPE -> block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
case VISUAL_SHAPE -> block.getVisualShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
};
}

@Override
protected boolean isShapeFullBlock(VoxelShape shape) {
return Block.isShapeFullBlock(shape);
}

@Override
protected boolean isFaceFull(VoxelShape shape, Direction face) {
return Block.isFaceFull(shape, PaperweightAdapter.adapt(face));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ public void setBiome(Location location, BiomeType biome) {
return new PaperweightWorldNativeAccess(this, new WeakReference<>(((CraftWorld) world).getHandle()));
}

private static net.minecraft.core.Direction adapt(Direction face) {
public static net.minecraft.core.Direction adapt(Direction face) {
return switch (face) {
case NORTH -> net.minecraft.core.Direction.NORTH;
case SOUTH -> net.minecraft.core.Direction.SOUTH;
Expand Down Expand Up @@ -565,6 +565,11 @@ public BlockMaterial getBlockMaterial(BlockType blockType) {
return new PaperweightBlockMaterial(mcBlockState);
}

@Override
public BlockMaterial getBlockMaterial(BlockState blockState) {
return new PaperweightBlockMaterial(adapt(blockState));
}

@SuppressWarnings({ "unchecked", "rawtypes" })
private static final LoadingCache<net.minecraft.world.level.block.state.properties.Property, Property<?>> PROPERTY_CACHE = CacheBuilder.newBuilder().build(new CacheLoader<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@

package com.sk89q.worldedit.bukkit.adapter.impl.v1_21_5;

import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.blocks.ShapeType;
import com.sk89q.worldedit.internal.block.AbstractBlockMaterial;
import com.sk89q.worldedit.util.Direction;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Clearable;
import net.minecraft.world.level.EmptyBlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public class PaperweightBlockMaterial implements BlockMaterial {
public class PaperweightBlockMaterial extends AbstractBlockMaterial<VoxelShape> {

private final BlockState block;

Expand All @@ -42,8 +46,21 @@ public boolean isAir() {
}

@Override
public boolean isFullCube() {
return Block.isShapeFullBlock(block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
protected VoxelShape getShape(ShapeType shapeType) {
return switch (shapeType) {
case SHAPE -> block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
case VISUAL_SHAPE -> block.getVisualShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
};
}

@Override
protected boolean isShapeFullBlock(VoxelShape shape) {
return Block.isShapeFullBlock(shape);
}

@Override
protected boolean isFaceFull(VoxelShape shape, Direction face) {
return Block.isFaceFull(shape, PaperweightAdapter.adapt(face));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ public void setBiome(Location location, BiomeType biome) {
return new PaperweightWorldNativeAccess(this, new WeakReference<>(((CraftWorld) world).getHandle()));
}

private static net.minecraft.core.Direction adapt(Direction face) {
public static net.minecraft.core.Direction adapt(Direction face) {
return switch (face) {
case NORTH -> net.minecraft.core.Direction.NORTH;
case SOUTH -> net.minecraft.core.Direction.SOUTH;
Expand Down Expand Up @@ -587,6 +587,11 @@ public BlockMaterial getBlockMaterial(BlockType blockType) {
return new PaperweightBlockMaterial(mcBlockState);
}

@Override
public BlockMaterial getBlockMaterial(BlockState blockState) {
return new PaperweightBlockMaterial(adapt(blockState));
}

@SuppressWarnings({ "unchecked", "rawtypes" })
private static final LoadingCache<net.minecraft.world.level.block.state.properties.Property, Property<?>> PROPERTY_CACHE = CacheBuilder.newBuilder().build(new CacheLoader<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@

package com.sk89q.worldedit.bukkit.adapter.impl.v1_21_6;

import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.blocks.ShapeType;
import com.sk89q.worldedit.internal.block.AbstractBlockMaterial;
import com.sk89q.worldedit.util.Direction;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Clearable;
import net.minecraft.world.level.EmptyBlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public class PaperweightBlockMaterial implements BlockMaterial {
public class PaperweightBlockMaterial extends AbstractBlockMaterial<VoxelShape> {

private final BlockState block;

Expand All @@ -42,8 +46,21 @@ public boolean isAir() {
}

@Override
public boolean isFullCube() {
return Block.isShapeFullBlock(block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
protected VoxelShape getShape(ShapeType shapeType) {
return switch (shapeType) {
case SHAPE -> block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
case VISUAL_SHAPE -> block.getVisualShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
};
}

@Override
protected boolean isShapeFullBlock(VoxelShape shape) {
return Block.isShapeFullBlock(shape);
}

@Override
protected boolean isFaceFull(VoxelShape shape, Direction face) {
return Block.isFaceFull(shape, PaperweightAdapter.adapt(face));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public void setBiome(Location location, BiomeType biome) {
return new PaperweightWorldNativeAccess(this, new WeakReference<>(((CraftWorld) world).getHandle()));
}

private static net.minecraft.core.Direction adapt(Direction face) {
public static net.minecraft.core.Direction adapt(Direction face) {
return switch (face) {
case NORTH -> net.minecraft.core.Direction.NORTH;
case SOUTH -> net.minecraft.core.Direction.SOUTH;
Expand Down Expand Up @@ -586,6 +586,11 @@ public BlockMaterial getBlockMaterial(BlockType blockType) {
return new PaperweightBlockMaterial(mcBlockState);
}

@Override
public BlockMaterial getBlockMaterial(BlockState blockState) {
return new PaperweightBlockMaterial(adapt(blockState));
}

@SuppressWarnings({ "unchecked", "rawtypes" })
private static final LoadingCache<net.minecraft.world.level.block.state.properties.Property, Property<?>> PROPERTY_CACHE = CacheBuilder.newBuilder().build(new CacheLoader<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,20 @@

package com.sk89q.worldedit.bukkit.adapter.impl.v1_21_9;

import com.sk89q.worldedit.world.registry.BlockMaterial;
import com.sk89q.worldedit.blocks.ShapeType;
import com.sk89q.worldedit.internal.block.AbstractBlockMaterial;
import com.sk89q.worldedit.util.Direction;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Clearable;
import net.minecraft.world.level.EmptyBlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.EntityBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public class PaperweightBlockMaterial implements BlockMaterial {
public class PaperweightBlockMaterial extends AbstractBlockMaterial<VoxelShape> {

private final BlockState block;

Expand All @@ -42,8 +46,21 @@ public boolean isAir() {
}

@Override
public boolean isFullCube() {
return Block.isShapeFullBlock(block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO));
protected VoxelShape getShape(ShapeType shapeType) {
return switch (shapeType) {
case SHAPE -> block.getShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
case VISUAL_SHAPE -> block.getVisualShape(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CollisionContext.empty());
};
}

@Override
protected boolean isShapeFullBlock(VoxelShape shape) {
return Block.isShapeFullBlock(shape);
}

@Override
protected boolean isFaceFull(VoxelShape shape, Direction face) {
return Block.isFaceFull(shape, PaperweightAdapter.adapt(face));
}

@Override
Expand Down
Loading
Loading