#Question about Custom Machine appearance

5 messages · Page 1 of 1 (latest)

indigo rock
#

I used CustomMachine to create the block 'dumpling_plate' and registered a block called 'plate'. When I right-click the 'plate' block while holding a specified item, the block is set to 'dumpling_plate', and the item is added to the container. Throughout this process, there were no errors, everything proceeded as expected. However, after 'plate' becomes 'dumpling_plate', 'dumpling_plate' adopts the default texture of CustomMachine, not the specified texture. Even triggering a block update or using 'F3 + T' to reload resource packs doesn't change it unless I use the '/reload' command or exit and re-enter the save. Besides, during multiplayer games, I noticed that this issue only occurs for the player who turn 'plate' into 'dumpling_plant', while it appears normal to other players' perspectives.

StartupEvents.registry('block', event => {
    event.create("dumpling:dumpling_plate", "custommachinery").machine("dumpling:dumpling_plate")
});
BlockEvents.rightClicked(event => {

    if (event.hand != "MAIN_HAND") {
        return;
    };

    if (event.block.getId() == 'dumpling:plate') {
        if (event.player.mainHandItem.getId() == 'dumpling:boiled_dumpling') {
            event.block.set('dumpling:dumpling_plate');
            let machine = CustomMachine.of(event.block);
            machine.addItemToSlot("slot1", event.player.mainHandItem, false);
            event.player.mainHandItem.count -= 1;
            event.cancel();
        }
    }

});
toxic basinBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

modest hearthBOT
#

Paste version of latest.log from @indigo rock

harsh summit
#

1st: Ask in CM's discord.
2nd: I have absolutely no idea what's going on here, and you should ask in CM's discord.

indigo rock
#

OK