mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Implemented arrows.
By: sk89q <the.sk89q@gmail.com>
This commit is contained in:
parent
8bec12c50b
commit
755c51da47
2 changed files with 30 additions and 0 deletions
|
@ -0,0 +1,15 @@
|
||||||
|
package org.bukkit.craftbukkit;
|
||||||
|
|
||||||
|
import org.bukkit.ArrowEntity;
|
||||||
|
import net.minecraft.server.EntityArrow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents an arrow.
|
||||||
|
*
|
||||||
|
* @author sk89q
|
||||||
|
*/
|
||||||
|
public class CraftArrowEntity extends CraftEntity implements ArrowEntity {
|
||||||
|
CraftArrowEntity(CraftServer server, EntityArrow entity) {
|
||||||
|
super(server, entity);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,8 +4,13 @@ package org.bukkit.craftbukkit;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import net.minecraft.server.WorldServer;
|
import net.minecraft.server.WorldServer;
|
||||||
|
import net.minecraft.server.EntityArrow;
|
||||||
|
|
||||||
|
import org.bukkit.ArrowEntity;
|
||||||
import org.bukkit.Block;
|
import org.bukkit.Block;
|
||||||
import org.bukkit.Chunk;
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Vector;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
|
|
||||||
public class CraftWorld implements World {
|
public class CraftWorld implements World {
|
||||||
|
@ -70,6 +75,16 @@ public class CraftWorld implements World {
|
||||||
return world;
|
return world;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArrowEntity spawnArrow(Location loc, Vector velocity, float speed,
|
||||||
|
float spread) {
|
||||||
|
EntityArrow arrow = new EntityArrow(world);
|
||||||
|
arrow.c(loc.getX(), loc.getY(), loc.getZ());
|
||||||
|
world.a(arrow);
|
||||||
|
arrow.a(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread);
|
||||||
|
return new CraftArrowEntity(world.getServer(), arrow);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "CraftWorld";
|
return "CraftWorld";
|
||||||
|
|
Loading…
Reference in a new issue