
Glorfindel22
Members-
Content Count
43 -
Joined
-
Last visited
Everything posted by Glorfindel22
-
[Fixed] [1.8] Setting the Item model for an ItemBlock
Glorfindel22 replied to Glorfindel22's topic in Modder Support
Thanks that fixed my issue. I am updating to 1.8.9 by the way, sorry I wasn't more clear about that. -
I am working on updating my mod to 1.8 and I am trying to switch to using ItemBlocks as it looks like it will be required to update to 1.9. I managed to get it mostly working, but I am still confused about a few things and can't find much information online. So here is what I have: The ItemBlock public class ItemBlockMortarAndPestle extends ItemBlock { public ItemBlockMortarAndPestle(Block block) { super(block); this.maxStackSize = 1; this.setUnlocalizedName("mortarAndPestle"); this.setCreativeTab(CoffeeAndTeaMod.teaTab); } } The Block public class BlockMortarAndPestle extends Block { public static final IProperty<EnumFacing> DIRECTION = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public BlockMortarAndPestle() { super(Material.rock); this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.495F, 0.8F); this.setCreativeTab(CoffeeAndTeaMod.teaTab); this.setDefaultState(blockState.getBaseState().withProperty(DIRECTION, EnumFacing.NORTH)); this.setHardness(5.0F); this.setHarvestLevel("pickaxe", 1); } @Override public boolean isOpaqueCube() { return false; } @Override public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } @Override public BlockState createBlockState() { return new BlockState(this, DIRECTION); } @Override public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(DIRECTION)).getIndex(); } @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(DIRECTION, enumfacing); } @Override /** * Called when a player places the block and is what is used to set direction */ public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(DIRECTION, placer.getHorizontalFacing().getOpposite()); } } Then I register it like this: mortarAndPestle = new BlockMortarAndPestle().setUnlocalizedName("mortarAndPestle"); GameRegistry.registerBlock(mortarAndPestle, ItemBlockMortarAndPestle.class, "mortarAndPestle"); So the block itself works perfectly fine and the model shows up when I place it however, there is no item model. It is just a the missing texture image. Which doesn't make sense to me because I have a file named mortarAndPestle.json in assets/teamod/models/item: { "parent": "builtin/generated", "textures": { "layer0": "teamod:items/mortarAndPestle" }, "display": { "thirdperson": { "rotation": [ -90, 0, 0 ], "translation": [ 0, 1, -3 ], "scale": [ 0.55, 0.55, 0.55 ] }, "firstperson": { "rotation": [ 0, -135, 25 ], "translation": [ 0, 4, 2 ], "scale": [ 1.7, 1.7, 1.7 ] } } } So my question is: how do I set an item model for an ItemBlock? Is it any different than normal?
-
[Solved] [1.8.9] Directional Blockstates with models
Glorfindel22 replied to Glorfindel22's topic in Modder Support
Thanks that fixed everything. My code for future reference. package net.richardsprojects.teamod.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.richardsprojects.teamod.CoffeeAndTeaMod; public class BlockEmptyCup extends Block { public static final IProperty<EnumFacing> DIRECTION = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public BlockEmptyCup() { super(Material.wood); this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.495F, 0.8F); this.setCreativeTab(CoffeeAndTeaMod.teaTab); this.setDefaultState(blockState.getBaseState().withProperty(DIRECTION, EnumFacing.NORTH)); } @Override public boolean isOpaqueCube() { return false; } @Override public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } @Override public BlockState createBlockState() { return new BlockState(this, DIRECTION); } @Override public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(DIRECTION)).getIndex(); } @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(DIRECTION, enumfacing); } @Override /** * Called when a player places the block and is what is used to set direction */ public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(DIRECTION, placer.getHorizontalFacing().getOpposite()); } } -
I am working on trying to update my 1.7.10 mod to Minecraft 1.8.9 and I am trying to use the json modelling system to implement the different facing directions in my blocks. My block originally worked fine before I attempted this but now I have messed it up and I can no longer place the block. I tried following the Intro to Blockstates guide on Read The Docs and I looked at the BlockFurnace vanilla code, but there must still be something I am missing. Here is what I have so far. BlockEmptyCup.java package net.richardsprojects.teamod.blocks; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.richardsprojects.teamod.CoffeeAndTeaMod; public class BlockEmptyCup extends Block { public static final IProperty<EnumFacing> DIRECTION = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public BlockEmptyCup() { super(Material.wood); this.setBlockBounds(0.2F, 0.0F, 0.2F, 0.8F, 0.495F, 0.8F); this.setCreativeTab(CoffeeAndTeaMod.teaTab); this.setDefaultState(new BlockState(this, DIRECTION).getBaseState().withProperty(DIRECTION, EnumFacing.NORTH)); } @Override public boolean isOpaqueCube() { return false; } @Override public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } @Override public BlockState createBlockState() { return new BlockState(this, DIRECTION); } @Override public int getMetaFromState(IBlockState state) { return ((EnumFacing)state.getValue(DIRECTION)).getIndex(); } @Override public IBlockState getStateFromMeta(int meta) { EnumFacing enumfacing = EnumFacing.getFront(meta); if (enumfacing.getAxis() == EnumFacing.Axis.Y) { enumfacing = EnumFacing.NORTH; } return this.getDefaultState().withProperty(DIRECTION, enumfacing); } public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { Block block = worldIn.getBlockState(pos.north()).getBlock(); Block block1 = worldIn.getBlockState(pos.south()).getBlock(); Block block2 = worldIn.getBlockState(pos.west()).getBlock(); Block block3 = worldIn.getBlockState(pos.east()).getBlock(); EnumFacing enumfacing = (EnumFacing)state.getValue(DIRECTION); if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock()) { enumfacing = EnumFacing.SOUTH; } else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock()) { enumfacing = EnumFacing.NORTH; } else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock()) { enumfacing = EnumFacing.EAST; } else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock()) { enumfacing = EnumFacing.WEST; } worldIn.setBlockState(pos, state.withProperty(DIRECTION, enumfacing), 2); } } } emptyCup.json { "variants": { "facing=north": { "model": "teamod:emptyCup" }, "facing=south": { "model": "teamod:emptyCup", "y": 180 }, "facing=west": { "model": "teamod:emptyCup", "y": 270 }, "facing=east": { "model": "teamod:emptyCup", "y": 90 } } } Thanks for any help!
-
I am working on an update to my Coffee and Tea Mod and I recently was able to get it so that so that Coffee and Tea Bushes spawn naturally through out the world with terrain generation. However, now I would like to see if it is possible to spawn my custom crops in the villager farms. Any ideas? My code is available on GitHub here: https://github.com/RichardsProjects/Richard-s-Coffee-And-Tea-Mod
-
[Solved] Naturally Spawning Custom Crops
Glorfindel22 replied to Glorfindel22's topic in Modder Support
That worked and with some tweaking I managed to get a result that I was pleased with. If anyone would like to see my code it's available here: https://www.github.com/RichardsProjects/Richard-s-Coffee-And-Tea-Mod -
I released my mod the Coffee and Tea Mod a few months ago. And I am currently working on an update to the mod right now. The Tea Mod adds Coffee and Tea Bushes, but I want to figure out how to have spawn them radomly in specific biomes naturally. However, I have never done any Terrain Generation before so I do not really no where to start. Any advice or help would be greatly appreciated.
-
[Solved] Custom Crop - Farmland turning to dirt
Glorfindel22 replied to Glorfindel22's topic in Modder Support
I figured it out. I needed to set the material to Material.plants. I'll leave this here for future reference. -
I am working on updating my Coffee & Tea Mod and I am trying to fix a bug that has been in it for a while. Basically whenever the farmland underneath my custom crop (technically a coffee bush) has a block update it turns to dirt. I have no idea how to fix this and it is really weird. Here is the code to my Coffee Bush. package net.richardsprojects.teamod.main; //Removed the imports to shorten the code here public class BlockCoffeeBush extends BlockContainer implements IGrowable { protected BlockCoffeeBush(Material mat) { super(mat); this.setTickRandomly(true); float f = 0.5F; this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, 0.25F, 0.5F + f); this.setCreativeTab((CreativeTabs)null); this.setHardness(0.0F); this.setStepSound(soundTypeGrass); this.disableStats(); } public static void mainRegistry() { initializeBlock(); registerBlock(); } //Used to handle crops growing public void updateTick(World world, int x, int y, int z, Random random) { if (world.getBlockLightValue(x, y + 1, z) >= 9) { int metadata = world.getBlockMetadata(x, y, z); if (metadata < 7) { if (random.nextInt(2) == 0) { metadata++; world.setBlockMetadataWithNotify(x, y, z, metadata, 2); } } } } public static Block coffeeBush; public static void initializeBlock() { coffeeBush = new BlockCoffeeBush(Material.grass).setBlockName("coffeeBush").setBlockTextureName("teamod:CoffeeStage1_4"); } public static void registerBlock() { GameRegistry.registerBlock(coffeeBush, coffeeBush.getUnlocalizedName()); } //Set the TileEntity @Override public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { return new CoffeeBushEntity(); } //Can be grown on farmland, dirt, or grass protected boolean canPlaceBlockOn(Block block) { return block == Blocks.farmland; } //Not a normal renderType @Override public int getRenderType() { return -1; } //It's not an opaque cube @Override public boolean isOpaqueCube() { return false; } //It's not a normal block public boolean renderAsNormalBlock() { return false; } //Returns whether its fully grown? @Override public boolean func_149851_a(World world, int x, int y, int z, boolean flag) { return world.getBlockMetadata(x, y, z) != 7; } //I have no idea what this is for. @Override public boolean func_149852_a(World world, Random random, int x, int y, int z) { return true; } //Handles Bonemeal @Override public void func_149853_b(World world, Random random, int x, int y, int z) { int metadata = 0; metadata = world.getBlockMetadata(x, y, z) + MathHelper.getRandomIntegerInRange(world.rand, 2, 5); if (metadata > 7) { metadata = 7; } world.setBlockMetadataWithNotify(x, y, z, metadata, 2); } protected Item func_149865_P() { return null; } /** * Gets an item for the block being called on. Args: world, x, y, z */ @SideOnly(Side.CLIENT) public Item getItem(World p_149694_1_, int p_149694_2_, int p_149694_3_, int p_149694_4_) { return this.func_149866_i(); } /** * Returns the quantity of items to drop on block destruction. */ @Override public int quantityDropped(Random p_149745_1_) { return 0; } /** * Gets an item for the block being called on. Args: world, x, y, z */ //TODO: Don't know if this needs to be only client side or not @SideOnly(Side.CLIENT) public Item getItemDropped(int p_149650_1_, Random rnd, int p_149650_3_) { return null; } protected Item func_149866_i() { return ItemCoffeeBeans.unroastedBean; } }[/Code] It may seem a bit odd because it is also a TileEntity so that it can display different 3d models for each stage. Any help would be greatly appreciated. I am trying to get this update out as quickly as possible (everything else is finished). TIA
-
Actually I just realized the problem. So I figured I would just post this for future reference. The issue is right here: //Code to check stage of Wheat if(par3World.getBlock(par4, par5, par6) == Blocks.wheat && par2EntityPlayer.worldObj.isRemote) { Apparently durability damage must be done client side so it should be this: //Code to check stage of Wheat if(par3World.getBlock(par4, par5, par6) == Blocks.wheat && !par2EntityPlayer.worldObj.isRemote) {
-
I am working on an update to my mod the Recipe Expansion Pack and I am having trouble making the plant book take durability when used (right clicked). I am writing my code inside of the "onItemUse" method. The issue is when I use it on wheat the first time the durability goes from 64/64 to 63/64 but then goes back up to 64/64 again when I use it the second time. This continues in a never ending loop each time I right click it resulting in the durability never going below 63. Here is my code: public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { //Code to check stage of Wheat if(par3World.getBlock(par4, par5, par6) == Blocks.wheat && par2EntityPlayer.worldObj.isRemote) { String text = "Wheat (Stage " + (par3World.getBlockMetadata(par4, par5, par6)); if((par3World.getBlockMetadata(par4, par5, par6) == 7)) { text = text + " - \"Mature\""; } text = text + ")"; if(!text.equals("")) { par2EntityPlayer.addChatComponentMessage(new ChatComponentText(text)); if(!par2EntityPlayer.capabilities.isCreativeMode) { par1ItemStack.damageItem(1, par2EntityPlayer); } } } }[/Code] Any help with this would be greatly appreciated, as it seems very odd and has confused me for quite some time.
-
[1.7.10] [Solved] Setting the "Pick Block" for Creative
Glorfindel22 replied to Glorfindel22's topic in Modder Support
Thanks that worked! -
I recently released a mod called the Coffee & Tea Mod and I am currently doing a few fixes for it. The cups that you place on the ground are Items, but I use an event to detect that when the player right clicks with them on the ground so that they place the block versions. Thus, I need to make it so that when a player uses the "pick block" ability in Creative they receive the item not the block. I assume I add an override method to the block class? Any help? TIA.
-
I need to create a custom tree as I am trying to create a coffee tree. I have no idea where to start because I can't see the code of Minecraft to base it off of in 1.7.10. I already have the seed item for it and made it from the grass by registering it. But I assume I need to at least create the sapling block, the wood block, and the leaf block. Are there any other files I would need to create and how would this all work? Any help would be greatly appreciated.
-
So you aren't running the server to test it in forge? If that's the case I fail to see why you need to get to login through eclipse because you are going to have to wait for the other person to update the forge mod running on that server or it will kick you because they won't match. Aren't you at least running the server in eclipse for testing it? If that's the case you can change the properties and you won't need to do it in the future only on the test server why you aren't logged in with a valid minecraft account.
-
You can set online-mode=false in the server.properties file and then it won't attempt to verify usernames. The "server.properties" file should be located in a folder called eclipse inside of your workspace.
-
You do realize you don't have to be logged in to run the client and test your mod. All you have to do is click the "play" button and run the client. It will then log you in as ForgeDevName. Sorry I can't help with logging in, but it's not required.
-
[Solved] [1.7.10] Making a block drop only an item when broken
Glorfindel22 replied to Glorfindel22's topic in Modder Support
Thanks that worked! -
I am working on a mod and one of the things it adds is cups to Minecraft. I wanted them to be able to be placed on the ground like cakes and drunk from. I have a really good looking model for them and they already render really well. However, I can't figure out how to make drop them drop an item upon being destroyed rather than a block. I am new to developing in 1.7.10. Should I use an event or write code in the block file that would handle it?
-
Thanks that fixed it. I removed the "_OBFID" fields and changed a few "func_***" methods to override and now it runs. I already published the update to the forum thread. You can get to it in my signature.
-
I don't see any errors in Eclipse about missing classes and I am pretty sure a copy of every class is in the exported jar file. Anyway here's the code (including imports): package net.richardsprojects.rep.main; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemSeeds; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.richardsprojects.rep.entity.BlockFlagPoleEntity; import net.richardsprojects.rep.entity.BlockWoodWallEntity; import net.richardsprojects.rep.entity.EntitySpear; import net.richardsprojects.rep.lib.Strings; import net.richardsprojects.rep.main.client.ClientProxy; import net.richardsprojects.rep.model.ModelSpear; import net.richardsprojects.rep.recipes.CompostRecipes; import net.richardsprojects.rep.render.FlagPoleRenderer; import net.richardsprojects.rep.render.RenderBlockWoodWall; import net.richardsprojects.rep.render.RenderSpear; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @Mod(modid=Strings.MODID, name=Strings.MOD_NAME, version=Strings.VERSION) public class RecipeExpansionPack { public static CreativeTabs tabRecipeXPack = new CreativeTabs("tabREP") { @SideOnly(Side.CLIENT) public Item getTabIconItem() { return ItemGrassSeeds.grassSeeds; } }; // The instance of your mod that Forge uses. @Instance("RecipeExpansionPack") public static RecipeExpansionPack instance; // Says where the client and server 'proxy' code is loaded. @SidedProxy(clientSide="net.richardsprojects.rep.main.client.ClientProxy", serverSide="net.rep.recipexpack.main.CommonProxy") public static CommonProxy proxy; public static ClientProxy client; @EventHandler public void preInit(FMLPreInitializationEvent event) { ItemGrassSeeds.mainRegistry(); ItemWoodBucket.mainRegistry(); ItemCompostIron.mainRegistry(); ItemCompostWooden.mainRegistry(); CompostBlock.mainRegistry(); CropCompostedCarrot.mainRegistry(); CropCompostedWheat.mainRegistry(); CropCompostedPotato.mainRegistry(); ItemFlags.mainRegistry(); ItemIceBottle.mainRegistry(); FlagPolePartItems.mainRegistry(); ItemIceCube.mainRegistry(); ItemQuiver.mainRegistry(); BlockWhiteFence.mainRegistry(); BlockClearGlass.mainRegistry(); ItemChisel.mainRegistry(); //TODO: Disabled temporarily as I was unable to get it to work in time //ItemSpear.mainRegistry(); //TODO: Disabled temporarily as I was unable to get it to work in time //BlockWoodWall.mainRegistry(); BlockFlagPole.mainRegistry(); //Register Event Handlers MinecraftForge.EVENT_BUS.register(new MCForgeModEvents()); FMLCommonHandler.instance().bus().register(new FMLModEvents()); //Register Entities //EntityRegistry.registerModEntity(EntitySpear.class, "Spear", 1, this, 64, 10, true); //RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear(new ModelSpear(), 0)); GameRegistry.registerTileEntity(BlockFlagPoleEntity.class, "tileEntityFlagPole"); //Add Recipes //Add Compost Recipe CompostRecipes.addCompostRecipes(new GameRegistry()); //Flint Recipe GameRegistry.addShapelessRecipe(new ItemStack(Items.flint), new ItemStack(Blocks.gravel), new ItemStack(Blocks.gravel)); //Mossy Cobblestone - Cobble & Vines GameRegistry.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone), new ItemStack(Blocks.vine), new ItemStack(Blocks.cobblestone)); //Grass Block - grass seeds GameRegistry.addShapelessRecipe(new ItemStack(Blocks.grass), new ItemStack(ItemGrassSeeds.grassSeeds), new ItemStack(Blocks.dirt)); //Wooden Bucket Recipe GameRegistry.addRecipe(new ItemStack(ItemWoodBucket.bucketWoodEmpty), "x x", "y y", " y ", 'x', new ItemStack(Items.stick), 'y', new ItemStack(Blocks.planks)); //Flag Pole Recipe GameRegistry.addShapelessRecipe(new ItemStack(BlockFlagPole.flagPole), new ItemStack(FlagPolePartItems.flagPartBase), new ItemStack(FlagPolePartItems.flagPartTruk), new ItemStack(FlagPolePartItems.flagPartPole)); //Flag Pole Part Recipe GameRegistry.addRecipe(new ItemStack(FlagPolePartItems.flagPartPole), "x", "x", "x", 'x', new ItemStack(Items.stick)); //Flag Pole Truk GameRegistry.addShapelessRecipe(new ItemStack(FlagPolePartItems.flagPartTruk), new ItemStack(Blocks.planks), new ItemStack(ItemChisel.chisel)); //Flag Pole Base Recipe GameRegistry.addRecipe(new ItemStack(FlagPolePartItems.flagPartBase), "xxx", "xxx", "xxx", 'x', new ItemStack(Blocks.planks)); //Flag Recipes //Yellow Flag GameRegistry.addRecipe(new ItemStack(ItemFlags.yellowFlag), "xxx", "xxx", "xxx", 'x', new ItemStack(Blocks.wool, 1, 4)); //Red Flag GameRegistry.addRecipe(new ItemStack(ItemFlags.redFlag), "xxx", "xxx", "xxx", 'x', new ItemStack(Blocks.wool, 1, 14)); //Green Flag GameRegistry.addRecipe(new ItemStack(ItemFlags.darkGreenFlag), "xxx", "xxx", "xxx", 'x', new ItemStack(Blocks.wool, 1, 13)); //Ice Cube Recipe GameRegistry.addShapelessRecipe(new ItemStack(ItemIceCube.iceCube), new ItemStack(ItemIceBottle.iceBottle)); //Ice Block GameRegistry.addRecipe(new ItemStack(Blocks.ice), "xxx", "xxx", "xxx", 'x', new ItemStack(ItemIceCube.iceCube)); //Quiver - Level 1 - Recipe GameRegistry.addRecipe(new ItemStack(ItemQuiver.quiver1), " xy", "x y", " xy", 'x', new ItemStack(Items.string), 'y', new ItemStack(Items.leather)); //Quiver - Level 2 - Recipe GameRegistry.addRecipe(new ItemStack(ItemQuiver.quiver2), "yyy", "yxy", "yyy", 'x', new ItemStack(ItemQuiver.quiver1), 'y', new ItemStack(Items.leather)); //Quiver - Level 3 - Recipe GameRegistry.addRecipe(new ItemStack(ItemQuiver.quiver3), "yyy", "yxy", "yyy", 'x', new ItemStack(ItemQuiver.quiver2), 'y', new ItemStack(Items.leather)); //White Fence - Recipe GameRegistry.addShapelessRecipe(new ItemStack(BlockWhiteFence.whiteFence), new ItemStack(Blocks.fence), new ItemStack(Items.dye, 1, 15)); //Clear Glass - Recipe GameRegistry.addShapelessRecipe(new ItemStack(BlockClearGlass.clearGlass), new ItemStack(Blocks.glass)); //Add Chisel Recipe GameRegistry.addRecipe(new ItemStack(ItemChisel.chisel), "x", "y", 'x', new ItemStack(Items.iron_ingot), 'y', new ItemStack(Items.stick)); } @EventHandler public void load(FMLInitializationEvent event) { proxy.registerKeyBindings(); //NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); //client.registerRenderThings(); //EntityRegistry.registerModEntity(EntitySpear.class, "recipexpack:flyingSpear", 1, RecipeExpansionPack.instance, 64, 10, true); //RenderingRegistry.registerEntityRenderingHandler(EntitySpear.class, new RenderSpear(new ModelSpear(), 0)); //ClientRegistry.bindTileEntitySpecialRenderer(BlockWoodWallEntity.class, new RenderBlockWoodWall()); ClientRegistry.bindTileEntitySpecialRenderer(BlockFlagPoleEntity.class, new FlagPoleRenderer()); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } [/Code]
-
I hate to bump the thread but I really need some ideas to solve this. Anyone know?
-
Okay so I finished programming my mod and now I am attempting to export it. I have been using the "gradlew build" command in Command Prompt to build the jar file. However, after I place the exported .jar file in my mods folder and launch Minecraft I get the following error: I assume that means the structure of my code and the way I am exporting is not correct because it can't find the file, although I checked in the .jar and everything seems fine. So I'll show my build.gradle file and screenshots of the jar file's structure and a screenshot of my structure in Eclipse. Gradle Build File: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' } } apply plugin: 'forge' version = "1.7.2-0.1.2" group= "net.richardsprojects" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "rep" minecraft { version = "1.7.2-10.12.0.1047" assetDir = "eclipse/assets" } processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } }[/Code] [b]Structure of mod in eclipse:[/b] [b]Structure of Exported jar file:[/b] I'd really like to release this update to my mod soon so any help would be greatly appreciated!
-
[1.7.2] setUnlocalizedName() no such method problem?
Glorfindel22 replied to Glorfindel22's topic in Modder Support
Yeah I followed a tutorial and they told me to modify the version, group, & archivesBaseName fields. Below is what my build.gradle file looks like: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.1-SNAPSHOT' } } apply plugin: 'forge' version = "1.7.2-0.1.2" group= "net.richardsprojects" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "RecipeExpansionPack" minecraft { version = "1.7.2-10.12.0.1024" assetDir = "eclipse/assets" } processResources { // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } }[/Code] -
[1.7.2] setUnlocalizedName() no such method problem?
Glorfindel22 replied to Glorfindel22's topic in Modder Support
I built it by running the "gradlew build" command in command prompt and I got the jar file from the "libs" folder inside of "build".