Added various new messages for the different shop object editor options.

Other changes:
* Changed a few button messages for consistency.
* Changed the default value for the setting
enable-chest-option-on-player-shop to 'true'.
master
blablubbabc 2019-05-28 21:12:11 +02:00
parent 2a52a612ad
commit 9ea37268bc
26 changed files with 372 additions and 86 deletions

View File

@ -30,7 +30,6 @@ Other changes:
* Changed: When spawning of villagers or wandering traders is disabled, villagers and wandering traders spawned by other plugins, spawn eggs, mob spawners or due to curing zombie villagers are still allowed to spawn now.
* Added a separate setting 'disable-zombie-villager-curing' (default: false) that can be used to prevent curing of zombie villagers.
* Made shop and object type matching more strict. This uses a fixed list of internal aliases now.
* Enabled various mobs by default now, which previously had some issues but seem to work fine now: Horse, mule, donkey, skeleton horse, zombie horse, llama.
* Removed the generic 'sub type' editor option in favor of letting each shop object supply a list of editor options. This allows living shopkeepers to provide multiple editor options now.
* API: Removed getSubTypeItem, cycleSubType and equipItem from ShopObject. Editor options are internal API for now, and mob equipment hasn't properly worked already before due to not getting persisted.
* Added new mob attribute editor options:
@ -59,8 +58,72 @@ Internal:
* Removed special handling of item damage tags from item comparison. Spigot has made some changes that should make this obsolete.
* Moved common de/serialization and validation code of shop object properties into new Property classes.
Config changes (if you are updating, you have to manually apply those changes):
* Enabled various mobs by default now, which previously had some issues but seem to work fine now: Horse, mule, donkey, skeleton horse, zombie horse, llama.
* Changed the default value for the setting enable-chest-option-on-player-shop to 'true'.
New messages:
* msg-zombie-villager-curing-disabled
* msg-button-sign-variant
* msg-button-sign-variant-lore
* msg-button-baby
* msg-button-baby-lore
* msg-button-sitting
* msg-button-sitting-lore
* msg-button-cat-variant
* msg-button-cat-variant-lore
* msg-button-collar-color
* msg-button-collar-color-lore
* msg-button-wolf-angry
* msg-button-wolf-angry-lore
* msg-button-carrying-chest
* msg-button-carrying-chest-lore
* msg-button-horse-color
* msg-button-horse-color-lore
* msg-button-horse-style
* msg-button-horse-style-lore
* msg-button-horse-armor
* msg-button-horse-armor-lore
* msg-button-llama-variant
* msg-button-llama-variant-lore
* msg-button-llama-carpet-color
* msg-button-llama-carpet-color-lore
* msg-button-creeper-charged
* msg-button-creeper-charged-lore
* msg-button-fox-variant
* msg-button-fox-variant-lore
* msg-button-fox-crouching
* msg-button-fox-crouching-lore
* msg-button-fox-sleeping
* msg-button-fox-sleeping-lore
* msg-button-mushroom-cow-variant
* msg-button-mushroom-cow-variant-lore
* msg-button-panda-variant
* msg-button-panda-variant-lore
* msg-button-parrot-variant
* msg-button-parrot-variant-lore
* msg-button-pig-saddle
* msg-button-pig-saddle-lore
* msg-button-sheep-color
* msg-button-sheep-color-lore
* msg-button-sheep-sheared
* msg-button-sheep-sheared-lore
* msg-button-villager-profession
* msg-button-villager-profession-lore
* msg-button-villager-variant
* msg-button-villager-variant-lore
* msg-button-villager-level
* msg-button-villager-level-lore
* msg-button-zombie-villager-profession
* msg-button-zombie-villager-profession-lore
Removed messages:
* msg-button-type
* msg-button-type-lore
Changed messages (if you are updating, you have to manually apply those changes):
* msg-button-name (lower case words)
* msg-button-chest (lower case words)
## v2.6.0 (2019-03-04)
### Supported MC versions: 1.13.2

View File

