Expanded the scope of item brushes (/br apply item, /br paint item).

They now additionally take a direction in which the simulated item usage
should be facing.
Also allow the item parser to parse "hand" and "offhand" as items, to
allow platforms with NBT item support return items with NBT (since
parsing is a slightly more complex task).
This commit is contained in:
wizjany
2019-06-09 00:30:57 -04:00
parent 62e2a76d78
commit f2f9c26602
14 changed files with 287 additions and 118 deletions

View File

@ -116,7 +116,7 @@ public class MobSpawnerBlock extends BaseBlock {
@Override
public String getNbtId() {
return "MobSpawner";
return "minecraft:mob_spawner";
}
@Override
@ -154,8 +154,8 @@ public class MobSpawnerBlock extends BaseBlock {
Map<String, Tag> values = rootTag.getValue();
Tag t = values.get("id");
if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("MobSpawner")) {
throw new RuntimeException("'MobSpawner' tile entity expected");
if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals(getNbtId())) {
throw new RuntimeException(String.format("'%s' tile entity expected", getNbtId()));
}
CompoundTag spawnDataTag;
@ -169,6 +169,7 @@ public class MobSpawnerBlock extends BaseBlock {
throw new InvalidFormatException("No spawn id.");
}
this.mobType = mobType;
this.spawnData = spawnDataTag;
} catch (InvalidFormatException ignored) {
throw new RuntimeException("Invalid mob spawner data: no SpawnData and/or no Delay");
}

View File

@ -88,7 +88,7 @@ public class SignBlock extends BaseBlock {
@Override
public String getNbtId() {
return "Sign";
return "minecraft:sign";
}
@Override
@ -114,8 +114,8 @@ public class SignBlock extends BaseBlock {
text = new String[] { EMPTY, EMPTY, EMPTY, EMPTY };
t = values.get("id");
if (!(t instanceof StringTag) || !((StringTag) t).getValue().equals("Sign")) {
throw new RuntimeException("'Sign' 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("Text1");