add first patch
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
// If playing on a server, the server admin must change these values
|
||||
// Requires a full game restart to take affect
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Enables a fee when a player dies to discourage players from dying on purpose.
|
||||
* Also disables fee from fainting in Skull Caverns
|
||||
* Setting this to false is not recommended.
|
||||
*/
|
||||
global.enableDeathDebt = true;
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Used for seeds unlocked in year 2. It should match what's in your seasons.toml
|
||||
*/
|
||||
global.subSeasonDuration = 10;
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Enables the clock icon from the HUD
|
||||
*/
|
||||
global.clockIcon = true;
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Gives every new player a White Sharestone on spawn to make visiting bases easier
|
||||
* This won't do anything in Single Player as they aren't otherwise obtainable
|
||||
*/
|
||||
global.multiplayerSharestones = false;
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Prevents blocks that break multiple blocks from being used in the Skull Cavern.
|
||||
* This is due to performance to prevent crashes from overloading the caverns.
|
||||
*/
|
||||
global.disableHammersSkullCavern = true;
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Skull Cavern will decay blocks placed after 30 seconds and torches after 1 minute
|
||||
*/
|
||||
global.skullCavernHardmode = false;
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Dev tool for large servers to diagnose crashes. May spam your console!
|
||||
*/
|
||||
global.susFunctionLogging = false;
|
||||
|
||||
|
||||
/**
|
||||
* Only server needs to change this
|
||||
* Enables chat color functionality with dyes in curio slots.
|
||||
* Disable if you are using other chat mods that do this
|
||||
*/
|
||||
global.enableChatColors = true;
|
||||
@@ -0,0 +1,4 @@
|
||||
// Priority 0
|
||||
StartupEvents.modifyCreativeTab("kubejs:tab", (event) => {
|
||||
event.setDisplayName("Society");
|
||||
});
|
||||
@@ -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"),
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,53 @@
|
||||
const starvationPrevention = (entity, affectionPenaltyMult) => {
|
||||
let entityNbt = entity.getNbt();
|
||||
const day = global.getDay(entity.level);
|
||||
if (day - entity.persistentData.getInt("ageLastFed") > 1) {
|
||||
entityNbt.EggLayTime = 20400;
|
||||
} else if (Math.random() > entity.persistentData.getInt("affection") / 1000) {
|
||||
entityNbt.EggLayTime = entityNbt.EggLayTime + 1000 * affectionPenaltyMult;
|
||||
} else if (entityNbt.EggLayTime > 12000) entityNbt.EggLayTime = 10240;
|
||||
entity.setNbt(entityNbt);
|
||||
};
|
||||
|
||||
EntityJSEvents.modifyEntity((event) => {
|
||||
event.modify("minecraft:chicken", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1000 === 0) {
|
||||
starvationPrevention(entity, 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("untitledduckmod:duck", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1000 === 0) {
|
||||
starvationPrevention(entity, 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("untitledduckmod:goose", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1000 === 0) {
|
||||
starvationPrevention(entity, 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("autumnity:turkey", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1000 === 0) {
|
||||
starvationPrevention(entity, 2);
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("etcetera:chapple", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1000 === 0) {
|
||||
let entityNbt = entity.getNbt();
|
||||
const day = global.getDay(entity.level);
|
||||
if (day - entity.persistentData.getInt("ageLastFed") > 1) {
|
||||
entityNbt.AppleLayTime = 20400;
|
||||
} else if (entityNbt.AppleLayTime > 12000) entityNbt.AppleLayTime = 10240;
|
||||
entity.setNbt(entityNbt);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,137 @@
|
||||
global.handleHayGolem = (entity) => {
|
||||
const { level } = entity;
|
||||
const entities = level
|
||||
.getEntitiesWithin(entity.boundingBox.inflate(8))
|
||||
.filter((e) => e.type == "golemoverhaul:hay_golem");
|
||||
const radius = 4;
|
||||
const { x, y, z } = entity;
|
||||
let scanBlock;
|
||||
if (entities.length <= 1) {
|
||||
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 (rnd10() && scanBlock.hasTag("society:hay_golem_improvable")) {
|
||||
if (scanBlock.id.equals("minecraft:farmland")) {
|
||||
scanBlock.set(
|
||||
"dew_drop_farmland_growth:low_quality_fertilized_farmland",
|
||||
scanBlock.getProperties()
|
||||
);
|
||||
} else if (
|
||||
scanBlock.id.equals(
|
||||
"dew_drop_farmland_growth:low_quality_fertilized_farmland"
|
||||
)
|
||||
) {
|
||||
scanBlock.set(
|
||||
"dew_drop_farmland_growth:high_quality_fertilized_farmland",
|
||||
scanBlock.getProperties()
|
||||
);
|
||||
}
|
||||
if (level.server) {
|
||||
level.server.runCommandSilent(
|
||||
`playsound ribbits:entity.ribbit.magic block @a ${scanBlock.x} ${scanBlock.y} ${scanBlock.z}`
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
global.handleKelpGolem = (entity) => {
|
||||
const { level } = entity;
|
||||
const { x, y, z } = entity;
|
||||
const radius = 4;
|
||||
let scanBlock;
|
||||
let blockProperties;
|
||||
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 === "dew_drop_farmland_growth:garden_pot") {
|
||||
blockProperties = scanBlock.getProperties();
|
||||
blockProperties.moisture = "7";
|
||||
scanBlock.set(scanBlock.id, blockProperties);
|
||||
}
|
||||
}
|
||||
if (level.server) {
|
||||
level.server.runCommandSilent(
|
||||
`playsound minecraft:block.water.ambient block @a ${x} ${y} ${z}`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
global.handleTerracottaGolem = (entity) => {
|
||||
const { level } = entity;
|
||||
const { x, y, z } = entity;
|
||||
const radius = 4;
|
||||
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.id.equals("minecraft:coarse_dirt")) {
|
||||
scanBlock.set("minecraft:clay");
|
||||
if (level.server) {
|
||||
level.server.runCommandSilent(
|
||||
`playsound twigs:block.silt.break block @a ${scanBlock.x} ${scanBlock.y} ${scanBlock.z}`
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
global.handleSlimeGolem = (entity) => {
|
||||
const { level } = entity;
|
||||
const entities = level
|
||||
.getEntitiesWithin(entity.boundingBox.inflate(8))
|
||||
.filter((e) => e.type == "splendid_slimes:splendid_slime");
|
||||
|
||||
const golems = level
|
||||
.getEntitiesWithin(entity.boundingBox.inflate(8))
|
||||
.filter((e) => e.type == "golemoverhaul:slime_golem");
|
||||
if (golems.length <= 1) {
|
||||
entities.forEach((slime) => {
|
||||
let nbt = slime.getNbt();
|
||||
nbt.Happiness = nbt.Happiness + 5;
|
||||
slime.setNbt(nbt);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
EntityJSEvents.modifyEntity((event) => {
|
||||
event.modify("golemoverhaul:hay_golem", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 3600 === 0) {
|
||||
global.handleHayGolem(entity);
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("golemoverhaul:kelp_golem", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1200 === 0) {
|
||||
global.handleKelpGolem(entity);
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("golemoverhaul:terracotta_golem", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 200 === 0) {
|
||||
global.handleTerracottaGolem(entity);
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("golemoverhaul:slime_golem", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1200 === 0) {
|
||||
global.handleSlimeGolem(entity);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
global.getLongwingSize = (size) => {
|
||||
let resolvedSize = Math.min(1.0, Math.max(0.5, 0.5 + (Math.random() / 2.0)));
|
||||
if (size == "normal") resolvedSize = Math.min(1.15, Math.max(0.85, 0.85 + (Math.random() / 5.0)));
|
||||
if (size == "larger") resolvedSize = Math.min(1.15, Math.max(0.85, 0.85 + (Math.random() / 3.0)));
|
||||
return resolvedSize;
|
||||
}
|
||||
|
||||
global.getLongwingFromEgg = (parent, coparent) => {
|
||||
if (parent === coparent) return parent;
|
||||
|
||||
let parent1;
|
||||
let parent2;
|
||||
global.longwings.forEach((wing, index) => {
|
||||
if (wing.variant == parent) parent1 = index;
|
||||
if (wing.variant == coparent) parent2 = index;
|
||||
});
|
||||
|
||||
let child = parent1 + parent2;
|
||||
if (global.longwings.length - 1 < child) child -= global.longwings.length;
|
||||
|
||||
let maxAllowedRarity = Math.min(global.longwings[parent1].rarity, global.longwings[parent2].rarity) - 1;
|
||||
let initialChild = child;
|
||||
|
||||
while (global.longwings[child].rarity < maxAllowedRarity) {
|
||||
child++;
|
||||
if (child >= global.longwings.length) child = 0;
|
||||
if (child === initialChild) break;
|
||||
}
|
||||
|
||||
return global.longwings[child].variant;
|
||||
};
|
||||
|
||||
global.handleLongwings = (entity, item) => {
|
||||
const { level } = entity;
|
||||
const entities = level
|
||||
.getEntitiesWithin(entity.boundingBox.inflate(8))
|
||||
.filter((e) => e !== entity && global.checkEntityTag(e, "society:longwing"));
|
||||
const radius = 4;
|
||||
const { x, y, z } = entity;
|
||||
let scanBlock;
|
||||
let scannedBlocks = 0;
|
||||
let scannedFlowers = [];
|
||||
let stolenBlock;
|
||||
if (global.susFunctionLogging) console.log("[SOCIETY-SUSFN] modifyLongwings.js");
|
||||
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("minecraft:flowers") && !scannedFlowers.includes(scanBlock.id)) {
|
||||
scannedFlowers.push(scanBlock.id);
|
||||
scannedBlocks++;
|
||||
if (!stolenBlock) stolenBlock = scanBlock;
|
||||
}
|
||||
}
|
||||
const chance = Math.min(1, scannedBlocks * 0.15 - entities.length * 0.1);
|
||||
if (chance > 0 && Math.random() <= chance) {
|
||||
let drop = level.createEntity("minecraft:item");
|
||||
drop.item = item;
|
||||
drop.x = x + 0.5;
|
||||
drop.y = y;
|
||||
drop.z = z + 0.5;
|
||||
drop.spawn();
|
||||
if (Math.random <= 0.08) {
|
||||
stolenBlock.set("minecraft:air");
|
||||
}
|
||||
}
|
||||
if (entities.length > 0 && true && chance > 0 && Math.random() <= (chance / 4)) {
|
||||
entities.sort((a, b) => a.distanceToSqr(entity) - b.distanceToSqr(entity));
|
||||
let coparent = entities[0];
|
||||
let eggs = level.createEntity("minecraft:item");
|
||||
let parentVariant = entity.getNbt().Variant;
|
||||
let coparentVariant = coparent.getNbt().Variant
|
||||
eggs.item = Item.of(
|
||||
"1x society:caterpillar_eggs",
|
||||
`{parent:"${parentVariant}",coparent:"${coparentVariant}",child:"${global.getLongwingFromEgg(parentVariant, coparentVariant)}",size:${Math.max(0.25, Math.round((((entity.getNbt().size + coparent.getNbt().size) + Math.random()) / 2) * 100) / 100)}}`);
|
||||
if (Math.random() <= 0.001) {
|
||||
eggs.item = Item.of("society:the_metamorphosize")
|
||||
}
|
||||
eggs.x = x + 0.5;
|
||||
eggs.y = y;
|
||||
eggs.z = z + 0.5;
|
||||
eggs.spawn();
|
||||
}
|
||||
};
|
||||
|
||||
EntityJSEvents.modifyEntity((event) => {
|
||||
event.modify("longwings:moth", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 6000 === 0) {
|
||||
global.handleLongwings(entity, "society:moth_pollen");
|
||||
}
|
||||
});
|
||||
});
|
||||
event.modify("longwings:butterfly", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 6000 === 0) {
|
||||
global.handleLongwings(entity, "society:butterfly_amber");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
global.handleRibbit = (entity) => {
|
||||
const nbt = entity.nbt.toString();
|
||||
|
||||
if (nbt.includes("gardener")) {
|
||||
let freshVillager = entity.level.createEntity("ribbits:ribbit");
|
||||
let villagerNbt = freshVillager.getNbt();
|
||||
villagerNbt.Brain.memories = entity.nbt.Brain.memories;
|
||||
freshVillager.customName = entity.customName;
|
||||
villagerNbt.Pos = [Number(entity.x), Number(entity.y), Number(entity.z)];
|
||||
freshVillager.setNbt(villagerNbt);
|
||||
villagerNbt.RibbitData = {
|
||||
umbrella: "ribbits:umbrella_3",
|
||||
instrument: "ribbits:none",
|
||||
profession: "ribbits:fisherman",
|
||||
};
|
||||
freshVillager.setNbt(villagerNbt);
|
||||
freshVillager.spawn();
|
||||
entity.setRemoved("unloaded_to_chunk");
|
||||
}
|
||||
};
|
||||
|
||||
EntityJSEvents.modifyEntity((event) => {
|
||||
event.modify("ribbits:ribbit", (modifyBuilder) => {
|
||||
modifyBuilder.tick((entity) => {
|
||||
if (entity.level.time % 1200 === 0) {
|
||||
global.handleRibbit(entity);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,68 @@
|
||||
console.info("[SOCIETY] fishingRodLeveling.js loaded");
|
||||
|
||||
let maxLureLevel = 4;
|
||||
let maxLuckOfTheSeaLevel = 6;
|
||||
|
||||
ForgeEvents.onEvent(
|
||||
"net.minecraftforge.event.entity.player.ItemFishedEvent",
|
||||
(e) => {
|
||||
let randCap = 40;
|
||||
const player = e.getEntity();
|
||||
const mainHandItem = player.getHeldItem("main_hand");
|
||||
const mainHandItemId = mainHandItem.getId();
|
||||
const enchantmentTags = mainHandItem.enchantmentTags;
|
||||
const validRods = [
|
||||
"aquaculture:iron_fishing_rod",
|
||||
"aquaculture:gold_fishing_rod",
|
||||
"aquaculture:diamond_fishing_rod",
|
||||
"aquaculture:neptunium_fishing_rod",
|
||||
"netherdepthsupgrade:lava_fishing_rod",
|
||||
];
|
||||
if (!validRods.includes(mainHandItemId)) return;
|
||||
|
||||
if (player.level.isRaining()) {
|
||||
randCap = randCap - 10;
|
||||
}
|
||||
switch (mainHandItemId) {
|
||||
case "aquaculture:gold_fishing_rod":
|
||||
randCap -= 5;
|
||||
break;
|
||||
case "aquaculture:diamond_fishing_rod":
|
||||
randCap -= 10;
|
||||
break;
|
||||
case "aquaculture:neptunium_fishing_rod":
|
||||
randCap -= 20;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
const randomNum = Math.floor(Math.random() * randCap);
|
||||
if (randomNum == 0) {
|
||||
const lureLevel = mainHandItem.getEnchantmentLevel("minecraft:lure");
|
||||
const luckOfTheSeaLevel = mainHandItem.getEnchantmentLevel(
|
||||
"minecraft:luck_of_the_sea"
|
||||
);
|
||||
if (lureLevel < maxLureLevel && Math.floor(Math.random() * 2) == 0) {
|
||||
for (let i = 0; i < enchantmentTags.size(); i++) {
|
||||
let enchantment = enchantmentTags.get(i);
|
||||
if (enchantment.get("id") == "minecraft:lure") {
|
||||
enchantmentTags.remove(i);
|
||||
}
|
||||
}
|
||||
mainHandItem.enchantStack("minecraft:lure", lureLevel + 1);
|
||||
player.tell(Text.translatable("society.fishing_rod.level_up.lure").gold());
|
||||
} else if (luckOfTheSeaLevel < maxLuckOfTheSeaLevel) {
|
||||
for (let i = 0; i < enchantmentTags.size(); i++) {
|
||||
let enchantment = enchantmentTags.get(i);
|
||||
if (enchantment.get("id") == "minecraft:luck_of_the_sea") {
|
||||
enchantmentTags.remove(i);
|
||||
}
|
||||
}
|
||||
mainHandItem.enchantStack(
|
||||
"minecraft:luck_of_the_sea",
|
||||
luckOfTheSeaLevel + 1
|
||||
);
|
||||
player.tell(Text.translatable("society.fishing_rod.level_up.lots").gold());
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,42 @@
|
||||
console.info("[SOCIETY] fishingSkills.js loaded");
|
||||
|
||||
global.handleExtraFishing = (e) => {
|
||||
const player = e.getEntity();
|
||||
let increase = 0;
|
||||
if (player.isFake()) player.getHeldItem("main_hand").count--;
|
||||
let hasNet = global.hasBobber(player.getHeldItem("main_hand"), "society:net_bobber")
|
||||
if (player.getLevel().dimension === "minecraft:the_nether") {
|
||||
if (Math.random() < 0.1) player.give(Item.of(`${hasNet ? 3 : 1}x society:nether_jelly`));
|
||||
if (player.stages.has("wooden_pollution") && Math.random() < 0.1)
|
||||
player.give(Item.of(`${hasNet ? 3 : 1}x society:nether_jelly`));
|
||||
if (player.stages.has("fly_fisher")) increase += 1;
|
||||
if (player.stages.has("school_fisher")) increase += 3;
|
||||
if (
|
||||
global.hasBobber(player.getHeldItem("main_hand"), "society:needle_bobber")
|
||||
)
|
||||
increase += 5;
|
||||
if (increase > 0) {
|
||||
e.getDrops().forEach((drop) => {
|
||||
if (drop.hasTag("minecraft:fishes")) {
|
||||
player.give(Item.of(`${increase}x ${drop.id}`, drop.nbt));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
e.getDrops().forEach((drop) => {
|
||||
if (
|
||||
!drop.hasTag("minecraft:fishes") &&
|
||||
hasNet &&
|
||||
drop.maxStackSize > drop.count * 2
|
||||
) {
|
||||
player.give(Item.of(`${drop.count * 2}x ${drop.id}`, drop.nbt));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ForgeEvents.onEvent(
|
||||
"net.minecraftforge.event.entity.player.ItemFishedEvent",
|
||||
(e) => {
|
||||
global.handleExtraFishing(e);
|
||||
}
|
||||
);
|
||||
@@ -0,0 +1,39 @@
|
||||
console.info("[SOCIETY] nerfHero.js loaded");
|
||||
|
||||
const apiEvent = Java.loadClass("net.minecraftforge.eventbus.api.Event");
|
||||
|
||||
global.runFixGrandma = (e) => {
|
||||
if (
|
||||
[
|
||||
"effect.farm_and_charm.grandmas_blessing",
|
||||
"effect.farm_and_charm.farmers_blessing",
|
||||
"effect.brewery.pintcharisma",
|
||||
].includes(e.getEffectInstance().getEffect().getDescriptionId()) &&
|
||||
e.getEntity().getType().toString() == "minecraft:player"
|
||||
) {
|
||||
// e.setResult(apiEvent.Result.DENY);
|
||||
if (e.getEntity().potionEffects.getActive().toString().includes("stunning")) {
|
||||
console.log("removing")
|
||||
e.getEntity().potionEffects.add("oreganized:stunning", 1, 1, true, false);
|
||||
e.setResult(apiEvent.Result.DENY);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
ForgeEvents.onEvent("net.minecraftforge.event.entity.living.MobEffectEvent$Applicable", (event) => {
|
||||
global.runFixGrandma(event);
|
||||
|
||||
if (
|
||||
[
|
||||
"effect.minecraft.hero_of_the_village",
|
||||
"effect.vinery.trading",
|
||||
"effect.brewery.pintcharisma",
|
||||
"effect.nethervinery.gravedigger",
|
||||
"effect.nethervinery.improved_gravedigger",
|
||||
].includes(event.getEffectInstance().getEffect().getDescriptionId()) &&
|
||||
event.getEntity().getType().toString() == "minecraft:player"
|
||||
) {
|
||||
event.setResult(apiEvent.Result.DENY);
|
||||
console.log("No cheese in industrial capitalism...");
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
// DEPRECATED
|
||||
@@ -0,0 +1,31 @@
|
||||
console.info("[SOCIETY] skullCavernChunkManager.js loaded");
|
||||
|
||||
global.chunkLoadManager = (e) => {
|
||||
const { chunk, level } = e;
|
||||
|
||||
if (level.dimension === "society:skull_cavern" && !level.isClientSide()) {
|
||||
if (global.susFunctionLogging) console.log("[SOCIETY-SUSFN] skullCavernChunkManager.js");
|
||||
const day = global.getDay(level);
|
||||
|
||||
if (!level.persistentData.chunkParityMap)
|
||||
level.persistentData.chunkParityMap = {};
|
||||
let chunkPos = chunk.pos.toString();
|
||||
let chunkMap = level.persistentData.chunkParityMap;
|
||||
if (chunkMap && chunkMap[chunkPos]) {
|
||||
if (Number(chunkMap[chunkPos].day) !== day) {
|
||||
level.persistentData.chunkParityMap[chunkPos] = {
|
||||
day: day,
|
||||
toggleBit: Number(chunkMap[chunkPos].toggleBit) == 0 ? 1 : 0,
|
||||
};
|
||||
}
|
||||
} else if (chunkMap)
|
||||
level.persistentData.chunkParityMap[chunkPos] = {
|
||||
day: day,
|
||||
toggleBit: 0,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
ForgeEvents.onEvent("net.minecraftforge.event.level.ChunkEvent$Load", (e) => {
|
||||
global.chunkLoadManager(e);
|
||||
});
|
||||
@@ -0,0 +1,783 @@
|
||||
// Why are entity type tags so weird
|
||||
global.checkEntityTag = (entity, checkedTag) => {
|
||||
if (!entity || !entity.entityType || !entity.entityType.tags) return false;
|
||||
return entity.entityType.tags.anyMatch((tag) => tag.location() == checkedTag);
|
||||
};
|
||||
|
||||
global.isFresh = (day, actionAge) => {
|
||||
return day < actionAge;
|
||||
};
|
||||
|
||||
global.getAnimalIsNotCramped = (target, scale, applyGlowing) => {
|
||||
const level = target.getLevel();
|
||||
const entities = level
|
||||
.getEntitiesWithin(target.boundingBox.inflate(scale))
|
||||
.filter((e) => global.checkEntityTag(e, "society:husbandry_animal"));
|
||||
let cramped = entities.length > 5
|
||||
if (cramped && applyGlowing) {
|
||||
entities.forEach((entity) => {
|
||||
entity.potionEffects.add("minecraft:glowing", 200, 0, false, false);
|
||||
})
|
||||
}
|
||||
return !cramped;
|
||||
};
|
||||
|
||||
global.isWarpedCow = (target) => {
|
||||
if (target.type === "meadow:wooly_cow") {
|
||||
if (target.toString().includes("WoolyCowEntity")) return Number(target.getNbt().Variant) === 2
|
||||
let variant = target.Variant
|
||||
if (variant && Number(variant) === 2) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
global.getMilkingTimeMult = (target, type) => {
|
||||
const warped = global.isWarpedCow(target);
|
||||
let mult;
|
||||
global.husbandryMilkingDefinitions.forEach((definition) => {
|
||||
if (!mult && definition.animal.equals(type.toString())) {
|
||||
if (warped && definition.warped) mult = definition.cooldown;
|
||||
if (!warped) mult = definition.cooldown;
|
||||
}
|
||||
});
|
||||
return mult;
|
||||
};
|
||||
|
||||
global.getHusbandryQuality = (hearts, mood, milk) => {
|
||||
let heartQuality = 0;
|
||||
let moodQuality = 0;
|
||||
if (hearts > 0) {
|
||||
if (milk) {
|
||||
if (hearts >= 10 || (hearts > 0 && hearts % 5 === 0)) {
|
||||
heartQuality = 3;
|
||||
} else {
|
||||
heartQuality = Math.floor((hearts % 11) / 2 - 2);
|
||||
}
|
||||
} else {
|
||||
if (hearts >= 10) {
|
||||
heartQuality = 3;
|
||||
} else {
|
||||
heartQuality = Math.floor((hearts % 11) / 2 - 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mood > 224) moodQuality = 3;
|
||||
else if (mood > 192) moodQuality = 2;
|
||||
else if (mood > 160) moodQuality = 1;
|
||||
return Math.min(moodQuality, heartQuality);
|
||||
};
|
||||
|
||||
const resolveMilk = (hearts, mood, target, type) => {
|
||||
let large = hearts > 5 && Math.random() < (mood + hearts * 10) / 256;
|
||||
let milk;
|
||||
const warped = global.isWarpedCow(target);
|
||||
global.husbandryMilkingDefinitions.forEach((definition) => {
|
||||
if (!milk && definition.animal.equals(type.toString())) {
|
||||
if (warped && definition.warped)
|
||||
milk = large ? definition.milk.lg : definition.milk.sm;
|
||||
if (!warped) milk = large ? definition.milk.lg : definition.milk.sm;
|
||||
}
|
||||
});
|
||||
return milk;
|
||||
};
|
||||
|
||||
const canMilk = (data, target, day, plushieModifiers) => {
|
||||
const ageLastMilked = data.getInt("ageLastMilked");
|
||||
const dayHasPassed =
|
||||
day > ageLastMilked + global.getMilkingTimeMult(target, target.type) - 1;
|
||||
const freshAnimal = global.isFresh(day, ageLastMilked);
|
||||
if (plushieModifiers) return freshAnimal || dayHasPassed;
|
||||
const hungry = global.compareDay(day, data.getInt("ageLastFed"), 1)
|
||||
return !target.isBaby() && !hungry && (freshAnimal || dayHasPassed);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.Player|null} player
|
||||
* player.stages, or auto-grabber NBT stages, or empty stages for mana milker
|
||||
* @param {Internal.Stages|SocietyStages} stages
|
||||
*/
|
||||
global.getMilk = (
|
||||
level,
|
||||
target,
|
||||
data,
|
||||
player,
|
||||
day,
|
||||
raiseAffection,
|
||||
plushieModifiers,
|
||||
stages
|
||||
) => {
|
||||
const crackerBonus = data.animalCracker ? 2 : 1;
|
||||
let affection;
|
||||
let mood;
|
||||
let affectionIncrease = 0;
|
||||
if (plushieModifiers) {
|
||||
affection = 1000;
|
||||
mood = 256;
|
||||
} else {
|
||||
affection = data.getInt("affection") || 0;
|
||||
mood = global.getOrFetchMood(level, target, day, player);
|
||||
affectionIncrease = stages.has("animal_whisperer") || data.bribed ? 10 : 5;
|
||||
}
|
||||
let hearts = Math.floor(affection / 100);
|
||||
|
||||
let quality = 0;
|
||||
if (canMilk(data, target, day, plushieModifiers)) {
|
||||
const plushieDoubleDrops = plushieModifiers && plushieModifiers.doubleDrops;
|
||||
const plushieProcessItems =
|
||||
plushieModifiers && plushieModifiers.processItems;
|
||||
if (raiseAffection) data.affection = affection + affectionIncrease;
|
||||
if (!plushieModifiers) data.ageLastMilked = day;
|
||||
if (mood >= 160) {
|
||||
quality = global.getHusbandryQuality(hearts, mood, true);
|
||||
}
|
||||
let milkId = resolveMilk(hearts, mood, target, target.type);
|
||||
if (milkId == "species:ichor_bottle" && hearts >= 5) quality = 3;
|
||||
if (plushieProcessItems) {
|
||||
let cheesePressOutput = global.cheesePressRecipes.get(milkId);
|
||||
if (cheesePressOutput) {
|
||||
milkId = Item.of(cheesePressOutput.output[0]).id;
|
||||
}
|
||||
}
|
||||
return Item.of(
|
||||
`${(stages.has("shepherd") ? 2 : 1) *
|
||||
crackerBonus *
|
||||
(plushieDoubleDrops ? 2 : 1)
|
||||
}x ${milkId}`,
|
||||
quality > 0 ? `{quality_food:{effects:[],quality:${quality}}}` : null
|
||||
);
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.Player|null} player
|
||||
* @param {Internal.Stages|SocietyStages} stages player.stages or auto-grabber NBT stages
|
||||
*/
|
||||
global.handleSpecialHarvest = (
|
||||
level,
|
||||
target,
|
||||
player,
|
||||
server,
|
||||
block,
|
||||
inventory,
|
||||
plushieModifiers,
|
||||
harvestFunction,
|
||||
stages
|
||||
) => {
|
||||
const day = global.getDay(level);
|
||||
const data = plushieModifiers ? target : target.persistentData;
|
||||
const ageLastFed = plushieModifiers ? -1 : data.getInt("ageLastFed");
|
||||
const ageLastDroppedSpecial = data.getInt("ageLastDroppedSpecial") || 0;
|
||||
const type = target.type;
|
||||
const freshAnimal = global.isFresh(day, ageLastDroppedSpecial);
|
||||
const hungry = global.compareDay(day, ageLastFed, 1)
|
||||
const crackerBonus = data.animalCracker ? 2 : 1;
|
||||
if (freshAnimal || day > ageLastDroppedSpecial) {
|
||||
let resolvedCount;
|
||||
let resolvedItem;
|
||||
global.husbandryForagingDefinitions.forEach((definition) => {
|
||||
if (definition.animal.equals(type)) {
|
||||
definition.forages.forEach((forage) => {
|
||||
resolvedCount = forage.countMult;
|
||||
if (forage.stage && stages.has(forage.stage.name)) {
|
||||
resolvedCount = forage.stage.newCountMult;
|
||||
}
|
||||
if (forage.itemPool) {
|
||||
resolvedItem =
|
||||
forage.itemPool[
|
||||
Math.floor(Math.random() * forage.itemPool.length)
|
||||
];
|
||||
} else {
|
||||
resolvedItem = forage.item;
|
||||
}
|
||||
harvestFunction(
|
||||
data,
|
||||
day,
|
||||
forage.chance,
|
||||
hungry,
|
||||
forage.minHearts,
|
||||
resolvedCount * crackerBonus,
|
||||
resolvedItem,
|
||||
forage.hasQuality,
|
||||
plushieModifiers,
|
||||
{
|
||||
level: level,
|
||||
target: target,
|
||||
player: player,
|
||||
server: server,
|
||||
block: block,
|
||||
inventory: inventory,
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
});
|
||||
if (
|
||||
stages.has("coopmaster") &&
|
||||
(plushieModifiers
|
||||
? global.coopMasterAnimals.includes(data.type)
|
||||
: global.checkEntityTag(target, "society:coopmaster_bird"))
|
||||
) {
|
||||
harvestFunction(
|
||||
data,
|
||||
day,
|
||||
0.02,
|
||||
hungry,
|
||||
1,
|
||||
1 * crackerBonus,
|
||||
"vintagedelight:golden_egg",
|
||||
true,
|
||||
plushieModifiers,
|
||||
{
|
||||
level: level,
|
||||
target: target,
|
||||
player: player,
|
||||
server: server,
|
||||
block: block,
|
||||
inventory: inventory,
|
||||
}
|
||||
);
|
||||
}
|
||||
if (data.bff && stages.has("bff")) {
|
||||
harvestFunction(
|
||||
data,
|
||||
day,
|
||||
0.1,
|
||||
hungry,
|
||||
10,
|
||||
1 * crackerBonus,
|
||||
"society:prismatic_shard",
|
||||
false,
|
||||
plushieModifiers,
|
||||
{
|
||||
level: level,
|
||||
target: target,
|
||||
player: player,
|
||||
server: server,
|
||||
block: block,
|
||||
inventory: inventory,
|
||||
}
|
||||
);
|
||||
}
|
||||
if (player && !player.isFake() && !stages.has("animal_fancy")) {
|
||||
harvestFunction(
|
||||
data,
|
||||
day,
|
||||
0.05,
|
||||
hungry,
|
||||
4,
|
||||
1,
|
||||
"society:animal_fancy",
|
||||
false,
|
||||
plushieModifiers,
|
||||
{
|
||||
level: level,
|
||||
target: target,
|
||||
player: player,
|
||||
server: server,
|
||||
block: block,
|
||||
inventory: inventory,
|
||||
}
|
||||
);
|
||||
}
|
||||
if (stages.has("reaping_scythe")) {
|
||||
harvestFunction(
|
||||
data,
|
||||
day,
|
||||
0.1,
|
||||
hungry,
|
||||
1,
|
||||
1 * crackerBonus,
|
||||
"quark:diamond_heart",
|
||||
false,
|
||||
plushieModifiers,
|
||||
{
|
||||
level: level,
|
||||
target: target,
|
||||
player: player,
|
||||
server: server,
|
||||
block: block,
|
||||
inventory: inventory,
|
||||
}
|
||||
);
|
||||
}
|
||||
if (
|
||||
plushieModifiers &&
|
||||
plushieModifiers.newDrops &&
|
||||
plushieModifiers.newDrops.length > 0
|
||||
) {
|
||||
plushieModifiers.newDrops.forEach((drop) => {
|
||||
harvestFunction(
|
||||
data,
|
||||
day,
|
||||
1,
|
||||
hungry,
|
||||
1,
|
||||
drop.count * crackerBonus,
|
||||
drop.id,
|
||||
false,
|
||||
plushieModifiers,
|
||||
{
|
||||
level: level,
|
||||
target: target,
|
||||
player: player,
|
||||
server: server,
|
||||
block: block,
|
||||
inventory: inventory,
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
if (!plushieModifiers) data.ageLastDroppedSpecial = day;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.Player|null} player
|
||||
* player.stages, or auto grabber NBT stages, or empty stages for mana milker
|
||||
* @param {Internal.Stages|SocietyStages} stages
|
||||
*/
|
||||
global.getMagicShearsOutput = (level, target, player, plushieModifiers, stages) => {
|
||||
const day = global.getDay(level);
|
||||
const data = plushieModifiers ? target : target.persistentData;
|
||||
const ageLastMagicHarvested = data.getInt("ageLastMagicHarvested");
|
||||
const freshAnimal = global.isFresh(day, ageLastMagicHarvested);
|
||||
let affection;
|
||||
let mood;
|
||||
if (plushieModifiers) {
|
||||
affection = 1000;
|
||||
mood = 256;
|
||||
} else {
|
||||
affection = data.getInt("affection") || 0;
|
||||
mood = global.getOrFetchMood(level, target, day, player);
|
||||
}
|
||||
|
||||
let hearts = Math.floor((affection > 1000 ? 1000 : affection) / 100);
|
||||
const targetId =
|
||||
target.type === "meadow:wooly_cow"
|
||||
? ["minecraft", "cow"]
|
||||
: target.type.split(":");
|
||||
const droppedLoot = Utils.rollChestLoot(
|
||||
`${targetId[0]}:entities/${targetId[1]}`
|
||||
).toArray();
|
||||
let newLoot = [];
|
||||
if (hearts >= 5 && (freshAnimal || day > ageLastMagicHarvested)) {
|
||||
if (!plushieModifiers || !plushieModifiers.resetDay) {
|
||||
data.ageLastMagicHarvested = day;
|
||||
}
|
||||
data.affection = affection - 7;
|
||||
if (!plushieModifiers) {
|
||||
level.spawnParticles(
|
||||
"snowyspirit:glow_light",
|
||||
true,
|
||||
target.x,
|
||||
target.y + 1.5,
|
||||
target.z,
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
20,
|
||||
2
|
||||
);
|
||||
}
|
||||
if (mood >= 160) {
|
||||
let quality = global.getHusbandryQuality(hearts, mood);
|
||||
for (let i = 0; i < droppedLoot.length; i++) {
|
||||
droppedLoot[i] = Item.of(
|
||||
droppedLoot[i].id,
|
||||
`{quality_food:{effects:[],quality:${quality}}}`
|
||||
);
|
||||
}
|
||||
}
|
||||
if (stages.has("mana_hand")) {
|
||||
let dropItem;
|
||||
for (let i = 0; i < droppedLoot.length; i++) {
|
||||
dropItem = droppedLoot[i];
|
||||
if (dropItem.maxStackSize < dropItem.count * 2) {
|
||||
newLoot.push(dropItem);
|
||||
newLoot.push(dropItem);
|
||||
} else {
|
||||
dropItem.count = dropItem.count * 2;
|
||||
newLoot.push(dropItem);
|
||||
}
|
||||
}
|
||||
return newLoot;
|
||||
}
|
||||
for (let i = 0; i < droppedLoot.length; i++) {
|
||||
newLoot.push(droppedLoot[i]);
|
||||
}
|
||||
if (stages.has("heretic")) {
|
||||
newLoot.push(Item.of("3x society:sparkstone"));
|
||||
if (!plushieModifiers) {
|
||||
target.attack(2);
|
||||
data.affection = affection - 20;
|
||||
}
|
||||
}
|
||||
return newLoot;
|
||||
} else return -1;
|
||||
};
|
||||
|
||||
const getMoodImpactModifier = (target) => {
|
||||
if (global.tierTwoHusbandryAnimals.includes(target.type)) return 1.25;
|
||||
if (global.tierThreeHusbandryAnimals.includes(target.type)) return 1.5;
|
||||
return 1;
|
||||
};
|
||||
|
||||
const getNearbyBlocks = (level, target, radius, tag) => {
|
||||
const { x, y, z } = target;
|
||||
let blockCount = 0;
|
||||
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(tag)) {
|
||||
blockCount++;
|
||||
}
|
||||
}
|
||||
return blockCount;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Internal.Player|null} player
|
||||
*/
|
||||
global.getOrFetchMood = (level, target, day, player, debugMood, disregardPet) => {
|
||||
if (global.checkEntityTag(target, "society:pet_animal")) return 256;
|
||||
const data = target.persistentData;
|
||||
let moodDebuffs = 0;
|
||||
let moodImpactModifier = getMoodImpactModifier(target);
|
||||
if (!player && debugMood) {
|
||||
console.log("getOrFetchMood: cannot debug mood because player is falsey!");
|
||||
debugMood = false;
|
||||
}
|
||||
if (moodImpactModifier > 1 && debugMood) player.tell(Text.translatable("society.husbandry.mood.breed_impact", moodImpactModifier).gold());
|
||||
if (!disregardPet && global.compareDay(day, data.getInt("ageLastPet"), 1)) {
|
||||
moodDebuffs += 96;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.not_pet").red());
|
||||
}
|
||||
if (global.compareDay(day, data.getInt("ageLastFed"), 2)) {
|
||||
moodDebuffs += 128;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.not_fed").red());
|
||||
}
|
||||
let requiredBlocks = 0;
|
||||
if (global.coldMobs.includes(target.type)) {
|
||||
requiredBlocks = getNearbyBlocks(level, target, 5, "society:cold_blocks");
|
||||
if (requiredBlocks < 5) {
|
||||
let coldDebuff = 32 - (32 * requiredBlocks) / 5
|
||||
moodDebuffs += coldDebuff;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.not_cold", coldDebuff).red());
|
||||
}
|
||||
} else {
|
||||
if (
|
||||
global.getSeasonFromBiome(level, target.getPos()) === "winter" &&
|
||||
level.canSeeSky(target.getPos())
|
||||
) {
|
||||
moodDebuffs += 32;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.too_cold").red());
|
||||
}
|
||||
}
|
||||
if (!global.getAnimalIsNotCramped(target, 1.1, debugMood)) {
|
||||
moodDebuffs += 96;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.cramped").red());
|
||||
}
|
||||
if (level.raining && level.canSeeSky(target.getPos())) {
|
||||
moodDebuffs += 32;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.wet").red());
|
||||
}
|
||||
let baseDebuffs = moodDebuffs
|
||||
moodDebuffs *= moodImpactModifier;
|
||||
if (day - data.getInt("ageLastBoosted") == 1) {
|
||||
moodDebuffs -= 24;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.boosted_food").green());
|
||||
}
|
||||
if (data.clockwork) {
|
||||
moodDebuffs -= 64;
|
||||
if (debugMood) player.tell(Text.translatable("society.husbandry.mood.clockwork").green());
|
||||
}
|
||||
if (debugMood) {
|
||||
if (baseDebuffs > 0) player.tell(Text.translatable("society.husbandry.mood.total_debuffs", Number(baseDebuffs)).darkRed());
|
||||
player.tell(Text.translatable("society.husbandry.mood.final_mood", Number(256 - moodDebuffs)).gray());
|
||||
}
|
||||
if (global.compareDay(day, data.getInt("ageLastSetMood"), 1)) {
|
||||
data.lastMood = Math.max(0, 256 - moodDebuffs);
|
||||
data.ageLastSetMood = day;
|
||||
}
|
||||
return data.lastMood;
|
||||
};
|
||||
/**
|
||||
* Plushie Trait related drops and mechanics
|
||||
*/
|
||||
global.getPlushieModifiers = (level, data, plushieBlock) => {
|
||||
let newDrops = [];
|
||||
let doubleDrops = false;
|
||||
let resetDay = false;
|
||||
let qualityMult = data.quality + 1;
|
||||
let probabilityIncrease = 0;
|
||||
let processItems = false;
|
||||
const roll = Math.random();
|
||||
switch (data.type) {
|
||||
case 0:
|
||||
// Aquatic
|
||||
if (roll < 0.05 * qualityMult) {
|
||||
newDrops.push(
|
||||
Item.of(rnd50() ? "society:river_jelly" : "society:ocean_jelly")
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
// Woodsy
|
||||
let nearbyLogs = global.getTaggedBlocksInRadius(
|
||||
level,
|
||||
"society:raw_logs",
|
||||
plushieBlock,
|
||||
7,
|
||||
true
|
||||
);
|
||||
if (nearbyLogs.length > 0) {
|
||||
newDrops.push(
|
||||
Item.of(
|
||||
`${qualityMult * 8}x ${nearbyLogs[Math.floor(Math.random() * nearbyLogs.length)]
|
||||
}`
|
||||
)
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
// Eldritch
|
||||
newDrops.push(Item.of(`${qualityMult}x oreganized:raw_silver`));
|
||||
break;
|
||||
case 3:
|
||||
// Wrathful
|
||||
newDrops.push(Item.of(`${qualityMult * 3}x oreganized:raw_lead`));
|
||||
break;
|
||||
case 4:
|
||||
// Sommelier
|
||||
if (roll < 0.25 * qualityMult) processItems = true;
|
||||
break;
|
||||
case 5:
|
||||
// Sunlit
|
||||
if (roll < (0.05 * qualityMult)) {
|
||||
newDrops.push(Item.of("society:sunlit_crystal"));
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
// Hungry
|
||||
if (roll < 0.1 * qualityMult) resetDay = true;
|
||||
break;
|
||||
case 7:
|
||||
// Anxious
|
||||
probabilityIncrease = 0.25 * qualityMult;
|
||||
break;
|
||||
case 8:
|
||||
// Shy
|
||||
if (
|
||||
global.getTaggedBlocksInRadius(
|
||||
level,
|
||||
"society:plushies",
|
||||
plushieBlock,
|
||||
3 - (qualityMult - 1)
|
||||
) == 1
|
||||
) {
|
||||
doubleDrops = true;
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
// Cheerful;
|
||||
if (
|
||||
global.getTaggedBlocksInRadius(
|
||||
level,
|
||||
"society:plushies",
|
||||
plushieBlock,
|
||||
2
|
||||
) >
|
||||
28 - 4 * qualityMult
|
||||
) {
|
||||
doubleDrops = true;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
// Chill
|
||||
newDrops.push(Item.of(`${qualityMult}x society:pristine_diamond`));
|
||||
break;
|
||||
case 11:
|
||||
// Machiavellian
|
||||
newDrops.push(Item.of(`${qualityMult}x minecraft:netherite_scrap`));
|
||||
break;
|
||||
case 12:
|
||||
// Cutesy
|
||||
newDrops.push(Item.of(`${qualityMult}x society:furniture_box`));
|
||||
break;
|
||||
case 13:
|
||||
// Fashionista
|
||||
if (
|
||||
global.getTaggedBlocksInRadius(
|
||||
level,
|
||||
"society:loot_furniture",
|
||||
plushieBlock,
|
||||
2
|
||||
) >=
|
||||
28 - 4 * qualityMult
|
||||
) {
|
||||
doubleDrops = true;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
case 14:
|
||||
// Neutral
|
||||
if (roll < 0.1 * qualityMult) doubleDrops = true;
|
||||
break;
|
||||
}
|
||||
return {
|
||||
newDrops: newDrops,
|
||||
doubleDrops: doubleDrops,
|
||||
resetDay: resetDay,
|
||||
probabilityIncrease: probabilityIncrease,
|
||||
processItems: processItems,
|
||||
};
|
||||
};
|
||||
// const { newDrops, doubleDrops, resetDay, probabilityIncrease, processItems } =
|
||||
// global.getPlushieDrops(plushieNbt, plushie);
|
||||
|
||||
global.executePlushieHusbandry = (
|
||||
level,
|
||||
server,
|
||||
player,
|
||||
item,
|
||||
block,
|
||||
specialHarvestFunction
|
||||
) => {
|
||||
let nbt = block.getEntityData();
|
||||
const { animal } = nbt.data;
|
||||
if (!animal) return;
|
||||
let reset = false;
|
||||
const day = global.getDay(level);
|
||||
const plushieMods = global.getPlushieModifiers(level, nbt.data, block);
|
||||
if (
|
||||
item === "society:milk_pail" &&
|
||||
global.milkableAnimals.includes(animal.type)
|
||||
) {
|
||||
let milkItem = global.getMilk(
|
||||
level,
|
||||
animal,
|
||||
animal,
|
||||
player,
|
||||
day,
|
||||
false,
|
||||
plushieMods,
|
||||
player.stages,
|
||||
);
|
||||
if (milkItem !== -1) {
|
||||
let milk = level.createEntity("minecraft:item");
|
||||
milk.x = player.x;
|
||||
milk.y = player.y;
|
||||
milk.z = player.z;
|
||||
milk.item = milkItem;
|
||||
milk.spawn();
|
||||
server.runCommandSilent(
|
||||
`playsound minecraft:entity.cow.milk block @a ${player.x} ${player.y} ${player.z}`
|
||||
);
|
||||
global.giveExperience(server, player, "husbandry", 30);
|
||||
if (!plushieMods.resetDay) {
|
||||
nbt.merge({
|
||||
data: {
|
||||
animal: {
|
||||
ageLastMilked: day,
|
||||
},
|
||||
},
|
||||
});
|
||||
} else {
|
||||
reset = true;
|
||||
}
|
||||
level.spawnParticles(
|
||||
"minecraft:note",
|
||||
true,
|
||||
block.x,
|
||||
block.y + 1.5,
|
||||
block.z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
global.handleSpecialHarvest(
|
||||
level,
|
||||
animal,
|
||||
player,
|
||||
server,
|
||||
block,
|
||||
undefined,
|
||||
plushieMods,
|
||||
specialHarvestFunction,
|
||||
player.stages,
|
||||
);
|
||||
if (!plushieMods.resetDay) {
|
||||
nbt.merge({
|
||||
data: {
|
||||
animal: {
|
||||
ageLastDroppedSpecial: day,
|
||||
},
|
||||
},
|
||||
});
|
||||
} else if (Number(animal.ageLastDroppedSpecial) < day) {
|
||||
reset = true;
|
||||
}
|
||||
if (item === "society:magic_shears") {
|
||||
const droppedLoot = global.getMagicShearsOutput(
|
||||
level,
|
||||
animal,
|
||||
player,
|
||||
plushieMods,
|
||||
player.stages,
|
||||
);
|
||||
if (droppedLoot !== -1) {
|
||||
server.runCommandSilent(
|
||||
`playsound minecraft:entity.sheep.shear block @a ${player.x} ${player.y} ${player.z}`
|
||||
);
|
||||
for (let i = 0; i < droppedLoot.length; i++) {
|
||||
let specialItem = level.createEntity("minecraft:item");
|
||||
let dropItem = droppedLoot[i];
|
||||
specialItem.x = player.x;
|
||||
specialItem.y = player.y;
|
||||
specialItem.z = player.z;
|
||||
specialItem.item = dropItem;
|
||||
specialItem.spawn();
|
||||
}
|
||||
level.spawnParticles(
|
||||
"snowyspirit:glow_light",
|
||||
true,
|
||||
block.x,
|
||||
block.y + 0.5,
|
||||
block.z,
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
20,
|
||||
2
|
||||
);
|
||||
global.addItemCooldown(player, item, 1);
|
||||
}
|
||||
}
|
||||
global.setBlockEntityData(block, nbt)
|
||||
if (reset) {
|
||||
server.runCommandSilent(
|
||||
`playsound legendarycreatures:corpse_eater_death block @a ${block.x} ${block.y} ${block.z}`
|
||||
);
|
||||
level.spawnParticles(
|
||||
"species:spectre_smoke",
|
||||
true,
|
||||
block.x,
|
||||
block.y,
|
||||
block.z,
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,189 @@
|
||||
// Priority: 0
|
||||
|
||||
global.artisanMachineDefinitions = [
|
||||
{
|
||||
id: "society:loom",
|
||||
recipes: global.loomRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 5,
|
||||
upgrade: "society:tiny_gnome",
|
||||
},
|
||||
{
|
||||
id: "society:cheese_press",
|
||||
recipes: global.cheesePressRecipes,
|
||||
stageCount: 2,
|
||||
maxInput: 1,
|
||||
upgrade: "society:pink_matter",
|
||||
},
|
||||
{
|
||||
id: "society:wine_keg",
|
||||
recipes: global.wineKegRecipes,
|
||||
stageCount: 6,
|
||||
maxInput: 3,
|
||||
upgrade: "society:gray_anatomy",
|
||||
},
|
||||
{
|
||||
id: "society:aging_cask",
|
||||
recipes: global.agingCaskRecipes,
|
||||
stageCount: 10,
|
||||
maxInput: 1,
|
||||
upgrade: "society:broken_clock",
|
||||
},
|
||||
{
|
||||
id: "society:ancient_cask",
|
||||
recipes: global.ancientCaskRecipes,
|
||||
stageCount: 20,
|
||||
maxInput: 1,
|
||||
upgrade: "society:inserter",
|
||||
},
|
||||
{
|
||||
id: "society:crystalarium",
|
||||
recipes: global.crystalariumCrystals,
|
||||
stageCount: 5,
|
||||
maxInput: 1,
|
||||
upgrade: "society:black_opal",
|
||||
},
|
||||
{
|
||||
id: "society:deluxe_worm_farm",
|
||||
recipes: global.deluxeWormFarmRecipes,
|
||||
stageCount: 2,
|
||||
maxInput: 4,
|
||||
upgrade: "society:infinity_worm",
|
||||
},
|
||||
{
|
||||
id: "society:fish_smoker",
|
||||
recipes: global.fishSmokerRecipes,
|
||||
stageCount: 2,
|
||||
maxInput: 1,
|
||||
upgrade: "society:ancient_roe",
|
||||
},
|
||||
{
|
||||
id: "society:bait_maker",
|
||||
recipes: global.baitMakerRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 1,
|
||||
},
|
||||
{
|
||||
id: "society:dehydrator",
|
||||
recipes: global.dehydratorRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 8,
|
||||
upgrade: "society:cordycep",
|
||||
},
|
||||
{
|
||||
id: "society:mayonnaise_machine",
|
||||
recipes: global.mayonnaiseMachineRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 1,
|
||||
upgrade: "society:enkephalin",
|
||||
},
|
||||
{
|
||||
id: "society:preserves_jar",
|
||||
recipes: global.preservesJarRecipes,
|
||||
stageCount: 3,
|
||||
maxInput: 5,
|
||||
upgrade: "society:stone_hand",
|
||||
},
|
||||
{
|
||||
id: "society:seed_maker",
|
||||
recipes: global.seedMakerRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 3,
|
||||
upgrade: "society:ancient_cog",
|
||||
},
|
||||
{
|
||||
id: "society:charging_rod",
|
||||
recipes: "society:battery",
|
||||
stageCount: 5,
|
||||
maxInput: 1,
|
||||
upgrade: "society:frosted_tip",
|
||||
},
|
||||
{
|
||||
id: "society:espresso_machine",
|
||||
recipes: global.espressoMachineRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 4,
|
||||
},
|
||||
{
|
||||
id: "society:tapper",
|
||||
recipes: global.tapperRecipes,
|
||||
stageCount: 7,
|
||||
maxInput: 1,
|
||||
},
|
||||
{
|
||||
id: "society:recycling_machine",
|
||||
recipes: global.recyclingMachineRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 1,
|
||||
upgrade: "society:recycled_core",
|
||||
},
|
||||
{
|
||||
id: "society:oil_maker",
|
||||
recipes: global.oilMakerRecipes,
|
||||
stageCount: 1,
|
||||
maxInput: 1,
|
||||
},
|
||||
{
|
||||
id: "society:mushroom_log",
|
||||
recipes: global.mushroomLogRecipes,
|
||||
stageCount: 4,
|
||||
maxInput: 1,
|
||||
},
|
||||
];
|
||||
|
||||
global.artisanMachineIds = global.artisanMachineDefinitions.map((x) => x.id);
|
||||
|
||||
global.typeConversionMap = [
|
||||
{
|
||||
id: "society:loom",
|
||||
output: ["society:merino_wool"],
|
||||
},
|
||||
{
|
||||
id: "society:cheese_press",
|
||||
output: ["society:aged_warped_cheese_block"],
|
||||
},
|
||||
{
|
||||
id: "society:aging_cask",
|
||||
output: ["society:aged_star_coquito"],
|
||||
},
|
||||
{
|
||||
id: "society:ancient_cask",
|
||||
output: ["society:double_aged_star_coquito"],
|
||||
},
|
||||
{
|
||||
id: "society:deluxe_worm_farm",
|
||||
output: ["4x crabbersdelight:deluxe_crab_trap_bait"],
|
||||
},
|
||||
{
|
||||
id: "society:fish_smoker",
|
||||
output: ["society:smoked_spindlefish"],
|
||||
},
|
||||
{
|
||||
id: "society:dehydrator",
|
||||
output: ["society:dried_starfruit"],
|
||||
},
|
||||
{
|
||||
id: "society:mayonnaise_machine",
|
||||
output: ["society:supreme_mayonnaise"],
|
||||
},
|
||||
{
|
||||
id: "society:preserves_jar",
|
||||
output: ["society:starfruit_preserves"],
|
||||
},
|
||||
{
|
||||
id: "society:charging_rod",
|
||||
output: ["society:battery"],
|
||||
},
|
||||
{
|
||||
id: "society:tapper",
|
||||
output: ["society:pine_tar"],
|
||||
},
|
||||
{
|
||||
id: "society:espresso_machine",
|
||||
output: ["society:espresso"],
|
||||
},
|
||||
{
|
||||
id: "society:recycling_machine",
|
||||
output: ["4x society:sparkstone"],
|
||||
},
|
||||
];
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,125 @@
|
||||
const relicTroveTable = [
|
||||
{
|
||||
drop: "#society:relics",
|
||||
drop_chance: 1,
|
||||
},
|
||||
{
|
||||
drop: "#society:treasure_books",
|
||||
drop_chance: 0.05,
|
||||
},
|
||||
{
|
||||
drop: "#society:relic_treasure",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
{
|
||||
drop: "#society:relic_treasure",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
,
|
||||
{
|
||||
drop: "#society:relic_treasure",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
,
|
||||
{
|
||||
drop: "#society:relic_treasure",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
,
|
||||
{
|
||||
drop: "#society:relic_treasure",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
];
|
||||
|
||||
const artifactTroveTable = [
|
||||
{
|
||||
drop: "#society:artifacts",
|
||||
drop_chance: 1,
|
||||
},
|
||||
{
|
||||
drop: "#society:treasure_books",
|
||||
drop_chance: 0.05,
|
||||
},
|
||||
];
|
||||
const geodeLootTable = [
|
||||
{
|
||||
drop: "#society:geode_junk",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
{
|
||||
drop: "#society:geode_bonus",
|
||||
drop_chance: 0.3,
|
||||
},
|
||||
{
|
||||
drop: "#society:geode_treasure",
|
||||
drop_chance: 0.2,
|
||||
},
|
||||
{
|
||||
drop: "#society:geode_relic",
|
||||
drop_chance: 0.01,
|
||||
},
|
||||
];
|
||||
const frozenGeodeLootTable = [
|
||||
{
|
||||
drop: "#society:geode_junk",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
{
|
||||
drop: "#society:frozen_geode_bonus",
|
||||
drop_chance: 0.3,
|
||||
},
|
||||
{
|
||||
drop: "#society:frozen_geode_treasure",
|
||||
drop_chance: 0.2,
|
||||
},
|
||||
{
|
||||
drop: "#society:frozen_geode_relic",
|
||||
drop_chance: 0.01,
|
||||
},
|
||||
];
|
||||
const magmaGeodeLootTable = [
|
||||
{
|
||||
drop: "#society:geode_junk",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
{
|
||||
drop: "#society:magma_geode_bonus",
|
||||
drop_chance: 0.3,
|
||||
},
|
||||
{
|
||||
drop: "#society:magma_geode_treasure",
|
||||
drop_chance: 0.2,
|
||||
},
|
||||
{
|
||||
drop: "#society:magma_geode_relic",
|
||||
drop_chance: 0.01,
|
||||
},
|
||||
];
|
||||
const omniGeodeLootTable = [
|
||||
{
|
||||
drop: "#society:geode_junk",
|
||||
drop_chance: 0.9,
|
||||
},
|
||||
{
|
||||
drop: "#society:omni_geode_bonus",
|
||||
drop_chance: 0.4,
|
||||
},
|
||||
{
|
||||
drop: "#society:omni_geode_treasure",
|
||||
drop_chance: 0.6,
|
||||
},
|
||||
{
|
||||
drop: "#society:omni_geode_special",
|
||||
drop_chance: 0.03,
|
||||
},
|
||||
];
|
||||
|
||||
global.extractinatorRecipes = [
|
||||
{ input: "society:relic_trove", output: relicTroveTable },
|
||||
{ input: "society:artifact_trove", output: artifactTroveTable },
|
||||
{ input: "society:geode", output: geodeLootTable },
|
||||
{ input: "society:frozen_geode", output: frozenGeodeLootTable },
|
||||
{ input: "society:magma_geode", output: magmaGeodeLootTable },
|
||||
{ input: "society:omni_geode", output: omniGeodeLootTable },
|
||||
];
|
||||
@@ -0,0 +1,561 @@
|
||||
// Priority: 1000
|
||||
// Spring Fish
|
||||
global.springOcean = [
|
||||
{ fish: "aquaculture:atlantic_herring", weight: 16 },
|
||||
{ fish: "aquaculture:atlantic_herring", weight: 16, night: true },
|
||||
{ fish: "minecraft:pufferfish", weight: 9, night: true, requiresClear: true },
|
||||
{ fish: "aquaculture:jellyfish", weight: 9, night: true },
|
||||
{ fish: "minecraft:tropical_fish", weight: 8 },
|
||||
{ fish: "minecraft:tropical_fish", weight: 8, night: true },
|
||||
{ fish: "unusualfishmod:raw_drooping_gourami", weight: 6 },
|
||||
{ fish: "aquaculture:atlantic_halibut", weight: 4, requiresRain: true },
|
||||
{ fish: "unusualfishmod:raw_spindlefish", weight: 3, night: true },
|
||||
];
|
||||
global.springRiver = [
|
||||
{ fish: "aquaculture:minnow", weight: 11 },
|
||||
{ fish: "aquaculture:bluegill", weight: 11, night: true },
|
||||
{ fish: "aquaculture:smallmouth_bass", weight: 9 },
|
||||
{ fish: "aquaculture:smallmouth_bass", weight: 9, night: true },
|
||||
{ fish: "minecraft:cod", weight: 10 },
|
||||
{ fish: "minecraft:cod", weight: 10, night: true },
|
||||
{ fish: "aquaculture:pink_salmon", weight: 9, night: true },
|
||||
{ fish: "aquaculture:catfish", weight: 8, night: true, requiresRain: true },
|
||||
{ fish: "aquaculture:bayad", weight: 5, night: true, requiresRain: true },
|
||||
{ fish: "unusualfishmod:raw_blind_sailfin", weight: 5 },
|
||||
];
|
||||
global.springFresh = [
|
||||
{ fish: "aquaculture:minnow", weight: 11 },
|
||||
{ fish: "aquaculture:bluegill", weight: 11, night: true },
|
||||
{ fish: "aquaculture:perch", weight: 9 },
|
||||
{ fish: "aquaculture:carp", weight: 9, requiresRain: true },
|
||||
{ fish: "unusualfishmod:raw_beaked_herring", weight: 8 },
|
||||
{ fish: "unusualfishmod:raw_hatchetfish", night: true, weight: 5 },
|
||||
{
|
||||
fish: "unusualfishmod:raw_eyelash",
|
||||
weight: 3,
|
||||
night: true,
|
||||
requiresClear: true,
|
||||
},
|
||||
];
|
||||
|
||||
// Summer fish
|
||||
global.summerOcean = [
|
||||
{ fish: "unusualfishmod:raw_sneep_snorp", weight: 32 },
|
||||
{
|
||||
fish: "minecraft:pufferfish",
|
||||
weight: 30,
|
||||
night: true,
|
||||
requiresClear: true,
|
||||
},
|
||||
{ fish: "aquaculture:jellyfish", weight: 24, night: true },
|
||||
{ fish: "minecraft:tropical_fish", weight: 22 },
|
||||
{ fish: "minecraft:tropical_fish", weight: 22, night: true },
|
||||
{ fish: "aquaculture:red_grouper", weight: 19, night: true },
|
||||
{ fish: "aquaculture:tuna", weight: 15 },
|
||||
{ fish: "aquaculture:capitaine", weight: 10 },
|
||||
{ fish: "aquaculture:goldfish", weight: 4, requiresClear: true },
|
||||
];
|
||||
global.summerRiver = [
|
||||
{ fish: "aquaculture:minnow", weight: 28 },
|
||||
{ fish: "aquaculture:bluegill", weight: 28, night: true },
|
||||
{ fish: "minecraft:salmon", weight: 25 },
|
||||
{ fish: "aquaculture:leech", weight: 23, night: true },
|
||||
{ fish: "aquaculture:smallmouth_bass", weight: 22 },
|
||||
{ fish: "aquaculture:smallmouth_bass", weight: 22, night: true },
|
||||
{ fish: "aquaculture:synodontis", weight: 18, requiresClear: true },
|
||||
{ fish: "aquaculture:tambaqui", weight: 18, night: true },
|
||||
{
|
||||
fish: "aquaculture:box_turtle",
|
||||
weight: 5,
|
||||
night: true,
|
||||
requiresRain: true,
|
||||
},
|
||||
];
|
||||
global.summerFresh = [
|
||||
{ fish: "aquaculture:minnow", weight: 11 },
|
||||
{ fish: "aquaculture:bluegill", weight: 11, night: true },
|
||||
{ fish: "aquaculture:carp", weight: 9 },
|
||||
{ fish: "aquaculture:leech", weight: 9, night: true },
|
||||
{ fish: "aquaculture:piranha", weight: 9, night: true, requiresRain: true },
|
||||
{ fish: "aquaculture:boulti", weight: 5, night: true },
|
||||
{ fish: "crittersandcompanions:koi_fish", weight: 3, requiresClear: true },
|
||||
{ fish: "aquaculture:arapaima", weight: 3, requiresRain: true },
|
||||
{ fish: "unusualfishmod:raw_circus_fish", weight: 2 },
|
||||
];
|
||||
|
||||
// Autumn Fish
|
||||
global.autumnOcean = [
|
||||
{ fish: "aquaculture:blackfish", weight: 22, night: true },
|
||||
{ fish: "aquaculture:blackfish", weight: 22 },
|
||||
{
|
||||
fish: "minecraft:pufferfish",
|
||||
weight: 22,
|
||||
night: true,
|
||||
requiresClear: true,
|
||||
},
|
||||
{
|
||||
fish: "unusualfishmod:raw_picklefish",
|
||||
weight: 22,
|
||||
night: true,
|
||||
requiresRain: true,
|
||||
},
|
||||
{ fish: "unusualfishmod:raw_forkfish", weight: 20 },
|
||||
{ fish: "unusualfishmod:raw_forkfish", weight: 20, night: true },
|
||||
{ fish: "unusualfishmod:raw_sailor_barb", weight: 18 },
|
||||
{ fish: "unusualfishmod:raw_demon_herring", weight: 16, night: true },
|
||||
{
|
||||
fish: "unusualfishmod:raw_copperflame_anthias",
|
||||
weight: 11,
|
||||
night: true,
|
||||
requiresClear: true,
|
||||
},
|
||||
{ fish: "aquaculture:red_shrooma", weight: 8, requiresRain: true },
|
||||
];
|
||||
global.autumnRiver = [
|
||||
{ fish: "aquaculture:minnow", weight: 27 },
|
||||
{ fish: "aquaculture:bluegill", weight: 27, night: true },
|
||||
{ fish: "minecraft:salmon", weight: 26 },
|
||||
{ fish: "aquaculture:brown_trout", weight: 26 },
|
||||
{ fish: "aquaculture:smallmouth_bass", weight: 24 },
|
||||
{ fish: "aquaculture:muskellunge", weight: 18, night: true },
|
||||
{
|
||||
fish: "aquaculture:arrau_turtle",
|
||||
weight: 8,
|
||||
night: true,
|
||||
requiresRain: true,
|
||||
},
|
||||
];
|
||||
global.autumnFresh = [
|
||||
{ fish: "aquaculture:minnow", weight: 11 },
|
||||
{ fish: "aquaculture:bluegill", weight: 11, night: true },
|
||||
{ fish: "aquaculture:perch", weight: 9 },
|
||||
{ fish: "aquaculture:carp", weight: 10 },
|
||||
{ fish: "aquaculture:gar", weight: 5, requiresRain: true },
|
||||
{ fish: "unusualfishmod:raw_bark_angelfish", weight: 4 },
|
||||
{
|
||||
fish: "unusualfishmod:raw_amber_goby",
|
||||
weight: 1,
|
||||
night: true,
|
||||
requiresClear: true,
|
||||
},
|
||||
];
|
||||
|
||||
// Winter Fish
|
||||
global.winterOcean = [
|
||||
{ fish: "aquaculture:atlantic_herring", weight: 27 },
|
||||
{ fish: "aquaculture:atlantic_herring", weight: 27, night: true },
|
||||
{ fish: "aquaculture:blackfish", night: true, weight: 26 },
|
||||
{ fish: "aquaculture:blackfish", weight: 26 },
|
||||
{ fish: "aquaculture:pollock", weight: 25, requiresRain: true },
|
||||
{ fish: "aquaculture:atlantic_cod", weight: 22 },
|
||||
{ fish: "unusualfishmod:raw_triple_twirl_pleco", night: true, weight: 20 },
|
||||
{
|
||||
fish: "unusualfishmod:raw_copperflame_anthias",
|
||||
weight: 15,
|
||||
night: true,
|
||||
requiresClear: true,
|
||||
},
|
||||
{ fish: "aquaculture:pacific_halibut", weight: 10 },
|
||||
{ fish: "aquaculture:brown_shrooma", weight: 8, requiresRain: true },
|
||||
];
|
||||
global.winterRiver = [
|
||||
{ fish: "aquaculture:minnow", weight: 28 },
|
||||
{ fish: "aquaculture:bluegill", weight: 28, night: true },
|
||||
{ fish: "minecraft:cod", weight: 27 },
|
||||
{ fish: "minecraft:cod", weight: 27, night: true },
|
||||
{ fish: "aquaculture:brown_trout", weight: 25 },
|
||||
{ fish: "aquaculture:pink_salmon", weight: 22 },
|
||||
{
|
||||
fish: "unusualfishmod:raw_duality_damselfish",
|
||||
weight: 16,
|
||||
night: true,
|
||||
requiresClear: true,
|
||||
},
|
||||
{ fish: "aquaculture:rainbow_trout", weight: 10, requiresRain: true },
|
||||
{
|
||||
fish: "aquaculture:starshell_turtle",
|
||||
weight: 8,
|
||||
night: true,
|
||||
requiresRain: true,
|
||||
},
|
||||
];
|
||||
global.winterFresh = [
|
||||
{ fish: "aquaculture:minnow", weight: 11 },
|
||||
{ fish: "aquaculture:bluegill", weight: 11, night: true },
|
||||
{ fish: "aquaculture:perch", weight: 9, night: true },
|
||||
{ fish: "aquaculture:carp", weight: 8, night: true },
|
||||
{ fish: "unusualfishmod:raw_snowflake", weight: 8, requiresRain: true },
|
||||
{
|
||||
fish: "unusualfishmod:raw_snowflake",
|
||||
weight: 8,
|
||||
night: true,
|
||||
requiresRain: true,
|
||||
},
|
||||
{ fish: "unusualfishmod:raw_aero_mono", weight: 4 },
|
||||
{ fish: "unusualfishmod:raw_hatchetfish", night: true, weight: 2 },
|
||||
];
|
||||
|
||||
global.getRoe = (fish) => {
|
||||
let fishId = fish.path;
|
||||
if (fishId.includes("raw_")) {
|
||||
if (fishId === "raw_snowflake") fishId = "frosty_fin";
|
||||
else fishId = fishId.substring(4, fishId.length);
|
||||
}
|
||||
return `society:${fishId}_roe`;
|
||||
};
|
||||
|
||||
global.getFishFromRoe = (roe) => {
|
||||
let roeId = roe.split(":")[1].slice(0, -4);
|
||||
if (roeId.includes("frosty_fin")) roeId = "raw_snowflake";
|
||||
return Array.from(global.fishPondDefinitions.keys()).find((fish) =>
|
||||
fish.includes(roeId),
|
||||
);
|
||||
};
|
||||
|
||||
global.getPondProperties = (block) => {
|
||||
const properties = block.getProperties();
|
||||
return {
|
||||
facing: properties.get("facing"),
|
||||
valid: properties.get("valid"),
|
||||
mature: properties.get("mature").toLowerCase(),
|
||||
upgraded: properties.get("upgraded").toLowerCase(),
|
||||
quest: properties.get("quest").toLowerCase(),
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.Player|null} player
|
||||
* @param {Internal.Stages|SocietyStages} stages stages player.stages or fish pond basket NBT stages
|
||||
*/
|
||||
global.handleFishHarvest = (block, player, server, basket, stages) => {
|
||||
const { facing, valid, upgraded, quest } = global.getPondProperties(block);
|
||||
let nbt = block.getEntityData();
|
||||
const { quest_id, type, population, max_population } = nbt.data;
|
||||
const fish = global.fishPondDefinitions.get(type);
|
||||
let additionalMaxRoe = 0;
|
||||
let harvestOutputs = [];
|
||||
if (Math.random() < 0.01 && !stages.has("bullfish_jobs")) {
|
||||
harvestOutputs.push("society:bullfish_jobs");
|
||||
}
|
||||
if (stages.has("caper_catcher")) additionalMaxRoe += 3;
|
||||
if (stages.has("caviar_catcher")) additionalMaxRoe += 2;
|
||||
const fishRoe = global.getRoe(type);
|
||||
const calculateRoe = rnd(
|
||||
Math.floor(population / 4),
|
||||
Math.floor(population / 2) + additionalMaxRoe,
|
||||
);
|
||||
const roeCount = calculateRoe > 1 ? calculateRoe : 1;
|
||||
harvestOutputs.push(`${roeCount}x ${fishRoe}`);
|
||||
if (fish.additionalRewards) {
|
||||
let fishPondRoll = 0;
|
||||
fish.additionalRewards.forEach((reward) => {
|
||||
fishPondRoll = Math.random();
|
||||
let rewardChance = reward.chance;
|
||||
if (upgraded == "true") rewardChance *= 2;
|
||||
if (stages.has("scum_collector")) rewardChance *= 2;
|
||||
if (population >= reward.minPopulation && fishPondRoll <= rewardChance) {
|
||||
// Rewards scale to amount of fish population relative to when reward starts spawning
|
||||
let calculateCount = Math.floor(
|
||||
reward.count *
|
||||
((population - reward.minPopulation) / (10 - reward.minPopulation)),
|
||||
);
|
||||
if (population == 10) calculateCount = reward.count;
|
||||
harvestOutputs.push(
|
||||
`${calculateCount > 1 ? calculateCount : 1}x ${reward.item}`,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
server.runCommandSilent(
|
||||
`playsound stardew_fishing:dwop block @a ${block.x} ${block.y} ${block.z}`,
|
||||
);
|
||||
if (!basket) {
|
||||
global.giveExperience(server, player, "fishing", roeCount * 4);
|
||||
}
|
||||
if (Number(max_population) === 10 && quest === "true") {
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
valid: valid,
|
||||
mature: false,
|
||||
upgraded: upgraded,
|
||||
quest: false,
|
||||
});
|
||||
} else {
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
valid: valid,
|
||||
mature: false,
|
||||
upgraded: upgraded,
|
||||
quest: quest,
|
||||
});
|
||||
}
|
||||
if (basket) return harvestOutputs;
|
||||
harvestOutputs.forEach((item) => {
|
||||
block.popItemFromFace(item, facing);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.Stages|SocietyStages} stages
|
||||
*/
|
||||
global.handleFishExtraction = (block, player, server, stages) => {
|
||||
let nbt = block.getEntityData();
|
||||
const { type, population, non_native_fish } = nbt.data;
|
||||
let naturalPopulation = population - non_native_fish;
|
||||
let result;
|
||||
let resultCount =
|
||||
stages.has("mitosis") && naturalPopulation > 0 ? 2 : 1;
|
||||
let quality = 0;
|
||||
if (stages.has("bullfish_jobs") && Number(naturalPopulation) > 3) {
|
||||
quality = Math.floor((Number(population) - 3) / 2);
|
||||
}
|
||||
if (stages.has("hot_hands") && naturalPopulation > 0) {
|
||||
server.runCommandSilent(
|
||||
`playsound minecraft:block.lava.extinguish block @a ${block.x} ${block.y} ${block.z}`,
|
||||
);
|
||||
let smokedFishId = type.path;
|
||||
if (smokedFishId.includes("raw_")) {
|
||||
if (smokedFishId === "raw_snowflake") smokedFishId = "frosty_fin";
|
||||
else smokedFishId = smokedFishId.substring(4, smokedFishId.length);
|
||||
}
|
||||
result = Item.of(
|
||||
`${resultCount}x ${rnd25() ? "minecraft:coal" : `society:smoked_${smokedFishId}`
|
||||
}`,
|
||||
quality > 0 ? `{quality_food:{quality:${quality}}}` : null,
|
||||
);
|
||||
} else {
|
||||
if (["aquaculture:leech", "aquaculture:minnow"].includes(type)) {
|
||||
result = Item.of(
|
||||
`${resultCount}x ${type}`,
|
||||
quality > 0
|
||||
? `{Damage:0,quality_food:{quality:${quality},effects:[]}}`
|
||||
: `{Damage:0}`,
|
||||
);
|
||||
} else {
|
||||
result = Item.of(
|
||||
`${resultCount}x ${type}`,
|
||||
quality > 0 ? `{quality_food:{quality:${quality},effects:[]}}` : null,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (result) {
|
||||
nbt.merge({
|
||||
data: {
|
||||
population: decreaseStage(population),
|
||||
non_native_fish: naturalPopulation > 0 ? non_native_fish : non_native_fish > 0 ? decreaseStage(non_native_fish) : 0,
|
||||
},
|
||||
});
|
||||
|
||||
global.setBlockEntityData(block, nbt)
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
global.validatePond = (block, level, lavaFish) => {
|
||||
const { x, y, z } = block;
|
||||
const facing = block.properties.get("facing");
|
||||
const pondWaterCheckMap = {
|
||||
north: { startX: 1, startZ: 4, endX: -1, endZ: 1 },
|
||||
south: { startX: -1, startZ: -4, endX: 1, endZ: -1 },
|
||||
east: { startX: -1, startZ: 1, endX: -4, endZ: -1 },
|
||||
west: { startX: 1, startZ: -1, endX: 4, endZ: 1 },
|
||||
};
|
||||
const adjacentPondMap = {
|
||||
north: { xOffset: 1, zOffset: 0 },
|
||||
south: { xOffset: 1, zOffset: 0 },
|
||||
east: { xOffset: 0, zOffset: 1 },
|
||||
west: { xOffset: 0, zOffset: 1 },
|
||||
};
|
||||
const { startX, startZ, endX, endZ } = pondWaterCheckMap[facing];
|
||||
let adjacentPos1 =
|
||||
new BlockPos(
|
||||
x + adjacentPondMap[facing].xOffset,
|
||||
y,
|
||||
z + adjacentPondMap[facing].zOffset,
|
||||
);
|
||||
let adjacentPos2 =
|
||||
new BlockPos(
|
||||
x - adjacentPondMap[facing].xOffset,
|
||||
y,
|
||||
z - adjacentPondMap[facing].zOffset,
|
||||
);
|
||||
|
||||
if (!level.isLoaded(adjacentPos1) || !level.isLoaded(adjacentPos2)) return false;
|
||||
const conflictingPonds = level.getBlock(adjacentPos1).id === "society:fish_pond" || level.getBlock(adjacentPos2).id === "society:fish_pond";
|
||||
let waterAmount = 0;
|
||||
let scannedId = "";
|
||||
let scannedBlockProperties;
|
||||
|
||||
for (let pos of BlockPos.betweenClosed(
|
||||
new BlockPos(x + startX, y, z + startZ),
|
||||
[x + endX, y, z + endZ],
|
||||
)) {
|
||||
if (!level.isLoaded(pos)) return false;
|
||||
|
||||
scannedBlockProperties = level.getBlock(pos).properties;
|
||||
scannedId = level.getBlock(pos).id;
|
||||
if (lavaFish && scannedId === "minecraft:lava") {
|
||||
waterAmount += 1;
|
||||
} else if (
|
||||
!lavaFish &&
|
||||
(scannedId === "minecraft:water" || scannedId === "minecraft:ice")
|
||||
) {
|
||||
waterAmount += 1;
|
||||
} else if (
|
||||
!lavaFish &&
|
||||
scannedBlockProperties &&
|
||||
scannedBlockProperties.get("waterlogged") == "true"
|
||||
) {
|
||||
waterAmount += 1;
|
||||
} else if (level.getBlock(pos).hasTag("society:fish_pond_water")) {
|
||||
waterAmount += 1;
|
||||
}
|
||||
}
|
||||
if (waterAmount !== 12 || conflictingPonds) return false;
|
||||
return true;
|
||||
};
|
||||
|
||||
const fishPondTickRate = 200;
|
||||
|
||||
const fishPondProgTime = 40;
|
||||
|
||||
global.convertPondFromLegacy = (block) => {
|
||||
let nbt = block.getEntityData();
|
||||
let newRecipe;
|
||||
if (!nbt.data.contains("type")) return;
|
||||
if (!String(nbt.data.type).includes(":")) {
|
||||
newRecipe = Array.from(global.fishPondDefinitions.keys())[
|
||||
Number(nbt.data.type) - 1
|
||||
];
|
||||
if (newRecipe) {
|
||||
nbt.merge({ data: { type: newRecipe } });
|
||||
global.setBlockEntityData(block, nbt)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
global.handleFishPondTick = (tickEvent) => {
|
||||
const { block, level } = tickEvent;
|
||||
const { x, y, z } = block;
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
let blockProperties = level.getBlock(block.pos).getProperties();
|
||||
|
||||
let nbt = block.getEntityData();
|
||||
if (
|
||||
blockProperties.get("mature") === "true" &&
|
||||
String(nbt.data.type).includes(":")
|
||||
)
|
||||
return;
|
||||
const { facing, valid, mature, upgraded, quest } = global.getPondProperties(
|
||||
level.getBlock(block.pos),
|
||||
);
|
||||
const { type, population, max_population, non_native_fish } = nbt.data;
|
||||
if (type == 0) {
|
||||
let defaultNbt = block.getEntityData();
|
||||
defaultNbt.merge({ data: { type: "" } });
|
||||
global.setBlockEntityData(block, defaultNbt);
|
||||
return;
|
||||
}
|
||||
if (!String(type).includes(":")) {
|
||||
global.convertPondFromLegacy(block);
|
||||
return;
|
||||
}
|
||||
const fish = global.fishPondDefinitions.get(type);
|
||||
if (!type.equals("") && tickEvent.tick % 20 === 0) {
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
valid: global.validatePond(block, level, fish.lava),
|
||||
mature: mature,
|
||||
upgraded: upgraded,
|
||||
quest: quest,
|
||||
});
|
||||
}
|
||||
if (
|
||||
morningModulo >= fishPondProgTime &&
|
||||
morningModulo < fishPondProgTime + fishPondTickRate
|
||||
) {
|
||||
if (!type.equals("") && valid === "true") {
|
||||
if (Number(population) > 1) {
|
||||
level.spawnParticles(
|
||||
"supplementaries:suds",
|
||||
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(2, 6),
|
||||
0.001,
|
||||
);
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
valid: valid,
|
||||
mature: true,
|
||||
upgraded: upgraded,
|
||||
quest: quest,
|
||||
});
|
||||
}
|
||||
if (Number(max_population) === 10 && quest === "true") {
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
valid: valid,
|
||||
mature: false,
|
||||
upgraded: upgraded,
|
||||
quest: false,
|
||||
});
|
||||
}
|
||||
if (
|
||||
Number(max_population) !== 10 &&
|
||||
quest !== "true" &&
|
||||
rnd75() &&
|
||||
population == max_population
|
||||
) {
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
valid: valid,
|
||||
mature: false,
|
||||
upgraded: upgraded,
|
||||
quest: true,
|
||||
});
|
||||
let questCount = getRequestedItems(type, max_population).length;
|
||||
nbt.merge({
|
||||
data: {
|
||||
quest_id: `${Math.min(Math.floor(rnd(0, questCount)), questCount - 1)}`,
|
||||
},
|
||||
});
|
||||
global.setBlockEntityData(block, nbt)
|
||||
} else if (population < max_population) {
|
||||
successParticles(level, block);
|
||||
level.server.runCommandSilent(
|
||||
`playsound supplementaries:item.bubble_blower block @a ${block.x} ${block.y} ${block.z}`,
|
||||
);
|
||||
nbt.merge({ data: { population: increaseStage(population) } });
|
||||
global.setBlockEntityData(block, nbt)
|
||||
} else if (population > max_population) {
|
||||
nbt.merge({ data: { population: max_population } });
|
||||
global.setBlockEntityData(block, nbt)
|
||||
}
|
||||
|
||||
if (population === max_population && non_native_fish > 0) {
|
||||
nbt.merge({
|
||||
data: { non_native_fish: decreaseStage(non_native_fish) },
|
||||
});
|
||||
global.setBlockEntityData(block, nbt)
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
global.hasBobber = (rod, bobberId) => {
|
||||
let stringNbt = rod.nbt.toString();
|
||||
if (
|
||||
rod.id == "minecraft:fishing_rod" ||
|
||||
rod.id == "netherdepthsupgrade:lava_fishing_rod"
|
||||
) {
|
||||
return stringNbt.includes(`{bobber:{Count:1b,id:"${bobberId}"}}`);
|
||||
} else {
|
||||
return stringNbt.includes(`{Count:1b,Slot:3,id:"${bobberId}"}`);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,776 @@
|
||||
global.lootFurniture = [
|
||||
"tanukidecor:antique_bookcase",
|
||||
"tanukidecor:wooden_block_stool",
|
||||
"tanukidecor:ship_in_a_bottle",
|
||||
"tanukidecor:red_mushroom_bed",
|
||||
"tanukidecor:blue_lamp",
|
||||
"tanukidecor:antique_bureau",
|
||||
"tanukidecor:rococo_clock",
|
||||
"tanukidecor:gorgeous_stool",
|
||||
"tanukidecor:green_science_pod",
|
||||
"tanukidecor:egyptian_table",
|
||||
"tanukidecor:recognizable_clock",
|
||||
"tanukidecor:purple_rocket_lamp",
|
||||
"tanukidecor:metronome",
|
||||
"tanukidecor:slate_clock",
|
||||
"tanukidecor:blue_table",
|
||||
"tanukidecor:antique_bed",
|
||||
"tanukidecor:gorgeous_table",
|
||||
"tanukidecor:phonograph",
|
||||
"tanukidecor:station_clock",
|
||||
"tanukidecor:egyptian_lamp",
|
||||
"tanukidecor:sweets_sofa",
|
||||
"tanukidecor:minimalist_couch",
|
||||
"tanukidecor:narrow_string_lights",
|
||||
"tanukidecor:wide_blue_streamer",
|
||||
"tanukidecor:egyptian_crest",
|
||||
"tanukidecor:small_striped_vase",
|
||||
"tanukidecor:minimalist_mirror",
|
||||
"tanukidecor:antique_wall_oil_lamp",
|
||||
"tanukidecor:green_wardrobe",
|
||||
"tanukidecor:snowglobe",
|
||||
"tanukidecor:yellow_rocket_lamp",
|
||||
"tanukidecor:newtons_cradle",
|
||||
"tanukidecor:green_mini_drawer",
|
||||
"tanukidecor:minimalist_chair",
|
||||
"tanukidecor:cabana_vanity",
|
||||
"tanukidecor:minimalist_bed",
|
||||
"tanukidecor:small_clock_tower_dial",
|
||||
"tanukidecor:wooden_block_bed",
|
||||
"tanukidecor:large_fireplace",
|
||||
"tanukidecor:regal_wall_lamp",
|
||||
"tanukidecor:log_bench",
|
||||
"tanukidecor:gorgeous_chest",
|
||||
"tanukidecor:green_bed",
|
||||
"tanukidecor:neon_diamond_sign",
|
||||
"tanukidecor:foliot_clock",
|
||||
"tanukidecor:blue_wardrobe",
|
||||
"tanukidecor:blue_bed",
|
||||
"tanukidecor:narrow_red_streamer",
|
||||
"tanukidecor:minimalist_table",
|
||||
"tanukidecor:regal_armoire",
|
||||
"tanukidecor:long_display_case",
|
||||
"tanukidecor:sweets_wall_lamp",
|
||||
"tanukidecor:antique_small_table_with_doily",
|
||||
"tanukidecor:gingerbread_clock",
|
||||
"tanukidecor:display_watch",
|
||||
"tanukidecor:gorgeous_mini_drawer",
|
||||
"tanukidecor:pink_rocket_lamp",
|
||||
"tanukidecor:green_lamp",
|
||||
"tanukidecor:regal_sofa",
|
||||
"tanukidecor:birdcage",
|
||||
"tanukidecor:antique_chair",
|
||||
"tanukidecor:neon_spade_sign",
|
||||
"tanukidecor:antique_clock",
|
||||
"tanukidecor:emblem_clock",
|
||||
"tanukidecor:blue_science_pod",
|
||||
"tanukidecor:small_fireplace",
|
||||
"tanukidecor:cabana_table",
|
||||
"tanukidecor:regal_bookshelf",
|
||||
"tanukidecor:green_counter",
|
||||
"tanukidecor:gorgeous_lamp",
|
||||
"tanukidecor:piano",
|
||||
"tanukidecor:narrow_green_streamer",
|
||||
"tanukidecor:gorgeous_bed",
|
||||
"tanukidecor:neon_club_sign",
|
||||
"tanukidecor:library_clock",
|
||||
"tanukidecor:blue_wall_tarp",
|
||||
"tanukidecor:slot_machine",
|
||||
"tanukidecor:wooden_block_drawers",
|
||||
"tanukidecor:blue_stall_tarp",
|
||||
"tanukidecor:green_pantry",
|
||||
"tanukidecor:brown_mushroom_stool",
|
||||
"tanukidecor:minimalist_small_table",
|
||||
"tanukidecor:train_set",
|
||||
"tanukidecor:narrow_yellow_streamer",
|
||||
"tanukidecor:sweets_closet",
|
||||
"tanukidecor:gorgeous_clock",
|
||||
"tanukidecor:regal_chair",
|
||||
"tanukidecor:gumball_machine",
|
||||
"tanukidecor:firewood",
|
||||
"tanukidecor:wide_green_streamer",
|
||||
"tanukidecor:cuckoo_clock",
|
||||
"tanukidecor:blue_bookshelf",
|
||||
"tanukidecor:alarm_clock",
|
||||
"tanukidecor:wooden_block_table",
|
||||
"tanukidecor:blue_bench",
|
||||
"tanukidecor:mantle_clock",
|
||||
"tanukidecor:cabana_bed",
|
||||
"tanukidecor:green_clock",
|
||||
"tanukidecor:regal_dresser",
|
||||
"tanukidecor:brown_mushroom_table",
|
||||
"tanukidecor:antique_radio",
|
||||
"tanukidecor:regal_clock",
|
||||
"tanukidecor:sweets_bookcase",
|
||||
"tanukidecor:lantern_clock",
|
||||
"tanukidecor:crystal_clock",
|
||||
"tanukidecor:antique_mirror",
|
||||
"tanukidecor:antique_wall_shelf",
|
||||
"tanukidecor:sweets_mini_table",
|
||||
"tanukidecor:minimalist_lamp",
|
||||
"tanukidecor:yellow_wall_tarp",
|
||||
"tanukidecor:blue_chair",
|
||||
"tanukidecor:blue_cabinet",
|
||||
"tanukidecor:wooden_block_toys",
|
||||
"tanukidecor:large_fancy_vase",
|
||||
"tanukidecor:regal_bed",
|
||||
"tanukidecor:wide_red_streamer",
|
||||
"tanukidecor:wooden_block_chair",
|
||||
"tanukidecor:red_mushroom_table",
|
||||
"tanukidecor:antique_small_table",
|
||||
"tanukidecor:owl_clock",
|
||||
"tanukidecor:cash_register",
|
||||
"tanukidecor:classic_vase",
|
||||
"tanukidecor:reed_clock",
|
||||
"tanukidecor:green_chair",
|
||||
"tanukidecor:wide_yellow_streamer",
|
||||
"tanukidecor:antique_sofa",
|
||||
"tanukidecor:wooden_block_bench",
|
||||
"tanukidecor:yellow_stall_tarp",
|
||||
"tanukidecor:blue_rocket_lamp",
|
||||
"tanukidecor:sweets_chair",
|
||||
"tanukidecor:red_mushroom_stool",
|
||||
"tanukidecor:log_stool",
|
||||
"tanukidecor:carriage_clock",
|
||||
"tanukidecor:green_bench",
|
||||
"tanukidecor:blue_clock",
|
||||
"tanukidecor:cabana_screen",
|
||||
"tanukidecor:green_wall_tarp",
|
||||
"tanukidecor:hourglass",
|
||||
"tanukidecor:globe",
|
||||
"tanukidecor:red_mushroom_lamp",
|
||||
"tanukidecor:gorgeous_seat",
|
||||
"tanukidecor:red_wall_tarp",
|
||||
"tanukidecor:red_clock",
|
||||
"tanukidecor:elegant_birdcage",
|
||||
"tanukidecor:minimalist_wardrobe",
|
||||
"tanukidecor:banjo_clock",
|
||||
"tanukidecor:antique_phone",
|
||||
"tanukidecor:red_rocket_lamp",
|
||||
"tanukidecor:narrow_blue_streamer",
|
||||
"tanukidecor:regal_small_table",
|
||||
"tanukidecor:large_clock_tower_dial",
|
||||
"tanukidecor:cabana_lamp",
|
||||
"tanukidecor:orange_science_pod",
|
||||
"tanukidecor:minimalist_stool",
|
||||
"tanukidecor:green_dresser",
|
||||
"tanukidecor:red_stall_tarp",
|
||||
"tanukidecor:egyptian_chair",
|
||||
"tanukidecor:green_desk",
|
||||
"tanukidecor:holiday_tree",
|
||||
"tanukidecor:turquoise_rocket_lamp",
|
||||
"tanukidecor:cabana_armchair",
|
||||
"tanukidecor:gorgeous_closet",
|
||||
"tanukidecor:green_rocket_lamp",
|
||||
"tanukidecor:fancy_vase",
|
||||
"tanukidecor:anniversary_clock",
|
||||
"tanukidecor:regal_vanity",
|
||||
"tanukidecor:blue_dresser",
|
||||
"tanukidecor:regal_lamp",
|
||||
"tanukidecor:minimalist_clock",
|
||||
"tanukidecor:antique_cabinet",
|
||||
"tanukidecor:egyptian_bed",
|
||||
"tanukidecor:red_science_pod",
|
||||
"tanukidecor:minimalist_dresser",
|
||||
"tanukidecor:wide_string_lights",
|
||||
"tanukidecor:antique_table",
|
||||
"tanukidecor:glowing_moss_jar",
|
||||
"tanukidecor:gorgeous_sofa",
|
||||
"tanukidecor:display_case",
|
||||
"tanukidecor:blue_bureau",
|
||||
"tanukidecor:grandfather_clock",
|
||||
"tanukidecor:cabana_bookcase",
|
||||
"tanukidecor:cabana_chair",
|
||||
"tanukidecor:wooden_block_bookshelf",
|
||||
"tanukidecor:rough_log_bench",
|
||||
"tanukidecor:green_stall_tarp",
|
||||
"tanukidecor:sweets_table",
|
||||
"tanukidecor:regal_table",
|
||||
"tanukidecor:gorgeous_desk",
|
||||
"tanukidecor:neon_heart_sign",
|
||||
"tanukidecor:antique_desk",
|
||||
"tanukidecor:sweets_bed",
|
||||
"tanukidecor:cabana_dresser",
|
||||
"tanukidecor:brown_mushroom_lamp",
|
||||
"tanukidecor:sweets_mini_lamp",
|
||||
"tanukidecor:large_striped_vase",
|
||||
"tanukidecor:antique_wardrobe",
|
||||
"tanukidecor:sweets_dresser",
|
||||
"tanukidecor:green_table",
|
||||
"tanukidecor:plasma_ball",
|
||||
"tanukidecor:brown_mushroom_log_stool",
|
||||
"tanukidecor:small_fancy_vase",
|
||||
"tanukidecor:wooden_block_clock",
|
||||
"tanukidecor:handcart",
|
||||
"tanukidecor:gorgeous_counter",
|
||||
"tanukidecor:dessert_case",
|
||||
"tanukidecor:cabana_wardrobe",
|
||||
"tanukidecor:red_mushroom_log_stool",
|
||||
"tanukidecor:brown_mushroom_bed",
|
||||
"furniture:spruce_clock",
|
||||
"furniture:oak_clock",
|
||||
"furniture:mangrove_clock",
|
||||
"furniture:cherry_clock",
|
||||
"furniture:dark_oak_clock",
|
||||
"furniture:acacia_clock",
|
||||
"furniture:jungle_clock",
|
||||
"furniture:birch_clock",
|
||||
"furniture:birch_mirror",
|
||||
"furniture:jungle_mirror",
|
||||
"furniture:spruce_mirror",
|
||||
"furniture:cherry_mirror",
|
||||
"furniture:dark_oak_mirror",
|
||||
"furniture:acacia_mirror",
|
||||
"furniture:oak_mirror",
|
||||
"furniture:mangrove_mirror",
|
||||
"furniture:cash_register",
|
||||
"furniture:iron_fish_tank",
|
||||
"furniture:tool_box",
|
||||
"furniture:sewing_kit",
|
||||
"furniture:explorers_box",
|
||||
"furniture:pells",
|
||||
"furniture:display",
|
||||
"furniture:canvas",
|
||||
"furniture:gramophone",
|
||||
"furniture:telescope",
|
||||
"furniture:boat_in_a_jar",
|
||||
"furniture:copper_fish_tank",
|
||||
"furniture:terrarium",
|
||||
"supplementaries:clock_block",
|
||||
"minecraft:painting",
|
||||
"candlelight:typewriter_copper",
|
||||
"create:cuckoo_clock",
|
||||
"beachparty:chair",
|
||||
"beachparty:beach_chair",
|
||||
"meadow:camera",
|
||||
"beachparty:table",
|
||||
"meadow:wheelbarrow",
|
||||
"beachparty:deck_chair",
|
||||
"beachparty:hammock",
|
||||
"candlelight:typewriter_iron",
|
||||
"brewery:barrel_main",
|
||||
"beachparty:lounge_chair",
|
||||
"beachparty:tiki_chair",
|
||||
"waterframes:projector",
|
||||
"waterframes:big_tv",
|
||||
"waterframes:tv_box",
|
||||
"beautify:warped_picture_frame",
|
||||
"beautify:birch_picture_frame",
|
||||
"beautify:jungle_picture_frame",
|
||||
"beautify:quartz_picture_frame",
|
||||
"beautify:acacia_picture_frame",
|
||||
"beautify:spruce_picture_frame",
|
||||
"beautify:dark_oak_picture_frame",
|
||||
"beautify:oak_picture_frame",
|
||||
"beautify:bookstack",
|
||||
"beautify:crimson_picture_frame",
|
||||
"beautify:lamp_bamboo",
|
||||
"beautify:lamp_jar",
|
||||
"beautify:lamp_light_bulb",
|
||||
"beautify:mangrove_picture_frame",
|
||||
"chimes:bamboo_chimes",
|
||||
"chimes:carved_bamboo_chimes",
|
||||
"chimes:iron_chimes",
|
||||
"chimes:copper_chimes",
|
||||
"chimes:amethyst_chimes",
|
||||
"chimes:glass_bells",
|
||||
"snowyspirit:snow_globe",
|
||||
"supplementaries:cannon",
|
||||
"supplementaries:lunch_basket",
|
||||
"candlelight:sofa",
|
||||
"candlelight:table",
|
||||
"candlelight:dinner_bell",
|
||||
"candlelight:hearth",
|
||||
"candlelight:painting",
|
||||
"candlelight:jewelry_box",
|
||||
"candlelight:chair",
|
||||
"candlelight:lamp",
|
||||
"minecraft:bell",
|
||||
"furniture:coffer",
|
||||
"society:gnome",
|
||||
"whimsy_deco:lucky_cat",
|
||||
"whimsy_deco:froggy_chair",
|
||||
"whimsy_deco:yellow_froggy_chair",
|
||||
"whimsy_deco:pink_froggy_chair",
|
||||
"whimsy_deco:orange_froggy_chair",
|
||||
"whimsy_deco:blue_froggy_chair",
|
||||
"whimsy_deco:black_atm",
|
||||
"whimsy_deco:blue_atm",
|
||||
"whimsy_deco:red_atm",
|
||||
"whimsy_deco:yellow_atm",
|
||||
"whimsy_deco:green_atm",
|
||||
"whimsy_deco:yellow_toy_plane",
|
||||
"whimsy_deco:red_toy_plane",
|
||||
"whimsy_deco:blue_toy_plane",
|
||||
"whimsy_deco:blue_phone",
|
||||
"whimsy_deco:black_phone",
|
||||
"whimsy_deco:red_phone",
|
||||
"whimsy_deco:gatcha_machine",
|
||||
"whimsy_deco:orange_stocking",
|
||||
"whimsy_deco:flamingo_swimming_ring",
|
||||
"whimsy_deco:swan_swimming_ring",
|
||||
"whimsy_deco:black_swan_swimming_ring",
|
||||
"whimsy_deco:traffic_cone",
|
||||
"whimsy_deco:washing_machine",
|
||||
"whimsy_deco:bathroom_rack",
|
||||
"whimsy_deco:bamboo_candle",
|
||||
"whimsy_deco:cash_register",
|
||||
"whimsy_deco:black_cash_register",
|
||||
"whimsy_deco:cowbell",
|
||||
"whimsy_deco:black_curio_cash_register",
|
||||
"whimsy_deco:gold_curio_cash_register",
|
||||
"whimsy_deco:copper_curio_cash_register",
|
||||
"whimsy_deco:iron_curio_cash_register",
|
||||
"whimsy_deco:caution_floor_sign",
|
||||
"whimsy_deco:dartboard",
|
||||
"whimsy_deco:spruce_desk_mirror",
|
||||
"whimsy_deco:oak_desk_mirror",
|
||||
"whimsy_deco:dark_oak_desk_mirror",
|
||||
"whimsy_deco:horseshoe",
|
||||
"whimsy_deco:red_lawn_mower",
|
||||
"whimsy_deco:golden_horseshoe",
|
||||
"whimsy_deco:orange_lawn_mower",
|
||||
"whimsy_deco:bamboo_framed_paper_lantern",
|
||||
"whimsy_deco:yellow_lawn_mower",
|
||||
"whimsy_deco:blue_lawn_mower",
|
||||
"whimsy_deco:matryoshka_doll",
|
||||
"whimsy_deco:paper_lantern",
|
||||
"whimsy_deco:red_paper_lantern",
|
||||
"whimsy_deco:blue_paper_lantern",
|
||||
"whimsy_deco:wood_framed_paper_lantern",
|
||||
"whimsy_deco:tree_paper_lantern",
|
||||
"whimsy_deco:vine_rattan_chair",
|
||||
"whimsy_deco:warped_rattan_chair",
|
||||
"whimsy_deco:rattan_stool",
|
||||
"whimsy_deco:rubber_duck",
|
||||
"whimsy_deco:shower",
|
||||
"whimsy_deco:red_stocking",
|
||||
"whimsy_deco:green_stocking",
|
||||
"whimsy_deco:blue_stocking",
|
||||
"whimsy_deco:moroccan_sofa",
|
||||
"whimsy_deco:orange_life_preserver_ring",
|
||||
"whimsy_deco:yellow_life_preserver_ring",
|
||||
"whimsy_deco:blue_life_preserver_ring",
|
||||
"whimsy_deco:red_life_preserver_ring",
|
||||
"whimsy_deco:recorder",
|
||||
"whimsy_deco:ship_helm",
|
||||
"whimsy_deco:vintage_globe",
|
||||
"whimsy_deco:antique_vintage_globe",
|
||||
"whimsy_deco:broom",
|
||||
"whimsy_deco:push_broom",
|
||||
"whimsy_deco:fan",
|
||||
"whimsy_deco:bronze_cowbell",
|
||||
|
||||
"cluttered:ham_sandwich",
|
||||
"cluttered:pastry_plate",
|
||||
"cluttered:pastry_display_case",
|
||||
"cluttered:gumball_machine_red",
|
||||
"cluttered:gumball_machine_blue",
|
||||
"cluttered:gumball_machine_purple",
|
||||
"cluttered:retro_fridge_white",
|
||||
"cluttered:retro_fridge_yellow",
|
||||
"cluttered:retro_toaster_black",
|
||||
"cluttered:retro_toaster_blue",
|
||||
"cluttered:retro_toaster_pink",
|
||||
"cluttered:retro_toaster_purple",
|
||||
"cluttered:retro_toaster_red",
|
||||
"cluttered:retro_toaster_turquoise",
|
||||
"cluttered:retro_toaster_white",
|
||||
"cluttered:retro_toaster_yellow",
|
||||
"cluttered:tarrytown_stove",
|
||||
"cluttered:flower_tea_kettle",
|
||||
"cluttered:coffee_grinder",
|
||||
"cluttered:analog_kitchen_scale",
|
||||
"cluttered:hanging_cloth",
|
||||
"cluttered:sweetheart_baking_set_bowl",
|
||||
"cluttered:sweetheart_baking_set_ingredients",
|
||||
"cluttered:drying_herbs",
|
||||
"cluttered:salt_pepper_shakers",
|
||||
"cluttered:small_spice_jars",
|
||||
"cluttered:jam_jars",
|
||||
"cluttered:assorted_glass_jars",
|
||||
"cluttered:small_glass_jars",
|
||||
"cluttered:wine_bottles",
|
||||
"cluttered:wine_bottle_rack",
|
||||
"cluttered:seltzer_cans",
|
||||
"cluttered:cat_mugs_cluttered",
|
||||
"cluttered:sliced_bread",
|
||||
"cluttered:pineapple",
|
||||
"cluttered:heart_cake",
|
||||
"cluttered:berry_cake",
|
||||
"cluttered:chocolate_croissant",
|
||||
"cluttered:blueberry_muffin",
|
||||
"cluttered:cinnamon_bun",
|
||||
"cluttered:croissant",
|
||||
"cluttered:pancake_stack",
|
||||
"cluttered:button_stool",
|
||||
"cluttered:cauldron_poster",
|
||||
"cluttered:small_cauldron_set",
|
||||
"cluttered:vial_stand",
|
||||
"cluttered:potion_shelf",
|
||||
"cluttered:retro_cafe_shelf",
|
||||
"cluttered:retro_cafe_shelf_window",
|
||||
"cluttered:black_cat_counter_drawers",
|
||||
"cluttered:black_cat_counter_left_door",
|
||||
"cluttered:black_cat_counter_right_door",
|
||||
"cluttered:black_cat_sink",
|
||||
"cluttered:black_cat_table",
|
||||
"cluttered:sweetheart_counter_drawers",
|
||||
"cluttered:kitchen_set_brown_cabinet_mini",
|
||||
"cluttered:sweetheart_counter_left_door",
|
||||
"cluttered:sweetheart_counter_right_door",
|
||||
"cluttered:sweetheart_sink",
|
||||
"cluttered:sweetheart_table",
|
||||
"cluttered:table",
|
||||
"cluttered:table_with_white_tablecloth",
|
||||
"cluttered:confectionery_table_blue",
|
||||
"cluttered:confectionery_table_pink",
|
||||
"cluttered:dorado_cabinet",
|
||||
"cluttered:dorado_cabinet_cluttered",
|
||||
"cluttered:havana_cabinet",
|
||||
"cluttered:havana_cabinet_cluttered",
|
||||
"cluttered:murex_cabinet",
|
||||
"cluttered:murex_cabinet_cluttered",
|
||||
"cluttered:china_cabinet",
|
||||
"cluttered:general_store_cabinet",
|
||||
"cluttered:retro_fridge_black",
|
||||
"cluttered:retro_fridge_blue",
|
||||
"cluttered:retro_fridge_pink",
|
||||
"cluttered:retro_fridge_purple",
|
||||
"cluttered:retro_fridge_red",
|
||||
"cluttered:retro_fridge_turquoise",
|
||||
"cluttered:antique_map",
|
||||
"cluttered:newspaper_pile_short",
|
||||
"cluttered:newspaper_pile_tall",
|
||||
"cluttered:scattered_papers",
|
||||
"cluttered:paper_pile",
|
||||
"cluttered:office_supplies_a",
|
||||
"cluttered:office_supplies_b",
|
||||
"cluttered:envelope_stack",
|
||||
"cluttered:yellow_notepad",
|
||||
"cluttered:sketchbook_single",
|
||||
"cluttered:cardboard_box_open",
|
||||
"cluttered:filing_box",
|
||||
"cluttered:bulletin_board",
|
||||
"cluttered:bulletin_board_cluttered",
|
||||
"cluttered:card_index",
|
||||
"cluttered:desk_green",
|
||||
"cluttered:desk_brown",
|
||||
"cluttered:desk_green_cluttered",
|
||||
"cluttered:desk_brown_cluttered",
|
||||
"cluttered:flower_desk_lamp",
|
||||
"cluttered:polaroid_camera",
|
||||
"cluttered:polaroids_a",
|
||||
"cluttered:polaroids_b",
|
||||
"cluttered:polaroids_c",
|
||||
"cluttered:box_of_paints",
|
||||
"cluttered:paint_water_jar",
|
||||
"cluttered:sewing_mannequin",
|
||||
"cluttered:sewing_machine_antique",
|
||||
"cluttered:sewing_table_with_tablecloth",
|
||||
"cluttered:sewing_clutter",
|
||||
"cluttered:scissors_and_thread",
|
||||
"cluttered:fabric_bolts",
|
||||
"cluttered:spool_of_thread_yellow",
|
||||
"cluttered:spool_of_thread_green",
|
||||
"cluttered:spool_of_thread_purple",
|
||||
"cluttered:spool_of_thread_pink",
|
||||
"cluttered:endtable_wood",
|
||||
"cluttered:nightstand_green",
|
||||
"cluttered:endtable_decor",
|
||||
"cluttered:violet_screen",
|
||||
"cluttered:safe_novakid",
|
||||
"cluttered:rubiks_cube",
|
||||
"cluttered:rubiks_cube_pastel",
|
||||
"cluttered:heavenly_ornamental_array",
|
||||
"cluttered:stars_pendant",
|
||||
"cluttered:moon_pendant",
|
||||
"cluttered:moon_decoration",
|
||||
"cluttered:garland_black_cat",
|
||||
"cluttered:garland_blossom",
|
||||
"cluttered:garland_bunny",
|
||||
"cluttered:garland_polaroid_a",
|
||||
"cluttered:garland_polaroid_b",
|
||||
"cluttered:garland_sunflower",
|
||||
"cluttered:garland_starry",
|
||||
"cluttered:bamboo_bookshelf",
|
||||
"cluttered:small_bookcase",
|
||||
"cluttered:ancient_codex",
|
||||
"cluttered:antique_book_stand",
|
||||
"cluttered:bunny_book_ends",
|
||||
"cluttered:row_of_small_books",
|
||||
"cluttered:row_of_small_books_pastel",
|
||||
"cluttered:row_of_small_books_shelved",
|
||||
"cluttered:row_of_small_books_pastel_shelved",
|
||||
"cluttered:book_open",
|
||||
"cluttered:stack_of_books",
|
||||
"cluttered:stack_of_books_tall",
|
||||
"cluttered:antique_library_books",
|
||||
"cluttered:rito_wooden_books",
|
||||
"cluttered:osson_pendant_white",
|
||||
"cluttered:osson_pendant_black",
|
||||
"cluttered:osson_pendant_brown",
|
||||
"cluttered:osson_pendant_red",
|
||||
"cluttered:osson_pendant_orange",
|
||||
"cluttered:osson_pendant_yellow",
|
||||
"cluttered:osson_pendant_sage_green",
|
||||
"cluttered:osson_pendant_racing_green",
|
||||
"cluttered:apple_chair",
|
||||
"cluttered:caged_bulb",
|
||||
"cluttered:antique_standing_lamp",
|
||||
"cluttered:stained_glass_lamp",
|
||||
"cluttered:colosseo_wall_lantern",
|
||||
"cluttered:sea_gem_lantern",
|
||||
"cluttered:hoppin_park_lantern",
|
||||
"cluttered:bee_lamp_angry",
|
||||
"cluttered:bee_lamp",
|
||||
"cluttered:honeycomb_lamp",
|
||||
"cluttered:lemon_table",
|
||||
"cluttered:fwish_armchair",
|
||||
"cluttered:fwish_ottoman",
|
||||
"cluttered:fwish_bookcase",
|
||||
"cluttered:mermaid_pearl",
|
||||
"cluttered:mermaid_dresser",
|
||||
"cluttered:rover_mug",
|
||||
"cluttered:rover_stool",
|
||||
"cluttered:briefcase_blank",
|
||||
"cluttered:briefcase_rover",
|
||||
"cluttered:imperial_chair",
|
||||
"cluttered:imperial_table",
|
||||
"cluttered:lunar_observatory_table",
|
||||
"cluttered:lunar_observatory_pedestal_table",
|
||||
"cluttered:lunar_observatory_books",
|
||||
"cluttered:lunar_observatory_basket_of_papers",
|
||||
"cluttered:lunar_observatory_globe",
|
||||
"cluttered:lunar_observatory_jar",
|
||||
"cluttered:cottage_chair",
|
||||
"cluttered:cottage_chair_cushioned",
|
||||
"cluttered:cottage_armchair",
|
||||
"cluttered:cottage_ottoman",
|
||||
"cluttered:cottage_side_table",
|
||||
"cluttered:cottage_standing_lamp",
|
||||
"cluttered:cottage_bookcase",
|
||||
"cluttered:darkwood_chair_geometric",
|
||||
"cluttered:darkwood_chair_quilted",
|
||||
"cluttered:darkwood_chair_southern_flair",
|
||||
"cluttered:darkwood_sofa_geometric",
|
||||
"cluttered:darkwood_sofa_quilted",
|
||||
"cluttered:darkwood_sofa_southern_flair",
|
||||
"cluttered:darkwood_decorative_shelves_geometric",
|
||||
"cluttered:darkwood_decorative_shelves_quilted",
|
||||
"cluttered:darkwood_decorative_shelves_southern_flair",
|
||||
"cluttered:darkwood_endtable",
|
||||
"cluttered:darkwood_table",
|
||||
"cluttered:darkwood_stool",
|
||||
"cluttered:darkwood_cabinet",
|
||||
"cluttered:darkwood_clock",
|
||||
"cluttered:darkwood_bed_geometric",
|
||||
"cluttered:darkwood_bed_quilted",
|
||||
"cluttered:darkwood_bed_southern_flair",
|
||||
"cluttered:wooden_block_bookshelf_pastel",
|
||||
"cluttered:pastel_chair",
|
||||
"cluttered:pastel_stool",
|
||||
"cluttered:pastel_table",
|
||||
"cluttered:pastel_light",
|
||||
"cluttered:pastel_cabinet",
|
||||
"cluttered:pastel_wardrobe",
|
||||
"cluttered:pastel_bed",
|
||||
"cluttered:brass_key",
|
||||
"cluttered:steampunk_lamp",
|
||||
"cluttered:steampunk_globe",
|
||||
"cluttered:blue_mushroom_table",
|
||||
"cluttered:blue_mushroom_wardrobe",
|
||||
"cluttered:blue_mushroom_bed",
|
||||
"cluttered:blue_mushroom_tv",
|
||||
"cluttered:blue_mushroom_lamp",
|
||||
"cluttered:red_mushroom_table",
|
||||
"cluttered:red_mushroom_wardrobe",
|
||||
"cluttered:red_mushroom_bed",
|
||||
"cluttered:red_mushroom_tv",
|
||||
"cluttered:red_mushroom_lamp",
|
||||
"cluttered:picnic_basket",
|
||||
"cluttered:picnic_basket_prepared",
|
||||
"cluttered:basket_of_produce",
|
||||
"cluttered:basket_of_flowers",
|
||||
"cluttered:birdhouse_unpainted",
|
||||
"cluttered:birdhouse_red",
|
||||
"cluttered:birdhouse_blue",
|
||||
"cluttered:birdhouse_pastel",
|
||||
"cluttered:cupid_bench",
|
||||
"cluttered:bicycle_yellow",
|
||||
"cluttered:bicycle_with_flowers_yellow",
|
||||
"cluttered:bicycle_blue",
|
||||
"cluttered:bicycle_with_flowers_blue",
|
||||
"cluttered:bicycle_purple",
|
||||
"cluttered:bicycle_with_flowers_purple",
|
||||
"cluttered:bicycle_pink",
|
||||
"cluttered:bicycle_with_flowers_pink",
|
||||
"cluttered:pok_ta_pok_hoop",
|
||||
"cluttered:pok_ta_pok_hoop_snakes",
|
||||
"cluttered:wedding_arch",
|
||||
"cluttered:watering_can",
|
||||
"cluttered:watering_can_copper",
|
||||
"cluttered:small_bush",
|
||||
"cluttered:two_flower_pots",
|
||||
"cluttered:mini_cactus_set",
|
||||
"cluttered:glass_vase_of_flowers",
|
||||
"cluttered:seaweed_planter",
|
||||
"cluttered:cat_plant_pot_black",
|
||||
"cluttered:cat_plant_pot_orange",
|
||||
"cluttered:hanging_plant_pot_flowers",
|
||||
"cluttered:hanging_plant_pot_grass",
|
||||
"cluttered:plant_ladder",
|
||||
"cluttered:fence_shelf_blue",
|
||||
"cluttered:mini_hanging_terrariums",
|
||||
"cluttered:mushroom_jars",
|
||||
"cluttered:mushroom_terrarium_red",
|
||||
"cluttered:mushroom_terrarium_brown",
|
||||
"cluttered:glowshroom_terrarium_yellow",
|
||||
"cluttered:glowshroom_terrarium_green",
|
||||
"cluttered:glowshroom_terrarium_blue",
|
||||
"cluttered:glowshroom_terrarium_purple",
|
||||
"cluttered:glowshroom_terrarium_pink",
|
||||
"cluttered:hanging_shelves_plants",
|
||||
"cluttered:hanging_shelves_pottery",
|
||||
"cluttered:flower_shelf_plant",
|
||||
"cluttered:flower_shelf_blue",
|
||||
"cluttered:flower_shelf_green",
|
||||
"cluttered:flower_shelf_pastel_yellow",
|
||||
"cluttered:flower_shelf_pink",
|
||||
"cluttered:flower_shelf_purple",
|
||||
"cluttered:flower_shelf_yellow",
|
||||
"cluttered:flower_shelf_candle_blue",
|
||||
"cluttered:flower_shelf_candle_green",
|
||||
"cluttered:flower_shelf_candle_pastel_yellow",
|
||||
"cluttered:flower_shelf_candle_pink",
|
||||
"cluttered:flower_shelf_candle_purple",
|
||||
"cluttered:flower_shelf_candle_yellow",
|
||||
"cluttered:small_shelf",
|
||||
"cluttered:small_shelf_pink",
|
||||
"cluttered:record_player_red",
|
||||
"cluttered:record_player_yellow",
|
||||
"cluttered:record_player_blue",
|
||||
"cluttered:record_player_purple",
|
||||
"cluttered:record_player_pink",
|
||||
"cluttered:record_player_brown",
|
||||
"cluttered:record_player_white",
|
||||
"cluttered:traditional_radio",
|
||||
"cluttered:unliving_chair",
|
||||
"cluttered:lovely_love_seat_basic",
|
||||
"cluttered:lovely_love_seat_black",
|
||||
"cluttered:armchair_fuchsia",
|
||||
"cluttered:armchair_ivory",
|
||||
"cluttered:armchair_flower",
|
||||
"cluttered:armchair_strawberry",
|
||||
"cluttered:armchair_heart",
|
||||
"cluttered:armchair_watermelon",
|
||||
"cluttered:armchair_lemon",
|
||||
"cluttered:armchair_starry",
|
||||
"cluttered:armchair_black_cat",
|
||||
"cluttered:madonna_ottoman",
|
||||
"cluttered:antique_mini_table",
|
||||
"cluttered:pedestal_hk",
|
||||
"cluttered:puzzle_piece_table_blue",
|
||||
"cluttered:puzzle_piece_table_green",
|
||||
"cluttered:puzzle_piece_table_red",
|
||||
"cluttered:puzzle_piece_table_yellow",
|
||||
"cluttered:puzzle_piece_table_pastel_blue",
|
||||
"cluttered:puzzle_piece_table_pastel_pink",
|
||||
"cluttered:puzzle_piece_table_pastel_purple",
|
||||
"cluttered:puzzle_piece_table_pastel_yellow",
|
||||
"cluttered:rose_end_table",
|
||||
"cluttered:rose_end_table_black",
|
||||
"cluttered:endtable_amethyst",
|
||||
"cluttered:endtable_bubblegum",
|
||||
"cluttered:endtable_charcoal",
|
||||
"cluttered:endtable_meadow",
|
||||
"cluttered:endtable_periwinkle",
|
||||
"cluttered:endtable_sunshine"
|
||||
];
|
||||
global.originalPlushies = [
|
||||
"whimsy_deco:fufu_plushie",
|
||||
"whimsy_deco:flower_pig_plushie",
|
||||
"whimsy_deco:golden_pig_plushie",
|
||||
"whimsy_deco:big_panda_plushie",
|
||||
"whimsy_deco:singing_frog_plushie",
|
||||
"whimsy_deco:vocal_doll",
|
||||
"whimsy_deco:red_vocal_doll",
|
||||
"tanukidecor:mayoral_mini_figure",
|
||||
"tanukidecor:developer_mini_figure",
|
||||
"perfectplushies:red_fox_plushie",
|
||||
"perfectplushies:snow_fox_plushie",
|
||||
"perfectplushies:fennec_fox_plushie",
|
||||
"perfectplushies:red_ruffed_lemur_plushie",
|
||||
"perfectplushies:red_panda_plushie",
|
||||
"perfectplushies:raccoon_plushie",
|
||||
"perfectplushies:capybara_plushie",
|
||||
"perfectplushies:dog_plushie",
|
||||
"perfectplushies:cat_plushie",
|
||||
"perfectplushies:dolphin_plushie",
|
||||
"perfectplushies:brown_rabbit_plushie",
|
||||
"perfectplushies:white_rabbit_plushie",
|
||||
"perfectplushies:frog_plushie",
|
||||
"perfectplushies:goose_plushie",
|
||||
"perfectplushies:duck_plushie",
|
||||
"perfectplushies:rubber_duck_plushie",
|
||||
"perfectplushies:robin_plushie",
|
||||
"perfectplushies:hummingbird_plushie",
|
||||
"perfectplushies:hippo_plushie",
|
||||
"perfectplushies:mouse_plushie",
|
||||
"perfectplushies:turtle_plushie",
|
||||
"perfectplushies:doe_plushie",
|
||||
"perfectplushies:reindeer_plushie",
|
||||
"perfectplushies:bear_plushie",
|
||||
"perfectplushies:koala_plushie",
|
||||
"perfectplushies:panda_plushie",
|
||||
"perfectplushies:lion_cub_plushie",
|
||||
"perfectplushies:elephant_plushie",
|
||||
"perfectplushies:monkey_plushie",
|
||||
"perfectplushies:seal_plushie",
|
||||
"perfectplushies:hedgehog_plushie",
|
||||
"perfectplushies:aye_aye_plushie",
|
||||
"perfectplushies:quokka_plushie",
|
||||
"kata:ace_kata_doll",
|
||||
"kata:dipp_kata_doll",
|
||||
"kata:foomin_kata_doll",
|
||||
"kata:havana_kata_doll",
|
||||
"kata:honey_kata_doll",
|
||||
"kata:ichigo_kata_doll",
|
||||
"kata:johnson_kata_doll",
|
||||
"kata:june_kata_doll",
|
||||
"kata:jungle_kata_doll",
|
||||
"kata:prince_kata_doll",
|
||||
"kata:geraldine_plushie",
|
||||
"cluttered:pastel_bunny_plushie",
|
||||
"cluttered:sand_seal_plush_blue",
|
||||
"cluttered:sand_seal_plush_green",
|
||||
"cluttered:sand_seal_plush_red",
|
||||
"cluttered:teddy_bear",
|
||||
"kata:fredbear_plushie",
|
||||
"kata:shiny_fredbear_plushie",
|
||||
"kata:princess_fredbear_plushie",
|
||||
"kata:chimera",
|
||||
];
|
||||
|
||||
global.plushies = [];
|
||||
global.originalPlushies.forEach((plushie) => {
|
||||
const splitStr = plushie.split(":");
|
||||
global.plushies.push(`${splitStr[0]}:adv_${splitStr[1]}`);
|
||||
});
|
||||
global.plushieTraits = [
|
||||
{ trait: "aquatic", color: "1", tag: "#minecraft:fishes" },
|
||||
{ trait: "woodsy", color: "2", tag: "#society:raw_logs" },
|
||||
{ trait: "eldritch", color: "3", tag: "#society:eldritch" },
|
||||
{ trait: "wrathful", color: "4", tag: "#minecraft:swords" },
|
||||
{ trait: "sommelier", color: "5", tag: "#candlelight:all_effects" },
|
||||
{ trait: "sunlit", color: "6", tag: "#society:omni_geode_treasure" },
|
||||
{ trait: "hungry", color: "8", tag: "#society:dish" },
|
||||
{ trait: "anxious", color: "8", tag: "#forge:crops" },
|
||||
{ trait: "shy", color: "9", tag: "#society:curtains" },
|
||||
{ trait: "cheerful", color: "a", tag: "#forge:fruits" },
|
||||
{ trait: "chill", color: "b", tag: "#society:chill" },
|
||||
{ trait: "machiavellian", color: "c", tag: "#numismatics:coins" },
|
||||
{ trait: "cutesy", color: "d", tag: "#society:bouquet_bag_flowers" },
|
||||
{ trait: "fashionista", color: "e", tag: "#society:clothing" },
|
||||
{ trait: "neutral", color: "f", tag: "#forge:vegetables" },
|
||||
];
|
||||
@@ -0,0 +1,30 @@
|
||||
// Priority: 1000
|
||||
global.getDay = (level) => Number((Math.floor(Number(level.dayTime() / 24000)) + 1).toFixed());
|
||||
|
||||
/**
|
||||
* I hate this function.
|
||||
*
|
||||
* Expected:
|
||||
* day: 10 | checkedDay: 11 | amount: 1 = true. Day in the past (time commands used)
|
||||
* day: 11 | checkedDay: 10 | amount: 1 = true.
|
||||
* day: 12 | checkedDay: 10 | amount: 1 = false.
|
||||
*
|
||||
* @param {*} day Current world day, usually gotten from global.getDay()
|
||||
* @param {*} checkedDay day to compare to current day
|
||||
* @param {*} amount Amount of days to get the difference of
|
||||
* @returns If the amount is greater than or equal to the amount of days have passed
|
||||
*/
|
||||
global.compareDay = (day, checkedDay, amount) => Number(day) < Number(checkedDay) || Number(day) - Number(checkedDay) >= amount;
|
||||
|
||||
global.getFacingPlusOffset = (facing, pos, offset) => {
|
||||
switch (facing) {
|
||||
case "north":
|
||||
return pos.offset(0, 0, -offset);
|
||||
case "south":
|
||||
return pos.offset(0, 0, offset);
|
||||
case "west":
|
||||
return pos.offset(-offset, 0, 0);
|
||||
case "east":
|
||||
return pos.offset(offset, 0, 0);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* wrapper so that arbitrary stage data can be read using the has() method same as player.stages
|
||||
* @param {string[]} stages
|
||||
* @return {object}
|
||||
*/
|
||||
function SocietyStages(stages) {
|
||||
return {
|
||||
value: stages,
|
||||
has: function (x) {
|
||||
return this.value.toString().includes(String(x));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
global.NO_STAGES = SocietyStages([]);
|
||||
|
||||
const TAG_STRING = Java.loadClass("net.minecraft.nbt.Tag").TAG_STRING;
|
||||
|
||||
/**
|
||||
* reads stages set in block entity NBT data by global.cacheOwner()
|
||||
* @param {Internal.BlockEntityJS} blockEntity
|
||||
* @return {SocietyStages}
|
||||
*/
|
||||
global.getBlockEntityStages = (blockEntity) => {
|
||||
return SocietyStages(
|
||||
blockEntity.data.getList("stages", TAG_STRING).toArray().map((x) => x.toString())
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* cache the stages of a block entity's owner in the block entity's NBT data
|
||||
* cache the existence of the block entity's owner's attributes, regardless of attribute value
|
||||
* if the owner is online, that player is returned, else null is returned
|
||||
* if nothing has ever been cached before, and the owner is not online, stages=[] attributes=[]
|
||||
* @param {Internal.BlockEntityJS} entity
|
||||
* @param {string[]|null|undefined} stagesToFind
|
||||
* @param {string[]|null|undefined} attributesToFind
|
||||
* @return {Internal.Player|null} owner
|
||||
*/
|
||||
global.cacheOwner = (entity, stagesToFind, attributesToFind) => {
|
||||
const { level, block } = entity;
|
||||
let binPlayer = null;
|
||||
level.getServer().players.forEach((p) => {
|
||||
if (p.getUuid().toString() === block.getEntityData().data.owner) {
|
||||
binPlayer = p;
|
||||
}
|
||||
});
|
||||
let nbt = block.getEntityData();
|
||||
if (binPlayer) {
|
||||
if (attributesToFind) {
|
||||
let newAttributes = [];
|
||||
attributesToFind.forEach((attr) => {
|
||||
newAttributes.push({
|
||||
Base: Number(
|
||||
binPlayer.nbt.Attributes.filter((obj) => {
|
||||
return obj.Name === attr;
|
||||
})[0]?.Base
|
||||
),
|
||||
Name: attr,
|
||||
});
|
||||
});
|
||||
nbt.data.attributes = newAttributes;
|
||||
}
|
||||
if (stagesToFind) {
|
||||
let stages = [];
|
||||
stagesToFind.forEach((stage) => {
|
||||
if (binPlayer.stages.has(stage)) stages.push(stage);
|
||||
});
|
||||
nbt.data.stages = stages;
|
||||
}
|
||||
} else {
|
||||
if ((attributesToFind !== null) && !nbt.data.contains("attributes")) {
|
||||
nbt.data.attributes = [];
|
||||
}
|
||||
if ((stagesToFind !== null) && !nbt.data.contains("stages")) {
|
||||
nbt.data.stages = [];
|
||||
}
|
||||
}
|
||||
global.setBlockEntityData(block, nbt);
|
||||
return binPlayer;
|
||||
};
|
||||
@@ -0,0 +1,205 @@
|
||||
const UNIVERSAL_HATED = [
|
||||
"crabbersdelight:jar_of_pickles",
|
||||
"windswept:holly_berries",
|
||||
"crabbersdelight:sea_pickle_juice",
|
||||
"netherdepthsupgrade:lava_pufferfish",
|
||||
"netherdepthsupgrade:eyeball_fish",
|
||||
"minecraft:pufferfish",
|
||||
"autumnity:foul_berries",
|
||||
"society:supreme_mayonnaise",
|
||||
"society:wraptor_mayonnaise",
|
||||
"society:large_duck_mayonnaise",
|
||||
"society:turtle_mayonnaise",
|
||||
"society:large_mayonnaise",
|
||||
"society:mayonnaise",
|
||||
"society:penguin_mayonnaise",
|
||||
"society:birt_mayonnaise",
|
||||
"society:cruncher_mayonnaise",
|
||||
"society:parrot_mayonnaise",
|
||||
"society:turkey_mayonnaise",
|
||||
"minecraft:warped_fungus",
|
||||
"society:coconut_oil",
|
||||
"farmersdelight:rotten_tomato",
|
||||
"minecraft:poisonous_potato",
|
||||
"aquaculture:tin_can",
|
||||
"society:dried_tubabacco_leaf",
|
||||
"minecraft:nether_star",
|
||||
"society:tubabacco_leaf",
|
||||
"society:large_turkey_mayonnaise",
|
||||
"society:petrified_mayonnaise",
|
||||
"society:flamingo_mayonnaise",
|
||||
"society:duck_mayonnaise",
|
||||
"society:goose_mayonnaise",
|
||||
"society:large_goose_mayonnaise",
|
||||
"society:golden_mayonnaise",
|
||||
"society:dragon_mayonnaise",
|
||||
"society:sniffer_mayonnaise",
|
||||
"society:springling_mayonnaise",
|
||||
"farmersdelight:straw",
|
||||
"trials:ominous_bottle",
|
||||
"minecraft:echo_shard",
|
||||
"society:living_flesh",
|
||||
"minecraft:popped_chorus_fruit",
|
||||
"society:large_galliraptor_mayonnaise",
|
||||
"society:galliraptor_mayonnaise",
|
||||
"minecraft:dragon_head",
|
||||
"minecraft:dragon_egg",
|
||||
"vinery:rotten_cherry",
|
||||
"minecraft:crimson_fungus",
|
||||
"quark:dragon_scale",
|
||||
"society:mini_oni_eye",
|
||||
"society:rubber",
|
||||
"society:sap"
|
||||
]
|
||||
const UNIVERSAL_DISLIKED = [
|
||||
"#society:raw_logs",
|
||||
"create:experience_block",
|
||||
"create:experience_nugget",
|
||||
"snowpig:frozen_ham",
|
||||
"society:oil",
|
||||
"snowpig:frozen_porkchop",
|
||||
"twigs:bamboo_thatch",
|
||||
"automobility:dash_panel",
|
||||
"netherdepthsupgrade:bonefish",
|
||||
"netherdepthsupgrade:wither_bonefish",
|
||||
"society:magma_geode",
|
||||
"society:omni_geode",
|
||||
"society:frozen_geode",
|
||||
"society:battery",
|
||||
"society:oak_resin",
|
||||
"society:pine_tar",
|
||||
"beachparty:palm_log",
|
||||
"atmospheric:carmine_husk",
|
||||
"untitledduckmod:goose_foot",
|
||||
"society:geode",
|
||||
"aquaculture:box",
|
||||
"vintagedelight:ghost_charcoal",
|
||||
"trials:trial_key_ominous",
|
||||
"trials:trial_key",
|
||||
"farmersdelight:nether_salad",
|
||||
"vintagedelight:century_egg",
|
||||
"crabbersdelight:kelp_shake",
|
||||
"society:sturdy_bamboo_block"
|
||||
]
|
||||
const UNIVERSAL_LIKED = [
|
||||
"#etcetera:sweaters",
|
||||
"#etcetera:hats",
|
||||
"#society:mineral",
|
||||
"#forge:gems",
|
||||
"#society:pristine_mineral",
|
||||
"minecraft:totem_of_undying",
|
||||
"atmospheric:candied_orange_slices",
|
||||
"quark:diamond_heart",
|
||||
"society:mossberry",
|
||||
"society:mossberry_stew",
|
||||
"crabbersdelight:pearl",
|
||||
"society:furniture_box",
|
||||
"society:ancient_cookie"
|
||||
]
|
||||
const UNIVERSAL_LOVED = [
|
||||
"society:prismatic_shard",
|
||||
"minecraft:rabbit_foot",
|
||||
"herbalbrews:oolong_tea",
|
||||
"society:sunlit_pearl",
|
||||
"vinery:jellie_wine",
|
||||
"society:gnome",
|
||||
"society:bowl_of_soul",
|
||||
"crabbersdelight:pearl_block"
|
||||
]
|
||||
|
||||
const villagerSpecificGifts = new Map([
|
||||
["shepherd", {
|
||||
loved: ["society:mossberry", "society:spider_silk", "society:mocha", "society:dirty_chai", "society:merino_wool"],
|
||||
liked: ["herbalbrews:cinnamon_coffee", "society:cranberry", "society:boysenberry", "society:crystalberry", "society:salmonberry"],
|
||||
neutral: [],
|
||||
disliked: ["#society:mineral"],
|
||||
hated: ["#minecraft:flowers", "#forge:raw_meat", "minecraft:rabbit_foot", "#minecraft:fishes"],
|
||||
}],
|
||||
["banker", {
|
||||
loved: ["society:legendary_ink", "wildernature:bison_horn", "candlelight:beef_wellington", "society:aged_goat_cheese_block", "meadow:goat_cheese_block"],
|
||||
liked: ["society:truffle_oil", "meadow:piece_of_goat_cheese", "society:mystic_syrup", "windswept:goat_stew", "society:ancient_vespertine"],
|
||||
neutral: ["#society:dish"],
|
||||
disliked: ["#society:farmer_product"],
|
||||
hated: ["society:energy_drink", "supplementaries:candy"],
|
||||
}],
|
||||
["blacksmith", {
|
||||
loved: ["society:ember_crystal_cluster", "crittersandcompanions:dragonfly_wing", "windswept:lavender", "herbalbrews:hazelnut_coffee", "bakery:hazelnut_ella"],
|
||||
liked: ["#minecraft:flowers", "#forge:raw_materials", "pamhc2trees:hazelnutitem", "pamhc2trees:roastedhazelnutitem"],
|
||||
neutral: [],
|
||||
disliked: [],
|
||||
hated: [],
|
||||
}],
|
||||
["carpenter", {
|
||||
loved: ["#gamediscs:game_discs", "society:steamy_gadget", "society:mossberry_stew", "trials:heavy_core", "vintagedelight:deluxe_granola_bar"],
|
||||
liked: ["vintagedelight:chocolate_nut_granola_bar", "vintagedelight:fruity_granola_bar", "vinery:straw_hat", "society:mossberry", "create:honeyed_apple"],
|
||||
neutral: ["#society:raw_logs"],
|
||||
disliked: [],
|
||||
hated: [],
|
||||
}],
|
||||
["fisher", {
|
||||
loved: ["unusualfishmod:cooked_aero_mono_stick", "society:princess_hairbrush", "vintagedelight:century_egg", "society:aquamagical_dust", "society:heart_of_neptunium", "minecraft:heart_of_the_sea"],
|
||||
liked: ["#minecraft:fishes", "minecraft:nautilus_shell", "minecraft:echo_shard", "crittersandcompanions:clam", "botania:black_lotus", "#minecraft:decorated_pot_sherds"],
|
||||
neutral: [],
|
||||
disliked: ["crabbersdelight:pearl_block"],
|
||||
hated: [],
|
||||
}],
|
||||
["market", {
|
||||
loved: ["#vinery:red_wine", "society:glitched_vhs", "windswept:elder_feather", "society:latte", "society:tubasmoke_carton", "society:ancient_vespertine"],
|
||||
liked: ["society:tubasmoke_stick", "society:energy_drink", "supplementaries:antique_ink", "herbalbrews:coffee", "untitledduckmod:duck_feather"],
|
||||
neutral: [],
|
||||
disliked: [],
|
||||
hated: ["herbalbrews:milk_coffee", "society:death_liquid"],
|
||||
}],
|
||||
["librarian", {
|
||||
loved: ["#society:clothing"],
|
||||
liked: ["supplementaries:antique_ink", "#society:dish", "society:prismatic_shard", "herbalbrews:oolong_tea", "society:sunlit_pearl", "vinery:jellie_wine", "society:bowl_of_soul"],
|
||||
neutral: ["minecraft:rabbit_foot", "crabbersdelight:pearl_block"],
|
||||
disliked: ["#vinery:red_wine", "#vinery:white_wine"],
|
||||
hated: ["society:tubasmoke_stick", "society:tubasmoke_carton"],
|
||||
}],
|
||||
["witch", {
|
||||
loved: ["#society:eldritch", "society:energy_drink", 'society:pink_energy_drink', 'society:white_energy_drink', 'society:mana_energy_drink', "society:latte", "society:mocha", "society:bowl_of_soul", "herbalbrews:milk_coffee", "herbalbrews:hazelnut_coffee"],
|
||||
liked: ["#society:mineral", "#minecraft:flowers", "herbalbrews:coffee", "society:espresso", "society:dirty_chai", "society:death_liquid"],
|
||||
neutral: ["#society:farmer_product",],
|
||||
disliked: ["society:truffle_tea"],
|
||||
hated: ["#minecraft:fishes", "herbalbrews:witch_hat"],
|
||||
}],
|
||||
["trader", {
|
||||
loved: ["society:star_coquito", "society:starcardi", "society:truffle_tea", 'veggiesdelight:rice_and_vegetables', 'society:chicken_tortilla_soup'],
|
||||
liked: ["snuffles:frosty_fluff", "#society:mineral", "#society:dish", "society:prismatic_shard", "minecraft:rabbit_foot", "society:sunlit_pearl", "crabbersdelight:pearl_block"],
|
||||
neutral: [],
|
||||
disliked: ["#society:clothing"],
|
||||
hated: ["society:gnome", 'society:spider_silk'],
|
||||
}]
|
||||
]);
|
||||
|
||||
const includesItemOrHasTag = (array, item) => {
|
||||
if (array.length === 0) return false;
|
||||
let result = false;
|
||||
array.forEach((element) => {
|
||||
if (!result) {
|
||||
if (element.includes("#")) {
|
||||
result = Item.of(item).hasTag(element.slice(1))
|
||||
} else {
|
||||
result = element.equals(item)
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
global.getVillagerGiftResult = (npcId, gift) => {
|
||||
const giftDefs = villagerSpecificGifts.get(npcId)
|
||||
if (giftDefs) {
|
||||
if (includesItemOrHasTag(giftDefs.loved, gift)) return "loved";
|
||||
if (includesItemOrHasTag(giftDefs.liked, gift)) return "liked";
|
||||
if (includesItemOrHasTag(giftDefs.neutral, gift)) return "neutral";
|
||||
if (includesItemOrHasTag(giftDefs.disliked, gift)) return "disliked";
|
||||
if (includesItemOrHasTag(giftDefs.hated, gift)) return "hated";
|
||||
}
|
||||
if (includesItemOrHasTag(UNIVERSAL_HATED, gift)) return "hated";
|
||||
if (includesItemOrHasTag(UNIVERSAL_DISLIKED, gift)) return "disliked";
|
||||
if (includesItemOrHasTag(UNIVERSAL_LIKED, gift)) return "liked";
|
||||
if (includesItemOrHasTag(UNIVERSAL_LOVED, gift)) return "loved";
|
||||
return "neutral"
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,429 @@
|
||||
// Priority: 1000
|
||||
const calculateQualityValue = (number, quality, doubled) => {
|
||||
let value;
|
||||
if (quality) {
|
||||
if (quality == 1.0) value = Math.round(number * (doubled ? 1.5 : 1.25));
|
||||
if (quality == 2.0) value = Math.round(number * (doubled ? 2 : 1.5));
|
||||
if (quality == 3.0) value = Math.round(number * (doubled ? 3 : 2));
|
||||
} else {
|
||||
value = number;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
// Returns array of coins from price, prioritizing high value coins
|
||||
const calculateCoinsFromValue = (price, output, coinMap) => {
|
||||
for (let i = 0; i < coinMap.length; i++) {
|
||||
let { coin, value } = coinMap[i];
|
||||
if (value <= price) {
|
||||
if (price % value === 0) {
|
||||
output.push({ coin: coin, count: price / value });
|
||||
return output;
|
||||
} else {
|
||||
output.push({ coin: coin, count: Math.floor(price / value) });
|
||||
calculateCoinsFromValue(price % value, output, coinMap);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const textComponentToLegacy = (data) => {
|
||||
const colorMap = {
|
||||
black: "§0", dark_blue: "§1", dark_green: "§2", dark_aqua: "§3",
|
||||
dark_red: "§4", dark_purple: "§5", gold: "§6", gray: "§7",
|
||||
dark_gray: "§8", blue: "§9", green: "§a", aqua: "§b",
|
||||
red: "§c", light_purple: "§d", yellow: "§e", white: "§f"
|
||||
};
|
||||
let prefix = "";
|
||||
if (data.color) prefix += colorMap[data.color.toLowerCase()] ?? "§f";
|
||||
if (data.bold) prefix += "§l";
|
||||
if (data.italic) prefix += "§o";
|
||||
if (data.underlined) prefix += "§n";
|
||||
if (data.strikethrough) prefix += "§m";
|
||||
if (data.obfuscated) prefix += "§k";
|
||||
const text = data.text ?? "";
|
||||
return prefix + text;
|
||||
};
|
||||
|
||||
|
||||
global.getShippingBinName = (nbt, legacy) => {
|
||||
if (nbt && nbt.contains('customName')) {
|
||||
let json = nbt.getString('customName');
|
||||
let data = JSON.parse(json);
|
||||
if (legacy) {
|
||||
return textComponentToLegacy(data);
|
||||
}
|
||||
else {
|
||||
return Text.of(data);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
global.getAttributeMultiplier = (attributes, multiplier) => {
|
||||
return (
|
||||
Number(
|
||||
attributes.filter((obj) => {
|
||||
return obj.Name === multiplier;
|
||||
})[0]?.Base
|
||||
) || 1
|
||||
);
|
||||
};
|
||||
|
||||
global.processShippingBinInventory = (
|
||||
inventory,
|
||||
inventorySlots,
|
||||
attributes,
|
||||
stages,
|
||||
returnRemoved,
|
||||
simulated
|
||||
) => {
|
||||
let calculatedValue = 0;
|
||||
let itemValue = 0;
|
||||
let removedItems = [];
|
||||
let slotItem;
|
||||
let isSellable;
|
||||
let isLongwing
|
||||
for (let i = 0; i < inventorySlots; i++) {
|
||||
slotItem = inventory.getStackInSlot(i).item;
|
||||
isLongwing = ["longwings:moth", "longwings:butterfly"].includes(slotItem.id);
|
||||
isSellable = global.trades.has(String(slotItem.id)) || isLongwing || ["splendid_slimes:plort", "splendid_slimes:slime_heart"].includes(slotItem.id);
|
||||
if (isSellable) {
|
||||
let trade = global.trades.get(String(slotItem.id));
|
||||
let quality = undefined;
|
||||
let doubleQuality = false;
|
||||
let slotNbt = undefined;
|
||||
if (inventory.getStackInSlot(i).hasNBT()) {
|
||||
slotNbt = inventory.getStackInSlot(i).nbt;
|
||||
}
|
||||
if (slotNbt && ((slotNbt.slime && slotNbt.slime.id) || (slotNbt.plort && slotNbt.plort.id))) {
|
||||
if (slotNbt.slime)
|
||||
trade = global.trades.get(`${slotItem.id}/${slotNbt.slime.id}`);
|
||||
if (slotNbt.plort)
|
||||
trade = global.trades.get(`${slotItem.id}/${slotNbt.plort.id}`);
|
||||
}
|
||||
if (slotNbt && isLongwing && slotNbt.variant) {
|
||||
trade = global.trades.get(`longwings:variant/${slotNbt.variant}`);
|
||||
}
|
||||
if (slotNbt && slotNbt.quality_food) {
|
||||
quality = slotNbt.quality_food.quality;
|
||||
}
|
||||
// UPDATE CACHING METHOD WHEN ADDING STAGES
|
||||
if (
|
||||
quality &&
|
||||
quality > 0 &&
|
||||
stages.toString().includes("the_quality_of_the_earth") &&
|
||||
trade.multiplier.equals("shippingbin:crop_sell_multiplier") &&
|
||||
!Item.of(slotItem).hasTag("minecraft:fishes")
|
||||
) {
|
||||
doubleQuality = true;
|
||||
}
|
||||
itemValue = calculateQualityValue(trade.value, quality, doubleQuality);
|
||||
if (
|
||||
stages.toString().includes("bluegill_meridian") &&
|
||||
slotItem.id == "aquaculture:bluegill"
|
||||
) {
|
||||
itemValue = calculateQualityValue(666, quality);
|
||||
}
|
||||
if (
|
||||
stages.toString().includes("phenomenology_of_treasure") &&
|
||||
(Item.of(slotItem).hasTag("society:artifacts") ||
|
||||
Item.of(slotItem).hasTag("society:relics"))
|
||||
) {
|
||||
itemValue *= 3;
|
||||
}
|
||||
if (
|
||||
stages.toString().includes("brine_and_punishment") &&
|
||||
Item.of(slotItem).hasTag("society:brine_and_punishment")
|
||||
) {
|
||||
itemValue *= 2;
|
||||
}
|
||||
if (isLongwing) {
|
||||
let size = 1.0;
|
||||
if (slotNbt.nbt) {
|
||||
if (item.nbt.size && typeof item.nbt.size !== "function") {
|
||||
size = slotNbt.size;
|
||||
}
|
||||
}
|
||||
if (stages.toString().includes("the_metamorphosize")) {
|
||||
itemValue += (Math.round((size / 0.01) * 4) * 3);
|
||||
} else {
|
||||
itemValue += Math.round((size / 0.01) * 4)
|
||||
}
|
||||
}
|
||||
let additionalValue = Math.round(
|
||||
itemValue *
|
||||
inventory.getStackInSlot(i).count *
|
||||
global.getAttributeMultiplier(attributes, trade.multiplier)
|
||||
);
|
||||
if (isNaN(additionalValue)) {
|
||||
console.log("SHIPPING BIN VALUE IS NAN! DEBUG LOG:")
|
||||
console.log("itemValue: " + itemValue)
|
||||
console.log("attrbMult: " + global.getAttributeMultiplier(attributes, trade.multiplier))
|
||||
console.log("Trade Value: " + trade.value)
|
||||
calculatedValue += itemValue * inventory.getStackInSlot(i).count
|
||||
} else {
|
||||
calculatedValue += additionalValue
|
||||
}
|
||||
|
||||
}
|
||||
if (isSellable && !simulated) {
|
||||
if (returnRemoved) removedItems.push(i);
|
||||
else inventory.setStackInSlot(i, "minecraft:air");
|
||||
}
|
||||
}
|
||||
return { calculatedValue: calculatedValue, removedItems: removedItems };
|
||||
};
|
||||
|
||||
const debugValueProcess = false;
|
||||
|
||||
global.handleShippingBinDebt = (
|
||||
value,
|
||||
player,
|
||||
server,
|
||||
block,
|
||||
inventory,
|
||||
extenalOutput
|
||||
) => {
|
||||
if (!player) return value;
|
||||
let playerUUID = player.getUuid().toString();
|
||||
let binDebt = 0;
|
||||
let debtPaid;
|
||||
let totalDebt;
|
||||
let receipt;
|
||||
let newValue = value;
|
||||
if (!playerUUID) return value;
|
||||
if (server.persistentData.debts) {
|
||||
binDebt = server.persistentData.debts.filter((debt) => {
|
||||
return debt.uuid === playerUUID;
|
||||
});
|
||||
}
|
||||
if (binDebt.length > 0 && binDebt[0].amount > 0) {
|
||||
totalDebt = binDebt[0].amount;
|
||||
if (value >= totalDebt) {
|
||||
newValue = value - totalDebt;
|
||||
debtPaid = totalDebt;
|
||||
server.runCommandSilent(
|
||||
global.getEmbersTextAPICommand(
|
||||
player.username,
|
||||
`{anchor:"TOP_LEFT",background:1,color:"#55FF55",size:1,offsetY:36,offsetX:6,typewriter:1,align:"TOP_LEFT"}`,
|
||||
160,
|
||||
Text.translatable(
|
||||
"society.shipping_bin.debt_paid_all",
|
||||
global.formatPrice(debtPaid.toFixed())
|
||||
).toJson()
|
||||
)
|
||||
);
|
||||
global.setDebt(server, playerUUID, 0);
|
||||
} else {
|
||||
debtPaid = value;
|
||||
newValue = 0;
|
||||
server.runCommandSilent(
|
||||
global.getEmbersTextAPICommand(
|
||||
player.username,
|
||||
`{anchor:"TOP_LEFT",background:1,color:"#FFFFFF",size:1,offsetY:36,offsetX:6,typewriter:1,align:"TOP_LEFT"}`,
|
||||
160,
|
||||
Text.translatable(
|
||||
"society.shipping_bin.debt_paid",
|
||||
global.formatPrice(debtPaid.toFixed())
|
||||
).toJson()
|
||||
)
|
||||
);
|
||||
global.setDebt(server, playerUUID, totalDebt - debtPaid);
|
||||
}
|
||||
}
|
||||
if (debtPaid > 0) {
|
||||
let receiptAuthor = global.translatableWithFallback("society.hospital_receipt.author", "Sunlit Valley Hospital").getString();
|
||||
let receiptText = Text.translatable(
|
||||
"society.shipping_bin.debt_paid_note",
|
||||
player.username,
|
||||
global.formatPrice(debtPaid.toFixed()),
|
||||
global.formatPrice(totalDebt.toFixed())
|
||||
).toJson();
|
||||
let receiptTitle = global.translatableWithFallback("society.shipping_bin.debt_paid_note.title", "Debt Payment Receipt").getString();
|
||||
receipt = global.getNotePaperItem(receiptAuthor, receiptText, receiptTitle);
|
||||
if (extenalOutput) {
|
||||
block.popItemFromFace(receipt, block.properties.get("facing"));
|
||||
} else {
|
||||
for (let j = 0; j < inventory.slots; j++) {
|
||||
if (inventory.getStackInSlot(j) === Item.of("minecraft:air")) {
|
||||
inventory.insertItem(j, receipt, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return newValue;
|
||||
};
|
||||
|
||||
global.processValueOutput = (
|
||||
value,
|
||||
slots,
|
||||
removedSlots,
|
||||
player,
|
||||
server,
|
||||
block,
|
||||
inventory,
|
||||
extenalOutput,
|
||||
ownerUUID
|
||||
) => {
|
||||
if (value > 0) {
|
||||
let hasRoom = false;
|
||||
value = Math.round(
|
||||
global.handleShippingBinDebt(
|
||||
value,
|
||||
player,
|
||||
server,
|
||||
block,
|
||||
inventory,
|
||||
extenalOutput
|
||||
)
|
||||
);
|
||||
let outputs = calculateCoinsFromValue(
|
||||
value,
|
||||
[],
|
||||
extenalOutput ? global.coinMap : basicCoinMap
|
||||
);
|
||||
|
||||
if (!outputs) outputs = [];
|
||||
|
||||
if (debugValueProcess) {
|
||||
console.log(`slots: ${slots}`);
|
||||
console.log(`countNonEmpty: ${inventory.countNonEmpty()}`);
|
||||
console.log(`RemovedSlots: ${removedSlots.length}`);
|
||||
console.log(`calculateSlotsNeeded: ${calculateSlotsNeeded(outputs)}`);
|
||||
}
|
||||
hasRoom =
|
||||
extenalOutput ||
|
||||
slots -
|
||||
inventory.countNonEmpty() +
|
||||
removedSlots.length -
|
||||
calculateSlotsNeeded(outputs) >=
|
||||
0;
|
||||
if (hasRoom) {
|
||||
if (!block.level.hasNeighborSignal(block.pos) && player) {
|
||||
server.runCommandSilent(
|
||||
`playsound etcetera:item.handbell.ring block @a ${player.x} ${player.y} ${player.z} 0.3`
|
||||
);
|
||||
let customName = global.getShippingBinName(block.getEntityData().data, true);
|
||||
let finalName = customName ? ` ${customName} ` : "";
|
||||
server.runCommandSilent(
|
||||
global.getEmbersTextAPICommand(
|
||||
player.username,
|
||||
`{anchor:"TOP_LEFT",background:1,color:"#FFFFFF",size:1,offsetY:36,offsetX:6,typewriter:1,align:"TOP_LEFT"}`,
|
||||
160,
|
||||
Text.translatable(
|
||||
"society.shipping_bin.goods_sold",
|
||||
finalName,
|
||||
global.formatPrice(value.toFixed()),
|
||||
).toJson()
|
||||
)
|
||||
);
|
||||
}
|
||||
if (extenalOutput) {
|
||||
let facing = block.properties.get("facing");
|
||||
let account = global.GLOBAL_BANK.getAccount(ownerUUID);
|
||||
let card = inventory.getStackInSlot(0);
|
||||
if (card && card.hasTag("numismatics:cards")) {
|
||||
account = global.GLOBAL_BANK.getAccount(
|
||||
card.nbt.getUUID("AccountID")
|
||||
);
|
||||
}
|
||||
if (account && account.getBalance() + value < 2147483000) {
|
||||
account.deposit(value);
|
||||
} else {
|
||||
outputs.forEach((output) => {
|
||||
let { coin, count } = output;
|
||||
for (let index = 0; index <= count; index += 64) {
|
||||
let difference = count - index;
|
||||
block.popItemFromFace(
|
||||
`${difference > 64 ? 64 : difference}x ${coin}`,
|
||||
facing
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
/**
|
||||
* Basic Shipping Bins only remove items when they're sure there's enough room.
|
||||
* Smart Shipping Bins remove items upon calculation because they output externally.
|
||||
*/
|
||||
for (let i = 0; i < removedSlots.length; i++) {
|
||||
inventory.setStackInSlot(removedSlots[i], "minecraft:air");
|
||||
}
|
||||
outputs.forEach((output) => {
|
||||
let { coin, count } = output;
|
||||
for (let index = 0; index <= count; index += 64) {
|
||||
let difference = count - index;
|
||||
for (let i = 0; i < slots; i++) {
|
||||
if (inventory.getStackInSlot(i).item.id === "minecraft:air") {
|
||||
inventory.setStackInSlot(
|
||||
i,
|
||||
Item.of(`${difference > 64 ? 64 : difference}x ${coin}`)
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasRoom && player) {
|
||||
server.runCommandSilent(
|
||||
`playsound stardew_fishing:fish_escape block @a ${player.x} ${player.y} ${player.z} 0.3`
|
||||
);
|
||||
server.runCommandSilent(
|
||||
global.getEmbersTextAPICommand(
|
||||
player.username,
|
||||
`{anchor:"TOP_LEFT",background:1,color:"#FF5555",size:1,offsetY:36,offsetX:6,typewriter:1,align:"TOP_LEFT"}`,
|
||||
160,
|
||||
Text.translatable("society.shipping_bin.full").toJson()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
global.cacheShippingBin = (entity) => {
|
||||
const { level, block } = entity;
|
||||
const attributeMapping = [
|
||||
"shippingbin:crop_sell_multiplier",
|
||||
"shippingbin:wood_sell_multiplier",
|
||||
"shippingbin:gem_sell_multiplier",
|
||||
"shippingbin:meat_sell_multiplier",
|
||||
];
|
||||
const stagesToFind = [
|
||||
"bluegill_meridian",
|
||||
"phenomenology_of_treasure",
|
||||
"brine_and_punishment",
|
||||
"the_quality_of_the_earth",
|
||||
"the_metamorphosize"
|
||||
];
|
||||
let binPlayer;
|
||||
level.getServer().players.forEach((p) => {
|
||||
if (p.getUuid().toString() === block.getEntityData().data.owner) {
|
||||
let newAttributes = [];
|
||||
let stages = [];
|
||||
attributeMapping.forEach((attr) => {
|
||||
newAttributes.push({
|
||||
Base: Number(
|
||||
p.nbt.Attributes.filter((obj) => {
|
||||
return obj.Name === attr;
|
||||
})[0]?.Base
|
||||
),
|
||||
Name: attr,
|
||||
});
|
||||
});
|
||||
stagesToFind.forEach((stage) => {
|
||||
if (p.stages.has(stage)) stages.push(stage);
|
||||
});
|
||||
let nbt = block.getEntityData();
|
||||
nbt.merge({ data: { attributes: newAttributes, stages: stages } });
|
||||
global.setBlockEntityData(block, nbt)
|
||||
binPlayer = p;
|
||||
}
|
||||
});
|
||||
return binPlayer;
|
||||
};
|
||||
@@ -0,0 +1,65 @@
|
||||
global.translatableWithFallback = (key, fallback) => {
|
||||
if(!fallback) return Text.translatable(key);
|
||||
else return Text.of(NBT.stringTag(`{"translate":"${key}", "fallback":"${fallback}"}`));
|
||||
}
|
||||
|
||||
global.getTranslatedEntityName = (entity_id, fallback) => {
|
||||
return global.translatableWithFallback(`entity.${entity_id.namespace}.${entity_id.path}`, fallback)
|
||||
}
|
||||
|
||||
global.getTranslatedItemName = (item_id, fallback) => {
|
||||
return global.translatableWithFallback(`item.${item_id.namespace}.${item_id.path}`, fallback)
|
||||
}
|
||||
|
||||
global.getTranslatedTextWithColorCode = (colorCode, key) => {
|
||||
switch(colorCode) {
|
||||
case "0":
|
||||
return Text.translatable(key).black();
|
||||
case "1":
|
||||
return Text.translatable(key).darkBlue();
|
||||
case "2":
|
||||
return Text.translatable(key).darkGreen();
|
||||
case "3":
|
||||
return Text.translatable(key).darkAqua();
|
||||
case "4":
|
||||
return Text.translatable(key).darkRed();
|
||||
case "5":
|
||||
return Text.translatable(key).darkPurple();
|
||||
case "6":
|
||||
return Text.translatable(key).gold();
|
||||
case "7":
|
||||
return Text.translatable(key).gray();
|
||||
case "8":
|
||||
return Text.translatable(key).darkGray();
|
||||
case "9":
|
||||
return Text.translatable(key).blue();
|
||||
case "a":
|
||||
return Text.translatable(key).green();
|
||||
case "b":
|
||||
return Text.translatable(key).aqua();
|
||||
case "c":
|
||||
return Text.translatable(key).red();
|
||||
case "d":
|
||||
return Text.translatable(key).lightPurple();
|
||||
case "e":
|
||||
return Text.translatable(key).yellow();
|
||||
case "f":
|
||||
return Text.translatable(key).white();
|
||||
default:
|
||||
return Text.translatable(key);
|
||||
}
|
||||
}
|
||||
|
||||
global.getNotePaperItem = (author, text, title) => {
|
||||
// I want to check argument type and process it,
|
||||
// but I'm not sure how does instanceof work in runtime.
|
||||
// So, This method takes 3 strings.
|
||||
return Item.of(
|
||||
"candlelight:note_paper_written",
|
||||
`{author:"${author}",text:['${text}'],title:"${title}"}`
|
||||
)
|
||||
}
|
||||
|
||||
global.getEmbersTextAPICommand = (target, design, duration, text) => {
|
||||
return `emberstextapi sendcustom ${target} ${design} ${duration} ${text}`
|
||||
}
|
||||
@@ -0,0 +1,697 @@
|
||||
console.info("[SOCIETY] husbandryDefinitions.js loaded");
|
||||
|
||||
const truffleForage = [
|
||||
{
|
||||
item: "society:truffle",
|
||||
countMult: 1,
|
||||
chance: 0.3,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
stage: {
|
||||
name: "triple_truffle",
|
||||
locale: "Triple Truffle",
|
||||
newCountMult: 3,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const fineWoolForage = [
|
||||
{
|
||||
item: "society:fine_wool",
|
||||
countMult: 1,
|
||||
chance: 0.5,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
];
|
||||
|
||||
global.husbandryForagingDefinitions = [
|
||||
{ animal: "minecraft:pig", forages: truffleForage },
|
||||
{ animal: "snowpig:snow_pig", forages: truffleForage },
|
||||
{
|
||||
animal: "minecraft:mooshroom",
|
||||
forages: [
|
||||
{
|
||||
item: "society:truffle",
|
||||
countMult: 1,
|
||||
chance: 0.3,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
stage: {
|
||||
name: "triple_truffle",
|
||||
locale: "Triple Truffle",
|
||||
newCountMult: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
itemPool: [
|
||||
"tanukidecor:brown_mushroom_log_stool",
|
||||
"tanukidecor:red_mushroom_log_stool",
|
||||
"tanukidecor:brown_mushroom_stool",
|
||||
"tanukidecor:red_mushroom_stool",
|
||||
],
|
||||
countMult: 1,
|
||||
chance: 0.04,
|
||||
minHearts: 8,
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
{ animal: "minecraft:sheep", forages: fineWoolForage },
|
||||
{ animal: "meadow:wooly_sheep", forages: fineWoolForage },
|
||||
{
|
||||
animal: "snuffles:snuffle",
|
||||
forages: [
|
||||
{
|
||||
item: "society:fine_wool",
|
||||
countMult: 1,
|
||||
chance: 0.5,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "species:frozen_hair",
|
||||
countMult: 4,
|
||||
chance: 0.2,
|
||||
minHearts: 7,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "wildernature:minisheep",
|
||||
forages: [
|
||||
{
|
||||
item: "society:fine_wool",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 6,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "society:no_name_for_the_sheep",
|
||||
countMult: 1,
|
||||
chance: 0.01,
|
||||
minHearts: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:rabbit",
|
||||
forages: [
|
||||
{
|
||||
item: "society:fine_wool",
|
||||
countMult: 1,
|
||||
chance: 0.33,
|
||||
minHearts: 3,
|
||||
hasQuality: true,
|
||||
stage: { name: "coopmaster", locale: "Coopmaster", newCountMult: 2 },
|
||||
},
|
||||
{
|
||||
item: "minecraft:rabbit_foot",
|
||||
countMult: 1,
|
||||
chance: 0.16,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
stage: { name: "coopmaster", locale: "Coopmaster", newCountMult: 2 },
|
||||
},
|
||||
{
|
||||
item: "wildernature:bunny_stalker_banner",
|
||||
countMult: 1,
|
||||
chance: 0.01,
|
||||
minHearts: 10,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "buzzier_bees:moobloom",
|
||||
forages: [
|
||||
{
|
||||
item: "betterarcheology:growth_totem",
|
||||
countMult: 1,
|
||||
chance: 0.05,
|
||||
minHearts: 10,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "autumnity:snail",
|
||||
forages: [
|
||||
{
|
||||
item: "autumnity:snail_shell_piece",
|
||||
countMult: 2,
|
||||
chance: 1,
|
||||
minHearts: 3,
|
||||
},
|
||||
{
|
||||
item: "farm_and_charm:strawberry",
|
||||
countMult: 5,
|
||||
chance: 1,
|
||||
minHearts: 6,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:sniffer",
|
||||
forages: [
|
||||
{
|
||||
item: "betterarcheology:artifact_shards",
|
||||
countMult: 6,
|
||||
chance: 1,
|
||||
minHearts: 5,
|
||||
},
|
||||
{
|
||||
item: "minecraft:sniffer_egg",
|
||||
countMult: 1,
|
||||
chance: 0.25,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "species:goober",
|
||||
forages: [
|
||||
{
|
||||
item: "species:petrified_egg",
|
||||
countMult: 1,
|
||||
chance: 0.25,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "species:cruncher",
|
||||
forages: [
|
||||
{
|
||||
item: "society:scavenged_food_bag",
|
||||
countMult: 1,
|
||||
chance: 0.4,
|
||||
minHearts: 1
|
||||
},
|
||||
{
|
||||
item: "etcetera:raw_bismuth",
|
||||
countMult: 4,
|
||||
chance: 0.25,
|
||||
minHearts: 5
|
||||
},
|
||||
{
|
||||
item: "quark:dragon_scale",
|
||||
countMult: 1,
|
||||
chance: 0.04,
|
||||
minHearts: 7,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "species:cruncher_egg",
|
||||
countMult: 1,
|
||||
chance: 0.15,
|
||||
minHearts: 8,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:panda",
|
||||
forages: [
|
||||
{
|
||||
itemPool: [
|
||||
"pamhc2trees:mangoitem",
|
||||
"atmospheric:orange",
|
||||
"pamhc2trees:peachitem",
|
||||
"pamhc2trees:pawpawitem",
|
||||
"pamhc2trees:bananaitem",
|
||||
],
|
||||
countMult: 2,
|
||||
chance: 0.75,
|
||||
minHearts: 2,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "crittersandcompanions:red_panda",
|
||||
forages: [
|
||||
{
|
||||
item: "society:ruby",
|
||||
countMult: 3,
|
||||
chance: 0.3,
|
||||
minHearts: 3,
|
||||
},
|
||||
{
|
||||
item: "society:pristine_ruby",
|
||||
countMult: 1,
|
||||
chance: 0.1,
|
||||
minHearts: 10,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "wildernature:squirrel",
|
||||
forages: [
|
||||
{
|
||||
item: "pamhc2trees:hazelnutitem",
|
||||
countMult: 4,
|
||||
chance: 0.25,
|
||||
minHearts: 6,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
itemPool: [
|
||||
"society:salmonberry",
|
||||
"society:boysenberry",
|
||||
"society:cranberry",
|
||||
"society:crystalberry",
|
||||
],
|
||||
countMult: 16,
|
||||
chance: 1,
|
||||
minHearts: 2,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "wildernature:deer",
|
||||
forages: [
|
||||
{
|
||||
itemPool: [
|
||||
"society:dried_sweet_berries",
|
||||
"society:dried_foul_berries",
|
||||
"society:dried_blueberry",
|
||||
"society:dried_strawberry",
|
||||
"society:dried_gearo_berry",
|
||||
"society:dried_glow_berries",
|
||||
],
|
||||
countMult: 6,
|
||||
chance: 0.25,
|
||||
minHearts: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "wildernature:raccoon",
|
||||
forages: [
|
||||
{
|
||||
itemPool: [
|
||||
"furniture:trash_bag",
|
||||
"society:scavenged_food_bag",
|
||||
"vinery:rotten_cherry",
|
||||
"farmersdelight:rotten_tomato",
|
||||
"aquaculture:tin_can",
|
||||
"society:artifact_trove",
|
||||
],
|
||||
countMult: 1,
|
||||
chance: 0.5,
|
||||
minHearts: 3,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:frog",
|
||||
forages: [
|
||||
{
|
||||
item: "society:sap",
|
||||
countMult: 8,
|
||||
chance: 0.3,
|
||||
minHearts: 1,
|
||||
},
|
||||
{
|
||||
item: "crabbersdelight:raw_frog_leg",
|
||||
countMult: 4,
|
||||
chance: 0.1,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "society:ribbit_gadget",
|
||||
countMult: 1,
|
||||
chance: 0.05,
|
||||
minHearts: 7,
|
||||
},
|
||||
{
|
||||
itemPool: [
|
||||
"minecraft:ochre_froglight",
|
||||
"minecraft:verdant_froglight",
|
||||
"minecraft:pearlescent_froglight",
|
||||
],
|
||||
countMult: 8,
|
||||
chance: 0.25,
|
||||
minHearts: 5,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "atmospheric:cochineal",
|
||||
forages: [
|
||||
{
|
||||
item: "atmospheric:carmine_husk",
|
||||
countMult: 8,
|
||||
chance: 1,
|
||||
minHearts: 1,
|
||||
},
|
||||
{
|
||||
item: "pamhc2trees:dragonfruititem",
|
||||
countMult: 4,
|
||||
chance: 0.5,
|
||||
minHearts: 6,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:squid",
|
||||
forages: [
|
||||
{
|
||||
item: "crabbersdelight:raw_squid_tentacles",
|
||||
countMult: 1,
|
||||
chance: 0.2,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "supplementaries:antique_ink",
|
||||
countMult: 1,
|
||||
chance: 0.1,
|
||||
minHearts: 8,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:glow_squid",
|
||||
forages: [
|
||||
{
|
||||
item: "crabbersdelight:raw_glow_squid_tentacles",
|
||||
countMult: 1,
|
||||
chance: 0.1,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "society:legendary_ink",
|
||||
countMult: 1,
|
||||
chance: 0.1,
|
||||
minHearts: 8,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:chicken",
|
||||
forages: [
|
||||
{
|
||||
item: "society:large_egg",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "untitledduckmod:duck",
|
||||
forages: [
|
||||
{
|
||||
item: "society:large_duck_egg",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "untitledduckmod:goose",
|
||||
forages: [
|
||||
{
|
||||
item: "society:large_goose_egg",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "autumnity:turkey",
|
||||
forages: [
|
||||
{
|
||||
item: "society:large_turkey_egg",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "windswept:elder_feather",
|
||||
countMult: 1,
|
||||
chance: 0.2,
|
||||
minHearts: 8,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "species:wraptor",
|
||||
forages: [
|
||||
{
|
||||
item: "species:wraptor_egg",
|
||||
countMult: 2,
|
||||
chance: 1,
|
||||
minHearts: 2,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "wildernature:flamingo",
|
||||
forages: [
|
||||
{
|
||||
item: "society:flamingo_egg",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "wildernature:penguin",
|
||||
forages: [
|
||||
{
|
||||
item: "society:penguin_egg",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 2,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "farmlife:galliraptor",
|
||||
forages: [
|
||||
{
|
||||
item: "society:large_galliraptor_egg",
|
||||
countMult: 1,
|
||||
chance: 1,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "windswept:frostbiter",
|
||||
forages: [
|
||||
{
|
||||
item: "windswept:frozen_branch",
|
||||
countMult: 1,
|
||||
chance: 0.15,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "betterarcheology:artifact_shards",
|
||||
countMult: 12,
|
||||
chance: 1,
|
||||
minHearts: 10,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:bat",
|
||||
forages: [
|
||||
{
|
||||
item: "pamhc2trees:plumitem",
|
||||
countMult: 2,
|
||||
chance: 0.15,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "atmospheric:passion_fruit",
|
||||
countMult: 2,
|
||||
chance: 0.10,
|
||||
minHearts: 8,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
itemPool: [
|
||||
"minecraft:apple",
|
||||
"pamhc2trees:lycheeitem",
|
||||
"pamhc2trees:bananaitem",
|
||||
],
|
||||
countMult: 3,
|
||||
chance: 1,
|
||||
minHearts: 2,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "crittersandcompanions:shima_enaga",
|
||||
forages: [
|
||||
{
|
||||
item: "atmospheric:currant",
|
||||
countMult: 8,
|
||||
chance: 1,
|
||||
minHearts: 2,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "vinery:cherry",
|
||||
countMult: 1,
|
||||
chance: 0.65,
|
||||
minHearts: 4,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "society:mossberry",
|
||||
countMult: 1,
|
||||
chance: 0.1,
|
||||
minHearts: 10,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:turtle",
|
||||
forages: [
|
||||
{
|
||||
item: "minecraft:turtle_egg",
|
||||
countMult: 2,
|
||||
chance: 0.25,
|
||||
minHearts: 5,
|
||||
hasQuality: true,
|
||||
},
|
||||
{
|
||||
item: "crittersandcompanions:dragonfly_wing",
|
||||
countMult: 1,
|
||||
chance: 0.1,
|
||||
minHearts: 9,
|
||||
},
|
||||
{
|
||||
item: "pamhc2trees:starfruititem",
|
||||
countMult: 3,
|
||||
chance: 0.12,
|
||||
minHearts: 10,
|
||||
hasQuality: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
const cowMilk = { sm: "society:milk", lg: "society:large_milk" };
|
||||
|
||||
const sheepMilk = { sm: "society:sheep_milk", lg: "society:large_sheep_milk" };
|
||||
|
||||
global.husbandryMilkingDefinitions = [
|
||||
{ animal: "minecraft:cow", cooldown: 1, milk: cowMilk },
|
||||
{ animal: "minecraft:mooshroom", cooldown: 1, milk: cowMilk },
|
||||
{
|
||||
animal: "buzzier_bees:moobloom",
|
||||
cooldown: 1,
|
||||
milk: { sm: "society:amethyst_milk", lg: "society:large_amethyst_milk" },
|
||||
},
|
||||
{ animal: "meadow:wooly_cow", warped: false, cooldown: 1, milk: cowMilk },
|
||||
{
|
||||
animal: "meadow:wooly_cow",
|
||||
warped: true,
|
||||
cooldown: 2,
|
||||
milk: { sm: "society:warped_milk", lg: "society:large_warped_milk" },
|
||||
},
|
||||
{ animal: "minecraft:sheep", cooldown: 2, milk: sheepMilk },
|
||||
{ animal: "meadow:wooly_sheep", cooldown: 2, milk: sheepMilk },
|
||||
{ animal: "wildernature:minisheep", cooldown: 2, milk: sheepMilk },
|
||||
{
|
||||
animal: "minecraft:goat",
|
||||
cooldown: 1,
|
||||
milk: { sm: "society:goat_milk", lg: "society:large_goat_milk" },
|
||||
},
|
||||
{
|
||||
animal: "meadow:water_buffalo",
|
||||
cooldown: 1,
|
||||
milk: { sm: "society:buffalo_milk", lg: "society:large_buffalo_milk" },
|
||||
},
|
||||
{
|
||||
animal: "wildernature:bison",
|
||||
cooldown: 1,
|
||||
milk: { sm: "society:buffalo_milk", lg: "society:large_buffalo_milk" },
|
||||
},
|
||||
{
|
||||
animal: "farmlife:domestic_tribull",
|
||||
cooldown: 1,
|
||||
milk: { sm: "society:tri_bull_milk", lg: "society:large_tri_bull_milk" },
|
||||
},
|
||||
{
|
||||
animal: "minecraft:squid",
|
||||
cooldown: 1,
|
||||
milk: { sm: "minecraft:ink_sac", lg: "minecraft:ink_sac" },
|
||||
},
|
||||
{
|
||||
animal: "minecraft:glow_squid",
|
||||
cooldown: 1,
|
||||
milk: { sm: "minecraft:glow_ink_sac", lg: "minecraft:glow_ink_sac" },
|
||||
},
|
||||
{
|
||||
animal: "species:mammutilation",
|
||||
cooldown: 2,
|
||||
milk: { sm: "species:ichor_bottle", lg: "species:ichor_bottle" },
|
||||
},
|
||||
{
|
||||
animal: "windswept:frostbiter",
|
||||
cooldown: 1,
|
||||
milk: cowMilk,
|
||||
},
|
||||
];
|
||||
|
||||
global.petGifts = [
|
||||
{ animal: "buzzier_bees:grizzly_bear", gifts: ["society:beemonican_seal"] },
|
||||
{
|
||||
animal: "minecraft:wolf",
|
||||
gifts: ["simplehats:longfoxears", "betterarcheology:wolf_fossil"],
|
||||
},
|
||||
{
|
||||
animal: "minecraft:cat",
|
||||
gifts: ["simplehats:nekoears", "betterarcheology:ocelot_fossil"],
|
||||
},
|
||||
{ animal: "quark:foxhound", gifts: ["simplehats:fireworks"] },
|
||||
{ animal: "quark:shiba", gifts: ["simplehats:eevee_ears"] },
|
||||
{ animal: "minecraft:allay", gifts: ["simplehats:chi_ears"] },
|
||||
{ animal: "minecraft:horse", gifts: ["relics:horse_flute"] },
|
||||
{ animal: "minecraft:polar_bear", gifts: ["simplehats:teddy_bear"] },
|
||||
{ animal: "hamsters:hamster", gifts: ["society:tiny_gnome"] },
|
||||
{ animal: "wildernature:hedgehog", gifts: ["simplehats:sonichood"] },
|
||||
{
|
||||
animal: "wildernature:red_wolf",
|
||||
gifts: ["betterarcheology:wolf_fossil", "wildernature:wolf_trapper_banner"],
|
||||
},
|
||||
{ animal: "wildernature:owl", gifts: ["tanukidecor:owl_clock"] },
|
||||
{ animal: "wildernature:dog", gifts: ["betterarcheology:sheep_fossil"] },
|
||||
{
|
||||
animal: "minecraft:axolotl",
|
||||
gifts: ["simplehats:axolotl_on_head", "beachparty:rubber_ring_axolotl"],
|
||||
},
|
||||
{
|
||||
animal: "crittersandcompanions:ferret",
|
||||
gifts: ["crittersandcompanions:jumping_spider_spawn_egg"],
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,649 @@
|
||||
console.info("[SOCIETY] artisanHopper.js loaded");
|
||||
|
||||
const artisanMachineCanHaveAdditionalOutput = [
|
||||
"society:loom",
|
||||
"society:crystalarium",
|
||||
"society:seed_maker",
|
||||
"society:aging_cask",
|
||||
"society:mayonnaise_machine",
|
||||
"society:wine_keg"
|
||||
];
|
||||
|
||||
/**
|
||||
* @param {Internal.Stages|SocietyStages} stages
|
||||
*/
|
||||
global.handleAdditionalArtisanMachineOutputs = (
|
||||
level,
|
||||
block,
|
||||
artisanMachine,
|
||||
recipes,
|
||||
recipeId,
|
||||
upgraded,
|
||||
stages
|
||||
) => {
|
||||
switch (artisanMachine.id) {
|
||||
case "society:loom": {
|
||||
if (upgraded && rnd25()) {
|
||||
global.insertBelow(
|
||||
level,
|
||||
block,
|
||||
Ingredient.of("#society:loot_furniture").itemIds[
|
||||
Math.floor(
|
||||
Math.random() *
|
||||
Ingredient.of("#society:loot_furniture").itemIds.length
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "society:crystalarium": {
|
||||
if (upgraded && rnd10()) {
|
||||
let recipe = recipes.get(recipeId);
|
||||
if (!recipe) {
|
||||
let legacyType = artisanMachine.getEntityData().data.type;
|
||||
if (legacyType > 0) {
|
||||
let legacyKey = Array.from(recipes.keys())[Number(legacyType) - 1];
|
||||
recipe = recipes.get(legacyKey);
|
||||
}
|
||||
}
|
||||
if (recipe && recipe.output) {
|
||||
recipe.output.forEach((item) => {
|
||||
const pristinePath = String(Item.of(item).id).split(":")[1];
|
||||
if (pristinePath) {
|
||||
global.insertBelow(level, block, `society:pristine_${pristinePath}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "society:seed_maker": {
|
||||
if (upgraded && rnd5()) {
|
||||
global.insertBelow(level, block, "society:ancient_fruit_seed");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "society:aging_cask": {
|
||||
if (stages.has("aged_prize") && rnd5()) {
|
||||
global.insertBelow(level, block, "society:prize_ticket");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "society:wine_keg": {
|
||||
if (upgraded && rnd5()) {
|
||||
global.insertBelow(level, block, "society:relic_trove");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "society:mayonnaise_machine": {
|
||||
if (upgraded && rnd5()) {
|
||||
global.insertBelow(level, block, "society:supreme_mayonnaise");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
// TODO: make artisan hopper set tappers
|
||||
/**
|
||||
* @param {Internal.Stages|SocietyStages} stages
|
||||
*/
|
||||
global.getArtisanMachineData = (player, block, upgraded, stages) => {
|
||||
let machineData = {
|
||||
recipes: [],
|
||||
stageCount: 0,
|
||||
multipleInputs: false,
|
||||
hasTag: false,
|
||||
outputMult: 1,
|
||||
soundType: "minecraft:ui.toast.in",
|
||||
};
|
||||
let rancherOutputCount;
|
||||
if (stages.has("rancher") && Math.random() <= 0.2) {
|
||||
rancherOutputCount = 2;
|
||||
}
|
||||
let machineNbt = block.getEntityData();
|
||||
switch (block.id) {
|
||||
case "society:loom":
|
||||
machineData = {
|
||||
recipes: global.loomRecipes,
|
||||
stageCount: 5,
|
||||
multipleInputs: true,
|
||||
hasTag: true,
|
||||
outputMult: rancherOutputCount,
|
||||
soundType: "minecraft:block.wool.fall",
|
||||
};
|
||||
break;
|
||||
case "society:mayonnaise_machine":
|
||||
machineData = {
|
||||
recipes: global.mayonnaiseMachineRecipes,
|
||||
stageCount: 3,
|
||||
outputMult: rancherOutputCount,
|
||||
soundType: "minecraft:block.sniffer_egg.plop",
|
||||
};
|
||||
break;
|
||||
case "society:preserves_jar":
|
||||
machineData = {
|
||||
recipes: global.preservesJarRecipes,
|
||||
stageCount: upgraded ? 3 : 5,
|
||||
multipleInputs: true,
|
||||
soundType: "minecraft:block.wood.place",
|
||||
};
|
||||
break;
|
||||
case "society:crystalarium":
|
||||
machineData = {
|
||||
recipes: global.crystalariumCrystals,
|
||||
stageCount: 5,
|
||||
soundType: "minecraft:block.amethyst_block.step",
|
||||
};
|
||||
break;
|
||||
case "society:wine_keg":
|
||||
machineData = {
|
||||
recipes: global.wineKegRecipes,
|
||||
stageCount: 3,
|
||||
multipleInputs: true,
|
||||
soundType: "minecraft:block.wood.place",
|
||||
};
|
||||
break;
|
||||
case "society:aging_cask":
|
||||
machineData = {
|
||||
recipes: global.agingCaskRecipes,
|
||||
stageCount: 10,
|
||||
soundType: "minecraft:block.wood.place",
|
||||
};
|
||||
break;
|
||||
case "society:cheese_press":
|
||||
machineData = {
|
||||
recipes: global.cheesePressRecipes,
|
||||
stageCount: 2,
|
||||
outputMult: rancherOutputCount,
|
||||
soundType: "species:block.frozen_meat.place",
|
||||
};
|
||||
break;
|
||||
case "society:ancient_cask":
|
||||
if (stages.has("ancient_aging")) {
|
||||
if (upgraded) {
|
||||
machineData = {
|
||||
recipes: global.ancientCaskRecipes,
|
||||
stageCount: 4,
|
||||
multipleInputs: true,
|
||||
hasTag: false,
|
||||
outputMult: 4,
|
||||
soundType: "",
|
||||
};
|
||||
} else
|
||||
machineData = {
|
||||
recipes: global.ancientCaskRecipes,
|
||||
stageCount: 20,
|
||||
soundType: "minecraft:block.wood.place",
|
||||
};
|
||||
} else machineData = undefined;
|
||||
break;
|
||||
case "society:dehydrator":
|
||||
machineData = {
|
||||
recipes: global.dehydratorRecipes,
|
||||
stageCount: 8,
|
||||
multipleInputs: true,
|
||||
soundType: "species:block.alphacene_foliage.place",
|
||||
};
|
||||
break;
|
||||
case "society:deluxe_worm_farm":
|
||||
machineData = {
|
||||
recipes: global.deluxeWormFarmRecipes,
|
||||
stageCount: 4,
|
||||
multipleInputs: true,
|
||||
soundType: "aquaculture:fish_flop",
|
||||
};
|
||||
break;
|
||||
case "society:seed_maker":
|
||||
machineData = {
|
||||
recipes: global.seedMakerRecipes,
|
||||
stageCount: 3,
|
||||
multipleInputs: true,
|
||||
soundType: "unusualfishmod:crab_scuttling",
|
||||
};
|
||||
break;
|
||||
case "society:fish_smoker":
|
||||
machineData = {
|
||||
recipes: global.fishSmokerRecipes,
|
||||
stageCount: 5,
|
||||
outputMult: upgraded ? 2 : 1,
|
||||
soundType: "farmersdelight:block.skillet.add_food",
|
||||
};
|
||||
break;
|
||||
case "society:espresso_machine":
|
||||
machineData = {
|
||||
recipes: global.espressoMachineRecipes,
|
||||
stageCount: 4,
|
||||
multipleInputs: true,
|
||||
soundType: "doapi:brewstation_whistle",
|
||||
};
|
||||
break;
|
||||
case "society:bait_maker":
|
||||
machineData = {
|
||||
recipes: global.baitMakerRecipes,
|
||||
stageCount: 1,
|
||||
soundType: "aquaculture:fish_death",
|
||||
};
|
||||
break;
|
||||
case "society:recycling_machine":
|
||||
machineData = {
|
||||
recipes: global.recyclingMachineRecipes,
|
||||
stageCount: 1,
|
||||
soundType: "twigs:block.basalt_bricks.fall",
|
||||
outputMult: upgraded ? 2 : 1,
|
||||
};
|
||||
break;
|
||||
case "society:oil_maker":
|
||||
machineData = {
|
||||
recipes: global.oilMakerRecipes,
|
||||
stageCount: 1,
|
||||
soundType: "supplementaries:block.jar.place",
|
||||
};
|
||||
break;
|
||||
case "society:tapper":
|
||||
machineData = {
|
||||
recipes: global.tapperRecipes,
|
||||
stageCount: 1,
|
||||
soundType: "vinery:cabinet_close",
|
||||
outputMult: stages.has("canadian_and_famous") ? 2 : 1,
|
||||
};
|
||||
break;
|
||||
case "society:mushroom_log":
|
||||
machineData = {
|
||||
recipes: global.mushroomLogRecipes,
|
||||
stageCount: 1,
|
||||
soundType: "species:block.alphacene_moss.place",
|
||||
outputMult: machineNbt && machineNbt.data && machineNbt.data.baseCount ? machineNbt.data.baseCount : 1,
|
||||
};
|
||||
break;
|
||||
case "society:charging_rod":
|
||||
machineData = { recipes: null, stageCount: 5, soundType: "" };
|
||||
break;
|
||||
default:
|
||||
machineData = undefined;
|
||||
}
|
||||
return machineData;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.BlockEntityJS} artisanHopper
|
||||
* @param {Internal.Player|null} player
|
||||
*/
|
||||
global.runArtisanHopper = (artisanHopper, artisanMachinePos, player, delay) => {
|
||||
const { level, block, inventory } = artisanHopper;
|
||||
const server = level.server;
|
||||
|
||||
server.scheduleInTicks(delay, () => {
|
||||
const artisanMachine = level.getBlock(artisanMachinePos);
|
||||
const { x, y, z } = artisanMachine;
|
||||
const nbt = artisanMachine.getEntityData();
|
||||
if (!nbt || !nbt.data) return;
|
||||
const upgraded = artisanMachine.properties.get("upgraded") == "true";
|
||||
const stages = global.getBlockEntityStages(artisanHopper);
|
||||
const loadedData = global.getArtisanMachineData(
|
||||
player,
|
||||
artisanMachine,
|
||||
upgraded,
|
||||
stages,
|
||||
);
|
||||
const season = global.getSeasonFromLevel(level);
|
||||
const chargingRodOutput = Item.of(
|
||||
`${upgraded && season === "winter" ? 3 : 1}x society:battery`
|
||||
);
|
||||
if (loadedData && artisanMachine) {
|
||||
let {
|
||||
recipes,
|
||||
stageCount,
|
||||
multipleInputs,
|
||||
hasTag,
|
||||
outputMult,
|
||||
soundType,
|
||||
} = loadedData;
|
||||
|
||||
if (recipes) {
|
||||
global.convertFromLegacy(recipes, level, artisanMachine);
|
||||
}
|
||||
let refreshedNbt = artisanMachine.getEntityData();
|
||||
let { stage, recipe } = refreshedNbt.data;
|
||||
let currentStage = stage || 0;
|
||||
let resolvedRecipeId = recipe;
|
||||
if (recipes && !recipes.has(resolvedRecipeId)) {
|
||||
let legacyType = refreshedNbt.data.type;
|
||||
if (legacyType > 0) {
|
||||
let legacyKey = Array.from(recipes.keys())[Number(legacyType) - 1];
|
||||
if (legacyKey) resolvedRecipeId = legacyKey;
|
||||
}
|
||||
}
|
||||
let hasInfinityWorm =
|
||||
artisanMachine.id === "society:deluxe_worm_farm" && upgraded;
|
||||
let machineOutputs = [];
|
||||
let newProperties = artisanMachine.getProperties();
|
||||
let recycleSparkstone;
|
||||
|
||||
if (
|
||||
newProperties.get("mature").toLowerCase() === "true" &&
|
||||
(artisanMachine.id === "society:charging_rod"
|
||||
? global.inventoryBelowHasRoom(level, block, chargingRodOutput)
|
||||
: recipes.has(resolvedRecipeId) &&
|
||||
global.inventoryBelowHasRoomForAll(
|
||||
level,
|
||||
block,
|
||||
recipes.get(resolvedRecipeId).output
|
||||
)) &&
|
||||
global.hasInventoryItems(inventory, "society:sparkstone", 1)
|
||||
) {
|
||||
server.runCommandSilent(
|
||||
`playsound stardew_fishing:dwop block @a ${x} ${y} ${z}`
|
||||
);
|
||||
if (artisanMachine.id === "society:charging_rod") {
|
||||
machineOutputs.push(chargingRodOutput);
|
||||
artisanMachine.set(artisanMachine.id, {
|
||||
working: false,
|
||||
mature: false,
|
||||
upgraded: upgraded,
|
||||
stage: "0",
|
||||
});
|
||||
} else if (hasInfinityWorm) {
|
||||
machineOutputs.push(
|
||||
Item.of("4x crabbersdelight:deluxe_crab_trap_bait")
|
||||
);
|
||||
artisanMachine.set(artisanMachine.id, {
|
||||
facing: artisanMachine.properties.get("facing"),
|
||||
type: "1",
|
||||
working: true,
|
||||
mature: false,
|
||||
upgraded: upgraded,
|
||||
stage: "0",
|
||||
});
|
||||
} else {
|
||||
machineOutputs = global.artisanHarvest(
|
||||
artisanMachine,
|
||||
recipes,
|
||||
stageCount,
|
||||
outputMult,
|
||||
artisanMachine.id === "society:cheese_press",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (machineOutputs && machineOutputs.length > 0) {
|
||||
recycleSparkstone = global.checkSparkstoneRecyclers(level, block);
|
||||
if (
|
||||
artisanMachine.id === "society:dehydrator" &&
|
||||
upgraded &&
|
||||
global.dehydratableMushroomOutputs.includes(machineOutputs[0].id)
|
||||
) {
|
||||
machineOutputs.forEach((output) => {
|
||||
output.count = 2;
|
||||
});
|
||||
}
|
||||
if (
|
||||
artisanMachineCanHaveAdditionalOutput.includes(artisanMachine.id)
|
||||
) {
|
||||
global.handleAdditionalArtisanMachineOutputs(
|
||||
level,
|
||||
block,
|
||||
artisanMachine,
|
||||
recipes,
|
||||
resolvedRecipeId,
|
||||
upgraded,
|
||||
stages
|
||||
);
|
||||
}
|
||||
let sparkstoneSaveChance = 0;
|
||||
if (stages.has("slouching_towards_artistry")) {
|
||||
sparkstoneSaveChance = Number(currentStage) * 0.05;
|
||||
}
|
||||
if (!recycleSparkstone && Math.random() > sparkstoneSaveChance) {
|
||||
global.useInventoryItems(inventory, "society:sparkstone", 1);
|
||||
} else {
|
||||
level.spawnParticles(
|
||||
"species:youth_potion",
|
||||
true,
|
||||
x,
|
||||
y + 0.5,
|
||||
z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
machineOutputs.forEach((output) => {
|
||||
global.insertBelow(level, block, output);
|
||||
});
|
||||
level.spawnParticles(
|
||||
"species:ascending_dust",
|
||||
true,
|
||||
x,
|
||||
y + 1,
|
||||
z,
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let abovePos = block.getPos().above();
|
||||
let aboveBlock = level.getBlock(abovePos.x, abovePos.y, abovePos.z);
|
||||
|
||||
if (
|
||||
recipes &&
|
||||
newProperties.get("working").toLowerCase() === "false" &&
|
||||
global.hasInventoryItems(inventory, "society:sparkstone", 1) &&
|
||||
aboveBlock.inventory &&
|
||||
!aboveBlock.inventory.isEmpty()
|
||||
) {
|
||||
let aboveBlockData = aboveBlock.getEntityData();
|
||||
if (aboveBlockData && aboveBlockData.toString().includes("filter_upgrade")) {
|
||||
if (player) {
|
||||
player.tell(Text.translatable("block.society.artisan_hopper.filter").red());
|
||||
}
|
||||
return;
|
||||
}
|
||||
let slots = aboveBlock.inventory.getSlots();
|
||||
let slotStack;
|
||||
let outputCount;
|
||||
for (let i = 0; i < slots; i++) {
|
||||
slotStack = aboveBlock.inventory.getStackInSlot(i);
|
||||
if (
|
||||
!(
|
||||
multipleInputs &&
|
||||
!slotStack.isEmpty() &&
|
||||
slotStack.count < stageCount
|
||||
)
|
||||
) {
|
||||
outputCount = global.artisanInsert(
|
||||
artisanMachine,
|
||||
slotStack,
|
||||
level,
|
||||
recipes,
|
||||
stageCount,
|
||||
soundType,
|
||||
multipleInputs,
|
||||
hasTag,
|
||||
true,
|
||||
server
|
||||
);
|
||||
if (outputCount > 0) {
|
||||
recycleSparkstone = global.checkSparkstoneRecyclers(level, block);
|
||||
if (!recycleSparkstone)
|
||||
global.useInventoryItems(inventory, "society:sparkstone", 1);
|
||||
else {
|
||||
level.spawnParticles(
|
||||
"species:youth_potion",
|
||||
true,
|
||||
x,
|
||||
y + 0.5,
|
||||
z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
level.runCommandSilent(
|
||||
`playsound create:fwoomp block @a ${x} ${y} ${z} 0.8`
|
||||
);
|
||||
aboveBlock.inventory.extractItem(i, outputCount, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (
|
||||
hasInfinityWorm &&
|
||||
newProperties.get("working").toLowerCase() === "false"
|
||||
) {
|
||||
artisanMachine.set(artisanMachine.id, {
|
||||
facing: artisanMachine.properties.get("facing"),
|
||||
type: "1",
|
||||
working: true,
|
||||
mature: false,
|
||||
upgraded: upgraded,
|
||||
stage: "0",
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.BlockEntityJS} entity
|
||||
*/
|
||||
global.artisanHopperScan = (entity, radius) => {
|
||||
const { block, level } = entity;
|
||||
const { x, y, z } = block;
|
||||
const attachedPlayer = global.cacheOwner(entity, [
|
||||
"slouching_towards_artistry", "ancient_aging", "rancher", "aged_prize", "canadian_and_famous"
|
||||
]);
|
||||
let scanBlock;
|
||||
let scannedBlocks = 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.hasTag("society:artisan_machine")) {
|
||||
global.runArtisanHopper(
|
||||
entity,
|
||||
pos.immutable(),
|
||||
attachedPlayer,
|
||||
scannedBlocks * 5
|
||||
);
|
||||
scannedBlocks++;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:artisan_hopper", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.artisan_hopper.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"society.working_block_entity.apply_player_skill"
|
||||
).gray()
|
||||
);
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `7x7x7`).green());
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.artisan_hopper.description.fuel"
|
||||
).lightPurple()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/artisan_hopper",
|
||||
});
|
||||
})
|
||||
.soundType("copper")
|
||||
.model("society:block/kubejs/artisan_hopper")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 2);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(600, 0, (entity) => {
|
||||
global.artisanHopperScan(entity, 3);
|
||||
});
|
||||
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)
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:mini_artisan_hopper", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.artisan_hopper.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"society.working_block_entity.apply_player_skill"
|
||||
).gray()
|
||||
);
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `3x3x3`).green());
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.artisan_hopper.description.fuel"
|
||||
).lightPurple()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/mini_artisan_hopper",
|
||||
});
|
||||
})
|
||||
.soundType("copper")
|
||||
.model("society:block/kubejs/mini_artisan_hopper")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 2);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(600, 0, (entity) => {
|
||||
global.artisanHopperScan(entity, 1);
|
||||
});
|
||||
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,342 @@
|
||||
console.info("[SOCIETY] autoGrabber.js loaded");
|
||||
|
||||
const handleAutoGrabSpecialItem = (
|
||||
data,
|
||||
day,
|
||||
chance,
|
||||
hungry,
|
||||
minHearts,
|
||||
mult,
|
||||
item,
|
||||
hasQuality,
|
||||
plushieModifiers,
|
||||
e
|
||||
) => {
|
||||
const { player, target, level, server, block, inventory } = e;
|
||||
let affection;
|
||||
let mood;
|
||||
let recycleSparkstone;
|
||||
let resolvedItem = item;
|
||||
let resolvedChance = chance;
|
||||
let resolvedHasQuality = hasQuality
|
||||
let dropAmount = mult * (plushieModifiers && plushieModifiers.doubleDrops ? 2 : 1);
|
||||
if (plushieModifiers) {
|
||||
affection = 1000;
|
||||
mood = 256;
|
||||
resolvedChance = chance + plushieModifiers.probabilityIncrease;
|
||||
if (plushieModifiers.processItems) {
|
||||
let processOutput = global.getProcessedItem(item, dropAmount);
|
||||
resolvedItem = processOutput.item.id;
|
||||
dropAmount = Math.round(dropAmount / processOutput.divisor) * processOutput.item.count;
|
||||
resolvedHasQuality = processOutput.preserveQuality
|
||||
}
|
||||
} else {
|
||||
affection = data.getInt("affection") || 0;
|
||||
mood = global.getOrFetchMood(level, target, day, player);
|
||||
}
|
||||
let hearts = Math.floor(affection / 100);
|
||||
|
||||
let quality = 0;
|
||||
|
||||
if (
|
||||
(!hungry || plushieModifiers) &&
|
||||
hearts >= minHearts &&
|
||||
Math.random() <= resolvedChance
|
||||
) {
|
||||
if (item.includes("large") && Math.random() > (mood + hearts * 10) / 256) {
|
||||
return;
|
||||
}
|
||||
if (resolvedHasQuality && mood >= 160) {
|
||||
quality = global.getHusbandryQuality(hearts, mood);
|
||||
}
|
||||
let remaining = dropAmount;
|
||||
let specialItemResultCode = 1;
|
||||
|
||||
while (remaining > 0 && specialItemResultCode == 1) {
|
||||
let currentAmount = Math.min(remaining, 64);
|
||||
let specialItem = Item.of(`${currentAmount}x ${resolvedItem}`, quality > 0 ? `{quality_food:{effects:[],quality:${quality}}}` : null);
|
||||
specialItemResultCode = global.insertBelow(level, block, specialItem);
|
||||
remaining -= currentAmount;
|
||||
}
|
||||
if (specialItemResultCode == 1) {
|
||||
recycleSparkstone = global.checkSparkstoneRecyclers(level, block);
|
||||
if (!recycleSparkstone && global.useInventoryItems(inventory, "society:sparkstone", 1) != 1)
|
||||
console.error("Sparkstone not consumed when it should have been!");
|
||||
server.runCommandSilent(
|
||||
`playsound stardew_fishing:dwop block @a ${block.x} ${block.y} ${block.z}`
|
||||
);
|
||||
if (target.x) {
|
||||
level.spawnParticles(
|
||||
"farmersdelight:star",
|
||||
true,
|
||||
target.x,
|
||||
target.y + 1,
|
||||
target.z,
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
0.2 * rnd(1, 4),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.BlockEntityJS} autoGrabber
|
||||
* @param {Internal.Player|null} player
|
||||
*/
|
||||
global.autoGrabAnimal = (autoGrabber, player, animal, plushieModifiers) => {
|
||||
const { inventory, block, level } = autoGrabber;
|
||||
let recycleSparkstone;
|
||||
let data;
|
||||
let nbt;
|
||||
if (plushieModifiers) {
|
||||
nbt = animal.getEntityData();
|
||||
data = nbt.data.animal;
|
||||
} else {
|
||||
data = animal.persistentData;
|
||||
}
|
||||
const stages = global.getBlockEntityStages(autoGrabber);
|
||||
const day = global.getDay(level);
|
||||
let mood;
|
||||
let hungry;
|
||||
if (plushieModifiers) {
|
||||
hungry = false;
|
||||
mood = 256;
|
||||
} else {
|
||||
hungry = global.compareDay(day, data.getInt("ageLastFed"), 1);
|
||||
if (!(!global.compareDay(day, data.getInt("ageLastPet"), 1) || level.dayTime() % 24000 > 12000)) return;
|
||||
mood = global.getOrFetchMood(level, animal, day, player);
|
||||
}
|
||||
if (mood < 64 && Math.random() < mood / 64) return;
|
||||
if (!hungry) {
|
||||
if (
|
||||
(plushieModifiers
|
||||
? global.milkableAnimals.includes(data.type)
|
||||
: global.checkEntityTag(animal, "society:milkable_animal")) &&
|
||||
global.inventoryHasItems(inventory, "society:sparkstone", 1) == 1
|
||||
) {
|
||||
let milkItem = global.getMilk(
|
||||
level,
|
||||
plushieModifiers ? data : animal,
|
||||
data,
|
||||
player,
|
||||
day,
|
||||
false,
|
||||
plushieModifiers,
|
||||
stages,
|
||||
);
|
||||
if (milkItem !== -1) {
|
||||
let insertedMilk = global.insertBelow(level, block, milkItem) == 1;
|
||||
if (insertedMilk) {
|
||||
recycleSparkstone = global.checkSparkstoneRecyclers(level, block);
|
||||
if (!recycleSparkstone && global.useInventoryItems(inventory, "society:sparkstone", 1) != 1)
|
||||
console.error("Sparkstone not consumed when it should have been!");
|
||||
if (!plushieModifiers && !global.getAnimalIsNotCramped(animal, 1.1))
|
||||
data.affection = data.getInt("affection") - 50;
|
||||
level.server.runCommandSilent(
|
||||
`playsound minecraft:entity.cow.milk block @a ${animal.x} ${animal.y} ${animal.z}`
|
||||
);
|
||||
level.spawnParticles(
|
||||
"atmospheric:aloe_blossom",
|
||||
true,
|
||||
animal.x,
|
||||
animal.y + 1.5,
|
||||
animal.z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
if (plushieModifiers && !plushieModifiers.resetDay) {
|
||||
nbt.merge({
|
||||
data: {
|
||||
animal: {
|
||||
ageLastMilked: day,
|
||||
},
|
||||
},
|
||||
});
|
||||
animal.setEntityData(nbt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (global.inventoryHasItems(inventory, "society:sparkstone", 1) == 1) {
|
||||
global.handleSpecialHarvest(
|
||||
level,
|
||||
plushieModifiers ? data : animal,
|
||||
player,
|
||||
level.server,
|
||||
block,
|
||||
inventory,
|
||||
plushieModifiers,
|
||||
handleAutoGrabSpecialItem,
|
||||
stages,
|
||||
);
|
||||
if (plushieModifiers && !plushieModifiers.resetDay) {
|
||||
nbt.merge({
|
||||
data: {
|
||||
animal: {
|
||||
ageLastDroppedSpecial: day,
|
||||
},
|
||||
},
|
||||
});
|
||||
animal.setEntityData(nbt);
|
||||
}
|
||||
}
|
||||
if (
|
||||
level.getBlock(block.pos).getProperties().get("upgraded") === "true" &&
|
||||
global.inventoryHasItems(inventory, "society:sparkstone", 1) == 1
|
||||
) {
|
||||
let droppedLoot = global.getMagicShearsOutput(
|
||||
level,
|
||||
plushieModifiers ? data : animal,
|
||||
player,
|
||||
plushieModifiers,
|
||||
stages,
|
||||
);
|
||||
if (droppedLoot !== -1) {
|
||||
level.server.runCommandSilent(
|
||||
`playsound minecraft:entity.sheep.shear block @a ${block.x} ${block.y} ${block.z}`
|
||||
);
|
||||
let insertedMagicDrops = false;
|
||||
for (let i = 0; i < droppedLoot.length; i++) {
|
||||
insertedMagicDrops =
|
||||
global.insertBelow(level, block, droppedLoot[i]) == 1;
|
||||
}
|
||||
if (insertedMagicDrops) {
|
||||
recycleSparkstone = global.checkSparkstoneRecyclers(level, block);
|
||||
if (!recycleSparkstone && global.useInventoryItems(inventory, "society:sparkstone", 1) != 1)
|
||||
console.error("Sparkstone not consumed when it should have been!");
|
||||
if (!plushieModifiers && !global.getAnimalIsNotCramped(animal, 1.1))
|
||||
data.affection = data.getInt("affection") - 50;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {Internal.BlockEntityJS} entity
|
||||
* @param {Internal.Player|null} attachedPlayer
|
||||
*/
|
||||
global.runAutoGrabber = (entity, attachedPlayer) => {
|
||||
const { block, level } = entity;
|
||||
let radius = 5;
|
||||
let nearbyFarmAnimals;
|
||||
nearbyFarmAnimals = level
|
||||
.getEntitiesWithin(AABB.ofBlock(block).inflate(radius))
|
||||
.filter((entity) =>
|
||||
global.checkEntityTag(entity, "society:husbandry_animal")
|
||||
);
|
||||
nearbyFarmAnimals.forEach((animal) => {
|
||||
global.autoGrabAnimal(entity, attachedPlayer, animal);
|
||||
});
|
||||
let { x, y, z } = block;
|
||||
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:plushies")) {
|
||||
let nbt = scanBlock.getEntityData();
|
||||
if (nbt.data.animal) {
|
||||
global.autoGrabAnimal(
|
||||
entity,
|
||||
attachedPlayer,
|
||||
scanBlock,
|
||||
global.getPlushieModifiers(level, nbt.data, scanBlock)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:auto_grabber", "cardinal")
|
||||
.displayName("Auto-Grabber")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 0, 16, 30, 16)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.auto_grabber.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"society.working_block_entity.apply_player_skill"
|
||||
).gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.auto_grabber.description.upgrade"
|
||||
).gold()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable("tooltip.society.area", `11x11x11`).green()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.auto_grabber.description.fuel"
|
||||
).lightPurple()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/auto_grabber",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/auto_grabber")
|
||||
.property(booleanProperty.create("upgraded"))
|
||||
.defaultState((state) => {
|
||||
state.set(booleanProperty.create("upgraded"), false);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(booleanProperty.create("upgraded"), false);
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 2);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(600, 0, (entity) => {
|
||||
const attachedPlayer = global.cacheOwner(entity, [
|
||||
"animal_fancy",
|
||||
"animal_whisperer",
|
||||
"bff",
|
||||
"coopmaster",
|
||||
"heretic",
|
||||
"mana_hand",
|
||||
"reaping_scythe",
|
||||
"shepherd",
|
||||
]);
|
||||
global.runAutoGrabber(entity, attachedPlayer);
|
||||
}),
|
||||
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)
|
||||
)
|
||||
);
|
||||
}).blockstateJson = {
|
||||
multipart: []
|
||||
.concat(getCardinalMultipartJsonBasicUpgradable("auto_grabber", "false"))
|
||||
.concat(
|
||||
getCardinalMultipartJsonBasicUpgradable("auto_grabber_upgraded", "true")
|
||||
),
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,87 @@
|
||||
console.info("[SOCIETY] autoPetter.js loaded");
|
||||
|
||||
const autoPetterTickRate = 20;
|
||||
const autoPetterProgTime = 1000;
|
||||
|
||||
global.runAutoPetter = (entity) => {
|
||||
const { block, level } = entity;
|
||||
let radius = 2;
|
||||
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
if (morningModulo >= autoPetterProgTime && morningModulo < autoPetterProgTime + autoPetterTickRate) {
|
||||
let day = global.getDay(level);
|
||||
|
||||
let nearbyFarmAnimals = level
|
||||
.getEntitiesWithin(AABB.ofBlock(block).inflate(radius))
|
||||
.filter((entity) =>
|
||||
global.checkEntityTag(entity, "society:husbandry_animal")
|
||||
);
|
||||
nearbyFarmAnimals.forEach((animal) => {
|
||||
let data = animal.persistentData;
|
||||
let ageLastPet = data.getInt("ageLastPet");
|
||||
let ageLastFed = data.getInt("ageLastFed");
|
||||
if (day > ageLastPet) {
|
||||
let hungry = global.compareDay(day, ageLastFed, 1)
|
||||
let affection = data.getInt("affection");
|
||||
let affectionIncreaseMult = data.bribed ? 2 : 1;
|
||||
let affectionIncrease = 5 * affectionIncreaseMult;
|
||||
|
||||
if (animal.isBaby()) {
|
||||
affectionIncrease = affectionIncrease * 2;
|
||||
}
|
||||
|
||||
let livableArea = global.getAnimalIsNotCramped(animal, 1.1);
|
||||
data.affection = affection + affectionIncrease;
|
||||
if (hungry || !livableArea) {
|
||||
data.affection = affection - (hungry ? 15 : 25);
|
||||
}
|
||||
data.ageLastPet = day;
|
||||
level.spawnParticles(
|
||||
"minecraft:heart",
|
||||
true,
|
||||
animal.x,
|
||||
animal.y + 1.5,
|
||||
animal.z,
|
||||
0,
|
||||
0.1,
|
||||
0,
|
||||
1,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e.create("society:auto_petter", "cardinal")
|
||||
.displayName("Auto-Petter")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 0, 16, 8, 16)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.auto_petter.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable("tooltip.society.area", `5x5x5`).green()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/auto_petter",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/auto_petter")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.serverTick(autoPetterTickRate, 0, (entity) => {
|
||||
global.runAutoPetter(entity)
|
||||
})
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
apply: { model: "society:block/kubejs/auto_petter_particle" },
|
||||
},
|
||||
].concat(getCardinalMultipartJsonBasic("auto_petter")),
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
console.info("[SOCIETY] autoTapper.js loaded");
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:auto_tapper", "cardinal")
|
||||
.displayName("Auto-Tapper")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.property(booleanProperty.create("error"))
|
||||
.defaultState((state) => {
|
||||
state.set(booleanProperty.create("error"), false);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(booleanProperty.create("error"), false);
|
||||
})
|
||||
.box(0, 0, 0, 16, 18, 16)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.auto_tapper.description").gray());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/auto_tapper",
|
||||
});
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.initialData({ Fluid: 0, FluidType: "" });
|
||||
blockInfo.serverTick(200, 0, (entity) => {
|
||||
global.runAutoTapper(entity);
|
||||
});
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.FLUID.customBlockEntity()
|
||||
.getCapacity(() => 10000)
|
||||
.getFluid((blockInfo, fl) => global.getFluid(blockInfo))
|
||||
.onFill((blockInfo, fluid, sim) => global.onFill(blockInfo, fluid, sim))
|
||||
.onDrain((blockInfo, fluid, sim) => global.onDrain(blockInfo, fluid, sim))
|
||||
);
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
apply: { model: "society:block/kubejs/auto_tapper_particle" },
|
||||
},
|
||||
{
|
||||
when: { error: true },
|
||||
apply: { model: "society:block/kubejs/error" },
|
||||
},
|
||||
].concat(getCardinalMultipartJsonBasic("auto_tapper")),
|
||||
};
|
||||
});
|
||||
global.runAutoTapper = (blockInfo) => {
|
||||
const { block, level } = blockInfo;
|
||||
|
||||
const fluidHandler = blockInfo.getCapability(ForgeCapabilities.FLUID_HANDLER).orElse(null);
|
||||
const fluidData = global.handleTapperRandomTick(
|
||||
{ block: block, level: level, server: level.getServer() },
|
||||
true
|
||||
);
|
||||
if (global.susFunctionLogging) console.log("[SOCIETY-SUSFN] autoTapper.js");
|
||||
if (fluidData && block.properties.get("error") == "false") {
|
||||
fluidHandler.fill(Fluid.of(fluidData.fluid, Math.round(10 / fluidData.time)), "execute");
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
console.info("[SOCIETY] autoWormFarm.js loaded");
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:auto_worm_farm")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 0, 16, 16, 16)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.auto_worm_farm.description").gray());
|
||||
item.tooltip(Text.translatable("society.working_block_entity.can_use_hopper").green());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/auto_worm_farm",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/auto_worm_farm")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 1);
|
||||
blockInfo.serverTick(1200, 0, (entity) => {
|
||||
const { x, y, z } = entity.block;
|
||||
if (entity.tick < 20) return;
|
||||
entity.inventory.insertItem("aquaculture:worm", false);
|
||||
entity.level.server.runCommandSilent(
|
||||
`playsound minecraft:block.composter.fill block @a ${x} ${y} ${z}`
|
||||
);
|
||||
entity.level.spawnParticles(
|
||||
"atmospheric:orange_vapor",
|
||||
true,
|
||||
x,
|
||||
y + 0.5,
|
||||
z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
}),
|
||||
blockInfo.rightClickOpensInventory();
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.ITEM.blockEntity()
|
||||
.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,90 @@
|
||||
// priority: 1
|
||||
console.info("[SOCIETY] basicShippingBin.js loaded");
|
||||
|
||||
const debug = false;
|
||||
|
||||
const basicCoinMap = [
|
||||
{ coin: "numismatics:sun", value: 4096 },
|
||||
{ coin: "numismatics:crown", value: 512 },
|
||||
{ coin: "numismatics:cog", value: 64 },
|
||||
{ coin: "numismatics:sprocket", value: 16 },
|
||||
{ coin: "numismatics:bevel", value: 8 },
|
||||
{ coin: "numismatics:spur", value: 1 },
|
||||
];
|
||||
|
||||
const calculateSlotsNeeded = (coins) => {
|
||||
let slots = 0;
|
||||
coins.forEach((coinObj) => {
|
||||
let { count } = coinObj;
|
||||
for (let index = 0; index <= count; index += 64) {
|
||||
slots++;
|
||||
}
|
||||
});
|
||||
return slots;
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("shippingbin:basic_shipping_bin", "cardinal")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("tooltip.society.shipping_bin").gray());
|
||||
item.modelJson({
|
||||
parent: "shippingbin:block/shipping_bin",
|
||||
});
|
||||
})
|
||||
.model("shippingbin:block/shipping_bin")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 4);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(10, 0, (entity) => {
|
||||
const { inventory, level, block } = entity;
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
if (rnd5()) global.cacheShippingBin(entity);
|
||||
if (morningModulo >= 5 && morningModulo < 15) {
|
||||
let slots = inventory.getSlots();
|
||||
let value = 0;
|
||||
let binPlayer = global.cacheShippingBin(entity);
|
||||
let blockData = block.getEntityData().data;
|
||||
let playerAttributes = blockData.attributes;
|
||||
let playerStages = blockData.stages;
|
||||
let removedSlots = [];
|
||||
let calculationResults;
|
||||
if (!playerStages || !playerAttributes) return;
|
||||
|
||||
calculationResults = global.processShippingBinInventory(
|
||||
inventory,
|
||||
slots,
|
||||
playerAttributes,
|
||||
playerStages,
|
||||
true
|
||||
);
|
||||
value = Math.round(calculationResults.calculatedValue);
|
||||
removedSlots = calculationResults.removedItems;
|
||||
global.processValueOutput(
|
||||
value,
|
||||
slots,
|
||||
removedSlots,
|
||||
binPlayer,
|
||||
level.getServer(),
|
||||
block,
|
||||
inventory
|
||||
);
|
||||
}
|
||||
}),
|
||||
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,70 @@
|
||||
// priority: -21
|
||||
console.info("[SOCIETY] caterpillarBox.js loaded");
|
||||
|
||||
global.handleCaterpillarBox = (e) => {
|
||||
const { inventory, level, block } = e;
|
||||
const { x, y, z } = block;
|
||||
let slots = inventory.getSlots();
|
||||
let slotItem;
|
||||
if (!inventory.isEmpty()) {
|
||||
for (let i = 0; i < slots; i++) {
|
||||
slotItem = inventory.getStackInSlot(i);
|
||||
if (slotItem.id == "society:caterpillar_eggs") {
|
||||
let type = "butterfly";
|
||||
let longwingDef;
|
||||
if (slotItem.nbt && slotItem.nbt.child) {
|
||||
global.longwings.forEach((wing) => {
|
||||
if (wing.variant === slotItem.nbt.child) {
|
||||
longwingDef = wing
|
||||
}
|
||||
})
|
||||
type = longwingDef.type;
|
||||
}
|
||||
let longwing = level.createEntity("longwings:" + type);
|
||||
if (longwingDef) {
|
||||
longwing.mergeNbt({ Variant: longwingDef.variant, size: Math.round(Math.min(global.getLongwingSize(longwingDef.size) * 2, slotItem.nbt.size) * 100) / 100});
|
||||
}
|
||||
longwing.setPosition(x, y + 1, z);
|
||||
longwing.spawn();
|
||||
slotItem.shrink(1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:caterpillar_box")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.soundType("wood")
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.caterpillar_box.description").gray());
|
||||
item.tooltip(Text.translatable("society.working_block_entity.can_use_hopper").green());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/caterpillar_box",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/caterpillar_box")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 1);
|
||||
blockInfo.serverTick(6000, 0, (entity) => {
|
||||
global.handleCaterpillarBox(entity);
|
||||
}),
|
||||
blockInfo.rightClickOpensInventory();
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.ITEM.blockEntity()
|
||||
.insertItem((blockEntity, slot, stack, simulate) =>
|
||||
blockEntity.inventory.insertItem(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,182 @@
|
||||
// priority: -21
|
||||
console.info("[SOCIETY] drumCornucopia.js loaded");
|
||||
|
||||
const drumCornucopiaProgTime = 1000;
|
||||
const fruitTreeBlocks = [
|
||||
"pamhc2trees:pamorange",
|
||||
"pamhc2trees:pamdragonfruit",
|
||||
"pamhc2trees:pampeach",
|
||||
"pamhc2trees:pamplum",
|
||||
"pamhc2trees:pambanana",
|
||||
"pamhc2trees:pamapple",
|
||||
"pamhc2trees:pamcherry",
|
||||
"pamhc2trees:pamstarfruit",
|
||||
"pamhc2trees:pamlychee",
|
||||
"pamhc2trees:pammango",
|
||||
"pamhc2trees:pamhazelnut",
|
||||
"pamhc2trees:pampawpaw",
|
||||
"pamhc2trees:pamcinnamon",
|
||||
"pamhc2trees:pampassionfruit",
|
||||
"pamhc2trees:pamlemon",
|
||||
];
|
||||
const dropThree = ["pamhc2trees:pamhazelnut", "pamhc2trees:pamlychee", "pamhc2trees:pambanana"];
|
||||
const dropModified = ["pamhc2trees:pampassionfruit", "pamhc2trees:pamorange"];
|
||||
const dropFourModified = ["pamhc2trees:pamcherry", "pamhc2trees:pamapple"];
|
||||
|
||||
global.handleCornucopia = (server, level, centerPos, player, returnExperience) => {
|
||||
let { x, y, z } = centerPos
|
||||
let scannedBlock;
|
||||
let fruitDrop;
|
||||
let fruitType;
|
||||
let fruitItem;
|
||||
let fruitCount;
|
||||
let success = false;
|
||||
let season;
|
||||
let modifiedProperties;
|
||||
let experienceMult = 0;
|
||||
server.runCommandSilent(
|
||||
`playsound ${player != null ? "trials:breeze_idle" : "etcetera:block.drum.djembe.low"} block @a ${x} ${y} ${z}`
|
||||
);
|
||||
if (!player) {
|
||||
level.spawnParticles(
|
||||
"species:ghoul_searching2",
|
||||
true,
|
||||
x,
|
||||
y + 0.5,
|
||||
z,
|
||||
0.1 * rnd(0, 1.5),
|
||||
0.1 * rnd(0, 1.5),
|
||||
0.1 * rnd(0, 1.5),
|
||||
1,
|
||||
0.05
|
||||
);
|
||||
}
|
||||
for (let pos of BlockPos.betweenClosed(new BlockPos(x - 10, y - 2, z - 10), [
|
||||
x + 10,
|
||||
y + 10,
|
||||
z + 10,
|
||||
])) {
|
||||
if (!level.isLoaded(pos)) continue;
|
||||
scannedBlock = level.getBlock(pos);
|
||||
if (scannedBlock.id == "minecraft:air") continue;
|
||||
success = false;
|
||||
fruitDrop = level.createEntity("minecraft:item");
|
||||
if (["vinery:dark_cherry_leaves", "vinery:apple_leaves"].includes(scannedBlock.id)) {
|
||||
season = global.getSeasonFromLevel(level);
|
||||
modifiedProperties = scannedBlock.properties;
|
||||
if (
|
||||
season === "spring" &&
|
||||
scannedBlock.properties.get("has_cherries") &&
|
||||
scannedBlock.properties.get("has_cherries").toString() === "true"
|
||||
) {
|
||||
fruitItem = "vinery:cherry";
|
||||
fruitItem.count = rnd(0, 4);
|
||||
success = true;
|
||||
modifiedProperties.can_grow_cherries = false;
|
||||
modifiedProperties.has_cherries = false;
|
||||
scannedBlock.set(scannedBlock.id, modifiedProperties);
|
||||
} else if (
|
||||
season === "autumn" &&
|
||||
scannedBlock.properties.get("has_apples") &&
|
||||
scannedBlock.properties.get("has_apples").toString() === "true"
|
||||
) {
|
||||
fruitItem = "minecraft:apple";
|
||||
fruitItem.count = rnd(0, 4);
|
||||
success = true;
|
||||
modifiedProperties.can_grow_apples = false;
|
||||
modifiedProperties.has_apples = false;
|
||||
scannedBlock.set(scannedBlock.id, modifiedProperties);
|
||||
}
|
||||
} else if (
|
||||
fruitTreeBlocks.includes(scannedBlock.id) &&
|
||||
scannedBlock.properties.get("age") == 7
|
||||
) {
|
||||
fruitType = String(scannedBlock.id.split(":")[1]);
|
||||
fruitCount = 1;
|
||||
success = true;
|
||||
if (dropThree.includes(scannedBlock.id)) fruitCount = 3;
|
||||
if (scannedBlock.id === "pamhc2trees:pambanana") {
|
||||
if (player && player.stages.has("banana_karenina")) fruitCount *= 2;
|
||||
else if (Math.random() <= 0.001) scannedBlock.popItem("society:banana_karenina");
|
||||
}
|
||||
|
||||
if (dropModified.includes(scannedBlock.id)) {
|
||||
fruitItem = Item.of(
|
||||
scannedBlock.id === "pamhc2trees:pampassionfruit"
|
||||
? "atmospheric:passion_fruit"
|
||||
: "atmospheric:orange"
|
||||
);
|
||||
} else if (dropFourModified.includes(scannedBlock.id)) {
|
||||
fruitCount = 4;
|
||||
fruitItem = Item.of(
|
||||
scannedBlock.id === "pamhc2trees:pamcherry" ? "vinery:cherry" : "minecraft:apple"
|
||||
);
|
||||
} else {
|
||||
fruitItem = Item.of(`pamhc2trees:${fruitType.substring(3, fruitType.length)}item`);
|
||||
}
|
||||
fruitItem.count = player && player.stages.has("tree_whisperer") ? fruitCount + 2 : fruitCount;
|
||||
scannedBlock.set(scannedBlock.id, {
|
||||
waterlogged: scannedBlock.properties.get("waterlogged") || "false",
|
||||
age: "0",
|
||||
});
|
||||
}
|
||||
if (success) {
|
||||
fruitDrop.x = scannedBlock.x;
|
||||
fruitDrop.y = scannedBlock.y;
|
||||
fruitDrop.z = scannedBlock.z;
|
||||
fruitDrop.item = fruitItem;
|
||||
|
||||
fruitDrop.spawn();
|
||||
experienceMult++;
|
||||
level.spawnParticles(
|
||||
"mysticaloaktree:wind",
|
||||
true,
|
||||
scannedBlock.x,
|
||||
scannedBlock.y + 0.5,
|
||||
scannedBlock.z,
|
||||
0.1 * rnd(0, 1.5),
|
||||
0.1 * rnd(0, 1.5),
|
||||
0.1 * rnd(0, 1.5),
|
||||
7,
|
||||
0.05
|
||||
);
|
||||
server.runCommandSilent(
|
||||
`playsound minecraft:block.grass.break block @a ${scannedBlock.x} ${scannedBlock.y} ${scannedBlock.z} 0.5`
|
||||
);
|
||||
}
|
||||
}
|
||||
if (returnExperience) return experienceMult;
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:drum_cornucopia")
|
||||
.displayName("Drum of the Cornucopia")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.soundType("wood")
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drum_cornucopia")
|
||||
.box(3, 0, 3, 13, 14, 13)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.drum_cornucopia.description").gray());
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `20x10x20`).green());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/drum_cornucopia",
|
||||
});
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.serverTick(artMachineTickRate, 0, (e) => {
|
||||
const { level, block } = e;
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
if (
|
||||
morningModulo >= drumCornucopiaProgTime &&
|
||||
morningModulo < drumCornucopiaProgTime + artMachineTickRate
|
||||
) {
|
||||
global.handleCornucopia(level.server, level, block.getPos())
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
@@ -0,0 +1,293 @@
|
||||
console.info("[SOCIETY] feedingTrough.js loaded");
|
||||
|
||||
const feedFunction = (
|
||||
level,
|
||||
animal,
|
||||
day,
|
||||
inventory,
|
||||
hasAnimalFeed,
|
||||
hasCandiedFeed,
|
||||
hasManaFeed
|
||||
) => {
|
||||
let data = animal.persistentData;
|
||||
if (!data.getInt("ageLastFed") || day < data.getInt("ageLastFed")) {
|
||||
data.ageLastFed = day;
|
||||
}
|
||||
if (day > data.ageLastFed) {
|
||||
let fed = false;
|
||||
let boost = 0;
|
||||
// prefer candied > mana > normal
|
||||
if (
|
||||
hasCandiedFeed &&
|
||||
global.useInventoryItems(inventory, "society:candied_animal_feed", 1) == 1
|
||||
) {
|
||||
fed = true;
|
||||
boost = 100;
|
||||
} else if (hasManaFeed && global.useInventoryItems(inventory, "society:mana_feed", 1) == 1) {
|
||||
fed = true;
|
||||
boost = 30;
|
||||
} else if (
|
||||
hasAnimalFeed &&
|
||||
global.useInventoryItems(inventory, "society:animal_feed", 1) == 1
|
||||
) {
|
||||
fed = true;
|
||||
}
|
||||
|
||||
if (fed) {
|
||||
animal.heal(4);
|
||||
data.ageLastFed = day;
|
||||
if (boost > 0) data.affection = data.getInt("affection") + boost;
|
||||
level.spawnParticles(
|
||||
"legendarycreatures:wisp_particle",
|
||||
true,
|
||||
animal.x,
|
||||
animal.y + 1.5,
|
||||
animal.z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
global.runFeedingTrough = (be, inventory, block, level) => {
|
||||
let radius = 6;
|
||||
let hasAnimalFeed = global.inventoryHasItems(inventory, "society:animal_feed", 1) == 1;
|
||||
let hasCandiedFeed = global.inventoryHasItems(inventory, "society:candied_animal_feed", 1) == 1;
|
||||
let hasManaFeed = global.inventoryHasItems(inventory, "society:mana_feed", 1) == 1;
|
||||
if (!(hasAnimalFeed || hasCandiedFeed || hasManaFeed)) return;
|
||||
let slots = inventory.getSlots();
|
||||
let feedCount = 0;
|
||||
|
||||
let nearbyFarmAnimals;
|
||||
let day = global.getDay(level);
|
||||
nearbyFarmAnimals = level
|
||||
.getEntitiesWithin(AABB.ofBlock(block).inflate(radius))
|
||||
.filter((entity) => global.checkEntityTag(entity, "society:husbandry_animal"));
|
||||
|
||||
nearbyFarmAnimals.forEach((animal) => {
|
||||
feedFunction(level, animal, day, inventory, hasAnimalFeed, hasCandiedFeed, hasManaFeed);
|
||||
});
|
||||
// Handle visual
|
||||
for (let i = 0; i < slots; i++) {
|
||||
if (inventory.getStackInSlot(i).hasTag("society:animal_feed"))
|
||||
feedCount += inventory.getStackInSlot(i).count;
|
||||
}
|
||||
let fill = 0;
|
||||
if (feedCount >= 512) fill = 4;
|
||||
else if (feedCount >= 256) fill = 3;
|
||||
else if (feedCount >= 128) fill = 2;
|
||||
else if (feedCount >= 8) fill = 1;
|
||||
be.block.set(be.block.id, {
|
||||
facing: be.block.properties.facing,
|
||||
fill: String(fill),
|
||||
});
|
||||
};
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:feeding_trough", "cardinal")
|
||||
.property(integerProperty.create("fill", 0, 4))
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 2, 16, 12, 14)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.feeding_trough.description").gray());
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `13x13x13`).green());
|
||||
item.modelJson({
|
||||
parent: "farm_and_charm:block/feeding_trough_size_0",
|
||||
});
|
||||
})
|
||||
.defaultState((state) => {
|
||||
state.set(integerProperty.create("fill", 0, 4), 0);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(integerProperty.create("fill", 0, 4), 0);
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 1);
|
||||
blockInfo.initialData({ fill: "0" });
|
||||
blockInfo.serverTick(300, 0, (entity) => {
|
||||
const { inventory, block, level } = entity;
|
||||
global.runFeedingTrough(entity, inventory, block, level);
|
||||
}),
|
||||
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))
|
||||
);
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { fill: 0, facing: "north" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_0",
|
||||
y: 0,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 0, facing: "east" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_0",
|
||||
y: 90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 0, facing: "south" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_0",
|
||||
y: 180,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 0, facing: "west" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_0",
|
||||
y: -90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 1, facing: "north" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_1",
|
||||
y: 0,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 1, facing: "east" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_1",
|
||||
y: 90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 1, facing: "south" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_1",
|
||||
y: 180,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 1, facing: "west" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_1",
|
||||
y: -90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 2, facing: "north" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_2",
|
||||
y: 0,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 2, facing: "east" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_2",
|
||||
y: 90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 2, facing: "south" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_2",
|
||||
y: 180,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 2, facing: "west" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_2",
|
||||
y: -90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 3, facing: "north" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_3",
|
||||
y: 0,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 3, facing: "east" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_3",
|
||||
y: 90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 3, facing: "south" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_3",
|
||||
y: 180,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 3, facing: "west" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_3",
|
||||
y: -90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 4, facing: "north" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_4",
|
||||
y: 0,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 4, facing: "east" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_4",
|
||||
y: 90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 4, facing: "south" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_4",
|
||||
y: 180,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { fill: 4, facing: "west" },
|
||||
apply: {
|
||||
model: "farm_and_charm:block/feeding_trough_size_4",
|
||||
y: -90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,274 @@
|
||||
console.info("[SOCIETY] artisanHopper.js loaded");
|
||||
|
||||
/**
|
||||
* @param {Internal.BlockEntityJS} fishPondBasket
|
||||
* @param {Internal.Player|null} player
|
||||
*/
|
||||
global.runFishPondBasket = (fishPondBasket, fishPondPos, player) => {
|
||||
const { level, block, inventory } = fishPondBasket;
|
||||
const stages = global.getBlockEntityStages(fishPondBasket);
|
||||
const server = level.server;
|
||||
const fishPond = level.getBlock(fishPondPos);
|
||||
const { x, y, z } = fishPond;
|
||||
let machineOutputs;
|
||||
let newProperties = fishPond.getProperties();
|
||||
let nbt = fishPond.getEntityData();
|
||||
let recycleSparkstone;
|
||||
const { type, max_population, population } = nbt.data;
|
||||
if (global.inventoryHasItems(inventory, "society:sparkstone", 1) != 1) return;
|
||||
recycleSparkstone = global.checkSparkstoneRecyclers(level, block);
|
||||
if (
|
||||
newProperties.get("mature").toLowerCase() === "true" &&
|
||||
global.inventoryBelowHasRoom(level, block, global.getRoe(type)) &&
|
||||
(recycleSparkstone || global.useInventoryItems(inventory, "society:sparkstone", 1) == 1)
|
||||
) {
|
||||
machineOutputs = global.handleFishHarvest(fishPond, player, server, true, stages);
|
||||
|
||||
if (machineOutputs.length > 0) {
|
||||
machineOutputs.forEach((item) => {
|
||||
global.insertBelow(level, block, item);
|
||||
});
|
||||
level.spawnParticles(
|
||||
"species:ascending_dust",
|
||||
true,
|
||||
x,
|
||||
y + 1,
|
||||
z,
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
if (
|
||||
newProperties.get("mature").toLowerCase() === "true" &&
|
||||
level.getBlock(block.pos).getProperties().get("upgraded") === "true" &&
|
||||
population > 0 && max_population === population
|
||||
) {
|
||||
let fishie = global.handleFishExtraction(fishPond, player, server, stages);
|
||||
recycleSparkstone = global.checkSparkstoneRecyclers(level, block);
|
||||
if (
|
||||
global.inventoryBelowHasRoom(level, block, fishie) &&
|
||||
(recycleSparkstone || global.useInventoryItems(inventory, "society:sparkstone", 1) == 1)
|
||||
) {
|
||||
global.insertBelow(level, block, fishie);
|
||||
level.spawnParticles(
|
||||
"species:ascending_dust",
|
||||
true,
|
||||
x,
|
||||
y + 1,
|
||||
z,
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:fish_pond_basket")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.waterlogged()
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.fish_pond_basket.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"society.working_block_entity.apply_player_skill"
|
||||
).gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.fish_pond_basket.description.upgrade"
|
||||
).gold()
|
||||
);
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `3x3x3`).green());
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.fish_pond_basket.description.fuel"
|
||||
).lightPurple()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/fish_pond_basket",
|
||||
});
|
||||
item.fireResistant(true);
|
||||
})
|
||||
.soundType("copper")
|
||||
.model("society:block/kubejs/fish_pond_basket")
|
||||
.property(booleanProperty.create("upgraded"))
|
||||
.defaultState((state) => {
|
||||
state
|
||||
.set(booleanProperty.create("upgraded"), false)
|
||||
.set(BlockProperties.WATERLOGGED, false);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state
|
||||
.set(booleanProperty.create("upgraded"), false)
|
||||
.set(BlockProperties.WATERLOGGED, false);
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 2);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(600, 0, (entity) => {
|
||||
const { block, level } = entity;
|
||||
const { x, y, z } = block;
|
||||
const radius = 1;
|
||||
let attachedPlayer = global.cacheOwner(entity, [
|
||||
"bullfish_jobs",
|
||||
"caper_catcher",
|
||||
"caviar_catcher",
|
||||
"hot_hands",
|
||||
"mitosis",
|
||||
"scum_collector",
|
||||
]);
|
||||
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.id === "society:fish_pond") {
|
||||
global.runFishPondBasket(entity, pos.immutable(), attachedPlayer);
|
||||
}
|
||||
}
|
||||
}),
|
||||
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)
|
||||
)
|
||||
);
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { upgraded: "false" },
|
||||
apply: { model: "society:block/kubejs/fish_pond_basket" },
|
||||
},
|
||||
{
|
||||
when: { upgraded: "true" },
|
||||
apply: { model: "society:block/kubejs/fish_pond_basket_upgraded" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
event
|
||||
.create("society:fish_pond_hatchery")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.waterlogged()
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.fish_pond_basket.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"society.working_block_entity.apply_player_skill"
|
||||
).gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.fish_pond_basket.description.upgrade"
|
||||
).gold()
|
||||
);
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `3x7x3`).green());
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.fish_pond_basket.description.fuel"
|
||||
).lightPurple()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/fish_pond_hatchery",
|
||||
});
|
||||
item.fireResistant(true);
|
||||
})
|
||||
.soundType("copper")
|
||||
.model("society:block/kubejs/fish_pond_hatchery")
|
||||
.property(booleanProperty.create("upgraded"))
|
||||
.defaultState((state) => {
|
||||
state
|
||||
.set(booleanProperty.create("upgraded"), false)
|
||||
.set(BlockProperties.WATERLOGGED, false);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state
|
||||
.set(booleanProperty.create("upgraded"), false)
|
||||
.set(BlockProperties.WATERLOGGED, false);
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 2);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(600, 0, (entity) => {
|
||||
const { block, level } = entity;
|
||||
const { x, y, z } = block;
|
||||
let attachedPlayer = global.cacheOwner(entity, [
|
||||
"bullfish_jobs",
|
||||
"caper_catcher",
|
||||
"caviar_catcher",
|
||||
"hot_hands",
|
||||
"mitosis",
|
||||
"scum_collector",
|
||||
]);
|
||||
let scanBlock;
|
||||
for (let pos of BlockPos.betweenClosed(
|
||||
new BlockPos(x - 1, y - 3, z - 1),
|
||||
[x + 1, y + 3, z + 1]
|
||||
)) {
|
||||
if (!level.isLoaded(pos)) continue;
|
||||
scanBlock = level.getBlock(pos);
|
||||
if (scanBlock.id === "society:fish_pond") {
|
||||
global.runFishPondBasket(entity, pos.immutable(), attachedPlayer);
|
||||
}
|
||||
}
|
||||
}),
|
||||
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)
|
||||
)
|
||||
);
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { upgraded: "false" },
|
||||
apply: { model: "society:block/kubejs/fish_pond_hatchery" },
|
||||
},
|
||||
{
|
||||
when: { upgraded: "true" },
|
||||
apply: { model: "society:block/kubejs/fish_pond_hatchery_upgraded" },
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,229 @@
|
||||
//priority: 100
|
||||
console.info("[SOCIETY] fishPondQuestManager.js loaded");
|
||||
|
||||
|
||||
global.handleManagerQuestSubmission = (entity, fishPondPos, attachedPlayer, delay) => {
|
||||
const { level, block, inventory } = entity;
|
||||
const server = level.server;
|
||||
|
||||
server.scheduleInTicks(delay, () => {
|
||||
const fishPond = level.getBlock(fishPondPos);
|
||||
const { x, y, z } = fishPond;
|
||||
const nbt = fishPond.getEntityData();
|
||||
|
||||
if (!nbt || !nbt.data) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { type: fishType, max_population, quest_id } = nbt.data;
|
||||
const { facing, valid, mature, upgraded, quest } =
|
||||
global.getPondProperties(fishPond);
|
||||
|
||||
|
||||
if (quest === "true" && global.fishPondDefinitions.get(`${fishType}`)) {
|
||||
const questContent = getRequestedItems(fishType, Number(max_population))[quest_id];
|
||||
|
||||
if (!questContent) {
|
||||
return;
|
||||
}
|
||||
|
||||
let checkedCount = attachedPlayer.stages.has("pond_house_five") ?
|
||||
Math.round(questContent.count / 2) :
|
||||
questContent.count;
|
||||
|
||||
if (global.hasInventoryItems(inventory, questContent.item, checkedCount)) {
|
||||
|
||||
successParticles(level, fishPond);
|
||||
fishPond.set(fishPond.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),
|
||||
},
|
||||
});
|
||||
fishPond.setEntityData(nbt);
|
||||
global.inventoryUseItems(inventory, questContent.item, checkedCount);
|
||||
|
||||
level.spawnParticles(
|
||||
"species:ascending_dust",
|
||||
true,
|
||||
x,
|
||||
y + 1,
|
||||
z,
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
global.getQuestItems = (block, level) => {
|
||||
let requestedItems = [];
|
||||
const { x, y, z } = block;
|
||||
let attachedPlayer;
|
||||
const ownerUuid = block.getEntityData().data.owner;
|
||||
|
||||
if (ownerUuid === "-1") return;
|
||||
|
||||
for (const p of level.getServer().players) {
|
||||
if (p.getUuid().toString() === ownerUuid) {
|
||||
attachedPlayer = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (attachedPlayer) {
|
||||
let radius = 10;
|
||||
let scanBlock;
|
||||
let halfCost = attachedPlayer.stages.has("pond_house_five");
|
||||
for (let pos of BlockPos.betweenClosed(new BlockPos(x - radius, y - radius, z - radius),
|
||||
[x + radius, y + radius, z + radius])) {
|
||||
scanBlock = level.getBlock(pos);
|
||||
if (scanBlock.id === "society:fish_pond") {
|
||||
let nbt = scanBlock.getEntityData();
|
||||
|
||||
if (!nbt || !nbt.data) continue;
|
||||
|
||||
let { type: fishType, max_population, quest_id } = nbt.data;
|
||||
let { quest } = global.getPondProperties(scanBlock);
|
||||
|
||||
if (quest === "true" && global.fishPondDefinitions.get(`${fishType}`)) {
|
||||
let questContent = getRequestedItems(fishType, Number(max_population))[quest_id];
|
||||
if (!questContent) {
|
||||
continue;
|
||||
}
|
||||
let checkedCount = halfCost ?
|
||||
Math.round(questContent.count / 2) :
|
||||
questContent.count;
|
||||
let requestedItem = questContent.item;
|
||||
requestedItems.push({ item: requestedItem, count: checkedCount });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const groupedMap = new Map();
|
||||
for (let i = 0; i < requestedItems.length; i++) {
|
||||
let entry = requestedItems[i];
|
||||
groupedMap.set(entry.item, (groupedMap.get(entry.item) || 0) + entry.count);
|
||||
}
|
||||
|
||||
const entries = [];
|
||||
groupedMap.forEach(function (count, item) {
|
||||
const displayName = Item.of(item).displayName.string;
|
||||
entries.push({
|
||||
Checked: "0b",
|
||||
Text: `{"text":"${count} x ${displayName}"}`,
|
||||
});
|
||||
});
|
||||
|
||||
const pageSize = 6;
|
||||
let pages = [];
|
||||
for (let i = 0; i < entries.length; i += pageSize) {
|
||||
pages.push({ Entries: entries.slice(i, i + pageSize) });
|
||||
}
|
||||
|
||||
return pages;
|
||||
}
|
||||
|
||||
global.runFishPondQuestManager = (entity) => {
|
||||
const { block, level } = entity;
|
||||
const { x, y, z } = block;
|
||||
let attachedPlayer;
|
||||
|
||||
const cDayTime = level.dayTime();
|
||||
const currentMorningModulo = cDayTime % 24000;
|
||||
const questManagerProgTime = 1000;
|
||||
if (currentMorningModulo < questManagerProgTime ||
|
||||
currentMorningModulo >= questManagerProgTime + artMachineTickRate) return;
|
||||
|
||||
const ownerUuid = block.getEntityData().data.owner;
|
||||
|
||||
if (ownerUuid === "-1") return;
|
||||
|
||||
for (const p of level.getServer().players) {
|
||||
if (p.getUuid().toString() === ownerUuid) {
|
||||
attachedPlayer = p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (attachedPlayer) {
|
||||
const radius = 10;
|
||||
let scanBlock;
|
||||
let scannedBlocks = 0;
|
||||
|
||||
for (let pos of BlockPos.betweenClosed(new BlockPos(x - radius, y - radius, z - radius),
|
||||
[x + radius, y + radius, z + radius])) {
|
||||
scanBlock = level.getBlock(pos);
|
||||
if (scanBlock.id === "society:fish_pond") {
|
||||
global.handleManagerQuestSubmission(
|
||||
entity,
|
||||
pos.immutable(),
|
||||
attachedPlayer,
|
||||
scannedBlocks * 5);
|
||||
scannedBlocks++;
|
||||
}
|
||||
}
|
||||
|
||||
level.server.runCommandSilent(
|
||||
`playsound botania:spreader_fire block @a ${x} ${y} ${z}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:fish_pond_manager", "cardinal")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.fish_pond_manager.description").gray());
|
||||
item.tooltip(Text.translatable("society.working_block_entity.apply_player_skill").gray());
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `21x21x21`).green());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/fish_pond_manager",
|
||||
});
|
||||
})
|
||||
.soundType("copper")
|
||||
.model("society:block/kubejs/fish_pond_manager")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 2);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
|
||||
global.runFishPondQuestManager(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,73 @@
|
||||
console.info("[SOCIETY] growthObelisk.js loaded");
|
||||
|
||||
const RandomSource = Java.loadClass("net.minecraft.util.RandomSource");
|
||||
|
||||
const growthObeliskProgTime = 1000;
|
||||
|
||||
global.runGrowthObelisk = (tickEvent) => {
|
||||
const { level, block, inventory } = tickEvent;
|
||||
const { x, y, z } = block;
|
||||
const server = level.server;
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
level.spawnParticles("snowyspirit:glow_light", true, x + 0.5, y + 2.2, z + 0.5, 0, 0, 0, 2, 2);
|
||||
if (
|
||||
morningModulo >= growthObeliskProgTime &&
|
||||
morningModulo < growthObeliskProgTime + artMachineTickRate
|
||||
) {
|
||||
if (global.hasInventoryItems(inventory, "society:spark_gro", 1)) {
|
||||
global.useInventoryItems(inventory, "society:spark_gro", 1);
|
||||
level.spawnParticles("species:ghoul_searching", true, x + 0.5, y, z + 0.5, 0, 0, 0, 1, 2);
|
||||
server.runCommandSilent(`playsound ribbits:entity.ribbit.magic block @a ${x} ${y} ${z} 1`);
|
||||
server.scheduleInTicks(4, () => {
|
||||
CropGrowthUtils.growCropsInRadius(level, block.getPos(), RandomSource.create(), 4);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e
|
||||
.create("society:growth_obelisk", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.growth_obelisk.description").gray());
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `7x1x7`).green());
|
||||
item.tooltip(Text.translatable("block.society.growth_obelisk.description.fuel").lightPurple());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/growth_obelisk/display",
|
||||
});
|
||||
})
|
||||
.soundType("stone")
|
||||
.model("society:block/kubejs/growth_obelisk/lower")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 2);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
|
||||
global.runGrowthObelisk(entity, 4);
|
||||
}),
|
||||
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))
|
||||
);
|
||||
});
|
||||
e
|
||||
.create("society:growth_obelisk_upper", "cardinal")
|
||||
.box(4, 0, 4, 12, 9, 12)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.defaultCutout()
|
||||
.soundType("stone")
|
||||
.model("society:block/kubejs/growth_obelisk/upper");
|
||||
});
|
||||
@@ -0,0 +1,77 @@
|
||||
console.info("[SOCIETY] juiceInserter.js loaded");
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:juice_inserter", "cardinal")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.box(1, 0, 1, 15, 16, 15)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.juice_inserter.description").gray());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/juice_inserter",
|
||||
});
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.initialData({ Fluid: 0, FluidType: "" });
|
||||
blockInfo.serverTick(10, 0, (entity) => {
|
||||
global.runJuiceInserter(entity);
|
||||
});
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.FLUID.customBlockEntity()
|
||||
.getCapacity(() => 10000)
|
||||
.getFluid((blockInfo, fl) => global.getFluid(blockInfo))
|
||||
.onFill((blockInfo, fluid, sim) => global.onFill(blockInfo, fluid, sim))
|
||||
.onDrain((blockInfo, fluid, sim) => global.onDrain(blockInfo, fluid, sim))
|
||||
);
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
apply: { model: "society:block/kubejs/juice_inserter_particle" },
|
||||
},
|
||||
].concat(getCardinalMultipartJsonBasic("juice_inserter")),
|
||||
};
|
||||
});
|
||||
|
||||
const juiceMap = [
|
||||
{ fluid: "vinery:white_grape_juice", barrelFluidId: "white_general" },
|
||||
{ fluid: "vinery:white_savanna_grape_juice", barrelFluidId: "white_savanna" },
|
||||
{ fluid: "vinery:white_taiga_grape_juice", barrelFluidId: "white_taiga" },
|
||||
{ fluid: "vinery:white_jungle_grape_juice", barrelFluidId: "white_jungle" },
|
||||
{ fluid: "nethervinery:warped_grape_juice", barrelFluidId: "white_warped" },
|
||||
{ fluid: "vinery:red_grape_juice", barrelFluidId: "red_general" },
|
||||
{ fluid: "vinery:red_savanna_grape_juice", barrelFluidId: "red_savanna" },
|
||||
{ fluid: "vinery:red_taiga_grape_juice", barrelFluidId: "red_taiga" },
|
||||
{ fluid: "vinery:red_jungle_grape_juice", barrelFluidId: "red_jungle" },
|
||||
{ fluid: "nethervinery:crimson_grape_juice", barrelFluidId: "red_crimson" },
|
||||
{ fluid: "vinery:apple_juice", barrelFluidId: "apple" },
|
||||
];
|
||||
global.runJuiceInserter = (blockInfo) => {
|
||||
const { block, level } = blockInfo;
|
||||
const fluidHandler = blockInfo.getCapability(ForgeCapabilities.FLUID_HANDLER).orElse(null);
|
||||
const fermentationBarrel = global.getFermentingBarrel(level, level.getBlock(block.getPos()));
|
||||
if (!fermentationBarrel.id.equals("vinery:fermentation_barrel")) return;
|
||||
let barrelData = fermentationBarrel.getEntityData();
|
||||
if (!barrelData) return;
|
||||
if (!block.getEntityData()) return;
|
||||
const fluidData = block.getEntityData().ForgeData;
|
||||
if (!barrelData) return;
|
||||
if (Number(barrelData.FluidLevel) + 25 > 100) return;
|
||||
if (fluidData === null || fluidData.Fluid < 250) return;
|
||||
juiceMap.forEach((juice) => {
|
||||
if (fluidData.FluidType && fluidData.FluidType.equals(juice.fluid)) {
|
||||
if (barrelData.FluidLevel === 0) {
|
||||
barrelData.JuiceType = juice.barrelFluidId;
|
||||
fermentationBarrel.setEntityData(barrelData);
|
||||
}
|
||||
if (barrelData.JuiceType.equals(juice.barrelFluidId)) {
|
||||
fluidHandler.drain(Fluid.of(fluidData.FluidType, 250), "execute");
|
||||
barrelData.FluidLevel = barrelData.FluidLevel + 25.0;
|
||||
fermentationBarrel.setEntityData(barrelData);
|
||||
level
|
||||
.getServer()
|
||||
.runCommandSilent(`playsound create:spout block @a ${block.x} ${block.y} ${block.z}`);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,150 @@
|
||||
console.info("[SOCIETY] manaFruit.js loaded");
|
||||
|
||||
const MANA_DRAIN = 2500;
|
||||
const FRUIT_MAX_MANA = MANA_DRAIN * 4;
|
||||
|
||||
global.handleManaFruit = (e) => {
|
||||
const { level, block } = e;
|
||||
const { x, y, z } = block;
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
let blockProperties = level.getBlock(block.pos).getProperties();
|
||||
let age = Number(blockProperties.get("age"));
|
||||
if (!global.surviveCheck(level, block.pos))
|
||||
level.destroyBlock(block.pos, true);
|
||||
if (age < 7 && morningModulo >= 20 && morningModulo < 40) {
|
||||
let mana = e.persistentData.getInt("mana");
|
||||
|
||||
if (mana >= MANA_DRAIN) {
|
||||
blockProperties.age = String(
|
||||
age +
|
||||
CropGrowthUtils.getFertilizerIncrease(
|
||||
age,
|
||||
7,
|
||||
level.getBlockState(block.pos.below())
|
||||
)
|
||||
);
|
||||
block.set(block.id, blockProperties);
|
||||
e.persistentData.putInt("mana", mana - MANA_DRAIN);
|
||||
level.server.runCommandSilent(
|
||||
`playsound botania:mana_pool_craft block @a ${x} ${y} ${z}`
|
||||
);
|
||||
level.spawnParticles(
|
||||
"windswept:will_o_the_wisp",
|
||||
true,
|
||||
x,
|
||||
y + 0.25,
|
||||
z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
} else if (age > 0) {
|
||||
blockProperties.age = String(age - 1);
|
||||
block.set(block.id, blockProperties);
|
||||
level.server.runCommandSilent(
|
||||
`playsound botania:virus_infect block @a ${x} ${y} ${z}`
|
||||
);
|
||||
level.spawnParticles(
|
||||
"farmlife:stinky",
|
||||
true,
|
||||
x,
|
||||
y + 0.25,
|
||||
z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e
|
||||
.create("society:mana_fruit_crop")
|
||||
.defaultCutout()
|
||||
.hardness(0)
|
||||
.resistance(0)
|
||||
.displayName("Mana Fruit Seed")
|
||||
.mapColor("grass")
|
||||
.soundType("azalea_leaves")
|
||||
.box(1, 0, 1, 15, 4, 15)
|
||||
.property(integerProperty.create("age", 0, 7))
|
||||
.defaultState((state) => {
|
||||
state.set(integerProperty.create("age", 0, 7), 0);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(integerProperty.create("age", 0, 7), 0);
|
||||
})
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.serverTick(20, 0, (entity) => global.handleManaFruit(entity)),
|
||||
blockInfo.attachCapability(
|
||||
BotaniaCapabilityBuilder.MANA.blockEntity()
|
||||
.canReceiveManaFromBurst((be) => {
|
||||
let mana = be.persistentData.getInt("mana");
|
||||
return mana < FRUIT_MAX_MANA;
|
||||
})
|
||||
.receiveMana((be, amount) => {
|
||||
let currentMana = be.persistentData.getInt("mana");
|
||||
let received = Math.min(FRUIT_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 >= FRUIT_MAX_MANA;
|
||||
})
|
||||
);
|
||||
})
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("society.working_block_entity.need_mana").aqua()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/mana_fruit_seed",
|
||||
},
|
||||
});
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 6 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage4" },
|
||||
},
|
||||
{
|
||||
when: { age: 7 },
|
||||
apply: { model: "society:block/kubejs/crops/mana_fruit_crop_stage5" },
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,110 @@
|
||||
console.info("[SOCIETY] manaMilker.js loaded");
|
||||
|
||||
const MANA_PER_MILK = 400;
|
||||
const MAX_MANA = MANA_PER_MILK * 10;
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:mana_milker")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 0, 16, 16, 16)
|
||||
.defaultCutout()
|
||||
.soundType("copper")
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.mana_milker.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable("society.working_block_entity.can_use_hopper").green()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable("society.working_block_entity.need_mana").aqua()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable("tooltip.society.area", `10x10x10`).green()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/mana_milker",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/mana_milker")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 1);
|
||||
blockInfo.serverTick(1200, 0, (entity) => {
|
||||
const { inventory, block, level } = entity;
|
||||
let mana = entity.persistentData.getInt("mana");
|
||||
inventory.allItems;
|
||||
let nearbyFarmAnimals;
|
||||
nearbyFarmAnimals = level
|
||||
.getEntitiesWithin(AABB.ofBlock(block).inflate(10))
|
||||
.filter((entity) =>
|
||||
global.checkEntityTag(entity, "society:milkable_animal")
|
||||
);
|
||||
nearbyFarmAnimals.forEach((animal) => {
|
||||
let data = animal.persistentData;
|
||||
if (mana >= MANA_PER_MILK) {
|
||||
const day = global.getDay(level);
|
||||
let milkItem = global.getMilk(
|
||||
level, animal, data, null, day, undefined, undefined, global.NO_STAGES
|
||||
);
|
||||
if (milkItem !== -1) {
|
||||
let success = entity.inventory.insertItem(milkItem, false);
|
||||
if (success) {
|
||||
entity.persistentData.putInt("mana", mana - MANA_PER_MILK);
|
||||
|
||||
level.server.runCommandSilent(
|
||||
`playsound minecraft:entity.cow.milk block @a ${animal.x} ${animal.y} ${animal.z}`
|
||||
);
|
||||
level.spawnParticles(
|
||||
"atmospheric:aloe_blossom",
|
||||
true,
|
||||
animal.x,
|
||||
animal.y + 1.5,
|
||||
animal.z,
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
0.1 * rnd(1, 4),
|
||||
5,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}),
|
||||
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)
|
||||
)
|
||||
);
|
||||
blockInfo.attachCapability(
|
||||
BotaniaCapabilityBuilder.MANA.blockEntity()
|
||||
.canReceiveManaFromBurst((be) => {
|
||||
let mana = be.persistentData.getInt("mana");
|
||||
return mana < MAX_MANA;
|
||||
})
|
||||
.receiveMana((be, amount) => {
|
||||
let currentMana = be.persistentData.getInt("mana");
|
||||
let received = Math.min(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 >= MAX_MANA;
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,98 @@
|
||||
console.info("[SOCIETY] manaSprinkler.js loaded");
|
||||
|
||||
const MANA_PER_SPRINKLE = 50;
|
||||
const SPRINKLER_MAX_MANA = MANA_PER_SPRINKLE * 25 * 8;
|
||||
|
||||
global.manaSprinklerScan = (entity, radius) => {
|
||||
const { block, level } = entity;
|
||||
const { x, y, z } = block;
|
||||
let scanBlock;
|
||||
let sprinklerMana = entity.persistentData.getInt("mana");
|
||||
let flowerBE
|
||||
let triggeredSpread = false;
|
||||
|
||||
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 == "society:mana_fruit_crop") {
|
||||
sprinklerMana = entity.persistentData.getInt("mana");
|
||||
flowerBE = scanBlock.entity
|
||||
if (sprinklerMana > MANA_PER_SPRINKLE && flowerBE.persistentData.getInt("mana") < FRUIT_MAX_MANA) {
|
||||
flowerBE.persistentData.putInt("mana", flowerBE.persistentData.getInt("mana") + MANA_PER_SPRINKLE);
|
||||
entity.persistentData.putInt("mana", entity.persistentData.getInt("mana") - MANA_PER_SPRINKLE);
|
||||
flowerBE.setChanged()
|
||||
entity.setChanged()
|
||||
triggeredSpread = true;
|
||||
level.spawnParticles(
|
||||
"windswept:will_o_the_wisp",
|
||||
true,
|
||||
scanBlock.x + 0.5,
|
||||
scanBlock.y + 1.25,
|
||||
scanBlock.z + 0.5,
|
||||
0, 0, 0,
|
||||
1,
|
||||
0.01
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (triggeredSpread) {
|
||||
level.server.runCommandSilent(
|
||||
`playsound doapi:water_sprinkler block @a ${x} ${y} ${z} 0.5 1`
|
||||
);
|
||||
level.server.runCommandSilent(
|
||||
`playsound botania:spreader_fire block @a ${x} ${y} ${z} 0.5 1`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:mana_sprinkler")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.tagBlock("dew_drop_farmland_growth:sprinkler_tier_2")
|
||||
.defaultCutout()
|
||||
.soundType("wood")
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.mana_sprinkler.description").aqua()
|
||||
);
|
||||
item.tooltip(Text.translatable(
|
||||
"tooltip.society.area",
|
||||
`5x5`
|
||||
).green())
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.mana_sprinkler.need_mana").aqua()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/mana_sprinkler",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/mana_sprinkler")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.serverTick(20, 0, (entity) => {
|
||||
global.manaSprinklerScan(entity, 2);
|
||||
}),
|
||||
blockInfo.attachCapability(
|
||||
BotaniaCapabilityBuilder.MANA.blockEntity()
|
||||
.canReceiveManaFromBurst((be) => {
|
||||
let mana = be.persistentData.getInt("mana");
|
||||
return mana < SPRINKLER_MAX_MANA;
|
||||
})
|
||||
.receiveMana((be, amount) => {
|
||||
let currentMana = be.persistentData.getInt("mana");
|
||||
let received = Math.min(SPRINKLER_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 >= SPRINKLER_MAX_MANA;
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,113 @@
|
||||
// priority: -21
|
||||
console.info("[SOCIETY] picklingCan.js loaded");
|
||||
|
||||
global.picklingRecipes = new Map([
|
||||
["vintagedelight:ghost_pepper", { pickle: "vintagedelight:pickled_pepper" }],
|
||||
["vintagedelight:cucumber", { pickle: "vintagedelight:pickle" }],
|
||||
["minecraft:pitcher_pod", { pickle: "vintagedelight:pickled_pitcher_pod" }],
|
||||
["minecraft:beetroot", { pickle: "vintagedelight:pickled_beetroot" }],
|
||||
["farm_and_charm:onion", { pickle: "vintagedelight:pickled_onion" }],
|
||||
["farmersdelight:cabbage", { pickle: "vintagedelight:kimchi" }],
|
||||
["farmersdelight:cabbage_leaf", { pickle: "vintagedelight:kimchi" }],
|
||||
["minecraft:egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["minecraft:turtle_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["untitledduckmod:duck_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["untitledduckmod:goose_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["autumnity:turkey_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["farmlife:galliraptor_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["society:penguin_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["society:flamingo_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
["society:cracked_egg", { pickle: "vintagedelight:pickled_egg" }],
|
||||
]);
|
||||
global.picklableVegetables.forEach((pickle) => {
|
||||
global.picklingRecipes.set(pickle.item, {
|
||||
pickle: `society:pickled_${pickle.item.split(":")[1]}`,
|
||||
});
|
||||
});
|
||||
global.handlePicklingCan = (e) => {
|
||||
const { inventory, level, block } = e;
|
||||
const { x, y, z } = block;
|
||||
let radius = 1;
|
||||
let slots = inventory.getSlots();
|
||||
let slotItem;
|
||||
const belowPos = block.getPos().below();
|
||||
const belowBlock = level.getBlock(belowPos.x, belowPos.y, belowPos.z);
|
||||
if (belowBlock.inventory && !inventory.isEmpty()) {
|
||||
for (let i = 0; i < slots; i++) {
|
||||
slotItem = inventory.getStackInSlot(i);
|
||||
if (
|
||||
slotItem !== Item.of("minecraft:air") &&
|
||||
global.picklingRecipes.get(`${slotItem.id}`)
|
||||
) {
|
||||
let pickle = global.picklingRecipes.get(`${slotItem.id}`).pickle;
|
||||
let pickleItem = Item.of(`1x ${pickle}`, slotItem.nbt);
|
||||
if (global.inventoryBelowHasRoom(level, block, pickleItem)) {
|
||||
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.id === "vintagedelight:salt") {
|
||||
let saltProperties = scanBlock.getProperties();
|
||||
if (rnd50()) {
|
||||
if (Number(saltProperties.get("layers")) > 1) {
|
||||
saltProperties.layers = `${Number(saltProperties.get("layers")) - 1
|
||||
}`;
|
||||
scanBlock.set(scanBlock.id, saltProperties);
|
||||
} else {
|
||||
scanBlock.set("minecraft:air");
|
||||
}
|
||||
}
|
||||
|
||||
global.insertBelow(level, block, pickleItem);
|
||||
slotItem.count--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:pickling_can")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.soundType("copper")
|
||||
.box(1, 0, 1, 15, 15, 15)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.prickly_can.description").gray());
|
||||
item.tooltip(Text.translatable("block.society.prickly_can.description.warn").red());
|
||||
item.tooltip(Text.translatable("society.working_block_entity.can_use_hopper").green());
|
||||
item.tooltip(Text.translatable("society.working_block_entity.preserve_quality").green());
|
||||
item.modelJson({
|
||||
parent: "etcetera:block/prickly_can",
|
||||
});
|
||||
})
|
||||
.model("etcetera:block/prickly_can")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 1);
|
||||
blockInfo.serverTick(600, 0, (entity) => {
|
||||
global.handlePicklingCan(entity);
|
||||
}),
|
||||
blockInfo.rightClickOpensInventory();
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.ITEM.blockEntity()
|
||||
.insertItem((blockEntity, slot, stack, simulate) =>
|
||||
blockEntity.inventory.insertItem(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,69 @@
|
||||
console.info("[SOCIETY] qualityWasher.js loaded");
|
||||
|
||||
global.handleQualityWasher = (e) => {
|
||||
const { inventory, level, block } = e;
|
||||
let slots = inventory.getSlots();
|
||||
let slotItem;
|
||||
let sentItem;
|
||||
let belowItem;
|
||||
const belowPos = block.getPos().below();
|
||||
const belowBlock = level.getBlock(belowPos.x, belowPos.y, belowPos.z);
|
||||
if (belowBlock.inventory && !inventory.isEmpty()) {
|
||||
for (let i = 0; i < slots; i++) {
|
||||
slotItem = inventory.getStackInSlot(i);
|
||||
if (slotItem !== Item.of("minecraft:air")) {
|
||||
for (let j = 0; j < belowBlock.inventory.slots; j++) {
|
||||
belowItem = belowBlock.inventory.getStackInSlot(j);
|
||||
if (
|
||||
belowItem === Item.of("minecraft:air") ||
|
||||
(belowItem === Item.of(slotItem.id) &&
|
||||
belowItem.count < belowBlock.inventory.getSlotLimit(j))
|
||||
) {
|
||||
sentItem = slotItem.copy();
|
||||
if (slotItem.nbt && slotItem.nbt.quality_food && !slotItem.hasTag('society:plushies')) {
|
||||
sentItem.nbt = null;
|
||||
}
|
||||
sentItem.count = 1;
|
||||
belowBlock.inventory.insertItem(j, sentItem, false);
|
||||
slotItem.count--;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:quality_washer", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 0, 16, 16, 16)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.quality_washer.description").gray());
|
||||
item.tooltip(Text.translatable("block.society.quality_washer.description.warn").red());
|
||||
item.tooltip(Text.translatable("society.working_block_entity.can_use_hopper").green());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/quality_washer",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/quality_washer")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 1);
|
||||
blockInfo.serverTick(20, 0, (entity) => {
|
||||
global.handleQualityWasher(entity);
|
||||
}),
|
||||
blockInfo.rightClickOpensInventory();
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.ITEM.blockEntity()
|
||||
.insertItem((blockEntity, slot, stack, simulate) =>
|
||||
blockEntity.inventory.insertItem(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,286 @@
|
||||
console.info("[SOCIETY] ribbitHut.js loaded");
|
||||
|
||||
const Block = Java.loadClass("net.minecraft.world.level.block.Block");
|
||||
const getDrops = (block, blockState, level, pos, player) => {
|
||||
if (block.id.includes("vinery")) {
|
||||
let grape = block.getProperties().get("grape").split("_");
|
||||
if (grape.length == 1) {
|
||||
return [
|
||||
Item.of(
|
||||
`4x ${["crimson", "warped"].includes(grape[0]) ? "nethervinery" : "vinery"
|
||||
}:${grape[0]}_grape`
|
||||
),
|
||||
];
|
||||
}
|
||||
return [Item.of(`4x vinery:${grape[0]}_grapes_${grape[1]}`)];
|
||||
}
|
||||
if (block.id.equals("windswept:wild_berry_bush")) {
|
||||
return [Item.of(`2x windswept:wild_berries`)];
|
||||
}
|
||||
if (block.id.equals("autumnity:tall_foul_berry_bush")) {
|
||||
return [Item.of(`2x autumnity:foul_berries`)];
|
||||
}
|
||||
return Block.getDrops(
|
||||
blockState,
|
||||
level,
|
||||
pos,
|
||||
null,
|
||||
player,
|
||||
Item.of("minecraft:hoe")
|
||||
);
|
||||
};
|
||||
const getPlantData = (block, mcBlock, blockState) => {
|
||||
let properties = block.getProperties();
|
||||
if (
|
||||
!properties ||
|
||||
!properties.get("age") ||
|
||||
["minecraft:torchflower", "minecraft:pitcher_crop"].includes(block.id)
|
||||
) {
|
||||
return {
|
||||
maxAge: true,
|
||||
};
|
||||
}
|
||||
if (
|
||||
[
|
||||
"windswept:wild_berry_bush",
|
||||
"minecraft:sweet_berry_bush",
|
||||
"autumnity:tall_foul_berry_bush",
|
||||
].includes(block.id)
|
||||
) {
|
||||
return {
|
||||
maxAge: properties.get("age").equals("3"),
|
||||
newAge:
|
||||
"minecraft:sweet_berry_bush".equals(block.id) ||
|
||||
"autumnity:tall_foul_berry_bush".equals(block.id)
|
||||
? "1"
|
||||
: "2",
|
||||
};
|
||||
}
|
||||
if ("society:mana_fruit_crop".equals(block.id))
|
||||
return { maxAge: properties.get("age").equals("7"), newAge: "0" };
|
||||
if ("vintagedelight:gearo_berry_bush".equals(block.id))
|
||||
return { maxAge: properties.get("age").equals("4"), newAge: "2" };
|
||||
if ("minecraft:cocoa".equals(block.id))
|
||||
return { maxAge: properties.get("age").equals("2"), newAge: "0" };
|
||||
if ("minecraft:nether_wart".equals(block.id))
|
||||
return { maxAge: properties.get("age").equals("3"), newAge: "0" };
|
||||
if (block.id.includes("vinery")) {
|
||||
return {
|
||||
maxAge: properties.get("age").equals("4"),
|
||||
newAge: block.id.includes("lattice") ? "1" : "2",
|
||||
};
|
||||
}
|
||||
if (["minecraft:melon_stem", "minecraft:pumpkin_stem"].includes(block.id)) {
|
||||
return {
|
||||
maxAge: false,
|
||||
newAge: "0",
|
||||
};
|
||||
}
|
||||
return { maxAge: mcBlock.isMaxAge(blockState), newAge: "0" };
|
||||
};
|
||||
const setHarvested = (level, pos, server, block, age) => {
|
||||
let newProperties = block.getProperties();
|
||||
if (age) {
|
||||
newProperties.age = `${age}`;
|
||||
block.set(block.id, newProperties);
|
||||
} else {
|
||||
block.set("minecraft:air");
|
||||
}
|
||||
const { x, y, z } = pos;
|
||||
server.runCommandSilent(
|
||||
`playsound minecraft:block.grass.break block @a ${x} ${y} ${z} 0.5`
|
||||
);
|
||||
level.spawnParticles(
|
||||
"ribbits:spell",
|
||||
true,
|
||||
x + 0.5,
|
||||
y + 0.5,
|
||||
z + 0.5,
|
||||
0,
|
||||
0.1,
|
||||
0,
|
||||
1,
|
||||
0.0001
|
||||
);
|
||||
};
|
||||
global.handleRibbitHarvest = (tickEvent, pos, player, delay) => {
|
||||
const { level, block } = tickEvent;
|
||||
const server = level.server;
|
||||
let blockState;
|
||||
let drops;
|
||||
let quality;
|
||||
let scannedBlock;
|
||||
let inserted = false;
|
||||
let valid = true;
|
||||
let plantData;
|
||||
if (global.susFunctionLogging) console.log("[SOCIETY-SUSFN] ribbitHut.js");
|
||||
server.scheduleInTicks(delay, () => {
|
||||
if (!level.isLoaded(pos)) return;
|
||||
scannedBlock = level.getBlock(pos);
|
||||
if (scannedBlock && scannedBlock.hasTag("society:ribbit_hut_harvests")) {
|
||||
blockState = level.getBlockState(pos);
|
||||
plantData = getPlantData(scannedBlock, blockState.block, blockState);
|
||||
if (
|
||||
scannedBlock.id === "supplementaries:flax" &&
|
||||
scannedBlock.getProperties().get("half") == "lower"
|
||||
) {
|
||||
valid = false;
|
||||
}
|
||||
if (valid && plantData.maxAge) {
|
||||
drops = getDrops(scannedBlock, blockState, level, pos, player);
|
||||
drops.forEach((drop) => {
|
||||
quality = global.getCropQuality(scannedBlock);
|
||||
// 4.0 TODO: remove effects:[] from this data
|
||||
if (quality > 0) {
|
||||
drop.nbt = `{quality_food:{effects:[],quality:${quality}}}`;
|
||||
}
|
||||
if (scannedBlock.id == "society:mana_fruit_crop") {
|
||||
if (player.stages.has("paradise_crop")) drop.count += 1;
|
||||
if (player.stages.has("crop_collector")) drop.count *= 2;
|
||||
}
|
||||
if (global.inventoryHasRoom(block, drop)) {
|
||||
global.insertInto(block, drop);
|
||||
inserted = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (inserted) {
|
||||
inserted = false;
|
||||
if (scannedBlock.id === "supplementaries:flax") {
|
||||
scannedBlock.set("minecraft:air");
|
||||
level
|
||||
.getBlock(pos.below())
|
||||
.set("supplementaries:flax", { age: "0", half: "lower" });
|
||||
} else {
|
||||
setHarvested(level, pos, server, scannedBlock, plantData.newAge);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
global.runRibbitHut = (tickEvent) => {
|
||||
const { level, block } = tickEvent;
|
||||
let centerBlock = global.getOpposite(
|
||||
block.getProperties().get("facing"),
|
||||
block.getPos()
|
||||
);
|
||||
const { x, y, z } = centerBlock;
|
||||
let scannedBlocks = 0;
|
||||
let attachedPlayer;
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
const ribbitHutProgTime = 1000;
|
||||
if (
|
||||
morningModulo >= ribbitHutProgTime &&
|
||||
morningModulo < ribbitHutProgTime + artMachineTickRate
|
||||
) {
|
||||
level.getServer().players.forEach((p) => {
|
||||
if (p.getUuid().toString() === block.getEntityData().data.owner) {
|
||||
attachedPlayer = p;
|
||||
}
|
||||
});
|
||||
if (attachedPlayer) {
|
||||
level.server.runCommandSilent(
|
||||
`playsound ribbits:entity.ribbit.ambient block @a ${x} ${y} ${z}`
|
||||
);
|
||||
for (let pos of BlockPos.betweenClosed(
|
||||
new BlockPos(x - 7, y - 1, z - 7),
|
||||
[x + 7, y + 1, z + 7]
|
||||
)) {
|
||||
global.handleRibbitHarvest(
|
||||
tickEvent,
|
||||
pos.immutable(),
|
||||
attachedPlayer,
|
||||
scannedBlocks
|
||||
);
|
||||
scannedBlocks++;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e.create("society:ribbit_hut", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.soundType("shroomlight")
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.ribbit_hut.description").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"society.working_block_entity.apply_player_skill"
|
||||
).gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable("tooltip.society.area", `15x3x15`).green()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/ribbit_hut_item",
|
||||
},
|
||||
});
|
||||
})
|
||||
.lightLevel(1)
|
||||
.property(booleanProperty.create("upgraded"))
|
||||
.defaultState((state) => {
|
||||
state.set(booleanProperty.create("upgraded"), false);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(booleanProperty.create("upgraded"), false);
|
||||
})
|
||||
.soundType("stone")
|
||||
.model("society:block/kubejs/ribbit_hut/bottom_front_center")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 3);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(artMachineTickRate, 0, (entity) => {
|
||||
global.runRibbitHut(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)
|
||||
)
|
||||
);
|
||||
});
|
||||
e.create("society:ribbit_hut_block", "cardinal")
|
||||
.property(integerProperty.create("layer", 0, 2))
|
||||
.property(integerProperty.create("depth", 0, 2))
|
||||
.property(integerProperty.create("side", 0, 2))
|
||||
.defaultState((state) => {
|
||||
state.set(integerProperty.create("layer", 0, 2), 0);
|
||||
state.set(integerProperty.create("depth", 0, 2), 0);
|
||||
state.set(integerProperty.create("side", 0, 2), 1);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(integerProperty.create("layer", 0, 2), 0);
|
||||
state.set(integerProperty.create("depth", 0, 2), 0);
|
||||
state.set(integerProperty.create("side", 0, 2), 1);
|
||||
})
|
||||
.resistance(3600000)
|
||||
.unbreakable()
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "ribbits:item/toadstool",
|
||||
});
|
||||
})
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.defaultCutout()
|
||||
.soundType("stone");
|
||||
});
|
||||
@@ -0,0 +1,129 @@
|
||||
// priority: -21
|
||||
console.info("[SOCIETY] roeRecycler.js loaded");
|
||||
|
||||
global.handleRoeRecycler = (e) => {
|
||||
const { inventory, level, block } = e;
|
||||
const { x, y, z } = block;
|
||||
let slots = inventory.getSlots();
|
||||
let slotItem;
|
||||
const belowPos = block.getPos().below();
|
||||
const belowBlock = level.getBlock(belowPos.x, belowPos.y, belowPos.z);
|
||||
if (rnd10() && belowBlock.inventory && !inventory.isEmpty()) {
|
||||
for (let i = 0; i < slots; i++) {
|
||||
slotItem = inventory.getStackInSlot(i);
|
||||
if (
|
||||
slotItem !== Item.of("minecraft:air") &&
|
||||
slotItem.id.includes("_roe") &&
|
||||
!slotItem.id.includes("aged_")
|
||||
) {
|
||||
let roeOutputs = [];
|
||||
let fish = global.fishPondDefinitions.get(
|
||||
global.getFishFromRoe(slotItem.id)
|
||||
);
|
||||
if (fish && fish.additionalRewards) {
|
||||
let fishPondRoll = 0;
|
||||
let population = rnd(1, 10);
|
||||
fish.additionalRewards.forEach((reward) => {
|
||||
fishPondRoll = Math.random();
|
||||
if (
|
||||
population >= reward.minPopulation &&
|
||||
fishPondRoll <= reward.chance / 2
|
||||
) {
|
||||
let calculateCount = Math.floor(
|
||||
Math.max(1, reward.count / 4) *
|
||||
((population - reward.minPopulation) /
|
||||
(10 - reward.minPopulation))
|
||||
);
|
||||
if (population == 10) calculateCount = reward.count;
|
||||
roeOutputs.push(
|
||||
`${calculateCount > 1 ? calculateCount : 1}x ${reward.item}`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (roeOutputs.length == 0 && rnd10()) {
|
||||
roeOutputs.push("1x aquaculture:algae");
|
||||
}
|
||||
let hasRoom = true;
|
||||
roeOutputs.forEach((item) => {
|
||||
if (!global.inventoryBelowHasRoom(level, block, item)) {
|
||||
hasRoom = false;
|
||||
}
|
||||
});
|
||||
if (hasRoom) {
|
||||
roeOutputs.forEach((item) => {
|
||||
global.insertBelow(level, block, item);
|
||||
});
|
||||
slotItem.count--;
|
||||
level.server.runCommandSilent(
|
||||
`playsound supplementaries:item.bubble_blower block @a ${block.x} ${block.y} ${block.z}`
|
||||
);
|
||||
level.spawnParticles(
|
||||
"supplementaries:suds",
|
||||
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(2, 6),
|
||||
0.001
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
level.spawnParticles(
|
||||
"domesticationinnovation:simple_bubble",
|
||||
true,
|
||||
x,
|
||||
y + 1,
|
||||
z,
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
0.2 * rnd(1, 1.5),
|
||||
3,
|
||||
0.01
|
||||
);
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:roe_recycler", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 0, 16, 16, 16)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.roe_recycler.description").gray()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/roe_recycler",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/roe_recycler")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 1);
|
||||
blockInfo.serverTick(20, 0, (entity) => {
|
||||
global.handleRoeRecycler(entity);
|
||||
}),
|
||||
blockInfo.rightClickOpensInventory();
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.ITEM.blockEntity()
|
||||
.insertItem((blockEntity, slot, stack, simulate) =>
|
||||
blockEntity.inventory.insertItem(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,63 @@
|
||||
console.info("[SOCIETY] shippingBinMonitor.js loaded");
|
||||
|
||||
global.runShippingBinMonitor = (entity) => {
|
||||
const { level, block } = entity;
|
||||
const belowPos = block.getPos().below();
|
||||
const belowBlock = level.getBlock(belowPos.x, belowPos.y, belowPos.z);
|
||||
if (belowBlock.hasTag("society:shipping_bin")) {
|
||||
let slots = belowBlock.inventory.getSlots();
|
||||
global.cacheShippingBin(entity);
|
||||
let blockData = belowBlock.getEntityData().data;
|
||||
let playerAttributes = blockData.attributes;
|
||||
let playerStages = blockData.stages;
|
||||
let calculationResults = -1;
|
||||
if (!playerStages || !playerAttributes) return;
|
||||
|
||||
calculationResults = Math.round(
|
||||
global.processShippingBinInventory(
|
||||
belowBlock.inventory,
|
||||
slots,
|
||||
playerAttributes,
|
||||
playerStages,
|
||||
false,
|
||||
true
|
||||
).calculatedValue
|
||||
);
|
||||
let nbt = block.getEntityData();
|
||||
if (nbt.data.value !== calculationResults) {
|
||||
nbt.merge({ data: { value: calculationResults } });
|
||||
global.setBlockEntityData(block, nbt)
|
||||
global.clearOldTextDisplay(block, level, "shipping_bin_monitor");
|
||||
global.spawnTextDisplay(
|
||||
block,
|
||||
block.y + 0.25,
|
||||
"shipping_bin_monitor",
|
||||
calculationResults === -1
|
||||
? Text.translatable("block.society.shipping_bin_monitor.offline")
|
||||
: Text.of(`●${calculationResults < 100000000 ? " " : ""}${global.formatPrice(calculationResults)}`)
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:shipping_bin_monitor", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.defaultCutout()
|
||||
.box(0, 0, 0, 16, 3, 16)
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.shipping_bin_monitor.description").gray());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/shipping_bin_monitor",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/shipping_bin_monitor")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.initialData({ value: 0 });
|
||||
blockInfo.serverTick(200, 0, (entity) => global.runShippingBinMonitor(entity));
|
||||
})
|
||||
.rightClick((click) => {
|
||||
global.runShippingBinMonitor({ block: click.block, level: click.level });
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,98 @@
|
||||
// priority: 1
|
||||
console.info("[SOCIETY] smartShippingBin.js loaded");
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("shippingbin:smart_shipping_bin", "cardinal")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("tooltip.society.smart_shipping_bin").gray()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable("tooltip.society.smart_shipping_bin.warn").red()
|
||||
);
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/smart_shipping_bin",
|
||||
});
|
||||
})
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.inventory(9, 6);
|
||||
blockInfo.initialData({ owner: "-1" });
|
||||
blockInfo.serverTick(4000, 0, (entity) => {
|
||||
const { inventory, block, level } = entity;
|
||||
if (global.susFunctionLogging) console.log("[SOCIETY-SUSFN] smartShippingBin.js");
|
||||
let slots = entity.inventory.getSlots();
|
||||
let value = 0;
|
||||
let binPlayer = global.cacheShippingBin(entity);
|
||||
let blockData = block.getEntityData().data;
|
||||
let playerAttributes = blockData.attributes;
|
||||
let playerStages = blockData.stages;
|
||||
let ownerUUID = blockData.owner;
|
||||
if (!playerStages || !playerAttributes) return;
|
||||
value = global.processShippingBinInventory(
|
||||
inventory,
|
||||
slots,
|
||||
playerAttributes,
|
||||
playerStages
|
||||
).calculatedValue;
|
||||
|
||||
global.processValueOutput(
|
||||
value,
|
||||
slots,
|
||||
undefined,
|
||||
binPlayer,
|
||||
level.getServer(),
|
||||
block,
|
||||
inventory,
|
||||
true,
|
||||
ownerUUID
|
||||
);
|
||||
}),
|
||||
blockInfo.rightClickOpensInventory();
|
||||
blockInfo.attachCapability(
|
||||
CapabilityBuilder.ITEM.blockEntity()
|
||||
.insertItem((blockEntity, slot, stack, simulate) =>
|
||||
blockEntity.inventory.insertItem(slot, stack, simulate)
|
||||
)
|
||||
.getSlotLimit((blockEntity, slot) => blockEntity.inventory.getSlotLimit(slot))
|
||||
.getSlots((blockEntity) => blockEntity.inventory.slots)
|
||||
.getStackInSlot((blockEntity, slot) => blockEntity.inventory.getStackInSlot(slot))
|
||||
);
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { facing: "north" },
|
||||
apply: {
|
||||
model: "society:block/kubejs/smart_shipping_bin",
|
||||
y: 0,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { facing: "east" },
|
||||
apply: {
|
||||
model: "society:block/kubejs/smart_shipping_bin",
|
||||
y: 90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { facing: "south" },
|
||||
apply: {
|
||||
model: "society:block/kubejs/smart_shipping_bin",
|
||||
y: 180,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
when: { facing: "west" },
|
||||
apply: {
|
||||
model: "society:block/kubejs/smart_shipping_bin",
|
||||
y: -90,
|
||||
uvlock: false,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
console.info("[SOCIETY] snowMelter.js loaded");
|
||||
|
||||
global.handleSnowMelter = (entity) => {
|
||||
const { block, level } = entity;
|
||||
if (block.level.hasNeighborSignal(block.pos)) return;
|
||||
const { x, y, z } = block;
|
||||
const radius = 10;
|
||||
const verticalRadius = 2;
|
||||
let scanBlock;
|
||||
if (global.susFunctionLogging) console.log('[SOCIETY-SUSFN] snowMelter.js')
|
||||
for (let pos of BlockPos.betweenClosed(new BlockPos(x - radius, y - verticalRadius, z - radius), [
|
||||
x + radius,
|
||||
y + verticalRadius,
|
||||
z + radius,
|
||||
])) {
|
||||
if (!level.isLoaded(pos)) continue;
|
||||
scanBlock = level.getBlock(pos);
|
||||
if (scanBlock.id === "minecraft:snow") {
|
||||
scanBlock.set("minecraft:air");
|
||||
}
|
||||
if (scanBlock.id === "snowrealmagic:snow") {
|
||||
scanBlock.set(scanBlock.getEntityData().Block);
|
||||
}
|
||||
if (scanBlock.id === "minecraft:ice") {
|
||||
scanBlock.set("minecraft:water");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e.create("society:snow_melter", "cardinal")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(0, 0, 0, 16, 16, 16)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.snow_melter.description").gray());
|
||||
item.tooltip(Text.translatable("tooltip.society.area", `19x5x19`).green());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/snow_melter",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/snow_melter")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.serverTick(600, 0, (entity) => {
|
||||
global.handleSnowMelter(entity);
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
// REMOVED
|
||||
@@ -0,0 +1,22 @@
|
||||
console.info("[SOCIETY] villagerHome.js loaded");
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
event
|
||||
.create("society:villager_home")
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.box(1, 0, 1, 15, 2, 15)
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.gray("Brings the invited villager to its housing and sets its home point."));
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/villager_home",
|
||||
});
|
||||
})
|
||||
.model("society:block/kubejs/villager_home")
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.enableSync();
|
||||
blockInfo.initialData({ placer: "-1", type: "", spawned: false });
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
// DEPRECATED
|
||||
@@ -0,0 +1,110 @@
|
||||
console.info("[SOCIETY] gnome.js loaded");
|
||||
|
||||
const getGnomeState = (name, type) => {
|
||||
const path = `society:block/kubejs/gnome/${name}`;
|
||||
let cardianal = [
|
||||
{
|
||||
when: { type: type, facing: "north" },
|
||||
apply: { model: path, y: 0, uvlock: false },
|
||||
},
|
||||
{
|
||||
when: { type: type, facing: "east" },
|
||||
apply: { model: path, y: 90, uvlock: false },
|
||||
},
|
||||
{
|
||||
when: { type: type, facing: "south" },
|
||||
apply: { model: path, y: 180, uvlock: false },
|
||||
},
|
||||
{
|
||||
when: { type: type, facing: "west" },
|
||||
apply: { model: path, y: -90, uvlock: false },
|
||||
},
|
||||
];
|
||||
return cardianal;
|
||||
};
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e
|
||||
.create("society:gnome", "cardinal")
|
||||
.property(integerProperty.create("type", 0, 3))
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.gnome.description").gray());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/gnome/base",
|
||||
});
|
||||
})
|
||||
.defaultState((state) => {
|
||||
state.set(integerProperty.create("type", 0, 3), 0);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(integerProperty.create("type", 0, 3), 0);
|
||||
})
|
||||
.rightClick((click) => {
|
||||
const { block, item, hand } = click;
|
||||
const type = Number(block.properties.get("type"));
|
||||
const facing = block.properties.get("facing");
|
||||
|
||||
if (hand == "OFF_HAND") return;
|
||||
if (hand == "MAIN_HAND") {
|
||||
if (item == "minecraft:lantern") {
|
||||
block.set("society:lantern_gnome", {
|
||||
facing: facing,
|
||||
});
|
||||
} else {
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
type: type == 3 ? "0" : String(type + 1),
|
||||
});
|
||||
}
|
||||
}
|
||||
}).blockstateJson = {
|
||||
multipart: []
|
||||
.concat(getGnomeState("base", 0))
|
||||
.concat(getGnomeState("fish", 1))
|
||||
.concat(getGnomeState("twig", 2))
|
||||
.concat(getGnomeState("swing", 3)),
|
||||
};
|
||||
e
|
||||
.create("society:lantern_gnome", "cardinal")
|
||||
.property(integerProperty.create("type", 0, 3))
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("block.society.lantern_gnome.description").gray());
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/gnome/lantern",
|
||||
});
|
||||
})
|
||||
.lightLevel(0.8)
|
||||
.rightClick((click) => {
|
||||
const { block, hand } = click;
|
||||
const type = Number(block.properties.get("type"));
|
||||
const facing = block.properties.get("facing");
|
||||
|
||||
if (hand == "OFF_HAND") return;
|
||||
if (hand == "MAIN_HAND") {
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
type: type == 3 ? "0" : String(type + 1),
|
||||
});
|
||||
}
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { facing: "north" },
|
||||
apply: { model: "society:block/kubejs/gnome/lantern", y: 0, uvlock: false },
|
||||
},
|
||||
{
|
||||
when: { facing: "east" },
|
||||
apply: { model: "society:block/kubejs/gnome/lantern", y: 90, uvlock: false },
|
||||
},
|
||||
{
|
||||
when: { facing: "south" },
|
||||
apply: { model: "society:block/kubejs/gnome/lantern", y: 180, uvlock: false },
|
||||
},
|
||||
{
|
||||
when: { facing: "west" },
|
||||
apply: { model: "society:block/kubejs/gnome/lantern", y: -90, uvlock: false },
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,257 @@
|
||||
ItemEvents.modification((e) => {
|
||||
e.modify("*", (item) => {
|
||||
item.maxDamage *= 3;
|
||||
});
|
||||
e.modify("gag:energized_hearthstone", (item) => {
|
||||
item.maxDamage = 2;
|
||||
});
|
||||
e.modify("gag:hearthstone", (item) => {
|
||||
item.maxDamage = 2;
|
||||
});
|
||||
e.modify("gag:escape_rope", (item) => {
|
||||
item.maxDamage = 1024;
|
||||
});
|
||||
global.geodeList.forEach((geodeItem) => {
|
||||
const { item } = geodeItem;
|
||||
e.modify(item, (item) => {
|
||||
item.rarity = "uncommon";
|
||||
});
|
||||
});
|
||||
global.frozenGeodeList.forEach((geodeItem) => {
|
||||
const { item } = geodeItem;
|
||||
e.modify(item, (item) => {
|
||||
item.rarity = "rare";
|
||||
});
|
||||
});
|
||||
global.magmaGeodeList.forEach((geodeItem) => {
|
||||
const { item } = geodeItem;
|
||||
e.modify(item, (item) => {
|
||||
item.rarity = "epic";
|
||||
});
|
||||
});
|
||||
e.modify("society:sparkstone", (item) => {
|
||||
item.rarity = "epic";
|
||||
});
|
||||
e.modify("numismatics:neptunium_coin", (item) => {
|
||||
item.rarity = "rare";
|
||||
});
|
||||
e.modify(
|
||||
[
|
||||
"numismatics:ancient_coin",
|
||||
"numismatics:prismatic_coin",
|
||||
"society:ancient_fruit_seed",
|
||||
"society:ancient_fruit",
|
||||
"society:sunlit_crystal",
|
||||
"society:plushie_wand",
|
||||
"society:treasure_totem",
|
||||
"society:recycled_core",
|
||||
"society:bubble_totem",
|
||||
"society:mystic_syrup",
|
||||
"society:net_bobber",
|
||||
"society:needle_bobber",
|
||||
"society:sparkpod",
|
||||
"society:sparkpod_seed",
|
||||
"cluttered:willow_sapling",
|
||||
"cluttered:willow_log",
|
||||
"cluttered:flowering_willow_log",
|
||||
"cluttered:flowering_willow_leaves",
|
||||
"cluttered:willow_leaves",
|
||||
"cluttered:willow_vines",
|
||||
"society:women_who_run_with_the_plushies",
|
||||
"society:the_spark_also_rises",
|
||||
"society:the_red_and_the_black",
|
||||
"society:the_quality_of_the_earth",
|
||||
"society:pond_house_five",
|
||||
"society:animal_cracker",
|
||||
"society:moon_statue",
|
||||
"society:roe_recycler",
|
||||
"minecraft:enchanting_table",
|
||||
"domesticationinnovation:collar_tag",
|
||||
"domesticationinnovation:wayward_lantern",
|
||||
"domesticationinnovation:drum",
|
||||
"society:spinel"
|
||||
],
|
||||
(item) => {
|
||||
item.rarity = "epic";
|
||||
},
|
||||
);
|
||||
e.modify(
|
||||
["society:milk_pail", "society:magic_shears", "society:mood_scanner"],
|
||||
(item) => {
|
||||
item.maxStackSize = 1;
|
||||
},
|
||||
);
|
||||
e.modify("society:aquamarine", (item) => {
|
||||
item.rarity = "uncommon";
|
||||
});
|
||||
e.modify("society:amethyst_chunk", (item) => {
|
||||
item.rarity = "uncommon";
|
||||
});
|
||||
e.modify("society:ruby", (item) => {
|
||||
item.rarity = "rare";
|
||||
});
|
||||
e.modify("society:topaz", (item) => {
|
||||
item.rarity = "rare";
|
||||
});
|
||||
e.modify("society:magic_rope", (item) => {
|
||||
item.rarity = "rare";
|
||||
});
|
||||
e.modify("society:magic_tunnel", (item) => {
|
||||
item.rarity = "rare";
|
||||
});
|
||||
e.modify("quark:diamond_heart", (item) => {
|
||||
item.rarity = "epic";
|
||||
});
|
||||
e.modify("society:jade", (item) => {
|
||||
item.rarity = "epic";
|
||||
});
|
||||
e.modify("society:prismatic_shard", (item) => {
|
||||
item.rarity = "epic";
|
||||
});
|
||||
e.modify("society:prismatic_shard_block", (item) => {
|
||||
item.rarity = "epic";
|
||||
});
|
||||
e.modify("society:golden_clock", (item) => {
|
||||
item.rarity = "epic";
|
||||
});
|
||||
const goldVanillaTools = [
|
||||
"minecraft:golden_hoe",
|
||||
"minecraft:golden_axe",
|
||||
"minecraft:golden_pickaxe",
|
||||
"minecraft:golden_shovel",
|
||||
];
|
||||
goldVanillaTools.forEach((tool) => {
|
||||
e.modify(tool, (item) => {
|
||||
item.digSpeed = 7;
|
||||
item.tier = (tier) => {
|
||||
tier.level = 3;
|
||||
};
|
||||
});
|
||||
});
|
||||
const goldHammers = [
|
||||
"justhammers:gold_reinforced_impact_hammer",
|
||||
"justhammers:gold_hammer",
|
||||
"justhammers:gold_destructor_hammer",
|
||||
"justhammers:gold_impact_hammer",
|
||||
"justhammers:gold_reinforced_hammer",
|
||||
];
|
||||
goldHammers.forEach((tool) => {
|
||||
e.modify(tool, (item) => {
|
||||
item.digSpeed = 7;
|
||||
item.tier = (tier) => {
|
||||
tier.level = 3;
|
||||
};
|
||||
});
|
||||
});
|
||||
e.modify("minecraft:golden_sword", (item) => {
|
||||
item.setAttackDamage(5.5);
|
||||
});
|
||||
e.modify("minecraft:golden_axe", (item) => {
|
||||
item.setAttackDamage(8);
|
||||
});
|
||||
const goldTools = [
|
||||
"farmersdelight:golden_knife",
|
||||
"aquaculture:gold_fishing_rod",
|
||||
"aquaculture:gold_fillet_knife",
|
||||
"sewingkit:gold_sewing_needle",
|
||||
"justhammers:gold_reinforced_hammer",
|
||||
"minecraft:golden_sword",
|
||||
"minecraft:golden_hoe",
|
||||
"minecraft:golden_axe",
|
||||
"minecraft:golden_pickaxe",
|
||||
"minecraft:golden_shovel",
|
||||
"justhammers:gold_reinforced_impact_hammer",
|
||||
"justhammers:gold_destructor_hammer",
|
||||
"justhammers:gold_impact_hammer",
|
||||
"justhammers:gold_hammer",
|
||||
];
|
||||
goldTools.forEach((tool) => {
|
||||
e.modify(tool, (item) => {
|
||||
item.maxDamage *= tool.namespace === "justhammers" ? 2 : 16;
|
||||
});
|
||||
});
|
||||
e.modify("minecraft:golden_helmet", (item) => {
|
||||
item.maxDamage *= 3;
|
||||
item.setArmorProtection(2.5);
|
||||
});
|
||||
e.modify("minecraft:golden_chestplate", (item) => {
|
||||
item.maxDamage *= 3;
|
||||
item.setArmorProtection(7);
|
||||
});
|
||||
e.modify("minecraft:golden_leggings", (item) => {
|
||||
item.maxDamage *= 3;
|
||||
item.setArmorProtection(5.5);
|
||||
});
|
||||
e.modify("minecraft:golden_boots", (item) => {
|
||||
item.maxDamage *= 3;
|
||||
item.setArmorProtection(2.5);
|
||||
});
|
||||
e.modify("twigs:twig", (item) => (item.burnTime = 200));
|
||||
const netheriteTools = [
|
||||
"minecraft:netherite_axe",
|
||||
"minecraft:netherite_hoe",
|
||||
"minecraft:netherite_pickaxe",
|
||||
"minecraft:netherite_shovel",
|
||||
];
|
||||
netheriteTools.forEach((armor) => {
|
||||
e.modify(armor, (item) => {
|
||||
item.setDigSpeed(item.digSpeed + 1);
|
||||
item.setAttackDamage(item.attackDamage + 2);
|
||||
});
|
||||
});
|
||||
e.modify("minecraft:netherite_sword", (item) => {
|
||||
item.setAttackDamage(10);
|
||||
});
|
||||
e.modify("minecraft:netherite_helmet", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(4);
|
||||
});
|
||||
e.modify("minecraft:netherite_chestplate", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(9);
|
||||
});
|
||||
e.modify("minecraft:netherite_leggings", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(7);
|
||||
});
|
||||
e.modify("minecraft:netherite_boots", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(3);
|
||||
});
|
||||
e.modify("botania:terrasteel_helmet", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(4);
|
||||
});
|
||||
e.modify("botania:terrasteel_chestplate", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(9);
|
||||
});
|
||||
e.modify("botania:terrasteel_leggings", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(7);
|
||||
});
|
||||
e.modify("botania:terrasteel_boots", (item) => {
|
||||
item.maxDamage *= 1.5;
|
||||
item.setArmorProtection(3);
|
||||
});
|
||||
|
||||
e.modify("botania:manasteel_sword", (item) => {
|
||||
item.setAttackDamage(7);
|
||||
});
|
||||
e.modify("botania:elementium_sword", (item) => {
|
||||
item.setAttackDamage(8);
|
||||
});
|
||||
e.modify("oreganized:electrum_sword", (item) => {
|
||||
item.setAttackDamage(8);
|
||||
});
|
||||
// Netherite Tier
|
||||
e.modify("botania:terra_sword", (item) => {
|
||||
item.setAttackDamage(10);
|
||||
});
|
||||
e.modify("botania:star_sword", (item) => {
|
||||
item.setAttackDamage(10);
|
||||
});
|
||||
e.modify("botania:thunder_sword", (item) => {
|
||||
item.setAttackDamage(10);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,154 @@
|
||||
console.info("[SOCIETY] plushieReRegister.js loaded");
|
||||
|
||||
global.plushieRightClick = (click) => {
|
||||
const { item, block, player, level, server, hand } = click;
|
||||
const { x, y, z } = block;
|
||||
let nbt = block.getEntityData();
|
||||
const { type, quest_id, affection, animal } = nbt.data;
|
||||
|
||||
if (player.isFake()) return;
|
||||
if (hand == "OFF_HAND") return;
|
||||
if (hand == "MAIN_HAND") {
|
||||
if (!Number(type)) {
|
||||
global.plushieTraits.forEach((trait, index) => {
|
||||
if (trait.trait.equals(type)) {
|
||||
nbt.merge({
|
||||
data: {
|
||||
type: index,
|
||||
},
|
||||
});
|
||||
global.setBlockEntityData(block, nbt)
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!animal) {
|
||||
if (
|
||||
player.stages.has("women_who_run_with_the_plushies") &&
|
||||
affection < 2
|
||||
) {
|
||||
nbt.merge({
|
||||
data: {
|
||||
affection: 2,
|
||||
},
|
||||
});
|
||||
global.setBlockEntityData(block, nbt)
|
||||
level.spawnParticles(
|
||||
"minecraft:heart",
|
||||
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
|
||||
);
|
||||
}
|
||||
if (quest_id > 0) {
|
||||
let questList = Ingredient.of(global.plushieTraits[type].tag).itemIds;
|
||||
let questOffset = 3;
|
||||
if (questList.length < 12) questOffset = 2;
|
||||
if (questList.length > 36) questOffset = 6;
|
||||
let questItem =
|
||||
questList[affection * questOffset + Number(quest_id) - 1];
|
||||
let questName = Item.of(questItem).displayName;
|
||||
if (item && item == questItem) {
|
||||
if (!player.isCreative()) item.count--;
|
||||
level.spawnParticles(
|
||||
"minecraft:heart",
|
||||
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
|
||||
);
|
||||
nbt.merge({
|
||||
data: {
|
||||
quest_id: affection == 3 ? "0" : String(rnd(1, 3)),
|
||||
affection: affection + 1,
|
||||
},
|
||||
});
|
||||
if (
|
||||
player.stages.has("husbandry_mastery") &&
|
||||
!player.stages.has("women_who_run_with_the_plushies") &&
|
||||
affection > 2 &&
|
||||
Math.random() <= 0.05
|
||||
) {
|
||||
block.popItemFromFace(
|
||||
"society:women_who_run_with_the_plushies",
|
||||
block.properties.get("facing")
|
||||
);
|
||||
}
|
||||
global.setBlockEntityData(block, nbt)
|
||||
player.tell(Text.translatable("society.plushie.thank").gray());
|
||||
} else {
|
||||
player.tell(Text.translatable("society.plushie.want_gift").gray());
|
||||
player.tell(questName);
|
||||
}
|
||||
}
|
||||
if (
|
||||
item == "minecraft:air" &&
|
||||
block.id === "whimsy_deco:adv_singing_frog_plushie"
|
||||
) {
|
||||
server.runCommandSilent(
|
||||
`playsound species:music.disk.spawner block @a ${x} ${y} ${z}`
|
||||
);
|
||||
block.set("whimsy_deco:sunlit_singing_frog", block.properties);
|
||||
global.setBlockEntityData(block, nbt)
|
||||
server.scheduleInTicks(0, () => {
|
||||
server.scheduleInTicks(2740, () => {
|
||||
if (
|
||||
level.getBlock(block.pos).id === "whimsy_deco:sunlit_singing_frog"
|
||||
) {
|
||||
block.set(
|
||||
"whimsy_deco:adv_singing_frog_plushie",
|
||||
block.properties
|
||||
);
|
||||
global.setBlockEntityData(block, nbt)
|
||||
}
|
||||
});
|
||||
});
|
||||
} else
|
||||
server.runCommandSilent(
|
||||
`playsound tanukidecor:block.mini_figure.squeak block @a ${x} ${y} ${z}`
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (event) => {
|
||||
global.originalPlushies.forEach((plushie) => {
|
||||
const splitStr = plushie.split(":");
|
||||
let modelPath = `${splitStr[0]}:block/${splitStr[1]}`;
|
||||
if (splitStr[0].equals("tanukidecor"))
|
||||
modelPath = `tanukidecor:block/mini_figure/${splitStr[1]}`;
|
||||
event
|
||||
.create(`${splitStr[0]}:adv_${splitStr[1]}`, "cardinal")
|
||||
.defaultCutout()
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.soundType("wool")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model(modelPath)
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: modelPath,
|
||||
});
|
||||
})
|
||||
.rightClick((click) => global.plushieRightClick(click))
|
||||
.blockEntity((blockInfo) => {
|
||||
blockInfo.initialData({
|
||||
type: "",
|
||||
quest_id: 0,
|
||||
quality: 0,
|
||||
affection: 0,
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
// DEPREACTED
|
||||
@@ -0,0 +1,845 @@
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e
|
||||
.create("society:treated_log")
|
||||
.soundType("wood")
|
||||
.property(BlockProperties.AXIS)
|
||||
.placementState((e) => e.set(BlockProperties.AXIS, e.clickedFace.axis))
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.tagBlock("minecraft:mineable/axe").blockstateJson = {
|
||||
variants: {
|
||||
"axis=x": {
|
||||
model: "society:block/kubejs/treated_log_horizontal",
|
||||
x: 90,
|
||||
y: 90,
|
||||
},
|
||||
"axis=y": {
|
||||
model: "society:block/kubejs/treated_log",
|
||||
},
|
||||
"axis=z": {
|
||||
model: "society:block/kubejs/treated_log_horizontal",
|
||||
x: 90,
|
||||
},
|
||||
},
|
||||
};
|
||||
// Ores
|
||||
e.create("society:earth_crystal")
|
||||
.box(2, 0, 2, 14, 8, 14)
|
||||
.defaultCutout()
|
||||
.soundType("stone")
|
||||
.hardness(2.5)
|
||||
.resistance(1.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.model("society:block/kubejs/earth_crystal")
|
||||
.lightLevel(0.5)
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/geode/earth_crystal",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e.create("society:fire_quartz")
|
||||
.box(2, 0, 2, 14, 8, 14)
|
||||
.defaultCutout()
|
||||
.soundType("amethyst")
|
||||
.hardness(2.5)
|
||||
.resistance(1.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_iron_tool")
|
||||
.lightLevel(0.8)
|
||||
.model("society:block/kubejs/fire_quartz")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/magma_geode/fire_quartz",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
e.create("society:geode_node")
|
||||
.box(4, 0, 4, 12, 9, 12)
|
||||
.defaultCutout()
|
||||
.soundType("stone")
|
||||
.hardness(4.5)
|
||||
.resistance(9.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_stone_tool")
|
||||
.model("society:block/kubejs/geode_node");
|
||||
|
||||
e.create("society:magma_geode_node")
|
||||
.box(4, 0, 4, 12, 9, 12)
|
||||
.defaultCutout()
|
||||
.soundType("stone")
|
||||
.hardness(22.5)
|
||||
.resistance(9.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_iron_tool")
|
||||
.model("society:block/kubejs/magma_geode_node");
|
||||
|
||||
e.create("society:omni_geode_node")
|
||||
.box(4, 0, 4, 12, 9, 12)
|
||||
.defaultCutout()
|
||||
.soundType("stone")
|
||||
.hardness(30.0)
|
||||
.resistance(9.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_diamond_tool")
|
||||
.model("society:block/kubejs/omni_geode_node");
|
||||
|
||||
// Skull Cavern
|
||||
e.create("society:skull_cavern_teleporter")
|
||||
.texture("up", "society:block/teleporter_top")
|
||||
.texture("down", "society:block/teleporter_bottom")
|
||||
.texture("north", "society:block/teleporter_side")
|
||||
.texture("east", "society:block/teleporter_side")
|
||||
.texture("south", "society:block/teleporter_side")
|
||||
.texture("west", "society:block/teleporter_side")
|
||||
.texture("particle", "society:block/teleporter_side")
|
||||
.mapColor("stone")
|
||||
.soundType("stone")
|
||||
.hardness(1.0)
|
||||
.resistance(3600000.0)
|
||||
.lightLevel(1)
|
||||
.requiresTool(false);
|
||||
|
||||
const createBoulder = (type) => {
|
||||
e.create(`society:${type}_boulder`)
|
||||
.texture("up", `society:block/${type}_boulder_top`)
|
||||
.texture("down", `society:block/${type}_boulder`)
|
||||
.texture("north", `society:block/${type}_boulder`)
|
||||
.texture("east", `society:block/${type}_boulder`)
|
||||
.texture("south", `society:block/${type}_boulder`)
|
||||
.texture("west", `society:block/${type}_boulder`)
|
||||
.texture("particle", `society:block/${type}_boulder`)
|
||||
.soundType("stone")
|
||||
.hardness(2)
|
||||
.resistance(1.0)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_iron_tool");
|
||||
};
|
||||
createBoulder("stone");
|
||||
createBoulder("ice");
|
||||
createBoulder("sandstone");
|
||||
createBoulder("blackstone");
|
||||
createBoulder("end_stone");
|
||||
|
||||
const createSkullVariant = (type, path) => {
|
||||
e.create(`society:skull_${type}`)
|
||||
.soundType("stone")
|
||||
.resistance(3600000)
|
||||
.requiresTool(true)
|
||||
.textureAll(path)
|
||||
.texture("particle", path)
|
||||
.unbreakable()
|
||||
.tagBlock("society:skull_block");
|
||||
};
|
||||
createSkullVariant("stone", "minecraft:block/stone");
|
||||
createSkullVariant("permafrost", "quark:block/permafrost");
|
||||
createSkullVariant("sandstone", "minecraft:block/sandstone_top");
|
||||
createSkullVariant("arid_sandstone", "atmospheric:block/arid_sandstone_top");
|
||||
createSkullVariant("blackstone", "minecraft:block/blackstone");
|
||||
createSkullVariant("end_stone", "minecraft:block/end_stone");
|
||||
|
||||
const createSupplyCrate = (type, path) => {
|
||||
e.create(`society:${type}_supply_crate`)
|
||||
.soundType("wood")
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.model(path)
|
||||
.tagBlock("society:supply_crate");
|
||||
};
|
||||
createSupplyCrate("oak", "refurbished_furniture:block/oak_crate_closed");
|
||||
createSupplyCrate(
|
||||
"spruce",
|
||||
"refurbished_furniture:block/spruce_crate_closed"
|
||||
);
|
||||
createSupplyCrate("palm", "everycomp:block/rfm/beachparty/palm_crate_closed");
|
||||
createSupplyCrate(
|
||||
"grimwood",
|
||||
"everycomp:block/rfm/atmospheric/grimwood_crate_closed"
|
||||
);
|
||||
|
||||
e.create("society:cavern_air")
|
||||
.box(0, 0, 0, 0, 0, 0)
|
||||
.property(integerProperty.create("type", 0, 4))
|
||||
.property(integerProperty.create("chunkbit", 0, 1))
|
||||
.model("minecraft:block/air")
|
||||
.hardness(-1)
|
||||
.resistance(3600000)
|
||||
.randomTick((tick) => {
|
||||
global.handleSkullCavernRegen(tick.level, tick.block);
|
||||
})
|
||||
.defaultState((state) => {
|
||||
state.set(integerProperty.create("type", 0, 4), 0);
|
||||
state.set(integerProperty.create("chunkbit", 0, 1), 0);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(integerProperty.create("type", 0, 4), 0);
|
||||
state.set(integerProperty.create("chunkbit", 0, 1), 0);
|
||||
});
|
||||
e.create("society:iridium_ore")
|
||||
.soundType("stone")
|
||||
.hardness(2.5)
|
||||
.resistance(1.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_diamond_tool")
|
||||
.model("society:block/kubejs/iridium_ore");
|
||||
|
||||
e.create("society:deepslate_iridium_ore")
|
||||
.soundType("stone")
|
||||
.hardness(2.5)
|
||||
.resistance(1.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_diamond_tool")
|
||||
.model("society:block/kubejs/deepslate_iridium_ore");
|
||||
|
||||
e.create("society:sparkstone_ore")
|
||||
.soundType("stone")
|
||||
.hardness(2.5)
|
||||
.resistance(1.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_diamond_tool")
|
||||
.model("society:block/kubejs/sparkstone_ore");
|
||||
|
||||
e.create("society:deepslate_sparkstone_ore")
|
||||
.soundType("stone")
|
||||
.hardness(2.5)
|
||||
.resistance(1.0)
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.tagBlock("minecraft:needs_diamond_tool")
|
||||
.model("society:block/kubejs/deepslate_sparkstone_ore");
|
||||
|
||||
e.create(`society:sparkstone_block`)
|
||||
.soundType("amethyst")
|
||||
.hardness(2)
|
||||
.resistance(1.0)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.textureAll("society:block/sparkstone_block");
|
||||
|
||||
e.create(`society:prismatic_shard_block`)
|
||||
.soundType("amethyst")
|
||||
.hardness(2)
|
||||
.resistance(1.0)
|
||||
.tagBlock("minecraft:mineable/pickaxe")
|
||||
.textureAll("society:block/prismatic_shard_block");
|
||||
|
||||
// Compressed Crops block
|
||||
e.create("society:animal_feed_sack", "cardinal")
|
||||
.model("society:block/kubejs/animal_feed_sack")
|
||||
.mapColor("dirt")
|
||||
.soundType("sand")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false);
|
||||
|
||||
e.create("herbalbrews:coffee_beans_sack")
|
||||
.texture("up", "quark:block/cocoa_beans_sack_top")
|
||||
.texture("down", "quark:block/cocoa_beans_sack_bottom")
|
||||
.texture("north", "quark:block/cocoa_beans_sack")
|
||||
.texture("east", "quark:block/cocoa_beans_sack")
|
||||
.texture("south", "quark:block/cocoa_beans_sack")
|
||||
.texture("west", "quark:block/cocoa_beans_sack")
|
||||
.mapColor("dirt")
|
||||
.soundType("sand")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.texture("particle", "quark:block/cocoa_beans_sack");
|
||||
|
||||
e.create("herbalbrews:yerba_mate_leaf_block")
|
||||
.textureAll("herbalbrews:block/green_tea_leaf2")
|
||||
.mapColor("grass")
|
||||
.soundType("azalea_leaves")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.texture("particle", "herbalbrews:block/green_tea_leaf2");
|
||||
|
||||
e.create("herbalbrews:rooibos_leaf_block")
|
||||
.textureAll("herbalbrews:block/green_tea_leaf2")
|
||||
.mapColor("grass")
|
||||
.soundType("azalea_leaves")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.texture("particle", "herbalbrews:block/green_tea_leaf2");
|
||||
|
||||
const createCrate = (type) => {
|
||||
e.create(`society:${type}_crate`)
|
||||
.texture("up", `society:block/${type}_crate_top`)
|
||||
.texture("down", "farmersdelight:block/crate_bottom")
|
||||
.texture("north", `society:block/${type}_crate_side`)
|
||||
.texture("east", `society:block/${type}_crate_side`)
|
||||
.texture("south", `society:block/${type}_crate_side`)
|
||||
.texture("west", `society:block/${type}_crate_side`)
|
||||
.texture("particle", `society:block/${type}_crate_top`)
|
||||
.mapColor("grass")
|
||||
.soundType("wood")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false);
|
||||
};
|
||||
|
||||
const crates = [
|
||||
"blueberry",
|
||||
"eggplant",
|
||||
"ancient_fruit",
|
||||
"sparkpod",
|
||||
"salmonberry",
|
||||
"boysenberry",
|
||||
"cranberry",
|
||||
"crystalberry",
|
||||
"mana_fruit",
|
||||
];
|
||||
crates.forEach((crate) => {
|
||||
createCrate(crate);
|
||||
});
|
||||
|
||||
e.create("society:tubabacco_leaf_block")
|
||||
.textureAll("herbalbrews:block/green_tea_leaf1")
|
||||
.mapColor("grass")
|
||||
.soundType("azalea_leaves")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.texture("particle", "herbalbrews:block/green_tea_leaf1");
|
||||
|
||||
// Decor
|
||||
e
|
||||
.create("society:sturdy_bamboo_block")
|
||||
.tag("minecraft:logs")
|
||||
.property(BlockProperties.AXIS)
|
||||
.placementState((e) => e.set(BlockProperties.AXIS, e.clickedFace.axis))
|
||||
.displayName("Sturdy Block of Bamboo")
|
||||
.soundType("wood")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/sturdy_bamboo_block",
|
||||
});
|
||||
})
|
||||
.requiresTool(true)
|
||||
.tagBlock("minecraft:mineable/axe").blockstateJson = {
|
||||
variants: {
|
||||
"axis=x": {
|
||||
model: "society:block/kubejs/sturdy_bamboo_block_horizontal",
|
||||
x: 90,
|
||||
y: 90,
|
||||
},
|
||||
"axis=y": {
|
||||
model: "society:block/kubejs/sturdy_bamboo_block",
|
||||
},
|
||||
"axis=z": {
|
||||
model: "society:block/kubejs/sturdy_bamboo_block_horizontal",
|
||||
x: 90,
|
||||
},
|
||||
},
|
||||
};
|
||||
// Drinks
|
||||
e.create("society:espresso")
|
||||
.box(6, 0, 6, 10, 4, 10)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/espresso_cup_block")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/espresso",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("minecraft:speed", 2400, 1, 1.0);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:steamed_milk")
|
||||
.box(5, 0, 5, 11, 7, 11)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/drinks/steamed_milk")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/steamed_milk",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.hunger(2);
|
||||
food.saturation(4);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:mocha")
|
||||
.box(5, 0, 5, 11, 7, 11)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/drinks/mocha")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/mocha",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("minecraft:speed", 1200, 1, 1.0);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:latte")
|
||||
.box(5, 0, 5, 11, 7, 11)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/drinks/latte")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/latte",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("minecraft:speed", 1200, 1, 1.0);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:dirty_chai")
|
||||
.box(5, 0, 5, 11, 7, 11)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/drinks/dirty_chai")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/dirty_chai",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("minecraft:speed", 2400, 1, 1.0);
|
||||
food.effect("herbalbrews:tough", 2400, 1, 1.0);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:bowl_of_soul")
|
||||
.box(5, 0, 5, 11, 3, 11)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/drinks/bowl_of_soul")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/bowl_of_soul",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("herbalbrews:fortune", 3600, 1, 1.0);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:truffle_tea")
|
||||
.box(5, 0, 5, 11, 3, 11)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.hardness(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/drinks/truffle_tea")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/truffle_tea",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("legendarycreatures:convulsion", 1600, 1, 1.0);
|
||||
});
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.truffle_tea.description").darkPurple()
|
||||
);
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:beer_london", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drinks/beer_london")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/beer_london",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.fastToEat(true);
|
||||
food.effect("vinery:jellie", 1200, 1, 1.0);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
})
|
||||
.displayName("London Beer");
|
||||
|
||||
e.create("society:beer_attunecore", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drinks/beer_attunecore")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/beer_attunecore",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.fastToEat(true);
|
||||
food.effect("vinery:jellie", 200, 1, 1.0);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
})
|
||||
.displayName("Attunecore Beer");
|
||||
|
||||
e.create("society:ancient_cider", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.soundType("glass")
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drinks/ancient_cider")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/ancient_cider",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("nethervinery:netherite", 400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:ancient_vespertine", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.soundType("glass")
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drinks/ancient_vespertine")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/ancient_vespertine",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("vinery:luck_effect", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:dewy_star", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.model("society:block/kubejs/drinks/dewy_star")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/dewy_star",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("brewery:haley", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:starcardi", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.model("society:block/kubejs/drinks/starcardi")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/starcardi",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("brewery:haley", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:star_coquito", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.model("society:block/kubejs/drinks/star_coquito")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/star_coquito",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("brewery:haley", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:violet_moon", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.model("society:block/kubejs/drinks/dewy_star")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/violet_moon",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("brewery:lightning_strike", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:sparkling_le_roy", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.soundType("glass")
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drinks/ancient_vespertine")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/sparkling_le_roy",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("windswept:frost_resistance", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:laputa_franc", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.soundType("glass")
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drinks/ancient_vespertine")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/laputa_franc",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("botania:soul_cross", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:mana_king", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.soundType("glass")
|
||||
.defaultCutout()
|
||||
.model("society:block/kubejs/drinks/ancient_vespertine")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/mana_king",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("botania:clear", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:forks_of_blue", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.model("society:block/kubejs/drinks/forks_of_blue")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/forks_of_blue",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("autumnity:extension", 1200, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:good_catawba", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.model("society:block/kubejs/drinks/good_catawba")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/good_catawba",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("herbalbrews:tough", 2400, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:nutty_basil", "cardinal")
|
||||
.box(2, 0, 2, 14, 14, 14)
|
||||
.defaultCutout()
|
||||
.soundType("glass")
|
||||
.model("society:block/kubejs/drinks/nutty_basil")
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "minecraft:item/generated",
|
||||
textures: {
|
||||
layer0: "society:item/drinks/nutty_basil",
|
||||
},
|
||||
});
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("atmospheric:spitting", 1000, 1, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
|
||||
e.create("society:supreme_mayonnaise", "cardinal")
|
||||
.model("society:block/kubejs/supreme_mayonnaise")
|
||||
.soundType("stone")
|
||||
.defaultCutout()
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.item((item) => {
|
||||
item.tooltip(
|
||||
Text.translatable("block.society.supreme_mayonnaise.description").red()
|
||||
);
|
||||
item.tooltip(
|
||||
Text.translatable(
|
||||
"block.society.supreme_mayonnaise.description.obtain"
|
||||
).gray()
|
||||
);
|
||||
item.food((food) => {
|
||||
food.alwaysEdible(true);
|
||||
food.effect("vinery:creeper_effect", 120, 4, 1.0);
|
||||
food.fastToEat(true);
|
||||
});
|
||||
item.useAnimation("drink");
|
||||
});
|
||||
// Catalogs
|
||||
e.create("society:tanuki_catalog", "cardinal")
|
||||
.box(2, 0, 3, 14, 1.025, 13)
|
||||
.defaultCutout()
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/tanuki_catalog")
|
||||
.displayName("♤ §aTanuki Catalog");
|
||||
|
||||
e.create("society:modern_catalog", "cardinal")
|
||||
.box(2, 0, 3, 14, 1.025, 13)
|
||||
.defaultCutout()
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/modern_catalog")
|
||||
.displayName("♧ Modern Catalog");
|
||||
|
||||
e.create("society:fantasy_catalog", "cardinal")
|
||||
.box(2, 0, 3, 14, 1.025, 13)
|
||||
.defaultCutout()
|
||||
.resistance(1.0)
|
||||
.requiresTool(false)
|
||||
.model("society:block/kubejs/fantasy_catalog")
|
||||
.displayName("♡ §eFantasy Catalog");
|
||||
|
||||
e.create("moreminecarts:greenhouse_glass_stairs", "stairs")
|
||||
.soundType("glass")
|
||||
.resistance(0.8)
|
||||
.renderType("translucent")
|
||||
.textureAll("moreminecarts:block/chiseled_organic_glass");
|
||||
|
||||
e.create("moreminecarts:greenhouse_glass_slab", "slab")
|
||||
.soundType("glass")
|
||||
.resistance(0.8)
|
||||
.renderType("translucent")
|
||||
.textureAll("moreminecarts:block/chiseled_organic_glass");
|
||||
});
|
||||
@@ -0,0 +1,836 @@
|
||||
global.updateBerryBush = (level, block) => {
|
||||
let type = 0;
|
||||
switch (global.getSeasonFromLevel(level)) {
|
||||
case "spring":
|
||||
type = 1;
|
||||
break;
|
||||
case "summer":
|
||||
type = 2;
|
||||
break;
|
||||
case "autumn":
|
||||
type = 3;
|
||||
break;
|
||||
default:
|
||||
case "winter":
|
||||
type = 4;
|
||||
}
|
||||
block.set(block.id, {
|
||||
type: String(type),
|
||||
});
|
||||
};
|
||||
|
||||
StartupEvents.registry("block", (e) => {
|
||||
// TODO: 4.0
|
||||
// e.create("society:berry_bush_crop", "crop")
|
||||
// .age(3, (builder) => {
|
||||
// builder
|
||||
// .shape(0, 0, 0, 0, 16, 4, 16)
|
||||
// .shape(1, 0, 0, 0, 16, 13, 16)
|
||||
// .shape(2, 0, 0, 0, 16, 16, 16)
|
||||
// .shape(3, 0, 0, 0, 16, 16, 16);
|
||||
// })
|
||||
// .survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
// .dropSeed(false)
|
||||
// .tagBlock("minecraft:mineable/hoe")
|
||||
// .tagBlock("minecraft:crops")
|
||||
// .property(integerProperty.create("type", 0, 4))
|
||||
// .defaultState((state) => {
|
||||
// state.set(integerProperty.create("type", 0, 4), 0);
|
||||
// })
|
||||
// .placementState((state) => {
|
||||
// state.set(integerProperty.create("type", 0, 4), 0);
|
||||
// })
|
||||
// .item((seedItem) => {
|
||||
// seedItem.texture("society:item/berry_bush_seed");
|
||||
// }).blockstateJson = {
|
||||
// multipart: [
|
||||
// {
|
||||
// when: { age: 0 },
|
||||
// apply: { model: "society:block/kubejs/berry_bush/start" },
|
||||
// },
|
||||
// {
|
||||
// when: { age: 1 },
|
||||
// apply: { model: "society:block/kubejs/berry_bush/middle" },
|
||||
// },
|
||||
// {
|
||||
// when: { age: 2 },
|
||||
// apply: { model: "society:block/kubejs/berry_bush/base" },
|
||||
// },
|
||||
// {
|
||||
// when: { age: 3 },
|
||||
// apply: { model: "society:block/kubejs/berry_bush/base" },
|
||||
// },
|
||||
// ],
|
||||
// };
|
||||
|
||||
e
|
||||
.create("society:ancient_fruit", "crop")
|
||||
.age(10, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 3, 16)
|
||||
.shape(1, 0, 0, 0, 16, 4, 16)
|
||||
.shape(2, 0, 0, 0, 16, 4, 16)
|
||||
.shape(3, 0, 0, 0, 16, 8, 16)
|
||||
.shape(4, 0, 0, 0, 16, 8, 16)
|
||||
.shape(5, 0, 0, 0, 16, 16, 16)
|
||||
.shape(6, 0, 0, 0, 16, 16, 16)
|
||||
.shape(7, 0, 0, 0, 16, 16, 16)
|
||||
.shape(8, 0, 0, 0, 16, 16, 16)
|
||||
.shape(9, 0, 0, 0, 16, 16, 16)
|
||||
.shape(10, 0, 0, 0, 16, 24, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("society:ancient_fruit", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/ancient_seed");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 6 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 7 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 8 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage4" },
|
||||
},
|
||||
{
|
||||
when: { age: 9 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage4" },
|
||||
},
|
||||
{
|
||||
when: { age: 10 },
|
||||
apply: { model: "society:block/kubejs/crops/ancient_fruit_crop_stage5" },
|
||||
},
|
||||
],
|
||||
};
|
||||
e
|
||||
.create("society:tubabacco_leaf", "crop")
|
||||
.age(9, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 4, 16)
|
||||
.shape(2, 0, 0, 0, 16, 5, 16)
|
||||
.shape(3, 0, 0, 0, 16, 5, 16)
|
||||
.shape(4, 0, 0, 0, 16, 10, 16)
|
||||
.shape(5, 0, 0, 0, 16, 10, 16)
|
||||
.shape(6, 0, 0, 0, 16, 10, 16)
|
||||
.shape(7, 0, 0, 0, 16, 10, 16)
|
||||
.shape(8, 0, 0, 0, 16, 16, 16)
|
||||
.shape(9, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("society:tubabacco_leaf", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/tubabacco_seed");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 6 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 7 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 8 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 9 },
|
||||
apply: { model: "society:block/kubejs/crops/tubabacco_plant_stage4" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
e
|
||||
.create("farm_and_charm:strawberry", "crop")
|
||||
.age(5, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 2, 16)
|
||||
.shape(1, 0, 0, 0, 16, 4, 16)
|
||||
.shape(2, 0, 0, 0, 16, 6, 16)
|
||||
.shape(3, 0, 0, 0, 16, 8, 16)
|
||||
.shape(4, 0, 0, 0, 16, 10, 16)
|
||||
.shape(5, 0, 0, 0, 16, 12, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("farm_and_charm:strawberry", 2)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("farm_and_charm:item/strawberry_seeds");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "farm_and_charm:block/strawberries_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "farm_and_charm:block/strawberries_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "farm_and_charm:block/strawberries_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "farm_and_charm:block/strawberries_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "farm_and_charm:block/strawberries_stage4" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "farm_and_charm:block/strawberries_stage5" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
e
|
||||
.create("brewery:hop_trellis", "crop")
|
||||
.age(6, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 16, 16)
|
||||
.shape(1, 0, 0, 0, 16, 16, 16)
|
||||
.shape(2, 0, 0, 0, 16, 16, 16)
|
||||
.shape(3, 0, 0, 0, 16, 16, 16)
|
||||
.shape(4, 0, 0, 0, 16, 16, 16)
|
||||
.shape(5, 0, 0, 0, 16, 16, 16)
|
||||
.shape(6, 0, 0, 0, 16, 22, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("brewery:hops", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("brewery:item/hops_seeds");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/hops_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/hops_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/hops_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/hops_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/hops_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/hops_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 6 },
|
||||
apply: { model: "society:block/kubejs/crops/hops_crop_stage4" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:blueberry", "crop")
|
||||
.age(7, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 6, 16)
|
||||
.shape(3, 0, 0, 0, 16, 12, 16)
|
||||
.shape(4, 0, 0, 0, 16, 12, 16)
|
||||
.shape(5, 0, 0, 0, 16, 16, 16)
|
||||
.shape(6, 0, 0, 0, 16, 16, 16)
|
||||
.shape(7, 0, 0, 0, 16, 20, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("society:blueberry", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/blueberry_seeds");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 6 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage4" },
|
||||
},
|
||||
{
|
||||
when: { age: 7 },
|
||||
apply: { model: "society:block/kubejs/crops/blueberry_crop_stage5" },
|
||||
},
|
||||
],
|
||||
};
|
||||
e
|
||||
.create("society:cranberry", "crop")
|
||||
.age(5, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 6, 16)
|
||||
.shape(3, 0, 0, 0, 16, 12, 16)
|
||||
.shape(4, 0, 0, 0, 16, 12, 16)
|
||||
.shape(5, 0, 0, 0, 16, 16, 16)
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("society:cranberry", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/cranberry_seeds");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/cranberry_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/cranberry_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/cranberry_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/cranberry_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/cranberry_crop_stage4" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/cranberry_crop_stage5" },
|
||||
},
|
||||
],
|
||||
};
|
||||
e
|
||||
.create("society:eggplant", "crop")
|
||||
.age(6, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 7, 16)
|
||||
.shape(3, 0, 0, 0, 16, 7, 16)
|
||||
.shape(4, 0, 0, 0, 16, 13, 16)
|
||||
.shape(5, 0, 0, 0, 16, 13, 16)
|
||||
.shape(6, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("society:eggplant", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/eggplant_seeds");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/eggplant_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/eggplant_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/eggplant_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/eggplant_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/eggplant_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/eggplant_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 6 },
|
||||
apply: { model: "society:block/kubejs/crops/eggplant_crop_stage4" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:carrot", "crop")
|
||||
.age(7, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 7, 16)
|
||||
.shape(3, 0, 0, 0, 16, 7, 16)
|
||||
.shape(4, 0, 0, 0, 16, 13, 16)
|
||||
.shape(5, 0, 0, 0, 16, 13, 16)
|
||||
.shape(6, 0, 0, 0, 16, 16, 16)
|
||||
.shape(7, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("minecraft:carrot", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/carrot_seed");
|
||||
}).blockstateJson = {
|
||||
variants: {
|
||||
"age=0": {
|
||||
model: "minecraft:block/carrots_stage0",
|
||||
},
|
||||
"age=1": {
|
||||
model: "minecraft:block/carrots_stage0",
|
||||
},
|
||||
"age=2": {
|
||||
model: "minecraft:block/carrots_stage1",
|
||||
},
|
||||
"age=3": {
|
||||
model: "minecraft:block/carrots_stage1",
|
||||
},
|
||||
"age=4": {
|
||||
model: "minecraft:block/carrots_stage2",
|
||||
},
|
||||
"age=5": {
|
||||
model: "minecraft:block/carrots_stage2",
|
||||
},
|
||||
"age=6": {
|
||||
model: "minecraft:block/carrots_stage2",
|
||||
},
|
||||
"age=7": {
|
||||
model: "minecraft:block/carrots_stage3",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:potato", "crop")
|
||||
.age(7, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 7, 16)
|
||||
.shape(3, 0, 0, 0, 16, 7, 16)
|
||||
.shape(4, 0, 0, 0, 16, 13, 16)
|
||||
.shape(5, 0, 0, 0, 16, 13, 16)
|
||||
.shape(6, 0, 0, 0, 16, 16, 16)
|
||||
.shape(7, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("minecraft:potato", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/potato_seed");
|
||||
}).blockstateJson = {
|
||||
variants: {
|
||||
"age=0": {
|
||||
model: "minecraft:block/potatoes_stage0",
|
||||
},
|
||||
"age=1": {
|
||||
model: "minecraft:block/potatoes_stage0",
|
||||
},
|
||||
"age=2": {
|
||||
model: "minecraft:block/potatoes_stage1",
|
||||
},
|
||||
"age=3": {
|
||||
model: "minecraft:block/potatoes_stage1",
|
||||
},
|
||||
"age=4": {
|
||||
model: "minecraft:block/potatoes_stage2",
|
||||
},
|
||||
"age=5": {
|
||||
model: "minecraft:block/potatoes_stage2",
|
||||
},
|
||||
"age=6": {
|
||||
model: "minecraft:block/potatoes_stage2",
|
||||
},
|
||||
"age=7": {
|
||||
model: "minecraft:block/potatoes_stage3",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:onion", "crop")
|
||||
.age(4, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 7, 16)
|
||||
.shape(3, 0, 0, 0, 16, 13, 16)
|
||||
.shape(4, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("farm_and_charm:onion", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/onion_seed");
|
||||
}).blockstateJson = {
|
||||
variants: {
|
||||
"age=0": [
|
||||
{
|
||||
model: "farm_and_charm:block/onion_stage0",
|
||||
weight: 1,
|
||||
},
|
||||
],
|
||||
"age=1": [
|
||||
{
|
||||
model: "farm_and_charm:block/onion_stage1",
|
||||
weight: 1,
|
||||
},
|
||||
],
|
||||
"age=2": [
|
||||
{
|
||||
model: "farm_and_charm:block/onion_stage2",
|
||||
weight: 1,
|
||||
},
|
||||
],
|
||||
"age=3": [
|
||||
{
|
||||
model: "farm_and_charm:block/onion_stage3",
|
||||
weight: 1,
|
||||
},
|
||||
],
|
||||
"age=4": [
|
||||
{
|
||||
model: "farm_and_charm:block/onion_stage4_1",
|
||||
weight: 1,
|
||||
},
|
||||
{
|
||||
model: "farm_and_charm:block/onion_stage4_2",
|
||||
weight: 1,
|
||||
},
|
||||
{
|
||||
model: "farm_and_charm:block/onion_stage4_3",
|
||||
weight: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:sweet_potato", "crop")
|
||||
.age(5, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 7, 16)
|
||||
.shape(3, 0, 0, 0, 16, 3, 16)
|
||||
.shape(4, 0, 0, 0, 16, 13, 16)
|
||||
.shape(5, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("veggiesdelight:sweet_potato", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/sweet_potato_seed");
|
||||
}).blockstateJson = {
|
||||
variants: {
|
||||
"age=0": {
|
||||
model: "veggiesdelight:block/sweet_potato_stage0",
|
||||
},
|
||||
"age=1": {
|
||||
model: "veggiesdelight:block/sweet_potato_stage1",
|
||||
},
|
||||
"age=2": {
|
||||
model: "veggiesdelight:block/sweet_potato_stage2",
|
||||
},
|
||||
"age=3": {
|
||||
model: "veggiesdelight:block/sweet_potato_stage3",
|
||||
},
|
||||
"age=4": {
|
||||
model: "veggiesdelight:block/sweet_potato_stage3",
|
||||
},
|
||||
"age=5": {
|
||||
model: "veggiesdelight:block/sweet_potato_stage4",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:peanut", "crop")
|
||||
.age(7, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 4, 16)
|
||||
.shape(1, 0, 0, 0, 16, 6, 16)
|
||||
.shape(2, 0, 0, 0, 16, 7, 16)
|
||||
.shape(3, 0, 0, 0, 16, 7, 16)
|
||||
.shape(4, 0, 0, 0, 16, 13, 16)
|
||||
.shape(5, 0, 0, 0, 16, 13, 16)
|
||||
.shape(6, 0, 0, 0, 16, 16, 16)
|
||||
.shape(7, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("vintagedelight:peanut", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/peanut_seed");
|
||||
}).blockstateJson = {
|
||||
variants: {
|
||||
"age=0": {
|
||||
model: "vintagedelight:block/peanuts_stage0",
|
||||
},
|
||||
"age=1": {
|
||||
model: "vintagedelight:block/peanuts_stage0",
|
||||
},
|
||||
"age=2": {
|
||||
model: "vintagedelight:block/peanuts_stage1",
|
||||
},
|
||||
"age=3": {
|
||||
model: "vintagedelight:block/peanuts_stage1",
|
||||
},
|
||||
"age=4": {
|
||||
model: "vintagedelight:block/peanuts_stage2",
|
||||
},
|
||||
"age=5": {
|
||||
model: "vintagedelight:block/peanuts_stage3",
|
||||
},
|
||||
"age=6": {
|
||||
model: "vintagedelight:block/peanuts_stage3",
|
||||
},
|
||||
"age=7": {
|
||||
model: "vintagedelight:block/peanuts_stage4",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:berry_bush")
|
||||
.defaultCutout()
|
||||
.hardness(0)
|
||||
.resistance(0)
|
||||
.mapColor("grass")
|
||||
.noCollision()
|
||||
.soundType("azalea_leaves")
|
||||
.property(integerProperty.create("type", 0, 4))
|
||||
.defaultCutout()
|
||||
.item((item) => {
|
||||
item.modelJson({
|
||||
parent: "society:block/kubejs/berry_bush/base",
|
||||
});
|
||||
})
|
||||
.defaultState((state) => {
|
||||
state.set(integerProperty.create("type", 0, 4), 0);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(integerProperty.create("type", 0, 4), 0);
|
||||
})
|
||||
.rightClick((click) => {
|
||||
const { block, level, hand } = click;
|
||||
|
||||
if (hand == "OFF_HAND") return;
|
||||
if (hand == "MAIN_HAND") {
|
||||
global.updateBerryBush(level, block);
|
||||
}
|
||||
})
|
||||
.randomTick((tick) => {
|
||||
const { block, level } = tick;
|
||||
global.updateBerryBush(level, block);
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { type: "0" },
|
||||
apply: { model: "society:block/kubejs/berry_bush/base" },
|
||||
},
|
||||
{
|
||||
when: { type: "1" },
|
||||
apply: { model: "society:block/kubejs/berry_bush/salmonberry" },
|
||||
},
|
||||
{
|
||||
when: { type: "2" },
|
||||
apply: { model: "society:block/kubejs/berry_bush/boysenberry" },
|
||||
},
|
||||
{
|
||||
when: { type: "3" },
|
||||
apply: { model: "society:block/kubejs/berry_bush/cranberry" },
|
||||
},
|
||||
{
|
||||
when: { type: "4" },
|
||||
apply: { model: "society:block/kubejs/berry_bush/crystalberry" },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
e
|
||||
.create("society:sparkpod", "crop")
|
||||
.age(8, (builder) => {
|
||||
builder
|
||||
.shape(0, 0, 0, 0, 16, 3, 16)
|
||||
.shape(1, 0, 0, 0, 16, 3, 16)
|
||||
.shape(2, 0, 0, 0, 16, 5, 16)
|
||||
.shape(3, 0, 0, 0, 16, 5, 16)
|
||||
.shape(4, 0, 0, 0, 16, 8, 16)
|
||||
.shape(5, 0, 0, 0, 16, 8, 16)
|
||||
.shape(6, 0, 0, 0, 16, 11, 16)
|
||||
.shape(7, 0, 0, 0, 16, 11, 16)
|
||||
.shape(8, 0, 0, 0, 16, 16, 16);
|
||||
})
|
||||
.survive((state, level, pos) => global.surviveCheck(level, pos))
|
||||
.dropSeed(false)
|
||||
.crop("society:sparkpod", 1)
|
||||
.tagBlock("minecraft:mineable/hoe")
|
||||
.tagBlock("minecraft:crops")
|
||||
.randomTick((tick) => {})
|
||||
.item((seedItem) => {
|
||||
seedItem.texture("society:item/sparkpod_spores");
|
||||
}).blockstateJson = {
|
||||
multipart: [
|
||||
{
|
||||
when: { age: 0 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 1 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage0" },
|
||||
},
|
||||
{
|
||||
when: { age: 2 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 3 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage1" },
|
||||
},
|
||||
{
|
||||
when: { age: 4 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 5 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage2" },
|
||||
},
|
||||
{
|
||||
when: { age: 6 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 7 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage3" },
|
||||
},
|
||||
{
|
||||
when: { age: 8 },
|
||||
apply: { model: "society:block/kubejs/crops/sparkpod_crop_stage4" },
|
||||
},
|
||||
],
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,34 @@
|
||||
// global.carpetTick = (entity) => {
|
||||
// let nearbyEntities = entity.level
|
||||
// .getEntitiesWithin(entity.getBoundingBox().inflate(3))
|
||||
// .filter((entity) => entity.isPlayer());
|
||||
// if (nearbyEntities.length > 0) {
|
||||
// let player = nearbyEntities[0];
|
||||
// if (player.isCrouching()) {
|
||||
// entity.setRemoved("unloaded_to_chunk");
|
||||
// Utils.getServer().runCommandSilent(
|
||||
// `playsound minecraft:block.wool.break block @a ${player.x} ${player.y} ${player.z}`
|
||||
// );
|
||||
// player.give(Item.of("whimsy_deco:paw_carpet"));
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
|
||||
// StartupEvents.registry("entity_type", (e) => {
|
||||
// e.create("whimsy_deco:paw_carpet_entity", "entityjs:mob")
|
||||
// .isPushable(false)
|
||||
// .onHurt((context) => {
|
||||
// context.entity.setRemoved("unloaded_to_chunk");
|
||||
// })
|
||||
// .translationKey("entity.whimsy_deco.paw_carpet")
|
||||
// .sized(0.1, 0.1)
|
||||
// .isPushable(false)
|
||||
// .canBeCollidedWith((entity) => false)
|
||||
// .canCollideWith((entity) => false)
|
||||
// .setDeathSound("minecraft:block.wool.break")
|
||||
// .isImmobile((entity) => true)
|
||||
// .tick((entity) => {
|
||||
// if (entity.age % 80 != 0) return;
|
||||
// global.carpetTick(entity);
|
||||
// });
|
||||
// });
|
||||
@@ -0,0 +1,112 @@
|
||||
console.info("[SOCIETY] registerFluids.js loaded");
|
||||
|
||||
StartupEvents.registry("fluid", (e) => {
|
||||
e.create("society:oak_resin")
|
||||
.thickTexture(0xfffefc)
|
||||
.bucketColor(0xfffefc)
|
||||
.displayName("Oak Resin")
|
||||
.tag("society:oak_resin");
|
||||
|
||||
e.create("society:pine_tar")
|
||||
.thickTexture(0x6e4117)
|
||||
.bucketColor(0x6e4117)
|
||||
.displayName("Pine Tar")
|
||||
.tag("society:pine_tar");
|
||||
|
||||
e.create("society:maple_syrup")
|
||||
.thickTexture(0x8a3727)
|
||||
.bucketColor(0x8a3727)
|
||||
.displayName("Maple Syrup")
|
||||
.tag("society:maple_syrup");
|
||||
|
||||
e.create("society:mystic_syrup")
|
||||
.thickTexture(0xcf8cf6)
|
||||
.bucketColor(0xcf8cf6)
|
||||
.displayName("Mystic Syrup")
|
||||
.tag("society:mystic_syrup");
|
||||
|
||||
e.create("society:vinegar")
|
||||
.thickTexture(0x680000)
|
||||
.bucketColor(0x680000)
|
||||
.displayName("Vinegar")
|
||||
.tag("society:vinegar");
|
||||
|
||||
e.create("society:alchemical_varnish")
|
||||
.thickTexture(0xa2b7bd)
|
||||
.bucketColor(0xa2b7bd)
|
||||
.displayName("Alchemical Varnish")
|
||||
.tag("society:alchemical_varnish");
|
||||
|
||||
e.create("society:mystic_jelly")
|
||||
.thickTexture(0x9cd8e0)
|
||||
.bucketColor(0x9cd8e0)
|
||||
.displayName("Mystic Jelly")
|
||||
.tag("society:mystic_jelly");
|
||||
|
||||
e.create("society:milk")
|
||||
.thinTexture(0xffffff)
|
||||
.bucketColor(0xffffff)
|
||||
.displayName("Milk")
|
||||
.tag("forge:milk");
|
||||
|
||||
//Vinery
|
||||
e.create("vinery:apple_juice")
|
||||
.thinTexture(0xfff1a3)
|
||||
.bucketColor(0xfff1a3)
|
||||
.displayName("Apple Juice")
|
||||
.tag("vinery:apple_juice");
|
||||
|
||||
e.create("vinery:white_grape_juice")
|
||||
.thinTexture(0xbdd9b2)
|
||||
.bucketColor(0xbdd9b2)
|
||||
.displayName("White Grape Juice")
|
||||
.tag("vinery:white_grape_juice");
|
||||
|
||||
e.create("vinery:red_grape_juice")
|
||||
.thinTexture(0x6c3c74)
|
||||
.bucketColor(0x6c3c74)
|
||||
.displayName("Red Grape Juice")
|
||||
.tag("vinery:red_grape_juice");
|
||||
|
||||
e.create("nethervinery:crimson_grape_juice")
|
||||
.thinTexture(0xf10959)
|
||||
.bucketColor(0xf10959)
|
||||
.displayName("Crimson Grape Juice")
|
||||
.tag("nethervinery:crimson_grape_juice");
|
||||
|
||||
e.create("nethervinery:warped_grape_juice")
|
||||
.thinTexture(0x2cbcba)
|
||||
.bucketColor(0x2cbcba)
|
||||
.displayName("Warped Grape Juice")
|
||||
.tag("nethervinery:warped_grape_juice");
|
||||
|
||||
e.create("society:ancient_fruit_juice")
|
||||
.thinTexture(0x5be3e4)
|
||||
.bucketColor(0x5be3e4)
|
||||
.displayName("Ancient Fruit Juice")
|
||||
.tag("society:ancient_fruit_juice");
|
||||
|
||||
e.create("society:starfruit_juice")
|
||||
.thinTexture(0xffa31c)
|
||||
.bucketColor(0xffa31c)
|
||||
.displayName("Starfruit Juice")
|
||||
.tag("society:starfruit_juice");
|
||||
|
||||
e.create("society:sparkpod_juice")
|
||||
.thinTexture(0xdf31f2)
|
||||
.bucketColor(0xdf31f2)
|
||||
.displayName("Sparkpod Juice")
|
||||
.tag("society:sparkpod_juice");
|
||||
|
||||
e.create("society:mana_fruit_juice")
|
||||
.thinTexture(0x00dedf)
|
||||
.bucketColor(0x00dedf)
|
||||
.displayName("Mana Fruit Juice")
|
||||
.tag("society:mana_fruit_juice");
|
||||
|
||||
e.create("relics:relic_experience")
|
||||
.thickTexture(0xf7b23f)
|
||||
.bucketColor(0xf7b23f)
|
||||
.displayName("Relic Experience")
|
||||
.tag("relics:relic_experience");
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,60 @@
|
||||
let $BlockEntity = Java.loadClass(
|
||||
"net.minecraft.world.level.block.entity.BlockEntity"
|
||||
);
|
||||
|
||||
const registerKey = (blockEntity, tag, key) => {
|
||||
if (blockEntity.data != null) {
|
||||
if (blockEntity.data[key] != null && !Number.isNaN(blockEntity.data[key])) {
|
||||
if (typeof blockEntity.data[key] == Number) {
|
||||
tag.putInt(key, blockEntity.data[key]);
|
||||
} else {
|
||||
tag.putString(key, blockEntity.data[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
JadeEvents.onCommonRegistration((e) => {
|
||||
const artisanMachineNbtKeys = ["stage", "recipe"];
|
||||
e.blockDataProvider("society:artisan_machine_jade", $BlockEntity).setCallback(
|
||||
(tag, accessor) => {
|
||||
const { blockEntity } = accessor;
|
||||
artisanMachineNbtKeys.forEach((key) => {
|
||||
registerKey(blockEntity, tag, key);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
const plushieNbtKeys = ["type", "quality", "affection"];
|
||||
e.blockDataProvider("society:plushie_jade", $BlockEntity).setCallback(
|
||||
(tag, accessor) => {
|
||||
const { blockEntity } = accessor;
|
||||
|
||||
plushieNbtKeys.forEach((key) => {
|
||||
registerKey(blockEntity, tag, key);
|
||||
});
|
||||
if (blockEntity.data != null && blockEntity.data.animal != null) {
|
||||
tag.putString("animal", blockEntity.data.animal.type);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const fishPondNbtKeys = ["type", "population", "max_population"];
|
||||
e.blockDataProvider("society:fish_pond_jade", $BlockEntity).setCallback(
|
||||
(tag, accessor) => {
|
||||
const { blockEntity } = accessor;
|
||||
|
||||
fishPondNbtKeys.forEach((key) => {
|
||||
registerKey(blockEntity, tag, key);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
e.blockDataProvider("kubejs:shipping_bin_jade", $BlockEntity).setCallback(
|
||||
(tag, accessor) => {
|
||||
const { blockEntity } = accessor;
|
||||
if (blockEntity.data != null && blockEntity.data.customName != null) {
|
||||
tag.putString("customName", blockEntity.data.customName.toString());
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
StartupEvents.registry('sound_event', e => {
|
||||
e.create("society:blazing_drift_fever_ex")
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
StartupEvents.registry("block", (e) => {
|
||||
let baseboardTypes = [
|
||||
"minecraft:birch_planks",
|
||||
"minecraft:dark_oak_planks",
|
||||
"minecraft:jungle_planks",
|
||||
"minecraft:oak_planks",
|
||||
"minecraft:spruce_planks",
|
||||
];
|
||||
["bee", "hive", "bunny", "cloud", "pink_flower"].forEach((wallpaperType) => {
|
||||
e.create(`society:${wallpaperType}_wallpaper`)
|
||||
.model(`society:block/kubejs/wallpaper/${wallpaperType}_wallpaper`)
|
||||
.soundType("wool")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.requiresTool(true);
|
||||
if (wallpaperType !== "bee") {
|
||||
e.create(`society:${wallpaperType}_baseboard`)
|
||||
.model(`society:block/kubejs/wallpaper/${wallpaperType}_baseboard`)
|
||||
.item((item) => {
|
||||
item.tooltip(Text.translatable("society.wallpaper.description").gray());
|
||||
item.tooltip(Text.translatable("society.wallpaper.description.tip").green());
|
||||
})
|
||||
.soundType("wood")
|
||||
.hardness(1.0)
|
||||
.resistance(1.0)
|
||||
.tagBlock("minecraft:mineable/axe")
|
||||
.requiresTool(true)
|
||||
.property(integerProperty.create("type", 0, baseboardTypes.length))
|
||||
.defaultState((state) => {
|
||||
state.set(integerProperty.create("type", 0, baseboardTypes.length), 0);
|
||||
})
|
||||
.placementState((state) => {
|
||||
state.set(integerProperty.create("type", 0, baseboardTypes.length), 0);
|
||||
})
|
||||
.rightClick((click) => {
|
||||
const { block, item, hand, player, server } = click;
|
||||
if (hand == "OFF_HAND") return;
|
||||
if (hand == "MAIN_HAND") {
|
||||
if (baseboardTypes.includes(item.id)) {
|
||||
server.runCommandSilent(
|
||||
`playsound minecraft:block.wood.place block @a ${block.x} ${block.y} ${block.z}`
|
||||
);
|
||||
block.set(block.id, {
|
||||
type: String(baseboardTypes.indexOf(item.id) + 1),
|
||||
});
|
||||
} else if (player.isCrouching()) {
|
||||
block.set(block.id, {
|
||||
type: "0",
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,76 @@
|
||||
console.info("[SOCIETY] registerWeapons.js loaded");
|
||||
|
||||
ItemEvents.toolTierRegistry((e) => {
|
||||
e.add("prismatic", (tier) => {
|
||||
tier.uses = 1000;
|
||||
tier.speed = 8;
|
||||
tier.attackDamageBonus = 2.0;
|
||||
tier.level = 2;
|
||||
tier.enchantmentValue = 14;
|
||||
tier.repairIngredient = "society:prismatic_shard";
|
||||
});
|
||||
});
|
||||
|
||||
StartupEvents.registry("item", (e) => {
|
||||
e.create("society:galaxy_sword", "sword")
|
||||
.texture("society:item/galaxy_sword")
|
||||
.rarity("epic")
|
||||
.tier("prismatic")
|
||||
.displayName("<ltcolor>c=AA0000;c=FFAA00;c=FF55FF;c=FFFF55;c=00AA00;c=00AAAA;c=AA00AA;c=FF55FF;w=10;p=2;Galaxy Sword</ltcolor>")
|
||||
.tag("minecraft:swords")
|
||||
.attackDamageBaseline(10.0)
|
||||
.speed(3.0)
|
||||
.modifyTier((tier) => {
|
||||
tier.setRepairIngredient(
|
||||
Ingredient.custom((item) => {
|
||||
if (item.id == "society:prismatic_shard") return true;
|
||||
return false;
|
||||
})
|
||||
);
|
||||
});
|
||||
e.create("society:dragontooth_axe", "axe")
|
||||
.texture("society:item/dragontooth_axe")
|
||||
.rarity("epic")
|
||||
.tier("prismatic")
|
||||
.attackDamageBaseline(12.0)
|
||||
.speed(5.0)
|
||||
.modifyTier((tier) => {
|
||||
tier.setRepairIngredient(
|
||||
Ingredient.custom((item) => {
|
||||
if (item.id == "society:prismatic_shard") return true;
|
||||
return false;
|
||||
})
|
||||
);
|
||||
});
|
||||
e.create("society:princess_hairbrush", "sword")
|
||||
.texture("society:item/artifacts/princess_hairbrush")
|
||||
.rarity("epic")
|
||||
.tier("prismatic")
|
||||
.tag("minecraft:swords")
|
||||
.attackDamageBaseline(6.0)
|
||||
.speed(3.0)
|
||||
.modifyTier((tier) => {
|
||||
tier.setRepairIngredient(
|
||||
Ingredient.custom((item) => {
|
||||
if (item.id == "society:prismatic_shard") return true;
|
||||
return false;
|
||||
})
|
||||
);
|
||||
});
|
||||
e.create("society:meowmageddon", "sword")
|
||||
.texture("society:item/meowmageddon")
|
||||
.rarity("epic")
|
||||
.tier("prismatic")
|
||||
.displayName("<ltcolor>c=55FFFF;c=77DDCC;c=FF55FF;c=FFFFFF;Meowmageddon</ltcolor>")
|
||||
.tag("minecraft:swords")
|
||||
.attackDamageBaseline(11.0)
|
||||
.speed(4.0)
|
||||
.modifyTier((tier) => {
|
||||
tier.setRepairIngredient(
|
||||
Ingredient.custom((item) => {
|
||||
if (item.id == "society:prismatic_shard") return true;
|
||||
return false;
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,166 @@
|
||||
console.info("[WHIMSY_DECO] registerWhimsyBlocks.js loaded");
|
||||
|
||||
StartupEvents.registry("block", (e) => {
|
||||
e.create("whimsy_deco:statue_endless_fortune", "animatable")
|
||||
.box(1, 0, 1, 15, 18, 15, true)
|
||||
.displayName("Statue of Endless Fortune")
|
||||
.animatableBlockEntity((info) => {
|
||||
info.addAnimation((state) =>
|
||||
state.setAndContinue(RawAnimation.begin().thenLoop("rotating"))
|
||||
);
|
||||
info.serverTick(artMachineTickRate, 0, (entity) => {
|
||||
const { level, block } = entity;
|
||||
const { x, y, z } = block;
|
||||
let dayTime = level.dayTime();
|
||||
let morningModulo = dayTime % 24000;
|
||||
if (
|
||||
morningModulo >= artMachineProgTime &&
|
||||
morningModulo < artMachineProgTime + artMachineTickRate
|
||||
) {
|
||||
level.server.runCommandSilent(
|
||||
`playsound tanukidecor:block.cash_register.ring block @a ${x} ${y} ${z}`
|
||||
);
|
||||
block.set(block.id, {
|
||||
facing: block.properties.get("facing"),
|
||||
mature: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
.defaultGeoModel()
|
||||
.property(BlockProperties.HORIZONTAL_FACING)
|
||||
.property(booleanProperty.create("mature"))
|
||||
.placementState((state) => {
|
||||
state
|
||||
.set(
|
||||
BlockProperties.HORIZONTAL_FACING,
|
||||
String(state.getHorizontalDirection().getOpposite())
|
||||
)
|
||||
.set(booleanProperty.create("mature"), false);
|
||||
})
|
||||
.rightClick((click) => {
|
||||
const { block, level, hand } = click;
|
||||
const { x, y, z } = block;
|
||||
const mature = String(block.properties.get("mature")) === "true";
|
||||
const facing = block.properties.get("facing");
|
||||
|
||||
if (click.player.isFake()) return;
|
||||
if (hand == "OFF_HAND") return;
|
||||
if (hand == "MAIN_HAND") {
|
||||
if (mature) {
|
||||
const possibleDrops = [
|
||||
"society:pristine_diamond",
|
||||
"minecraft:netherite_ingot",
|
||||
"society:omni_geode",
|
||||
"oreganized:electrum_ingot",
|
||||
];
|
||||
block.popItemFromFace(
|
||||
possibleDrops[Math.floor(Math.random() * possibleDrops.length)],
|
||||
facing
|
||||
);
|
||||
level.server.runCommandSilent(
|
||||
`playsound tanukidecor:block.cash_register.ring block @a ${x} ${y} ${z}`
|
||||
);
|
||||
block.set(block.id, {
|
||||
facing: facing,
|
||||
mature: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
e.create("whimsy_deco:sunlit_singing_frog", "animatable")
|
||||
.animatableBlockEntity((info) => {
|
||||
info.addAnimation((state) =>
|
||||
state.setAndContinue(RawAnimation.begin().thenLoop("sing"))
|
||||
);
|
||||
})
|
||||
.box(1, 0, 1, 15, 18, 15, true)
|
||||
.defaultGeoModel()
|
||||
.property(BlockProperties.HORIZONTAL_FACING)
|
||||
.property(integerProperty.create("type", 0, global.plushieTraits.length))
|
||||
.placementState((state) => {
|
||||
state
|
||||
.set(
|
||||
BlockProperties.HORIZONTAL_FACING,
|
||||
String(state.getHorizontalDirection().getOpposite())
|
||||
)
|
||||
.set(integerProperty.create("type", 0, global.plushieTraits.length), 0);
|
||||
})
|
||||
.defaultState((state) => {
|
||||
state.set(
|
||||
integerProperty.create("type", 0, global.plushieTraits.length),
|
||||
0
|
||||
);
|
||||
})
|
||||
.rightClick((click) => {
|
||||
const { block, server } = click;
|
||||
const { x, y, z } = block;
|
||||
let nbt = block.getEntityData();
|
||||
block.set("whimsy_deco:adv_singing_frog_plushie", block.properties);
|
||||
global.setBlockEntityData(block, nbt)
|
||||
server.runCommandSilent(
|
||||
`execute positioned ${x} ${y} ${z} run stopsound @e[type=player,distance=..4] block`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
// StartupEvents.registry("item", (e) => {
|
||||
// e.create("whimsy_deco:paw_carpet")
|
||||
// .tooltip(Text.gray("Sneak while standing on it to remove"))
|
||||
// .modelJson({
|
||||
// texture_size: [128, 128],
|
||||
// textures: {
|
||||
// 0: "whimsy_deco:block/paw_carpet",
|
||||
// particle: "whimsy_deco:block/paw_carpet",
|
||||
// },
|
||||
// elements: [
|
||||
// {
|
||||
// from: [-16, 0, 0],
|
||||
// to: [32, 1, 32],
|
||||
// faces: {
|
||||
// north: { uv: [0, 0, 6, 0.125], texture: "#0" },
|
||||
// east: { uv: [0.125, 0, 4.125, 0.125], texture: "#0" },
|
||||
// south: { uv: [0, 0, 6, 0.125], texture: "#0" },
|
||||
// west: { uv: [0.5, 0, 4.5, 0.125], texture: "#0" },
|
||||
// up: { uv: [12, 8, 0, 0], texture: "#0" },
|
||||
// down: { uv: [12, 0, 0, 8], texture: "#0" },
|
||||
// },
|
||||
// },
|
||||
// ],
|
||||
// display: {
|
||||
// thirdperson_righthand: {
|
||||
// rotation: [75, 45, 0],
|
||||
// translation: [0, 2.5, 0],
|
||||
// scale: [0.375, 0.375, 0.375],
|
||||
// },
|
||||
// thirdperson_lefthand: {
|
||||
// rotation: [75, 45, 0],
|
||||
// translation: [0, 2.5, 0],
|
||||
// scale: [0.375, 0.375, 0.375],
|
||||
// },
|
||||
// firstperson_righthand: {
|
||||
// rotation: [0, 45, 0],
|
||||
// scale: [0.4, 0.4, 0.4],
|
||||
// },
|
||||
// firstperson_lefthand: {
|
||||
// rotation: [0, -135, 0],
|
||||
// scale: [0.4, 0.4, 0.4],
|
||||
// },
|
||||
// ground: {
|
||||
// translation: [0, 3, 0],
|
||||
// scale: [0.25, 0.25, 0.25],
|
||||
// },
|
||||
// gui: {
|
||||
// rotation: [30, -135, 0],
|
||||
// translation: [1.5, 0, 0],
|
||||
// scale: [0.29, 0.29, 0.29],
|
||||
// },
|
||||
// fixed: {
|
||||
// rotation: [-90, 0, 0],
|
||||
// translation: [0, -2.75, -1.75],
|
||||
// scale: [0.38, 0.38, 0.38],
|
||||
// },
|
||||
// },
|
||||
// });
|
||||
// });
|
||||
@@ -0,0 +1,38 @@
|
||||
const SeasonHelper = Java.loadClass("sereneseasons.api.season.SeasonHelper")
|
||||
const Season = Java.loadClass("sereneseasons.api.season.Season")
|
||||
|
||||
const seasonName = (seasonObj) => {
|
||||
if (seasonObj == Season.SPRING) {
|
||||
return 'spring'
|
||||
} else if (seasonObj == Season.SUMMER) {
|
||||
return 'summer'
|
||||
} else if (seasonObj == Season.AUTUMN) {
|
||||
return 'autumn'
|
||||
} else {
|
||||
return 'winter'
|
||||
}
|
||||
}
|
||||
|
||||
global.getSeasonFromLevel = (level) => {
|
||||
return seasonName(SeasonHelper.getSeasonState(level).getSeason())
|
||||
}
|
||||
|
||||
global.getSeasonFromBiome = (level, pos) => {
|
||||
const biome = level.getBiome(pos);
|
||||
const biomeTags = biome.tags().map((tagkey) => tagkey.location()).toList();
|
||||
if (
|
||||
biomeTags.toString().includes("sereneseasons:tropical_biomes")
|
||||
) {
|
||||
return "summer"
|
||||
}
|
||||
if (
|
||||
Number(biome.get().getTemperature(pos)) < 0.15
|
||||
) {
|
||||
return "winter"
|
||||
}
|
||||
return global.getSeasonFromLevel(level);
|
||||
}
|
||||
|
||||
global.isLateSeason = (level) => {
|
||||
return SeasonHelper.getSeasonState(level).getSubSeason().toString().includes("LATE");
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
ForgeEvents.onEvent("net.minecraftforge.event.entity.player.PlayerSleepInBedEvent", (e) => {
|
||||
global.handleSkullSleep(e);
|
||||
});
|
||||
global.handleSkullSleep = (e) => {
|
||||
const { entity } = e;
|
||||
if (!entity.isPlayer()) return;
|
||||
const level = entity.level;
|
||||
level.getServer().players.forEach((p) => {
|
||||
if (p.getLevel().dimension === "society:skull_cavern") {
|
||||
entity.tell(
|
||||
Text.translatable("society.skull_cavern.cannot_sleep", p.username).red()
|
||||
);
|
||||
e.cancel();
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user