-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 游戏内编辑 GUI - 单行独立更新周期、显示条件 - HolographicDisplays 导入 - 改善代码, 测试基本稳定 - 对 1.8-1.14 做了兼容 (仍未测试)
- Loading branch information
Showing
27 changed files
with
971 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
src/main/java/me/arasple/mc/trhologram/action/ActionGroups.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package me.arasple.mc.trhologram.action; | ||
|
||
import me.arasple.mc.trhologram.action.base.AbstractAction; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Arasple | ||
* @date 2020/2/15 12:07 | ||
*/ | ||
public class ActionGroups { | ||
|
||
private int priority; | ||
private String requirement; | ||
private List<AbstractAction> actions; | ||
|
||
public ActionGroups(int priority, String requirement, List<AbstractAction> actions) { | ||
this.priority = priority; | ||
this.requirement = requirement; | ||
this.actions = actions; | ||
} | ||
|
||
public int getPriority() { | ||
return priority; | ||
} | ||
|
||
public void setPriority(int priority) { | ||
this.priority = priority; | ||
} | ||
|
||
public String getRequirement() { | ||
return requirement; | ||
} | ||
|
||
public void setRequirement(String requirement) { | ||
this.requirement = requirement; | ||
} | ||
|
||
public List<AbstractAction> getActions() { | ||
return actions; | ||
} | ||
|
||
public void setActions(List<AbstractAction> actions) { | ||
this.actions = actions; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 15 additions & 21 deletions
36
src/main/java/me/arasple/mc/trhologram/commands/CommandDebug.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,26 @@ | ||
package me.arasple.mc.trhologram.commands | ||
|
||
import io.izzel.taboolib.module.command.base.BaseCommand | ||
import io.izzel.taboolib.module.command.base.BaseMainCommand | ||
import me.arasple.mc.trhologram.hologram.HologramContent | ||
import me.arasple.mc.trhologram.hologram.HologramManager | ||
import io.izzel.taboolib.module.command.base.Argument | ||
import io.izzel.taboolib.module.command.base.BaseSubCommand | ||
import me.arasple.mc.trhologram.api.TrHologramAPI | ||
import org.bukkit.command.Command | ||
import org.bukkit.command.CommandSender | ||
import org.bukkit.entity.Player | ||
import java.util.function.Consumer | ||
|
||
/** | ||
* @author Arasple | ||
* @date 2020/2/14 8:56 | ||
* @date 2020/2/13 22:38 | ||
*/ | ||
@BaseCommand(name = "holyshit") | ||
class CommandDebug : BaseMainCommand() { | ||
class CommandDebug : BaseSubCommand() { | ||
|
||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<String>): Boolean { | ||
if (sender is Player) { | ||
println("HoloSize: " + HologramManager.getHolograms().size) | ||
println("Holograms: \n") | ||
HologramManager.getHolograms().forEach(Consumer { hologram -> | ||
println("---: " + hologram.viewers) | ||
hologram.contents.forEach(Consumer { hologramContent: HologramContent -> println("---: " + hologramContent.text) }) | ||
}) | ||
} else { | ||
HologramManager.getHolograms().clear() | ||
override fun getArguments(): Array<Argument> { | ||
return arrayOf(Argument("Hologram Name", true)) | ||
} | ||
|
||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<String>) { | ||
val hologram = TrHologramAPI.getHologramById(args[0]) | ||
if (hologram != null) { | ||
sender.sendMessage("As String: §7$hologram") | ||
} | ||
return true | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/me/arasple/mc/trhologram/commands/CommandEdit.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package me.arasple.mc.trhologram.commands | ||
|
||
import io.izzel.taboolib.module.command.base.Argument | ||
import io.izzel.taboolib.module.command.base.BaseSubCommand | ||
import io.izzel.taboolib.module.command.base.CommandTab | ||
import io.izzel.taboolib.module.command.base.CommandType | ||
import io.izzel.taboolib.module.locale.TLocale | ||
import io.izzel.taboolib.util.lite.Catchers | ||
import me.arasple.mc.trhologram.api.TrHologramAPI | ||
import me.arasple.mc.trhologram.edit.EditorMenu | ||
import org.bukkit.command.Command | ||
import org.bukkit.command.CommandSender | ||
import org.bukkit.entity.Player | ||
|
||
/** | ||
* @author Arasple | ||
* @date 2020/2/15 12:29 | ||
*/ | ||
class CommandEdit : BaseSubCommand() { | ||
|
||
override fun getArguments(): Array<Argument> { | ||
return arrayOf(Argument("Hologram Name", false, CommandTab { TrHologramAPI.getHologramIds() })) | ||
} | ||
|
||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<String>) { | ||
val player = sender as Player | ||
Catchers.getPlayerdata().remove(player.name) | ||
if (args.isNotEmpty()) { | ||
editHologram(player, args[0]) | ||
return | ||
} | ||
Catchers.call(player, object : Catchers.Catcher { | ||
override fun before(): Catchers.Catcher { | ||
TLocale.sendTo(player, "COMMANDS.EDIT.INPUT-NAME") | ||
return this | ||
} | ||
|
||
override fun after(input: String): Boolean { | ||
editHologram(player, input) | ||
return false | ||
} | ||
|
||
override fun cancel() { | ||
TLocale.sendTo(player, "COMMANDS.QUIT") | ||
} | ||
}) | ||
} | ||
|
||
private fun editHologram(player: Player, input: String) { | ||
val hologram = TrHologramAPI.getHologramById(input) | ||
if (hologram == null) { | ||
TLocale.sendTo(player, "COMMANDS.EDIT.NOT-EXIST") | ||
} else { | ||
TLocale.Display.sendTitle(player, "", "", 5, 10, 5) | ||
EditorMenu.openEditor(hologram, player) | ||
} | ||
} | ||
|
||
override fun getType(): CommandType { | ||
return CommandType.PLAYER | ||
} | ||
|
||
} |
Oops, something went wrong.
bedd9f1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么我在1.12.2还没加载出来呢