mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Added an option to allow normal creative researching
This commit is contained in:
parent
da8749ffca
commit
d819e1d6bc
@ -7,6 +7,7 @@ options:
|
|||||||
prefix: '&a&lSlimefun &7>'
|
prefix: '&a&lSlimefun &7>'
|
||||||
auto-save-delay-in-minutes: 10
|
auto-save-delay-in-minutes: 10
|
||||||
show-vanilla-recipes-in-guide: true
|
show-vanilla-recipes-in-guide: true
|
||||||
|
allow-free-creative-research: true
|
||||||
guide:
|
guide:
|
||||||
default-view-book: false
|
default-view-book: false
|
||||||
URID:
|
URID:
|
||||||
|
@ -67,6 +67,7 @@ public class SlimefunGuide {
|
|||||||
public static Date last_update = new Date();
|
public static Date last_update = new Date();
|
||||||
|
|
||||||
static boolean all_recipes = true;
|
static boolean all_recipes = true;
|
||||||
|
public static boolean creative_research = true;
|
||||||
private static final int category_size = 36;
|
private static final int category_size = 36;
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -866,7 +867,7 @@ public class SlimefunGuide {
|
|||||||
@Override
|
@Override
|
||||||
public boolean onClick(final Player p, int slot, ItemStack item, ClickAction action) {
|
public boolean onClick(final Player p, int slot, ItemStack item, ClickAction action) {
|
||||||
boolean canBuy = false;
|
boolean canBuy = false;
|
||||||
if (p.getGameMode() == GameMode.CREATIVE) canBuy = true;
|
if (p.getGameMode() == GameMode.CREATIVE && creative_research) canBuy = true;
|
||||||
else if (p.getLevel() >= cost) {
|
else if (p.getLevel() >= cost) {
|
||||||
p.setLevel(p.getLevel() - cost);
|
p.setLevel(p.getLevel() - cost);
|
||||||
canBuy = true;
|
canBuy = true;
|
||||||
@ -878,7 +879,7 @@ public class SlimefunGuide {
|
|||||||
if (researched) openCategory(p, category, true, selected_page, experimental);
|
if (researched) openCategory(p, category, true, selected_page, experimental);
|
||||||
else if (!Research.isResearching(p)){
|
else if (!Research.isResearching(p)){
|
||||||
if (p.getGameMode() == GameMode.CREATIVE) {
|
if (p.getGameMode() == GameMode.CREATIVE) {
|
||||||
research.unlock(p, true);
|
research.unlock(p, creative_research);
|
||||||
openCategory(p, category, survival, selected_page, experimental);
|
openCategory(p, category, survival, selected_page, experimental);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -384,6 +384,7 @@ public class SlimefunStartup extends JavaPlugin {
|
|||||||
|
|
||||||
if (clearlag) new ClearLaggIntegration(this);
|
if (clearlag) new ClearLaggIntegration(this);
|
||||||
|
|
||||||
|
SlimefunGuide.creative_research = config.getBoolean("options.allow-free-creative-research");
|
||||||
// Do not show /sf elevator command in our Log, it could get quite spammy
|
// Do not show /sf elevator command in our Log, it could get quite spammy
|
||||||
CSCoreLib.getLib().filterLog("([A-Za-z0-9_]{3,16}) issued server command: /sf elevator (.{0,})");
|
CSCoreLib.getLib().filterLog("([A-Za-z0-9_]{3,16}) issued server command: /sf elevator (.{0,})");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user