Merge pull request #2385 from Adam-/puro-puro
impling plugin: use spawn events
This commit is contained in:
@@ -0,0 +1,87 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, Adam <Adam@sigterm.info>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.client.plugins.implings;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import net.runelite.api.NpcID;
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Getter
|
||||||
|
enum Impling
|
||||||
|
{
|
||||||
|
BABY(ImplingType.BABY, NpcID.BABY_IMPLING),
|
||||||
|
BABY_2(ImplingType.BABY, NpcID.BABY_IMPLING_1645),
|
||||||
|
|
||||||
|
YOUNG(ImplingType.YOUNG, NpcID.YOUNG_IMPLING),
|
||||||
|
YOUNG_2(ImplingType.YOUNG, NpcID.YOUNG_IMPLING_1646),
|
||||||
|
|
||||||
|
GOURMET(ImplingType.GOURMET, NpcID.GOURMET_IMPLING),
|
||||||
|
GOURMET_2(ImplingType.GOURMET, NpcID.GOURMET_IMPLING_1647),
|
||||||
|
|
||||||
|
EARTH(ImplingType.EARTH, NpcID.EARTH_IMPLING),
|
||||||
|
EARTH_2(ImplingType.EARTH, NpcID.EARTH_IMPLING_1648),
|
||||||
|
|
||||||
|
ESSENCE(ImplingType.ESSENCE, NpcID.ESSENCE_IMPLING),
|
||||||
|
ESSENCE_2(ImplingType.ESSENCE, NpcID.ESSENCE_IMPLING_1649),
|
||||||
|
|
||||||
|
ECLECTIC(ImplingType.ECLECTIC, NpcID.ECLECTIC_IMPLING),
|
||||||
|
ECLECTIC_2(ImplingType.ECLECTIC, NpcID.ECLECTIC_IMPLING_1650),
|
||||||
|
|
||||||
|
NATURE(ImplingType.NATURE, NpcID.NATURE_IMPLING),
|
||||||
|
NATURE_2(ImplingType.NATURE, NpcID.NATURE_IMPLING_1651),
|
||||||
|
|
||||||
|
MAGPIE(ImplingType.MAGPIE, NpcID.MAGPIE_IMPLING),
|
||||||
|
MAGPIE_2(ImplingType.MAGPIE, NpcID.MAGPIE_IMPLING_1652),
|
||||||
|
|
||||||
|
NINJA(ImplingType.NINJA, NpcID.NINJA_IMPLING),
|
||||||
|
NINJA_2(ImplingType.NINJA, NpcID.NINJA_IMPLING_1653),
|
||||||
|
|
||||||
|
DRAGON(ImplingType.DRAGON, NpcID.DRAGON_IMPLING),
|
||||||
|
DRAGON_2(ImplingType.DRAGON, NpcID.DRAGON_IMPLING_1654),
|
||||||
|
|
||||||
|
LUCKY(ImplingType.LUCKY, NpcID.LUCKY_IMPLING),
|
||||||
|
LUCKY_2(ImplingType.LUCKY, NpcID.LUCKY_IMPLING_7302);
|
||||||
|
|
||||||
|
private ImplingType implingType;
|
||||||
|
private final int npcId;
|
||||||
|
|
||||||
|
private static final Map<Integer, Impling> IMPLINGS = new HashMap<>();
|
||||||
|
|
||||||
|
static
|
||||||
|
{
|
||||||
|
for (Impling impling : values())
|
||||||
|
{
|
||||||
|
IMPLINGS.put(impling.npcId, impling);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Impling findImpling(int npcId)
|
||||||
|
{
|
||||||
|
return IMPLINGS.get(npcId);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.implings;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
|
import java.util.List;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.Point;
|
import net.runelite.api.Point;
|
||||||
@@ -52,8 +53,8 @@ public class ImplingMinimapOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
NPC[] imps = plugin.getImplings();
|
List<NPC> imps = plugin.getImplings();
|
||||||
if (imps == null)
|
if (imps.isEmpty())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -61,16 +62,18 @@ public class ImplingMinimapOverlay extends Overlay
|
|||||||
for (NPC imp : imps)
|
for (NPC imp : imps)
|
||||||
{
|
{
|
||||||
Point impLocation = imp.getMinimapLocation();
|
Point impLocation = imp.getMinimapLocation();
|
||||||
if (impLocation != null)
|
Color color = plugin.npcToColor(imp);
|
||||||
|
if (!plugin.showNpc(imp) || impLocation == null || color == null)
|
||||||
{
|
{
|
||||||
Color color = plugin.getIds().get(imp.getId());
|
continue;
|
||||||
OverlayUtil.renderMinimapLocation(graphics, impLocation, color);
|
}
|
||||||
|
|
||||||
if (config.showName())
|
OverlayUtil.renderMinimapLocation(graphics, impLocation, color);
|
||||||
{
|
|
||||||
Point textLocation = new Point(impLocation.getX() + 1, impLocation.getY());
|
if (config.showName())
|
||||||
OverlayUtil.renderTextLocation(graphics, textLocation, imp.getName(), color);
|
{
|
||||||
}
|
Point textLocation = new Point(impLocation.getX() + 1, impLocation.getY());
|
||||||
|
OverlayUtil.renderTextLocation(graphics, textLocation, imp.getName(), color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, Adam <Adam@sigterm.info>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package net.runelite.client.plugins.implings;
|
||||||
|
|
||||||
|
enum ImplingType
|
||||||
|
{
|
||||||
|
BABY,
|
||||||
|
YOUNG,
|
||||||
|
GOURMET,
|
||||||
|
EARTH,
|
||||||
|
ESSENCE,
|
||||||
|
ECLECTIC,
|
||||||
|
NATURE,
|
||||||
|
MAGPIE,
|
||||||
|
NINJA,
|
||||||
|
DRAGON,
|
||||||
|
LUCKY
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ import java.awt.Color;
|
|||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Polygon;
|
import java.awt.Polygon;
|
||||||
|
import java.util.List;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import net.runelite.api.Actor;
|
import net.runelite.api.Actor;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
@@ -38,7 +39,6 @@ import net.runelite.client.ui.overlay.OverlayPosition;
|
|||||||
import net.runelite.client.ui.overlay.OverlayUtil;
|
import net.runelite.client.ui.overlay.OverlayUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author robin
|
* @author robin
|
||||||
*/
|
*/
|
||||||
public class ImplingsOverlay extends Overlay
|
public class ImplingsOverlay extends Overlay
|
||||||
@@ -56,22 +56,22 @@ public class ImplingsOverlay extends Overlay
|
|||||||
@Override
|
@Override
|
||||||
public Dimension render(Graphics2D graphics)
|
public Dimension render(Graphics2D graphics)
|
||||||
{
|
{
|
||||||
NPC[] imps = plugin.getImplings();
|
List<NPC> implings = plugin.getImplings();
|
||||||
if (imps == null)
|
|
||||||
|
if (implings.isEmpty())
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (NPC imp : imps)
|
for (NPC imp : implings)
|
||||||
{
|
{
|
||||||
if (imp == null || imp.getName() == null)
|
Color color = plugin.npcToColor(imp);
|
||||||
|
if (!plugin.showNpc(imp) || color == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Spawns have the name "null", so they get changed to "Spawn"
|
drawImp(graphics, imp, imp.getName(), color);
|
||||||
String text = imp.getName().equals("null") ? "Spawn" : imp.getName();
|
|
||||||
drawImp(graphics, imp, text, plugin.getIds().get(imp.getId()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -1,45 +1,42 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017, Robin <robin.weymans@gmail.com>
|
* Copyright (c) 2017, Robin <robin.weymans@gmail.com>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright notice, this
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
||||||
* list of conditions and the following disclaimer.
|
* list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
* this list of conditions and the following disclaimer in the documentation
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
* and/or other materials provided with the distribution.
|
* and/or other materials provided with the distribution.
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.implings;
|
package net.runelite.client.plugins.implings;
|
||||||
|
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
import com.google.common.primitives.Ints;
|
|
||||||
import com.google.inject.Provides;
|
import com.google.inject.Provides;
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashMap;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import net.runelite.api.NPC;
|
import net.runelite.api.NPC;
|
||||||
import net.runelite.api.NpcID;
|
import net.runelite.api.events.NpcDespawned;
|
||||||
import net.runelite.api.events.ConfigChanged;
|
import net.runelite.api.events.NpcSpawned;
|
||||||
import net.runelite.api.events.GameTick;
|
|
||||||
import net.runelite.api.queries.NPCQuery;
|
|
||||||
import net.runelite.client.config.ConfigManager;
|
import net.runelite.client.config.ConfigManager;
|
||||||
import net.runelite.client.plugins.Plugin;
|
import net.runelite.client.plugins.Plugin;
|
||||||
import net.runelite.client.plugins.PluginDescriptor;
|
import net.runelite.client.plugins.PluginDescriptor;
|
||||||
@@ -47,7 +44,6 @@ import net.runelite.client.ui.overlay.Overlay;
|
|||||||
import net.runelite.client.util.QueryRunner;
|
import net.runelite.client.util.QueryRunner;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author robin
|
* @author robin
|
||||||
*/
|
*/
|
||||||
@PluginDescriptor(
|
@PluginDescriptor(
|
||||||
@@ -55,15 +51,8 @@ import net.runelite.client.util.QueryRunner;
|
|||||||
)
|
)
|
||||||
public class ImplingsPlugin extends Plugin
|
public class ImplingsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
// Impling spawns in PuroPuro. Not in NpcID.
|
|
||||||
private static final int STATIC_SPAWN = 1618;
|
|
||||||
private static final int DYNAMIC_SPAWN = 1633;
|
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
@Getter(AccessLevel.PACKAGE)
|
||||||
private NPC[] implings;
|
private final List<NPC> implings = new ArrayList<>();
|
||||||
|
|
||||||
@Getter(AccessLevel.PACKAGE)
|
|
||||||
private final Map<Integer, Color> ids = new HashMap<>();
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ImplingsOverlay overlay;
|
private ImplingsOverlay overlay;
|
||||||
@@ -83,13 +72,6 @@ public class ImplingsPlugin extends Plugin
|
|||||||
return configManager.getConfig(ImplingsConfig.class);
|
return configManager.getConfig(ImplingsConfig.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void startUp() throws Exception
|
|
||||||
{
|
|
||||||
// Initialize overlay config
|
|
||||||
updateConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Collection<Overlay> getOverlays()
|
public Collection<Overlay> getOverlays()
|
||||||
{
|
{
|
||||||
@@ -97,82 +79,101 @@ public class ImplingsPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void updateConfig(ConfigChanged event)
|
public void onNpcSpawned(NpcSpawned npcSpawned)
|
||||||
{
|
{
|
||||||
updateConfig();
|
NPC npc = npcSpawned.getNpc();
|
||||||
|
Impling impling = Impling.findImpling(npc.getId());
|
||||||
|
|
||||||
|
if (impling != null)
|
||||||
|
{
|
||||||
|
implings.add(npc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void onGameTick(GameTick event)
|
public void onNpcDespawned(NpcDespawned npcDespawned)
|
||||||
{
|
{
|
||||||
NPCQuery implingQuery = new NPCQuery()
|
if (implings.isEmpty())
|
||||||
.idEquals(Ints.toArray(ids.keySet()));
|
{
|
||||||
implings = queryRunner.runQuery(implingQuery);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
NPC npc = npcDespawned.getNpc();
|
||||||
|
implings.remove(npc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateConfig()
|
boolean showNpc(NPC npc)
|
||||||
{
|
{
|
||||||
ids.clear();
|
Impling impling = Impling.findImpling(npc.getId());
|
||||||
if (config.showBaby())
|
if (impling == null)
|
||||||
{
|
{
|
||||||
ids.put(NpcID.BABY_IMPLING, config.getBabyColor());
|
return false;
|
||||||
ids.put(NpcID.BABY_IMPLING_1645, config.getBabyColor());
|
|
||||||
}
|
}
|
||||||
if (config.showYoung())
|
|
||||||
|
switch (impling.getImplingType())
|
||||||
{
|
{
|
||||||
ids.put(NpcID.YOUNG_IMPLING, config.getYoungColor());
|
case BABY:
|
||||||
ids.put(NpcID.YOUNG_IMPLING_1646, config.getYoungColor());
|
return config.showBaby();
|
||||||
}
|
case YOUNG:
|
||||||
if (config.showGourmet())
|
return config.showYoung();
|
||||||
{
|
case GOURMET:
|
||||||
ids.put(NpcID.GOURMET_IMPLING, config.getGourmetColor());
|
return config.showGourmet();
|
||||||
ids.put(NpcID.GOURMET_IMPLING_1647, config.getGourmetColor());
|
case EARTH:
|
||||||
}
|
return config.showEarth();
|
||||||
if (config.showEarth())
|
case ESSENCE:
|
||||||
{
|
return config.showEssence();
|
||||||
ids.put(NpcID.EARTH_IMPLING, config.getEarthColor());
|
case ECLECTIC:
|
||||||
ids.put(NpcID.EARTH_IMPLING_1648, config.getEarthColor());
|
return config.showEclectic();
|
||||||
}
|
case NATURE:
|
||||||
if (config.showEssence())
|
return config.showNature();
|
||||||
{
|
case MAGPIE:
|
||||||
ids.put(NpcID.ESSENCE_IMPLING, config.getEssenceColor());
|
return config.showMagpie();
|
||||||
ids.put(NpcID.ESSENCE_IMPLING_1649, config.getEssenceColor());
|
case NINJA:
|
||||||
}
|
return config.showNinja();
|
||||||
if (config.showEclectic())
|
case DRAGON:
|
||||||
{
|
return config.showDragon();
|
||||||
ids.put(NpcID.ECLECTIC_IMPLING, config.getEclecticColor());
|
case LUCKY:
|
||||||
ids.put(NpcID.ECLECTIC_IMPLING_1650, config.getEclecticColor());
|
return config.showLucky();
|
||||||
}
|
default:
|
||||||
if (config.showNature())
|
return false;
|
||||||
{
|
|
||||||
ids.put(NpcID.NATURE_IMPLING, config.getNatureColor());
|
|
||||||
ids.put(NpcID.NATURE_IMPLING_1651, config.getNatureColor());
|
|
||||||
}
|
|
||||||
if (config.showMagpie())
|
|
||||||
{
|
|
||||||
ids.put(NpcID.MAGPIE_IMPLING, config.getMagpieColor());
|
|
||||||
ids.put(NpcID.MAGPIE_IMPLING_1652, config.getMagpieColor());
|
|
||||||
}
|
|
||||||
if (config.showNinja())
|
|
||||||
{
|
|
||||||
ids.put(NpcID.NINJA_IMPLING, config.getNinjaColor());
|
|
||||||
ids.put(NpcID.NINJA_IMPLING_1653, config.getNinjaColor());
|
|
||||||
}
|
|
||||||
if (config.showDragon())
|
|
||||||
{
|
|
||||||
ids.put(NpcID.DRAGON_IMPLING, config.getDragonColor());
|
|
||||||
ids.put(NpcID.DRAGON_IMPLING_1654, config.getDragonColor());
|
|
||||||
}
|
|
||||||
if (config.showLucky())
|
|
||||||
{
|
|
||||||
ids.put(NpcID.LUCKY_IMPLING, config.getLuckyColor());
|
|
||||||
ids.put(NpcID.LUCKY_IMPLING_7302, config.getLuckyColor());
|
|
||||||
}
|
|
||||||
if (config.showSpawn())
|
|
||||||
{
|
|
||||||
ids.put(STATIC_SPAWN, config.getSpawnColor());
|
|
||||||
ids.put(DYNAMIC_SPAWN, config.getSpawnColor());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Color npcToColor(NPC npc)
|
||||||
|
{
|
||||||
|
Impling impling = Impling.findImpling(npc.getId());
|
||||||
|
if (impling == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (impling.getImplingType())
|
||||||
|
{
|
||||||
|
|
||||||
|
case BABY:
|
||||||
|
return config.getBabyColor();
|
||||||
|
case YOUNG:
|
||||||
|
return config.getYoungColor();
|
||||||
|
case GOURMET:
|
||||||
|
return config.getGourmetColor();
|
||||||
|
case EARTH:
|
||||||
|
return config.getEarthColor();
|
||||||
|
case ESSENCE:
|
||||||
|
return config.getEssenceColor();
|
||||||
|
case ECLECTIC:
|
||||||
|
return config.getEclecticColor();
|
||||||
|
case NATURE:
|
||||||
|
return config.getNatureColor();
|
||||||
|
case MAGPIE:
|
||||||
|
return config.getMagpieColor();
|
||||||
|
case NINJA:
|
||||||
|
return config.getNinjaColor();
|
||||||
|
case DRAGON:
|
||||||
|
return config.getDragonColor();
|
||||||
|
case LUCKY:
|
||||||
|
return config.getLuckyColor();
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user