Skip to content

Commit

Permalink
rubber/plastic processing draft
Browse files Browse the repository at this point in the history
  • Loading branch information
Octelly committed Nov 18, 2023
1 parent 0a494e7 commit 32d3657
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 24 deletions.
6 changes: 5 additions & 1 deletion index.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ hash = "225830cfae9ec5ddb984a95ab4ca3dd2acfaef901de212f036b99bf8993a2cca"

[[files]]
file = "kubejs/server_scripts/recipes.js"
hash = "28502cc74a7dacf4b9b534efc33acd959e20d72431cbef6e5f4260034b7ecd59"
hash = "8c23cfa20758afaf2b1fbd4cf28fa1021669574957313acf31a18745ab03806d"

[[files]]
file = "kubejs/startup_scripts/0_globals.js"
hash = "7a58b4a46faed4df9a18958372934cb6a9df5d434018bc6cbf80e27fdefbb11d"

[[files]]
file = "kubejs/startup_scripts/items_blocks.js"
Expand Down
51 changes: 29 additions & 22 deletions kubejs/server_scripts/recipes.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ let AUT = (id, x) => MOD("autumnity", id, x)
let QRK = (id, x) => MOD("quark", id, x)
let IE = (id, x) => MOD("immersiveengineering", id, x)
let TH = (id, x) => MOD("thermal", id, x)
let IF = (id, x) => MOD("industrialforegoing", id, x)



