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; 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.material = material;
this.data = data;
this.x = x; this.x = x;
this.y = y; this.y = y;
this.z = z; this.z = z;

View File

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