mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Use BlockState for player inventory getBlock
This commit is contained in:
parent
6f04022738
commit
7fb3899bb7
@ -21,7 +21,6 @@ package com.boydti.fawe.bukkit.adapter;
|
|||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
import static com.google.common.base.Preconditions.checkNotNull;
|
||||||
|
|
||||||
import ignore.test.DummyServer;
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
import com.sk89q.jnbt.ByteArrayTag;
|
import com.sk89q.jnbt.ByteArrayTag;
|
||||||
@ -113,7 +112,7 @@ public final class Spigot_v1_13_R1 implements BukkitImplAdapter<NBTBase> {
|
|||||||
|
|
||||||
public Spigot_v1_13_R1() throws NoSuchFieldException, NoSuchMethodException {
|
public Spigot_v1_13_R1() throws NoSuchFieldException, NoSuchMethodException {
|
||||||
// A simple test
|
// A simple test
|
||||||
if (Bukkit.getServer().getClass() != DummyServer.class) CraftServer.class.cast(Bukkit.getServer());
|
if (!Bukkit.getServer().getClass().getName().endsWith("DummyServer")) CraftServer.class.cast(Bukkit.getServer());
|
||||||
// test between 1.12 and 1.12.1 since md_5 didn't update revision numbers
|
// test between 1.12 and 1.12.1 since md_5 didn't update revision numbers
|
||||||
TileEntity.class.getDeclaredMethod("load", NBTTagCompound.class);
|
TileEntity.class.getDeclaredMethod("load", NBTTagCompound.class);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ public class PlayerWrapper extends AbstractPlayerActor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException {
|
public BlockState getBlockInHand(HandSide handSide) throws WorldEditException {
|
||||||
return parent.getBlockInHand(handSide);
|
return parent.getBlockInHand(handSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class DefaultBlockParser extends InputParser<BlockStateHolder> {
|
|||||||
super(worldEdit);
|
super(worldEdit);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static BaseBlock getBlockInHand(Actor actor, HandSide handSide) throws InputParseException {
|
private static BlockState getBlockInHand(Actor actor, HandSide handSide) throws InputParseException {
|
||||||
if (actor instanceof Player) {
|
if (actor instanceof Player) {
|
||||||
try {
|
try {
|
||||||
return ((Player) actor).getBlockInHand(handSide);
|
return ((Player) actor).getBlockInHand(handSide);
|
||||||
|
@ -65,7 +65,7 @@ public class PlayerProxy extends AbstractPlayerActor {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BaseBlock getBlockInHand(HandSide handSide) throws WorldEditException {
|
public BlockState getBlockInHand(HandSide handSide) throws WorldEditException {
|
||||||
return basePlayer.getBlockInHand(handSide);
|
return basePlayer.getBlockInHand(handSide);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ public class SnapshotRestore {
|
|||||||
// Now just copy blocks!
|
// Now just copy blocks!
|
||||||
for (Vector pos : entry.getValue()) {
|
for (Vector pos : entry.getValue()) {
|
||||||
try {
|
try {
|
||||||
BaseBlock block = chunk.getBlock(pos);
|
BlockState block = chunk.getBlock(pos);
|
||||||
editSession.setBlock(pos, block);
|
editSession.setBlock(pos, block);
|
||||||
} catch (DataException e) {
|
} catch (DataException e) {
|
||||||
// this is a workaround: just ignore for now
|
// this is a workaround: just ignore for now
|
||||||
|
Loading…
Reference in New Issue
Block a user