Fixed hat clipping + sack bug + made farmer payment requests more human parsable
This commit is contained in:
@@ -6,15 +6,12 @@ import core.game.container.impl.EquipmentContainer;
|
||||
import core.game.node.entity.combat.equipment.WeaponInterface;
|
||||
import core.game.node.entity.impl.Animator.Priority;
|
||||
import core.game.node.entity.player.Player;
|
||||
|
||||
import core.game.node.item.Item;
|
||||
import rs09.game.system.config.ItemConfigParser;
|
||||
import core.game.world.update.flag.context.Animation;
|
||||
import core.game.world.update.flag.player.AppearanceFlag;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import rs09.game.system.config.ItemConfigParser;
|
||||
|
||||
/**
|
||||
* Represents an appearance managing class of a player.
|
||||
@@ -237,6 +234,10 @@ public final class Appearance {
|
||||
this.bodyParts[part] = 0;
|
||||
}
|
||||
|
||||
public void flagHatClipping() {
|
||||
this.bodyParts[8] = 0x100;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepares the data used for the appearance update mask.
|
||||
* @param player The player.
|
||||
@@ -302,7 +303,7 @@ public final class Appearance {
|
||||
drawClothes(7, getLegs().getLook());
|
||||
}
|
||||
if ((hat != null && hat.getDefinition().getConfiguration(ItemConfigParser.REMOVE_HEAD, false)) || castleWarsHood) {
|
||||
clearBodyPart(8);
|
||||
flagHatClipping();
|
||||
} else {
|
||||
drawClothes(8, getHair().getLook());
|
||||
}
|
||||
|
||||
+17
-2
@@ -9,6 +9,7 @@ import core.game.node.entity.player.Player
|
||||
import core.game.node.item.Item
|
||||
import core.plugin.Initializable
|
||||
import core.plugin.Plugin
|
||||
import org.rs09.consts.Items
|
||||
|
||||
@Initializable
|
||||
class FarmerPayOptionHandler : OptionHandler() {
|
||||
@@ -76,10 +77,24 @@ class FarmerPayOptionHandler : OptionHandler() {
|
||||
return true
|
||||
} else {
|
||||
item = patch?.plantable?.protectionItem
|
||||
val protectionText = when(item?.id){
|
||||
Items.COMPOST_6032 -> if(item?.amount == 1) "bucket of compost" else "buckets of compost"
|
||||
Items.POTATOES10_5438 -> if(item?.amount == 1) "sack of potatoes" else "sacks of potatoes"
|
||||
Items.ONIONS10_5458 -> if(item?.amount == 1) "sack of onions" else "sacks of onions"
|
||||
Items.CABBAGES10_5478 -> if(item?.amount == 1) "sack of cabbages" else "sacks of cabbages"
|
||||
Items.JUTE_FIBRE_5931 -> "jute fibres"
|
||||
Items.APPLES5_5386 -> if(item?.amount == 1) "basket of apples" else "baskets of apples"
|
||||
Items.MARIGOLDS_6010 -> "harvest of marigold"
|
||||
Items.TOMATOES5_5968 -> if(item?.amount == 1) "basket of tomatoes" else "baskets of tomatoes"
|
||||
Items.ORANGES5_5396 -> if(item?.amount == 1) "basket of oranges" else "baskets of oranges"
|
||||
Items.COCONUT_5974 -> "coconuts"
|
||||
Items.STRAWBERRIES5_5406 -> if(item?.amount == 1) "basket of strawberries" else "baskets of strawberries"
|
||||
Items.BANANAS5_5416 -> if(item?.amount == 1) "basket of bananas" else "baskets of bananas"
|
||||
else -> item?.name?.toLowerCase()
|
||||
}
|
||||
if(item == null) npc("Sorry, I won't protect that.").also { stage = 1000 }
|
||||
else{
|
||||
val name = item?.name?.toLowerCase()
|
||||
npc("I would like ${item?.amount} $name","to protect that patch.")
|
||||
npc("I would like ${item?.amount} $protectionText","to protect that patch.")
|
||||
stage = 0
|
||||
}
|
||||
}
|
||||
|
||||
+15
-5
@@ -114,13 +114,23 @@ class SackBasketOptionHandler : OptionHandler() {
|
||||
val container = BasketsAndSacks.forId(containerID)
|
||||
val produce = if(container == null){
|
||||
var selected = 0
|
||||
for(i in (fruit + produce)){
|
||||
if(player.inventory.contains(i,1)){
|
||||
selected = i
|
||||
break
|
||||
if(containerID == Items.EMPTY_SACK_5418) {
|
||||
for (i in (produce)) {
|
||||
if (player.inventory.contains(i, 1)) {
|
||||
selected = i
|
||||
break
|
||||
}
|
||||
}
|
||||
selected
|
||||
} else {
|
||||
for (i in (fruit)) {
|
||||
if (player.inventory.contains(i, 1)) {
|
||||
selected = i
|
||||
break
|
||||
}
|
||||
}
|
||||
selected
|
||||
}
|
||||
selected
|
||||
} else {
|
||||
container.produceID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user