-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed Config.java and replaced with FileManager
- Loading branch information
Showing
8 changed files
with
262 additions
and
50 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
115 changes: 115 additions & 0 deletions
115
src/main/java/com/github/sanctum/labyrinth/formatting/component/NewComponent.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,115 @@ | ||
package com.github.sanctum.labyrinth.formatting.component; | ||
|
||
import com.github.sanctum.labyrinth.formatting.string.ColoredString; | ||
import net.md_5.bungee.api.chat.ClickEvent; | ||
import net.md_5.bungee.api.chat.HoverEvent; | ||
import net.md_5.bungee.api.chat.TextComponent; | ||
import org.bukkit.ChatColor; | ||
|
||
public class NewComponent { | ||
|
||
private static String color(String text) { | ||
return ChatColor.translateAlternateColorCodes('&', text); | ||
} | ||
|
||
public TextComponent textHoverable(String normalText, String hoverText, String hoverTextMessage) { | ||
TextComponent text = new ColoredString(normalText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
text.addExtra(hover); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(color(hoverTextMessage))))); | ||
return text; | ||
} | ||
|
||
public TextComponent textHoverable(String normalText, String hoverText, String normalText2, String hoverTextMessage) { | ||
TextComponent text = new ColoredString(normalText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent text2 = new ColoredString(normalText2, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(color(hoverTextMessage))))); | ||
return text; | ||
} | ||
|
||
public TextComponent textHoverable(String normalText, String hoverText, String normalText2, String hoverText2, String hoverTextMessage, String hoverText2Message) { | ||
TextComponent text = new ColoredString(normalText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent text2 = new ColoredString(normalText2, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover2 = new ColoredString(hoverText2, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
text.addExtra(hover2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(color(hoverTextMessage))))); | ||
hover2.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(color(hoverText2Message))))); | ||
return text; | ||
} | ||
// * | ||
// | ||
// SEND TEXT THE PLAYER CAN BE SUGGESTED TO EXECUTE COMMANDS WITH | ||
// | ||
|
||
public TextComponent textSuggestable(String normalText, String hoverText, String hoverTextMessage, String commandName) { | ||
TextComponent text = new ColoredString(normalText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
text.addExtra(hover); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(color(hoverTextMessage))))); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + commandName)); | ||
return text; | ||
} | ||
// * | ||
// | ||
// SEND TEXT THE PLAYER CAN RUN COMMANDS WITH | ||
// | ||
|
||
public TextComponent textRunnable(String normalText, String hoverText, String hoverTextMessage, String commandName) { | ||
TextComponent text = new ColoredString(normalText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
text.addExtra(hover); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(new ColoredString(hoverTextMessage, ColoredString.ColorType.HEX).toString())))); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
return text; | ||
} | ||
|
||
public TextComponent textRunnable(String normalText, String hoverText, String normalText2, String hoverTextMessage, String commandName) { | ||
TextComponent text = new ColoredString(normalText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent text2 = new ColoredString(normalText2, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(new ColoredString(hoverTextMessage, ColoredString.ColorType.HEX).toString())))); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
return text; | ||
} | ||
|
||
public TextComponent textRunnable(String normalText, String hoverText, String normalText2, String hoverText2, String hoverTextMessage, String hoverText2Message, String commandName, String commandName2) { | ||
TextComponent text = new ColoredString(normalText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent text2 = new ColoredString(normalText2, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover2 = new ColoredString(hoverText2, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
text.addExtra(hover2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(new ColoredString(hoverTextMessage, ColoredString.ColorType.HEX).toString())))); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
hover2.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(new ColoredString(hoverText2Message, ColoredString.ColorType.HEX).toString())))); | ||
hover2.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName2)); | ||
return text; | ||
} | ||
|
||
public TextComponent textRunnable(String hoverText, String hoverText2, String hoverTextBody3, String hoverTextMessage, String hoverText2Message, String hoverMessage3, String commandName, String commandName2, String commandName3) { | ||
TextComponent hover = new ColoredString(hoverText, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover2 = new ColoredString(hoverText2, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
TextComponent hover3 = new ColoredString(hoverTextBody3, ColoredString.ColorType.MC_COMPONENT).toComponent(); | ||
hover.addExtra(hover2); | ||
hover.addExtra(hover3); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(new ColoredString(hoverTextMessage, ColoredString.ColorType.HEX).toString())))); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
hover2.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(new ColoredString(hoverText2Message, ColoredString.ColorType.HEX).toString())))); | ||
hover2.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName2)); | ||
hover3.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, (new net.md_5.bungee.api.chat.hover.content.Text(new ColoredString(hoverMessage3, ColoredString.ColorType.HEX).toString())))); | ||
hover3.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName3)); | ||
return hover; | ||
} | ||
|
||
|
||
|
||
} |
107 changes: 107 additions & 0 deletions
107
src/main/java/com/github/sanctum/labyrinth/formatting/component/OldComponent.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,107 @@ | ||
package com.github.sanctum.labyrinth.formatting.component; | ||
|
||
|
||
import net.md_5.bungee.api.chat.ClickEvent; | ||
import net.md_5.bungee.api.chat.ComponentBuilder; | ||
import net.md_5.bungee.api.chat.HoverEvent; | ||
import net.md_5.bungee.api.chat.TextComponent; | ||
import org.bukkit.ChatColor; | ||
|
||
public class OldComponent { | ||
|
||
private String color(String text) { | ||
return ChatColor.translateAlternateColorCodes('&', text); | ||
} | ||
|
||
public TextComponent textHoverable(String normalText, String hoverText, String hoverTextMessage) { | ||
TextComponent text = new TextComponent(color(normalText)); | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
text.addExtra(hover); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
return text; | ||
} | ||
|
||
public TextComponent textHoverable(String normalText, String hoverText, String normalText2, String hoverTextMessage) { | ||
TextComponent text = new TextComponent(color(normalText)); | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
TextComponent text2 = new TextComponent(color(normalText2)); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
return text; | ||
} | ||
|
||
public TextComponent textHoverable(String normalText, String hoverText, String normalText2, String hoverText2, String hoverTextMessage, String hoverText2Message) { | ||
TextComponent text = new TextComponent(color(normalText)); | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
TextComponent text2 = new TextComponent(color(normalText2)); | ||
TextComponent hover2 = new TextComponent(color(hoverText2)); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
text.addExtra(hover2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
hover2.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverText2Message)).create())); | ||
return text; | ||
} | ||
|
||
public TextComponent textSuggestable(String normalText, String hoverText, String hoverTextMessage, String commandName) { | ||
TextComponent text = new TextComponent(color(normalText)); | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
text.addExtra(hover); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + commandName)); | ||
return text; | ||
} | ||
|
||
public TextComponent textRunnable(String normalText, String hoverText, String hoverTextMessage, String commandName) { | ||
TextComponent text = new TextComponent(color(normalText)); | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
text.addExtra(hover); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
return text; | ||
} | ||
|
||
public TextComponent textRunnable(String normalText, String hoverText, String normalText2, String hoverTextMessage, String commandName) { | ||
TextComponent text = new TextComponent(color(normalText)); | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
TextComponent text2 = new TextComponent(color(normalText2)); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
return text; | ||
} | ||
|
||
public TextComponent textRunnable(String normalText, String hoverText, String normalText2, String hoverText2, String hoverTextMessage, String hoverText2Message, String commandName, String commandName2) { | ||
TextComponent text = new TextComponent(color(normalText)); | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
TextComponent text2 = new TextComponent(color(normalText2)); | ||
TextComponent hover2 = new TextComponent(color(hoverText2)); | ||
text.addExtra(hover); | ||
text.addExtra(text2); | ||
text.addExtra(hover2); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
hover2.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverText2Message)).create())); | ||
hover2.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName2)); | ||
return text; | ||
} | ||
|
||
public TextComponent textRunnable(String hoverText, String hoverText2, String hoverTextBody3, String hoverTextMessage, String hoverText2Message, String hoverMessage3, String commandName, String commandName2, String commandName3) { | ||
TextComponent hover = new TextComponent(color(hoverText)); | ||
TextComponent hover2 = new TextComponent(color(hoverText2)); | ||
TextComponent hover3 = new TextComponent(color(hoverTextBody3)); | ||
hover.addExtra(hover2); | ||
hover.addExtra(hover3); | ||
hover.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverTextMessage)).create())); | ||
hover.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName)); | ||
hover2.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverText2Message)).create())); | ||
hover2.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName2)); | ||
hover3.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(color(hoverMessage3)).create())); | ||
hover3.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/" + commandName3)); | ||
return hover; | ||
} | ||
|
||
|
||
} |
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
Oops, something went wrong.