mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-22 08:29:35 +00:00
3.0.3-hotfix3
This commit is contained in:
@@ -374,18 +374,22 @@ public class PlatformManager extends Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Sprinkler sprinkler = plugin.getWorldDataManager().getSprinklerData(SimpleLocation.getByBukkitLocation(location));
|
Sprinkler sprinkler = plugin.getWorldDataManager().getSprinklerData(SimpleLocation.getByBukkitLocation(location));
|
||||||
if (sprinkler != null) {
|
|
||||||
WaterAmountHologram waterAmountHologram = sprinklerConfig.getSprinklerHologram();
|
WaterAmountHologram waterAmountHologram = sprinklerConfig.getSprinklerHologram();
|
||||||
if (waterAmountHologram != null) {
|
if (waterAmountHologram != null) {
|
||||||
String content = waterAmountHologram.getContent(sprinkler.getWater(), sprinklerConfig.getStorage());
|
String content;
|
||||||
plugin.getHologramManager().showHologram(player,
|
if (sprinkler != null) {
|
||||||
location.clone().add(0.5, waterAmountHologram.getOffset(),0.5),
|
content = waterAmountHologram.getContent(sprinkler.getWater(), sprinklerConfig.getStorage());
|
||||||
AdventureUtils.getComponentFromMiniMessage(content),
|
} else {
|
||||||
waterAmountHologram.getDuration() * 1000,
|
content = waterAmountHologram.getContent(0, sprinklerConfig.getStorage());
|
||||||
waterAmountHologram.getMode(),
|
|
||||||
waterAmountHologram.getTextDisplayMeta()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
plugin.getHologramManager().showHologram(player,
|
||||||
|
location.clone().add(0.5, waterAmountHologram.getOffset(),0.5),
|
||||||
|
AdventureUtils.getComponentFromMiniMessage(content),
|
||||||
|
waterAmountHologram.getDuration() * 1000,
|
||||||
|
waterAmountHologram.getMode(),
|
||||||
|
waterAmountHologram.getTextDisplayMeta()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ public class MessageManager extends Function {
|
|||||||
public static String setDate;
|
public static String setDate;
|
||||||
public static String worldNotExist;
|
public static String worldNotExist;
|
||||||
public static String seasonNotExist;
|
public static String seasonNotExist;
|
||||||
|
public static String forceWork;
|
||||||
|
public static String forceConsume;
|
||||||
|
|
||||||
public MessageManager(CustomCrops plugin) {
|
public MessageManager(CustomCrops plugin) {
|
||||||
this.plugin =plugin;
|
this.plugin =plugin;
|
||||||
@@ -81,5 +83,7 @@ public class MessageManager extends Function {
|
|||||||
setDate = config.getString("messages.set-date", "<white>Successfully set {world}'s date to {date}.");
|
setDate = config.getString("messages.set-date", "<white>Successfully set {world}'s date to {date}.");
|
||||||
worldNotExist = config.getString("messages.world-not-exist", "<white>World {world} does not exist.");
|
worldNotExist = config.getString("messages.world-not-exist", "<white>World {world} does not exist.");
|
||||||
seasonNotExist = config.getString("messages.season-not-exist", "<white>Season {season} does not exist.");
|
seasonNotExist = config.getString("messages.season-not-exist", "<white>Season {season} does not exist.");
|
||||||
|
forceWork = config.getString("messages.force-sprinkler-work", "<white>Forced {world}'s sprinklers to work.");
|
||||||
|
forceConsume = config.getString("messages.force-consume", "<white>Forced {world}'s pots to reduce water amount and the remaining use of fertilizers.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public class CCWorld extends Function {
|
|||||||
scheduleConsumeTask();
|
scheduleConsumeTask();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (time > 1970 && time < 2030 && lastWorkDay != day) {
|
else if (time > 970 && time < 1030 && lastWorkDay != day) {
|
||||||
lastWorkDay = day;
|
lastWorkDay = day;
|
||||||
if (ConfigManager.enableScheduleSystem) {
|
if (ConfigManager.enableScheduleSystem) {
|
||||||
scheduleSprinklerWork();
|
scheduleSprinklerWork();
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class ConsumeTaskCommand extends AbstractSubCommand {
|
|||||||
AdventureUtils.sendMessage(sender, MessageManager.prefix + MessageManager.worldNotExist.replace("{world}", args.get(0)));
|
AdventureUtils.sendMessage(sender, MessageManager.prefix + MessageManager.worldNotExist.replace("{world}", args.get(0)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
AdventureUtils.sendMessage(sender, MessageManager.prefix + MessageManager.forceConsume.replace("{world}", args.get(0)));
|
||||||
CustomCrops.getInstance().getScheduler().runTaskAsync(() -> {
|
CustomCrops.getInstance().getScheduler().runTaskAsync(() -> {
|
||||||
CCWorld ccworld = CustomCrops.getInstance().getWorldDataManager().getWorld(args.get(0));
|
CCWorld ccworld = CustomCrops.getInstance().getWorldDataManager().getWorld(args.get(0));
|
||||||
if (ccworld != null) {
|
if (ccworld != null) {
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class SprinklerWorkCommand extends AbstractSubCommand {
|
|||||||
AdventureUtils.sendMessage(sender, MessageManager.prefix + MessageManager.worldNotExist.replace("{world}", args.get(0)));
|
AdventureUtils.sendMessage(sender, MessageManager.prefix + MessageManager.worldNotExist.replace("{world}", args.get(0)));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
AdventureUtils.sendMessage(sender, MessageManager.prefix + MessageManager.forceWork.replace("{world}", args.get(0)));
|
||||||
CustomCrops.getInstance().getScheduler().runTaskAsync(() -> {
|
CustomCrops.getInstance().getScheduler().runTaskAsync(() -> {
|
||||||
CCWorld ccworld = CustomCrops.getInstance().getWorldDataManager().getWorld(args.get(0));
|
CCWorld ccworld = CustomCrops.getInstance().getWorldDataManager().getWorld(args.get(0));
|
||||||
if (ccworld != null) {
|
if (ccworld != null) {
|
||||||
|
|||||||
@@ -20,5 +20,5 @@ messages:
|
|||||||
set-date: "<white>Successfully set {world}'s date to {date}."
|
set-date: "<white>Successfully set {world}'s date to {date}."
|
||||||
world-not-exist: '<white>World {world} does not exist.'
|
world-not-exist: '<white>World {world} does not exist.'
|
||||||
season-not-exist: '<white>Season {season} does not exist.'
|
season-not-exist: '<white>Season {season} does not exist.'
|
||||||
force-sprinkler-work: "<white>Forced {world}'s sprinklers to work"
|
force-sprinkler-work: "<white>Forced {world}'s sprinklers to start working."
|
||||||
force-consume: "<white>Forced {world}'s pots to reduce water amount and the remaining use of fertilizers"
|
force-consume: "<white>Forced {world}'s pots to reduce water amount and the remaining use of fertilizers."
|
||||||
Reference in New Issue
Block a user