Skip to content

Commit

Permalink
Remove debug code I forgot to remove
Browse files Browse the repository at this point in the history
  • Loading branch information
iso2013 committed Jun 9, 2018
1 parent 229b768 commit edde72d
Showing 1 changed file with 2 additions and 39 deletions.
41 changes: 2 additions & 39 deletions Plugin/src/main/java/net/blitzcube/peapi/PacketEntityAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
import net.blitzcube.peapi.api.entity.IEntityIdentifier;
import net.blitzcube.peapi.api.entity.fake.IFakeEntity;
import net.blitzcube.peapi.api.entity.fake.IFakeEntityFactory;
import net.blitzcube.peapi.api.entity.modifier.IEntityModifier;
import net.blitzcube.peapi.api.entity.modifier.IEntityModifierRegistry;
import net.blitzcube.peapi.api.entity.modifier.IModifiableEntity;
import net.blitzcube.peapi.api.event.IEntityPacketEvent;
import net.blitzcube.peapi.api.listener.IListener;
import net.blitzcube.peapi.api.packet.*;
import net.blitzcube.peapi.api.packet.IEntityPacket;
import net.blitzcube.peapi.api.packet.IEntityPacketFactory;
import net.blitzcube.peapi.entity.EntityIdentifier;
import net.blitzcube.peapi.entity.SightDistanceRegistry;
import net.blitzcube.peapi.entity.fake.FakeEntity;
Expand All @@ -27,7 +26,6 @@
import net.blitzcube.peapi.event.engine.PacketEventDispatcher;
import net.blitzcube.peapi.packet.EntityPacketFactory;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
Expand Down Expand Up @@ -102,41 +100,6 @@ public void onEnable() {
chainFactory = BukkitTaskChainFactory.create(this);

if (instance == null) instance = this;

IEntityModifier<Color> potionColor = this.getModifierRegistry().lookup(EntityType.SHEEP, "POTION_COLOR",
Color.class);

this.addListener(new IListener() {
@Override
public ListenerPriority getPriority() {
return ListenerPriority.NORMAL;
}

@Override
public void onEvent(IEntityPacketEvent e) {
if (e.getPacketType() == IEntityPacketEvent.EntityPacketType.ADD_EFFECT) {
e.getPlayer().sendMessage("effect added: " + ((IEntityPotionAddPacket) e.getPacket()).getEffect()
.getType().getName());
} else if (e.getPacketType() == IEntityPacketEvent.EntityPacketType.REMOVE_EFFECT) {
e.getPlayer().sendMessage("effect removed: " + ((IEntityPotionRemovePacket) e.getPacket())
.getEffectType().getName());
} else if (e.getPacketType() == IEntityPacketEvent.EntityPacketType.DATA) {
IModifiableEntity en = wrap(((IEntityDataPacket) e.getPacket()).getMetadata());
e.getPlayer().sendMessage("specified: " + potionColor.specifies(en));
Color c = potionColor.getValue(en);
if (c != null)
e.getPlayer().sendMessage("color: " + c.getRed() + ", " + c.getGreen() + ", " + c.getBlue());
potionColor.setValue(en, Color.fromRGB(0, 255, 255));
((IEntityDataPacket) e.getPacket()).setMetadata(en.getWatchableObjects());
}
}

@Override
public EntityType[] getTargets() {
return EntityType.values();
}
});

}

@Override
Expand Down

0 comments on commit edde72d

Please sign in to comment.