提供: Minecraft Modding Wiki
この編集を取り消せます。
下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
10行目: | 10行目: | ||
package custom.tool.item; | package custom.tool.item; | ||
− | |||
import net.minecraft.item.EnumToolMaterial; | import net.minecraft.item.EnumToolMaterial; | ||
− | |||
− | |||
− | |||
− | |||
− | |||
import cpw.mods.fml.common.Mod; | import cpw.mods.fml.common.Mod; | ||
+ | import cpw.mods.fml.common.network.NetworkMod; | ||
import cpw.mods.fml.common.Mod.EventHandler; | import cpw.mods.fml.common.Mod.EventHandler; | ||
import cpw.mods.fml.common.event.FMLPreInitializationEvent; | import cpw.mods.fml.common.event.FMLPreInitializationEvent; | ||
− | |||
import cpw.mods.fml.common.registry.GameRegistry; | import cpw.mods.fml.common.registry.GameRegistry; | ||
import cpw.mods.fml.common.registry.LanguageRegistry; | import cpw.mods.fml.common.registry.LanguageRegistry; | ||
@Mod( | @Mod( | ||
− | modid = CustomModelTools | + | modid = "CustomModelTools", |
− | name = | + | name = "Custom Model Tools", |
− | version = | + | version = "1" |
) | ) | ||
@NetworkMod( | @NetworkMod( | ||
35行目: | 29行目: | ||
public class CustomModelTools | public class CustomModelTools | ||
{ | { | ||
− | |||
− | |||
− | |||
− | |||
public static final boolean clientSideRequiredBoolean = true; | public static final boolean clientSideRequiredBoolean = true; | ||
− | public static final boolean | + | public static final boolean serverSudeRequiredBoolean = false; |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
public static EnumToolMaterial toolMaterial; | public static EnumToolMaterial toolMaterial; | ||
public static ItemTool mainItem; | public static ItemTool mainItem; | ||
− | |||
− | |||
− | |||
− | |||
− | @ | + | @EventHabdler |
public void mainLoading(FMLPreInitializationEvent event) | public void mainLoading(FMLPreInitializationEvent event) | ||
{ | { | ||
− | mainItem = | + | mainItem = new ItemCustomModelTools(3001, toolMaterial.rock).setData("CustomModelItem", "CustomModelItem"); |
− | registerItem(mainItem, "CustomModelItem", "Custom Model Item", "カスタムモデルアイテム" | + | registerItem(mainItem, "CustomModelItem", "Custom Model Item", "カスタムモデルアイテム"); |
− | |||
} | } | ||
− | public void registerItem(Item items, String name, String en_US, String ja_JP | + | public void registerItem(Item items, String name, String en_US, String ja_JP) |
{ | { | ||
− | + | GameReigstry.registerItem(items, name); | |
− | LanguageRegistry | + | LanguageRegistry.addNameForObject(items, "en_US", en_US); |
− | LanguageRegistry | + | LanguageRegistry.addNameForObject(items, "ja_JP", ja_JP); |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
} | } | ||
} | } | ||
92行目: | 56行目: | ||
<source lang = java> | <source lang = java> | ||
package custom.tool.item; | package custom.tool.item; | ||
− | + | ||
import net.minecraft.item.ItemTool; | import net.minecraft.item.ItemTool; | ||
− | |||
import net.minecraft.item.EnumToolMaterial; | import net.minecraft.item.EnumToolMaterial; | ||
import net.minecraft.block.Block; | import net.minecraft.block.Block; | ||
− | |||
public class ItemCustomModelTools extends ItemTool | public class ItemCustomModelTools extends ItemTool | ||
{ | { | ||
− | |||
private static final Block[] setBleakingList = new Block[] {// ItemSpade.java | private static final Block[] setBleakingList = new Block[] {// ItemSpade.java | ||
Block.grass, | Block.grass, | ||
112行目: | 73行目: | ||
Block.tilledField, | Block.tilledField, | ||
Block.slowSand, | Block.slowSand, | ||
− | Block.mycelium | + | Block.mycelium |
// ItemPickaxe.java | // ItemPickaxe.java | ||
Block.cobblestone, | Block.cobblestone, | ||
134行目: | 95行目: | ||
Block.railDetector, | Block.railDetector, | ||
Block.railPowered, | Block.railPowered, | ||
− | Block.railActivator | + | Block.railActivator |
− | + | // ItemAxe.java | |
− | Block.planks, | + | Block.planks, Block.bookShelf, |
− | |||
Block.wood, Block.chest, | Block.wood, Block.chest, | ||
Block.stoneDoubleSlab, | Block.stoneDoubleSlab, | ||
144行目: | 104行目: | ||
Block.pumpkinLantern}; | Block.pumpkinLantern}; | ||
// 詳しい情報は、ItemSpade.java ItemPickaxe.java ItemAxe.javaを参照 | // 詳しい情報は、ItemSpade.java ItemPickaxe.java ItemAxe.javaを参照 | ||
− | + | ||
− | |||
public ItemCustomModelTools(int par1ID, EnumToolMaterial par2EnumToolMaterial) | public ItemCustomModelTools(int par1ID, EnumToolMaterial par2EnumToolMaterial) | ||
{ | { | ||
153行目: | 112行目: | ||
public boolean canHarvestBlock(Block par1Block) | public boolean canHarvestBlock(Block par1Block) | ||
{ | { | ||
− | + | return par1Block == Block.snow ? true : par1Block == Block.blockSnow : //雪 | |
+ | (par1Block == Block.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : //黒曜石 | ||
+ | (par1Block != Block.blockDiamond && par1Block != Block.oreDiamond ? //ダイヤモンド | ||
+ | (par1Block != Block.oreEmerald && par1Block != Block.blockEmerald ? //エメラルド | ||
+ | (par1Block != Block.blockGold && par1Block != Block.oreGold ? //金 | ||
+ | (par1Block != Block.blockIron && par1Block != Block.oreIron ? //鉄 | ||
+ | (par1Block != Block.blockLapis && par1Block != Block.oreLapis ? //ラピスラズリ | ||
+ | (par1Block != Block.oreRedstone && par1Block != Block.oreRedstoneGlowing ? //レッドストーン | ||
+ | (par1Block.blockMaterial == Material.rock ? true : //マテリアル属性 石 | ||
+ | (par1Block.blockMaterial == Material.iron ? true : //マテリアル属性 鉄 | ||
+ | par1Block.blockMaterial == Material.anvil)) //マテリアル属性 金床 | ||
+ | this.toolMaterial.getHarvestLevel() >= 2) : //マテリアルレベル 2 | ||
+ | this.toolMaterial.getHarvestLevel() >= 1) : //マテリアルレベル 1 | ||
+ | this.toolMaterial.getHarvestLevel() >= 1) : //マテリアルレベル 1 | ||
+ | this.toolMaterial.getHarvestLevel() >= 2) : //マテリアルレベル 2 | ||
+ | this.toolMaterial.getHarvestLevel() >= 2) : //マテリアルレベル 2 | ||
+ | this.toolMaterial.getHarvestLevel() >= 2)); //マテリアルレベル 2 | ||
} | } | ||
@Override | @Override | ||
168行目: | 143行目: | ||
super.getStrVsBlock(par1ItemStack, par2Block); | super.getStrVsBlock(par1ItemStack, par2Block); | ||
} | } | ||
− | public Item setData(String domain, String path | + | public Item setData(String domain, String path) |
{ | { | ||
setUnlocalizedName(path); | setUnlocalizedName(path); | ||
iconString = domain + ":" + path; | iconString = domain + ":" + path; | ||
− | |||
− | |||
} | } | ||
} | } | ||
179行目: | 152行目: | ||
</source> | </source> | ||
− | + | 未完成<br> | |
− | + | [[チュートリアル一覧]]に乗せる方がいるのなら、まだ乗せないで下さい | |
− | < | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |