geforkt von Mirrors/Paper
SPIGOT-6579: DragonFireBall movement with setDirection jumps around a lot
By: DerFrZocker <derrieple@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
81ee774c37
Commit
cae78fadd8
@ -12,6 +12,8 @@ import net.minecraft.nbt.NBTBase;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.chat.IChatBaseComponent;
|
import net.minecraft.network.chat.IChatBaseComponent;
|
||||||
import net.minecraft.server.level.EntityPlayer;
|
import net.minecraft.server.level.EntityPlayer;
|
||||||
|
import net.minecraft.server.level.PlayerChunkMap;
|
||||||
|
import net.minecraft.server.level.WorldServer;
|
||||||
import net.minecraft.world.damagesource.DamageSource;
|
import net.minecraft.world.damagesource.DamageSource;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.EntityAreaEffectCloud;
|
import net.minecraft.world.entity.EntityAreaEffectCloud;
|
||||||
@ -1035,6 +1037,22 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
|||||||
return nbttagcompound;
|
return nbttagcompound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// re-sends the spawn entity packet to updated values which cannot be updated otherwise
|
||||||
|
protected void update() {
|
||||||
|
if (!getHandle().isAlive()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldServer world = ((CraftWorld) getWorld()).getHandle();
|
||||||
|
PlayerChunkMap.EntityTracker entityTracker = world.getChunkProvider().chunkMap.entityMap.get(getEntityId());
|
||||||
|
|
||||||
|
if (entityTracker == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
entityTracker.broadcast(getHandle().getPacket());
|
||||||
|
}
|
||||||
|
|
||||||
private static PermissibleBase getPermissibleBase() {
|
private static PermissibleBase getPermissibleBase() {
|
||||||
if (perm == null) {
|
if (perm == null) {
|
||||||
perm = new PermissibleBase(new ServerOperator() {
|
perm = new PermissibleBase(new ServerOperator() {
|
||||||
|
@ -57,6 +57,7 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
|
|||||||
public void setDirection(Vector direction) {
|
public void setDirection(Vector direction) {
|
||||||
Validate.notNull(direction, "Direction can not be null");
|
Validate.notNull(direction, "Direction can not be null");
|
||||||
getHandle().setDirection(direction.getX(), direction.getY(), direction.getZ());
|
getHandle().setDirection(direction.getX(), direction.getY(), direction.getZ());
|
||||||
|
update(); // SPIGOT-6579
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
package org.bukkit.craftbukkit.entity;
|
package org.bukkit.craftbukkit.entity;
|
||||||
|
|
||||||
import net.minecraft.core.EnumDirection;
|
import net.minecraft.core.EnumDirection;
|
||||||
import net.minecraft.server.level.PlayerChunkMap;
|
|
||||||
import net.minecraft.server.level.WorldServer;
|
|
||||||
import net.minecraft.world.entity.decoration.EntityHanging;
|
import net.minecraft.world.entity.decoration.EntityHanging;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.craftbukkit.CraftWorld;
|
|
||||||
import org.bukkit.craftbukkit.block.CraftBlock;
|
import org.bukkit.craftbukkit.block.CraftBlock;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Hanging;
|
import org.bukkit.entity.Hanging;
|
||||||
@ -74,19 +71,4 @@ public class CraftHanging extends CraftEntity implements Hanging {
|
|||||||
public EntityType getType() {
|
public EntityType getType() {
|
||||||
return EntityType.UNKNOWN;
|
return EntityType.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void update() {
|
|
||||||
if (!getHandle().isAlive()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
WorldServer world = ((CraftWorld) getWorld()).getHandle();
|
|
||||||
PlayerChunkMap.EntityTracker entityTracker = world.getChunkProvider().chunkMap.entityMap.get(getEntityId());
|
|
||||||
|
|
||||||
if (entityTracker == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
entityTracker.broadcast(getHandle().getPacket());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren