How do you use so many images in your mods, though?
Rollback Post to RevisionRollBack
May the ores be with you.
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
Hi, I'm starting to learn some java code and i have mod with some explosion...
now my problem is explosive block which i can't display the block when i use right click mouse
can you help me what's the problem of my code?
Im using 1.3.2 version
Here's my mod file
Block File
package net.minecraft.src;
import java.util.Random;
public class SampleBomb extends Block
{
public SampleBomb(int par1, int par2)
{
super(par1, par2, Material.tnt);
this.setCreativeTab(CreativeTabs.tabRedstone);
}
/**
* Returns the block texture based on the side being looked at. Args: side
*/
//public int getBlockTextureFromSide(int par1)
//{
//return par1 == 0 ? this.blockIndexInTexture + 2 : (par1 == 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture);
//}
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (par5 > 0 && Block.blocksList[par5].canProvidePower() && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 1;
}
/**
* Called upon the block being destroyed by an explosion
*/
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
EntitySampleBomb var5 = new EntitySampleBomb(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F));
var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8;
par1World.spawnEntityInWorld(var5);
}
}
/**
* Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
*/
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
if (!par1World.isRemote)
{
if ((par5 & 1) == 1)
{
EntitySampleBomb var6 = new EntitySampleBomb(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F));
par1World.spawnEntityInWorld(var6);
par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F);
}
}
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.shiftedIndex)
{
this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
return true;
}
else
{
return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);
}
}
/**
* Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage
* and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
*/
protected ItemStack createStackedBlock(int par1)
{
return null;
}
}
public static final Block SampleBomb = (new SampleBomb (222, ModLoader.addOverride("/terrain.png", "/textures/RodneyNuclearTextures.png")).setBlockName("AtomicBomb"));
Hey I tried out your tutorial for a new dimension and I get this error:
java.lang.NullPointerException
at net.minecraft.src.World.getBlockMaterial(World.java:461)
at net.minecraft.src.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:103)
at net.minecraft.src.WorldServer.tick(WorldServer.java:117)
at net.minecraft.src.IntegratedServer.performDimensionUpdates(IntegratedServer.java:341)
at net.minecraft.src.IntegratedServer.updateTimeLightAndEntities(IntegratedServer.java:298)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:547)
at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:140)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:453)
at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)
Maybe you know what I did wrong? The codes are copy-pasted from your source code download.
I think this is a tick error or something? I'm not so sure cuz I had this error before and I resolved it quick.
Hai, your tutorials were extremely helpful, thank you for that, but I have a question, how can I create a throwable weapon? I know it has something to do with entities but I have no idea how :/
The Meaning of Life, the Universe, and Everything.
Join Date:
7/1/2012
Posts:
76
Minecraft:
Nukeannihilation
Member Details
I'm not sure if there is some sort of post that answers my same question here, but what exactly would I have to do to make a new chunk manager? Should I just copy code from an pre-existing manager in Minecraft and rename stuff, or is there some short-cut?
Is there any way that I could get my block to behave like the snow block that forms a coat on the ground (I want it to change the block underneath it and change it to a different block when it is destroyed) also, how can I get an item to place a block?
Okay I used your coding and changed it so it fit my mod and dimension, But I have too problemos.
1.My Block of time Frame wont spawn my portal when i light it.(it should)
2.If i cheat my self a portal and enter it it disconnects me from the (singleplayer)server and then crashes the game
ERROR REPORT:
Minecraft Version: 1.3.2
- Operating System: Windows XP (x86) version 5.1
- Java Version: 1.7.0_06, Oracle Corporation
- Java VM Version: Java HotSpot™ Client VM (mixed mode), Oracle Corporation
- Memory: 841027304 bytes (802 MB) / 1067057152 bytes (1017 MB) up to 1067057152 bytes (1017 MB)
- JVM Flags: 3 total; -Xincgc -Xms1024M -Xmx1024M
- ModLoader: Mods loaded: 2
ModLoader 1.3.2
mod_walle Wall-E Mod for 1.3.2
- Is Modded: Very likely
- Profiler Position: N/A (disabled)
- Player Count: 0 / 8; []
- World Test Entities: 0 total; []
- World Test Players: 1 total; [EntityPlayerMP['Player517'/179, l='Test', x=143.49, y=60.00, z=217.34]]
- World Test Chunk Stats: ServerChunkCache: 0 Drop: 0
- Type: Integrated Server
java.lang.NullPointerException
at net.minecraft.src.ChunkProviderFuture.initializeNoiseField(ChunkProviderFuture.java:356)
at net.minecraft.src.ChunkProviderFuture.generateTerrain(ChunkProviderFuture.java:105)
at net.minecraft.src.ChunkProviderFuture.provideChunk(ChunkProviderFuture.java:278)
at net.minecraft.src.ChunkProviderServer.loadChunk(ChunkProviderServer.java:104)
at net.minecraft.src.ChunkProviderServer.provideChunk(ChunkProviderServer.java:129)
at net.minecraft.src.World.getChunkFromChunkCoords(World.java:347)
at net.minecraft.src.SpawnerAnimals.getRandomSpawningPointInChunk(SpawnerAnimals.java:21)
at net.minecraft.src.SpawnerAnimals.findChunksForSpawning(SpawnerAnimals.java:90)
at net.minecraft.src.WorldServer.tick(WorldServer.java:106)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:613)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:555)
at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:148)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:464)
at net.minecraft.src.ThreadServerApplication.run(ThreadServerApplication.java:17)
--- END ERROR REPORT ad5e6d44 ----------
so heres my code.
mod_walle:
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
import java.util.List;
import java.util.jar.*;
import java.util.*;
import java.util.logging.*;
import java.util.concurrent.*;
import java.awt.datatransfer.*;
import java.awt.geom.*;
import java.util.zip.*;
import java.awt.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class mod_walle extends BaseMod {
public static final Block BlockTimePortal = (new BlockTimePortal(214).setStepSound(Block.soundWoodFootstep).setHardness(0.5F).setResistance(1F).setBlockName("BlockTimePortal"));
public static final Block BlockTime = (new BlockTime(213,ModLoader.addOverride("/terrain.png", "/Wall-E/Time Block.png")).setHardness(50.0F).setResistance(2000.0F).setBlockName("Time").setStepSound(Block.soundStoneFootstep));
public static final Block BlockCrap = (new BlockCrap(212,ModLoader.addOverride("/terrain.png", "/Wall-E/Crap.png")).setHardness(50.0F).setResistance(2000.0F).setBlockName("BlockCrap").setStepSound(Block.soundStoneFootstep));
public static final Item ItemRubber = (new ItemRubber(2012).setIconIndex(ModLoader.addOverride("/gui/items.png", "/Wall-E/Rubber.png")).setItemName("ItemRubber"));
public static final Block BlockRubberOre = (new BlockRubberOre(211,ModLoader.addOverride("/terrain.png", "/Wall-E/RubberOre.png")).setHardness(10F).setResistance(10F).setBlockName("BlockRubberOre").setStepSound(Block.soundStoneFootstep));
@Override
public String getVersion() {
return "Wall-E Mod for 1.3.2";
}
@Override
public void load() {
ModLoader.registerBlock(BlockTimePortal);
ModLoader.addName(BlockTimePortal, "Time Portal");
ModLoader.addRecipe(new ItemStack(BlockTime, 1), new Object [] {"###", "###", "###", Character.valueOf('#'),Item.pocketSundial});
ModLoader.registerBlock(BlockTime);
ModLoader.addName(BlockTime, "Block of Time!");
ModLoader.addName(BlockCrap, "Junk");
ModLoader.registerBlock(BlockCrap);
ModLoader.addName(ItemRubber, "Rubber");
ModLoader.addSmelting(BlockRubberOre.blockID, new ItemStack(ItemRubber, 1), 1.0F);
ModLoader.registerBlock(BlockRubberOre);
ModLoader.addName(BlockRubberOre, "Rubber Ore");
DimensionAPI.registerDimension(new WorldProviderFuture());
}
public void generateSurface(World world, Random rand, int y, int z){
for(int a = 0; a < 8; a++){
int i = y + rand.nextInt(16);
int j = rand.nextInt(100);
int k = z + rand.nextInt(16);
(new WorldGenMinable(mod_walle.BlockRubberOre.blockID, 20)).generate(world, rand, i, j, k);
}
}
}
MY BlockTime(the block that is supposed to be the frame)
package net.minecraft.src;
import java.util.Random;
public class BlockTime extends Block
{
public BlockTime(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
}
My BlockTimePortal(theportal)
package net.minecraft.src;
import java.util.List;
import java.util.ArrayList;
public class BlockTimePortal extends BlockPortalBase
{
//Look in BlockPortalBase.java to see the full array of hooks you can use for your portal block.
public BlockTimePortal(int i)
{
super(i, ModLoader.addOverride("/terrain.png", "/Wall-E/Time Portal.png"), Material.portal);
//Get a unique sprite index for the portal texture so that it doesn't override another
//texture.
}
public WorldProviderBase getDimension()
{
return new WorldProviderFuture();
}
public Teleporter getTeleporter()
{
return new FutureTeleporter();
}
//You can get to this dimension from the overworld (0) and Nether (-1).
//You should probably make the portal non-solid so you can step into it...
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == blockID || par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == 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 List canTeleportFromDimension()
{
ArrayList arraylist = new ArrayList();
arraylist.add(Integer.valueOf(0));//player can teleport from overworld to this dimension
arraylist.add(Integer.valueOf(-1));//player can teleport from Nether to this dimension
return arraylist;
}
/**
* Is this block (a) opaque and ( a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z
*/
public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
{
int i = 0;
int j = 0;
if (par1World.getBlockId(par2 - 1, par3, par4) == mod_walle.BlockTime.blockID || par1World.getBlockId(par2 + 1, par3, par4) == mod_walle.BlockTime.blockID)
{
i = 1;
}
if (par1World.getBlockId(par2, par3, par4 - 1) == mod_walle.BlockTime.blockID || par1World.getBlockId(par2, par3, par4 + 1) == mod_walle.BlockTime.blockID)
{
j = 1;
}
if (i == j)
{
return false;
}
if (par1World.getBlockId(par2 - i, par3, par4 - j) == 0)
{
par2 -= i;
par4 -= j;
}
for (int k = -1; k <= 2; k++)
{
for (int i1 = -1; i1 <= 3; i1++)
{
boolean flag = k == -1 || k == 2 || i1 == -1 || i1 == 3;
if ((k == -1 || k == 2) && (i1 == -1 || i1 == 3))
{
continue;
}
int k1 = par1World.getBlockId(par2 + i * k, par3 + i1, par4 + j * k);
if (flag)
{
if (k1 != mod_walle.BlockTime.blockID)
{
return false;
}
continue;
}
if (k1 != 0 && k1 != Block.fire.blockID)
{
return false;
}
}
}
par1World.editingBlocks = true;
for (int l = 0; l < 2; l++)
{
for (int j1 = 0; j1 < 3; j1++)
{
par1World.setBlockWithNotify(par2 + i * l, par3 + j1, par4 + j * l, mod_walle.BlockTimePortal.blockID);
}
}
par1World.editingBlocks = false;
return true;
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
int i = 0;
int j = 1;
if (par1World.getBlockId(par2 - 1, par3, par4) == blockID || par1World.getBlockId(par2 + 1, par3, par4) == blockID)
{
i = 1;
j = 0;
}
int k;
for (k = par3; par1World.getBlockId(par2, k - 1, par4) == blockID; k--) { }
if (par1World.getBlockId(par2, k - 1, par4) != mod_walle.BlockTime.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
int l;
for (l = 1; l < 4 && par1World.getBlockId(par2, k + l, par4) == blockID; l++) { }
if (l != 3 || par1World.getBlockId(par2, k + l, par4) != mod_walle.BlockTime.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == blockID || par1World.getBlockId(par2 + 1, par3, par4) == blockID;
boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == blockID || par1World.getBlockId(par2, par3, par4 + 1) == blockID;
if (flag && flag1)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
if ((par1World.getBlockId(par2 + i, par3, par4 + j) != mod_walle.BlockTime.blockID || par1World.getBlockId(par2 - i, par3, par4 - j) != blockID) && (par1World.getBlockId(par2 - i, par3, par4 - j) != mod_walle.BlockTime.blockID || par1World.getBlockId(par2 + i, par3, par4 + j) != blockID))
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
else
{
return;
}
}
/**
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
* coordinates. Args: blockAccess, x, y, z, side
*/
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par1IBlockAccess.getBlockId(par2, par3, par4) == blockID)
{
return false;
}
boolean flag = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != blockID;
boolean flag1 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != blockID;
boolean flag2 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != blockID;
boolean flag3 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != blockID;
boolean flag4 = flag || flag1;
boolean flag5 = flag2 || flag3;
if (flag4 && par5 == 4)
{
return true;
}
if (flag4 && par5 == 5)
{
return true;
}
if (flag5 && par5 == 2)
{
return true;
}
return flag5 && par5 == 3;
}
public boolean displayPortalOverlay()
{
return true;
}
public int getOverlayTexture()
{
return blockIndexInTexture;
}
public int getPortalDelay()
{
return 85;//default
}
public String getEnteringMessage() {
return "Traveling to The Future!";
}
public String getLeavingMessage() {
return "Returning to The Present";
}
}
My BiomeGenFuture
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class BiomeGenFuture extends BiomeGenBase
{
public static final BiomeGenBase Future = null;
protected WorldGenerator bushGen;
protected WorldGenerator sandGen;
protected WorldGenerator hematiteGen;
protected WorldGenerator meteoriteGen;
protected WorldGenerator cobaltGen;
protected WorldGenerator blazestoneGen;
public BiomeGenFuture(int par1)
{
super(par1);
this.spawnableMonsterList.clear();
this.spawnableCreatureList.clear();
// this.spawnableCreatureList.add(new SpawnListEntry(net.minecraft.src.EntitySkeletonKnight.class, 2, 1, 2));
//this.spawnableCreatureList.add(new SpawnListEntry(EntityAshCreeper.class, 5, 4, 4));
//this.spawnableCreatureList.add(new SpawnListEntry(EntitySkeletonKnight.class, 5, 4, 4));
// this.spawnableCreatureList.add(new SpawnListEntry(net.minecraft.src.EntityAshCreeper.class, 2, 3, 3));
//this.bushGen = new WorldGenForbiddenBush();
// this.sandGen = new WorldGenForbiddenSand(7, mod_ForbiddenForest.ForbiddenSand.blockID);
// this.spawnableWaterCreatureList.clear();
topBlock = (byte)mod_walle.BlockCrap.blockID;
fillerBlock = (byte)mod_walle.BlockCrap.blockID;
//biomeDecorator = new BiomeDecoratorForbidden(this);
/*
this.blazestoneGen = new WorldGenForbidden2(mod_ForbiddenForest.FirestoneOre.blockID, 8);
this.hematiteGen = new WorldGenForbidden2(mod_ForbiddenForest.HematiteOre.blockID, 8);
this.meteoriteGen = new WorldGenForbidden2(mod_ForbiddenForest.MeteoriteOre.blockID, 7);
this.cobaltGen = new WorldGenForbidden2(mod_ForbiddenForest.CobaltOre.blockID, 7);
*/
}
}
My FutureTeleporter
package net.minecraft.src;
import java.util.Random;
public class FutureTeleporter extends Teleporter
{
//The Teleporter class handles finding existing portals and generating new ones. It pinpoints
//the location to which the player should be teleported when traveling across dimensions.
private Random random;
public FutureTeleporter()
{
random = new Random();
}
public void placeInPortal(World world, Entity entity)
{
if (placeInExistingPortal(world, entity))
{
return;
}
else
{
createPortal(world, entity);
placeInExistingPortal(world, entity);
return;
}
}
public boolean placeInExistingPortal(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 = 128 - 1; k2 >= 0; k2--)
{
if (world.getBlockId(j1, k2, j2) != mod_walle.BlockTimePortal.blockID)
{
continue;
}
for (; world.getBlockId(j1, k2 - 1, j2) == mod_walle.BlockTimePortal.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_walle.BlockTimePortal.blockID)
{
d2 -= 0.5D;
}
if (world.getBlockId(k1 + 1, l1, i2) == mod_walle.BlockTimePortal.blockID)
{
d2 += 0.5D;
}
if (world.getBlockId(k1, l1, i2 - 1) == mod_walle.BlockTimePortal.blockID)
{
d6 -= 0.5D;
}
if (world.getBlockId(k1, l1, i2 + 1) == mod_walle.BlockTimePortal.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 createPortal(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 = random.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 = 128 - 1; 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 = 128 - 1; l4 >= 0; l4--)
{
if (!world.isAirBlock(j2, l4, k3))
{
continue;
}
for (; l4 > 0 && 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 > 128 - 10)
{
i1 = 128 - 10;
}
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 ? mod_walle.BlockTime.blockID : 0);
}
}
}
}
for (int j5 = 0; j5 < 4; j5++)
{
world.editingBlocks = true;
//You can add your own portal's generation here (and delete all the code up to
//"world.editingBlocks = false"). This particular portal is like a Nether portal, but with
//sandstone instead of obsidian, and obviously the Taiga portal block instead of the Nether
//one.
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 ? mod_walle.BlockCrap.blockID : mod_walle.BlockCrap.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;
}
}
My BiomeGenBase
package net.minecraft.src;
import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public abstract class BiomeGenBase
{
/** An array of all the biomes, indexed by biome id. */
public static final BiomeGenBase[] biomeList = new BiomeGenBase[256];
public static final BiomeGenBase ocean = (new BiomeGenOcean(0)).setColor(112).setBiomeName("Ocean").setMinMaxHeight(-1.0F, 0.4F);
public static final BiomeGenBase plains = (new BiomeGenPlains(1)).setColor(9286496).setBiomeName("Plains").setTemperatureRainfall(0.8F, 0.4F);
public static final BiomeGenBase desert = (new BiomeGenDesert(2)).setColor(16421912).setBiomeName("Desert").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setMinMaxHeight(0.1F, 0.2F);
public static final BiomeGenBase extremeHills = (new BiomeGenHills(3)).setColor(6316128).setBiomeName("Extreme Hills").setMinMaxHeight(0.3F, 1.5F).setTemperatureRainfall(0.2F, 0.3F);
public static final BiomeGenBase forest = (new BiomeGenForest(4)).setColor(353825).setBiomeName("Forest").func_76733_a(5159473).setTemperatureRainfall(0.7F, 0.8F);
public static final BiomeGenBase taiga = (new BiomeGenTaiga(5)).setColor(747097).setBiomeName("Taiga").func_76733_a(5159473).setEnableSnow().setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.1F, 0.4F);
public static final BiomeGenBase swampland = (new BiomeGenSwamp(6)).setColor(522674).setBiomeName("Swampland").func_76733_a(9154376).setMinMaxHeight(-0.2F, 0.1F).setTemperatureRainfall(0.8F, 0.9F);
public static final BiomeGenBase river = (new BiomeGenRiver(7)).setColor(255).setBiomeName("River").setMinMaxHeight(-0.5F, 0.0F);
public static final BiomeGenBase hell = (new BiomeGenHell(8)).setColor(16711680).setBiomeName("Hell").setDisableRain().setTemperatureRainfall(2.0F, 0.0F);
/** Is the biome used for sky world. */
public static final BiomeGenBase sky = (new BiomeGenEnd(9)).setColor(8421631).setBiomeName("Sky").setDisableRain();
public static final BiomeGenBase frozenOcean = (new BiomeGenOcean(10)).setColor(9474208).setBiomeName("FrozenOcean").setEnableSnow().setMinMaxHeight(-1.0F, 0.5F).setTemperatureRainfall(0.0F, 0.5F);
public static final BiomeGenBase frozenRiver = (new BiomeGenRiver(11)).setColor(10526975).setBiomeName("FrozenRiver").setEnableSnow().setMinMaxHeight(-0.5F, 0.0F).setTemperatureRainfall(0.0F, 0.5F);
public static final BiomeGenBase icePlains = (new BiomeGenSnow(12)).setColor(16777215).setBiomeName("Ice Plains").setEnableSnow().setTemperatureRainfall(0.0F, 0.5F);
public static final BiomeGenBase iceMountains = (new BiomeGenSnow(13)).setColor(10526880).setBiomeName("Ice Mountains").setEnableSnow().setMinMaxHeight(0.3F, 1.3F).setTemperatureRainfall(0.0F, 0.5F);
public static final BiomeGenBase mushroomIsland = (new BiomeGenMushroomIsland(14)).setColor(16711935).setBiomeName("MushroomIsland").setTemperatureRainfall(0.9F, 1.0F).setMinMaxHeight(0.2F, 1.0F);
public static final BiomeGenBase mushroomIslandShore = (new BiomeGenMushroomIsland(15)).setColor(10486015).setBiomeName("MushroomIslandShore").setTemperatureRainfall(0.9F, 1.0F).setMinMaxHeight(-1.0F, 0.1F);
public static final BiomeGenBase future = (new BiomeGenFuture(23)).setColor(16711680).setBiomeName("Future").setDisableRain().setTemperatureRainfall(2.0F, 0.0F);
/** Beach biome. */
public static final BiomeGenBase beach = (new BiomeGenBeach(16)).setColor(16440917).setBiomeName("Beach").setTemperatureRainfall(0.8F, 0.4F).setMinMaxHeight(0.0F, 0.1F);
/** Desert Hills biome. */
public static final BiomeGenBase desertHills = (new BiomeGenDesert(17)).setColor(13786898).setBiomeName("DesertHills").setDisableRain().setTemperatureRainfall(2.0F, 0.0F).setMinMaxHeight(0.3F, 0.8F);
/** Forest Hills biome. */
public static final BiomeGenBase forestHills = (new BiomeGenForest(18)).setColor(2250012).setBiomeName("ForestHills").func_76733_a(5159473).setTemperatureRainfall(0.7F, 0.8F).setMinMaxHeight(0.3F, 0.7F);
/** Taiga Hills biome. */
public static final BiomeGenBase taigaHills = (new BiomeGenTaiga(19)).setColor(1456435).setBiomeName("TaigaHills").setEnableSnow().func_76733_a(5159473).setTemperatureRainfall(0.05F, 0.8F).setMinMaxHeight(0.3F, 0.8F);
/** Extreme Hills Edge biome. */
public static final BiomeGenBase extremeHillsEdge = (new BiomeGenHills(20)).setColor(7501978).setBiomeName("Extreme Hills Edge").setMinMaxHeight(0.2F, 0.8F).setTemperatureRainfall(0.2F, 0.3F);
/** Jungle biome identifier */
public static final BiomeGenBase jungle = (new BiomeGenJungle(21)).setColor(5470985).setBiomeName("Jungle").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(0.2F, 0.4F);
public static final BiomeGenBase jungleHills = (new BiomeGenJungle(22)).setColor(2900485).setBiomeName("JungleHills").func_76733_a(5470985).setTemperatureRainfall(1.2F, 0.9F).setMinMaxHeight(1.8F, 0.5F);
public String biomeName;
public int color;
/** The block expected to be on the top of this biome */
public byte topBlock;
/** The block to fill spots in when not on the top */
public byte fillerBlock;
public int field_76754_C;
/** The minimum height of this biome. Default 0.1. */
public float minHeight;
/** The maximum height of this biome. Default 0.3. */
public float maxHeight;
/** The temperature of this biome. */
public float temperature;
/** The rainfall in this biome. */
public float rainfall;
/** Color tint applied to water depending on biome */
public int waterColorMultiplier;
/** The biome decorator. */
public BiomeDecorator theBiomeDecorator;
/**
* Holds the classes of IMobs (hostile mobs) that can be spawned in the biome.
*/
protected List spawnableMonsterList;
/**
* Holds the classes of any creature that can be spawned in the biome as friendly creature.
*/
protected List spawnableCreatureList;
/**
* Holds the classes of any aquatic creature that can be spawned in the water of the biome.
*/
protected List spawnableWaterCreatureList;
/** Set to true if snow is enabled for this biome. */
private boolean enableSnow;
/**
* Is true (default) if the biome support rain (desert and nether can't have rain)
*/
private boolean enableRain;
/** The id number to this biome, and its index in the biomeList array. */
public final int biomeID;
protected WorldGenTrees worldGeneratorTrees;
/** The big tree generator. */
protected WorldGenBigTree worldGeneratorBigTree;
protected WorldGenForest worldGeneratorForest;
protected WorldGenSwamp worldGeneratorSwamp;
protected BiomeGenBase(int par1)
{
this.topBlock = (byte)Block.grass.blockID;
this.fillerBlock = (byte)Block.dirt.blockID;
this.field_76754_C = 5169201;
this.minHeight = 0.1F;
this.maxHeight = 0.3F;
this.temperature = 0.5F;
this.rainfall = 0.5F;
this.waterColorMultiplier = 16777215;
this.spawnableMonsterList = new ArrayList();
this.spawnableCreatureList = new ArrayList();
this.spawnableWaterCreatureList = new ArrayList();
this.enableRain = true;
this.worldGeneratorTrees = new WorldGenTrees(false);
this.worldGeneratorBigTree = new WorldGenBigTree(false);
this.worldGeneratorForest = new WorldGenForest(false);
this.worldGeneratorSwamp = new WorldGenSwamp();
this.biomeID = par1;
biomeList[par1] = this;
this.theBiomeDecorator = this.createBiomeDecorator();
this.spawnableCreatureList.add(new SpawnListEntry(EntitySheep.class, 12, 4, 4));
this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 10, 4, 4));
this.spawnableCreatureList.add(new SpawnListEntry(EntityChicken.class, 10, 4, 4));
this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 8, 4, 4));
this.spawnableMonsterList.add(new SpawnListEntry(EntitySpider.class, 10, 4, 4));
this.spawnableMonsterList.add(new SpawnListEntry(EntityZombie.class, 10, 4, 4));
this.spawnableMonsterList.add(new SpawnListEntry(EntitySkeleton.class, 10, 4, 4));
this.spawnableMonsterList.add(new SpawnListEntry(EntityCreeper.class, 10, 4, 4));
this.spawnableMonsterList.add(new SpawnListEntry(EntitySlime.class, 10, 4, 4));
this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 1, 1, 4));
this.spawnableWaterCreatureList.add(new SpawnListEntry(EntitySquid.class, 10, 4, 4));
}
/**
* Allocate a new BiomeDecorator for this BiomeGenBase
*/
protected BiomeDecorator createBiomeDecorator()
{
return new BiomeDecorator(this);
}
/**
* Sets the temperature and rainfall of this biome.
*/
private BiomeGenBase setTemperatureRainfall(float par1, float par2)
{
if (par1 > 0.1F && par1 < 0.2F)
{
throw new IllegalArgumentException("Please avoid temperatures in the range 0.1 - 0.2 because of snow");
}
else
{
this.temperature = par1;
this.rainfall = par2;
return this;
}
}
/**
* Sets the minimum and maximum height of this biome. Seems to go from -2.0 to 2.0.
*/
private BiomeGenBase setMinMaxHeight(float par1, float par2)
{
this.minHeight = par1;
this.maxHeight = par2;
return this;
}
/**
* Disable the rain for the biome.
*/
private BiomeGenBase setDisableRain()
{
this.enableRain = false;
return this;
}
/**
* Gets a WorldGen appropriate for this biome.
*/
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
{
return (WorldGenerator)(par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : this.worldGeneratorTrees);
}
/**
* Gets a WorldGen appropriate for this biome.
*/
public WorldGenerator getRandomWorldGenForGrass(Random par1Random)
{
return new WorldGenTallGrass(Block.tallGrass.blockID, 1);
}
/**
* sets enableSnow to true during biome initialization. returns BiomeGenBase.
*/
protected BiomeGenBase setEnableSnow()
{
this.enableSnow = true;
return this;
}
protected BiomeGenBase setBiomeName(String par1Str)
{
this.biomeName = par1Str;
return this;
}
protected BiomeGenBase func_76733_a(int par1)
{
this.field_76754_C = par1;
return this;
}
protected BiomeGenBase setColor(int par1)
{
this.color = par1;
return this;
}
/**
* takes temperature, returns color
*/
public int getSkyColorByTemp(float par1)
{
par1 /= 3.0F;
if (par1 < -1.0F)
{
par1 = -1.0F;
}
if (par1 > 1.0F)
{
par1 = 1.0F;
}
return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
}
/**
* Returns the correspondent list of the EnumCreatureType informed.
*/
public List getSpawnableList(EnumCreatureType par1EnumCreatureType)
{
return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : null));
}
/**
* Returns true if the biome have snowfall instead a normal rain.
*/
public boolean getEnableSnow()
{
return this.enableSnow;
}
/**
* Return true if the biome supports lightning bolt spawn, either by have the bolts enabled and have rain enabled.
*/
public boolean canSpawnLightningBolt()
{
return this.enableSnow ? false : this.enableRain;
}
/**
* Checks to see if the rainfall level of the biome is extremely high
*/
public boolean isHighHumidity()
{
return this.rainfall > 0.85F;
}
/**
* returns the chance a creature has to spawn.
*/
public float getSpawningChance()
{
return 0.1F;
}
/**
* Gets an integer representation of this biome's rainfall
*/
public final int getIntRainfall()
{
return (int)(this.rainfall * 65536.0F);
}
/**
* Gets an integer representation of this biome's temperature
*/
public final int getIntTemperature()
{
return (int)(this.temperature * 65536.0F);
}
/**
* Gets a floating point representation of this biome's rainfall
*/
public final float getFloatRainfall()
{
return this.rainfall;
}
/**
* Gets a floating point representation of this biome's temperature
*/
public final float getFloatTemperature()
{
return this.temperature;
}
public void decorate(World par1World, Random par2Random, int par3, int par4)
{
this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4);
}
/**
* Provides the basic grass color based on the biome temperature and rainfall
*/
public int getBiomeGrassColor()
{
double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
return ColorizerGrass.getGrassColor(var1, var3);
}
/**
* Provides the basic foliage color based on the biome temperature and rainfall
*/
public int getBiomeFoliageColor()
{
double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
return ColorizerFoliage.getFoliageColor(var1, var3);
}
}
My WorldProviderFuture
package net.minecraft.src;
import java.util.Random;
public class WorldProviderFuture extends WorldProviderBase
{
//The WorldProvider covers all the basics of the dimension. Look in WorldProviderBase.java and
//WorldProvider.java for all the potential qualities you can assign to your dimension.
public WorldProviderFuture()
{
}
//The save file will be called DIM65 (DIM + id number).
public int getDimensionID()
{
return 65;
}
public boolean renderClouds()
{
return true;
}
public boolean renderEndSky()
{
return false;
}
public boolean renderVoidFog()
{
return true;
}
public float setMoonSize()
{
return 2.1F;
}
public float setSunSize()
{
return 1.0F;
}
public String getSunTexture()
{
return null;
}
public String getMoonTexture()
{
return null;
}
public boolean renderStars()
{
return true;
}
public boolean darkenSkyDuringRain()
{
return true;
}
public String getRespawnMessage()
{
return " Returing to the Present ";
}
//You can use an existing WorldChunkManager, or create your own. You must create your own to
//add multiple unique biomes to a dimension.
public void registerWorldChunkManager()
{
worldChunkMgr = new WorldChunkManagerHell(BiomeGenFuture.Future, 1.0F, 0.0F);
}
//This is where you define your terrain generator.
public IChunkProvider getChunkProvider()
{
return new ChunkProviderFuture(worldObj, worldObj.getSeed(), false);
}
//Note that, if you respawn in the dimension, you will end up at the coordinates of your
//overworld spawn point, not at the location of your first entrance to the dimension or
//something like that. Note also that beds don't work if you cannot respawn in the dimension.
public boolean canRespawnHere()
{
return false;
}
public float calculateCelestialAngle(long par1, float par3)
{
return 0.5F;
}
@Override
public String func_80007_l() {
// TODO Auto-generated method stub
return null;
I watched the liquid tutorial (which I think is a bit outdated now) and because of the stuff they changed you have to create a new material for your liquid, I believe. So I made my material and edited the bucket file so it can pick it up, but I crash when I start the world because it can't render the liquid because I have no texture. How do I make a new texture for the liquid correctly and/or what am I doing wrong?
@ TheInstitutions I made a dimension and I'm getting a problem with MAJOR lag spike when i get in the world. Any ideas?
mod_###
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
import java.util.List;
import java.util.jar.*;
import java.util.*;
import java.util.logging.*;
import java.util.concurrent.*;
import java.awt.datatransfer.*;
import java.awt.geom.*;
import java.util.zip.*;
import java.awt.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class mod_zephyrmod extends BaseMod
{private Map entityRenderMap = new HashMap();
/**Registers Achievements**/
public static final Block ZephyrGrass = (new ZephyrGrass(200,0).setStepSound(Block.soundGrassFootstep).setHardness(0.4F).setResistance(1F).setLightValue(2.0F).setBlockName("ZephyrGrass"));
public static final Block ZephyrDirt = (new ZephyrDirt(201,ModLoader.addOverride("/terrain.png", "/zephyrmod/zephyrdirt.png")).setHardness(0.4F).setStepSound(Block.soundGrassFootstep).setResistance(1F).setLightValue(1.5F).setBlockName("ZephyrDirt"));
public static final Block ZephyrStone = (new ZephyrStone(202,ModLoader.addOverride("/terrain.png", "/zephyrmod/zephyrstone.png")).setHardness(3.0F).setStepSound(Block.soundStoneFootstep).setResistance(2.0F).setBlockName("ZephyrStone"));
public static final Block SeriatedStone = (new SeriatedStone(203,ModLoader.addOverride("/terrain.png", "/zephyrmod/seriatedstone.png")).setHardness(4.0F).setStepSound(Block.soundStoneFootstep).setResistance(2.0F).setBlockName("SeriatedStone"));
public static final Block PlatinumOre = (new PlatinumOre(204,ModLoader.addOverride("/terrain.png", "/zephyrmod/platinumore.png")).setHardness(7.0F).setStepSound(Block.soundStoneFootstep).setLightValue(0.5F).setResistance(5.0F).setBlockName("PlatinumOre"));
public static final BlockZephyrPortal ZephyrPortal = (BlockZephyrPortal) (new BlockZephyrPortal(205).setStepSound(Block.soundWoodFootstep).setHardness(0.5F).setResistance(1F).setBlockName("ZephyrPortal"));
//Secondary Blocks
//Multiple-Side Textures
public static int grassTop;
public static int grassSide;
public static int grassBottom;
//Loads, initializes and organizes all the ModLoader functions **/
public void load()
{
ModLoader.registerBlock(ZephyrGrass);
ModLoader.registerBlock(ZephyrDirt);
ModLoader.registerBlock(ZephyrStone);
ModLoader.registerBlock(SeriatedStone);
ModLoader.registerBlock(PlatinumOre);
ModLoader.registerBlock(ZephyrPortal);
ModLoader.addName(ZephyrGrass, "Zephyr Grass");
ModLoader.addName(ZephyrDirt, "Zephyr Dirt");
ModLoader.addName(ZephyrStone, "Zephyr Stone");
ModLoader.addName(SeriatedStone, "Seriated Stone");
ModLoader.addName(PlatinumOre, "Platinum Ore");
ModLoader.addName(ZephyrPortal, "Zephyr Portal");
grassTop = ModLoader.addOverride("/terrain.png", "/zephyrmod/grassTop.png");
grassSide = ModLoader.addOverride("/terrain.png", "/zephyrmod/grassSide.png");
grassBottom = ModLoader.addOverride("/terrain.png", "/zephyrmod/grassBottom.png");
//Biome & Dimension
DimensionAPI.registerDimension(new WorldProviderZephyr());
//ModLoader.addBiome(BiomeGenBase.ForbiddenForest);
}
/** Generates structures and blocks the world. Which world they generate in are determined by there respective WorldGen files**/
public void generateSurface(World world, Random rand, int y , int z)
{
for(int a= 0; a <15; a++)
{
int randPosX = y + rand.nextInt(16);
int randPosY = rand.nextInt(3 + 200);
int randPosZ = z + rand.nextInt(16);
(new WorldGenZephyr(mod_zephyrmod.PlatinumOre.blockID, 15)).generate(world, rand, randPosX, randPosY, randPosZ);
}
/** Generates the Forbidden Tree in the Forbidden biome only **/
}
/** Returns the version of the mod**/
public String getVersion()
{
return "Zephyr Mod v.01 by gdogw1";
}
/**Defines the variable "creative inventory")**/
private static GuiScreen creativeInventory;
}
Block Portal
package net.minecraft.src;
import java.util.List;
import java.util.ArrayList;
public class BlockZephyrPortal extends BlockPortalBase
{
//Look in BlockPortalBase.java to see the full array of hooks you can use for your portal block.
public BlockZephyrPortal(int i)
{
super(i, ModLoader.addOverride("/terrain.png", "/zephyrmod/zephyrportal.png"), Material.portal);
//Get a unique sprite index for the portal texture so that it doesn't override another
//texture.
this.setCreativeTab(CreativeTabs.tabMaterials);
}
public WorldProviderBase getDimension()
{
return new WorldProviderZephyr();
}
public Teleporter getTeleporter()
{
return new ZephyrTeleporter();
}
//You can get to this dimension from the overworld (0) and Nether (-1).
//You should probably make the portal non-solid so you can step into it...
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k)
{
return null;
}
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
if (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == blockID || par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == 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 List canTeleportFromDimension()
{
ArrayList arraylist = new ArrayList();
arraylist.add(Integer.valueOf(0));//player can teleport from overworld to this dimension
arraylist.add(Integer.valueOf(-1));//player can teleport from Nether to this dimension
return arraylist;
}
/**
* Is this block (a) opaque and ( a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}
/**
* Checks to see if this location is valid to create a portal and will return True if it does. Args: world, x, y, z
*/
public boolean tryToCreatePortal(World par1World, int par2, int par3, int par4)
{
int i = 0;
int j = 0;
if (par1World.getBlockId(par2 - 1, par3, par4) == mod_zephyrmod.SeriatedStone.blockID || par1World.getBlockId(par2 + 1, par3, par4) == mod_zephyrmod.SeriatedStone.blockID)
{
i = 1;
}
if (par1World.getBlockId(par2, par3, par4 - 1) == mod_zephyrmod.SeriatedStone.blockID || par1World.getBlockId(par2, par3, par4 + 1) == mod_zephyrmod.SeriatedStone.blockID)
{
j = 1;
}
if (i == j)
{
return false;
}
if (par1World.getBlockId(par2 - i, par3, par4 - j) == 0)
{
par2 -= i;
par4 -= j;
}
for (int k = -1; k <= 2; k++)
{
for (int i1 = -1; i1 <= 3; i1++)
{
boolean flag = k == -1 || k == 2 || i1 == -1 || i1 == 3;
if ((k == -1 || k == 2) && (i1 == -1 || i1 == 3))
{
continue;
}
int k1 = par1World.getBlockId(par2 + i * k, par3 + i1, par4 + j * k);
if (flag)
{
if (k1 != mod_zephyrmod.SeriatedStone.blockID)
{
return false;
}
continue;
}
if (k1 != 0 && k1 != Block.fire.blockID)
{
return false;
}
}
}
par1World.editingBlocks = true;
for (int l = 0; l < 2; l++)
{
for (int j1 = 0; j1 < 3; j1++)
{
par1World.setBlockWithNotify(par2 + i * l, par3 + j1, par4 + j * l, mod_zephyrmod.ZephyrPortal.blockID);
}
}
par1World.editingBlocks = false;
return true;
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
int i = 0;
int j = 1;
if (par1World.getBlockId(par2 - 1, par3, par4) == blockID || par1World.getBlockId(par2 + 1, par3, par4) == blockID)
{
i = 1;
j = 0;
}
int k;
for (k = par3; par1World.getBlockId(par2, k - 1, par4) == blockID; k--) { }
if (par1World.getBlockId(par2, k - 1, par4) != mod_zephyrmod.SeriatedStone.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
int l;
for (l = 1; l < 4 && par1World.getBlockId(par2, k + l, par4) == blockID; l++) { }
if (l != 3 || par1World.getBlockId(par2, k + l, par4) != mod_zephyrmod.SeriatedStone.blockID)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
boolean flag = par1World.getBlockId(par2 - 1, par3, par4) == blockID || par1World.getBlockId(par2 + 1, par3, par4) == blockID;
boolean flag1 = par1World.getBlockId(par2, par3, par4 - 1) == blockID || par1World.getBlockId(par2, par3, par4 + 1) == blockID;
if (flag && flag1)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
if ((par1World.getBlockId(par2 + i, par3, par4 + j) != mod_zephyrmod.SeriatedStone.blockID || par1World.getBlockId(par2 - i, par3, par4 - j) != blockID) && (par1World.getBlockId(par2 - i, par3, par4 - j) != mod_zephyrmod.SeriatedStone.blockID || par1World.getBlockId(par2 + i, par3, par4 + j) != blockID))
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
return;
}
else
{
return;
}
}
/**
* Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
* coordinates. Args: blockAccess, x, y, z, side
*/
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
if (par1IBlockAccess.getBlockId(par2, par3, par4) == blockID)
{
return false;
}
boolean flag = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != blockID;
boolean flag1 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != blockID;
boolean flag2 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != blockID;
boolean flag3 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != blockID;
boolean flag4 = flag || flag1;
boolean flag5 = flag2 || flag3;
if (flag4 && par5 == 4)
{
return true;
}
if (flag4 && par5 == 5)
{
return true;
}
if (flag5 && par5 == 2)
{
return true;
}
return flag5 && par5 == 3;
}
public boolean displayPortalOverlay()
{
return true;
}
public int getOverlayTexture()
{
return blockIndexInTexture;
}
public int getPortalDelay()
{
return 85;//default
}
public String getEnteringMessage() {
return "Entering Zephyr";
}
public String getLeavingMessage() {
return "Leaving Zephyr";
}
}
I am doing your dimension tutorial, whenever I run it, I get:
--- BEGIN ERROR REPORT 4cbca48a --------
Generated 02/09/12 13:14
- Minecraft Version: 1.3.2
- Operating System: Windows XP (x86) version 5.1
- Java Version: 1.7.0_05, Oracle Corporation
- Java VM Version: Java HotSpot(TM) Client VM (mixed mode), Oracle Corporation
- Memory: 1002119704 bytes (955 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)
- JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
- ModLoader: Mods loaded: 1
ModLoader 1.3.2
java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at net.minecraft.src.ModLoader.addMod(ModLoader.java:378)
at net.minecraft.src.ModLoader.readFromClassPath(ModLoader.java:1369)
at net.minecraft.src.ModLoader.init(ModLoader.java:944)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:186)
at net.minecraft.src.RenderManager.(RenderManager.java:86)
at net.minecraft.src.RenderManager.(RenderManager.java:14)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:404)
at net.minecraft.client.Minecraft.run(Minecraft.java:724)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at net.minecraft.src.BiomeGenTheArch.(BiomeGenTheArch.java:28)
at net.minecraft.src.mod_TheArch.(mod_TheArch.java:28)
... 15 more
--- END ERROR REPORT 850ec553 ----------
There s a problem with your biome. Sadly, its a NullPointerExceptionError, meaning I cannot tell you exactly where the error is. Debug your code carefully by commenting out lines and then running your game. Good luck
I'm not sure if there is some sort of post that answers my same question here, but what exactly would I have to do to make a new chunk manager? Should I just copy code from an pre-existing manager in Minecraft and rename stuff, or is there some short-cut?
any answer? Anyone? I'm using the dimension tutorial and this is kinda holding me up.
May the ores be with you.
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
May the ores be with you.
Yes, I'm one of these guys: If I say something that offends you or just seems wrong, please let me know. I was almost certainly just making a joke or a pun, or something really dumb like that, and didn't mean anything by it. Don't take anything I say too seriously!
this is what i'm looking for,
The Advanced tutorial....
Hope more tutorials will come...
Yeah Those Work Great!
now my problem is explosive block which i can't display the block when i use right click mouse
can you help me what's the problem of my code?
Im using 1.3.2 version
Here's my mod file
Block File
package net.minecraft.src;
import java.util.Random;
public class SampleBomb extends Block
{
public SampleBomb(int par1, int par2)
{
super(par1, par2, Material.tnt);
this.setCreativeTab(CreativeTabs.tabRedstone);
}
/**
* Returns the block texture based on the side being looked at. Args: side
*/
//public int getBlockTextureFromSide(int par1)
//{
//return par1 == 0 ? this.blockIndexInTexture + 2 : (par1 == 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture);
//}
/**
* Called whenever the block is added into the world. Args: world, x, y, z
*/
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (par5 > 0 && Block.blocksList[par5].canProvidePower() && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 1;
}
/**
* Called upon the block being destroyed by an explosion
*/
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4)
{
if (!par1World.isRemote)
{
EntitySampleBomb var5 = new EntitySampleBomb(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F));
var5.fuse = par1World.rand.nextInt(var5.fuse / 4) + var5.fuse / 8;
par1World.spawnEntityInWorld(var5);
}
}
/**
* Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
*/
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
if (!par1World.isRemote)
{
if ((par5 & 1) == 1)
{
EntitySampleBomb var6 = new EntitySampleBomb(par1World, (double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F));
par1World.spawnEntityInWorld(var6);
par1World.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F);
}
}
}
/**
* Called upon block activation (right click on the block.)
*/
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.shiftedIndex)
{
this.onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
return true;
}
else
{
return super.onBlockActivated(par1World, par2, par3, par4, par5EntityPlayer, par6, par7, par8, par9);
}
}
/**
* Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage
* and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
*/
protected ItemStack createStackedBlock(int par1)
{
return null;
}
}
Entity file
package net.minecraft.src;
public class EntitySampleBomb extends Entity
{
public EntitySampleBomb (World world)
{
super(world);
fuse = 0;
preventEntitySpawning = true;
setSize(0.98F, 0.98F);
yOffset = height / 2.0F;
}
public EntitySampleBomb (World world, double d, double d1, double d2)
{
this(world);
setPosition (d, d1, d2);
float f = (float)(Math.random()* 3.141592741012732D * 2D);
motionX = -MathHelper.sin((f * 3.141593F) / 180F) * 0.02F;
motionY = 0.20000000298023224D;
motionZ = -MathHelper.cos(( f * 3.141593F) / 180F) * 0.02F;
fuse = 100;
prevPosX = d;
prevPosY = d1;
prevPosZ = d2;
}
protected void entityUnit()
{
}
protected boolean canTriggerWalking()
{
return false;
}
public boolean canBeCollidedWith()
{
return !isDead;
}
public void onUpdate()
{
prevPosX = posX;
prevPosY = posY;
prevPosZ = posZ;
motionY -= 0.039999999105930328D;
moveEntity(motionX, motionY, motionZ);
motionX *= 0.98000001907348633D;
motionY *= 0.98000001907348633D;
motionZ *= 0.98000001907348633D;
if(onGround)
{
motionX *= 0.69999998807907104D;
motionZ *= 0.69999998807907104D;
motionY += -0.5D;
}
if(fuse -- <= 0)
{
setDead();
explode();
}
//CODE WRITTEN BY THEINSTITUTIONS
else
{
worldObj.spawnParticle("smoke", posX, posY + 0.5D, posZ, 0.0D, 0.0F, 0.0D);
}
}
private void explode()
{
float f = 4F; //Change this value to the size of your explosion
worldObj.createExplosion(null, posX, posY, posZ, f);
}
protected void writeEntityToNBT(NBTTagCompound tut)
{
tut.setByte("Fuse", (byte)fuse);
}
protected void readEntityFromNBT(NBTTagCompound tut)
{
fuse = tut.getByte("Fuse");
}
public float getShadowSize()
{
return 0.0F;
}
public int fuse;
protected void entityInit()
{
}
}
Render file
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
public class RenderSampleBomb extends Render
{
private RenderBlocks blockRenderer;
public RenderSampleBomb()
{
blockRenderer = new RenderBlocks();
shadowSize = 0.5F;
}
public void func_153_a(EntitySampleBomb entityfirebombprimed, double d, double d1, double d2,
float f, float f1)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)d, (float)d1, (float)d2);
if(((float)entityfirebombprimed.fuse - f1) + 1.0F < 10F)
{
float f2 = 1.0F - (((float)entityfirebombprimed.fuse - f1) + 1.0F) / 10F;
if(f2 < 0.0F)
{
f2 = 0.0F;
}
if(f2 > 1.0F)
{
f2 = 1.0F;
}
f2 *= f2;
f2 *= f2;
float f4 = 1.0F + f2 * 0.3F;
GL11.glScalef(f4, f4, f4);
}
float f3 = (1.0F - (((float)entityfirebombprimed.fuse - f1) + 1.0F) / 100F) * 0.8F;
loadTexture("/terrain.png");
blockRenderer.renderBlockAsItem(mod_Sample.SampleBomb, 0, entityfirebombprimed.getBrightness(f1));
if((entityfirebombprimed.fuse / 5) % 2 == 0)
{
GL11.glDisable(3553 /*GL_TEXTURE_2D*/);
GL11.glDisable(2896 /*GL_LIGHTING*/);
GL11.glEnable(3042 /*GL_BLEND*/);
GL11.glBlendFunc(770, 772);
GL11.glColor4f(1.0F, 1.0F, 1.0F, f3);
blockRenderer.renderBlockAsItem(Block.tnt, 0, 1.0F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(3042 /*GL_BLEND*/);
GL11.glEnable(2896 /*GL_LIGHTING*/);
GL11.glEnable(3553 /*GL_TEXTURE_2D*/);
}
GL11.glPopMatrix();
}
public void doRender(Entity entity, double d, double d1, double d2,
float f, float f1)
{
func_153_a((EntitySampleBomb)entity, d, d1, d2, f, f1);
}
}
mod file
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class mod_Sample extends BaseMod
{
public static final Block SampleBomb = (new SampleBomb (222, ModLoader.addOverride("/terrain.png", "/textures/RodneyNuclearTextures.png")).setBlockName("AtomicBomb"));
public void load()
{
//register
//AtomicBomb.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/textures/RedBlockIron.png");
ModLoader.registerBlock(SampleBomb);
ModLoader.addName(SampleBomb, "Sample Bomb");
}
public void addRenderer(Map map)
{
map.put(net.minecraft.src.EntitySampleBomb.class, new RenderSampleBomb());
}
@Override
public String getVersion() {
// TODO Auto-generated method stub
return null;
}
}
I think this is a tick error or something? I'm not so sure cuz I had this error before and I resolved it quick.
Be sure to check out my texture pack: Easy Ores!
1.My Block of time Frame wont spawn my portal when i light it.(it should)
2.If i cheat my self a portal and enter it it disconnects me from the (singleplayer)server and then crashes the game
ERROR REPORT:
so heres my code.
mod_walle:
MY BlockTime(the block that is supposed to be the frame)
My BlockTimePortal(theportal)
My BiomeGenFuture
My FutureTeleporter
My BiomeGenBase
My WorldProviderFuture
My WorldGenFuture
Also, when if i use a portal, that world becomes a staright pathway to a crash!
I have the same problem
In your world provider: put this
I do, but lota of peoples wanted Forge tutorials so I am giving them what they want
There s a problem with your biome. Sadly, its a NullPointerExceptionError, meaning I cannot tell you exactly where the error is. Debug your code carefully by commenting out lines and then running your game. Good luck
any answer? Anyone? I'm using the dimension tutorial and this is kinda holding me up.