1- package be .isach .ultracosmetics .v1_18_R2 ;
1+ package be .isach .ultracosmetics .v1_20_R1 ;
22
33import be .isach .ultracosmetics .UltraCosmeticsData ;
44import be .isach .ultracosmetics .util .MathUtils ;
55import be .isach .ultracosmetics .util .Particles ;
66import be .isach .ultracosmetics .version .IEntityUtil ;
7-
7+ import com .mojang .datafixers .util .Pair ;
8+ import net .minecraft .core .Rotations ;
9+ import net .minecraft .network .protocol .Packet ;
10+ import net .minecraft .network .protocol .game .ClientboundAddEntityPacket ;
11+ import net .minecraft .network .protocol .game .ClientboundRemoveEntitiesPacket ;
12+ import net .minecraft .network .protocol .game .ClientboundSetEntityDataPacket ;
13+ import net .minecraft .network .protocol .game .ClientboundSetEquipmentPacket ;
14+ import net .minecraft .network .protocol .game .ClientboundTeleportEntityPacket ;
15+ import net .minecraft .world .entity .EntityType ;
16+ import net .minecraft .world .entity .EquipmentSlot ;
17+ import net .minecraft .world .entity .decoration .ArmorStand ;
18+ import net .minecraft .world .item .ItemStack ;
819import org .bukkit .Bukkit ;
920import org .bukkit .Location ;
10- import org .bukkit .craftbukkit .v1_18_R2 .CraftWorld ;
11- import org .bukkit .craftbukkit .v1_18_R2 .entity .CraftEntity ;
12- import org .bukkit .craftbukkit .v1_18_R2 .entity .CraftPlayer ;
13- import org .bukkit .craftbukkit .v1_18_R2 .entity .CraftWither ;
14- import org .bukkit .craftbukkit .v1_18_R2 .inventory .CraftItemStack ;
21+ import org .bukkit .craftbukkit .v1_19_R3 .CraftWorld ;
22+ import org .bukkit .craftbukkit .v1_19_R3 .entity .CraftEntity ;
23+ import org .bukkit .craftbukkit .v1_19_R3 .entity .CraftPlayer ;
24+ import org .bukkit .craftbukkit .v1_19_R3 .entity .CraftWither ;
25+ import org .bukkit .craftbukkit .v1_19_R3 .inventory .CraftItemStack ;
1526import org .bukkit .entity .Player ;
1627import org .bukkit .entity .Wither ;
1728import org .bukkit .util .Vector ;
1829
19- import com .mojang .datafixers .util .Pair ;
20-
2130import java .util .ArrayList ;
2231import java .util .HashMap ;
2332import java .util .HashSet ;
2736import java .util .Set ;
2837import java .util .function .Predicate ;
2938
30- import net .minecraft .core .Rotations ;
31- import net .minecraft .network .protocol .Packet ;
32- import net .minecraft .network .protocol .game .ClientboundAddEntityPacket ;
33- import net .minecraft .network .protocol .game .ClientboundRemoveEntitiesPacket ;
34- import net .minecraft .network .protocol .game .ClientboundSetEntityDataPacket ;
35- import net .minecraft .network .protocol .game .ClientboundSetEquipmentPacket ;
36- import net .minecraft .network .protocol .game .ClientboundTeleportEntityPacket ;
37- import net .minecraft .world .entity .EntityType ;
38- import net .minecraft .world .entity .EquipmentSlot ;
39- import net .minecraft .world .entity .decoration .ArmorStand ;
40- import net .minecraft .world .item .ItemStack ;
41-
4239/**
4340 * @author RadBuilder
4441 * @author iSach
4542 */
4643public class EntityUtil implements IEntityUtil {
4744
4845 private final Random r = new Random ();
49- private Map <Player ,Set <ArmorStand >> fakeArmorStandsMap = new HashMap <>();
50- private Map <Player ,Set <org .bukkit .entity .Entity >> cooldownJumpMap = new HashMap <>();
46+ private Map <Player , Set <ArmorStand >> fakeArmorStandsMap = new HashMap <>();
47+ private Map <Player , Set <org .bukkit .entity .Entity >> cooldownJumpMap = new HashMap <>();
5148
5249 @ Override
5350 public void resetWitherSize (Wither wither ) {
@@ -65,13 +62,13 @@ public void sendBlizzard(final Player player, Location loc, Predicate<org.bukkit
6562 as .setSmall (true );
6663 as .setNoGravity (true );
6764 as .setShowArms (true );
68- as .setHeadPose (new Rotations (( r .nextInt (360 )), ( r .nextInt (360 )), ( r .nextInt (360 ) )));
69- as .absMoveTo (loc .getX () + MathUtils .randomDouble (-1.5 , 1.5 ), loc .getY () + MathUtils .randomDouble (0 , .05 ) - 0.75 ,
65+ as .setHeadPose (new Rotations (r .nextInt (360 ), r .nextInt (360 ), r .nextInt (360 )));
66+ as .absMoveTo (loc .getX () + MathUtils .randomDouble (-1.5 , 1.5 ), loc .getY () + MathUtils .randomDouble (0 , 0.5 ) - 0.75 ,
7067 loc .getZ () + MathUtils .randomDouble (-1.5 , 1.5 ), 0 , 0 );
7168 fakeArmorStands .add (as );
7269 ClientboundAddEntityPacket addPacket = new ClientboundAddEntityPacket (as );
73- ClientboundSetEntityDataPacket dataPacket = new ClientboundSetEntityDataPacket (as .getId (), as .getEntityData (), false );
74- List <Pair <EquipmentSlot ,ItemStack >> equipment = new ArrayList <>();
70+ ClientboundSetEntityDataPacket dataPacket = new ClientboundSetEntityDataPacket (as .getId (), as .getEntityData (). packDirty () );
71+ List <Pair <EquipmentSlot , ItemStack >> equipment = new ArrayList <>();
7572 equipment .add (new Pair <>(EquipmentSlot .HEAD , CraftItemStack .asNMSCopy (new org .bukkit .inventory .ItemStack (org .bukkit .Material .PACKED_ICE ))));
7673 ClientboundSetEquipmentPacket equipmentPacket = new ClientboundSetEquipmentPacket (as .getId (), equipment );
7774 for (Player loopPlayer : player .getWorld ().getPlayers ()) {
@@ -121,7 +118,7 @@ public void sendDestroyPacket(Player player, org.bukkit.entity.Entity entity) {
121118
122119 @ Override
123120 public void setStepHeight (org .bukkit .entity .Entity entity ) {
124- ((CraftEntity ) entity ).getHandle ().maxUpStep = 1 ;
121+ ((CraftEntity ) entity ).getHandle ().setMaxUpStep ( 1 ) ;
125122 }
126123
127124 @ Override
0 commit comments