###mcreator中のバグ
mcreatorを使用中に、ブロックを壊した時のイベントを設定したところ、
以下のようなエラーが出ました。
mcreator_cobblestonePickel.javaファイルの62行目が悪いのはわかるのですが、
どのように直せばいいのかわかりません。
また、自動生成されたコードを勝手に書き換えていいのでしょうか?
どなたかご教授お願いします。
###発生している問題・エラーメッセージ
:compileApiJava UP-TO-DATE :processApiResources UP-TO-DATE :apiClasses UP-TO-DATE :sourceMainJava 警告: [options] ブートストラップ・クラスパスが-source 1.6と一緒に設定されていません C:\Pylo\MCreator172\forge\build\sources\java\mod\mcreator\mcreator_cobblestonePickel.java:62: エラー: onBlockDestroyedに適切なメソッドが見つかりません(ItemStack,World,Block,int,int,int,int,EntityLivingBase): エラー: onBlockDestroyedに適切なメソッドが見つかりません(ItemStack,World,Block,int,int,int,int,EntityLivingBase) :compileJava FAILED super.onBlockDestroyed(itemstack, world, block, i ^ ,BUILD FAILED j, k, l, entity); メソッド Item.onBlockDestroyed(ItemStack,World,Block,int,int,int,EntityLivingBase)は使用できません (実引数リストと仮引数リストの長さが異なります) メソッド ItemCobblestonePickel.onBlockDestroyed(ItemStack,World,Block,int,int,int,EntityLivingB (実引数リストと仮引数リストの長さが異なります) ase)は使用できません
###該当のソースコード
package mod.mcreator; import net.minecraftforge.common.util.EnumHelper; import net.minecraft.world.World; import net.minecraft.item.ItemStack; import net.minecraft.item.Item; import net.minecraft.init.Blocks; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLiving; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.block.Block; import java.util.Random; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.event.FMLServerStartingEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class mcreator_cobblestonePickel { public mcreator_cobblestonePickel() { } public static Item block; public static Object instance; public void load() { ItemStack stack = new ItemStack(block, 1); GameRegistry.addRecipe( stack, new Object[]{"012", "X4X", "X7X", Character.valueOf('0'), new ItemStack(mcreator_tier2.block, 1), Character.valueOf('1'), new ItemStack(mcreator_tier2.block, 1), Character.valueOf('2'), new ItemStack(mcreator_tier2.block, 1), Character.valueOf('4'), new ItemStack(mcreator_stonestick.block, 1), Character.valueOf('7'), new ItemStack(mcreator_stonestick.block, 1),}); } public void generateNether(World world, Random random, int chunkX, int chunkZ) { } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { } public int addFuel(ItemStack fuel) { return 0; } public void serverLoad(FMLServerStartingEvent event) { } public void preInit(FMLPreInitializationEvent event) { } public void registerRenderers() { } static { Item.ToolMaterial enumt = EnumHelper.addToolMaterial("COBBLESTONEPICKEL", 1, 512, 12F, 5, 1); block = (new ItemCobblestonePickel() { public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int i, int j, int k, int l, EntityLivingBase entity) { super.onBlockDestroyed(itemstack, world, block, i, j, k, l, entity); if (true) { world.getBlock(i, j, k).dropBlockAsItem(world, i, j, k, 1, 1); world.setBlockToAir(i, j, k); } return true; } }).setUnlocalizedName("CobblestonePickel").setTextureName("cobblestone pickele"); Item.itemRegistry.addObject(425, "CobblestonePickel", block); } static class ItemCobblestonePickel extends Item { private Block[] blocksEffectiveAgainst = new Block[]{Blocks.stone,}; // harvest level int harvest = 1; protected float efficiencyOnProperMaterial; protected ItemCobblestonePickel() { efficiencyOnProperMaterial = 12; setMaxDamage(512); setMaxStackSize(1); this.setCreativeTab(CreativeTabs.tabTools); } /** * Returns the strength of the stack against a given block. 1.0F base, * (Quality+1)*2 if correct blocktype, 1.5F if sword */ public float func_150893_a(ItemStack par1ItemStack, Block par2Block) { for (int i = 0; i < blocksEffectiveAgainst.length; i++) { if (blocksEffectiveAgainst[i] == par2Block) { return efficiencyOnProperMaterial; } } return 0.0F; } /** * Current implementations of this method in child classes do not use * the entry argument beside ev. They just raise the damage on the * stack. */ public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLiving, EntityLivingBase par3EntityLiving) { par1ItemStack.damageItem(2, par3EntityLiving); return true; } public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLiving) { par1ItemStack.damageItem(1, par7EntityLiving); return true; } /** * Returns True is the item is renderer in full 3D when hold. */ public boolean isFull3D() { return true; } /** * Return the enchantability factor of the item, most of the time is * based on material. */ public int getItemEnchantability() { // kok se lohk cara return 1; } } }
回答1件
あなたの回答
tips
プレビュー