Note: You will need a thing called fernflower.jar for this to work. You can get it __. Put it in runtime/bin along with the other .jar's. Then put ShockahPI in your normal jar where you put modloader and decompile.
mod_Namehere
package net.minecraft.src;
public class mod_Namehere extends BaseMod
{
public mod_Namehere()
{
new DimensionNamehere().name = "Namehere";
ModLoader.RegisterBlock(NameherePortal);
ModLoader.RegisterBlock(NamehereStone);
ModLoader.RegisterBlock(NamehereDirt);
ModLoader.RegisterBlock(NamehereGrass);
ModLoader.RegisterBlock(BlockNameherePortalStarter);
ModLoader.AddName(PortalStarterNamehere, "Namehere Portal Starter");
ModLoader.AddName(NamehereStone, "Namehere Stone");
ModLoader.AddName(NamehereDirt, "Namehere Dirt");
ModLoader.AddName(NamehereGrass, "Namehere Grass");
NamehereStoneTexture = ModLoader.addOverride("/terrain.png", "/Myfolder/NamehereStone.png");
NamehereGrassTexture = ModLoader.addOverride("/terrain.png", "/Myfolder/NamehereGrass.png");
NamehereDirtTexture = ModLoader.addOverride("/terrain.png", "/Myfolder/NamehereDirt.png");
NamehereGrass.blockIndexInTexture = NamehereGrassTexture;
NamehereStone.blockIndexInTexture = NamehereStoneTexture;
NamehereDirt.blockIndexInTexture = NamehereDirtTexture;
ToolBase.Shovel.mineBlocks.add(new BlockHarvestPower(NamehereDirt.blockID, 0.0F));
ToolBase.Shovel.mineBlocks.add(new BlockHarvestPower(NamehereGrass.blockID, 0.0F));
ToolBase.Pickaxe.mineBlocks.add(new BlockHarvestPower(NamehereStone.blockID, 0.0F));
}
public static final BlockPortalNamehere NameherePortal;
public static final Item PortalStarterNamehere;
public static final Block BlockNameherePortalStarter;
public static final Block NamehereStone;
public static final Block NamehereGrass;
public static final Block NamehereDirt;
public static int NamehereStoneTexture;
public static int NamehereGrassTexture;
public static int NamehereDirtTexture;
static
{
NameherePortal = (BlockPortalNamehere)(new BlockPortalNamehere(234, ModLoader.getUniqueSpriteIndex("/terrain.png"))).setHardness(-1F).setStepSound(Block.soundGlassFootstep).setLightValue(0.75F).setBlockName("NameherePortal");
PortalStarterNamehere = new ItemNameherePortalStarter(1987).setIconCoord(5, 0).setItemName("NameherePortalStarter");
BlockNameherePortalStarter = new BlockNameherePortalStarter(235, 1, Material.sponge).setHardness(0.0F).disableStats().disableNeighborNotifyOnMetadataChange().setBlockName("BlockNameherePortalStarter");
NamehereStone = (new BlockNamehereStone(236, 1)).setHardness(1.5F).setResistance(10F).setStepSound(Block.soundStoneFootstep).setBlockName("NamehereStone");
NamehereGrass = (Block)(new BlockNamehereGrass(237, 1)).setHardness(0.6F).setStepSound(Block.soundGrassFootstep).setBlockName("NamehereGrass");
NamehereDirt = (new BlockNamehereDirt(238, 1)).setHardness(0.5F).setStepSound(Block.soundGravelFootstep).setBlockName("NamehereDirt");
}
public String Version()
{
return "1.7.3";
}
}
BlockNamehereDirt
package net.minecraft.src;
public class BlockNamehereDirt extends Block
{
protected BlockNamehereDirt(int i, int j)
{
super(i, j, Material.ground);
}
public int idDropped(int i, Random random)
{
return mod_Namehere.NamehereDirt.blockID;
}
}
BlockNamehereGrass
package net.minecraft.src;
import java.util.Random;
public class BlockNamehereGrass extends Block
{
protected BlockNamehereGrass(int i, int j)
{
super(i, Material.grassMaterial);
blockIndexInTexture = j;
setTickOnLoad(true);
}
public int getBlockTexture(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(l == 1)
{
return 0;
}
if(l == 0)
{
return 2;
}
Material material = iblockaccess.getBlockMaterial(i, j + 1, k);
return material != Material.snow && material != Material.builtSnow ? 3 : 68;
}
public int colorMultiplier(IBlockAccess iblockaccess, int i, int j, int k)
{
iblockaccess.getWorldChunkManager().func_4069_a(i, k, 1, 1);
double d = iblockaccess.getWorldChunkManager().temperature[0];
double d1 = iblockaccess.getWorldChunkManager().humidity[0];
return ColorizerGrass.getGrassColor(d, d1);
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.multiplayerWorld)
{
return;
}
if(world.getBlockLightValue(i, j + 1, k) < 4 && Block.lightOpacity[world.getBlockId(i, j + 1, k)] > 2)
{
if(random.nextInt(4) != 0)
{
return;
}
world.setBlockWithNotify(i, j, k, mod_Namehere.NamehereDirt.blockID);
} else
if(world.getBlockLightValue(i, j + 1, k) >= 9)
{
int l = (i + random.nextInt(3)) - 1;
int i1 = (j + random.nextInt(5)) - 3;
int j1 = (k + random.nextInt(3)) - 1;
int k1 = world.getBlockId(l, i1 + 1, j1);
if(world.getBlockId(l, i1, j1) == mod_Namehere.NamehereDirt.blockID && world.getBlockLightValue(l, i1 + 1, j1) >= 4 && Block.lightOpacity[k1] <= 2)
{
world.setBlockWithNotify(l, i1, j1, mod_Namehere.NamehereGrass.blockID);
}
}
}
public int idDropped(int i, Random random)
{
return mod_Namehere.NamehereDirt.idDropped(0, random);
}
}
BlockNamehereStone
package net.minecraft.src;
import java.util.Random;
public class BlockNamehereStone extends Block
{
public BlockNamehereStone(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random)
{
return mod_Namehere.NamehereStone.blockID;
}
}
BlockNameherePortalStarter
package net.minecraft.src;
public class BlockNameherePortalStarter extends Block
{
public BlockNameherePortalStarter(int i, int j, Material material)
{
super(i, j, material);
}
public void onBlockAdded(World world, int i, int j, int k){
if(world.getBlockId(i, j - 1, k) == Block.dirt.blockID && mod_Namehere.NameherePortal.tryToCreatePortal(world, i, j, k))
{
return;
}else {
world.setBlockWithNotify(i, j, k, 0);
}
}
}
BlockPortalNamehere
package net.minecraft.src;
import java.util.Random;
public class BlockPortalNamehere extends BlockBreakable
{
public BlockPortalNamehere(int i, int j)
{
super(i, j, Material.portal, false);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k)
{
if(iblockaccess.getBlockId(i - 1, j, k) == blockID || iblockaccess.getBlockId(i + 1, j, k) == blockID)
{
float f = 0.5F;
float f2 = 0.125F;
setBlockBounds(0.5F - f, 0.0F, 0.5F - f2, 0.5F + f, 1.0F, 0.5F + f2);
} else
{
float f1 = 0.125F;
float f3 = 0.5F;
setBlockBounds(0.5F - f1, 0.0F, 0.5F - f3, 0.5F + f1, 1.0F, 0.5F + f3);
}
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public boolean tryToCreatePortal(World world, int i, int j, int k)
{
int l = 0;
int i1 = 0;
if(world.getBlockId(i - 1, j, k) == Block.dirt.blockID || world.getBlockId(i + 1, j, k) == Block.dirt.blockID)
{
l = 1;
}
if(world.getBlockId(i, j, k - 1) == Block.dirt.blockID || world.getBlockId(i, j, k + 1) == Block.dirt.blockID)
{
i1 = 1;
}
if(l == i1)
{
return false;
}
if(world.getBlockId(i - l, j, k - i1) == 0)
{
i -= l;
k -= i1;
}
for(int l1 = -1; l1 <= 2; l1++)
{
for(int j1 = -1; j1 <= 3; j1++)
{
boolean flag = l1 == -1 || l1 == 2 || j1 == -1 || j1 == 3;
if(l1 != -1 && l1 != 2 || j1 != -1 && j1 != 3)
{
int j2 = world.getBlockId(i + l * l1, j + j1, k + i1 * l1);
if(flag)
{
if(j2 != Block.dirt.blockID)
{
return false;
}
} else
if(j2 != 0 && j2 != mod_Namehere.NameherePortal.blockID)
{
return false;
}
}
}
}
world.editingBlocks = true;
for(int i2 = 0; i2 < 2; i2++)
{
for(int k1 = 0; k1 < 3; k1++)
{
world.setBlockWithNotify(i + l * i2, j + k1, k + i1 * i2, mod_Namehere.NameherePortal.blockID);
}
}
world.editingBlocks = false;
return true;
}
public void onNeighborBlockChange(World world, int i, int j, int k, int l)
{
int i1 = 0;
int j1 = 1;
if(world.getBlockId(i - 1, j, k) == blockID || world.getBlockId(i + 1, j, k) == blockID)
{
i1 = 1;
j1 = 0;
}
int k1;
for(k1 = j; world.getBlockId(i, k1 - 1, k) == blockID; k1--) { }
if(world.getBlockId(i, k1 - 1, k) != Block.dirt.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
return;
}
int l1;
for(l1 = 1; l1 < 4 && world.getBlockId(i, k1 + l1, k) == blockID; l1++) { }
if(l1 != 3 || world.getBlockId(i, k1 + l1, k) != Block.dirt.blockID)
{
world.setBlockWithNotify(i, j, k, 0);
return;
}
boolean flag = world.getBlockId(i - 1, j, k) == blockID || world.getBlockId(i + 1, j, k) == blockID;
boolean flag1 = world.getBlockId(i, j, k - 1) == blockID || world.getBlockId(i, j, k + 1) == blockID;
if(flag && flag1)
{
world.setBlockWithNotify(i, j, k, 0);
return;
}
if((world.getBlockId(i + i1, j, k + j1) != Block.dirt.blockID || world.getBlockId(i - i1, j, k - j1) != blockID) && (world.getBlockId(i - i1, j, k - j1) != Block.dirt.blockID || world.getBlockId(i + i1, j, k + j1) != blockID))
{
world.setBlockWithNotify(i, j, k, 0);
return;
} else
{
return;
}
}
public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
{
if(iblockaccess.getBlockId(i, j, k) == blockID)
{
return false;
}
boolean flag = iblockaccess.getBlockId(i - 1, j, k) == blockID && iblockaccess.getBlockId(i - 2, j, k) != blockID;
boolean flag1 = iblockaccess.getBlockId(i + 1, j, k) == blockID && iblockaccess.getBlockId(i + 2, j, k) != blockID;
boolean flag2 = iblockaccess.getBlockId(i, j, k - 1) == blockID && iblockaccess.getBlockId(i, j, k - 2) != blockID;
boolean flag3 = iblockaccess.getBlockId(i, j, k + 1) == blockID && iblockaccess.getBlockId(i, j, k + 2) != blockID;
boolean flag4 = flag || flag1;
boolean flag5 = flag2 || flag3;
if(flag4 && l == 4)
{
return true;
}
if(flag4 && l == 5)
{
return true;
}
if(flag5 && l == 2)
{
return true;
}
return flag5 && l == 3;
}
public int quantityDropped(Random random)
{
return 0;
}
public int getRenderBlockPass()
{
return 1;
}
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity)
{
if(entity.ridingEntity == null && entity.riddenByEntity == null)
{
if(entity instanceof EntityPlayerSP)
{
EntityPlayerSP entityplayersp = (EntityPlayerSP)entity;
entityplayersp.portal = getDimNumber();
}
entity.setInPortal();
}
}
public void randomDisplayTick(World world, int i, int j, int k, Random random)
{
if(random.nextInt(100) == 0)
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "portal.portal", 1.0F, random.nextFloat() * 0.4F + 0.8F);
}
for(int l = 0; l < 4; l++)
{
double d = (float)i + random.nextFloat();
double d1 = (float)j + random.nextFloat();
double d2 = (float)k + random.nextFloat();
double d3 = 0.0D;
double d4 = 0.0D;
double d5 = 0.0D;
int i1 = random.nextInt(2) * 2 - 1;
d3 = ((double)random.nextFloat() - 0.5D) * 0.5D;
d4 = ((double)random.nextFloat() - 0.5D) * 0.5D;
d5 = ((double)random.nextFloat() - 0.5D) * 0.5D;
if(world.getBlockId(i - 1, j, k) == blockID || world.getBlockId(i + 1, j, k) == blockID)
{
d2 = (double)k + 0.5D + 0.25D * (double)i1;
d5 = random.nextFloat() * 2.0F * (float)i1;
} else
{
d = (double)i + 0.5D + 0.25D * (double)i1;
d3 = random.nextFloat() * 2.0F * (float)i1;
}
world.spawnParticle("portal", d, d1, d2, d3, d4, d5);
}
}
public int getDimNumber()
{
return 1001;
}
}
ChunkProviderNamehere
DimensionNamehere
ItemNameherePortalStarter
MapGenCavesNamehere
TeleporterNamehere
WorldGenTreesNamehere
WorldProviderNamehere
Thank you for this tutorial you get 1 trillion/5 stars :biggrin.gif:
EDIT
where can i contact the author so i can get fernflower.jar
Thank you for this tutorial you get 1 trillion/5 stars :biggrin.gif:
EDIT
where can i contact the author so i can get fernflower.jar
Ha, thanks but it's not done yet... I have a copy of the fernflower.jar but I'm not sure whether or not I'm aloud to share it with just anyone. I might ask someone like searge or something.
Ha, thanks but it's not done yet... I have a copy of the fernflower.jar but I'm not sure whether or not I'm aloud to share it with just anyone. I might ask someone like searge or something.
Why custom shears? Also, I was going to do throwable explosive and item tut's but I can't seem to get the texture to load properly when I throw my knife.. The firebomb I made won't even show the texture...
Why custom shears? Also, I was going to do throwable explosive and item tut's but I can't seem to get the texture to load properly when I throw my knife.. The firebomb I made won't even show the texture...
did you ever figure out the issue with the properties file mod?
look at the reply i did. a few post up.
for the armors
ModLoader.AddArmor("lavastoneArmor")
change to
ModLoader.AddArmor("lavastonearmor")
then place the lavastonearmor_1.png and lavastonearmor_2.png into your minecraft.jar armor folder. see if that works.
Thanks for your help, but cowmonkey just solved it. I had to rename my textures lavastoneArmor_1, and 2. Thanks again!
Thank you for this tutorial you get 1 trillion/5 stars :biggrin.gif:
EDIT
where can i contact the author so i can get fernflower.jar
have you tried the mod to see if it worked for you?
here is the java files/image http://www.mediafire.com/?3j60sncn4eb2o4w
Ha, thanks but it's not done yet... I have a copy of the fernflower.jar but I'm not sure whether or not I'm aloud to share it with just anyone. I might ask someone like searge or something.
Did you get my pm just curious
ah ok wasnt sure so i sent it to you.
...Are you going to make this, or not??!?
There are plenty of those types of tutorials on the MC forums, why don't you look until he is has one...
Oh, ok.
I looked, and found a tutorial on all the tools.
But I'm not looking for those, at least not yet. I actually need a tutorial on custom SHEARS.
did you ever figure out the issue with the properties file mod?
k, thanks. I will lookup a new way to generate a property file.