mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-08-29 13:20:32 +00:00
add BukkitAdapter util method
This commit is contained in:
@@ -18,10 +18,13 @@
|
|||||||
package com.dfsek.terra.bukkit.world;
|
package com.dfsek.terra.bukkit.world;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.TreeType;
|
import org.bukkit.TreeType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.generator.WorldInfo;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import com.dfsek.terra.api.block.BlockType;
|
import com.dfsek.terra.api.block.BlockType;
|
||||||
@@ -81,6 +84,14 @@ public final class BukkitAdapter {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static WorldProperties adapt(WorldInfo worldInfo) {
|
||||||
|
return new BukkitWorldProperties(worldInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WorldInfo adapt(WorldProperties properties) {
|
||||||
|
return (WorldInfo) properties.getHandle();
|
||||||
|
}
|
||||||
|
|
||||||
public static Half adapt(org.bukkit.block.data.Bisected.Half half) {
|
public static Half adapt(org.bukkit.block.data.Bisected.Half half) {
|
||||||
return switch(half) {
|
return switch(half) {
|
||||||
case BOTTOM -> Half.BOTTOM;
|
case BOTTOM -> Half.BOTTOM;
|
||||||
|
|||||||
Reference in New Issue
Block a user