Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Generic cleanup/reformat.
Dieser Commit ist enthalten in:
Ursprung
001a45804e
Commit
04be2b9b31
@ -69,10 +69,10 @@ public class BlockDispenser extends BlockContainer {
|
|||||||
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
|
CraftBlock block = (CraftBlock) craftWorld.getBlockAt(i, j, k);
|
||||||
LivingEntity who = (entityhuman == null)?null:(LivingEntity)entityhuman.getBukkitEntity();
|
LivingEntity who = (entityhuman == null)?null:(LivingEntity)entityhuman.getBukkitEntity();
|
||||||
|
|
||||||
BlockInteractEvent bie = new BlockInteractEvent(eventType, block, who);
|
BlockInteractEvent event = new BlockInteractEvent(eventType, block, who);
|
||||||
server.getPluginManager().callEvent(bie);
|
server.getPluginManager().callEvent(event);
|
||||||
|
|
||||||
if (bie.isCancelled()) {
|
if (event.isCancelled()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
@ -131,13 +131,13 @@ public class BlockFire extends Block {
|
|||||||
|
|
||||||
if (random.nextInt(l) < i1) {
|
if (random.nextInt(l) < i1) {
|
||||||
boolean flag = world.getTypeId(i, j, k) == Block.TNT.id;
|
boolean flag = world.getTypeId(i, j, k) == Block.TNT.id;
|
||||||
// CraftBukkit start: BlockBurnEvent
|
// CraftBukkit start
|
||||||
Server server = ((WorldServer)world).getServer();
|
Server server = ((WorldServer)world).getServer();
|
||||||
CraftWorld cworld = ((WorldServer)world).getWorld();
|
CraftWorld cworld = ((WorldServer)world).getWorld();
|
||||||
org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k));
|
org.bukkit.block.Block theBlock = (cworld.getBlockAt(i, j, k));
|
||||||
BlockBurnEvent burnEvent = new BlockBurnEvent(theBlock);
|
BlockBurnEvent event = new BlockBurnEvent(theBlock);
|
||||||
server.getPluginManager().callEvent(burnEvent);
|
server.getPluginManager().callEvent(event);
|
||||||
if(!burnEvent.isCancelled()) {
|
if(!event.isCancelled()) {
|
||||||
if (random.nextInt(2) == 0) {
|
if (random.nextInt(2) == 0) {
|
||||||
world.e(i, j, k, this.id);
|
world.e(i, j, k, this.id);
|
||||||
} else {
|
} else {
|
||||||
@ -148,7 +148,7 @@ public class BlockFire extends Block {
|
|||||||
Block.TNT.a(world, i, j, k, 0);
|
Block.TNT.a(world, i, j, k, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// CraftBukkit end: BlockBurnEvent
|
// CraftBukkit end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ public class ItemSign extends Item {
|
|||||||
CraftWorld craftWorld = ((WorldServer) world).getWorld();
|
CraftWorld craftWorld = ((WorldServer) world).getWorld();
|
||||||
CraftServer craftServer = ((WorldServer) world).getServer();
|
CraftServer craftServer = ((WorldServer) world).getServer();
|
||||||
org.bukkit.block.Block blockClicked = craftWorld.getBlockAt(i, j, k);
|
org.bukkit.block.Block blockClicked = craftWorld.getBlockAt(i, j, k);
|
||||||
//CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
if (l == 1) {
|
if (l == 1) {
|
||||||
++j;
|
++j;
|
||||||
|
@ -2,9 +2,9 @@ package net.minecraft.server;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
//CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.BlockChangeDelegate;
|
import org.bukkit.BlockChangeDelegate;
|
||||||
//CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public class WorldGenBigTree extends WorldGenerator {
|
public class WorldGenBigTree extends WorldGenerator {
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@ package net.minecraft.server;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
//CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.BlockChangeDelegate;
|
import org.bukkit.BlockChangeDelegate;
|
||||||
//CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public class WorldGenForest extends WorldGenerator {
|
public class WorldGenForest extends WorldGenerator {
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@ package net.minecraft.server;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
//CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.BlockChangeDelegate;
|
import org.bukkit.BlockChangeDelegate;
|
||||||
//CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public class WorldGenTaiga1 extends WorldGenerator {
|
public class WorldGenTaiga1 extends WorldGenerator {
|
||||||
|
|
||||||
|
@ -2,9 +2,9 @@ package net.minecraft.server;
|
|||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
//CraftBukkit start
|
// CraftBukkit start
|
||||||
import org.bukkit.BlockChangeDelegate;
|
import org.bukkit.BlockChangeDelegate;
|
||||||
//CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
public class WorldGenTaiga2 extends WorldGenerator {
|
public class WorldGenTaiga2 extends WorldGenerator {
|
||||||
|
|
||||||
|
@ -158,26 +158,16 @@ public class CraftWorld implements World {
|
|||||||
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
|
public boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BIG_TREE:
|
case BIG_TREE:
|
||||||
return (new WorldGenBigTree())
|
return new WorldGenBigTree().generate(delegate, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
.generate(delegate, rand,
|
|
||||||
loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
|
||||||
case BIRCH:
|
case BIRCH:
|
||||||
return (new WorldGenForest())
|
return new WorldGenForest().generate(delegate, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
.generate(delegate, rand,
|
|
||||||
loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
|
||||||
case REDWOOD:
|
case REDWOOD:
|
||||||
return (new WorldGenTaiga2())
|
return new WorldGenTaiga2().generate(delegate, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
.generate(delegate, rand,
|
|
||||||
loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
|
||||||
case TALL_REDWOOD:
|
case TALL_REDWOOD:
|
||||||
return (new WorldGenTaiga1())
|
return new WorldGenTaiga1().generate(delegate, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
.generate(delegate, rand,
|
|
||||||
loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
|
||||||
case TREE:
|
case TREE:
|
||||||
default:
|
default:
|
||||||
return (new WorldGenTrees())
|
return new WorldGenTrees().generate(delegate, rand, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
.generate(delegate, rand,
|
|
||||||
loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -257,11 +247,9 @@ public class CraftWorld implements World {
|
|||||||
public List<Entity> getEntities() {
|
public List<Entity> getEntities() {
|
||||||
List<Entity> list = new ArrayList<Entity>();
|
List<Entity> list = new ArrayList<Entity>();
|
||||||
|
|
||||||
for (Object o : world.b) {
|
for (Object o: world.b) {
|
||||||
if (o instanceof net.minecraft.server.Entity) {
|
if (o instanceof net.minecraft.server.Entity) {
|
||||||
net.minecraft.server.Entity mcEnt
|
net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity)o;
|
||||||
= (net.minecraft.server.Entity)o;
|
|
||||||
|
|
||||||
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
||||||
|
|
||||||
// Assuming that bukkitEntity isn't null
|
// Assuming that bukkitEntity isn't null
|
||||||
@ -277,11 +265,9 @@ public class CraftWorld implements World {
|
|||||||
public List<LivingEntity> getLivingEntities() {
|
public List<LivingEntity> getLivingEntities() {
|
||||||
List<LivingEntity> list = new ArrayList<LivingEntity>();
|
List<LivingEntity> list = new ArrayList<LivingEntity>();
|
||||||
|
|
||||||
for (Object o : world.b) {
|
for (Object o: world.b) {
|
||||||
if (o instanceof net.minecraft.server.Entity) {
|
if (o instanceof net.minecraft.server.Entity) {
|
||||||
net.minecraft.server.Entity mcEnt
|
net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity)o;
|
||||||
= (net.minecraft.server.Entity)o;
|
|
||||||
|
|
||||||
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
Entity bukkitEntity = mcEnt.getBukkitEntity();
|
||||||
|
|
||||||
// Assuming that bukkitEntity isn't null
|
// Assuming that bukkitEntity isn't null
|
||||||
|
@ -170,8 +170,7 @@ public class CraftBlock implements Block {
|
|||||||
* @return Block at the given face
|
* @return Block at the given face
|
||||||
*/
|
*/
|
||||||
public Block getFace(final BlockFace face, final int distance) {
|
public Block getFace(final BlockFace face, final int distance) {
|
||||||
return getRelative(face.getModX() * distance, face.getModY() * distance,
|
return getRelative(face.getModX() * distance, face.getModY() * distance, face.getModZ() * distance);
|
||||||
face.getModZ() * distance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4,7 +4,6 @@ package org.bukkit.craftbukkit.entity;
|
|||||||
import net.minecraft.server.EntityHuman;
|
import net.minecraft.server.EntityHuman;
|
||||||
import org.bukkit.entity.HumanEntity;
|
import org.bukkit.entity.HumanEntity;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
|
||||||
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
|
import org.bukkit.craftbukkit.inventory.CraftInventoryPlayer;
|
||||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren