Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
Fixing event names
Dieser Commit ist enthalten in:
Ursprung
4c420e6aa8
Commit
437025a179
@ -99,7 +99,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
|
||||
if (this.l(world, i, j - 1, k)) {
|
||||
// CraftBukkit start - send "down" to the server
|
||||
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, BlockFace.DOWN);
|
||||
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FROMTO, source, BlockFace.DOWN);
|
||||
if (server != null) {
|
||||
server.getPluginManager().callEvent(event);
|
||||
}
|
||||
@ -129,7 +129,7 @@ public class BlockFlowing extends BlockFluids {
|
||||
int index = 0;
|
||||
for (BlockFace currentFace: faces) {
|
||||
if (aboolean[index]) {
|
||||
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FLOW, source, currentFace);
|
||||
BlockFromToEvent event = new BlockFromToEvent(Type.BLOCK_FROMTO, source, currentFace);
|
||||
|
||||
if (server != null) {
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
@ -81,7 +81,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
* 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(Type.CHUNK_LOADED, chunk.bukkitChunk));
|
||||
server.getPluginManager().callEvent(new ChunkLoadEvent(Type.CHUNK_LOAD, chunk.bukkitChunk));
|
||||
}
|
||||
// CraftBukkit end
|
||||
|
||||
@ -212,7 +212,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
||||
Chunk chunk = e.get(chunkcoordinates);
|
||||
if (chunk == null) continue;
|
||||
|
||||
ChunkUnloadEvent event = new ChunkUnloadEvent(Type.CHUNK_UNLOADED, chunk.bukkitChunk);
|
||||
ChunkUnloadEvent event = new ChunkUnloadEvent(Type.CHUNK_UNLOAD, chunk.bukkitChunk);
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
g.getWorld().preserveChunk( (CraftChunk) chunk.bukkitChunk );
|
||||
|
@ -3,7 +3,7 @@ package net.minecraft.server;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.event.entity.ExplosionPrimedEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityCreeper extends EntityMonster {
|
||||
@ -85,9 +85,9 @@ public class EntityCreeper extends EntityMonster {
|
||||
if (this.a >= 30) {
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED;
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimeEvent.Type.EXPLOSION_PRIME;
|
||||
|
||||
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), 3.0F, false);
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent(eventType, CraftEntity.getEntity(server, this), 3.0F, false);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
|
@ -8,7 +8,7 @@ import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.event.entity.EntityDamageByProjectileEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.ExplosionPrimedEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityFireball extends Entity {
|
||||
@ -149,9 +149,9 @@ public class EntityFireball extends Entity {
|
||||
}
|
||||
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED;
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimeEvent.Type.EXPLOSION_PRIME;
|
||||
|
||||
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), 1.0F, false);
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent(eventType, CraftEntity.getEntity(server, this), 1.0F, false);
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
// give 'this' instead of (Entity) null so we know what causes the damage
|
||||
|
@ -3,7 +3,7 @@ package net.minecraft.server;
|
||||
// CraftBukkit start
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.entity.CraftEntity;
|
||||
import org.bukkit.event.entity.ExplosionPrimedEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class EntityTNTPrimed extends Entity {
|
||||
@ -69,9 +69,9 @@ public class EntityTNTPrimed extends Entity {
|
||||
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) this.world).getServer();
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimedEvent.Type.EXPLOSION_PRIMED;
|
||||
org.bukkit.event.Event.Type eventType = ExplosionPrimeEvent.Type.EXPLOSION_PRIME;
|
||||
|
||||
ExplosionPrimedEvent event = new ExplosionPrimedEvent(eventType, CraftEntity.getEntity(server, this), f, false);
|
||||
ExplosionPrimeEvent event = new ExplosionPrimeEvent(eventType, CraftEntity.getEntity(server, this), f, false);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
|
@ -91,7 +91,7 @@ public class ItemBlock extends Item {
|
||||
*/
|
||||
if (world.setTypeIdAndData(i, j, k, a, a(itemstack.h()))) { // <-- world.b does this to place the block
|
||||
org.bukkit.Server server = ((WorldServer) world).getServer();
|
||||
Type eventType = Type.BLOCK_PLACED;
|
||||
Type eventType = Type.BLOCK_PLACE;
|
||||
org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack);
|
||||
Player thePlayer = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity();
|
||||
|
||||
|
@ -10,6 +10,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event.Type;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.event.player.PlayerVegetationPlantEvent;
|
||||
// CraftBukkit end
|
||||
|
||||
public class ItemReed extends Item {
|
||||
@ -91,7 +92,7 @@ public class ItemReed extends Item {
|
||||
*/
|
||||
if (world.setTypeId(i, j, k, this.a)) { // <-- world.e does this to place the block
|
||||
org.bukkit.Server server = ((WorldServer) world).getServer();
|
||||
Type eventType = Type.BLOCK_PLACED;
|
||||
Type eventType = Type.BLOCK_PLACE;
|
||||
org.bukkit.inventory.ItemStack itemInHand = new CraftItemStack(itemstack);
|
||||
Player thePlayer = (entityhuman == null) ? null : (Player) entityhuman.getBukkitEntity();
|
||||
|
||||
|
@ -212,7 +212,7 @@ public class MinecraftServer implements Runnable, ICommandListener {
|
||||
world.a(true, (IProgressUpdate) null);
|
||||
world.r();
|
||||
|
||||
WorldEvent event = new WorldEvent( Event.Type.WORLD_SAVED, world.getWorld() );
|
||||
WorldEvent event = new WorldEvent( Event.Type.WORLD_SAVE, world.getWorld() );
|
||||
server.getPluginManager().callEvent( event );
|
||||
}
|
||||
|
||||
|
@ -351,9 +351,9 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
if ((blockId == Block.REDSTONE_WIRE.id && block.getData() > 0) || blockId == Block.REDSTONE_TORCH_ON.id) {
|
||||
server.getPluginManager().callEvent( new BlockRedstoneEvent(block, (blockId == Block.REDSTONE_WIRE.id ? block.getData() : 15), 0));
|
||||
}
|
||||
event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.BROKEN, player);
|
||||
event = new BlockDamageEvent(Type.BLOCK_DAMAGE, block, BlockDamageLevel.BROKEN, player);
|
||||
} else {
|
||||
event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STARTED, player);
|
||||
event = new BlockDamageEvent(Type.BLOCK_DAMAGE, block, BlockDamageLevel.STARTED, player);
|
||||
}
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
@ -364,7 +364,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
// CraftBukkit start - Get last block that the player hit
|
||||
// Otherwise the block is a Bedrock @(0,0,0)
|
||||
block = (CraftBlock) player.getWorld().getBlockAt(lastX, lastY, lastZ);
|
||||
BlockDamageEvent event = new BlockDamageEvent(Type.BLOCK_DAMAGED, block, BlockDamageLevel.STOPPED, player);
|
||||
BlockDamageEvent event = new BlockDamageEvent(Type.BLOCK_DAMAGE, block, BlockDamageLevel.STOPPED, player);
|
||||
server.getPluginManager().callEvent(event);
|
||||
if (!event.isCancelled()) {
|
||||
this.e.c.b(i, j, k);
|
||||
@ -489,7 +489,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
|
||||
}
|
||||
CraftItemStack craftItem = new CraftItemStack(itemstack);
|
||||
Player player = getPlayer();
|
||||
BlockRightClickEvent event = new BlockRightClickEvent(Type.BLOCK_RIGHTCLICKED, blockClicked, blockFace, craftItem, player);
|
||||
BlockRightClickEvent event = new BlockRightClickEvent(Type.BLOCK_RIGHTCLICK, blockClicked, blockFace, craftItem, player);
|
||||
server.getPluginManager().callEvent(event);
|
||||
|
||||
this.e.c.a(this.e, this.e.world, itemstack, i, j, k, l);
|
||||
|
@ -332,7 +332,7 @@ public final class CraftServer implements Server {
|
||||
protected void addWorld(World world) {
|
||||
worlds.put(world.getName().toLowerCase(), world);
|
||||
|
||||
pluginManager.callEvent(new WorldEvent(Type.WORLD_LOADED, world));
|
||||
pluginManager.callEvent(new WorldEvent(Type.WORLD_LOAD, world));
|
||||
}
|
||||
|
||||
public Logger getLogger() {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren