mirror of https://github.com/tomasff/BeesPlus.git
Compare commits
33 Commits
Author | SHA1 | Date |
---|---|---|
Tomás F | c9c5d78a38 | |
Tomás F | 9a94cea232 | |
Tomás F | e7ae6ae440 | |
Tomás F | 1e0c51f607 | |
Tomás F | f224810f45 | |
Tomás F | 8d0f7f3498 | |
Ai Tanabe | 85e8bb3271 | |
Tomás F | bd982cdbe2 | |
Tomás F | 3882d3e21b | |
Tomás F | 0fb9f945f4 | |
Tomás F | 1abf7570bf | |
ErdbeerbaerLP | f29ba54069 | |
Tomás F | 82855f4f86 | |
Tomás F | 5140310b87 | |
Tomás F | 93a01271fe | |
Tomás F | 5f3c97cdcd | |
Tomás F | 65901852d2 | |
Tomás F | 80674bef7a | |
Tomás F | 9f38ec8b19 | |
Tomás F | 0c865fc87f | |
Tomás F | 171e3bcb41 | |
Tomás F | 5e36087c4a | |
Tomás F | 3453aea187 | |
Tomás F | fd39a81542 | |
Tomás F | a65214c24a | |
Tomás F | c965dccdac | |
Tomás F | 559234f0dd | |
Tomás F | c24786020e | |
Tomás F | 2f20b90968 | |
Tomás F | e5ff947996 | |
Tomás F | ea99c15c3d | |
Choi YunJun | c25713f375 | |
Tomás F | b71ea15609 |
|
@ -0,0 +1,35 @@
|
|||
name: Java CI
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '17'
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1.1.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: Release ${{ github.ref }}
|
||||
draft: true
|
||||
prerelease: false
|
||||
- name: Upload release artifact
|
||||
id: upload_release_artifact
|
||||
uses: actions/upload-artifact@v2.0.1
|
||||
with:
|
||||
path: ${{ github.workspace }}/target/BeesPlus-*.jar
|
|
@ -2,13 +2,14 @@
|
|||
<img src="static/header.png" alt="Bees+"/>
|
||||
</p>
|
||||
|
||||
![](https://github.com/tomasff/BeesPlus/workflows/Java%20CI/badge.svg)
|
||||
![Java](https://img.shields.io/badge/Java-8%2B-blue)
|
||||
![Spigot Downloads](https://img.shields.io/spiget/downloads/77224)
|
||||
[![CodeFactor](https://www.codefactor.io/repository/github/tomasff/beesplus/badge)](https://www.codefactor.io/repository/github/tomasff/beesplus)
|
||||
|
||||
A Spigot (Minecraft server software) plugin that displays useful bee-related information.
|
||||
|
||||
## Compatibiliy
|
||||
## Compatibility
|
||||
This plugin is only compatible with Minecraft 1.15+ currently.
|
||||
|
||||
## Demo
|
||||
|
|
28
pom.xml
28
pom.xml
|
@ -6,16 +6,21 @@
|
|||
|
||||
<groupId>com.tomff.beesplus</groupId>
|
||||
<artifactId>BeesPlus</artifactId>
|
||||
<version>1.5</version>
|
||||
<version>1.6.1</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<maven.compiler.source>1.8</maven.compiler.source>
|
||||
<maven.compiler.target>1.8</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<junit.jupiter.version>5.6.2</junit.jupiter.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spigot-repo</id>
|
||||
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>CodeMC</id>
|
||||
<url>https://repo.codemc.org/repository/maven-public</url>
|
||||
|
@ -26,15 +31,21 @@
|
|||
<dependency>
|
||||
<groupId>org.spigotmc</groupId>
|
||||
<artifactId>spigot-api</artifactId>
|
||||
<version>1.15.2-R0.1-SNAPSHOT</version>
|
||||
<version>1.18.2-R0.1-SNAPSHOT</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>1.7</version>
|
||||
<version>3.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>${junit.jupiter.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -54,7 +65,7 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<relocation>
|
||||
|
@ -80,6 +91,11 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.2</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
|
@ -12,10 +12,12 @@ import com.tomff.beesplus.handlers.DamageHandler;
|
|||
import com.tomff.beesplus.handlers.RightClickHandler;
|
||||
import com.tomff.beesplus.items.*;
|
||||
import com.tomff.beesplus.localization.Localization;
|
||||
import com.tomff.beesplus.localization.LocalizationWrapper;
|
||||
import com.tomff.beesplus.localization.LocalizationLoader;
|
||||
import org.bstats.bukkit.Metrics;
|
||||
import org.bstats.charts.SimplePie;
|
||||
import org.bukkit.configuration.InvalidConfigurationException;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -23,6 +25,11 @@ import java.util.Locale;
|
|||
|
||||
public class BeesPlus extends JavaPlugin {
|
||||
|
||||
private static final int RESOURCE_ID = 77224;
|
||||
private static final int PLUGIN_ID = 7065;
|
||||
|
||||
private static final String LANGUAGE_CHART_ID = "language_used";
|
||||
|
||||
private GuiViewTracker guiViewTracker;
|
||||
private CustomItemManager customItemManager;
|
||||
|
||||
|
@ -34,9 +41,11 @@ public class BeesPlus extends JavaPlugin {
|
|||
guiViewTracker = new GuiViewTracker();
|
||||
customItemManager = new CustomItemManager(this);
|
||||
|
||||
getServer().getPluginManager().registerEvents(new GuiHandler(this), this);
|
||||
getServer().getPluginManager().registerEvents(new BeehiveHandler(), this);
|
||||
getServer().getPluginManager().registerEvents(new RightClickHandler(this), this);
|
||||
PluginManager pluginManager = getServer().getPluginManager();
|
||||
|
||||
pluginManager.registerEvents(new GuiHandler(this), this);
|
||||
pluginManager.registerEvents(new BeehiveHandler(), this);
|
||||
pluginManager.registerEvents(new RightClickHandler(this), this);
|
||||
|
||||
if (!loadLocale()) {
|
||||
getServer().getPluginManager().disablePlugin(this);
|
||||
|
@ -45,8 +54,11 @@ public class BeesPlus extends JavaPlugin {
|
|||
|
||||
registerItems();
|
||||
setupMetrics();
|
||||
setupUpdateChecker();
|
||||
}
|
||||
|
||||
new UpdateChecker(this, 77224).getVersion(version -> {
|
||||
private void setupUpdateChecker() {
|
||||
new UpdateChecker(this, RESOURCE_ID).getVersion(version -> {
|
||||
if (!this.getDescription().getVersion().equalsIgnoreCase(version)) {
|
||||
getLogger().info("A new update is available: BeesPlus " + version);
|
||||
}
|
||||
|
@ -54,9 +66,9 @@ public class BeesPlus extends JavaPlugin {
|
|||
}
|
||||
|
||||
private void setupMetrics() {
|
||||
Metrics metrics = new Metrics(this, 7065);
|
||||
Metrics metrics = new Metrics(this, PLUGIN_ID);
|
||||
|
||||
metrics.addCustomChart(new Metrics.SimplePie("language_used",
|
||||
metrics.addCustomChart(new SimplePie(LANGUAGE_CHART_ID,
|
||||
() -> getConfig().getString("locale", Locale.ENGLISH.toLanguageTag())));
|
||||
}
|
||||
|
||||
|
@ -67,10 +79,10 @@ public class BeesPlus extends JavaPlugin {
|
|||
|
||||
private boolean loadLocale() {
|
||||
String locale = getConfig().getString("locale", Locale.ENGLISH.toLanguageTag());
|
||||
LocalizationWrapper localizationWrapper = new LocalizationWrapper(this, "locale");
|
||||
LocalizationLoader localizationLoader = new LocalizationLoader(this, "locale");
|
||||
|
||||
try {
|
||||
YamlConfiguration localeYamlFile = localizationWrapper.getLocale(locale);
|
||||
YamlConfiguration localeYamlFile = localizationLoader.load(locale);
|
||||
Localization.load(localeYamlFile);
|
||||
} catch (IOException e) {
|
||||
getLogger().severe("Invalid locale! Please choose a valid locale.");
|
||||
|
@ -102,8 +114,18 @@ public class BeesPlus extends JavaPlugin {
|
|||
}),
|
||||
new AddFields("locale/en.yml", beehiveUpgradeTranslation),
|
||||
new AddFields("locale/fr.yml", beehiveUpgradeTranslation),
|
||||
new AddFields("locale/hu.yml", beehiveUpgradeTranslation),
|
||||
new AddFields("locale/zh_cn.yml", beehiveUpgradeTranslation),
|
||||
new AddFields("locale/hu.yml", new Field[] {
|
||||
new Field("beehive_upgrade_item_name", "&6Méhkas fejlesztés"),
|
||||
new Field("beehive_upgrade_item_lore", "&7Méh kapacitás: &a+3||&8(Jobb klikk, hogy használd)"),
|
||||
new Field("beehive_upgrade_success", "&aMéhkas felfejlesztve! Új populáció: &7%beesno%&a méh"),
|
||||
new Field("beehive_upgrade_max", "&cHiba: Ez a méhkas elérte a megengedett maximum populációt!")
|
||||
}),
|
||||
new AddFields("locale/zh_cn.yml", new Field[] {
|
||||
new Field("beehive_upgrade_item_name", "&6蜂巢升级"),
|
||||
new Field("beehive_upgrade_item_lore", "&7蜜蜂容量: &a+3||&8(右键单击查看)"),
|
||||
new Field("beehive_upgrade_success", "&a蜂巢升级! 新移入: &7%beesno%&a 蜜蜂"),
|
||||
new Field("beehive_upgrade_max", "&c错误:此蜂箱已达到允许的最大数量!")
|
||||
}),
|
||||
new AddFields("locale/pt.yml", new Field[] {
|
||||
new Field("beehive_upgrade_item_name", "&6Melhorar Colmeia"),
|
||||
new Field("beehive_upgrade_item_lore", "&7População de abelhas: &a+3||&8(Clique direito para usar)"),
|
||||
|
@ -123,7 +145,7 @@ public class BeesPlus extends JavaPlugin {
|
|||
|
||||
boolean isProtectionSuitEnabled = getConfig().getBoolean("beeprotectionsuit.enabled", true);
|
||||
|
||||
if(isProtectionSuitEnabled) {
|
||||
if (isProtectionSuitEnabled) {
|
||||
customItemManager.registerCustomItem("protection_boots", new BeeProtectionBoots());
|
||||
customItemManager.registerCustomItem("protection_leggings", new BeeProtectionLeggings());
|
||||
customItemManager.registerCustomItem("protection_chestplate", new BeeProtectionChestplate());
|
||||
|
|
|
@ -21,7 +21,8 @@ public class UpdateChecker {
|
|||
|
||||
public void getVersion(final Consumer<String> consumer) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(beesPlus, () -> {
|
||||
try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId).openStream(); Scanner scanner = new Scanner(inputStream)) {
|
||||
try (InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.resourceId).openStream();
|
||||
Scanner scanner = new Scanner(inputStream)) {
|
||||
if (scanner.hasNext()) {
|
||||
consumer.accept(scanner.next());
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@ import org.bukkit.inventory.ItemStack;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
public abstract class CustomItem {
|
||||
public interface CustomItem {
|
||||
|
||||
public abstract String[] getRecipe();
|
||||
public abstract Map<Character, Material> getIngredients();
|
||||
public abstract ItemStack getResult();
|
||||
String[] getRecipe();
|
||||
Map<Character, Material> getIngredients();
|
||||
ItemStack getResult();
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ public class CustomItemManager {
|
|||
|
||||
NamespacedKey namespacedKey = new NamespacedKey(beesPlus, id);
|
||||
ShapedRecipe recipe = new ShapedRecipe(namespacedKey, customItem.getResult());
|
||||
|
||||
recipe.shape(customItem.getRecipe());
|
||||
customItem.getIngredients().forEach(recipe::setIngredient);
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.tomff.beesplus.core.items.ItemBuilder;
|
|||
import com.tomff.beesplus.localization.Localization;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Bee;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class BeeInfo extends Gui {
|
||||
|
@ -26,6 +27,44 @@ public class BeeInfo extends Gui {
|
|||
return Localization.get(Localization.BEE_INFO_GUI_TITLE);
|
||||
}
|
||||
|
||||
public void rideBee(Player player) {
|
||||
double distance = player.getLocation().distance(bee.getLocation());
|
||||
|
||||
if (!player.hasPermission("beesplus.bee.ride")) {
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_NO_PERMISSION);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (bee.getAnger() > 0) {
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_ANGRY);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (distance <= 6) {
|
||||
if (bee.getPassengers().size() >= 1) {
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_ALREADY);
|
||||
return;
|
||||
}
|
||||
|
||||
player.closeInventory();
|
||||
|
||||
bee.addPassenger(player);
|
||||
|
||||
String title = Localization.get(Localization.RIDE_BEE_TITLE, player.getName());
|
||||
String subtitle = Localization.get(Localization.RIDE_BEE_SUBTITLE, player.getName());
|
||||
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDER_DRAGON_FLAP, 10, 1);
|
||||
player.sendTitle(title, subtitle, 10, 25, 10);
|
||||
} else {
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_TOO_FAR);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildIcons() {
|
||||
ItemStack age = new ItemBuilder(Material.OAK_SIGN)
|
||||
|
@ -64,44 +103,7 @@ public class BeeInfo extends Gui {
|
|||
.setName(Localization.get(Localization.BEE_INFO_GUI_RIDE))
|
||||
.build();
|
||||
|
||||
Icon mountIcon = new Icon(mount, (player) -> {
|
||||
double distance = player.getLocation().distance(bee.getLocation());
|
||||
|
||||
if (!player.hasPermission("beesplus.bee.ride")) {
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_NO_PERMISSION);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (bee.getAnger() > 0) {
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_ANGRY);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (distance <= 6) {
|
||||
|
||||
if (bee.getPassengers().size() >= 1) {
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_ALREADY);
|
||||
return;
|
||||
}
|
||||
|
||||
player.closeInventory();
|
||||
|
||||
bee.addPassenger(player);
|
||||
|
||||
String title = Localization.get(Localization.RIDE_BEE_TITLE, player.getName());
|
||||
String subtitle = Localization.get(Localization.RIDE_BEE_SUBTITLE, player.getName());
|
||||
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_ENDER_DRAGON_FLAP, 10, 1);
|
||||
player.sendTitle(title, subtitle, 10, 25, 10);
|
||||
} else {
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
Localization.sendMessage(player, Localization.BEE_INFO_GUI_RIDE_TOO_FAR);
|
||||
}
|
||||
});
|
||||
Icon mountIcon = new Icon(mount, this::rideBee);
|
||||
setIcon(mountIcon, 15);
|
||||
|
||||
ItemStack stung = new ItemBuilder(Material.IRON_SWORD)
|
||||
|
|
|
@ -24,8 +24,7 @@ import org.bukkit.persistence.PersistentDataType;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BeeHiveUpgrade extends CustomItem implements Listener {
|
||||
|
||||
public class BeeHiveUpgrade implements CustomItem, Listener {
|
||||
private NamespacedKey upgradeKey;
|
||||
private int maxPopulation;
|
||||
|
||||
|
@ -34,7 +33,6 @@ public class BeeHiveUpgrade extends CustomItem implements Listener {
|
|||
maxPopulation = beesPlus.getConfig().getInt("beehiveupgrade.maximumpopulation", 9);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getRecipe() {
|
||||
return new String[] {
|
||||
"CCC",
|
||||
|
@ -43,7 +41,6 @@ public class BeeHiveUpgrade extends CustomItem implements Listener {
|
|||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Character, Material> getIngredients() {
|
||||
Map<Character, Material> ingredients = new HashMap<>();
|
||||
|
||||
|
@ -53,7 +50,6 @@ public class BeeHiveUpgrade extends CustomItem implements Listener {
|
|||
return ingredients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult() {
|
||||
return new ItemBuilder(Material.HONEYCOMB)
|
||||
.setName(Localization.get(Localization.BEEHIVE_UPGRADE_ITEM_NAME))
|
||||
|
@ -107,24 +103,28 @@ public class BeeHiveUpgrade extends CustomItem implements Listener {
|
|||
return;
|
||||
}
|
||||
|
||||
if (beehive.getMaxEntities() >= maxPopulation) {
|
||||
Localization.sendMessage(player, Localization.BEEHIVE_UPGRADE_MAX);
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
beehive.setMaxEntities(beehive.getMaxEntities() + 3);
|
||||
beehive.update();
|
||||
|
||||
Localization.sendMessage(player, Localization.BEEHIVE_UPGRADE_SUCCESS, beehive.getMaxEntities());
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 2, 2);
|
||||
|
||||
ItemStack upgradeAmountRemove = handItem.clone();
|
||||
upgradeAmountRemove.setAmount(1);
|
||||
|
||||
player.getInventory().removeItem(upgradeAmountRemove);
|
||||
upgradeBeehive(player, beehive, handItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void upgradeBeehive(Player player, Beehive beehive, ItemStack handItem) {
|
||||
if (beehive.getMaxEntities() >= maxPopulation) {
|
||||
Localization.sendMessage(player, Localization.BEEHIVE_UPGRADE_MAX);
|
||||
player.playSound(player.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 2, 2);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
beehive.setMaxEntities(beehive.getMaxEntities() + 3);
|
||||
beehive.update();
|
||||
|
||||
Localization.sendMessage(player, Localization.BEEHIVE_UPGRADE_SUCCESS, beehive.getMaxEntities());
|
||||
player.playSound(player.getLocation(), Sound.ENTITY_ARROW_HIT_PLAYER, 2, 2);
|
||||
|
||||
ItemStack upgradeAmountRemove = handItem.clone();
|
||||
upgradeAmountRemove.setAmount(1);
|
||||
|
||||
player.getInventory().removeItem(upgradeAmountRemove);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,8 +9,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BeeProtectionBoots extends CustomItem {
|
||||
@Override
|
||||
public class BeeProtectionBoots implements CustomItem {
|
||||
public String[] getRecipe() {
|
||||
return new String[] {
|
||||
"SSS",
|
||||
|
@ -19,7 +18,6 @@ public class BeeProtectionBoots extends CustomItem {
|
|||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Character, Material> getIngredients() {
|
||||
Map<Character, Material> ingredients = new HashMap<>();
|
||||
|
||||
|
@ -29,7 +27,6 @@ public class BeeProtectionBoots extends CustomItem {
|
|||
return ingredients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult() {
|
||||
return new ItemBuilder(Material.CHAINMAIL_BOOTS)
|
||||
.setName(Localization.get(Localization.BEE_PROTECTION_BOOTS))
|
||||
|
|
|
@ -9,8 +9,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BeeProtectionChestplate extends CustomItem {
|
||||
@Override
|
||||
public class BeeProtectionChestplate implements CustomItem {
|
||||
public String[] getRecipe() {
|
||||
return new String[] {
|
||||
"SSS",
|
||||
|
@ -19,7 +18,6 @@ public class BeeProtectionChestplate extends CustomItem {
|
|||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Character, Material> getIngredients() {
|
||||
Map<Character, Material> ingredients = new HashMap<>();
|
||||
|
||||
|
@ -29,7 +27,6 @@ public class BeeProtectionChestplate extends CustomItem {
|
|||
return ingredients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult() {
|
||||
return new ItemBuilder(Material.CHAINMAIL_CHESTPLATE)
|
||||
.setName(Localization.get(Localization.BEE_PROTECTION_CHESTPLATE))
|
||||
|
|
|
@ -9,8 +9,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BeeProtectionHelmet extends CustomItem {
|
||||
@Override
|
||||
public class BeeProtectionHelmet implements CustomItem {
|
||||
public String[] getRecipe() {
|
||||
return new String[] {
|
||||
"SSS",
|
||||
|
@ -19,7 +18,6 @@ public class BeeProtectionHelmet extends CustomItem {
|
|||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Character, Material> getIngredients() {
|
||||
Map<Character, Material> ingredients = new HashMap<>();
|
||||
|
||||
|
@ -29,7 +27,6 @@ public class BeeProtectionHelmet extends CustomItem {
|
|||
return ingredients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult() {
|
||||
return new ItemBuilder(Material.CHAINMAIL_HELMET)
|
||||
.setName(Localization.get(Localization.BEE_PROTECTION_HELMET))
|
||||
|
|
|
@ -9,8 +9,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BeeProtectionLeggings extends CustomItem {
|
||||
@Override
|
||||
public class BeeProtectionLeggings implements CustomItem {
|
||||
public String[] getRecipe() {
|
||||
return new String[] {
|
||||
"SSS",
|
||||
|
@ -19,7 +18,6 @@ public class BeeProtectionLeggings extends CustomItem {
|
|||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Character, Material> getIngredients() {
|
||||
Map<Character, Material> ingredients = new HashMap<>();
|
||||
|
||||
|
@ -29,7 +27,6 @@ public class BeeProtectionLeggings extends CustomItem {
|
|||
return ingredients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getResult() {
|
||||
return new ItemBuilder(Material.CHAINMAIL_LEGGINGS)
|
||||
.setName(Localization.get(Localization.BEE_PROTECTION_LEGGINGS))
|
||||
|
|
|
@ -8,17 +8,17 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class LocalizationWrapper {
|
||||
public class LocalizationLoader {
|
||||
|
||||
private final BeesPlus beesPlus;
|
||||
private final String basePath;
|
||||
|
||||
public LocalizationWrapper(BeesPlus beesPlus, String path) {
|
||||
public LocalizationLoader(BeesPlus beesPlus, String path) {
|
||||
this.beesPlus = beesPlus;
|
||||
this.basePath = path;
|
||||
}
|
||||
|
||||
public YamlConfiguration getLocale(String locale) throws IOException, InvalidConfigurationException {
|
||||
public YamlConfiguration load(String locale) throws IOException, InvalidConfigurationException {
|
||||
String path = Paths.get(basePath, locale + ".yml").toString();
|
||||
File localeFile = new File(beesPlus.getDataFolder(), path);
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Language Settings
|
||||
#
|
||||
# Available locale: en, fr, pt, zh_cn, hu
|
||||
# Available locale: en, fr, pt, zh_cn, hu, de
|
||||
#
|
||||
# If you want to create your own, the file name must match the locale name.
|
||||
# Example:
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
####################
|
||||
# Yes or no
|
||||
####################
|
||||
text_yes: "&aJa"
|
||||
text_no: "&cNein"
|
||||
|
||||
###################
|
||||
# Beehive GUI
|
||||
###################
|
||||
beehive_info_gui_title: "&8Bienenstockinformationen"
|
||||
|
||||
beehive_info_gui_honey_capacity: "&fHonig-Lager"
|
||||
|
||||
beehive_info_gui_honey_capacity_desc: "&aKapazität: &7%current%/%maximum%"
|
||||
|
||||
beehive_info_gui_bee_capacity: "&fBienenwohnraum"
|
||||
|
||||
beehive_info_gui_bee_capacity_desc: "&aKapazität: &7%current%/%maximum% Bienen"
|
||||
|
||||
beehive_info_gui_sedated: "&aSediert"
|
||||
beehive_info_gui_not_sedated: "&cNicht sediert"
|
||||
|
||||
beehive_info_gui_flower: "&fBlume"
|
||||
|
||||
# Use || to a create a new line
|
||||
beehive_info_gui_no_target_flower_desc: "&aDieser Bienenstock hat||&anoch keine Zielblume!"
|
||||
|
||||
honey_low: "Wenig"
|
||||
honey_medium: "Mittel"
|
||||
honey_high: "Viel"
|
||||
honey_very_high: "Sehr Viel"
|
||||
|
||||
###################
|
||||
# Bee GUI
|
||||
###################
|
||||
bee_info_gui_title: "&8Bienen-Info"
|
||||
|
||||
bee_info_gui_age: "&fAlter"
|
||||
bee_info_gui_age_adult: "&aErwachsen"
|
||||
bee_info_gui_age_baby: "&aBaby"
|
||||
|
||||
bee_info_gui_anger: "&fWut"
|
||||
|
||||
# Use %level% as a placeholder for the bee's anger level
|
||||
bee_info_gui_anger_level_desc: "&aWut-level: &7%level%"
|
||||
|
||||
bee_info_gui_hive_location: "&fBienenstock-Ort"
|
||||
|
||||
# Use || to a create a new line
|
||||
bee_info_gui_no_hive_desc: "&aDiese Biene hat||&anoch keinen Stock!"
|
||||
|
||||
bee_info_gui_ride: "&fReiten"
|
||||
bee_info_gui_ride_no_permission: "&cDu hast nicht die Erlaubnis auf Bienen zu reiten!"
|
||||
bee_info_gui_ride_angry: "&cDu kannst keine wütenden Bienen reiten!"
|
||||
bee_info_gui_ride_already: "&cDiese Biene ist bereits besetzt!"
|
||||
bee_info_gui_ride_too_far: "&cDu bist zu weit von der Biene entfernt!"
|
||||
|
||||
bee_info_gui_has_stung: "&fHat gestochen?"
|
||||
bee_info_gui_has_nectar: "&fHat Nektar?"
|
||||
|
||||
bee_info_gui_health: "&fGesundheit"
|
||||
|
||||
# Use %health% to represent the bee's health
|
||||
bee_info_gui_health_desc: "&a&7%health% ❤"
|
||||
|
||||
###################
|
||||
# Riding a bee title
|
||||
# Use %name% as a placeholder for the player's name
|
||||
###################
|
||||
ride_bee_title: "&6Du reitest nun"
|
||||
ride_bee_subtitle: "&6eine Biene, &8%name%&6!"
|
||||
|
||||
###################
|
||||
# Protection suit name
|
||||
###################
|
||||
bee_protection_helmet: "&6Bienenschutzhelm"
|
||||
bee_protection_chestplate: "&6Bienenschutzhemd"
|
||||
bee_protection_leggings: "&6Bienenschutzhose"
|
||||
bee_protection_boots: "&6Bienenschutzschuhe"
|
||||
|
||||
###################
|
||||
# Beehive upgrade item
|
||||
###################
|
||||
beehive_upgrade_item_name: "&6Bienenstock Upgrade"
|
||||
|
||||
# Use || to a create a new line
|
||||
beehive_upgrade_item_lore: "&7Bienenwohnraum: &a+3||&8(Zum verwenden rechtsklicken)"
|
||||
|
||||
beehive_upgrade_success: "&aBienenstock verbessert! Neuer Wohnraum: &7%beesno%&a Bienen"
|
||||
beehive_upgrade_max: "&cFehler: Dieser Bienenstock hat bereits den maximalen Wohnraum erreicht!"
|
|
@ -87,10 +87,10 @@ bee_protection_boots: "&6Bottes de protection des abeilles"
|
|||
###################
|
||||
# Beehive upgrade item
|
||||
###################
|
||||
beehive_upgrade_item_name: "&6Beehive Upgrade"
|
||||
beehive_upgrade_item_name: "&6Amélioration de la ruche"
|
||||
|
||||
# Use || to a create a new line
|
||||
beehive_upgrade_item_lore: "&7Bee capacity: &a+3||&8(Right click to use)"
|
||||
beehive_upgrade_item_lore: "&7Capacité d'abeilles: &a+3||&8(Cliquez à droite pour l'utiliser)"
|
||||
|
||||
beehive_upgrade_success: "&aBeehive upgraded! New population: &7%beesno%&a bees"
|
||||
beehive_upgrade_max: "&cError: This beehive has reached the maximum population allowed!"
|
||||
beehive_upgrade_success: "&aLa ruche a été améliorée ! Nouvelle population de: &7%beesno%&a abeilles"
|
||||
beehive_upgrade_max: "&cErreur : Cette ruche a atteint sa capacité maximale !"
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
####################
|
||||
# Yes or no
|
||||
####################
|
||||
text_yes: "&a네"
|
||||
text_no: "&c아니요"
|
||||
|
||||
###################
|
||||
# Beehive GUI
|
||||
###################
|
||||
beehive_info_gui_title: "&8벌집 정보"
|
||||
|
||||
beehive_info_gui_honey_capacity: "&f꿀 용량"
|
||||
|
||||
beehive_info_gui_honey_capacity_desc: "&a용량: &7%current%/%maximum%"
|
||||
|
||||
beehive_info_gui_bee_capacity: "&f벌 용량"
|
||||
|
||||
beehive_info_gui_bee_capacity_desc: "&a용량: &7%current%/%maximum% 벌"
|
||||
|
||||
beehive_info_gui_sedated: "&a진정제"
|
||||
beehive_info_gui_not_sedated: "&c진정제 없음"
|
||||
|
||||
beehive_info_gui_flower: "&f꽃"
|
||||
|
||||
# Use || to a create a new line
|
||||
beehive_info_gui_no_target_flower_desc: "&a이 벌집은 ||&a설정된 꽃이 없습니다!"
|
||||
|
||||
honey_low: "적음"
|
||||
honey_medium: "중간"
|
||||
honey_high: "많음"
|
||||
honey_very_high: "매우 많음"
|
||||
|
||||
###################
|
||||
# Bee GUI
|
||||
###################
|
||||
bee_info_gui_title: "&8벌 정보"
|
||||
|
||||
bee_info_gui_age: "&f나이"
|
||||
bee_info_gui_age_adult: "&a어른"
|
||||
bee_info_gui_age_baby: "&a아기"
|
||||
|
||||
bee_info_gui_anger: "&f화남"
|
||||
|
||||
# Use %level% as a placeholder for the bee's anger level
|
||||
bee_info_gui_anger_level_desc: "&a화남 레벨: &7%level%"
|
||||
|
||||
bee_info_gui_hive_location: "&f벌집 위치"
|
||||
|
||||
# Use || to a create a new line
|
||||
bee_info_gui_no_hive_desc: "&a이 벌은 ||&a벌집을 가지고 있지 않습니다!"
|
||||
|
||||
bee_info_gui_ride: "&f탑승"
|
||||
bee_info_gui_ride_no_permission: "&c벌을 탈 수 있는 권한이 없습니다!"
|
||||
bee_info_gui_ride_angry: "&c화난 벌을 탈 수 없습니다!"
|
||||
bee_info_gui_ride_already: "&c누군가 이미 이 벌을 타고 있습니다!"
|
||||
bee_info_gui_ride_too_far: "&c벌을 타기에는 거리가 너무 멉니다!"
|
||||
|
||||
bee_info_gui_has_stung: "&f찌르기?"
|
||||
bee_info_gui_has_nectar: "&f꿀?"
|
||||
|
||||
bee_info_gui_health: "&f체력"
|
||||
|
||||
# Use %health% to represent the bee's health
|
||||
bee_info_gui_health_desc: "&a체력: &7%health% ❤"
|
||||
|
||||
###################
|
||||
# Riding a bee title
|
||||
# Use %name% as a placeholder for the player's name
|
||||
###################
|
||||
ride_bee_title: "&6벌에 탑승하였습니다."
|
||||
ride_bee_subtitle: "&6이 벌의 이름은 &8%name%&6!"
|
||||
|
||||
###################
|
||||
# Protection suit name
|
||||
###################
|
||||
bee_protection_helmet: "&6벌 보호 투구"
|
||||
bee_protection_chestplate: "&6벌 보호 흉갑"
|
||||
bee_protection_leggings: "&6벌 보호 바지"
|
||||
bee_protection_boots: "&6벌 보호 부츠"
|
||||
|
||||
###################
|
||||
# Beehive upgrade item
|
||||
###################
|
||||
beehive_upgrade_item_name: "&6벌집 업그레이드"
|
||||
|
||||
# Use || to a create a new line
|
||||
beehive_upgrade_item_lore: "&7벌 용량: &a+3||&8(우클릭으로 사용)"
|
||||
|
||||
beehive_upgrade_success: "&a벌집이 업그레이드 되었습니다! 새로운 벌 수용량: &7%beesno%&a 마리"
|
||||
beehive_upgrade_max: "&c에러: 이 벌집은 수용량 최고치에 도달하였습니다!"
|
|
@ -87,10 +87,10 @@ bee_protection_boots: "&6蜜蜂保护靴"
|
|||
###################
|
||||
# Beehive upgrade item
|
||||
###################
|
||||
beehive_upgrade_item_name: "&6Beehive Upgrade"
|
||||
beehive_upgrade_item_name: "&6蜂巢升级"
|
||||
|
||||
# Use || to a create a new line
|
||||
beehive_upgrade_item_lore: "&7Bee capacity: &a+3||&8(Right click to use)"
|
||||
beehive_upgrade_item_lore: "&7蜜蜂容量: &a+3||&8(右键单击查看)"
|
||||
|
||||
beehive_upgrade_success: "&aBeehive upgraded! New population: &7%beesno%&a bees"
|
||||
beehive_upgrade_max: "&cError: This beehive has reached the maximum population allowed!"
|
||||
beehive_upgrade_success: "&a蜂巢升级! 新移入: &7%beesno%&a 蜜蜂"
|
||||
beehive_upgrade_max: "&c错误:此蜂箱已达到允许的最大数量!"
|
|
@ -2,7 +2,7 @@ name: BeesPlus
|
|||
author: Attlantiz
|
||||
version: ${project.version}
|
||||
main: com.tomff.beesplus.BeesPlus
|
||||
api-version: 1.15
|
||||
api-version: 1.18
|
||||
permissions:
|
||||
beesplus.bee.view:
|
||||
default: op
|
||||
|
@ -14,4 +14,3 @@ permissions:
|
|||
default: op
|
||||
beesplus.beehive.upgrade:
|
||||
default: op
|
||||
|
||||
|
|
Loading…
Reference in New Issue