Git Product home page Git Product logo

level's Introduction

Level

Build Status Bugs Reliability Rating Lines of Code

About

Add-on for BentoBox to calculate island levels for BentoBox game modes like BSkyBlock and AcidIsland. It counts blocks and assigns a value to them. Players gain levels by accumulating points and can lose levels too if their points go down. This add-on will work for game modes listed in the config.yml.

Full documentation for Level can be found at docs.bentobox.world.

Official download releases are at download.bentobox.world.

How to use

  1. Place the level addon jar in the addons folder of the BentoBox plugin
  2. Restart the server
  3. The addon will create a data folder and inside the folder will be a config.yml
  4. Edit the config.yml how you want. The config specifies how much blocks are worth (see below)
  5. Restart the server if you make a change

Upgrading

  1. Read the release notes carefully, but you may have to delete the old config.yml to use a new one.

Permissions

Permissions are given automatically to players as listed below for BSkyBlock, AcidIsland and CaveBlock. If your permissions plugin strips permissions then you may have to allocate these manually. Note that if a player doesn't have the intopten permission, they will not be listed in the top ten.

permissions:    
  bskyblock.intopten:
    description: Player is in the top ten.
    default: true
  bskyblock.island.level:
    description: Player can use level command
    default: true
  bskyblock.island.top:
    description: Player can use top ten command
    default: true
  bskyblock.island.value:
    description: Player can use value command
    default: true
  bskyblock.admin.level:
    description: Player can use admin level command
    default: true
  bskyblock.admin.topten:
    description: Player can use admin top ten command
    default: true

Config.yml

The config.yml has the following sections:

  • Game Mode Addon configuration
  • General settings
  • Limits
  • Block values
  • Per-world block values

Game Mode Addon configuration

This section allows you to list which game mode add-ons Level should hook into. Use BentoBox's version command to list the official add-on name.

General Settings

This section defines a number of overall settings for the add-on.

  • Underwater block multiplier - default value = 1. If this value is > 1 then blocks below sea level will have a greater value.
  • Level cost - Value of one island level. Default 100. Minimum value is 1.
  • Level wait - Cool down between level requests in seconds
  • Death penalty - How many block values a player will lose per death. Default value of 100 means that for every death, the player will lose 1 level (if levelcost is 100)
  • Sum Team Deaths - if true, all the team member deaths are summed. If false, only the leader's deaths counts.
  • Max deaths - If player dies more than this, it doesn't count anymore.
  • Reset deaths on island reset
  • Reset deaths on team join

Limits

This section lists the limits for any particular block. Blocks over this amount are not counted. This limit applies to all game modes and is not world-specific. Format is MATERIAL: value

Block values

This section lists the value of a block in all game modes (worlds). To specific world-specific values, use the next section. Value must be an integer. Any blocks not listed will have a value of 0. AIR is always zero. Format is MATERIAL: value.

World-specific block values

List any blocks that have a different value in a specific world. If a block is not listed, the default value will be used from the blocks section. Prefix with world name. The values will apply to the associated nether and the end if they exist. Example:

worlds:
  AcidIsland_world:
    SAND: 0
    SANDSTONE: 0
    ICE: 0

In this example, AcidIsland will use the same values as BSkyBlock for all blocks except for sand, sandstone and ice.

level's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

level's Issues

Death Count Does Not Increase

I've tried dying Opped and not. Can't seem to make the death count budge.
Plugins (14): WorldEdit, BentoBox, PermissionsEx, Vault, WorldGuard, Multiverse-Core, Citizens, ChestShop, Essentials, ChatControl, HeadDatabase, CrateReloaded, EssentialsSpawn, VanishNoPacket

Adjust island-level by a static value

https://github.com/tastybento/bskyblock/issues/69

From @ghacproductions on May 14, 2017 19:21

Hey,

I've checked both the plugin-site on spigotmc.org and the source-code (atleast a quick check) and could not find a (possible) feature:

Adjusting the island-level of a player(his island) by a static value (setting, adding or removing an amount of levels).
This would be very useful for giving whole levels for specific challenges as the challenges could simply execute an "island leveladd" command to give a specifc amount of levels (points). Additionally, other plugins could hook into the system and execute commands to give islandlevel.

If this is an appreciated feature, I'ld happily create a PR for this feature.

Greetings
ghac

Copied from original issue: tastybento/ASkyBlock-Bugs-N-Features#220

Is top bug

From @Frozen-Craft on October 15, 2018 16:12

Describe the bug
Island appear twice in topten

To Reproduce
Steps to reproduce the behavior:
The bug seems appear when a player give make another player owner
(and the island level change)

Expected behavior
there is some bugs with islands owner and others island ranks please fix them

Screenshots
https://imgur.com/a/B0Vyocc

Server Information (please complete the following information):

  • Database being used: Flat file
  • OS: Linux
  • Java Version: Java 8
  • Other plugins? LuckPerms, WorldEdit, SkyGUI, EggCatcher, CustomOreGen, MinewebBridge, PlugMan, AdvancedBan, ProtocolLib, WorldGuard, HideAndCustomPlugins, VoidGenerator, BentoBox, VoxelSniper, AdvancedBanGUI, TAB, CS-CoreLib, Vault, Essentials, EpicRename, QuickShop, Multiverse-Core, Citizens, VanishNoPacket, MythicMobs, Slimefun, EssentialsChat, Shop, EssentialsSpawn, DungeonsXL, CrateReloaded

Copied from original issue: BentoBoxWorld/BentoBox#307

Deaths Reset On Reset

Description
Death Count is persistant after reset

Steps to reproduce the behavior:
Die (rip)
See deaths in /ai/is level
reset island
still see deaths in ai/is level

Expected behavior
All deaths to be wiped upon island reset

Screenshots
https://youtu.be/jFktzC3RylY

Server Information:
[Please complete the following information:]

Database being used (YAML, JSON, MySQL, MongoDB): FLATFILE
OS: CENTOS
Java Version: I think 8 or above
BentoBox version: 0.18.0
Addons installed? See Pic
Other plugins? See Pic
image
image

Additional context
For the custom plugins we run that hook into BBOX all info can be found on Git https://github.com/TreeboMC
CONFIGS.zip

Cost and Level in GUI

Is your feature request related to a problem? Please describe.
Players currently can't see the level requirement or cost of a biome without attempting to change to that biome, very inconvenient for players.

Describe the solution you'd like
Display the biome cost and the level requirement in the lore of the biome icon. If the cost is set to 0 or level requirement are set to 0 then they should not be displayed in the GUI in order to keep it tidier.

Calculate level on login

Is your feature request related to a problem? Please describe.
Players can control when level is calculated and choose not to calculate their new level if they know it'll be older than their old one.

Describe the solution you'd like
Config option to control whether island level is calculated on login, like in ASkyblock.

Block values broken

When editing the island level config it doesn't actually do anything. The changes save and they aren't overwritten but the changes don't actually take effect on the server. For example if I change the levelwait value, the cooldown stays at the default value. This is the same for the levelcost also.

It also seems as if the island level is broken in general? Each cobblestone block placed counts as one level, rather than 1 point towards the 100 for a level as suggested by the default config.

Trying to get the top ten.

Hi.
I'm trying to get the top ten from the Level addon in my plugin. My plan was to list the top 10 islands' owners and levels to the chat, when I run a command. But I can't figure out how should I do that.
I've tried few things:

TopTen topten = ((Level) bentoBox.getAddonsManager().getAddonByName("Level").get()).getTopTen();

java.lang.NoClassDefFoundError: world/bentobox/level/Level

Addon lvl = bentoBox.getAddonsManager().getAddonByName("Level").get();

Method mthd = lvl.getClass().getMethod("getTopTen");

TopTen topten = (TopTen) mthd.invoke(lvl);

java.lang.ClassNotFoundException: world.bentobox.level.TopTen

So the question is; how shall I do this?

Thanks in advance for your reply.

Soft block limits

