grounditems: refactor isDropped into LootType
the isDropped boolean was essentially just a lootype all its own this allows the onlyShowLoot option to show your own dropped items overlay
This commit is contained in:
@@ -48,10 +48,6 @@ class GroundItem
|
|||||||
private boolean tradeable;
|
private boolean tradeable;
|
||||||
@Nonnull
|
@Nonnull
|
||||||
private LootType lootType;
|
private LootType lootType;
|
||||||
/**
|
|
||||||
* Is dropped by me
|
|
||||||
*/
|
|
||||||
private boolean isDropped;
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private Instant spawnTime;
|
private Instant spawnTime;
|
||||||
|
|
||||||
|
|||||||
@@ -364,7 +364,7 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
private void drawTimerOverlay(Graphics2D graphics, int textX, int textY, GroundItem groundItem)
|
private void drawTimerOverlay(Graphics2D graphics, int textX, int textY, GroundItem groundItem)
|
||||||
{
|
{
|
||||||
// We can only accurately guess despawn times for our own pvm loot and dropped items
|
// We can only accurately guess despawn times for our own pvm loot and dropped items
|
||||||
if (groundItem.getLootType() != LootType.PVM && !groundItem.isDropped())
|
if (groundItem.getLootType() != LootType.PVM && groundItem.getLootType() != LootType.DROPPED)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -395,7 +395,7 @@ public class GroundItemsOverlay extends Overlay
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (groundItem.isDropped())
|
if (groundItem.getLootType() == LootType.DROPPED)
|
||||||
{
|
{
|
||||||
despawnTime = spawnTime.plus(DESPAWN_TIME_DROP);
|
despawnTime = spawnTime.plus(DESPAWN_TIME_DROP);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -393,8 +393,7 @@ public class GroundItemsPlugin extends Plugin
|
|||||||
.haPrice(alchPrice)
|
.haPrice(alchPrice)
|
||||||
.height(tile.getItemLayer().getHeight())
|
.height(tile.getItemLayer().getHeight())
|
||||||
.tradeable(itemComposition.isTradeable())
|
.tradeable(itemComposition.isTradeable())
|
||||||
.lootType(LootType.UNKNOWN)
|
.lootType(dropped ? LootType.DROPPED : LootType.UNKNOWN)
|
||||||
.isDropped(dropped)
|
|
||||||
.spawnTime(Instant.now())
|
.spawnTime(Instant.now())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ package net.runelite.client.plugins.grounditems;
|
|||||||
enum LootType
|
enum LootType
|
||||||
{
|
{
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
|
DROPPED,
|
||||||
PVP,
|
PVP,
|
||||||
PVM;
|
PVM;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user