@@ -5,11 +5,12 @@
const RpOutliner = Java . loadClass ( 'net.createmod.catnip.outliner.Outliner' )
const RpAABB = Java . loadClass ( 'net.minecraft.world.phys.AABB' )
const RpTextures = Java . loadClass ( 'com.simibubi.create.AllSpecialTextures' )
const PLOT _COLOR = { mine : 0x4FC3F7 , free : 0x66DD66 , auction : 0xFFD54F , taken : 0xB0B0B0 , frozen : 0xE05050 , state : 0xFF9800 }
const SHOW _TICKS = 100 // 5 секунд після входу на ділянку
const WALL _BELOW = 6 // рамка від 6 блоків нижче гравця…
const WALL _HEIGHT = 18 // …на 18 блоків угору
const WALL _BOTTOM = - 64 // стіна межі стоїть на всю висоту світу й не рухається разом із гравцем
const WALL _TOP = 320
let rpPlots = [ ] // { id, kind, walls: [[x1, z1, x2, z2], …] }
let rpByChunk = { } // "cx,cz" -> індекс у rpPlots
@@ -74,7 +75,6 @@ function rpDraw () {
if ( here !== rpHere ) { rpHere = here ; if ( here !== '' ) rpShowUntil = rpTick + SHOW _TICKS }
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 = RpOutliner . getInstance ( )
for ( var i = 0 ; i < rpPlots . length ; i ++ ) {
var plot = rpPlots [ i ]
@@ -82,7 +82,7 @@ function rpDraw () {
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 RpAABB ( 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 ] , WALL _BOTTOM , wall [ 1 ] , wall [ 2 ] , WALL _TOP , wall [ 3 ] ) ) . colored ( colour ) . lineWidth ( 1 / 16 ) . withFaceTexture ( RpTextures . THIN _CHECKERED ) . disableCull ( )
}
}
}