mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-26 04:12:22 +00:00
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:
parent
ade20c8255
commit
6bce68768a
@ -101,7 +101,7 @@ public class Config {
|
|||||||
public boolean remove_shop_on_error;
|
public boolean remove_shop_on_error;
|
||||||
|
|
||||||
/** Amount the hologram should be lifted **/
|
/** 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 **/
|
/** The maximum distance between a player and a shop to see the hologram **/
|
||||||
public double maximal_distance;
|
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");
|
append_potion_level_to_item_name = plugin.getConfig().getBoolean("append-potion-level-to-item-name");
|
||||||
show_shop_items = plugin.getConfig().getBoolean("show-shop-items");
|
show_shop_items = plugin.getConfig().getBoolean("show-shop-items");
|
||||||
remove_shop_on_error = plugin.getConfig().getBoolean("remove-shop-on-error");
|
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");
|
maximal_distance = plugin.getConfig().getDouble("maximal-distance");
|
||||||
shop_creation_price_normal = plugin.getConfig().getDouble("shop-creation-price.normal");
|
shop_creation_price_normal = plugin.getConfig().getDouble("shop-creation-price.normal");
|
||||||
shop_creation_price_admin = plugin.getConfig().getDouble("shop-creation-price.admin");
|
shop_creation_price_admin = plugin.getConfig().getDouble("shop-creation-price.admin");
|
||||||
|
@ -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);
|
} 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())),
|
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)));
|
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);
|
hologram = new Hologram(plugin, holoText, holoLocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,11 +25,11 @@ enable-debug-log: false
|
|||||||
# (The messages can be found and modified in the specified language file)
|
# (The messages can be found and modified in the specified language file)
|
||||||
two-line-prices: false
|
two-line-prices: false
|
||||||
|
|
||||||
# Set the amount (may be negative) the hologram should be lifted
|
# Set the amount (may be negative) the hologram should be lifted in the y-axis,
|
||||||
# in the y-axis (a higher number lifts the hologram more up, '1' equals to one block).
|
# when "two-line-prices" is set to true and buying and selling is enabled at the shop.
|
||||||
# It's recommended to change the value (to around 0.2) if "two-line-prices" is set to true, to prevent
|
# The higher the number, the higher will the hologram be.
|
||||||
# the floating item to intersect with the hologram.
|
# A value of '1' equals to one block, and a value of '0.25' is equal to the height of one line.
|
||||||
hologram-lift: 0
|
two-line-hologram-lift: 0.25
|
||||||
|
|
||||||
# Set whether players should be allowed to sell/buy broken items
|
# Set whether players should be allowed to sell/buy broken items
|
||||||
allow-broken-items: false
|
allow-broken-items: false
|
||||||
|
Loading…
Reference in New Issue
Block a user