mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
add bukkit grass workaround
This commit is contained in:
@@ -29,16 +29,28 @@ import com.dfsek.terra.api.handle.WorldHandle;
|
||||
import com.dfsek.terra.bukkit.world.block.data.BukkitBlockState;
|
||||
import com.dfsek.terra.bukkit.world.entity.BukkitEntityType;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
public class BukkitWorldHandle implements WorldHandle {
|
||||
private final BlockState air;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(BukkitWorldHandle.class);
|
||||
|
||||
public BukkitWorldHandle() {
|
||||
this.air = BukkitBlockState.newInstance(Material.AIR.createBlockData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized @NotNull BlockState createBlockState(@NotNull String data) {
|
||||
if(data.equals("minecraft:grass")) { //TODO: remove in 7.0
|
||||
data = "minecraft:short_grass";
|
||||
logger.warn(
|
||||
"Translating minecraft:grass to minecraft:short_grass. In 1.20.3 minecraft:grass was renamed to minecraft:short_grass" +
|
||||
". You are advised to preform this rename in your config backs as this translation will be removed in the next major " +
|
||||
"version of Terra.");
|
||||
}
|
||||
org.bukkit.block.data.BlockData bukkitData = Bukkit.createBlockData(
|
||||
data); // somehow bukkit managed to make this not thread safe! :)
|
||||
return BukkitBlockState.newInstance(bukkitData);
|
||||
|
||||
@@ -4,6 +4,6 @@ version: "@VERSION@"
|
||||
load: "STARTUP"
|
||||
author: dfsek
|
||||
website: "@WIKI@"
|
||||
api-version: "1.13"
|
||||
api-version: "1.20.3"
|
||||
description: "@DESCRIPTION@"
|
||||
folia-supported: true
|
||||
|
||||
Reference in New Issue
Block a user