-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added pack_icon, and resources, and removed commands for meant…
…ime and is in release
- Loading branch information
Showing
53 changed files
with
802 additions
and
2,574 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 was deleted.
Oops, something went wrong.
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,35 @@ | ||
import TextColor from "./textColor"; | ||
const formatCodes = { | ||
[TextColor.Black]: "§0", | ||
[TextColor.DarkBlue]: "§1", | ||
[TextColor.DarkGreen]: "§2", | ||
[TextColor.DarkAqua]: "§3", | ||
[TextColor.DarkRed]: "§4", | ||
[TextColor.DarkPurple]: "§5", | ||
[TextColor.Gold]: "§6", | ||
[TextColor.Gray]: "§7", | ||
[TextColor.DarkGray]: "§8", | ||
[TextColor.Blue]: "§9", | ||
[TextColor.Green]: "§a", | ||
[TextColor.Aqua]: "§b", | ||
[TextColor.Red]: "§c", | ||
[TextColor.LightPurple]: "§d", | ||
[TextColor.Yellow]: "§e", | ||
[TextColor.White]: "§f", | ||
[TextColor.MinecoinGold]: "§g", | ||
[TextColor.MaterialQuartz]: "§h", | ||
[TextColor.MaterialIron]: "§i", | ||
[TextColor.MaterialNetherite]: "§j", | ||
obfuscated: "§k", | ||
bold: "§l", | ||
[TextColor.MaterialRedstone]: "§m", | ||
[TextColor.MaterialCopper]: "§n", | ||
italic: "§o", | ||
[TextColor.MaterialGold]: "§p", | ||
[TextColor.MaterialEmerald]: "§q", | ||
reset: "§r", | ||
[TextColor.MaterialDiamond]: "§s", | ||
[TextColor.MaterialLapis]: "§t", | ||
[TextColor.MaterialAmethyst]: "§u", | ||
}; | ||
export default formatCodes; |
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,12 @@ | ||
import getFormatCodes from "./getFormatCodes"; | ||
import formatCodes from "./formatCodes"; | ||
const formattingEnd = `${formatCodes.reset}§¬`; | ||
const nestedFormattingEnd = new RegExp(`(?<=${formattingEnd}(?!${formatCodes.reset}|$))`, "g"); | ||
export default function formatText(text, formatting) { | ||
const prefix = getFormatCodes(formatting); | ||
text = prefix + text; | ||
text = text.replace(nestedFormattingEnd, prefix); | ||
if (!text.endsWith(formattingEnd)) | ||
text += formattingEnd; | ||
return text; | ||
} |
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,16 @@ | ||
import formatCodes from "./formatCodes"; | ||
export default function getFormatCodes(formatting) { | ||
let codes = ""; | ||
const { color, bold, italic, obfuscated, reset } = formatting; | ||
if (reset) | ||
codes += formatCodes.reset; | ||
if (bold) | ||
codes += formatCodes.bold; | ||
if (italic) | ||
codes += formatCodes.italic; | ||
if (obfuscated) | ||
codes += formatCodes.obfuscated; | ||
if (color) | ||
codes += formatCodes[color]; | ||
return codes; | ||
} |
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,118 @@ | ||
import formatText from "./formatText"; | ||
import getFormatCodes from "./getFormatCodes"; | ||
import makeCallable from "./makeCallable"; | ||
import TextColor from "./textColor"; | ||
class Chroma { | ||
constructor(formatting = {}) { | ||
this.formatting = formatting; | ||
function format(...text) { | ||
return formatText(text.join(" "), this.formatting); | ||
} | ||
return makeCallable(this, format); | ||
} | ||
toString() { | ||
return getFormatCodes(this.formatting); | ||
} | ||
with(option, value) { | ||
return new Chroma({ ...this.formatting, [option]: value }); | ||
} | ||
get bold() { | ||
return this.with("bold", true); | ||
} | ||
get italic() { | ||
return this.with("italic", true); | ||
} | ||
get obfuscated() { | ||
return this.with("obfuscated", true); | ||
} | ||
get reset() { | ||
return new Chroma({ reset: true }); | ||
} | ||
color(textColor) { | ||
return this.with("color", textColor); | ||
} | ||
get aqua() { | ||
return this.color(TextColor.Aqua); | ||
} | ||
get black() { | ||
return this.color(TextColor.Black); | ||
} | ||
get blue() { | ||
return this.color(TextColor.Blue); | ||
} | ||
get darkAqua() { | ||
return this.color(TextColor.DarkAqua); | ||
} | ||
get darkBlue() { | ||
return this.color(TextColor.DarkBlue); | ||
} | ||
get darkGray() { | ||
return this.color(TextColor.DarkGray); | ||
} | ||
get darkGreen() { | ||
return this.color(TextColor.DarkGreen); | ||
} | ||
get darkPurple() { | ||
return this.color(TextColor.DarkPurple); | ||
} | ||
get darkRed() { | ||
return this.color(TextColor.DarkRed); | ||
} | ||
get gold() { | ||
return this.color(TextColor.Gold); | ||
} | ||
get gray() { | ||
return this.color(TextColor.Gray); | ||
} | ||
get green() { | ||
return this.color(TextColor.Green); | ||
} | ||
get lightPurple() { | ||
return this.color(TextColor.LightPurple); | ||
} | ||
get materialAmethyst() { | ||
return this.color(TextColor.MaterialAmethyst); | ||
} | ||
get materialCopper() { | ||
return this.color(TextColor.MaterialCopper); | ||
} | ||
get materialDiamond() { | ||
return this.color(TextColor.MaterialDiamond); | ||
} | ||
get materialEmerald() { | ||
return this.color(TextColor.MaterialEmerald); | ||
} | ||
get materialGold() { | ||
return this.color(TextColor.MaterialGold); | ||
} | ||
get materialIron() { | ||
return this.color(TextColor.MaterialIron); | ||
} | ||
get materialLapis() { | ||
return this.color(TextColor.MaterialLapis); | ||
} | ||
get materialNetherite() { | ||
return this.color(TextColor.MaterialNetherite); | ||
} | ||
get materialQuartz() { | ||
return this.color(TextColor.MaterialQuartz); | ||
} | ||
get materialRedstone() { | ||
return this.color(TextColor.MaterialRedstone); | ||
} | ||
get minecoinGold() { | ||
return this.color(TextColor.MinecoinGold); | ||
} | ||
get red() { | ||
return this.color(TextColor.Red); | ||
} | ||
get yellow() { | ||
return this.color(TextColor.Yellow); | ||
} | ||
get white() { | ||
return this.color(TextColor.White); | ||
} | ||
} | ||
const chroma = new Chroma(); | ||
export default chroma; | ||
export { chroma, TextColor }; |
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,7 @@ | ||
export default function makeCallable(object, callback) { | ||
const callableObject = callback.bind(object); | ||
Object.setPrototypeOf(callableObject, Object.getPrototypeOf(object)); | ||
const properties = Object.getOwnPropertyDescriptors(object); | ||
Object.defineProperties(callableObject, properties); | ||
return callableObject; | ||
} |
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,31 @@ | ||
var TextColor; | ||
(function (TextColor) { | ||
TextColor["Aqua"] = "aqua"; | ||
TextColor["Black"] = "black"; | ||
TextColor["Blue"] = "blue"; | ||
TextColor["DarkAqua"] = "dark_aqua"; | ||
TextColor["DarkBlue"] = "dark_blue"; | ||
TextColor["DarkGray"] = "dark_gray"; | ||
TextColor["DarkGreen"] = "dark_green"; | ||
TextColor["DarkPurple"] = "dark_purple"; | ||
TextColor["DarkRed"] = "dark_red"; | ||
TextColor["Gold"] = "gold"; | ||
TextColor["Gray"] = "gray"; | ||
TextColor["Green"] = "green"; | ||
TextColor["LightPurple"] = "light_purple"; | ||
TextColor["MaterialAmethyst"] = "material_amethyst"; | ||
TextColor["MaterialCopper"] = "material_copper"; | ||
TextColor["MaterialDiamond"] = "material_diamond"; | ||
TextColor["MaterialEmerald"] = "material_emerald"; | ||
TextColor["MaterialGold"] = "material_gold"; | ||
TextColor["MaterialIron"] = "material_iron"; | ||
TextColor["MaterialLapis"] = "material_lapis"; | ||
TextColor["MaterialNetherite"] = "material_netherite"; | ||
TextColor["MaterialQuartz"] = "material_quartz"; | ||
TextColor["MaterialRedstone"] = "material_redstone"; | ||
TextColor["MinecoinGold"] = "minecoin_gold"; | ||
TextColor["Red"] = "red"; | ||
TextColor["Yellow"] = "yellow"; | ||
TextColor["White"] = "white"; | ||
})(TextColor || (TextColor = {})); | ||
export default TextColor; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Empty file.
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,4 +1,13 @@ | ||
export default { | ||
debug: true, | ||
/** | ||
* Enables debug messages to content logs. | ||
*/ | ||
debug: false, | ||
/** | ||
* The amount of iron ingots required in order to repair an anvil. | ||
*/ | ||
IronIngotsRequired: 1, | ||
}; | ||
export const VERSION = "1.0.0"; | ||
|
||
// version (do not change) | ||
export const VERSION = "1.0.0"; |
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.