Block turning in to update block when placing
LotchMc opened this issue · 14 comments
I am unable to reproduce this issue, could you please attach your code and make sure you're not doing anything that could be causing this?
const DURABILITY = 592;
const PROTECTION = 8;
public function __construct(ItemIdentifier $identifier, string $name = "Unknown") {
parent::__construct($identifier, $name, new ArmorTypeInfo(self::PROTECTION, self::DURABILITY, ArmorInventory::SLOT_CHEST));
$this->initComponent("cobalt_chestplate", 1, new CreativeInventoryInfo("equipment", "itemGroup.name.chestplate"));
$this->addComponent("minecraft:wearable", CompoundTag::create()->setString("slot", "slot.armor.chest"));
$this->addComponent("minecraft:armor", CompoundTag::create()->setInt("protection", self::PROTECTION));
$this->addComponent("minecraft:durability", CompoundTag::create()->setInt("max_durability", self::DURABILITY));
}
Twisted ?
This is the same logic I used as well. Could you try again with a server that only has Customies and this item registered?
yes, i go
I managed to fix this bug but now I have another bug with CustomBlocks
Could you attach the code you are using to register these blocks, and could you also try disabling all your plugins apart from customies and the one used to register the block?
This is my block:
$material = new Material(Material::TARGET_ALL, "cobalt_block", Material::RENDER_METHOD_ALPHA_TEST);
$model = new Model([$material], "geometry.block", new Vector3(-8, 0, -8), new Vector3(16, 16, 16));
$creativeInfo = new CreativeInventoryInfo(CreativeInventoryInfo::CATEGORY_CONSTRUCTION);
CustomiesBlockFactory::getInstance()->registerBlock(fn(int $id) => new CobaltBlock(new BlockIdentifier($id, 1), "cobalt_block", new BlockBreakInfo(3.0, BlockToolType::PICKAXE, ToolTier::IRON()->getHarvestLevel())), "minecraft:cobalt_block", $model, $creativeInfo);
And it is my class
class CobaltBlock extends Block {
public function __construct(BlockIdentifier $idInfo, string $name, BlockBreakInfo $blockBreakInfo) {
parent::__construct($idInfo, $name, $blockBreakInfo);
}
public function getDropsForCompatibleTool(Item $item): array
{
return [ItemFactory::getInstance()->get(1, 1, 1)];
}
My customblock as registered in Main.php
public function getSilkTouchDrops(Item $item): array
{
return [ItemFactory::getInstance()->get(1, 1, 1)];
}
}
twisted ?
I don't see anything wrong with your code, did you test this with only Customies and the plugin registering these blocks? Please attach a picture of the output from /pl
just to be sure
@TwistedAsylumMC can you send a template plugin for do this more easily please
The wiki already has everything you need, you just need to copy and paste
ok
ok twisted, we have a problem, when we do a simple plugin to add one block, it's work but, when we add an other block, it place the block UPDATE, but UPDATE it just a textures