Commit Graph
12 Commits
Author SHA1 Message Date
YoyoNow 9eea5f5e25 Keep hidden block entities in chunks without their data
Hidden block entities were removed from chunk data, so the client did not
render blocks like shulker boxes at all. They are now sent with empty data,
hiding their contents but not the block itself.
2026-10-31 22:24:51 +01:00
YoyoNow 4dbe2ccac7 Speed up uncovering blocks in hulls
The steps that can lead into or past a changed block are computed once per
hull instead of searching all directions and parts on every block update,
which makes an update about three times faster.
2026-10-31 21:58:48 +01:00
YoyoNow d7d452ebe6 Let doors and trapdoors occlude in hulls
Doors and trapdoors do not occlude for the client, so they had no full face
in the hull and rays passed through closed trapdoors, revealing blocks behind
them along diagonals. Their face masks now come from their shape, so the face
their panel covers is full.
2026-10-31 21:37:08 +01:00
YoyoNow baa4cf34e5 Calculate hull visibility on block faces
Instead of a block occluding as a whole, the hull stores which of its six
faces are full, using the occlusion shapes the client culls faces with. A ray
inside a block can only leave it through an open face and enter the next
block through its open opposite face; if only that face is full, the ray
reaches its surface, so the block is visible, but stops there. Slabs, stairs
and stacked slabs now hide what is behind them; double slabs need no special
case anymore. Faces only open up on block updates, after which the rays that
could not get into, out of or past the block are continued.

Hidden blocks occlude by the same decision as the techhider, so waterlogged
blocks count as well when water is hidden. The hull therefore takes the
ObfuscationConfig, which the fight shares with its TechHiderWrapper.
2026-10-31 21:18:24 +01:00
YoyoNow 5651455a5f Stop hull rays from passing between occluding blocks
A ray only moves diagonally if it could also reach the block by moving along
the single axes of the direction one after another without passing an
occluding block, so it no longer squeezes between blocks touching at an edge
or corner. When a block stops occluding, the diagonal rays it blocked are
continued, so incremental updates match a full initialisation.

Double slabs now occlude as well, as slab materials do not; block updates
pass the block data instead of the material for that.

To keep the initialisation fast, a ray only checks a diagonal step after the
cheaper checks, and the branch directions are computed once per hull.
2026-10-31 17:07:18 +01:00
YoyoNow d76c396268 Do not hide entities with the BauSystem hullhider
HullHider gets a hideEntities parameter: the fight still hides entities inside
hidden hulls, /hullhider only hides blocks. As the TechHider also dropped
spawn packets at hidden positions, ForPlayer#canAccessEntitySpawn decides
about them now, which the BauTechHider always allows.
2026-10-31 15:57:25 +01:00
YoyoNow f02f356b2b Add /hullhider to BauSystem
/hullhider hides the inside of the build area hull of a region from the
players who toggle it, like the hull hider of a fight. Each region gets its
own hull while somebody uses it; it is rebuilt every time somebody enables it,
as WorldEdit and Axiom changes do not update it. /techhider, /xray and
/hullhider exclude each other per player and region.

Which players may see the hull contents is now decided by Viewers, a sealed
class with HiddenByDefault (fight) and VisibleByDefault (bau). Added players
are stored in a set; isViewer alone defines what being added means.
2026-10-31 15:32:18 +01:00
YoyoNow d1fb4ca67e Allow removing hulls and resend their chunks
HullHider#removeHull stops hiding a hull: it shows the entities and REntities
the hull hid and resends its chunks to everybody who could not view it. A hull
is enabled again by adding and initialising it.

Hull#resendChunks only resends chunks the player has loaded. HullHider now
resends the chunks to non-viewers after initialising a hull itself, so
FightHullHider no longer does it.
2026-10-31 15:09:04 +01:00
YoyoNow ce2a23f4b8 Migrate BauSystem to the new TechHider and remove the legacy TechHider
The new TechHider registers a permanent global filter, so BauSystem now uses
a single BauTechHider that combines the hiding rules of the spectator
techhider, /techhider and /xray per player. To support the different
obfuscation blocks of these rules, ForPlayer now provides the obfuscation
block per position.

The ChunkHider now also checks single valued chunk sections, which were sent
unfiltered before, and recalculates their block count if they change.
Unhandled packet types are logged once; statistics, debug samples and ping
responses are passed through.

The legacy TechHider and its access widener entries are removed.
2026-10-31 15:00:37 +01:00
YoyoNow 7d4252325a Extract obfuscation config into HiderCore
ObfuscationConfig resolves the hidden blocks, block states (including all
waterlogged states when water is hidden) and block entity types plus the
obfuscation block, either from a gamemode's techhider config or from plain
materials. TechHiderWrapper now only contains the fight specific access rules.
2026-10-31 14:50:32 +01:00
YoyoNow da4b684a4b Move Hull and generic HullHider into HiderCore
Hull no longer depends on FightSystem: plugin, world, region, ground
visibility and hidden blocks are passed in. HullRegion is the common block
box hulls work on. The generic HullHider<K> manages one hull per key and does
the block, entity and REntity tracking; FightHullHider keeps the fight
specific parts (team hulls, viewer rules, state dependent registration).

Entities are now checked against the hull with block coordinates, so entities
in the bottom layer and at the max z edge are handled correctly.
2026-10-31 14:49:00 +01:00
YoyoNow a3a97ee102 Move TechHider into new HiderCore module
HiderCore holds the TechHider, ChunkHider and AccessPrivilegeProvider so that
FightSystem and BauSystem can both shade it. BlockIds and ProtocolUtils stay in
SpigotCore (used by AntiNocom and RFallingBlockEntity) and move to
de.steamwar.core to avoid a split package. The access widener entries the
TechHider needs are duplicated into hidercore.accesswidener; the legacy
TechHider still needs its own copies in SpigotCore.
2026-10-31 14:44:55 +01:00