Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
Include ThrownPotion in spawn methods. Adds BUKKIT-2542
Dieser Commit ist enthalten in:
Ursprung
e1b50b0110
Commit
62c6d223e4
@ -848,6 +848,8 @@ public class CraftWorld implements World {
|
||||
} else if (ThrownExpBottle.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityThrownExpBottle(world);
|
||||
entity.setPositionRotation(x, y, z, 0, 0);
|
||||
} else if (ThrownPotion.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntityPotion(world, x, y, z, CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.POTION, 1)));
|
||||
} else if (Fireball.class.isAssignableFrom(clazz)) {
|
||||
if (SmallFireball.class.isAssignableFrom(clazz)) {
|
||||
entity = new EntitySmallFireball(world);
|
||||
|
@ -16,6 +16,7 @@ import net.minecraft.server.EntityLiving;
|
||||
import net.minecraft.server.EntitySmallFireball;
|
||||
import net.minecraft.server.EntitySnowball;
|
||||
import net.minecraft.server.EntityPlayer;
|
||||
import net.minecraft.server.EntityPotion;
|
||||
import net.minecraft.server.EntityWitherSkull;
|
||||
import net.minecraft.server.MobEffect;
|
||||
import net.minecraft.server.MobEffectList;
|
||||
@ -24,10 +25,12 @@ import net.minecraft.server.Packet42RemoveMobEffect;
|
||||
import org.apache.commons.lang.Validate;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.craftbukkit.CraftServer;
|
||||
import org.bukkit.craftbukkit.CraftWorld;
|
||||
import org.bukkit.craftbukkit.inventory.CraftEntityEquipment;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.entity.Arrow;
|
||||
import org.bukkit.entity.Egg;
|
||||
import org.bukkit.entity.Entity;
|
||||
@ -40,9 +43,11 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Projectile;
|
||||
import org.bukkit.entity.SmallFireball;
|
||||
import org.bukkit.entity.Snowball;
|
||||
import org.bukkit.entity.ThrownPotion;
|
||||
import org.bukkit.entity.WitherSkull;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.inventory.EntityEquipment;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
import org.bukkit.util.BlockIterator;
|
||||
@ -299,6 +304,8 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
launch = new EntityEnderPearl(world, getHandle());
|
||||
} else if (Arrow.class.isAssignableFrom(projectile)) {
|
||||
launch = new EntityArrow(world, getHandle(), 1);
|
||||
} else if (ThrownPotion.class.isAssignableFrom(projectile)) {
|
||||
launch = new EntityPotion(world, getHandle(), CraftItemStack.asNMSCopy(new ItemStack(Material.POTION, 1)));
|
||||
} else if (Fireball.class.isAssignableFrom(projectile)) {
|
||||
Location location = getEyeLocation();
|
||||
Vector direction = location.getDirection().multiply(10);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren