Skip to content
Open
10 changes: 10 additions & 0 deletions verification/src/changes/accepted-core-public-api-changes.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
{
"//hollow overhaul": [
{
"type": "com.sk89q.worldedit.EditSession",
"member": "Method com.sk89q.worldedit.EditSession.hollowOutRegion(com.sk89q.worldedit.regions.Region,int,com.sk89q.worldedit.function.pattern.Pattern)",
"changes": [
"METHOD_NOW_FINAL",
"ANNOTATION_DEPRECATED_ADDED"
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,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
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -56,6 +57,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), PaperweightAdapter.adapt(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.sk89q.worldedit.coremc.internal.CoreMcCommandSender;
import com.sk89q.worldedit.coremc.internal.CoreMcPlatform;
import com.sk89q.worldedit.coremc.internal.CoreMcPlayer;
import com.sk89q.worldedit.coremc.internal.CoreMcTransmogrifier;
import com.sk89q.worldedit.coremc.internal.CoreMcWorld;
import com.sk89q.worldedit.coremc.internal.NBTConverter;
import com.sk89q.worldedit.coremc.mixin.AccessorCommandSourceStack;
Expand Down Expand Up @@ -121,14 +122,7 @@ public Vec3 toVec3(BlockVector3 vector) {
}

public net.minecraft.core.Direction adapt(Direction face) {
return switch (face) {
case NORTH -> net.minecraft.core.Direction.NORTH;
case SOUTH -> net.minecraft.core.Direction.SOUTH;
case WEST -> net.minecraft.core.Direction.WEST;
case EAST -> net.minecraft.core.Direction.EAST;
case DOWN -> net.minecraft.core.Direction.DOWN;
default -> net.minecraft.core.Direction.UP;
};
return CoreMcTransmogrifier.transmogToMinecraft(face);
}

public Direction adaptEnumFacing(@Nullable net.minecraft.core.Direction face) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

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;
Expand Down Expand Up @@ -60,6 +61,11 @@ protected boolean isFullCubeUncached(ShapeType shapeType) {
return Block.isShapeFullBlock(getShape(shapeType));
}

@Override
protected boolean isFullFaceUncached(ShapeType shapeType, Direction face) {
return Block.isFaceFull(getShape(shapeType), CoreMcTransmogrifier.transmogToMinecraft(face));
}

@Override
public boolean isOpaque() {
return block.canOcclude();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ public CoreMcTransmogrifier(CoreMcPlatform platform) {
this.platform = platform;
}

public static net.minecraft.core.Direction transmogToMinecraft(Direction face) {
return switch (face) {
case NORTH -> net.minecraft.core.Direction.NORTH;
case SOUTH -> net.minecraft.core.Direction.SOUTH;
case WEST -> net.minecraft.core.Direction.WEST;
case EAST -> net.minecraft.core.Direction.EAST;
case DOWN -> net.minecraft.core.Direction.DOWN;
default -> net.minecraft.core.Direction.UP;
};
}

public Property<?> transmogToWorldEditProperty(net.minecraft.world.level.block.state.properties.Property<?> property) {
return propertyCache.getUnchecked(property);
}
Expand Down Expand Up @@ -104,7 +115,7 @@ private net.minecraft.world.level.block.state.BlockState transmogToMinecraftProp
if (property instanceof net.minecraft.world.level.block.state.properties.EnumProperty) {
if (property.getValueClass() == net.minecraft.core.Direction.class) {
Direction dir = (Direction) value;
value = platform.getAdapter().adapt(dir);
value = transmogToMinecraft(dir);
} else {
String enumName = (String) value;
value = ((net.minecraft.world.level.block.state.properties.EnumProperty<?>) property).getValue((String) value).orElseThrow(() ->
Expand Down
Loading
Loading