All users will need to merge their Minecraft Forum account with a new or existing Twitch account starting October 23rd. You can merge your accounts by clicking here. Have questions? Learn more here.
Dismiss
  • 0

    posted a message on [1.6.2][Launcher][Multi-platform] ServerRunner Revamped!
    Quote from Kovu

    Nice job! Glad to see it's clean from viruses as well.


    Thanks!
    Posted in: Minecraft Tools
  • 0

    posted a message on [1.6.2][Launcher][Multi-platform] ServerRunner Revamped!
    ServerRunner is back!
    Even though you probably have no idea what it is.

    I released ServerRunner v1.0 close to a year ago, but it was written in Applescript and was pretty much useless. Since then, I have spent a lot of time expanding my programming horizons, and have created an easy-to-use, functional, and fast Minecraft server launcher written in Java.

    What does it do?
    ServerRunner allows the average Minecraft player to host his or her very own Minecraft server with little prior knowledge.
    It includes:
    • Easy download of server software from official Mojang website
    • Options to choose how much memory should be allocated to the server
    • A simple built-in text editor that allows you to edit the server.properties file
    • The ability to have multiple servers saved and run each of them from a convenient menu
    • A built-in backup tool (in progress)
    • A button that allows you to delete any of your stored servers
    • and more!
    The downloads start at version 2.3 because I never got around to uploading the earlier versions.

    Downloads
    Main download for ServerRunner v2.3: here
    All other versions: here
    I plan on releasing source code if there is any demand


    PLEASE NOTE: You will still need to port forward or install and setup LogMeIn Hamachi for the server to be played anywhere but locally. Unfortunately, I can't do this from ServerRunner, but Hamachi is very easy to setup!
    Posted in: Minecraft Tools
  • 1

    posted a message on Eclipse error
    Change it to look like this:

    public static final Block AxisDirt = new Axisdirt(200).setCreativeTab(CreativeTabs.tabBlock).ModLoader.addOverride ("/terrain.png", "/Axis/Axisdirt.png");

    You had an unneeded parenthesis before "new" that you didn't close off at the end.
    You need to fix this for each block declaration (The "public static final Block" things).
    Posted in: Modification Development
  • 0

    posted a message on [Universal] Subarakis One Stop Custom Block Tutorial ! make it with techne !
    Quote from senpaisubaraki

    in your mod file
    in stead of
    ModLoader.addName(new ItemStack(blockPillar, 1, 1), "Brick Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 2), "Stone Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 0), "Oak Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 3), "Obsdian Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 4), "Lapis Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 5), "Jungle Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 6), "Pine Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 7), "Birch Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 8), "Nether Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 9), "Marble Pillar");
    ModLoader.addName(new ItemStack(blockPillar, 1, 10), "Diamond Pillar");
    // as you can see, i made 11 different blocks. 0 included to 10. each with a different name.

    add a name to the block as usual > modloader.addname(yourblock, "ingame name");
    add a normal block (i hope you know how to do that)
    delete ItemPillar
    be shure to add a texture to your block.

    in block***
    delete this

    public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
    {
    par3List.add(new ItemStack(par1, 1, 0));
    par3List.add(new ItemStack(par1, 1, 1));
    par3List.add(new ItemStack(par1, 1, 2));
    par3List.add(new ItemStack(par1, 1, 3));
    par3List.add(new ItemStack(par1, 1, 4));
    par3List.add(new ItemStack(par1, 1, 5));
    par3List.add(new ItemStack(par1, 1, 6));
    par3List.add(new ItemStack(par1, 1, 7));
    par3List.add(new ItemStack(par1, 1, 8));
    par3List.add(new ItemStack(par1, 1, 9));
    par3List.add(new ItemStack(par1, 1, 10));

    } // to get all sub blocks. make it more or less ass you please.




    in tile entity pillar renderer
    delethe the whole swith, be shure to keep 1 of this >
    bindTextureByName("/subaraki/pillar3.png");

    thats all i can really tell you. I already told in the first post that experience is required. if you look a few comments up, you can see that EzioJBing did very well without my help.



    Thank you! That is exactly what I needed! Sorry I asked for this but I really wanted to make sure that I had it right. I do have experience, just not in custom block models, which is why I came here.
    Posted in: Tutorials
  • 0

    posted a message on [Universal] Subarakis One Stop Custom Block Tutorial ! make it with techne !
    Quote from senpaisubaraki

    delete

    in Block, hasSubtypes

    in Render, switch(i) and all other textures bellow


    I'm sorry but this really doesn't help me at all.
    Posted in: Tutorials
  • 0

    posted a message on [Universal] Subarakis One Stop Custom Block Tutorial ! make it with techne !
    Would you mind posting the code for making a block with a custom model but for only one block instead of several variations of one block? It gets kinda confusing trying to modify the code to make it work for only one block.

    Thanks!
    Posted in: Tutorials
  • 0

    posted a message on Request: The Diver mod
    I have a solution to the underwater-torch-taking-up-a-whole-block-and-minecraft-doesn't-have-a-dynamic-lighting-system problem!

    Someone (maybe me) could create a custom block model that looks like a glass block with a torch inside. This way, it would look more like the crafting recipe and it wouldn't look totally stupid in the game!

    I have no idea if this is actually a good idea, as I just came up with it on the spot, so it might be total crap.

    Let me know if this is a good idea, and if I could help with the mod!
    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on [Universal] Subarakis One Stop Custom Block Tutorial ! make it with techne !
    Quote from senpaisubaraki

    I guess you used paint or something else to make your texture and forgot to erase the techne texture map part.
    If you want it to make so you can look trough it, don't use paint ! use gimp or any other image editing software.
    Save your texture file with a .png extention. not Jpeg or something else.
    .png allows ''See-trough'' textures. Meaning, what you don't use won't be rendered in white like any other image extention.


    I hope i helped !

    Edit. I read your post again.
    Your problem is not the one I mentioned above. It's because you have two blocks rendering in one.
    Yours, and a Normal block.
    Check your code again, every single file.
    Be sure to not have mixed up anywehere between Block and BlockMyBlock or something.
    I recomand checking your mod file first and make shure you have your block decleration written right.
    It should look a bit like this :
    public static final Block blockPillar = (new BlockPillar (BrickPillar, 0, TileEntityPillar.class)).setHardness(5F).setResistance(7F).setBlockName("blockApiLLar").setCreativeTab(CreativeTabs.tabBlock);

    (new BlockPillar...) is very important here.
    regarding your texture
    (new BlockPillar(BrickPillar, 0, TileEntityPillar.class)) is even more important. The 0 is the texture you use.

    But I would need to see your code to help more if you can't find the problem yourself.


    I am basically using your a very slightly modified version of your example code just until I can figure out how to do it by myself. (I'm not stealing so don't be mad!)

    mod_Pillars.java

    package net.minecraft.src;
    
    import java.util.Random;
    
    public class mod_Pillars extends BaseMod
    {
    	public static int BrickPillar = 188; // we use this to give the id to the block and item. Do it like this. it's better for the health of you custom block.
    
    
    	public static int modelID; // we use this to define the ID of your model. if you have multiple custom blocks make a second one that would look like this:
    	public static int modelID2;
    
    
    	public static final Block blockPillar = (new BlockPillar (BrickPillar, 0, TileEntityPillar.class)).setHardness(5F).setResistance(7F).setBlockName("blockApiLLar").setCreativeTab(CreativeTabs.tabBlock); // make the new block. you should get error for now on blockPillar and TileEntityPillar. BrickPillar is the ID number, which we defined in the int above.
    
    	public static final Item BrickItem = (new ItemPillar (BrickPillar-256, blockPillar).setItemName("olkirdcvgh")).setTabToDisplayOn(CreativeTabs.tabBlock); // BrickPillar-256 is to associate the BlockID with the Item.
    
    	public mod_Pillars()
    	{
    
    
    		ModLoader.addName(new ItemStack(blockPillar, 1, 1), "Brick Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 2), "Stone Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 0), "Oak Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 3), "Obsdian Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 4), "Lapis Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 5), "Jungle Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 6), "Pine Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 7), "Birch Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 8), "Nether Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 9), "Marble Pillar");
    		ModLoader.addName(new ItemStack(blockPillar, 1, 10), "Diamond Pillar");
    		// as you can see, i made 11 different blocks. 0 included to 10. each with a different name.
    		
    		ModLoader.registerTileEntity(TileEntityPillar.class, "Pillar", new TileEntityPillarRenderer() );
    		// obvious. registers the tile entity from tile entity pillar renderer to tile entity pillar
    
    	}
    
    	public void load()
    	{
    
    
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 0), new Object[] {"F","G","F", 'F', new ItemStack (Block.planks, 1, 0), 'G', new ItemStack (Block.wood, 1, 0) });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 1), new Object[] {"F","G","F", 'F', Item.brick, 'G', Block.brick });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 2), new Object[] {"F","G","F", 'F', Block.cobblestone, 'G', Block.stone });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 3), new Object[] {"F","F","F", 'F', Block.obsidian });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 4), new Object[] {"F","G","F", 'F', new ItemStack (Item.dyePowder, 1, 4), 'G', Block.blockLapis });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 5), new Object[] {"F","G","F", 'F', new ItemStack (Block.planks, 1, 3), 'G', new ItemStack (Block.wood, 1, 3) });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 6), new Object[] {"F","G","F", 'F', new ItemStack (Block.planks, 1, 1), 'G', new ItemStack (Block.wood, 1, 1) });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 7), new Object[] {"F","G","F", 'F', new ItemStack (Block.planks, 1, 2), 'G', new ItemStack (Block.wood, 1, 2) });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 8), new Object[] {"F","G","F", 'F', Block.netherBrick, 'G', Block.netherrack });
    		ModLoader.addRecipe(new ItemStack(blockPillar, 2, 10),new Object[] {"F","G","F", 'F', Item.diamond, 'G', Item.diamond });
    
    		// add the different recipes.if you want to add your own custom block to a recipe, instead of 'F', Block.blockname you do 'F' new ItemStack(blockPillar, 1, 5) 5 can be changed to any number you used.
    
    
    
    
    
    		modelID = ModLoader.getUniqueBlockModelID(this, true);
    		// this is to get a unique blockmodel ID if you have two different custom blocks, add modelID2 to it etc.
    
    	}
    
    
    	public void renderInvBlock(RenderBlocks var1, Block var2, int var3, int var4)
    	{
    		super.renderInvBlock(var1, var2, var3, var4);
    
    		if (var2 == blockPillar)
    		{
    			TileEntityRenderer.instance.renderTileEntityAt(new TileEntityPillar(), 0.0D, 0.0D, 0.0D, 0.0F);
    		}
    	}
    
    	// this allows the block to render in you inventory
    	// all those zero's at the end are used for rendering in the players hand. leave it that way.
    
    	public String getVersion()
    	{
    		return "1.3.2";
    	}
    
    
    }


    BlockPillar.java

    package net.minecraft.src;
    import java.util.List;
    import java.util.Random;
    public class BlockPillar extends BlockContainer // it has to extend BlockContainer or it wont read the tileentity file.
    {
    
    
    	public BlockPillar(int par1, int par2, Class class1)
    	{
    
    		super(par1, par2, Material.rock);
    		this.setCreativeTab(CreativeTabs.tabBlock);
    		this.setRequiresSelfNotify(); // absolutely needed
    
    	}
    
    
    	// to make it drop an item, uncomment the lines below
    	/* public int idDropped()
    	{
    	return Item.ingotIron; // you might need .shiftedIndex, i just wrote it here without eclipse
    	}
    	*/
    
    
    	public int quantityDropped(Random par1Random)
    	{
    		return 1;
    	}
    	// if you want your block to drop itself more then once, change it to an higher number.
    
    
    
    
    	public int getRenderType()
    	{
    		return mod_Pillars.modelID2;
    	} // where and what to render
    
    
    	public boolean isOpaqueCube()
    	{
    		return false;
    	} // make it opaque cube, or else you will be able to see trough the world !
    
    	public boolean renderAsNormalBlock()
    	{
    		return false;
    	} // offcourse, because it's not a 1x1x1 block
    
    
    	/**
    	* Determines the damage on the item the block drops. Used in cloth and wood.
    	*/
    	protected int damageDropped(int par1)
    	{
    		return par1;
    	}
    
    
    	public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
    	{
    
    		int p = MathHelper.floor_double((double)((par5EntityPlayer.rotationYaw * 4F) / 360F) + 0.5D) & 3; //i don't know what this is for, so we better keep that there
    
    		byte byte0 = 3;
    
    
    		if (p == 0)
    		{
    			byte0 = 4;
    		}
    
    		if (p == 1)
    		{
    			byte0 = 3;
    		}
    
    		if (p == 2)
    		{
    			byte0 = 2;
    		}
    
    		if (p == 3)
    		{
    			byte0 = 1;
    		}
    
    		par1World.setBlockMetadataWithNotify(par2, par3, par4, byte0);
    
    		return true;
    	}
    
    	public TileEntity getBlockEntity()
    	{
    		return new TileEntityPillar();
    	}
    
    
    	public TileEntity createNewTileEntity(World var1)
    	{
    		return new TileEntityPillar();
    	}
    
    	public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
    	{
    		par3List.add(new ItemStack(par1, 1, 0));
    		par3List.add(new ItemStack(par1, 1, 1));
    		par3List.add(new ItemStack(par1, 1, 2));
    		par3List.add(new ItemStack(par1, 1, 3));
    		par3List.add(new ItemStack(par1, 1, 4));
    		par3List.add(new ItemStack(par1, 1, 5));
    		par3List.add(new ItemStack(par1, 1, 6));
    		par3List.add(new ItemStack(par1, 1, 7));
    		par3List.add(new ItemStack(par1, 1, 8));
    		par3List.add(new ItemStack(par1, 1, 9));
    		par3List.add(new ItemStack(par1, 1, 10));
    
    	} // to get all sub blocks. make it more or less ass you please.
    
    
    }


    ItemPillar.java

    package net.minecraft.src;
    
    public class ItemPillar extends ItemBlock
    {
    	public ItemPillar(int par1, Block block)
    	{
    		super(par1);
    		setHasSubtypes(true);
    	}
    
    	public String getItemNameIS(ItemStack itemstack)
    	{
    		String name = "";
    		switch(itemstack.getItemDamage())
    		{
    			case 0:
    			{
    				name = "WoodPillar";
    				break;
    			}
    			case 1:
    			{
    				name = "BrickPillar";
    				break;
    			}
    			case 2:
    			{
    				name = "StonePillar";
    				break;
    			}
    			case 3:
    			{
    				name = "ObsidianPillar";
    				break;
    			}
    			case 4:
    			{
    				name = "LapisPillar";
    				break;
    			}
    			case 5:
    			{
    				name = "JunglePillar";
    				break;
    			}
    			case 6:
    			{
    				name = "PinePillar";
    				break;
    			}
    			case 7:
    			{
    				name = "BirchPillar";
    				break;
    			}
    			case 8:
    			{
    				name = "NetherPillar";
    				break;
    			}
    			case 9:
    			{
    				name = "MarblePillar";
    				break;
    			}
    			case 10:
    			{
    				name = "DiamondPillar";
    				break;
    			}
    			default: name = "WoodPillar";
    		}
    		return itemstack.getItem().getItemName() + "." + name;
    	}
    	// for every block, you need a name. it doesn't matter, really. its just so all your blocks wont have the same name. delete this part and all your blocks have the same name.
    
    	public int getMetadata(int par1)
    	{
    		return par1;
    	}
    }


    ModelPillar.java

    package net.minecraft.src;
    
    public class ModelPillar extends ModelBase
    {
      //fields
    	ModelRenderer Shape1;
    
      public ModelPillar()
      {
    	textureWidth = 64;
    	textureHeight = 31;
    	
    	  Shape1 = new ModelRenderer(this, 0, 0);
    	  Shape1.addBox(0F, 0F, 0F, 16, 15, 16);
    	  Shape1.setRotationPoint(-8F, 9F, -8F);
    	  Shape1.setTextureSize(64, 31);
    	  Shape1.mirror = true;
    	  setRotation(Shape1, 0F, 0F, 0F);
      }
    
      public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
      {
    	super.render(entity, f, f1, f2, f3, f4, f5);
    	setRotationAngles(f, f1, f2, f3, f4, f5);
    	Shape1.render(f5);
      }
    
      public void renderModel(float f5)
      {
    	Shape1.render(f5);
      }
    
      private void setRotation(ModelRenderer model, float x, float y, float z)
      {
    	model.rotateAngleX = x;
    	model.rotateAngleY = y;
    	model.rotateAngleZ = z;
      }
    
      public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
      {
    	super.setRotationAngles(f, f1, f2, f3, f4, f5);
      }
    
    }


    TileEntityPillarRenderer.java

    package net.minecraft.src;
    import org.lwjgl.opengl.GL11;
    import org.lwjgl.opengl.GL12;
    import java.util.Random;
    
    public class TileEntityPillarRenderer extends TileEntitySpecialRenderer // because your block is, and you are too.
    {
    	private ModelPillar model; // yup, this refers to the last file. so you'll get an error for now. it says what model it has to take. you could also make it a boat, or a cow. nice for statues or something. have it render the model of a cow.
    	
    	public TileEntityPillarRenderer()
    	{
    		model = new ModelPillar();
    	} // where and what to render
    
    	public void renderAModelAt(TileEntityPillar tile, double d, double d1, double d2, float f)
    	{
    		// here comes the hard part
    
    		int i =0; // a regular int, with a zero. more on this below
    
    		if(tile.worldObj != null) // to tell the world that your object is placed.
    		{
    			i =(tile.worldObj.getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord)); // to tell the game it needs to pick up metadata from your block
    		}
    
    
    		switch (i) // the good part. get's your block muliple textures
    		{
    			case 0:
    			bindTextureByName("/subaraki/pillar3.png"); // bindTextureByName + the path to your image. for the block that you gave damage number 0
    			break;
    			case 1:
    			bindTextureByName("/subaraki/pillar.png"); // and so on and so on
    			break;
    			case 2:
    			bindTextureByName("/subaraki/pillar2.png");
    			break;
    			case 3:
    			bindTextureByName("/subaraki/pillar4.png");
    			break;
    			case 4:
    			bindTextureByName("/subaraki/pillar5.png");
    			break;
    			case 5:
    			bindTextureByName("/subaraki/pillar6.png");
    			break;
    			case 6:
    			bindTextureByName("/subaraki/pillar7.png");
    			break;
    			case 7:
    			bindTextureByName("/subaraki/pillar8.png");
    			break;
    			case 8:
    			bindTextureByName("/subaraki/pillar9.png");
    			break;
    			case 9:
    			bindTextureByName("/subaraki/pillar10.png");
    			break;
    			case 10:
    			bindTextureByName("/subaraki/pillar11.png");
    			break;
    			default:
    			bindTextureByName("/subaraki/pillar.png");
    		}
    
    		// for the int i = 0 which i mentioned above. the 0 will take over the texture from case 0, and have that texture render in your inventory. I unfortunately do not know yet how to make your block have more then one texture in your inventory. the blocks rendered in the world will have the allocated texture, the ones in the inventory wont. this will be updated as soon as I or anyone else founds the solution
    
    		GL11.glPushMatrix(); //start
    		GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F); //size
    		GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); //change the first 0 in like 90 to make it rotate 90 degrees.
    		GL11.glScalef(1.0F, -1F, -1F); // to make your block have a normal positioning. comment out to see what happens
    		model.renderModel(0.0625F); //renders and 0.0625F is exactly 1/16. every block has 16 entitys/pixels. if you make the number 1, every pixel will be as big as a block. make it 0.03125 and your block will be half as big as a normal one.
    		GL11.glPopMatrix(); //end
    
    	}
    
    
    
    	public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
    	{
    		renderAModelAt((TileEntityPillar) tileentity, d, d1, d2, f); //where to render
    	}
    
    }


    TileEntityPillar.java

    package net.minecraft.src;
    public class TileEntityPillar extends TileEntity
    {
    	public TileEntityPillar()
    	{
    	} // yup. it's empty. your block just needs this file to be able to render it in. no questions. just make this file.
    }

    Posted in: Tutorials
  • 0

    posted a message on [Universal] Subarakis One Stop Custom Block Tutorial ! make it with techne !
    Probably an noob error... BUT...
    I can place down the block I made just fine (it's like a normal block but one pixel shorter), however, the texturemap I made with Techne that I am currently using as my block texture is semi-covered up because there is another texture below it (the default gray grass texture).
    NOTE: In the picture attached, it doesn't look like the top texture is there, but it is. It's just hidden by the gray texture.

    Any help would be appreciated!


    Posted in: Tutorials
  • 0

    posted a message on [TOOL] [MAC/LINUX] PyMCSR- Server Runner revamped!
    PyMCSR v1.0
    By: LukeNukemMC

    Q: What is PyMCSR?
    A: PyMCSR is a tool written in Python to easily run a Minecraft server.

    Q: What do you need to run PyMCSR?
    A: Currently, you need to be running on a unix operating system (Mac/Linux), and you need to have Python and cURL installed.

    Q: How do I know if I have Python?
    A: Open the application "Terminal," and type "Python". You should get something like this:

    Last login: Sat Aug 4 16:26:02 on ttys000
    somethingt:~ yourUsername$ Python
    ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
    Python 2.7.2 (default, Jun 24 2011, 12:20:15)
    [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    If you get an error, visit "python.org" and download Python

    Q: How do I know if I have curl?
    A: In the Terminal application, type "sudo port install curl". You may have to put in your user password.

    Q: Where do I download PyMCSR?
    A: http://adf.ly/BXKg6

    Q: How do I run PyMCSR?
    A: The easiest way is to first put PyMCSR.py on your desktop, then open terminal and type, "python ~/Desktop/PyMCSR.py". The program should run in the Terminal window. Just follow the instructions and it should work fine.

    Q: How can I support PyMCSR?
    A: Donate via PayPal here
    Posted in: Server Administration
  • 0

    posted a message on TechGuy's Modding Tutorials
    Quote from TechGuy543

    More Tutorials

    Tools

    Due to the amount of code required for this, I've put it in another spoiler.


    mod_Tools
    package net.minecraft.src;
    public class mod_Tools extends BaseMod
    {
    public static final Item pickaxe = new ItemNameherePickaxe(2000, EnumToolMaterialNamehere.MATERIALNAMEHERE).setItemName("pickaxe");
    public static final Item axe = new ItemNamehereAxe(2001, EnumToolMaterialNamehere.MATERIALNAMEHERE).setItemName("axe");
    public static final Item shovel = new ItemNamehereShovel(2002, EnumToolMaterialNamehere.MATERIALNAMEHERE).setItemName("shovel");
    public static final Item sword = new ItemNamehereSword(2003, EnumToolMaterialNamehere.MATERIALNAMEHERE).setItemName("sword");
    public static final Item hoe = new ItemNamehereHoe(2004, EnumToolMaterialNamehere.MATERIALNAMEHERE).setItemName("hoe");
    public void load()
    {
      pickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/pathtoyourfile/pickaxeimage.png");
      axe.iconIndex = ModLoader.addOverride("/gui/items.png", "/pathtoyourfile/axeimage.png");
      shovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/pathtoyourfile/shovelimage.png");
      sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/pathtoyourfile/swordimage.png");
      hoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/pathtoyourfile/hoeimage.png");
    
    
      ModLoader.addName(pickaxe, "Pickaxe");
      ModLoader.addName(axe, "Axe");
      ModLoader.addName(shovel, "Shovel");
      ModLoader.addName(sword, "Sword");
      ModLoader.addName(hoe, "Hoe");
    
      ModLoader.addRecipe(new ItemStack(pickaxe, 1), new Object [] {"###", " % ", " % ", '#', Block.dirt, '%', Item.stick});
      ModLoader.addRecipe(new ItemStack(axe, 1), new Object [] {"##", "#%", " %", '#', Block.dirt, '%', Item.stick});
      ModLoader.addRecipe(new ItemStack(shovel, 1), new Object [] {"#", "%", "%", '#', Block.dirt, '%', Item.stick});
      ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {"#", "#", "%", '#', Block.dirt, '%', Item.stick});
      ModLoader.addRecipe(new ItemStack(hoe, 1), new Object [] {"##", " %", " %", '#', Block.dirt, '%', Item.stick});
    }
    
    public String getVersion()
    {
      return "1.2.5";
    }
    }


    ItemNamehereTool

    package net.minecraft.src;
    public class ItemNamehereTool extends Item
    {
    private Block blocksEffectiveAgainst[];
    protected float efficiencyOnProperMaterial;
    private int damageVsEntity;
    protected EnumToolMaterialNamehere toolMaterial;
    protected ItemNamehereTool(int i, int j, EnumToolMaterialNamehere par3EnumToolMaterialNamehere, Block par4ArrayOfBlock[])
    {
      super(i);
      efficiencyOnProperMaterial = 4F;
      toolMaterial = par3EnumToolMaterialNamehere;
      blocksEffectiveAgainst = par4ArrayOfBlock;
      maxStackSize = 1;
      setMaxDamage(par3EnumToolMaterialNamehere.getMaxUses());
      efficiencyOnProperMaterial = par3EnumToolMaterialNamehere.getEfficiencyOnProperMaterial();
      damageVsEntity = j + par3EnumToolMaterialNamehere.getDamageVsEntity();
    }
    /**
      * 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 getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
    {
      for (int i = 0; i < blocksEffectiveAgainst.length; i++)
      {
       if (blocksEffectiveAgainst[i] == par2Block)
       {
    	return efficiencyOnProperMaterial;
       }
      }
      return 1.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, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
    {
      par1ItemStack.damageItem(2, par3EntityLiving);
      return true;
    }
    public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
    {
      par1ItemStack.damageItem(1, par6EntityLiving);
      return true;
    }
    /**
      * Returns the damage against a given entity.
      */
    public int getDamageVsEntity(Entity par1Entity)
    {
      return damageVsEntity;
    }
    /**
      * 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()
    {
      return toolMaterial.getEnchantability();
    }
    }


    EnumToolMaterialNamehere
    package net.minecraft.src;
    public enum EnumToolMaterialNamehere
    {
    	MATERIALNAMEHERE(0, 59, 2.0F, 0, 15);
    	private final int harvestLevel;
    	private final int maxUses;
    	private final float efficiencyOnProperMaterial;
    	private final int damageVsEntity;
    	private final int enchantability;
    	private EnumToolMaterialNamehere(int par3, int par4, float par5, int par6, int par7)
    	{
    		harvestLevel = par3;
    		maxUses = par4;
    		efficiencyOnProperMaterial = par5;
    		damageVsEntity = par6;
    		enchantability = par7;
    	}
    	public int getMaxUses()
    	{
    		return maxUses;
    	}
    	public float getEfficiencyOnProperMaterial()
    	{
    		return efficiencyOnProperMaterial;
    	}
    	public int getDamageVsEntity()
    	{
    		return damageVsEntity;
    	}
    	public int getHarvestLevel()
    	{
    		return harvestLevel;
    	}
    	public int getEnchantability()
    	{
    		return enchantability;
    	}
    }


    ItemNameherePickaxe
    package net.minecraft.src;
    public class ItemNameherePickaxe extends ItemNamehereTool
    {
    private static Block blocksEffectiveAgainst[];
    protected ItemNameherePickaxe(int par1, EnumToolMaterialNamehere par2EnumToolMaterialNamehere)
    {
      super(par1, 2, par2EnumToolMaterialNamehere, blocksEffectiveAgainst);
    }
    /**
      * Returns if the item (tool) can harvest results from the block type.
      */
    public boolean canHarvestBlock(Block par1Block)
    {
      if (par1Block == Block.obsidian)
      {
       return toolMaterial.getHarvestLevel() == 3;
      }
      if (par1Block == Block.blockDiamond || par1Block == Block.oreDiamond)
      {
       return toolMaterial.getHarvestLevel() >= 2;
      }
      if (par1Block == Block.blockGold || par1Block == Block.oreGold)
      {
       return toolMaterial.getHarvestLevel() >= 2;
      }
      if (par1Block == Block.blockSteel || par1Block == Block.oreIron)
      {
       return toolMaterial.getHarvestLevel() >= 1;
      }
      if (par1Block == Block.blockLapis || par1Block == Block.oreLapis)
      {
       return toolMaterial.getHarvestLevel() >= 1;
      }
      if (par1Block == Block.oreRedstone || par1Block == Block.oreRedstoneGlowing)
      {
       return toolMaterial.getHarvestLevel() >= 2;
      }
      if (par1Block.blockMaterial == Material.rock)
      {
       return true;
      }
      return par1Block.blockMaterial == Material.iron;
    }
    /**
      * 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 getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
    {
      if (par2Block != null && (par2Block.blockMaterial == Material.iron || par2Block.blockMaterial == Material.rock))
      {
       return efficiencyOnProperMaterial;
      }
      else
      {
       return super.getStrVsBlock(par1ItemStack, par2Block);
      }
    }
    static
    {
      blocksEffectiveAgainst = (new Block[]
    	{
    	Block.cobblestone, Block.stairDouble, Block.stairSingle, Block.stone, Block.sandStone, Block.cobblestoneMossy, Block.oreIron, Block.blockSteel, Block.oreCoal, Block.blockGold,
    	Block.oreGold, Block.oreDiamond, Block.blockDiamond, Block.ice, Block.netherrack, Block.oreLapis, Block.blockLapis, Block.oreRedstone, Block.oreRedstoneGlowing, Block.rail,
    	Block.railDetector, Block.railPowered
    	});
    }
    }


    ItemNamehereAxe
    package net.minecraft.src;
    public class ItemNamehereAxe extends ItemNamehereTool
    {
    	private static Block blocksEffectiveAgainst[];
    	protected ItemNamehereAxe(int par1, EnumToolMaterialNamehere par2EnumToolMaterialNamehere)
    	{
    		super(par1, 3, par2EnumToolMaterialNamehere, blocksEffectiveAgainst);
    	}
    	/**
    	 * 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 getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
    	{
    		if (par2Block != null && par2Block.blockMaterial == Material.wood)
    		{
    			return efficiencyOnProperMaterial;
    		}
    		else
    		{
    			return super.getStrVsBlock(par1ItemStack, par2Block);
    		}
    	}
    	static
    	{
    		blocksEffectiveAgainst = (new Block[]
    				{
    					Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stairDouble, Block.stairSingle, Block.pumpkin, Block.pumpkinLantern
    				});
    	}
    }


    ItemNamehereShovel
    package net.minecraft.src;
    public class ItemNamehereShovel extends ItemNamehereTool
    {
    	private static Block blocksEffectiveAgainst[];
    	public ItemNamehereShovel(int par1, EnumToolMaterialNamehere par2EnumToolMaterialNamehere)
    	{
    		super(par1, 1, par2EnumToolMaterialNamehere, blocksEffectiveAgainst);
    	}
    	/**
    	 * Returns if the item (tool) can harvest results from the block type.
    	 */
    	public boolean canHarvestBlock(Block par1Block)
    	{
    		if (par1Block == Block.snow)
    		{
    			return true;
    		}
    		return par1Block == Block.blockSnow;
    	}
    	static
    	{
    		blocksEffectiveAgainst = (new Block[]
    				{
    					Block.grass, Block.dirt, Block.sand, Block.gravel, Block.snow, Block.blockSnow, Block.blockClay, Block.tilledField, Block.slowSand, Block.mycelium
    				});
    	}
    }


    ItemNamehereSword
    package net.minecraft.src;
    public class ItemNamehereSword extends Item
    {
    	private int weaponDamage;
    	private final EnumToolMaterialNamehere toolMaterial;
    	public ItemNamehereSword(int par1, EnumToolMaterialNamehere par2EnumToolMaterialNamehere)
    	{
    		super(par1);
    		toolMaterial = par2EnumToolMaterialNamehere;
    		maxStackSize = 1;
    		setMaxDamage(par2EnumToolMaterialNamehere.getMaxUses());
    		weaponDamage = 4 + par2EnumToolMaterialNamehere.getDamageVsEntity();
    	}
    	/**
    	 * 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 getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
    	{
    		return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
    	}
    	/**
    	 * 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, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
    	{
    		par1ItemStack.damageItem(1, par3EntityLiving);
    		return true;
    	}
    	public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
    	{
    		par1ItemStack.damageItem(2, par6EntityLiving);
    		return true;
    	}
    	/**
    	 * Returns the damage against a given entity.
    	 */
    	public int getDamageVsEntity(Entity par1Entity)
    	{
    		return weaponDamage;
    	}
    	/**
    	 * Returns True is the item is renderer in full 3D when hold.
    	 */
    	public boolean isFull3D()
    	{
    		return true;
    	}
    	/**
    	 * returns the action that specifies what animation to play when the items is being used
    	 */
    	public EnumAction getItemUseAction(ItemStack par1ItemStack)
    	{
    		return EnumAction.block;
    	}
    	/**
    	 * How long it takes to use or consume an item
    	 */
    	public int getMaxItemUseDuration(ItemStack par1ItemStack)
    	{
    		return 0x11940;
    	}
    	/**
    	 * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
    	 */
    	public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    	{
    		par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
    		return par1ItemStack;
    	}
    	/**
    	 * Returns if the item (tool) can harvest results from the block type.
    	 */
    	public boolean canHarvestBlock(Block par1Block)
    	{
    		return par1Block.blockID == Block.web.blockID;
    	}
    	/**
    	 * Return the enchantability factor of the item, most of the time is based on material.
    	 */
    	public int getItemEnchantability()
    	{
    		return toolMaterial.getEnchantability();
    	}
    }


    ItemNamehereHoe
    package net.minecraft.src;
    public class ItemNamehereHoe extends Item
    {
    	public ItemNamehereHoe(int par1, EnumToolMaterialNamehere par2EnumToolMaterialNamehere)
    	{
    		super(par1);
    		maxStackSize = 1;
    		setMaxDamage(par2EnumToolMaterialNamehere.getMaxUses());
    	}
    	public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7)
    	{
    		if (!par2EntityPlayer.canPlayerEdit(par4, par5, par6))
    		{
    			return false;
    		}
    		int i = par3World.getBlockId(par4, par5, par6);
    		int j = par3World.getBlockId(par4, par5 + 1, par6);
    		if (par7 != 0 && j == 0 && i == Block.grass.blockID || i == Block.dirt.blockID)
    		{
    			Block block = Block.tilledField;
    			par3World.playSoundEffect((float)par4 + 0.5F, (float)par5 + 0.5F, (float)par6 + 0.5F, block.stepSound.getStepSound(), (block.stepSound.getVolume() + 1.0F) / 2.0F, block.stepSound.getPitch() * 0.8F);
    			if (par3World.isRemote)
    			{
    				return true;
    			}
    			else
    			{
    				par3World.setBlockWithNotify(par4, par5, par6, block.blockID);
    				par1ItemStack.damageItem(1, par2EntityPlayer);
    				return true;
    			}
    		}
    		else
    		{
    			return false;
    		}
    	}
      
    	public boolean isFull3D()
    	{
    		return true;
    	}
    }





    Understanding the Code

    mod_Tools
    • This is a fairly normal mod_ class. It is important to remember that tools are just items with special features.
    It takes time to type out and explain so much code. Please be patient!


    It is fairly easy to add tools with only one document (mod_*.java). However, you still need to add a line of code in EnumToolMaterial.java under GOLD that has the properties of your tool material. PLEASE NOTE: I recommend making the EnumToolMaterialNameHere.java file (That TechGuy uses) instead of adding to the EnumToolMaterial.java file, so the mod is compatible with other mods.

    Here is the code for the mod_*.java file (I made bone tools PLEASE do not copy the code verbatim and claim it is your own work):

    package net.minecraft.src;

    import java.util.Random;

    public class mod_ModBoneTools extends BaseMod
    {
    public static final Item BonePickaxe;
    public static final Item BoneShovel;
    public static final Item BoneAxe;
    public static final Item BoneSword;
    public static final Item BoneHoe;

    public void load()
    {
    BonePickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/ModTextures/Tools/BonePickaxe.png");
    ModLoader.addName(BonePickaxe, "Bone Pickaxe");
    ModLoader.addRecipe(new ItemStack(BonePickaxe, 1), new Object[] {"***", " @ ", " @ ", Character.valueOf('*'), mod_ModEnchantedBone.EnchantedBone, Character.valueOf('@'), Item.stick});

    BoneHoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/ModTextures/Tools/BoneHoe.png");
    ModLoader.addName(BoneHoe, "Bone Hoe");
    ModLoader.addRecipe(new ItemStack(BoneHoe, 1), new Object[] {"** ", " @ ", " @ ", Character.valueOf('*'), mod_ModEnchantedBone.EnchantedBone, Character.valueOf('@'), Item.stick});

    BoneAxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/ModTextures/Tools/BoneAxe.png");
    ModLoader.addName(BoneAxe, "Bone Axe");
    ModLoader.addRecipe(new ItemStack(BoneAxe, 1), new Object[] {"** ", "*@ ", " @ ", Character.valueOf('*'), mod_ModEnchantedBone.EnchantedBone, Character.valueOf('@'), Item.stick});

    BoneShovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/ModTextures/Tools/BoneShovel.png");
    ModLoader.addName(BoneShovel, "Bone Shovel");
    ModLoader.addRecipe(new ItemStack(BoneShovel, 1), new Object[] {" * ", " @ ", " @ ", Character.valueOf('*'), mod_ModEnchantedBone.EnchantedBone, Character.valueOf('@'), Item.stick});

    BoneSword.iconIndex = ModLoader.addOverride("/gui/items.png", "/ModTextures/Tools/BoneSword.png");
    ModLoader.addName(BoneSword, "Bone Sword");
    ModLoader.addRecipe(new ItemStack(BoneSword, 1), new Object[] {" * ", " * ", " @ ", Character.valueOf('*'), mod_ModEnchantedBone.EnchantedBone, Character.valueOf('@'), Item.stick});
    }

    public String getVersion()
    {
    return "1.2.5";
    }

    static
    {
    BonePickaxe = (new ItemPickaxe(5994, EnumToolMaterial.BONE)).setItemName("Bone Pickaxe");
    BoneShovel = (new ItemSpade(5997, EnumToolMaterial.BONE)).setItemName("Bone Shovel");
    BoneAxe = (new ItemAxe(5996, EnumToolMaterial.BONE)).setItemName("Bone Axe");
    BoneSword = (new ItemSword(5995, EnumToolMaterial.BONE)).setItemName("Bone Sword");
    BoneHoe = (new ItemHoe(5998, EnumToolMaterial.BONE)).setItemName("Bone Hoe");
    }
    }

    Posted in: Mapping and Modding Tutorials
  • 0

    posted a message on Modding Tutorials?
    I would also strongly recommend these tutorials:
    http://www.minecraftforum.net/topic/1161758-modloader125-modding-tutorials-by-darkthynder-and-makerz739-dawn/

    They are very in-depth and easy to understand.
    Posted in: Mods Discussion
  • 0

    posted a message on Modding in 1.2.3?
    I've been messing around with some of the Minecraft .class/.java files in MCP. I've made some cool stuff, including editing some mobs like zombies to give them custom attack, health, etc. However, I have to change the "EntityZombie.java" that already exists, I can't make my own "EntityFastZombie.java" or whatever. Could someone either tell me how to make my own mob (IN 1.2.3!) or steer me in the right direction of where I could find this information?

    Thanks!
    Posted in: Mods Discussion
  • 0

    posted a message on [MAC][MOD] Minecraft Jar Tool
    Quote from ipodtouchdude

    10.8 is a developer preview.


    If you want to build from source code on OS X 10.7 you have to set the deployment target in Xcode to 10.7
    Posted in: Minecraft Tools
  • 0

    posted a message on My (Kind of) Epic base
    Quote from ColbyCobalt

    Although it's certainly not "impossible" to get all that stuff legit, getting all the would mean you would likely know more about the game and there would be all sorts of things here that he doesn't have, such as utility rooms, farms, etc. Believe it or not a house built in survival gets higher scores 99.9% of the time than if it was built in Creative, and if the reasons are not obvious, you are probably not old enough to argue with anyways..

    More on topic, the house I would have to give a 3/10. It would get a 4/10 on survival so don't get too crazy, it's overuse of diamond/iron/gold blocks looks gaudy and there is not a whole lot going on as far as interesting architecture.

    I go harder on you for two reasons, first being you made a small-mid sized build in a mode that can fly around and has infinite of every item and used "expensive" blocks to try and make it look nicer. The second being you say "I've been playing a couple of years and never made a real base" which says to me either you are totally full of crap, or you played a little bit here and there and now you say you have been playing all this time.


    I understand the poor ratings of my construction, as I have barely had any time to work on this. My reliance on shiny blocks, and the overall ostentatiousness of this build is rather disappointing.
    However, I have been playing about 1-2 hours a day since the mid-Alpha stages, so I don't appreciate you saying that I'm "full of crap" or that I've only been playing "here and there." If anything I play too much. By saying I never have built a base, I meant a large living area, like in the thread I cited. In most of my worlds, all of the buildings are spread out and are not grouped in one area. This is one of the first times I have made a base where everything is grouped together.
    I also don't appreciate your beliefs that I am somehow inferior and that I am "probably not old enough to argue with anyways.." I said specifically at the start of my post that my building is "still in the VERY early developmental phases." Also, despite the fact that you can fly around and have infinite building materials in creative, you still have to choose, plan, and place all of the blocks. The block count on this creation has easily hit 1000, and I only have had time to work on this for about 20-30 minutes, without MCEdit or WorldEdit.

    When I asked for feedback and constructive criticism, I didn't mean that I was to be insulted and told that I am "full of crap."
    Posted in: Survival Mode
  • To post a comment, please or register a new account.