0.12.4: Essential removed; plot outline script no longer clashes with KubeJS's own AABB binding
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
2e55380f25
commit
98e61093df
@@ -3,8 +3,8 @@
|
||||
// (лише вона). Дані приходять із сервера каналом createrp_plots; малює Outliner, яким Create малює виділення.
|
||||
// Rhino: без const/let усередині циклів і try — лише var.
|
||||
|
||||
const Outliner = Java.loadClass('net.createmod.catnip.outliner.Outliner')
|
||||
const AABB = Java.loadClass('net.minecraft.world.phys.AABB')
|
||||
const RpOutliner = Java.loadClass('net.createmod.catnip.outliner.Outliner')
|
||||
const RpAABB = Java.loadClass('net.minecraft.world.phys.AABB')
|
||||
|
||||
const PLOT_COLOR = { mine: 0x4FC3F7, free: 0x66DD66, auction: 0xFFD54F, taken: 0xB0B0B0, frozen: 0xE05050, state: 0xFF9800 }
|
||||
const SHOW_TICKS = 100 // 5 секунд після входу на ділянку
|
||||
@@ -75,14 +75,14 @@ function rpDraw () {
|
||||
var holding = String(player.mainHandItem.id) === 'kubejs:citizen_guide' || String(player.offHandItem.id) === 'kubejs:citizen_guide'
|
||||
if (!holding && rpTick >= rpShowUntil) return
|
||||
var y1 = Math.floor(player.y) - WALL_BELOW; var y2 = y1 + WALL_HEIGHT
|
||||
var outliner = Outliner.getInstance()
|
||||
var outliner = RpOutliner.getInstance()
|
||||
for (var i = 0; i < rpPlots.length; i++) {
|
||||
var plot = rpPlots[i]
|
||||
if (!holding && plot.id !== rpHere) continue
|
||||
var colour = PLOT_COLOR[plot.kind] || PLOT_COLOR.taken
|
||||
for (var w = 0; w < plot.walls.length; w++) {
|
||||
var wall = plot.walls[w]
|
||||
outliner.showAABB('createrp_plot_' + plot.id + '_' + w, new AABB(wall[0], y1, wall[1], wall[2], y2, wall[3])).colored(colour).lineWidth(1 / 16)
|
||||
outliner.showAABB('createrp_plot_' + plot.id + '_' + w, new RpAABB(wall[0], y1, wall[1], wall[2], y2, wall[3])).colored(colour).lineWidth(1 / 16)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user