Coder Social home page Coder Social logo

Sign Bug? about scaffolding HOT 5 OPEN

einfachBlu avatar einfachBlu commented on August 16, 2024
Sign Bug?

from scaffolding.

Comments (5)

LooFifteen avatar LooFifteen commented on August 16, 2024

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.

from scaffolding.

einfachBlu avatar einfachBlu commented on August 16, 2024
// 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 when they are placed by scaffolding?
I have registered the SignHandler already.

from scaffolding.

LooFifteen avatar LooFifteen commented on August 16, 2024

You need to set the block handler when the block is placed. Just registering it does not apply it to the sign.

from scaffolding.

einfachBlu avatar einfachBlu commented on August 16, 2024
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?

from scaffolding.

einfachBlu avatar einfachBlu commented on August 16, 2024

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

from scaffolding.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.