diff --git a/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java b/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java index 90335ff1605..a4b41334177 100644 --- a/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java +++ b/src/main/java/net/neoforged/neoforge/registries/DeferredRegister.java @@ -496,7 +496,7 @@ public DeferredItem register(String name, Supplier registerSimpleBlockItem(String name, Supplier block, Item.Properties properties) { - return this.register(name, key -> new BlockItem(block.get(), properties.setId(ResourceKey.create(Registries.ITEM, key)))); + return this.register(name, key -> new BlockItem(block.get(), properties.setId(ResourceKey.create(Registries.ITEM, key)).useBlockDescriptionPrefix())); } /** diff --git a/tests/src/main/java/net/neoforged/neoforge/oldtest/block/CustomPlantTypeTest.java b/tests/src/main/java/net/neoforged/neoforge/oldtest/block/CustomPlantTypeTest.java index 53171338876..72c5e7e1857 100644 --- a/tests/src/main/java/net/neoforged/neoforge/oldtest/block/CustomPlantTypeTest.java +++ b/tests/src/main/java/net/neoforged/neoforge/oldtest/block/CustomPlantTypeTest.java @@ -50,8 +50,8 @@ public static void registerBlocks(RegisterEvent event) { @SubscribeEvent public static void registerItems(RegisterEvent event) { event.register(Registries.ITEM, helper -> { - helper.register(CUSTOM_SOIL.getId(), new BlockItem(CUSTOM_SOIL.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, CUSTOM_SOIL.getId())))); - helper.register(CUSTOM_PLANT.getId(), new BlockItem(CUSTOM_PLANT.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, CUSTOM_PLANT.getId())))); + helper.register(CUSTOM_SOIL.getId(), new BlockItem(CUSTOM_SOIL.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, CUSTOM_SOIL.getId())).useBlockDescriptionPrefix())); + helper.register(CUSTOM_PLANT.getId(), new BlockItem(CUSTOM_PLANT.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, CUSTOM_PLANT.getId())).useBlockDescriptionPrefix())); }); } diff --git a/tests/src/main/java/net/neoforged/neoforge/oldtest/block/FlowerPotTest.java b/tests/src/main/java/net/neoforged/neoforge/oldtest/block/FlowerPotTest.java index f588619a433..24c2c8049b1 100644 --- a/tests/src/main/java/net/neoforged/neoforge/oldtest/block/FlowerPotTest.java +++ b/tests/src/main/java/net/neoforged/neoforge/oldtest/block/FlowerPotTest.java @@ -34,7 +34,7 @@ public class FlowerPotTest { public static final DeferredBlock OAK_FLOWER_POT = BLOCKS.registerBlock(BLOCK_ID + "_oak", props -> new FlowerPotBlock(EMPTY_FLOWER_POT, () -> Blocks.OAK_SAPLING, props), Block.Properties.ofFullCopy(Blocks.FLOWER_POT)); static { - ITEMS.register(BLOCK_ID, () -> new BlockItem(EMPTY_FLOWER_POT.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, EMPTY_FLOWER_POT.getId())))); + ITEMS.register(BLOCK_ID, () -> new BlockItem(EMPTY_FLOWER_POT.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, EMPTY_FLOWER_POT.getId())).useBlockDescriptionPrefix())); } @SubscribeEvent diff --git a/tests/src/main/java/net/neoforged/neoforge/oldtest/block/SlipperinessTest.java b/tests/src/main/java/net/neoforged/neoforge/oldtest/block/SlipperinessTest.java index 5852dbf6d18..306a9c4ef9d 100644 --- a/tests/src/main/java/net/neoforged/neoforge/oldtest/block/SlipperinessTest.java +++ b/tests/src/main/java/net/neoforged/neoforge/oldtest/block/SlipperinessTest.java @@ -42,7 +42,7 @@ public float getFriction(BlockState state, LevelReader level, BlockPos pos, Enti @SubscribeEvent public static void registerItems(RegisterEvent e) { - e.register(Registries.ITEM, helper -> helper.register(BB_BLOCK.getId(), new BlockItem(BB_BLOCK.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, BB_BLOCK.getId()))))); + e.register(Registries.ITEM, helper -> helper.register(BB_BLOCK.getId(), new BlockItem(BB_BLOCK.get(), new Item.Properties().setId(ResourceKey.create(Registries.ITEM, BB_BLOCK.getId())).useBlockDescriptionPrefix()))); } /* diff --git a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/CompositeModelTest.java b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/CompositeModelTest.java index 8a01616dd37..aadbd1708d2 100644 --- a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/CompositeModelTest.java +++ b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/CompositeModelTest.java @@ -64,7 +64,7 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, } }, Block.Properties.of().mapColor(MapColor.WOOD).strength(10)); - public static DeferredItem composite_item = ITEMS.registerItem("composite_block", props -> new BlockItem(composite_block.get(), props) { + public static DeferredItem composite_item = ITEMS.registerItem("composite_block", props -> new BlockItem(composite_block.get(), props.useBlockDescriptionPrefix()) { @Override public boolean canEquip(ItemStack stack, EquipmentSlot armorType, LivingEntity entity) { return armorType == EquipmentSlot.HEAD; diff --git a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/NewModelLoaderTest.java b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/NewModelLoaderTest.java index aca793f49ed..db7b863456f 100644 --- a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/NewModelLoaderTest.java +++ b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/NewModelLoaderTest.java @@ -81,7 +81,7 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, } }, Block.Properties.of().mapColor(MapColor.WOOD).strength(10)); - public static DeferredItem obj_item = ITEMS.registerItem("obj_block", props -> new BlockItem(obj_block.get(), props) { + public static DeferredItem obj_item = ITEMS.registerItem("obj_block", props -> new BlockItem(obj_block.get(), props.useBlockDescriptionPrefix()) { @Override public boolean canEquip(ItemStack stack, EquipmentSlot armorType, LivingEntity entity) { return armorType == EquipmentSlot.HEAD; diff --git a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/TRSRTransformerTest.java b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/TRSRTransformerTest.java index a46e3f1ec2c..f30a5f7cc6f 100644 --- a/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/TRSRTransformerTest.java +++ b/tests/src/main/java/net/neoforged/neoforge/oldtest/client/model/TRSRTransformerTest.java @@ -17,7 +17,6 @@ import net.minecraft.util.RandomSource; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTabs; -import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.MapColor; @@ -45,7 +44,7 @@ public class TRSRTransformerTest { private static final DeferredBlock TEST_BLOCK = BLOCKS.registerBlock("test", Block::new, Block.Properties.of().mapColor(MapColor.STONE)); @SuppressWarnings("unused") - private static final DeferredItem TEST_ITEM = ITEMS.registerItem("test", props -> new BlockItem(TEST_BLOCK.get(), props)); + private static final DeferredItem TEST_ITEM = ITEMS.registerSimpleBlockItem(TEST_BLOCK); public TRSRTransformerTest(IEventBus modEventBus) { if (FMLEnvironment.dist.isClient()) {