Use MaterialData instead of block id and data for chunk generation

This commit is contained in:
Speentie8081 2018-07-21 00:15:13 -05:00
parent f533efb2c8
commit d5b01aced2

View File

@ -8,6 +8,7 @@ import com.intellectualcrafters.plot.util.block.ScopedLocalBlockQueue;
import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.BukkitUtil;
import java.util.Arrays; import java.util.Arrays;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.bukkit.generator.ChunkGenerator.BiomeGrid; import org.bukkit.generator.ChunkGenerator.BiomeGrid;
@ -115,7 +116,7 @@ public class GenChunk extends ScopedLocalBlockQueue {
@Override @Override
public boolean setBlock(int x, int y, int z, int id, int data) { public boolean setBlock(int x, int y, int z, int id, int data) {
if (this.result == null) { if (this.result == null) {
this.cd.setBlock(x, y, z, id, (byte) data); this.cd.setBlock(x, y, z, new MaterialData(Material.getMaterial(id), (byte) data));
return true; return true;
} }
int i = MainUtil.CACHE_I[y][x][z]; int i = MainUtil.CACHE_I[y][x][z];