Preserve data in structures.

This commit is contained in:
Brianna 2020-04-07 05:35:57 -04:00
parent 251571a33a
commit de7e5375f6
2 changed files with 4 additions and 2 deletions

View File

@ -54,8 +54,9 @@ public class BlockData {
private boolean exactTeleport = true;
public BlockData(String material, int x, int y, int z, String biome) {
public BlockData(String material, byte data, int x, int y, int z, String biome) {
this.material = material;
this.data = data;
this.x = x;
this.y = y;
this.z = z;

View File

@ -1,6 +1,7 @@
package com.songoda.skyblock.utils.world.block;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.compatibility.ServerVersion;
import com.songoda.core.utils.BlockUtils;
import com.songoda.skyblock.utils.item.ItemStackUtil;
import com.songoda.skyblock.utils.version.NMSUtil;
@ -22,7 +23,7 @@ import java.util.List;
public final class BlockUtil extends BlockUtils {
public static BlockData convertBlockToBlockData(Block block, int x, int y, int z) {
BlockData blockData = new BlockData(block.getType().name(), x, y, z, block.getBiome().toString());
BlockData blockData = new BlockData(block.getType().name(), block.getData(), x, y, z, block.getBiome().toString());
int NMSVersion = NMSUtil.getVersionNumber();
blockData.setVersion(NMSVersion);