@ -41,9 +41,11 @@ Low priority:
* Tropical fish: color, pattern, pattern color
* Vex: charged state?
* Add individual config options for the different editor options?
* Allow switching between editor options back and forth via left and right clicking
* Sign shopkeepers temporarily load the chunk on plugin reloads
# 1.14:
* Settings to handle wandering trader differently to regular villagers? (spawn blocking, hiring, trade blocking)
* Allow changing the sign text color?
* Set villager trades and test if they display trade-able items when the player holds corresponding items

View File

@ -167,7 +167,7 @@ public class Settings {
public static Material nameItem = Material.NAME_TAG;
public static List<String> nameItemLore = new ArrayList<>(0);
public static boolean enableChestOptionOnPlayerShop = false;
public static boolean enableChestOptionOnPlayerShop = true;
public static Material chestItem = Material.CHEST;
public static Material deleteItem = Material.BONE;
@ -265,17 +265,68 @@ public class Settings {
public static String msgButtonCurrentPage = "&6Page {page} of {max_page}";
public static List<String> msgButtonCurrentPageLore = Arrays.asList();
public static String msgButtonName = "&aSet Shop Name";
public static String msgButtonName = "&aSet shop name";
public static List<String> msgButtonNameLore = Arrays.asList("Lets you rename", "your shopkeeper");
public static String msgButtonChest = "&aView Chest Inventory";
public static String msgButtonChest = "&aView chest inventory";
public static List<String> msgButtonChestLore = Arrays.asList("Lets you view the inventory", " your shopkeeper is using");
public static String msgButtonType = "&aChoose Appearance";
public static List<String> msgButtonTypeLore = Arrays.asList("Changes the look", "of your shopkeeper");
public static String msgButtonDelete = "&4Delete";
public static List<String> msgButtonDeleteLore = Arrays.asList("Closes and removes", "this shopkeeper");
public static String msgButtonHire = "&aHire";
public static List<String> msgButtonHireLore = Arrays.asList("Buy this shop");
public static String msgButtonSignVariant = "&aChoose sign variant";
public static List<String> msgButtonSignVariantLore = Arrays.asList("Changes the sign's", "wood type");
public static String msgButtonBaby = "&aToggle baby variant";
public static List<String> msgButtonBabyLore = Arrays.asList("Toggles between the mob's", "baby and adult variant");
public static String msgButtonSitting = "&aToggle sitting pose";
public static List<String> msgButtonSittingLore = Arrays.asList("Toggles the mob's", "sitting pose");
public static String msgButtonCatVariant = "&aChoose cat variant";
public static List<String> msgButtonCatVariantLore = Arrays.asList("Changes the cat's look");
public static String msgButtonCollarColor = "&aChoose collar color";
public static List<String> msgButtonCollarColorLore = Arrays.asList("Changes the mob's", "collar color");
public static String msgButtonWolfAngry = "&aToggle angry wolf";
public static List<String> msgButtonWolfAngryLore = Arrays.asList("Toggles the wolf's", "angry state");
public static String msgButtonCarryingChest = "&aToggle carrying chest";
public static List<String> msgButtonCarryingChestLore = Arrays.asList("Toggles whether the mob", "is carrying a chest");
public static String msgButtonHorseColor = "&aChoose horse color";
public static List<String> msgButtonHorseColorLore = Arrays.asList("Changes the color", "of the horse");
public static String msgButtonHorseStyle = "&aChoose horse style";
public static List<String> msgButtonHorseStyleLore = Arrays.asList("Changes the coat pattern", "of the horse");
public static String msgButtonHorseArmor = "&aChoose horse armor";
public static List<String> msgButtonHorseArmorLore = Arrays.asList("Changes the armor", "of the horse");
public static String msgButtonLlamaVariant = "&aChoose llama variant";
public static List<String> msgButtonLlamaVariantLore = Arrays.asList("Changes the llama's look");
public static String msgButtonLlamaCarpetColor = "&aLlama carpet color";
public static List<String> msgButtonLlamaCarpetColorLore = Arrays.asList("Changes the llama's", "carpet color");
public static String msgButtonCreeperCharged = "&aToggle charged creeper";
public static List<String> msgButtonCreeperChargedLore = Arrays.asList("Toggles the creeper's", "charged state");
public static String msgButtonFoxVariant = "&aChoose fox variant";
public static List<String> msgButtonFoxVariantLore = Arrays.asList("Changes the fox's look");
public static String msgButtonFoxCrouching = "&aToggle crouching pose";
public static List<String> msgButtonFoxCrouchingLore = Arrays.asList("Toggles the fox's", "crouching pose");
public static String msgButtonFoxSleeping = "&aToggle sleeping pose";
public static List<String> msgButtonFoxSleepingLore = Arrays.asList("Toggles the fox's", "sleeping pose");
public static String msgButtonMooshroomVariant = "&aChoose mooshroom variant";
public static List<String> msgButtonMooshroomVariantLore = Arrays.asList("Changes the look", "of the mooshroom");
public static String msgButtonPandaVariant = "&aChoose panda variant";
public static List<String> msgButtonPandaVariantLore = Arrays.asList("Changes the panda's look");
public static String msgButtonParrotVariant = "&aChoose parrot variant";
public static List<String> msgButtonParrotVariantLore = Arrays.asList("Changes the parrot's look");
public static String msgButtonPigSaddle = "&aToggle pig saddle";
public static List<String> msgButtonPigSaddleLore = Arrays.asList("Toggles the pig's saddle");
public static String msgButtonSheepColor = "&aChoose sheep color";
public static List<String> msgButtonSheepColorLore = Arrays.asList("Changes the sheep's", "wool color");
public static String msgButtonSheepSheared = "&aToggle sheared sheep";
public static List<String> msgButtonSheepShearedLore = Arrays.asList("Toggles the sheep's", "sheared state");
public static String msgButtonVillagerProfession = "&aChoose villager profession";
public static List<String> msgButtonVillagerProfessionLore = Arrays.asList("Changes the profession", "of the villager");
public static String msgButtonVillagerVariant = "&aChoose villager variant";
public static List<String> msgButtonVillagerVariantLore = Arrays.asList("Changes the look", "of the villager");
public static String msgButtonVillagerLevel = "&aChoose villager level";
public static List<String> msgButtonVillagerLevelLore = Arrays.asList("Changes the level", "of the villager");
public static String msgButtonZombieVillagerProfession = "&aChoose villager profession";
public static List<String> msgButtonZombieVillagerProfessionLore = Arrays.asList("Changes the profession", "of the zombie villager");
public static String msgTradingTitlePrefix = "&2";
public static String msgTradingTitleDefault = "Shopkeeper";

View File

@ -155,7 +155,7 @@ public class SKLivingShopObject<E extends LivingEntity> extends AbstractEntitySh
// clear equipment:
EntityEquipment equipment = entity.getEquipment();
equipment.clear();
equipment.clear(); // TODO Does not work for foxes yet
// remove potion effects:
for (PotionEffect potionEffect : entity.getActivePotionEffects()) {

View File

@ -116,7 +116,7 @@ public class SKLivingShopObjectTypes implements LivingShopObjectTypes {
* <li> RAVAGER: okay
* <li> TRADER_LLAMA: okay
* <li> WANDERING_VILLAGER: okay
* <li> FOX: okay
* <li> FOX: okay, randomly spawns with an item in its mouth (clearing its equipment doesn't work, yet)
* </ul>
*/

View File

@ -100,8 +100,7 @@ public class BabyableShop<E extends Ageable> extends SKLivingShopObject<E> {
private ItemStack getBabyEditorItem() {
ItemStack iconItem = new ItemStack(Material.EGG);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonBaby, Settings.msgButtonBabyLore);
return iconItem;
}

View File

@ -148,10 +148,7 @@ public class CatShop extends SittableShop<Cat> {
ItemUtils.setLeatherColor(iconItem, Color.PURPLE);
break;
}
// TODO use more specific text
// String catTypeName = StringUtils.capitalizeAll(catType.name().toLowerCase(Locale.ROOT).replace('_', ' '));
// ItemUtils.setItemStackNameAndLore(item, ChatColor.GOLD + catTypeName, null);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonCatVariant, Settings.msgButtonCatVariantLore);
return iconItem;
}
@ -206,8 +203,7 @@ public class CatShop extends SittableShop<Cat> {
} else {
iconItem = new ItemStack(ItemUtils.getWoolType(collarColor));
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonCollarColor, Settings.msgButtonCollarColorLore);
return iconItem;
}

View File

@ -76,8 +76,7 @@ public class ChestedHorseShop<E extends ChestedHorse> extends BabyableShop<E> {
private ItemStack getCarryingChestEditorItem() {
ItemStack iconItem = new ItemStack(Material.CHEST);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonCarryingChest, Settings.msgButtonCarryingChestLore);
return iconItem;
}

View File

@ -82,8 +82,7 @@ public class CreeperShop extends SKLivingShopObject<Creeper> {
} else {
iconItem = new ItemStack(Material.LIME_WOOL);
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonCreeperCharged, Settings.msgButtonCreeperChargedLore);
return iconItem;
}

View File

@ -106,8 +106,7 @@ public class FoxShop extends SittableShop<Fox> {
ItemUtils.setLeatherColor(iconItem, Color.ORANGE);
break;
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonFoxVariant, Settings.msgButtonFoxVariantLore);
return iconItem;
}
@ -150,8 +149,7 @@ public class FoxShop extends SittableShop<Fox> {
private ItemStack getSleepingEditorItem() {
ItemStack iconItem = new ItemStack(sleeping ? Material.GREEN_BED : Material.RED_BED);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonFoxSleeping, Settings.msgButtonFoxSleepingLore);
return iconItem;
}
@ -195,8 +193,7 @@ public class FoxShop extends SittableShop<Fox> {
private ItemStack getCrouchingEditorItem() {
ItemStack iconItem = new ItemStack(crouching ? Material.GREEN_CARPET : Material.RED_CARPET);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonFoxCrouching, Settings.msgButtonFoxCrouchingLore);
return iconItem;
}

View File

@ -140,8 +140,7 @@ public class HorseShop extends BabyableShop<Horse> {
ItemUtils.setLeatherColor(iconItem, Color.WHITE);
break;
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonHorseColor, Settings.msgButtonHorseColorLore);
return iconItem;
}
@ -184,8 +183,7 @@ public class HorseShop extends BabyableShop<Horse> {
meta.addPattern(new Pattern(DyeColor.BROWN, PatternType.TRIANGLES_BOTTOM));
meta.addPattern(new Pattern(DyeColor.BROWN, PatternType.TRIANGLES_TOP));
iconItem.setItemMeta(meta);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonHorseStyle, Settings.msgButtonHorseStyleLore);
return iconItem;
}
@ -223,8 +221,7 @@ public class HorseShop extends BabyableShop<Horse> {
private ItemStack getArmorEditorItem() {
ItemStack iconItem = new ItemStack(armor == null ? Material.BARRIER : armor.getMaterial());
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonHorseArmor, Settings.msgButtonHorseArmorLore);
return iconItem;
}

