LTDV10Test/packet/kubejs/client_scripts/render/infinity_cell.js
3944Realms 67a395b765
Some checks failed
Deploy to Remote Server / deploy (push) Failing after 1m11s
初始化
2026-04-14 18:20:56 +08:00

22 lines
771 B
JavaScript

const $Lighting = Java.loadClass("com.mojang.blaze3d.platform.Lighting")
RenderJSEvents.RegisterItemDecorations(e => {
e.register("expatternprovider:infinity_cell", c => {
if(!c.itemStack.nbt) return
let record = c.itemStack.nbt.getCompound("record")
let type = record.getString("#c")
let id = record.getString("id")
c.pushPose()
c.translate(c.xOffset + 8, c.yOffset + 7, 10)
c.scale(0.65, 0.65)
$Lighting.setupForFlatItems()
if (type == "ae2:i") {
c.renderGuiItem(Item.of(id), 0, 0)
}
else if (type == "ae2:f") {
c.renderGuiItem(Fluid.of(id).fluid.bucket.defaultInstance, 0, 0)
}
$Lighting.setupFor3DItems()
c.popPose()
})
})