Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ command /change-camera:
send "Look at a nearby mob first." to player
stop
set {_camera} to a new clientbound camera packet:
entity id: protocol id of {_target}
camera id: protocol id of {_target}
send packet {_camera} to player
wait 5 seconds
set {_reset} to a new clientbound camera packet:
entity id: protocol id of player
camera id: protocol id of player
send packet {_reset} to player
```

Expand Down Expand Up @@ -249,6 +249,8 @@ command /fake-dropped-item:

The persistent fake entity can be restored after supported updates and reconnects while it is still active. This example removes it after 20 seconds.

Standalone fake entities are displayed only in chunks already sent to their viewers. They reappear when those chunks return, following each player's effective view distance. Mounted entity chains keep their existing visibility behavior because a rider's stored spawn location may differ from its vehicle's location.

### Fake Blocks

Right-click a block to make it appear as gold for five seconds. Only you see the change; the real block is untouched.
Expand All @@ -273,6 +275,8 @@ on right click:

Persistent block overrides can survive block updates and reconnects during the current server session, until they are reset or cleared.

Block updates are grouped by chunk section. Persistent blocks outside a viewer's sent chunks stay stored and are reapplied when the chunk arrives; temporary changes are sent only if the chunk is already visible. Re-display work is combined and spread across ticks during chunk-loading bursts, without loading distant world chunks.

### Inventory Navigation

Run `/inv-nav` to display a simple navigation menu in your own crafting grid. These are fake inventory items, not changes to your real inventory.
Expand Down Expand Up @@ -361,8 +365,7 @@ Persistence is opt-in. Add `with persistent` to a supported syntax to reapply a
Reapplying an inventory or equipment override **without** `with persistent` replaces the persistent override with a one-time appearance.

> [!NOTE]
> Persistence is not permanent storage. Overrides are not saved across server restarts.

> Persistence is not permanent storage. They will disappear after a server restart.
## Player Inventory Slots

The fake inventory slot syntax uses **raw slot indices**.
Expand Down
6 changes: 5 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "org.crebs"
version = "1.0.1"
version = "1.0.2"

val mockitoAgent by configurations.creating

Expand All @@ -27,11 +27,14 @@ repositories {
}

dependencies {
implementation("org.bstats:bstats-bukkit:3.2.1")
testImplementation(platform("org.junit:junit-bom:6.0.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.apache.logging.log4j:log4j-api:2.26.1")
testImplementation("org.mockito:mockito-core:5.15.2")
testImplementation("io.netty:netty-buffer:4.2.16.Final")
testRuntimeOnly("org.apache.commons:commons-lang3:3.20.0")
testImplementation("net.bytebuddy:byte-buddy:1.18.12")
testRuntimeOnly("net.bytebuddy:byte-buddy-agent:1.18.12")
mockitoAgent("org.mockito:mockito-core:5.15.2") {
Expand Down Expand Up @@ -74,6 +77,7 @@ tasks.processResources {

tasks.shadowJar {
archiveClassifier.set("")
relocate("org.bstats", "org.crebs.skpackets.libs.bstats")
relocate("me.tofaa.entitylib", "org.crebs.skpackets.libs.entitylib")
relocate("com.github.shanebeee.skr", "org.crebs.skpackets.libs.skr")
mergeServiceFiles()
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/crebs/skpackets/SkPackets.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.crebs.skpackets;

import com.github.shanebeee.skr.Registration;
import org.bstats.bukkit.Metrics;
import org.bukkit.plugin.java.JavaPlugin;
import org.crebs.skpackets.api.entity.PacketEntityManager;
import org.crebs.skpackets.api.simple.FakeBlockManager;
Expand Down Expand Up @@ -43,6 +44,8 @@ public PacketTeamManager getPacketTeams() {

private ElementRuntime elementRuntime;
private Registration registration;
private org.crebs.skpackets.api.update.UpdateChecker updateChecker;
private Metrics metrics;

public static SkPackets getInstance() {
if (instance == null) {
Expand Down Expand Up @@ -90,10 +93,22 @@ public void onEnable() {
new TeamModule(registration));
registration.finalizeRegistration();
ElementCounts.log(registration, getServer().getConsoleSender());
saveDefaultConfig();
metrics = new Metrics(this, 35259);
updateChecker = new org.crebs.skpackets.api.update.UpdateChecker(this);
updateChecker.start();
}

@Override
public void onDisable() {
if (metrics != null) {
metrics.shutdown();
metrics = null;
}
if (updateChecker != null) {
updateChecker.close();
updateChecker = null;
}
if (skinRefresh != null) {
skinRefresh.close();
skinRefresh = null;
Expand Down
Loading
Loading