Archiviert
13
0

Cleaned up CraftBukkit comments in NMS.

Added newlines at the end of files
Fixed improper line endings on some files
Matched start - end comments
Added some missing comments for diffs
Fixed syntax on some spots
Minimized some diff
Removed some no longer used files
Added comment on some required files with no changes
Fixed imports of items used once
Added imports for items used more than once
Dieser Commit ist enthalten in:
Wesley Wolfe 2012-07-22 01:18:00 -05:00
Ursprung 8b9aad8c2b
Commit b00de5f176
126 geänderte Dateien mit 491 neuen und 751 gelöschten Zeilen

Datei anzeigen

@ -529,7 +529,6 @@ public class Block {
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
entityhuman.a(StatisticList.C[this.id], 1);
entityhuman.c(0.025F);
if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
ItemStack itemstack = this.a_(l);

Datei anzeigen

@ -1,12 +1,9 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent;
// CraftBukkit end
import java.util.Random;
import org.bukkit.event.entity.EntityDamageByBlockEvent; // CraftBukkit
public class BlockCactus extends Block {
protected BlockCactus(int i, int j) {
@ -90,7 +87,7 @@ public class BlockCactus extends Block {
org.bukkit.block.Block damager = world.getWorld().getBlockAt(i, j, k);
org.bukkit.entity.Entity damagee = (entity == null) ? null : entity.getBukkitEntity();
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, EntityDamageEvent.DamageCause.CONTACT, 1);
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, org.bukkit.event.entity.EntityDamageEvent.DamageCause.CONTACT, 1);
world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {

Datei anzeigen

@ -94,4 +94,4 @@ public class BlockCauldron extends Block {
public int getDropType(int i, Random random, int j) {
return Item.CAULDRON.id;
}
}
}

Datei anzeigen

@ -5,7 +5,6 @@ import java.util.Random;
// CraftBukkit start
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.block.BlockDispenseEvent;
import org.bukkit.util.Vector;
// CraftBukkit end
public class BlockDispenser extends BlockContainer {
@ -125,7 +124,7 @@ public class BlockDispenser extends BlockContainer {
org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k);
org.bukkit.inventory.ItemStack bukkitItem = new CraftItemStack(itemstack).clone();
BlockDispenseEvent event = new BlockDispenseEvent(block, bukkitItem, new Vector(motX, motY, motZ));
BlockDispenseEvent event = new BlockDispenseEvent(block, bukkitItem, new org.bukkit.util.Vector(motX, motY, motZ));
world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {

Datei anzeigen

@ -2,6 +2,8 @@ package net.minecraft.server;
import java.util.Random;
import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit
public class BlockDragonEgg extends Block {
public BlockDragonEgg(int i, int j) {
@ -64,14 +66,15 @@ public class BlockDragonEgg extends Block {
// CraftBukkit start
org.bukkit.block.Block from = world.getWorld().getBlockAt(i, j, k);
org.bukkit.block.Block to = world.getWorld().getBlockAt(i1, j1, k1);
org.bukkit.event.block.BlockFromToEvent event = new org.bukkit.event.block.BlockFromToEvent(from, to);
BlockFromToEvent event = new BlockFromToEvent(from, to);
org.bukkit.Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
i1 = event.getToBlock().getX();
j1 = event.getToBlock().getY();
k1 = event.getToBlock().getZ();
} else return;
if (event.isCancelled()) {
return;
}
i1 = event.getToBlock().getX();
j1 = event.getToBlock().getY();
k1 = event.getToBlock().getZ();
// CraftBukkit end
world.setTypeIdAndData(i1, j1, k1, this.id, world.getData(i, j, k));

Datei anzeigen

@ -3,12 +3,9 @@ package net.minecraft.server;
import java.util.Random;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.material.MaterialData;
// CraftBukkit end
public class BlockFire extends Block {
@ -109,7 +106,7 @@ public class BlockFire extends Block {
org.bukkit.Server server = world.getServer();
org.bukkit.World bworld = world.getWorld();
IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SPREAD;
BlockIgniteEvent.IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SPREAD;
org.bukkit.block.Block fromBlock = bworld.getBlockAt(i, j, k);
// CraftBukkit end
@ -151,7 +148,7 @@ public class BlockFire extends Block {
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, k1, j1).getState();
blockState.setTypeId(this.id);
blockState.setData(new MaterialData(this.id, (byte) k2));
blockState.setData(new org.bukkit.material.MaterialData(this.id, (byte) k2));
BlockSpreadEvent spreadEvent = new BlockSpreadEvent(blockState.getBlock(), fromBlock, blockState);
server.getPluginManager().callEvent(spreadEvent);
@ -261,7 +258,7 @@ public class BlockFire extends Block {
}
// CraftBukkit start
private void fireExtinguished(World world, int x, int y, int z) {
if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(x, y, z), 0).isCancelled() == false) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(x, y, z), 0).isCancelled() == false) {
world.setTypeId(x, y, z, 0);
}
}

Datei anzeigen

@ -3,6 +3,7 @@ package net.minecraft.server;
import java.util.Random;
// CraftBukkit start
import org.bukkit.block.BlockState;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.block.BlockFadeEvent;
// CraftBukkit end
@ -24,7 +25,7 @@ public class BlockGrass extends Block {
if (world.getLightLevel(i, j + 1, k) < 4 && Block.lightBlock[world.getTypeId(i, j + 1, k)] > 2) {
// CraftBukkit start - reuse getLightLevel
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i, j, k).getState();
BlockState blockState = bworld.getBlockAt(i, j, k).getState();
blockState.setTypeId(Block.DIRT.id);
BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState);
@ -44,7 +45,7 @@ public class BlockGrass extends Block {
if (world.getTypeId(i1, j1, k1) == Block.DIRT.id && world.getLightLevel(i1, j1 + 1, k1) >= 4 && Block.lightBlock[l1] <= 2) {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
blockState.setTypeId(this.id);
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState);

Datei anzeigen

@ -1,7 +1,6 @@
package net.minecraft.server;
import java.util.Random;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockIce extends BlockHalfTransparant {
@ -27,7 +26,7 @@ public class BlockIce extends BlockHalfTransparant {
public void a(World world, int i, int j, int k, Random random) {
if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.lightBlock[this.id]) {
// CraftBukkit start
if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) {
return;
}
// CraftBukkit end

Datei anzeigen

@ -81,7 +81,7 @@ public class BlockMinecartTrack extends Block {
if (!world.isStatic) {
this.a(world, i, j, k, true);
if (this.id == Block.GOLDEN_RAIL.id) {
// this.doPhysics(world, i, j, k, this.id); CraftBukkit - Fix issues with rails
// this.doPhysics(world, i, j, k, this.id); // CraftBukkit - Fix issues with rails
}
}
}

Datei anzeigen

@ -1,13 +1,13 @@
package net.minecraft.server;
import java.util.ArrayList;
import java.util.Random;
// CraftBukkit start
import org.bukkit.BlockChangeDelegate;
import java.util.ArrayList;
import org.bukkit.Location;
import org.bukkit.TreeType;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.world.StructureGrowEvent;
// CraftBukkit end
@ -63,7 +63,7 @@ public class BlockMushroom extends BlockFlower {
if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
blockState.setTypeId(this.id);
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState);
@ -96,7 +96,7 @@ public class BlockMushroom extends BlockFlower {
}
// CraftBukkit - added bonemeal, player and itemstack
public boolean grow(World world, int i, int j, int k, Random random, boolean bonemeal, Player player, ItemStack itemstack) {
public boolean grow(World world, int i, int j, int k, Random random, boolean bonemeal, org.bukkit.entity.Player player, ItemStack itemstack) {
int l = world.getData(i, j, k);
world.setRawTypeId(i, j, k, 0);
@ -114,7 +114,7 @@ public class BlockMushroom extends BlockFlower {
worldgenhugemushroom = new WorldGenHugeMushroom(1);
}
if (worldgenhugemushroom != null && event != null) {
grown = worldgenhugemushroom.grow((BlockChangeDelegate)world, random, i, j, k, event, itemstack, world.getWorld());
grown = worldgenhugemushroom.grow((org.bukkit.BlockChangeDelegate)world, random, i, j, k, event, itemstack, world.getWorld());
if (event.isFromBonemeal() && itemstack != null) {
--itemstack.count;
}

Datei anzeigen

@ -1,8 +1,12 @@
package net.minecraft.server;
import java.util.Random;
import org.bukkit.event.block.BlockFadeEvent; // CraftBukkit
import org.bukkit.event.block.BlockSpreadEvent; // CraftBukkit
// CraftBukkit start
import org.bukkit.block.BlockState;
import org.bukkit.event.block.BlockFadeEvent;
import org.bukkit.event.block.BlockSpreadEvent;
// CraftBukkit end
public class BlockMycel extends Block {
@ -21,7 +25,7 @@ public class BlockMycel extends Block {
if (world.getLightLevel(i, j + 1, k) < 4 && Block.lightBlock[world.getTypeId(i, j + 1, k)] > 2) {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i, j, k).getState();
BlockState blockState = bworld.getBlockAt(i, j, k).getState();
blockState.setTypeId(Block.DIRT.id);
BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState);
@ -41,7 +45,7 @@ public class BlockMycel extends Block {
if (world.getTypeId(i1, j1, k1) == Block.DIRT.id && world.getLightLevel(i1, j1 + 1, k1) >= 4 && Block.lightBlock[l1] <= 2) {
// CraftBukkit start
org.bukkit.World bworld = world.getWorld();
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState();
blockState.setTypeId(this.id);
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState);

Datei anzeigen

@ -78,7 +78,7 @@ public class BlockPortal extends BlockHalfTransparant {
if (flag) {
if (j1 != Block.OBSIDIAN.id) {
return false;
} else {
} else { // CraftBukkit
blocks.add(bworld.getBlockAt(i + b0 * l, j + i1, k + b1 * l)); // CraftBukkit
}
} else if (j1 != 0 && j1 != Block.FIRE.id) {

Datei anzeigen

@ -4,7 +4,6 @@ import java.util.List;
import java.util.Random;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockRedstoneEvent;
import org.bukkit.event.entity.EntityInteractEvent;
// CraftBukkit end
@ -110,7 +109,7 @@ public class BlockPressurePlate extends Block {
org.bukkit.event.Cancellable cancellable;
if (object instanceof EntityHuman) {
cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) object, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null);
cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) object, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null);
} else if (object instanceof Entity) {
cancellable = new EntityInteractEvent(((Entity) object).getBukkitEntity(), bworld.getBlockAt(i, j, k));
manager.callEvent((EntityInteractEvent) cancellable);

Datei anzeigen

@ -4,7 +4,6 @@ import java.util.Random;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockRedstoneEvent;
// CraftBukkit end
public class BlockRedstoneLamp extends Block {

Datei anzeigen

@ -2,6 +2,8 @@ package net.minecraft.server;
import java.util.Random;
import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
public class BlockRedstoneOre extends Block {
private boolean a;
@ -33,7 +35,7 @@ public class BlockRedstoneOre extends Block {
super.b(world, i, j, k, entity);
}
} else {
org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k));
EntityInteractEvent event = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k));
world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
this.g(world, i, j, k);

Datei anzeigen

@ -1,14 +1,11 @@
package net.minecraft.server;
import java.util.Random;
// CraftBukkit start
import org.bukkit.BlockChangeDelegate;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.TreeType;
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.util.StructureGrowDelegate;
import org.bukkit.entity.Player;
import org.bukkit.event.world.StructureGrowEvent;
// CraftBukkit end
@ -42,7 +39,7 @@ public class BlockSapling extends BlockFlower {
}
// CraftBukkit - added bonemeal, player and itemstack
public void grow(World world, int i, int j, int k, Random random, boolean bonemeal, Player player, ItemStack itemstack) {
public void grow(World world, int i, int j, int k, Random random, boolean bonemeal, org.bukkit.entity.Player player, ItemStack itemstack) {
int l = world.getData(i, j, k) & 3;
int i1 = 0;
int j1 = 0;
@ -102,11 +99,11 @@ public class BlockSapling extends BlockFlower {
if (grownTree) {
Location location = new Location(world.getWorld(), i, j, k);
StructureGrowEvent event = new StructureGrowEvent(location, treeType, bonemeal, player, delegate.getBlocks());
Bukkit.getPluginManager().callEvent(event);
org.bukkit.Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
grownTree = false;
} else {
for (BlockState state : event.getBlocks()) {
for (org.bukkit.block.BlockState state : event.getBlocks()) {
state.update(true);
}
if (event.isFromBonemeal() && itemstack != null) {
@ -140,7 +137,7 @@ public class BlockSapling extends BlockFlower {
public boolean a(World world, Random random, int i, int j, int k);
public boolean generate(BlockChangeDelegate world, Random random, int i, int j, int k);
public boolean generate(org.bukkit.BlockChangeDelegate world, Random random, int i, int j, int k);
}
// CraftBukkit end
}

Datei anzeigen

@ -1,7 +1,6 @@
package net.minecraft.server;
import java.util.Random;
import org.bukkit.craftbukkit.event.CraftEventFactory;
public class BlockSnow extends Block {
@ -78,7 +77,7 @@ public class BlockSnow extends Block {
public void a(World world, int i, int j, int k, Random random) {
if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11) {
// CraftBukkit start
if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), 0).isCancelled()) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), 0).isCancelled()) {
return;
}
// CraftBukkit end

Datei anzeigen

@ -2,10 +2,7 @@ package net.minecraft.server;
import java.util.Random;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.EntityInteractEvent;
// CraftBukkit end
import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit
public class BlockSoil extends Block {
@ -52,7 +49,7 @@ public class BlockSoil extends Block {
// CraftBukkit start - Interact Soil
org.bukkit.event.Cancellable cancellable;
if (entity instanceof EntityHuman) {
cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null);
cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null);
} else {
cancellable = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k));
world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable);

Datei anzeigen

@ -2,7 +2,10 @@ package net.minecraft.server;
import java.util.Random;
import org.bukkit.event.block.BlockIgniteEvent; // CraftBukkit
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockIgniteEvent;
// CraftBukkit end
public class BlockStationary extends BlockFluids {
@ -57,7 +60,7 @@ public class BlockStationary extends BlockFluids {
// CraftBukkit start - prevent lava putting something on fire.
org.bukkit.block.Block block = bworld.getBlockAt(i, j, k);
if (block.getTypeId() != Block.FIRE.id) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
continue;
}
}
@ -82,7 +85,7 @@ public class BlockStationary extends BlockFluids {
// CraftBukkit start - prevent lava putting something on fire.
org.bukkit.block.Block block = bworld.getBlockAt(i, j + 1, k);
if (block.getTypeId() != Block.FIRE.id) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) {
continue;
}
}

Datei anzeigen

@ -2,6 +2,8 @@ package net.minecraft.server;
import java.util.Random;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockStem extends BlockFlower {
private Block blockFruit;
@ -29,7 +31,7 @@ public class BlockStem extends BlockFlower {
if (l < 7) {
++l;
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, l); // CraftBukkit
CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, l); // CraftBukkit
} else {
if (world.getTypeId(i - 1, j, k) == this.blockFruit.id) {
return;
@ -70,7 +72,7 @@ public class BlockStem extends BlockFlower {
int l1 = world.getTypeId(j1, j - 1, k1);
if (world.getTypeId(j1, j, k1) == 0 && (l1 == Block.SOIL.id || l1 == Block.DIRT.id || l1 == Block.GRASS.id)) {
org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, j1, j, k1, this.blockFruit.id, 0); // CraftBukkit
CraftEventFactory.handleBlockGrowEvent(world, j1, j, k1, this.blockFruit.id, 0); // CraftBukkit
}
}
}

Datei anzeigen

@ -1,6 +1,6 @@
package net.minecraft.server;
import java.util.ArrayList;
// import java.util.ArrayList; // CraftBukkit
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
@ -10,6 +10,7 @@ import java.util.Random;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.util.UnsafeList;
// CraftBukkit end
@ -665,8 +666,8 @@ public class Chunk {
java.util.Iterator<Object> iter = this.entitySlices[i].iterator();
while (iter.hasNext()) {
Entity entity = (Entity) iter.next();
int cx = org.bukkit.Location.locToBlock(entity.locX) >> 4;
int cz = org.bukkit.Location.locToBlock(entity.locZ) >> 4;
int cx = Location.locToBlock(entity.locX) >> 4;
int cz = Location.locToBlock(entity.locZ) >> 4;
// Do not pass along players, as doing so can get them stuck outside of time.
// (which for example disables inventory icon updates and prevents block breaking)

Datei anzeigen

@ -9,13 +9,11 @@ import java.util.Set;
// CraftBukkit start
import java.util.Random;
import org.bukkit.craftbukkit.CraftChunk;
import org.bukkit.Server;
import org.bukkit.craftbukkit.util.LongHashset;
import org.bukkit.craftbukkit.util.LongHashtable;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.event.world.ChunkPopulateEvent;
import org.bukkit.event.world.ChunkUnloadEvent;
import org.bukkit.generator.BlockPopulator;
// CraftBukkit end
public class ChunkProviderServer implements IChunkProvider {
@ -93,14 +91,14 @@ public class ChunkProviderServer implements IChunkProvider {
}
// CraftBukkit start
org.bukkit.Server server = this.world.getServer();
Server server = this.world.getServer();
if (server != null) {
/*
* If it's a new world, the first few chunks are generated inside
* the World constructor. We can't reliably alter that, so we have
* no way of creating a CraftWorld/CraftServer at that point.
*/
server.getPluginManager().callEvent(new ChunkLoadEvent(chunk.bukkitChunk, newChunk));
server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(chunk.bukkitChunk, newChunk));
}
// CraftBukkit end
@ -185,12 +183,12 @@ public class ChunkProviderServer implements IChunkProvider {
org.bukkit.World world = this.world.getWorld();
if (world != null) {
for (BlockPopulator populator : world.getPopulators()) {
for (org.bukkit.generator.BlockPopulator populator : world.getPopulators()) {
populator.populate(world, random, chunk.bukkitChunk);
}
}
BlockSand.instaFall = false;
this.world.getServer().getPluginManager().callEvent(new ChunkPopulateEvent(chunk.bukkitChunk));
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(chunk.bukkitChunk));
// CraftBukkit end
chunk.e();
@ -232,7 +230,7 @@ public class ChunkProviderServer implements IChunkProvider {
public boolean unloadChunks() {
if (!this.world.savingDisabled) {
// CraftBukkit start
org.bukkit.Server server = this.world.getServer();
Server server = this.world.getServer();
for (int i = 0; i < 50 && !this.unloadQueue.isEmpty(); i++) {
long chunkcoordinates = this.unloadQueue.popFirst();
Chunk chunk = this.chunks.get(chunkcoordinates);

Datei anzeigen

@ -5,7 +5,6 @@ import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.File;
import java.io.IOException; // CraftBukkit
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@ -132,7 +131,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
return true;
}
public void a(PendingChunkToSave pendingchunktosave) throws IOException { // CraftBukkit - Added throws
public void a(PendingChunkToSave pendingchunktosave) throws java.io.IOException { // CraftBukkit - Added throws
DataOutputStream dataoutputstream = RegionFileCache.c(this.d, pendingchunktosave.a.x, pendingchunktosave.a.z);
NBTCompressedStreamTools.a(pendingchunktosave.b, (DataOutput) dataoutputstream);

Datei anzeigen

@ -7,11 +7,13 @@ import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.regex.Pattern; // CraftBukkit
final class ConsoleLogFormatter extends Formatter {
private SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// CraftBukkit start - add color stripping, change constructor to take it
private java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]");
private Pattern pattern = Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]");
private boolean strip = false;
ConsoleLogFormatter(boolean strip) {

Datei anzeigen

@ -5,20 +5,14 @@ import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
// CraftBukkit start
import java.io.File;
import java.util.logging.Handler;
import org.bukkit.craftbukkit.util.ShortConsoleLogFormatter;
import org.bukkit.craftbukkit.util.TerminalConsoleHandler;
// CraftBukkit end
import java.io.File; // CraftBukkit
public class ConsoleLogManager {
public static Logger a = Logger.getLogger("Minecraft");
public static Logger global = Logger.getLogger(""); // CraftBukkit
public ConsoleLogManager() {
}
public ConsoleLogManager() {}
// CraftBukkit - change of method signature!
public static void init(MinecraftServer server) {
@ -26,13 +20,13 @@ public class ConsoleLogManager {
a.setUseParentHandlers(false);
// CraftBukkit start
ConsoleHandler consolehandler = new TerminalConsoleHandler(server.reader);
ConsoleHandler consolehandler = new org.bukkit.craftbukkit.util.TerminalConsoleHandler(server.reader);
for (Handler handler : global.getHandlers()) {
for (java.util.logging.Handler handler : global.getHandlers()) {
global.removeHandler(handler);
}
consolehandler.setFormatter(new ShortConsoleLogFormatter(server));
consolehandler.setFormatter(new org.bukkit.craftbukkit.util.ShortConsoleLogFormatter(server));
global.addHandler(consolehandler);
// CraftBukkit end

Datei anzeigen

@ -6,7 +6,6 @@ import java.util.List;
import java.util.Set;
// CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.InventoryView;
// CraftBukkit end
@ -23,7 +22,7 @@ public abstract class Container {
// CraftBukkit start
public boolean checkReachable = true;
public abstract InventoryView getBukkitView();
public void transferTo(Container other, CraftHumanEntity player) {
public void transferTo(Container other, org.bukkit.craftbukkit.entity.CraftHumanEntity player) {
InventoryView source = this.getBukkitView(), destination = other.getBukkitView();
((CraftInventory) source.getTopInventory()).getInventory().onClose(player);
((CraftInventory) source.getBottomInventory()).getInventory().onClose(player);

Datei anzeigen

@ -2,8 +2,6 @@ package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest;
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
// CraftBukkit end
@ -21,9 +19,9 @@ public class ContainerChest extends Container {
}
CraftInventory inventory;
if (this.container instanceof PlayerInventory) {
inventory = new CraftInventoryPlayer((PlayerInventory) this.container);
inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryPlayer((PlayerInventory) this.container);
} else if (this.container instanceof InventoryLargeChest) {
inventory = new CraftInventoryDoubleChest((InventoryLargeChest) this.container);
inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) this.container);
} else {
inventory = new CraftInventory(this.container);
}

Datei anzeigen

@ -1,12 +1,11 @@
package net.minecraft.server;
import java.util.Iterator;
// import java.util.Iterator; // CraftBukkit
import java.util.List;
import java.util.Random;
// CraftBukkit start
import java.util.Map;
import java.util.HashMap;
import org.bukkit.craftbukkit.inventory.CraftInventoryEnchanting;
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
@ -154,7 +153,7 @@ public class ContainerEnchantTable extends Container {
if (list != null) {
// CraftBukkit start
Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new HashMap<org.bukkit.enchantments.Enchantment, Integer>();
Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new java.util.HashMap<org.bukkit.enchantments.Enchantment, Integer>();
for (Object obj : list) {
EnchantmentInstance instance = (EnchantmentInstance) obj;
enchants.put(org.bukkit.enchantments.Enchantment.getById(instance.enchantment.id), instance.level);

Datei anzeigen

@ -1,12 +1,10 @@
package net.minecraft.server;
import java.util.ArrayList;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
public class ContainerEnchantTableSubcontainer implements IInventory {
@ -17,7 +15,7 @@ public class ContainerEnchantTableSubcontainer implements IInventory {
private List d;
// CraftBukkit start
public List<HumanEntity> transaction = new ArrayList<HumanEntity>();
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
public org.bukkit.entity.Player player;
private int maxStack = MAX_STACK;
@ -37,7 +35,7 @@ public class ContainerEnchantTableSubcontainer implements IInventory {
return transaction;
}
public InventoryHolder getOwner() {
public org.bukkit.inventory.InventoryHolder getOwner() {
return this.player;
}

Datei anzeigen

@ -4,10 +4,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.inventory.InventoryView;
// CraftBukkit end
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class CraftingManager {
@ -15,7 +13,7 @@ public class CraftingManager {
public List recipies = new ArrayList(); // CraftBukkit - private -> public
// CraftBukkit start
public CraftingRecipe lastRecipe;
public InventoryView lastCraftView;
public org.bukkit.inventory.InventoryView lastCraftView;
// CraftBukkit end
public static final CraftingManager getInstance() {

Datei anzeigen

@ -1,7 +1,5 @@
package net.minecraft.server;
import org.bukkit.inventory.Recipe; // CraftBukkit
public interface CraftingRecipe {
boolean a(InventoryCrafting inventorycrafting);
@ -11,6 +9,6 @@ public interface CraftingRecipe {
int a();
ItemStack b();
Recipe toBukkitRecipe(); // CraftBukkit
org.bukkit.inventory.Recipe toBukkitRecipe(); // CraftBukkit
}

Datei anzeigen

@ -1,7 +1,5 @@
package net.minecraft.server;
import org.bukkit.craftbukkit.enchantments.CraftEnchantment;
public abstract class Enchantment {
// CraftBukkit - update CraftEnchant.getName(i) if this changes.
public static final Enchantment[] byId = new Enchantment[256];
@ -41,7 +39,7 @@ public abstract class Enchantment {
byId[i] = this;
}
org.bukkit.enchantments.Enchantment.registerEnchantment(new CraftEnchantment(this)); // CraftBukkit
org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment(this)); // CraftBukkit
}
public int getRandomWeight() {

Datei anzeigen

@ -1,17 +0,0 @@
package net.minecraft.server;
final class EnchantmentModifierDamage implements EnchantmentModifier {
public int a;
public EntityLiving b;
private EnchantmentModifierDamage() {}
public void a(Enchantment enchantment, int i) {
this.a += enchantment.a(i, this.b);
}
EnchantmentModifierDamage(EmptyClass3 emptyclass3) {
this();
}
}

Datei anzeigen

@ -1,17 +0,0 @@
package net.minecraft.server;
final class EnchantmentModifierProtection implements EnchantmentModifier {
public int a;
public DamageSource b;
private EnchantmentModifierProtection() {}
public void a(Enchantment enchantment, int i) {
this.a += enchantment.a(i, this.b);
}
EnchantmentModifierProtection(EmptyClass3 emptyclass3) {
this();
}
}

Datei anzeigen

@ -5,17 +5,19 @@ import java.util.Random;
// CraftBukkit start
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Painting;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.entity.EntityCombustByBlockEvent;
import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
import org.bukkit.event.vehicle.VehicleEnterEvent;
import org.bukkit.event.vehicle.VehicleExitEvent;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageByBlockEvent;
@ -381,7 +383,7 @@ public abstract class Entity {
if (!this.fireProof) {
// CraftBukkit start - fallen in lava TODO: this event spams!
if (this instanceof EntityLiving) {
org.bukkit.Server server = this.world.getServer();
Server server = this.world.getServer();
// TODO: shouldn't be sending null for the block.
org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k);
@ -397,7 +399,7 @@ public abstract class Entity {
if (this.fireTicks <= 0) {
// not on fire yet
EntityCombustEvent combustEvent = new EntityCombustByBlockEvent(damager, damagee, 15);
EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15);
server.getPluginManager().callEvent(combustEvent);
if (!combustEvent.isCancelled()) {
@ -895,7 +897,7 @@ public abstract class Entity {
// CraftBukkit start
if (world == null) {
this.die();
this.world = ((org.bukkit.craftbukkit.CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle();
this.world = ((CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle();
return;
}
// CraftBukkit end
@ -1124,7 +1126,7 @@ public abstract class Entity {
// CraftBukkit start - reset world
if (this instanceof EntityPlayer) {
org.bukkit.Server server = Bukkit.getServer();
Server server = Bukkit.getServer();
org.bukkit.World bworld = null;
// TODO: Remove World related checks, replaced with WorldUID.
@ -1141,7 +1143,7 @@ public abstract class Entity {
bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getWorldServer(entityPlayer.dimension).getWorld();
}
this.spawnIn(bworld == null ? null : ((org.bukkit.craftbukkit.CraftWorld) bworld).getHandle());
this.spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle());
}
// CraftBukkit end
}

Datei anzeigen

@ -1,8 +1,5 @@
package net.minecraft.server;
import java.util.List;
import org.bukkit.craftbukkit.event.CraftEventFactory;
public class EntityBlaze extends EntityMonster {
private float a = 0.5F;
@ -144,14 +141,14 @@ public class EntityBlaze extends EntityMonster {
protected void dropDeathLoot(boolean flag, int i) {
if (flag) {
// CraftBukkit start
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int j = this.random.nextInt(2 + i);
if (j > 0) {
loot.add(new org.bukkit.inventory.ItemStack(Item.BLAZE_ROD.id, j));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}
}

Datei anzeigen

@ -5,13 +5,10 @@ import java.util.List;
// CraftBukkit start
import org.bukkit.Location;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.event.vehicle.VehicleDamageEvent;
import org.bukkit.event.vehicle.VehicleDestroyEvent;
import org.bukkit.event.vehicle.VehicleEnterEvent;
import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
import org.bukkit.event.vehicle.VehicleMoveEvent;
import org.bukkit.event.vehicle.VehicleUpdateEvent;
// CraftBukkit end
public class EntityBoat extends Entity {
@ -83,7 +80,7 @@ public class EntityBoat extends Entity {
this.lastY = d1;
this.lastZ = d2;
this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
}
public double x_() {
@ -307,7 +304,6 @@ public class EntityBoat extends Entity {
this.world.getServer().getPluginManager().callEvent(destroyEvent);
if (!destroyEvent.isCancelled()) {
// CraftBukkit end
this.die();
int k;
@ -319,7 +315,8 @@ public class EntityBoat extends Entity {
for (k = 0; k < 2; ++k) {
this.a(Item.STICK.id, 1, 0.0F);
}
} // CraftBukkit
}
// CraftBukkit end
}
} else {
this.motX *= 0.9900000095367432D;
@ -364,7 +361,7 @@ public class EntityBoat extends Entity {
Location to = new Location(bworld, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
server.getPluginManager().callEvent(new VehicleUpdateEvent(vehicle));
server.getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleUpdateEvent(vehicle));
if (!from.equals(to)) {
VehicleMoveEvent event = new VehicleMoveEvent(vehicle, from, to);

Datei anzeigen

@ -1,10 +1,5 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.List;
import org.bukkit.craftbukkit.event.CraftEventFactory;
// CraftBukkit end
public class EntityChicken extends EntityAnimal {
public boolean a = false;
@ -98,7 +93,7 @@ public class EntityChicken extends EntityAnimal {
protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start - whole method
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int j = this.random.nextInt(3) + this.random.nextInt(1 + i);
if (j > 0) {
@ -111,7 +106,7 @@ public class EntityChicken extends EntityAnimal {
loot.add(new org.bukkit.inventory.ItemStack(Item.RAW_CHICKEN.id, 1));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}

Datei anzeigen

@ -1,13 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.List;
import org.bukkit.Location;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.player.PlayerBucketFillEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class EntityCow extends EntityAnimal {
@ -64,7 +57,7 @@ public class EntityCow extends EntityAnimal {
protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start - whole method
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int j = this.random.nextInt(3) + this.random.nextInt(1 + i);
if (j > 0) {
@ -86,14 +79,14 @@ public class EntityCow extends EntityAnimal {
if (itemstack != null && itemstack.id == Item.BUCKET.id) {
// CraftBukkit start - got milk?
Location loc = this.getBukkitEntity().getLocation();
PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET);
org.bukkit.Location loc = this.getBukkitEntity().getLocation();
org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET);
if (event.isCancelled()) {
return false;
}
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, CraftItemStack.createNMSItemStack(event.getItemStack()));
entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, org.bukkit.craftbukkit.inventory.CraftItemStack.createNMSItemStack(event.getItemStack()));
// CraftBukkit end
return true;

Datei anzeigen

@ -2,7 +2,6 @@ package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.TrigMath;
import org.bukkit.event.entity.EntityTargetEvent;
// CraftBukkit end
@ -106,7 +105,7 @@ public abstract class EntityCreature extends EntityLiving {
double d2 = vec3d.c - this.locZ;
double d3 = vec3d.b - (double) i;
// CraftBukkit - Math -> TrigMath
float f2 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
float f2 = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F;
float f3 = f2 - this.yaw;
for (this.aX = this.bb; f3 < -180.0F; f3 += 360.0F) {

Datei anzeigen

@ -1,8 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.List;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.ExplosionPrimeEvent;
// CraftBukkit end
@ -110,7 +108,7 @@ public class EntityCreeper extends EntityMonster {
protected void dropDeathLoot(boolean flag, int i) {
int j = this.getLootId();
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
if (j > 0) {
int k = this.random.nextInt(3);
@ -158,7 +156,7 @@ public class EntityCreeper extends EntityMonster {
super.a(entityweatherlighting);
// CraftBukkit start
if (org.bukkit.craftbukkit.event.CraftEventFactory.callCreeperPowerEvent(this, entityweatherlighting, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) {
if (CraftEventFactory.callCreeperPowerEvent(this, entityweatherlighting, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) {
return;
}

Datei anzeigen

@ -1,9 +1,9 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.Location;
import org.bukkit.entity.Ageable;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.event.player.PlayerEggThrowEvent;
// CraftBukkit end
@ -37,7 +37,7 @@ public class EntityEgg extends EntityProjectile {
EntityType hatchingType = EntityType.CHICKEN;
if (this.shooter instanceof EntityPlayer) {
org.bukkit.entity.Player player = (this.shooter == null) ? null : (org.bukkit.entity.Player) this.shooter.getBukkitEntity();
Player player = (this.shooter == null) ? null : (Player) this.shooter.getBukkitEntity();
PlayerEggThrowEvent event = new PlayerEggThrowEvent(player, (org.bukkit.entity.Egg) this.getBukkitEntity(), hatching, (byte) numHatching, hatchingType);
this.world.getServer().getPluginManager().callEvent(event);
@ -49,7 +49,7 @@ public class EntityEgg extends EntityProjectile {
if (hatching) {
for (int k = 0; k < numHatching; k++) {
org.bukkit.entity.Entity entity = world.getWorld().spawn(new Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass(), SpawnReason.EGG);
org.bukkit.entity.Entity entity = world.getWorld().spawn(new org.bukkit.Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass(), SpawnReason.EGG);
if (entity instanceof Ageable) {
((Ageable) entity).setBaby();

Datei anzeigen

@ -4,9 +4,12 @@ import java.util.Iterator;
import java.util.List;
// CraftBukkit start
import java.util.ArrayList;
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.util.BlockStateListPopulator;
import org.bukkit.event.entity.EntityCreatePortalEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.Bukkit;
// CraftBukkit end
@ -339,7 +342,7 @@ public class EntityEnderDragon extends EntityComplex {
this.s = null;
} else if (this.ticksLived % 10 == 0 && this.health < this.t) {
// CraftBukkit start
org.bukkit.event.entity.EntityRegainHealthEvent event = new org.bukkit.event.entity.EntityRegainHealthEvent(this.getBukkitEntity(), 1, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL);
EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@ -398,7 +401,7 @@ public class EntityEnderDragon extends EntityComplex {
// CraftBukkit start - throw damage events when the dragon attacks
// The EntityHuman case is handled in EntityHuman, so don't throw it here
if (!(entity instanceof EntityHuman)) {
org.bukkit.event.entity.EntityDamageByEntityEvent damageEvent = new org.bukkit.event.entity.EntityDamageByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, 10);
EntityDamageByEntityEvent damageEvent = new EntityDamageByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, 10);
Bukkit.getPluginManager().callEvent(damageEvent);
if (!damageEvent.isCancelled()) {
@ -460,7 +463,7 @@ public class EntityEnderDragon extends EntityComplex {
boolean flag1 = false;
// CraftBukkit start - create a list to hold all the destroyed blocks
List<org.bukkit.block.Block> destroyedBlocks = new ArrayList<org.bukkit.block.Block>();
List<org.bukkit.block.Block> destroyedBlocks = new java.util.ArrayList<org.bukkit.block.Block>();
org.bukkit.craftbukkit.CraftWorld craftWorld = this.world.getWorld();
// CraftBukkit end
for (int k1 = i; k1 <= l; ++k1) {
@ -486,7 +489,7 @@ public class EntityEnderDragon extends EntityComplex {
if (flag1) {
// CraftBukkit start - set off an EntityExplodeEvent for the dragon exploding all these blocks
org.bukkit.entity.Entity bukkitEntity = this.getBukkitEntity();
org.bukkit.event.entity.EntityExplodeEvent event = new org.bukkit.event.entity.EntityExplodeEvent(bukkitEntity, bukkitEntity.getLocation(), destroyedBlocks, 0F);
EntityExplodeEvent event = new EntityExplodeEvent(bukkitEntity, bukkitEntity.getLocation(), destroyedBlocks, 0F);
Bukkit.getPluginManager().callEvent(event);
if (event.isCancelled()) {
// this flag literally means 'Dragon hit something hard' (Obsidian, White Stone or Bedrock) and will cause the dragon to slow down.
@ -575,7 +578,7 @@ public class EntityEnderDragon extends EntityComplex {
byte b1 = 4;
// CraftBukkit start - Replace any "this.world" in the following with just "world"!
org.bukkit.craftbukkit.util.BlockStateListPopulator world = new org.bukkit.craftbukkit.util.BlockStateListPopulator(this.world.getWorld());
BlockStateListPopulator world = new BlockStateListPopulator(this.world.getWorld());
for (int k = b0 - 1; k <= b0 + 32; ++k) {
for (int l = i - b1; l <= i + b1; ++l) {
@ -611,7 +614,7 @@ public class EntityEnderDragon extends EntityComplex {
world.setTypeId(i, b0 + 3, j, Block.BEDROCK.id);
world.setTypeId(i, b0 + 4, j, Block.DRAGON_EGG.id);
org.bukkit.event.entity.EntityCreatePortalEvent event = new org.bukkit.event.entity.EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), java.util.Collections.unmodifiableList(world.getList()), org.bukkit.PortalType.ENDER);
EntityCreatePortalEvent event = new EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), java.util.Collections.unmodifiableList(world.getList()), org.bukkit.PortalType.ENDER);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {

Datei anzeigen

@ -5,7 +5,6 @@ import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.Location;
// CraftBukkit end
public class EntityEnderPearl extends EntityProjectile {
@ -40,7 +39,7 @@ public class EntityEnderPearl extends EntityProjectile {
if (this.shooter instanceof EntityPlayer) {
CraftPlayer player = (CraftPlayer) this.shooter.bukkitEntity;
teleport = player.isOnline() && player.getWorld() == getBukkitEntity().getWorld();
Location location = getBukkitEntity().getLocation();
org.bukkit.Location location = getBukkitEntity().getLocation();
location.setPitch(player.getLocation().getPitch());
location.setYaw(player.getLocation().getYaw());

Datei anzeigen

@ -1,8 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.List;
import org.bukkit.Location;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.EntityTeleportEvent;
@ -288,7 +286,7 @@ public class EntityEnderman extends EntityMonster {
if (j > 0) {
// CraftBukkit start - whole method
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int count = this.random.nextInt(2 + i);
if ((j > 0) && (count > 0)) {

Datei anzeigen

@ -1,6 +1,9 @@
package net.minecraft.server;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.EntityTargetEvent;
// CraftBukkit end
public class EntityExperienceOrb extends Entity {
@ -57,7 +60,7 @@ public class EntityExperienceOrb extends Entity {
if (entityhuman != null) {
// CraftBukkit start
org.bukkit.event.entity.EntityTargetEvent event = CraftEventFactory.callEntityTargetEvent(this, entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
EntityTargetEvent event = CraftEventFactory.callEntityTargetEvent(this, entityhuman, EntityTargetEvent.TargetReason.CLOSEST_PLAYER);
Entity target = event.getTarget() == null ? null : ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle();
if (!event.isCancelled() && target != null) {

Datei anzeigen

@ -3,8 +3,6 @@ package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.entity.Explosive;
import org.bukkit.event.entity.ExplosionPrimeEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
// CraftBukkit end
@ -198,7 +196,7 @@ public class EntityFireball extends Entity {
;
}
// CraftBukkit start
ExplosionPrimeEvent event = new ExplosionPrimeEvent((Explosive) CraftEntity.getEntity(this.world.getServer(), this));
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.world.getServer(), this));
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {

Datei anzeigen

@ -2,7 +2,10 @@ package net.minecraft.server;
import java.util.List;
import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit
// CraftBukkit start
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerFishEvent;
// CraftBukkit end
public class EntityFishingHook extends Entity {
@ -312,7 +315,7 @@ public class EntityFishingHook extends Entity {
if (this.hooked != null) {
// CraftBukkit start
PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY);
PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY);
this.world.getServer().getPluginManager().callEvent(playerFishEvent);
if (playerFishEvent.isCancelled()) {
@ -335,7 +338,7 @@ public class EntityFishingHook extends Entity {
} else if (this.k > 0) {
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.RAW_FISH));
// CraftBukkit start
PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), entityitem.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_FISH);
PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), entityitem.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_FISH);
this.world.getServer().getPluginManager().callEvent(playerFishEvent);
if (playerFishEvent.isCancelled()) {
@ -361,7 +364,7 @@ public class EntityFishingHook extends Entity {
if (this.h) {
// CraftBukkit start
PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.IN_GROUND);
PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.IN_GROUND);
this.world.getServer().getPluginManager().callEvent(playerFishEvent);
if (playerFishEvent.isCancelled()) {
@ -375,7 +378,7 @@ public class EntityFishingHook extends Entity {
// CraftBukkit start
if (b0 == 0) {
PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.FAILED_ATTEMPT);
PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.FAILED_ATTEMPT);
this.world.getServer().getPluginManager().callEvent(playerFishEvent);
}
// CraftBukkit end

Datei anzeigen

@ -1,9 +1,7 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.EntityTargetEvent;
// CraftBukkit end
@ -200,7 +198,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int j = this.random.nextInt(2) + this.random.nextInt(1 + i);
int k;
@ -215,7 +213,7 @@ public class EntityGhast extends EntityFlying implements IMonster {
loot.add(new CraftItemStack(Item.SULPHUR.id, j));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}

Datei anzeigen

@ -4,9 +4,7 @@ import java.util.Iterator;
import java.util.List;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.entity.CraftItem;
import org.bukkit.craftbukkit.TrigMath;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityCombustByEntityEvent;
@ -319,7 +317,7 @@ public abstract class EntityHuman extends EntityLiving {
float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ);
// CraftBukkit - Math -> TrigMath
float f1 = (float) TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F;
float f1 = (float) org.bukkit.craftbukkit.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F;
if (f > 0.1F) {
f = 0.1F;
@ -577,10 +575,9 @@ public abstract class EntityHuman extends EntityLiving {
i = i * 3 / 2;
}
}
/* CraftBukkit start - Don't filter out 0 damage
if (i == 0) {
if (false && i == 0) { // CraftBukkit - Don't filter out 0 damage
return false;
} else { CraftBukkit end */
} else {
Entity entity1 = entity;
if (entity instanceof EntityArrow && ((EntityArrow) entity).shooter != null) {
@ -593,7 +590,7 @@ public abstract class EntityHuman extends EntityLiving {
this.a(StatisticList.x, i);
return super.damageEntity(damagesource, i);
//} // CraftBukkit
}
}
}
}
@ -800,7 +797,7 @@ public abstract class EntityHuman extends EntityLiving {
if (l > 0) {
// CraftBukkit start - raise a combust event when somebody hits with a fire enchanted item
EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), l * 4);
Bukkit.getPluginManager().callEvent(combustEvent);
org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent);
if (!combustEvent.isCancelled()) {
entity.setOnFire(combustEvent.getDuration());

Datei anzeigen

@ -1,9 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.player.PlayerPickupItemEvent;
// CraftBukkit end
import org.bukkit.event.player.PlayerPickupItemEvent; // CraftBukkit
public class EntityItem extends Entity {
@ -88,7 +85,7 @@ public class EntityItem extends Entity {
++this.age;
if (this.age >= 6000) {
// CraftBukkit start
if (CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) {
this.age = 0;
return;
}

Datei anzeigen

@ -7,13 +7,10 @@ import java.util.List;
import java.util.Random;
// CraftBukkit start
import org.bukkit.craftbukkit.TrigMath;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
// CraftBukkit end
public abstract class EntityLiving extends Entity {
@ -460,7 +457,7 @@ public abstract class EntityLiving extends Entity {
f3 = 1.0F;
f2 = f * 3.0F;
// CraftBukkit - Math -> TrigMath
f1 = (float) TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F;
f1 = (float) org.bukkit.craftbukkit.TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F;
}
if (this.ao > 0.0F) {
@ -558,10 +555,10 @@ public abstract class EntityLiving extends Entity {
// CraftBukkit start - delegate so we can handle providing a reason for health being regained
public void heal(int i) {
heal(i, RegainReason.CUSTOM);
heal(i, EntityRegainHealthEvent.RegainReason.CUSTOM);
}
public void heal(int i, RegainReason regainReason) {
public void heal(int i, EntityRegainHealthEvent.RegainReason regainReason) {
if (this.health > 0) {
EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), i, regainReason);
this.world.getServer().getPluginManager().callEvent(event);
@ -607,7 +604,7 @@ public abstract class EntityLiving extends Entity {
// CraftBukkit start
if (damagesource instanceof EntityDamageSource) {
org.bukkit.event.entity.EntityDamageEvent event = CraftEventFactory.handleEntityDamageEvent(this, damagesource, i);
EntityDamageEvent event = CraftEventFactory.handleEntityDamageEvent(this, damagesource, i);
if (event.isCancelled()) {
return false;
}
@ -781,18 +778,15 @@ public abstract class EntityLiving extends Entity {
if (!this.isBaby()) {
this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i);
/* CraftBukkit start - move rare item drop call to dropDeathLoot
if (this.lastDamageByPlayerTime > 0) {
if (false && this.lastDamageByPlayerTime > 0) { // CraftBukkit - move rare item drop call to dropDeathLoot
int j = this.random.nextInt(200) - i;
if (j < 5) {
this.b(j <= 0 ? 1 : 0);
}
}
// */
} else {
CraftEventFactory.callEntityDeathEvent(this);
// CraftBukkit end
} else { // CraftBukkit
CraftEventFactory.callEntityDeathEvent(this); // CraftBukkit
}
}
@ -830,7 +824,7 @@ public abstract class EntityLiving extends Entity {
if (k < 5) {
ItemStack itemstack = this.b(k <= 0 ? 1 : 0);
if (itemstack != null) {
loot.add(new CraftItemStack(itemstack));
loot.add(new org.bukkit.craftbukkit.inventory.CraftItemStack(itemstack));
}
}
}

Datei anzeigen

@ -1,8 +1,5 @@
package net.minecraft.server;
import java.util.List; // CraftBukkit
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class EntityMagmaCube extends EntitySlime {
public EntityMagmaCube(World world) {
@ -38,7 +35,7 @@ public class EntityMagmaCube extends EntitySlime {
protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start - whole method
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int j = this.getLootId();
if (j > 0 && this.getSize() > 1) {
@ -53,7 +50,7 @@ public class EntityMagmaCube extends EntitySlime {
}
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}

Datei anzeigen

@ -3,18 +3,12 @@ package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import java.util.ArrayList;
import org.bukkit.Location;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.vehicle.VehicleCreateEvent;
import org.bukkit.event.vehicle.VehicleDamageEvent;
import org.bukkit.event.vehicle.VehicleDestroyEvent;
import org.bukkit.event.vehicle.VehicleEnterEvent;
import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
import org.bukkit.event.vehicle.VehicleMoveEvent;
import org.bukkit.event.vehicle.VehicleUpdateEvent;
import org.bukkit.util.Vector;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
@ -45,7 +39,7 @@ public class EntityMinecart extends Entity implements IInventory {
private double flyingY = 0.95;
private double flyingZ = 0.95;
public double maxSpeed = 0.4D;
public List<HumanEntity> transaction = new ArrayList<HumanEntity>();
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
private int maxStack = MAX_STACK;
public ItemStack[] getContents() {
@ -119,7 +113,7 @@ public class EntityMinecart extends Entity implements IInventory {
this.lastZ = d2;
this.type = i;
this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit
}
public double x_() {
@ -598,10 +592,10 @@ public class EntityMinecart extends Entity implements IInventory {
Location to = new Location(bworld, this.locX, this.locY, this.locZ, this.yaw, this.pitch);
Vehicle vehicle = (Vehicle) this.getBukkitEntity();
this.world.getServer().getPluginManager().callEvent(new VehicleUpdateEvent(vehicle));
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleUpdateEvent(vehicle));
if (!from.equals(to)) {
this.world.getServer().getPluginManager().callEvent(new VehicleMoveEvent(vehicle, from, to));
this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, from, to));
}
// CraftBukkit end

Datei anzeigen

@ -1,5 +1,7 @@
package net.minecraft.server;
import org.bukkit.event.player.PlayerShearEntityEvent; // CraftBukkit
public class EntityMushroomCow extends EntityCow {
public EntityMushroomCow(World world) {
@ -22,10 +24,10 @@ public class EntityMushroomCow extends EntityCow {
return true;
}
}
if (itemstack != null && itemstack.id == Item.SHEARS.id && this.getAge() >= 0) {
// CraftBukkit start
org.bukkit.event.player.PlayerShearEntityEvent event = new org.bukkit.event.player.PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity());
PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity());
this.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {

Datei anzeigen

@ -5,7 +5,6 @@ import java.util.List;
// CraftBukkit start
import org.bukkit.entity.Painting;
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
import org.bukkit.event.painting.PaintingBreakEvent.RemoveCause;
import org.bukkit.event.painting.PaintingBreakEvent;
// CraftBukkit end
@ -216,7 +215,7 @@ public class EntityPainting extends Entity {
// CraftBukkit start
PaintingBreakEvent event = null;
if (damagesource.getEntity() != null) {
event = new PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity());
event = new org.bukkit.event.painting.PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity());
} else {
if (damagesource == DamageSource.FIRE) {
event = new PaintingBreakEvent((Painting) this.getBukkitEntity(), RemoveCause.FIRE);
@ -284,11 +283,9 @@ public class EntityPainting extends Entity {
}
public void b_(double d0, double d1, double d2) {
/* CraftBukkit start - not needed for paintings
if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
if (false && !this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { // CraftBukkit start - not needed for paintings
this.die();
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING)));
}
// CraftBukkit end */
}
}

Datei anzeigen

@ -3,8 +3,6 @@ package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.EntityTargetEvent;
// CraftBukkit end
@ -95,7 +93,7 @@ public class EntityPigZombie extends EntityZombie {
this.target = null;
return;
}
entity = ((CraftEntity) event.getTarget()).getHandle();
entity = ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle();
// CraftBukkit end
this.target = entity;
@ -142,7 +140,7 @@ public class EntityPigZombie extends EntityZombie {
}
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}

Datei anzeigen

@ -6,14 +6,11 @@ import java.util.List;
import java.util.Set;
// CraftBukkit start
import java.util.EnumSet;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.ChunkCompressionThread;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryType;
// CraftBukkit end
@ -88,7 +85,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void spawnIn(World world) {
super.spawnIn(world);
// CraftBukkit - world fallback code, either respawn location or global spawn
// CraftBukkit start - world fallback code, either respawn location or global spawn
if (world == null) {
this.dead = false;
ChunkCoordinates position = null;
@ -167,7 +164,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
}
}
PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, damagesource.getLocalizedDeathMessage(this));
org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, damagesource.getLocalizedDeathMessage(this));
String deathMessage = event.getDeathMessage();
@ -175,7 +172,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.server.serverConfigurationManager.sendAll(new Packet3Chat(event.getDeathMessage()));
}
// CraftBukkit start - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
// CraftBukkit - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory.
for (int i = 0; i < this.inventory.items.length; ++i) {
this.inventory.items[i] = null;
}
@ -254,7 +251,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
boolean flag1 = false;
// CraftBukkit - Add check against Chunk Packets in the ChunkCompressionThread.
if (this.netServerHandler.lowPriorityCount() + ChunkCompressionThread.getPlayerQueueSize(this) < 4) {
if (this.netServerHandler.lowPriorityCount() + org.bukkit.craftbukkit.ChunkCompressionThread.getPlayerQueueSize(this) < 4) {
flag1 = true;
}
@ -563,7 +560,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.netServerHandler.sendPacket(new Packet104WindowItems(container.windowId, list));
this.netServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getCarried()));
// CraftBukkit start - send a Set Slot to update the crafting result slot
if (EnumSet.of(InventoryType.CRAFTING,InventoryType.WORKBENCH).contains(container.getBukkitView().getType())) {
if (java.util.EnumSet.of(InventoryType.CRAFTING,InventoryType.WORKBENCH).contains(container.getBukkitView().getType())) {
this.netServerHandler.sendPacket(new Packet103SetSlot(container.windowId, 0, container.getSlot(0).getItem()));
}
// CraftBukkit end

Datei anzeigen

@ -4,13 +4,10 @@ import java.util.Iterator;
import java.util.List;
// CraftBukkit start
import java.util.Collection;
import java.util.HashMap;
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.PotionSplashEvent;
// CraftBukkit end
public class EntityPotion extends EntityProjectile {
@ -77,7 +74,7 @@ public class EntityPotion extends EntityProjectile {
}
}
PotionSplashEvent event = CraftEventFactory.callPotionSplashEvent(this, affected);
org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected);
if (!event.isCancelled()) {
for (LivingEntity victim : event.getAffectedEntities()) {
if (!(victim instanceof CraftLivingEntity)) {

Datei anzeigen

@ -1,9 +1,8 @@
package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.entity.Projectile;
import org.bukkit.event.entity.ProjectileHitEvent;
// CraftBukkit end
@ -156,8 +155,8 @@ public abstract class EntityProjectile extends Entity {
this.a(movingobjectposition);
// CraftBukkit start
if (this.dead) {
ProjectileHitEvent hitEvent = new ProjectileHitEvent((Projectile) this.getBukkitEntity());
Bukkit.getPluginManager().callEvent(hitEvent);
ProjectileHitEvent hitEvent = new ProjectileHitEvent((org.bukkit.entity.Projectile) this.getBukkitEntity());
org.bukkit.Bukkit.getPluginManager().callEvent(hitEvent);
}
// CraftBukkit end
}

Datei anzeigen

@ -3,9 +3,8 @@ package net.minecraft.server;
import java.util.Random;
// CraftBukkit start
import org.bukkit.Material;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.entity.Sheep;
import org.bukkit.event.entity.SheepRegrowWoolEvent;
import org.bukkit.event.player.PlayerShearEntityEvent;
// CraftBukkit end
public class EntitySheep extends EntityAnimal {
@ -66,7 +65,7 @@ public class EntitySheep extends EntityAnimal {
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.Material.WOOL, 1, (short) 0, (byte) this.getColor()));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}
@ -80,7 +79,7 @@ public class EntitySheep extends EntityAnimal {
if (itemstack != null && itemstack.id == Item.SHEARS.id && !this.isSheared() && !this.isBaby()) {
if (!this.world.isStatic) {
// CraftBukkit start
org.bukkit.event.player.PlayerShearEntityEvent event = new org.bukkit.event.player.PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity());
PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity());
this.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@ -174,7 +173,7 @@ public class EntitySheep extends EntityAnimal {
public void z() {
// CraftBukkit start
org.bukkit.event.entity.SheepRegrowWoolEvent event = new org.bukkit.event.entity.SheepRegrowWoolEvent((Sheep) this.getBukkitEntity());
SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity());
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {

Datei anzeigen

@ -1,9 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
// CraftBukkit end
import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit
public class EntitySkeleton extends EntityMonster {
@ -54,7 +51,7 @@ public class EntitySkeleton extends EntityMonster {
if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
// CraftBukkit start
org.bukkit.event.entity.EntityCombustEvent event = new org.bukkit.event.entity.EntityCombustEvent(this.getBukkitEntity(), 8);
EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@ -105,12 +102,12 @@ public class EntitySkeleton extends EntityMonster {
if (k < 5) {
ItemStack itemstack = this.b(k <= 0 ? 1 : 0);
if (itemstack != null) {
loot.add(new CraftItemStack(itemstack));
loot.add(new org.bukkit.craftbukkit.inventory.CraftItemStack(itemstack));
}
}
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}

Datei anzeigen

@ -1,5 +1,7 @@
package net.minecraft.server;
import org.bukkit.event.entity.SlimeSplitEvent; // CraftBukkit
public class EntitySlime extends EntityLiving implements IMonster {
public float a;
@ -139,7 +141,7 @@ public class EntitySlime extends EntityLiving implements IMonster {
int j = 2 + this.random.nextInt(3);
// CraftBukkit start
org.bukkit.event.entity.SlimeSplitEvent event = new org.bukkit.event.entity.SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled() && event.getCount() > 0) {

Datei anzeigen

@ -1,9 +1,8 @@
package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.EntityBlockFormEvent;
import org.bukkit.event.entity.EntityDamageEvent;
// CraftBukkit end
@ -66,7 +65,7 @@ public class EntitySnowman extends EntityGolem {
if (this.world.getTypeId(j, k, l) == 0 && this.world.getBiome(j, l).i() < 0.8F && Block.SNOW.canPlace(this.world, j, k, l)) {
// CraftBukkit start
BlockState blockState = this.world.getWorld().getBlockAt(j, k, l).getState();
org.bukkit.block.BlockState blockState = this.world.getWorld().getBlockAt(j, k, l).getState();
blockState.setTypeId(Block.SNOW.id);
EntityBlockFormEvent event = new EntityBlockFormEvent(this.getBukkitEntity(), blockState.getBlock(), blockState);
@ -101,7 +100,7 @@ public class EntitySnowman extends EntityGolem {
loot.add(new org.bukkit.inventory.ItemStack(Item.SNOW_BALL.id, j));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}
}

Datei anzeigen

@ -1,12 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.craftbukkit.event.CraftEventFactory;
// CraftBukkit end
import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
public class EntitySpider extends EntityMonster {
@ -81,7 +75,7 @@ public class EntitySpider extends EntityMonster {
if (event.getTarget() == null) {
this.target = null;
} else {
this.target = ((CraftEntity) event.getTarget()).getHandle();
this.target = ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle();
}
return;
}
@ -117,7 +111,7 @@ public class EntitySpider extends EntityMonster {
protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start - whole method; adapted from super.dropDeathLoot.
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int k = this.random.nextInt(3);
@ -133,7 +127,7 @@ public class EntitySpider extends EntityMonster {
loot.add(new org.bukkit.inventory.ItemStack(Item.SPIDER_EYE.id, 1));
}
CraftEventFactory.callEntityDeathEvent(this, loot); // raise event even for those times when the entity does not drop loot
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // raise event even for those times when the entity does not drop loot
// CraftBukkit end
}

Datei anzeigen

@ -1,6 +1,5 @@
package net.minecraft.server;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class EntitySquid extends EntityWaterAnimal {
@ -67,7 +66,7 @@ public class EntitySquid extends EntityWaterAnimal {
loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.Material.INK_SACK, count));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
}

Datei anzeigen

@ -1,11 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.entity.Explosive;
import org.bukkit.event.entity.ExplosionPrimeEvent;
// CraftBukkit end
import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit
public class EntityTNTPrimed extends Entity {
@ -78,9 +73,9 @@ public class EntityTNTPrimed extends Entity {
// CraftBukkit start
// float f = 4.0F;
CraftServer server = this.world.getServer();
org.bukkit.craftbukkit.CraftServer server = this.world.getServer();
ExplosionPrimeEvent event = new ExplosionPrimeEvent((Explosive) CraftEntity.getEntity(server, this));
ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(server, this));
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {

Datei anzeigen

@ -6,6 +6,11 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
// CraftBukkit start
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerVelocityEvent;
// CraftBukkit end
public class EntityTrackerEntry {
public Entity tracker;
@ -168,10 +173,10 @@ public class EntityTrackerEntry {
boolean cancelled = false;
if (this.tracker instanceof EntityPlayer) {
org.bukkit.entity.Player player = (org.bukkit.entity.Player) this.tracker.getBukkitEntity();
Player player = (Player) this.tracker.getBukkitEntity();
org.bukkit.util.Vector velocity = player.getVelocity();
org.bukkit.event.player.PlayerVelocityEvent event = new org.bukkit.event.player.PlayerVelocityEvent(player, velocity);
PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity);
this.tracker.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {
@ -225,7 +230,7 @@ public class EntityTrackerEntry {
if (!this.trackedPlayers.contains(entityplayer)) {
// CraftBukkit start
if (tracker instanceof EntityPlayer) {
org.bukkit.entity.Player player = ((EntityPlayer) tracker).getBukkitEntity();
Player player = ((EntityPlayer) tracker).getBukkitEntity();
if (!entityplayer.getBukkitEntity().canSee(player)) {
return;
}

Datei anzeigen

@ -2,11 +2,7 @@ package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
// CraftBukkit end
import org.bukkit.event.block.BlockIgniteEvent; // CraftBukkit
public class EntityWeatherLighting extends EntityWeather {
@ -15,7 +11,7 @@ public class EntityWeatherLighting extends EntityWeather {
private int c;
// CraftBukkit start
private CraftWorld cworld;
private org.bukkit.craftbukkit.CraftWorld cworld;
public boolean isEffect = false;
public EntityWeatherLighting(World world, double d0, double d1, double d2) {
@ -45,7 +41,7 @@ public class EntityWeatherLighting extends EntityWeather {
if (world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(world, i, j, k)) {
// CraftBukkit start
BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), IgniteCause.LIGHTNING, null);
BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), BlockIgniteEvent.IgniteCause.LIGHTNING, null);
world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@ -61,7 +57,7 @@ public class EntityWeatherLighting extends EntityWeather {
if (world.getTypeId(j, k, l) == 0 && Block.FIRE.canPlace(world, j, k, l)) {
// CraftBukkit start
BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(j, k, l), IgniteCause.LIGHTNING, null);
BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(j, k, l), BlockIgniteEvent.IgniteCause.LIGHTNING, null);
world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@ -96,7 +92,7 @@ public class EntityWeatherLighting extends EntityWeather {
if (this.world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(this.world, i, j, k)) {
// CraftBukkit start
BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), IgniteCause.LIGHTNING, null);
BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), BlockIgniteEvent.IgniteCause.LIGHTNING, null);
this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) {

Datei anzeigen

@ -8,7 +8,6 @@ import java.util.Set;
// CraftBukkit start
import org.bukkit.Bukkit;
import org.bukkit.entity.TNTPrimed;
import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
@ -108,7 +107,7 @@ public class Explosion {
for (int k2 = 0; k2 < list.size(); ++k2) {
Entity entity = (Entity) list.get(k2);
// CraftBukkit - start
// CraftBukkit start
d0 = entity.locX - this.posX;
d1 = entity.locY - this.posY;
d2 = entity.locZ - this.posZ;
@ -127,7 +126,7 @@ public class Explosion {
d1 = 0d;
d2 = 0d;
}
// CraftBukkit - end
// CraftBukkit end
double d9 = (double) this.world.a(vec3d, entity.boundingBox);
double d10 = (1.0D - d7) * d9;
@ -151,7 +150,7 @@ public class Explosion {
} else {
final org.bukkit.entity.Entity damager = this.source.getBukkitEntity();
final EntityDamageEvent.DamageCause damageCause;
if (damager instanceof TNTPrimed) {
if (damager instanceof org.bukkit.entity.TNTPrimed) {
damageCause = EntityDamageEvent.DamageCause.BLOCK_EXPLOSION;
} else {
damageCause = EntityDamageEvent.DamageCause.ENTITY_EXPLOSION;

Datei anzeigen

@ -2,7 +2,6 @@ package net.minecraft.server;
import java.io.File;
import java.util.List;
import java.util.UUID; // CraftBukkit
public interface IDataManager {
@ -22,5 +21,5 @@ public interface IDataManager {
File getDataFile(String s);
UUID getUUID(); // CraftBukkit
java.util.UUID getUUID(); // CraftBukkit
}

Datei anzeigen

@ -1,12 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit
public interface IInventory {
@ -39,12 +33,12 @@ public interface IInventory {
void onClose(CraftHumanEntity who);
List<HumanEntity> getViewers();
java.util.List<org.bukkit.entity.HumanEntity> getViewers();
InventoryHolder getOwner();
org.bukkit.inventory.InventoryHolder getOwner();
void setMaxStackSize(int size);
int MAX_STACK = 64;
//CraftBukkit end
// CraftBukkit end
}

Datei anzeigen

@ -1,12 +1,8 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.ArrayList;
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
public class InventoryCraftResult implements IInventory {
@ -19,15 +15,15 @@ public class InventoryCraftResult implements IInventory {
public ItemStack[] getContents() {
return this.items;
}
public InventoryHolder getOwner() {
public org.bukkit.inventory.InventoryHolder getOwner() {
return null; // Result slots don't get an owner
}
// Don't need a transaction; the InventoryCrafting keeps track of it for us
public void onOpen(CraftHumanEntity who) {}
public void onClose(CraftHumanEntity who) {}
public List<HumanEntity> getViewers() {
return new ArrayList<HumanEntity>();
public java.util.List<HumanEntity> getViewers() {
return new java.util.ArrayList<HumanEntity>();
}
public void setMaxStackSize(int size) {

Datei anzeigen

@ -1,13 +1,11 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.ArrayList;
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
public class InventoryCrafting implements IInventory {
@ -17,7 +15,7 @@ public class InventoryCrafting implements IInventory {
private Container c;
// CraftBukkit start
public List<HumanEntity> transaction = new ArrayList<HumanEntity>();
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
public CraftingRecipe currentRecipe;
public IInventory resultInventory;
private EntityHuman owner;
@ -43,7 +41,7 @@ public class InventoryCrafting implements IInventory {
return transaction;
}
public InventoryHolder getOwner() {
public org.bukkit.inventory.InventoryHolder getOwner() {
return owner.getBukkitEntity();
}

Datei anzeigen

@ -1,12 +1,10 @@
package net.minecraft.server;
// CraftBukkit start
import java.util.ArrayList;
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end
public class InventoryLargeChest implements IInventory {
@ -16,7 +14,7 @@ public class InventoryLargeChest implements IInventory {
public IInventory right; // CraftBukkit - private -> public
// CraftBukkit start
public List<HumanEntity> transaction = new ArrayList<HumanEntity>();
public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
public ItemStack[] getContents() {
ItemStack[] result = new ItemStack[this.getSize()];
@ -42,7 +40,7 @@ public class InventoryLargeChest implements IInventory {
return transaction;
}
public InventoryHolder getOwner() {
public org.bukkit.inventory.InventoryHolder getOwner() {
return null; // This method won't be called since CraftInventoryDoubleChest doesn't defer to here
}

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemBed extends Item {
@ -47,7 +43,7 @@ public class ItemBed extends Item {
world.setTypeIdAndData(i, j, k, blockbed.id, i1);
// CraftBukkit start - bed
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false);

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemBlock extends Item {
@ -68,7 +64,7 @@ public class ItemBlock extends Item {
world.suppressPhysics = true;
world.setTypeIdAndData(i, j, k, id, this.filterData(itemstack.getData()));
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ);
id = world.getTypeId(i, j, k);
int data = world.getData(i, j, k);
replacedBlockState.update(true);

Datei anzeigen

@ -2,12 +2,6 @@ package net.minecraft.server;
import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
// CraftBukkit end
public class ItemBoat extends Item {
public ItemBoat(int i) {
@ -64,7 +58,7 @@ public class ItemBoat extends Item {
if (!world.isStatic) {
// CraftBukkit start - Boat placement
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(entityhuman, Action.RIGHT_CLICK_BLOCK, j, k, l, movingobjectposition.face, itemstack);
org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, j, k, l, movingobjectposition.face, itemstack);
if (event.isCancelled()) {
return itemstack;

Datei anzeigen

@ -1,9 +1,5 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.entity.EntityShootBowEvent;
// CraftBukkit end
public class ItemBow extends Item {
@ -52,7 +48,7 @@ public class ItemBow extends Item {
}
// CraftBukkit start
EntityShootBowEvent event = CraftEventFactory.callEntityShootBowEvent(entityhuman, itemstack, entityarrow, f);
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(entityhuman, itemstack, entityarrow, f);
if (event.isCancelled()) {
event.getProjectile().remove();
return;

Datei anzeigen

@ -1,7 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.Location;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.player.PlayerBucketEmptyEvent;
@ -147,7 +146,7 @@ public class ItemBucket extends Item {
}
} else if (this.a == 0 && movingobjectposition.entity instanceof EntityCow) {
// CraftBukkit start - This codepath seems to be *NEVER* called
Location loc = movingobjectposition.entity.getBukkitEntity().getLocation();
org.bukkit.Location loc = movingobjectposition.entity.getBukkitEntity().getLocation();
PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET);
if (event.isCancelled()) {

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemDoor extends Item {
@ -93,7 +89,7 @@ public class ItemDoor extends Item {
world.setTypeIdAndData(i, j, k, block.id, l);
// CraftBukkit start
if (entityhuman != null) {
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false);

Datei anzeigen

@ -1,7 +1,9 @@
package net.minecraft.server;
import org.bukkit.entity.Player; // CraftBukkit
import org.bukkit.entity.Sheep;
// CraftBukkit start
import org.bukkit.entity.Player;
import org.bukkit.event.entity.SheepDyeWoolEvent;
// CraftBukkit end
public class ItemDye extends Item {
@ -116,7 +118,7 @@ public class ItemDye extends Item {
if (!entitysheep.isSheared() && entitysheep.getColor() != i) {
// CraftBukkit start
byte bColor = new Integer(i).byteValue();
org.bukkit.event.entity.SheepDyeWoolEvent event = new org.bukkit.event.entity.SheepDyeWoolEvent((Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByData(bColor));
SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByData(bColor));
entitysheep.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) {

Datei anzeigen

@ -2,10 +2,8 @@ package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
public class ItemFlintAndSteel extends Item {
@ -68,7 +66,7 @@ public class ItemFlintAndSteel extends Item {
world.setTypeId(i, j, k, Block.FIRE.id);
// CraftBukkit start
BlockPlaceEvent placeEvent = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
org.bukkit.event.block.BlockPlaceEvent placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
if (placeEvent.isCancelled() || !placeEvent.canBuild()) {
placeEvent.getBlockPlaced().setTypeIdAndData(0, (byte) 0, false);

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemHoe extends Item {
@ -35,7 +31,7 @@ public class ItemHoe extends Item {
world.setTypeId(i, j, k, block.id);
// CraftBukkit start - Hoes - blockface -1 for 'SELF'
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeId(blockState.getTypeId());

Datei anzeigen

@ -2,7 +2,6 @@ package net.minecraft.server;
// CraftBukkit start
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.Event;
import org.bukkit.event.block.Action;
@ -138,7 +137,7 @@ public class ItemInWorldManager {
}
return;
}
BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, i, j, k, this.player.inventory.getItemInHand(), toolDamage >= 1.0f);
org.bukkit.event.block.BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, i, j, k, this.player.inventory.getItemInHand(), toolDamage >= 1.0f);
if (blockEvent.isCancelled()) {
// Let the client know the block still exists
@ -277,7 +276,7 @@ public class ItemInWorldManager {
}
}
// TODO: Review this code, it changed in 1.8 but I'm not sure if we need to update or not
// CraftBukkit - TODO: Review this code, it changed in 1.8 but I'm not sure if we need to update or not
public boolean interact(EntityHuman entityhuman, World world, ItemStack itemstack, int i, int j, int k, int l) {
int i1 = world.getTypeId(i, j, k);

Datei anzeigen

@ -1,11 +1,5 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
// CraftBukkit end
public class ItemMinecart extends Item {
public int a;
@ -22,7 +16,7 @@ public class ItemMinecart extends Item {
if (BlockMinecartTrack.d(i1)) {
if (!world.isStatic) {
// CraftBukkit start - Minecarts
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(entityhuman, Action.RIGHT_CLICK_BLOCK, i, j, k, l, itemstack);
org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, i, j, k, l, itemstack);
if (event.isCancelled()) {
return false;

Datei anzeigen

@ -3,7 +3,6 @@ package net.minecraft.server;
// CraftBukkit start
import org.bukkit.entity.Player;
import org.bukkit.event.painting.PaintingPlaceEvent;
import org.bukkit.craftbukkit.block.CraftBlock;
// CraftBukkit end
public class ItemPainting extends Item {
@ -43,7 +42,7 @@ public class ItemPainting extends Item {
Player who = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity();
org.bukkit.block.Block blockClicked = world.getWorld().getBlockAt(i, j, k);
org.bukkit.block.BlockFace blockFace = CraftBlock.notchToBlockFace(l);
org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(l);
PaintingPlaceEvent event = new PaintingPlaceEvent((org.bukkit.entity.Painting) entitypainting.getBukkitEntity(), who, blockClicked, blockFace);
world.getServer().getPluginManager().callEvent(event);

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemRedstone extends Item {
@ -55,7 +51,7 @@ public class ItemRedstone extends Item {
world.suppressPhysics = true;
world.setRawTypeId(i, j, k, Block.REDSTONE_WIRE.id); // We update after the event
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
blockState.update(true);
world.suppressPhysics = false;

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemReed extends Item {
@ -68,7 +64,7 @@ public class ItemReed extends Item {
* replace this with.
*/
if (world.setRawTypeId(i, j, k, this.id)) { // <-- world.e does this to place the block
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ);
if (event.isCancelled() || !event.canBuild()) {
// CraftBukkit - undo; this only has reed, repeater and pie blocks

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemSeeds extends Item {
@ -29,7 +25,7 @@ public class ItemSeeds extends Item {
world.setTypeId(i, j + 1, k, this.id);
// CraftBukkit start - seeds
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeId(0);

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemSign extends Item {
@ -57,7 +53,7 @@ public class ItemSign extends Item {
}
// CraftBukkit start - sign
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ);
if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false);

Datei anzeigen

@ -34,16 +34,7 @@ public class ItemStep extends ItemBlock {
boolean flag = (j1 & 8) != 0;
if ((l == 1 && !flag || l == 0 && flag) && i1 == Block.STEP.id && k1 == itemstack.getData()) {
/* CraftBukkit start - handle this in super
if (world.containsEntity(Block.DOUBLE_STEP.e(world, i, j, k)) && world.setTypeIdAndData(i, j, k, Block.DOUBLE_STEP.id, k1)) {
world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), Block.DOUBLE_STEP.stepSound.getName(), (Block.DOUBLE_STEP.stepSound.getVolume1() + 1.0F) / 2.0F, Block.DOUBLE_STEP.stepSound.getVolume2() * 0.8F);
--itemstack.count;
}
return true;
*/
return super.interactWith(itemstack, entityhuman, world, i, j, k, -1);
// CraftBukkit end
return super.interactWith(itemstack, entityhuman, world, i, j, k, -1); // CraftBukkit - handle this in super
} else {
return b(itemstack, entityhuman, world, i, j, k, l) ? true : super.interactWith(itemstack, entityhuman, world, i, j, k, l);
}

Datei anzeigen

@ -1,57 +1,53 @@
package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
public class ItemWaterLily extends ItemColoredBlock {
public ItemWaterLily(int i) {
super(i, false);
}
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
MovingObjectPosition movingobjectposition = this.a(world, entityhuman, true);
if (movingobjectposition == null) {
return itemstack;
} else {
if (movingobjectposition.type == EnumMovingObjectType.TILE) {
int i = movingobjectposition.b;
int j = movingobjectposition.c;
int k = movingobjectposition.d;
if (!world.a(entityhuman, i, j, k)) {
return itemstack;
}
if (!entityhuman.d(i, j, k)) {
return itemstack;
}
if (world.getMaterial(i, j, k) == Material.WATER && world.getData(i, j, k) == 0 && world.isEmpty(i, j + 1, k)) {
CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j + 1, k); // CraftBukkit
world.setTypeId(i, j + 1, k, Block.WATER_LILY.id);
// CraftBukkit start - waterlily
BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeId(0);
return itemstack;
}
// CraftBukkit end
if (!entityhuman.abilities.canInstantlyBuild) {
--itemstack.count;
}
}
}
return itemstack;
}
}
}
package net.minecraft.server;
import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
public class ItemWaterLily extends ItemColoredBlock {
public ItemWaterLily(int i) {
super(i, false);
}
public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
MovingObjectPosition movingobjectposition = this.a(world, entityhuman, true);
if (movingobjectposition == null) {
return itemstack;
} else {
if (movingobjectposition.type == EnumMovingObjectType.TILE) {
int i = movingobjectposition.b;
int j = movingobjectposition.c;
int k = movingobjectposition.d;
if (!world.a(entityhuman, i, j, k)) {
return itemstack;
}
if (!entityhuman.d(i, j, k)) {
return itemstack;
}
if (world.getMaterial(i, j, k) == Material.WATER && world.getData(i, j, k) == 0 && world.isEmpty(i, j + 1, k)) {
CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j + 1, k); // CraftBukkit
world.setTypeId(i, j + 1, k, Block.WATER_LILY.id);
// CraftBukkit start - waterlily
org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeId(0);
return itemstack;
}
// CraftBukkit end
if (!entityhuman.abilities.canInstantlyBuild) {
--itemstack.count;
}
}
}
return itemstack;
}
}
}

Datei anzeigen

@ -3,6 +3,7 @@ package net.minecraft.server;
import java.util.ArrayList;
import java.util.List;
// CraftBukkit - We import this because the compiler hates package-private methods in an external jar
class MinecartTrackLogic {
private World b;

Datei anzeigen

@ -1,5 +1,6 @@
package net.minecraft.server;
// import java.awt.GraphicsEnvironment; // CraftBukkit
import java.io.File;
import java.io.IOException;
import java.net.InetAddress;
@ -14,25 +15,14 @@ import java.util.logging.Logger;
// CraftBukkit start
import java.io.PrintStream;
import java.net.UnknownHostException;
import jline.console.ConsoleReader;
import joptsimple.OptionSet;
import org.bukkit.World.Environment;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.command.RemoteConsoleCommandSender;
import org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.LoggerOutputStream;
import org.bukkit.craftbukkit.scheduler.CraftScheduler;
import org.bukkit.craftbukkit.util.ServerShutdownThread;
import org.bukkit.event.server.ServerCommandEvent;
import org.bukkit.event.server.RemoteServerCommandEvent;
import org.bukkit.event.world.WorldInitEvent;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.event.world.WorldSaveEvent;
import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginLoadOrder;
// CraftBukkit end
public class MinecraftServer implements Runnable, ICommandListener, IMinecraftServer {
@ -76,10 +66,10 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
// CraftBukkit start
public List<WorldServer> worlds = new ArrayList<WorldServer>();
public CraftServer server;
public org.bukkit.craftbukkit.CraftServer server;
public OptionSet options;
public ConsoleCommandSender console;
public RemoteConsoleCommandSender remoteConsole;
public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
public ConsoleReader reader;
public static int currentTick;
public final Thread primaryThread;
@ -105,13 +95,13 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
Logger.getLogger(MinecraftServer.class.getName()).log(Level.SEVERE, null, ex);
}
}
Runtime.getRuntime().addShutdownHook(new ServerShutdownThread(this));
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
primaryThread = new ThreadServerApplication("Server thread", this); // Moved from main
// CraftBukkit end
}
private boolean init() throws UnknownHostException { // CraftBukkit - added throws UnknownHostException
private boolean init() throws java.net.UnknownHostException { // CraftBukkit - added throws UnknownHostException
this.consoleCommandHandler = new ConsoleCommandHandler(this);
ThreadCommandReader threadcommandreader = new ThreadCommandReader(this);
@ -211,7 +201,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
log.info("Starting remote control listener");
this.J = new RemoteControlListener(this);
this.J.a();
this.remoteConsole = new CraftRemoteConsoleCommandSender();
this.remoteConsole = new org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender(); // CraftBukkit
}
// CraftBukkit start
@ -265,7 +255,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
String worldType = Environment.getEnvironment(dimension).toString().toLowerCase();
String name = (dimension == 0) ? s : s + "_" + worldType;
ChunkGenerator gen = this.server.getGenerator(name);
org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name);
WorldSettings settings = new WorldSettings(i, j, generateStructures, false, worldtype);
if (k == 0) {
@ -311,7 +301,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
world.getWorld().getPopulators().addAll(gen.getDefaultPopulators(world.getWorld()));
}
this.server.getPluginManager().callEvent(new WorldInitEvent(world.getWorld()));
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld()));
world.tracker = new EntityTracker(this, world); // CraftBukkit
world.addIWorldAccess(new WorldManager(this, world));
@ -363,7 +353,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
// CraftBukkit start
for (World world : this.worlds) {
this.server.getPluginManager().callEvent(new WorldLoadEvent(world.getWorld()));
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld()));
}
// CraftBukkit end
@ -380,7 +370,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
this.k = null;
this.l = 0;
this.server.enablePlugins(PluginLoadOrder.POSTWORLD); // CraftBukkit
this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD); // CraftBukkit
}
void saveChunks() { // CraftBukkit - private -> default
@ -532,7 +522,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
// CraftBukkit start - only send timeupdates to the people in that world
((CraftScheduler) this.server.getScheduler()).mainThreadHeartbeat(this.ticks);
((org.bukkit.craftbukkit.scheduler.CraftScheduler) this.server.getScheduler()).mainThreadHeartbeat(this.ticks);
// Send timeupdates to everyone, it will get the right time from the world the player is in.
if (this.ticks % 20 == 0) {
@ -722,7 +712,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe
public String getPlugins() {
// CraftBukkit start - whole method
StringBuilder result = new StringBuilder();
Plugin[] plugins = server.getPluginManager().getPlugins();
org.bukkit.plugin.Plugin[] plugins = server.getPluginManager().getPlugins();
result.append(server.getName());
result.append(" on Bukkit ");

Datei anzeigen

@ -2,11 +2,8 @@ package net.minecraft.server;
// CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.potion.CraftPotionEffectType;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.potion.PotionEffectType;
// CraftBukkit end
public class MobEffectList {
@ -64,7 +61,7 @@ public class MobEffectList {
this.N = j;
PotionEffectType.registerPotionEffectType(new CraftPotionEffectType(this)); // CraftBukkit
org.bukkit.potion.PotionEffectType.registerPotionEffectType(new org.bukkit.craftbukkit.potion.CraftPotionEffectType(this)); // CraftBukkit
}
protected MobEffectList a(int i, int j) {
@ -84,7 +81,7 @@ public class MobEffectList {
} else if (this.id == POISON.id) {
if (entityliving.getHealth() > 1) {
// CraftBukkit start
EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, DamageCause.POISON, 1);
EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, EntityDamageEvent.DamageCause.POISON, 1);
if (!event.isCancelled() && event.getDamage() > 0) {
entityliving.damageEntity(DamageSource.MAGIC, event.getDamage());
@ -96,7 +93,7 @@ public class MobEffectList {
} else if ((this.id != HEAL.id || entityliving.aN()) && (this.id != HARM.id || !entityliving.aN())) {
if (this.id == HARM.id && !entityliving.aN() || this.id == HEAL.id && entityliving.aN()) {
// CraftBukkit start
EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, DamageCause.MAGIC, 6 << i);
EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, EntityDamageEvent.DamageCause.MAGIC, 6 << i);
if (!event.isCancelled() && event.getDamage() > 0) {
entityliving.damageEntity(DamageSource.MAGIC, event.getDamage());

Datei anzeigen

@ -2,13 +2,10 @@ package net.minecraft.server;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException; // CraftBukkit
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.logging.Level; // CraftBukkit
import java.util.logging.Logger; // CraftBukkit
public class NBTTagCompound extends NBTBase {
@ -34,8 +31,8 @@ public class NBTTagCompound extends NBTBase {
// CraftBukkit start
try {
dataoutput.writeByte(0);
} catch (IOException ex) {
Logger.getLogger(NBTTagCompound.class.getName()).log(Level.SEVERE, null, ex);
} catch (java.io.IOException ex) {
java.util.logging.Logger.getLogger(NBTTagCompound.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
}

Datei anzeigen

@ -5,12 +5,6 @@ import java.util.Iterator;
import java.util.Random;
import java.util.logging.Logger;
// CraftBukkit start
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.server.ServerListPingEvent;
// CraftBukkit end
public class NetLoginHandler extends NetHandler {
public static Logger logger = Logger.getLogger("Minecraft");
@ -86,7 +80,7 @@ public class NetLoginHandler extends NetHandler {
} else {
if (!this.server.onlineMode) {
// CraftBukkit start - disallow colour in names
if (!packet1login.name.equals(ChatColor.stripColor(packet1login.name))) {
if (!packet1login.name.equals(org.bukkit.ChatColor.stripColor(packet1login.name))) {
this.disconnect("Colourful names are not permitted!");
return;
}
@ -153,7 +147,7 @@ public class NetLoginHandler extends NetHandler {
if (this.networkManager.getSocket() == null) return; // CraftBukkit - fix NPE when a client queries a server that is unable to handle it.
try {
// CraftBukkit start
ServerListPingEvent pingEvent = CraftEventFactory.callServerListPingEvent(this.server.server, getSocket().getInetAddress(), this.server.motd, this.server.serverConfigurationManager.getPlayerCount(), this.server.serverConfigurationManager.getMaxPlayers());
org.bukkit.event.server.ServerListPingEvent pingEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(this.server.server, getSocket().getInetAddress(), this.server.motd, this.server.serverConfigurationManager.getPlayerCount(), this.server.serverConfigurationManager.getMaxPlayers());
String s = pingEvent.getMotd() + "\u00A7" + this.server.serverConfigurationManager.getPlayerCount() + "\u00A7" + pingEvent.getMaxPlayers();
// CraftBukkit end

Datei anzeigen

@ -7,23 +7,14 @@ import java.util.logging.Logger;
// CraftBukkit start
import java.io.UnsupportedEncodingException;
import java.util.logging.Level;
import java.util.Arrays;
import java.util.HashSet;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.ChunkCompressionThread;
import org.bukkit.Location;
import org.bukkit.command.CommandException;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.inventory.CraftInventoryView;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.craftbukkit.block.CraftBlock;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.craftbukkit.TextWrapper;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.block.Action;
@ -32,7 +23,6 @@ import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerMoveEvent;
@ -44,9 +34,7 @@ import org.bukkit.event.inventory.*;
import org.bukkit.event.inventory.InventoryType.SlotType;
import org.bukkit.event.player.PlayerToggleFlightEvent;
import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.Recipe;
// CraftBukkit end
public class NetServerHandler extends NetHandler implements ICommandListener {
@ -82,7 +70,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.server = minecraftserver.server;
}
private final CraftServer server;
private final org.bukkit.craftbukkit.CraftServer server;
private int lastTick = MinecraftServer.currentTick;
private int lastDropTick = MinecraftServer.currentTick;
private int dropCount = 0;
@ -105,7 +93,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
public CraftPlayer getPlayer() {
return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity();
}
private final static HashSet<Integer> invalidItems = new HashSet<Integer>(Arrays.asList(8, 9, 10, 11, 26, 34, 36, 51, 52, 55, 59, 60, 63, 64, 68, 71, 75, 78, 83, 90, 92, 93, 94, 95));
private final static HashSet<Integer> invalidItems = new HashSet<Integer>(java.util.Arrays.asList(8, 9, 10, 11, 26, 34, 36, 51, 52, 55, 59, 60, 63, 64, 68, 71, 75, 78, 83, 90, 92, 93, 94, 95));
// CraftBukkit end
public void a() {
@ -530,9 +518,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
}
if (packet14blockdig.e == 0) {
// CraftBukkit
// CraftBukkit start
if (i1 < this.server.getSpawnRadius() && !flag) {
CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, i, j, k, l, this.player.inventory.getItemInHand());
// CraftBukkit end
this.player.netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, worldserver));
} else {
this.player.itemInWorldManager.dig(i, j, k, packet14blockdig.face);
@ -603,7 +592,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
// CraftBukkit start
int itemstackAmount = itemstack.count;
PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack);
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack);
if (event.useItemInHand() != Event.Result.DENY) {
this.player.itemInWorldManager.useItem(this.player, this.player.world, itemstack);
}
@ -717,13 +706,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.player.compassTarget = new Location(this.getPlayer().getWorld(), packet6.x, packet6.y, packet6.z);
} else if (packet instanceof Packet3Chat) {
String message = ((Packet3Chat) packet).message;
for (final String line : TextWrapper.wrapText(message)) {
for (final String line : org.bukkit.craftbukkit.TextWrapper.wrapText(message)) {
this.networkManager.queue(new Packet3Chat(line));
}
packet = null;
} else if (packet != null && packet.lowPriority == true) {
// Reroute all low-priority packets through to compression thread.
ChunkCompressionThread.sendPacket(this.player, packet);
org.bukkit.craftbukkit.ChunkCompressionThread.sendPacket(this.player, packet);
packet = null;
}
if (packet != null) this.networkManager.queue(packet);
@ -822,14 +811,14 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
if (this.server.dispatchCommand(player, event.getMessage().substring(1))) {
return;
}
} catch (CommandException ex) {
player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to perform this command");
Logger.getLogger(NetServerHandler.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (org.bukkit.command.CommandException ex) {
player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command");
Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, null, ex);
return;
}
// CraftBukkit end
/* // CraftBukkit start - No longer needed as we have already handled it in server.dispatchServerCommand above.
/* CraftBukkit start - No longer needed as we have already handled it in server.dispatchServerCommand above.
if (s.toLowerCase().startsWith("/me ")) {
s = "* " + this.player.name + " " + s.substring(s.indexOf(" ")).trim();
logger.info(s);
@ -1026,7 +1015,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
PlayerPortalEvent event = new PlayerPortalEvent(this.player.getBukkitEntity(), this.player.getBukkitEntity().getLocation(), toLocation, pta, PlayerPortalEvent.TeleportCause.END_PORTAL);
event.useTravelAgent(false);
Bukkit.getServer().getPluginManager().callEvent(event);
org.bukkit.Bukkit.getServer().getPluginManager().callEvent(event);
this.player = this.minecraftServer.serverConfigurationManager.moveToWorld(this.player, 0, true, event.getTo());
// CraftBukkit end
} else {
@ -1063,9 +1052,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
SlotType type = CraftInventoryView.getSlotType(inventory, packet102windowclick.slot);
InventoryClickEvent event = new InventoryClickEvent(inventory, type, packet102windowclick.slot, packet102windowclick.button != 0, packet102windowclick.shift);
Inventory top = inventory.getTopInventory();
org.bukkit.inventory.Inventory top = inventory.getTopInventory();
if (packet102windowclick.slot == 0 && top instanceof CraftingInventory) {
Recipe recipe = ((CraftingInventory) top).getRecipe();
org.bukkit.inventory.Recipe recipe = ((CraftingInventory) top).getRecipe();
if (recipe != null) {
event = new CraftItemEvent(recipe, inventory, type, packet102windowclick.slot, packet102windowclick.button != 0, packet102windowclick.shift);
}
@ -1147,7 +1136,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
boolean flag3 = itemstack == null || itemstack.getData() >= 0 && itemstack.getData() >= 0 && itemstack.count <= 64 && itemstack.count > 0;
// CraftBukkit start - Fire INVENTORY_CLICK event
HumanEntity player = this.player.getBukkitEntity();
org.bukkit.entity.HumanEntity player = this.player.getBukkitEntity();
InventoryView inventory = new CraftInventoryView(player, player.getInventory(), this.player.defaultContainer);
SlotType slot = SlotType.QUICKBAR;
if (packet107setcreativeslot.slot == -1) {
@ -1225,8 +1214,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
if (!tileentitysign.c()) {
this.minecraftServer.warning("Player " + this.player.name + " just tried to change non-editable sign");
// CraftBukkit
this.sendPacket(new Packet130UpdateSign(packet130updatesign.x, packet130updatesign.y, packet130updatesign.z, tileentitysign.lines));
this.sendPacket(new Packet130UpdateSign(packet130updatesign.x, packet130updatesign.y, packet130updatesign.z, tileentitysign.lines)); // CraftBukkit
return;
}
}
@ -1261,7 +1249,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
// CraftBukkit start
Player player = this.server.getPlayer(this.player);
SignChangeEvent event = new SignChangeEvent((CraftBlock) player.getWorld().getBlockAt(j, k, i), this.server.getPlayer(this.player), packet130updatesign.lines);
SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(j, k, i), this.server.getPlayer(this.player), packet130updatesign.lines);
this.server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {

Datei anzeigen

@ -9,7 +9,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
// CraftBukkit start
import java.io.IOException;
import java.util.List;
import java.util.Collections;
// CraftBukkit end
@ -26,7 +25,7 @@ public class NetworkListenThread {
public MinecraftServer c;
private HashMap i = new HashMap();
public NetworkListenThread(MinecraftServer minecraftserver, InetAddress inetaddress, int i) throws IOException { // CraftBukkit
public NetworkListenThread(MinecraftServer minecraftserver, InetAddress inetaddress, int i) throws java.io.IOException { // CraftBukkit
this.c = minecraftserver;
this.d = new ServerSocket(i, 0, inetaddress);
this.d.setPerformancePreferences(0, 2, 1);

Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen