This commit is contained in:
Bruno Rybársky 2024-06-14 14:48:03 +02:00
parent 3727cf7a5b
commit 822cf629ad
2 changed files with 5 additions and 5 deletions

@ -41,7 +41,7 @@ public class StorageBlock extends Block implements PolymerTexturedBlock, BlockEn
public StorageBlock(Settings settings, BlockModelType type, String modelId) { public StorageBlock(Settings settings, BlockModelType type, String modelId) {
super(settings); super(settings);
this.polymerBlockState = PolymerBlockResourceUtils.requestBlock(type, PolymerBlockModel.of(new Identifier(ServerStorage.MODID, modelId))); this.polymerBlockState = PolymerBlockResourceUtils.requestBlock(type, PolymerBlockModel.of(Identifier.of(ServerStorage.MODID, modelId)));
} }
@Override @Override
@ -50,14 +50,14 @@ public class StorageBlock extends Block implements PolymerTexturedBlock, BlockEn
} }
public static void register() { public static void register() {
var modId = new Identifier(ServerStorage.MODID, ServerStorage.MODELID); var modId = Identifier.of(ServerStorage.MODID, ServerStorage.MODELID);
STORAGE_BLOCK = Registry.register(Registries.BLOCK, modId, STORAGE_BLOCK = Registry.register(Registries.BLOCK, modId,
new StorageBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL), BlockModelType.FULL_BLOCK, ServerStorage.MODELID)); new StorageBlock(AbstractBlock.Settings.copy(Blocks.WHITE_WOOL), BlockModelType.FULL_BLOCK, ServerStorage.MODELID));
UseBlockCallback.EVENT.register(StorageBlock::onUse); UseBlockCallback.EVENT.register(StorageBlock::onUse);
STORAGE_BLOCK_ENTITY = Registry.register( STORAGE_BLOCK_ENTITY = Registry.register(
Registries.BLOCK_ENTITY_TYPE, Registries.BLOCK_ENTITY_TYPE,
new Identifier(MODID, MODELID), Identifier.of(MODID, MODELID),
BlockEntityType.Builder.create(StorageBlockEntity::new, STORAGE_BLOCK).build(null) BlockEntityType.Builder.create(StorageBlockEntity::new, STORAGE_BLOCK).build(null)
); );
PolymerBlockUtils.registerBlockEntity(STORAGE_BLOCK_ENTITY); PolymerBlockUtils.registerBlockEntity(STORAGE_BLOCK_ENTITY);

@ -20,7 +20,7 @@ public class StorageBlockItem extends BlockItem implements PolymerItem {
public StorageBlockItem(Settings settings, Block block, String modelId) { public StorageBlockItem(Settings settings, Block block, String modelId) {
super(block, settings); super(block, settings);
this.polymerModel = PolymerResourcePackUtils.requestModel(Items.BARRIER, new Identifier(ServerStorage.MODID, modelId)); this.polymerModel = PolymerResourcePackUtils.requestModel(Items.BARRIER, Identifier.of(ServerStorage.MODID, modelId));
} }
@Override @Override
@ -34,7 +34,7 @@ public class StorageBlockItem extends BlockItem implements PolymerItem {
} }
public static void register() { public static void register() {
var modId = new Identifier(ServerStorage.MODID, ServerStorage.MODELID); var modId = Identifier.of(ServerStorage.MODID, ServerStorage.MODELID);
Item item = Registry.register(Registries.ITEM, modId, new StorageBlockItem(new Item.Settings(), STORAGE_BLOCK, ServerStorage.MODELID)); Item item = Registry.register(Registries.ITEM, modId, new StorageBlockItem(new Item.Settings(), STORAGE_BLOCK, ServerStorage.MODELID));
ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item)); ItemGroupEvents.modifyEntriesEvent(ItemGroups.FUNCTIONAL).register(content -> content.add(item));
} }