mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-15 17:44:57 +00:00
[ci skip] spotlessApply with the new settings
This commit is contained in:
1 parent
a314fccd1b
commit
8f026dad8f
161 files changed
+14073
-12846
No files matched your search
@@ -53,149 +53,159 @@ import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||
|
||||
@Mod(modid = Chisel.MOD_ID, name = Chisel.MOD_NAME, version = Chisel.VERSION, guiFactory = "team.chisel.client.gui.GuiFactory", dependencies = "after:EE3;after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest")
|
||||
@Mod(
|
||||
modid = Chisel.MOD_ID,
|
||||
name = Chisel.MOD_NAME,
|
||||
version = Chisel.VERSION,
|
||||
guiFactory = "team.chisel.client.gui.GuiFactory",
|
||||
dependencies = "after:EE3;after:ForgeMultipart;after:Thaumcraft;after:appliedenergistics2;after:Railcraft;after:AWWayofTime;after:TwilightForest")
|
||||
public class Chisel {
|
||||
|
||||
public static final String MOD_ID = "chisel";
|
||||
public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType("dig.stone", MOD_ID + ":step.templeblock", 1.0f, 1.0f);
|
||||
public static final String MOD_NAME = "Chisel";
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType("holystone", 1.0f, 1.0f);
|
||||
public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f);
|
||||
public static boolean multipartLoaded = false;
|
||||
public static boolean gtnhLoaded = false;
|
||||
public static int renderEldritchId;
|
||||
public static int renderAutoChiselId;
|
||||
public static int renderGlowId;
|
||||
public static int renderLayeredId;
|
||||
public static int roadLineId;
|
||||
public static final String MOD_ID = "chisel";
|
||||
public static final BlockCarvable.SoundType soundTempleFootstep = new BlockCarvable.SoundType(
|
||||
"dig.stone",
|
||||
MOD_ID + ":step.templeblock",
|
||||
1.0f,
|
||||
1.0f);
|
||||
public static final String MOD_NAME = "Chisel";
|
||||
public static final String VERSION = "GRADLETOKEN_VERSION";
|
||||
public static final BlockCarvable.SoundType soundHolystoneFootstep = new BlockCarvable.SoundType(
|
||||
"holystone",
|
||||
1.0f,
|
||||
1.0f);
|
||||
public static final BlockCarvable.SoundType soundMetalFootstep = new BlockCarvable.SoundType("metal", 1.0f, 1.0f);
|
||||
public static boolean multipartLoaded = false;
|
||||
public static boolean gtnhLoaded = false;
|
||||
public static int renderEldritchId;
|
||||
public static int renderAutoChiselId;
|
||||
public static int renderGlowId;
|
||||
public static int renderLayeredId;
|
||||
public static int roadLineId;
|
||||
|
||||
public static final Logger logger = LogManager.getLogger(MOD_NAME);
|
||||
public static final Logger logger = LogManager.getLogger(MOD_NAME);
|
||||
|
||||
@Instance(MOD_ID)
|
||||
public static Chisel instance;
|
||||
@Instance(MOD_ID)
|
||||
public static Chisel instance;
|
||||
|
||||
public Chisel() {
|
||||
ChiselAPIProps.MOD_ID = MOD_ID;
|
||||
CarvableHelper.itemCarvableClass = ItemCarvable.class;
|
||||
Carving.construct();
|
||||
}
|
||||
public Chisel() {
|
||||
ChiselAPIProps.MOD_ID = MOD_ID;
|
||||
CarvableHelper.itemCarvableClass = ItemCarvable.class;
|
||||
Carving.construct();
|
||||
}
|
||||
|
||||
@SidedProxy(clientSide = "team.chisel.proxy.ClientProxy", serverSide = "team.chisel.proxy.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
@SidedProxy(clientSide = "team.chisel.proxy.ClientProxy", serverSide = "team.chisel.proxy.CommonProxy")
|
||||
public static CommonProxy proxy;
|
||||
|
||||
@EventHandler
|
||||
public void missingMapping(FMLMissingMappingsEvent event) {
|
||||
BlockNameConversion.init();
|
||||
@EventHandler
|
||||
public void missingMapping(FMLMissingMappingsEvent event) {
|
||||
BlockNameConversion.init();
|
||||
|
||||
for (MissingMapping m : event.get()) {
|
||||
// This bug was introduced along with Chisel 1.5.2, and was fixed in
|
||||
// 1.5.3.
|
||||
// Ice Stairs were called null.0-7 instead of other names, and
|
||||
// Marble/Limestone stairs did not exist.
|
||||
// This fixes the bug.
|
||||
if (m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) {
|
||||
m.warn();// (Action.WARN);
|
||||
}
|
||||
for (MissingMapping m : event.get()) {
|
||||
// This bug was introduced along with Chisel 1.5.2, and was fixed in
|
||||
// 1.5.3.
|
||||
// Ice Stairs were called null.0-7 instead of other names, and
|
||||
// Marble/Limestone stairs did not exist.
|
||||
// This fixes the bug.
|
||||
if (m.name.startsWith("null.") && m.name.length() == 6 && m.type == Type.BLOCK) {
|
||||
m.warn();// (Action.WARN);
|
||||
}
|
||||
|
||||
// Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs,
|
||||
// marbleStairs when loading an old (1.5.4) save
|
||||
else if (m.type == Type.BLOCK) {
|
||||
final Block block = BlockNameConversion.findBlock(m.name);
|
||||
// Fix mapping of snakestoneSand, snakestoneStone, limestoneStairs,
|
||||
// marbleStairs when loading an old (1.5.4) save
|
||||
else if (m.type == Type.BLOCK) {
|
||||
final Block block = BlockNameConversion.findBlock(m.name);
|
||||
|
||||
if (block != null) {
|
||||
m.remap(block);
|
||||
FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block));
|
||||
} else
|
||||
FMLLog.getLogger().warn("Block " + m.name + " could not get remapped.");
|
||||
} else if (m.type == Type.ITEM) {
|
||||
final Item item = BlockNameConversion.findItem(m.name);
|
||||
if (block != null) {
|
||||
m.remap(block);
|
||||
FMLLog.getLogger().info("Remapping block " + m.name + " to " + General.getName(block));
|
||||
} else FMLLog.getLogger().warn("Block " + m.name + " could not get remapped.");
|
||||
} else if (m.type == Type.ITEM) {
|
||||
final Item item = BlockNameConversion.findItem(m.name);
|
||||
|
||||
if (item != null) {
|
||||
m.remap(item);
|
||||
FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item));
|
||||
if (item != null) {
|
||||
m.remap(item);
|
||||
FMLLog.getLogger().info("Remapping item " + m.name + " to " + General.getName(item));
|
||||
|
||||
} else
|
||||
FMLLog.getLogger().warn("Item " + m.name + " could not get remapped.");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else FMLLog.getLogger().warn("Item " + m.name + " could not get remapped.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
FMLCommonHandler.instance().registerCrashCallable(new ChiselCrashCallable());
|
||||
|
||||
File configFile = event.getSuggestedConfigurationFile();
|
||||
Configurations.configExists = configFile.exists();
|
||||
Configurations.config = new Configuration(configFile);
|
||||
Configurations.config.load();
|
||||
Configurations.refreshConfig();
|
||||
@EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
FMLCommonHandler.instance().registerCrashCallable(new ChiselCrashCallable());
|
||||
|
||||
File configFile = event.getSuggestedConfigurationFile();
|
||||
Configurations.configExists = configFile.exists();
|
||||
Configurations.config = new Configuration(configFile);
|
||||
Configurations.config.load();
|
||||
Configurations.refreshConfig();
|
||||
|
||||
if (Loader.isModLoaded("dreamcraft")) {
|
||||
gtnhLoaded = true;
|
||||
}
|
||||
TabsInit.preInit();
|
||||
Features.preInit();
|
||||
Statistics.init();
|
||||
PacketHandler.init();
|
||||
ChiselController.INSTANCE.preInit();
|
||||
if (Loader.isModLoaded("ForgeMultipart")) {
|
||||
new FMPCompat().init();
|
||||
}
|
||||
proxy.preInit();
|
||||
}
|
||||
TabsInit.preInit();
|
||||
Features.preInit();
|
||||
Statistics.init();
|
||||
PacketHandler.init();
|
||||
ChiselController.INSTANCE.preInit();
|
||||
if (Loader.isModLoaded("ForgeMultipart")) {
|
||||
new FMPCompat().init();
|
||||
}
|
||||
proxy.preInit();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
Features.init();
|
||||
@EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
Features.init();
|
||||
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler());
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, new ChiselGuiHandler());
|
||||
|
||||
addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount);
|
||||
addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount);
|
||||
addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5);
|
||||
addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5);
|
||||
addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5);
|
||||
GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000);
|
||||
addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount);
|
||||
addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount);
|
||||
addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5);
|
||||
addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5);
|
||||
addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5);
|
||||
GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000);
|
||||
|
||||
EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);
|
||||
EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);
|
||||
|
||||
proxy.init();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(instance);
|
||||
proxy.init();
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
FMLCommonHandler.instance().bus().register(instance);
|
||||
|
||||
FMLInterModComms.sendMessage("Waila", "register", "team.chisel.compat.WailaCompat.register");
|
||||
}
|
||||
FMLInterModComms.sendMessage("Waila", "register", "team.chisel.compat.WailaCompat.register");
|
||||
}
|
||||
|
||||
private void addWorldgen(Features feature, Block block, double... data) {
|
||||
if (feature.enabled()) {
|
||||
if (data.length == 1) {
|
||||
GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0]);
|
||||
} else if (data.length > 1 && data.length < 4) {
|
||||
GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2]);
|
||||
} else if (data.length == 4) {
|
||||
GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2], data[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void addWorldgen(Features feature, Block block, double... data) {
|
||||
if (feature.enabled()) {
|
||||
if (data.length == 1) {
|
||||
GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0]);
|
||||
} else if (data.length > 1 && data.length < 4) {
|
||||
GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2]);
|
||||
} else if (data.length == 4) {
|
||||
GeneratorChisel.INSTANCE.addFeature(block, 32, (int) data[0], (int) data[1], (int) data[2], data[3]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
TabsInit.postInit();
|
||||
Compatibility.init(event);
|
||||
}
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
TabsInit.postInit();
|
||||
Compatibility.init(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onIMC(IMCEvent event) {
|
||||
for (IMCMessage msg : event.getMessages()) {
|
||||
IMCHandler.INSTANCE.handleMessage(msg);
|
||||
}
|
||||
}
|
||||
@EventHandler
|
||||
public void onIMC(IMCEvent event) {
|
||||
for (IMCMessage msg : event.getMessages()) {
|
||||
IMCHandler.INSTANCE.handleMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
|
||||
if (event.modID.equals("chisel")) {
|
||||
Configurations.refreshConfig();
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) {
|
||||
if (event.modID.equals("chisel")) {
|
||||
Configurations.refreshConfig();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user