I opened a new topic because I believe that in the previous people may think that what I am saying is not like making a axe. And I wanted to make clear that it is a bug and if anyone can help me because my mod need if or if a axe. You could help me?
You could make a screenshot to see how it would have to be the integrated code? It would be very important to solve this for me, bearing in mind that can take a long and shows the new version of MCREATOR.
import net.minecraft.client.renderer.block.model.*; public class mcreator_axee{
public mcreator_axee(){}
public static Item block; public static Object instance;public void load(FMLInitializationEvent event){ ItemStack stack = new ItemStack(block, 1);if(event.getSide() == Side.CLIENT) Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(block, 0, new ModelResourceLocation("TestEnvironmentMod:Axee", "inventory")); } 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(){}
:clean :deobfCompileDummyTask :deobfProvidedDummyTask :sourceApiJava :compileApiJava UP-TO-DATE :processApiResources UP-TO-DATE :apiClasses UP-TO-DATE :sourceMainJava C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:122: error: cannot find symbol private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder}); ^ symbol: variable Sets location: class ItemCustomAxe C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:126: error: no suitable constructor found for ItemTool(float,ToolMaterial,Set<Block>) super(3.0F, material, EFFECTIVE_ON); ^ constructor ItemTool.ItemTool(ToolMaterial,Set<Block>) is not applicable (actual and formal argument lists differ in length) constructor ItemTool.ItemTool(float,float,ToolMaterial,Set<Block>) is not applicable (actual and formal argument lists differ in length) C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: method getMaterial in class Block cannot be applied to given types; return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial; ^ required: IBlockState found: no arguments reason: actual and formal argument lists differ in length C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: method getMaterial in class Block cannot be applied to given types; return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial; ^ required: IBlockState found: no arguments reason: actual and formal argument lists differ in length C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: method getMaterial in class Block cannot be applied to given types; return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial; ^ required: IBlockState found: no arguments reason: actual and formal argument lists differ in length C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: no suitable method found for getStrVsBlock(ItemStack,Block) return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial; ^ method ItemTool.getStrVsBlock(ItemStack,IBlockState) is not applicable (actual argument Block cannot be converted to IBlockState by method invocation conversion) method Item.getStrVsBlock(ItemStack,IBlockState) is not applicable (actual argument Block cannot be converted to IBlockState by method invocation conversion) :compileJava FAILED 6 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':compileJava'. > Compilation failed; see the compiler error output for details. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED
public Axe(ToolMaterial material) { super(material, EFFECTIVE_ON); this.damageVsEntity = material.getDamageVsEntity(); this.attackSpeed = -3.0F; // TODO Auto-generated constructor stub }
public float getStrVsBlock(ItemStack stack, IBlockState state) { Material material = state.getMaterial(); return material != Material.wood && material != Material.plants && material != Material.vine ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial; }
I opened a new topic because I believe that in the previous people may think that what I am saying is not like making a axe. And I wanted to make clear that it is a bug and if anyone can help me because my mod need if or if a axe. You could help me?
You could make a screenshot to see how it would have to be the integrated code? It would be very important to solve this for me, bearing in mind that can take a long and shows the new version of MCREATOR.
https://mcreator.pylo.co/forum/20823/90-working-axe
https://mcreator.pylo.co/forum/20823/90-working-axe
@#4 Something like this?
package mod.mcreator;
import net.minecraftforge.fml.client.registry.*;
import net.minecraftforge.fml.common.*;
import net.minecraftforge.fml.common.asm.*;
import net.minecraftforge.fml.common.asm.transformers.*;
import net.minecraftforge.fml.common.discovery.*;
import net.minecraftforge.fml.common.discovery.asm.*;
import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.common.functions.*;
import net.minecraftforge.fml.common.network.*;
import net.minecraftforge.fml.common.registry.*;
import net.minecraftforge.fml.common.toposort.*;
import net.minecraftforge.fml.common.versioning.*;
import net.minecraftforge.fml.relauncher.*;
import net.minecraftforge.fml.server.*;
import net.minecraft.block.*;
import net.minecraft.block.material.*;
import net.minecraft.client.*;
import net.minecraft.client.audio.*;
import net.minecraft.client.entity.*;
import net.minecraft.client.gui.*;
import net.minecraft.client.gui.achievement.*;
import net.minecraft.client.gui.inventory.*;
import net.minecraft.client.model.*;
import net.minecraft.client.multiplayer.*;
import net.minecraft.client.particle.*;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.culling.*;
import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.tileentity.*;
import net.minecraft.client.settings.*;
import net.minecraft.command.*;
import net.minecraft.crash.*;
import net.minecraft.creativetab.*;
import net.minecraft.dispenser.*;
import net.minecraft.enchantment.*;
import net.minecraft.entity.*;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.boss.*;
import net.minecraft.entity.effect.*;
import net.minecraft.entity.item.*;
import net.minecraft.entity.monster.*;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.*;
import net.minecraft.entity.projectile.*;
import net.minecraft.inventory.*;
import net.minecraft.item.*;
import net.minecraft.item.crafting.*;
import net.minecraft.nbt.*;
import net.minecraft.network.*;
import net.minecraft.network.rcon.*;
import net.minecraft.pathfinding.*;
import net.minecraft.potion.*;
import net.minecraft.profiler.*;
import net.minecraft.server.*;
import net.minecraft.server.dedicated.*;
import net.minecraft.server.gui.*;
import net.minecraft.server.integrated.*;
import net.minecraft.server.management.*;
import net.minecraft.stats.*;
import net.minecraft.tileentity.*;
import net.minecraft.util.*;
import net.minecraft.village.*;
import net.minecraft.world.*;
import net.minecraft.world.biome.*;
import net.minecraft.world.chunk.*;
import net.minecraft.world.chunk.storage.*;
import net.minecraft.world.demo.*;
import net.minecraft.world.gen.*;
import net.minecraft.world.gen.feature.*;
import net.minecraft.world.gen.layer.*;
import net.minecraft.world.gen.structure.*;
import net.minecraft.world.storage.*;
import net.minecraftforge.classloading.*;
import net.minecraftforge.client.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.event.sound.*;
import net.minecraftforge.common.*;
import net.minecraftforge.event.*;
import net.minecraftforge.event.entity.*;
import net.minecraftforge.event.entity.item.*;
import net.minecraftforge.event.entity.living.*;
import net.minecraftforge.event.entity.minecart.*;
import net.minecraftforge.event.entity.player.*;
import net.minecraftforge.event.terraingen.*;
import net.minecraftforge.event.world.*;
import net.minecraftforge.oredict.*;
import net.minecraft.init.*;
import java.util.*;
import net.minecraftforge.common.util.*;import net.minecraft.block.state.*;
import net.minecraft.util.math.*;
import net.minecraft.client.renderer.block.model.*;
public class mcreator_axee{
public mcreator_axee(){}
public static Item block;
public static Object instance;public void load(FMLInitializationEvent event){
ItemStack stack = new ItemStack(block, 1);if(event.getSide() == Side.CLIENT)
Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(block, 0, new ModelResourceLocation("TestEnvironmentMod:Axee", "inventory"));
}
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("AXEE", 1, 100, 4F, 5, 2);block = (Item)(new ItemCustomAxe(enumt)).setUnlocalizedName("Axee");
GameRegistry.registerItem(block, "Axee");
block.setCreativeTab(CreativeTabs.tabTools);
}
public static class ItemCustomAxe extends ItemTool
{
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder});
protected ItemCustomAxe(Item.ToolMaterial material)
{
super(3.0F, material, EFFECTIVE_ON);
}
public float getStrVsBlock(ItemStack stack, Block block)
{
return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial;
}
@Override
public Set<String> getToolClasses(ItemStack stack){
HashMap<String, Integer> ret = new HashMap<String, Integer>();
ret.put("axe", 1);
return ret.keySet();
}
}
}
:clean
:deobfCompileDummyTask
:deobfProvidedDummyTask
:sourceApiJava
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava
C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:122: error: cannot find symbol
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder});
^
symbol: variable Sets
location: class ItemCustomAxe
C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:126: error: no suitable constructor found for ItemTool(float,ToolMaterial,Set<Block>)
super(3.0F, material, EFFECTIVE_ON);
^
constructor ItemTool.ItemTool(ToolMaterial,Set<Block>) is not applicable
(actual and formal argument lists differ in length)
constructor ItemTool.ItemTool(float,float,ToolMaterial,Set<Block>) is not applicable
(actual and formal argument lists differ in length)
C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: method getMaterial in class Block cannot be applied to given types;
return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial;
^
required: IBlockState
found: no arguments
reason: actual and formal argument lists differ in length
C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: method getMaterial in class Block cannot be applied to given types;
return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial;
^
required: IBlockState
found: no arguments
reason: actual and formal argument lists differ in length
C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: method getMaterial in class Block cannot be applied to given types;
return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial;
^
required: IBlockState
found: no arguments
reason: actual and formal argument lists differ in length
C:\Users\Morelplay\Desktop\MODPRUEBAS\forge\build\sources\main\java\mod\mcreator\mcreator_axee.java:131: error: no suitable method found for getStrVsBlock(ItemStack,Block)
return block.getMaterial() != Material.wood && block.getMaterial() != Material.plants && block.getMaterial() != Material.vine ? super.getStrVsBlock(stack, block) : this.efficiencyOnProperMaterial;
^
method ItemTool.getStrVsBlock(ItemStack,IBlockState) is not applicable
(actual argument Block cannot be converted to IBlockState by method invocation conversion)
method Item.getStrVsBlock(ItemStack,IBlockState) is not applicable
(actual argument Block cannot be converted to IBlockState by method invocation conversion)
:compileJava FAILED
6 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
@#4.1
How could implement this in my tool Axe? I think this would work
import java.util.Set;
import com.google.common.collect.Sets;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
public class Axe extends ItemTool {
private static final Set<Block> EFFECTIVE_ON = Sets.newHashSet(new Block[] {Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder, Blocks.wooden_button, Blocks.wooden_pressure_plate});
public Axe(ToolMaterial material) {
super(material, EFFECTIVE_ON);
this.damageVsEntity = material.getDamageVsEntity();
this.attackSpeed = -3.0F;
// TODO Auto-generated constructor stub
}
public float getStrVsBlock(ItemStack stack, IBlockState state)
{
Material material = state.getMaterial();
return material != Material.wood && material != Material.plants && material != Material.vine ? super.getStrVsBlock(stack, state) : this.efficiencyOnProperMaterial;
}
}