View File

@ -106,8 +106,7 @@ public class LlamaShop<E extends Llama> extends ChestedHorseShop<E> {
ItemUtils.setLeatherColor(iconItem, Color.WHITE.mixDyes(DyeColor.ORANGE));
break;
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonLlamaVariant, Settings.msgButtonLlamaVariantLore);
return iconItem;
}
@ -145,8 +144,7 @@ public class LlamaShop<E extends Llama> extends ChestedHorseShop<E> {
private ItemStack getCarpetColorEditorItem() {
ItemStack iconItem = new ItemStack(carpetColor == null ? Material.BARRIER : ItemUtils.getCarpetType(carpetColor));
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonLlamaCarpetColor, Settings.msgButtonLlamaCarpetColorLore);
return iconItem;
}

View File

@ -88,8 +88,7 @@ public class MushroomCowShop extends BabyableShop<MushroomCow> {
iconItem = new ItemStack(Material.BROWN_MUSHROOM);
break;
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonMooshroomVariant, Settings.msgButtonMooshroomVariantLore);
return iconItem;
}

View File

@ -81,8 +81,7 @@ public class PandaShop extends BabyableShop<Panda> {
private ItemStack getGeneEditorItem() {
ItemStack iconItem = new ItemStack(Material.PANDA_SPAWN_EGG);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonPandaVariant, Settings.msgButtonPandaVariantLore);
return iconItem;
}

