working FabricSign

This commit is contained in:
dfsek
2021-02-23 17:29:39 -07:00
parent 9c2b844290
commit 533380107b
4 changed files with 30 additions and 12 deletions

View File

@@ -24,12 +24,11 @@ public class BukkitSign extends BukkitBlockState implements Sign {
((org.bukkit.block.Sign) getHandle()).setLine(index, line);
}
@Override
public void applyState(String state) {
SerialState.parse(state).forEach((k, v) -> {
if(!v.startsWith("text")) throw new IllegalArgumentException("Invalid property: " + k);
setLine(Integer.parseInt(k) + 1, v.substring(4));
if(!k.startsWith("text")) throw new IllegalArgumentException("Invalid property: " + k);
setLine(Integer.parseInt(k.substring(4)), v);
});
}
}