3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-11-07 20:10:06 +01:00

Fix setting player heads with owner name.

Dieser Commit ist enthalten in:
wizjany 2019-06-29 11:11:22 -04:00
Ursprung abbca2ea18
Commit 9cbf8178ea
2 geänderte Dateien mit 9 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -83,14 +83,15 @@ public class SkullBlock extends BaseBlock {
@Override
public String getNbtId() {
return "Skull";
return "skull";
}
@Override
public CompoundTag getNbtData() {
Map<String, Tag> values = new HashMap<>();
if (owner == null) owner = "";
values.put("ExtraType", new StringTag(owner));
Map<String, Tag> inner = new HashMap<>();
inner.put("Name", new StringTag(owner));
values.put("Owner", new CompoundTag(inner));
return new CompoundTag(values);
}
@ -105,13 +106,13 @@ public class SkullBlock extends BaseBlock {
Tag t;
t = values.get("id");
if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Skull")) {
throw new RuntimeException("'Skull' tile entity expected");
if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals(getNbtId())) {
throw new RuntimeException(String.format("'%s' tile entity expected", getNbtId()));
}
t = values.get("ExtraType");
if (t instanceof StringTag) {
owner = ((StringTag) t).getValue();
t = values.get("Owner");
if (t instanceof CompoundTag) {
setOwner(((CompoundTag) t).getValue().get("Name").getValue().toString());
}
}
}

Datei anzeigen

@ -42,7 +42,6 @@ import com.sk89q.worldedit.util.HandSide;
import com.sk89q.worldedit.world.World;
import com.sk89q.worldedit.world.block.BaseBlock;
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.BlockType;
import com.sk89q.worldedit.world.block.BlockTypes;