View File

@ -102,8 +102,7 @@ public class ParrotShop extends SittableShop<Parrot> {
iconItem = new ItemStack(ItemUtils.getWoolType(DyeColor.RED));
break;
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonParrotVariant, Settings.msgButtonParrotVariantLore);
return iconItem;
}

View File

@ -76,8 +76,7 @@ public class PigShop extends BabyableShop<Pig> {
private ItemStack getSaddleEditorItem() {
ItemStack iconItem = new ItemStack(Material.SADDLE);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonPigSaddle, Settings.msgButtonPigSaddleLore);
return iconItem;
}

View File

@ -87,8 +87,7 @@ public class SheepShop extends BabyableShop<Sheep> {
private ItemStack getColorEditorItem() {
ItemStack iconItem = new ItemStack(ItemUtils.getWoolType(color));
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonSheepColor, Settings.msgButtonSheepColorLore);
return iconItem;
}
@ -126,8 +125,7 @@ public class SheepShop extends BabyableShop<Sheep> {
private ItemStack getShearedEditorItem() {
ItemStack iconItem = new ItemStack(Material.SHEARS);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonSheepSheared, Settings.msgButtonSheepShearedLore);
return iconItem;
}

View File

@ -78,8 +78,7 @@ public class SittableShop<E extends Ageable & Sittable> extends BabyableShop<E>
private ItemStack getSittingEditorItem() {
ItemStack iconItem = new ItemStack(Material.IRON_HORSE_ARMOR);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonSitting, Settings.msgButtonSittingLore);
return iconItem;
}

View File

@ -175,10 +175,7 @@ public class VillagerShop extends BabyableShop<Villager> {
break;
}
assert iconItem != null;
// TODO use more specific text
// ItemUtils.setLocalizedName(iconItem, "entity.minecraft.villager." +
// profession.name().toLowerCase(Locale.ROOT));
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonVillagerProfession, Settings.msgButtonVillagerProfessionLore);
return iconItem;
}
@ -241,8 +238,7 @@ public class VillagerShop extends BabyableShop<Villager> {
ItemUtils.setLeatherColor(iconItem, Color.WHITE.mixDyes(DyeColor.BROWN));
break;
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonVillagerVariant, Settings.msgButtonVillagerVariantLore);
return iconItem;
}
@ -300,10 +296,7 @@ public class VillagerShop extends BabyableShop<Villager> {
break;
}
assert iconItem != null;
// TODO use more specific text
// ItemUtils.setLocalizedName(iconItem, "entity.minecraft.villager." +
// profession.name().toLowerCase(Locale.ROOT));
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonVillagerLevel, Settings.msgButtonVillagerLevelLore);
return iconItem;
}

View File

@ -91,8 +91,7 @@ public class WolfShop extends SittableShop<Wolf> {
private ItemStack getAngryEditorItem() {
ItemStack iconItem = new ItemStack(angry ? Material.RED_WOOL : Material.WHITE_WOOL);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonWolfAngry, Settings.msgButtonWolfAngryLore);
return iconItem;
}
@ -141,8 +140,7 @@ public class WolfShop extends SittableShop<Wolf> {
} else {
iconItem = new ItemStack(ItemUtils.getWoolType(collarColor));
}
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonCollarColor, Settings.msgButtonCollarColorLore);
return iconItem;
}

View File

@ -77,11 +77,8 @@ public class ZombieShop<E extends Zombie> extends SKLivingShopObject<E> {
}
private ItemStack getBabyEditorItem() {
// TODO use mob-specific spawn egg (if available; some mobs (illusioner) don't have a spawn egg)?
// on the other hand: using a single item consistently for the editor icon has benefits as well
ItemStack iconItem = new ItemStack(Material.EGG);
// TODO use more specific text
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonBaby, Settings.msgButtonBabyLore);
return iconItem;
}

View File

@ -131,10 +131,7 @@ public class ZombieVillagerShop extends ZombieShop<ZombieVillager> {
break;
}
assert iconItem != null;
// TODO use more specific text
// ItemUtils.setLocalizedName(iconItem, "entity.minecraft.villager." +
// profession.name().toLowerCase(Locale.ROOT));
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonZombieVillagerProfession, Settings.msgButtonZombieVillagerProfessionLore);
return iconItem;
}

View File

@ -364,7 +364,6 @@ public class SKSignShopObject extends AbstractBlockShopObject implements SignSho
protected ItemStack getSignTypeEditorItem() {
ItemStack iconItem = new ItemStack(getMaterial(signType, false));
// TODO use more specific text
return ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonType, Settings.msgButtonTypeLore);
return ItemUtils.setItemStackNameAndLore(iconItem, Settings.msgButtonSignVariant, Settings.msgButtonSignVariantLore);
}
}

View File