Is your feature request related to a problem? Please describe.
Instead of (or in addition to) a hard block limit, it would be nice to include a system where blocks above a certain level don't count for nothing, but instead count for less and less as more and more of the block is placed. This is similar to uSkyblock's diminishingreturns feature.

Describe the solution you'd like
Include an addition value to input in the level config for the value which the soft limit will kick in for each individual block. Then, in another part of the config, a place to set the scale at which the block values will diminish.

Describe alternatives you've considered
The ability to create other lists in the config to specify the worth of blocks when a number of them have been placed. For example, cobble being worth 1 per block after 10000 have been placed, .5 after 15000, etc.

The commands "/bsb top" and "/acid top" do not display the top ten player list

Description
Typing the commands "/bsb top" and "/acid top" cannot be displayed in the top 10 players in the chat bar.

Steps to reproduce the behavior:

  1. Type the command '/bsb top'
  2. But will output '/bsbadmin top: show the top ten list'
  3. Scroll down to '....'
  4. See error

Expected behavior
I can use it in previous versions, I want to use this feature to do the top ten list of holograms.

Screenshots
qul3c_vc j 2e_hpb j qlf

Server Information:

[Please complete the following information:]

  • Database being used (YAML, JSON, MySQL, MongoDB): [YAML]
  • OS: [Windows 7]
  • Java Version: [Java 8]
  • BentoBox version: [last Stable Build]
  • Addons installed? [[16:24:48 INFO]: Running SPIGOT 1.13.2.
    [16:24:48 INFO]: BentoBox version: 1.3.0-SNAPSHOT
    [16:24:48 INFO]: Loaded Game Worlds:
    [16:24:48 INFO]: AcidIsland_world (AcidIsland)
    [16:24:48 INFO]: BSkyBlock_world (BSkyBlock)
    [16:24:48 INFO]: Loaded Addons:
    [16:24:48 INFO]: AcidIsland 1.3.0-SNAPSHOT
    [16:24:48 INFO]: BSkyBlock 1.3.0-SNAPSHOT
    [16:24:48 INFO]: Biomes 0.5.0-SNAPSHOT
    [16:24:48 INFO]: Challenges 0.6.0-SNAPSHOT
    [16:24:48 INFO]: Level 1.2.1-SNAPSHOT
    [16:24:48 INFO]: Limits 0.1.0-SNAPSHOT
    [16:24:48 INFO]: WelcomeWarps 1.2-SNAPSHOT]
  • Other plugins? [[16:25:18 INFO]: Plugins (22): LuckPerms, WorldEdit, VoidGenerator, PlaceholderA
    PI, HackedServer, SQLibrary, Vault, PlayerPoints, WorldGuard, Citizens, BentoBox
    , React, CMIEInjector, ExtraContexts, Multiverse-Core, Residence, CMI, LocketteP
    ro, BossShopPro, PlayerShops, ItemShops, GuiShopManager]

Additional context
Add any other context about the problem here.

Feature - IS Top Based on Island Members

https://github.com/tastybento/bskyblock/issues/72

From @Fluxty on June 17, 2017 15:59

Islands with less than the max members are at a disadvantage on /is top, due to larger teams being able to make more progress. This is particularly challenging for solo islands and becomes increasingly demotivating to play on servers that are not freshly reset.

I'm proposing alongside the global /is top there could also be island top leaderboards based on the team members, so a separate is top for teams of 1, 2, 3, etc. exclusively.

Copied from original issue: tastybento/ASkyBlock-Bugs-N-Features#284

Signs not recognized

Spigot 1.14.3 latest (Jenkins 2382)
git-Spigot-935adb3-a0e4747 (MC: 1.14.3) (Implementing API version 1.14.3-R0.1-SNAPSHOT)

Description

Describe the bug

[16:13:08] [Server thread/WARN]: [BentoBox] Unknown material (SIGN) in config.yml blocks section. Skipping...
[16:13:08] [Server thread/WARN]: [BentoBox] Unknown material (WALL_SIGN) in config.yml blocks section. Skipping...

