neuralgia/kubejs/server_scripts/create_additions/events.js
Gustavo f3dfa471ec
Refactor & update to gt7
* gt7 removed credits/coins

* port gregtech additions to java

* add eslint locally

* add style linting

* switch target ECMA standard

* run linter

* clean up a bunch of linter errors

* remove outdated greate API calls

* forgot about the TFC multi compat issue

* reverted greate recipe removals

* some more linting stuff

* fix some issues with greenhouse recipes

* fix up some material stuff

* fix recipe types

* - Fixed single block machine rendering (#1465)

* minor fixes and changes

---------

Signed-off-by: Pyritie <pyritie@gmail.com>
Co-authored-by: Pyritie <pyritie@gmail.com>
Co-authored-by: Redeix <59435925+Redeix@users.noreply.github.com>
2025-07-28 12:27:06 +10:00

16 lines
No EOL
563 B
JavaScript

// priority: 0
"use strict";
const $FoodData = Java.loadClass("net.dries007.tfc.common.capabilities.food.FoodData")
// hunger, water, saturation, grain, fruit, veg, protein, dairy, decayModifier
const cakeData = new $FoodData(6, 0, 2, 1, 0, 0, 0, 0.5, 0)
BlockEvents.rightClicked(event => {
const { block, server, player, player: { x, y, z, username } } = event;
if (block.id !== 'createaddition:chocolate_cake' && block.id !== 'createaddition:honey_cake') return
let foodData = player.getFoodData();
if (foodData.needsFood()) foodData.eat(cakeData);
});