@ -4,6 +4,7 @@ import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
@ -452,6 +453,14 @@ public final class Utils {
return message;
}
public static List<String> replaceArgs(Collection<String> messages, String... args) {
List<String> replaced = new ArrayList<>(messages.size());
for (String message : messages) {
replaced.add(replaceArgs(message, args));
}
return replaced;
}
public static void sendMessage(CommandSender sender, String message, String... args) {
// replace message arguments:
message = replaceArgs(message, args);

View File

@ -249,7 +249,7 @@ name-item-lore: []
# Whether the editor menu of player shops contains an options to open the
# shop's chest.
enable-chest-option-on-player-shop: false
enable-chest-option-on-player-shop: true
# The item type of the open-chest button.
chest-item: CHEST
@ -407,18 +407,14 @@ msg-button-next-page-lore: []
msg-button-current-page: "&6Page {page} of {max_page}"
msg-button-current-page-lore: []
msg-button-name: "&aSet Shop Name"
msg-button-name: "&aSet shop name"
msg-button-name-lore:
- Lets you rename
- your shopkeeper
msg-button-chest: "&aView Chest Inventory"
msg-button-chest: "&aView chest inventory"
msg-button-chest-lore:
- Lets you view the inventory
- your shopkeeper is using
msg-button-type: "&aChoose Appearance"
msg-button-type-lore:
- Changes the look
- of your shopkeeper
msg-button-delete: "&4Delete"
msg-button-delete-lore:
- Closes and removes
@ -427,6 +423,105 @@ msg-button-hire: "&aHire"
msg-button-hire-lore:
- Buy this shopkeeper
msg-button-sign-variant: "&aChoose sign variant"
msg-button-sign-variant-lore:
- "Changes the sign's"
- "wood type"
msg-button-baby: "&aToggle baby variant"
msg-button-baby-lore:
- "Toggles between the mob's"
- "baby and adult variant"
msg-button-sitting: "&aToggle sitting pose"
msg-button-sitting-lore:
- "Toggles the mob's"
- "sitting pose"
msg-button-cat-variant: "&aChoose cat variant"
msg-button-cat-variant-lore:
- "Changes the cat's look"
msg-button-collar-color: "&aChoose collar color"
msg-button-collar-color-lore:
- "Changes the mob's"
- "collar color"
msg-button-wolf-angry: "&aToggle angry wolf"
msg-button-wolf-angry-lore:
- "Toggles the wolf's"
- "angry state"
msg-button-carrying-chest: "&aToggle carrying chest"
msg-button-carrying-chest-lore:
- "Toggles whether the mob"
- "is carrying a chest"
msg-button-horse-color: "&aChoose horse color"
msg-button-horse-color-lore:
- "Changes the color"
- "of the horse"
msg-button-horse-style: "&aChoose horse style"
msg-button-horse-style-lore:
- "Changes the coat pattern"
- "of the horse"
msg-button-horse-armor: "&aChoose horse armor"
msg-button-horse-armor-lore:
- "Changes the armor"
- "of the horse"
msg-button-llama-variant: "&aChoose llama variant"
msg-button-llama-variant-lore:
- "Changes the llama's look"
msg-button-llama-carpet-color: "&aLlama carpet color"
msg-button-llama-carpet-color-lore:
- "Changes the llama's"
- "carpet color"
msg-button-creeper-charged: "&aToggle charged creeper"
msg-button-creeper-charged-lore:
- "Toggles the creeper's"
- "charged state"
msg-button-fox-variant: "&aChoose fox variant"
msg-button-fox-variant-lore:
- "Changes the fox's look"
msg-button-fox-crouching: "&aToggle crouching pose"
msg-button-fox-crouching-lore:
- "Toggles the fox's"
- "crouching pose"
msg-button-fox-sleeping: "&aToggle sleeping pose"
msg-button-fox-sleeping-lore:
- "Toggles the fox's"
- "sleeping pose"
msg-button-mooshroom-variant: "&aChoose mooshroom variant"
msg-button-mooshroom-variant-lore:
- "Changes the look"
- "of the mooshroom"
msg-button-panda-variant: "&aChoose panda variant"
msg-button-panda-variant-lore:
- "Changes the panda's look"
msg-button-parrot-variant: "&aChoose parrot variant"
msg-button-parrot-variant-lore:
- "Changes the parrot's look"
msg-button-pig-saddle: "&aToggle pig saddle"
msg-button-pig-saddle-lore:
- "Toggles the pig's saddle"
msg-button-sheep-color: "&aChoose sheep color"
msg-button-sheep-color-lore:
- "Changes the sheep's"
- "wool color"
msg-button-sheep-sheared: "&aToggle sheared sheep"
msg-button-sheep-sheared-lore:
- "Toggles the sheep's"
- "sheared state"
msg-button-villager-profession: "&aChoose villager profession"
msg-button-villager-profession-lore:
- "Changes the profession"
- "of the villager"
msg-button-villager-variant: "&aChoose villager variant"
msg-button-villager-variant-lore:
- "Changes the look"
- "of the villager"
msg-button-villager-level: "&aChoose villager level"
msg-button-villager-level-lore:
- "Changes the level"
- "of the villager"
msg-button-zombie-villager-profession: "&aChoose villager profession"
msg-button-zombie-villager-profession-lore:
- "Changes the profession"
- "of the zombie villager"
msg-trading-title-prefix: "&2"
msg-trading-title-default: "Shopkeeper"

View File

@ -39,10 +39,6 @@ msg-button-chest: "&aShop-Inventar öffnen"
msg-button-chest-lore:
- Zeigt dir das Inventar
- deines Verkäufers
msg-button-type: "&aAussehen ändern"
msg-button-type-lore:
- Ändert das Aussehen
- deines Verkäufers
msg-button-delete: "&4Entfernen"
msg-button-delete-lore:
- Schließt diesen Shop und
@ -51,6 +47,114 @@ msg-button-hire: "&aAnheuern"
msg-button-hire-lore:
- Kaufe diesen Shop
msg-button-type: "&aAussehen ändern"
msg-button-type-lore:
- Ändert das Aussehen
- deines Verkäufers
msg-button-sign-variant: "&aSchild-Variante ändern"
msg-button-sign-variant-lore:
- "Ändert den Holztyp"
- "des Schildes"
msg-button-baby: "&aBaby-Variante umschalten"
msg-button-baby-lore:
- "Wechselt zwischen der Kind- und"
- "Erwachsenen-Variante des Mobs"
msg-button-sitting: "&aSitzhaltung umschalten"
msg-button-sitting-lore:
- "Wechselt die Sitzhaltung"
msg-button-cat-variant: "&aKatzen-Variante ändern"
msg-button-cat-variant-lore:
- "Ändert das Aussehen"
- "der Katze"
msg-button-collar-color: "&aHalsband Farbe ändern"
msg-button-collar-color-lore:
- "Ändert die Farbe"
- "des Halsbandes"
msg-button-wolf-angry: "&aWütender Wolf umschalten"
msg-button-wolf-angry-lore:
- "Wechselt zwischen wütendem"
- "und zahmen Wolf"
msg-button-carrying-chest: "&aTragetasche umschalten"
msg-button-carrying-chest-lore:
- "Schaltet die Tragetasche"
- "an und aus"
msg-button-horse-color: "&aFellfarbe ändern"
msg-button-horse-color-lore:
- "Ändert die Fellfarbe"
- "des Pferdes"
msg-button-horse-style: "&aFellmuster ändern"
msg-button-horse-style-lore:
- "Ändert das Fellmuster"
- "des Pferdes"
msg-button-horse-armor: "&aPferderüstung ändern"
msg-button-horse-armor-lore:
- "Ändert die Pferderüstung"
msg-button-llama-variant: "&aLama-Variante ändern"
msg-button-llama-variant-lore:
- "Ändert das Aussehen"
- "des Lamas"
msg-button-llama-carpet-color: "&aTeppich Farbe ändern"
msg-button-llama-carpet-color-lore:
- "Ändert die Farbe"
- "des Teppichs"
msg-button-creeper-charged: "&aAufladung umschalten"
msg-button-creeper-charged-lore:
- "Wechselt zwischen normalem"
- "und aufgeladenem Creeper"
msg-button-fox-variant: "&aFuchs-Variante ändern"
msg-button-fox-variant-lore:
- "Ändert das Aussehen"
- "des Fuchses"
msg-button-fox-crouching: "&aPirschhaltung umschalten"
msg-button-fox-crouching-lore:
- "Wechselt zwischen normaler"
- "und pirschender Haltung"
msg-button-fox-sleeping: "&aSchlafhaltung umschalten"
msg-button-fox-sleeping-lore:
- "Wechselt zwischen normaler"
- "und Schlafhaltung"
msg-button-mooshroom-variant: "&aMooshroom-Variante ändern"
msg-button-mooshroom-variant-lore:
- "Ändert das Aussehen"
- "der Mooshroom"
msg-button-panda-variant: "&aPanda-Variante ändern"
msg-button-panda-variant-lore:
- "Ändert das Aussehen"
- "des Pandas"
msg-button-parrot-variant: "&aPapagei-Variante ändern"
msg-button-parrot-variant-lore:
- "Ändert das Aussehen"
- "des Papageis"
msg-button-pig-saddle: "&aSattel umschalten"
msg-button-pig-saddle-lore:
- "Schaltet den Sattel"
- "an oder aus"
msg-button-sheep-color: "&aWollfarbe ändern"
msg-button-sheep-color-lore:
- "Ändert die Wollfarbe"
- "des Schafs"
msg-button-sheep-sheared: "&aGeschoren umschalten"
msg-button-sheep-sheared-lore:
- "Schaltet zwischen geschorenem"
- "und ungeschorenem Schaf um"
msg-button-villager-profession: "&aBeruf ändern"
msg-button-villager-profession-lore:
- "Ändert den Beruf"
- "des Dorfbewohners"
msg-button-villager-variant: "&aDorfbewohner-Variante ändern"
msg-button-villager-variant-lore:
- "Ändert das Aussehen"
- "des Dorfbewohners"
msg-button-villager-level: "&aErfahrungslevel ändern"
msg-button-villager-level-lore:
- "Ändert das Erfahrungslevel"
- "des Dorfbewohners"
msg-button-zombie-villager-profession: "&aBeruf ändern"
msg-button-zombie-villager-profession-lore:
- "Ändert den Beruf des"
- "Dorfbewohner-Zombies"
msg-trading-title-prefix: "&2"
msg-trading-title-default: "Händler"