diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-07-22 01:18:00 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-07-23 23:55:31 -0500 |
commit | b00de5f1768e14238f8660b63eb3fd5d744fc0a9 (patch) | |
tree | 2c1407b1ef81f38e16f3c4e453bec077dfd1eb53 /src/main | |
parent | 8b9aad8c2b4057ab33a7bff2b8711d0d48c13568 (diff) | |
download | craftbukkit-b00de5f1768e14238f8660b63eb3fd5d744fc0a9.tar craftbukkit-b00de5f1768e14238f8660b63eb3fd5d744fc0a9.tar.gz craftbukkit-b00de5f1768e14238f8660b63eb3fd5d744fc0a9.tar.lz craftbukkit-b00de5f1768e14238f8660b63eb3fd5d744fc0a9.tar.xz craftbukkit-b00de5f1768e14238f8660b63eb3fd5d744fc0a9.zip |
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
Diffstat (limited to 'src/main')
126 files changed, 491 insertions, 751 deletions
diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java index ce0640b5..6e229d5b 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java @@ -529,7 +529,6 @@ public class Block { public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) { entityhuman.a(StatisticList.C[this.id], 1); entityhuman.c(0.025F); - if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) { ItemStack itemstack = this.a_(l); diff --git a/src/main/java/net/minecraft/server/BlockCactus.java b/src/main/java/net/minecraft/server/BlockCactus.java index 5d1da1bd..1997a863 100644 --- a/src/main/java/net/minecraft/server/BlockCactus.java +++ b/src/main/java/net/minecraft/server/BlockCactus.java @@ -1,12 +1,9 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.event.entity.EntityDamageByBlockEvent; -import org.bukkit.event.entity.EntityDamageEvent; -// CraftBukkit end - import java.util.Random; +import org.bukkit.event.entity.EntityDamageByBlockEvent; // CraftBukkit + public class BlockCactus extends Block { protected BlockCactus(int i, int j) { @@ -90,7 +87,7 @@ public class BlockCactus extends Block { org.bukkit.block.Block damager = world.getWorld().getBlockAt(i, j, k); org.bukkit.entity.Entity damagee = (entity == null) ? null : entity.getBukkitEntity(); - EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, EntityDamageEvent.DamageCause.CONTACT, 1); + EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, org.bukkit.event.entity.EntityDamageEvent.DamageCause.CONTACT, 1); world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/BlockCauldron.java b/src/main/java/net/minecraft/server/BlockCauldron.java index 515271e5..ba444961 100644 --- a/src/main/java/net/minecraft/server/BlockCauldron.java +++ b/src/main/java/net/minecraft/server/BlockCauldron.java @@ -94,4 +94,4 @@ public class BlockCauldron extends Block { public int getDropType(int i, Random random, int j) { return Item.CAULDRON.id; } -}
\ No newline at end of file +} diff --git a/src/main/java/net/minecraft/server/BlockDispenser.java b/src/main/java/net/minecraft/server/BlockDispenser.java index 1debc7da..8a009674 100644 --- a/src/main/java/net/minecraft/server/BlockDispenser.java +++ b/src/main/java/net/minecraft/server/BlockDispenser.java @@ -5,7 +5,6 @@ import java.util.Random; // CraftBukkit start import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.event.block.BlockDispenseEvent; -import org.bukkit.util.Vector; // CraftBukkit end public class BlockDispenser extends BlockContainer { @@ -125,7 +124,7 @@ public class BlockDispenser extends BlockContainer { org.bukkit.block.Block block = world.getWorld().getBlockAt(i, j, k); org.bukkit.inventory.ItemStack bukkitItem = new CraftItemStack(itemstack).clone(); - BlockDispenseEvent event = new BlockDispenseEvent(block, bukkitItem, new Vector(motX, motY, motZ)); + BlockDispenseEvent event = new BlockDispenseEvent(block, bukkitItem, new org.bukkit.util.Vector(motX, motY, motZ)); world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/BlockDragonEgg.java b/src/main/java/net/minecraft/server/BlockDragonEgg.java index 66f26f59..f97b7cf1 100644 --- a/src/main/java/net/minecraft/server/BlockDragonEgg.java +++ b/src/main/java/net/minecraft/server/BlockDragonEgg.java @@ -2,6 +2,8 @@ package net.minecraft.server; import java.util.Random; +import org.bukkit.event.block.BlockFromToEvent; // CraftBukkit + public class BlockDragonEgg extends Block { public BlockDragonEgg(int i, int j) { @@ -64,14 +66,15 @@ public class BlockDragonEgg extends Block { // CraftBukkit start org.bukkit.block.Block from = world.getWorld().getBlockAt(i, j, k); org.bukkit.block.Block to = world.getWorld().getBlockAt(i1, j1, k1); - org.bukkit.event.block.BlockFromToEvent event = new org.bukkit.event.block.BlockFromToEvent(from, to); + BlockFromToEvent event = new BlockFromToEvent(from, to); org.bukkit.Bukkit.getPluginManager().callEvent(event); - if (!event.isCancelled()) { - i1 = event.getToBlock().getX(); - j1 = event.getToBlock().getY(); - k1 = event.getToBlock().getZ(); - } else return; + if (event.isCancelled()) { + return; + } + i1 = event.getToBlock().getX(); + j1 = event.getToBlock().getY(); + k1 = event.getToBlock().getZ(); // CraftBukkit end world.setTypeIdAndData(i1, j1, k1, this.id, world.getData(i, j, k)); diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java index 40c7e728..3a4ce881 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java @@ -3,12 +3,9 @@ package net.minecraft.server; import java.util.Random; // CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.block.BlockIgniteEvent; -import org.bukkit.event.block.BlockIgniteEvent.IgniteCause; import org.bukkit.event.block.BlockBurnEvent; import org.bukkit.event.block.BlockSpreadEvent; -import org.bukkit.material.MaterialData; // CraftBukkit end public class BlockFire extends Block { @@ -109,7 +106,7 @@ public class BlockFire extends Block { org.bukkit.Server server = world.getServer(); org.bukkit.World bworld = world.getWorld(); - IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SPREAD; + BlockIgniteEvent.IgniteCause igniteCause = BlockIgniteEvent.IgniteCause.SPREAD; org.bukkit.block.Block fromBlock = bworld.getBlockAt(i, j, k); // CraftBukkit end @@ -151,7 +148,7 @@ public class BlockFire extends Block { org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, k1, j1).getState(); blockState.setTypeId(this.id); - blockState.setData(new MaterialData(this.id, (byte) k2)); + blockState.setData(new org.bukkit.material.MaterialData(this.id, (byte) k2)); BlockSpreadEvent spreadEvent = new BlockSpreadEvent(blockState.getBlock(), fromBlock, blockState); server.getPluginManager().callEvent(spreadEvent); @@ -261,7 +258,7 @@ public class BlockFire extends Block { } // CraftBukkit start private void fireExtinguished(World world, int x, int y, int z) { - if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(x, y, z), 0).isCancelled() == false) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(x, y, z), 0).isCancelled() == false) { world.setTypeId(x, y, z, 0); } } diff --git a/src/main/java/net/minecraft/server/BlockGrass.java b/src/main/java/net/minecraft/server/BlockGrass.java index 38f839a9..c3f06876 100644 --- a/src/main/java/net/minecraft/server/BlockGrass.java +++ b/src/main/java/net/minecraft/server/BlockGrass.java @@ -3,6 +3,7 @@ package net.minecraft.server; import java.util.Random; // CraftBukkit start +import org.bukkit.block.BlockState; import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.block.BlockFadeEvent; // CraftBukkit end @@ -24,7 +25,7 @@ public class BlockGrass extends Block { if (world.getLightLevel(i, j + 1, k) < 4 && Block.lightBlock[world.getTypeId(i, j + 1, k)] > 2) { // CraftBukkit start - reuse getLightLevel org.bukkit.World bworld = world.getWorld(); - org.bukkit.block.BlockState blockState = bworld.getBlockAt(i, j, k).getState(); + BlockState blockState = bworld.getBlockAt(i, j, k).getState(); blockState.setTypeId(Block.DIRT.id); BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState); @@ -44,7 +45,7 @@ public class BlockGrass extends Block { if (world.getTypeId(i1, j1, k1) == Block.DIRT.id && world.getLightLevel(i1, j1 + 1, k1) >= 4 && Block.lightBlock[l1] <= 2) { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); - org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); + BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); blockState.setTypeId(this.id); BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); diff --git a/src/main/java/net/minecraft/server/BlockIce.java b/src/main/java/net/minecraft/server/BlockIce.java index 08d27a32..7895543d 100644 --- a/src/main/java/net/minecraft/server/BlockIce.java +++ b/src/main/java/net/minecraft/server/BlockIce.java @@ -1,7 +1,6 @@ package net.minecraft.server; import java.util.Random; -import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit public class BlockIce extends BlockHalfTransparant { @@ -27,7 +26,7 @@ public class BlockIce extends BlockHalfTransparant { public void a(World world, int i, int j, int k, Random random) { if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11 - Block.lightBlock[this.id]) { // CraftBukkit start - if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), Block.STATIONARY_WATER.id).isCancelled()) { return; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/BlockMinecartTrack.java b/src/main/java/net/minecraft/server/BlockMinecartTrack.java index 2d12075e..528fdd84 100644 --- a/src/main/java/net/minecraft/server/BlockMinecartTrack.java +++ b/src/main/java/net/minecraft/server/BlockMinecartTrack.java @@ -81,7 +81,7 @@ public class BlockMinecartTrack extends Block { if (!world.isStatic) { this.a(world, i, j, k, true); if (this.id == Block.GOLDEN_RAIL.id) { - // this.doPhysics(world, i, j, k, this.id); CraftBukkit - Fix issues with rails + // this.doPhysics(world, i, j, k, this.id); // CraftBukkit - Fix issues with rails } } } diff --git a/src/main/java/net/minecraft/server/BlockMushroom.java b/src/main/java/net/minecraft/server/BlockMushroom.java index 6d4e2cb1..c9f1143d 100644 --- a/src/main/java/net/minecraft/server/BlockMushroom.java +++ b/src/main/java/net/minecraft/server/BlockMushroom.java @@ -1,13 +1,13 @@ package net.minecraft.server; -import java.util.ArrayList; import java.util.Random; + // CraftBukkit start -import org.bukkit.BlockChangeDelegate; +import java.util.ArrayList; + import org.bukkit.Location; import org.bukkit.TreeType; import org.bukkit.block.BlockState; -import org.bukkit.entity.Player; import org.bukkit.event.block.BlockSpreadEvent; import org.bukkit.event.world.StructureGrowEvent; // CraftBukkit end @@ -63,7 +63,7 @@ public class BlockMushroom extends BlockFlower { if (world.isEmpty(i1, j1, k1) && this.f(world, i1, j1, k1)) { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); - org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); + BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); blockState.setTypeId(this.id); BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); @@ -96,7 +96,7 @@ public class BlockMushroom extends BlockFlower { } // CraftBukkit - added bonemeal, player and itemstack - public boolean grow(World world, int i, int j, int k, Random random, boolean bonemeal, Player player, ItemStack itemstack) { + public boolean grow(World world, int i, int j, int k, Random random, boolean bonemeal, org.bukkit.entity.Player player, ItemStack itemstack) { int l = world.getData(i, j, k); world.setRawTypeId(i, j, k, 0); @@ -114,7 +114,7 @@ public class BlockMushroom extends BlockFlower { worldgenhugemushroom = new WorldGenHugeMushroom(1); } if (worldgenhugemushroom != null && event != null) { - grown = worldgenhugemushroom.grow((BlockChangeDelegate)world, random, i, j, k, event, itemstack, world.getWorld()); + grown = worldgenhugemushroom.grow((org.bukkit.BlockChangeDelegate)world, random, i, j, k, event, itemstack, world.getWorld()); if (event.isFromBonemeal() && itemstack != null) { --itemstack.count; } diff --git a/src/main/java/net/minecraft/server/BlockMycel.java b/src/main/java/net/minecraft/server/BlockMycel.java index 0b152774..d0d51e2e 100644 --- a/src/main/java/net/minecraft/server/BlockMycel.java +++ b/src/main/java/net/minecraft/server/BlockMycel.java @@ -1,8 +1,12 @@ package net.minecraft.server; import java.util.Random; -import org.bukkit.event.block.BlockFadeEvent; // CraftBukkit -import org.bukkit.event.block.BlockSpreadEvent; // CraftBukkit + +// CraftBukkit start +import org.bukkit.block.BlockState; +import org.bukkit.event.block.BlockFadeEvent; +import org.bukkit.event.block.BlockSpreadEvent; +// CraftBukkit end public class BlockMycel extends Block { @@ -21,7 +25,7 @@ public class BlockMycel extends Block { if (world.getLightLevel(i, j + 1, k) < 4 && Block.lightBlock[world.getTypeId(i, j + 1, k)] > 2) { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); - org.bukkit.block.BlockState blockState = bworld.getBlockAt(i, j, k).getState(); + BlockState blockState = bworld.getBlockAt(i, j, k).getState(); blockState.setTypeId(Block.DIRT.id); BlockFadeEvent event = new BlockFadeEvent(blockState.getBlock(), blockState); @@ -41,7 +45,7 @@ public class BlockMycel extends Block { if (world.getTypeId(i1, j1, k1) == Block.DIRT.id && world.getLightLevel(i1, j1 + 1, k1) >= 4 && Block.lightBlock[l1] <= 2) { // CraftBukkit start org.bukkit.World bworld = world.getWorld(); - org.bukkit.block.BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); + BlockState blockState = bworld.getBlockAt(i1, j1, k1).getState(); blockState.setTypeId(this.id); BlockSpreadEvent event = new BlockSpreadEvent(blockState.getBlock(), bworld.getBlockAt(i, j, k), blockState); diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java index 8967a8fd..057f526b 100644 --- a/src/main/java/net/minecraft/server/BlockPortal.java +++ b/src/main/java/net/minecraft/server/BlockPortal.java @@ -78,7 +78,7 @@ public class BlockPortal extends BlockHalfTransparant { if (flag) { if (j1 != Block.OBSIDIAN.id) { return false; - } else { + } else { // CraftBukkit blocks.add(bworld.getBlockAt(i + b0 * l, j + i1, k + b1 * l)); // CraftBukkit } } else if (j1 != 0 && j1 != Block.FIRE.id) { diff --git a/src/main/java/net/minecraft/server/BlockPressurePlate.java b/src/main/java/net/minecraft/server/BlockPressurePlate.java index 9f32d091..e15ee3b5 100644 --- a/src/main/java/net/minecraft/server/BlockPressurePlate.java +++ b/src/main/java/net/minecraft/server/BlockPressurePlate.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Random; // CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.block.BlockRedstoneEvent; import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit end @@ -110,7 +109,7 @@ public class BlockPressurePlate extends Block { org.bukkit.event.Cancellable cancellable; if (object instanceof EntityHuman) { - cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) object, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null); + cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) object, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null); } else if (object instanceof Entity) { cancellable = new EntityInteractEvent(((Entity) object).getBukkitEntity(), bworld.getBlockAt(i, j, k)); manager.callEvent((EntityInteractEvent) cancellable); diff --git a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java index 6fde3076..5aa16d64 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneLamp.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneLamp.java @@ -4,7 +4,6 @@ import java.util.Random; // CraftBukkit start import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockRedstoneEvent; // CraftBukkit end public class BlockRedstoneLamp extends Block { diff --git a/src/main/java/net/minecraft/server/BlockRedstoneOre.java b/src/main/java/net/minecraft/server/BlockRedstoneOre.java index 8d28de8b..7811b87a 100644 --- a/src/main/java/net/minecraft/server/BlockRedstoneOre.java +++ b/src/main/java/net/minecraft/server/BlockRedstoneOre.java @@ -2,6 +2,8 @@ package net.minecraft.server; import java.util.Random; +import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit + public class BlockRedstoneOre extends Block { private boolean a; @@ -33,7 +35,7 @@ public class BlockRedstoneOre extends Block { super.b(world, i, j, k, entity); } } else { - org.bukkit.event.entity.EntityInteractEvent event = new org.bukkit.event.entity.EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k)); + EntityInteractEvent event = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k)); world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { this.g(world, i, j, k); diff --git a/src/main/java/net/minecraft/server/BlockSapling.java b/src/main/java/net/minecraft/server/BlockSapling.java index 71ffc87d..27853ae7 100644 --- a/src/main/java/net/minecraft/server/BlockSapling.java +++ b/src/main/java/net/minecraft/server/BlockSapling.java @@ -1,14 +1,11 @@ package net.minecraft.server; import java.util.Random; + // CraftBukkit start -import org.bukkit.BlockChangeDelegate; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.TreeType; -import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.util.StructureGrowDelegate; -import org.bukkit.entity.Player; import org.bukkit.event.world.StructureGrowEvent; // CraftBukkit end @@ -42,7 +39,7 @@ public class BlockSapling extends BlockFlower { } // CraftBukkit - added bonemeal, player and itemstack - public void grow(World world, int i, int j, int k, Random random, boolean bonemeal, Player player, ItemStack itemstack) { + public void grow(World world, int i, int j, int k, Random random, boolean bonemeal, org.bukkit.entity.Player player, ItemStack itemstack) { int l = world.getData(i, j, k) & 3; int i1 = 0; int j1 = 0; @@ -102,11 +99,11 @@ public class BlockSapling extends BlockFlower { if (grownTree) { Location location = new Location(world.getWorld(), i, j, k); StructureGrowEvent event = new StructureGrowEvent(location, treeType, bonemeal, player, delegate.getBlocks()); - Bukkit.getPluginManager().callEvent(event); + org.bukkit.Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) { grownTree = false; } else { - for (BlockState state : event.getBlocks()) { + for (org.bukkit.block.BlockState state : event.getBlocks()) { state.update(true); } if (event.isFromBonemeal() && itemstack != null) { @@ -140,7 +137,7 @@ public class BlockSapling extends BlockFlower { public boolean a(World world, Random random, int i, int j, int k); - public boolean generate(BlockChangeDelegate world, Random random, int i, int j, int k); + public boolean generate(org.bukkit.BlockChangeDelegate world, Random random, int i, int j, int k); } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/BlockSnow.java b/src/main/java/net/minecraft/server/BlockSnow.java index 308eb977..52db4965 100644 --- a/src/main/java/net/minecraft/server/BlockSnow.java +++ b/src/main/java/net/minecraft/server/BlockSnow.java @@ -1,7 +1,6 @@ package net.minecraft.server; import java.util.Random; -import org.bukkit.craftbukkit.event.CraftEventFactory; public class BlockSnow extends Block { @@ -78,7 +77,7 @@ public class BlockSnow extends Block { public void a(World world, int i, int j, int k, Random random) { if (world.a(EnumSkyBlock.BLOCK, i, j, k) > 11) { // CraftBukkit start - if (CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), 0).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(world.getWorld().getBlockAt(i, j, k), 0).isCancelled()) { return; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/BlockSoil.java b/src/main/java/net/minecraft/server/BlockSoil.java index 591dd773..1c2c201e 100644 --- a/src/main/java/net/minecraft/server/BlockSoil.java +++ b/src/main/java/net/minecraft/server/BlockSoil.java @@ -2,10 +2,7 @@ package net.minecraft.server; import java.util.Random; -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.entity.EntityInteractEvent; -// CraftBukkit end +import org.bukkit.event.entity.EntityInteractEvent; // CraftBukkit public class BlockSoil extends Block { @@ -52,7 +49,7 @@ public class BlockSoil extends Block { // CraftBukkit start - Interact Soil org.bukkit.event.Cancellable cancellable; if (entity instanceof EntityHuman) { - cancellable = CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null); + cancellable = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, i, j, k, -1, null); } else { cancellable = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(i, j, k)); world.getServer().getPluginManager().callEvent((EntityInteractEvent) cancellable); diff --git a/src/main/java/net/minecraft/server/BlockStationary.java b/src/main/java/net/minecraft/server/BlockStationary.java index bbf87e01..a3a266d7 100644 --- a/src/main/java/net/minecraft/server/BlockStationary.java +++ b/src/main/java/net/minecraft/server/BlockStationary.java @@ -2,7 +2,10 @@ package net.minecraft.server; import java.util.Random; -import org.bukkit.event.block.BlockIgniteEvent; // CraftBukkit +// CraftBukkit start +import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.event.block.BlockIgniteEvent; +// CraftBukkit end public class BlockStationary extends BlockFluids { @@ -57,7 +60,7 @@ public class BlockStationary extends BlockFluids { // CraftBukkit start - prevent lava putting something on fire. org.bukkit.block.Block block = bworld.getBlockAt(i, j, k); if (block.getTypeId() != Block.FIRE.id) { - if (org.bukkit.craftbukkit.event.CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) { + if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) { continue; } } @@ -82,7 +85,7 @@ public class BlockStationary extends BlockFluids { // CraftBukkit start - prevent lava putting something on fire. org.bukkit.block.Block block = bworld.getBlockAt(i, j + 1, k); if (block.getTypeId() != Block.FIRE.id) { - if (org.bukkit.craftbukkit.event.CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) { + if (CraftEventFactory.callEvent(new BlockIgniteEvent(block, igniteCause, null)).isCancelled()) { continue; } } diff --git a/src/main/java/net/minecraft/server/BlockStem.java b/src/main/java/net/minecraft/server/BlockStem.java index 44687703..513aab62 100644 --- a/src/main/java/net/minecraft/server/BlockStem.java +++ b/src/main/java/net/minecraft/server/BlockStem.java @@ -2,6 +2,8 @@ package net.minecraft.server; import java.util.Random; +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit + public class BlockStem extends BlockFlower { private Block blockFruit; @@ -29,7 +31,7 @@ public class BlockStem extends BlockFlower { if (l < 7) { ++l; - org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, l); // CraftBukkit + CraftEventFactory.handleBlockGrowEvent(world, i, j, k, this.id, l); // CraftBukkit } else { if (world.getTypeId(i - 1, j, k) == this.blockFruit.id) { return; @@ -70,7 +72,7 @@ public class BlockStem extends BlockFlower { int l1 = world.getTypeId(j1, j - 1, k1); if (world.getTypeId(j1, j, k1) == 0 && (l1 == Block.SOIL.id || l1 == Block.DIRT.id || l1 == Block.GRASS.id)) { - org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(world, j1, j, k1, this.blockFruit.id, 0); // CraftBukkit + CraftEventFactory.handleBlockGrowEvent(world, j1, j, k1, this.blockFruit.id, 0); // CraftBukkit } } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 5835eef9..223ed087 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1,6 +1,6 @@ package net.minecraft.server; -import java.util.ArrayList; +// import java.util.ArrayList; // CraftBukkit import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; @@ -10,6 +10,7 @@ import java.util.Random; // CraftBukkit start import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.craftbukkit.util.UnsafeList; // CraftBukkit end @@ -665,8 +666,8 @@ public class Chunk { java.util.Iterator<Object> iter = this.entitySlices[i].iterator(); while (iter.hasNext()) { Entity entity = (Entity) iter.next(); - int cx = org.bukkit.Location.locToBlock(entity.locX) >> 4; - int cz = org.bukkit.Location.locToBlock(entity.locZ) >> 4; + int cx = Location.locToBlock(entity.locX) >> 4; + int cz = Location.locToBlock(entity.locZ) >> 4; // Do not pass along players, as doing so can get them stuck outside of time. // (which for example disables inventory icon updates and prevents block breaking) diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index 60f7f91d..f3a38c94 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -9,13 +9,11 @@ import java.util.Set; // CraftBukkit start import java.util.Random; -import org.bukkit.craftbukkit.CraftChunk; + +import org.bukkit.Server; import org.bukkit.craftbukkit.util.LongHashset; import org.bukkit.craftbukkit.util.LongHashtable; -import org.bukkit.event.world.ChunkLoadEvent; -import org.bukkit.event.world.ChunkPopulateEvent; import org.bukkit.event.world.ChunkUnloadEvent; -import org.bukkit.generator.BlockPopulator; // CraftBukkit end public class ChunkProviderServer implements IChunkProvider { @@ -93,14 +91,14 @@ public class ChunkProviderServer implements IChunkProvider { } // CraftBukkit start - org.bukkit.Server server = this.world.getServer(); + Server server = this.world.getServer(); if (server != null) { /* * If it's a new world, the first few chunks are generated inside * the World constructor. We can't reliably alter that, so we have * no way of creating a CraftWorld/CraftServer at that point. */ - server.getPluginManager().callEvent(new ChunkLoadEvent(chunk.bukkitChunk, newChunk)); + server.getPluginManager().callEvent(new org.bukkit.event.world.ChunkLoadEvent(chunk.bukkitChunk, newChunk)); } // CraftBukkit end @@ -185,12 +183,12 @@ public class ChunkProviderServer implements IChunkProvider { org.bukkit.World world = this.world.getWorld(); if (world != null) { - for (BlockPopulator populator : world.getPopulators()) { + for (org.bukkit.generator.BlockPopulator populator : world.getPopulators()) { populator.populate(world, random, chunk.bukkitChunk); } } BlockSand.instaFall = false; - this.world.getServer().getPluginManager().callEvent(new ChunkPopulateEvent(chunk.bukkitChunk)); + this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.world.ChunkPopulateEvent(chunk.bukkitChunk)); // CraftBukkit end chunk.e(); @@ -232,7 +230,7 @@ public class ChunkProviderServer implements IChunkProvider { public boolean unloadChunks() { if (!this.world.savingDisabled) { // CraftBukkit start - org.bukkit.Server server = this.world.getServer(); + Server server = this.world.getServer(); for (int i = 0; i < 50 && !this.unloadQueue.isEmpty(); i++) { long chunkcoordinates = this.unloadQueue.popFirst(); Chunk chunk = this.chunks.get(chunkcoordinates); diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java index d27f1948..e4ba36a5 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -5,7 +5,6 @@ import java.io.DataInputStream; import java.io.DataOutput; import java.io.DataOutputStream; import java.io.File; -import java.io.IOException; // CraftBukkit import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -132,7 +131,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver { return true; } - public void a(PendingChunkToSave pendingchunktosave) throws IOException { // CraftBukkit - Added throws + public void a(PendingChunkToSave pendingchunktosave) throws java.io.IOException { // CraftBukkit - Added throws DataOutputStream dataoutputstream = RegionFileCache.c(this.d, pendingchunktosave.a.x, pendingchunktosave.a.z); NBTCompressedStreamTools.a(pendingchunktosave.b, (DataOutput) dataoutputstream); diff --git a/src/main/java/net/minecraft/server/ConsoleLogFormatter.java b/src/main/java/net/minecraft/server/ConsoleLogFormatter.java index 2ed2a5e7..d1bd5eff 100644 --- a/src/main/java/net/minecraft/server/ConsoleLogFormatter.java +++ b/src/main/java/net/minecraft/server/ConsoleLogFormatter.java @@ -7,11 +7,13 @@ import java.util.logging.Formatter; import java.util.logging.Level; import java.util.logging.LogRecord; +import java.util.regex.Pattern; // CraftBukkit + final class ConsoleLogFormatter extends Formatter { private SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // CraftBukkit start - add color stripping, change constructor to take it - private java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]"); + private Pattern pattern = Pattern.compile("\\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]"); private boolean strip = false; ConsoleLogFormatter(boolean strip) { diff --git a/src/main/java/net/minecraft/server/ConsoleLogManager.java b/src/main/java/net/minecraft/server/ConsoleLogManager.java index 1e4af5e5..f9f3f222 100644 --- a/src/main/java/net/minecraft/server/ConsoleLogManager.java +++ b/src/main/java/net/minecraft/server/ConsoleLogManager.java @@ -5,20 +5,14 @@ import java.util.logging.FileHandler; import java.util.logging.Level; import java.util.logging.Logger; -// CraftBukkit start -import java.io.File; -import java.util.logging.Handler; -import org.bukkit.craftbukkit.util.ShortConsoleLogFormatter; -import org.bukkit.craftbukkit.util.TerminalConsoleHandler; -// CraftBukkit end +import java.io.File; // CraftBukkit public class ConsoleLogManager { public static Logger a = Logger.getLogger("Minecraft"); public static Logger global = Logger.getLogger(""); // CraftBukkit - public ConsoleLogManager() { - } + public ConsoleLogManager() {} // CraftBukkit - change of method signature! public static void init(MinecraftServer server) { @@ -26,13 +20,13 @@ public class ConsoleLogManager { a.setUseParentHandlers(false); // CraftBukkit start - ConsoleHandler consolehandler = new TerminalConsoleHandler(server.reader); + ConsoleHandler consolehandler = new org.bukkit.craftbukkit.util.TerminalConsoleHandler(server.reader); - for (Handler handler : global.getHandlers()) { + for (java.util.logging.Handler handler : global.getHandlers()) { global.removeHandler(handler); } - consolehandler.setFormatter(new ShortConsoleLogFormatter(server)); + consolehandler.setFormatter(new org.bukkit.craftbukkit.util.ShortConsoleLogFormatter(server)); global.addHandler(consolehandler); // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java index 734378bc..6ffd42ed 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -6,7 +6,6 @@ import java.util.List; import java.util.Set; // CraftBukkit start -import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.inventory.InventoryView; // CraftBukkit end @@ -23,7 +22,7 @@ public abstract class Container { // CraftBukkit start public boolean checkReachable = true; public abstract InventoryView getBukkitView(); - public void transferTo(Container other, CraftHumanEntity player) { + public void transferTo(Container other, org.bukkit.craftbukkit.entity.CraftHumanEntity player) { InventoryView source = this.getBukkitView(), destination = other.getBukkitView(); ((CraftInventory) source.getTopInventory()).getInventory().onClose(player); ((CraftInventory) source.getBottomInventory()).getInventory().onClose(player); diff --git a/src/main/java/net/minecraft/server/ContainerChest.java b/src/main/java/net/minecraft/server/ContainerChest.java index e2876d21..86270600 100644 --- a/src/main/java/net/minecraft/server/ContainerChest.java +++ b/src/main/java/net/minecraft/server/ContainerChest.java @@ -2,8 +2,6 @@ package net.minecraft.server; // CraftBukkit start import org.bukkit.craftbukkit.inventory.CraftInventory; -import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest; -import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer; import org.bukkit.craftbukkit.inventory.CraftInventoryView; // CraftBukkit end @@ -21,9 +19,9 @@ public class ContainerChest extends Container { } CraftInventory inventory; if (this.container instanceof PlayerInventory) { - inventory = new CraftInventoryPlayer((PlayerInventory) this.container); + inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryPlayer((PlayerInventory) this.container); } else if (this.container instanceof InventoryLargeChest) { - inventory = new CraftInventoryDoubleChest((InventoryLargeChest) this.container); + inventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) this.container); } else { inventory = new CraftInventory(this.container); } diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTable.java b/src/main/java/net/minecraft/server/ContainerEnchantTable.java index a2eb3473..ece50e71 100644 --- a/src/main/java/net/minecraft/server/ContainerEnchantTable.java +++ b/src/main/java/net/minecraft/server/ContainerEnchantTable.java @@ -1,12 +1,11 @@ package net.minecraft.server; -import java.util.Iterator; +// import java.util.Iterator; // CraftBukkit import java.util.List; import java.util.Random; // CraftBukkit start import java.util.Map; -import java.util.HashMap; import org.bukkit.craftbukkit.inventory.CraftInventoryEnchanting; import org.bukkit.craftbukkit.inventory.CraftInventoryView; @@ -154,7 +153,7 @@ public class ContainerEnchantTable extends Container { if (list != null) { // CraftBukkit start - Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new HashMap<org.bukkit.enchantments.Enchantment, Integer>(); + Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new java.util.HashMap<org.bukkit.enchantments.Enchantment, Integer>(); for (Object obj : list) { EnchantmentInstance instance = (EnchantmentInstance) obj; enchants.put(org.bukkit.enchantments.Enchantment.getById(instance.enchantment.id), instance.level); diff --git a/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java b/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java index 400feb56..99e0f5cb 100644 --- a/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java +++ b/src/main/java/net/minecraft/server/ContainerEnchantTableSubcontainer.java @@ -1,12 +1,10 @@ package net.minecraft.server; -import java.util.ArrayList; import java.util.List; // CraftBukkit start import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; -import org.bukkit.inventory.InventoryHolder; // CraftBukkit end public class ContainerEnchantTableSubcontainer implements IInventory { @@ -17,7 +15,7 @@ public class ContainerEnchantTableSubcontainer implements IInventory { private List d; // CraftBukkit start - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); public org.bukkit.entity.Player player; private int maxStack = MAX_STACK; @@ -37,7 +35,7 @@ public class ContainerEnchantTableSubcontainer implements IInventory { return transaction; } - public InventoryHolder getOwner() { + public org.bukkit.inventory.InventoryHolder getOwner() { return this.player; } diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java index a5973bac..e6f8691c 100644 --- a/src/main/java/net/minecraft/server/CraftingManager.java +++ b/src/main/java/net/minecraft/server/CraftingManager.java @@ -4,10 +4,8 @@ import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.inventory.InventoryView; -// CraftBukkit end + +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit public class CraftingManager { @@ -15,7 +13,7 @@ public class CraftingManager { public List recipies = new ArrayList(); // CraftBukkit - private -> public // CraftBukkit start public CraftingRecipe lastRecipe; - public InventoryView lastCraftView; + public org.bukkit.inventory.InventoryView lastCraftView; // CraftBukkit end public static final CraftingManager getInstance() { diff --git a/src/main/java/net/minecraft/server/CraftingRecipe.java b/src/main/java/net/minecraft/server/CraftingRecipe.java index 28c2526d..fceeb736 100644 --- a/src/main/java/net/minecraft/server/CraftingRecipe.java +++ b/src/main/java/net/minecraft/server/CraftingRecipe.java @@ -1,7 +1,5 @@ package net.minecraft.server; -import org.bukkit.inventory.Recipe; // CraftBukkit - public interface CraftingRecipe { boolean a(InventoryCrafting inventorycrafting); @@ -11,6 +9,6 @@ public interface CraftingRecipe { int a(); ItemStack b(); - - Recipe toBukkitRecipe(); // CraftBukkit + + org.bukkit.inventory.Recipe toBukkitRecipe(); // CraftBukkit } diff --git a/src/main/java/net/minecraft/server/Enchantment.java b/src/main/java/net/minecraft/server/Enchantment.java index 307ebed9..8fa4811d 100644 --- a/src/main/java/net/minecraft/server/Enchantment.java +++ b/src/main/java/net/minecraft/server/Enchantment.java @@ -1,7 +1,5 @@ package net.minecraft.server; -import org.bukkit.craftbukkit.enchantments.CraftEnchantment; - public abstract class Enchantment { // CraftBukkit - update CraftEnchant.getName(i) if this changes. public static final Enchantment[] byId = new Enchantment[256]; @@ -41,7 +39,7 @@ public abstract class Enchantment { byId[i] = this; } - org.bukkit.enchantments.Enchantment.registerEnchantment(new CraftEnchantment(this)); // CraftBukkit + org.bukkit.enchantments.Enchantment.registerEnchantment(new org.bukkit.craftbukkit.enchantments.CraftEnchantment(this)); // CraftBukkit } public int getRandomWeight() { diff --git a/src/main/java/net/minecraft/server/EnchantmentModifierDamage.java b/src/main/java/net/minecraft/server/EnchantmentModifierDamage.java deleted file mode 100644 index 41f00ad0..00000000 --- a/src/main/java/net/minecraft/server/EnchantmentModifierDamage.java +++ /dev/null @@ -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(); - } -} diff --git a/src/main/java/net/minecraft/server/EnchantmentModifierProtection.java b/src/main/java/net/minecraft/server/EnchantmentModifierProtection.java deleted file mode 100644 index 4b1ec519..00000000 --- a/src/main/java/net/minecraft/server/EnchantmentModifierProtection.java +++ /dev/null @@ -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(); - } -} diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java index c7a67cfa..d8b778ec 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java @@ -5,17 +5,19 @@ import java.util.Random; // CraftBukkit start import java.util.UUID; + import org.bukkit.Bukkit; +import org.bukkit.Server; import org.bukkit.block.BlockFace; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Painting; import org.bukkit.entity.Vehicle; -import org.bukkit.event.entity.EntityCombustByBlockEvent; import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.painting.PaintingBreakByEntityEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleExitEvent; +import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.event.entity.EntityCombustEvent; import org.bukkit.event.entity.EntityDamageByBlockEvent; @@ -381,7 +383,7 @@ public abstract class Entity { if (!this.fireProof) { // CraftBukkit start - fallen in lava TODO: this event spams! if (this instanceof EntityLiving) { - org.bukkit.Server server = this.world.getServer(); + Server server = this.world.getServer(); // TODO: shouldn't be sending null for the block. org.bukkit.block.Block damager = null; // ((WorldServer) this.l).getWorld().getBlockAt(i, j, k); @@ -397,7 +399,7 @@ public abstract class Entity { if (this.fireTicks <= 0) { // not on fire yet - EntityCombustEvent combustEvent = new EntityCombustByBlockEvent(damager, damagee, 15); + EntityCombustEvent combustEvent = new org.bukkit.event.entity.EntityCombustByBlockEvent(damager, damagee, 15); server.getPluginManager().callEvent(combustEvent); if (!combustEvent.isCancelled()) { @@ -895,7 +897,7 @@ public abstract class Entity { // CraftBukkit start if (world == null) { this.die(); - this.world = ((org.bukkit.craftbukkit.CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle(); + this.world = ((CraftWorld) Bukkit.getServer().getWorlds().get(0)).getHandle(); return; } // CraftBukkit end @@ -1124,7 +1126,7 @@ public abstract class Entity { // CraftBukkit start - reset world if (this instanceof EntityPlayer) { - org.bukkit.Server server = Bukkit.getServer(); + Server server = Bukkit.getServer(); org.bukkit.World bworld = null; // TODO: Remove World related checks, replaced with WorldUID. @@ -1141,7 +1143,7 @@ public abstract class Entity { bworld = ((org.bukkit.craftbukkit.CraftServer) server).getServer().getWorldServer(entityPlayer.dimension).getWorld(); } - this.spawnIn(bworld == null ? null : ((org.bukkit.craftbukkit.CraftWorld) bworld).getHandle()); + this.spawnIn(bworld == null ? null : ((CraftWorld) bworld).getHandle()); } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityBlaze.java b/src/main/java/net/minecraft/server/EntityBlaze.java index aef63faf..ca3af516 100644 --- a/src/main/java/net/minecraft/server/EntityBlaze.java +++ b/src/main/java/net/minecraft/server/EntityBlaze.java @@ -1,8 +1,5 @@ package net.minecraft.server; -import java.util.List; -import org.bukkit.craftbukkit.event.CraftEventFactory; - public class EntityBlaze extends EntityMonster { private float a = 0.5F; @@ -144,14 +141,14 @@ public class EntityBlaze extends EntityMonster { protected void dropDeathLoot(boolean flag, int i) { if (flag) { // CraftBukkit start - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int j = this.random.nextInt(2 + i); if (j > 0) { loot.add(new org.bukkit.inventory.ItemStack(Item.BLAZE_ROD.id, j)); } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } } diff --git a/src/main/java/net/minecraft/server/EntityBoat.java b/src/main/java/net/minecraft/server/EntityBoat.java index c72413ba..88b98447 100644 --- a/src/main/java/net/minecraft/server/EntityBoat.java +++ b/src/main/java/net/minecraft/server/EntityBoat.java @@ -5,13 +5,10 @@ import java.util.List; // CraftBukkit start import org.bukkit.Location; import org.bukkit.entity.Vehicle; -import org.bukkit.event.vehicle.VehicleCreateEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; import org.bukkit.event.vehicle.VehicleDestroyEvent; -import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; import org.bukkit.event.vehicle.VehicleMoveEvent; -import org.bukkit.event.vehicle.VehicleUpdateEvent; // CraftBukkit end public class EntityBoat extends Entity { @@ -83,7 +80,7 @@ public class EntityBoat extends Entity { this.lastY = d1; this.lastZ = d2; - this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit + this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit } public double x_() { @@ -307,7 +304,6 @@ public class EntityBoat extends Entity { this.world.getServer().getPluginManager().callEvent(destroyEvent); if (!destroyEvent.isCancelled()) { - // CraftBukkit end this.die(); int k; @@ -319,7 +315,8 @@ public class EntityBoat extends Entity { for (k = 0; k < 2; ++k) { this.a(Item.STICK.id, 1, 0.0F); } - } // CraftBukkit + } + // CraftBukkit end } } else { this.motX *= 0.9900000095367432D; @@ -364,7 +361,7 @@ public class EntityBoat extends Entity { Location to = new Location(bworld, this.locX, this.locY, this.locZ, this.yaw, this.pitch); Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - server.getPluginManager().callEvent(new VehicleUpdateEvent(vehicle)); + server.getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleUpdateEvent(vehicle)); if (!from.equals(to)) { VehicleMoveEvent event = new VehicleMoveEvent(vehicle, from, to); diff --git a/src/main/java/net/minecraft/server/EntityChicken.java b/src/main/java/net/minecraft/server/EntityChicken.java index 323d6ddc..ce0bf76b 100644 --- a/src/main/java/net/minecraft/server/EntityChicken.java +++ b/src/main/java/net/minecraft/server/EntityChicken.java @@ -1,10 +1,5 @@ package net.minecraft.server; -// CraftBukkit start -import java.util.List; -import org.bukkit.craftbukkit.event.CraftEventFactory; -// CraftBukkit end - public class EntityChicken extends EntityAnimal { public boolean a = false; @@ -98,7 +93,7 @@ public class EntityChicken extends EntityAnimal { protected void dropDeathLoot(boolean flag, int i) { // CraftBukkit start - whole method - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int j = this.random.nextInt(3) + this.random.nextInt(1 + i); if (j > 0) { @@ -111,7 +106,7 @@ public class EntityChicken extends EntityAnimal { loot.add(new org.bukkit.inventory.ItemStack(Item.RAW_CHICKEN.id, 1)); } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java index e9dbe438..2b7d341f 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -1,13 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import java.util.List; - -import org.bukkit.Location; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.event.player.PlayerBucketFillEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit public class EntityCow extends EntityAnimal { @@ -64,7 +57,7 @@ public class EntityCow extends EntityAnimal { protected void dropDeathLoot(boolean flag, int i) { // CraftBukkit start - whole method - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int j = this.random.nextInt(3) + this.random.nextInt(1 + i); if (j > 0) { @@ -86,14 +79,14 @@ public class EntityCow extends EntityAnimal { if (itemstack != null && itemstack.id == Item.BUCKET.id) { // CraftBukkit start - got milk? - Location loc = this.getBukkitEntity().getLocation(); - PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET); + org.bukkit.Location loc = this.getBukkitEntity().getLocation(); + org.bukkit.event.player.PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET); if (event.isCancelled()) { return false; } - entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, CraftItemStack.createNMSItemStack(event.getItemStack())); + entityhuman.inventory.setItem(entityhuman.inventory.itemInHandIndex, org.bukkit.craftbukkit.inventory.CraftItemStack.createNMSItemStack(event.getItemStack())); // CraftBukkit end return true; diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java index 741e755e..3f7914d7 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -2,7 +2,6 @@ package net.minecraft.server; // CraftBukkit start import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.TrigMath; import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit end @@ -106,7 +105,7 @@ public abstract class EntityCreature extends EntityLiving { double d2 = vec3d.c - this.locZ; double d3 = vec3d.b - (double) i; // CraftBukkit - Math -> TrigMath - float f2 = (float) (TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F; + float f2 = (float) (org.bukkit.craftbukkit.TrigMath.atan2(d2, d1) * 180.0D / 3.1415927410125732D) - 90.0F; float f3 = f2 - this.yaw; for (this.aX = this.bb; f3 < -180.0F; f3 += 360.0F) { diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java index 10bb2922..8f943210 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -1,8 +1,6 @@ package net.minecraft.server; // CraftBukkit start -import java.util.List; - import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit end @@ -110,7 +108,7 @@ public class EntityCreeper extends EntityMonster { protected void dropDeathLoot(boolean flag, int i) { int j = this.getLootId(); - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); if (j > 0) { int k = this.random.nextInt(3); @@ -158,7 +156,7 @@ public class EntityCreeper extends EntityMonster { super.a(entityweatherlighting); // CraftBukkit start - if (org.bukkit.craftbukkit.event.CraftEventFactory.callCreeperPowerEvent(this, entityweatherlighting, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) { + if (CraftEventFactory.callCreeperPowerEvent(this, entityweatherlighting, org.bukkit.event.entity.CreeperPowerEvent.PowerCause.LIGHTNING).isCancelled()) { return; } diff --git a/src/main/java/net/minecraft/server/EntityEgg.java b/src/main/java/net/minecraft/server/EntityEgg.java index afa0bf8c..2ef13243 100644 --- a/src/main/java/net/minecraft/server/EntityEgg.java +++ b/src/main/java/net/minecraft/server/EntityEgg.java @@ -1,9 +1,9 @@ package net.minecraft.server; // CraftBukkit start -import org.bukkit.Location; import org.bukkit.entity.Ageable; import org.bukkit.entity.EntityType; +import org.bukkit.entity.Player; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; import org.bukkit.event.player.PlayerEggThrowEvent; // CraftBukkit end @@ -37,7 +37,7 @@ public class EntityEgg extends EntityProjectile { EntityType hatchingType = EntityType.CHICKEN; if (this.shooter instanceof EntityPlayer) { - org.bukkit.entity.Player player = (this.shooter == null) ? null : (org.bukkit.entity.Player) this.shooter.getBukkitEntity(); + Player player = (this.shooter == null) ? null : (Player) this.shooter.getBukkitEntity(); PlayerEggThrowEvent event = new PlayerEggThrowEvent(player, (org.bukkit.entity.Egg) this.getBukkitEntity(), hatching, (byte) numHatching, hatchingType); this.world.getServer().getPluginManager().callEvent(event); @@ -49,7 +49,7 @@ public class EntityEgg extends EntityProjectile { if (hatching) { for (int k = 0; k < numHatching; k++) { - org.bukkit.entity.Entity entity = world.getWorld().spawn(new Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass(), SpawnReason.EGG); + org.bukkit.entity.Entity entity = world.getWorld().spawn(new org.bukkit.Location(world.getWorld(), this.locX, this.locY, this.locZ, this.yaw, 0.0F), hatchingType.getEntityClass(), SpawnReason.EGG); if (entity instanceof Ageable) { ((Ageable) entity).setBaby(); diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java index 9c7c14b2..470c09b8 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -4,9 +4,12 @@ import java.util.Iterator; import java.util.List; // CraftBukkit start -import java.util.ArrayList; - import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.util.BlockStateListPopulator; +import org.bukkit.event.entity.EntityCreatePortalEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; +import org.bukkit.event.entity.EntityExplodeEvent; +import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.Bukkit; // CraftBukkit end @@ -339,7 +342,7 @@ public class EntityEnderDragon extends EntityComplex { this.s = null; } else if (this.ticksLived % 10 == 0 && this.health < this.t) { // CraftBukkit start - org.bukkit.event.entity.EntityRegainHealthEvent event = new org.bukkit.event.entity.EntityRegainHealthEvent(this.getBukkitEntity(), 1, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL); + EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), 1, EntityRegainHealthEvent.RegainReason.ENDER_CRYSTAL); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -398,7 +401,7 @@ public class EntityEnderDragon extends EntityComplex { // CraftBukkit start - throw damage events when the dragon attacks // The EntityHuman case is handled in EntityHuman, so don't throw it here if (!(entity instanceof EntityHuman)) { - org.bukkit.event.entity.EntityDamageByEntityEvent damageEvent = new org.bukkit.event.entity.EntityDamageByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, 10); + EntityDamageByEntityEvent damageEvent = new EntityDamageByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, 10); Bukkit.getPluginManager().callEvent(damageEvent); if (!damageEvent.isCancelled()) { @@ -460,7 +463,7 @@ public class EntityEnderDragon extends EntityComplex { boolean flag1 = false; // CraftBukkit start - create a list to hold all the destroyed blocks - List<org.bukkit.block.Block> destroyedBlocks = new ArrayList<org.bukkit.block.Block>(); + List<org.bukkit.block.Block> destroyedBlocks = new java.util.ArrayList<org.bukkit.block.Block>(); org.bukkit.craftbukkit.CraftWorld craftWorld = this.world.getWorld(); // CraftBukkit end for (int k1 = i; k1 <= l; ++k1) { @@ -486,7 +489,7 @@ public class EntityEnderDragon extends EntityComplex { if (flag1) { // CraftBukkit start - set off an EntityExplodeEvent for the dragon exploding all these blocks org.bukkit.entity.Entity bukkitEntity = this.getBukkitEntity(); - org.bukkit.event.entity.EntityExplodeEvent event = new org.bukkit.event.entity.EntityExplodeEvent(bukkitEntity, bukkitEntity.getLocation(), destroyedBlocks, 0F); + EntityExplodeEvent event = new EntityExplodeEvent(bukkitEntity, bukkitEntity.getLocation(), destroyedBlocks, 0F); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) { // this flag literally means 'Dragon hit something hard' (Obsidian, White Stone or Bedrock) and will cause the dragon to slow down. @@ -575,7 +578,7 @@ public class EntityEnderDragon extends EntityComplex { byte b1 = 4; // CraftBukkit start - Replace any "this.world" in the following with just "world"! - org.bukkit.craftbukkit.util.BlockStateListPopulator world = new org.bukkit.craftbukkit.util.BlockStateListPopulator(this.world.getWorld()); + BlockStateListPopulator world = new BlockStateListPopulator(this.world.getWorld()); for (int k = b0 - 1; k <= b0 + 32; ++k) { for (int l = i - b1; l <= i + b1; ++l) { @@ -611,7 +614,7 @@ public class EntityEnderDragon extends EntityComplex { world.setTypeId(i, b0 + 3, j, Block.BEDROCK.id); world.setTypeId(i, b0 + 4, j, Block.DRAGON_EGG.id); - org.bukkit.event.entity.EntityCreatePortalEvent event = new org.bukkit.event.entity.EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), java.util.Collections.unmodifiableList(world.getList()), org.bukkit.PortalType.ENDER); + EntityCreatePortalEvent event = new EntityCreatePortalEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), java.util.Collections.unmodifiableList(world.getList()), org.bukkit.PortalType.ENDER); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java index 4e66b050..4878da82 100644 --- a/src/main/java/net/minecraft/server/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java @@ -5,7 +5,6 @@ import org.bukkit.Bukkit; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerTeleportEvent; -import org.bukkit.Location; // CraftBukkit end public class EntityEnderPearl extends EntityProjectile { @@ -40,7 +39,7 @@ public class EntityEnderPearl extends EntityProjectile { if (this.shooter instanceof EntityPlayer) { CraftPlayer player = (CraftPlayer) this.shooter.bukkitEntity; teleport = player.isOnline() && player.getWorld() == getBukkitEntity().getWorld(); - Location location = getBukkitEntity().getLocation(); + org.bukkit.Location location = getBukkitEntity().getLocation(); location.setPitch(player.getLocation().getPitch()); location.setYaw(player.getLocation().getYaw()); diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java index 868bc357..ae251da1 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -1,8 +1,6 @@ package net.minecraft.server; // CraftBukkit start -import java.util.List; - import org.bukkit.Location; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.entity.EntityTeleportEvent; @@ -288,7 +286,7 @@ public class EntityEnderman extends EntityMonster { if (j > 0) { // CraftBukkit start - whole method - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int count = this.random.nextInt(2 + i); if ((j > 0) && (count > 0)) { diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java index 2dac019e..3217c2d7 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -1,6 +1,9 @@ package net.minecraft.server; -import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit +// CraftBukkit start +import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.event.entity.EntityTargetEvent; +// CraftBukkit end public class EntityExperienceOrb extends Entity { @@ -57,7 +60,7 @@ public class EntityExperienceOrb extends Entity { if (entityhuman != null) { // CraftBukkit start - org.bukkit.event.entity.EntityTargetEvent event = CraftEventFactory.callEntityTargetEvent(this, entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER); + EntityTargetEvent event = CraftEventFactory.callEntityTargetEvent(this, entityhuman, EntityTargetEvent.TargetReason.CLOSEST_PLAYER); Entity target = event.getTarget() == null ? null : ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle(); if (!event.isCancelled() && target != null) { diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index 92abbdf4..fac4901c 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -3,8 +3,6 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.entity.Explosive; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.ProjectileHitEvent; // CraftBukkit end @@ -198,7 +196,7 @@ public class EntityFireball extends Entity { ; } // CraftBukkit start - ExplosionPrimeEvent event = new ExplosionPrimeEvent((Explosive) CraftEntity.getEntity(this.world.getServer(), this)); + ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(this.world.getServer(), this)); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java index 8e0abf14..109c8dec 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java @@ -2,7 +2,10 @@ package net.minecraft.server; import java.util.List; -import org.bukkit.event.player.PlayerFishEvent; // CraftBukkit +// CraftBukkit start +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerFishEvent; +// CraftBukkit end public class EntityFishingHook extends Entity { @@ -312,7 +315,7 @@ public class EntityFishingHook extends Entity { if (this.hooked != null) { // CraftBukkit start - PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY); + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), this.hooked.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_ENTITY); this.world.getServer().getPluginManager().callEvent(playerFishEvent); if (playerFishEvent.isCancelled()) { @@ -335,7 +338,7 @@ public class EntityFishingHook extends Entity { } else if (this.k > 0) { EntityItem entityitem = new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.RAW_FISH)); // CraftBukkit start - PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), entityitem.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_FISH); + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), entityitem.getBukkitEntity(), PlayerFishEvent.State.CAUGHT_FISH); this.world.getServer().getPluginManager().callEvent(playerFishEvent); if (playerFishEvent.isCancelled()) { @@ -361,7 +364,7 @@ public class EntityFishingHook extends Entity { if (this.h) { // CraftBukkit start - PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.IN_GROUND); + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.IN_GROUND); this.world.getServer().getPluginManager().callEvent(playerFishEvent); if (playerFishEvent.isCancelled()) { @@ -375,7 +378,7 @@ public class EntityFishingHook extends Entity { // CraftBukkit start if (b0 == 0) { - PlayerFishEvent playerFishEvent = new PlayerFishEvent((org.bukkit.entity.Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.FAILED_ATTEMPT); + PlayerFishEvent playerFishEvent = new PlayerFishEvent((Player) this.owner.getBukkitEntity(), null, PlayerFishEvent.State.FAILED_ATTEMPT); this.world.getServer().getPluginManager().callEvent(playerFishEvent); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityGhast.java b/src/main/java/net/minecraft/server/EntityGhast.java index 6f0ff5be..91a82cc2 100644 --- a/src/main/java/net/minecraft/server/EntityGhast.java +++ b/src/main/java/net/minecraft/server/EntityGhast.java @@ -1,9 +1,7 @@ package net.minecraft.server; // CraftBukkit start -import java.util.List; import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit end @@ -200,7 +198,7 @@ public class EntityGhast extends EntityFlying implements IMonster { protected void dropDeathLoot(boolean flag, int i) { // CraftBukkit start - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int j = this.random.nextInt(2) + this.random.nextInt(1 + i); int k; @@ -215,7 +213,7 @@ public class EntityGhast extends EntityFlying implements IMonster { loot.add(new CraftItemStack(Item.SULPHUR.id, j)); } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index c552f000..8ce4aeb0 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -4,9 +4,7 @@ import java.util.Iterator; import java.util.List; // CraftBukkit start -import org.bukkit.Bukkit; import org.bukkit.craftbukkit.entity.CraftItem; -import org.bukkit.craftbukkit.TrigMath; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityCombustByEntityEvent; @@ -319,7 +317,7 @@ public abstract class EntityHuman extends EntityLiving { float f = MathHelper.sqrt(this.motX * this.motX + this.motZ * this.motZ); // CraftBukkit - Math -> TrigMath - float f1 = (float) TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F; + float f1 = (float) org.bukkit.craftbukkit.TrigMath.atan(-this.motY * 0.20000000298023224D) * 15.0F; if (f > 0.1F) { f = 0.1F; @@ -577,10 +575,9 @@ public abstract class EntityHuman extends EntityLiving { i = i * 3 / 2; } } - /* CraftBukkit start - Don't filter out 0 damage - if (i == 0) { + if (false && i == 0) { // CraftBukkit - Don't filter out 0 damage return false; - } else { CraftBukkit end */ + } else { Entity entity1 = entity; if (entity instanceof EntityArrow && ((EntityArrow) entity).shooter != null) { @@ -593,7 +590,7 @@ public abstract class EntityHuman extends EntityLiving { this.a(StatisticList.x, i); return super.damageEntity(damagesource, i); - //} // CraftBukkit + } } } } @@ -800,7 +797,7 @@ public abstract class EntityHuman extends EntityLiving { if (l > 0) { // CraftBukkit start - raise a combust event when somebody hits with a fire enchanted item EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), l * 4); - Bukkit.getPluginManager().callEvent(combustEvent); + org.bukkit.Bukkit.getPluginManager().callEvent(combustEvent); if (!combustEvent.isCancelled()) { entity.setOnFire(combustEvent.getDuration()); diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java index 689f5409..34a87bdf 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -1,9 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.player.PlayerPickupItemEvent; -// CraftBukkit end +import org.bukkit.event.player.PlayerPickupItemEvent; // CraftBukkit public class EntityItem extends Entity { @@ -88,7 +85,7 @@ public class EntityItem extends Entity { ++this.age; if (this.age >= 6000) { // CraftBukkit start - if (CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { + if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; return; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index cf71f171..c55c599b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -7,13 +7,10 @@ import java.util.List; import java.util.Random; // CraftBukkit start -import org.bukkit.craftbukkit.TrigMath; import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityRegainHealthEvent; -import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; // CraftBukkit end public abstract class EntityLiving extends Entity { @@ -460,7 +457,7 @@ public abstract class EntityLiving extends Entity { f3 = 1.0F; f2 = f * 3.0F; // CraftBukkit - Math -> TrigMath - f1 = (float) TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; + f1 = (float) org.bukkit.craftbukkit.TrigMath.atan2(d1, d0) * 180.0F / 3.1415927F - 90.0F; } if (this.ao > 0.0F) { @@ -558,10 +555,10 @@ public abstract class EntityLiving extends Entity { // CraftBukkit start - delegate so we can handle providing a reason for health being regained public void heal(int i) { - heal(i, RegainReason.CUSTOM); + heal(i, EntityRegainHealthEvent.RegainReason.CUSTOM); } - public void heal(int i, RegainReason regainReason) { + public void heal(int i, EntityRegainHealthEvent.RegainReason regainReason) { if (this.health > 0) { EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), i, regainReason); this.world.getServer().getPluginManager().callEvent(event); @@ -607,7 +604,7 @@ public abstract class EntityLiving extends Entity { // CraftBukkit start if (damagesource instanceof EntityDamageSource) { - org.bukkit.event.entity.EntityDamageEvent event = CraftEventFactory.handleEntityDamageEvent(this, damagesource, i); + EntityDamageEvent event = CraftEventFactory.handleEntityDamageEvent(this, damagesource, i); if (event.isCancelled()) { return false; } @@ -781,18 +778,15 @@ public abstract class EntityLiving extends Entity { if (!this.isBaby()) { this.dropDeathLoot(this.lastDamageByPlayerTime > 0, i); - /* CraftBukkit start - move rare item drop call to dropDeathLoot - if (this.lastDamageByPlayerTime > 0) { + if (false && this.lastDamageByPlayerTime > 0) { // CraftBukkit - move rare item drop call to dropDeathLoot int j = this.random.nextInt(200) - i; if (j < 5) { this.b(j <= 0 ? 1 : 0); } } - // */ - } else { - CraftEventFactory.callEntityDeathEvent(this); - // CraftBukkit end + } else { // CraftBukkit + CraftEventFactory.callEntityDeathEvent(this); // CraftBukkit } } @@ -830,7 +824,7 @@ public abstract class EntityLiving extends Entity { if (k < 5) { ItemStack itemstack = this.b(k <= 0 ? 1 : 0); if (itemstack != null) { - loot.add(new CraftItemStack(itemstack)); + loot.add(new org.bukkit.craftbukkit.inventory.CraftItemStack(itemstack)); } } } diff --git a/src/main/java/net/minecraft/server/EntityMagmaCube.java b/src/main/java/net/minecraft/server/EntityMagmaCube.java index 589ac2a1..cbfd6ad1 100644 --- a/src/main/java/net/minecraft/server/EntityMagmaCube.java +++ b/src/main/java/net/minecraft/server/EntityMagmaCube.java @@ -1,8 +1,5 @@ package net.minecraft.server; -import java.util.List; // CraftBukkit -import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit - public class EntityMagmaCube extends EntitySlime { public EntityMagmaCube(World world) { @@ -38,7 +35,7 @@ public class EntityMagmaCube extends EntitySlime { protected void dropDeathLoot(boolean flag, int i) { // CraftBukkit start - whole method - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int j = this.getLootId(); if (j > 0 && this.getSize() > 1) { @@ -53,7 +50,7 @@ public class EntityMagmaCube extends EntitySlime { } } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityMinecart.java b/src/main/java/net/minecraft/server/EntityMinecart.java index 490666b3..2cc6db22 100644 --- a/src/main/java/net/minecraft/server/EntityMinecart.java +++ b/src/main/java/net/minecraft/server/EntityMinecart.java @@ -3,18 +3,12 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import java.util.ArrayList; - import org.bukkit.Location; import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Vehicle; -import org.bukkit.event.vehicle.VehicleCreateEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; import org.bukkit.event.vehicle.VehicleDestroyEvent; -import org.bukkit.event.vehicle.VehicleEnterEvent; import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; -import org.bukkit.event.vehicle.VehicleMoveEvent; -import org.bukkit.event.vehicle.VehicleUpdateEvent; import org.bukkit.util.Vector; import org.bukkit.inventory.InventoryHolder; import org.bukkit.craftbukkit.entity.CraftHumanEntity; @@ -45,7 +39,7 @@ public class EntityMinecart extends Entity implements IInventory { private double flyingY = 0.95; private double flyingZ = 0.95; public double maxSpeed = 0.4D; - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); private int maxStack = MAX_STACK; public ItemStack[] getContents() { @@ -119,7 +113,7 @@ public class EntityMinecart extends Entity implements IInventory { this.lastZ = d2; this.type = i; - this.world.getServer().getPluginManager().callEvent(new VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit + this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleCreateEvent((Vehicle) this.getBukkitEntity())); // CraftBukkit } public double x_() { @@ -598,10 +592,10 @@ public class EntityMinecart extends Entity implements IInventory { Location to = new Location(bworld, this.locX, this.locY, this.locZ, this.yaw, this.pitch); Vehicle vehicle = (Vehicle) this.getBukkitEntity(); - this.world.getServer().getPluginManager().callEvent(new VehicleUpdateEvent(vehicle)); + this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleUpdateEvent(vehicle)); if (!from.equals(to)) { - this.world.getServer().getPluginManager().callEvent(new VehicleMoveEvent(vehicle, from, to)); + this.world.getServer().getPluginManager().callEvent(new org.bukkit.event.vehicle.VehicleMoveEvent(vehicle, from, to)); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java index 83467cfd..21ced48b 100644 --- a/src/main/java/net/minecraft/server/EntityMushroomCow.java +++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java @@ -1,5 +1,7 @@ package net.minecraft.server; +import org.bukkit.event.player.PlayerShearEntityEvent; // CraftBukkit + public class EntityMushroomCow extends EntityCow { public EntityMushroomCow(World world) { @@ -22,10 +24,10 @@ public class EntityMushroomCow extends EntityCow { return true; } } - + if (itemstack != null && itemstack.id == Item.SHEARS.id && this.getAge() >= 0) { // CraftBukkit start - org.bukkit.event.player.PlayerShearEntityEvent event = new org.bukkit.event.player.PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity()); + PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity()); this.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityPainting.java b/src/main/java/net/minecraft/server/EntityPainting.java index 61fbe56a..21eba049 100644 --- a/src/main/java/net/minecraft/server/EntityPainting.java +++ b/src/main/java/net/minecraft/server/EntityPainting.java @@ -5,7 +5,6 @@ import java.util.List; // CraftBukkit start import org.bukkit.entity.Painting; -import org.bukkit.event.painting.PaintingBreakByEntityEvent; import org.bukkit.event.painting.PaintingBreakEvent.RemoveCause; import org.bukkit.event.painting.PaintingBreakEvent; // CraftBukkit end @@ -216,7 +215,7 @@ public class EntityPainting extends Entity { // CraftBukkit start PaintingBreakEvent event = null; if (damagesource.getEntity() != null) { - event = new PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity()); + event = new org.bukkit.event.painting.PaintingBreakByEntityEvent((Painting) this.getBukkitEntity(), damagesource.getEntity() == null ? null : damagesource.getEntity().getBukkitEntity()); } else { if (damagesource == DamageSource.FIRE) { event = new PaintingBreakEvent((Painting) this.getBukkitEntity(), RemoveCause.FIRE); @@ -284,11 +283,9 @@ public class EntityPainting extends Entity { } public void b_(double d0, double d1, double d2) { - /* CraftBukkit start - not needed for paintings - if (!this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { + if (false && !this.world.isStatic && !this.dead && d0 * d0 + d1 * d1 + d2 * d2 > 0.0D) { // CraftBukkit start - not needed for paintings this.die(); this.world.addEntity(new EntityItem(this.world, this.locX, this.locY, this.locZ, new ItemStack(Item.PAINTING))); } - // CraftBukkit end */ } } diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java index 6f50c75d..4a9666e5 100644 --- a/src/main/java/net/minecraft/server/EntityPigZombie.java +++ b/src/main/java/net/minecraft/server/EntityPigZombie.java @@ -3,8 +3,6 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit end @@ -95,7 +93,7 @@ public class EntityPigZombie extends EntityZombie { this.target = null; return; } - entity = ((CraftEntity) event.getTarget()).getHandle(); + entity = ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle(); // CraftBukkit end this.target = entity; @@ -142,7 +140,7 @@ public class EntityPigZombie extends EntityZombie { } } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java index ceab0c1b..8676d9d5 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -6,14 +6,11 @@ import java.util.List; import java.util.Set; // CraftBukkit start -import java.util.EnumSet; import org.bukkit.Bukkit; -import org.bukkit.craftbukkit.ChunkCompressionThread; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.inventory.InventoryType; // CraftBukkit end @@ -88,7 +85,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void spawnIn(World world) { super.spawnIn(world); - // CraftBukkit - world fallback code, either respawn location or global spawn + // CraftBukkit start - world fallback code, either respawn location or global spawn if (world == null) { this.dead = false; ChunkCoordinates position = null; @@ -167,7 +164,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } - PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, damagesource.getLocalizedDeathMessage(this)); + org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, damagesource.getLocalizedDeathMessage(this)); String deathMessage = event.getDeathMessage(); @@ -175,7 +172,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.server.serverConfigurationManager.sendAll(new Packet3Chat(event.getDeathMessage())); } - // CraftBukkit start - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. + // CraftBukkit - we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. for (int i = 0; i < this.inventory.items.length; ++i) { this.inventory.items[i] = null; } @@ -254,7 +251,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { boolean flag1 = false; // CraftBukkit - Add check against Chunk Packets in the ChunkCompressionThread. - if (this.netServerHandler.lowPriorityCount() + ChunkCompressionThread.getPlayerQueueSize(this) < 4) { + if (this.netServerHandler.lowPriorityCount() + org.bukkit.craftbukkit.ChunkCompressionThread.getPlayerQueueSize(this) < 4) { flag1 = true; } @@ -563,7 +560,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.netServerHandler.sendPacket(new Packet104WindowItems(container.windowId, list)); this.netServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getCarried())); // CraftBukkit start - send a Set Slot to update the crafting result slot - if (EnumSet.of(InventoryType.CRAFTING,InventoryType.WORKBENCH).contains(container.getBukkitView().getType())) { + if (java.util.EnumSet.of(InventoryType.CRAFTING,InventoryType.WORKBENCH).contains(container.getBukkitView().getType())) { this.netServerHandler.sendPacket(new Packet103SetSlot(container.windowId, 0, container.getSlot(0).getItem())); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java index d581fa5b..09968061 100644 --- a/src/main/java/net/minecraft/server/EntityPotion.java +++ b/src/main/java/net/minecraft/server/EntityPotion.java @@ -4,13 +4,10 @@ import java.util.Iterator; import java.util.List; // CraftBukkit start -import java.util.Collection; import java.util.HashMap; import org.bukkit.craftbukkit.entity.CraftLivingEntity; -import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.entity.LivingEntity; -import org.bukkit.event.entity.PotionSplashEvent; // CraftBukkit end public class EntityPotion extends EntityProjectile { @@ -77,7 +74,7 @@ public class EntityPotion extends EntityProjectile { } } - PotionSplashEvent event = CraftEventFactory.callPotionSplashEvent(this, affected); + org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected); if (!event.isCancelled()) { for (LivingEntity victim : event.getAffectedEntities()) { if (!(victim instanceof CraftLivingEntity)) { diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java index ea54fe8e..039d599c 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -1,9 +1,8 @@ package net.minecraft.server; import java.util.List; + // CraftBukkit start -import org.bukkit.Bukkit; -import org.bukkit.entity.Projectile; import org.bukkit.event.entity.ProjectileHitEvent; // CraftBukkit end @@ -156,8 +155,8 @@ public abstract class EntityProjectile extends Entity { this.a(movingobjectposition); // CraftBukkit start if (this.dead) { - ProjectileHitEvent hitEvent = new ProjectileHitEvent((Projectile) this.getBukkitEntity()); - Bukkit.getPluginManager().callEvent(hitEvent); + ProjectileHitEvent hitEvent = new ProjectileHitEvent((org.bukkit.entity.Projectile) this.getBukkitEntity()); + org.bukkit.Bukkit.getPluginManager().callEvent(hitEvent); } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntitySheep.java b/src/main/java/net/minecraft/server/EntitySheep.java index ff1bb825..7dba926e 100644 --- a/src/main/java/net/minecraft/server/EntitySheep.java +++ b/src/main/java/net/minecraft/server/EntitySheep.java @@ -3,9 +3,8 @@ package net.minecraft.server; import java.util.Random; // CraftBukkit start -import org.bukkit.Material; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.entity.Sheep; +import org.bukkit.event.entity.SheepRegrowWoolEvent; +import org.bukkit.event.player.PlayerShearEntityEvent; // CraftBukkit end public class EntitySheep extends EntityAnimal { @@ -66,7 +65,7 @@ public class EntitySheep extends EntityAnimal { loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.Material.WOOL, 1, (short) 0, (byte) this.getColor())); } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } @@ -80,7 +79,7 @@ public class EntitySheep extends EntityAnimal { if (itemstack != null && itemstack.id == Item.SHEARS.id && !this.isSheared() && !this.isBaby()) { if (!this.world.isStatic) { // CraftBukkit start - org.bukkit.event.player.PlayerShearEntityEvent event = new org.bukkit.event.player.PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity()); + PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity()); this.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -174,7 +173,7 @@ public class EntitySheep extends EntityAnimal { public void z() { // CraftBukkit start - org.bukkit.event.entity.SheepRegrowWoolEvent event = new org.bukkit.event.entity.SheepRegrowWoolEvent((Sheep) this.getBukkitEntity()); + SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity()); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java index 1a46d8d6..477f75ad 100644 --- a/src/main/java/net/minecraft/server/EntitySkeleton.java +++ b/src/main/java/net/minecraft/server/EntitySkeleton.java @@ -1,9 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -// CraftBukkit end +import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit public class EntitySkeleton extends EntityMonster { @@ -54,7 +51,7 @@ public class EntitySkeleton extends EntityMonster { if (f > 0.5F && this.world.isChunkLoaded(MathHelper.floor(this.locX), MathHelper.floor(this.locY), MathHelper.floor(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { // CraftBukkit start - org.bukkit.event.entity.EntityCombustEvent event = new org.bukkit.event.entity.EntityCombustEvent(this.getBukkitEntity(), 8); + EntityCombustEvent event = new EntityCombustEvent(this.getBukkitEntity(), 8); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -105,12 +102,12 @@ public class EntitySkeleton extends EntityMonster { if (k < 5) { ItemStack itemstack = this.b(k <= 0 ? 1 : 0); if (itemstack != null) { - loot.add(new CraftItemStack(itemstack)); + loot.add(new org.bukkit.craftbukkit.inventory.CraftItemStack(itemstack)); } } } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java index a6e75441..5e2d29aa 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -1,5 +1,7 @@ package net.minecraft.server; +import org.bukkit.event.entity.SlimeSplitEvent; // CraftBukkit + public class EntitySlime extends EntityLiving implements IMonster { public float a; @@ -139,7 +141,7 @@ public class EntitySlime extends EntityLiving implements IMonster { int j = 2 + this.random.nextInt(3); // CraftBukkit start - org.bukkit.event.entity.SlimeSplitEvent event = new org.bukkit.event.entity.SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j); + SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled() && event.getCount() > 0) { diff --git a/src/main/java/net/minecraft/server/EntitySnowman.java b/src/main/java/net/minecraft/server/EntitySnowman.java index 518f2532..3cd0c7d9 100644 --- a/src/main/java/net/minecraft/server/EntitySnowman.java +++ b/src/main/java/net/minecraft/server/EntitySnowman.java @@ -1,9 +1,8 @@ package net.minecraft.server; import java.util.List; + // CraftBukkit start -import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.block.EntityBlockFormEvent; import org.bukkit.event.entity.EntityDamageEvent; // CraftBukkit end @@ -66,7 +65,7 @@ public class EntitySnowman extends EntityGolem { if (this.world.getTypeId(j, k, l) == 0 && this.world.getBiome(j, l).i() < 0.8F && Block.SNOW.canPlace(this.world, j, k, l)) { // CraftBukkit start - BlockState blockState = this.world.getWorld().getBlockAt(j, k, l).getState(); + org.bukkit.block.BlockState blockState = this.world.getWorld().getBlockAt(j, k, l).getState(); blockState.setTypeId(Block.SNOW.id); EntityBlockFormEvent event = new EntityBlockFormEvent(this.getBukkitEntity(), blockState.getBlock(), blockState); @@ -101,7 +100,7 @@ public class EntitySnowman extends EntityGolem { loot.add(new org.bukkit.inventory.ItemStack(Item.SNOW_BALL.id, j)); } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } } diff --git a/src/main/java/net/minecraft/server/EntitySpider.java b/src/main/java/net/minecraft/server/EntitySpider.java index 9ba4a2dd..21b0c6d7 100644 --- a/src/main/java/net/minecraft/server/EntitySpider.java +++ b/src/main/java/net/minecraft/server/EntitySpider.java @@ -1,12 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import java.util.List; - -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.craftbukkit.event.CraftEventFactory; -// CraftBukkit end +import org.bukkit.event.entity.EntityTargetEvent; // CraftBukkit public class EntitySpider extends EntityMonster { @@ -81,7 +75,7 @@ public class EntitySpider extends EntityMonster { if (event.getTarget() == null) { this.target = null; } else { - this.target = ((CraftEntity) event.getTarget()).getHandle(); + this.target = ((org.bukkit.craftbukkit.entity.CraftEntity) event.getTarget()).getHandle(); } return; } @@ -117,7 +111,7 @@ public class EntitySpider extends EntityMonster { protected void dropDeathLoot(boolean flag, int i) { // CraftBukkit start - whole method; adapted from super.dropDeathLoot. - List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); + java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>(); int k = this.random.nextInt(3); @@ -133,7 +127,7 @@ public class EntitySpider extends EntityMonster { loot.add(new org.bukkit.inventory.ItemStack(Item.SPIDER_EYE.id, 1)); } - CraftEventFactory.callEntityDeathEvent(this, loot); // raise event even for those times when the entity does not drop loot + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // raise event even for those times when the entity does not drop loot // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java index 7ef47888..f245e84b 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -1,6 +1,5 @@ package net.minecraft.server; -import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit public class EntitySquid extends EntityWaterAnimal { @@ -67,7 +66,7 @@ public class EntitySquid extends EntityWaterAnimal { loot.add(new org.bukkit.inventory.ItemStack(org.bukkit.Material.INK_SACK, count)); } - CraftEventFactory.callEntityDeathEvent(this, loot); + org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java index cfd5ac18..70e01349 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -1,11 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.entity.Explosive; -import org.bukkit.event.entity.ExplosionPrimeEvent; -// CraftBukkit end +import org.bukkit.event.entity.ExplosionPrimeEvent; // CraftBukkit public class EntityTNTPrimed extends Entity { @@ -78,9 +73,9 @@ public class EntityTNTPrimed extends Entity { // CraftBukkit start // float f = 4.0F; - CraftServer server = this.world.getServer(); + org.bukkit.craftbukkit.CraftServer server = this.world.getServer(); - ExplosionPrimeEvent event = new ExplosionPrimeEvent((Explosive) CraftEntity.getEntity(server, this)); + ExplosionPrimeEvent event = new ExplosionPrimeEvent((org.bukkit.entity.Explosive) org.bukkit.craftbukkit.entity.CraftEntity.getEntity(server, this)); server.getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java index 6f1496e8..72e4a325 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -6,6 +6,11 @@ import java.util.Iterator; import java.util.List; import java.util.Set; +// CraftBukkit start +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerVelocityEvent; +// CraftBukkit end + public class EntityTrackerEntry { public Entity tracker; @@ -168,10 +173,10 @@ public class EntityTrackerEntry { boolean cancelled = false; if (this.tracker instanceof EntityPlayer) { - org.bukkit.entity.Player player = (org.bukkit.entity.Player) this.tracker.getBukkitEntity(); + Player player = (Player) this.tracker.getBukkitEntity(); org.bukkit.util.Vector velocity = player.getVelocity(); - org.bukkit.event.player.PlayerVelocityEvent event = new org.bukkit.event.player.PlayerVelocityEvent(player, velocity); + PlayerVelocityEvent event = new PlayerVelocityEvent(player, velocity); this.tracker.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -225,7 +230,7 @@ public class EntityTrackerEntry { if (!this.trackedPlayers.contains(entityplayer)) { // CraftBukkit start if (tracker instanceof EntityPlayer) { - org.bukkit.entity.Player player = ((EntityPlayer) tracker).getBukkitEntity(); + Player player = ((EntityPlayer) tracker).getBukkitEntity(); if (!entityplayer.getBukkitEntity().canSee(player)) { return; } diff --git a/src/main/java/net/minecraft/server/EntityWeatherLighting.java b/src/main/java/net/minecraft/server/EntityWeatherLighting.java index 3a7f364b..6f04c6ee 100644 --- a/src/main/java/net/minecraft/server/EntityWeatherLighting.java +++ b/src/main/java/net/minecraft/server/EntityWeatherLighting.java @@ -2,11 +2,7 @@ package net.minecraft.server; import java.util.List; -// CraftBukkit start -import org.bukkit.craftbukkit.CraftWorld; -import org.bukkit.event.block.BlockIgniteEvent; -import org.bukkit.event.block.BlockIgniteEvent.IgniteCause; -// CraftBukkit end +import org.bukkit.event.block.BlockIgniteEvent; // CraftBukkit public class EntityWeatherLighting extends EntityWeather { @@ -15,7 +11,7 @@ public class EntityWeatherLighting extends EntityWeather { private int c; // CraftBukkit start - private CraftWorld cworld; + private org.bukkit.craftbukkit.CraftWorld cworld; public boolean isEffect = false; public EntityWeatherLighting(World world, double d0, double d1, double d2) { @@ -45,7 +41,7 @@ public class EntityWeatherLighting extends EntityWeather { if (world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(world, i, j, k)) { // CraftBukkit start - BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), IgniteCause.LIGHTNING, null); + BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), BlockIgniteEvent.IgniteCause.LIGHTNING, null); world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -61,7 +57,7 @@ public class EntityWeatherLighting extends EntityWeather { if (world.getTypeId(j, k, l) == 0 && Block.FIRE.canPlace(world, j, k, l)) { // CraftBukkit start - BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(j, k, l), IgniteCause.LIGHTNING, null); + BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(j, k, l), BlockIgniteEvent.IgniteCause.LIGHTNING, null); world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { @@ -96,7 +92,7 @@ public class EntityWeatherLighting extends EntityWeather { if (this.world.getTypeId(i, j, k) == 0 && Block.FIRE.canPlace(this.world, i, j, k)) { // CraftBukkit start - BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), IgniteCause.LIGHTNING, null); + BlockIgniteEvent event = new BlockIgniteEvent(this.cworld.getBlockAt(i, j, k), BlockIgniteEvent.IgniteCause.LIGHTNING, null); this.world.getServer().getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java index 3fc462bb..63b82408 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java @@ -8,7 +8,6 @@ import java.util.Set; // CraftBukkit start import org.bukkit.Bukkit; -import org.bukkit.entity.TNTPrimed; import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; @@ -108,7 +107,7 @@ public class Explosion { for (int k2 = 0; k2 < list.size(); ++k2) { Entity entity = (Entity) list.get(k2); - // CraftBukkit - start + // CraftBukkit start d0 = entity.locX - this.posX; d1 = entity.locY - this.posY; d2 = entity.locZ - this.posZ; @@ -127,7 +126,7 @@ public class Explosion { d1 = 0d; d2 = 0d; } - // CraftBukkit - end + // CraftBukkit end double d9 = (double) this.world.a(vec3d, entity.boundingBox); double d10 = (1.0D - d7) * d9; @@ -151,7 +150,7 @@ public class Explosion { } else { final org.bukkit.entity.Entity damager = this.source.getBukkitEntity(); final EntityDamageEvent.DamageCause damageCause; - if (damager instanceof TNTPrimed) { + if (damager instanceof org.bukkit.entity.TNTPrimed) { damageCause = EntityDamageEvent.DamageCause.BLOCK_EXPLOSION; } else { damageCause = EntityDamageEvent.DamageCause.ENTITY_EXPLOSION; diff --git a/src/main/java/net/minecraft/server/IDataManager.java b/src/main/java/net/minecraft/server/IDataManager.java index 87c7b03c..afdb4dd3 100644 --- a/src/main/java/net/minecraft/server/IDataManager.java +++ b/src/main/java/net/minecraft/server/IDataManager.java @@ -2,7 +2,6 @@ package net.minecraft.server; import java.io.File; import java.util.List; -import java.util.UUID; // CraftBukkit public interface IDataManager { @@ -22,5 +21,5 @@ public interface IDataManager { File getDataFile(String s); - UUID getUUID(); // CraftBukkit + java.util.UUID getUUID(); // CraftBukkit } diff --git a/src/main/java/net/minecraft/server/IInventory.java b/src/main/java/net/minecraft/server/IInventory.java index a8b87d8c..0e9ad1b5 100644 --- a/src/main/java/net/minecraft/server/IInventory.java +++ b/src/main/java/net/minecraft/server/IInventory.java @@ -1,12 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import java.util.List; - -import org.bukkit.craftbukkit.entity.CraftHumanEntity; -import org.bukkit.entity.HumanEntity; -import org.bukkit.inventory.InventoryHolder; -// CraftBukkit end +import org.bukkit.craftbukkit.entity.CraftHumanEntity; // CraftBukkit public interface IInventory { @@ -39,12 +33,12 @@ public interface IInventory { void onClose(CraftHumanEntity who); - List<HumanEntity> getViewers(); + java.util.List<org.bukkit.entity.HumanEntity> getViewers(); - InventoryHolder getOwner(); + org.bukkit.inventory.InventoryHolder getOwner(); void setMaxStackSize(int size); int MAX_STACK = 64; - //CraftBukkit end + // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/InventoryCraftResult.java b/src/main/java/net/minecraft/server/InventoryCraftResult.java index 18b6791e..90ddeddd 100644 --- a/src/main/java/net/minecraft/server/InventoryCraftResult.java +++ b/src/main/java/net/minecraft/server/InventoryCraftResult.java @@ -1,12 +1,8 @@ package net.minecraft.server; // CraftBukkit start -import java.util.ArrayList; -import java.util.List; - import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; -import org.bukkit.inventory.InventoryHolder; // CraftBukkit end public class InventoryCraftResult implements IInventory { @@ -19,15 +15,15 @@ public class InventoryCraftResult implements IInventory { public ItemStack[] getContents() { return this.items; } - public InventoryHolder getOwner() { + public org.bukkit.inventory.InventoryHolder getOwner() { return null; // Result slots don't get an owner } // Don't need a transaction; the InventoryCrafting keeps track of it for us public void onOpen(CraftHumanEntity who) {} public void onClose(CraftHumanEntity who) {} - public List<HumanEntity> getViewers() { - return new ArrayList<HumanEntity>(); + public java.util.List<HumanEntity> getViewers() { + return new java.util.ArrayList<HumanEntity>(); } public void setMaxStackSize(int size) { diff --git a/src/main/java/net/minecraft/server/InventoryCrafting.java b/src/main/java/net/minecraft/server/InventoryCrafting.java index 857ad0e7..be99de8d 100644 --- a/src/main/java/net/minecraft/server/InventoryCrafting.java +++ b/src/main/java/net/minecraft/server/InventoryCrafting.java @@ -1,13 +1,11 @@ package net.minecraft.server; // CraftBukkit start -import java.util.ArrayList; import java.util.List; import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; import org.bukkit.event.inventory.InventoryType; -import org.bukkit.inventory.InventoryHolder; // CraftBukkit end public class InventoryCrafting implements IInventory { @@ -17,7 +15,7 @@ public class InventoryCrafting implements IInventory { private Container c; // CraftBukkit start - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); public CraftingRecipe currentRecipe; public IInventory resultInventory; private EntityHuman owner; @@ -43,7 +41,7 @@ public class InventoryCrafting implements IInventory { return transaction; } - public InventoryHolder getOwner() { + public org.bukkit.inventory.InventoryHolder getOwner() { return owner.getBukkitEntity(); } diff --git a/src/main/java/net/minecraft/server/InventoryLargeChest.java b/src/main/java/net/minecraft/server/InventoryLargeChest.java index 0f23a2f8..41391c4a 100644 --- a/src/main/java/net/minecraft/server/InventoryLargeChest.java +++ b/src/main/java/net/minecraft/server/InventoryLargeChest.java @@ -1,12 +1,10 @@ package net.minecraft.server; // CraftBukkit start -import java.util.ArrayList; import java.util.List; import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; -import org.bukkit.inventory.InventoryHolder; // CraftBukkit end public class InventoryLargeChest implements IInventory { @@ -16,7 +14,7 @@ public class InventoryLargeChest implements IInventory { public IInventory right; // CraftBukkit - private -> public // CraftBukkit start - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); public ItemStack[] getContents() { ItemStack[] result = new ItemStack[this.getSize()]; @@ -42,7 +40,7 @@ public class InventoryLargeChest implements IInventory { return transaction; } - public InventoryHolder getOwner() { + public org.bukkit.inventory.InventoryHolder getOwner() { return null; // This method won't be called since CraftInventoryDoubleChest doesn't defer to here } diff --git a/src/main/java/net/minecraft/server/ItemBed.java b/src/main/java/net/minecraft/server/ItemBed.java index 61d49e75..0fcbd676 100644 --- a/src/main/java/net/minecraft/server/ItemBed.java +++ b/src/main/java/net/minecraft/server/ItemBed.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemBed extends Item { @@ -47,7 +43,7 @@ public class ItemBed extends Item { world.setTypeIdAndData(i, j, k, blockbed.id, i1); // CraftBukkit start - bed - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); if (event.isCancelled() || !event.canBuild()) { event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java index d27a788d..5545c011 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemBlock extends Item { @@ -68,7 +64,7 @@ public class ItemBlock extends Item { world.suppressPhysics = true; world.setTypeIdAndData(i, j, k, id, this.filterData(itemstack.getData())); - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ); id = world.getTypeId(i, j, k); int data = world.getData(i, j, k); replacedBlockState.update(true); diff --git a/src/main/java/net/minecraft/server/ItemBoat.java b/src/main/java/net/minecraft/server/ItemBoat.java index 77767ce4..776167ac 100644 --- a/src/main/java/net/minecraft/server/ItemBoat.java +++ b/src/main/java/net/minecraft/server/ItemBoat.java @@ -2,12 +2,6 @@ package net.minecraft.server; import java.util.List; -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -// CraftBukkit end - public class ItemBoat extends Item { public ItemBoat(int i) { @@ -64,7 +58,7 @@ public class ItemBoat extends Item { if (!world.isStatic) { // CraftBukkit start - Boat placement - PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(entityhuman, Action.RIGHT_CLICK_BLOCK, j, k, l, movingobjectposition.face, itemstack); + org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, j, k, l, movingobjectposition.face, itemstack); if (event.isCancelled()) { return itemstack; diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java index 0b3fe3a4..fa664ffc 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java @@ -1,9 +1,5 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.entity.EntityShootBowEvent; -// CraftBukkit end public class ItemBow extends Item { @@ -52,7 +48,7 @@ public class ItemBow extends Item { } // CraftBukkit start - EntityShootBowEvent event = CraftEventFactory.callEntityShootBowEvent(entityhuman, itemstack, entityarrow, f); + org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(entityhuman, itemstack, entityarrow, f); if (event.isCancelled()) { event.getProjectile().remove(); return; diff --git a/src/main/java/net/minecraft/server/ItemBucket.java b/src/main/java/net/minecraft/server/ItemBucket.java index 3227a0a4..2de28f5a 100644 --- a/src/main/java/net/minecraft/server/ItemBucket.java +++ b/src/main/java/net/minecraft/server/ItemBucket.java @@ -1,7 +1,6 @@ package net.minecraft.server; // CraftBukkit start -import org.bukkit.Location; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.event.player.PlayerBucketEmptyEvent; @@ -147,7 +146,7 @@ public class ItemBucket extends Item { } } else if (this.a == 0 && movingobjectposition.entity instanceof EntityCow) { // CraftBukkit start - This codepath seems to be *NEVER* called - Location loc = movingobjectposition.entity.getBukkitEntity().getLocation(); + org.bukkit.Location loc = movingobjectposition.entity.getBukkitEntity().getLocation(); PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent(entityhuman, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), -1, itemstack, Item.MILK_BUCKET); if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/ItemDoor.java b/src/main/java/net/minecraft/server/ItemDoor.java index 52362923..050388e5 100644 --- a/src/main/java/net/minecraft/server/ItemDoor.java +++ b/src/main/java/net/minecraft/server/ItemDoor.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemDoor extends Item { @@ -93,7 +89,7 @@ public class ItemDoor extends Item { world.setTypeIdAndData(i, j, k, block.id, l); // CraftBukkit start if (entityhuman != null) { - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k); if (event.isCancelled() || !event.canBuild()) { event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); diff --git a/src/main/java/net/minecraft/server/ItemDye.java b/src/main/java/net/minecraft/server/ItemDye.java index 952e4ba6..59a787ce 100644 --- a/src/main/java/net/minecraft/server/ItemDye.java +++ b/src/main/java/net/minecraft/server/ItemDye.java @@ -1,7 +1,9 @@ package net.minecraft.server; -import org.bukkit.entity.Player; // CraftBukkit -import org.bukkit.entity.Sheep; +// CraftBukkit start +import org.bukkit.entity.Player; +import org.bukkit.event.entity.SheepDyeWoolEvent; +// CraftBukkit end public class ItemDye extends Item { @@ -116,7 +118,7 @@ public class ItemDye extends Item { if (!entitysheep.isSheared() && entitysheep.getColor() != i) { // CraftBukkit start byte bColor = new Integer(i).byteValue(); - org.bukkit.event.entity.SheepDyeWoolEvent event = new org.bukkit.event.entity.SheepDyeWoolEvent((Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByData(bColor)); + SheepDyeWoolEvent event = new SheepDyeWoolEvent((org.bukkit.entity.Sheep) entitysheep.getBukkitEntity(), org.bukkit.DyeColor.getByData(bColor)); entitysheep.world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/ItemFlintAndSteel.java b/src/main/java/net/minecraft/server/ItemFlintAndSteel.java index 1451c27c..13e80416 100644 --- a/src/main/java/net/minecraft/server/ItemFlintAndSteel.java +++ b/src/main/java/net/minecraft/server/ItemFlintAndSteel.java @@ -2,10 +2,8 @@ package net.minecraft.server; // CraftBukkit start import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.entity.Player; import org.bukkit.event.block.BlockIgniteEvent; -import org.bukkit.event.block.BlockPlaceEvent; // CraftBukkit end public class ItemFlintAndSteel extends Item { @@ -68,7 +66,7 @@ public class ItemFlintAndSteel extends Item { world.setTypeId(i, j, k, Block.FIRE.id); // CraftBukkit start - BlockPlaceEvent placeEvent = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); + org.bukkit.event.block.BlockPlaceEvent placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); if (placeEvent.isCancelled() || !placeEvent.canBuild()) { placeEvent.getBlockPlaced().setTypeIdAndData(0, (byte) 0, false); diff --git a/src/main/java/net/minecraft/server/ItemHoe.java b/src/main/java/net/minecraft/server/ItemHoe.java index 3820088f..839911d9 100644 --- a/src/main/java/net/minecraft/server/ItemHoe.java +++ b/src/main/java/net/minecraft/server/ItemHoe.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemHoe extends Item { @@ -35,7 +31,7 @@ public class ItemHoe extends Item { world.setTypeId(i, j, k, block.id); // CraftBukkit start - Hoes - blockface -1 for 'SELF' - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k); if (event.isCancelled() || !event.canBuild()) { event.getBlockPlaced().setTypeId(blockState.getTypeId()); diff --git a/src/main/java/net/minecraft/server/ItemInWorldManager.java b/src/main/java/net/minecraft/server/ItemInWorldManager.java index fd4aae58..bd41a1f3 100644 --- a/src/main/java/net/minecraft/server/ItemInWorldManager.java +++ b/src/main/java/net/minecraft/server/ItemInWorldManager.java @@ -2,7 +2,6 @@ package net.minecraft.server; // CraftBukkit start import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockDamageEvent; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.event.Event; import org.bukkit.event.block.Action; @@ -138,7 +137,7 @@ public class ItemInWorldManager { } return; } - BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, i, j, k, this.player.inventory.getItemInHand(), toolDamage >= 1.0f); + org.bukkit.event.block.BlockDamageEvent blockEvent = CraftEventFactory.callBlockDamageEvent(this.player, i, j, k, this.player.inventory.getItemInHand(), toolDamage >= 1.0f); if (blockEvent.isCancelled()) { // Let the client know the block still exists @@ -277,7 +276,7 @@ public class ItemInWorldManager { } } - // TODO: Review this code, it changed in 1.8 but I'm not sure if we need to update or not + // CraftBukkit - TODO: Review this code, it changed in 1.8 but I'm not sure if we need to update or not public boolean interact(EntityHuman entityhuman, World world, ItemStack itemstack, int i, int j, int k, int l) { int i1 = world.getTypeId(i, j, k); diff --git a/src/main/java/net/minecraft/server/ItemMinecart.java b/src/main/java/net/minecraft/server/ItemMinecart.java index f339f112..2a86b00d 100644 --- a/src/main/java/net/minecraft/server/ItemMinecart.java +++ b/src/main/java/net/minecraft/server/ItemMinecart.java @@ -1,11 +1,5 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.Action; -import org.bukkit.event.player.PlayerInteractEvent; -// CraftBukkit end - public class ItemMinecart extends Item { public int a; @@ -22,7 +16,7 @@ public class ItemMinecart extends Item { if (BlockMinecartTrack.d(i1)) { if (!world.isStatic) { // CraftBukkit start - Minecarts - PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(entityhuman, Action.RIGHT_CLICK_BLOCK, i, j, k, l, itemstack); + org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(entityhuman, org.bukkit.event.block.Action.RIGHT_CLICK_BLOCK, i, j, k, l, itemstack); if (event.isCancelled()) { return false; diff --git a/src/main/java/net/minecraft/server/ItemPainting.java b/src/main/java/net/minecraft/server/ItemPainting.java index 526a1a7e..085286cf 100644 --- a/src/main/java/net/minecraft/server/ItemPainting.java +++ b/src/main/java/net/minecraft/server/ItemPainting.java @@ -3,7 +3,6 @@ package net.minecraft.server; // CraftBukkit start import org.bukkit.entity.Player; import org.bukkit.event.painting.PaintingPlaceEvent; -import org.bukkit.craftbukkit.block.CraftBlock; // CraftBukkit end public class ItemPainting extends Item { @@ -43,7 +42,7 @@ public class ItemPainting extends Item { Player who = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity(); org.bukkit.block.Block blockClicked = world.getWorld().getBlockAt(i, j, k); - org.bukkit.block.BlockFace blockFace = CraftBlock.notchToBlockFace(l); + org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(l); PaintingPlaceEvent event = new PaintingPlaceEvent((org.bukkit.entity.Painting) entitypainting.getBukkitEntity(), who, blockClicked, blockFace); world.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/ItemRedstone.java b/src/main/java/net/minecraft/server/ItemRedstone.java index b9705038..38f205da 100644 --- a/src/main/java/net/minecraft/server/ItemRedstone.java +++ b/src/main/java/net/minecraft/server/ItemRedstone.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemRedstone extends Item { @@ -55,7 +51,7 @@ public class ItemRedstone extends Item { world.suppressPhysics = true; world.setRawTypeId(i, j, k, Block.REDSTONE_WIRE.id); // We update after the event - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); blockState.update(true); world.suppressPhysics = false; diff --git a/src/main/java/net/minecraft/server/ItemReed.java b/src/main/java/net/minecraft/server/ItemReed.java index 3aeaf4b6..b272261f 100644 --- a/src/main/java/net/minecraft/server/ItemReed.java +++ b/src/main/java/net/minecraft/server/ItemReed.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemReed extends Item { @@ -68,7 +64,7 @@ public class ItemReed extends Item { * replace this with. */ if (world.setRawTypeId(i, j, k, this.id)) { // <-- world.e does this to place the block - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, replacedBlockState, clickedX, clickedY, clickedZ); if (event.isCancelled() || !event.canBuild()) { // CraftBukkit - undo; this only has reed, repeater and pie blocks diff --git a/src/main/java/net/minecraft/server/ItemSeeds.java b/src/main/java/net/minecraft/server/ItemSeeds.java index 51ecb6c2..ca023859 100644 --- a/src/main/java/net/minecraft/server/ItemSeeds.java +++ b/src/main/java/net/minecraft/server/ItemSeeds.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemSeeds extends Item { @@ -29,7 +25,7 @@ public class ItemSeeds extends Item { world.setTypeId(i, j + 1, k, this.id); // CraftBukkit start - seeds - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k); if (event.isCancelled() || !event.canBuild()) { event.getBlockPlaced().setTypeId(0); diff --git a/src/main/java/net/minecraft/server/ItemSign.java b/src/main/java/net/minecraft/server/ItemSign.java index f36a625f..5a63dc27 100644 --- a/src/main/java/net/minecraft/server/ItemSign.java +++ b/src/main/java/net/minecraft/server/ItemSign.java @@ -1,10 +1,6 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.block.BlockPlaceEvent; -// CraftBukkit end +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit public class ItemSign extends Item { @@ -57,7 +53,7 @@ public class ItemSign extends Item { } // CraftBukkit start - sign - BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, clickedX, clickedY, clickedZ); if (event.isCancelled() || !event.canBuild()) { event.getBlockPlaced().setTypeIdAndData(blockState.getTypeId(), blockState.getRawData(), false); diff --git a/src/main/java/net/minecraft/server/ItemStep.java b/src/main/java/net/minecraft/server/ItemStep.java index f83498a4..b1bf231c 100644 --- a/src/main/java/net/minecraft/server/ItemStep.java +++ b/src/main/java/net/minecraft/server/ItemStep.java @@ -34,16 +34,7 @@ public class ItemStep extends ItemBlock { boolean flag = (j1 & 8) != 0; if ((l == 1 && !flag || l == 0 && flag) && i1 == Block.STEP.id && k1 == itemstack.getData()) { - /* CraftBukkit start - handle this in super - if (world.containsEntity(Block.DOUBLE_STEP.e(world, i, j, k)) && world.setTypeIdAndData(i, j, k, Block.DOUBLE_STEP.id, k1)) { - world.makeSound((double) ((float) i + 0.5F), (double) ((float) j + 0.5F), (double) ((float) k + 0.5F), Block.DOUBLE_STEP.stepSound.getName(), (Block.DOUBLE_STEP.stepSound.getVolume1() + 1.0F) / 2.0F, Block.DOUBLE_STEP.stepSound.getVolume2() * 0.8F); - --itemstack.count; - } - - return true; - */ - return super.interactWith(itemstack, entityhuman, world, i, j, k, -1); - // CraftBukkit end + return super.interactWith(itemstack, entityhuman, world, i, j, k, -1); // CraftBukkit - handle this in super } else { return b(itemstack, entityhuman, world, i, j, k, l) ? true : super.interactWith(itemstack, entityhuman, world, i, j, k, l); } diff --git a/src/main/java/net/minecraft/server/ItemWaterLily.java b/src/main/java/net/minecraft/server/ItemWaterLily.java index 0665f650..05910a54 100644 --- a/src/main/java/net/minecraft/server/ItemWaterLily.java +++ b/src/main/java/net/minecraft/server/ItemWaterLily.java @@ -1,57 +1,53 @@ -package net.minecraft.server;
-
-// CraftBukkit start
-import org.bukkit.craftbukkit.block.CraftBlockState;
-import org.bukkit.craftbukkit.event.CraftEventFactory;
-import org.bukkit.event.block.BlockPlaceEvent;
-// CraftBukkit end
-
-public class ItemWaterLily extends ItemColoredBlock {
-
- public ItemWaterLily(int i) {
- super(i, false);
- }
-
- public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) {
- MovingObjectPosition movingobjectposition = this.a(world, entityhuman, true);
-
- if (movingobjectposition == null) {
- return itemstack;
- } else {
- if (movingobjectposition.type == EnumMovingObjectType.TILE) {
- int i = movingobjectposition.b;
- int j = movingobjectposition.c;
- int k = movingobjectposition.d;
-
- if (!world.a(entityhuman, i, j, k)) {
- return itemstack;
- }
-
- if (!entityhuman.d(i, j, k)) {
- return itemstack;
- }
-
- if (world.getMaterial(i, j, k) == Material.WATER && world.getData(i, j, k) == 0 && world.isEmpty(i, j + 1, k)) {
- CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j + 1, k); // CraftBukkit
-
- world.setTypeId(i, j + 1, k, Block.WATER_LILY.id);
-
- // CraftBukkit start - waterlily
- BlockPlaceEvent event = CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k);
-
- if (event.isCancelled() || !event.canBuild()) {
- event.getBlockPlaced().setTypeId(0);
- return itemstack;
- }
- // CraftBukkit end
-
- if (!entityhuman.abilities.canInstantlyBuild) {
- --itemstack.count;
- }
- }
- }
-
- return itemstack;
- }
- }
-}
+package net.minecraft.server; + +import org.bukkit.craftbukkit.block.CraftBlockState; // CraftBukkit + +public class ItemWaterLily extends ItemColoredBlock { + + public ItemWaterLily(int i) { + super(i, false); + } + + public ItemStack a(ItemStack itemstack, World world, EntityHuman entityhuman) { + MovingObjectPosition movingobjectposition = this.a(world, entityhuman, true); + + if (movingobjectposition == null) { + return itemstack; + } else { + if (movingobjectposition.type == EnumMovingObjectType.TILE) { + int i = movingobjectposition.b; + int j = movingobjectposition.c; + int k = movingobjectposition.d; + + if (!world.a(entityhuman, i, j, k)) { + return itemstack; + } + + if (!entityhuman.d(i, j, k)) { + return itemstack; + } + + if (world.getMaterial(i, j, k) == Material.WATER && world.getData(i, j, k) == 0 && world.isEmpty(i, j + 1, k)) { + CraftBlockState blockState = CraftBlockState.getBlockState(world, i, j + 1, k); // CraftBukkit + + world.setTypeId(i, j + 1, k, Block.WATER_LILY.id); + + // CraftBukkit start - waterlily + org.bukkit.event.block.BlockPlaceEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(world, entityhuman, blockState, i, j, k); + + if (event.isCancelled() || !event.canBuild()) { + event.getBlockPlaced().setTypeId(0); + return itemstack; + } + // CraftBukkit end + + if (!entityhuman.abilities.canInstantlyBuild) { + --itemstack.count; + } + } + } + + return itemstack; + } + } +} diff --git a/src/main/java/net/minecraft/server/MinecartTrackLogic.java b/src/main/java/net/minecraft/server/MinecartTrackLogic.java index aa5d8a70..9a41ce11 100644 --- a/src/main/java/net/minecraft/server/MinecartTrackLogic.java +++ b/src/main/java/net/minecraft/server/MinecartTrackLogic.java @@ -3,6 +3,7 @@ package net.minecraft.server; import java.util.ArrayList; import java.util.List; +// CraftBukkit - We import this because the compiler hates package-private methods in an external jar class MinecartTrackLogic { private World b; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index e6c7ec13..c58551ee 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1,5 +1,6 @@ package net.minecraft.server; +// import java.awt.GraphicsEnvironment; // CraftBukkit import java.io.File; import java.io.IOException; import java.net.InetAddress; @@ -14,25 +15,14 @@ import java.util.logging.Logger; // CraftBukkit start import java.io.PrintStream; -import java.net.UnknownHostException; import jline.console.ConsoleReader; import joptsimple.OptionSet; + import org.bukkit.World.Environment; -import org.bukkit.command.ConsoleCommandSender; -import org.bukkit.command.RemoteConsoleCommandSender; -import org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender; -import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.LoggerOutputStream; -import org.bukkit.craftbukkit.scheduler.CraftScheduler; -import org.bukkit.craftbukkit.util.ServerShutdownThread; import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.event.server.RemoteServerCommandEvent; -import org.bukkit.event.world.WorldInitEvent; -import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.event.world.WorldSaveEvent; -import org.bukkit.generator.ChunkGenerator; -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.PluginLoadOrder; // CraftBukkit end public class MinecraftServer implements Runnable, ICommandListener, IMinecraftServer { @@ -76,10 +66,10 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe // CraftBukkit start public List<WorldServer> worlds = new ArrayList<WorldServer>(); - public CraftServer server; + public org.bukkit.craftbukkit.CraftServer server; public OptionSet options; - public ConsoleCommandSender console; - public RemoteConsoleCommandSender remoteConsole; + public org.bukkit.command.ConsoleCommandSender console; + public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public ConsoleReader reader; public static int currentTick; public final Thread primaryThread; @@ -105,13 +95,13 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe Logger.getLogger(MinecraftServer.class.getName()).log(Level.SEVERE, null, ex); } } - Runtime.getRuntime().addShutdownHook(new ServerShutdownThread(this)); + Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); primaryThread = new ThreadServerApplication("Server thread", this); // Moved from main // CraftBukkit end } - private boolean init() throws UnknownHostException { // CraftBukkit - added throws UnknownHostException + private boolean init() throws java.net.UnknownHostException { // CraftBukkit - added throws UnknownHostException this.consoleCommandHandler = new ConsoleCommandHandler(this); ThreadCommandReader threadcommandreader = new ThreadCommandReader(this); @@ -211,7 +201,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe log.info("Starting remote control listener"); this.J = new RemoteControlListener(this); this.J.a(); - this.remoteConsole = new CraftRemoteConsoleCommandSender(); + this.remoteConsole = new org.bukkit.craftbukkit.command.CraftRemoteConsoleCommandSender(); // CraftBukkit } // CraftBukkit start @@ -265,7 +255,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe String worldType = Environment.getEnvironment(dimension).toString().toLowerCase(); String name = (dimension == 0) ? s : s + "_" + worldType; - ChunkGenerator gen = this.server.getGenerator(name); + org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name); WorldSettings settings = new WorldSettings(i, j, generateStructures, false, worldtype); if (k == 0) { @@ -311,7 +301,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe world.getWorld().getPopulators().addAll(gen.getDefaultPopulators(world.getWorld())); } - this.server.getPluginManager().callEvent(new WorldInitEvent(world.getWorld())); + this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldInitEvent(world.getWorld())); world.tracker = new EntityTracker(this, world); // CraftBukkit world.addIWorldAccess(new WorldManager(this, world)); @@ -363,7 +353,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe // CraftBukkit start for (World world : this.worlds) { - this.server.getPluginManager().callEvent(new WorldLoadEvent(world.getWorld())); + this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(world.getWorld())); } // CraftBukkit end @@ -380,7 +370,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe this.k = null; this.l = 0; - this.server.enablePlugins(PluginLoadOrder.POSTWORLD); // CraftBukkit + this.server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.POSTWORLD); // CraftBukkit } void saveChunks() { // CraftBukkit - private -> default @@ -532,7 +522,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe // CraftBukkit start - only send timeupdates to the people in that world - ((CraftScheduler) this.server.getScheduler()).mainThreadHeartbeat(this.ticks); + ((org.bukkit.craftbukkit.scheduler.CraftScheduler) this.server.getScheduler()).mainThreadHeartbeat(this.ticks); // Send timeupdates to everyone, it will get the right time from the world the player is in. if (this.ticks % 20 == 0) { @@ -722,7 +712,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe public String getPlugins() { // CraftBukkit start - whole method StringBuilder result = new StringBuilder(); - Plugin[] plugins = server.getPluginManager().getPlugins(); + org.bukkit.plugin.Plugin[] plugins = server.getPluginManager().getPlugins(); result.append(server.getName()); result.append(" on Bukkit "); diff --git a/src/main/java/net/minecraft/server/MobEffectList.java b/src/main/java/net/minecraft/server/MobEffectList.java index 78945bbc..5907ebe7 100644 --- a/src/main/java/net/minecraft/server/MobEffectList.java +++ b/src/main/java/net/minecraft/server/MobEffectList.java @@ -2,11 +2,8 @@ package net.minecraft.server; // CraftBukkit start import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.craftbukkit.potion.CraftPotionEffectType; import org.bukkit.event.entity.EntityDamageEvent; -import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; -import org.bukkit.potion.PotionEffectType; // CraftBukkit end public class MobEffectList { @@ -64,7 +61,7 @@ public class MobEffectList { this.N = j; - PotionEffectType.registerPotionEffectType(new CraftPotionEffectType(this)); // CraftBukkit + org.bukkit.potion.PotionEffectType.registerPotionEffectType(new org.bukkit.craftbukkit.potion.CraftPotionEffectType(this)); // CraftBukkit } protected MobEffectList a(int i, int j) { @@ -84,7 +81,7 @@ public class MobEffectList { } else if (this.id == POISON.id) { if (entityliving.getHealth() > 1) { // CraftBukkit start - EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, DamageCause.POISON, 1); + EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, EntityDamageEvent.DamageCause.POISON, 1); if (!event.isCancelled() && event.getDamage() > 0) { entityliving.damageEntity(DamageSource.MAGIC, event.getDamage()); @@ -96,7 +93,7 @@ public class MobEffectList { } else if ((this.id != HEAL.id || entityliving.aN()) && (this.id != HARM.id || !entityliving.aN())) { if (this.id == HARM.id && !entityliving.aN() || this.id == HEAL.id && entityliving.aN()) { // CraftBukkit start - EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, DamageCause.MAGIC, 6 << i); + EntityDamageEvent event = CraftEventFactory.callEntityDamageEvent(null, entityliving, EntityDamageEvent.DamageCause.MAGIC, 6 << i); if (!event.isCancelled() && event.getDamage() > 0) { entityliving.damageEntity(DamageSource.MAGIC, event.getDamage()); diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java index 6a82cfca..834d2724 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -2,13 +2,10 @@ package net.minecraft.server; import java.io.DataInput; import java.io.DataOutput; -import java.io.IOException; // CraftBukkit import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.logging.Level; // CraftBukkit -import java.util.logging.Logger; // CraftBukkit public class NBTTagCompound extends NBTBase { @@ -34,8 +31,8 @@ public class NBTTagCompound extends NBTBase { // CraftBukkit start try { dataoutput.writeByte(0); - } catch (IOException ex) { - Logger.getLogger(NBTTagCompound.class.getName()).log(Level.SEVERE, null, ex); + } catch (java.io.IOException ex) { + java.util.logging.Logger.getLogger(NBTTagCompound.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } } diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java index aa0ac400..436f7de4 100644 --- a/src/main/java/net/minecraft/server/NetLoginHandler.java +++ b/src/main/java/net/minecraft/server/NetLoginHandler.java @@ -5,12 +5,6 @@ import java.util.Iterator; import java.util.Random; import java.util.logging.Logger; -// CraftBukkit start -import org.bukkit.ChatColor; -import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.event.server.ServerListPingEvent; -// CraftBukkit end - public class NetLoginHandler extends NetHandler { public static Logger logger = Logger.getLogger("Minecraft"); @@ -86,7 +80,7 @@ public class NetLoginHandler extends NetHandler { } else { if (!this.server.onlineMode) { // CraftBukkit start - disallow colour in names - if (!packet1login.name.equals(ChatColor.stripColor(packet1login.name))) { + if (!packet1login.name.equals(org.bukkit.ChatColor.stripColor(packet1login.name))) { this.disconnect("Colourful names are not permitted!"); return; } @@ -153,7 +147,7 @@ public class NetLoginHandler extends NetHandler { if (this.networkManager.getSocket() == null) return; // CraftBukkit - fix NPE when a client queries a server that is unable to handle it. try { // CraftBukkit start - ServerListPingEvent pingEvent = CraftEventFactory.callServerListPingEvent(this.server.server, getSocket().getInetAddress(), this.server.motd, this.server.serverConfigurationManager.getPlayerCount(), this.server.serverConfigurationManager.getMaxPlayers()); + org.bukkit.event.server.ServerListPingEvent pingEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callServerListPingEvent(this.server.server, getSocket().getInetAddress(), this.server.motd, this.server.serverConfigurationManager.getPlayerCount(), this.server.serverConfigurationManager.getMaxPlayers()); String s = pingEvent.getMotd() + "\u00A7" + this.server.serverConfigurationManager.getPlayerCount() + "\u00A7" + pingEvent.getMaxPlayers(); // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/NetServerHandler.java b/src/main/java/net/minecraft/server/NetServerHandler.java index 7377d4db..afead300 100644 --- a/src/main/java/net/minecraft/server/NetServerHandler.java +++ b/src/main/java/net/minecraft/server/NetServerHandler.java @@ -7,23 +7,14 @@ import java.util.logging.Logger; // CraftBukkit start import java.io.UnsupportedEncodingException; import java.util.logging.Level; -import java.util.Arrays; import java.util.HashSet; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.craftbukkit.ChunkCompressionThread; import org.bukkit.Location; -import org.bukkit.command.CommandException; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.inventory.CraftInventoryView; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.event.CraftEventFactory; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.TextWrapper; -import org.bukkit.entity.HumanEntity; import org.bukkit.entity.Player; import org.bukkit.event.Event; import org.bukkit.event.block.Action; @@ -32,7 +23,6 @@ import org.bukkit.event.player.PlayerAnimationEvent; import org.bukkit.event.player.PlayerChatEvent; import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; -import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerItemHeldEvent; import org.bukkit.event.player.PlayerKickEvent; import org.bukkit.event.player.PlayerMoveEvent; @@ -44,9 +34,7 @@ import org.bukkit.event.inventory.*; import org.bukkit.event.inventory.InventoryType.SlotType; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.inventory.CraftingInventory; -import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryView; -import org.bukkit.inventory.Recipe; // CraftBukkit end public class NetServerHandler extends NetHandler implements ICommandListener { @@ -82,7 +70,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { this.server = minecraftserver.server; } - private final CraftServer server; + private final org.bukkit.craftbukkit.CraftServer server; private int lastTick = MinecraftServer.currentTick; private int lastDropTick = MinecraftServer.currentTick; private int dropCount = 0; @@ -105,7 +93,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { public CraftPlayer getPlayer() { return (this.player == null) ? null : (CraftPlayer) this.player.getBukkitEntity(); } - private final static HashSet<Integer> invalidItems = new HashSet<Integer>(Arrays.asList(8, 9, 10, 11, 26, 34, 36, 51, 52, 55, 59, 60, 63, 64, 68, 71, 75, 78, 83, 90, 92, 93, 94, 95)); + private final static HashSet<Integer> invalidItems = new HashSet<Integer>(java.util.Arrays.asList(8, 9, 10, 11, 26, 34, 36, 51, 52, 55, 59, 60, 63, 64, 68, 71, 75, 78, 83, 90, 92, 93, 94, 95)); // CraftBukkit end public void a() { @@ -530,9 +518,10 @@ public class NetServerHandler extends NetHandler implements ICommandListener { } if (packet14blockdig.e == 0) { - // CraftBukkit + // CraftBukkit start if (i1 < this.server.getSpawnRadius() && !flag) { CraftEventFactory.callPlayerInteractEvent(this.player, Action.LEFT_CLICK_BLOCK, i, j, k, l, this.player.inventory.getItemInHand()); + // CraftBukkit end this.player.netServerHandler.sendPacket(new Packet53BlockChange(i, j, k, worldserver)); } else { this.player.itemInWorldManager.dig(i, j, k, packet14blockdig.face); @@ -603,7 +592,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { // CraftBukkit start int itemstackAmount = itemstack.count; - PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack); + org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemstack); if (event.useItemInHand() != Event.Result.DENY) { this.player.itemInWorldManager.useItem(this.player, this.player.world, itemstack); } @@ -717,13 +706,13 @@ public class NetServerHandler extends NetHandler implements ICommandListener { this.player.compassTarget = new Location(this.getPlayer().getWorld(), packet6.x, packet6.y, packet6.z); } else if (packet instanceof Packet3Chat) { String message = ((Packet3Chat) packet).message; - for (final String line : TextWrapper.wrapText(message)) { + for (final String line : org.bukkit.craftbukkit.TextWrapper.wrapText(message)) { this.networkManager.queue(new Packet3Chat(line)); } packet = null; } else if (packet != null && packet.lowPriority == true) { // Reroute all low-priority packets through to compression thread. - ChunkCompressionThread.sendPacket(this.player, packet); + org.bukkit.craftbukkit.ChunkCompressionThread.sendPacket(this.player, packet); packet = null; } if (packet != null) this.networkManager.queue(packet); @@ -822,14 +811,14 @@ public class NetServerHandler extends NetHandler implements ICommandListener { if (this.server.dispatchCommand(player, event.getMessage().substring(1))) { return; } - } catch (CommandException ex) { - player.sendMessage(ChatColor.RED + "An internal error occurred while attempting to perform this command"); - Logger.getLogger(NetServerHandler.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); + } catch (org.bukkit.command.CommandException ex) { + player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command"); + Logger.getLogger(NetServerHandler.class.getName()).log(Level.SEVERE, null, ex); return; } // CraftBukkit end - /* // CraftBukkit start - No longer needed as we have already handled it in server.dispatchServerCommand above. + /* CraftBukkit start - No longer needed as we have already handled it in server.dispatchServerCommand above. if (s.toLowerCase().startsWith("/me ")) { s = "* " + this.player.name + " " + s.substring(s.indexOf(" ")).trim(); logger.info(s); @@ -1026,7 +1015,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { PlayerPortalEvent event = new PlayerPortalEvent(this.player.getBukkitEntity(), this.player.getBukkitEntity().getLocation(), toLocation, pta, PlayerPortalEvent.TeleportCause.END_PORTAL); event.useTravelAgent(false); - Bukkit.getServer().getPluginManager().callEvent(event); + org.bukkit.Bukkit.getServer().getPluginManager().callEvent(event); this.player = this.minecraftServer.serverConfigurationManager.moveToWorld(this.player, 0, true, event.getTo()); // CraftBukkit end } else { @@ -1063,9 +1052,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener { SlotType type = CraftInventoryView.getSlotType(inventory, packet102windowclick.slot); InventoryClickEvent event = new InventoryClickEvent(inventory, type, packet102windowclick.slot, packet102windowclick.button != 0, packet102windowclick.shift); - Inventory top = inventory.getTopInventory(); + org.bukkit.inventory.Inventory top = inventory.getTopInventory(); if (packet102windowclick.slot == 0 && top instanceof CraftingInventory) { - Recipe recipe = ((CraftingInventory) top).getRecipe(); + org.bukkit.inventory.Recipe recipe = ((CraftingInventory) top).getRecipe(); if (recipe != null) { event = new CraftItemEvent(recipe, inventory, type, packet102windowclick.slot, packet102windowclick.button != 0, packet102windowclick.shift); } @@ -1147,7 +1136,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { boolean flag3 = itemstack == null || itemstack.getData() >= 0 && itemstack.getData() >= 0 && itemstack.count <= 64 && itemstack.count > 0; // CraftBukkit start - Fire INVENTORY_CLICK event - HumanEntity player = this.player.getBukkitEntity(); + org.bukkit.entity.HumanEntity player = this.player.getBukkitEntity(); InventoryView inventory = new CraftInventoryView(player, player.getInventory(), this.player.defaultContainer); SlotType slot = SlotType.QUICKBAR; if (packet107setcreativeslot.slot == -1) { @@ -1225,8 +1214,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { if (!tileentitysign.c()) { this.minecraftServer.warning("Player " + this.player.name + " just tried to change non-editable sign"); - // CraftBukkit - this.sendPacket(new Packet130UpdateSign(packet130updatesign.x, packet130updatesign.y, packet130updatesign.z, tileentitysign.lines)); + this.sendPacket(new Packet130UpdateSign(packet130updatesign.x, packet130updatesign.y, packet130updatesign.z, tileentitysign.lines)); // CraftBukkit return; } } @@ -1261,7 +1249,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener { // CraftBukkit start Player player = this.server.getPlayer(this.player); - SignChangeEvent event = new SignChangeEvent((CraftBlock) player.getWorld().getBlockAt(j, k, i), this.server.getPlayer(this.player), packet130updatesign.lines); + SignChangeEvent event = new SignChangeEvent((org.bukkit.craftbukkit.block.CraftBlock) player.getWorld().getBlockAt(j, k, i), this.server.getPlayer(this.player), packet130updatesign.lines); this.server.getPluginManager().callEvent(event); if (!event.isCancelled()) { diff --git a/src/main/java/net/minecraft/server/NetworkListenThread.java b/src/main/java/net/minecraft/server/NetworkListenThread.java index cddac3b3..13b10f18 100644 --- a/src/main/java/net/minecraft/server/NetworkListenThread.java +++ b/src/main/java/net/minecraft/server/NetworkListenThread.java @@ -9,7 +9,6 @@ import java.util.logging.Level; import java.util.logging.Logger; // CraftBukkit start -import java.io.IOException; import java.util.List; import java.util.Collections; // CraftBukkit end @@ -26,7 +25,7 @@ public class NetworkListenThread { public MinecraftServer c; private HashMap i = new HashMap(); - public NetworkListenThread(MinecraftServer minecraftserver, InetAddress inetaddress, int i) throws IOException { // CraftBukkit + public NetworkListenThread(MinecraftServer minecraftserver, InetAddress inetaddress, int i) throws java.io.IOException { // CraftBukkit this.c = minecraftserver; this.d = new ServerSocket(i, 0, inetaddress); this.d.setPerformancePreferences(0, 2, 1); diff --git a/src/main/java/net/minecraft/server/NetworkWriterThread.java b/src/main/java/net/minecraft/server/NetworkWriterThread.java index 0b742c4b..140fcd2d 100644 --- a/src/main/java/net/minecraft/server/NetworkWriterThread.java +++ b/src/main/java/net/minecraft/server/NetworkWriterThread.java @@ -1,68 +1,68 @@ -package net.minecraft.server;
-
-import java.io.IOException;
-
-class NetworkWriterThread extends Thread {
-
- final NetworkManager a;
-
- NetworkWriterThread(NetworkManager networkmanager, String s) {
- super(s);
- this.a = networkmanager;
- }
-
- public void run() {
- Object object = NetworkManager.a;
-
- synchronized (NetworkManager.a) {
- ++NetworkManager.c;
- }
-
- while (true) {
- boolean flag = false;
-
- try {
- flag = true;
- if (!NetworkManager.a(this.a)) {
- flag = false;
- break;
- }
-
- while (NetworkManager.d(this.a)) {
- ;
- }
-
- try {
- if (NetworkManager.e(this.a) != null) {
- NetworkManager.e(this.a).flush();
- }
- } catch (IOException ioexception) {
- if (!NetworkManager.f(this.a)) {
- NetworkManager.a(this.a, (Exception) ioexception);
- }
-
- // ioexception.printStackTrace(); // CraftBukkit - Don't spam console on unexpected disconnect
- }
-
- try {
- sleep(2L);
- } catch (InterruptedException interruptedexception) {
- ;
- }
- } finally {
- if (flag) {
- Object object1 = NetworkManager.a;
-
- synchronized (NetworkManager.a) {
- --NetworkManager.c;
- }
- }
- }
- }
-
- object = NetworkManager.a;
- synchronized (NetworkManager.a) {
- --NetworkManager.c;
- }
- }
-}
+package net.minecraft.server; + +import java.io.IOException; + +class NetworkWriterThread extends Thread { + + final NetworkManager a; + + NetworkWriterThread(NetworkManager networkmanager, String s) { + super(s); + this.a = networkmanager; + } + + public void run() { + Object object = NetworkManager.a; + + synchronized (NetworkManager.a) { + ++NetworkManager.c; + } + + while (true) { + boolean flag = false; + + try { + flag = true; + if (!NetworkManager.a(this.a)) { + flag = false; + break; + } + + while (NetworkManager.d(this.a)) { + ; + } + + try { + if (NetworkManager.e(this.a) != null) { + NetworkManager.e(this.a).flush(); + } + } catch (IOException ioexception) { + if (!NetworkManager.f(this.a)) { + NetworkManager.a(this.a, (Exception) ioexception); + } + + // ioexception.printStackTrace(); // CraftBukkit - Don't spam console on unexpected disconnect + } + + try { + sleep(2L); + } catch (InterruptedException interruptedexception) { + ; + } + } finally { + if (flag) { + Object object1 = NetworkManager.a; + + synchronized (NetworkManager.a) { + --NetworkManager.c; + } + } + } + } + + object = NetworkManager.a; + synchronized (NetworkManager.a) { + --NetworkManager.c; + } + } +} diff --git a/src/main/java/net/minecraft/server/Packet20NamedEntitySpawn.java b/src/main/java/net/minecraft/server/Packet20NamedEntitySpawn.java index 0b6780ff..d32795c9 100644 --- a/src/main/java/net/minecraft/server/Packet20NamedEntitySpawn.java +++ b/src/main/java/net/minecraft/server/Packet20NamedEntitySpawn.java @@ -23,8 +23,7 @@ public class Packet20NamedEntitySpawn extends Packet { // CraftBukkit start - limit name length to 16 characters if (entityhuman.name.length() > 16) { this.b = entityhuman.name.substring(0, 16); - } - else { + } else { this.b = entityhuman.name; } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/Packet51MapChunk.java b/src/main/java/net/minecraft/server/Packet51MapChunk.java index 015757da..a054615e 100644 --- a/src/main/java/net/minecraft/server/Packet51MapChunk.java +++ b/src/main/java/net/minecraft/server/Packet51MapChunk.java @@ -4,7 +4,7 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.zip.DataFormatException; -import java.util.zip.Deflater; +// import java.util.zip.Deflater; // CraftBukkit import java.util.zip.Inflater; public class Packet51MapChunk extends Packet { @@ -23,7 +23,6 @@ public class Packet51MapChunk extends Packet { this.lowPriority = true; } - // CraftBukkit start public Packet51MapChunk(Chunk chunk, boolean flag, int i) { this.lowPriority = true; this.a = chunk.x; diff --git a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java index 317e7a62..8d9ffd21 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalEatTile.java @@ -73,4 +73,4 @@ public class PathfinderGoalEatTile extends PathfinderGoal { } } } -}
\ No newline at end of file +} diff --git a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java index 28c21aad..d35f1647 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalSelector.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalSelector.java @@ -1,7 +1,8 @@ package net.minecraft.server; -import java.util.ArrayList; +//import java.util.ArrayList; // CraftBukkit import java.util.Iterator; + import org.bukkit.craftbukkit.util.UnsafeList; // CraftBukkit public class PathfinderGoalSelector { @@ -22,7 +23,8 @@ public class PathfinderGoalSelector { // CraftBukkit start - don't use iterators for private fields for (int i = 0; i < this.a.size(); i++) { - PathfinderGoalSelectorItem pathfindergoalselectoritem = (PathfinderGoalSelectorItem) this.a.unsafeGet(i); // CraftBukkit - use unsafeGet + PathfinderGoalSelectorItem pathfindergoalselectoritem = (PathfinderGoalSelectorItem) this.a.unsafeGet(i); + // CraftBukkit end boolean flag = this.b.contains(pathfindergoalselectoritem); if (flag) { @@ -42,27 +44,26 @@ public class PathfinderGoalSelector { this.b.add(pathfindergoalselectoritem); } } - // CraftBukkit end boolean flag1 = false; - // CraftBukkit start - removed usage of arraylist - /*if (flag1 && arraylist.size() > 0) { + /* CraftBukkit start - removed usage of arraylist + if (flag1 && arraylist.size() > 0) { System.out.println("Starting: "); - }*/ - // CraftBukkit end + } + // CraftBukkit end */ Iterator iterator1; PathfinderGoalSelectorItem pathfindergoalselectoritem1; - // CraftBukkit start - removed usage of arraylist - /*for (iterator1 = arraylist.iterator(); iterator1.hasNext(); pathfindergoalselectoritem1.a.c()) { + /* CraftBukkit start - removed usage of arraylist + for (iterator1 = arraylist.iterator(); iterator1.hasNext(); pathfindergoalselectoritem1.a.c()) { pathfindergoalselectoritem1 = (PathfinderGoalSelectorItem) iterator1.next(); if (flag1) { System.out.println(pathfindergoalselectoritem1.a.toString() + ", "); } - }*/ - // CraftBukkit end + } + // CraftBukkit end */ if (flag1 && this.b.size() > 0) { System.out.println("Running: "); diff --git a/src/main/java/net/minecraft/server/PlayerInventory.java b/src/main/java/net/minecraft/server/PlayerInventory.java index df502e88..a5e2c4d2 100644 --- a/src/main/java/net/minecraft/server/PlayerInventory.java +++ b/src/main/java/net/minecraft/server/PlayerInventory.java @@ -1,12 +1,10 @@ package net.minecraft.server; // CraftBukkit start -import java.util.ArrayList; import java.util.List; import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; -import org.bukkit.inventory.InventoryHolder; // CraftBukkit end public class PlayerInventory implements IInventory { @@ -19,7 +17,7 @@ public class PlayerInventory implements IInventory { public boolean e = false; // CraftBukkit start - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); private int maxStack = MAX_STACK; public ItemStack[] getContents() { @@ -42,7 +40,7 @@ public class PlayerInventory implements IInventory { return transaction; } - public InventoryHolder getOwner() { + public org.bukkit.inventory.InventoryHolder getOwner() { return this.player.getBukkitEntity(); } diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java index ae0feee2..20e981c8 100644 --- a/src/main/java/net/minecraft/server/PropertyManager.java +++ b/src/main/java/net/minecraft/server/PropertyManager.java @@ -7,6 +7,8 @@ import java.util.Properties; import java.util.logging.Level; import java.util.logging.Logger; +import joptsimple.OptionSet; // CraftBukkit + public class PropertyManager { public static Logger a = Logger.getLogger("Minecraft"); @@ -29,9 +31,9 @@ public class PropertyManager { } // CraftBukkit start - private joptsimple.OptionSet options = null; + private OptionSet options = null; - public PropertyManager(final joptsimple.OptionSet options) { + public PropertyManager(final OptionSet options) { this((File) options.valueOf("config")); this.options = options; diff --git a/src/main/java/net/minecraft/server/SecondaryWorldServer.java b/src/main/java/net/minecraft/server/SecondaryWorldServer.java index 086ba361..0f1bcadc 100644 --- a/src/main/java/net/minecraft/server/SecondaryWorldServer.java +++ b/src/main/java/net/minecraft/server/SecondaryWorldServer.java @@ -1,10 +1,8 @@ package net.minecraft.server; -import org.bukkit.generator.ChunkGenerator; // CraftBukkit - public class SecondaryWorldServer extends WorldServer { // CraftBukkit start - public SecondaryWorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, WorldSettings worldsettings, WorldServer worldserver, org.bukkit.World.Environment env, ChunkGenerator gen) { + public SecondaryWorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, WorldSettings worldsettings, WorldServer worldserver, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { super(minecraftserver, idatamanager, s, i, worldsettings, env, gen); // CraftBukkit end this.worldMaps = worldserver.worldMaps; diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index e0099568..97cc93fb 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -18,8 +18,8 @@ import java.util.LinkedHashSet; import org.bukkit.Location; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; -import org.bukkit.craftbukkit.command.ColouredConsoleSender; import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerChangedWorldEvent; import org.bukkit.event.player.PlayerPortalEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerJoinEvent; @@ -53,7 +53,7 @@ public class ServerConfigurationManager { public ServerConfigurationManager(MinecraftServer minecraftserver) { minecraftserver.server = new CraftServer(minecraftserver, this); - minecraftserver.console = ColouredConsoleSender.getInstance(); + minecraftserver.console = org.bukkit.craftbukkit.command.ColouredConsoleSender.getInstance(); this.cserver = minecraftserver.server; // CraftBukkit end @@ -322,7 +322,7 @@ public class ServerConfigurationManager { entityplayer1.E(); // CraftBukkit start - don't fire on respawn if (fromWorld != location.getWorld()) { - org.bukkit.event.player.PlayerChangedWorldEvent event = new org.bukkit.event.player.PlayerChangedWorldEvent((Player) entityplayer1.getBukkitEntity(), fromWorld); + PlayerChangedWorldEvent event = new PlayerChangedWorldEvent((Player) entityplayer1.getBukkitEntity(), fromWorld); Bukkit.getServer().getPluginManager().callEvent(event); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/ShapedRecipes.java b/src/main/java/net/minecraft/server/ShapedRecipes.java index 1613fd15..cf7f1070 100644 --- a/src/main/java/net/minecraft/server/ShapedRecipes.java +++ b/src/main/java/net/minecraft/server/ShapedRecipes.java @@ -3,7 +3,6 @@ package net.minecraft.server; // CraftBukkit start import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftShapedRecipe; -import org.bukkit.inventory.ShapedRecipe; // CraftBukkit end public class ShapedRecipes implements CraftingRecipe { @@ -23,7 +22,7 @@ public class ShapedRecipes implements CraftingRecipe { } // CraftBukkit start - public ShapedRecipe toBukkitRecipe() { + public org.bukkit.inventory.ShapedRecipe toBukkitRecipe() { CraftItemStack result = new CraftItemStack(this.result); CraftShapedRecipe recipe = new CraftShapedRecipe(result, this); switch (this.width) { diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java index b542d1bc..548d810c 100644 --- a/src/main/java/net/minecraft/server/ShapelessRecipes.java +++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java @@ -7,7 +7,6 @@ import java.util.List; // CraftBukkit start import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftShapelessRecipe; -import org.bukkit.inventory.ShapelessRecipe; // CraftBukkit end public class ShapelessRecipes implements CraftingRecipe { @@ -22,7 +21,7 @@ public class ShapelessRecipes implements CraftingRecipe { // CraftBukkit start @SuppressWarnings("unchecked") - public ShapelessRecipe toBukkitRecipe() { + public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe() { CraftItemStack result = new CraftItemStack(this.result); CraftShapelessRecipe recipe = new CraftShapelessRecipe(result, this); for (ItemStack stack : (List<ItemStack>) this.ingredients) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java index 29ca51e1..d62e9838 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -7,7 +7,6 @@ import java.util.List; import java.util.Random; // CraftBukkit start -import java.util.ArrayList; import org.bukkit.craftbukkit.util.LongBaseHashtable; import org.bukkit.craftbukkit.util.EntryBase; import org.bukkit.craftbukkit.util.LongHash; @@ -85,7 +84,7 @@ public final class SpawnerCreature { i = 0; ChunkCoordinates chunkcoordinates = world.getSpawn(); - ArrayList<EntryBase> b = chunkCoords.entries(); // CraftBukkit + java.util.ArrayList<EntryBase> b = chunkCoords.entries(); // CraftBukkit EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values(); j = aenumcreaturetype.length; diff --git a/src/main/java/net/minecraft/server/ThreadCommandReader.java b/src/main/java/net/minecraft/server/ThreadCommandReader.java index e48aa733..b6dccdd5 100644 --- a/src/main/java/net/minecraft/server/ThreadCommandReader.java +++ b/src/main/java/net/minecraft/server/ThreadCommandReader.java @@ -4,7 +4,7 @@ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; -import static org.bukkit.craftbukkit.Main.*; +import static org.bukkit.craftbukkit.Main.*; // CraftBukkit public class ThreadCommandReader extends Thread { diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java index 8137c78e..d569ed8c 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -4,7 +4,6 @@ import java.util.HashMap; import java.util.Map; // CraftBukkit start -import org.bukkit.block.BlockState; import org.bukkit.inventory.InventoryHolder; // CraftBukkit end @@ -128,7 +127,7 @@ public class TileEntity { // CraftBukkit start public InventoryHolder getOwner() { - BlockState state = world.getWorld().getBlockAt(x, y, z).getState(); + org.bukkit.block.BlockState state = world.getWorld().getBlockAt(x, y, z).getState(); if(state instanceof InventoryHolder) return (InventoryHolder) state; return null; } diff --git a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java index f5c15f92..fe3a487c 100644 --- a/src/main/java/net/minecraft/server/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/server/TileEntityBrewingStand.java @@ -3,13 +3,9 @@ package net.minecraft.server; import java.util.List; // CraftBukkit start -import java.util.ArrayList; - -import org.bukkit.Bukkit; import org.bukkit.craftbukkit.entity.CraftHumanEntity; import org.bukkit.entity.HumanEntity; import org.bukkit.event.inventory.BrewEvent; -import org.bukkit.inventory.BrewerInventory; // CraftBukkit end public class TileEntityBrewingStand extends TileEntity implements IInventory { @@ -22,7 +18,7 @@ public class TileEntityBrewingStand extends TileEntity implements IInventory { public TileEntityBrewingStand() {} // CraftBukkit start - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); private int maxStack = 1; public void onOpen(CraftHumanEntity who) { @@ -128,8 +124,8 @@ public class TileEntityBrewingStand extends TileEntity implements IInventory { // CraftBukkit start - fire BREW event if (getOwner() != null) { - BrewEvent event = new BrewEvent(world.getWorld().getBlockAt(x, y, z), (BrewerInventory) this.getOwner().getInventory()); - Bukkit.getPluginManager().callEvent(event); + BrewEvent event = new BrewEvent(world.getWorld().getBlockAt(x, y, z), (org.bukkit.inventory.BrewerInventory) this.getOwner().getInventory()); + org.bukkit.Bukkit.getPluginManager().callEvent(event); if(event.isCancelled()) { return; } diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java index b3a83751..f6512f10 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -1,7 +1,6 @@ package net.minecraft.server; // CraftBukkit start -import java.util.ArrayList; import java.util.List; import org.bukkit.craftbukkit.entity.CraftHumanEntity; @@ -22,7 +21,7 @@ public class TileEntityChest extends TileEntity implements IInventory { private int ticks; // CraftBukkit start - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); private int maxStack = MAX_STACK; public ItemStack[] getContents() { diff --git a/src/main/java/net/minecraft/server/TileEntityDispenser.java b/src/main/java/net/minecraft/server/TileEntityDispenser.java index c811610d..09045326 100644 --- a/src/main/java/net/minecraft/server/TileEntityDispenser.java +++ b/src/main/java/net/minecraft/server/TileEntityDispenser.java @@ -3,7 +3,6 @@ package net.minecraft.server; import java.util.Random; // CraftBukkit start -import java.util.ArrayList; import java.util.List; import org.bukkit.craftbukkit.entity.CraftHumanEntity; @@ -16,7 +15,7 @@ public class TileEntityDispenser extends TileEntity implements IInventory { private Random b = new Random(); // CraftBukkit start - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); private int maxStack = MAX_STACK; public ItemStack[] getContents() { diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java index d282cc13..10db2c76 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -1,7 +1,6 @@ package net.minecraft.server; // CraftBukkit start -import java.util.ArrayList; import java.util.List; import org.bukkit.craftbukkit.inventory.CraftItemStack; @@ -21,7 +20,7 @@ public class TileEntityFurnace extends TileEntity implements IInventory { // CraftBukkit start private int lastTick = (int) (System.currentTimeMillis() / 50); private int maxStack = MAX_STACK; - public List<HumanEntity> transaction = new ArrayList<HumanEntity>(); + public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); public ItemStack[] getContents() { return this.items; diff --git a/src/main/java/net/minecraft/server/TileEntityNote.java b/src/main/java/net/minecraft/server/TileEntityNote.java index 78c6b553..80513603 100644 --- a/src/main/java/net/minecraft/server/TileEntityNote.java +++ b/src/main/java/net/minecraft/server/TileEntityNote.java @@ -1,7 +1,5 @@ package net.minecraft.server; -import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit - public class TileEntityNote extends TileEntity { public byte note = 0; @@ -53,7 +51,7 @@ public class TileEntityNote extends TileEntity { } // CraftBukkit start - org.bukkit.event.block.NotePlayEvent event = CraftEventFactory.callNotePlayEvent(this.world, i, j, k, b0, this.note); + org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(this.world, i, j, k, b0, this.note); if (!event.isCancelled()) { this.world.playNote(i, j, k, event.getInstrument().getType(), event.getNote().getId()); } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 589c9320..70cacddb 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -10,10 +10,7 @@ import java.util.Set; import java.util.TreeSet; // CraftBukkit start -import java.util.UUID; - import org.bukkit.Bukkit; -import org.bukkit.Location; import org.bukkit.craftbukkit.util.LongHash; import org.bukkit.craftbukkit.util.LongHashset; import org.bukkit.generator.ChunkGenerator; @@ -190,7 +187,7 @@ public class World implements IBlockAccess { // CraftBukkit start if (this.generator != null) { Random rand = new Random(this.getSeed()); - Location spawn = this.generator.getFixedSpawnLocation(((WorldServer) this).getWorld(), rand); + org.bukkit.Location spawn = this.generator.getFixedSpawnLocation(((WorldServer) this).getWorld(), rand); if (spawn != null) { if (spawn.getWorld() != ((WorldServer) this).getWorld()) { @@ -2927,7 +2924,7 @@ public class World implements IBlockAccess { } // CraftBukkit start - public UUID getUUID() { + public java.util.UUID getUUID() { return this.dataManager.getUUID(); } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/WorldGenHugeMushroom.java b/src/main/java/net/minecraft/server/WorldGenHugeMushroom.java index 23230713..bf409754 100644 --- a/src/main/java/net/minecraft/server/WorldGenHugeMushroom.java +++ b/src/main/java/net/minecraft/server/WorldGenHugeMushroom.java @@ -3,10 +3,7 @@ package net.minecraft.server; import java.util.Random; // CraftBukkit start import org.bukkit.BlockChangeDelegate; -import org.bukkit.Bukkit; import org.bukkit.block.BlockState; -import org.bukkit.craftbukkit.CraftWorld; -import org.bukkit.event.world.StructureGrowEvent; import org.bukkit.material.MaterialData; // CraftBukkit end @@ -32,7 +29,7 @@ public class WorldGenHugeMushroom extends WorldGenerator implements BlockSapling return grow(world, random, i, j, k, null, null, null); } - public boolean grow(BlockChangeDelegate world, Random random, int i, int j, int k, StructureGrowEvent event, ItemStack itemstack, CraftWorld bukkitWorld) { + public boolean grow(BlockChangeDelegate world, Random random, int i, int j, int k, org.bukkit.event.world.StructureGrowEvent event, ItemStack itemstack, org.bukkit.craftbukkit.CraftWorld bukkitWorld) { // CraftBukkit end int l = random.nextInt(2); @@ -200,7 +197,7 @@ public class WorldGenHugeMushroom extends WorldGenerator implements BlockSapling } // CraftBukkit start if (event != null) { - Bukkit.getPluginManager().callEvent(event); + org.bukkit.Bukkit.getPluginManager().callEvent(event); if (!event.isCancelled()) { for (BlockState state : event.getBlocks()) { state.update(true); diff --git a/src/main/java/net/minecraft/server/WorldGenSwampTree.java b/src/main/java/net/minecraft/server/WorldGenSwampTree.java index d1adaaf9..cea5cb8c 100644 --- a/src/main/java/net/minecraft/server/WorldGenSwampTree.java +++ b/src/main/java/net/minecraft/server/WorldGenSwampTree.java @@ -2,15 +2,19 @@ package net.minecraft.server; import java.util.Random; +import org.bukkit.BlockChangeDelegate; // CraftBukkit + public class WorldGenSwampTree extends WorldGenerator implements BlockSapling.TreeGenerator { // CraftBukkit - add interface public WorldGenSwampTree() {} public boolean a(World world, Random random, int i, int j, int k) { - return generate((org.bukkit.BlockChangeDelegate) world, random, i, j, k); + // CraftBukkit start + return generate((BlockChangeDelegate) world, random, i, j, k); } - public boolean generate(org.bukkit.BlockChangeDelegate world, Random random, int i, int j, int k) { + public boolean generate(BlockChangeDelegate world, Random random, int i, int j, int k) { + // CraftBukkit end int l; for (l = random.nextInt(4) + 5; world.getTypeId(i, j - 1, k) != 0 && Block.byId[world.getTypeId(i, j - 1, k)].material == Material.WATER; --j) { // CraftBukkit - bypass World.getMaterial @@ -126,7 +130,7 @@ public class WorldGenSwampTree extends WorldGenerator implements BlockSapling.T } // CraftBukkit - change signature - private void b(org.bukkit.BlockChangeDelegate world, int i, int j, int k, int l) { + private void b(BlockChangeDelegate world, int i, int j, int k, int l) { this.setTypeAndData(world, i, j, k, Block.VINE.id, l); int i1 = 4; diff --git a/src/main/java/net/minecraft/server/WorldMap.java b/src/main/java/net/minecraft/server/WorldMap.java index 08914204..e4243464 100644 --- a/src/main/java/net/minecraft/server/WorldMap.java +++ b/src/main/java/net/minecraft/server/WorldMap.java @@ -8,7 +8,6 @@ import java.util.Map; // CraftBukkit start import java.util.UUID; -import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.map.CraftMapView; @@ -36,7 +35,7 @@ public class WorldMap extends WorldMapBase { super(s); // CraftBukkit start mapView = new CraftMapView(this); - server = (CraftServer) Bukkit.getServer(); + server = (CraftServer) org.bukkit.Bukkit.getServer(); // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/WorldMapHumanTracker.java b/src/main/java/net/minecraft/server/WorldMapHumanTracker.java index 4acd5ed3..69779683 100644 --- a/src/main/java/net/minecraft/server/WorldMapHumanTracker.java +++ b/src/main/java/net/minecraft/server/WorldMapHumanTracker.java @@ -1,11 +1,5 @@ package net.minecraft.server; -// CraftBukkit start -import org.bukkit.map.MapCursor; -import org.bukkit.craftbukkit.entity.CraftPlayer; -import org.bukkit.craftbukkit.map.RenderData; -// CraftBukkit end - public class WorldMapHumanTracker { public final EntityHuman trackee; @@ -35,7 +29,7 @@ public class WorldMapHumanTracker { int i; int j; - RenderData render = this.worldMap.mapView.render((CraftPlayer) trackee.getBukkitEntity()); // CraftBukkit + org.bukkit.craftbukkit.map.RenderData render = this.worldMap.mapView.render((org.bukkit.craftbukkit.entity.CraftPlayer) trackee.getBukkitEntity()); // CraftBukkit if (--this.f < 0) { this.f = 4; @@ -45,7 +39,7 @@ public class WorldMapHumanTracker { // CraftBukkit start for (i = 0; i < render.cursors.size(); ++i) { - MapCursor cursor = render.cursors.get(i); + org.bukkit.map.MapCursor cursor = render.cursors.get(i); if (!cursor.isVisible()) continue; byte value = (byte) (((cursor.getRawType() == 0 || cursor.getDirection() < 8 ? cursor.getDirection() : cursor.getDirection() - 1) & 15) * 16); diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java index bf2a1ced..78f644f9 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java @@ -11,8 +11,11 @@ import java.io.OutputStream; import java.util.List; import java.util.logging.Logger; -import java.util.UUID; // CraftBukkit -import org.bukkit.craftbukkit.entity.CraftPlayer; // CraftBukkit +// CraftBukkit start +import java.util.UUID; + +import org.bukkit.craftbukkit.entity.CraftPlayer; +// CraftBukkit end public class WorldNBTStorage implements PlayerFileData, IDataManager { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index 9b67eb73..a9344efd 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -4,16 +4,9 @@ import java.util.ArrayList; import java.util.List; // CraftBukkit start -import org.bukkit.BlockChangeDelegate; -import org.bukkit.generator.ChunkGenerator; -import org.bukkit.craftbukkit.generator.CustomChunkGenerator; -import org.bukkit.craftbukkit.generator.InternalChunkGenerator; -import org.bukkit.craftbukkit.generator.NetherChunkGenerator; -import org.bukkit.craftbukkit.generator.NormalChunkGenerator; -import org.bukkit.craftbukkit.generator.SkyLandsChunkGenerator; import org.bukkit.event.weather.LightningStrikeEvent; -public class WorldServer extends World implements BlockChangeDelegate { +public class WorldServer extends World implements org.bukkit.BlockChangeDelegate { // CraftBukkit end public ChunkProviderServer chunkProviderServer; @@ -23,7 +16,7 @@ public class WorldServer extends World implements BlockChangeDelegate { private IntHashMap entitiesById; // CraftBukkit start - change signature - public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, WorldSettings worldsettings, org.bukkit.World.Environment env, ChunkGenerator gen) { + public WorldServer(MinecraftServer minecraftserver, IDataManager idatamanager, String s, int i, WorldSettings worldsettings, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { super(idatamanager, s, worldsettings, WorldProvider.byDimension(env.getId()), gen, env); this.server = minecraftserver; if (this.entitiesById == null) { @@ -115,16 +108,16 @@ public class WorldServer extends World implements BlockChangeDelegate { IChunkLoader ichunkloader = this.dataManager.createChunkLoader(this.worldProvider); // CraftBukkit start - InternalChunkGenerator gen; + org.bukkit.craftbukkit.generator.InternalChunkGenerator gen; if (this.generator != null) { - gen = new CustomChunkGenerator(this, this.getSeed(), this.generator); + gen = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, this.getSeed(), this.generator); } else if (this.worldProvider instanceof WorldProviderHell) { - gen = new NetherChunkGenerator(this, this.getSeed()); + gen = new org.bukkit.craftbukkit.generator.NetherChunkGenerator(this, this.getSeed()); } else if (this.worldProvider instanceof WorldProviderTheEnd) { - gen = new SkyLandsChunkGenerator(this, this.getSeed()); + gen = new org.bukkit.craftbukkit.generator.SkyLandsChunkGenerator(this, this.getSeed()); } else { - gen = new NormalChunkGenerator(this, this.getSeed()); + gen = new org.bukkit.craftbukkit.generator.NormalChunkGenerator(this, this.getSeed()); } this.chunkProviderServer = new ChunkProviderServer(this, ichunkloader, gen); |