mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-24 11:55:13 -06:00
minimize change to soft clay
This commit is contained in:
parent
ec41a9b564
commit
7bd8a8b3e9
1 changed files with 50 additions and 50 deletions
|
|
@ -21,47 +21,47 @@ import java.util.Objects;
|
|||
@Initializable
|
||||
public final class SoftclayPlugin extends UseWithHandler {
|
||||
|
||||
/**
|
||||
* Represents the clay item.
|
||||
*/
|
||||
private static final Item CLAY = new Item(Items.CLAY_434);
|
||||
/**
|
||||
* Represents the clay item.
|
||||
*/
|
||||
private static final Item CLAY = new Item(Items.CLAY_434);
|
||||
|
||||
/**
|
||||
* Represents the soft clay item.
|
||||
*/
|
||||
private static final Item SOFT_CLAY = new Item(Items.SOFT_CLAY_1761);
|
||||
/**
|
||||
* Represents the soft clay item.
|
||||
*/
|
||||
private static final Item SOFT_CLAY = new Item(Items.SOFT_CLAY_1761);
|
||||
|
||||
/**
|
||||
* Represents the bowl of water item.
|
||||
*/
|
||||
private static final Item BOWL_OF_WATER = new Item(Items.BOWL_OF_WATER_1921);
|
||||
/**
|
||||
* Represents the bowl of water item.
|
||||
*/
|
||||
private static final Item BOWL_OF_WATER = new Item(Items.BOWL_OF_WATER_1921);
|
||||
|
||||
/**
|
||||
* Represents the empty bowl item.
|
||||
*/
|
||||
private static final Item BOWL = new Item(Items.BOWL_1923);
|
||||
/**
|
||||
* Represents the empty bowl item.
|
||||
*/
|
||||
private static final Item BOWL = new Item(Items.BOWL_1923);
|
||||
|
||||
/**
|
||||
* Represents the empty bucket item.
|
||||
*/
|
||||
private static final Item BUCKET = new Item(Items.BUCKET_1925);
|
||||
/**
|
||||
* Represents the empty bucket item.
|
||||
*/
|
||||
private static final Item BUCKET = new Item(Items.BUCKET_1925);
|
||||
|
||||
/**
|
||||
* Represents the bucket of water item.
|
||||
*/
|
||||
private static final Item BUCKET_OF_WATER = new Item(Items.BUCKET_OF_WATER_1929);
|
||||
|
||||
/**
|
||||
* Represents the jug item.
|
||||
*/
|
||||
private static final Item JUG = new Item(Items.JUG_1935);
|
||||
/**
|
||||
* Represents the jug item.
|
||||
*/
|
||||
private static final Item JUG = new Item(Items.JUG_1935);
|
||||
|
||||
/**
|
||||
* Represents the jug of water item.
|
||||
*/
|
||||
private static final Item JUG_OF_WATER = new Item(Items.JUG_OF_WATER_1937);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Constructs a new {@code SoftclayPlugin} {@code Object}.
|
||||
*/
|
||||
public SoftclayPlugin() {
|
||||
|
|
@ -70,7 +70,7 @@ public final class SoftclayPlugin extends UseWithHandler {
|
|||
|
||||
@Override
|
||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||
addHandler(1921, ITEM_TYPE, this);
|
||||
addHandler(1921, ITEM_TYPE, this);
|
||||
addHandler(1929, ITEM_TYPE, this);
|
||||
addHandler(1937, ITEM_TYPE, this);
|
||||
return this;
|
||||
|
|
@ -115,33 +115,33 @@ public final class SoftclayPlugin extends UseWithHandler {
|
|||
* @return {@code True} if so.
|
||||
*/
|
||||
private boolean create(final Player player, NodeUsageEvent event) {
|
||||
Item removeItem = null;
|
||||
Item returnItem = null;
|
||||
if (event.getUsedItem().getId() == Items.BUCKET_OF_WATER_1929 || event.getBaseItem().getId() == Items.BUCKET_OF_WATER_1929) {
|
||||
removeItem = BUCKET_OF_WATER;
|
||||
returnItem = BUCKET;
|
||||
}
|
||||
if (event.getUsedItem().getId() == Items.BOWL_OF_WATER_1921 || event.getBaseItem().getId() == Items.BOWL_OF_WATER_1921) {
|
||||
removeItem = BOWL_OF_WATER;
|
||||
returnItem = BOWL;
|
||||
}
|
||||
if (event.getUsedItem().getId() == Items.JUG_OF_WATER_1937 || event.getBaseItem().getId() == Items.JUG_OF_WATER_1937) {
|
||||
removeItem = JUG_OF_WATER;
|
||||
returnItem = JUG;
|
||||
}
|
||||
Item removeItem = null;
|
||||
Item returnItem = null;
|
||||
if (event.getUsedItem().getId() == Items.BUCKET_OF_WATER_1929 || event.getBaseItem().getId() == Items.BUCKET_OF_WATER_1929) {
|
||||
removeItem = BUCKET_OF_WATER;
|
||||
returnItem = BUCKET;
|
||||
}
|
||||
if (event.getUsedItem().getId() == Items.BOWL_OF_WATER_1921 || event.getBaseItem().getId() == Items.BOWL_OF_WATER_1921) {
|
||||
removeItem = BOWL_OF_WATER;
|
||||
returnItem = BOWL;
|
||||
}
|
||||
if (event.getUsedItem().getId() == Items.JUG_OF_WATER_1937 || event.getBaseItem().getId() == Items.JUG_OF_WATER_1937) {
|
||||
removeItem = JUG_OF_WATER;
|
||||
returnItem = JUG;
|
||||
}
|
||||
|
||||
if (player.getInventory().containsItem(CLAY) && player.getInventory().containsItem(Objects.requireNonNull(removeItem))) {
|
||||
player.getInventory().remove(removeItem);
|
||||
player.getInventory().remove(CLAY);
|
||||
player.getPacketDispatch().sendMessage("You mix the clay and water. You now have some soft, workable clay.");
|
||||
player.getInventory().add(SOFT_CLAY);
|
||||
player.getInventory().add(returnItem);
|
||||
if (!player.getAchievementDiaryManager().hasCompletedTask(DiaryType.LUMBRIDGE, 0, 6) && player.getLocation().getRegionId() == 12341) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 0, 6);
|
||||
}
|
||||
player.getInventory().remove(removeItem);
|
||||
player.getInventory().remove(CLAY);
|
||||
player.getPacketDispatch().sendMessage("You mix the clay and water. You now have some soft, workable clay.");
|
||||
player.getInventory().add(SOFT_CLAY);
|
||||
player.getInventory().add(returnItem);
|
||||
if (!player.getAchievementDiaryManager().hasCompletedTask(DiaryType.LUMBRIDGE, 0, 6) && player.getLocation().getRegionId() == 12341) {
|
||||
player.getAchievementDiaryManager().finishTask(player, DiaryType.LUMBRIDGE, 0, 6);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue