This repository has been archived by the owner on May 27, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Sign Bug? #18
Comments
You need to set the block handler of the signs when they are placed by scaffolding. This project is currently stale so I will not be adding any features to make this task easier. |
// Registering the SignHandler
MinecraftServer.getBlockManager().registerHandler(NamespaceID.from("minecraft:sign"), SignHandler::new);
// SignHandler Class
public final class SignHandler implements BlockHandler {
@Override
public @NotNull NamespaceID getNamespaceId() {
return NamespaceID.from("minecraft", "sign");
}
public Collection<Tag<?>> getBlockEntityTags() {
return Arrays.asList(
Tag.Byte("GlowingText"),
Tag.String("Color"),
Tag.String("Text1"),
Tag.String("Text2"),
Tag.String("Text3"),
Tag.String("Text4"));
}
} What do you mean with |
You need to set the block handler when the block is placed. Just registering it does not apply it to the sign. |
Block block =
Block.OAK_SIGN
.withTag(
Tag.String("Text1"),
GsonComponentSerializer.gson().serialize(Component.text("Line 1")))
.withHandler(new SignHandler());
// Option 1
AbsoluteBlockBatch absoluteBlockBatch = new AbsoluteBlockBatch();
absoluteBlockBatch.setBlock(world.getSpawnPos(), block);
absoluteBlockBatch.apply(instance, () -> {});
// Option 2
instance.setBlock(world.getSpawnPos(), block); But this works for example. Just the Schematic Class does not seem to load it correctly. Have you tested it in the past with Signs? |
I can't find a way of how to assign Handler after they are placed by the BlockBatch you apply with the Schematics. There maybe need to be a PreSetter Parameter to change the Block before it gets applied to the BlockBatch |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a schematic created and loaded which contains Signs with Text on it.
The Signs on loading does not have a Text
Does Schematics contain the Text of the Signs? if yes -> They dont get loaded correctly (I have BlockHandler for Signs registered)
The text was updated successfully, but these errors were encountered: