mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-23 13:46:45 +01:00
37 lines
991 B
Java
37 lines
991 B
Java
package com.plotsquared.bukkit.util;
|
|
|
|
import java.util.Collection;
|
|
|
|
import org.bukkit.Chunk;
|
|
import org.bukkit.World;
|
|
import org.bukkit.block.Block;
|
|
|
|
import com.intellectualcrafters.plot.util.MainUtil;
|
|
|
|
public class SetBlockSlow extends BukkitSetBlockManager {
|
|
@Override
|
|
public void set(final World world, final int x, final int y, final int z, final int id, final byte data) {
|
|
final Block block = world.getBlockAt(x, y, z);
|
|
if (id == -1) {
|
|
block.setData(data, false);
|
|
return;
|
|
}
|
|
if (block.getData() == data) {
|
|
if (block.getTypeId() != id) {
|
|
block.setTypeId(id, false);
|
|
}
|
|
} else {
|
|
if (block.getTypeId() == id) {
|
|
block.setData(data, false);
|
|
} else {
|
|
block.setTypeIdAndData(id, data, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void update(final Collection<Chunk> chunks) {
|
|
// TODO nothing
|
|
}
|
|
}
|