Expand Down Expand Up @@ -90,33 +91,43 @@ function betterSawdust(event) {

function rubberAndPlastic(event) {
//event.replaceInput({}, 'industrialforegoing:plastic', 'pneumaticcraft:plastic')
//event.remove({ output: 'industrialforegoing:plastic' })
event.remove({ output: 'industrialforegoing:plastic' })
event.remove({ output: TH('rubber') })
//event.remove({ output: IF('dryrubber') })
event.remove({ output: 'create_dd:raw_rubber' })
//event.remove({ output: 'pneumaticcraft:plastic' })

//event.remove({ type: 'industrialforegoing:fluid_extractor' })

//for (const [type, blocks] of Object.entries(global.wood_types)) {
// if ("log" in blocks &&
// "stripped_log" in blocks) {
// event.custom({
// type: 'industrialforegoing:fluid_extractor',
// input: Item.of(blocks.log).toJson(),
// result: blocks.stripped_log,
// breakChange: 0.010,
// output: "{FluidName:\"industrialforegoing:latex\",Amount:33}",
// defaultRecipe: false
// })
// }
event.remove({ type: 'industrialforegoing:fluid_extractor' })

//}
for (const [type, blocks] of Object.entries(global.wood_types)) {
if ("log" in blocks &&
"stripped_log" in blocks) {
event.custom({
type: 'industrialforegoing:fluid_extractor',
input: Item.of(blocks.log).toJson(),
result: blocks.stripped_log,
breakChange: 0.010,
output: "{FluidName:\"industrialforegoing:latex\",Amount:33}",
defaultRecipe: false
})
}
}

event.recipes.createCompacting('industrialforegoing:tinydryrubber', Fluid.of('industrialforegoing:latex', 200))

//event.recipes.createCompacting('industrialforegoing:tinydryrubber', Fluid.of('industrialforegoing:latex', 200))
event.replaceInput({}, TH('rubber'), 'create_dd:raw_rubber')
event.replaceInput({}, TH('cured_rubber'), 'create_dd:rubber')
event.replaceInput({}, IF('dryrubber'), 'create_dd:raw_rubber')
event.replaceOutput({}, TH('rubber'), 'create_dd:raw_rubber')
event.replaceOutput({}, TH('cured_rubber'), 'create_dd:rubber')
event.replaceOutput({}, IF('dryrubber'), 'create_dd:raw_rubber')

//event.smelting(KJ('cured_rubber'), 'industrialforegoing:dryrubber')
//event.recipes.createPressing('pneumaticcraft:plastic', KJ('cured_rubber'))

let rubber = 'create_dd:rubber'

event.recipes.createPressing(IF('plastic'), rubber)

event.remove({ mod: 'create', output: CR('belt_connector') })

event.replaceInput({ mod: 'create' }, MC('dried_kelp'), rubber)
Expand All @@ -126,10 +137,6 @@ function rubberAndPlastic(event) {
event.replaceInput({ mod: 'createdieselgenerators' }, MC('dried_kelp'), rubber)
event.replaceInput({ mod: 'create_dd' }, MC('dried_kelp'), rubber)

event.replaceInput({}, TH('rubber'), 'create_dd:raw_rubber')
event.replaceInput({}, TH('cured_rubber'), 'create_dd:rubber')
event.replaceOutput({}, TH('rubber'), 'create_dd:raw_rubber')
event.replaceOutput({}, TH('cured_rubber'), 'create_dd:rubber')

//event.remove({ id: /create_dd:sap_from_.*_log/ })
//event.remove({ id: /create_dd:sap_from_.*_wood/ })
Expand Down
81 changes: 81 additions & 0 deletions kubejs/startup_scripts/0_globals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
// priority: 99

let MOD = (domain, id, x) => (x ? `${x}x ` : "") + (id.startsWith('#') ? '#' : "") + domain + ":" + id.replace('#', '')
let MC = (id, x) => MOD("minecraft", id, x)
let AP = (id, x) => MOD("architects_palette", id, x)
let ENV = (id, x) => MOD("environmental", id, x)
let AQU = (id, x) => MOD("upgrade_aquatic", id, x)
let TIC = (id, x) => MOD("tconstruct", id, x)
let ATM = (id, x) => MOD("atmospheric", id, x)
let AUT = (id, x) => MOD("autumnity", id, x)
let QRK = (id, x) => MOD("quark", id, x)
let BYG = (id, x) => MOD("byg", id, x)
let BOP = (id, x) => MOD("biomesoplenty", id, x)
let TWB = (id, x) => MOD("wildbackport", id, x)
let ECO = (id, x) => MOD("ecologics", id, x)
let ITA = (id, x) => MOD("italian_delight", id, x)

let wood_types = [
[MC, "oak"],
[MC, "spruce"],
[MC, "birch"],
[MC, "jungle"],
[MC, "acacia"],
[MC, "dark_oak"],
[AP, "twisted"],
[ENV, "willow"],
[ENV, "cherry"],
[ENV, "wisteria"],
[AQU, "driftwood"],
[AQU, "river"],
[TIC, "greenheart"],
[TIC, "skyroot"],
[TIC, "bloodshroom"],
[ATM, "rosewood"],
[ATM, "morado"],
[ATM, "yucca"],
[ATM, "aspen"],
[AUT, "maple"],
[QRK, "blossom"],
[QRK, "azalea"]
]

global.wood_types = {}

wood_types.forEach(type => {

global.wood_types[type] = {}

// LOG
global.wood_types[type].log = type[0](type[1] + "_log")

// STRIPPED LOG
if (type[0] != ITA) {
if (type[0] == ECO && type[1] == "flowering_azalea") {
global.wood_types[type].stripped_log = type[0]("stripped_azalea_log")
} else {
global.wood_types[type].stripped_log = type[0]("stripped_" + type[1] + "_log")
}
}

// WOOD
if (type[0] != ITA) {
if (type[1].endsWith("wood") && type[0] != BYG && type[0] != BOP) {
global.wood_types[type].wood = type[0](type[1])
} else {
global.wood_types[type].wood = type[0](type[1] + "_wood")
}
}

// STRIPPED WOOD
if (type[0] != ITA) {
if (type[0] == ECO && type[1] == "flowering_azalea") {
global.wood_types[type].stripped_wood = type[0]("stripped_azalea_wood")
} else if (type[1].endsWith("wood") && type[0] != BYG && type[0] != BOP) {
global.wood_types[type].stripped_wood = type[0]("stripped_" + type[1])
} else {
global.wood_types[type].stripped_wood = type[0]("stripped_" + type[1] + "_wood")
}
}

})
2 changes: 1 addition & 1 deletion pack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
[index]
file = "index.toml"
hash-format = "sha256"
hash = "6fb6ca161e197d05aa5206f3ab1e9007933a2ca34f73170a5f8d13877034c655"
hash = "49f342c5192c01d6d399d0c8fe2a7a48cd28bd3a50d4e83249cb2cdc5015b98a"

[versions]
forge = "40.2.14"
Expand Down

0 comments on commit 32d3657

Please sign in to comment.