Post init interface
This commit is contained in:
parent
cb51137c87
commit
992d755801
3 changed files with 18 additions and 0 deletions
|
@ -6,6 +6,7 @@ import net.minecraft.client.renderer.RenderType;
|
||||||
import net.minecraft.core.Registry;
|
import net.minecraft.core.Registry;
|
||||||
import ru.bclib.api.ModIntegrationAPI;
|
import ru.bclib.api.ModIntegrationAPI;
|
||||||
import ru.bclib.client.render.BCLRenderLayer;
|
import ru.bclib.client.render.BCLRenderLayer;
|
||||||
|
import ru.bclib.interfaces.IPostInit;
|
||||||
import ru.bclib.interfaces.IRenderTyped;
|
import ru.bclib.interfaces.IRenderTyped;
|
||||||
import ru.bclib.registry.BaseBlockEntityRenders;
|
import ru.bclib.registry.BaseBlockEntityRenders;
|
||||||
|
|
||||||
|
@ -15,6 +16,11 @@ public class BCLibClient implements ClientModInitializer {
|
||||||
ModIntegrationAPI.registerAll();
|
ModIntegrationAPI.registerAll();
|
||||||
BaseBlockEntityRenders.register();
|
BaseBlockEntityRenders.register();
|
||||||
registerRenderLayers();
|
registerRenderLayers();
|
||||||
|
Registry.BLOCK.forEach(block -> {
|
||||||
|
if (block instanceof IPostInit) {
|
||||||
|
((IPostInit) block).postInit();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void registerRenderLayers() {
|
private void registerRenderLayers() {
|
||||||
|
|
5
src/main/java/ru/bclib/interfaces/IPostInit.java
Normal file
5
src/main/java/ru/bclib/interfaces/IPostInit.java
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
package ru.bclib.interfaces;
|
||||||
|
|
||||||
|
public interface IPostInit {
|
||||||
|
void postInit();
|
||||||
|
}
|
|
@ -1,11 +1,18 @@
|
||||||
package ru.bclib.server;
|
package ru.bclib.server;
|
||||||
|
|
||||||
import net.fabricmc.api.DedicatedServerModInitializer;
|
import net.fabricmc.api.DedicatedServerModInitializer;
|
||||||
|
import net.minecraft.core.Registry;
|
||||||
import ru.bclib.api.ModIntegrationAPI;
|
import ru.bclib.api.ModIntegrationAPI;
|
||||||
|
import ru.bclib.interfaces.IPostInit;
|
||||||
|
|
||||||
public class BCLibServer implements DedicatedServerModInitializer {
|
public class BCLibServer implements DedicatedServerModInitializer {
|
||||||
@Override
|
@Override
|
||||||
public void onInitializeServer() {
|
public void onInitializeServer() {
|
||||||
ModIntegrationAPI.registerAll();
|
ModIntegrationAPI.registerAll();
|
||||||
|
Registry.BLOCK.forEach(block -> {
|
||||||
|
if (block instanceof IPostInit) {
|
||||||
|
((IPostInit) block).postInit();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue