[1.7.3] New Dimension (outdated code)
2 posters
MC Modding :: Modding :: Singleplayer Modding :: Tutorials
Page 1 of 1
[1.7.3] New Dimension (outdated code)
- Spoiler:
- DimensionNamehere
- Code:
package net.minecraft.src;
public class DimensionNamehere extends DimensionBase
{
public DimensionNamehere()
{
super(1001,WorldProviderNamehere.class,TeleporterNamehere.class);
}
}
ItemNameherePortalStarter- Code:
package net.minecraft.src;
public class ItemNameherePortalStarter extends Item
{
public ItemNameherePortalStarter(int i)
{
super(i);
}
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l)
{
if(l == 0)
{
j--;
}
if(l == 1)
{
j++;
}
if(l == 2)
{
k--;
}
if(l == 3)
{
k++;
}
if(l == 4)
{
i--;
}
if(l == 5)
{
i++;
}
int i1 = world.getBlockId(i, j, k);
if(i1 == 0)
{
world.playSoundEffect((double)i + 0.5D, (double)j + 0.5D, (double)k + 0.5D, "fire.ignite", 1.0F, itemRand.nextFloat() * 0.4F + 0.8F);
world.setBlockWithNotify(i, j, k, mod_Namehere.BlockNameherePortalStarter.blockID);
}
itemstack.damageItem(1, entityplayer);
return true;
}
}
MapGenCavesNamehere- Code:
package net.minecraft.src;
import java.util.Random;
public class MapGenCavesNamehere extends MapGenBase
{
public MapGenCavesNamehere()
{
}
protected void func_870_a(int i, int j, byte abyte0[], double d, double d1,
double d2)
{
releaseEntitySkin(i, j, abyte0, d, d1, d2, 1.0F + rand.nextFloat() * 6F, 0.0F, 0.0F, -1, -1, 0.5D);
}
protected void releaseEntitySkin(int i, int j, byte abyte0[], double d, double d1,
double d2, float f, float f1, float f2, int k, int l,
double d3)
{
double d4 = i * 16 + 8;
double d5 = j * 16 + 8;
float f3 = 0.0F;
float f4 = 0.0F;
Random random = new Random(rand.nextLong());
if(l <= 0)
{
int i1 = field_1306_a * 16 - 16;
l = i1 - random.nextInt(i1 / 4);
}
boolean flag = false;
if(k == -1)
{
k = l / 2;
flag = true;
}
int j1 = random.nextInt(l / 2) + l / 4;
boolean flag1 = random.nextInt(6) == 0;
for(; k < l; k++)
{
double d6 = 1.5D + (double)(MathHelper.sin(((float)k * 3.141593F) / (float)l) * f * 1.0F);
double d7 = d6 * d3;
float f5 = MathHelper.cos(f2);
float f6 = MathHelper.sin(f2);
d += MathHelper.cos(f1) * f5;
d1 += f6;
d2 += MathHelper.sin(f1) * f5;
if(flag1)
{
f2 *= 0.92F;
} else
{
f2 *= 0.7F;
}
f2 += f4 * 0.1F;
f1 += f3 * 0.1F;
f4 *= 0.9F;
f3 *= 0.75F;
f4 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 2.0F;
f3 += (random.nextFloat() - random.nextFloat()) * random.nextFloat() * 4F;
if(!flag && k == j1 && f > 1.0F)
{
releaseEntitySkin(i, j, abyte0, d, d1, d2, random.nextFloat() * 0.5F + 0.5F, f1 - 1.570796F, f2 / 3F, k, l, 1.0D);
releaseEntitySkin(i, j, abyte0, d, d1, d2, random.nextFloat() * 0.5F + 0.5F, f1 + 1.570796F, f2 / 3F, k, l, 1.0D);
return;
}
if(!flag && random.nextInt(4) == 0)
{
continue;
}
double d8a = d - d4;
double d9a = d2 - d5;
double d10a = l - k;
double d11 = f + 2.0F + 16F;
if((d8a * d8a + d9a * d9a) - d10a * d10a > d11 * d11)
{
return;
}
if(d < d4 - 16D - d6 * 2D || d2 < d5 - 16D - d6 * 2D || d > d4 + 16D + d6 * 2D || d2 > d5 + 16D + d6 * 2D)
{
continue;
}
int d8 = MathHelper.floor_double(d - d6) - i * 16 - 1;
int k1 = (MathHelper.floor_double(d + d6) - i * 16) + 1;
int d9 = MathHelper.floor_double(d1 - d7) - 1;
int l1 = MathHelper.floor_double(d1 + d7) + 1;
int d10 = MathHelper.floor_double(d2 - d6) - j * 16 - 1;
int i2 = (MathHelper.floor_double(d2 + d6) - j * 16) + 1;
if(d8 < 0)
{
d8 = 0;
}
if(k1 > 16)
{
k1 = 16;
}
if(d9 < 1)
{
d9 = 1;
}
if(l1 > 120)
{
l1 = 120;
}
if(d10 < 0)
{
d10 = 0;
}
if(i2 > 16)
{
i2 = 16;
}
boolean flag2 = false;
for(int j2 = d8; !flag2 && j2 < k1; j2++)
{
for(int l2 = d10; !flag2 && l2 < i2; l2++)
{
for(int i3 = l1 + 1; !flag2 && i3 >= d9 - 1; i3--)
{
int j3 = (j2 * 16 + l2) * 128 + i3;
if(i3 < 0 || i3 >= 128)
{
continue;
}
if(abyte0[j3] == Block.waterMoving.blockID || abyte0[j3] == Block.waterStill.blockID)
{
flag2 = true;
}
if(i3 != d9 - 1 && j2 != d8 && j2 != k1 - 1 && l2 != d10 && l2 != i2 - 1)
{
i3 = d9;
}
}
}
}
if(flag2)
{
continue;
}
for(int k2 = d8; k2 < k1; k2++)
{
double d12 = (((double)(k2 + i * 16) + 0.5D) - d) / d6;
label0:
for(int k3 = d10; k3 < i2; k3++)
{
double d13 = (((double)(k3 + j * 16) + 0.5D) - d2) / d6;
int l3 = (k2 * 16 + k3) * 128 + l1;
boolean flag3 = false;
if(d12 * d12 + d13 * d13 >= 1.0D)
{
continue;
}
int i4 = l1 - 1;
do
{
if(i4 < d9)
{
continue label0;
}
double d14 = (((double)i4 + 0.5D) - d1) / d7;
if(d14 > -0.69999999999999996D && d12 * d12 + d14 * d14 + d13 * d13 < 1.0D)
{
byte byte0 = abyte0[l3];
if(byte0 == mod_Namehere.NamehereGrass.blockID)
{
flag3 = true;
}
if(byte0 == mod_Namehere.NamehereStone.blockID || byte0 == mod_Namehere.NamehereDirt.blockID || byte0 == mod_Namehere.NamehereGrass.blockID)
{
if(i4 < 10)
{
abyte0[l3] = (byte)Block.lavaMoving.blockID;
} else
{
abyte0[l3] = 0;
if(flag3 && abyte0[l3 - 1] == mod_Namehere.NamehereDirt.blockID)
{
abyte0[l3 - 1] = (byte)mod_Namehere.NamehereGrass.blockID;
}
}
}
}
l3--;
i4--;
} while(true);
}
}
if(flag)
{
break;
}
}
}
protected void func_868_a(World world, int i, int j, int k, int l, byte abyte0[])
{
int i1 = rand.nextInt(rand.nextInt(rand.nextInt(40) + 1) + 1);
if(rand.nextInt(15) != 0)
{
i1 = 0;
}
for(int j1 = 0; j1 < i1; j1++)
{
double d = i * 16 + rand.nextInt(16);
double d1 = rand.nextInt(rand.nextInt(120) + 8);
double d2 = j * 16 + rand.nextInt(16);
int k1 = 1;
if(rand.nextInt(4) == 0)
{
func_870_a(k, l, abyte0, d, d1, d2);
k1 += rand.nextInt(4);
}
for(int l1 = 0; l1 < k1; l1++)
{
float f = rand.nextFloat() * 3.141593F * 2.0F;
float f1 = ((rand.nextFloat() - 0.5F) * 2.0F) / 8F;
float f2 = rand.nextFloat() * 2.0F + rand.nextFloat();
releaseEntitySkin(k, l, abyte0, d, d1, d2, f2, f, f1, 0, 0, 1.0D);
}
}
}
}
TeleporterNamehere- Code:
package net.minecraft.src;
import java.util.Random;
public class TeleporterNamehere extends Teleporter
{
public TeleporterNamehere()
{
field_4232_a = new Random();
}
public void func_4107_a(World world, Entity entity)
{
if(func_4106_b(world, entity))
{
return;
} else
{
func_4108_c(world, entity);
func_4106_b(world, entity);
return;
}
}
public boolean func_4106_b(World world, Entity entity)
{
char c = '\200';
double d = -1D;
int i = 0;
int j = 0;
int k = 0;
int l = MathHelper.floor_double(entity.posX);
int i1 = MathHelper.floor_double(entity.posZ);
for(int j1 = l - c; j1 <= l + c; j1++)
{
double d1 = ((double)j1 + 0.5D) - entity.posX;
for(int j2 = i1 - c; j2 <= i1 + c; j2++)
{
double d3 = ((double)j2 + 0.5D) - entity.posZ;
for(int k2 = 127; k2 >= 0; k2--)
{
if(world.getBlockId(j1, k2, j2) != mod_Namehere.NameherePortal.blockID)
{
continue;
}
for(; world.getBlockId(j1, k2 - 1, j2) == mod_Namehere.NameherePortal.blockID; k2--) { }
double d5 = ((double)k2 + 0.5D) - entity.posY;
double d7 = d1 * d1 + d5 * d5 + d3 * d3;
if(d < 0.0D || d7 < d)
{
d = d7;
i = j1;
j = k2;
k = j2;
}
}
}
}
if(d >= 0.0D)
{
int k1 = i;
int l1 = j;
int i2 = k;
double d2 = (double)k1 + 0.5D;
double d4 = (double)l1 + 0.5D;
double d6 = (double)i2 + 0.5D;
if(world.getBlockId(k1 - 1, l1, i2) == mod_Namehere.NameherePortal.blockID)
{
d2 -= 0.5D;
}
if(world.getBlockId(k1 + 1, l1, i2) == mod_Namehere.NameherePortal.blockID)
{
d2 += 0.5D;
}
if(world.getBlockId(k1, l1, i2 - 1) == mod_Namehere.NameherePortal.blockID)
{
d6 -= 0.5D;
}
if(world.getBlockId(k1, l1, i2 + 1) == mod_Namehere.NameherePortal.blockID)
{
d6 += 0.5D;
}
entity.setLocationAndAngles(d2, d4, d6, entity.rotationYaw, 0.0F);
entity.motionX = entity.motionY = entity.motionZ = 0.0D;
return true;
} else
{
return false;
}
}
public boolean func_4108_c(World world, Entity entity)
{
byte byte0 = 16;
double d = -1D;
int i = MathHelper.floor_double(entity.posX);
int j = MathHelper.floor_double(entity.posY);
int k = MathHelper.floor_double(entity.posZ);
int l = i;
int i1 = j;
int j1 = k;
int k1 = 0;
int l1 = field_4232_a.nextInt(4);
for(int i2 = i - byte0; i2 <= i + byte0; i2++)
{
double d1 = ((double)i2 + 0.5D) - entity.posX;
for(int j3 = k - byte0; j3 <= k + byte0; j3++)
{
double d3 = ((double)j3 + 0.5D) - entity.posZ;
for(int k4 = 127; k4 >= 0; k4--)
{
if(!world.isAirBlock(i2, k4, j3))
{
continue;
}
for(; k4 > 0 && world.isAirBlock(i2, k4 - 1, j3); k4--) { }
label0:
for(int k5 = l1; k5 < l1 + 4; k5++)
{
int l6 = k5 % 2;
int i8 = 1 - l6;
if(k5 % 4 >= 2)
{
l6 = -l6;
i8 = -i8;
}
for(int j9 = 0; j9 < 3; j9++)
{
for(int k10 = 0; k10 < 4; k10++)
{
for(int l11 = -1; l11 < 4; l11++)
{
int j12 = i2 + (k10 - 1) * l6 + j9 * i8;
int l12 = k4 + l11;
int j13 = (j3 + (k10 - 1) * i8) - j9 * l6;
if(l11 < 0 && !world.getBlockMaterial(j12, l12, j13).isSolid() || l11 >= 0 && !world.isAirBlock(j12, l12, j13))
{
break label0;
}
}
}
}
double d5 = ((double)k4 + 0.5D) - entity.posY;
double d7 = d1 * d1 + d5 * d5 + d3 * d3;
if(d < 0.0D || d7 < d)
{
d = d7;
l = i2;
i1 = k4;
j1 = j3;
k1 = k5 % 4;
}
}
}
}
}
if(d < 0.0D)
{
for(int j2 = i - byte0; j2 <= i + byte0; j2++)
{
double d2 = ((double)j2 + 0.5D) - entity.posX;
for(int k3 = k - byte0; k3 <= k + byte0; k3++)
{
double d4 = ((double)k3 + 0.5D) - entity.posZ;
for(int l4 = 127; l4 >= 0; l4--)
{
if(!world.isAirBlock(j2, l4, k3))
{
continue;
}
for(; world.isAirBlock(j2, l4 - 1, k3); l4--) { }
label1:
for(int l5 = l1; l5 < l1 + 2; l5++)
{
int i7 = l5 % 2;
int j8 = 1 - i7;
for(int k9 = 0; k9 < 4; k9++)
{
for(int l10 = -1; l10 < 4; l10++)
{
int i12 = j2 + (k9 - 1) * i7;
int k12 = l4 + l10;
int i13 = k3 + (k9 - 1) * j8;
if(l10 < 0 && !world.getBlockMaterial(i12, k12, i13).isSolid() || l10 >= 0 && !world.isAirBlock(i12, k12, i13))
{
break label1;
}
}
}
double d6 = ((double)l4 + 0.5D) - entity.posY;
double d8 = d2 * d2 + d6 * d6 + d4 * d4;
if(d < 0.0D || d8 < d)
{
d = d8;
l = j2;
i1 = l4;
j1 = k3;
k1 = l5 % 2;
}
}
}
}
}
}
int k2 = k1;
int l2 = l;
int i3 = i1;
int l3 = j1;
int i4 = k2 % 2;
int j4 = 1 - i4;
if(k2 % 4 >= 2)
{
i4 = -i4;
j4 = -j4;
}
if(d < 0.0D)
{
if(i1 < 70)
{
i1 = 70;
}
if(i1 > 118)
{
i1 = 118;
}
i3 = i1;
for(int i5 = -1; i5 <= 1; i5++)
{
for(int i6 = 1; i6 < 3; i6++)
{
for(int j7 = -1; j7 < 3; j7++)
{
int k8 = l2 + (i6 - 1) * i4 + i5 * j4;
int l9 = i3 + j7;
int i11 = (l3 + (i6 - 1) * j4) - i5 * i4;
boolean flag = j7 < 0;
world.setBlockWithNotify(k8, l9, i11, flag ? Block.dirt.blockID : 0);
}
}
}
}
for(int j5 = 0; j5 < 4; j5++)
{
world.editingBlocks = true;
for(int j6 = 0; j6 < 4; j6++)
{
for(int k7 = -1; k7 < 4; k7++)
{
int l8 = l2 + (j6 - 1) * i4;
int i10 = i3 + k7;
int j11 = l3 + (j6 - 1) * j4;
boolean flag1 = j6 == 0 || j6 == 3 || k7 == -1 || k7 == 3;
world.setBlockWithNotify(l8, i10, j11, flag1 ? Block.dirt.blockID : mod_Namehere.NameherePortal.blockID);
}
}
world.editingBlocks = false;
for(int k6 = 0; k6 < 4; k6++)
{
for(int l7 = -1; l7 < 4; l7++)
{
int i9 = l2 + (k6 - 1) * i4;
int j10 = i3 + l7;
int k11 = l3 + (k6 - 1) * j4;
world.notifyBlocksOfNeighborChange(i9, j10, k11, world.getBlockId(i9, j10, k11));
}
}
}
return true;
}
private Random field_4232_a;
}
WorldGenTreesNamehere- Code:
package net.minecraft.src;
import java.util.Random;
public class WorldGenTreesNamehere extends WorldGenerator
{
public WorldGenTreesNamehere()
{
}
public boolean generate(World world, Random random, int i, int j, int k)
{
int l = random.nextInt(3) + 4;
boolean flag = true;
if(j < 1 || j + l + 1 > 128)
{
return false;
}
for(int i1 = j; i1 <= j + 1 + l; i1++)
{
byte byte0 = 1;
if(i1 == j)
{
byte0 = 0;
}
if(i1 >= (j + 1 + l) - 2)
{
byte0 = 2;
}
for(int i2 = i - byte0; i2 <= i + byte0 && flag; i2++)
{
for(int l2 = k - byte0; l2 <= k + byte0 && flag; l2++)
{
if(i1 >= 0 && i1 < 128)
{
int j3 = world.getBlockId(i2, i1, l2);
if(j3 != 0 && j3 != Block.leaves.blockID)
{
flag = false;
}
} else
{
flag = false;
}
}
}
}
if(!flag)
{
return false;
}
int j1 = world.getBlockId(i, j - 1, k);
if(j1 != mod_Namehere.NamehereGrass.blockID && j1 != mod_Namehere.NamehereDirt.blockID || j >= 128 - l - 1)
{
return false;
}
world.setBlock(i, j - 1, k, mod_Namehere.NamehereDirt.blockID);
for(int k1 = (j - 3) + l; k1 <= j + l; k1++)
{
int j2 = k1 - (j + l);
int i3 = 1 - j2 / 2;
for(int k3 = i - i3; k3 <= i + i3; k3++)
{
int l3 = k3 - i;
for(int i4 = k - i3; i4 <= k + i3; i4++)
{
int j4 = i4 - k;
if((Math.abs(l3) != i3 || Math.abs(j4) != i3 || random.nextInt(2) != 0 && j2 != 0) && !Block.opaqueCubeLookup[world.getBlockId(k3, k1, i4)])
{
world.setBlock(k3, k1, i4, Block.leaves.blockID);
}
}
}
}
for(int l1 = 0; l1 < l; l1++)
{
int k2 = world.getBlockId(i, j + l1, k);
if(k2 == 0 || k2 == Block.leaves.blockID)
{
world.setBlock(i, j + l1, k, Block.wood.blockID);
}
}
return true;
}
}
WorldProviderNamehere- Code:
package net.minecraft.src;
public class WorldProviderNamehere extends WorldProvider
{
public WorldProviderNamehere()
{
}
public void registerWorldChunkManager()
{
worldChunkMgr = new WorldChunkManagerHell(BiomeGenBase.sky, 0.5D, 0.0D);
worldType = 1001;
}
public IChunkProvider getChunkProvider()
{
return new ChunkProviderNamehere(worldObj, worldObj.getRandomSeed());
}
public float calculateCelestialAngle(long l, float f)
{
return 0.0F;
}
public float[] calcSunriseSunsetColors(float f, float f1)
{
return null;
}
public Vec3D func_4096_a(float f, float f1)
{
int i = 0x8080a0;
float f2 = MathHelper.cos(f * 3.141593F * 2.0F) * 2.0F + 0.5F;
if(f2 < 0.0F)
{
f2 = 0.0F;
}
if(f2 > 1.0F)
{
f2 = 1.0F;
}
float f3 = (float)(i >> 16 & 0xff) / 255F;
float f4 = (float)(i >> 8 & 0xff) / 255F;
float f5 = (float)(i & 0xff) / 255F;
f3 *= f2 * 0.94F + 0.06F;
f4 *= f2 * 0.94F + 0.06F;
f5 *= f2 * 0.91F + 0.09F;
return Vec3D.createVector(f3, f4, f5);
}
public boolean func_28112_c()
{
return false;
}
public float getCloudHeight()
{
return 10F;
}
public boolean canCoordinateBeSpawn(int i, int j)
{
int k = worldObj.getFirstUncoveredBlock(i, j);
if(k == 0)
{
return false;
} else
{
return Block.blocksList[k].blockMaterial.getIsSolid();
}
}
public boolean canRespawnHere()
{
return false;
}
}
No help will be given for quite a long time as this is really advanced stuff. Do not attempt this unless you know how it works.
Last edited by Strengthowns on Wed Oct 05, 2011 11:02 am; edited 3 times in total
Re: [1.7.3] New Dimension (outdated code)
New Dimension
Note: You will need a thing called fernflower.jar for this to work. You can get it here. Put it in runtime/bin along with the other .jar's. Then put ShockahPI in your normal jar where you put modloader and decompile.- Spoiler:
- mod_Namehere
- Code:
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- Code:
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- Code:
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- Code:
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- Code:
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- Code:
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- Code:
package net.minecraft.src;
import java.util.Random;
public class ChunkProviderNamehere
implements IChunkProvider
{
public ChunkProviderNamehere(World world, long l)
{
field_28079_r = new double[256];
field_28078_s = new double[256];
field_28077_t = new double[256];
field_28076_u = new MapGenCavesNamehere();
field_28088_i = new int[32][32];
field_28081_p = world;
field_28087_j = new Random(l);
field_28086_k = new NoiseGeneratorOctaves(field_28087_j, 16);
field_28085_l = new NoiseGeneratorOctaves(field_28087_j, 16);
field_28084_m = new NoiseGeneratorOctaves(field_28087_j, 8);
field_28083_n = new NoiseGeneratorOctaves(field_28087_j, 4);
field_28082_o = new NoiseGeneratorOctaves(field_28087_j, 4);
field_28096_a = new NoiseGeneratorOctaves(field_28087_j, 10);
field_28095_b = new NoiseGeneratorOctaves(field_28087_j, 16);
field_28094_c = new NoiseGeneratorOctaves(field_28087_j, 8);
}
public void func_28071_a(int i, int j, byte abyte0[], BiomeGenBase abiomegenbase[], double ad[])
{
byte byte0 = 2;
int k = byte0 + 1;
byte byte1 = 33;
int l = byte0 + 1;
field_28080_q = func_28073_a(field_28080_q, i * byte0, 0, j * byte0, k, byte1, l);
for(int i1 = 0; i1 < byte0; i1++)
{
for(int j1 = 0; j1 < byte0; j1++)
{
for(int k1 = 0; k1 < 32; k1++)
{
double d = 0.25D;
double d1 = field_28080_q[((i1 + 0) * l + (j1 + 0)) * byte1 + (k1 + 0)];
double d2 = field_28080_q[((i1 + 0) * l + (j1 + 1)) * byte1 + (k1 + 0)];
double d3 = field_28080_q[((i1 + 1) * l + (j1 + 0)) * byte1 + (k1 + 0)];
double d4 = field_28080_q[((i1 + 1) * l + (j1 + 1)) * byte1 + (k1 + 0)];
double d5 = (field_28080_q[((i1 + 0) * l + (j1 + 0)) * byte1 + (k1 + 1)] - d1) * d;
double d6 = (field_28080_q[((i1 + 0) * l + (j1 + 1)) * byte1 + (k1 + 1)] - d2) * d;
double d7 = (field_28080_q[((i1 + 1) * l + (j1 + 0)) * byte1 + (k1 + 1)] - d3) * d;
double d8 = (field_28080_q[((i1 + 1) * l + (j1 + 1)) * byte1 + (k1 + 1)] - d4) * d;
for(int l1 = 0; l1 < 4; l1++)
{
double d9 = 0.125D;
double d10 = d1;
double d11 = d2;
double d12 = (d3 - d1) * d9;
double d13 = (d4 - d2) * d9;
for(int i2 = 0; i2 < 8; i2++)
{
int j2 = i2 + i1 * 8 << 11 | 0 + j1 * 8 << 7 | k1 * 4 + l1;
char c = '\200';
double d14 = 0.125D;
double d15 = d10;
double d16 = (d11 - d10) * d14;
for(int k2 = 0; k2 < 8; k2++)
{
int l2 = 0;
if(d15 > 0.0D)
{
l2 = mod_Namehere.NamehereStone.blockID;
}
abyte0[j2] = (byte)l2;
j2 += c;
d15 += d16;
}
d10 += d12;
d11 += d13;
}
d1 += d5;
d2 += d6;
d3 += d7;
d4 += d8;
}
}
}
}
}
public void func_28072_a(int i, int j, byte abyte0[], BiomeGenBase abiomegenbase[])
{
double d = 0.03125D;
field_28079_r = field_28083_n.generateNoiseOctaves(field_28079_r, i * 16, j * 16, 0.0D, 16, 16, 1, d, d, 1.0D);
field_28078_s = field_28083_n.generateNoiseOctaves(field_28078_s, i * 16, 109.0134D, j * 16, 16, 1, 16, d, 1.0D, d);
field_28077_t = field_28082_o.generateNoiseOctaves(field_28077_t, i * 16, j * 16, 0.0D, 16, 16, 1, d * 2D, d * 2D, d * 2D);
for(int k = 0; k < 16; k++)
{
for(int l = 0; l < 16; l++)
{
BiomeGenBase biomegenbase = abiomegenbase[k + l * 16];
int i1 = (int)(field_28077_t[k + l * 16] / 3D + 3D + field_28087_j.nextDouble() * 0.25D);
int j1 = -1;
byte byte0 = (byte)mod_Namehere.NamehereGrass.blockID;
byte byte1 = (byte)mod_Namehere.NamehereDirt.blockID;
for(int k1 = 127; k1 >= 0; k1--)
{
int l1 = (l * 16 + k) * 128 + k1;
byte byte2 = abyte0[l1];
if(byte2 == 0)
{
j1 = -1;
continue;
}
if(byte2 != (byte)mod_Namehere.NamehereStone.blockID)
{
continue;
}
if(j1 == -1)
{
if(i1 <= 0)
{
byte0 = 0;
byte1 = (byte)mod_Namehere.NamehereStone.blockID;
}
j1 = i1;
if(k1 >= 0)
{
abyte0[l1] = byte0;
} else
{
abyte0[l1] = byte1;
}
continue;
}
if(j1 <= 0)
{
continue;
}
j1--;
abyte0[l1] = byte1;
if(j1 == 0 && byte1 == Block.sand.blockID)
{
j1 = field_28087_j.nextInt(4);
byte1 = (byte)Block.sandStone.blockID;
}
}
}
}
}
public Chunk prepareChunk(int i, int j)
{
return provideChunk(i, j);
}
public Chunk provideChunk(int i, int j)
{
field_28087_j.setSeed((long)i * 0x4f9939f508L + (long)j * 0x1ef1565bd5L);
byte abyte0[] = new byte[32768];
Chunk chunk = new Chunk(field_28081_p, abyte0, i, j);
field_28075_v = field_28081_p.getWorldChunkManager().loadBlockGeneratorData(field_28075_v, i * 16, j * 16, 16, 16);
double ad[] = field_28081_p.getWorldChunkManager().temperature;
func_28071_a(i, j, abyte0, field_28075_v, ad);
func_28072_a(i, j, abyte0, field_28075_v);
field_28076_u.func_867_a(this, field_28081_p, i, j, abyte0);
chunk.func_1024_c();
return chunk;
}
private double[] func_28073_a(double ad[], int i, int j, int k, int l, int i1, int j1)
{
if(ad == null)
{
ad = new double[l * i1 * j1];
}
double d = 684.41200000000003D;
double d1 = 684.41200000000003D;
double ad1[] = field_28081_p.getWorldChunkManager().temperature;
double ad2[] = field_28081_p.getWorldChunkManager().humidity;
field_28090_g = field_28096_a.func_4109_a(field_28090_g, i, k, l, j1, 1.121D, 1.121D, 0.5D);
field_28089_h = field_28095_b.func_4109_a(field_28089_h, i, k, l, j1, 200D, 200D, 0.5D);
d *= 2D;
field_28093_d = field_28084_m.generateNoiseOctaves(field_28093_d, i, j, k, l, i1, j1, d / 80D, d1 / 160D, d / 80D);
field_28092_e = field_28086_k.generateNoiseOctaves(field_28092_e, i, j, k, l, i1, j1, d, d1, d);
field_28091_f = field_28085_l.generateNoiseOctaves(field_28091_f, i, j, k, l, i1, j1, d, d1, d);
int k1 = 0;
int l1 = 0;
int i2 = 16 / l;
for(int j2 = 0; j2 < l; j2++)
{
int k2 = j2 * i2 + i2 / 2;
for(int l2 = 0; l2 < j1; l2++)
{
int i3 = l2 * i2 + i2 / 2;
double d2 = ad1[k2 * 16 + i3];
double d3 = ad2[k2 * 16 + i3] * d2;
double d4 = 1.0D - d3;
d4 *= d4;
d4 *= d4;
d4 = 1.0D - d4;
double d5 = (field_28090_g[l1] + 256D) / 512D;
d5 *= d4;
if(d5 > 1.0D)
{
d5 = 1.0D;
}
double d6 = field_28089_h[l1] / 8000D;
if(d6 < 0.0D)
{
d6 = -d6 * 0.29999999999999999D;
}
d6 = d6 * 3D - 2D;
if(d6 > 1.0D)
{
d6 = 1.0D;
}
d6 /= 8D;
d6 = 0.0D;
if(d5 < 0.0D)
{
d5 = 0.0D;
}
d5 += 0.5D;
d6 = (d6 * (double)i1) / 16D;
l1++;
double d7 = (double)i1 / 2D;
for(int j3 = 0; j3 < i1; j3++)
{
double d8 = 0.0D;
double d9 = (((double)j3 - d7) * 8D) / d5;
if(d9 < 0.0D)
{
d9 *= -1D;
}
double d10 = field_28092_e[k1] / 512D;
double d11 = field_28091_f[k1] / 512D;
double d12 = (field_28093_d[k1] / 10D + 1.0D) / 2D;
if(d12 < 0.0D)
{
d8 = d10;
} else
if(d12 > 1.0D)
{
d8 = d11;
} else
{
d8 = d10 + (d11 - d10) * d12;
}
d8 -= 8D;
int k3 = 32;
if(j3 > i1 - k3)
{
double d13 = (float)(j3 - (i1 - k3)) / ((float)k3 - 1.0F);
d8 = d8 * (1.0D - d13) + -30D * d13;
}
k3 = 8;
if(j3 < k3)
{
double d14 = (float)(k3 - j3) / ((float)k3 - 1.0F);
d8 = d8 * (1.0D - d14) + -30D * d14;
}
ad[k1] = d8;
k1++;
}
}
}
return ad;
}
public boolean chunkExists(int i, int j)
{
return true;
}
public void populate(IChunkProvider ichunkprovider, int i, int j)
{
BlockSand.fallInstantly = true;
int k = i * 16;
int l = j * 16;
BiomeGenBase biomegenbase = field_28081_p.getWorldChunkManager().getBiomeGenAt(k + 16, l + 16);
field_28087_j.setSeed(field_28081_p.getRandomSeed());
long l1 = (field_28087_j.nextLong() / 2L) * 2L + 1L;
long l2 = (field_28087_j.nextLong() / 2L) * 2L + 1L;
field_28087_j.setSeed((long)i * l1 + (long)j * l2 ^ field_28081_p.getRandomSeed());
double d = 0.25D;
if(field_28087_j.nextInt(4) == 0)
{
int i1 = k + field_28087_j.nextInt(16) + 8;
int l4 = field_28087_j.nextInt(128);
int i8 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenLakes(Block.waterStill.blockID)).generate(field_28081_p, field_28087_j, i1, l4, i8);
}
if(field_28087_j.nextInt(8) == 0)
{
int j1 = k + field_28087_j.nextInt(16) + 8;
int i5 = field_28087_j.nextInt(field_28087_j.nextInt(120) + 8);
int j8 = l + field_28087_j.nextInt(16) + 8;
if(i5 < 64 || field_28087_j.nextInt(10) == 0)
{
(new WorldGenLakes(Block.lavaStill.blockID)).generate(field_28081_p, field_28087_j, j1, i5, j8);
}
}
for(int k1 = 0; k1 < 8; k1++)
{
int j5 = k + field_28087_j.nextInt(16) + 8;
int k8 = field_28087_j.nextInt(128);
int i13 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenDungeons()).generate(field_28081_p, field_28087_j, j5, k8, i13);
}
for(int i2 = 0; i2 < 10; i2++)
{
int k5 = k + field_28087_j.nextInt(16);
int l8 = field_28087_j.nextInt(128);
int j13 = l + field_28087_j.nextInt(16);
(new WorldGenClay(32)).generate(field_28081_p, field_28087_j, k5, l8, j13);
}
for(int j2 = 0; j2 < 20; j2++)
{
int l5 = k + field_28087_j.nextInt(16);
int i9 = field_28087_j.nextInt(128);
int k13 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.dirt.blockID, 32)).generate(field_28081_p, field_28087_j, l5, i9, k13);
}
for(int k2 = 0; k2 < 10; k2++)
{
int i6 = k + field_28087_j.nextInt(16);
int j9 = field_28087_j.nextInt(128);
int l13 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.gravel.blockID, 32)).generate(field_28081_p, field_28087_j, i6, j9, l13);
}
for(int i3 = 0; i3 < 20; i3++)
{
int j6 = k + field_28087_j.nextInt(16);
int k9 = field_28087_j.nextInt(128);
int i14 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.oreCoal.blockID, 16)).generate(field_28081_p, field_28087_j, j6, k9, i14);
}
for(int j3 = 0; j3 < 20; j3++)
{
int k6 = k + field_28087_j.nextInt(16);
int l9 = field_28087_j.nextInt(64);
int j14 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.oreIron.blockID, 8)).generate(field_28081_p, field_28087_j, k6, l9, j14);
}
for(int k3 = 0; k3 < 2; k3++)
{
int l6 = k + field_28087_j.nextInt(16);
int i10 = field_28087_j.nextInt(32);
int k14 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.oreGold.blockID, 8)).generate(field_28081_p, field_28087_j, l6, i10, k14);
}
for(int l3 = 0; l3 < 8; l3++)
{
int i7 = k + field_28087_j.nextInt(16);
int j10 = field_28087_j.nextInt(16);
int l14 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.oreRedstone.blockID, 7)).generate(field_28081_p, field_28087_j, i7, j10, l14);
}
for(int i4 = 0; i4 < 1; i4++)
{
int j7 = k + field_28087_j.nextInt(16);
int k10 = field_28087_j.nextInt(16);
int i15 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.oreDiamond.blockID, 7)).generate(field_28081_p, field_28087_j, j7, k10, i15);
}
for(int j4 = 0; j4 < 1; j4++)
{
int k7 = k + field_28087_j.nextInt(16);
int l10 = field_28087_j.nextInt(16) + field_28087_j.nextInt(16);
int j15 = l + field_28087_j.nextInt(16);
(new WorldGenMinable(Block.oreLapis.blockID, 6)).generate(field_28081_p, field_28087_j, k7, l10, j15);
}
d = 0.5D;
int k4 = (int)((field_28094_c.func_806_a((double)k * d, (double)l * d) / 8D + field_28087_j.nextDouble() * 4D + 4D) / 3D);
int l7 = 0;
if(field_28087_j.nextInt(10) == 0)
{
l7++;
}
if(biomegenbase == BiomeGenBase.forest)
{
l7 += k4 + 5;
}
if(biomegenbase == BiomeGenBase.rainforest)
{
l7 += k4 + 5;
}
if(biomegenbase == BiomeGenBase.seasonalForest)
{
//l7 += k4 + 2;
l7 += k4 + 5;
}
if(biomegenbase == BiomeGenBase.taiga)
{
l7 += k4 + 5;
}
if(biomegenbase == BiomeGenBase.desert)
{
//l7 -= 20;
l7 += k4 + 5;
}
if(biomegenbase == BiomeGenBase.tundra)
{
//l7 -= 20;
l7 += k4 + 5;
}
if(biomegenbase == BiomeGenBase.plains)
{
//l7 -= 20;
l7 += k4 + 5;
}
for(int i11 = 0; i11 < l7; i11++)
{
int k15 = k + field_28087_j.nextInt(16) + 8;
int j18 = l + field_28087_j.nextInt(16) + 8;
WorldGenerator worldgenerator = biomegenbase.getRandomWorldGenForTrees(field_28087_j);
worldgenerator.func_517_a(1.0D, 1.0D, 1.0D);
worldgenerator.generate(field_28081_p, field_28087_j, k15, field_28081_p.getHeightValue(k15, j18), j18);
}
for(int i11 = 0; i11 < l7; i11++){
int k15 = k + field_28087_j.nextInt(16) + 8;
int j18 = l + field_28087_j.nextInt(16) + 8;
WorldGenTreesNamehere treeGen = new WorldGenTreesNamehere();
treeGen.generate(field_28081_p, field_28087_j, k15, field_28081_p.getHeightValue(k15, j18), j18);
}
for(int j11 = 0; j11 < 2; j11++)
{
int l15 = k + field_28087_j.nextInt(16) + 8;
int k18 = field_28087_j.nextInt(128);
int i21 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenFlowers(Block.plantYellow.blockID)).generate(field_28081_p, field_28087_j, l15, k18, i21);
}
if(field_28087_j.nextInt(2) == 0)
{
int k11 = k + field_28087_j.nextInt(16) + 8;
int i16 = field_28087_j.nextInt(128);
int l18 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenFlowers(Block.plantRed.blockID)).generate(field_28081_p, field_28087_j, k11, i16, l18);
}
if(field_28087_j.nextInt(4) == 0)
{
int l11 = k + field_28087_j.nextInt(16) + 8;
int j16 = field_28087_j.nextInt(128);
int i19 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(field_28081_p, field_28087_j, l11, j16, i19);
}
if(field_28087_j.nextInt(8) == 0)
{
int i12 = k + field_28087_j.nextInt(16) + 8;
int k16 = field_28087_j.nextInt(128);
int j19 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenFlowers(Block.mushroomRed.blockID)).generate(field_28081_p, field_28087_j, i12, k16, j19);
}
for(int j12 = 0; j12 < 10; j12++)
{
int l16 = k + field_28087_j.nextInt(16) + 8;
int k19 = field_28087_j.nextInt(128);
int j21 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenReed()).generate(field_28081_p, field_28087_j, l16, k19, j21);
}
if(field_28087_j.nextInt(32) == 0)
{
int k12 = k + field_28087_j.nextInt(16) + 8;
int i17 = field_28087_j.nextInt(128);
int l19 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenPumpkin()).generate(field_28081_p, field_28087_j, k12, i17, l19);
}
int l12 = 0;
if(biomegenbase == BiomeGenBase.desert)
{
l12 += 10;
}
for(int j17 = 0; j17 < l12; j17++)
{
int i20 = k + field_28087_j.nextInt(16) + 8;
int k21 = field_28087_j.nextInt(128);
int k22 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenCactus()).generate(field_28081_p, field_28087_j, i20, k21, k22);
}
for(int k17 = 0; k17 < 50; k17++)
{
int j20 = k + field_28087_j.nextInt(16) + 8;
int l21 = field_28087_j.nextInt(field_28087_j.nextInt(120) + 8);
int l22 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenLiquids(Block.waterMoving.blockID)).generate(field_28081_p, field_28087_j, j20, l21, l22);
}
for(int l17 = 0; l17 < 20; l17++)
{
int k20 = k + field_28087_j.nextInt(16) + 8;
int i22 = field_28087_j.nextInt(field_28087_j.nextInt(field_28087_j.nextInt(112) + 8) + 8);
int i23 = l + field_28087_j.nextInt(16) + 8;
(new WorldGenLiquids(Block.lavaMoving.blockID)).generate(field_28081_p, field_28087_j, k20, i22, i23);
}
field_28074_w = field_28081_p.getWorldChunkManager().getTemperatures(field_28074_w, k + 8, l + 8, 16, 16);
for(int i18 = k + 8; i18 < k + 8 + 16; i18++)
{
for(int l20 = l + 8; l20 < l + 8 + 16; l20++)
{
int j22 = i18 - (k + 8);
int j23 = l20 - (l + 8);
int k23 = field_28081_p.findTopSolidBlock(i18, l20);
double d1 = field_28074_w[j22 * 16 + j23] - ((double)(k23 - 64) / 64D) * 0.29999999999999999D;
if(d1 < 0.5D && k23 > 0 && k23 < 128 && field_28081_p.isAirBlock(i18, k23, l20) && field_28081_p.getBlockMaterial(i18, k23 - 1, l20).getIsSolid() && field_28081_p.getBlockMaterial(i18, k23 - 1, l20) != Material.ice)
{
field_28081_p.setBlockWithNotify(i18, k23, l20, Block.snow.blockID);
}
}
}
BlockSand.fallInstantly = false;
}
public boolean saveChunks(boolean flag, IProgressUpdate iprogressupdate)
{
return true;
}
public boolean unload100OldestChunks()
{
return false;
}
public boolean canSave()
{
return true;
}
public String makeString()
{
return "RandomLevelSource";
}
private Random field_28087_j;
private NoiseGeneratorOctaves field_28086_k;
private NoiseGeneratorOctaves field_28085_l;
private NoiseGeneratorOctaves field_28084_m;
private NoiseGeneratorOctaves field_28083_n;
private NoiseGeneratorOctaves field_28082_o;
public NoiseGeneratorOctaves field_28096_a;
public NoiseGeneratorOctaves field_28095_b;
public NoiseGeneratorOctaves field_28094_c;
private World field_28081_p;
private double field_28080_q[];
private double field_28079_r[];
private double field_28078_s[];
private double field_28077_t[];
private MapGenBase field_28076_u;
private BiomeGenBase field_28075_v[];
double field_28093_d[];
double field_28092_e[];
double field_28091_f[];
double field_28090_g[];
double field_28089_h[];
int field_28088_i[][];
private double field_28074_w[];
}
Re: [1.7.3] New Dimension (outdated code)
Can you update?
Also make a way were u only use modloader
Also make a way were u only use modloader
austin56101- Moderator
- Posts : 85
Join date : 2011-10-22
Age : 28
Location : Cali!
Similar topics
» [Unanswered] Dimension Portal/Simple Dimension
» [Unanswered] Making New Minecraft Dimension
» [answered]What is wrong with my code?
» [Unanswered] sword code
» [Answered] Armor code gives error
» [Unanswered] Making New Minecraft Dimension
» [answered]What is wrong with my code?
» [Unanswered] sword code
» [Answered] Armor code gives error
MC Modding :: Modding :: Singleplayer Modding :: Tutorials
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum