|
12 | 12 | import net.blitzcube.peapi.api.entity.IEntityIdentifier; |
13 | 13 | import net.blitzcube.peapi.api.entity.fake.IFakeEntity; |
14 | 14 | import net.blitzcube.peapi.api.entity.fake.IFakeEntityFactory; |
15 | | -import net.blitzcube.peapi.api.entity.modifier.IEntityModifier; |
16 | 15 | import net.blitzcube.peapi.api.entity.modifier.IEntityModifierRegistry; |
17 | 16 | import net.blitzcube.peapi.api.entity.modifier.IModifiableEntity; |
18 | | -import net.blitzcube.peapi.api.event.IEntityPacketEvent; |
19 | 17 | import net.blitzcube.peapi.api.listener.IListener; |
20 | | -import net.blitzcube.peapi.api.packet.*; |
| 18 | +import net.blitzcube.peapi.api.packet.IEntityPacket; |
| 19 | +import net.blitzcube.peapi.api.packet.IEntityPacketFactory; |
21 | 20 | import net.blitzcube.peapi.entity.EntityIdentifier; |
22 | 21 | import net.blitzcube.peapi.entity.SightDistanceRegistry; |
23 | 22 | import net.blitzcube.peapi.entity.fake.FakeEntity; |
|
27 | 26 | import net.blitzcube.peapi.event.engine.PacketEventDispatcher; |
28 | 27 | import net.blitzcube.peapi.packet.EntityPacketFactory; |
29 | 28 | import org.bukkit.Bukkit; |
30 | | -import org.bukkit.Color; |
31 | 29 | import org.bukkit.Location; |
32 | 30 | import org.bukkit.entity.Entity; |
33 | 31 | import org.bukkit.entity.EntityType; |
@@ -102,41 +100,6 @@ public void onEnable() { |
102 | 100 | chainFactory = BukkitTaskChainFactory.create(this); |
103 | 101 |
|
104 | 102 | if (instance == null) instance = this; |
105 | | - |
106 | | - IEntityModifier<Color> potionColor = this.getModifierRegistry().lookup(EntityType.SHEEP, "POTION_COLOR", |
107 | | - Color.class); |
108 | | - |
109 | | - this.addListener(new IListener() { |
110 | | - @Override |
111 | | - public ListenerPriority getPriority() { |
112 | | - return ListenerPriority.NORMAL; |
113 | | - } |
114 | | - |
115 | | - @Override |
116 | | - public void onEvent(IEntityPacketEvent e) { |
117 | | - if (e.getPacketType() == IEntityPacketEvent.EntityPacketType.ADD_EFFECT) { |
118 | | - e.getPlayer().sendMessage("effect added: " + ((IEntityPotionAddPacket) e.getPacket()).getEffect() |
119 | | - .getType().getName()); |
120 | | - } else if (e.getPacketType() == IEntityPacketEvent.EntityPacketType.REMOVE_EFFECT) { |
121 | | - e.getPlayer().sendMessage("effect removed: " + ((IEntityPotionRemovePacket) e.getPacket()) |
122 | | - .getEffectType().getName()); |
123 | | - } else if (e.getPacketType() == IEntityPacketEvent.EntityPacketType.DATA) { |
124 | | - IModifiableEntity en = wrap(((IEntityDataPacket) e.getPacket()).getMetadata()); |
125 | | - e.getPlayer().sendMessage("specified: " + potionColor.specifies(en)); |
126 | | - Color c = potionColor.getValue(en); |
127 | | - if (c != null) |
128 | | - e.getPlayer().sendMessage("color: " + c.getRed() + ", " + c.getGreen() + ", " + c.getBlue()); |
129 | | - potionColor.setValue(en, Color.fromRGB(0, 255, 255)); |
130 | | - ((IEntityDataPacket) e.getPacket()).setMetadata(en.getWatchableObjects()); |
131 | | - } |
132 | | - } |
133 | | - |
134 | | - @Override |
135 | | - public EntityType[] getTargets() { |
136 | | - return EntityType.values(); |
137 | | - } |
138 | | - }); |
139 | | - |
140 | 103 | } |
141 | 104 |
|
142 | 105 | @Override |
|
0 commit comments