Fix formatting.
This commit is contained in:
parent
61ec751ca1
commit
a4ce846d07
@ -9,6 +9,7 @@ import java.util.logging.Logger;
|
|||||||
import java.util.logging.Handler;
|
import java.util.logging.Handler;
|
||||||
import org.bukkit.craftbukkit.util.ShortConsoleLogFormatter;
|
import org.bukkit.craftbukkit.util.ShortConsoleLogFormatter;
|
||||||
import org.bukkit.craftbukkit.util.TerminalConsoleHandler;
|
import org.bukkit.craftbukkit.util.TerminalConsoleHandler;
|
||||||
|
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public class ConsoleLogManager {
|
public class ConsoleLogManager {
|
||||||
@ -16,7 +17,8 @@ public class ConsoleLogManager {
|
|||||||
public static Logger a = Logger.getLogger("Minecraft");
|
public static Logger a = Logger.getLogger("Minecraft");
|
||||||
public static Logger global = Logger.getLogger(""); // CraftBukkit
|
public static Logger global = Logger.getLogger(""); // CraftBukkit
|
||||||
|
|
||||||
public ConsoleLogManager() {}
|
public ConsoleLogManager() {
|
||||||
|
}
|
||||||
|
|
||||||
// CraftBukkit - change of method signature!
|
// CraftBukkit - change of method signature!
|
||||||
public static void init(MinecraftServer server) {
|
public static void init(MinecraftServer server) {
|
||||||
|
@ -3,7 +3,7 @@ package net.minecraft.server;
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
import org.bukkit.craftbukkit.event.CraftEventFactory;
|
||||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||||
// CraftBukkit End
|
// CraftBukkit end
|
||||||
|
|
||||||
public class EntityItem extends Entity {
|
public class EntityItem extends Entity {
|
||||||
|
|
||||||
|
@ -71,8 +71,7 @@ public class ItemBlock extends Item {
|
|||||||
CraftBlockState blockStateBelow = null;
|
CraftBlockState blockStateBelow = null;
|
||||||
// Toggles whether the normal or the block below is used for the place event
|
// Toggles whether the normal or the block below is used for the place event
|
||||||
boolean eventUseBlockBelow = false;
|
boolean eventUseBlockBelow = false;
|
||||||
if ((world.getTypeId(i, j - 1, k) == Block.STEP.id || world.getTypeId(i, j - 1, k) == Block.DOUBLE_STEP.id)
|
if ((world.getTypeId(i, j - 1, k) == Block.STEP.id || world.getTypeId(i, j - 1, k) == Block.DOUBLE_STEP.id) && (itemstack.id == Block.DOUBLE_STEP.id || itemstack.id == Block.STEP.id)) {
|
||||||
&& (itemstack.id == Block.DOUBLE_STEP.id || itemstack.id == Block.STEP.id)) {
|
|
||||||
blockStateBelow = CraftBlockState.getBlockState(world, i, j - 1, k);
|
blockStateBelow = CraftBlockState.getBlockState(world, i, j - 1, k);
|
||||||
// Step is placed on step, forms a doublestep replacing the original step, so we need the lower block
|
// Step is placed on step, forms a doublestep replacing the original step, so we need the lower block
|
||||||
eventUseBlockBelow = itemstack.id == Block.STEP.id && blockStateBelow.getTypeId() == Block.STEP.id;
|
eventUseBlockBelow = itemstack.id == Block.STEP.id && blockStateBelow.getTypeId() == Block.STEP.id;
|
||||||
|
@ -65,6 +65,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
|||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
this.server = minecraftserver.server;
|
this.server = minecraftserver.server;
|
||||||
}
|
}
|
||||||
|
|
||||||
private final CraftServer server;
|
private final CraftServer server;
|
||||||
private int lastTick = MinecraftServer.currentTick;
|
private int lastTick = MinecraftServer.currentTick;
|
||||||
private int lastDropTick = MinecraftServer.currentTick;
|
private int lastDropTick = MinecraftServer.currentTick;
|
||||||
|
@ -18,13 +18,16 @@ public final class SpawnerCreature {
|
|||||||
// private static HashMap b = new HashMap(); // CraftBukkit - moved local to spawnEntities
|
// private static HashMap b = new HashMap(); // CraftBukkit - moved local to spawnEntities
|
||||||
static private class ChunkEntry extends EntryBase {
|
static private class ChunkEntry extends EntryBase {
|
||||||
public boolean spawn;
|
public boolean spawn;
|
||||||
|
|
||||||
public ChunkEntry(int x, int z, boolean spawn) {
|
public ChunkEntry(int x, int z, boolean spawn) {
|
||||||
super(LongHash.toLong(x, z));
|
super(LongHash.toLong(x, z));
|
||||||
this.spawn = spawn;
|
this.spawn = spawn;
|
||||||
}
|
}
|
||||||
|
|
||||||
int getX() {
|
int getX() {
|
||||||
return LongHash.msw(key);
|
return LongHash.msw(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
int getZ() {
|
int getZ() {
|
||||||
return LongHash.lsw(key);
|
return LongHash.lsw(key);
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ public class TileEntityFurnace extends TileEntity implements IInventory {
|
|||||||
|
|
||||||
// CraftBukkit start
|
// CraftBukkit start
|
||||||
private int lastTick = (int) (System.currentTimeMillis() / 50);
|
private int lastTick = (int) (System.currentTimeMillis() / 50);
|
||||||
|
|
||||||
public ItemStack[] getContents() {
|
public ItemStack[] getContents() {
|
||||||
return this.items;
|
return this.items;
|
||||||
}
|
}
|
||||||
|
@ -864,7 +864,6 @@ public class World implements IBlockAccess {
|
|||||||
return this.addEntity(entity, SpawnReason.CUSTOM); // Set reason as Custom by default
|
return this.addEntity(entity, SpawnReason.CUSTOM); // Set reason as Custom by default
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
|
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
int i = MathHelper.floor(entity.locX / 16.0D);
|
int i = MathHelper.floor(entity.locX / 16.0D);
|
||||||
|
@ -5,6 +5,7 @@ import org.bukkit.block.Biome;
|
|||||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||||
|
|
||||||
import net.minecraft.server.BiomeBase;
|
import net.minecraft.server.BiomeBase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents a static, thread-safe snapshot of chunk of blocks
|
* Represents a static, thread-safe snapshot of chunk of blocks
|
||||||
* Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)
|
* Purpose is to allow clean, efficient copy of a chunk data to be made, and then handed off for processing in another thread (e.g. map rendering)
|
||||||
@ -23,9 +24,6 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
|||||||
private static final int BLOCKLIGHT_OFF = BLOCKDATA_OFF + 16384;
|
private static final int BLOCKLIGHT_OFF = BLOCKDATA_OFF + 16384;
|
||||||
private static final int SKYLIGHT_OFF = BLOCKLIGHT_OFF + 16384;
|
private static final int SKYLIGHT_OFF = BLOCKLIGHT_OFF + 16384;
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*/
|
|
||||||
CraftChunkSnapshot(int x, int z, String wname, long wtime, byte[] buf, byte[] hmap, BiomeBase[] biome, double[] biomeTemp, double[] biomeRain) {
|
CraftChunkSnapshot(int x, int z, String wname, long wtime, byte[] buf, byte[] hmap, BiomeBase[] biome, double[] biomeTemp, double[] biomeRain) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.z = z;
|
this.z = z;
|
||||||
@ -38,135 +36,56 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
|||||||
this.biomeRain = biomeRain;
|
this.biomeRain = biomeRain;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the X-coordinate of this chunk
|
|
||||||
*
|
|
||||||
* @return X-coordinate
|
|
||||||
*/
|
|
||||||
public int getX() {
|
public int getX() {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the Z-coordinate of this chunk
|
|
||||||
*
|
|
||||||
* @return Z-coordinate
|
|
||||||
*/
|
|
||||||
public int getZ() {
|
public int getZ() {
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets name of the world containing this chunk
|
|
||||||
*
|
|
||||||
* @return Parent World Name
|
|
||||||
*/
|
|
||||||
public String getWorldName() {
|
public String getWorldName() {
|
||||||
return worldname;
|
return worldname;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get block type for block at corresponding coordinate in the chunk
|
|
||||||
*
|
|
||||||
* @param x 0-15
|
|
||||||
* @param y 0-127
|
|
||||||
* @param z 0-15
|
|
||||||
* @return 0-255
|
|
||||||
*/
|
|
||||||
public int getBlockTypeId(int x, int y, int z) {
|
public int getBlockTypeId(int x, int y, int z) {
|
||||||
return buf[x << 11 | z << 7 | y] & 255;
|
return buf[x << 11 | z << 7 | y] & 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get block data for block at corresponding coordinate in the chunk
|
|
||||||
*
|
|
||||||
* @param x 0-15
|
|
||||||
* @param y 0-127
|
|
||||||
* @param z 0-15
|
|
||||||
* @return 0-15
|
|
||||||
*/
|
|
||||||
public int getBlockData(int x, int y, int z) {
|
public int getBlockData(int x, int y, int z) {
|
||||||
int off = ((x << 10) | (z << 6) | (y >> 1)) + BLOCKDATA_OFF;
|
int off = ((x << 10) | (z << 6) | (y >> 1)) + BLOCKDATA_OFF;
|
||||||
|
|
||||||
return ((y & 1) == 0) ? (buf[off] & 0xF) : ((buf[off] >> 4) & 0xF);
|
return ((y & 1) == 0) ? (buf[off] & 0xF) : ((buf[off] >> 4) & 0xF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get sky light level for block at corresponding coordinate in the chunk
|
|
||||||
*
|
|
||||||
* @param x 0-15
|
|
||||||
* @param y 0-127
|
|
||||||
* @param z 0-15
|
|
||||||
* @return 0-15
|
|
||||||
*/
|
|
||||||
public int getBlockSkyLight(int x, int y, int z) {
|
public int getBlockSkyLight(int x, int y, int z) {
|
||||||
int off = ((x << 10) | (z << 6) | (y >> 1)) + SKYLIGHT_OFF;
|
int off = ((x << 10) | (z << 6) | (y >> 1)) + SKYLIGHT_OFF;
|
||||||
|
|
||||||
return ((y & 1) == 0) ? (buf[off] & 0xF) : ((buf[off] >> 4) & 0xF);
|
return ((y & 1) == 0) ? (buf[off] & 0xF) : ((buf[off] >> 4) & 0xF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get light level emitted by block at corresponding coordinate in the chunk
|
|
||||||
*
|
|
||||||
* @param x 0-15
|
|
||||||
* @param y 0-127
|
|
||||||
* @param z 0-15
|
|
||||||
* @return 0-15
|
|
||||||
*/
|
|
||||||
public int getBlockEmittedLight(int x, int y, int z) {
|
public int getBlockEmittedLight(int x, int y, int z) {
|
||||||
int off = ((x << 10) | (z << 6) | (y >> 1)) + BLOCKLIGHT_OFF;
|
int off = ((x << 10) | (z << 6) | (y >> 1)) + BLOCKLIGHT_OFF;
|
||||||
|
|
||||||
return ((y & 1) == 0) ? (buf[off] & 0xF) : ((buf[off] >> 4) & 0xF);
|
return ((y & 1) == 0) ? (buf[off] & 0xF) : ((buf[off] >> 4) & 0xF);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the highest non-air coordinate at the given coordinates
|
|
||||||
*
|
|
||||||
* @param x X-coordinate of the blocks
|
|
||||||
* @param z Z-coordinate of the blocks
|
|
||||||
* @return Y-coordinate of the highest non-air block
|
|
||||||
*/
|
|
||||||
public int getHighestBlockYAt(int x, int z) {
|
public int getHighestBlockYAt(int x, int z) {
|
||||||
return hmap[z << 4 | x] & 255;
|
return hmap[z << 4 | x] & 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get biome at given coordinates
|
|
||||||
*
|
|
||||||
* @param x X-coordinate
|
|
||||||
* @param z Z-coordinate
|
|
||||||
* @return Biome at given coordinate
|
|
||||||
*/
|
|
||||||
public Biome getBiome(int x, int z) {
|
public Biome getBiome(int x, int z) {
|
||||||
return CraftBlock.biomeBaseToBiome(biome[z << 4 | x]);
|
return CraftBlock.biomeBaseToBiome(biome[z << 4 | x]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get raw biome temperature (0.0-1.0) at given coordinate
|
|
||||||
*
|
|
||||||
* @param x X-coordinate
|
|
||||||
* @param z Z-coordinate
|
|
||||||
* @return temperature at given coordinate
|
|
||||||
*/
|
|
||||||
public double getRawBiomeTemperature(int x, int z) {
|
public double getRawBiomeTemperature(int x, int z) {
|
||||||
return biomeTemp[z << 4 | x];
|
return biomeTemp[z << 4 | x];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get raw biome rainfall (0.0-1.0) at given coordinate
|
|
||||||
*
|
|
||||||
* @param x X-coordinate
|
|
||||||
* @param z Z-coordinate
|
|
||||||
* @return rainfall at given coordinate
|
|
||||||
*/
|
|
||||||
public double getRawBiomeRainfall(int x, int z) {
|
public double getRawBiomeRainfall(int x, int z) {
|
||||||
return biomeRain[z << 4 | x];
|
return biomeRain[z << 4 | x];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get world full time when chunk snapshot was captured
|
|
||||||
* @return time in ticks
|
|
||||||
*/
|
|
||||||
public long getCaptureFullTime() {
|
public long getCaptureFullTime() {
|
||||||
return captureFulltime;
|
return captureFulltime;
|
||||||
}
|
}
|
||||||
|
@ -372,7 +372,6 @@ public final class CraftServer implements Server {
|
|||||||
return server;
|
return server;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// NOTE: Should only be called from MinecraftServer.b()
|
// NOTE: Should only be called from MinecraftServer.b()
|
||||||
public boolean dispatchCommand(CommandSender sender, ServerCommand serverCommand) {
|
public boolean dispatchCommand(CommandSender sender, ServerCommand serverCommand) {
|
||||||
return dispatchCommand(sender, serverCommand.command);
|
return dispatchCommand(sender, serverCommand.command);
|
||||||
@ -918,8 +917,7 @@ public final class CraftServer implements Server {
|
|||||||
int spaceLeft = 16 - oldName.length();
|
int spaceLeft = 16 - oldName.length();
|
||||||
|
|
||||||
if (spaceLeft <= 1) { // We also hit the list name length limit!
|
if (spaceLeft <= 1) { // We also hit the list name length limit!
|
||||||
entityPlayer.listName = oldName.subSequence(0, oldName.length() - 2 - spaceLeft)
|
entityPlayer.listName = oldName.subSequence(0, oldName.length() - 2 - spaceLeft) + String.valueOf(System.currentTimeMillis() % 99);
|
||||||
+ String.valueOf(System.currentTimeMillis() % 99);
|
|
||||||
} else {
|
} else {
|
||||||
entityPlayer.listName = oldName + String.valueOf(System.currentTimeMillis() % 99);
|
entityPlayer.listName = oldName + String.valueOf(System.currentTimeMillis() % 99);
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,6 @@ public class CraftWorld implements World {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isChunkInUse(int x, int z) {
|
public boolean isChunkInUse(int x, int z) {
|
||||||
Player[] players = server.getOnlinePlayers();
|
Player[] players = server.getOnlinePlayers();
|
||||||
|
|
||||||
@ -802,7 +801,8 @@ public class CraftWorld implements World {
|
|||||||
dir = 2;
|
dir = 2;
|
||||||
break;
|
break;
|
||||||
case SOUTH:
|
case SOUTH:
|
||||||
dir = 3;;
|
dir = 3;
|
||||||
|
;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir);
|
entity = new EntityPainting(world, (int) x, (int) y, (int) z, dir);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.bukkit.craftbukkit;
|
package org.bukkit.craftbukkit;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -137,7 +137,6 @@ public class PortalTravelAgent implements TravelAgent {
|
|||||||
public boolean createPortal(Location location) {
|
public boolean createPortal(Location location) {
|
||||||
net.minecraft.server.World world = ((CraftWorld) location.getWorld()).getHandle();
|
net.minecraft.server.World world = ((CraftWorld) location.getWorld()).getHandle();
|
||||||
|
|
||||||
|
|
||||||
if (location.getWorld().getEnvironment() == Environment.THE_END) {
|
if (location.getWorld().getEnvironment() == Environment.THE_END) {
|
||||||
int i = MathHelper.floor(location.getBlockX());
|
int i = MathHelper.floor(location.getBlockX());
|
||||||
int j = MathHelper.floor(location.getBlockY()) - 1;
|
int j = MathHelper.floor(location.getBlockY()) - 1;
|
||||||
@ -401,9 +400,6 @@ public class PortalTravelAgent implements TravelAgent {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public TravelAgent setSearchRadius(int radius) {
|
public TravelAgent setSearchRadius(int radius) {
|
||||||
this.searchRadius = radius;
|
this.searchRadius = radius;
|
||||||
return this;
|
return this;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package org.bukkit.craftbukkit;
|
package org.bukkit.craftbukkit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Credits for this class goes to user aioobe on stackoverflow.com
|
* Credits for this class goes to user aioobe on stackoverflow.com
|
||||||
* Source: http://stackoverflow.com/questions/4454630/j2me-calculate-the-the-distance-between-2-latitude-and-longitude
|
* Source: http://stackoverflow.com/questions/4454630/j2me-calculate-the-the-distance-between-2-latitude-and-longitude
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class TrigMath {
|
public class TrigMath {
|
||||||
|
|
||||||
|
@ -36,56 +36,26 @@ public class CraftBlockState implements BlockState {
|
|||||||
return new CraftBlockState(world.getWorld().getBlockAt(x, y, z));
|
return new CraftBlockState(world.getWorld().getBlockAt(x, y, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the world which contains this Block
|
|
||||||
*
|
|
||||||
* @return World containing this block
|
|
||||||
*/
|
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
return world;
|
return world;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the x-coordinate of this block
|
|
||||||
*
|
|
||||||
* @return x-coordinate
|
|
||||||
*/
|
|
||||||
public int getX() {
|
public int getX() {
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the y-coordinate of this block
|
|
||||||
*
|
|
||||||
* @return y-coordinate
|
|
||||||
*/
|
|
||||||
public int getY() {
|
public int getY() {
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the z-coordinate of this block
|
|
||||||
*
|
|
||||||
* @return z-coordinate
|
|
||||||
*/
|
|
||||||
public int getZ() {
|
public int getZ() {
|
||||||
return z;
|
return z;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the chunk which contains this block
|
|
||||||
*
|
|
||||||
* @return Containing Chunk
|
|
||||||
*/
|
|
||||||
public Chunk getChunk() {
|
public Chunk getChunk() {
|
||||||
return chunk;
|
return chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the metadata for this block
|
|
||||||
*
|
|
||||||
* @param data New block specific metadata
|
|
||||||
*/
|
|
||||||
public void setData(final MaterialData data) {
|
public void setData(final MaterialData data) {
|
||||||
Material mat = getType();
|
Material mat = getType();
|
||||||
|
|
||||||
@ -101,29 +71,14 @@ public class CraftBlockState implements BlockState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the metadata for this block
|
|
||||||
*
|
|
||||||
* @return block specific metadata
|
|
||||||
*/
|
|
||||||
public MaterialData getData() {
|
public MaterialData getData() {
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the type of this block
|
|
||||||
*
|
|
||||||
* @param type Material to change this block to
|
|
||||||
*/
|
|
||||||
public void setType(final Material type) {
|
public void setType(final Material type) {
|
||||||
setTypeId(type.getId());
|
setTypeId(type.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the type-id of this block
|
|
||||||
*
|
|
||||||
* @param type Type-Id to change this block to
|
|
||||||
*/
|
|
||||||
public boolean setTypeId(final int type) {
|
public boolean setTypeId(final int type) {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
|
||||||
@ -131,29 +86,14 @@ public class CraftBlockState implements BlockState {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type of this block
|
|
||||||
*
|
|
||||||
* @return block type
|
|
||||||
*/
|
|
||||||
public Material getType() {
|
public Material getType() {
|
||||||
return Material.getMaterial(getTypeId());
|
return Material.getMaterial(getTypeId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the type-id of this block
|
|
||||||
*
|
|
||||||
* @return block type-id
|
|
||||||
*/
|
|
||||||
public int getTypeId() {
|
public int getTypeId() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the light level between 0-15
|
|
||||||
*
|
|
||||||
* @return light level
|
|
||||||
*/
|
|
||||||
public byte getLightLevel() {
|
public byte getLightLevel() {
|
||||||
return light;
|
return light;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import net.minecraft.server.EntityExperienceOrb;
|
import net.minecraft.server.EntityExperienceOrb;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.server.EntityMagmaCube;
|
import net.minecraft.server.EntityMagmaCube;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.entity.MagmaCube;
|
import org.bukkit.entity.MagmaCube;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import net.minecraft.server.EntityWeather;
|
import net.minecraft.server.EntityWeather;
|
||||||
|
@ -74,6 +74,7 @@ public class CraftWolf extends CraftAnimals implements Wolf {
|
|||||||
/**
|
/**
|
||||||
* The owner's name is how MC knows and persists the Wolf's owner. Since we choose to instead use an AnimalTamer, this functionality
|
* The owner's name is how MC knows and persists the Wolf's owner. Since we choose to instead use an AnimalTamer, this functionality
|
||||||
* is used only as a backup. If the animal tamer is a player, we will store their name, otherwise we store an empty string.
|
* is used only as a backup. If the animal tamer is a player, we will store their name, otherwise we store an empty string.
|
||||||
|
*
|
||||||
* @return the owner's name, if they are a player; otherwise, the empty string or null.
|
* @return the owner's name, if they are a player; otherwise, the empty string or null.
|
||||||
*/
|
*/
|
||||||
String getOwnerName() {
|
String getOwnerName() {
|
||||||
@ -87,6 +88,7 @@ public class CraftWolf extends CraftAnimals implements Wolf {
|
|||||||
/**
|
/**
|
||||||
* Only used internally at the moment, and there to set the path to null (that is stop the thing from running around)
|
* Only used internally at the moment, and there to set the path to null (that is stop the thing from running around)
|
||||||
* TODO use this later to extend the API, when we have Path classes in Bukkit
|
* TODO use this later to extend the API, when we have Path classes in Bukkit
|
||||||
|
*
|
||||||
* @param pathentity currently the MC defined PathEntity class. Should be replaced with an API interface at some point.
|
* @param pathentity currently the MC defined PathEntity class. Should be replaced with an API interface at some point.
|
||||||
*/
|
*/
|
||||||
private void setPath(PathEntity pathentity) {
|
private void setPath(PathEntity pathentity) {
|
||||||
@ -103,8 +105,6 @@ public class CraftWolf extends CraftAnimals implements Wolf {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public EntityWolf getHandle() {
|
public EntityWolf getHandle() {
|
||||||
// It's somewhat easier to override this here, as many internal methods rely on EntityWolf specific methods.
|
|
||||||
// Doing this has no impact on anything outside this class.
|
|
||||||
return (EntityWolf) entity;
|
return (EntityWolf) entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +147,7 @@ public class CraftEventFactory {
|
|||||||
}
|
}
|
||||||
return callPlayerInteractEvent(who, action, 0, 255, 0, 0, itemstack);
|
return callPlayerInteractEvent(who, action, 0, 255, 0, 0, itemstack);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, int clickedX, int clickedY, int clickedZ, int clickedFace, ItemStack itemstack) {
|
public static PlayerInteractEvent callPlayerInteractEvent(EntityHuman who, Action action, int clickedX, int clickedY, int clickedZ, int clickedFace, ItemStack itemstack) {
|
||||||
Player player = (who == null) ? null : (Player) who.getBukkitEntity();
|
Player player = (who == null) ? null : (Player) who.getBukkitEntity();
|
||||||
CraftItemStack itemInHand = new CraftItemStack(itemstack);
|
CraftItemStack itemInHand = new CraftItemStack(itemstack);
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.bukkit.craftbukkit.generator;
|
package org.bukkit.craftbukkit.generator;
|
||||||
|
|
||||||
import net.minecraft.server.IChunkProvider;
|
import net.minecraft.server.IChunkProvider;
|
||||||
|
@ -33,7 +33,8 @@ public class CraftMapCanvas implements MapCanvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setPixel(int x, int y, byte color) {
|
public void setPixel(int x, int y, byte color) {
|
||||||
if (x < 0 || y < 0 || x >= 128 || y >= 128) return;
|
if (x < 0 || y < 0 || x >= 128 || y >= 128)
|
||||||
|
return;
|
||||||
if (buffer[y * 128 + x] != color) {
|
if (buffer[y * 128 + x] != color) {
|
||||||
buffer[y * 128 + x] = color;
|
buffer[y * 128 + x] = color;
|
||||||
mapView.worldMap.flagDirty(x, y, y);
|
mapView.worldMap.flagDirty(x, y, y);
|
||||||
@ -41,12 +42,14 @@ public class CraftMapCanvas implements MapCanvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public byte getPixel(int x, int y) {
|
public byte getPixel(int x, int y) {
|
||||||
if (x < 0 || y < 0 || x >= 128 || y >= 128) return 0;
|
if (x < 0 || y < 0 || x >= 128 || y >= 128)
|
||||||
|
return 0;
|
||||||
return buffer[y * 128 + x];
|
return buffer[y * 128 + x];
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getBasePixel(int x, int y) {
|
public byte getBasePixel(int x, int y) {
|
||||||
if (x < 0 || y < 0 || x >= 128 || y >= 128) return 0;
|
if (x < 0 || y < 0 || x >= 128 || y >= 128)
|
||||||
|
return 0;
|
||||||
return base[y * 128 + x];
|
return base[y * 128 + x];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.util;
|
|||||||
|
|
||||||
public class EntryBase {
|
public class EntryBase {
|
||||||
protected long key;
|
protected long key;
|
||||||
|
|
||||||
public EntryBase(long key) {
|
public EntryBase(long key) {
|
||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,7 @@ public class LongHashtable<V> extends LongBaseHashtable {
|
|||||||
|
|
||||||
private class Entry extends EntryBase {
|
private class Entry extends EntryBase {
|
||||||
V value;
|
V value;
|
||||||
|
|
||||||
Entry(long k, V v) {
|
Entry(long k, V v) {
|
||||||
super(k);
|
super(k);
|
||||||
this.value = v;
|
this.value = v;
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package org.bukkit.craftbukkit.util;
|
package org.bukkit.craftbukkit.util;
|
||||||
|
|
||||||
import net.minecraft.server.MinecraftServer;
|
import net.minecraft.server.MinecraftServer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user