Skip to content

Commit d6dbbe6

Browse files
committed
🐺📨
1 parent 83071d5 commit d6dbbe6

6 files changed

Lines changed: 13 additions & 19 deletions

File tree

src/main/java/top/ctnstudio/futurefood/api/IObjectRegister.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ public interface IObjectRegister<T> {
1818
ImmutableMap<ResourceLocation, Lazy<T>> copyObjects();
1919

2020
/**
21-
* Register an object.
21+
* @apiNote Register an object.
2222
*
23-
* @param name
24-
* @param supplier
25-
* @return
23+
* @param name the register name, it will make a ResourceLocation by mod.
24+
* @param supplier the object we will register. Never use an object instance without a wrapper,
25+
* too early to use the data will make registry holder crash.
26+
* @return the supplier who is input, or it will make a lazy wrapper.
2627
*/
2728
@Internal
2829
Supplier<T> register(String name, Supplier<T> supplier);
@@ -40,7 +41,7 @@ public interface IObjectRegister<T> {
4041
ResourceKey<? extends Registry<T>> getResourceKey();
4142

4243
/**
43-
* Return the raw map in register.
44+
* return the raw map in register.
4445
*/
4546
@Internal
4647
Map<ResourceLocation, Lazy<T>> getObjectMap();

src/main/java/top/ctnstudio/futurefood/common/item/ItemBlockBase.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main/java/top/ctnstudio/futurefood/core/FfClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
@Mod(value = FutureFood.ID, dist = Dist.CLIENT)
88
public class FfClient {
9+
@SuppressWarnings("unused")
910
public FfClient(ModContainer container) {
1011
}
1112
}

src/main/java/top/ctnstudio/futurefood/core/FfDatagen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* 数据生成主类
2424
*/
2525
@EventBusSubscriber()
26+
@SuppressWarnings("all")
2627
public class FfDatagen {
2728
@SubscribeEvent
2829
public static void gatherData(final GatherDataEvent event) throws IOException {

src/main/java/top/ctnstudio/futurefood/core/FutureFood.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import javax.annotation.CheckForNull;
1717
import javax.annotation.Nonnull;
1818

19+
@SuppressWarnings("unused")
1920
@Mod(FutureFood.ID)
2021
public class FutureFood {
2122
public static final String ID = "futurefood";
@@ -53,9 +54,9 @@ public static <T> T getModObject(final Registry<T> registry, final String name)
5354
* Register the objects in mod.
5455
*/
5556
private void register(final RegisterEvent event) {
56-
ModBlock.init(event);
57-
ModTileEntity.init(event);
58-
ModItem.init(event);
57+
ModBlock.INSTANCE.registerObject(event);
58+
ModTileEntity.INSTANCE.registerObject(event);
59+
ModItem.INSTANCE.registerObject(event);
5960
ModCreativeModeTab.init(event);
6061
}
6162
}

src/main/java/top/ctnstudio/futurefood/core/init/ModTileEntity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ private ModTileEntity() {
2323
super(BuiltInRegistries.BLOCK_ENTITY_TYPE, Registries.BLOCK_ENTITY_TYPE);
2424
}
2525

26+
@SuppressWarnings("all")
2627
@Nonnull
2728
private static Supplier<BlockEntityType<?>> register(final String name,
2829
final BlockEntitySupplier<?> blockEntity) {

0 commit comments

Comments
 (0)