mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-11-20 20:32:24 +00:00
The Great Refractor!
This commit is contained in:
1 parent
aa52debeb5
commit
5b5e29a8ce
92 files changed
+1616
-1452
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package info.jbcs.minecraft.chisel.compat;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import info.jbcs.minecraft.chisel.ChiselModCompatibility;
|
||||
import info.jbcs.minecraft.chisel.carving.Carving;
|
||||
|
||||
public class Compatibility
|
||||
{
|
||||
|
||||
public static void init(FMLPostInitializationEvent event)
|
||||
{
|
||||
new ChiselModCompatibility().postInit(event);
|
||||
|
||||
addSupport("ProjRed|Exploration", "projectred.exploration.stone", "marble", 0, 99);
|
||||
addSupport("bluepower", "marble", "marble", 0, 99);
|
||||
|
||||
addSupport("PFAAGeologica", "strongStone", "marble", 5, 99);
|
||||
addSupport("PFAAGeologica", "strongStoneSlab", "marbleSlab", 5, 99);
|
||||
addSupport("PFAAGeologica", "strongStoneBrickStairs.marble", "marbleStairs", 0, 99);
|
||||
addSupport("PFAAGeologica", "mediumStone", "limestone", 0, 99);
|
||||
addSupport("PFAAGeologica", "mediumStoneSlab", "limestoneSlab", 0, 99);
|
||||
addSupport("PFAAGeologica", "mediumStoneBrickStairs.limestone", "limestoneStairs", 0, 99);
|
||||
addSupport("PFAAGeologica", "strongStoneBrick", "stoneBrick", 3, 99);
|
||||
addSupport("PFAAGeologica", "strongCobble", "cobblestone", 3, 99);
|
||||
}
|
||||
|
||||
public static void addSupport(String modname, String blockname, String name, int metadata, int order)
|
||||
{
|
||||
if(Loader.isModLoaded(modname) && GameRegistry.findBlock(modname, blockname) != null)
|
||||
{
|
||||
Carving.chisel.addVariation(name, GameRegistry.findBlock(modname, blockname), metadata, order);
|
||||
GameRegistry.findBlock(modname, blockname).setHarvestLevel("chisel", 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package info.jbcs.minecraft.chisel.compat;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
import info.jbcs.minecraft.chisel.compat.ModIntegration.IModIntegration;
|
||||
import info.jbcs.minecraft.chisel.init.ModBlocks;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FMPIntegration implements IModIntegration{
|
||||
@Override
|
||||
public String getModId(){
|
||||
return "ForgeMultipart";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(){
|
||||
registerMaterial(ModBlocks.marble);
|
||||
registerMaterial(ModBlocks.marbleSlab);
|
||||
registerMaterial(ModBlocks.marblePillar);
|
||||
registerMaterial(ModBlocks.marblePillarSlab);
|
||||
registerMaterial(ModBlocks.marbleStairs);
|
||||
registerMaterial(ModBlocks.limestone);
|
||||
registerMaterial(ModBlocks.limestoneSlab);
|
||||
registerMaterial(ModBlocks.limestoneStairs);
|
||||
registerMaterial(ModBlocks.cobblestone);
|
||||
registerMaterial(ModBlocks.glass);
|
||||
registerMaterial(ModBlocks.sandstone, 3, 15);
|
||||
registerMaterial(ModBlocks.sandstoneScribbles);
|
||||
registerMaterial(ModBlocks.concrete, 0, 10);
|
||||
registerMaterial(ModBlocks.iron, 1, 15);
|
||||
registerMaterial(ModBlocks.gold, 1, 14);
|
||||
registerMaterial(ModBlocks.diamond, 1, 12);
|
||||
registerMaterial(ModBlocks.lightstone, 1, 15);
|
||||
registerMaterial(ModBlocks.lapis, 1, 8);
|
||||
registerMaterial(ModBlocks.emerald, 1, 11);
|
||||
registerMaterial(ModBlocks.netherBrick, 1, 15);
|
||||
registerMaterial(ModBlocks.netherrack, 1, 14);
|
||||
registerMaterial(ModBlocks.cobblestoneMossy, 1, 15);
|
||||
registerMaterial(ModBlocks.stoneBrick, 4, 15);
|
||||
registerMaterial(ModBlocks.dirt, 0, 12);
|
||||
registerMaterial(ModBlocks.ice, 1, 15);
|
||||
registerMaterial(ModBlocks.icePillar);
|
||||
registerMaterial(ModBlocks.iceStairs);
|
||||
registerMaterial(ModBlocks.obsidian, 1, 15);
|
||||
registerMaterial(ModBlocks.paneIron, 1, 9);
|
||||
registerMaterial(ModBlocks.redstone, 1, 15);
|
||||
registerMaterial(ModBlocks.holystone, 0, 13);
|
||||
registerMaterial(ModBlocks.lavastone, 0, 6);
|
||||
registerMaterial(ModBlocks.fantasy);
|
||||
registerMaterial(ModBlocks.carpet);
|
||||
registerMaterial(ModBlocks.carpetFloor);
|
||||
registerMaterial(ModBlocks.bookshelf, 0, 8);
|
||||
registerMaterial(ModBlocks.tyrian);
|
||||
registerMaterial(ModBlocks.temple);
|
||||
registerMaterial(ModBlocks.templeMossy);
|
||||
registerMaterial(ModBlocks.cloud, 0, 0);
|
||||
registerMaterial(ModBlocks.factory);
|
||||
registerMaterial(ModBlocks.paperWall, 0, 8);
|
||||
registerMaterial(ModBlocks.laboratory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(){
|
||||
|
||||
}
|
||||
|
||||
private void registerMaterial(Block block){
|
||||
registerMaterial(block, 0, 15);
|
||||
}
|
||||
|
||||
private void registerMaterial(Block block, int minMeta, int maxMeta){
|
||||
for(int c = minMeta; c <= maxMeta; c++){
|
||||
FMLInterModComms.sendMessage(getModId(), "microMaterial", new ItemStack(block, 1, c));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package info.jbcs.minecraft.chisel.compat;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ModIntegration {
|
||||
|
||||
private static List<IModIntegration> integratedMods = new ArrayList<IModIntegration>();
|
||||
|
||||
public static void addMod(Class<? extends IModIntegration> cls){
|
||||
try{
|
||||
IModIntegration obj = cls.newInstance();
|
||||
|
||||
if(Loader.isModLoaded(obj.getModId())){
|
||||
integratedMods.add(obj);
|
||||
}
|
||||
} catch(Throwable throwable){
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void init(){
|
||||
try{
|
||||
for(IModIntegration integration : integratedMods){
|
||||
integration.onInit();
|
||||
}
|
||||
} catch (Throwable throwable){
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void postInit(){
|
||||
try {
|
||||
for (IModIntegration integration : integratedMods){
|
||||
integration.onPostInit();
|
||||
}
|
||||
} catch (Throwable throwable){
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
static interface IModIntegration{
|
||||
String getModId();
|
||||
void onInit();
|
||||
void onPostInit();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user