CivClassic / Citadel

A Minecraft plugin to protect your chests and builds using in-game materials. Requires an attacker to break each block a certain number of times. Built for Paper 1.16.5
BSD 3-Clause "New" or "Revised" License
1 stars 21 forks source link

Localized reinforcement decay #56

Open Maxopoly opened 3 years ago

Maxopoly commented 3 years ago

Instead of a single global timer I want localized decay.

Keep a bitmap of the map with a resolution of 512x512 blocks to one pixel. Values in the bitmap are timestamps used for decay.

Players will update the timestamp for their own 512x512 region and all adjacent ones (3x3 field of 512x512 sections) whenever they login or cross a 512-border (make sure to exit moveevent listener early).

Use HashMap for in memory storage, assume most groups have no time stamps for most regions. Standard db table for persisting. Also add a config value to use as fallback for when no timer is known to avoid all reinforcements initially being fully decayed when this is put on the live server.