mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-10 04:28:35 +00:00
Remove Kotlin (#625)
Shrinks the jar size since we no longer must bundle the Kotlin library. The downside is that some classes grew in size compared to their Kotlin versions. Many contributors didn't care for Kotlin either.
This commit is contained in:
@ -0,0 +1,104 @@
|
||||
package com.boydti.fawe.object.clipboard;
|
||||
|
||||
import com.boydti.fawe.beta.implementation.lighting.HeightMapType;
|
||||
import com.sk89q.jnbt.CompoundTag;
|
||||
import com.sk89q.worldedit.WorldEditException;
|
||||
import com.sk89q.worldedit.entity.Entity;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.world.biome.BiomeType;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockState;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public final class EmptyClipboard implements Clipboard {
|
||||
private static final EmptyClipboard instance = new EmptyClipboard();
|
||||
|
||||
public static EmptyClipboard getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Region getRegion() {
|
||||
return new CuboidRegion(BlockVector3.ZERO, BlockVector3.ZERO);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BlockVector3 getDimensions() {
|
||||
return BlockVector3.ZERO;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BlockVector3 getOrigin() {
|
||||
return BlockVector3.ZERO;
|
||||
}
|
||||
|
||||
public void setOrigin(@NotNull BlockVector3 origin) {
|
||||
}
|
||||
|
||||
public void removeEntity(@NotNull Entity entity) {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BlockVector3 getMinimumPoint() {
|
||||
return BlockVector3.ZERO;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BlockVector3 getMaximumPoint() {
|
||||
return BlockVector3.ZERO;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BaseBlock getFullBlock(@NotNull BlockVector3 position) {
|
||||
return BlockTypes.AIR.getDefaultState().toBaseBlock();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BlockState getBlock(@NotNull BlockVector3 position) {
|
||||
return BlockTypes.AIR.getDefaultState();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public BiomeType getBiome(@NotNull BlockVector3 position) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public int[] getHeightMap(@Nullable HeightMapType type) {
|
||||
return new int[256];
|
||||
}
|
||||
|
||||
public boolean setBlock(@NotNull BlockVector3 position, BlockStateHolder block) throws WorldEditException {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setBlock(int x, int y, int z, BlockStateHolder block) throws WorldEditException {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setTile(int x, int y, int z, @NotNull CompoundTag tile) throws WorldEditException {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setBiome(@NotNull BlockVector3 position, @NotNull BiomeType biome) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean fullySupports3DBiomes() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean setBiome(int x, int y, int z, @NotNull BiomeType biome) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private EmptyClipboard() {
|
||||
}
|
||||
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
package com.boydti.fawe.`object`.clipboard
|
||||
|
||||
import com.boydti.fawe.beta.implementation.lighting.HeightMapType
|
||||
import com.sk89q.jnbt.CompoundTag
|
||||
import com.sk89q.worldedit.WorldEditException
|
||||
import com.sk89q.worldedit.entity.Entity
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard
|
||||
import com.sk89q.worldedit.math.BlockVector2
|
||||
import com.sk89q.worldedit.math.BlockVector3
|
||||
import com.sk89q.worldedit.regions.CuboidRegion
|
||||
import com.sk89q.worldedit.regions.Region
|
||||
import com.sk89q.worldedit.world.biome.BiomeType
|
||||
import com.sk89q.worldedit.world.block.BaseBlock
|
||||
import com.sk89q.worldedit.world.block.BlockState
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder
|
||||
import com.sk89q.worldedit.world.block.BlockTypes
|
||||
|
||||
object EmptyClipboard : Clipboard {
|
||||
override fun getRegion(): Region {
|
||||
return CuboidRegion(BlockVector3.ZERO, BlockVector3.ZERO)
|
||||
}
|
||||
|
||||
override fun getDimensions(): BlockVector3 {
|
||||
return BlockVector3.ZERO
|
||||
}
|
||||
|
||||
override fun getOrigin(): BlockVector3 {
|
||||
return BlockVector3.ZERO
|
||||
}
|
||||
|
||||
override fun setOrigin(origin: BlockVector3) {}
|
||||
override fun removeEntity(entity: Entity) {}
|
||||
override fun getMinimumPoint(): BlockVector3 {
|
||||
return BlockVector3.ZERO
|
||||
}
|
||||
|
||||
override fun getMaximumPoint(): BlockVector3 {
|
||||
return BlockVector3.ZERO
|
||||
}
|
||||
|
||||
override fun getFullBlock(position: BlockVector3): BaseBlock {
|
||||
return BlockTypes.AIR!!.defaultState.toBaseBlock()
|
||||
}
|
||||
|
||||
override fun getBlock(position: BlockVector3): BlockState {
|
||||
return BlockTypes.AIR!!.defaultState
|
||||
}
|
||||
|
||||
override fun getBiome(position: BlockVector3): BiomeType? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun getHeightMap(type: HeightMapType?): IntArray {
|
||||
return IntArray(256)
|
||||
}
|
||||
|
||||
@Throws(WorldEditException::class)
|
||||
override fun <T : BlockStateHolder<T>?> setBlock(position: BlockVector3, block: T): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
@Throws(WorldEditException::class)
|
||||
override fun <T : BlockStateHolder<T>?> setBlock(x: Int, y: Int, z: Int, block: T): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
@Throws(WorldEditException::class)
|
||||
override fun setTile(x: Int, y: Int, z: Int, tile: CompoundTag): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun setBiome(position: BlockVector3, biome: BiomeType): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun fullySupports3DBiomes(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
override fun setBiome(x: Int, y: Int, z: Int, biome: BiomeType): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ public class LazyClipboardHolder extends URIClipboardHolder {
|
||||
*
|
||||
*/
|
||||
public LazyClipboardHolder(URI uri, ByteSource source, ClipboardFormat format, UUID uuid) {
|
||||
super(uri, EmptyClipboard.INSTANCE);
|
||||
super(uri, EmptyClipboard.getInstance());
|
||||
this.source = source;
|
||||
this.format = format;
|
||||
this.uuid = uuid != null ? uuid : UUID.randomUUID();
|
||||
|
@ -22,7 +22,7 @@ public class MultiClipboardHolder extends URIClipboardHolder {
|
||||
}
|
||||
|
||||
public MultiClipboardHolder(URI uri) {
|
||||
super(uri, EmptyClipboard.INSTANCE);
|
||||
super(uri, EmptyClipboard.getInstance());
|
||||
holders = new ArrayList<>();
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ public class MultiClipboardHolder extends URIClipboardHolder {
|
||||
}
|
||||
|
||||
public MultiClipboardHolder(Clipboard clipboard) {
|
||||
super(URI.create(""), EmptyClipboard.INSTANCE);
|
||||
super(URI.create(""), EmptyClipboard.getInstance());
|
||||
holders = new ArrayList<>();
|
||||
URI uri = URI.create("");
|
||||
if (clipboard.getURI() != null) {
|
||||
@ -140,7 +140,7 @@ public class MultiClipboardHolder extends URIClipboardHolder {
|
||||
cached = available = getClipboards().toArray(new Clipboard[0]);
|
||||
}
|
||||
switch (available.length) {
|
||||
case 0: return EmptyClipboard.INSTANCE;
|
||||
case 0: return EmptyClipboard.getInstance();
|
||||
case 1: return available[0];
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user