End Stone Smelter
This commit is contained in:
parent
257307d93d
commit
a542aac45b
18 changed files with 551 additions and 77 deletions
|
@ -31,7 +31,7 @@ public class BlockEntityRegistry {
|
|||
BlockEntityType.Builder.create(ESignBlockEntity::new, getSigns()));
|
||||
|
||||
public static <T extends BlockEntity> BlockEntityType<T> registerBlockEntity(String id, BlockEntityType.Builder<T> builder) {
|
||||
return Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier(BetterEnd.MOD_ID, id), builder.build(null));
|
||||
return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.getResId(id), builder.build(null));
|
||||
}
|
||||
|
||||
public static void register() {}
|
||||
|
|
|
@ -42,12 +42,12 @@ public class BlockRegistry {
|
|||
public static void register() {}
|
||||
|
||||
public static Block registerBlock(String name, Block block) {
|
||||
Registry.register(Registry.BLOCK, new Identifier(BetterEnd.MOD_ID, name), block);
|
||||
Registry.register(Registry.BLOCK, BetterEnd.getResId(name), block);
|
||||
ItemRegistry.registerItem(name, new BlockItem(block, new Item.Settings().group(CreativeTab.END_TAB)));
|
||||
return block;
|
||||
}
|
||||
|
||||
public static Block registerBlockNI(String name, Block block) {
|
||||
return Registry.register(Registry.BLOCK, new Identifier(BetterEnd.MOD_ID, name), block);
|
||||
return Registry.register(Registry.BLOCK, BetterEnd.getResId(name), block);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
package ru.betterend.registry;
|
||||
|
||||
import net.fabricmc.fabric.api.tag.TagRegistry;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.tag.Tag;
|
||||
import net.minecraft.tag.Tag.Identified;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.util.TagHelper;
|
||||
|
||||
|
@ -12,7 +13,7 @@ public class BlockTagRegistry {
|
|||
public static final Tag.Identified<Block> END_GROUND = makeTag("end_ground");
|
||||
|
||||
private static Tag.Identified<Block> makeTag(String name) {
|
||||
return (Identified<Block>) TagRegistry.block(new Identifier(BetterEnd.MOD_ID, name));
|
||||
return (Identified<Block>) TagRegistry.block(BetterEnd.getResId(name));
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
|
|
|
@ -8,8 +8,8 @@ import net.minecraft.item.BlockItem;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
|
||||
import ru.betterend.BetterEnd;
|
||||
|
||||
public class ItemRegistry {
|
||||
|
@ -22,7 +22,7 @@ public class ItemRegistry {
|
|||
|
||||
protected static Item registerItem(String name, Item item) {
|
||||
if (item != Items.AIR) {
|
||||
Registry.register(Registry.ITEM, new Identifier(BetterEnd.MOD_ID, name), item);
|
||||
Registry.register(Registry.ITEM, BetterEnd.getResId(name), item);
|
||||
if (item instanceof BlockItem)
|
||||
MOD_BLOCKS.add(item);
|
||||
else
|
||||
|
|
11
src/main/java/ru/betterend/registry/ScreensRegistry.java
Normal file
11
src/main/java/ru/betterend/registry/ScreensRegistry.java
Normal file
|
@ -0,0 +1,11 @@
|
|||
package ru.betterend.registry;
|
||||
|
||||
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
|
||||
import ru.betterend.client.gui.EndStoneSmelterScreen;
|
||||
import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
|
||||
|
||||
public class ScreensRegistry {
|
||||
public static void register() {
|
||||
ScreenRegistry.register(EndStoneSmelterScreenHandler.HANDLER_TYPE, EndStoneSmelterScreen::new);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue