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) { public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
entityhuman.a(StatisticList.C[this.id], 1); entityhuman.a(StatisticList.C[this.id], 1);
entityhuman.c(0.025F); entityhuman.c(0.025F);
if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) { if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
ItemStack itemstack = this.a_(l); ItemStack itemstack = this.a_(l);

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -2,6 +2,8 @@ package net.minecraft.server;
import java.util.Random; import java.util.Random;
import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit
public class BlockDragonEgg extends Block { public class BlockDragonEgg extends Block {
public BlockDragonEgg(int i, int j) { public BlockDragonEgg(int i, int j) {
@ -64,14 +66,15 @@ public class BlockDragonEgg extends Block {
// CraftBukkit start // CraftBukkit start
org.bukkit.block.Block from = world.getWorld().getBlockAt(i, j, k); org.bukkit.block.Block from = world.getWorld().getBlockAt(i, j, k);
org.bukkit.block.Block to = world.getWorld().getBlockAt(i1, j1, k1); 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); org.bukkit.Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (event.isCancelled()) {
i1 = event.getToBlock().getX(); return;
j1 = event.getToBlock().getY(); }
k1 = event.getToBlock().getZ(); i1 = event.getToBlock().getX();
} else return; j1 = event.getToBlock().getY();
k1 = event.getToBlock().getZ();
// CraftBukkit end // CraftBukkit end
world.setTypeIdAndData(i1, j1, k1, this.id, world.getData(i, j, k)); 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; import java.util.Random;
// CraftBukkit start // CraftBukkit start
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockIgniteEvent; import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockBurnEvent;
import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.material.MaterialData;
// CraftBukkit end // CraftBukkit end
public class BlockFire extends Block { public class BlockFire extends Block {
@ -109,7 +106,7 @@ public class BlockFire extends Block {
org.bukkit.Server server = world.getServer(); org.bukkit.Server server = world.getServer();
org.bukkit.World bworld = world.getWorld(); 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); org.bukkit.block.Block fromBlock = bworld.getBlockAt(i, j, k);
// CraftBukkit end // CraftBukkit end
@ -151,7 +148,7 @@ public class BlockFire extends Block {
org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, k1, j1).getState(); org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, k1, j1).getState();
blockState.setTypeId(this.id); 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); BlockSpreadEvent spreadEvent = new BlockSpreadEvent(blockState.getBlock(), fromBlock, blockState);
server.getPluginManager().callEvent(spreadEvent); server.getPluginManager().callEvent(spreadEvent);
@ -261,7 +258,7 @@ public class BlockFire extends Block {
} }
// CraftBukkit start // CraftBukkit start
private void fireExtinguished(World world, int x, int y, int z) { 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); world.setTypeId(x, y, z, 0);
} }
} }

Datei anzeigen

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

Datei anzeigen

@ -1,7 +1,6 @@
package net.minecraft.server; package net.minecraft.server;
import java.util.Random; import java.util.Random;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockIce extends BlockHalfTransparant { 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) { 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]) { if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.lightBlock[this.id]) {
// CraftBukkit start // 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; return;
} }
// CraftBukkit end // CraftBukkit end

Datei anzeigen

@ -81,7 +81,7 @@ public class BlockMinecartTrack extends Block {
if (!world.isStatic) { if (!world.isStatic) {
this.a(world, i, j, k, true); this.a(world, i, j, k, true);
if (this.id == Block.GOLDEN_RAIL.id) { 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; package net.minecraft.server;
import java.util.ArrayList;
import java.util.Random; import java.util.Random;
// CraftBukkit start // CraftBukkit start
import org.bukkit.BlockChangeDelegate; import java.util.ArrayList;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.TreeType; import org.bukkit.TreeType;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.BlockSpreadEvent;
import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.event.world.StructureGrowEvent;
// CraftBukkit end // CraftBukkit end
@ -63,7 +63,7 @@ public class BlockMushroom extends BlockFlower {
if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) { if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) {
// CraftBukkit start // CraftBukkit start
org.bukkit.World bworld = world.getWorld(); 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); blockState.setTypeId(this.id);
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); 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 // 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); int l = world.getData(i, j, k);
world.setRawTypeId(i, j, k, 0); world.setRawTypeId(i, j, k, 0);
@ -114,7 +114,7 @@ public class BlockMushroom extends BlockFlower {
worldgenhugemushroom = new WorldGenHugeMushroom(1); worldgenhugemushroom = new WorldGenHugeMushroom(1);
} }
if (worldgenhugemushroom != null && event != null) { 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) { if (event.isFromBonemeal() && itemstack != null) {
--itemstack.count; --itemstack.count;
} }

Datei anzeigen

@ -1,8 +1,12 @@
package net.minecraft.server; package net.minecraft.server;
import java.util.Random; 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 { 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) { if (world.getLightLevel(i, j + 1, k) < 4 && Block.lightBlock[world.getTypeId(i, j + 1, k)] > 2) {
// CraftBukkit start // CraftBukkit start
org.bukkit.World bworld = world.getWorld(); 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); blockState.setTypeId(Block.DIRT.id);
BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState); 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) { if (world.getTypeId(i1, j1, k1) == Block.DIRT.id && world.getLightLevel(i1, j1 + 1, k1) >= 4 && Block.lightBlock[l1] <= 2) {
// CraftBukkit start // CraftBukkit start
org.bukkit.World bworld = world.getWorld(); 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); blockState.setTypeId(this.id);
BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); 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 (flag) {
if (j1 != Block.OBSIDIAN.id) { if (j1 != Block.OBSIDIAN.id) {
return false; return false;
} else { } else { // CraftBukkit
blocks.add(bworld.getBlockAt(i + b0 * l, j + i1, k + b1 * l)); // CraftBukkit blocks.add(bworld.getBlockAt(i + b0 * l, j + i1, k + b1 * l)); // CraftBukkit
} }
} else if (j1 != 0 && j1 != Block.FIRE.id) { } else if (j1 != 0 && j1 != Block.FIRE.id) {

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -2,7 +2,10 @@ package net.minecraft.server;
import java.util.Random; 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 { public class BlockStationary extends BlockFluids {
@ -57,7 +60,7 @@ public class BlockStationary extends BlockFluids {
// CraftBukkit start - prevent lava putting something on fire. // CraftBukkit start - prevent lava putting something on fire.
org.bukkit.block.Block block = bworld.getBlockAt(i, j, k); org.bukkit.block.Block block = bworld.getBlockAt(i, j, k);
if (block.getTypeId() != Block.FIRE.id) { 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; continue;
} }
} }
@ -82,7 +85,7 @@ public class BlockStationary extends BlockFluids {
// CraftBukkit start - prevent lava putting something on fire. // CraftBukkit start - prevent lava putting something on fire.
org.bukkit.block.Block block = bworld.getBlockAt(i, j + 1, k); org.bukkit.block.Block block = bworld.getBlockAt(i, j + 1, k);
if (block.getTypeId() != Block.FIRE.id) { 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; continue;
} }
} }

Datei anzeigen

@ -2,6 +2,8 @@ package net.minecraft.server;
import java.util.Random; import java.util.Random;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class BlockStem extends BlockFlower { public class BlockStem extends BlockFlower {
private Block blockFruit; private Block blockFruit;
@ -29,7 +31,7 @@ public class BlockStem extends BlockFlower {
if (l < 7) { if (l < 7) {
++l; ++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 { } else {
if (world.getTypeId(i - 1, j, k) == this.blockFruit.id) { if (world.getTypeId(i - 1, j, k) == this.blockFruit.id) {
return; return;
@ -70,7 +72,7 @@ public class BlockStem extends BlockFlower {
int l1 = world.getTypeId(j1, j - 1, k1); 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)) { 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; package net.minecraft.server;
import java.util.ArrayList; // import java.util.ArrayList; // CraftBukkit
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
@ -10,6 +10,7 @@ import java.util.Random;
// CraftBukkit start // CraftBukkit start
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.craftbukkit.util.UnsafeList; import org.bukkit.craftbukkit.util.UnsafeList;
// CraftBukkit end // CraftBukkit end
@ -665,8 +666,8 @@ public class Chunk {
java.util.Iterator<Object> iter = this.entitySlices[i].iterator(); java.util.Iterator<Object> iter = this.entitySlices[i].iterator();
while (iter.hasNext()) { while (iter.hasNext()) {
Entity entity = (Entity) iter.next(); Entity entity = (Entity) iter.next();
int cx = org.bukkit.Location.locToBlock(entity.locX) >> 4; int cx = Location.locToBlock(entity.locX) >> 4;
int cz = org.bukkit.Location.locToBlock(entity.locZ) >> 4; int cz = Location.locToBlock(entity.locZ) >> 4;
// Do not pass along players, as doing so can get them stuck outside of time. // 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) // (which for example disables inventory icon updates and prevents block breaking)

Datei anzeigen

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

Datei anzeigen

@ -5,7 +5,6 @@ import java.io.DataInputStream;
import java.io.DataOutput; import java.io.DataOutput;
import java.io.DataOutputStream; import java.io.DataOutputStream;
import java.io.File; import java.io.File;
import java.io.IOException; // CraftBukkit
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
@ -132,7 +131,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
return true; 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); DataOutputStream dataoutputstream = RegionFileCache.c(this.d, pendingchunktosave.a.x, pendingchunktosave.a.z);
NBTCompressedStreamTools.a(pendingchunktosave.b, (DataOutput) dataoutputstream); 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.Level;
import java.util.logging.LogRecord; import java.util.logging.LogRecord;
import java.util.regex.Pattern; // CraftBukkit
final class ConsoleLogFormatter extends Formatter { final class ConsoleLogFormatter extends Formatter {
private SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); private SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
// CraftBukkit start - add color stripping, change constructor to take it // 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; private boolean strip = false;
ConsoleLogFormatter(boolean strip) { ConsoleLogFormatter(boolean strip) {

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,7 +1,5 @@
package net.minecraft.server; package net.minecraft.server;
import org.bukkit.craftbukkit.enchantments.CraftEnchantment;
public abstract class Enchantment { public abstract class Enchantment {
// CraftBukkit - update CraftEnchant.getName(i) if this changes. // CraftBukkit - update CraftEnchant.getName(i) if this changes.
public static final Enchantment[] byId = new Enchantment[256]; public static final Enchantment[] byId = new Enchantment[256];
@ -41,7 +39,7 @@ public abstract class Enchantment {
byId[i] = this; 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() { 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 // CraftBukkit start
import java.util.UUID; import java.util.UUID;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Server;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Painting; import org.bukkit.entity.Painting;
import org.bukkit.entity.Vehicle; import org.bukkit.entity.Vehicle;
import org.bukkit.event.entity.EntityCombustByBlockEvent;
import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.entity.EntityCombustByEntityEvent;
import org.bukkit.event.painting.PaintingBreakByEntityEvent; import org.bukkit.event.painting.PaintingBreakByEntityEvent;
import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent;
import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleEnterEvent;
import org.bukkit.event.vehicle.VehicleExitEvent; import org.bukkit.event.vehicle.VehicleExitEvent;
import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityCombustEvent;
import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageByBlockEvent;
@ -381,7 +383,7 @@ public abstract class Entity {
if (!this.fireProof) { if (!this.fireProof) {
// CraftBukkit start - fallen in lava TODO: this event spams! // CraftBukkit start - fallen in lava TODO: this event spams!
if (this instanceof EntityLiving) { 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. // TODO: shouldn't be sending null for the block.
org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k); 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) { if (this.fireTicks <= 0) {
// not on fire yet // 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); server.getPluginManager().callEvent(combustEvent);
if (!combustEvent.isCancelled()) { if (!combustEvent.isCancelled()) {
@ -895,7 +897,7 @@ public abstract class Entity {
// CraftBukkit start // CraftBukkit start
if (world == null) { if (world == null) {
this.die(); this.die();
this.world = ((org.bukkit.craftbukkit.CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle(); this.world = ((CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle();
return; return;
} }
// CraftBukkit end // CraftBukkit end
@ -1124,7 +1126,7 @@ public abstract class Entity {
// CraftBukkit start - reset world // CraftBukkit start - reset world
if (this instanceof EntityPlayer) { if (this instanceof EntityPlayer) {
org.bukkit.Server server = Bukkit.getServer(); Server server = Bukkit.getServer();
org.bukkit.World bworld = null; org.bukkit.World bworld = null;
// TODO: Remove World related checks, replaced with WorldUID. // 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(); 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 // CraftBukkit end
} }

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,9 +1,9 @@
package net.minecraft.server; package net.minecraft.server;
// CraftBukkit start // CraftBukkit start
import org.bukkit.Location;
import org.bukkit.entity.Ageable; import org.bukkit.entity.Ageable;
import org.bukkit.entity.EntityType; import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
import org.bukkit.event.player.PlayerEggThrowEvent; import org.bukkit.event.player.PlayerEggThrowEvent;
// CraftBukkit end // CraftBukkit end
@ -37,7 +37,7 @@ public class EntityEgg extends EntityProjectile {
EntityType hatchingType = EntityType.CHICKEN; EntityType hatchingType = EntityType.CHICKEN;
if (this.shooter instanceof EntityPlayer) { 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); PlayerEggThrowEvent event = new PlayerEggThrowEvent(player, (org.bukkit.entity.Egg) this.getBukkitEntity(), hatching, (byte) numHatching, hatchingType);
this.world.getServer().getPluginManager().callEvent(event); this.world.getServer().getPluginManager().callEvent(event);
@ -49,7 +49,7 @@ public class EntityEgg extends EntityProjectile {
if (hatching) { if (hatching) {
for (int k = 0; k < numHatching; k++) { 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) { if (entity instanceof Ageable) {
((Ageable) entity).setBaby(); ((Ageable) entity).setBaby();

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,6 +1,9 @@
package net.minecraft.server; 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 { public class EntityExperienceOrb extends Entity {
@ -57,7 +60,7 @@ public class EntityExperienceOrb extends Entity {
if (entityhuman != null) { if (entityhuman != null) {
// CraftBukkit start // 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(); Entity target = event.getTarget() == null ? null : ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle();
if (!event.isCancelled() && target != null) { if (!event.isCancelled() && target != null) {

Datei anzeigen

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

Datei anzeigen

@ -2,7 +2,10 @@ package net.minecraft.server;
import java.util.List; 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 { public class EntityFishingHook extends Entity {
@ -312,7 +315,7 @@ public class EntityFishingHook extends Entity {
if (this.hooked != null) { if (this.hooked != null) {
// CraftBukkit start // 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); this.world.getServer().getPluginManager().callEvent(playerFishEvent);
if (playerFishEvent.isCancelled()) { if (playerFishEvent.isCancelled()) {
@ -335,7 +338,7 @@ public class EntityFishingHook extends Entity {
} else if (this.k > 0) { } else if (this.k > 0) {
EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.RAW_FISH)); EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.RAW_FISH));
// CraftBukkit start // 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); this.world.getServer().getPluginManager().callEvent(playerFishEvent);
if (playerFishEvent.isCancelled()) { if (playerFishEvent.isCancelled()) {
@ -361,7 +364,7 @@ public class EntityFishingHook extends Entity {
if (this.h) { if (this.h) {
// CraftBukkit start // 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); this.world.getServer().getPluginManager().callEvent(playerFishEvent);
if (playerFishEvent.isCancelled()) { if (playerFishEvent.isCancelled()) {
@ -375,7 +378,7 @@ public class EntityFishingHook extends Entity {
// CraftBukkit start // CraftBukkit start
if (b0 == 0) { 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); this.world.getServer().getPluginManager().callEvent(playerFishEvent);
} }
// CraftBukkit end // CraftBukkit end

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -7,13 +7,10 @@ import java.util.List;
import java.util.Random; import java.util.Random;
// CraftBukkit start // CraftBukkit start
import org.bukkit.craftbukkit.TrigMath;
import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
// CraftBukkit end // CraftBukkit end
public abstract class EntityLiving extends Entity { public abstract class EntityLiving extends Entity {
@ -460,7 +457,7 @@ public abstract class EntityLiving extends Entity {
f3 = 1.0F; f3 = 1.0F;
f2 = f * 3.0F; f2 = f * 3.0F;
// CraftBukkit - Math -> TrigMath // 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) { 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 // CraftBukkit start - delegate so we can handle providing a reason for health being regained
public void heal(int i) { 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) { if (this.health > 0) {
EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), i, regainReason); EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), i, regainReason);
this.world.getServer().getPluginManager().callEvent(event); this.world.getServer().getPluginManager().callEvent(event);
@ -607,7 +604,7 @@ public abstract class EntityLiving extends Entity {
// CraftBukkit start // CraftBukkit start
if (damagesource instanceof EntityDamageSource) { 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()) { if (event.isCancelled()) {
return false; return false;
} }
@ -781,18 +778,15 @@ public abstract class EntityLiving extends Entity {
if (!this.isBaby()) { if (!this.isBaby()) {
this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i); this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i);
/* CraftBukkit start - move rare item drop call to dropDeathLoot if (false && this.lastDamageByPlayerTime > 0) { // CraftBukkit - move rare item drop call to dropDeathLoot
if (this.lastDamageByPlayerTime > 0) {
int j = this.random.nextInt(200) - i; int j = this.random.nextInt(200) - i;
if (j < 5) { if (j < 5) {
this.b(j <= 0 ? 1 : 0); this.b(j <= 0 ? 1 : 0);
} }
} }
// */ } else { // CraftBukkit
} else { CraftEventFactory.callEntityDeathEvent(this); // CraftBukkit
CraftEventFactory.callEntityDeathEvent(this);
// CraftBukkit end
} }
} }
@ -830,7 +824,7 @@ public abstract class EntityLiving extends Entity {
if (k < 5) { if (k < 5) {
ItemStack itemstack = this.b(k <= 0 ? 1 : 0); ItemStack itemstack = this.b(k <= 0 ? 1 : 0);
if (itemstack != null) { 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; package net.minecraft.server;
import java.util.List; // CraftBukkit
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class EntityMagmaCube extends EntitySlime { public class EntityMagmaCube extends EntitySlime {
public EntityMagmaCube(World world) { public EntityMagmaCube(World world) {
@ -38,7 +35,7 @@ public class EntityMagmaCube extends EntitySlime {
protected void dropDeathLoot(boolean flag, int i) { protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start - whole method // 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(); int j = this.getLootId();
if (j > 0 && this.getSize() > 1) { 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 // CraftBukkit end
} }

Datei anzeigen

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

Datei anzeigen

@ -1,5 +1,7 @@
package net.minecraft.server; package net.minecraft.server;
import org.bukkit.event.player.PlayerShearEntityEvent; // CraftBukkit
public class EntityMushroomCow extends EntityCow { public class EntityMushroomCow extends EntityCow {
public EntityMushroomCow(World world) { public EntityMushroomCow(World world) {
@ -25,7 +27,7 @@ public class EntityMushroomCow extends EntityCow {
if (itemstack != null && itemstack.id == Item.SHEARS.id && this.getAge() >= 0) { if (itemstack != null && itemstack.id == Item.SHEARS.id && this.getAge() >= 0) {
// CraftBukkit start // 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); this.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {

Datei anzeigen

@ -5,7 +5,6 @@ import java.util.List;
// CraftBukkit start // CraftBukkit start
import org.bukkit.entity.Painting; import org.bukkit.entity.Painting;
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
import org.bukkit.event.painting.PaintingBreakEvent.RemoveCause; import org.bukkit.event.painting.PaintingBreakEvent.RemoveCause;
import org.bukkit.event.painting.PaintingBreakEvent; import org.bukkit.event.painting.PaintingBreakEvent;
// CraftBukkit end // CraftBukkit end
@ -216,7 +215,7 @@ public class EntityPainting extends Entity {
// CraftBukkit start // CraftBukkit start
PaintingBreakEvent event = null; PaintingBreakEvent event = null;
if (damagesource.getEntity() != 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 { } else {
if (damagesource == DamageSource.FIRE) { if (damagesource == DamageSource.FIRE) {
event = new PaintingBreakEvent((Painting) this.getBukkitEntity(), RemoveCause.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) { public void b_(double d0, double d1, double d2) {
/* CraftBukkit start - not needed for paintings if (false && !this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { // CraftBukkit start - not needed for paintings
if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) {
this.die(); this.die();
this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING))); 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; import java.util.List;
// CraftBukkit start // CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.EntityTargetEvent;
// CraftBukkit end // CraftBukkit end
@ -95,7 +93,7 @@ public class EntityPigZombie extends EntityZombie {
this.target = null; this.target = null;
return; return;
} }
entity = ((CraftEntity) event.getTarget()).getHandle(); entity = ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle();
// CraftBukkit end // CraftBukkit end
this.target = entity; 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 // CraftBukkit end
} }

Datei anzeigen

@ -6,14 +6,11 @@ import java.util.List;
import java.util.Set; import java.util.Set;
// CraftBukkit start // CraftBukkit start
import java.util.EnumSet;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.ChunkCompressionThread;
import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.inventory.InventoryType;
// CraftBukkit end // CraftBukkit end
@ -88,7 +85,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
public void spawnIn(World world) { public void spawnIn(World world) {
super.spawnIn(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) { if (world == null) {
this.dead = false; this.dead = false;
ChunkCoordinates position = null; 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(); String deathMessage = event.getDeathMessage();
@ -175,7 +172,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
this.server.serverConfigurationManager.sendAll(new Packet3Chat(event.getDeathMessage())); 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) { for (int i = 0; i < this.inventory.items.length; ++i) {
this.inventory.items[i] = null; this.inventory.items[i] = null;
} }
@ -254,7 +251,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting {
boolean flag1 = false; boolean flag1 = false;
// CraftBukkit - Add check against Chunk Packets in the ChunkCompressionThread. // 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; 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 Packet104WindowItems(container.windowId, list));
this.netServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getCarried())); this.netServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getCarried()));
// CraftBukkit start - send a Set Slot to update the crafting result slot // 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())); this.netServerHandler.sendPacket(new Packet103SetSlot(container.windowId, 0, container.getSlot(0).getItem()));
} }
// CraftBukkit end // CraftBukkit end

Datei anzeigen

@ -4,13 +4,10 @@ import java.util.Iterator;
import java.util.List; import java.util.List;
// CraftBukkit start // CraftBukkit start
import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import org.bukkit.craftbukkit.entity.CraftLivingEntity; import org.bukkit.craftbukkit.entity.CraftLivingEntity;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.PotionSplashEvent;
// CraftBukkit end // CraftBukkit end
public class EntityPotion extends EntityProjectile { 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()) { if (!event.isCancelled()) {
for (LivingEntity victim : event.getAffectedEntities()) { for (LivingEntity victim : event.getAffectedEntities()) {
if (!(victim instanceof CraftLivingEntity)) { if (!(victim instanceof CraftLivingEntity)) {

Datei anzeigen

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

Datei anzeigen

@ -3,9 +3,8 @@ package net.minecraft.server;
import java.util.Random; import java.util.Random;
// CraftBukkit start // CraftBukkit start
import org.bukkit.Material; import org.bukkit.event.entity.SheepRegrowWoolEvent;
import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.player.PlayerShearEntityEvent;
import org.bukkit.entity.Sheep;
// CraftBukkit end // CraftBukkit end
public class EntitySheep extends EntityAnimal { 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())); 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 // CraftBukkit end
} }
@ -80,7 +79,7 @@ public class EntitySheep extends EntityAnimal {
if (itemstack != null && itemstack.id == Item.SHEARS.id && !this.isSheared() && !this.isBaby()) { if (itemstack != null && itemstack.id == Item.SHEARS.id && !this.isSheared() && !this.isBaby()) {
if (!this.world.isStatic) { if (!this.world.isStatic) {
// CraftBukkit start // 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); this.world.getServer().getPluginManager().callEvent(event);
if (event.isCancelled()) { if (event.isCancelled()) {
@ -174,7 +173,7 @@ public class EntitySheep extends EntityAnimal {
public void z() { public void z() {
// CraftBukkit start // 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); this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {

Datei anzeigen

@ -1,9 +1,6 @@
package net.minecraft.server; package net.minecraft.server;
// CraftBukkit start import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
// CraftBukkit end
public class EntitySkeleton extends EntityMonster { 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) { 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 // 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); this.world.getServer().getPluginManager().callEvent(event);
if (!event.isCancelled()) { if (!event.isCancelled()) {
@ -105,12 +102,12 @@ public class EntitySkeleton extends EntityMonster {
if (k < 5) { if (k < 5) {
ItemStack itemstack = this.b(k <= 0 ? 1 : 0); ItemStack itemstack = this.b(k <= 0 ? 1 : 0);
if (itemstack != null) { 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 // CraftBukkit end
} }

Datei anzeigen

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

Datei anzeigen

@ -1,9 +1,8 @@
package net.minecraft.server; package net.minecraft.server;
import java.util.List; import java.util.List;
// CraftBukkit start // CraftBukkit start
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.EntityBlockFormEvent; import org.bukkit.event.block.EntityBlockFormEvent;
import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDamageEvent;
// CraftBukkit end // 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)) { 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 // 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); blockState.setTypeId(Block.SNOW.id);
EntityBlockFormEvent event = new EntityBlockFormEvent(this.getBukkitEntity(), blockState.getBlock(), blockState); 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)); 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 // CraftBukkit end
} }
} }

Datei anzeigen

@ -1,12 +1,6 @@
package net.minecraft.server; package net.minecraft.server;
// CraftBukkit start import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit
import java.util.List;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.event.entity.EntityTargetEvent;
import org.bukkit.craftbukkit.event.CraftEventFactory;
// CraftBukkit end
public class EntitySpider extends EntityMonster { public class EntitySpider extends EntityMonster {
@ -81,7 +75,7 @@ public class EntitySpider extends EntityMonster {
if (event.getTarget() == null) { if (event.getTarget() == null) {
this.target = null; this.target = null;
} else { } else {
this.target = ((CraftEntity) event.getTarget()).getHandle(); this.target = ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle();
} }
return; return;
} }
@ -117,7 +111,7 @@ public class EntitySpider extends EntityMonster {
protected void dropDeathLoot(boolean flag, int i) { protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start - whole method; adapted from super.dropDeathLoot. // 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); 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)); 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 // CraftBukkit end
} }

Datei anzeigen

@ -1,6 +1,5 @@
package net.minecraft.server; package net.minecraft.server;
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
public class EntitySquid extends EntityWaterAnimal { 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)); 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 // CraftBukkit end
} }

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -1,12 +1,10 @@
package net.minecraft.server; package net.minecraft.server;
// CraftBukkit start // CraftBukkit start
import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.craftbukkit.entity.CraftHumanEntity;
import org.bukkit.entity.HumanEntity; import org.bukkit.entity.HumanEntity;
import org.bukkit.inventory.InventoryHolder;
// CraftBukkit end // CraftBukkit end
public class InventoryLargeChest implements IInventory { public class InventoryLargeChest implements IInventory {
@ -16,7 +14,7 @@ public class InventoryLargeChest implements IInventory {
public IInventory right; // CraftBukkit - private -> public public IInventory right; // CraftBukkit - private -> public
// CraftBukkit start // CraftBukkit start
public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
public ItemStack[] getContents() { public ItemStack[] getContents() {
ItemStack[] result = new ItemStack[this.getSize()]; ItemStack[] result = new ItemStack[this.getSize()];
@ -42,7 +40,7 @@ public class InventoryLargeChest implements IInventory {
return transaction; 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 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; package net.minecraft.server;
// CraftBukkit start import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
import org.bukkit.craftbukkit.block.CraftBlockState;
import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.block.BlockPlaceEvent;
// CraftBukkit end
public class ItemBed extends Item { public class ItemBed extends Item {
@ -47,7 +43,7 @@ public class ItemBed extends Item {
world.setTypeIdAndData(i, j, k, blockbed.id, i1); world.setTypeIdAndData(i, j, k, blockbed.id, i1);
// CraftBukkit start - bed // 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()) { if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false);

Datei anzeigen

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

Datei anzeigen

@ -2,12 +2,6 @@ package net.minecraft.server;
import java.util.List; 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 class ItemBoat extends Item {
public ItemBoat(int i) { public ItemBoat(int i) {
@ -64,7 +58,7 @@ public class ItemBoat extends Item {
if (!world.isStatic) { if (!world.isStatic) {
// CraftBukkit start - Boat placement // 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()) { if (event.isCancelled()) {
return itemstack; return itemstack;

Datei anzeigen

@ -1,9 +1,5 @@
package net.minecraft.server; 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 { public class ItemBow extends Item {
@ -52,7 +48,7 @@ public class ItemBow extends Item {
} }
// CraftBukkit start // 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()) { if (event.isCancelled()) {
event.getProjectile().remove(); event.getProjectile().remove();
return; return;

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -2,7 +2,6 @@ package net.minecraft.server;
// CraftBukkit start // CraftBukkit start
import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockDamageEvent;
import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.event.CraftEventFactory;
import org.bukkit.event.Event; import org.bukkit.event.Event;
import org.bukkit.event.block.Action; import org.bukkit.event.block.Action;
@ -138,7 +137,7 @@ public class ItemInWorldManager {
} }
return; 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()) { if (blockEvent.isCancelled()) {
// Let the client know the block still exists // 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) { public boolean interact(EntityHuman entityhuman, World world, ItemStack itemstack, int i, int j, int k, int l) {
int i1 = world.getTypeId(i, j, k); int i1 = world.getTypeId(i, j, k);

Datei anzeigen

@ -1,11 +1,5 @@
package net.minecraft.server; 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 class ItemMinecart extends Item {
public int a; public int a;
@ -22,7 +16,7 @@ public class ItemMinecart extends Item {
if (BlockMinecartTrack.d(i1)) { if (BlockMinecartTrack.d(i1)) {
if (!world.isStatic) { if (!world.isStatic) {
// CraftBukkit start - Minecarts // 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()) { if (event.isCancelled()) {
return false; return false;

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -34,16 +34,7 @@ public class ItemStep extends ItemBlock {
boolean flag = (j1 & 8) != 0; boolean flag = (j1 & 8) != 0;
if ((l == 1 && !flag || l == 0 && flag) && i1 == Block.STEP.id && k1 == itemstack.getData()) { if ((l == 1 && !flag || l == 0 && flag) && i1 == Block.STEP.id && k1 == itemstack.getData()) {
/* CraftBukkit start - handle this in super return super.interactWith(itemstack, entityhuman, world, i, j, k, -1); // CraftBukkit - 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
} else { } else {
return b(itemstack, entityhuman, world, i, j, k, l) ? true : super.interactWith(itemstack, entityhuman, world, i, j, k, l); return b(itemstack, entityhuman, world, i, j, k, l) ? true : super.interactWith(itemstack, entityhuman, world, i, j, k, l);
} }

Datei anzeigen

@ -1,10 +1,6 @@
package net.minecraft.server; package net.minecraft.server;
// CraftBukkit start import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit
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 class ItemWaterLily extends ItemColoredBlock {
@ -37,7 +33,7 @@ public class ItemWaterLily extends ItemColoredBlock {
world.setTypeId(i, j + 1, k, Block.WATER_LILY.id); world.setTypeId(i, j + 1, k, Block.WATER_LILY.id);
// CraftBukkit start - waterlily // CraftBukkit start - waterlily
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()) { if (event.isCancelled() || !event.canBuild()) {
event.getBlockPlaced().setTypeId(0); event.getBlockPlaced().setTypeId(0);

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -2,13 +2,10 @@ package net.minecraft.server;
import java.io.DataInput; import java.io.DataInput;
import java.io.DataOutput; import java.io.DataOutput;
import java.io.IOException; // CraftBukkit
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.logging.Level; // CraftBukkit
import java.util.logging.Logger; // CraftBukkit
public class NBTTagCompound extends NBTBase { public class NBTTagCompound extends NBTBase {
@ -34,8 +31,8 @@ public class NBTTagCompound extends NBTBase {
// CraftBukkit start // CraftBukkit start
try { try {
dataoutput.writeByte(0); dataoutput.writeByte(0);
} catch (IOException ex) { } catch (java.io.IOException ex) {
Logger.getLogger(NBTTagCompound.class.getName()).log(Level.SEVERE, null, 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.Random;
import java.util.logging.Logger; 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 class NetLoginHandler extends NetHandler {
public static Logger logger = Logger.getLogger("Minecraft"); public static Logger logger = Logger.getLogger("Minecraft");
@ -86,7 +80,7 @@ public class NetLoginHandler extends NetHandler {
} else { } else {
if (!this.server.onlineMode) { if (!this.server.onlineMode) {
// CraftBukkit start - disallow colour in names // 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!"); this.disconnect("Colourful names are not permitted!");
return; 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. if (this.networkManager.getSocket() == null) return; // CraftBukkit - fix NPE when a client queries a server that is unable to handle it.
try { try {
// CraftBukkit start // 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(); String s = pingEvent.getMotd() + "\u00A7" + this.server.serverConfigurationManager.getPlayerCount() + "\u00A7" + pingEvent.getMaxPlayers();
// CraftBukkit end // CraftBukkit end

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

@ -23,8 +23,7 @@ public class Packet20NamedEntitySpawn extends Packet {
// CraftBukkit start - limit name length to 16 characters // CraftBukkit start - limit name length to 16 characters
if (entityhuman.name.length() > 16) { if (entityhuman.name.length() > 16) {
this.b = entityhuman.name.substring(0, 16); this.b = entityhuman.name.substring(0, 16);
} } else {
else {
this.b = entityhuman.name; this.b = entityhuman.name;
} }
// CraftBukkit end // CraftBukkit end

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