mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-04 00:45:57 +00:00
add BukkitAdapter util method
This commit is contained in:
parent
0228facd71
commit
7a59aeb80c
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user