Only apply additional hologram lift on two-line-shops

(When "two-line-prices" is enabled and the shop has buying and selling enabled)
This commit is contained in:
Eric 2016-08-10 13:10:09 +02:00
parent ade20c8255
commit 6bce68768a
3 changed files with 10 additions and 10 deletions

View File

@ -101,7 +101,7 @@ public class Config {
public boolean remove_shop_on_error;
/** Amount the hologram should be lifted **/
public double hologram_lift;
public double two_line_hologram_lift;
/** The maximum distance between a player and a shop to see the hologram **/
public double maximal_distance;
@ -284,7 +284,7 @@ public class Config {
append_potion_level_to_item_name = plugin.getConfig().getBoolean("append-potion-level-to-item-name");
show_shop_items = plugin.getConfig().getBoolean("show-shop-items");
remove_shop_on_error = plugin.getConfig().getBoolean("remove-shop-on-error");
hologram_lift = plugin.getConfig().getDouble("hologram-lift");
two_line_hologram_lift = plugin.getConfig().getDouble("two-line-hologram-lift");
maximal_distance = plugin.getConfig().getDouble("maximal-distance");
shop_creation_price_normal = plugin.getConfig().getDouble("shop-creation-price.normal");
shop_creation_price_admin = plugin.getConfig().getDouble("shop-creation-price.admin");

View File

@ -183,9 +183,6 @@ public class Shop {
} else holoLocation = new Location(b.getWorld(), b.getX() + 0.5, b.getY() - 0.6, b.getZ() + 0.5);
if (holoText.length == 3)
holoLocation.add(0, plugin.getShopChestConfig().hologram_lift, 0);
holoText[0] = LanguageUtils.getMessage(LocalizedMessage.Message.HOLOGRAM_FORMAT, new LocalizedMessage.ReplacedRegex(Regex.AMOUNT, String.valueOf(product.getAmount())),
new LocalizedMessage.ReplacedRegex(Regex.ITEM_NAME, LanguageUtils.getItemName(product)));
@ -203,6 +200,9 @@ public class Shop {
}
}
if (holoText.length == 3 && holoText[2] != null)
holoLocation.add(0, plugin.getShopChestConfig().two_line_hologram_lift, 0);
hologram = new Hologram(plugin, holoText, holoLocation);
}

View File

@ -25,11 +25,11 @@ enable-debug-log: false
# (The messages can be found and modified in the specified language file)
two-line-prices: false
# Set the amount (may be negative) the hologram should be lifted
# in the y-axis (a higher number lifts the hologram more up, '1' equals to one block).
# It's recommended to change the value (to around 0.2) if "two-line-prices" is set to true, to prevent
# the floating item to intersect with the hologram.
hologram-lift: 0
# Set the amount (may be negative) the hologram should be lifted in the y-axis,
# when "two-line-prices" is set to true and buying and selling is enabled at the shop.
# The higher the number, the higher will the hologram be.
# A value of '1' equals to one block, and a value of '0.25' is equal to the height of one line.
two-line-hologram-lift: 0.25
# Set whether players should be allowed to sell/buy broken items
allow-broken-items: false