Steps to reproduce the behavior

  • Start server
  • Process console/log

Screenshots and videos

Expected behavior

New materials should be included in configuration.

Environment

Server

  • OS: CentOS Linux release 7.6.1810 (Core)
  • Java version: java version "11.0.3" 2019-04-16 LTS
    Java(TM) SE Runtime Environment 18.9 (build 11.0.3+12-LTS)
    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.3+12-LTS, mixed mode)

Plugins

Many, but irrelevant to this issue.

BentoBox setup

BentoBox and Addons
>bbox version
[18:18:12] [Server thread/INFO]: Running SPIGOT 1.14.3.
[18:18:12] [Server thread/INFO]: BentoBox version: 1.6.0-SNAPSHOT-b1225
[18:18:12] [Server thread/INFO]: Loaded Game Worlds:
[18:18:12] [Server thread/INFO]: world_skyblock (SkyBlock): Overworld, Nether, End
[18:18:12] [Server thread/INFO]: Loaded Addons:
[18:18:12] [Server thread/INFO]: BSkyBlock 1.5.3-SNAPSHOT (ENABLED)
[18:18:12] [Server thread/INFO]: Challenges 0.8.0-SNAPSHOT-#278 (ENABLED)
[18:18:12] [Server thread/INFO]: Level 1.5.1-SNAPSHOT (ENABLED)
Configuration
  • Database: JSON

Additional context

Add Support for CaveBlock & SkyGrid

As the 2 new gamemode addons have now been made level needs to know about them. there is no Commands for CaveBlock or SkyGrid registered in the addon.yml.

Island Levels

The level of the island as well as placing the blocks could also be increased by completing the challenges. For each challenge a score could be assigned that can be established within the file.

that islandresetdeathreset: true is not working

Description
A clear and concise description of what the bug is.
The addon doesn't reset your deaths even tho it's enabled to islandresetdeathreset: true

Steps to reproduce the behavior:

  1. Just try it.

Expected behavior
it should work

Screenshots
no need sir

Server Information:

[Please complete the following information:]

  • YAML
  • Multicraft (linux)
  • Java 8
  • bbox version: 1.5.3
  • Addons installed? yes level addon is 1.5.0
  • Other plugins? yes other plugins: multiverse, worldedit, worldguard, multiverse inv

Additional context
just doesn't work

[Bug] Is level calculation

Description

Describe the bug

The level calculation got mixed up

Steps to reproduce the behavior

  1. make 3 blueprints
  2. stop server
  3. delete worlds
  4. delete databases
  5. start server
  6. start island by choosing 1 of the blueprints
  7. check to see that Is level = 0
  8. is reset and choose different island
  9. check is level. Result is e.g. -22
  10. is reset and choose different island
  11. check is level. Result is e.g. 99
  12. is reset and choose the same island as step 6
  13. check is level. Result is e.g. -57
  14. is reset and choose the same island as step 8
  15. check is level. Result is e.g. 198

Screenshots and videos

Expected behavior

I am trying to understand the logic behind this.

Environment

Server

  • OS: Linux
  • Java version: 1.8.0_212

Plugins

BentoBox, CMI, LuckPerms, Vault*, WorldBorder, WorldEdit, WorldEditCUI, WorldGuard

BentoBox setup

BentoBox and Addons
Running PAPER 1.13.2.
BentoBox version: 1.5.0-SNAPSHOT-b1097
Loaded Game Worlds:
bskyblock_world (BSkyBlock): Overworld, Nether, End
Loaded Addons:
Biomes 1.5.0.0-SNAPSHOT-b79
BSkyBlock 1.5.0
Challenges 0.7.5-SNAPSHOT-b227
Level 1.5.0-SNAPSHOT
Limits 0.2.0-SNAPSHOT
MagicCobblestoneGenerator 1.5.0.1
Configuration
  • Database: JSON

Additional context

Get level from IslandLevelCalculatedEvent level does not match actual level

To get island level:

Math.toIntExact((long)(new AddonRequestBuilder()).addon("Level").label("island-level").addMetaData("player", uuid).addMetaData("world-name", world).request());

