add first patch

This commit is contained in:
2026-07-31 10:34:32 +09:00
parent 03aac2e45e
commit b1cbc6c78d
6390 changed files with 547430 additions and 0 deletions
@@ -0,0 +1,249 @@
//priority: 100
console.info("[SOCIETY] agingCask.js loaded");
global.agingCaskRecipes = new Map([]);
// Both global variables as items are registered based on these
global.ageableProductInputs = [
{ item: "vinery:cristel_wine", name: "Cristel Wine", time: 10 },
{
item: "vinery:creepers_crush",
name: "Bottle of 'Creepers Crush'",
time: 10,
},
{
item: "vinery:villagers_fright",
name: "Bottle of 'Villagers Fright'",
time: 10,
},
{ item: "vinery:glowing_wine", name: "Sun-kissed Wine", time: 10 },
{ item: "vinery:mead", name: "Mead", time: 10 },
{
item: "vinery:bottle_mojang_noir",
name: "Bottle of 'Mojang Noir'",
time: 10,
},
{ item: "vinery:eiswein", name: "Eiswein", time: 10 },
{ item: "society:good_catawba", name: "Good Catawba", time: 10 },
{ item: "vinery:cherry_wine", name: "Cherry Wine", time: 10 },
{ item: "vinery:mellohi_wine", name: "Mellohi Wine", time: 10 },
{ item: "vinery:magnetic_wine", name: "Magnetic Wine", time: 10 },
{ item: "vinery:chorus_wine", name: "Chorus Wine", time: 10 },
{ item: "vinery:noir_wine", name: "Noir Wine", time: 10 },
{ item: "vinery:lilitu_wine", name: "Miss Lilitus Wine", time: 10 },
{ item: "vinery:stal_wine", name: "Stal Wine", time: 10 },
{ item: "vinery:strad_wine", name: "Strad Wine", time: 10 },
{ item: "vinery:solaris_wine", name: "Solaris Wine", time: 10 },
{ item: "vinery:bolvar_wine", name: "Bolvar Wine", time: 10 },
{ item: "vinery:aegis_wine", name: "Aegis Wine", time: 10 },
{ item: "vinery:clark_wine", name: "Clark Wine", time: 10 },
{ item: "vinery:chenet_wine", name: "Chenet Wine", time: 10 },
{ item: "vinery:kelp_cider", name: "Kelp Cider", time: 10 },
{ item: "vinery:apple_wine", name: "Apple Wine", time: 10 },
{ item: "vinery:apple_cider", name: "Cider", time: 10 },
{ item: "vinery:jellie_wine", name: "Jellie Wine", time: 10 },
{ item: "vinery:red_wine", name: "Red Wine", time: 10 },
{ item: "society:forks_of_blue", name: "Forks of Blue", time: 10 },
{ item: "vinery:jo_special_mixture", name: "Jo's Special Mixture", time: 10 },
{ item: "society:nutty_basil", name: "Nutty Basil", time: 10 },
{ item: "vintagedelight:century_egg", name: "Century Egg", time: 10 },
{ item: "society:energy_drink", name: "Energy Drink", time: 4 },
{ item: "society:espresso", name: "Espresso", time: 2 },
{ item: "society:starcardi", name: "Starcardi", time: 4 },
{ item: "society:star_coquito", name: "Star Coquito", time: 10 },
{ item: "nethervinery:blazewine_pinot", name: "Blazewine Pinot", time: 10 },
{ item: "nethervinery:netherite_nectar", name: "Iridium Nectar", time: 10 },
{ item: "nethervinery:ghastly_grenache", name: "Ghastly Grenache", time: 10 },
{ item: "nethervinery:lava_fizz", name: "Lava Fizz", time: 10 },
{ item: "nethervinery:nether_fizz", name: "Nether Fizz", time: 10 },
{
item: "nethervinery:improved_lava_fizz",
name: "Improved Lava Fizz",
time: 8,
},
{
item: "nethervinery:improved_nether_fizz",
name: "Improved Nether Fizz",
time: 8,
},
{ item: "brewery:beer_wheat", name: "Wheat Beer", time: 3 },
{ item: "brewery:beer_barley", name: "Barley Beer", time: 3 },
{ item: "brewery:beer_hops", name: "Hops Beer", time: 3 },
{ item: "brewery:beer_nettle", name: "Nettle Beer", time: 3 },
{ item: "brewery:beer_oat", name: "Oat Beer", time: 3 },
{ item: "brewery:beer_haley", name: "Haley Beer", time: 3 },
{ item: "brewery:whiskey_jojannik", name: "JoJannik Select", time: 4 },
{
item: "brewery:whiskey_lilitusinglemalt",
name: "Lilitu Single Malt",
time: 4,
},
{
item: "brewery:whiskey_cristelwalker",
name: "CristelWalker Original",
time: 4,
},
{ item: "brewery:whiskey_maggoallan", name: "Aged MaggoAllan", time: 4 },
{
item: "brewery:whiskey_carrasconlabel",
name: "Carrasconlabel Heritage",
time: 4,
},
{ item: "brewery:whiskey_ak", name: "AK Reserve", time: 6 },
{
item: "brewery:whiskey_highland_hearth",
name: "Highland Hearth Signature",
time: 4,
},
{
item: "brewery:whiskey_smokey_reverie",
name: "Aged Smokey Reverie",
time: 4,
},
{
item: "brewery:whiskey_jamesons_malt",
name: "Jameson Malt Whiskey",
time: 4,
},
{ item: "brewery:dark_brew", name: "Dark Brew", time: 6 },
{ item: "meadow:cheese_block", name: "Cheese Wheel", time: 3 },
{ item: "meadow:goat_cheese_block", name: "Goat Cheese Wheel", time: 3 },
{ item: "meadow:warped_cheese_block", name: "Warped Cheese Wheel", time: 3 },
{ item: "meadow:sheep_cheese_block", name: "Sheep Cheese Wheel", time: 3 },
{ item: "meadow:grain_cheese_block", name: "Grain Cheese Wheel", time: 3 },
{
item: "meadow:amethyst_cheese_block",
name: "Amethyst Cheese Wheel",
time: 3,
},
{
item: "meadow:buffalo_cheese_block",
name: "Buffalo Cheese Wheel",
time: 3,
},
{ item: "society:beer_london", name: "London Beer", time: 3 },
{ item: "society:ancient_vespertine", name: "Ancient Vespertine", time: 10 },
{ item: "society:dewy_star", name: "Dewy Star", time: 10 },
{ item: "society:ancient_cider", name: "Ancient Cider", time: 10 },
{ item: "society:beer_attunecore", name: "Attunecore Beer", time: 3 },
{
item: "farmlife:tribull_cheese_wheel",
name: "Tri-Bull Cheese Wheel",
time: 3,
},
{ item: "society:violet_moon", name: "Violet Moon", time: 5 },
{ item: "society:laputa_franc", name: "Laputa Franc", time: 10 },
{ item: "society:sparkling_le_roy", name: "Sparkling Le Roy", time: 5 },
{ item: "society:mana_king", name: "Mana King", time: 10 },
];
global.ageableProductInputs.forEach((product) => {
const splitProduct = product.item.split(":");
global.agingCaskRecipes.set(product.item, {
output: [`1x society:aged_${splitProduct[1]}`],
time: product.time,
});
});
StartupEvents.registry("block", (event) => {
event
.create("society:aging_cask", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable("block.society.aging_cask.description").gray()
);
item.modelJson({
parent: "society:block/kubejs/aging_cask/aging_cask",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const facing = block.properties.get("facing").toLowerCase();
const nbt = block.getEntityData();
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (
!upgraded &&
block.properties.get("working").toLowerCase() == "false" &&
item == "society:broken_clock"
) {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
} else if (!upgraded && item == "society:broken_clock") {
player.tell(
Text.translatable(
"society.working_block_entity.cannot_upgrade"
).red()
);
}
}
if (
player.stages.has("aged_prize") &&
block.properties.get("mature") === "true" &&
rnd5()
) {
block.popItemFromFace("society:prize_ticket", facing);
}
if (
!player.stages.has("slouching_towards_artistry") &&
block.properties.get("mature") === "true" &&
Number(nbt.data.stage) > 5 &&
Math.random() <= 0.01
) {
block.popItemFromFace(
"society:slouching_towards_artistry",
block.properties.get("facing")
);
}
global.handleBERightClick(
"minecraft:block.wood.place",
click,
global.agingCaskRecipes,
10
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.agingCaskRecipes, 10, true);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("aging_cask"),
};
});
@@ -0,0 +1,239 @@
//priority: 100
console.info("[SOCIETY] ancientCask.js loaded");
global.ancientCaskRecipes = new Map([]);
[
{ item: "vinery:cristel_wine", name: "Cristel Wine", time: 20 },
{
item: "vinery:creepers_crush",
name: "Bottle of 'Creepers Crush'",
time: 20,
},
{
item: "vinery:villagers_fright",
name: "Bottle of 'Villagers Fright'",
time: 20,
},
{ item: "vinery:glowing_wine", name: "Sun-kissed Wine", time: 20 },
{ item: "vinery:mead", name: "Mead", time: 20 },
{
item: "vinery:bottle_mojang_noir",
name: "Bottle of 'Mojang Noir'",
time: 20,
},
{ item: "vinery:eiswein", name: "Eiswein", time: 20 },
{ item: "society:good_catawba", name: "Good Catawba", time: 20 },
{ item: "vinery:cherry_wine", name: "Cherry Wine", time: 20 },
{ item: "vinery:mellohi_wine", name: "Mellohi Wine", time: 20 },
{ item: "vinery:magnetic_wine", name: "Magnetic Wine", time: 20 },
{ item: "vinery:chorus_wine", name: "Chorus Wine", time: 20 },
{ item: "vinery:noir_wine", name: "Noir Wine", time: 20 },
{ item: "vinery:lilitu_wine", name: "Miss Lilitus Wine", time: 20 },
{ item: "vinery:stal_wine", name: "Stal Wine", time: 20 },
{ item: "vinery:strad_wine", name: "Strad Wine", time: 20 },
{ item: "vinery:solaris_wine", name: "Solaris Wine", time: 20 },
{ item: "vinery:bolvar_wine", name: "Bolvar Wine", time: 20 },
{ item: "vinery:aegis_wine", name: "Aegis Wine", time: 20 },
{ item: "vinery:clark_wine", name: "Clark Wine", time: 20 },
{ item: "vinery:chenet_wine", name: "Chenet Wine", time: 20 },
{ item: "vinery:kelp_cider", name: "Kelp Cider", time: 20 },
{ item: "vinery:apple_wine", name: "Apple Wine", time: 20 },
{ item: "vinery:apple_cider", name: "Cider", time: 20 },
{ item: "vinery:jellie_wine", name: "Jellie Wine", time: 20 },
{ item: "vinery:red_wine", name: "Red Wine", time: 20 },
{ item: "society:forks_of_blue", name: "Forks of Blue", time: 20 },
{ item: "vinery:jo_special_mixture", name: "Jo's Special Mixture", time: 20 },
{ item: "society:nutty_basil", name: "Nutty Basil", time: 20 },
{ item: "vintagedelight:century_egg", name: "Century Egg", time: 20 },
{ item: "society:energy_drink", name: "Energy Drink", time: 14 },
{ item: "society:espresso", name: "Espresso", time: 12 },
{ item: "society:starcardi", name: "Starcardi", time: 14 },
{ item: "society:star_coquito", name: "Star Coquito", time: 20 },
{ item: "nethervinery:blazewine_pinot", name: "Blazewine Pinot", time: 20 },
{ item: "nethervinery:netherite_nectar", name: "Iridium Nectar", time: 20 },
{ item: "nethervinery:ghastly_grenache", name: "Ghastly Grenache", time: 20 },
{ item: "nethervinery:lava_fizz", name: "Lava Fizz", time: 20 },
{ item: "nethervinery:nether_fizz", name: "Nether Fizz", time: 20 },
{
item: "nethervinery:improved_lava_fizz",
name: "Improved Lava Fizz",
time: 18,
},
{
item: "nethervinery:improved_nether_fizz",
name: "Improved Nether Fizz",
time: 18,
},
{ item: "brewery:beer_wheat", name: "Wheat Beer", time: 13 },
{ item: "brewery:beer_barley", name: "Barley Beer", time: 13 },
{ item: "brewery:beer_hops", name: "Hops Beer", time: 13 },
{ item: "brewery:beer_nettle", name: "Nettle Beer", time: 13 },
{ item: "brewery:beer_oat", name: "Oat Beer", time: 13 },
{ item: "brewery:beer_haley", name: "Haley Beer", time: 13 },
{ item: "brewery:whiskey_jojannik", name: "JoJannik Select", time: 14 },
{
item: "brewery:whiskey_lilitusinglemalt",
name: "Lilitu Single Malt",
time: 14,
},
{
item: "brewery:whiskey_cristelwalker",
name: "CristelWalker Original",
time: 14,
},
{ item: "brewery:whiskey_maggoallan", name: "Aged MaggoAllan", time: 14 },
{
item: "brewery:whiskey_carrasconlabel",
name: "Carrasconlabel Heritage",
time: 14,
},
{ item: "brewery:whiskey_ak", name: "AK Reserve", time: 14 },
{
item: "brewery:whiskey_highland_hearth",
name: "Highland Hearth Signature",
time: 14,
},
{
item: "brewery:whiskey_smokey_reverie",
name: "Aged Smokey Reverie",
time: 14,
},
{
item: "brewery:whiskey_jamesons_malt",
name: "Jameson Malt Whiskey",
time: 16,
},
{ item: "brewery:dark_brew", name: "Dark Brew", time: 16 },
{ item: "meadow:cheese_block", name: "Cheese Wheel", time: 13 },
{ item: "meadow:goat_cheese_block", name: "Goat Cheese Wheel", time: 13 },
{ item: "meadow:warped_cheese_block", name: "Warped Cheese Wheel", time: 13 },
{ item: "meadow:sheep_cheese_block", name: "Sheep Cheese Wheel", time: 13 },
{ item: "meadow:grain_cheese_block", name: "Grain Cheese Wheel", time: 13 },
{
item: "meadow:amethyst_cheese_block",
name: "Amethyst Cheese Wheel",
time: 13,
},
{
item: "meadow:buffalo_cheese_block",
name: "Buffalo Cheese Wheel",
time: 13,
},
{ item: "society:beer_london", name: "London Beer", time: 13 },
{ item: "society:ancient_vespertine", name: "Ancient Vespertine", time: 20 },
{ item: "society:dewy_star", name: "Dewy Star", time: 20 },
{ item: "society:ancient_cider", name: "Ancient Cider", time: 20 },
{ item: "society:beer_attunecore", name: "Attunecore Beer", time: 13 },
{
item: "farmlife:tribull_cheese_wheel",
name: "Tri-Bull Cheese Wheel",
time: 13,
},
{ item: "society:violet_moon", name: "Violet Moon", time: 10 },
{ item: "society:laputa_franc", name: "Laputa Franc", time: 20 },
{ item: "society:sparkling_le_roy", name: "Sparkling Le Roy", time: 10 },
{ item: "society:mana_king", name: "Mana King", time: 20 },
].forEach((product) => {
const splitProduct = product.item.split(":");
global.ancientCaskRecipes.set(`society:aged_${splitProduct[1]}`, {
output: [`1x society:double_aged_${splitProduct[1]}`],
time: product.time,
});
});
StartupEvents.registry("block", (event) => {
event
.create("society:ancient_cask", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.ancient_cask.description").gray());
item.tooltip(Text.translatable("block.society.ancient_cask.description.warn").red());
item.modelJson({
parent: "society:block/kubejs/ancient_cask/ancient_cask",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const facing = block.properties.get("facing").toLowerCase();
if (player.stages.has("ancient_aging")) {
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (
!upgraded &&
block.properties.get("working").toLowerCase() == "false" &&
block.properties.get("mature").toLowerCase() == "false" &&
item == "society:inserter"
) {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 4),
0.2 * rnd(1, 4),
0.2 * rnd(1, 4),
3,
0.01
);
block.set(block.id, {
facing: facing,
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
} else if (!upgraded && item == "society:inserter") {
player.tell(Text.translatable("society.working_block_entity.cannot_upgrade").red());
}
}
if (upgraded)
global.handleBERightClick(
"minecraft:block.wood.place",
click,
global.ancientCaskRecipes,
4,
true,
false,
4
);
else
global.handleBERightClick(
"minecraft:block.wood.place",
click,
global.ancientCaskRecipes,
20
);
} else player.tell(Text.translatable("block.society.ancient_cask.no_skill").red());
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.ancientCaskRecipes, 20);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("ancient_cask"),
};
});
@@ -0,0 +1,117 @@
//priority: 100
console.info("[SOCIETY] ancientGoddessStatue.js loaded");
StartupEvents.registry("block", (event) => {
event
.create("society:ancient_goddess_statue", "cardinal")
.box(3, 0, 3, 13, 20, 13)
.defaultCutout()
.soundType("stone")
.hardness(4.5)
.resistance(9.0)
.requiresTool(false)
.model("society:block/kubejs/ancient_goddess_statue")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable(
"block.society.ancient_goddess_statue.description"
).gray()
);
item.tooltip(
Text.translatable(
"block.society.ancient_goddess_statue.description.warn"
).red()
);
item.modelJson({
parent: "society:block/kubejs/ancient_goddess_statue",
});
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const facing = block.properties.get("facing");
const season = global.getSeasonFromLevel(player.level);
if (player.stages.has("farmers_blessing")) {
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
let day = global.getDay(level);
if (!player.persistentData.days) player.persistentData.days = {}
let dayData = player.persistentData.days.ancientGoddessStatueDay;
if (dayData == undefined || global.compareDay(day, dayData, 1)) {
switch (season) {
case "spring":
if (item === "society:ancient_fruit" && item.count === 64) {
block.popItemFromFace("society:prismatic_shard", facing);
if (!player.isCreative()) item.count = item.count - 64;
successParticles(level, block);
player.persistentData.days.ancientGoddessStatueDay = day;
} else {
player.tell(
Text.translatable(
"block.society.ancient_goddess_statue.spring"
).aqua()
);
}
break;
case "summer":
if (item === "vintagedelight:ghost_pepper" && item.count === 64) {
block.popItemFromFace("64x society:sparkstone", facing);
if (!player.isCreative()) item.count = item.count - 64;
successParticles(level, block);
player.persistentData.days.ancientGoddessStatueDay = day;
} else {
player.tell(
Text.translatable(
"block.society.ancient_goddess_statue.summer"
).aqua()
);
}
break;
case "autumn":
if (item === "farm_and_charm:corn" && item.count === 64) {
block.popItemFromFace(
"4x society:pristine_star_shards",
facing
);
if (!player.isCreative()) item.count = item.count - 64;
successParticles(level, block);
player.persistentData.days.ancientGoddessStatueDay = day;
} else {
player.tell(
Text.translatable(
"block.society.ancient_goddess_statue.autumn"
).aqua()
);
}
break;
case "winter":
if (item === "snowyspirit:ginger" && item.count === 64) {
block.popItemFromFace("4x minecraft:netherite_scrap", facing);
if (!player.isCreative()) item.count = item.count - 64;
successParticles(level, block);
player.persistentData.days.ancientGoddessStatueDay = day;
} else {
player.tell(
Text.translatable(
"block.society.ancient_goddess_statue.winter"
).aqua()
);
}
break;
}
} else {
player.tell(
Text.translatable("block.society.ancient_goddess_statue.already_taken").red()
);
}
}
} else
player.tell(
Text.translatable(
"block.society.ancient_goddess_statue.no_skill"
).red()
);
})
});
@@ -0,0 +1,134 @@
//priority: 100
console.info("[SOCIETY] baitMaker.js loaded");
const baitFish = [
"aquaculture:atlantic_herring",
"minecraft:pufferfish",
"aquaculture:minnow",
"aquaculture:bluegill",
"aquaculture:perch",
"minecraft:salmon",
"aquaculture:blackfish",
"aquaculture:brown_trout",
"aquaculture:carp",
"aquaculture:piranha",
"aquaculture:smallmouth_bass",
"minecraft:cod",
"aquaculture:pollock",
"aquaculture:jellyfish",
"aquaculture:rainbow_trout",
"aquaculture:pink_salmon",
"minecraft:tropical_fish",
"aquaculture:red_grouper",
"aquaculture:gar",
"aquaculture:muskellunge",
"aquaculture:synodontis",
"aquaculture:tambaqui",
"aquaculture:atlantic_cod",
"aquaculture:boulti",
"aquaculture:leech",
"aquaculture:catfish",
"aquaculture:tuna",
"aquaculture:bayad",
"aquaculture:arapaima",
"aquaculture:atlantic_halibut",
"aquaculture:starshell_turtle",
"aquaculture:brown_shrooma",
"aquaculture:red_shrooma",
"aquaculture:arrau_turtle",
"aquaculture:capitaine",
"aquaculture:box_turtle",
"aquaculture:pacific_halibut",
"aquaculture:goldfish",
"crabbersdelight:shrimp",
"crabbersdelight:clawster",
"crabbersdelight:crab",
"crabbersdelight:clam",
"netherdepthsupgrade:searing_cod",
"netherdepthsupgrade:blazefish",
"netherdepthsupgrade:lava_pufferfish",
"netherdepthsupgrade:obsidianfish",
"netherdepthsupgrade:bonefish",
"netherdepthsupgrade:wither_bonefish",
"netherdepthsupgrade:magmacubefish",
"netherdepthsupgrade:glowdine",
"netherdepthsupgrade:soulsucker",
"netherdepthsupgrade:fortress_grouper",
"netherdepthsupgrade:eyeball_fish",
"society:neptuna",
"unusualfishmod:raw_sneep_snorp",
"unusualfishmod:raw_picklefish",
"unusualfishmod:raw_forkfish",
"unusualfishmod:raw_beaked_herring",
"unusualfishmod:raw_sailor_barb",
"unusualfishmod:raw_demon_herring",
"unusualfishmod:raw_triple_twirl_pleco",
"unusualfishmod:raw_copperflame_anthias",
"unusualfishmod:raw_drooping_gourami",
"unusualfishmod:raw_duality_damselfish",
"unusualfishmod:raw_blind_sailfin",
"unusualfishmod:raw_circus_fish",
"unusualfishmod:raw_snowflake",
"unusualfishmod:raw_aero_mono",
"unusualfishmod:raw_hatchetfish",
"unusualfishmod:raw_spindlefish",
"unusualfishmod:raw_bark_angelfish",
"unusualfishmod:raw_amber_goby",
"unusualfishmod:raw_eyelash",
"crittersandcompanions:koi_fish",
];
global.baitMakerRecipes = new Map([]);
baitFish.forEach((fish) => {
const splitFish = fish.split(":");
let fishId = splitFish[1];
if (!["barrel", "roe", "meat"].some((denied) => splitFish[1].includes(denied))) {
if (fishId.includes("raw_")) {
if (fishId === "raw_snowflake") fishId = "frosty_fin";
else fishId = fishId.substring(4, fishId.length);
}
global.baitMakerRecipes.set(fish, {
output: [`3x society:${fishId}_bait`],
});
}
});
StartupEvents.registry("block", (event) => {
event
.create("society:bait_maker", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(2, 0, 2, 14, 19, 14)
.defaultCutout()
.soundType("copper")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.bait_maker.description").gray());
item.modelJson({
parent: "society:block/kubejs/bait_maker/bait_maker_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.rightClick((click) => {
global.handleBERightClick("aquaculture:fish_death", click, global.baitMakerRecipes, 1);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.baitMakerRecipes, 1);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("bait_maker"),
};
});
@@ -0,0 +1,152 @@
//priority: 100
console.info("[SOCIETY] chargingRod.js loaded");
StartupEvents.registry("block", (event) => {
event
.create("society:charging_rod", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.soundType("copper")
.box(4, 0, 4, 12, 16, 12)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.charging_rod.description").gray());
item.modelJson({
parent: "society:block/kubejs/charging_rod_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level, server } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const season = global.getSeasonFromLevel(level);
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:frosted_tip") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
if (block.properties.get("mature").toLowerCase() === "true") {
block.popItemFromFace(
Item.of(`${upgraded && season === "winter" ? 3 : 1}x society:battery`),
"up"
);
server.runCommandSilent(
`playsound stardew_fishing:dwop block @a ${player.x} ${player.y} ${player.z}`
);
global.giveExperience(server, player, "farming", 40);
block.set(block.id, {
working: false,
mature: false,
upgraded: upgraded,
});
}
})
.randomTick((tick) => {
const { block, level } = tick;
const { x, y, z } = block;
const upgraded = block.properties.get("upgraded") == "true";
if (
block.properties.get("working").toLowerCase() === "false" &&
block.properties.get("mature").toLowerCase() === "false"
) {
const season = global.getSeasonFromLevel(level);
if ((!upgraded && season === "winter") || !level.raining || !block.canSeeSky) return;
if (season !== "winter" && !level.thundering) return;
level.spawnParticles(
"minecraft:campfire_cosy_smoke",
true,
x + 0.5,
y + 1,
z + 0.5,
0.1 * rnd(1, 2),
0.1 * rnd(1, 2),
0.1 * rnd(1, 2),
rnd(1, 4),
0.1
);
Utils.server.runCommandSilent(
`execute in ${level.dimension} run summon lightning_bolt ${block.x} ${block.y} ${block.z}`
);
let nbt = block.getEntityData();
nbt.merge({ data: { stage: 0 } });
global.setBlockEntityData(block, nbt)
block.set(block.id, {
working: true,
mature: false,
upgraded: upgraded,
});
}
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, null, 5);
});
}).blockstateJson = {
multipart: [
{ apply: { model: "society:block/kubejs/charging_rod_particle" } },
{
when: { working: false, upgraded: false, mature: false },
apply: { model: "society:block/kubejs/charging_rod_off" },
},
{
when: { working: true, upgraded: false, mature: false },
apply: { model: "society:block/kubejs/charging_rod" },
},
{
when: { working: false, upgraded: false, mature: true },
apply: { model: "society:block/kubejs/charging_rod_done" },
},
{
when: { working: false, upgraded: true, mature: false },
apply: { model: "society:block/kubejs/charging_rod_upgraded_off" },
},
{
when: { working: true, upgraded: true, mature: false },
apply: { model: "society:block/kubejs/charging_rod_upgraded" },
},
{
when: { working: false, upgraded: true, mature: true },
apply: { model: "society:block/kubejs/charging_rod_upgraded_done" },
},
{
when: { mature: true },
apply: { model: "society:block/kubejs/machine_done" },
},
],
};
});
@@ -0,0 +1,117 @@
//priority: 100
console.info("[SOCIETY] mayonnaiseMachine.js loaded");
global.cheesePressRecipes = new Map([
["society:sheep_milk", { output: ["1x meadow:piece_of_sheep_cheese"] }],
["society:milk", { output: ["1x meadow:piece_of_cheese"] }],
["society:buffalo_milk", { output: ["1x meadow:piece_of_buffalo_cheese"] }],
["society:goat_milk", { output: ["1x meadow:piece_of_goat_cheese"] }],
["society:warped_milk", { output: ["1x meadow:piece_of_warped_cheese"] }],
["society:tri_bull_milk", { output: ["1x farmlife:tribull_cheese_wedge"] }],
["society:grain_milk", { output: ["1x meadow:piece_of_grain_cheese"] }],
["society:amethyst_milk", { output: ["1x meadow:piece_of_amethyst_cheese"] }],
["society:large_sheep_milk", { output: ["1x meadow:sheep_cheese_block"] }],
["society:large_milk", { output: ["1x meadow:cheese_block"] }],
[
"society:large_buffalo_milk",
{ output: ["1x meadow:buffalo_cheese_block"] },
],
["society:large_goat_milk", { output: ["1x meadow:goat_cheese_block"] }],
["society:large_warped_milk", { output: ["1x meadow:warped_cheese_block"] }],
[
"society:large_tri_bull_milk",
{ output: ["1x farmlife:tribull_cheese_wheel"] },
],
["society:large_grain_milk", { output: ["1x meadow:grain_cheese_block"] }],
[
"society:large_amethyst_milk",
{ output: ["1x meadow:amethyst_cheese_block"] },
],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:cheese_press", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.soundType("copper")
.box(2, 0, 2, 14, 19, 14)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.displayName("Artisan Cheese Press")
.item((item) => {
item.tooltip(Text.translatable("block.society.cheese_press.description").gray());
item.tooltip(Text.translatable("society.working_block_entity.preserve_quality").green());
item.modelJson({
parent: "society:block/kubejs/cheese_press/cheese_press_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const facing = block.properties.get("facing").toLowerCase();
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:pink_matter") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true
});
}
}
let outputCount = 1;
if (player.stages.has("rancher") && Math.random() <= 0.2) {
outputCount = 2;
}
global.handleBERightClick(
"species:block.frozen_meat.place",
click,
global.cheesePressRecipes,
3,
false,
false,
outputCount,
false,
true
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "", quality: 0 });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.cheesePressRecipes, 2);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("cheese_press"),
};
});
@@ -0,0 +1,82 @@
console.info("[SOCIETY] coinLeaderboard.js loaded");
const updateLeaderboardMap = (server) => {
let accountName;
let playerList = server.persistentData.playerList;
let overflowList = server.persistentData.overflowList;
if (!playerList) return undefined;
let leaderboardMap = new Map();
global.GLOBAL_BANK.accounts.forEach((playerUUID, bankAccount) => {
accountName = playerList[playerUUID];
if (overflowList != null && overflowList[playerUUID] != null) {
leaderboardMap.set(
accountName,
bankAccount.getBalance() + overflowList[playerUUID] * 1006632960
);
} else {
if (!accountName) {
accountName = "";
Object.keys(server.persistentData.playerList).forEach((playerUUID) => {
if (accountName !== "" &&bankAccount.isAuthorized(playerUUID)) {
if (accountName !== "") accountName += playerList[playerUUID] +"'s Team"
}
})
}
leaderboardMap.set(accountName, bankAccount.getBalance());
}
});
return Array.from(leaderboardMap)
.sort((a, b) => b[1] - a[1])
.slice(0, 10);
};
global.updateLeaderboard = (block, level, server) => {
let calcY = block.y + 3;
let leaderboardMap = updateLeaderboardMap(server);
if (!leaderboardMap) return;
if (global.susFunctionLogging)
console.log("[SOCIETY-SUSFN] coinLeaderboard.js");
global.clearOldTextDisplay(block, level, "leaderboard");
// Display leaderboard name
global.spawnTextDisplay(
block,
calcY,
"leaderboard",
Text.translatable("block.society.coin_leaderboard.title")
);
// Display leaderboard accounts
leaderboardMap.forEach((playerName) => {
const balanceStr = playerName.toString().split(`,`);
if (balanceStr[0].length <= 1) return;
calcY -= 0.3;
global.spawnTextDisplay(
block,
calcY,
"leaderboard",
Text.of(`§6${balanceStr[0]} §7- §f● §6${balanceStr[1].replace(/\B(?=(\d{3})+(?!\d))/g, ",")}`)
);
});
};
StartupEvents.registry("block", (e) => {
e.create("society:coin_leaderboard", "cardinal")
.box(2, 0, 2, 14, 2, 14)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.model("society:block/kubejs/coin_leaderboard")
.item((item) => {
item.tooltip(
Text.translatable("block.society.coin_leaderboard.description").gray()
);
item.modelJson({
parent: "society:block/kubejs/coin_leaderboard",
});
})
.blockEntity((be) => {
be.serverTick(600, 0, (tick) => {
global.updateLeaderboard(tick.block, tick.level, tick.level.server);
});
});
});
@@ -0,0 +1,158 @@
//priority: 100
console.info("[SOCIETY] crystalarium.js loaded");
global.crystalariumCrystals = new Map([]);
const crystals = [
{ item: "society:ocean_stone", time: 3 },
{ item: "society:opal", time: 3 },
{ item: "society:pyrite", time: 3 },
{ item: "society:soapstone", time: 3 },
{ item: "society:frozen_tear", time: 1 },
{ item: "society:baryte", time: 3 },
{ item: "society:basalt_shard", time: 3 },
{ item: "society:bixbyite", time: 3 },
{ item: "society:dolomite", time: 3 },
{ item: "society:fire_quartz", time: 2 },
{ item: "society:earth_crystal", time: 1 },
{ item: "society:allanite", time: 3 },
{ item: "society:calcite_gem", time: 3 },
{ item: "society:celestine", time: 3 },
{ item: "society:granite_slate", time: 3 },
{ item: "society:jagoite", time: 3 },
{ item: "society:jamborite", time: 3 },
{ item: "society:slate", time: 3 },
{ item: "society:limestone_pebble", time: 3 },
{ item: "society:malachite", time: 3 },
{ item: "society:mudstone", time: 3 },
{ item: "society:nekoite", time: 3 },
{ item: "society:orpiment", time: 3 },
{ item: "society:petrified_slime", time: 3 },
{ item: "society:sandstone_slate", time: 3 },
{ item: "society:thunder_egg", time: 3 },
{ item: "society:aerinite", time: 3 },
{ item: "society:esperite", time: 3 },
{ item: "society:fairy_stone", time: 3 },
{ item: "society:fluorapatite", time: 3 },
{ item: "society:geminite", time: 3 },
{ item: "society:ghost_crystal", time: 3 },
{ item: "society:hematite", time: 3 },
{ item: "society:kyanite", time: 3 },
{ item: "society:lunarite", time: 3 },
{ item: "society:marble", time: 3 },
{ item: "society:fire_opal", time: 3 },
{ item: "society:helvite", time: 4 },
{ item: "society:jasper", time: 3 },
{ item: "society:lemon_stone", time: 3 },
{ item: "society:neptunite", time: 4 },
{ item: "society:pure_obsidian", time: 3 },
{ item: "society:star_shards", time: 4 },
{ item: "society:tigerseye", time: 3 },
{ item: "society:aquamarine", time: 1 },
{ item: "society:ruby", time: 2 },
{ item: "society:amethyst_chunk", time: 1 },
{ item: "society:topaz", time: 2 },
{ item: "society:jade", time: 5 },
{ item: "minecraft:emerald", time: 2 },
{ item: "minecraft:lapis_lazuli", time: 1 },
{ item: "minecraft:diamond", time: 4 },
{ item: "minecraft:amethyst_shard", time: 1 },
{ item: "minecraft:prismarine_crystals", time: 1 },
{ item: "minecraft:quartz", time: 1 },
{ item: "society:spinel", time: 6 },
];
crystals.forEach((crystal) => {
global.crystalariumCrystals.set(crystal.item, {
output: [`2x ${crystal.item}`],
time: crystal.time,
});
});
StartupEvents.registry("block", (event) => {
event
.create("society:crystalarium", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(2, 0, 2, 14, 16, 14)
.defaultCutout()
.soundType("stone")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.crystalarium.description").gray());
item.modelJson({
parent: "society:block/kubejs/crystalarium/crystalarium",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:black_opal") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: block.properties.get("facing"),
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
global.convertFromLegacy(global.crystalariumCrystals, level, block);
if (upgraded && block.properties.get("mature") === "true" && rnd10()) {
let nbt = block.getEntityData();
let recipeId = nbt.data.recipe;
let recipe = recipeId ? global.crystalariumCrystals.get(recipeId) : null;
if (recipe && recipe.output) {
recipe.output.forEach((item) => {
let pristinePath = String(Item.of(item).id).split(":")[1];
if (pristinePath) {
block.popItemFromFace(`society:pristine_${pristinePath}`, block.properties.get("facing").toLowerCase());
}
})
}
}
global.handleBERightClick(
"minecraft:block.amethyst_block.step",
click,
global.crystalariumCrystals,
5
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.crystalariumCrystals, 5);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("crystalarium"),
};
});
@@ -0,0 +1,192 @@
//priority: 100
console.info("[SOCIETY] dehydrator.js loaded");
global.dehydratorRecipes = new Map([
["nethervinery:crimson_grape", { output: [`1x society:nether_raisins`] }],
["nethervinery:warped_grape", { output: [`1x society:nether_raisins`] }],
]);
const overworldGrapes = [
"vinery:red_grape",
"vinery:taiga_grapes_red",
"vinery:savanna_grapes_red",
"vinery:jungle_grapes_red",
"vinery:white_grape",
"vinery:taiga_grapes_white",
"vinery:jungle_grapes_white",
"vinery:savanna_grapes_white",
];
overworldGrapes.forEach((item) => {
global.dehydratorRecipes.set(item, {
output: [`1x society:raisins`],
});
});
global.dehydratableMushrooms = [
"minecraft:brown_mushroom",
"minecraft:red_mushroom",
"minecraft:crimson_fungus",
"minecraft:warped_fungus",
"quark:glow_shroom",
"ribbits:toadstool",
"species:alphacene_mushroom",
"verdantvibes:bracket_mushroom",
"cluttered:blue_roundhead",
"cluttered:fly_agaric",
];
global.dehydratableMushroomOutputs = ["society:dried_shimmering_mushrooms"];
global.dehydratableMushrooms.forEach((item) => {
global.dehydratableMushroomOutputs.push(`society:dried_${item.path}`);
global.dehydratorRecipes.set(item, {
output: [`1x society:dried_${item.path}`],
});
});
global.dehydratableFruits = [
"minecraft:sweet_berries",
"autumnity:foul_berries",
"atmospheric:currant",
"atmospheric:yucca_fruit",
"minecraft:apple",
"minecraft:melon_slice",
"vintagedelight:gearo_berry",
"minecraft:chorus_fruit",
"pamhc2trees:lycheeitem",
"pamhc2trees:bananaitem",
"farm_and_charm:strawberry",
"minecraft:glow_berries",
"vinery:cherry",
"society:blueberry",
"pamhc2trees:mangoitem",
"pamhc2trees:peachitem",
"pamhc2trees:pawpawitem",
"pamhc2trees:plumitem",
"society:ancient_fruit",
"atmospheric:orange",
"pamhc2trees:dragonfruititem",
"atmospheric:passion_fruit",
"pamhc2trees:starfruititem",
"pamhc2trees:lemonitem",
"society:salmonberry",
"society:boysenberry",
"society:cranberry",
"society:mossberry",
"society:crystalberry",
"windswept:wild_berries",
"society:mana_fruit",
"society:sparkpod",
];
global.dehydratableFruits.forEach((item) => {
let itemId = item.path;
if (itemId.includes("item")) itemId = itemId.substring(0, itemId.length - 4);
global.dehydratorRecipes.set(item, {
output: [`1x society:dried_${itemId}`],
});
});
global.shimmeringMushrooms = [
"botania:white_mushroom",
"botania:orange_mushroom",
"botania:magenta_mushroom",
"botania:light_blue_mushroom",
"botania:yellow_mushroom",
"botania:lime_mushroom",
"botania:pink_mushroom",
"botania:black_mushroom",
"botania:red_mushroom",
"botania:green_mushroom",
"botania:brown_mushroom",
"botania:blue_mushroom",
"botania:purple_mushroom",
"botania:cyan_mushroom",
"botania:light_gray_mushroom",
"botania:gray_mushroom",
];
global.shimmeringMushrooms.forEach((item) => {
global.dehydratorRecipes.set(item, {
output: [`1x society:dried_shimmering_mushrooms`],
});
});
StartupEvents.registry("block", (event) => {
event
.create("society:dehydrator", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(1, 0, 4, 15, 16, 12)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.dehydrator.description").gray());
item.modelJson({
parent: "society:block/kubejs/dehydrator/dehydrator_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const facing = block.properties.get("facing");
const input = block.getEntityData().data.recipe;
let isMushroom;
if (input) {
isMushroom =
global.dehydratableMushrooms.includes(input) ||
global.shimmeringMushrooms.includes(input);
}
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:cordycep") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
global.handleBERightClick(
"species:block.alphacene_foliage.place",
click,
global.dehydratorRecipes,
8,
true,
false,
upgraded && isMushroom ? 2 : 1
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.dehydratorRecipes, 1);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("dehydrator"),
};
});
@@ -0,0 +1,124 @@
//priority: 100
console.info("[SOCIETY] deluxeWormFarm.js loaded");
global.deluxeWormFarmRecipes = new Map([
["crabbersdelight:crab_trap_bait", { output: ["4x crabbersdelight:deluxe_crab_trap_bait"] }],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:deluxe_worm_farm", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.soundType("copper")
.box(2, 0, 2, 14, 15, 14)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.model("society:block/kubejs/deluxe_worm_farm")
.item((item) => {
item.tooltip(Text.translatable("block.society.deluxe_worm_farm.description").gray());
item.modelJson({
parent: "society:block/kubejs/deluxe_worm_farm",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:infinity_worm") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: block.properties.get("facing"),
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
global.handleBERightClick(
"aquaculture:fish_flop",
click,
global.deluxeWormFarmRecipes,
4,
true
);
if (upgraded && block.properties.get("working") === "false") {
let nbt = block.getEntityData();
nbt.merge({ data: { recipe: "crabbersdelight:crab_trap_bait", stage: 0 } });
global.setBlockEntityData(block, nbt)
block.set(block.id, {
facing: block.properties.get("facing"),
working: true,
mature: false,
upgraded: upgraded,
});
}
})
.randomTick((tick) => {
global.handleBERandomTick(tick, rnd50(), 2);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
}).blockstateJson = {
multipart: [
{
when: { upgraded: false },
apply: { model: "society:block/kubejs/deluxe_worm_farm_base" },
},
{
when: { upgraded: true },
apply: { model: "society:block/kubejs/deluxe_worm_farm_base_upgraded" },
},
{
when: { working: true, upgraded: false },
apply: { model: "society:block/kubejs/deluxe_worm_farm" },
},
{
when: { mature: true, upgraded: false },
apply: { model: "society:block/kubejs/deluxe_worm_farm" },
},
{
when: { working: true, upgraded: true },
apply: { model: "society:block/kubejs/deluxe_worm_farm_upgraded" },
},
{
when: { mature: true, upgraded: true },
apply: { model: "society:block/kubejs/deluxe_worm_farm_upgraded" },
},
{
when: { mature: true },
apply: { model: "society:block/kubejs/machine_done" },
},
],
};
});
@@ -0,0 +1,195 @@
//priority: 100
console.info("[SOCIETY] espressoMachine.js loaded");
global.espressoMachineRecipes = new Map([
["herbalbrews:ground_coffee", { output: ["1x society:espresso"] }],
["society:large_milk", { output: ["4x society:steamed_milk"] }],
["society:large_sheep_milk", { output: ["4x society:steamed_milk"] }],
["society:large_goat_milk", { output: ["4x society:steamed_milk"] }],
["society:large_warped_milk", { output: ["4x society:steamed_milk"] }],
["society:large_buffalo_milk", { output: ["4x society:steamed_milk"] }],
["society:milk", { output: ["1x society:steamed_milk"] }],
["society:sheep_milk", { output: ["1x society:steamed_milk"] }],
["society:goat_milk", { output: ["1x society:steamed_milk"] }],
["society:warped_milk", { output: ["1x society:steamed_milk"] }],
["society:buffalo_milk", { output: ["1x society:steamed_milk"] }],
[
"farmersdelight:milk_bottle",
{ output: ["1x society:steamed_milk", "1x minecraft:glass_bottle"] },
],
[
"vintagedelight:nut_milk_bottle",
{ output: ["1x society:steamed_milk", "1x minecraft:glass_bottle"] },
],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:espresso_machine", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(4, 0, 2, 12, 14, 14)
.defaultCutout()
.model("society:block/kubejs/espresso_machine")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.espresso_machine.description").gray());
item.modelJson({
parent: "society:block/kubejs/espresso_machine",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { item, block, hand, player, server } = click;
if (player.isFake()) return;
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
let recipe = global.espressoMachineRecipes.get(`${item.id}`);
// Handle steamed milk
if (recipe && recipe.output[0].includes("steamed_milk")) {
if (!player.isCreative()) item.count--;
server.runCommandSilent(
`playsound minecraft:block.lava.extinguish block @a ${player.x} ${player.y} ${player.z}`
);
global.giveExperience(server, player, "farming", 10);
recipe.output.forEach((e) => {
block.popItemFromFace(e, block.properties.get("facing"));
});
}
}
global.handleBERightClick(
"doapi:brewstation_whistle",
click,
new Map([["herbalbrews:ground_coffee", { output: ["1x society:espresso"] }]]),
4,
true
);
})
.randomTick((tick) => {
global.handleBERandomTick(tick, true, 1);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
}).blockstateJson = {
multipart: [
{
apply: { model: "society:block/kubejs/espresso_machine_particle" },
},
{
when: { mature: true },
apply: { model: "society:block/kubejs/machine_done" },
},
{
when: { working: false, mature: true, facing: "north" },
apply: {
model: "society:block/kubejs/espresso_cup_full",
y: 0,
uvlock: false,
},
},
{
when: { working: false, mature: true, facing: "east" },
apply: {
model: "society:block/kubejs/espresso_cup_full",
y: 90,
uvlock: false,
},
},
{
when: { working: false, mature: true, facing: "south" },
apply: {
model: "society:block/kubejs/espresso_cup_full",
y: 180,
uvlock: false,
},
},
{
when: { working: false, mature: true, facing: "west" },
apply: {
model: "society:block/kubejs/espresso_cup_full",
y: -90,
uvlock: false,
},
},
{
when: { working: true, mature: false, facing: "north" },
apply: {
model: "society:block/kubejs/espresso_cup_empty",
y: 0,
uvlock: false,
},
},
{
when: { working: true, mature: false, facing: "east" },
apply: {
model: "society:block/kubejs/espresso_cup_empty",
y: 90,
uvlock: false,
},
},
{
when: { working: true, mature: false, facing: "south" },
apply: {
model: "society:block/kubejs/espresso_cup_empty",
y: 180,
uvlock: false,
},
},
{
when: { working: true, mature: false, facing: "west" },
apply: {
model: "society:block/kubejs/espresso_cup_empty",
y: -90,
uvlock: false,
},
},
{
when: { facing: "north" },
apply: {
model: "society:block/kubejs/espresso_machine",
y: 0,
uvlock: false,
},
},
{
when: { facing: "east" },
apply: {
model: "society:block/kubejs/espresso_machine",
y: 90,
uvlock: false,
},
},
{
when: { facing: "south" },
apply: {
model: "society:block/kubejs/espresso_machine",
y: 180,
uvlock: false,
},
},
{
when: { facing: "west" },
apply: {
model: "society:block/kubejs/espresso_machine",
y: -90,
uvlock: false,
},
},
],
};
});
@@ -0,0 +1,320 @@
//priority: 100
console.info("[SOCIETY] fishPond.js loaded");
const getRequestedItems = (type, population) => {
let requestedItems = {};
global.fishPondDefinitions.get(`${type}`).quests.forEach((quest) => {
if (quest.population == population) {
requestedItems = quest.requestedItems;
}
});
return requestedItems;
};
global.handleFishInsertion = (clickEvent) => {
const { item, block, player, level, server } = clickEvent;
const { facing, upgraded } = global.getPondProperties(block);
let nbt = block.getEntityData();
const { type, population, max_population, non_native_fish } = nbt.data;
if (type.equals("") && global.fishPondDefinitions.has(`${item.id}`)) {
successParticles(level, block);
block.set(block.id, {
facing: facing,
valid: true,
mature: false,
upgraded: upgraded,
quest: false,
});
nbt.merge({
data: {
type: item.id,
quest_id: 0,
population: 1,
max_population: 3,
non_native_fish: 1,
},
});
global.setBlockEntityData(block, nbt)
if (!player.isCreative()) item.count--;
} else if (type == item && population < max_population) {
server.runCommandSilent(
`playsound minecraft:entity.player.splash block @a ${block.x} ${block.y} ${block.z}`
);
level.spawnParticles(
"minecraft:splash",
true,
block.x + 0.5,
block.y + 0.9,
block.z + 0.5,
0.1 * rnd(1, 4),
0.1 * rnd(1, 4),
0.1 * rnd(1, 4),
10,
0.1
);
nbt.merge({
data: {
population: increaseStage(population),
non_native_fish: increaseStage(non_native_fish),
},
});
global.setBlockEntityData(block, nbt)
if (!player.isCreative()) item.count--;
}
};
global.handleQuestSubmission = (type, clickEvent) => {
const { item, block, player, level } = clickEvent;
const { facing, valid, mature, upgraded } = global.getPondProperties(block);
let nbt = block.getEntityData();
const { max_population, quest_id } = nbt.data;
const questContent = getRequestedItems(type, Number(max_population))[
quest_id
];
if (item && questContent && item == questContent.item) {
let checkedCount = player.stages.has("pond_house_five")
? Math.round(questContent.count / 2)
: questContent.count;
if (item.count >= checkedCount) {
successParticles(level, block);
block.set(block.id, {
facing: facing,
valid: valid,
mature: mature,
upgraded: upgraded,
quest: false,
});
nbt.merge({
data: {
quest_id: 0,
max_population: increaseStage(
max_population,
Number(max_population) === 7 ? 3 : 2
),
},
});
global.setBlockEntityData(block, nbt)
if (
player.stages.has("fishing_mastery") &&
!player.stages.has("pond_house_five") &&
Math.random() <= 0.01
) {
block.popItemFromFace("society:pond_house_five", facing);
}
clickEvent.server.scheduleInTicks(2, () => {
player.tell(
Text.translatable(
"block.society.fish_pond.fish_quest.complete"
).green()
);
});
if (!player.isCreative()) item.count = item.count - checkedCount;
} else {
clickEvent.server.scheduleInTicks(2, () => {
player.tell(
Text.translatable(
"block.society.fish_pond.fish_quest.partial",
`${checkedCount - item.count}`
).red()
);
});
}
}
};
global.handleFishPondRightClick = (clickEvent) => {
const { item, block, hand, player, server, level } = clickEvent;
const { facing, valid, mature, upgraded, quest } =
global.getPondProperties(block);
// Prevent Deployers from using artisan machines
if (player.isFake()) return;
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
let nbt = block.getEntityData();
const { type, population, quest_id } = nbt.data;
if (upgraded === false && item === "society:sea_biscut") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
valid: valid,
mature: false,
upgraded: true,
quest: quest,
});
}
if (!player.isCrouching()) {
if (item && quest === "true" && global.fishPondDefinitions.get(`${type}`)) {
global.handleQuestSubmission(type, clickEvent);
}
global.handleFishInsertion(clickEvent);
if (mature === "true") {
global.handleFishHarvest(block, player, server, false, player.stages);
}
if (!type.equals("") && population == "0") {
if (item && item.hasTag("forge:tools/fishing_rods")) {
block.set(block.id, {
facing: facing,
valid: valid,
mature: false,
upgraded: upgraded,
quest: false,
});
nbt.merge({
data: {
type: "",
quest_id: 0,
population: 0,
max_population: 3,
non_native_fish: 0,
},
});
} else {
player.tell(
Text.translatable("block.society.fish_pond.fishing_rod").red()
);
}
}
} else if (population > 0) {
let fishItem = global.handleFishExtraction(block, player, server, player.stages);
if (fishItem) player.give(fishItem);
}
}
};
StartupEvents.registry("block", (event) => {
event
.create("society:fish_pond", "cardinal")
.property(booleanProperty.create("valid"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.property(booleanProperty.create("quest"))
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.modelJson({
parent: "society:block/kubejs/fish_pond",
});
item.fireResistant(true);
})
.defaultState((state) => {
state
.set(booleanProperty.create("valid"), true)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
.set(booleanProperty.create("quest"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("valid"), true)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
.set(booleanProperty.create("quest"), false);
})
.rightClick((click) => {
global.handleFishPondRightClick(click);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({
type: "",
quest_id: 0,
population: 0,
max_population: 3,
non_native_fish: 0,
});
blockInfo.serverTick(fishPondTickRate, 0, (entity) => {
global.handleFishPondTick(entity);
});
}).blockstateJson = {
multipart: [
{ apply: { model: "society:block/kubejs/fish_pond_particle" } },
{
when: { facing: "north", upgraded: false },
apply: { model: "society:block/kubejs/fish_pond", y: 0, uvlock: false },
},
{
when: { facing: "east", upgraded: false },
apply: {
model: "society:block/kubejs/fish_pond",
y: 90,
uvlock: false,
},
},
{
when: { facing: "south", upgraded: false },
apply: {
model: "society:block/kubejs/fish_pond",
y: 180,
uvlock: false,
},
},
{
when: { facing: "west", upgraded: false },
apply: {
model: "society:block/kubejs/fish_pond",
y: -90,
uvlock: false,
},
},
{
when: { facing: "north", upgraded: true },
apply: {
model: "society:block/kubejs/fish_pond_upgraded",
y: 0,
uvlock: false,
},
},
{
when: { facing: "east", upgraded: true },
apply: {
model: "society:block/kubejs/fish_pond_upgraded",
y: 90,
uvlock: false,
},
},
{
when: { facing: "south", upgraded: true },
apply: {
model: "society:block/kubejs/fish_pond_upgraded",
y: 180,
uvlock: false,
},
},
{
when: { facing: "west", upgraded: true },
apply: {
model: "society:block/kubejs/fish_pond_upgraded",
y: -90,
uvlock: false,
},
},
{
when: { mature: true },
apply: { model: "society:block/kubejs/machine_done" },
},
{
when: { quest: true, mature: false },
apply: { model: "society:block/kubejs/pond_quest" },
},
{
when: { valid: false },
apply: { model: "society:block/kubejs/error" },
},
],
};
});
@@ -0,0 +1,170 @@
//priority: 100
console.info("[SOCIETY] fishSmoker.js loaded");
global.fishSmokerRecipes = new Map([]);
const smokableFish = [
"aquaculture:atlantic_herring",
"minecraft:pufferfish",
"aquaculture:minnow",
"aquaculture:bluegill",
"aquaculture:perch",
"minecraft:salmon",
"aquaculture:blackfish",
"aquaculture:brown_trout",
"aquaculture:carp",
"aquaculture:piranha",
"aquaculture:smallmouth_bass",
"minecraft:cod",
"aquaculture:pollock",
"aquaculture:jellyfish",
"aquaculture:rainbow_trout",
"aquaculture:pink_salmon",
"minecraft:tropical_fish",
"aquaculture:red_grouper",
"aquaculture:gar",
"aquaculture:muskellunge",
"aquaculture:synodontis",
"aquaculture:tambaqui",
"aquaculture:atlantic_cod",
"aquaculture:boulti",
"aquaculture:leech",
"aquaculture:catfish",
"aquaculture:tuna",
"aquaculture:bayad",
"aquaculture:arapaima",
"aquaculture:atlantic_halibut",
"aquaculture:starshell_turtle",
"aquaculture:brown_shrooma",
"aquaculture:red_shrooma",
"aquaculture:arrau_turtle",
"aquaculture:capitaine",
"aquaculture:box_turtle",
"aquaculture:pacific_halibut",
"aquaculture:goldfish",
"crabbersdelight:shrimp",
"crabbersdelight:clawster",
"crabbersdelight:crab",
"crabbersdelight:clam",
"netherdepthsupgrade:searing_cod",
"netherdepthsupgrade:blazefish",
"netherdepthsupgrade:lava_pufferfish",
"netherdepthsupgrade:obsidianfish",
"netherdepthsupgrade:bonefish",
"netherdepthsupgrade:wither_bonefish",
"netherdepthsupgrade:magmacubefish",
"netherdepthsupgrade:glowdine",
"netherdepthsupgrade:soulsucker",
"netherdepthsupgrade:fortress_grouper",
"netherdepthsupgrade:eyeball_fish",
"society:neptuna",
"unusualfishmod:raw_sneep_snorp",
"unusualfishmod:raw_picklefish",
"unusualfishmod:raw_forkfish",
"unusualfishmod:raw_beaked_herring",
"unusualfishmod:raw_sailor_barb",
"unusualfishmod:raw_demon_herring",
"unusualfishmod:raw_triple_twirl_pleco",
"unusualfishmod:raw_copperflame_anthias",
"unusualfishmod:raw_drooping_gourami",
"unusualfishmod:raw_duality_damselfish",
"unusualfishmod:raw_blind_sailfin",
"unusualfishmod:raw_circus_fish",
"unusualfishmod:raw_snowflake",
"unusualfishmod:raw_aero_mono",
"unusualfishmod:raw_hatchetfish",
"unusualfishmod:raw_spindlefish",
"unusualfishmod:raw_bark_angelfish",
"unusualfishmod:raw_amber_goby",
"unusualfishmod:raw_eyelash",
"crittersandcompanions:koi_fish",
];
smokableFish.forEach((fish) => {
let fishId = fish.path;
if (fishId.includes("raw_")) {
if (fishId === "raw_snowflake") fishId = "frosty_fin";
else fishId = fishId.substring(4, fishId.length);
}
global.fishSmokerRecipes.set(fish, {
output: [`1x society:smoked_${fishId}`],
});
});
StartupEvents.registry("block", (event) => {
event
.create("society:fish_smoker", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(1, 0, 4, 15, 28, 12)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.fish_smoker.description").gray());
item.tooltip(Text.translatable("society.working_block_entity.preserve_quality").green());
item.modelJson({
parent: "society:block/kubejs/fish_smoker/fish_smoker_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const quality = block.properties.get("quality");
const facing = block.properties.get("facing");
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:ancient_roe") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
global.handleBERightClick(
"farmersdelight:block.skillet.add_food",
click,
global.fishSmokerRecipes,
5,
false,
false,
upgraded ? 2 : 1
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "", quality: 0 });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.fishSmokerRecipes, 2);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("fish_smoker", true),
};
});
@@ -0,0 +1,116 @@
console.info("[SOCIETY] goldenClock.js loaded");
global.handleProgress = (level, block) => {
const eventObj = { level: level, block: block };
let id = block.id;
switch (id) {
case "society:loom":
global.handleBETick(eventObj, global.loomRecipes, 1, false, true);
break;
case "society:mayonnaise_machine":
global.handleBETick(eventObj, global.mayonnaiseMachineRecipes, 1, false, true);
break;
case "society:cheese_press":
global.handleBETick(eventObj, global.cheesePressRecipes, 2, false, true);
break;
case "society:preserves_jar":
global.handleBETick(eventObj, global.preservesJarRecipes, 3, false, true);
break;
case "society:wine_keg":
global.handleBETick(eventObj, global.wineKegRecipes, 6, false, true);
break;
case "society:crystalarium":
global.handleBETick(eventObj, global.crystalariumCrystals, 5, false, true);
break;
case "society:aging_cask":
global.handleBETick(eventObj, global.agingCaskRecipes, 10, true, true);
break;
case "society:ancient_cask":
global.handleBETick(eventObj, global.ancientCaskRecipes, 20, false, true);
break;
case "society:dehydrator":
global.handleBETick(eventObj, global.dehydratorRecipes, 1, false, true);
break;
case "society:deluxe_worm_farm":
global.handleBETick(eventObj, null, 1, false, true);
break;
case "society:seed_maker":
global.handleBETick(eventObj, global.seedMakerRecipes, 1, false, true);
break;
case "society:fish_smoker":
global.handleBETick(eventObj, global.fishSmokerRecipes, 2, false, true);
break;
case "society:bait_maker":
global.handleBETick(eventObj, global.baitMakerRecipes, 1, false, true);
break;
case "society:recycling_machine":
global.handleBETick(eventObj, global.recyclingMachineRecipes, 1, false, true);
break;
case "society:oil_maker":
global.handleBETick(eventObj, global.oilMakerRecipes, 1, false, true);
break;
case "society:tapper":
if (block.properties.get("error") !== "true")
global.handleBETick(eventObj, global.tapperRecipes, 7, false, true);
break;
case "society:mushroom_log":
global.handleBETick(eventObj, global.mushroomLogRecipes, 4, false, true);
break;
case "society:bait_maker":
global.handleBETick(eventObj, null, 7, false, false, false, true);
break;
case "society:charging_rod":
global.handleBETick(eventObj, null, 5);
break;
default:
console.log("Invalid artisan machine!");
}
};
global.runGoldenClock = (entity) => {
const { level, block } = entity;
const { x, y, z } = block;
const radius = 2;
let scanBlock;
let dayTime = level.dayTime();
let morningModulo = dayTime % 24000;
const goldenClockProgTime = 1000;
if (
morningModulo >= goldenClockProgTime &&
morningModulo < goldenClockProgTime + artMachineTickRate
) {
for (let pos of BlockPos.betweenClosed(new BlockPos(x - radius, y - radius, z - radius), [
x + radius,
y + radius,
z + radius,
])) {
if (!level.isLoaded(pos)) continue;
scanBlock = level.getBlock(pos);
if (scanBlock.hasTag("society:golden_clock_advanced")) {
global.handleProgress(level, scanBlock);
}
}
level.server.runCommandSilent(
`playsound tanukidecor:block.grandfather_clock.chime block @a ${x} ${y} ${z}`
);
}
};
StartupEvents.registry("block", (event) => {
event
.create("society:golden_clock", "cardinal")
.soundType("copper")
.box(1, 0, 1, 15, 16, 15)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.golden_clock.description").gray());
item.tooltip(Text.translatable("tooltip.society.area", `5x5x5`).green());
item.modelJson({
parent: "society:block/kubejs/golden_clock",
});
})
.model("society:block/kubejs/golden_clock")
.blockEntity((blockInfo) => {
blockInfo.serverTick(artMachineTickRate, 0, (entity) => global.runGoldenClock(entity));
});
});
@@ -0,0 +1,95 @@
console.info("[SOCIETY] iridiumClock.js loaded");
global.runIridiumClock = (entity) => {
const { level, block } = entity;
const { x, y, z } = block;
const radius = 2;
let scanBlock;
let dayTime = level.dayTime();
let morningModulo = dayTime % 24000;
const iridiumClockProgTime = 20;
if (
morningModulo >= iridiumClockProgTime &&
morningModulo < iridiumClockProgTime + artMachineTickRate
) {
let surroundingClocks = 0;
for (let pos of BlockPos.betweenClosed(new BlockPos(x - radius, y - radius, z - radius), [
x + radius,
y + radius,
z + radius,
])) {
if (!level.isLoaded(pos)) continue;
scanBlock = level.getBlock(pos);
if (scanBlock.id.equals("society:golden_clock")) {
surroundingClocks++;
}
}
let blockNbt = block.getEntityData();
if (Number(blockNbt.data.triggerTimes) < 1728) {
blockNbt.merge({
data: {
triggerTimes: Number(blockNbt.data.triggerTimes) + 1,
},
});
}
global.setBlockEntityData(block, blockNbt);
let spinelType = Math.random() < 0.01 * surroundingClocks ? "society:pristine_spinel" : "society:spinel"
let spinelToInsert = blockNbt.data.triggerTimes;
let roundedStacks = Math.floor(spinelToInsert / 64);
if (spinelToInsert < 64) {
global.insertInto(block, Item.of(`${spinelToInsert}x ${spinelType}`));
} else {
for (let i = 0; i <= roundedStacks; i++) {
if (roundedStacks - 1 == i && spinelToInsert % 64 !== 0) {
global.insertInto(block, Item.of(`${spinelToInsert - (roundedStacks * 64)}x ${spinelType}`));
} else {
global.insertInto(block, Item.of(`64x ${spinelType}`));
}
}
}
level.server.runCommandSilent(
`playsound tanukidecor:block.clock_tower.chime block @a ${x} ${y} ${z}`
);
}
}
StartupEvents.registry("block", (event) => {
event
.create("society:iridium_clock", "cardinal")
.soundType("copper")
.box(1, 0, 1, 15, 16, 15)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.iridium_clock.description").gray());
item.tooltip(Text.translatable("block.society.iridium_clock.area").green());
item.modelJson({
parent: "society:block/kubejs/iridium_clock",
});
})
.model("society:block/kubejs/iridium_clock")
.blockEntity((blockInfo) => {
blockInfo.inventory(9, 3);
blockInfo.initialData({ triggerTimes: 0 });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => global.runIridiumClock(entity))
blockInfo.rightClickOpensInventory();
blockInfo.attachCapability(
CapabilityBuilder.ITEM.blockEntity()
.insertItem((blockEntity, slot, stack, simulate) =>
blockEntity.inventory.insertItem(slot, stack, simulate)
)
.extractItem((blockEntity, slot, stack, simulate) =>
blockEntity.inventory.extractItem(slot, stack, simulate)
)
.getSlotLimit((blockEntity, slot) =>
blockEntity.inventory.getSlotLimit(slot)
)
.getSlots((blockEntity) => blockEntity.inventory.slots)
.getStackInSlot((blockEntity, slot) =>
blockEntity.inventory.getStackInSlot(slot)
)
);
})
});
@@ -0,0 +1,98 @@
//priority: 100
console.info("[SOCIETY] loom.js loaded");
global.loomRecipes = new Map([
["#minecraft:wool", { output: ["society:canvas"] }],
["etcetera:cotton_flower", { output: ["society:canvas"] }],
["society:fine_wool", { output: ["society:merino_wool"] }],
["botania:mana_string", { output: ["botania:manaweave_cloth"] }],
["crittersandcompanions:silk", { output: ["society:merino_wool"] }],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:loom", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(0, 0, 1, 16, 26, 16)
.defaultCutout()
.displayName("Canvas Loom")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.loom.description").gray());
item.modelJson({
parent: "society:block/kubejs/loom/loom_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const facing = block.properties.get("facing").toLowerCase();
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:tiny_gnome") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
if (upgraded && block.properties.get("mature") === "true" && rnd25()) {
const furniture = Ingredient.of("#society:loot_furniture").itemIds;
block.popItemFromFace(furniture[Math.floor(Math.random() * furniture.length)], facing);
}
let outputCount = 1;
if (player.stages.has("rancher") && Math.random() <= 0.2) {
outputCount = 2;
}
global.handleBERightClick(
"minecraft:block.wool.fall",
click,
global.loomRecipes,
5,
true,
true,
outputCount
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.loomRecipes, 1);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("loom"),
};
});
@@ -0,0 +1,84 @@
console.info("[SOCIETY] manaClock.js loaded");
const MANA_PER_AGE = 10000;
const CLOCK_MAX_MANA = MANA_PER_AGE * 26;
global.manaClockTick = (entity) => {
const { block, level } = entity;
const { x, y, z } = block;
const radius = 1;
let mana = entity.persistentData.getInt("mana");
if (mana >= MANA_PER_AGE) {
let scanBlock;
for (let pos of BlockPos.betweenClosed(
new BlockPos(x - radius, y - radius, z - radius),
[x + radius, y + radius, z + radius]
)) {
if (!level.isLoaded(pos)) continue;
scanBlock = level.getBlock(pos);
if (scanBlock.hasTag("society:golden_clock_advanced")) {
global.handleProgress(level, scanBlock);
entity.persistentData.putInt("mana", mana - MANA_PER_AGE);
level.server.runCommandSilent(
`playsound botania:gaia_trap block @a ${x} ${y} ${z}`
);
level.spawnParticles(
"farmlife:stinky",
true,
scanBlock.x,
scanBlock.y + 1.5,
scanBlock.z,
0.1 * rnd(1, 4),
0.1 * rnd(1, 4),
0.1 * rnd(1, 4),
5,
0.01
);
break;
}
}
}
};
StartupEvents.registry("block", (event) => {
event
.create("society:mana_clock", "cardinal")
.soundType("copper")
.box(1, 0, 1, 15, 16, 15)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable("block.society.mana_clock.description").gray()
);
item.tooltip(
Text.translatable("society.working_block_entity.need_mana").aqua()
);
item.tooltip(Text.translatable("tooltip.society.area", `3x3`).green());
item.modelJson({
parent: "society:block/kubejs/mana_clock",
});
})
.model("society:block/kubejs/mana_clock")
.blockEntity((blockInfo) => {
blockInfo.serverTick(200, 0, (entity) => global.manaClockTick(entity)),
blockInfo.attachCapability(
BotaniaCapabilityBuilder.MANA.blockEntity()
.canReceiveManaFromBurst((be) => {
let mana = be.persistentData.getInt("mana");
return mana < CLOCK_MAX_MANA;
})
.receiveMana((be, amount) => {
let currentMana = be.persistentData.getInt("mana");
let received = Math.min(CLOCK_MAX_MANA - currentMana, amount);
be.persistentData.putInt("mana", currentMana + received);
})
.getCurrentMana((be) => be.persistentData.getInt("mana"))
.isFull((be) => {
let mana = be.persistentData.getInt("mana");
return mana >= CLOCK_MAX_MANA;
})
);
});
});
@@ -0,0 +1,121 @@
//priority: 100
console.info("[SOCIETY] mayonnaiseMachine.js loaded");
global.mayonnaiseMachineRecipes = new Map([
["minecraft:egg", { output: ["1x society:mayonnaise"] }],
["untitledduckmod:duck_egg", { output: ["1x society:duck_mayonnaise"] }],
["untitledduckmod:goose_egg", { output: ["1x society:goose_mayonnaise"] }],
["quark:egg_parrot_red_blue", { output: ["1x society:parrot_mayonnaise"] }],
["quark:egg_parrot_blue", { output: ["1x society:parrot_mayonnaise"] }],
["quark:egg_parrot_green", { output: ["1x society:parrot_mayonnaise"] }],
["quark:egg_parrot_yellow_blue", { output: ["1x society:parrot_mayonnaise"] }],
["quark:egg_parrot_gray", { output: ["1x society:parrot_mayonnaise"] }],
["minecraft:turtle_egg", { output: ["1x society:turtle_mayonnaise"] }],
["minecraft:sniffer_egg", { output: ["1x society:sniffer_mayonnaise"] }],
["minecraft:dragon_egg", { output: ["1x society:dragon_mayonnaise"] }],
["vintagedelight:golden_egg", { output: ["1x society:golden_mayonnaise"] }],
["autumnity:turkey_egg", { output: ["1x society:turkey_mayonnaise"] }],
["society:large_egg", { output: ["1x society:large_mayonnaise"] }],
["society:large_duck_egg", { output: ["1x society:large_duck_mayonnaise"] }],
["society:large_goose_egg", { output: ["1x society:large_goose_mayonnaise"] }],
["society:large_turkey_egg", { output: ["1x society:large_turkey_mayonnaise"] }],
["species:birt_egg", { output: ["1x society:birt_mayonnaise"] }],
["species:wraptor_egg", { output: ["1x society:wraptor_mayonnaise"] }],
["species:springling_egg", { output: ["1x society:springling_mayonnaise"] }],
["species:petrified_egg", { output: ["1x society:petrified_mayonnaise"] }],
["species:cruncher_egg", { output: ["1x society:cruncher_mayonnaise"] }],
["society:flamingo_egg", { output: ["1x society:flamingo_mayonnaise"] }],
["society:penguin_egg", { output: ["1x society:penguin_mayonnaise"] }],
["farmlife:galliraptor_egg", { output: ["1x society:galliraptor_mayonnaise"] }],
["society:large_galliraptor_egg", { output: ["1x society:large_galliraptor_mayonnaise"] }],
["minecraft:brown_egg", { output: ["1x society:mayonnaise"] }],
["minecraft:blue_egg", { output: ["1x society:mayonnaise"] }],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:mayonnaise_machine", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.soundType("copper")
.box(2, 0, 2, 14, 19, 14)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.mayonnaise_machine.description").gray());
item.tooltip(Text.translatable("society.working_block_entity.preserve_quality").green());
item.modelJson({
parent: "society:block/kubejs/mayonnaise_machine/mayonnaise_machine_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:enkephalin") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: block.properties.get("facing"),
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
if (upgraded && block.properties.get("mature") === "true" && rnd5()) {
block.popItemFromFace(
"society:supreme_mayonnaise",
block.properties.get("facing").toLowerCase()
);
}
let outputCount = 1;
if (player.stages.has("rancher") && Math.random() <= 0.2) {
outputCount = 2;
}
global.handleBERightClick(
"minecraft:block.sniffer_egg.plop",
click,
global.mayonnaiseMachineRecipes,
3,
false,
false,
outputCount
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "", quality: 0 });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.mayonnaiseMachineRecipes, 1);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("mayonnaise_machine"),
};
});
@@ -0,0 +1,82 @@
//priority: 100
console.info("[SOCIETY] moonStatue.js loaded");
const statueBuffs = [
"moon_extra_ore",
"moon_geode_roll",
"moon_rope_reveal",
"moon_remains",
"moon_damage",
];
global.handleMoonStatueClick = (click) => {
const { player, server, hand, block, level } = click;
if (!player.isFake() && player.stages.has("mining_mastery")) {
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
let day = global.getDay(level);
if (!player.persistentData.days) player.persistentData.days = {}
let dayData = player.persistentData.days.moonStatueDay;
if (dayData == undefined || global.compareDay(day, dayData, 1)) {
let selectedBuff =
statueBuffs[Math.floor(Math.random() * statueBuffs.length)];
player.tell(
Text.translatable(`block.society.moon_statue.announce`).aqua()
);
player.tell(
Text.translatable(`block.society.moon_statue.${selectedBuff}`).green()
);
player.persistentData.days.moonStatueDay = day;
statueBuffs.forEach((buff) => {
player.stages.remove(buff);
});
player.stages.add(selectedBuff);
server.runCommandSilent(
`playsound create:peculiar_bell_use block @a ${player.x} ${player.y} ${player.z}`
);
level.spawnParticles(
"species:spectre_smoke",
true,
block.x,
block.y + 1.5,
block.z,
0.1 * rnd(1, 2),
0.1 * rnd(1, 2),
0.1 * rnd(1, 2),
1,
0.5
);
} else {
player.tell(
Text.translatable("block.society.moon_statue.already_taken").red()
);
}
}
} else
player.tell(Text.translatable("block.society.moon_statue.no_mastery").red());
};
StartupEvents.registry("block", (event) => {
event
.create("society:moon_statue", "cardinal")
.displayName("Statue of The Moon Gnome")
.defaultCutout()
.soundType("stone")
.hardness(4.5)
.resistance(9.0)
.lightLevel(0.8)
.requiresTool(false)
.model("society:block/kubejs/moon_statue")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable("block.society.moon_statue.description").gray()
);
item.modelJson({
parent: "society:block/kubejs/moon_statue",
});
})
.rightClick((click) => {
global.handleMoonStatueClick(click);
});
});
@@ -0,0 +1,134 @@
//priority: 100
console.info("[SOCIETY] mushroomLog.js loaded");
global.mushroomLogRecipes = new Map([
// Red/brown mushroom
["minecraft:mushroom_stem", { output: ["2x minecraft:brown_mushroom"]}],
["meadow:pine_log", { output: ["2x minecraft:brown_mushroom"]}],
["autumnity:maple_log", { output: ["2x minecraft:brown_mushroom"]}],
["windswept:pine_log", { output: ["2x minecraft:brown_mushroom"]}],
["minecraft:acacia_log", { output: ["2x minecraft:brown_mushroom"]}],
["minecraft:jungle_log", { output: ["2x minecraft:red_mushroom"]}],
["beachparty:palm_log", { output: ["2x minecraft:red_mushroom"]}],
["minecraft:spruce_log", { output: ["2x minecraft:red_mushroom"]}],
["minecraft:cherry_log", { output: ["2x minecraft:red_mushroom"]}],
["quark:blossom_log", { output: ["2x minecraft:red_mushroom"]}],
["minecraft:mangrove_log", { output: ["2x minecraft:red_mushroom" ]}],
// Red colony
["windswept:weathered_pine_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["minecraft:oak_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["vinery:dark_cherry_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["cluttered:crabapple_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["atmospheric:grimwood_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
// Brown colony
["windswept:chestnut_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["minecraft:pale_oak_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["cluttered:poplar_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["atmospheric:aspen_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
["minecraft:dark_oak_log", { output: ["1x farmersdelight:red_mushroom_colony"]}],
// Toadstool
["atmospheric:rosewood_log", { output: ["3x ribbits:toadstool"]}],
["atmospheric:morado_log", { output: ["3x ribbits:toadstool"]}],
["atmospheric:yucca_log", { output: ["3x ribbits:toadstool"]}],
["atmospheric:laurel_log", { output: ["3x ribbits:toadstool"]}],
["vinery:apple_log", { output: ["3x ribbits:toadstool"]}],
["windswept:holly_log", { output: ["3x ribbits:toadstool"]}],
// Bracket
["quark:ancient_log", { output: ["1x verdantvibes:bracket_mushroom"]}],
["atmospheric:kousa_log", { output: ["1x verdantvibes:bracket_mushroom"]}],
["quark:azalea_log", { output: ["1x verdantvibes:bracket_mushroom"]}],
// Shimmering
["atmospheric:watchful_aspen_log", { output: ["1x botania:yellow_mushroom"]}],
["atmospheric:crustose_log", { output: ["1x botania:yellow_mushroom"]}],
["cluttered:flowering_poplar_log", { output: ["1x botania:yellow_mushroom"]}],
["cluttered:flowering_crabapple_log", { output: ["1x botania:pink_mushroom"]}],
// Glow
["cluttered:fluorescent_maple_log", { output: ["3x quark:glow_shroom"]}],
["vintagedelight:magic_vine", { output: ["4x quark:glow_shroom"]}],
// Warped crimson
["minecraft:crimson_stem", { output: ["3x minecraft:crimson_fungus"]}],
["minecraft:warped_stem", { output: ["3x minecraft:warped_fungus"]}],
// Alphacene
["betterarcheology:rotten_log", { output: ["2x species:alphacene_mushroom"]}],
// Cluttershroms
["cluttered:blue_mushroom_cap", { output: ["1x cluttered:blue_roundhead"]}],
["cluttered:blue_mushroom_log", { output: ["1x cluttered:blue_roundhead"]}],
["cluttered:red_mushroom_log", { output: ["1x cluttered:fly_agaric"]}],
["cluttered:red_mushroom_cap", { output: ["1x cluttered:fly_agaric"]}],
["cluttered:sycamore_log", { output: ["1x cluttered:blue_roundhead"]}],
]);
global.dominantMushroomLogBlocks = new Map([
["species:alphacene_mushroom_block", { output: ["2x species:alphacene_mushroom"]}],
["minecraft:birch_log", { output: ["2x verdantvibes:bracket_mushroom"]}],
["cluttered:willow_log", { output: ["4x botania:magenta_mushroom"]}],
["cluttered:flowering_willow_log", { output: ["4x botania:purple_mushroom"],}],
["quark:glow_shroom_stem", { output: ["3x quark:glow_shroom"]}],
["minecraft:brown_mushroom_block", { output: ["2x farmersdelight:brown_mushroom_colony"]}],
["minecraft:red_mushroom_block", { output: ["2x farmersdelight:red_mushroom_colony"]}],
["ribbits:toadstool_stem", { output: ["4x ribbits:toadstool"]}],
["ribbits:brown_toadstool", { output: ["4x ribbits:toadstool"]}],
["ribbits:red_toadstool", { output: ["4x ribbits:toadstool"]}],
])
Array.from(global.dominantMushroomLogBlocks.keys()).forEach((recipe) => {
global.mushroomLogRecipes.set(recipe, global.dominantMushroomLogBlocks.get(recipe));
});
StartupEvents.registry("block", (event) => {
event
.create("society:mushroom_log", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.property(booleanProperty.create("error"))
.soundType("wood")
.defaultCutout()
.box(0, 0, 0, 16, 13, 16)
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable("block.society.mushroom_log.description").gray()
);
item.modelJson({
parent: "society:block/kubejs/mushroom_log/mushroom_log_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
let nbt = click.block.getEntityData();
global.handleBERightClick(
"species:block.alphacene_moss.place",
click,
global.mushroomLogRecipes,
7,
false,
false,
nbt && nbt.data && nbt.data.baseCount ? nbt.data.baseCount : 1,
true
);
global.handleMushroomLogRandomTick(click);
})
.randomTick((tick) => {
global.handleMushroomLogRandomTick(tick);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "", quality: 0 });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.mushroomLogRecipes, 4);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("mushroom_log"),
};
});
@@ -0,0 +1,63 @@
//priority: 100
console.info("[SOCIETY] oilMaker.js loaded");
global.oilMakerRecipes = new Map([
["society:truffle", { output: ["1x society:truffle_oil"] }],
["farm_and_charm:corn", { output: ["1x society:oil"] }],
["atmospheric:yellow_blossoms", { output: ["1x society:oil"] }],
["minecraft:torchflower", { output: ["3x society:oil"] }],
["beachparty:coconut_open", { output: ["1x society:coconut_oil"] }],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:oil_maker", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable("block.society.oil_maker.description").gray()
);
item.modelJson({
parent: "society:block/kubejs/oil_maker/oil_maker_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { block } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
global.handleBERightClick(
"supplementaries:block.jar.place",
click,
global.oilMakerRecipes,
1,
false,
false,
1
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.oilMakerRecipes, 1);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("oil_maker"),
};
});
@@ -0,0 +1,260 @@
//priority: 100
console.info("[SOCIETY] preservesJar.js loaded");
const roeFish = [
{ item: "aquaculture:atlantic_herring" },
{ item: "minecraft:pufferfish" },
{ item: "aquaculture:minnow" },
{ item: "aquaculture:bluegill" },
{ item: "aquaculture:perch" },
{ item: "minecraft:salmon" },
{ item: "aquaculture:blackfish" },
{ item: "aquaculture:brown_trout" },
{ item: "aquaculture:carp" },
{ item: "aquaculture:piranha" },
{ item: "aquaculture:smallmouth_bass" },
{ item: "minecraft:cod" },
{ item: "aquaculture:pollock" },
{ item: "aquaculture:jellyfish" },
{ item: "aquaculture:rainbow_trout" },
{ item: "aquaculture:pink_salmon" },
{ item: "minecraft:tropical_fish" },
{ item: "aquaculture:red_grouper" },
{ item: "aquaculture:gar" },
{ item: "aquaculture:muskellunge" },
{ item: "aquaculture:synodontis" },
{ item: "aquaculture:tambaqui" },
{ item: "aquaculture:atlantic_cod" },
{ item: "aquaculture:boulti" },
{ item: "aquaculture:leech" },
{ item: "aquaculture:catfish" },
{ item: "aquaculture:tuna" },
{ item: "aquaculture:bayad" },
{ item: "aquaculture:arapaima" },
{ item: "aquaculture:atlantic_halibut" },
{ item: "aquaculture:starshell_turtle" },
{ item: "aquaculture:brown_shrooma" },
{ item: "aquaculture:red_shrooma" },
{ item: "aquaculture:arrau_turtle" },
{ item: "aquaculture:capitaine" },
{ item: "aquaculture:box_turtle" },
{ item: "aquaculture:pacific_halibut" },
{ item: "aquaculture:goldfish" },
{ item: "crabbersdelight:shrimp" },
{ item: "crabbersdelight:clawster" },
{ item: "crabbersdelight:crab" },
{ item: "crabbersdelight:clam" },
{ item: "netherdepthsupgrade:searing_cod" },
{ item: "netherdepthsupgrade:blazefish" },
{ item: "netherdepthsupgrade:lava_pufferfish" },
{ item: "netherdepthsupgrade:obsidianfish" },
{ item: "netherdepthsupgrade:bonefish" },
{ item: "netherdepthsupgrade:wither_bonefish" },
{ item: "netherdepthsupgrade:magmacubefish" },
{ item: "netherdepthsupgrade:glowdine" },
{ item: "netherdepthsupgrade:soulsucker" },
{ item: "netherdepthsupgrade:fortress_grouper" },
{ item: "netherdepthsupgrade:eyeball_fish" },
{ item: "society:neptuna" },
{ item: "unusualfishmod:raw_sneep_snorp" },
{ item: "unusualfishmod:raw_picklefish" },
{ item: "unusualfishmod:raw_forkfish" },
{ item: "unusualfishmod:raw_beaked_herring" },
{ item: "unusualfishmod:raw_sailor_barb" },
{ item: "unusualfishmod:raw_demon_herring" },
{ item: "unusualfishmod:raw_triple_twirl_pleco" },
{ item: "unusualfishmod:raw_copperflame_anthias" },
{ item: "unusualfishmod:raw_drooping_gourami" },
{ item: "unusualfishmod:raw_duality_damselfish" },
{ item: "unusualfishmod:raw_blind_sailfin" },
{ item: "unusualfishmod:raw_circus_fish" },
{ item: "unusualfishmod:raw_snowflake" },
{ item: "unusualfishmod:raw_aero_mono" },
{ item: "unusualfishmod:raw_hatchetfish" },
{ item: "unusualfishmod:raw_spindlefish" },
{ item: "unusualfishmod:raw_bark_angelfish" },
{ item: "unusualfishmod:raw_amber_goby" },
{ item: "unusualfishmod:raw_eyelash" },
{ item: "crittersandcompanions:koi_fish" },
];
global.preservesJarRecipes = new Map([
["vintagedelight:gearo_berry", { output: ["vintagedelight:gearo_berry_mason_jar"] }],
["vintagedelight:peanut", { output: ["vintagedelight:nut_mash_mason_jar"] }],
["vintagedelight:cucumber", { output: ["vintagedelight:relish_mason_jar"] }],
["vintagedelight:ghost_pepper", { output: ["vintagedelight:pepper_jam_mason_jar"] }],
["minecraft:glow_berries", { output: ["vintagedelight:glow_berry_mason_jar"] }],
["minecraft:sweet_berries", { output: ["vintagedelight:sweet_berry_mason_jar"] }],
["minecraft:apple", { output: ["vintagedelight:apple_sauce_mason_jar"] }],
["society:ancient_fruit", { output: ["society:ancient_fruit_preserves"] }],
["pamhc2trees:dragonfruititem", { output: ["society:dragonfruit_preserves"] }],
["pamhc2trees:starfruititem", { output: ["society:starfruit_preserves"] }],
["atmospheric:orange", { output: ["society:orange_preserves"] }],
["pamhc2trees:bananaitem", { output: ["society:banana_preserves"] }],
["pamhc2trees:mangoitem", { output: ["society:mango_preserves"] }],
["pamhc2trees:lycheeitem", { output: ["society:lychee_preserves"] }],
["pamhc2trees:peachitem", { output: ["society:peach_preserves"] }],
["vinery:cherry", { output: ["society:cherry_preserves"] }],
["farm_and_charm:strawberry", { output: ["society:strawberry_preserves"] }],
["pamhc2trees:plumitem", { output: ["society:plum_preserves"] }],
["pamhc2trees:pawpawitem", { output: ["society:pawpaw_preserves"] }],
["minecraft:melon_slice", { output: ["society:melon_preserves"] }],
["farmersdelight:pumpkin_slice", { output: ["society:pumpkin_preserves"] }],
["vinery:red_grape", { output: ["society:red_grape_preserves"] }],
["vinery:jungle_grapes_red", { output: ["society:red_grape_preserves"] }],
["vinery:savanna_grapes_red", { output: ["society:red_grape_preserves"] }],
["vinery:taiga_grapes_red", { output: ["society:red_grape_preserves"] }],
["vinery:white_grape", { output: ["society:white_grape_preserves"] }],
["vinery:jungle_grapes_white", { output: ["society:white_grape_preserves"] }],
["vinery:savanna_grapes_white", { output: ["society:white_grape_preserves"] }],
["vinery:taiga_grapes_white", { output: ["society:white_grape_preserves"] }],
["society:blueberry", { output: ["society:blueberry_preserves"] }],
["atmospheric:passion_fruit", { output: ["society:passion_fruit_preserves"] }],
["atmospheric:currant", { output: ["society:currant_preserves"] }],
["atmospheric:yucca_fruit", { output: ["society:yucca_preserves"] }],
["atmospheric:aloe_leaves", { output: ["society:aloe_preserves"] }],
["minecraft:carrot", { output: ["society:carrot_preserves"] }],
["minecraft:potato", { output: ["society:potato_preserves"] }],
["minecraft:beetroot", { output: ["society:beetroot_preserves"] }],
["farm_and_charm:corn", { output: ["society:corn_preserves"] }],
["farmersdelight:tomato", { output: ["society:tomato_preserves"] }],
["pamhc2trees:hazelnutitem", { output: ["society:hazelnut_mash"] }],
["autumnity:foul_berries", { output: ["society:foul_berries_preserves"] }],
["minecraft:chorus_fruit", { output: ["society:chorus_fruit_preserves"] }],
["pamhc2trees:lemonitem", { output: ["society:lemon_preserves"] }],
["farm_and_charm:onion", { output: ["society:onion_preserves"] }],
["society:eggplant", { output: ["society:eggplant_preserves"] }],
["veggiesdelight:cauliflower", { output: ["society:cauliflower_preserves"] }],
["veggiesdelight:bellpepper", { output: ["society:bell_pepper_preserves"] }],
["veggiesdelight:sweet_potato", { output: ["society:sweet_potato_preserves"] }],
["veggiesdelight:garlic", { output: ["society:garlic_preserves"] }],
["snowyspirit:ginger", { output: ["society:ginger_preserves"] }],
["society:salmonberry", { output: ["society:salmonberry_preserves"] }],
["society:boysenberry", { output: ["society:boysenberry_preserves"] }],
["society:cranberry", { output: ["society:cranberry_preserves"] }],
["society:crystalberry", { output: ["society:crystalberry_preserves"] }],
["windswept:wild_berries", { output: ["society:wild_berries_preserves"] }],
["veggiesdelight:zucchini", { output: ["society:zucchini_preserves"] }],
["veggiesdelight:turnip", { output: ["society:turnip_preserves"] }],
["veggiesdelight:broccoli", { output: ["society:broccoli_preserves"] }],
["society:mana_fruit", { output: ["society:mana_fruit_preserves"] }],
["society:sparkpod", { output: ["society:sparkpod_preserves"] }],
["society:mossberry", { output: ["society:mossberry_preserves"] }],
]);
roeFish.forEach((fish) => {
const splitFish = fish.item.split(":");
let fishId = splitFish[1];
if (!fishId.includes("_barrel") && !fishId.includes("_roe")) {
if (fishId.includes("raw_")) {
if (fishId === "raw_snowflake") fishId = "frosty_fin";
else fishId = fishId.substring(4, fishId.length);
}
global.preservesJarRecipes.set(`society:${fishId}_roe`, {
output: [`society:aged_${fishId}_roe`],
});
}
});
StartupEvents.registry("block", (event) => {
event
.create("society:preserves_jar", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(2, 0, 2, 14, 15, 14)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.preserves_jar.description").gray());
item.modelJson({
parent: "society:block/kubejs/preserves_jar",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND" && !upgraded && item == "society:stone_hand") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 4),
0.2 * rnd(1, 4),
0.2 * rnd(1, 4),
3,
0.01
);
block.set(block.id, {
facing: block.properties.get("facing"),
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
global.handleBERightClick(
"minecraft:block.wood.place",
click,
global.preservesJarRecipes,
upgraded ? 3 : 5,
true,
true
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.preservesJarRecipes, 3);
});
}).blockstateJson = {
multipart: [
{
when: { upgraded: false },
apply: { model: "society:block/kubejs/preserves_jar_base" },
},
{
when: { working: true },
apply: { model: "society:block/kubejs/preserves_jar_lid" },
},
{
when: { mature: true, working: false },
apply: { model: "society:block/kubejs/preserves_jar_lid_done" },
},
{
when: { upgraded: true },
apply: { model: "society:block/kubejs/preserves_jar_base_upgraded" },
},
{
when: { working: true, upgraded: false },
apply: { model: "society:block/kubejs/preserves_jar_base" },
},
{
when: { mature: true, upgraded: false },
apply: { model: "society:block/kubejs/preserves_jar_base" },
},
{
when: { mature: true },
apply: { model: "society:block/kubejs/machine_done" },
},
],
};
});
@@ -0,0 +1,504 @@
//priority: 100
console.info("[SOCIETY] preservesJar.js loaded");
global.prizeMachineRewards = [
{
hint: "seedy",
possibleOutputs: [
"8x minecraft:torchflower_seeds",
"8x minecraft:pitcher_pod",
"8x herbalbrews:tea_blossom",
"8x herbalbrews:coffee_beans",
"8x etcetera:cotton_seeds",
],
},
{
hint: "writhing and squirming",
possibleOutputs: ["8x aquaculture:minnow", "8x aquaculture:worm"],
},
{
hint: "upgradable",
possibleOutputs: [
"sophisticatedbackpacks:upgrade_base",
"sophisticatedstorage:upgrade_base",
],
},
{
hint: "bearing red fruits",
possibleOutputs: [
"pamhc2trees:cherry_sapling",
"pamhc2trees:apple_sapling",
],
},
{
hint: "crabs love to chow on",
possibleOutputs: [
"16x crabbersdelight:crab_trap_bait",
"16x crabbersdelight:deluxe_crab_trap_bait",
],
},
{
hint: "for decorating",
possibleOutputs: ["2x society:furniture_box", "simplehats:hatbag_epic"],
},
{
hint: "soothing and refreshing",
possibleOutputs: ["2x herbalbrews:oolong_tea"],
},
{
hint: "fancy to rest on",
possibleOutputs: [
"tanukidecor:antique_bed",
"tanukidecor:regal_bed",
"tanukidecor:sweets_bed",
"tanukidecor:gorgeous_bed",
"tanukidecor:cabana_bed",
"tanukidecor:wooden_block_bed",
"tanukidecor:green_bed",
"tanukidecor:minimalist_bed",
"tanukidecor:brown_mushroom_bed",
"tanukidecor:red_mushroom_bed",
"tanukidecor:egyptian_bed",
"tanukidecor:blue_bed",
],
},
{
hint: "useful for farm animals",
possibleOutputs: [
"2x society:mayonnaise_machine",
"2x society:loom",
"128x society:animal_feed",
],
},
{
hint: "bearing juicy round fruits",
possibleOutputs: ["pamhc2trees:plum_sapling", "pamhc2trees:peach_sapling"],
},
{
hint: "that smells like sulfur",
possibleOutputs: [
"16x supplementaries:bomb",
"16x supplementaries:bomb_blue",
"16x betterarcheology:bomb",
"16x minecraft:tnt",
"society:fish_smoker",
],
},
{
hint: "weirdly resembling an egg",
possibleOutputs: ["etcetera:eggple", "etcetera:golden_eggple"],
},
{
hint: "capable of handling liquids",
possibleOutputs: [
"2x vintagedelight:fermenting_jar",
"2x society:tapper",
"2x vinery:fermentation_barrel",
],
},
{
hint: "rare and rocky",
possibleOutputs: ["4x society:omni_geode"],
},
{
hint: "large and wooden",
possibleOutputs: ["2x brewery:barrel_main"],
},
{
hint: "good for reading",
possibleOutputs: [
"society:intro_to_algorithms",
"society:no_name_for_the_sheep",
"society:paradise_crop",
"society:slime_contain_protect",
"society:slouching_towards_artistry",
"society:debt_caverns",
"society:phenomenology_of_treasure",
"society:frogs_bounty_bazaar",
"society:hitting_hard_and_soft",
"society:paradise_crop",
"society:intro_to_algorithms",
"society:hitting_hard_and_soft",
"society:first_aid_guide",
"society:canadian_and_famous",
"society:bluegill_meridian",
"society:brine_and_punishment",
"society:animal_fancy",
"society:first_aid_guide",
"society:canadian_and_famous",
"society:bluegill_meridian",
"society:brine_and_punishment",
"society:banana_karenina",
"society:animal_fancy",
],
},
{
hint: "useful for mechanics",
possibleOutputs: [
"32x create:andesite_alloy",
"8x create:brass_ingot",
"4x create:sturdy_sheet",
"create:precision_mechanism",
"create:brass_hand",
"society:battery",
],
},
{
hint: "decorative",
possibleOutputs: ["minecraft:painting", "simplehats:hatbag_epic"],
},
{
hint: "with jaded fruit",
possibleOutputs: ["pamhc2trees:pawpaw_sapling"],
},
{
hint: "soothing and refreshing... Again",
possibleOutputs: ["2x herbalbrews:oolong_tea"],
},
{
hint: "rare, rocky, and plentiful",
possibleOutputs: ["8x society:omni_geode"],
},
{
hint: "advanced for the farm",
possibleOutputs: ["society:preserves_jar", "society:crystalarium"],
},
{
hint: "shiny",
possibleOutputs: ["3x quark:diamond_heart"],
},
{
hint: "seasonal to wear",
possibleOutputs: [
"simplehats:hatbag_halloween",
"simplehats:hatbag_easter",
"simplehats:hatbag_summer",
"simplehats:hatbag_festive",
],
},
{
hint: "ancient from the soil",
possibleOutputs: [
"society:ancient_fruit_seed",
"society:ancient_fruit",
"society:ancient_fruit",
],
},
{
hint: "extremely valuable",
possibleOutputs: [
"society:dragon_mayonnaise",
"society:prismatic_shard",
"society:golden_mayonnaise",
"society:magic_rock_candy",
],
},
{
hint: "only enjoyed by those of age",
possibleOutputs: ["society:aging_cask", "tanukidecor:slot_machine"],
},
{
hint: "with jaded fruit... Again",
possibleOutputs: ["pamhc2trees:hazelnut_sapling"],
},
{
hint: "tickety?",
possibleOutputs: ["3x splendid_slimes:slime_ticket"],
},
{
hint: "spicy",
possibleOutputs: [
"16x vintagedelight:stuffed_burrito",
"16x vintagedelight:ghostly_chili",
"32x vintagedelight:ghost_pepper",
"16x vintagedelight:pickled_pepper",
"8x vintagedelight:pepper_jam_mason_jar",
],
},
{
hint: "about to hatch",
possibleOutputs: [
"species:cruncher_egg",
"species:petrified_egg",
"species:springling_egg",
"species:wraptor_egg",
"minecraft:sniffer_egg",
],
},
{
hint: "filled with plushies",
possibleOutputs: ["whimsy_deco:gatcha_machine"],
},
{
hint: "beachy",
possibleOutputs: [
"beachparty:hammock",
"beachparty:lounge_chair",
"beachparty:tiki_chair",
"beachparty:chair",
"beachparty:table",
"beachparty:beach_chair",
"beachparty:deck_chair"
],
},
{
hint: "passionate",
possibleOutputs: ["pamhc2trees:passionfruit_sapling"],
},
{
hint: "fish get excited for",
possibleOutputs: [
"society:deluxe_worm_farm",
"society:fish_smoker",
"society:fish_pond",
"society:sea_biscut",
],
},
{
hint: "sticky, from a tree",
possibleOutputs: [
"4x society:maple_syrup",
"4x society:pine_tar",
"4x society:oak_resin",
],
},
{
hint: "wintery",
possibleOutputs: [
"64x snowyspirit:candy_cane",
"pamhc2trees:cinnamon_sapling",
"8x society:frozen_geode",
"8x society:frozen_tear",
],
},
{
hint: "relating to relics",
possibleOutputs: [
"society:relic_trove",
"64x relics:relic_experience_bottle",
],
},
{
hint: "fossilized",
possibleOutputs: [
"betterarcheology:creeper_fossil_head",
"betterarcheology:creeper_fossil_body",
"betterarcheology:villager_fossil_body",
"betterarcheology:villager_fossil_head",
"betterarcheology:chicken_fossil_body",
"betterarcheology:chicken_fossil_head",
"betterarcheology:ocelot_fossil_body",
"betterarcheology:ocelot_fossil_head",
"betterarcheology:wolf_fossil_body",
"betterarcheology:wolf_fossil_head",
"betterarcheology:sheep_fossil_body",
"betterarcheology:sheep_fossil_head",
"betterarcheology:guardian_fossil_head",
"betterarcheology:guardian_fossil_body",
],
},
{
hint: "something not of this world.",
possibleOutputs: ["1x minecraft:eye_armor_trim_smithing_template"],
},
{
hint: "soothing and refreshing... Again",
possibleOutputs: ["2x herbalbrews:oolong_tea"],
},
{
hint: "artly and factual",
possibleOutputs: [
"society:artifact_trove",
"betterarcheology:unidentified_artifact",
],
},
{
hint: "seedy that's hard to find",
possibleOutputs: [
"8x herbalbrews:tea_blossom",
"8x herbalbrews:coffee_beans",
"8x nethervinery:crimson_grape_seeds",
"8x vinery:jungle_grape_seeds_red",
"8x vinery:taiga_grape_seeds_red",
"8x vinery:savanna_grape_seeds_red",
"8x nethervinery:warped_grape_seeds",
"8x vinery:jungle_grape_seeds_white",
"8x vinery:taiga_grape_seeds_white",
"8x vinery:savanna_grape_seeds_white",
],
},
{
hint: "that upgrades machines",
possibleOutputs: [
"society:stone_hand",
"society:frosted_tip",
"society:tiny_gnome",
"society:gray_anatomy",
"society:broken_clock",
"society:black_opal",
"society:sea_biscut",
"society:ancient_cog",
"society:ancient_roe",
"society:infinity_worm",
"society:cordycep",
"society:pink_matter",
"society:enkephalin",
],
},
{
hint: "good for reading... again?",
possibleOutputs: [
"society:intro_to_algorithms",
"society:no_name_for_the_sheep",
"society:paradise_crop",
"society:slime_contain_protect",
"society:slouching_towards_artistry",
"society:debt_caverns",
"society:phenomenology_of_treasure",
"society:frogs_bounty_bazaar",
"society:hitting_hard_and_soft",
"society:paradise_crop",
"society:intro_to_algorithms",
"society:hitting_hard_and_soft",
"society:first_aid_guide",
"society:canadian_and_famous",
"society:bluegill_meridian",
"society:brine_and_punishment",
"society:animal_fancy",
"society:first_aid_guide",
"society:canadian_and_famous",
"society:bluegill_meridian",
"society:brine_and_punishment",
"society:banana_karenina",
"society:animal_fancy",
],
},
];
StartupEvents.registry("block", (event) => {
event
.create("society:prize_machine", "cardinal")
.property(
integerProperty.create("prize", 0, global.prizeMachineRewards.length)
)
.box(0, 0, 6, 16, 28, 16)
.defaultCutout()
.soundType("copper")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.prize_machine.description").gray());
item.modelJson({
parent: "society:block/kubejs/prize_machine",
});
})
.defaultState((state) => {
state.set(
integerProperty.create("prize", 0, global.prizeMachineRewards.length),
0
);
})
.placementState((state) => {
state.set(
integerProperty.create("prize", 0, global.prizeMachineRewards.length),
0
);
})
.rightClick((click) => {
const { item, block, hand, player, level, server } = click;
const { x, y, z } = block;
let nbt = block.getEntityData();
const prizeNumber = nbt.data.prize;
const prizeOutput =
global.prizeMachineRewards[Number(prizeNumber)].possibleOutputs;
const prizeHint = global.prizeMachineRewards[Number(prizeNumber)].hint;
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND" && item === "society:prize_ticket") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"minecraft:happy_villager",
true,
x + 0.5,
y + 0.5,
z + 0.5,
0.1 * rnd(1, 4),
0.1 * rnd(1, 4),
0.1 * rnd(1, 4),
10,
0.1
);
const prize = prizeOutput[rnd(0, prizeOutput.length - 1)];
block.popItemFromFace(prize, block.properties.get("facing"));
if (player.stages.has("frogs_bounty_bazaar")) {
block.popItemFromFace(prize, block.properties.get("facing"));
}
nbt.merge({
data: {
prize:
Number(prizeNumber) === global.prizeMachineRewards.length - 1
? 8
: (nbt.data.prize += 1),
},
});
global.setBlockEntityData(block, nbt)
click.server.runCommandSilent(
`playsound stardew_fishing:complete block @a ${player.x} ${player.y} ${player.z}`
);
global.giveExperience(server, player, "farming", 100);
global.giveExperience(server, player, "husbandry", 100);
global.giveExperience(server, player, "mining", 100);
global.giveExperience(server, player, "adventuring", 100);
global.giveExperience(server, player, "fishing", 100);
} else {
player.tell(
Text.translatable(
"block.society.prize_machine.next",
global.translatableWithFallback(
`society.prize_machine.hint.${prizeNumber}`,
`Something §6${prizeHint}§r...`
)
).gray()
);
}
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ prize: 0 });
}).blockstateJson = {
multipart: [
{
apply: { model: "society:block/kubejs/prize_machine_particle" },
},
{
when: { facing: "north" },
apply: {
model: "society:block/kubejs/prize_machine",
y: 0,
uvlock: false,
},
},
{
when: { facing: "east" },
apply: {
model: "society:block/kubejs/prize_machine",
y: 90,
uvlock: false,
},
},
{
when: { facing: "south" },
apply: {
model: "society:block/kubejs/prize_machine",
y: 180,
uvlock: false,
},
},
{
when: { facing: "west" },
apply: {
model: "society:block/kubejs/prize_machine",
y: -90,
uvlock: false,
},
},
],
};
});
@@ -0,0 +1,144 @@
//priority: 100
console.info("[SOCIETY] recyclingMachine.js loaded");
global.recyclingMachineRecipes = new Map([
["aquaculture:tin_can", { output: ["3x numismatics:cog"] }],
["aquaculture:driftwood", { output: ["1x meadow:fire_log"] }],
["furniture:trash_bag", { output: ["4x society:bouquet_bag"] }],
["society:fire_quartz", { output: ["24x minecraft:quartz"] }],
["betterarcheology:artifact_shards", { output: ["6x society:sparkstone"] }],
["zetter:canvas", { output: ["4x society:canvas"], multExempt: true }],
[
"aquaculture:fish_bones",
{ output: ["dew_drop_farmland_growth:strong_fertilizer"] },
],
[
"aquaculture:algae",
{ output: ["dew_drop_farmland_growth:high_quality_fertilizer"] },
],
["simplehats:hatbag_common", { output: ["1x society:canvas"] }],
["simplehats:hatbag_uncommon", { output: ["2x society:canvas"] }],
["simplehats:hatbag_rare", { output: ["3x society:canvas"] }],
["simplehats:hatbag_epic", { output: ["4x society:canvas"] }],
["simplehats:hatbag_easter", { output: ["5x society:canvas"] }],
["simplehats:hatbag_summer", { output: ["5x society:canvas"] }],
["simplehats:hatbag_halloween", { output: ["5x society:canvas"] }],
["simplehats:hatbag_festive", { output: ["5x society:canvas"] }],
["atmospheric:carmine_husk", { output: ["2x ribbits:toadstool"] }],
["society:legendary_ink", { output: ["4x supplementaries:antique_ink"] }],
[
"rehooked:red_hook",
{ output: ["rehooked:diamond_hook", "society:prismatic_shard"], multExempt: true },
],
["rehooked:blaze_hook", { output: ["rehooked:diamond_hook"], multExempt: true }],
[
"atmospheric:grimwood_leaves",
{ output: ["4x atmospheric:grimwood_sapling"] },
],
["society:butterfly_amber", { output: ["4x society:sparkstone"] }],
["society:moth_pollen", { output: ["4x vintagedelight:organic_mash"] }],
["society:maple_syrup", { output: ["4x vintagedelight:organic_mash"] }],
["society:ruby", { output: ["4x quark:red_corundum"] }],
["society:topaz", { output: ["4x quark:orange_corundum"] }],
["society:fluorapatite", { output: ["4x quark:violet_corundum"] }],
["society:geminite", { output: ["4x quark:green_corundum"] }],
["society:kyanite", { output: ["4x quark:indigo_corundum"] }],
["society:opal", { output: ["4x quark:white_corundum"] }],
["society:lemon_stone", { output: ["4x quark:yellow_corundum"] }],
["society:ghost_crystal", { output: ["4x quark:blue_corundum"] }],
["society:bixbyite", { output: ["4x quark:black_corundum"] }],
[
"society:enriched_bone_meal",
{ output: ["1x vintagedelight:organic_mash"] },
],
["minecraft:raw_iron", { output: ["2x create:crushed_raw_iron"] }],
["minecraft:raw_copper", { output: ["2x create:crushed_raw_copper"] }],
["minecraft:raw_gold", { output: ["2x create:crushed_raw_gold"] }],
["create:raw_zinc", { output: ["2x create:crushed_raw_zinc"] }],
["oreganized:raw_lead", { output: ["2x create:crushed_raw_lead"] }],
["oreganized:raw_silver", { output: ["2x create:crushed_raw_silver"] }],
["etcetera:raw_bismuth", { output: ["2x create:crushed_raw_bismuth"] }],
["society:sparkpod", { output: ["6x society:sparkstone"] }],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:recycling_machine", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(1, 0, 3, 15, 16, 13)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable("block.society.recycling_machine.description").gray()
);
item.modelJson({
parent: "society:block/kubejs/recycling_machine/recycling_machine_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const quality = block.properties.get("quality");
const facing = block.properties.get("facing");
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:recycled_core") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
quality: quality,
});
}
}
global.handleBERightClick(
"twigs:block.basalt_bricks.fall",
click,
global.recyclingMachineRecipes,
1,
false,
false,
upgraded ? 2 : 1
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.recyclingMachineRecipes, 1);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("recycling_machine"),
};
});
@@ -0,0 +1,165 @@
//priority: 100
console.info("[SOCIETY] seedMaker.js loaded");
global.seedMakerRecipes = new Map([
["farm_and_charm:corn", { output: ["6x farm_and_charm:kernels"] }],
["minecraft:wheat", { output: ["6x minecraft:wheat_seeds"] }],
["vinery:jungle_grapes_red", { output: ["6x vinery:jungle_grape_seeds_red"] }],
["vinery:jungle_grapes_white", { output: ["6x vinery:jungle_grape_seeds_white"] }],
["herbalbrews:green_tea_leaf", { output: ["6x herbalbrews:tea_blossom"] }],
["snowyspirit:ginger", { output: ["6x snowyspirit:ginger_flower"] }],
["minecraft:pumpkin", { output: ["6x minecraft:pumpkin_seeds"] }],
["minecraft:melon_slice", { output: ["6x minecraft:melon_seeds"] }],
["minecraft:beetroot", { output: ["6x minecraft:beetroot_seeds"] }],
["brewery:hops", { output: ["6x brewery:hop_trellis_seed"] }],
["farm_and_charm:lettuce", { output: ["6x farm_and_charm:lettuce_seeds"] }],
["supplementaries:flax", { output: ["6x supplementaries:flax_seeds"] }],
["society:eggplant", { output: ["6x society:eggplant_seed"] }],
["farm_and_charm:strawberry", { output: ["6x farm_and_charm:strawberry_seed"] }],
["farm_and_charm:oat", { output: ["6x farm_and_charm:oat_seeds"] }],
["farm_and_charm:barley", { output: ["6x farm_and_charm:barley_seeds"] }],
["nethervinery:crimson_grape", { output: ["6x nethervinery:crimson_grape_seeds"] }],
["nethervinery:warped_grape", { output: ["6x nethervinery:warped_grape_seeds"] }],
["vinery:red_grape", { output: ["6x vinery:red_grape_seeds"] }],
["vinery:white_grape", { output: ["6x vinery:white_grape_seeds"] }],
["vinery:savanna_grapes_red", { output: ["6x vinery:savanna_grape_seeds_red"] }],
["vinery:savanna_grapes_white", { output: ["6x vinery:savanna_grape_seeds_white"] }],
["vinery:taiga_grapes_red", { output: ["6x vinery:taiga_grape_seeds_red"] }],
["vinery:taiga_grapes_white", { output: ["6x vinery:taiga_grape_seeds_white"] }],
["farmersdelight:cabbage", { output: ["6x farmersdelight:cabbage_seeds"] }],
["vintagedelight:cucumber", { output: ["6x vintagedelight:cucumber_seeds"] }],
["vintagedelight:ghost_pepper", { output: ["6x vintagedelight:ghost_pepper_seeds"] }],
["society:ancient_fruit", { output: ["1x society:ancient_fruit_seed"] }],
["farmersdelight:tomato", { output: ["6x farmersdelight:tomato_seeds"] }],
["etcetera:cotton_flower", { output: ["6x etcetera:cotton_seeds"] }],
["society:tubabacco_leaf", { output: ["6x society:tubabacco_leaf_seed"] }],
["society:blueberry", { output: ["6x society:blueberry_seed"] }],
["minecraft:pitcher_plant", { output: ["6x minecraft:pitcher_pod"] }],
["minecraft:torchflower", { output: ["6x minecraft:torchflower_seeds"] }],
["veggiesdelight:bellpepper", { output: ["6x veggiesdelight:bellpepper_seeds"] }],
["veggiesdelight:cauliflower", { output: ["6x veggiesdelight:cauliflower_seeds"] }],
["veggiesdelight:garlic", { output: ["6x veggiesdelight:garlic_seed"] }],
["botania:green_mystical_flower", { output: ["6x botania_seeds:green_mystical_flower_seed"] }],
["botania:cyan_mystical_flower", { output: ["6x botania_seeds:cyan_mystical_flower_seed"] }],
[
"botania:light_blue_mystical_flower",
{ output: ["6x botania_seeds:light_blue_mystical_flower_seed"] },
],
["botania:blue_mystical_flower", { output: ["6x botania_seeds:blue_mystical_flower_seed"] }],
["botania:purple_mystical_flower", { output: ["6x botania_seeds:purple_mystical_flower_seed"] }],
[
"botania:magenta_mystical_flower",
{ output: ["6x botania_seeds:magenta_mystical_flower_seed"] },
],
["botania:pink_mystical_flower", { output: ["6x botania_seeds:pink_mystical_flower_seed"] }],
["botania:white_mystical_flower", { output: ["6x botania_seeds:white_mystical_flower_seed"] }],
[
"botania:light_gray_mystical_flower",
{ output: ["6x botania_seeds:light_gray_mystical_flower_seed"] },
],
["botania:gray_mystical_flower", { output: ["6x botania_seeds:gray_mystical_flower_seed"] }],
["botania:black_mystical_flower", { output: ["6x botania_seeds:black_mystical_flower_seed"] }],
["botania:brown_mystical_flower", { output: ["6x botania_seeds:brown_mystical_flower_seed"] }],
["botania:red_mystical_flower", { output: ["6x botania_seeds:red_mystical_flower_seed"] }],
["botania:orange_mystical_flower", { output: ["6x botania_seeds:orange_mystical_flower_seed"] }],
["botania:yellow_mystical_flower", { output: ["6x botania_seeds:yellow_mystical_flower_seed"] }],
["botania:lime_mystical_flower", { output: ["6x botania_seeds:lime_mystical_flower_seed"] }],
["farmersdelight:rice_panicle", { output: ["6x farmersdelight:rice"] }],
["minecraft:potato", { output: ["6x society:potato_seed"] }],
["minecraft:carrot", { output: ["6x society:carrot_seed"] }],
["farm_and_charm:onion", { output: ["6x society:onion_seed"] }],
["vintagedelight:peanut", { output: ["6x society:peanut_seed"] }],
["veggiesdelight:sweet_potato", { output: ["6x society:sweet_potato_seed"] }],
["mysticaloaktree:wise_oak", { output: ["1x botania:overgrowth_seed"] }],
["atmospheric:currant", { output: ["6x atmospheric:currant_seedling"] }],
["atmospheric:aloe_leaves", { output: ["6x atmospheric:aloe_kernels"] }],
["veggiesdelight:turnip", { output: ["6x veggiesdelight:turnip_seeds"] }],
["veggiesdelight:broccoli", { output: ["6x veggiesdelight:broccoli_seeds"] }],
["veggiesdelight:zucchini", { output: ["6x veggiesdelight:zucchini_seeds"] }],
["society:cranberry", { output: ["6x society:cranberry_seed"] }],
["society:sparkpod", { output: ["16x society:sparkstone"] }],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:seed_maker", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(2, 0, 2, 14, 19, 14)
.defaultCutout()
.soundType("copper")
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.seed_maker.description").gray());
item.tooltip(Text.translatable("society.working_block_entity.preserve_quality").green());
item.modelJson({
parent: "society:block/kubejs/seed_maker/seed_maker_off",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
const facing = block.properties.get("facing").toLowerCase();
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:ancient_cog") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
facing: facing,
type: block.properties.get("type"),
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
}
if (upgraded && block.properties.get("mature") === "true" && rnd5()) {
block.popItemFromFace("society:ancient_fruit_seed", facing);
}
global.handleBERightClick(
"unusualfishmod:crab_scuttling",
click,
global.seedMakerRecipes,
3,
true
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "", quality: 0 });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.seedMakerRecipes, 1);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("seed_maker"),
};
});
@@ -0,0 +1,165 @@
console.info("[SOCIETY] sparkstoneRecycler.js loaded");
const MANA_PER_RECYCLE = 5000;
const RECYCLER_MAX_MANA = MANA_PER_RECYCLE * 50;
global.checkSparkstoneRecyclers = (level, block) => {
const { x, y, z } = block;
const offsetsToCheck = [
{ x: 1, y: 0, z: 0 },
{ x: 0, y: 0, z: 1 },
{ x: -1, y: 0, z: 0 },
{ x: 0, y: 0, z: -1 },
{ x: 0, y: 1, z: 0 },
{ x: 0, y: -1, z: 0 },
];
let recycled = false;
let scannedBlock;
let mana;
offsetsToCheck.forEach((offset) => {
if (!recycled) {
scannedBlock = level.getBlock(
new BlockPos(block.x + offset.x, block.y + offset.y, block.z + offset.z)
);
if ("society:sparkstone_recycler".equals(scannedBlock.id)) {
mana = scannedBlock.getEntity().persistentData.getInt("mana");
if (mana >= MANA_PER_RECYCLE && rnd10()) {
scannedBlock.getEntity().persistentData.putInt("mana", mana - MANA_PER_AGE);
recycled = true;
level.server.runCommandSilent(`playsound botania:starcaller block @a ${x} ${y} ${z}`);
level.spawnParticles(
"ribbits:spell",
true,
scannedBlock.x,
scannedBlock.y + 0.5,
scannedBlock.z,
0.1 * rnd(1, 3),
0.1 * rnd(1, 3),
0.1 * rnd(1, 3),
10,
0.01
);
}
}
}
});
return recycled;
};
global.sparkstoneRecyclerTick = (entity) => {
const { block } = entity;
let mana = entity.persistentData.getInt("mana");
let newProperties = entity.level.getBlock(block.getPos()).getProperties();
if (mana >= MANA_PER_RECYCLE) newProperties.powered = true;
else newProperties.powered = false;
block.set(block.id, newProperties);
};
StartupEvents.registry("block", (event) => {
event
.create("society:sparkstone_recycler")
.soundType("copper")
.box(4, 0, 4, 12, 16, 12)
.defaultCutout()
.property(BlockProperties.FACING)
.property(booleanProperty.create("powered"))
.defaultState((state) => {
state
.set(BlockProperties.FACING, "up")
.set(booleanProperty.create("powered"), false)
.set(BlockProperties.WATERLOGGED, false);
})
.placementState((state) => {
state
.set(BlockProperties.FACING, state.clickedFace)
.set(booleanProperty.create("powered"), false)
.set(BlockProperties.WATERLOGGED, false);
})
.waterlogged()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.sparkstone_recycler.description").gray());
item.tooltip(Text.translatable("society.working_block_entity.need_mana").aqua());
item.tooltip(Text.translatable("block.society.sparkstone_recycler.description.compatible").green());
item.modelJson({
parent: "society:block/kubejs/sparkstone_recycler",
});
})
.model("society:block/kubejs/sparkstone_recycler")
.blockEntity((blockInfo) => {
blockInfo.serverTick(200, 0, (entity) => global.sparkstoneRecyclerTick(entity)),
blockInfo.attachCapability(
BotaniaCapabilityBuilder.MANA.blockEntity()
.canReceiveManaFromBurst((be) => {
let mana = be.persistentData.getInt("mana");
return mana < RECYCLER_MAX_MANA;
})
.receiveMana((be, amount) => {
let currentMana = be.persistentData.getInt("mana");
let received = Math.min(RECYCLER_MAX_MANA - currentMana, amount);
be.persistentData.putInt("mana", currentMana + received);
})
.getCurrentMana((be) => be.persistentData.getInt("mana"))
.isFull((be) => {
let mana = be.persistentData.getInt("mana");
return mana >= RECYCLER_MAX_MANA;
})
);
}).blockstateJson = {
variants: {
"facing=down,powered=false": {
model: "society:block/kubejs/sparkstone_recycler",
x: 180,
},
"facing=down,powered=true": {
model: "society:block/kubejs/sparkstone_recycler_on",
x: 180,
},
"facing=east,powered=false": {
model: "society:block/kubejs/sparkstone_recycler",
x: 90,
y: 90,
},
"facing=east,powered=true": {
model: "society:block/kubejs/sparkstone_recycler_on",
x: 90,
y: 90,
},
"facing=north,powered=false": {
model: "society:block/kubejs/sparkstone_recycler",
x: 90,
},
"facing=north,powered=true": {
model: "society:block/kubejs/sparkstone_recycler_on",
x: 90,
},
"facing=south,powered=false": {
model: "society:block/kubejs/sparkstone_recycler",
x: 90,
y: 180,
},
"facing=south,powered=true": {
model: "society:block/kubejs/sparkstone_recycler_on",
x: 90,
y: 180,
},
"facing=up,powered=false": {
model: "society:block/kubejs/sparkstone_recycler",
},
"facing=up,powered=true": {
model: "society:block/kubejs/sparkstone_recycler_on",
},
"facing=west,powered=false": {
model: "society:block/kubejs/sparkstone_recycler",
x: 90,
y: 270,
},
"facing=west,powered=true": {
model: "society:block/kubejs/sparkstone_recycler_on",
x: 90,
y: 270,
},
},
};
});
@@ -0,0 +1,207 @@
//priority: 100
console.info("[SOCIETY] tapper.js loaded");
global.tapperRecipes = new Map([
[
"minecraft:spruce_log",
{
leaves: ["minecraft:spruce_leaves"],
output: ["1x society:pine_tar"],
fluidOutput: "society:pine_tar",
time: 5,
},
],
[
"meadow:pine_log",
{
leaves: ["meadow:pine_leaves", "meadow:pine_leaves_2"],
output: ["1x society:pine_tar"],
fluidOutput: "society:pine_tar",
time: 5,
},
],
[
"minecraft:oak_log",
{
leaves: ["minecraft:oak_leaves"],
output: ["1x society:oak_resin"],
fluidOutput: "society:oak_resin",
time: 5,
},
],
[
"minecraft:dark_oak_log",
{
leaves: ["minecraft:dark_oak_leaves"],
output: ["1x society:oak_resin"],
fluidOutput: "society:oak_resin",
time: 5,
},
],
[
"autumnity:maple_log",
{
leaves: [
"autumnity:maple_leaves",
"autumnity:orange_maple_leaves",
"autumnity:yellow_maple_leaves",
"autumnity:red_maple_leaves",
],
output: ["1x society:maple_syrup"],
fluidOutput: "society:maple_syrup",
time: 4,
},
],
[
"minecraft:acacia_log",
{
leaves: ["minecraft:acacia_leaves"],
output: ["4x society:sap"],
fluidOutput: "create_central_kitchen:sap",
time: 1,
},
],
[
"mysticaloaktree:wise_oak",
{
leaves: ["minecraft:oak_leaves"],
output: ["4x botania:black_lotus"],
fluidOutput: "society:oak_resin",
time: 2,
},
],
[
"minecraft:pale_oak_log",
{
leaves: ["minecraft:pale_oak_leaves"],
output: ["32x minecraft:resin_clump"],
fluidOutput: "society:oak_resin",
time: 2,
},
],
[
"windswept:pine_log",
{
leaves: ["meadow:pine_leaves", "meadow:pine_leaves_2"],
output: ["1x society:pine_tar"],
fluidOutput: "society:pine_tar",
time: 5,
},
],
[
"cluttered:willow_log",
{
leaves: ["cluttered:flowering_willow_leaves", "cluttered:willow_leaves"],
output: ["1x society:mystic_syrup"],
fluidOutput: "society:mystic_syrup",
time:7,
},
],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:tapper", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.property(booleanProperty.create("error"))
.soundType("copper")
.defaultCutout()
.box(3, 0, 6, 13, 16, 16)
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(Text.translatable("block.society.tapper.description").gray());
item.modelJson({
parent: "society:block/kubejs/tapper",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
.set(booleanProperty.create("error"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false)
.set(booleanProperty.create("error"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND") {
if (!upgraded && item == "society:slime_gel") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
0.2 * rnd(1, 2),
3,
0.01
);
block.set(block.id, {
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
error: block.properties.get("error"),
});
}
}
if (
!player.stages.has("canadian_and_famous") &&
block.properties.get("mature") === "true" &&
Math.random() <= 0.01
) {
block.popItemFromFace("society:canadian_and_famous", block.properties.get("facing"));
}
global.handleBERightClick(
"vinery:cabinet_close",
click,
global.tapperRecipes,
7,
false,
false,
player.stages.has("canadian_and_famous") ? 2 : 1,
true
);
global.handleTapperRandomTick(click);
})
.randomTick((tick) => {
global.handleTapperRandomTick(tick);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
if (entity.block.properties.get("error") !== "true")
global.handleBETick(entity, global.tapperRecipes, 7);
});
}).blockstateJson = {
multipart: [
{
apply: { model: "society:block/kubejs/tapper_particle" },
},
{
when: { mature: true },
apply: { model: "society:block/kubejs/machine_done" },
},
{
when: { error: true },
apply: { model: "society:block/kubejs/error" },
},
].concat(getCardinalMultipartJsonBasic("tapper")),
};
});
@@ -0,0 +1,138 @@
//priority: 100
console.info("[SOCIETY] wineKeg.js loaded");
global.wineKegRecipes = new Map([
["minecraft:honey_block", { output: ["vinery:mead"] }],
["society:maple_syrup", { output: ["vinery:apple_cider"] }],
["minecraft:apple", { output: ["vinery:apple_wine"] }],
["atmospheric:orange", { output: ["vinery:glowing_wine"] }],
["minecraft:glow_berries", { output: ["vinery:solaris_wine"] }],
["pamhc2trees:plumitem", { output: ["vinery:noir_wine"] }],
["vinery:cherry", { output: ["vinery:cherry_wine"] }],
["vintagedelight:gearo_berry", { output: ["vinery:cristel_wine"] }],
["society:blueberry", { output: ["society:forks_of_blue"] }],
["farm_and_charm:strawberry", { output: ["society:good_catawba"] }],
["vintagedelight:peanut", { output: ["society:nutty_basil"] }],
["pamhc2trees:hazelnutitem", { output: ["society:nutty_basil"] }],
["society:ancient_fruit", { output: ["society:ancient_vespertine"] }],
["pamhc2trees:starfruititem", { output: ["society:dewy_star"] }],
["pamhc2trees:pawpawitem", { output: ["nethervinery:nether_fizz"] }],
["atmospheric:aloe_leaves", { output: ["nethervinery:ghastly_grenache"] }],
["vintagedelight:ghost_pepper", { output: ["nethervinery:lava_fizz"] }],
["pamhc2trees:lemonitem", { output: ["nethervinery:blazewine_pinot"] }],
["minecraft:sweet_berries", { output: ["vinery:red_wine"] }],
["vinery:red_grape", { output: ["vinery:red_wine"] }],
["vinery:savanna_grapes_red", { output: ["vinery:red_wine"] }],
["vinery:taiga_grapes_red", { output: ["vinery:red_wine"] }],
["vinery:jungle_grapes_red", { output: ["vinery:red_wine"] }],
["nethervinery:crimson_grape", { output: ["vinery:red_wine"] }],
["vinery:white_grape", { output: ["vinery:strad_wine"] }],
["vinery:savanna_grapes_white", { output: ["vinery:strad_wine"] }],
["vinery:jungle_grapes_white", { output: ["vinery:strad_wine"] }],
["vinery:taiga_grapes_white", { output: ["vinery:strad_wine"] }],
["nethervinery:warped_grape", { output: ["vinery:strad_wine"] }],
["windswept:wild_berries", { output: ["vinery:strad_wine"] }],
["minecraft:melon", { output: ["vinery:kelp_cider"] }],
["autumnity:foul_berries", { output: ["vinery:creepers_crush"] }],
["pamhc2trees:dragonfruititem", { output: ["vinery:eiswein"] }],
["pamhc2trees:mangoitem", { output: ["vinery:aegis_wine"] }],
["atmospheric:passion_fruit", { output: ["vinery:lilitu_wine"] }],
["atmospheric:blood_orange", { output: ["vinery:jo_special_mixture"] }],
["society:salmonberry", { output: ["vinery:bolvar_wine"] }],
["society:boysenberry", { output: ["vinery:bolvar_wine"] }],
["society:cranberry", { output: ["vinery:bolvar_wine"] }],
["society:crystalberry", { output: ["vinery:bolvar_wine"] }],
["minecraft:chorus_fruit", { output: ["vinery:chorus_wine"] }],
["atmospheric:currant", { output: ["vinery:villagers_fright"] }],
["pamhc2trees:bananaitem", { output: ["vinery:clark_wine"] }],
["atmospheric:yucca_fruit", { output: ["vinery:magnetic_wine"] }],
["farmersdelight:tomato", { output: ["vinery:stal_wine"] }],
["pamhc2trees:peachitem", { output: ["vinery:chenet_wine"] }],
["pamhc2trees:lycheeitem", { output: ["vinery:bottle_mojang_noir"] }],
["society:sparkpod", { output: ["society:violet_moon"] }],
["society:mana_fruit", { output: ["society:laputa_franc"] }],
["society:mossberry", { output: ["vinery:noir_wine"] }],
]);
StartupEvents.registry("block", (event) => {
event
.create("society:wine_keg", "cardinal")
.property(booleanProperty.create("working"))
.property(booleanProperty.create("mature"))
.property(booleanProperty.create("upgraded"))
.box(2, 0, 2, 14, 15, 14)
.defaultCutout()
.tagBlock("minecraft:mineable/pickaxe")
.tagBlock("minecraft:mineable/axe")
.tagBlock("minecraft:needs_stone_tool")
.item((item) => {
item.tooltip(
Text.translatable("block.society.wine_keg.description").gray()
);
item.modelJson({
parent: "society:block/kubejs/wine_keg/wine_keg",
});
})
.defaultState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.placementState((state) => {
state
.set(booleanProperty.create("working"), false)
.set(booleanProperty.create("mature"), false)
.set(booleanProperty.create("upgraded"), false);
})
.rightClick((click) => {
const { player, item, block, hand, level } = click;
const upgraded = block.properties.get("upgraded").toLowerCase() == "true";
if (hand == "OFF_HAND") return;
if (hand == "MAIN_HAND" && !upgraded && item == "society:gray_anatomy") {
if (!player.isCreative()) item.count--;
level.spawnParticles(
"farmersdelight:star",
true,
block.x,
block.y + 1,
block.z,
0.2 * rnd(1, 4),
0.2 * rnd(1, 4),
0.2 * rnd(1, 4),
3,
0.01
);
block.set(block.id, {
facing: block.properties.get("facing"),
working: block.properties.get("working"),
mature: block.properties.get("mature"),
upgraded: true,
});
}
if (
block.properties.get("upgraded") === "true" &&
block.properties.get("mature") === "true" &&
rnd5()
) {
block.popItemFromFace("society:relic_trove", facing);
}
global.handleBERightClick(
"minecraft:block.wood.place",
click,
global.wineKegRecipes,
3,
true,
true
);
})
.blockEntity((blockInfo) => {
blockInfo.initialData({ stage: 0, recipe: "" });
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
global.handleBETick(entity, global.wineKegRecipes, 6);
});
}).blockstateJson = {
multipart: getCardinalMultipartJson("wine_keg"),
};
});