Everything posted by Fergoman007
-
key bind to open config gui
i was wondering how you would open the new config gui in world and by using keybind. Note that i have already got the framework for the keybind in place and was a bit stuck on how to open the gui
-
build script that increments the build number after being built
i am having trouble try to get my mod to export mod files with different build number This is my current build script 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.2-SNAPSHOT' } } apply plugin: 'forge' ext.configFile = file "build.properties" configFile.withReader{ def prop = new Properties() prop.load(it) ext.config = new ConfigSlurper().parse prop } ext.buildnumber = 0 if (System.getenv().BUILD_NUMBER) project.buildnumber = System.getenv().BUILD_NUMBER logger.lifecycle "Building Version: " + project.config.buildnumber project.buildnumber += 1 version = config.mod_version group= "fergoman123.mods.fergoutil" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "FergoUtil" minecraft { version = config.minecraft_version + "-" + config.forge_version assetDir = "eclipse/assets" replaceIn "fergoman123/mods/fergoutil/lib/ModInfo.java" replace "@mod_version@", project.version replace "@mcVersion@", project.config.minecraft_version replace "@forge_version@", project.config.forge_version replace "@buildNum@", project.buildnumber } version = "${config.minecraft_version}-${config.mod_version}-${buildnumber}" dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.config.mod_version, 'mcversion':project.config.mcVersion } // copy everything else, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Any Help is appreciated
-
[SOLVED] [1.7.2] Enchantment effect onto armor
with the haseffect method use this because that version of hasEffect is depreciated @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack par1ItemStack, int pass) { return true; }
-
Hammer for my mod
it played around with it a bit and still getting the the extra set of 3x3 Edit corrected spelling
-
Hammer for my mod
what i meant was that it is breaking two sets of 3x3 on the x/z public boolean onBlockDestroyed(ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase elb) { // Vanilla Blocks boolean isCobble = world.getBlock(x, y, z) == Blocks.cobblestone; boolean isStone = world.getBlock(x, y, z) == Blocks.stone; boolean isStoneBrick = world.getBlock(x, y, z) == Blocks.stonebrick; boolean isSandtone = world.getBlock(x, y, z) == Blocks.sandstone; boolean isOreExperience = world.getBlock(x, y, z) == ModBlocks.oreExperience; boolean isOreObsidian = world.getBlock(x, y, z) == ModBlocks.oreObsidian; boolean isOreEmeraldCrystal = world.getBlock(x, y, z) == ModBlocks.oreEmeraldCrystal; boolean isOreLapisCrystal = world.getBlock(x, y, z) == ModBlocks.oreLapisCrystal; boolean isOreBronze = world.getBlock(x, y, z) == ModBlocks.oreBronze; boolean isOreAdamantium = world.getBlock(x, y, z) == ModBlocks.oreAdamantium; boolean[] vanillaBlocks = new boolean[]{isCobble, isStone, isStoneBrick, isSandtone}; boolean[] fergoToolsOres = new boolean[]{isOreExperience, isOreObsidian, isOreEmeraldCrystal, isOreLapisCrystal, isOreBronze, isOreAdamantium}; if(vanillaBlocks[0] || vanillaBlocks[1] || vanillaBlocks[2] || fergoToolsOres[0] || fergoToolsOres[1] || fergoToolsOres[2] || fergoToolsOres[3] || fergoToolsOres[4] || fergoToolsOres[5] || world.getBlock(x, y, z) != Blocks.bedrock) { for(int ix = -1; ix < 2; ++ix) { for (int iy = -1; iy < 2; ++iy) { for (int iz = -1; iz < 2; ++iz) { world.func_147480_a(x + ix, y + iy, z + iz, true); stack.setItemDamage(stack.getItemDamage() - 9); } } } return true; } else { return false; } } Edit: added Code to Reply
-
Hammer for my mod
it works now but now the problem is that it is breaking two sets of of 3x3 Edit: corrected spelling
-
Hammer for my mod
ok this is what i have tried this has not worked public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { boolean isCobble = world.getBlock(x, y, z) == Blocks.cobblestone; boolean isStone = world.getBlock(x, y, z) == Blocks.stone; boolean isStoneBrick = world.getBlock(x, y, z) == Blocks.stonebrick; if(isCobble || isStone || isStoneBrick){ for (int ix = -1; x < 2; x++) { for (int iy = -1; x < 2; x++) { for (int iz = -1; x < 2; x++) { world.func_147480_a(x + ix, y + iy, z + iz, true); } } } return true; } else { System.out.println("[FergoTools] False"); return false; } }
-
Hammer for my mod
Where exactly would I put the onBlockDestroyedByPlayer method
-
Hammer for my mod
how exactly do i do that
-
Hammer for my mod
nothing yet i am trying to figure how it can be done
-
Hammer for my mod
i would like to know how to make a hammer for my mod that would break blocks in a 3x3 area any help would be appreciated Thanks Fergoman007
-
[1.7.2] Custom Tools Causing Crash on Use
it's not just one tool it all of the all of the and something to note it that the textures for the tools aren't displaying either
-
[1.7.2] Custom Tools Causing Crash on Use
This is my ModItems class
-
[1.7.2] Custom Tools Causing Crash on Use
This is my main class
-
[1.7.2] Custom Tools Causing Crash on Use
Hi what did you mean by registering it properly ?
-
[1.7.2] Custom Tools Causing Crash on Use
Hi Every one i keep getting the crash when i go to use my custom tools can any one help me Thanks hope someone can help
-
Iw ould like to make a mod but i cannot download source for forge?
hi try click the star on the right of the src button thats is a direct link see how you go
-
Item overlay rendering
what i am trying to do is to render the amount of uses that an item has left and for some reason it does not render over the item
-
Item overlay rendering
hi need some help im try to get the damage value of the an item onto the item in the inventory but it unfortunately is rendering UseCount 3 Class package fergoman007.mods.usecount; import org.lwjgl.opengl.GL11; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.item.ItemStack; 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.Mod.InstanceFactory; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import fergoman007.mods.usecount.handlers.PacketHandler; import fergoman007.mods.usecount.lib.Reference; import fergoman007.mods.usecount.renderer.ItemRender; @Mod(modid = Reference.modid, name = Reference.name, version = Reference.version) @NetworkMod(clientSideRequired = true, serverSideRequired = false, channels = {Reference.channel}, packetHandler = PacketHandler.class) public class UseCount3 { @Instance(Reference.modid) public static UseCount3 instance; public static ItemRender renderer; public void renderUseCountOverLay(FontRenderer fontRenderer, TextureManager manager, ItemStack itemstack, int par1, int par2) { int uses = itemstack.getMaxDamage() - itemstack.getItemDamageForDisplay() +1; int dmg = itemstack.getItemDamageForDisplay(); int initialColour = (int) Math.round(255.0D - dmg * 255.0D / itemstack.getMaxDamage()); int colour = 0xFFFFFF; if(itemstack.getItemDamageForDisplay() != 0); { colour = 255 - initialColour << 16 | initialColour << 8; } if(itemstack.getMaxDamage() > 0) { String s = String.valueOf(uses); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glScaled(0.5f, 0.5f, 0.5f); int width = fontRenderer.getStringWidth(s); fontRenderer.drawStringWithShadow(s, (par1 + * 2 + 1 + (width / 2) - (width), (par2 + 9) * 2, colour); GL11.glScalef(2f, 2f, 2f); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_DEPTH_TEST); } } @EventHandler public void load(FMLInitializationEvent evt) { renderer = new ItemRender(); } } ItemRender Class package fergoman007.mods.usecount.renderer; import fergoman007.mods.usecount.UseCount3; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.item.ItemStack; public class ItemRender extends RenderItem { @Override public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, TextureManager par2TextureManager, ItemStack par3ItemStack, int par4, int par5) { UseCount3 uc = new UseCount3(); uc.renderUseCountOverLay(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5); } } if anyone can help i thank you in advance
-
Dropping meta data items
when i had it like that the metadata item did not drop
-
Dropping meta data items
hi im having trouble getting my ore to drop my items using meta data BlockOreEmeraldCrystal class: package fergoman007.mods.fergotools.block; import java.util.Random; import fergoman007.mods.fergotools.FergoTools; import fergoman007.mods.fergotools.lib.Reference; import fergoman007.mods.fergotools.lib.Strings; import fergoman007.mods.fergotools.lib.Textures; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.world.World; public class BlockOreEmeraldCrystal extends Block { public BlockOreEmeraldCrystal(int par1, Material par2Material) { super(par1, par2Material); this.setUnlocalizedName(Strings.oreEmeraldCrystal); this.setHardness(2.5f); this.setStepSound(soundStoneFootstep); this.setResistance(50f); this.setCreativeTab(FergoTools.tabFergoBlocks); } public void registerIcons(IconRegister register) { blockIcon = register.registerIcon(Reference.TEXTURE_LOC + Textures.oreEmeraldCrystalTexture); } public int damageDropped(int metadata) { switch(metadata) { case 1: return FergoTools.fergoMaterials.itemID; } return metadata; } @Override public int idDropped(int metadata, Random random, int par2) { switch(metadata) { case 1 : return FergoTools.fergoMaterials.itemID; // Error Case default: return -1; // air } } public int quantityDropped(int par1, Random rand, int par2) { return 3 + rand.nextInt(4) + 1; } public void onBlockDestroyedByPlayer(World world, int x, int y, int z, int meta) { this.dropXpOnBlockBreak(world, x, y, z, 4); } } i would appreciate the help
IPS spam blocked by CleanTalk.