(It matches with /is level)

To get island level from event:

Math.toIntExact((long) event.getKeyValues().get("level"));

Island level from event shows 2 or 3 more levels.

Island: 0.2.0
Database: yml

Nether Island Level

Is it already possible to somehow enable level calculation in nether and maybe end world too?
This would be really good feature.

Negative level calculated

Description
The problem is that the BSkyblock levels are calculated wrong.

Steps to reproduce the behavior:
Using the command /island level

Expected behavior
I expected to see positive levels (level 17?)

Console dump (Using the command "/bsbadmin user GonzoDark")
10.02 20:38:39 [Server] INFO Calculating level...
10.02 20:38:39 [Server] INFO Island level is -449
10.02 20:38:39 [Server] INFO Level Log for island in BSkyBlock at 0,120,0
10.02 20:38:39 [Server] INFO Island owner UUID = 31a89138-24bd-44da-aa33-b5e50d54a3f6
10.02 20:38:39 [Server] INFO Total block value count = 1,712
10.02 20:38:39 [Server] INFO Level cost = 100
10.02 20:38:39 [Server] INFO Deaths handicap = 0
10.02 20:38:39 [Server] INFO Level calculated = 17
10.02 20:38:39 [Server] INFO ==================================
10.02 20:38:39 [Server] INFO Regular block count
10.02 20:38:39 [Server] INFO Total number of blocks = 2,085
10.02 20:38:39 [Server] INFO OAK_PLANKS:864 blocks x 1 = 864
10.02 20:38:39 [Server] INFO COBBLESTONE:239 blocks x 1 = 239
10.02 20:38:39 [Server] INFO JUNGLE_LEAVES:237 blocks x 0 = 0
10.02 20:38:39 [Server] INFO VINE:147 blocks x 1 = 147
10.02 20:38:39 [Server] INFO JUNGLE_LOG:99 blocks x 0 = 0
10.02 20:38:39 [Server] INFO SPRUCE_LEAVES:95 blocks x 0 = 0
10.02 20:38:39 [Server] INFO BIRCH_LEAVES:58 blocks x 0 = 0
10.02 20:38:39 [Server] INFO SPRUCE_LOG:53 blocks x 0 = 0
10.02 20:38:39 [Server] INFO WATER:52 blocks x 0 = 0
10.02 20:38:39 [Server] INFO FARMLAND:30 blocks x 1 = 30
10.02 20:38:39 [Server] INFO DIRT:28 blocks x 3 = 84
10.02 20:38:39 [Server] INFO GRASS_BLOCK:25 blocks x 4 = 100
10.02 20:38:39 [Server] INFO TORCH:23 blocks x 1 = 23
10.02 20:38:39 [Server] INFO BIRCH_PLANKS:19 blocks x 1 = 19
10.02 20:38:39 [Server] INFO SUGAR_CANE:11 blocks x 1 = 11
10.02 20:38:39 [Server] INFO CACTUS:11 blocks x 1 = 11
10.02 20:38:39 [Server] INFO ATTACHED_MELON_STEM:8 blocks x 1 = 8
10.02 20:38:39 [Server] INFO LADDER:8 blocks x 2 = 16
10.02 20:38:39 [Server] INFO CHEST:8 blocks x 8 = 64
10.02 20:38:39 [Server] INFO PODZOL:8 blocks x 2 = 16
10.02 20:38:39 [Server] INFO MELON:8 blocks x 1 = 8
10.02 20:38:39 [Server] INFO WHEAT:8 blocks x 1 = 8
10.02 20:38:39 [Server] INFO PUMPKIN_STEM:8 blocks x 1 = 8
10.02 20:38:39 [Server] INFO SAND:6 blocks x 1 = 6
10.02 20:38:39 [Server] INFO BIRCH_LOG:6 blocks x 0 = 0
10.02 20:38:39 [Server] INFO PUMPKIN:5 blocks x 1 = 5
10.02 20:38:39 [Server] INFO WALL_TORCH:5 blocks x 1 = 5
10.02 20:38:39 [Server] INFO ATTACHED_PUMPKIN_STEM:5 blocks x 1 = 5
10.02 20:38:39 [Server] INFO WALL_SIGN:4 blocks x 6 = 24
10.02 20:38:39 [Server] INFO LAVA:2 blocks x 0 = 0
10.02 20:38:39 [Server] INFO MELON_STEM:1 blocks x 1 = 1
10.02 20:38:39 [Server] INFO FURNACE:1 blocks x 8 = 8
10.02 20:38:39 [Server] INFO BEDROCK:1 blocks x 0 = 0
10.02 20:38:39 [Server] INFO CRAFTING_TABLE:1 blocks x 1 = 1
10.02 20:38:39 [Server] INFO POTTED_POPPY:1 blocks x 1 = 1
10.02 20:38:39 [Server] INFO Subtotal = 1712
10.02 20:38:39 [Server] INFO ==================================
10.02 20:38:39 [Server] INFO Blocks not counted because they exceeded limits: 0
10.02 20:38:39 [Server] INFO ==================================
10.02 20:38:39 [Server] INFO Blocks on island that are not in config.yml
10.02 20:38:39 [Server] INFO Total number = 0
10.02 20:38:39 [Server] INFO ==================================

