mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-19 05:31:32 +01:00
SPIGOT-4037: Improve legacy BlockState.setData
By: md_5 <git@md-5.net>
This commit is contained in:
parent
07fa7316e0
commit
01e8982b04
1 changed files with 2 additions and 1 deletions
|
@ -20,6 +20,7 @@ import org.bukkit.plugin.Plugin;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import net.minecraft.server.GeneratorAccess;
|
import net.minecraft.server.GeneratorAccess;
|
||||||
import net.minecraft.server.IBlockData;
|
import net.minecraft.server.IBlockData;
|
||||||
|
import org.bukkit.craftbukkit.util.CraftLegacy;
|
||||||
|
|
||||||
public class CraftBlockState implements BlockState {
|
public class CraftBlockState implements BlockState {
|
||||||
private final CraftWorld world;
|
private final CraftWorld world;
|
||||||
|
@ -101,7 +102,7 @@ public class CraftBlockState implements BlockState {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setData(final MaterialData data) {
|
public void setData(final MaterialData data) {
|
||||||
Material mat = getType();
|
Material mat = CraftMagicNumbers.getMaterial(this.data).getItemType();
|
||||||
|
|
||||||
if ((mat == null) || (mat.getData() == null)) {
|
if ((mat == null) || (mat.getData() == null)) {
|
||||||
this.data = CraftMagicNumbers.getBlock(data);
|
this.data = CraftMagicNumbers.getBlock(data);
|
||||||
|
|
Loading…
Add table
Reference in a new issue