1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 11:45:51 +00:00

Merge pull request #1 from TheBusyBiscuit/master

Comparing new changes
This commit is contained in:
Poma123 2020-02-08 09:53:53 +01:00 committed by GitHub
commit 8acae7133e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 700 additions and 812 deletions

View File

@ -47,6 +47,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>3.2.1</version>
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>

View File

@ -1,107 +0,0 @@
package io.github.thebusybiscuit.slimefun4.api;
import java.util.Collection;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.api.blocks.SlimefunBlock;
import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import io.github.thebusybiscuit.slimefun4.api.items.ItemRestriction;
import io.github.thebusybiscuit.slimefun4.core.SlimefunWorld;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource;
import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.api.PlayerProfile;
/**
* This class will hold the declarations of important API methods for Slimefun.
* Normally these methods will not be implemented in this interface, but some
* methods will have a default implementation for convenience.
*
* @author TheBusyBiscuit
*
*/
public interface SlimefunAPI {
/**
* This method will register the given restriction.
* Calling this should directly influence the outcome of {@link SlimefunAPI#getItemRestrictions()}.
*
* @param restriction The restriction to register
*/
void addItemRestriction(ItemRestriction restriction);
/**
* This method will return a {@link Set} of all instances of {@link ItemRestriction} that will directly
* affect the outcome of {@link SlimefunAPI#isAllowedToUse(Player, ItemStack, boolean)}
*
* @return The Set of all registered item restrictions
*/
Set<ItemRestriction> getItemRestrictions();
/**
* This method will return whether a Player is allowed to use the given {@link ItemStack}.
* If warningMessages is set to true, the Player will be informed about the outcome of this method.
*
* Internally this method will loop through {@link SlimefunAPI#getItemRestrictions()} and perform
* checks using all available instances of {@link ItemRestriction}.
*
* Do NOT warn Players about a restriction if this method returns false.
* Warnings should be exclusively handled via {@link ItemRestriction#warnPlayer(PlayerProfile, Player, SlimefunItem, ItemStack)}
*
* @param p The Player to perform the check on
* @param item The Item to perform the check on
* @param sendWarnings Whether to warn the Player about not being able to use the given item
* @return Whether the Player is allowed to use the given item
*/
default boolean isAllowedToUse(Player p, ItemStack item, boolean sendWarnings) {
PlayerProfile profile = PlayerProfile.get(p);
SlimefunItem sfItem = SlimefunItem.getByItem(item);
for (ItemRestriction restriction : getItemRestrictions()) {
if (!restriction.isAllowed(profile, p, sfItem, item)) {
if (sendWarnings) restriction.warnPlayer(profile, p, sfItem, item);
return false;
}
}
return true;
}
/**
* This method returns a {@link Set} of all registered instances of {@link Category}.
*
* @return A Set of all Categories
*/
Set<Category> getCategories();
/**
* This method returns A {@link Set} of all registered instances of {@link SlimefunItem}.
* Its default implementation generates a new Set based on all items found in the categories
* returned by {@link SlimefunAPI#getCategories()}
*
* @return A Set of all SlimefunItems
*/
default Set<SlimefunItem> getItems() {
return getCategories().stream().flatMap(cat -> cat.getItems().stream()).collect(Collectors.toSet());
}
Optional<SlimefunItem> getSlimefunItem(ItemStack item);
Optional<SlimefunBlock> getBlock(Block b);
SlimefunWorld getWorld(World world);
PlayerProfile getPlayer(OfflinePlayer player);
void registerGEOResource(GEOResource resource);
Collection<OreGenResource> getGEOResources();
}

View File