Server Information:

[Please complete the following information:]

  • Database being used (YAML, JSON, MySQL, MongoDB): []
    YAML
  • OS: [e.g. iOS]
    Ubuntu 18.04
  • Java Version: [e.g. Java 8]
    Java 8
  • BentoBox version: [e.g. 1.7.2.21]
    1.2.1
  • Addons installed? [Do '/bentobox version' and copy/paste from the console]
    SkyGrid 0.0.1-SNAPSHOT
    AcidIsland 1.0
    BSkyblock 1.1
    Challenges 0.5.0-SNAPSHOT
    Level 0.2.0
  • Other plugins? [Do '/plugins' and copy/paste from the console]
    Plugins (22): CoreProtect, Wild, WorldEdit, FastAsyncWorldEdit, GameAPI, FlashlightPlus, Essentials, CommandHelper, PermissionsEx, Boss, mcMMO, Vault, WorldGuard, ProtocolLib, BentoBox, PerWorldInventory, PlotSquared, PreciousStones, Multiverse-Core, ChatControl, Multiverse-NetherPortals, CoreArena

Additional context
None

Issus when adding last challenges and last level update of buento box

Weird GUI issus occure when adding challenges and level with buentobox skyblock. I can precisly say looking like some part of the code showing up. for my part i have simply test without level and working fine. still i need level on my server for the simple advancement purpose. im adding you a screen shop of issus occuring im prety sure its because a code line is not close or maybe something more advance than what i know. i wish you know what's the issus.

there is a discord

https://media.discordapp.net/attachments/351818427301625857/551958636914540574/unknown.png?width=862&height=485

Island top data

TopTen Data file name is being saved as Upper case
It also does not seem to hold the current IS Top data
reverts to old data instead of current

image

Running SPIGOT 1.14.3.
BentoBox version: 1.6.0-SNAPSHOT-b1225
Loaded Game Worlds:
acidisland_world (acidisland): Overworld, Nether, End
Loaded Addons:
AcidIsland 1.5.1-SNAPSHOT (ENABLED)
Biomes 1.5.2.1-SNAPSHOT-b124 (ENABLED)
Challenges 0.8.0-SNAPSHOT-#278 (ENABLED)
Level 1.5.1-SNAPSHOT (ENABLED)
Limits 0.2.3-SNAPSHOT (ENABLED)
WelcomeWarps 1.5.2-SNAPSHOT (ENABLED)

Shorthand island level

I would like to see an option in level yml file that allows for shorthand island level like in ASkyBlock. (10,000 -> 10k)

Display Top 10 as an Hologram

From @Poslovitch on March 29, 2017 18:39

From @Poslovitch on November 30, 2016 10:34

The display place should be set by an admin command (e.g, /asadmin displaytop10).

