@@ -13,7 +13,7 @@
|
||||
public class EntityTrackerEntry {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -61,8 +67,12 @@
|
||||
@@ -59,8 +65,12 @@
|
||||
private List<Entity> lastPassengers;
|
||||
private boolean wasRiding;
|
||||
private boolean wasOnGround;
|
||||
@@ -27,69 +27,30 @@
|
||||
this.ap = Vec3D.ZERO;
|
||||
this.lastPassengers = Collections.emptyList();
|
||||
this.level = worldserver;
|
||||
@@ -82,22 +92,22 @@
|
||||
@@ -88,18 +98,18 @@
|
||||
if (entity instanceof EntityItemFrame) {
|
||||
EntityItemFrame entityitemframe = (EntityItemFrame) entity;
|
||||
|
||||
if (!list.equals(this.lastPassengers)) {
|
||||
this.lastPassengers = list;
|
||||
- this.broadcast.accept(new PacketPlayOutMount(this.entity));
|
||||
+ this.broadcastAndSend(new PacketPlayOutMount(this.entity)); // CraftBukkit
|
||||
}
|
||||
- if (this.tickCount % 10 == 0) {
|
||||
+ if (true || this.tickCount % 10 == 0) { // CraftBukkit - Moved below, should always enter this block
|
||||
ItemStack itemstack = entityitemframe.getItem();
|
||||
|
||||
- if (this.entity instanceof EntityItemFrame && this.tickCount % 10 == 0) {
|
||||
+ if (this.entity instanceof EntityItemFrame /*&& this.tickCounter % 10 == 0*/) { // CraftBukkit - Moved below, should always enter this block
|
||||
EntityItemFrame entityitemframe = (EntityItemFrame) this.entity;
|
||||
ItemStack itemstack = entityitemframe.getItem();
|
||||
- if (itemstack.getItem() instanceof ItemWorldMap) {
|
||||
+ if (this.tickCount % 10 == 0 && itemstack.getItem() instanceof ItemWorldMap) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks
|
||||
Integer integer = ItemWorldMap.getMapId(itemstack);
|
||||
WorldMap worldmap = ItemWorldMap.getSavedData(integer, this.level);
|
||||
|
||||
- if (itemstack.getItem() instanceof ItemWorldMap) {
|
||||
+ if (this.tickCount % 10 == 0 && itemstack.getItem() instanceof ItemWorldMap) { // CraftBukkit - Moved this.tickCounter % 10 logic here so item frames do not enter the other blocks
|
||||
Integer integer = ItemWorldMap.getMapId(itemstack);
|
||||
WorldMap worldmap = ItemWorldMap.getSavedData(integer, this.level);
|
||||
if (worldmap != null) {
|
||||
- Iterator iterator = this.level.players().iterator();
|
||||
+ Iterator<ServerPlayerConnection> iterator = this.trackedPlayers.iterator(); // CraftBukkit
|
||||
|
||||
if (worldmap != null) {
|
||||
- Iterator iterator = this.level.players().iterator();
|
||||
+ Iterator<ServerPlayerConnection> iterator = this.trackedPlayers.iterator(); // CraftBukkit
|
||||
while (iterator.hasNext()) {
|
||||
- EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
+ EntityPlayer entityplayer = iterator.next().getPlayer(); // CraftBukkit
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
- EntityPlayer entityplayer = (EntityPlayer) iterator.next();
|
||||
+ EntityPlayer entityplayer = iterator.next().getPlayer(); // CraftBukkit
|
||||
|
||||
worldmap.tickCarriedBy(entityplayer, itemstack);
|
||||
Packet<?> packet = worldmap.getUpdatePacket(integer, entityplayer);
|
||||
@@ -140,6 +150,17 @@
|
||||
boolean flag2 = flag1 || this.tickCount % 60 == 0;
|
||||
boolean flag3 = Math.abs(i - this.yRotp) >= 1 || Math.abs(j - this.xRotp) >= 1;
|
||||
|
||||
+ // CraftBukkit start - Code moved from below
|
||||
+ if (flag2) {
|
||||
+ this.updateSentPos();
|
||||
+ }
|
||||
+
|
||||
+ if (flag3) {
|
||||
+ this.yRotp = i;
|
||||
+ this.xRotp = j;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (this.tickCount > 0 || this.entity instanceof EntityArrow) {
|
||||
long k = PacketPlayOutEntity.entityToPacket(vec3d.x);
|
||||
long l = PacketPlayOutEntity.entityToPacket(vec3d.y);
|
||||
@@ -178,6 +199,7 @@
|
||||
}
|
||||
|
||||
this.sendDirtyEntityData();
|
||||
+ /* CraftBukkit start - Code moved up
|
||||
if (flag2) {
|
||||
this.updateSentPos();
|
||||
}
|
||||
@@ -186,6 +208,7 @@
|
||||
this.yRotp = i;
|
||||
this.xRotp = j;
|
||||
}
|
||||
+ // CraftBukkit end */
|
||||
|
||||
this.wasRiding = false;
|
||||
}
|
||||
@@ -201,7 +224,27 @@
|
||||
worldmap.tickCarriedBy(entityplayer, itemstack);
|
||||
Packet<?> packet = worldmap.getUpdatePacket(integer, entityplayer);
|
||||
@@ -204,7 +214,27 @@
|
||||
|
||||
++this.tickCount;
|
||||
if (this.entity.hurtMarked) {
|
||||
@@ -118,7 +79,7 @@
|
||||
this.entity.hurtMarked = false;
|
||||
}
|
||||
|
||||
@@ -216,13 +259,16 @@
|
||||
@@ -219,13 +249,16 @@
|
||||
PlayerConnection playerconnection = entityplayer.connection;
|
||||
|
||||
Objects.requireNonNull(entityplayer.connection);
|
||||
@@ -138,7 +99,7 @@
|
||||
}
|
||||
|
||||
Packet<?> packet = this.entity.getAddEntityPacket();
|
||||
@@ -238,6 +284,12 @@
|
||||
@@ -241,6 +274,12 @@
|
||||
if (this.entity instanceof EntityLiving) {
|
||||
Collection<AttributeModifiable> collection = ((EntityLiving) this.entity).getAttributes().getSyncableAttributes();
|
||||
|
||||
@@ -151,7 +112,7 @@
|
||||
if (!collection.isEmpty()) {
|
||||
consumer.accept(new PacketPlayOutUpdateAttributes(this.entity.getId(), collection));
|
||||
}
|
||||
@@ -269,8 +321,14 @@
|
||||
@@ -272,8 +311,14 @@
|
||||
if (!list.isEmpty()) {
|
||||
consumer.accept(new PacketPlayOutEntityEquipment(this.entity.getId(), list));
|
||||
}
|
||||
@@ -166,7 +127,7 @@
|
||||
if (this.entity instanceof EntityLiving) {
|
||||
EntityLiving entityliving = (EntityLiving) this.entity;
|
||||
Iterator iterator = entityliving.getActiveEffects().iterator();
|
||||
@@ -311,6 +369,11 @@
|
||||
@@ -314,6 +359,11 @@
|
||||
Set<AttributeModifiable> set = ((EntityLiving) this.entity).getAttributes().getDirtyAttributes();
|
||||
|
||||
if (!set.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user