fix world coordinate issues on Fabric

This commit is contained in:
dfsek
2021-06-25 00:45:24 -07:00
parent ff4cbda294
commit da0fb7dd15
25 changed files with 89 additions and 79 deletions

View File

@@ -44,7 +44,7 @@ public class BukkitChunkGenerator implements com.dfsek.terra.api.world.generator
@Override
public @NotNull BlockData getBlockData(int x, int y, int z) {
public @NotNull BlockData getBlock(int x, int y, int z) {
return BukkitBlockData.newInstance(delegate.getBlockData(x, y, z));
}
}

View File

@@ -54,7 +54,7 @@ public class CommonListener implements Listener {
block.setType(Material.AIR);
Tree tree = c.getRegistry(Tree.class).get(TREE_TYPE_STRING_TRANSFORMER.translate(e.getSpecies()));
org.bukkit.Location location = e.getLocation();
if(!tree.plant(new LocationImpl(bukkit, location.getX(), location.getY(), location.getZ()), new FastRandom()))
if(!tree.plant(new LocationImpl(bukkit, location.getX(), location.getY(), location.getZ()), , new FastRandom()))
block.setBlockData(data);
}
}

View File

@@ -45,7 +45,7 @@ public class BukkitChunk implements Chunk {
}
@Override
public @NotNull BlockData getBlockData(int x, int y, int z) {
public @NotNull BlockData getBlock(int x, int y, int z) {
return getBlock(x, y, z).getBlockData();
}
}

View File

@@ -4,8 +4,9 @@ import com.dfsek.terra.api.TerraPlugin;
import com.dfsek.terra.api.handle.WorldHandle;
import com.dfsek.terra.api.profiler.ProfileFrame;
import com.dfsek.terra.api.util.collections.MaterialSet;
import com.dfsek.terra.api.vector.Location;
import com.dfsek.terra.api.vector.Vector3;
import com.dfsek.terra.api.world.Tree;
import com.dfsek.terra.api.world.World;
import org.bukkit.TreeType;
import java.util.Locale;
@@ -43,7 +44,7 @@ public class BukkitTree implements Tree {
@Override
@SuppressWarnings("try")
public boolean plant(Location l, Random r) {
public boolean plant(Vector3 l, World world, Random r) {
try(ProfileFrame ignore = main.getProfiler().profile("bukkit_tree:" + delegate.toString().toLowerCase(Locale.ROOT))) {
return ((BukkitWorld) l.getWorld()).getHandle().generateTree(BukkitAdapter.adapt(l), delegate);
}