It would display the top 10 as an Hologram (like this picture : goo.gl/lXUKAu )
Try to make it without using HolographicDisplayAPI (so would need a little NMS handling, but i think we could have a look on this class of a plugin i worked a little on : https://github.com/TheBusyBiscuit/Slimefun4/blob/master/src/me/mrCookieSlime/Slimefun/holograms/ArmorStandFactory.java )

Should have an "auto-update" too ^^

And why do not "built-in" TopTenHeads in ASkyBlock?

Copied from original issue: tastybento/askyblock#383

Copied from original issue: tastybento/ASkyBlock-Bugs-N-Features#48

Trying to hook PlaceholderAPI for player island level.

package bskyblock.addon.level.placeholder;

import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;

import bskyblock.addon.level.Level;

public class PlaceholderAPI extends PlaceholderExpansion {

private Level levelPlugin;

public String getIdentifier() {
    return "bskyblock";
}

public String getPlugin() {
    return null;
}


public String getAuthor() {
    return "botneil";
}

public String getVersion() {
    return "0.69";
}
public String onPlaceholderRequest(Player p, String identifier) {
    if(identifier.equalsIgnoreCase("onlines")){
        return String.valueOf(Bukkit.getOnlinePlayers().size());
    }
    if(p == null){
        return "";
    }
    if(identifier.equalsIgnoreCase("level")){
        return String.valueOf(Long.toString(levelPlugin.getIslandLevel(p.getWorld(), p.getUniqueId())));
    }
	return null;

}

}
I just keep getting nullpointer exceptions, what am I doing wrong?
"return String.valueOf(Long.toString(levelPlugin.getIslandLevel(p.getWorld(), p.getUniqueId())));" is the line that doesn't work

API to support "custom blocks" in level calculation

https://github.com/tastybento/bskyblock/issues/21

From @Poslovitch on May 3, 2017 19:14

Idea taken from : https://forum.rinaorc.com/index.php?threads/skyblock.9667/ (french server forum)

Consists in giving to developpers a programming interface to register their "custom blocks", ideally an abstract Object.

When calculating the island level, ASB would go through every registered custom block and ask if a block is "special". Then if true, ASB will use the "custom" block value instead of the vanilla one.

I.e : Slimefun (https://github.com/TheBusyBiscuit/Slimefun4) adds a 24-Carat Gold Block, which is extremely valuable, as it is hard to obtain. But, when placed on an island, this block doesn't give much levels as a regular gold block.
Hopefully, Poslovitch worked hard on a new feature in ASB API ( :D ), which allows Slimefun to register this custom block !
And now, when ASB calculates island level, it checks if the block is "custom" (by an abstract method "isCustom" which returns a boolean). If true, it uses the value of the custom block (Slimefun gives a default value, but it can be overriden by adding a line with the "id" of the custom block in blockvalues.yml), otherwise it uses the vanilla value.

And it would work the same for /is value.

This is an idea that may slow the level calculation, but I think it would be something very interesting. It's now possible with plugins (and even with resource packs!) to "add" blocks. Providing a way to make them more or less valuable than "normal" blocks would be an "added value" to the overall plugin as well as promoting incredible plugins like Slimefun.

Copied from original issue: tastybento/ASkyBlock-Bugs-N-Features#180

Console error when changing world name

Description
If I change my world name from the default "AcidIsland_world" name everything works fine except I get this error in the console or startup:

[ERROR] [BentoBox] Level Addon: No such world : AcidIsland_world

Steps to reproduce the behavior:

  1. Change world name
  2. Restart server
  3. Read console
  4. See error

Expected behavior
For there to be no error in the console.

Server Information:

  • Database: Flat file
  • OS: Debian
  • Java Version: 8
  • BentoBox version: Latest
  • Addons installed? All of them

World names in LevelsData do not get updated

Description
The world names in the LevelsData do not get updated accordingly to the gamemode's world name

Steps to reproduce the behavior:

  1. Change the worldname
  2. Get the island level using a placeholder: it will always return 0, although the island level is, e.g., 8.

Expected behavior
The world names in the LevelsData should be updated whenever the gamemodes' world names are updated.

Screenshots
None.

Server Information:
Most of it is irrelevant, however this became an issue with 1.5.0 as we're recommending users to lowercase their worlds' names.

Additional context
None.

Request for /is top

Is your feature request related to a problem? Please describe.
A small problem, the players heads in /is top has color codes which we can't change.
Now it's &e&o and it would be nice to be able to change that in the config

Describe the solution you'd like
Adding an extra feature in the config file to edit the color codes of a players head in /is top

Describe alternatives you've considered
I am not sure which any other alternative solution there is for this "problem"

Additional context
image

Placeholder support

Is there a placeholder for chat formatting (EssentialsX) for this level addon?

add readme.md

Add a readme that explains how to use this addon for server owners or simply use a link that explains how.

Exception on island top at console

Description

island top

at console generates the following error. In-game /island top opens the GUI.

Steps to reproduce the behavior:

>island top
[13:31:01 WARN]: Unexpected exception while parsing console command "island top"
org.bukkit.command.CommandException: Unhandled exception executing 'island top' in world.bentobox.bskyblock.commands.IslandCommand(island)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:146) ~[spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        at org.bukkit.craftbukkit.v1_13_R2.CraftServer.dispatchCommand(CraftServer.java:702) ~[spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        at org.bukkit.craftbukkit.v1_13_R2.CraftServer.dispatchServerCommand(CraftServer.java:687) [spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        at net.minecraft.server.v1_13_R2.DedicatedServer.aU(DedicatedServer.java:459) [spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:418) [spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:835) [spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:733) [spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_181]
Caused by: java.lang.NullPointerException
        at world.bentobox.bentobox.api.panels.Panel.open(Panel.java:94) ~[?:?]
        at world.bentobox.bentobox.api.panels.Panel.<init>(Panel.java:59) ~[?:?]
        at world.bentobox.bentobox.api.panels.builders.PanelBuilder.build(PanelBuilder.java:95) ~[?:?]
        at world.bentobox.level.TopTen.getGUI(TopTen.java:102) ~[?:?]
        at world.bentobox.level.commands.IslandTop.execute(IslandTop.java:20) ~[?:?]
        at world.bentobox.bentobox.api.commands.CompositeCommand.execute(CompositeCommand.java:237) ~[?:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:139) ~[spigot-1.13.2.jar-2018-11-10-0712:git-Spigot-947a8e7-3a91182]
        ... 7 more

Expected behavior
Command should be executable from the console, but obviously cannot open the GUI. A simple list of top islands would be nice.

Note that ASkyBlock on Spigot 1.12.2 produces:

This command must be used in-game.

Server Information:

  • Spigot 1.13.2 latest
  • BentoBox version: 0.14.1
[13:34:59 INFO]: Bentobox version: 0.14.1
[13:34:59 INFO]: Loaded Game Worlds:
[13:34:59 INFO]: world_skyblock (BSkyBlock)
[13:34:59 INFO]: Loaded Add-Ons
[13:34:59 INFO]: BSkyBlock 0.5.0-SNAPSHOT
[13:34:59 INFO]: BentoBox-Challenges 0.0.3-SNAPSHOT
[13:34:59 INFO]: Level 0.1.0-SNAPSHOT

Team levels

Description
If you team with a player, it does not create one head in the level gui, but rather two
please take a look at these screenshots, that wilkl explain it.
https://imgur.com/a/qy2GRjg
https://imgur.com/a/qy2GRjg

Steps to reproduce the behavior:

  1. Team with another player
  2. do /is top

Expected behavior
it should merge and only create one icon in the gui

Screenshots
https://imgur.com/a/qy2GRjg

Server Information:

[Please complete the following information:]

  • Database being used: JSON
  • OS: Multicraft (linux)
  • Java Version: Java 8
  • BentoBox version: 1.3.1
  • Addons installed? Bskyblock, level, challenges
  • Other plugins? https://imgur.com/PTquWrG

Additional context

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.