2019-09-03 08:34:02 +02:00
|
|
|
package com.simibubi.create;
|
|
|
|
|
2019-09-22 20:23:26 +02:00
|
|
|
import com.simibubi.create.modules.contraptions.CachedBufferReloader;
|
2019-09-12 10:00:15 +02:00
|
|
|
import com.simibubi.create.modules.contraptions.receivers.EncasedFanParticleHandler;
|
2019-09-03 08:34:02 +02:00
|
|
|
import com.simibubi.create.modules.schematics.ClientSchematicLoader;
|
|
|
|
import com.simibubi.create.modules.schematics.client.SchematicAndQuillHandler;
|
|
|
|
import com.simibubi.create.modules.schematics.client.SchematicHandler;
|
|
|
|
import com.simibubi.create.modules.schematics.client.SchematicHologram;
|
|
|
|
|
2019-09-22 20:23:26 +02:00
|
|
|
import net.minecraft.client.Minecraft;
|
|
|
|
import net.minecraft.resources.IReloadableResourceManager;
|
|
|
|
import net.minecraft.resources.IResourceManager;
|
2019-09-03 08:34:02 +02:00
|
|
|
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
|
|
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
|
|
|
|
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
|
2019-09-10 22:51:26 +02:00
|
|
|
import net.minecraftforge.fml.config.ModConfig;
|
2019-09-03 08:34:02 +02:00
|
|
|
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
|
|
|
|
|
2019-09-10 22:51:26 +02:00
|
|
|
@EventBusSubscriber(bus = Bus.MOD)
|
2019-09-03 08:34:02 +02:00
|
|
|
public class CreateClient {
|
|
|
|
|
|
|
|
public static ClientSchematicLoader schematicSender;
|
|
|
|
public static SchematicHandler schematicHandler;
|
|
|
|
public static SchematicHologram schematicHologram;
|
|
|
|
public static SchematicAndQuillHandler schematicAndQuillHandler;
|
2019-09-12 10:00:15 +02:00
|
|
|
public static EncasedFanParticleHandler fanParticles;
|
2019-09-03 08:34:02 +02:00
|
|
|
|
2019-09-10 22:51:26 +02:00
|
|
|
public static ModConfig config;
|
2019-09-22 20:23:26 +02:00
|
|
|
|
2019-09-03 08:34:02 +02:00
|
|
|
@SubscribeEvent
|
|
|
|
public static void clientInit(FMLClientSetupEvent event) {
|
|
|
|
schematicSender = new ClientSchematicLoader();
|
|
|
|
schematicHandler = new SchematicHandler();
|
|
|
|
schematicHologram = new SchematicHologram();
|
2019-09-03 23:03:52 +02:00
|
|
|
schematicAndQuillHandler = new SchematicAndQuillHandler();
|
2019-09-12 10:00:15 +02:00
|
|
|
fanParticles = new EncasedFanParticleHandler();
|
2019-09-22 20:23:26 +02:00
|
|
|
|
2019-09-03 08:34:02 +02:00
|
|
|
AllKeys.register();
|
|
|
|
AllContainers.registerScreenFactories();
|
|
|
|
AllTileEntities.registerRenderers();
|
|
|
|
AllItems.registerColorHandlers();
|
2019-09-13 18:36:18 +02:00
|
|
|
AllBlocks.registerColorHandlers();
|
2019-09-22 20:23:26 +02:00
|
|
|
|
|
|
|
IResourceManager resourceManager = Minecraft.getInstance().getResourceManager();
|
|
|
|
if (resourceManager instanceof IReloadableResourceManager)
|
|
|
|
((IReloadableResourceManager) resourceManager).addReloadListener(new CachedBufferReloader());
|
2019-09-03 08:34:02 +02:00
|
|
|
}
|
2019-09-22 20:23:26 +02:00
|
|
|
|
2019-09-10 22:51:26 +02:00
|
|
|
@SubscribeEvent
|
|
|
|
public static void createConfigs(ModConfig.ModConfigEvent event) {
|
|
|
|
if (event.getConfig().getSpec() == CreateConfig.specification)
|
|
|
|
return;
|
2019-09-22 20:23:26 +02:00
|
|
|
|
2019-09-10 22:51:26 +02:00
|
|
|
config = event.getConfig();
|
|
|
|
}
|
2019-09-03 08:34:02 +02:00
|
|
|
|
|
|
|
public static void gameTick() {
|
|
|
|
schematicSender.tick();
|
|
|
|
schematicAndQuillHandler.tick();
|
|
|
|
schematicHandler.tick();
|
|
|
|
schematicHologram.tick();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|