2011-01-01 18:33:18 +00:00
|
|
|
// $Id$
|
|
|
|
/*
|
|
|
|
* WorldEdit
|
|
|
|
* Copyright (C) 2010 sk89q <http://www.sk89q.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-02-18 23:49:50 +00:00
|
|
|
*/
|
2011-01-01 18:33:18 +00:00
|
|
|
|
|
|
|
package com.sk89q.worldedit;
|
|
|
|
|
2011-01-11 18:21:26 +00:00
|
|
|
import java.util.Random;
|
2011-01-23 08:36:26 +00:00
|
|
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
2011-01-08 19:26:27 +00:00
|
|
|
import com.sk89q.worldedit.blocks.BaseItemStack;
|
2011-09-03 16:54:20 +00:00
|
|
|
import com.sk89q.worldedit.blocks.BlockID;
|
2011-09-14 23:19:19 +00:00
|
|
|
import com.sk89q.worldedit.blocks.BlockType;
|
2011-09-03 16:54:20 +00:00
|
|
|
import com.sk89q.worldedit.blocks.ItemType;
|
2011-03-13 00:37:07 +00:00
|
|
|
import com.sk89q.worldedit.regions.Region;
|
2011-01-08 19:26:27 +00:00
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
/**
|
|
|
|
* Represents a world.
|
|
|
|
*
|
|
|
|
* @author sk89q
|
|
|
|
*/
|
|
|
|
public abstract class LocalWorld {
|
2011-01-11 18:21:26 +00:00
|
|
|
/**
|
|
|
|
* Random generator.
|
|
|
|
*/
|
|
|
|
protected Random random = new Random();
|
2011-07-07 17:23:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the name of the world.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract String getName();
|
2011-02-18 23:49:50 +00:00
|
|
|
|
2011-01-08 19:26:27 +00:00
|
|
|
/**
|
|
|
|
* Set block type.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract boolean setBlockType(Vector pt, int type);
|
|
|
|
|
2011-06-04 17:30:45 +00:00
|
|
|
/**
|
|
|
|
* Set block type.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public boolean setBlockTypeFast(Vector pt, int type) {
|
|
|
|
return setBlockType(pt, type);
|
|
|
|
}
|
|
|
|
|
2011-01-08 19:26:27 +00:00
|
|
|
/**
|
|
|
|
* Get block type.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract int getBlockType(Vector pt);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set block data.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @param data
|
|
|
|
*/
|
2011-07-15 07:00:48 +00:00
|
|
|
|
2011-01-08 19:26:27 +00:00
|
|
|
public abstract void setBlockData(Vector pt, int data);
|
|
|
|
|
2011-06-04 17:30:45 +00:00
|
|
|
/**
|
|
|
|
* Set block data.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @param data
|
|
|
|
*/
|
2011-07-15 07:00:48 +00:00
|
|
|
public abstract void setBlockDataFast(Vector pt, int data);
|
2011-06-04 17:30:45 +00:00
|
|
|
|
2011-07-15 07:00:48 +00:00
|
|
|
/**
|
|
|
|
* set block type & data
|
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @param data
|
|
|
|
* @return
|
|
|
|
*/
|
2011-08-14 07:48:18 +00:00
|
|
|
public boolean setTypeIdAndData(Vector pt, int type, int data) {
|
|
|
|
boolean ret = setBlockType(pt, type);
|
|
|
|
setBlockData(pt, data);
|
|
|
|
return ret;
|
|
|
|
}
|
2011-07-15 07:00:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* set block type & data
|
|
|
|
* @param pt
|
|
|
|
* @param type
|
|
|
|
* @param data
|
|
|
|
* @return
|
|
|
|
*/
|
2011-08-14 07:48:18 +00:00
|
|
|
public boolean setTypeIdAndDataFast(Vector pt, int type, int data) {
|
|
|
|
boolean ret = setBlockTypeFast(pt, type);
|
|
|
|
setBlockDataFast(pt, data);
|
|
|
|
return ret;
|
|
|
|
}
|
2011-07-15 07:00:48 +00:00
|
|
|
|
2011-01-08 19:26:27 +00:00
|
|
|
/**
|
|
|
|
* Get block data.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract int getBlockData(Vector pt);
|
2011-04-30 06:15:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get block light level.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract int getBlockLightLevel(Vector pt);
|
2011-03-13 00:37:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Regenerate an area.
|
|
|
|
*
|
|
|
|
* @param region
|
|
|
|
* @param editSession
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract boolean regenerate(Region region, EditSession editSession);
|
2011-01-08 19:26:27 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-23 08:36:26 +00:00
|
|
|
* Attempts to accurately copy a BaseBlock's extra data to the world.
|
2011-01-08 19:26:27 +00:00
|
|
|
*
|
|
|
|
* @param pt
|
2011-01-23 08:36:26 +00:00
|
|
|
* @param block
|
2011-01-08 19:26:27 +00:00
|
|
|
* @return
|
|
|
|
*/
|
2011-01-23 08:36:26 +00:00
|
|
|
public abstract boolean copyToWorld(Vector pt, BaseBlock block);
|
2011-01-08 19:26:27 +00:00
|
|
|
|
|
|
|
/**
|
2011-01-23 08:36:26 +00:00
|
|
|
* Attempts to read a BaseBlock's extra data from the world.
|
2011-01-08 19:26:27 +00:00
|
|
|
*
|
|
|
|
* @param pt
|
2011-01-23 08:36:26 +00:00
|
|
|
* @param block
|
2011-01-08 19:26:27 +00:00
|
|
|
* @return
|
|
|
|
*/
|
2011-01-23 08:36:26 +00:00
|
|
|
public abstract boolean copyFromWorld(Vector pt, BaseBlock block);
|
2011-01-08 19:26:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear a chest's contents.
|
|
|
|
*
|
|
|
|
* @param pt
|
2011-02-18 23:49:50 +00:00
|
|
|
* @return
|
2011-01-08 19:26:27 +00:00
|
|
|
*/
|
2011-01-23 08:36:26 +00:00
|
|
|
public abstract boolean clearContainerBlockContents(Vector pt);
|
2011-01-08 19:26:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a tree at a location.
|
|
|
|
*
|
2011-02-18 23:49:50 +00:00
|
|
|
* @param editSession
|
2011-01-08 19:26:27 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
2011-02-18 23:49:50 +00:00
|
|
|
* @throws MaxChangedBlocksException
|
2011-01-08 19:26:27 +00:00
|
|
|
*/
|
2011-01-30 22:54:42 +00:00
|
|
|
public abstract boolean generateTree(EditSession editSession, Vector pt)
|
|
|
|
throws MaxChangedBlocksException;
|
2011-01-08 19:26:27 +00:00
|
|
|
|
2011-01-09 18:22:01 +00:00
|
|
|
/**
|
|
|
|
* Generate a big tree at a location.
|
|
|
|
*
|
2011-02-18 23:49:50 +00:00
|
|
|
* @param editSession
|
2011-01-09 18:22:01 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
2011-02-18 23:49:50 +00:00
|
|
|
* @throws MaxChangedBlocksException
|
2011-01-09 18:22:01 +00:00
|
|
|
*/
|
2011-01-30 22:54:42 +00:00
|
|
|
public abstract boolean generateBigTree(EditSession editSession, Vector pt)
|
|
|
|
throws MaxChangedBlocksException;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a birch tree at a location.
|
|
|
|
*
|
2011-02-18 23:49:50 +00:00
|
|
|
* @param editSession
|
2011-01-30 22:54:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
2011-02-18 23:49:50 +00:00
|
|
|
* @throws MaxChangedBlocksException
|
2011-01-30 22:54:42 +00:00
|
|
|
*/
|
|
|
|
public abstract boolean generateBirchTree(EditSession editSession, Vector pt)
|
2011-02-18 23:49:50 +00:00
|
|
|
throws MaxChangedBlocksException;
|
2011-01-30 22:54:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a redwood tree at a location.
|
|
|
|
*
|
2011-02-18 23:49:50 +00:00
|
|
|
* @param editSession
|
2011-01-30 22:54:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
2011-02-18 23:49:50 +00:00
|
|
|
* @throws MaxChangedBlocksException
|
2011-01-30 22:54:42 +00:00
|
|
|
*/
|
2011-02-18 23:49:50 +00:00
|
|
|
public abstract boolean generateRedwoodTree(EditSession editSession,
|
|
|
|
Vector pt) throws MaxChangedBlocksException;
|
2011-01-30 22:54:42 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a tall redwood tree at a location.
|
|
|
|
*
|
2011-02-18 23:49:50 +00:00
|
|
|
* @param editSession
|
2011-01-30 22:54:42 +00:00
|
|
|
* @param pt
|
|
|
|
* @return
|
2011-02-18 23:49:50 +00:00
|
|
|
* @throws MaxChangedBlocksException
|
2011-01-30 22:54:42 +00:00
|
|
|
*/
|
2011-02-18 23:49:50 +00:00
|
|
|
public abstract boolean generateTallRedwoodTree(EditSession editSession,
|
|
|
|
Vector pt) throws MaxChangedBlocksException;
|
2011-01-09 18:22:01 +00:00
|
|
|
|
2011-01-08 19:26:27 +00:00
|
|
|
/**
|
|
|
|
* Drop an item.
|
2011-02-18 23:49:50 +00:00
|
|
|
*
|
2011-01-08 19:26:27 +00:00
|
|
|
* @param pt
|
2011-02-18 23:49:50 +00:00
|
|
|
* @param item
|
2011-01-08 19:26:27 +00:00
|
|
|
* @param times
|
|
|
|
*/
|
2011-02-18 23:49:50 +00:00
|
|
|
public void dropItem(Vector pt, BaseItemStack item, int times) {
|
2011-07-15 07:00:48 +00:00
|
|
|
for (int i = 0; i < times; ++i) {
|
2011-01-18 04:30:54 +00:00
|
|
|
dropItem(pt, item);
|
2011-01-11 18:21:26 +00:00
|
|
|
}
|
|
|
|
}
|
2011-01-08 19:26:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Drop an item.
|
|
|
|
*
|
|
|
|
* @param pt
|
2011-01-18 04:30:54 +00:00
|
|
|
* @param item
|
2011-01-08 19:26:27 +00:00
|
|
|
*/
|
2011-01-18 04:30:54 +00:00
|
|
|
public abstract void dropItem(Vector pt, BaseItemStack item);
|
2011-01-08 19:26:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Simulate a block being mined.
|
|
|
|
*
|
|
|
|
* @param pt
|
|
|
|
*/
|
2011-01-11 18:21:26 +00:00
|
|
|
public void simulateBlockMine(Vector pt) {
|
|
|
|
int type = getBlockType(pt);
|
2011-03-12 08:43:41 +00:00
|
|
|
//setBlockType(pt, 0);
|
2011-02-18 23:49:50 +00:00
|
|
|
|
2011-09-05 01:53:39 +00:00
|
|
|
switch (type) {
|
|
|
|
case BlockID.STONE:
|
|
|
|
dropItem(pt, new BaseItemStack(BlockID.COBBLESTONE));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.GRASS:
|
|
|
|
dropItem(pt, new BaseItemStack(BlockID.DIRT));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.GRAVEL:
|
2011-01-11 18:21:26 +00:00
|
|
|
if (random.nextDouble() >= 0.9) {
|
2011-09-03 16:54:20 +00:00
|
|
|
dropItem(pt, new BaseItemStack(ItemType.FLINT.getID()));
|
2011-07-15 08:22:58 +00:00
|
|
|
} else {
|
2011-07-15 06:59:30 +00:00
|
|
|
dropItem(pt, new BaseItemStack(type));
|
2011-01-11 18:21:26 +00:00
|
|
|
}
|
2011-09-05 01:53:39 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.COAL_ORE:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.COAL.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.LOG:
|
|
|
|
dropItem(pt, new BaseItemStack(type, 1, (short) getBlockData(pt)));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.LEAVES:
|
2011-01-11 18:21:26 +00:00
|
|
|
if (random.nextDouble() > 0.95) {
|
2011-09-03 16:54:20 +00:00
|
|
|
dropItem(pt, new BaseItemStack(BlockID.SAPLING, 1, (short) getBlockData(pt)));
|
2011-01-11 18:21:26 +00:00
|
|
|
}
|
2011-09-05 01:53:39 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.LAPIS_LAZULI_ORE:
|
2011-09-03 16:54:20 +00:00
|
|
|
dropItem(pt, new BaseItemStack(ItemType.INK_SACK.getID(), 1, (short) 4), (random.nextInt(5) + 4));
|
2011-09-05 01:53:39 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.BED:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.BED_ITEM.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.LONG_GRASS:
|
|
|
|
if (random.nextInt(8) == 0) dropItem(pt, new BaseItemStack(ItemType.SEEDS.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.CLOTH:
|
|
|
|
dropItem(pt, new BaseItemStack(type, 1, (short) getBlockData(pt)));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.DOUBLE_STEP:
|
2011-09-03 16:54:20 +00:00
|
|
|
dropItem(pt, new BaseItemStack(BlockID.STEP, 1, (short) getBlockData(pt)), 2);
|
2011-09-05 01:53:39 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.STEP:
|
|
|
|
dropItem(pt, new BaseItemStack(type, 1, (short) getBlockData(pt)));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.WOODEN_STAIRS:
|
|
|
|
dropItem(pt, new BaseItemStack(BlockID.WOOD));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.REDSTONE_WIRE:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.REDSTONE_DUST.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.DIAMOND_ORE:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.DIAMOND.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.CROPS:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.SEEDS.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.SOIL:
|
|
|
|
dropItem(pt, new BaseItemStack(BlockID.DIRT));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.BURNING_FURNACE:
|
|
|
|
dropItem(pt, new BaseItemStack(BlockID.FURNACE));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.SIGN_POST:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.SIGN.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.WOODEN_DOOR:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.WOODEN_DOOR_ITEM.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.COBBLESTONE_STAIRS:
|
|
|
|
dropItem(pt, new BaseItemStack(BlockID.COBBLESTONE));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.WALL_SIGN:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.SIGN.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.IRON_DOOR:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.IRON_DOOR_ITEM.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.REDSTONE_ORE:
|
|
|
|
case BlockID.GLOWING_REDSTONE_ORE:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.REDSTONE_DUST.getID()), (random.nextInt(2) + 4));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.REDSTONE_TORCH_OFF:
|
|
|
|
dropItem(pt, new BaseItemStack(BlockID.REDSTONE_TORCH_ON));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.CLAY:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.CLAY_BALL.getID()), 4);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.REED:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.SUGAR_CANE_ITEM.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.LIGHTSTONE:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.LIGHTSTONE_DUST.getID()), (random.nextInt(3) + 2));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.REDSTONE_REPEATER_OFF:
|
|
|
|
case BlockID.REDSTONE_REPEATER_ON:
|
|
|
|
dropItem(pt, new BaseItemStack(ItemType.REDSTONE_REPEATER.getID()));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BlockID.BEDROCK:
|
|
|
|
case BlockID.WATER:
|
|
|
|
case BlockID.STATIONARY_WATER:
|
|
|
|
case BlockID.LAVA:
|
|
|
|
case BlockID.STATIONARY_LAVA:
|
|
|
|
case BlockID.GLASS:
|
|
|
|
case BlockID.PISTON_EXTENSION:
|
|
|
|
case BlockID.BOOKCASE:
|
|
|
|
case BlockID.FIRE:
|
|
|
|
case BlockID.MOB_SPAWNER:
|
|
|
|
case BlockID.SNOW:
|
|
|
|
case BlockID.ICE:
|
|
|
|
case BlockID.PORTAL:
|
|
|
|
case BlockID.AIR:
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2011-01-18 04:30:54 +00:00
|
|
|
dropItem(pt, new BaseItemStack(type));
|
2011-09-05 01:53:39 +00:00
|
|
|
break;
|
2011-01-11 18:21:26 +00:00
|
|
|
}
|
|
|
|
}
|
2011-01-08 19:26:27 +00:00
|
|
|
|
|
|
|
/**
|
2011-05-24 22:19:11 +00:00
|
|
|
* Kill mobs in an area, excluding pet wolves.
|
2011-01-08 19:26:27 +00:00
|
|
|
*
|
|
|
|
* @param origin
|
|
|
|
* @param radius
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract int killMobs(Vector origin, int radius);
|
2011-02-18 23:49:50 +00:00
|
|
|
|
2011-05-24 22:19:11 +00:00
|
|
|
/**
|
|
|
|
* Kill mobs in an area.
|
|
|
|
*
|
|
|
|
* @param origin
|
|
|
|
* @param radius
|
|
|
|
* @param killPets
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract int killMobs(Vector origin, int radius, boolean killPets);
|
|
|
|
|
2011-02-19 04:31:49 +00:00
|
|
|
/**
|
|
|
|
* Remove entities in an area.
|
|
|
|
*
|
|
|
|
* @param type
|
|
|
|
* @param origin
|
|
|
|
* @param radius
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public abstract int removeEntities(EntityType type, Vector origin, int radius);
|
2011-06-05 05:22:23 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns whether a block has a valid ID.
|
|
|
|
*
|
|
|
|
* @param type
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public boolean isValidBlockType(int type) {
|
2011-09-14 23:19:19 +00:00
|
|
|
return BlockType.fromID(type) != null;
|
2011-06-05 05:22:23 +00:00
|
|
|
}
|
2011-02-19 04:31:49 +00:00
|
|
|
|
2011-08-30 00:31:08 +00:00
|
|
|
/**
|
|
|
|
* Checks if the chunk pt is in is loaded. if not, loads the chunk
|
|
|
|
*
|
|
|
|
* @param pt Position to check
|
|
|
|
*/
|
|
|
|
public abstract void checkLoadedChuck(Vector pt);
|
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
/**
|
|
|
|
* Compare if the other world is equal.
|
|
|
|
*
|
|
|
|
* @param other
|
|
|
|
* @return
|
|
|
|
*/
|
2011-02-18 23:49:50 +00:00
|
|
|
@Override
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract boolean equals(Object other);
|
2011-02-18 23:49:50 +00:00
|
|
|
|
2011-01-01 18:33:18 +00:00
|
|
|
/**
|
|
|
|
* Hash code.
|
|
|
|
*
|
|
|
|
* @return
|
|
|
|
*/
|
2011-02-18 23:49:50 +00:00
|
|
|
@Override
|
2011-01-01 18:33:18 +00:00
|
|
|
public abstract int hashCode();
|
|
|
|
}
|