mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Fix setting player heads with owner name.
This commit is contained in:
parent
abbca2ea18
commit
9cbf8178ea
@ -83,14 +83,15 @@ public class SkullBlock extends BaseBlock {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getNbtId() {
|
public String getNbtId() {
|
||||||
return "Skull";
|
return "skull";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompoundTag getNbtData() {
|
public CompoundTag getNbtData() {
|
||||||
Map<String, Tag> values = new HashMap<>();
|
Map<String, Tag> values = new HashMap<>();
|
||||||
if (owner == null) owner = "";
|
Map<String, Tag> inner = new HashMap<>();
|
||||||
values.put("ExtraType", new StringTag(owner));
|
inner.put("Name", new StringTag(owner));
|
||||||
|
values.put("Owner", new CompoundTag(inner));
|
||||||
return new CompoundTag(values);
|
return new CompoundTag(values);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,13 +106,13 @@ public class SkullBlock extends BaseBlock {
|
|||||||
Tag t;
|
Tag t;
|
||||||
|
|
||||||
t = values.get("id");
|
t = values.get("id");
|
||||||
if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Skull")) {
|
if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals(getNbtId())) {
|
||||||
throw new RuntimeException("'Skull' tile entity expected");
|
throw new RuntimeException(String.format("'%s' tile entity expected", getNbtId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
t = values.get("ExtraType");
|
t = values.get("Owner");
|
||||||
if (t instanceof StringTag) {
|
if (t instanceof CompoundTag) {
|
||||||
owner = ((StringTag) t).getValue();
|
setOwner(((CompoundTag) t).getValue().get("Name").getValue().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,6 @@ import com.sk89q.worldedit.util.HandSide;
|
|||||||
import com.sk89q.worldedit.world.World;
|
import com.sk89q.worldedit.world.World;
|
||||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||||
import com.sk89q.worldedit.world.block.BlockCategories;
|
import com.sk89q.worldedit.world.block.BlockCategories;
|
||||||
import com.sk89q.worldedit.world.block.BlockCategory;
|
|
||||||
import com.sk89q.worldedit.world.block.BlockState;
|
import com.sk89q.worldedit.world.block.BlockState;
|
||||||
import com.sk89q.worldedit.world.block.BlockType;
|
import com.sk89q.worldedit.world.block.BlockType;
|
||||||
import com.sk89q.worldedit.world.block.BlockTypes;
|
import com.sk89q.worldedit.world.block.BlockTypes;
|
||||||
|
Loading…
Reference in New Issue
Block a user