@ -1,20 +1,35 @@
package io.github.thebusybiscuit.slimefun4.api.geo; package io.github.thebusybiscuit.slimefun4.api.geo;
import org.bukkit.Chunk; import org.bukkit.Chunk;
import org.bukkit.Keyed;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
public interface GEOResource { import me.mrCookieSlime.Slimefun.SlimefunPlugin;
public interface GEOResource extends Keyed {
/** /**
* Returns the default supply of this resource in that biome * Returns the default supply of this resource in that biome
* *
* @param environment The {@link Environment} this area is currently in (NORMAL / NETHER / THE_END)
* @param biome The {@link Biome} this area is currently in.
*
* @return The default supply found in a {@link Chunk} with the given {@link Biome} * @return The default supply found in a {@link Chunk} with the given {@link Biome}
*/ */
int getDefaultSupply(Biome biome); int getDefaultSupply(Environment environment, Biome biome);
/** /**
* Name/ID e.g. "Oil" * Returns how much the value may deviate from the default supply (positive only).
*
* @return The deviation or spread of the supply
*/
int getMaxDeviation();
/**
* Returns the name of this resource (e.g. "Oil")
* *
* @return The name of this Resource * @return The name of this Resource
*/ */
@ -28,14 +43,6 @@ public interface GEOResource {
*/ */
ItemStack getItem(); ItemStack getItem();
/**
* Measurement Unit e.g. "Bucket" / "Buckets".
* Use the amount parameter to determine whether to use singular or plural.
*
* @return The Measurement Unit for this resource, will be treated like a suffix.
*/
String getMeasurementUnit(int amount);
/** /**
* Returns whether this Resource can be obtained using a GEO Miner. * Returns whether this Resource can be obtained using a GEO Miner.
* This will automatically add it to the GEO - Miner. * This will automatically add it to the GEO - Miner.
@ -44,4 +51,16 @@ public interface GEOResource {
*/ */
boolean isObtainableFromGEOMiner(); boolean isObtainableFromGEOMiner();
/**
* Registers this GEO Resource
*/
default void register() {
SlimefunPlugin.getGPSNetwork().getResourceManager().register(this);
}
default String getName(Player p) {
String name = SlimefunPlugin.getLocal().getResourceString(p, "resources." + getKey().getNamespace() + "." + getKey().getKey());
return name == null ? getName(): name;
}
} }

View File

@ -0,0 +1,111 @@
package io.github.thebusybiscuit.slimefun4.api.geo;
import java.util.OptionalInt;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.config.Config;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.cscorelib2.skull.SkullItem;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
public class ResourceManager {
private final int[] backgroundSlots = {0, 1, 2, 3, 5, 6, 7, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53};
private final ItemStack chunkTexture = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODQ0OWI5MzE4ZTMzMTU4ZTY0YTQ2YWIwZGUxMjFjM2Q0MDAwMGUzMzMyYzE1NzQ5MzJiM2M4NDlkOGZhMGRjMiJ9fX0=");
private final Config config = new Config("plugins/Slimefun/resources.yml");
public void register(GEOResource resource) {
boolean enabled = config.getOrSetDefault(resource.getKey().toString().replace(':', '.') + ".enabled", true);
if (enabled) {
SlimefunPlugin.getRegistry().getGEOResources().add(resource);
}
config.save();
}
public OptionalInt getSupplies(GEOResource resource, World world, int x, int z) {
String key = resource.getKey().toString().replace(':', '-');
String value = BlockStorage.getChunkInfo(world, x, z, key);
if (value != null) {
return OptionalInt.of(Integer.parseInt(value));
}
else {
return OptionalInt.empty();
}
}
public void setSupplies(GEOResource resource, World world, int x, int z, int value) {
String key = resource.getKey().toString().replace(':', '-');
BlockStorage.setChunkInfo(world, x, z, key, String.valueOf(value));
}
private int generate(GEOResource resource, World world, int x, int z) {
Block block = world.getBlockAt(x << 4, 72, z << 4);
int value = resource.getDefaultSupply(world.getEnvironment(), block.getBiome());
if (value > 0) {
value += ThreadLocalRandom.current().nextInt(resource.getMaxDeviation());
}
setSupplies(resource, world, x, z, value);
return value;
}
public void scan(Player p, Block block) {
if (SlimefunPlugin.getGPSNetwork().getNetworkComplexity(p.getUniqueId()) < 600) {
SlimefunPlugin.getLocal().sendMessages(p, "gps.insufficient-complexity", true, msg -> msg.replace("%complexity%", "600"));
return;
}
int x = block.getX() >> 4;
int z = block.getZ() >> 4;
ChestMenu menu = new ChestMenu("&4" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.results"));
for (int slot : backgroundSlots) {
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
}
menu.addItem(4, new CustomItem(chunkTexture,
"&e" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.chunk"),
"",
"&8\u21E8 &7" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.world") + ": " + block.getWorld().getName(),
"&8\u21E8 &7X: " + x + " Z: " + z
), ChestMenuUtils.getEmptyClickHandler());
int index = 10;
for (GEOResource resource : SlimefunPlugin.getRegistry().getGEOResources().values()) {
OptionalInt optional = getSupplies(resource, block.getWorld(), x, z);
int supplies = optional.isPresent() ? optional.getAsInt() : generate(resource, block.getWorld(), x, z);
String suffix = SlimefunPlugin.getLocal().getResourceString(p, supplies == 1 ? "tooltips.unit" : "tooltips.units");
ItemStack item = new CustomItem(resource.getItem(), "&r" + resource.getName(p), "&8\u21E8 &e" + supplies + ' ' + suffix);
if (supplies > 1) {
item.setAmount(supplies > item.getMaxStackSize() ? item.getMaxStackSize(): supplies);
}
menu.addItem(index, item, ChestMenuUtils.getEmptyClickHandler());
index++;
if (index % 9 == 8) {
index += 2;
}
}
menu.open(p);
}
}

View File

@ -1,4 +1,4 @@
package me.mrCookieSlime.Slimefun.GPS; package io.github.thebusybiscuit.slimefun4.api.gps;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
@ -19,6 +19,7 @@ import io.github.thebusybiscuit.cscorelib2.config.Config;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler; import io.github.thebusybiscuit.cscorelib2.math.DoubleHandler;
import io.github.thebusybiscuit.cscorelib2.skull.SkullItem; import io.github.thebusybiscuit.cscorelib2.skull.SkullItem;
import io.github.thebusybiscuit.slimefun4.api.geo.ResourceManager;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
@ -29,23 +30,24 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage;
public class GPSNetwork { public class GPSNetwork {
private static final String DIRECTORY = "data-storage/Slimefun/waypoints/"; private static final String WAYPOINTS_DIRECTORY = "data-storage/Slimefun/waypoints/";
private final int[] border = {0, 1, 3, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53}; private final int[] border = {0, 1, 3, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53};
private final int[] inventory = {19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 41, 42, 43}; private final int[] inventory = {19, 20, 21, 22, 23, 24, 25, 28, 29, 30, 31, 32, 33, 34, 37, 38, 39, 40, 41, 42, 43};
private final Map<UUID, Set<Location>> transmitters = new HashMap<>(); private final Map<UUID, Set<Location>> transmitters = new HashMap<>();
private final GPSTeleportation teleportation = new GPSTeleportation(this); private final TeleportationManager teleportation = new TeleportationManager(this);
private final ResourceManager resourceManager = new ResourceManager();
private final ItemStack deathpointIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWFlMzg1NWY5NTJjZDRhMDNjMTQ4YTk0NmUzZjgxMmE1OTU1YWQzNWNiY2I1MjYyN2VhNGFjZDQ3ZDMwODEifX19"); private final ItemStack deathpointIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMWFlMzg1NWY5NTJjZDRhMDNjMTQ4YTk0NmUzZjgxMmE1OTU1YWQzNWNiY2I1MjYyN2VhNGFjZDQ3ZDMwODEifX19");
private final ItemStack netherIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDgzNTcxZmY1ODlmMWE1OWJiMDJiODA4MDBmYzczNjExNmUyN2MzZGNmOWVmZWJlZGU4Y2YxZmRkZSJ9fX0="); private final ItemStack netherIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDgzNTcxZmY1ODlmMWE1OWJiMDJiODA4MDBmYzczNjExNmUyN2MzZGNmOWVmZWJlZGU4Y2YxZmRkZSJ9fX0=");
private final ItemStack endIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZjYWM1OWIyYWFlNDg5YWEwNjg3YjVkODAyYjI1NTVlYjE0YTQwYmQ2MmIyMWViMTE2ZmE1NjljZGI3NTYifX19"); private final ItemStack endIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzZjYWM1OWIyYWFlNDg5YWEwNjg3YjVkODAyYjI1NTVlYjE0YTQwYmQ2MmIyMWViMTE2ZmE1NjljZGI3NTYifX19");
private final ItemStack worldIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0="); private final ItemStack worldIcon = SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0=");
public void updateTransmitter(Location l, UUID uuid, NetworkStatus status) { public void updateTransmitter(Location l, UUID uuid, boolean online) {
Set<Location> set = transmitters.getOrDefault(uuid, new HashSet<>()); Set<Location> set = transmitters.getOrDefault(uuid, new HashSet<>());
if (status == NetworkStatus.ONLINE) { if (online) {
if (set.add(l)) { if (set.add(l)) {
transmitters.put(uuid, set); transmitters.put(uuid, set);
} }
@ -164,7 +166,7 @@ public class GPSNetwork {
menu.addItem(slot, new CustomItem(globe, entry.getKey(), "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "", "&8\u21E8 &cClick to delete")); menu.addItem(slot, new CustomItem(globe, entry.getKey(), "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "", "&8\u21E8 &cClick to delete"));
menu.addMenuClickHandler(slot, (pl, slotn, item, action) -> { menu.addMenuClickHandler(slot, (pl, slotn, item, action) -> {
String id = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', entry.getKey())).toUpperCase().replace(' ', '_'); String id = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', entry.getKey())).toUpperCase().replace(' ', '_');
Config cfg = new Config(DIRECTORY + pl.getUniqueId().toString() + ".yml"); Config cfg = new Config(WAYPOINTS_DIRECTORY + pl.getUniqueId().toString() + ".yml");
cfg.setValue(id, null); cfg.setValue(id, null);
cfg.save(); cfg.save();
pl.playSound(pl.getLocation(), Sound.UI_BUTTON_CLICK, 1F, 1F); pl.playSound(pl.getLocation(), Sound.UI_BUTTON_CLICK, 1F, 1F);
@ -181,7 +183,7 @@ public class GPSNetwork {
public Map<String, Location> getWaypoints(UUID uuid) { public Map<String, Location> getWaypoints(UUID uuid) {
Map<String, Location> map = new HashMap<>(); Map<String, Location> map = new HashMap<>();
Config cfg = new Config(DIRECTORY + uuid.toString() + ".yml"); Config cfg = new Config(WAYPOINTS_DIRECTORY + uuid.toString() + ".yml");
for (String key : cfg.getKeys()) { for (String key : cfg.getKeys()) {
if (cfg.contains(key + ".world") && Bukkit.getWorld(cfg.getString(key + ".world")) != null) { if (cfg.contains(key + ".world") && Bukkit.getWorld(cfg.getString(key + ".world")) != null) {
@ -212,7 +214,7 @@ public class GPSNetwork {
return; return;
} }
Config cfg = new Config(DIRECTORY + p.getUniqueId().toString() + ".yml"); Config cfg = new Config(WAYPOINTS_DIRECTORY + p.getUniqueId().toString() + ".yml");
String id = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', name)).toUpperCase().replace(' ', '_'); String id = ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', name)).toUpperCase().replace(' ', '_');
cfg.setValue(id, l); cfg.setValue(id, l);
@ -227,8 +229,12 @@ public class GPSNetwork {
return transmitters.getOrDefault(uuid, new HashSet<>()); return transmitters.getOrDefault(uuid, new HashSet<>());
} }
public GPSTeleportation getTeleleportationService() { public TeleportationManager getTeleleportationService() {
return teleportation; return teleportation;
} }
public ResourceManager getResourceManager() {
return resourceManager;
}
} }

View File

@ -1,4 +1,4 @@
package me.mrCookieSlime.Slimefun.GPS; package io.github.thebusybiscuit.slimefun4.api.gps;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
@ -23,7 +23,7 @@ import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.Slimefun;
public final class GPSTeleportation { public final class TeleportationManager {
private final Set<UUID> teleporterUsers = new HashSet<>(); private final Set<UUID> teleporterUsers = new HashSet<>();
private final int[] teleporterBorder = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53}; private final int[] teleporterBorder = {0, 1, 2, 3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53};
@ -31,7 +31,7 @@ public final class GPSTeleportation {
private final GPSNetwork network; private final GPSNetwork network;
public GPSTeleportation(GPSNetwork gpsNetwork) { public TeleportationManager(GPSNetwork gpsNetwork) {
network = gpsNetwork; network = gpsNetwork;
} }

View File

@ -15,13 +15,12 @@ import org.bukkit.entity.EntityType;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.collections.KeyMap; import io.github.thebusybiscuit.cscorelib2.collections.KeyMap;
import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import io.github.thebusybiscuit.slimefun4.core.guide.BookSlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.BookSlimefunGuide;
import io.github.thebusybiscuit.slimefun4.core.guide.ChestSlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.ChestSlimefunGuide;
import io.github.thebusybiscuit.slimefun4.core.guide.ISlimefunGuide; import io.github.thebusybiscuit.slimefun4.core.guide.ISlimefunGuide;
import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout; import io.github.thebusybiscuit.slimefun4.core.guide.SlimefunGuideLayout;
import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.MultiBlock; import me.mrCookieSlime.Slimefun.Objects.MultiBlock;
import me.mrCookieSlime.Slimefun.Objects.Research; import me.mrCookieSlime.Slimefun.Objects.Research;
@ -51,8 +50,7 @@ public class SlimefunRegistry {
private final Set<String> activeChunks = new HashSet<>(); private final Set<String> activeChunks = new HashSet<>();
private final Set<UUID> researchingPlayers = new HashSet<>(); private final Set<UUID> researchingPlayers = new HashSet<>();
private final Map<String, OreGenResource> geoResources = new HashMap<>(); private final KeyMap<GEOResource> geoResources = new KeyMap<>();
private final Map<String, Config> geoResourcesConfigs = new HashMap<>();
private final Set<String> energyGenerators = new HashSet<>(); private final Set<String> energyGenerators = new HashSet<>();
private final Set<String> energyCapacitors = new HashSet<>(); private final Set<String> energyCapacitors = new HashSet<>();
@ -188,14 +186,10 @@ public class SlimefunRegistry {
return activeTickers; return activeTickers;
} }
public Map<String, OreGenResource> getGEOResources() { public KeyMap<GEOResource> getGEOResources() {
return geoResources; return geoResources;
} }
public Map<String, Config> getGEOResourceConfigs() {
return geoResourcesConfigs;
}
@Deprecated @Deprecated
public Map<Integer, List<GuideHandler>> getGuideHandlers() { public Map<Integer, List<GuideHandler>> getGuideHandlers() {
return guideHandlers; return guideHandlers;

View File

@ -379,7 +379,7 @@ public class ChestSlimefunGuide implements ISlimefunGuide {
RecipeChoice[] choices = SlimefunPlugin.getMinecraftRecipes().getRecipeInput(recipe); RecipeChoice[] choices = SlimefunPlugin.getMinecraftRecipes().getRecipeInput(recipe);
if (choices[0] instanceof MaterialChoice) { if (choices.length == 1 && choices[0] instanceof MaterialChoice) {
recipeItems[4] = new ItemStack(((MaterialChoice) choices[0]).getChoices().get(0)); recipeItems[4] = new ItemStack(((MaterialChoice) choices[0]).getChoices().get(0));
if (((MaterialChoice) choices[0]).getChoices().size() > 1) { if (((MaterialChoice) choices[0]).getChoices().size() > 1) {

View File

@ -299,8 +299,7 @@ public final class GuideSettings {
for (Language language : SlimefunPlugin.getLocal().getLanguages()) { for (Language language : SlimefunPlugin.getLocal().getLanguages()) {
menu.addItem(slot, new CustomItem(language.getItem(), menu.addItem(slot, new CustomItem(language.getItem(),
ChatColor.GREEN + language.getName(p), ChatColor.GREEN + language.getName(p),
"&7" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.progress.messages") + ": &b" + SlimefunPlugin.getLocal().getProgress(language, Language::getMessages) + '%', "&b" + SlimefunPlugin.getLocal().getProgress(language) + '%',
"&7" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.progress.researches") + ": &b" + SlimefunPlugin.getLocal().getProgress(language, Language::getResearches) + '%',
"", "",
"&7\u21E8 &e" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.select") "&7\u21E8 &e" + SlimefunPlugin.getLocal().getMessage(p, "guide.languages.select")
), (pl, i, item, action) -> { ), (pl, i, item, action) -> {

View File

@ -8,7 +8,6 @@ import java.util.Collection;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import java.util.Optional; import java.util.Optional;
import java.util.function.Function;
import java.util.logging.Level; import java.util.logging.Level;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
@ -44,7 +43,7 @@ public class LocalizationService extends SlimefunLocalization {
defaultLanguage.setMessages(getConfig().getConfiguration()); defaultLanguage.setMessages(getConfig().getConfiguration());
for (SupportedLanguage lang : SupportedLanguage.values()) { for (SupportedLanguage lang : SupportedLanguage.values()) {
addLanguage(lang.getId(), lang.getTexture()); addLanguage(lang.getID(), lang.getTexture());
} }
String language = getConfig().getString(LANGUAGE_PATH); String language = getConfig().getString(LANGUAGE_PATH);
@ -82,7 +81,7 @@ public class LocalizationService extends SlimefunLocalization {
@Override @Override
public boolean hasLanguage(String language) { public boolean hasLanguage(String language) {
// Checks if our jar files contains any .yml file for this id // Checks if our jar files contains any .yml file for this id
return containsResource("messages_" + language) || containsResource("researches_" + language); return containsResource("messages_" + language) || containsResource("researches_" + language) || containsResource("resources_" + language);
} }
private boolean containsResource(String file) { private boolean containsResource(String file) {
@ -119,6 +118,11 @@ public class LocalizationService extends SlimefunLocalization {
getConfig().clear(); getConfig().clear();
} }
defaultLanguage.setResearches(streamConfigFile("researches_" + language + ".yml", null));
defaultLanguage.setResources(streamConfigFile("resources_" + language + ".yml", null));
defaultLanguage.setCategories(streamConfigFile("categories_" + language + ".yml", null));
Slimefun.getLogger().log(Level.INFO, "Loaded language \"{0}\"", language); Slimefun.getLogger().log(Level.INFO, "Loaded language \"{0}\"", language);
getConfig().setValue(LANGUAGE_PATH, language); getConfig().setValue(LANGUAGE_PATH, language);
@ -139,23 +143,37 @@ public class LocalizationService extends SlimefunLocalization {
if (hasLanguage(id)) { if (hasLanguage(id)) {
FileConfiguration messages = streamConfigFile("messages_" + id + ".yml", getConfig().getConfiguration()); FileConfiguration messages = streamConfigFile("messages_" + id + ".yml", getConfig().getConfiguration());
FileConfiguration researches = streamConfigFile("researches_" + id + ".yml", null); FileConfiguration researches = streamConfigFile("researches_" + id + ".yml", null);
FileConfiguration resources = streamConfigFile("resources_" + id + ".yml", null);
FileConfiguration categories = streamConfigFile("categories_" + id + ".yml", null);
Language language = new Language(id, hash); Language language = new Language(id, hash);
language.setMessages(messages); language.setMessages(messages);
language.setResearches(researches); language.setResearches(researches);
language.setResources(resources);
language.setCategories(categories);
languages.put(id, language); languages.put(id, language);
} }
} }
public double getProgress(Language lang, Function<Language, FileConfiguration> method) { public double getProgress(Language lang) {
double defaultKeys = getTotalKeys(method.apply(languages.get("en"))); double defaultKeys = getTotalKeys(languages.get(SupportedLanguage.ENGLISH.getID()));
if (defaultKeys == 0) return 0; if (defaultKeys == 0) return 0;
return DoubleHandler.fixDouble(100.0 * (getTotalKeys(method.apply(lang)) / defaultKeys)); return DoubleHandler.fixDouble(100.0 * (getTotalKeys(lang) / defaultKeys));
} }
private double getTotalKeys(FileConfiguration cfg) { private double getTotalKeys(Language lang) {
return cfg != null ? cfg.getKeys(true).size(): 0; return getKeys(lang.getMessages(), lang.getResearches(), lang.getResources(), lang.getCategories());
}
private double getKeys(FileConfiguration... files) {
int keys = 0;
for (FileConfiguration cfg : files) {
keys += cfg != null ? cfg.getKeys(true).size() : 0;
}
return keys;
} }
private FileConfiguration streamConfigFile(String file, FileConfiguration defaults) { private FileConfiguration streamConfigFile(String file, FileConfiguration defaults) {

View File

@ -14,6 +14,8 @@ public final class Language {
private FileConfiguration messages; private FileConfiguration messages;
private FileConfiguration researches; private FileConfiguration researches;
private FileConfiguration resources;
private FileConfiguration categories;
public Language(String id, String hash) { public Language(String id, String hash) {
this.id = id; this.id = id;
@ -34,6 +36,14 @@ public final class Language {
return researches; return researches;
} }
public FileConfiguration getResources() {
return resources;
}
public FileConfiguration getCategories() {
return categories;
}
public void setMessages(FileConfiguration config) { public void setMessages(FileConfiguration config) {
this.messages = config; this.messages = config;
} }
@ -42,6 +52,14 @@ public final class Language {
this.researches = config; this.researches = config;
} }
public void setResources(FileConfiguration config) {
this.resources = config;
}
public void setCategories(FileConfiguration config) {
this.categories = config;
}
public ItemStack getItem() { public ItemStack getItem() {
return item; return item;
} }

View File

@ -43,6 +43,25 @@ public abstract class SlimefunLocalization extends Localization implements Keyed
return language.getResearches().getString(key.getNamespace() + "." + key.getKey()); return language.getResearches().getString(key.getNamespace() + "." + key.getKey());
} }
public String getCategoryName(Player p, NamespacedKey key) {
Language language = getLanguage(p);
if (language.getCategories() == null) return null;
return language.getCategories().getString(key.getNamespace() + "." + key.getKey());
}
public String getResourceString(Player p, String key) {
Language language = getLanguage(p);
String value = language.getResources() != null ? language.getResources().getString(key): null;
if (value != null) {
return value;
}
else {
return getLanguage("en").getResources().getString(key);
}
}
@Override @Override
public void sendMessage(CommandSender sender, String key, boolean addPrefix) { public void sendMessage(CommandSender sender, String key, boolean addPrefix) {
String prefix = addPrefix ? getPrefix(): ""; String prefix = addPrefix ? getPrefix(): "";

View File

@ -39,7 +39,7 @@ public enum SupportedLanguage {
this.textureHash = textureHash; this.textureHash = textureHash;
} }
public String getId() { public String getID() {
return id; return id;
} }

View File

@ -72,6 +72,9 @@ public class Translators {
// Translators - Chinese (Taiwan) // Translators - Chinese (Taiwan)
addTranslator("BrineYT", "zh-TW", true); addTranslator("BrineYT", "zh-TW", true);
addTranslator("mio9", "zh-TW", true); addTranslator("mio9", "zh-TW", true);
// Translators - Arabic
addTranslator("mohkamfer", "citBabY", "ar", false);
} }
private void addTranslator(String name, String language, boolean lock) { private void addTranslator(String name, String language, boolean lock) {

View File

@ -1,36 +0,0 @@
package io.github.thebusybiscuit.slimefun4.implementation.geo.resources;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
public class NetherIceResource implements OreGenResource {
@Override
public int getDefaultSupply(Biome biome) {
return biome == Biome.NETHER ? 32: 0;
}
@Override
public String getName() {
return "Nether Ice";
}
@Override
public ItemStack getIcon() {
return SlimefunItems.NETHER_ICE.clone();
}
@Override
public String getMeasurementUnit() {
return "Block(s)";
}
@Override
public boolean isLiquid() {
return false;
}
}

View File

@ -1,76 +0,0 @@
package io.github.thebusybiscuit.slimefun4.implementation.geo.resources;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
public class SaltResource implements OreGenResource {
@Override
public int getDefaultSupply(Biome biome) {
Random random = ThreadLocalRandom.current();
switch (biome) {
case SNOWY_BEACH:
case STONE_SHORE:
case BEACH:
case DESERT_LAKES:
case RIVER:
case ICE_SPIKES:
case FROZEN_RIVER:
return random.nextInt(40) + 3;
case DEEP_OCEAN:
case OCEAN:
case COLD_OCEAN:
case DEEP_COLD_OCEAN:
case DEEP_FROZEN_OCEAN:
case DEEP_LUKEWARM_OCEAN:
case DEEP_WARM_OCEAN:
case FROZEN_OCEAN:
case LUKEWARM_OCEAN:
case WARM_OCEAN:
return random.nextInt(60) + 24;
case SWAMP:
case SWAMP_HILLS:
return random.nextInt(20) + 4;
case THE_END:
case END_BARRENS:
case END_MIDLANDS:
case SMALL_END_ISLANDS:
case NETHER:
return 0;
default:
return random.nextInt(6) + 4;
}
}
@Override
public String getName() {
return "Salt";
}
@Override
public ItemStack getIcon() {
return SlimefunItems.SALT.clone();
}
@Override
public String getMeasurementUnit() {
return "Crystal(s)";
}
@Override
public boolean isLiquid() {
return false;
}
}

View File

@ -1,50 +0,0 @@
package io.github.thebusybiscuit.slimefun4.implementation.geo.resources;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
public class UraniumResource implements OreGenResource {
@Override
public int getDefaultSupply(Biome biome) {
Random random = ThreadLocalRandom.current();
switch (biome) {
case THE_END:
case END_BARRENS:
case END_MIDLANDS:
case SMALL_END_ISLANDS:
case NETHER:
return 0;
default:
return random.nextInt(5) + 1;
}
}
@Override
public String getName() {
return "Small Chunks of Uranium";
}
@Override
public ItemStack getIcon() {
return SlimefunItems.SMALL_URANIUM.clone();
}
@Override
public String getMeasurementUnit() {
return "Piece(s)";
}
@Override
public boolean isLiquid() {
return false;
}
}

View File

@ -0,0 +1,46 @@
package io.github.thebusybiscuit.slimefun4.implementation.resources;
import org.bukkit.NamespacedKey;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
public class NetherIceResource implements GEOResource {
private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "nether_ice");
@Override
public int getDefaultSupply(Environment environment, Biome biome) {
return environment == Environment.NETHER ? 32: 0;
}
@Override
public NamespacedKey getKey() {
return key;
}
@Override
public int getMaxDeviation() {
return 6;
}
@Override
public String getName() {
return "Nether Ice";
}
@Override
public ItemStack getItem() {
return SlimefunItems.NETHER_ICE.clone();
}
@Override
public boolean isObtainableFromGEOMiner() {
return true;
}
}

View File

@ -1,50 +1,48 @@
package io.github.thebusybiscuit.slimefun4.implementation.geo.resources; package io.github.thebusybiscuit.slimefun4.implementation.resources;
import java.util.Random;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.NamespacedKey;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome; import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource; import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
public class OilResource implements OreGenResource { public class OilResource implements GEOResource {
private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "oil");
@Override @Override
public int getDefaultSupply(Biome biome) { public int getDefaultSupply(Environment environment, Biome biome) {
Random random = ThreadLocalRandom.current();
if (environment != Environment.NORMAL) {
return 0;
}
switch (biome) { switch (biome) {
case SNOWY_BEACH: case SNOWY_BEACH:
case STONE_SHORE: case STONE_SHORE:
case BEACH: case BEACH:
return random.nextInt(6) + 2; return 6;
case DESERT: case DESERT:
case DESERT_HILLS: case DESERT_HILLS:
case DESERT_LAKES: case DESERT_LAKES:
return random.nextInt(40) + 19; return 45;
case MOUNTAINS: case MOUNTAINS:
case GRAVELLY_MOUNTAINS: case GRAVELLY_MOUNTAINS:
case MOUNTAIN_EDGE: case MOUNTAIN_EDGE:
case RIVER: case RIVER:
return random.nextInt(14) + 13; return 17;
case SNOWY_MOUNTAINS: case SNOWY_MOUNTAINS:
case SNOWY_TUNDRA: case SNOWY_TUNDRA:
case ICE_SPIKES: case ICE_SPIKES:
case FROZEN_OCEAN: case FROZEN_OCEAN:
case FROZEN_RIVER: case FROZEN_RIVER:
return random.nextInt(11) + 3; return 14;
case THE_END:
case END_BARRENS:
case END_MIDLANDS:
case SMALL_END_ISLANDS:
case NETHER:
return 0;
case BADLANDS: case BADLANDS:
case BADLANDS_PLATEAU: case BADLANDS_PLATEAU:
@ -54,7 +52,7 @@ public class OilResource implements OreGenResource {
case MODIFIED_WOODED_BADLANDS_PLATEAU: case MODIFIED_WOODED_BADLANDS_PLATEAU:
case MUSHROOM_FIELDS: case MUSHROOM_FIELDS:
case MUSHROOM_FIELD_SHORE: case MUSHROOM_FIELD_SHORE:
return random.nextInt(24) + 14; return 24;
case DEEP_OCEAN: case DEEP_OCEAN:
case OCEAN: case OCEAN:
@ -65,35 +63,40 @@ public class OilResource implements OreGenResource {
case DEEP_WARM_OCEAN: case DEEP_WARM_OCEAN:
case LUKEWARM_OCEAN: case LUKEWARM_OCEAN:
case WARM_OCEAN: case WARM_OCEAN:
return random.nextInt(62) + 24; return 62;
case SWAMP: case SWAMP:
case SWAMP_HILLS: case SWAMP_HILLS:
return random.nextInt(20) + 4; return 20;
default: default:
return random.nextInt(10) + 6; return 10;
} }
} }
@Override
public NamespacedKey getKey() {
return key;
}
@Override
public int getMaxDeviation() {
return 8;
}
@Override @Override
public String getName() { public String getName() {
return "Oil"; return "Oil";
} }
@Override @Override
public ItemStack getIcon() { public ItemStack getItem() {
return SlimefunItems.BUCKET_OF_OIL.clone(); return SlimefunItems.BUCKET_OF_OIL.clone();
} }
@Override @Override
public String getMeasurementUnit() { public boolean isObtainableFromGEOMiner() {
return "Bucket(s)"; return false;
}
@Override
public boolean isLiquid() {
return true;
} }
} }

View File

@ -0,0 +1,79 @@
package io.github.thebusybiscuit.slimefun4.implementation.resources;
import org.bukkit.NamespacedKey;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
public class SaltResource implements GEOResource {
private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "salt");
@Override
public int getDefaultSupply(Environment environment, Biome biome) {
if (environment != Environment.NORMAL) {
return 0;
}
switch (biome) {
case SNOWY_BEACH:
case STONE_SHORE:
case BEACH:
case DESERT_LAKES:
case RIVER:
case ICE_SPIKES:
case FROZEN_RIVER:
return 40;
case DEEP_OCEAN:
case OCEAN:
case COLD_OCEAN:
case DEEP_COLD_OCEAN:
case DEEP_FROZEN_OCEAN:
case DEEP_LUKEWARM_OCEAN:
case DEEP_WARM_OCEAN:
case FROZEN_OCEAN:
case LUKEWARM_OCEAN:
case WARM_OCEAN:
return 60;
case SWAMP:
case SWAMP_HILLS:
return 20;
default:
return 6;
}
}
@Override
public int getMaxDeviation() {
return 18;
}
@Override
public NamespacedKey getKey() {
return key;
}
@Override
public String getName() {
return "Salt";
}
@Override
public ItemStack getItem() {
return SlimefunItems.SALT.clone();
}
@Override
public boolean isObtainableFromGEOMiner() {
return true;
}
}

View File

@ -0,0 +1,50 @@
package io.github.thebusybiscuit.slimefun4.implementation.resources;
import org.bukkit.NamespacedKey;
import org.bukkit.World.Environment;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
public class UraniumResource implements GEOResource {
private final NamespacedKey key = new NamespacedKey(SlimefunPlugin.instance, "uranium");
@Override
public int getDefaultSupply(Environment envionment, Biome biome) {
if (envionment == Environment.NORMAL) {
return 5;
}
return 0;
}
@Override
public NamespacedKey getKey() {
return key;
}
@Override
public int getMaxDeviation() {
return 2;
}
@Override
public String getName() {
return "Small Chunks of Uranium";
}
@Override
public ItemStack getItem() {
return SlimefunItems.SMALL_URANIUM.clone();
}
@Override
public boolean isObtainableFromGEOMiner() {
return true;
}
}

View File

@ -177,11 +177,11 @@ import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.Slimefun; import me.mrCookieSlime.Slimefun.api.Slimefun;
import me.mrCookieSlime.Slimefun.api.SlimefunItemStack; import me.mrCookieSlime.Slimefun.api.SlimefunItemStack;
public final class SlimefunSetup { public final class SlimefunItemSetup {
private SlimefunSetup() {} private SlimefunItemSetup() {}
public static void setupItems() { public static void setup() {
new SlimefunItem(Categories.WEAPONS, (SlimefunItemStack) SlimefunItems.GRANDMAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE, new SlimefunItem(Categories.WEAPONS, (SlimefunItemStack) SlimefunItems.GRANDMAS_WALKING_STICK, RecipeType.ENHANCED_CRAFTING_TABLE,
new ItemStack[] {null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null}) new ItemStack[] {null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null, null, new ItemStack(Material.OAK_LOG), null})
.register(true); .register(true);

View File

@ -1,58 +0,0 @@
package me.mrCookieSlime.Slimefun.GEO;
import org.bukkit.Chunk;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.cscorelib2.skull.SkullItem;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
public final class GEOScanner {
private static final int[] BACKGROUND_SLOTS = {0, 1, 2, 3, 5, 6, 7, 8, 9, 17, 18, 26, 27, 35, 36, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53};
private GEOScanner() {}
public static void scanChunk(Player p, Chunk chunk) {
if (SlimefunPlugin.getGPSNetwork().getNetworkComplexity(p.getUniqueId()) < 600) {
SlimefunPlugin.getLocal().sendMessages(p, "gps.insufficient-complexity", true, msg -> msg.replace("%complexity%", "600"));
return;
}
ChestMenu menu = new ChestMenu("&4GEO-Scan Results");
for (int slot : BACKGROUND_SLOTS) {
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
}
menu.addItem(4, new CustomItem(SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODQ0OWI5MzE4ZTMzMTU4ZTY0YTQ2YWIwZGUxMjFjM2Q0MDAwMGUzMzMyYzE1NzQ5MzJiM2M4NDlkOGZhMGRjMiJ9fX0="),
"&eScanned Chunk",
"",
"&8\u21E8 &7World: " + chunk.getWorld().getName(),
"&8\u21E8 &7X: " + chunk.getX() + " Z: " + chunk.getZ()
), ChestMenuUtils.getEmptyClickHandler());
int index = 10;
for (OreGenResource resource : OreGenSystem.listResources()) {
int supply = OreGenSystem.getSupplies(resource, chunk, true);
ItemStack item = new CustomItem(resource.getItem(), "&r" + resource.getName(), "&8\u21E8 &e" + supply + ' ' + resource.getMeasurementUnit());
if (supply > 1) {
item.setAmount(supply > item.getMaxStackSize() ? item.getMaxStackSize(): supply);
}
menu.addItem(index, item, ChestMenuUtils.getEmptyClickHandler());
index++;
if (index % 9 == 8) {
index += 2;
}
}
menu.open(p);
}
}

View File

@ -1,35 +0,0 @@
package me.mrCookieSlime.Slimefun.GEO;
import org.bukkit.block.Biome;
import org.bukkit.inventory.ItemStack;
public interface OreGenResource {
/**
* Returns the default supply of this resource in that biome
*/
int getDefaultSupply(Biome biome);
/**
* Name/ID e.g. "Oil"
*/
String getName();
@Deprecated
ItemStack getIcon();
default ItemStack getItem() {
return getIcon();
}
/**
* Measurement Unit e.g. "Buckets"
*/
String getMeasurementUnit();
/**
* Returns whether this Resource is considered a fluid
*/
boolean isLiquid();
}

View File

@ -1,126 +0,0 @@
package me.mrCookieSlime.Slimefun.GEO;
import java.util.Collection;
import java.util.concurrent.ThreadLocalRandom;
import java.util.logging.Level;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.block.Biome;
import io.github.thebusybiscuit.cscorelib2.config.Config;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.api.BlockStorage;
import me.mrCookieSlime.Slimefun.api.Slimefun;
public final class OreGenSystem {
private OreGenSystem() {}
public static Collection<OreGenResource> listResources() {
return SlimefunPlugin.getRegistry().getGEOResources().values();
}
public static void registerResource(OreGenResource resource) {
Config cfg = new Config("plugins/Slimefun/generators/" + resource.getName() + ".yml");
cfg.setDefaultValue("enabled", true);
for (Biome biome : Biome.values()) {
cfg.setDefaultValue("spawn-rates." + biome.toString(), resource.getDefaultSupply(biome));
}
cfg.save();
if (cfg.getBoolean("enabled")) {
Slimefun.getLogger().log(Level.INFO, "Registering Ore Gen: " + resource.getName());
SlimefunPlugin.getRegistry().getGEOResources().put(resource.getName(), resource);
SlimefunPlugin.getRegistry().getGEOResourceConfigs().put(resource.getName(), cfg);
}
}
public static OreGenResource getResource(String name) {
return SlimefunPlugin.getRegistry().getGEOResources().get(name);
}
private static int getDefault(OreGenResource resource, Biome biome) {
if (resource == null) {
return 0;
}
else {
int supply = SlimefunPlugin.getRegistry().getGEOResourceConfigs().get(resource.getName()).getInt("spawn-rates." + biome.toString());
return supply > 0 ? (supply + ThreadLocalRandom.current().nextInt(3)): 0;
}
}
public static void setSupplies(OreGenResource resource, Chunk chunk, int amount) {
if (resource != null) {
BlockStorage.setChunkInfo(chunk, "resources_" + resource.getName().toUpperCase(), String.valueOf(amount));
}
}
public static void setSupplies(OreGenResource resource, Location l, int amount) {
if (resource != null) {
BlockStorage.setChunkInfo(l, "resources_" + resource.getName().toUpperCase(), String.valueOf(amount));
}
}
public static int generateSupplies(OreGenResource resource, Chunk chunk) {
if (resource == null) return 0;
int supplies = getDefault(resource, chunk.getBlock(7, 60, 7).getBiome());
BlockStorage.setChunkInfo(chunk, "resources_" + resource.getName().toUpperCase(), String.valueOf(supplies));
return supplies;
}
public static int generateSupplies(OreGenResource resource, Location l) {
if (resource == null) return 0;
int supplies = getDefault(resource, l.getBlock().getBiome());
BlockStorage.setChunkInfo(l, "resources_" + resource.getName().toUpperCase(), String.valueOf(supplies));
return supplies;
}
public static int getSupplies(OreGenResource resource, Chunk chunk, boolean generate) {
if (resource == null) return 0;
String supply = BlockStorage.getChunkInfo(chunk, "resources_" + resource.getName().toUpperCase());
if (supply != null) {
return Integer.parseInt(supply);
}
else if (!generate) {
return 0;
}
else {
return generateSupplies(resource, chunk);
}
}
public static int getSupplies(OreGenResource resource, Location l, boolean generate) {
if (resource == null) return 0;
String supply = BlockStorage.getChunkInfo(l, "resources_" + resource.getName().toUpperCase());
if (supply != null) {
return Integer.parseInt(supply);
}
else if (!generate) {
return 0;
}
else {
return generateSupplies(resource, l);
}
}
public static boolean wasResourceGenerated(OreGenResource resource, Chunk chunk) {
if (resource == null) return false;
return BlockStorage.hasChunkInfo(chunk, "resources_" + resource.getName().toUpperCase());
}
public static boolean wasResourceGenerated(OreGenResource resource, Location l) {
if (resource == null) return false;
return BlockStorage.hasChunkInfo(l, "resources_" + resource.getName().toUpperCase());
}
}

View File

@ -1,8 +0,0 @@
package me.mrCookieSlime.Slimefun.GPS;
public enum NetworkStatus {
ONLINE,
OFFLINE;
}

View File

@ -1,9 +1,11 @@
package me.mrCookieSlime.Slimefun.Lists; package me.mrCookieSlime.Slimefun.Lists;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.slimefun4.utils.ChatUtils; import io.github.thebusybiscuit.slimefun4.utils.ChatUtils;
import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.LockedCategory; import me.mrCookieSlime.Slimefun.Objects.LockedCategory;
import me.mrCookieSlime.Slimefun.Objects.SeasonalCategory; import me.mrCookieSlime.Slimefun.Objects.SeasonalCategory;
@ -19,30 +21,30 @@ public final class Categories {
private Categories() {} private Categories() {}
public static final Category WEAPONS = new Category(new CustomItem(SlimefunItems.BLADE_OF_VAMPIRES, "&7Weapons"), 1); public static final Category WEAPONS = new Category(new NamespacedKey(SlimefunPlugin.instance, "weapons"), new CustomItem(SlimefunItems.BLADE_OF_VAMPIRES, "&7Weapons"), 1);
public static final Category TOOLS = new Category(new CustomItem(SlimefunItems.AUTO_SMELT_PICKAXE, "&7Tools"), 1); public static final Category TOOLS = new Category(new NamespacedKey(SlimefunPlugin.instance, "tools"), new CustomItem(SlimefunItems.AUTO_SMELT_PICKAXE, "&7Tools"), 1);
public static final Category PORTABLE = new Category(new CustomItem(SlimefunItems.BACKPACK_MEDIUM, "&7Items"), 1); public static final Category PORTABLE = new Category(new NamespacedKey(SlimefunPlugin.instance, "items"), new CustomItem(SlimefunItems.BACKPACK_MEDIUM, "&7Useful Items"), 1);
public static final Category FOOD = new Category(new CustomItem(SlimefunItems.FORTUNE_COOKIE, "&7Food"), 2); public static final Category FOOD = new Category(new NamespacedKey(SlimefunPlugin.instance, "food"), new CustomItem(SlimefunItems.FORTUNE_COOKIE, "&7Food"), 2);
public static final Category MACHINES_1 = new Category(new CustomItem(Material.SMITHING_TABLE, "&7Basic Machines"), 1); public static final Category MACHINES_1 = new Category(new NamespacedKey(SlimefunPlugin.instance, "basic_machines"), new CustomItem(Material.SMITHING_TABLE, "&7Basic Machines"), 1);
public static final LockedCategory ELECTRICITY = new LockedCategory(new CustomItem(SlimefunItems.NUCLEAR_REACTOR, "&bEnergy and Electricity"), 4, MACHINES_1); public static final LockedCategory ELECTRICITY = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "electricity"), new CustomItem(SlimefunItems.NUCLEAR_REACTOR, "&bEnergy and Electricity"), 4, MACHINES_1);
public static final LockedCategory GPS = new LockedCategory(new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS-based Machines"), 4, MACHINES_1); public static final LockedCategory GPS = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "gps"), new CustomItem(SlimefunItems.GPS_TRANSMITTER, "&bGPS-based Machines"), 4, MACHINES_1);
public static final Category ARMOR = new Category(new CustomItem(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor"), 2); public static final Category ARMOR = new Category(new NamespacedKey(SlimefunPlugin.instance, "armor"), new CustomItem(SlimefunItems.DAMASCUS_STEEL_CHESTPLATE, "&7Armor"), 2);
public static final Category LUMPS_AND_MAGIC = new Category(new CustomItem(SlimefunItems.RUNE_ENDER, "&7Magical Items"), 2); public static final Category LUMPS_AND_MAGIC = new Category(new NamespacedKey(SlimefunPlugin.instance, "magical_items"), new CustomItem(SlimefunItems.RUNE_ENDER, "&7Magical Items"), 2);
public static final Category MAGIC = new Category(new CustomItem(SlimefunItems.INFUSED_ELYTRA, "&7Magical Gadgets"), 3); public static final Category MAGIC = new Category(new NamespacedKey(SlimefunPlugin.instance, "magical_gadgets"), new CustomItem(SlimefunItems.INFUSED_ELYTRA, "&7Magical Gadgets"), 3);
public static final Category MISC = new Category(new CustomItem(SlimefunItems.CAN, "&7Miscellaneous"), 2); public static final Category MISC = new Category(new NamespacedKey(SlimefunPlugin.instance, "misc"), new CustomItem(SlimefunItems.CAN, "&7Miscellaneous"), 2);
public static final Category TECH = new Category(new CustomItem(SlimefunItems.STEEL_JETPACK, "&7Technical Gadgets"), 3); public static final Category TECH = new Category(new NamespacedKey(SlimefunPlugin.instance, "technical_gadgets"), new CustomItem(SlimefunItems.STEEL_JETPACK, "&7Technical Gadgets"), 3);
public static final Category RESOURCES = new Category(new CustomItem(SlimefunItems.SYNTHETIC_SAPPHIRE, "&7Resources"), 1); public static final Category RESOURCES = new Category(new NamespacedKey(SlimefunPlugin.instance, "resources"), new CustomItem(SlimefunItems.SYNTHETIC_SAPPHIRE, "&7Resources"), 1);
public static final Category CARGO = new LockedCategory(new CustomItem(SlimefunItems.CARGO_MANAGER, "&cCargo Management"), 4, MACHINES_1); public static final Category CARGO = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "cargo"), new CustomItem(SlimefunItems.CARGO_MANAGER, "&cCargo Management"), 4, MACHINES_1);
public static final Category TECH_MISC = new Category(new CustomItem(SlimefunItems.HEATING_COIL, "&7Technical Components"), 2); public static final Category TECH_MISC = new Category(new NamespacedKey(SlimefunPlugin.instance, "tech_misc"), new CustomItem(SlimefunItems.HEATING_COIL, "&7Technical Components"), 2);
public static final Category MAGIC_ARMOR = new Category(new CustomItem(SlimefunItems.ENDER_HELMET, "&7Magical Armor"), 2); public static final Category MAGIC_ARMOR = new Category(new NamespacedKey(SlimefunPlugin.instance, "magical_armor"), new CustomItem(SlimefunItems.ENDER_HELMET, "&7Magical Armor"), 2);
public static final Category TALISMANS_1 = new Category(new CustomItem(SlimefunItems.TALISMAN, "&7Talismans - &aTier I"), 2); public static final Category TALISMANS_1 = new Category(new NamespacedKey(SlimefunPlugin.instance, "talismans"), new CustomItem(SlimefunItems.TALISMAN, "&7Talismans - &aTier I"), 2);
public static final LockedCategory TALISMANS_2 = new LockedCategory(new CustomItem(SlimefunItems.ENDER_TALISMAN, "&7Talismans - &aTier II"), 3, TALISMANS_1); public static final LockedCategory TALISMANS_2 = new LockedCategory(new NamespacedKey(SlimefunPlugin.instance, "ender_talismans"), new CustomItem(SlimefunItems.ENDER_TALISMAN, "&7Talismans - &aTier II"), 3, TALISMANS_1);
// Seasonal Categories // Seasonal Categories
public static final SeasonalCategory CHRISTMAS = new SeasonalCategory(12, 1, new CustomItem(Material.NETHER_STAR, ChatUtils.christmas("Christmas") + " &7(December)")); public static final SeasonalCategory CHRISTMAS = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "christmas"), 12, 1, new CustomItem(Material.NETHER_STAR, ChatUtils.christmas("Christmas") + " &7(December only)"));
public static final SeasonalCategory VALENTINES_DAY = new SeasonalCategory(2, 2, new CustomItem(Material.POPPY, "&dValentine's Day" + " &7(14th February)")); public static final SeasonalCategory VALENTINES_DAY = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "valentines_day"), 2, 2, new CustomItem(Material.POPPY, "&dValentine's Day" + " &7(14th February)"));
public static final SeasonalCategory EASTER = new SeasonalCategory(4, 2, new CustomItem(Material.EGG, "&6Easter" + " &7(April)")); public static final SeasonalCategory EASTER = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "easter"), 4, 2, new CustomItem(Material.EGG, "&6Easter" + " &7(April)"));
public static final SeasonalCategory BIRTHDAY = new SeasonalCategory(10, 1, new CustomItem(Material.FIREWORK_ROCKET, "&a&lTheBusyBiscuit's Birthday &7(26th October)")); public static final SeasonalCategory BIRTHDAY = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "birthday"), 10, 1, new CustomItem(Material.FIREWORK_ROCKET, "&a&lTheBusyBiscuit's Birthday &7(26th October)"));
public static final SeasonalCategory HALLOWEEN = new SeasonalCategory(10, 1, new CustomItem(Material.JACK_O_LANTERN, "&6&lHalloween &7(31st October)")); public static final SeasonalCategory HALLOWEEN = new SeasonalCategory(new NamespacedKey(SlimefunPlugin.instance, "halloween"), 10, 1, new CustomItem(Material.JACK_O_LANTERN, "&6&lHalloween &7(31st October)"));
} }

View File

@ -7,13 +7,14 @@ import java.util.Comparator;
import java.util.List; import java.util.List;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Keyed;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta; import org.bukkit.inventory.meta.ItemMeta;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry;
import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.Categories; import me.mrCookieSlime.Slimefun.Lists.Categories;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
@ -29,8 +30,9 @@ import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
* @see LockedCategory * @see LockedCategory
* @see SeasonalCategory * @see SeasonalCategory
*/ */
public class Category { public class Category implements Keyed {
private final NamespacedKey key;
private final ItemStack item; private final ItemStack item;
private final List<SlimefunItem> items; private final List<SlimefunItem> items;
private final int tier; private final int tier;
@ -40,13 +42,19 @@ public class Category {
* The tier is set to a default value of {@code 3}. * The tier is set to a default value of {@code 3}.
* *
* @param item the display item for this category * @param item the display item for this category
* @deprecated Use the alternative with a {@link NamespacedKey} instead
* *
* @since 4.0 * @since 4.0
*/ */
@Deprecated
public Category(ItemStack item) { public Category(ItemStack item) {
this(item, 3); this(item, 3);
} }
public Category(NamespacedKey key, ItemStack item) {
this(key, item, 3);
}
/** /**
* Constructs a Category with the given display item and the provided tier. * Constructs a Category with the given display item and the provided tier.
* </br> * </br>
@ -54,11 +62,18 @@ public class Category {
* *
* @param item the display item for this category * @param item the display item for this category
* @param tier the tier for this category * @param tier the tier for this category
* @deprecated Use the alternative with a {@link NamespacedKey} instead
* *
* @since 4.0 * @since 4.0
*/ */
@Deprecated
public Category(ItemStack item, int tier) { public Category(ItemStack item, int tier) {
this(new NamespacedKey(SlimefunPlugin.instance, "invalid_category"), item, tier);
}
public Category(NamespacedKey key, ItemStack item, int tier) {
this.item = item; this.item = item;
this.key = key;
ItemMeta meta = item.getItemMeta(); ItemMeta meta = item.getItemMeta();
meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES);
@ -69,19 +84,9 @@ public class Category {
this.tier = tier; this.tier = tier;
} }
/** @Override
* Gets the list of the registered categories. public NamespacedKey getKey() {
* return key;
* @deprecated Use {@link SlimefunRegistry#getEnabledCategories()}
*
* @return the list of the registered categories
*
* @since 4.0
* @see Categories
*/
@Deprecated
public static List<Category> list() {
return SlimefunPlugin.getRegistry().getEnabledCategories();
} }
/** /**
@ -120,7 +125,13 @@ public class Category {
} }
public ItemStack getItem(Player p) { public ItemStack getItem(Player p) {
return new CustomItem(item, meta -> meta.setLore(Arrays.asList("", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category")))); return new CustomItem(item, meta -> {
String name = SlimefunPlugin.getLocal().getCategoryName(p, getKey());
if (name == null) name = item.getItemMeta().getDisplayName();
meta.setDisplayName(ChatColor.GREEN + name);
meta.setLore(Arrays.asList("", ChatColor.GRAY + "\u21E8 " + ChatColor.GREEN + SlimefunPlugin.getLocal().getMessage(p, "guide.tooltips.open-category")));
});
} }
/** /**

View File

@ -3,6 +3,7 @@ package me.mrCookieSlime.Slimefun.Objects;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -40,10 +41,15 @@ public class LockedCategory extends Category {
* @since 4.0 * @since 4.0
* @see #LockedCategory(ItemStack, int, Category...) * @see #LockedCategory(ItemStack, int, Category...)
*/ */
@Deprecated
public LockedCategory(ItemStack item, Category... parents) { public LockedCategory(ItemStack item, Category... parents) {
this(item, 3, parents); this(item, 3, parents);
} }
public LockedCategory(NamespacedKey key, ItemStack item, Category... parents) {
this(key, item, 3, parents);
}
/** /**
* The constructor for a LockedCategory. * The constructor for a LockedCategory.
* <p> * <p>
@ -57,11 +63,17 @@ public class LockedCategory extends Category {
* @since 4.0 * @since 4.0
* @see #LockedCategory(ItemStack, Category...) * @see #LockedCategory(ItemStack, Category...)
*/ */
@Deprecated
public LockedCategory(ItemStack item, int tier, Category... parents) { public LockedCategory(ItemStack item, int tier, Category... parents) {
super(item, tier); super(item, tier);
this.parents = Arrays.asList(parents); this.parents = Arrays.asList(parents);
} }
public LockedCategory(NamespacedKey key, ItemStack item, int tier, Category... parents) {
super(key, item, tier);
this.parents = Arrays.asList(parents);
}
/** /**
* Gets the list of parent categories for this category. * Gets the list of parent categories for this category.
* *

View File

@ -2,6 +2,7 @@ package me.mrCookieSlime.Slimefun.Objects;
import java.util.Calendar; import java.util.Calendar;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
/** /**
@ -32,8 +33,8 @@ public class SeasonalCategory extends Category {
* *
* @since 4.0 * @since 4.0
*/ */
public SeasonalCategory(int month, int tier, ItemStack item) { public SeasonalCategory(NamespacedKey key, int month, int tier, ItemStack item) {
super(item, tier); super(key, item, tier);
if (month < 1 || month > 12) { if (month < 1 || month > 12) {
throw new IllegalArgumentException("There is no month no. " + month); throw new IllegalArgumentException("There is no month no. " + month);

View File

@ -1,9 +1,11 @@
package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items; package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.items;
import org.bukkit.entity.Player; import java.util.Optional;
import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.Slimefun.GEO.GEOScanner; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem;
@ -19,9 +21,12 @@ public class PortableGEOScanner extends SimpleSlimefunItem<ItemUseHandler> {
@Override @Override
public ItemUseHandler getItemHandler() { public ItemUseHandler getItemHandler() {
return e -> { return e -> {
Optional<Block> block = e.getClickedBlock();
e.cancel(); e.cancel();
Player p = e.getPlayer();
GEOScanner.scanChunk(p, p.getLocation().getChunk()); if (block.isPresent()) {
SlimefunPlugin.getGPSNetwork().getResourceManager().scan(e.getPlayer(), block.get());
}
}; };
} }

View File

@ -2,6 +2,7 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines.electric.geo;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.OptionalInt;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -10,12 +11,12 @@ import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram; import io.github.thebusybiscuit.slimefun4.utils.holograms.SimpleHologram;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ChestMenu.AdvancedMenuClickHandler;
import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction; import me.mrCookieSlime.CSCoreLibPlugin.general.Inventory.ClickAction;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.GEO.OreGenSystem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler;
@ -110,8 +111,8 @@ public abstract class GEOMiner extends AContainer implements InventoryBlock, Rec
public List<ItemStack> getDisplayRecipes() { public List<ItemStack> getDisplayRecipes() {
List<ItemStack> displayRecipes = new LinkedList<>(); List<ItemStack> displayRecipes = new LinkedList<>();
for (OreGenResource resource : OreGenSystem.listResources()) { for (GEOResource resource : SlimefunPlugin.getRegistry().getGEOResources().values()) {
if (!resource.isLiquid()) { if (resource.isObtainableFromGEOMiner()) {
displayRecipes.add(new CustomItem(resource.getItem(), "&r" + resource.getName())); displayRecipes.add(new CustomItem(resource.getItem(), "&r" + resource.getName()));
} }
} }
@ -175,18 +176,20 @@ public abstract class GEOMiner extends AContainer implements InventoryBlock, Rec
processing.remove(b); processing.remove(b);
} }
} }
else if (!BlockStorage.hasChunkInfo(b.getChunk())) { else if (!BlockStorage.hasChunkInfo(b.getWorld(), b.getX() >> 4, b.getZ() >> 4)) {
SimpleHologram.update(b, "&4GEO-Scan required!"); SimpleHologram.update(b, "&4GEO-Scan required!");
} }
else { else {
for (OreGenResource resource : OreGenSystem.listResources()) { for (GEOResource resource : SlimefunPlugin.getRegistry().getGEOResources().values()) {
if (!resource.isLiquid()) { if (resource.isObtainableFromGEOMiner()) {
if (!OreGenSystem.wasResourceGenerated(resource, b.getLocation())) { OptionalInt optional = SlimefunPlugin.getGPSNetwork().getResourceManager().getSupplies(resource, b.getWorld(), b.getX() >> 4, b.getZ() >> 4);
if (!optional.isPresent()) {
SimpleHologram.update(b, "&4GEO-Scan required!"); SimpleHologram.update(b, "&4GEO-Scan required!");
return; return;
} }
else { else {
int supplies = OreGenSystem.getSupplies(resource, b.getLocation(), false); int supplies = optional.getAsInt();
if (supplies > 0) { if (supplies > 0) {
MachineRecipe r = new MachineRecipe(getProcessingTime() / getSpeed(), new ItemStack[0], new ItemStack[] {resource.getItem().clone()}); MachineRecipe r = new MachineRecipe(getProcessingTime() / getSpeed(), new ItemStack[0], new ItemStack[] {resource.getItem().clone()});
@ -194,7 +197,7 @@ public abstract class GEOMiner extends AContainer implements InventoryBlock, Rec
processing.put(b, r); processing.put(b, r);
progress.put(b, r.getTicks()); progress.put(b, r.getTicks());
OreGenSystem.setSupplies(resource, b.getLocation(), supplies - 1); SlimefunPlugin.getGPSNetwork().getResourceManager().setSupplies(resource, b.getWorld(), b.getX() >> 4, b.getZ() >> 4, supplies - 1);
SimpleHologram.update(b, "&7Mining: &r" + resource.getName()); SimpleHologram.update(b, "&7Mining: &r" + resource.getName());
return; return;
} }

View File

@ -3,7 +3,7 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines.electric.geo;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.Slimefun.GEO.GEOScanner; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SimpleSlimefunItem;
@ -27,7 +27,7 @@ public class GEOScannerBlock extends SimpleSlimefunItem<BlockUseHandler> {
Block b = e.getClickedBlock().get(); Block b = e.getClickedBlock().get();
e.cancel(); e.cancel();
GEOScanner.scanChunk(e.getPlayer(), b.getChunk()); SlimefunPlugin.getGPSNetwork().getResourceManager().scan(e.getPlayer(), b);
}; };
} }
} }

View File

@ -2,18 +2,19 @@ package me.mrCookieSlime.Slimefun.Objects.SlimefunItem.machines.electric.geo;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.OptionalInt;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import io.github.thebusybiscuit.cscorelib2.item.CustomItem; import io.github.thebusybiscuit.cscorelib2.item.CustomItem;
import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction; import io.github.thebusybiscuit.cscorelib2.protection.ProtectableAction;
import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils; import io.github.thebusybiscuit.slimefun4.utils.ChestMenuUtils;
import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.GEO.OreGenResource;
import me.mrCookieSlime.Slimefun.GEO.OreGenSystem;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
@ -30,9 +31,13 @@ import me.mrCookieSlime.Slimefun.api.item_transport.ItemTransportFlow;
public abstract class OilPump extends AContainer implements RecipeDisplayItem { public abstract class OilPump extends AContainer implements RecipeDisplayItem {
private final GEOResource oil;
public OilPump(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) { public OilPump(Category category, SlimefunItemStack item, RecipeType recipeType, ItemStack[] recipe) {
super(category, item, recipeType, recipe); super(category, item, recipeType, recipe);
oil = SlimefunPlugin.getRegistry().getGEOResources().get(new NamespacedKey(SlimefunPlugin.instance, "oil")).orElse(null);
new BlockMenuPreset(getID(), getInventoryTitle()) { new BlockMenuPreset(getID(), getInventoryTitle()) {
@Override @Override
@ -46,10 +51,11 @@ public abstract class OilPump extends AContainer implements RecipeDisplayItem {
return false; return false;
} }
if (!OreGenSystem.wasResourceGenerated(OreGenSystem.getResource("Oil"), b.getLocation())) { if (!SlimefunPlugin.getGPSNetwork().getResourceManager().getSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4).isPresent()) {
SlimefunPlugin.getLocal().sendMessage(p, "gps.geo.scan-required", true); SlimefunPlugin.getLocal().sendMessage(p, "gps.geo.scan-required", true);
return false; return false;
} }
return true; return true;
} }
@ -107,16 +113,15 @@ public abstract class OilPump extends AContainer implements RecipeDisplayItem {
else if (inv.fits(SlimefunItems.BUCKET_OF_OIL, getOutputSlots())) { else if (inv.fits(SlimefunItems.BUCKET_OF_OIL, getOutputSlots())) {
for (int slot : getInputSlots()) { for (int slot : getInputSlots()) {
if (SlimefunManager.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.BUCKET), true)) { if (SlimefunManager.isItemSimilar(inv.getItemInSlot(slot), new ItemStack(Material.BUCKET), true)) {
OreGenResource oil = OreGenSystem.getResource("Oil"); OptionalInt supplies = SlimefunPlugin.getGPSNetwork().getResourceManager().getSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4);
int supplies = OreGenSystem.getSupplies(oil, b.getLocation(), false);
if (supplies > 0) { if (supplies.isPresent() && supplies.getAsInt() > 0) {
MachineRecipe r = new MachineRecipe(26, new ItemStack[0], new ItemStack[] {SlimefunItems.BUCKET_OF_OIL}); MachineRecipe r = new MachineRecipe(26, new ItemStack[0], new ItemStack[] {SlimefunItems.BUCKET_OF_OIL});
inv.consumeItem(slot); inv.consumeItem(slot);
processing.put(b, r); processing.put(b, r);
progress.put(b, r.getTicks()); progress.put(b, r.getTicks());
OreGenSystem.setSupplies(oil, b.getLocation(), supplies - 1); SlimefunPlugin.getGPSNetwork().getResourceManager().setSupplies(oil, b.getWorld(), b.getX() >> 4, b.getZ() >> 4, supplies.getAsInt() - 1);
} }
else { else {
ItemStack item = inv.getItemInSlot(slot).clone(); ItemStack item = inv.getItemInSlot(slot).clone();

View File

@ -8,7 +8,6 @@ import org.bukkit.inventory.ItemStack;
import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config; import me.mrCookieSlime.CSCoreLibPlugin.Configuration.Config;
import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.GPS.NetworkStatus;
import me.mrCookieSlime.Slimefun.Lists.RecipeType; import me.mrCookieSlime.Slimefun.Lists.RecipeType;
import me.mrCookieSlime.Slimefun.Objects.Category; import me.mrCookieSlime.Slimefun.Objects.Category;
import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler; import me.mrCookieSlime.Slimefun.Objects.SlimefunBlockHandler;
@ -34,7 +33,7 @@ public abstract class GPSTransmitter extends SimpleSlimefunItem<BlockTicker> {
@Override @Override
public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) { public boolean onBreak(Player p, Block b, SlimefunItem item, UnregisterReason reason) {
SlimefunPlugin.getGPSNetwork().updateTransmitter(b.getLocation(), UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner")), NetworkStatus.OFFLINE); SlimefunPlugin.getGPSNetwork().updateTransmitter(b.getLocation(), UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner")), false);
return true; return true;
} }
}); });
@ -50,13 +49,14 @@ public abstract class GPSTransmitter extends SimpleSlimefunItem<BlockTicker> {
@Override @Override
public void tick(Block b, SlimefunItem item, Config data) { public void tick(Block b, SlimefunItem item, Config data) {
int charge = ChargableBlock.getCharge(b); int charge = ChargableBlock.getCharge(b);
UUID owner = UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner"));
if (charge >= getEnergyConsumption()) { if (charge >= getEnergyConsumption()) {
SlimefunPlugin.getGPSNetwork().updateTransmitter(b.getLocation(), UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner")), NetworkStatus.ONLINE); SlimefunPlugin.getGPSNetwork().updateTransmitter(b.getLocation(), owner, true);
ChargableBlock.setCharge(b.getLocation(), charge - getEnergyConsumption()); ChargableBlock.setCharge(b.getLocation(), charge - getEnergyConsumption());
} }
else { else {
SlimefunPlugin.getGPSNetwork().updateTransmitter(b.getLocation(), UUID.fromString(BlockStorage.getLocationInfo(b.getLocation(), "owner")), NetworkStatus.OFFLINE); SlimefunPlugin.getGPSNetwork().updateTransmitter(b.getLocation(), owner, false);
} }
} }

View File

@ -17,6 +17,7 @@ import io.github.thebusybiscuit.cscorelib2.config.Config;
import io.github.thebusybiscuit.cscorelib2.protection.ProtectionManager; import io.github.thebusybiscuit.cscorelib2.protection.ProtectionManager;
import io.github.thebusybiscuit.cscorelib2.recipes.RecipeSnapshot; import io.github.thebusybiscuit.cscorelib2.recipes.RecipeSnapshot;
import io.github.thebusybiscuit.cscorelib2.reflection.ReflectionUtils; import io.github.thebusybiscuit.cscorelib2.reflection.ReflectionUtils;
import io.github.thebusybiscuit.slimefun4.api.gps.GPSNetwork;
import io.github.thebusybiscuit.slimefun4.api.network.NetworkManager; import io.github.thebusybiscuit.slimefun4.api.network.NetworkManager;
import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry; import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry;
import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand; import io.github.thebusybiscuit.slimefun4.core.commands.SlimefunCommand;
@ -30,10 +31,6 @@ import io.github.thebusybiscuit.slimefun4.core.services.GitHubService;
import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService; import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService;
import io.github.thebusybiscuit.slimefun4.core.services.MetricsService; import io.github.thebusybiscuit.slimefun4.core.services.MetricsService;
import io.github.thebusybiscuit.slimefun4.core.services.UpdaterService; import io.github.thebusybiscuit.slimefun4.core.services.UpdaterService;
import io.github.thebusybiscuit.slimefun4.implementation.geo.resources.NetherIceResource;
import io.github.thebusybiscuit.slimefun4.implementation.geo.resources.OilResource;
import io.github.thebusybiscuit.slimefun4.implementation.geo.resources.SaltResource;
import io.github.thebusybiscuit.slimefun4.implementation.geo.resources.UraniumResource;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.AncientAltarListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.AndroidKillingListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.AndroidKillingListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.AutonomousToolsListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.AutonomousToolsListener;
@ -62,15 +59,17 @@ import io.github.thebusybiscuit.slimefun4.implementation.listeners.TalismanListe
import io.github.thebusybiscuit.slimefun4.implementation.listeners.TeleporterListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.TeleporterListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.VanillaMachinesListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.VanillaMachinesListener;
import io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener; import io.github.thebusybiscuit.slimefun4.implementation.listeners.WorldListener;
import io.github.thebusybiscuit.slimefun4.implementation.resources.NetherIceResource;
import io.github.thebusybiscuit.slimefun4.implementation.resources.OilResource;
import io.github.thebusybiscuit.slimefun4.implementation.resources.SaltResource;
import io.github.thebusybiscuit.slimefun4.implementation.resources.UraniumResource;
import io.github.thebusybiscuit.slimefun4.implementation.setup.MiscSetup; import io.github.thebusybiscuit.slimefun4.implementation.setup.MiscSetup;
import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup; import io.github.thebusybiscuit.slimefun4.implementation.setup.ResearchSetup;
import io.github.thebusybiscuit.slimefun4.implementation.setup.SlimefunSetup; import io.github.thebusybiscuit.slimefun4.implementation.setup.SlimefunItemSetup;
import io.github.thebusybiscuit.slimefun4.implementation.setup.WikiSetup; import io.github.thebusybiscuit.slimefun4.implementation.setup.WikiSetup;
import io.github.thebusybiscuit.slimefun4.implementation.tasks.ArmorTask; import io.github.thebusybiscuit.slimefun4.implementation.tasks.ArmorTask;
import io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask; import io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask;
import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib; import me.mrCookieSlime.CSCoreLibPlugin.CSCoreLib;
import me.mrCookieSlime.Slimefun.GEO.OreGenSystem;
import me.mrCookieSlime.Slimefun.GPS.GPSNetwork;
import me.mrCookieSlime.Slimefun.Lists.SlimefunItems; import me.mrCookieSlime.Slimefun.Lists.SlimefunItems;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.abstractItems.AContainer;
@ -171,7 +170,7 @@ public final class SlimefunPlugin extends JavaPlugin {
MiscSetup.setupItemSettings(); MiscSetup.setupItemSettings();
try { try {
SlimefunSetup.setupItems(); SlimefunItemSetup.setup();
} catch (Exception x) { } catch (Exception x) {
getLogger().log(Level.SEVERE, "An Error occured while initializing SlimefunItems for Slimefun " + getVersion(), x); getLogger().log(Level.SEVERE, "An Error occured while initializing SlimefunItems for Slimefun " + getVersion(), x);
} }
@ -188,10 +187,10 @@ public final class SlimefunPlugin extends JavaPlugin {
getLogger().log(Level.INFO, "Loading World Generators..."); getLogger().log(Level.INFO, "Loading World Generators...");
// Generating Oil as an OreGenResource (it iss a cool API) // Generating Oil as an OreGenResource (it iss a cool API)
OreGenSystem.registerResource(new OilResource()); new OilResource().register();
OreGenSystem.registerResource(new NetherIceResource()); new NetherIceResource().register();
OreGenSystem.registerResource(new UraniumResource()); new UraniumResource().register();
OreGenSystem.registerResource(new SaltResource()); new SaltResource().register();
// Setting up GitHub Connectors... // Setting up GitHub Connectors...
gitHubService.connect(config.getBoolean("options.print-out-github-data-retrieving")); gitHubService.connect(config.getBoolean("options.print-out-github-data-retrieving"));

View File

@ -59,15 +59,19 @@ public class BlockStorage {
private static String serializeLocation(Location l) { private static String serializeLocation(Location l) {
return l.getWorld().getName() + ';' + l.getBlockX() + ';' + l.getBlockY() + ';' + l.getBlockZ(); return l.getWorld().getName() + ';' + l.getBlockX() + ';' + l.getBlockY() + ';' + l.getBlockZ();
} }
//
private static String serializeChunk(Chunk chunk) { // private static String serializeChunk(Chunk chunk) {
return chunk.getWorld().getName() + ";Chunk;" + chunk.getX() + ';' + chunk.getZ(); // return chunk.getWorld().getName() + ";Chunk;" + chunk.getX() + ';' + chunk.getZ();
} // }
//
private static String locationToChunkString(Location l) { private static String locationToChunkString(Location l) {
return l.getWorld().getName() + ";Chunk;" + (l.getBlockX() >> 4) + ';' + (l.getBlockZ() >> 4); return l.getWorld().getName() + ";Chunk;" + (l.getBlockX() >> 4) + ';' + (l.getBlockZ() >> 4);
} }
private static String serializeChunk(World world, int x, int z) {
return world.getName() + ";Chunk;" + x + ";" + z;
}
private static Location deserializeLocation(String l) { private static Location deserializeLocation(String l) {
try { try {
String[] components = l.split(";"); String[] components = l.split(";");
@ -141,7 +145,7 @@ public class BlockStorage {
} }
} }
} catch (Exception x) { } catch (Exception x) {
Slimefun.getLogger().log(Level.WARNING, "Failed to load " + file.getName() + '(' + key + ") for Slimefun " + Slimefun.getVersion(), x); Slimefun.getLogger().log(Level.WARNING, "Failed to load " + file.getName() + '(' + key + ") for Slimefun " + SlimefunPlugin.getVersion(), x);
} }
} }
done++; done++;
@ -170,7 +174,7 @@ public class BlockStorage {
SlimefunPlugin.getRegistry().getChunks().put(key, new BlockInfoConfig(parseJSON(cfg.getString(key)))); SlimefunPlugin.getRegistry().getChunks().put(key, new BlockInfoConfig(parseJSON(cfg.getString(key))));
} }
} catch (Exception x) { } catch (Exception x) {
Slimefun.getLogger().log(Level.WARNING, "Failed to load " + chunks.getName() + " in World " + world.getName() + '(' + key + ") for Slimefun " + Slimefun.getVersion(), x); Slimefun.getLogger().log(Level.WARNING, "Failed to load " + chunks.getName() + " in World " + world.getName() + '(' + key + ") for Slimefun " + SlimefunPlugin.getVersion(), x);
} }
} }
} }
@ -261,7 +265,7 @@ public class BlockStorage {
try { try {
Files.move(tmpFile.toPath(), cfg.getFile().toPath(), StandardCopyOption.ATOMIC_MOVE); Files.move(tmpFile.toPath(), cfg.getFile().toPath(), StandardCopyOption.ATOMIC_MOVE);
} catch (IOException x) { } catch (IOException x) {
Slimefun.getLogger().log(Level.SEVERE, "An Error occured while copying a temporary File for Slimefun " + Slimefun.getVersion(), x); Slimefun.getLogger().log(Level.SEVERE, "An Error occured while copying a temporary File for Slimefun " + SlimefunPlugin.getVersion(), x);
} }
} }
} }
@ -325,16 +329,6 @@ public class BlockStorage {
} }
} }
@Deprecated
public static Config getBlockInfo(Block block) {
return getLocationInfo(block.getLocation());
}
@Deprecated
public static Config getBlockInfo(Location l) {
return getLocationInfo(l);
}
public static Config getLocationInfo(Location l) { public static Config getLocationInfo(Location l) {
BlockStorage storage = getStorage(l.getWorld()); BlockStorage storage = getStorage(l.getWorld());
Config cfg = storage.storage.get(l); Config cfg = storage.storage.get(l);
@ -366,7 +360,7 @@ public class BlockStorage {
logger.log(Level.WARNING, ""); logger.log(Level.WARNING, "");
logger.log(Level.WARNING, "IGNORE THIS ERROR UNLESS IT IS SPAMMING"); logger.log(Level.WARNING, "IGNORE THIS ERROR UNLESS IT IS SPAMMING");
logger.log(Level.WARNING, ""); logger.log(Level.WARNING, "");
logger.log(Level.SEVERE, "An Error occured while parsing Block Info for Slimefun " + Slimefun.getVersion(), x); logger.log(Level.SEVERE, "An Error occured while parsing Block Info for Slimefun " + SlimefunPlugin.getVersion(), x);
return null; return null;
} }
} }
@ -381,21 +375,6 @@ public class BlockStorage {
return json.toString(); return json.toString();
} }
private static String getJSONData(Chunk chunk) {
if (chunk == null) return null;
return SlimefunPlugin.getRegistry().getChunks().get(serializeChunk(chunk)).toJSON();
}
@Deprecated
public static String getBlockInfo(Block block, String key) {
return getLocationInfo(block.getLocation(), key);
}
@Deprecated
public static String getBlockInfo(Location l, String key) {
return getLocationInfo(l, key);
}
public static String getLocationInfo(Location l, String key) { public static String getLocationInfo(Location l, String key) {
return getLocationInfo(l).getString(key); return getLocationInfo(l).getString(key);
} }
@ -509,20 +488,10 @@ public class BlockStorage {
} }
} }
@Deprecated
public static void moveBlockInfo(Block block, Block newBlock) {
moveBlockInfo(block.getLocation(), newBlock.getLocation());
}
public static void moveBlockInfo(Location from, Location to) { public static void moveBlockInfo(Location from, Location to) {
SlimefunPlugin.getTicker().queueMove(from, to); SlimefunPlugin.getTicker().queueMove(from, to);
} }
@Deprecated
public static void _integrated_moveBlockInfo(Block block, Block newBlock) {
_integrated_moveLocationInfo(block.getLocation(), newBlock.getLocation());
}
public static void _integrated_moveLocationInfo(Location from, Location to) { public static void _integrated_moveLocationInfo(Location from, Location to) {
if (!hasBlockInfo(from)) return; if (!hasBlockInfo(from)) return;
BlockStorage storage = getStorage(from.getWorld()); BlockStorage storage = getStorage(from.getWorld());
@ -623,26 +592,10 @@ public class BlockStorage {
return new HashSet<>(SlimefunPlugin.getRegistry().getActiveChunks()); return new HashSet<>(SlimefunPlugin.getRegistry().getActiveChunks());
} }
@Deprecated
public static Set<Block> getTickingBlocks(Chunk chunk) {
return getTickingBlocks(chunk.toString());
}
public static Set<Location> getTickingLocations(Chunk chunk) { public static Set<Location> getTickingLocations(Chunk chunk) {
return getTickingLocations(chunk.toString()); return getTickingLocations(chunk.toString());
} }
@Deprecated
public static Set<Block> getTickingBlocks(String chunk) {
Set<Block> ret = new HashSet<>();
for (Location l : getTickingLocations(chunk)) {
ret.add(l.getBlock());
}
return ret;
}
public static Set<Location> getTickingLocations(String chunk) { public static Set<Location> getTickingLocations(String chunk) {
return new HashSet<>(SlimefunPlugin.getRegistry().getActiveTickers().get(chunk)); return new HashSet<>(SlimefunPlugin.getRegistry().getActiveTickers().get(chunk));
} }
@ -711,36 +664,23 @@ public class BlockStorage {
else return storage.loadInventory(l, BlockMenuPreset.getPreset(checkID(l))); else return storage.loadInventory(l, BlockMenuPreset.getPreset(checkID(l)));
} }
public static Config getChunkInfo(Chunk chunk) { public static Config getChunkInfo(World world, int x, int z) {
try { try {
BlockInfoConfig cfg = SlimefunPlugin.getRegistry().getChunks().get(serializeChunk(chunk)); BlockInfoConfig cfg = SlimefunPlugin.getRegistry().getChunks().get(serializeChunk(world, x, z));
return cfg == null ? new BlockInfoConfig() : cfg; return cfg == null ? new BlockInfoConfig() : cfg;
} catch (Exception x) { } catch (Exception e) {
Slimefun.getLogger().log(Level.SEVERE, "Failed to parse ChunkInfo for Chunk: " + (chunk == null ? "?": chunk.getX()) + ", " + (chunk == null ? "?": chunk.getZ()) + " (" + getJSONData(chunk) + ") for Slimefun " + Slimefun.getVersion(), x); Slimefun.getLogger().log(Level.SEVERE, "Failed to parse ChunkInfo for Slimefun " + SlimefunPlugin.getVersion(), x);
return new BlockInfoConfig(); return new BlockInfoConfig();
} }
} }
public static Config getChunkInfo(Location l) { public static void setChunkInfo(World world, int x, int z, String key, String value) {
try { String serializedChunk = serializeChunk(world, x, z);
BlockInfoConfig cfg = SlimefunPlugin.getRegistry().getChunks().get(locationToChunkString(l)); BlockInfoConfig cfg = SlimefunPlugin.getRegistry().getChunks().get(serializedChunk);
return cfg == null ? new BlockInfoConfig() : cfg;
} catch (Exception x) {
Slimefun.getLogger().log(Level.SEVERE, "Failed to parse ChunkInfo for Location: " + (l == null ? "?": l.getBlockX()) + ", " + (l == null ? "?": l.getBlockZ()) + " for Slimefun " + Slimefun.getVersion(), x);
return new BlockInfoConfig();
}
}
public static boolean hasChunkInfo(Chunk chunk) {
return SlimefunPlugin.getRegistry().getChunks().containsKey(serializeChunk(chunk));
}
public static void setChunkInfo(Chunk chunk, String key, String value) {
BlockInfoConfig cfg = SlimefunPlugin.getRegistry().getChunks().get(serializeChunk(chunk));
if (cfg == null) { if (cfg == null) {
cfg = new BlockInfoConfig(); cfg = new BlockInfoConfig();
SlimefunPlugin.getRegistry().getChunks().put(serializeChunk(chunk), cfg); SlimefunPlugin.getRegistry().getChunks().put(serializedChunk, cfg);
} }
cfg.setValue(key, value); cfg.setValue(key, value);
@ -748,37 +688,13 @@ public class BlockStorage {
chunkChanges++; chunkChanges++;
} }
public static void setChunkInfo(Location l, String key, String value) { public static boolean hasChunkInfo(World world, int x, int z) {
BlockInfoConfig cfg = SlimefunPlugin.getRegistry().getChunks().get(locationToChunkString(l)); String serializedChunk = serializeChunk(world, x, z);
return SlimefunPlugin.getRegistry().getChunks().containsKey(serializedChunk);
if (cfg == null) {
cfg = new BlockInfoConfig();
SlimefunPlugin.getRegistry().getChunks().put(locationToChunkString(l), cfg);
} }
cfg.setValue(key, value); public static String getChunkInfo(World world, int x, int z, String key) {
return getChunkInfo(world, x, z).getString(key);
chunkChanges++;
}
public static String getChunkInfo(Chunk chunk, String key) {
return getChunkInfo(chunk).getString(key);
}
public static String getChunkInfo(Location l, String key) {
return getChunkInfo(l).getString(key);
}
public static boolean hasChunkInfo(Chunk chunk, String key) {
return getChunkInfo(chunk, key) != null;
}
public static boolean hasChunkInfo(Location l, String key) {
return getChunkInfo(l, key) != null;
}
public static void clearChunkInfo(Chunk chunk) {
SlimefunPlugin.getRegistry().getChunks().remove(serializeChunk(chunk));
} }
public static String getBlockInfoAsJson(Block block) { public static String getBlockInfoAsJson(Block block) {

View File

@ -11,10 +11,10 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitTask; import org.bukkit.scheduler.BukkitTask;
import io.github.thebusybiscuit.cscorelib2.config.Config; import io.github.thebusybiscuit.cscorelib2.config.Config;
import io.github.thebusybiscuit.slimefun4.api.gps.GPSNetwork;
import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry; import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry;
import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService; import io.github.thebusybiscuit.slimefun4.core.services.LocalizationService;
import me.mrCookieSlime.Slimefun.SlimefunPlugin; import me.mrCookieSlime.Slimefun.SlimefunPlugin;
import me.mrCookieSlime.Slimefun.GPS.GPSNetwork;
import me.mrCookieSlime.Slimefun.Objects.Research; import me.mrCookieSlime.Slimefun.Objects.Research;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.ItemState; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.ItemState;
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem;

View File

@ -0,0 +1,25 @@
---
slimefun:
weapons: Waffen
tools: Werkzeuge
items: Nützliche Gegenstände
food: Essen
basic_machines: Einfache Maschinen
electricity: Energie und Elektrizität
gps: GPS-basierte Maschinen
armor: Rüstung
magical_items: Magische Gegenstände
magical_gadgets: Magische Gadgets
misc: Sonstige Gegenstände
technical_gadgets: Technische Gadgets
resources: Ressourcen
cargo: Cargo-Management
tech_misc: Technische Komponenten
magical_armor: Magische Rüstung
talismans: Talismane (Tier I)
ender_talismans: Ender-Talismane (Tier II)
christmas: Weihnachtszeit (Dezember)
valentines_day: Valentinstag (14. Februar)
easter: Ostern (April)
birthday: TheBusyBiscuit's Geburtstag (26. Oktober)
halloween: Halloween (31. Oktober)

View File

@ -0,0 +1,24 @@
slimefun:
weapons: 'Weapons'
tools: 'Tools'
items: 'Useful Items'
food: 'Food'
basic_machines: 'Basic Machines'
electricity: 'Energy and Electricity'
gps: 'GPS-based Machines'
armor: 'Armor'
magical_items: 'Magical Items'
magical_gadgets: 'Magical Gadgets'
misc: 'Miscellaneous Items'
technical_gadgets: 'Technical Gadgets'
resources: 'Resources'
cargo: 'Cargo Management'
tech_misc: 'Technical Components'
magical_armor: 'Magical Armor'
talismans: 'Talismans (Tier I)'
ender_talismans: 'Ender Talismans (Tier II)'
christmas: 'Christmas (December)'
valentines_day: 'Valentine''s Day (14th February)'
easter: 'Easter (April)'
birthday: 'TheBusyBiscuit''s birthday (26th October)'
halloween: 'Halloween (31st October)'

View File

@ -31,9 +31,6 @@ guide:
select: اضغط لإختيار هذه اللغة select: اضغط لإختيار هذه اللغة
select-default: اضغط لتحديد اللغة الإفتراضية select-default: اضغط لتحديد اللغة الإفتراضية
selected-language: 'الإختيار الحالي:' selected-language: 'الإختيار الحالي:'
progress:
messages: رسائل الشات
researches: أسماء الأبحاث
title: title:
main: كتيب سلايم فان main: كتيب سلايم فان
settings: الإعدادات والمعلومات settings: الإعدادات والمعلومات

View File

@ -99,9 +99,6 @@ guide:
lore: Klicke um eine Übersetzung hinzuzufügen lore: Klicke um eine Übersetzung hinzuzufügen
name: "&aFehlt etwas?" name: "&aFehlt etwas?"
updated: "&aFolgende Sprache wurde ausgewählt: &b%lang%" updated: "&aFolgende Sprache wurde ausgewählt: &b%lang%"
progress:
messages: Chatnachrichten
researches: Namen von Erforschungen
pages: pages:
next: Nächste Seite next: Nächste Seite
previous: Vorherige Seite previous: Vorherige Seite

View File

@ -49,10 +49,6 @@ guide:
name: '&aIs something missing?' name: '&aIs something missing?'
lore: 'Click to add your own translation' lore: 'Click to add your own translation'
progress:
messages: 'Chat messages'
researches: 'Research names'
title: title:
main: 'Slimefun Guide' main: 'Slimefun Guide'
settings: 'Settings & Info' settings: 'Settings & Info'

View File

@ -96,9 +96,6 @@ guide:
lore: Cliquez pour ajouter votre propre traduction lore: Cliquez pour ajouter votre propre traduction
name: "&aIl manque quelque chose ?" name: "&aIl manque quelque chose ?"
updated: "&aVotre langue a été correctement définie sur : &b%lang%" updated: "&aVotre langue a été correctement définie sur : &b%lang%"
progress:
messages: Messages du chat
researches: Noms des Recherches
pages: pages:
next: Page suivante next: Page suivante
previous: Page précédente previous: Page précédente

View File

@ -93,9 +93,6 @@ guide:
lore: Kattints a saját fordítás hozzáadásához lore: Kattints a saját fordítás hozzáadásához
name: "&aHiányzik valami?" name: "&aHiányzik valami?"
updated: "&aA nyelvet sikeresen átállítottad erre: &b%lang%" updated: "&aA nyelvet sikeresen átállítottad erre: &b%lang%"
progress:
messages: Chat üzenetek
researches: Kutatási nevek
pages: pages:
next: Következő oldal next: Következő oldal
previous: Előző oldal previous: Előző oldal

View File

@ -95,9 +95,6 @@ guide:
lore: Нажмите, чтобы добавить свой перевод lore: Нажмите, чтобы добавить свой перевод
name: "&aЧего-то не хватает?" name: "&aЧего-то не хватает?"
updated: "&aВаш язык успешно установлен на: &b%lang%" updated: "&aВаш язык успешно установлен на: &b%lang%"
progress:
messages: Сообщения чата
researches: Названия исследований
pages: pages:
next: Следующая страница next: Следующая страница
previous: Предыдущая страница previous: Предыдущая страница

View File

@ -74,6 +74,10 @@ gps:
max: "&4Dosiahol si maximálny počet waypointov" max: "&4Dosiahol si maximálny počet waypointov"
new: "&eProsím napíš meno pre tvoj nový waypoint do chatu. &7(Kódy farieb sú podporované!)" new: "&eProsím napíš meno pre tvoj nový waypoint do chatu. &7(Kódy farieb sú podporované!)"
guide: guide:
back:
guide: Ísť naspäť do Slimefun príručky
settings: Ísť naspäť do nastavení
title: Naspäť
cheat: cheat:
no-multiblocks: "&4Nemôžeš cheatovať multiblocky, musíš ich postaviť!" no-multiblocks: "&4Nemôžeš cheatovať multiblocky, musíš ich postaviť!"
credits: credits:
@ -93,9 +97,6 @@ guide:
lore: Klikni pre pridanie svojho prekladu lore: Klikni pre pridanie svojho prekladu
name: "&aNiečo chýba?" name: "&aNiečo chýba?"
updated: "&aTvoj jazyk bol úspešne nastavený na: &b%lang%" updated: "&aTvoj jazyk bol úspešne nastavený na: &b%lang%"
progress:
messages: Správy v chate
researches: Názvy prieskumov
pages: pages:
next: Ďalšia stránka next: Ďalšia stránka
previous: Predošlá stránka previous: Predošlá stránka
@ -112,47 +113,43 @@ guide:
languages: Nastav si preferovaný jazyk languages: Nastav si preferovaný jazyk
main: Slimefun príručka main: Slimefun príručka
settings: Nastavenia a informácie settings: Nastavenia a informácie
wiki: Slimefun4 Wiki
source: Zdrojový kód source: Zdrojový kód
wiki: Slimefun4 Wiki
tooltips: tooltips:
open-category: Klikni pre otvorenie open-category: Klikni pre otvorenie
versions-notice: Toto je veľmi dôležité pri nahlasovaní bugov! versions-notice: Toto je veľmi dôležité pri nahlasovaní bugov!
back:
title: Naspäť
guide: Ísť naspäť do Slimefun príručky
settings: Ísť naspäť do nastavení
inventory: inventory:
no-access: "&4Nemáš opŕavnenie na otvorenie tohto bloku" no-access: "&4Nemáš opŕavnenie na otvorenie tohto bloku"
languages: languages:
af: Afrikánčina
ar: Arabčina
cs: Čeština cs: Čeština
da: Dánčina
de: Nemčina de: Nemčina
default: Východzí jazyk servera default: Východzí jazyk servera
el: Gréčtina el: Gréčtina
en: Angličtina en: Angličtina
es: Španielčina es: Španielčina
fi: Fínština
fr: Francúzština fr: Francúzština
he: Hebrejčina he: Hebrejčina
hu: Maďarčina hu: Maďarčina
id: Indonézčina id: Indonézčina
it: Taliančina it: Taliančina
lv: Lotyština lv: Lotyština
ms: Malajština
nl: Holandčina nl: Holandčina
'no': Nórština
pl: Poľština pl: Poľština
pt: Portugalština (Portugalsko) pt: Portugalština (Portugalsko)
pt-BR: Portugalština (Brazília) pt-BR: Portugalština (Brazília)
ru: Ruština ru: Ruština
sk: Slovenčina sk: Slovenčina
sv: Švédština sv: Švédština
uk: Ukrajinčina
vi: Vietnamčina vi: Vietnamčina
zh-CN: Čínština (Čína) zh-CN: Čínština (Čína)
zh-TW: Čínština (Taiwan) zh-TW: Čínština (Taiwan)
ar: Arabčina
af: Afrikánčina
da: Dánčina
fi: Fínština
'no': Nórština
uk: Ukrajinčina
ms: Malajština
machines: machines:
ANCIENT_ALTAR: ANCIENT_ALTAR:
not-enough-pedestals: "&4Oltár nie je obkolesený dostatočným počtom podstáv&c(%pedestals% not-enough-pedestals: "&4Oltár nie je obkolesený dostatočným počtom podstáv&c(%pedestals%
@ -214,7 +211,6 @@ messages:
multimeter: "&bUložená energia: &3%stored% &b/ &3%capacity%" multimeter: "&bUložená energia: &3%stored% &b/ &3%capacity%"
no-iron-golem-heal: "&cToto nie je železný ingot. Toto nemôžeš použiť na uzdravenie no-iron-golem-heal: "&cToto nie je železný ingot. Toto nemôžeš použiť na uzdravenie
iron golema!" iron golema!"
no-permission: "& 4Na to nemáte potrebné povolenie"
no-pvp: "&cTu nemôžeš útočiť na hráčov!" no-pvp: "&cTu nemôžeš útočiť na hráčov!"
not-enough-xp: "&4Nemáš dostatok XP na odomknutie" not-enough-xp: "&4Nemáš dostatok XP na odomknutie"
no-tome-yourself: "&cNemôžeš použiť &4Knihu vedomostí &cna seba..." no-tome-yourself: "&cNemôžeš použiť &4Knihu vedomostí &cna seba..."
@ -252,6 +248,7 @@ messages:
unknown-player: "&4Neznámy hráč: &c%player%" unknown-player: "&4Neznámy hráč: &c%player%"
unlocked: '&bOdomkol si &7"%research%"' unlocked: '&bOdomkol si &7"%research%"'
usage: "&4Použitie: &c%usage%" usage: "&4Použitie: &c%usage%"
no-permission: "&4Na to nemáš potrebné oprávnenie"
miner: miner:
no-ores: "&ePrepáč, nenašiel som žiadne ore naokolo!" no-ores: "&ePrepáč, nenašiel som žiadne ore naokolo!"
workbench: workbench:

View File

@ -92,9 +92,6 @@ guide:
lore: Klicka här för att lägga till din egen översättning lore: Klicka här för att lägga till din egen översättning
name: "&aIs något som saknas?" name: "&aIs något som saknas?"
updated: "&aDitt språk är nu inställt på: &b%lang%" updated: "&aDitt språk är nu inställt på: &b%lang%"
progress:
messages: Chat meddelanden
researches: Forska namn
pages: pages:
next: Nästa sida next: Nästa sida
previous: Förra sidan previous: Förra sidan

View File

@ -94,9 +94,6 @@ guide:
lore: Nhấn vào đây để thêm bản dịch của riêng bạn lore: Nhấn vào đây để thêm bản dịch của riêng bạn
name: "&aThiếu một cái gì đó?" name: "&aThiếu một cái gì đó?"
updated: "&aNgôn ngữ của bạn đã được đặt thành công: &b%lang%" updated: "&aNgôn ngữ của bạn đã được đặt thành công: &b%lang%"
progress:
messages: Tin nhắn trò chuyện
researches: Tên nghiên cứu
pages: pages:
next: Trang tiếp theo next: Trang tiếp theo
previous: Trang trước previous: Trang trước

View File

@ -92,9 +92,6 @@ guide:
lore: 单击添加你自己的翻译 lore: 单击添加你自己的翻译
name: "&a少了些什么?" name: "&a少了些什么?"
updated: "&a你的语言已设为: &b%lang%" updated: "&a你的语言已设为: &b%lang%"
progress:
messages: 聊天消息
researches: 研究名字
pages: pages:
next: 下一页 next: 下一页
previous: 上一页 previous: 上一页

View File

@ -92,9 +92,6 @@ guide:
lore: 點擊增加您自己的翻譯 lore: 點擊增加您自己的翻譯
name: "&a缺少什麼嗎?" name: "&a缺少什麼嗎?"
updated: "&a你的語言已改成: &b%lang%" updated: "&a你的語言已改成: &b%lang%"
progress:
messages: 聊天欄訊息
researches: 研究名稱
pages: pages:
next: 下一頁 next: 下一頁
previous: 上一頁 previous: 上一頁

View File

@ -0,0 +1,24 @@
---
tooltips:
results: GEO-Scan Ergebnisse
chunk: Gescannter Chunk
world: Welt
unit: Einheit
units: Einheiten
resources:
slimefun:
oil: Öl
nether_ice: Nether-Eis
salt: Salz
uranium: Uran
slimefunorechunks:
iron_ore_chunk: Eisenerzbrocken
gold_ore_chunk: Golderzbrocken
copper_ore_chunk: Kupfererzbrocken
tin_ore_chunk: Zinnerzbrocken
silver_ore_chunk: Silbererzbrocken
aluminum_ore_chunk: Aluminiumerzbrocken
lead_ore_chunk: Bleierzbrocken
zinc_ore_chunk: Zinkerzbrocken
nickel_ore_chunk: Nickelerzbrocken
cobalt_ore_chunk: Kobalterzbrocken

View File

@ -0,0 +1,25 @@
tooltips:
results: 'GEO-Scan Results'
chunk: 'Scanned Chunk'
world: 'World'
unit: 'Unit'
units: 'Units'
resources:
slimefun:
oil: 'Oil'
nether_ice: 'Nether Ice'
salt: 'Salt'
uranium: 'Uranium'
slimefunorechunks:
iron_ore_chunk: 'Iron Ore Chunk'
gold_ore_chunk: 'Gold Ore Chunk'
copper_ore_chunk: 'Copper Ore Chunk'
tin_ore_chunk: 'Tin Ore Chunk'
silver_ore_chunk: 'Silver Ore Chunk'
aluminum_ore_chunk: 'Aluminum Ore Chunk'
lead_ore_chunk: 'Lead Ore Chunk'
zinc_ore_chunk: 'Zinc Ore Chunk'
nickel_ore_chunk: 'Nickel Ore Chunk'
cobalt_ore_chunk: 'Cobalt Ore Chunk'