@Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod {
public static final String MODID = "syokuninnu";
public static final String VERSION = "1.0";
public static CreativeTabs mytab = new mytab("mytab");//自作タブを追加する
//アイテムを定義する
public static Item rogo = new pierogo();
public static Item reds = new reds();
public static Item milkb = new milkb();
public static Item creamb = new creamb();
public static Item buttersb2 = new buttersb2();
public static Item buttersb = new buttersb();
public static Item uth1 = new uth1();
public static Item uth2 = new uth2();
public static Item butter = new butterb();
public static Item realknife = new realknife();
public static Item monsc = new monsc();
public static Item dream = new dream();
//ブロックを定義する
public static Block blockpie1 = new blockpie1();
public static Block blockpie2 = new blockpie2();
public static Block blockpie3 = new blockpie3();
public static Block blockpie4 = new blockpie4();
//食べ物を追加する(ここで回復量もきめる)
public final Item itempie = new itempie(2191, 10, false);
public final Item qui = new Quiche(2192, 5, false);
public static Item snowp = new snowp(2193, 10, false);
public static Item spc = new spc(2194, 4, false);
public static Item spd = new spd(2195, 6, false);
public static Item ncream = new ncream(2196, 5, false);
public static Item bisicle = new bisicle(2197,5, false);
public static Item unisicle = new unisicle(2198,5,false);
//実績を定義する
public static Achievement suicide;
public static Achievement xp;
public static Achievement LOVE;
public static Achievement eatpie;
public static Achievement nice;
public static Achievement crazy;
public static int love = 0;
//アーマー関係を定義
public static Item hart;
public static Item band;
public static ItemArmor.ArmorMaterial ut1a;
//レンダーを定義
public static int RenderID1;
public static int RenderID2;
public static int RenderID3;
public static int RenderID4;
@EventHandler
public void init(FMLInitializationEvent event) {
//他のイベントに関するスクリプトを読み込む
//(モブドロップとか)
MinecraftForge.EVENT_BUS.register(new CustomDropEventHundler());
MinecraftForge.EVENT_BUS.register(new killmob());
//簡易レンダーを読み込む
this.RenderID1 = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new render1());
this.RenderID2 = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new render2());
this.RenderID3 = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new render3());
this.RenderID4 = RenderingRegistry.getNextAvailableRenderId();
RenderingRegistry.registerBlockHandler(new render4());
//ロゴ
GameRegistry.registerItem(rogo, "rogo");
//ハート
GameRegistry.registerItem(uth1, "uth1");
GameRegistry.registerItem(uth2, "uth2");
//パイ(アイテム)
GameRegistry.registerItem(itempie, "itempie");
//バタースコッチパイ(Block)
GameRegistry.registerBlock(blockpie1, "blockpie1");
GameRegistry.addRecipe(new ItemStack(blockpie1),
"CCC",
"BAB",
"DDD",
'A', Items.egg,
'B', Items.sugar,
'C', buttersb,
'D', Items.wheat);
GameRegistry.addRecipe(new ItemStack(itempie, 4),
"A",
'A', ExampleMod.blockpie1);
GameRegistry.registerBlock(blockpie2, "blockpie2");
GameRegistry.registerBlock(blockpie3, "blockpie3");
GameRegistry.registerBlock(blockpie4, "blockpie4");
//赤砂糖
GameRegistry.registerItem(reds, "reds");
GameRegistry.addRecipe(new ItemStack(reds, 4),
"AA",
"AA",
'A', Items.reeds);
//ミルク瓶
GameRegistry.registerItem(milkb, "milkb");
GameRegistry.addRecipe(new ItemStack(milkb, 8),
"AAA",
"ABA",
"AAA",
'A', Items.glass_bottle,
'B', Items.milk_bucket);
//バター
GameRegistry.registerItem(butter, "butter");
GameRegistry.addShapelessRecipe(new ItemStack(butter), milkb);
//生クリーム瓶
GameRegistry.registerItem(creamb, "creamb");
GameRegistry.addSmelting(milkb, new ItemStack(creamb), 0.3f);//かまどのレシピ
//バタースコッチの素
GameRegistry.registerItem(buttersb2, "buttersb2");
GameRegistry.addShapelessRecipe(new ItemStack(buttersb2), reds, reds, butter, creamb);//自由なレシピ(素材をどこにおいてもいいタイプ)
//バタースコッチ
GameRegistry.registerItem(buttersb, "buttersb");
GameRegistry.addSmelting(buttersb2, new ItemStack(buttersb), 0.3f);
//ナイフ
GameRegistry.registerItem(realknife, "realknife");
//キッシュ
GameRegistry.registerItem(qui, "qui");
GameRegistry.addShapelessRecipe(new ItemStack(qui), Items.wheat, Items.egg, Items.carrot, Items.potato);
//スノーピース
GameRegistry.registerItem(snowp, "snowp");
//モンスターキャンディ
GameRegistry.registerItem(monsc, "monsc");
GameRegistry.addShapelessRecipe(new ItemStack(monsc), Items.sugar, Items.paper);
//スパイダーソーダ
GameRegistry.registerItem(spc, "spc");
GameRegistry.addShapelessRecipe(new ItemStack(spc), Items.potionitem, Items.fermented_spider_eye,Items.sugar);
//クモドーナツ
GameRegistry.registerItem(spd,"spd");
GameRegistry.addShapelessRecipe(new ItemStack(spd,8), Items.wheat,Items.wheat, Items.wheat,Items.wheat, Items.wheat,Items.wheat, Items.wheat,Items.wheat,spc);
//ナイスクリーム
GameRegistry.registerItem(ncream,"ncream");
GameRegistry.addShapelessRecipe(new ItemStack(ncream,3), Items.wheat, Items.paper,Items.sugar,Items.egg,creamb);
//バイシックル
GameRegistry.registerItem(bisicle,"bisicle");
GameRegistry.addShapelessRecipe(new ItemStack(bisicle,1), Items.stick, Items.sugar,Items.sugar,Items.potionitem);
//ユニシックル
GameRegistry.registerItem(unisicle,"unisicle");
GameRegistry.addShapelessRecipe(new ItemStack(unisicle,2), bisicle);
//実績の実装
//内部名称, 言語名称, 横の位置, 縦の位置, アイコンのアイテム, 親実績
//縦の位置はマイナスで上 横の位置はマイナスで左
this.suicide = new Achievement("Suicide", "suicide", 0, 0,
new ItemStack(this.uth1, 0), null);
//Achievement("名前", "名前", 横位置, 縦位置,new ItemStack(this.アイコンのアイテム, 0), 親実績);
this.xp = new Achievement("Xp", "xp", 0, -2,
new ItemStack(this.uth2, 0), null);
this.LOVE = new Achievement("LOVE", "love", 2, -2,
new ItemStack(this.uth2, 0), xp);
this.eatpie = new Achievement("eatpie", "pie", 2, 0,
new ItemStack(this.itempie, 0), null);
this.nice = new Achievement("nice", "nice", -2, 2,
new ItemStack(this.ncream, 0), null);
this.crazy = new Achievement("crazy", "crazy",-2, -2,
new ItemStack(this.realknife, 0), xp);
AchievementPage.registerAchievementPage(new AchievementPage("under", new Achievement[]{this.suicide, this.xp, this.LOVE, this.eatpie,this.nice,this.crazy}));
}
//自作コマンドのスクリプトを読み込む
@EventHandler
public void serverLoad(FMLServerStartingEvent event){
event.registerServerCommand(new command1());
}
//防具の追加
@Mod.EventHandler
public void perInit(FMLPreInitializationEvent event) {
//定義&防御力など
ut1a = EnumHelper.addArmorMaterial("ut1a", 0, new int[]{1, 20, 1, 1}, 0);
ut1a.customCraftingMaterial = uth1;
band = new ut1(0) {
public void onArmorTick(World world, EntityPlayer entity, ItemStack itemStack) {
int i = (int) entity.posX;
int j = (int) entity.posY;
int k = (int) entity.posZ;
}
}
.setUnlocalizedName("band")
.setTextureName(ExampleMod.MODID+":band");
GameRegistry.registerItem(band,"band");
hart = new ut1(1) {
public void onArmorTick(World world, EntityPlayer entity, ItemStack itemStack) {
int i = (int) entity.posX;
int j = (int) entity.posY;
int k = (int) entity.posZ;
}
}
.setUnlocalizedName("hart")
.setTextureName(ExampleMod.MODID + ":hartn");
GameRegistry.registerItem(hart, "hart");
}
}