@@ -189,6 +189,8 @@ public abstract class Entity extends Location implements Metadatable {
189
189
public static final int DATA_PLAYER_LAST_DEATH_POS = 127 ;
190
190
public static final int DATA_PLAYER_LAST_DEATH_DIMENSION = 128 ;
191
191
public static final int DATA_PLAYER_HAS_DIED = 129 ;
192
+ public static final int DATA_COLLISION_BOX = 130 ; //vector3f
193
+ public static final int DATA_VISIBLE_MOB_EFFECTS = 131 ; //long
192
194
193
195
// Flags
194
196
public static final int DATA_FLAG_ONFIRE = 0 ;
@@ -845,6 +847,8 @@ protected void recalculateEffectColor() {
845
847
int [] color = new int [3 ];
846
848
int count = 0 ;
847
849
boolean ambient = true ;
850
+ long effectsData = 0 ;
851
+ int packedEffectsCount = 0 ;
848
852
for (Effect effect : this .effects .values ()) {
849
853
if (effect .isVisible ()) {
850
854
int [] c = effect .getColor ();
@@ -855,6 +859,10 @@ protected void recalculateEffectColor() {
855
859
if (!effect .isAmbient ()) {
856
860
ambient = false ;
857
861
}
862
+ if (packedEffectsCount < 8 ) {
863
+ effectsData = effectsData << 7 | ((effect .getId () & 0x3f ) << 1 ) | (effect .isAmbient () ? 1 : 0 );
864
+ packedEffectsCount ++;
865
+ }
858
866
}
859
867
}
860
868
@@ -869,6 +877,7 @@ protected void recalculateEffectColor() {
869
877
this .setDataProperty (new IntEntityData (Entity .DATA_POTION_COLOR , 0 ));
870
878
this .setDataProperty (new ByteEntityData (Entity .DATA_POTION_AMBIENT , 0 ));
871
879
}
880
+ this .setDataProperty (new LongEntityData (Entity .DATA_VISIBLE_MOB_EFFECTS , effectsData ));
872
881
}
873
882
874
883
public static Entity createEntity (String name , Position pos , Object ... args ) {
0 commit comments