Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Switch to new containers. Support systems for removing quark crates #554

Merged
merged 4 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions kubejs/assets/ptdye/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
"text.ptdye.name": "Prepare To Dye",
"text.ptdye.replacePlacedCrate": "Placed out-of-date crate has been replaced by updated crate",
"text.ptdye.pickedUpOutofdate": "Picked up out-of-date item!",
"text.ptdye.outOfDate.QuarkCrate": "Quark Crate has been replaced. Update in personal assembler, or place for it to be automatically updated.",

"advancement.ptdye.root": "Welcome to Chroma Prime",
"advancement.ptdye.root.desc": "Crash land on Chroma Prime",
"advancement.ptdye.toolbox": "In case of Crash Landing",
Expand Down
Binary file modified kubejs/data/minecraft/structures/spaceship_betsy_wreck.nbt
Binary file not shown.
Binary file modified kubejs/data/minecraft/structures/spaceship_pure_daisy_wreck.nbt
Binary file not shown.
Binary file modified kubejs/data/minecraft/structures/spaceship_resources_wreck.nbt
Binary file not shown.
3 changes: 2 additions & 1 deletion kubejs/features.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,6 @@
"Disable brewing stand": true,
"pillagers drop heads": true,
"Recycle crossbow": true,
"remove crossbow recipe": true
"remove crossbow recipe": true,
"Replace Quark Crate": true
}
17 changes: 17 additions & 0 deletions kubejs/server_scripts/base/featrues/barrel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
if (feature("Replace Quark Crate")) {
// output, input
addStonecutting("ptdyeplus:crate_barrel", "quark:crate")

BlockEvents.placed("quark:crate", (event) => {
event.block.set("ptdyeplus:crate_barrel")
tellPlayer(event.getPlayer(), "text.ptdye.replacePlacedCrate")
})

ItemEvents.pickedUp("quark:crate", (event) => {
tellPlayer(event.getPlayer(), Text.translate("text.ptdye.pickedUpOutofdate").append(" ").red().append(Text.translate("text.ptdye.outOfDate.QuarkCrate").white()))
})

BlockEvents.rightClicked("quark:crate", (event) => {
tellPlayer(event.getPlayer(), "text.ptdye.outOfDate.QuarkCrate")
})
}
3 changes: 2 additions & 1 deletion kubejs/server_scripts/base/featrues/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ if (
"supplementaries:turn_table",
"supplementaries:spring_launcher",
"botania:apothecary_default",
"quark:crate",
"ptdyeplus:crate_barrel",
"ptdyeplus:barrel_barrel"
],
},
{
Expand Down
13 changes: 13 additions & 0 deletions kubejs/server_scripts/base/wrappers/_modpackUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,17 @@ function removeItems(items) {
items.forEach(item => {
removeItem(item)
});
}

/**
* Send a message to the player
* @param {Internal.Player} player Targetted player
* @param {Internal.Component|String} component Message to tell the player. String must be a translation key
*/
function tellPlayer(player, component) {
if (player) {
if (typeof component === "string")
component = Text.translate(component).white()
player.tell(Text.translate("text.ptdye.name").append(": ").green().append(component))
}
}
Loading