Rewards: delivery on Paper/Fabric, admin bundle editor, launcher chips

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DjMbLQujBHunCCu5GpsHaT
This commit is contained in:
Claude committed 2026-10-01 00:59:08 +00:00
1 parent 209ade0119
commit 0dc948caa4
18 files changed
+496 -2

No files matched your search

@@ -42,6 +42,13 @@ final class FabricConfig {
bool("clientlink.enabled", true), text("economy.currency_symbol", "$"));
}
net.scopenet.core.RewardRules rewards() {
net.scopenet.core.RewardRules d = net.scopenet.core.RewardRules.defaults();
return new net.scopenet.core.RewardRules(bool("rewards.enabled", true), bool("rewards.allow_commands", false),
text("rewards.permission_command", d.permissionCommand()), text("rewards.permission_deny_command", d.permissionDenyCommand()),
text("rewards.permission_temp_command", d.permissionTempCommand()), text("rewards.group_command", d.groupCommand()));
}
/** {@code permissions.default_level}: "all" lets everyone use commands unless LuckPerms says otherwise, "op" limits them to operators. */
boolean everyoneByDefault() { return !text("permissions.default_level", "all").equalsIgnoreCase("op"); }
}
@@ -55,6 +55,7 @@ public final class FabricFeatures implements Runnable {
private Perms perms;
private FabricConfig config;
private ActionPoller poller;
private net.scopenet.core.RewardPoller rewards;
private MapService map;
private int ticks;
private String placeholderStatus = "off";
@@ -113,6 +114,7 @@ public final class FabricFeatures implements Runnable {
// Actions from the map, and the claims and pins the SCOPENET Map draws.
poller = new ActionPoller(env, (from, to) -> commands.essentials.tpa(from, new String[]{to.name()}));
rewards = new net.scopenet.core.RewardPoller(env, config.rewards());
map = new MapService(env, integration.client().claims(), commands.mapSource(), cache, integration.settings().panel().toString(),
config.bool("map.show_homes", false), s.getMotd());
integration.setMapOverlay(() -> { MapService current = map; return current == null ? "{\"claims\":[],\"pins\":[]}" : net.scopenet.core.map.MapOverlay.toJson(current.snapshot()).toString(); });
@@ -150,6 +152,7 @@ public final class FabricFeatures implements Runnable {
cache.tick(p -> link.pushState(p));
link.tick();
poller.tick();
rewards.tick();
map.tick();
}
if (ticks % 40 == 0) commands.tick();
@@ -72,4 +72,26 @@ final class FabricPlatform implements Platform {
@Override public void runMain(Runnable task) { server.execute(task); }
@Override public void runAsync(Runnable task) { io.execute(task); }
@Override public boolean giveItem(UUID id, String item, int amount) {
ServerPlayer p = server.getPlayerList().getPlayer(id);
ResourceLocation location = ResourceLocation.tryParse(item);
if (p == null || location == null) return false;
var found = net.minecraft.core.registries.BuiltInRegistries.ITEM.getOptional(location);
if (found.isEmpty() || found.get() == net.minecraft.world.item.Items.AIR) return false;
net.minecraft.world.item.Item type = found.get();
for (int left = amount; left > 0; ) {
int n = Math.min(left, type.getMaxStackSize());
net.minecraft.world.item.ItemStack stack = new net.minecraft.world.item.ItemStack(type, n);
p.getInventory().add(stack);
if (!stack.isEmpty()) p.drop(stack, false);
left -= n;
}
return true;
}
@Override public boolean console(String command) {
server.getCommands().performPrefixedCommand(server.createCommandSourceStack(), command);
return true;
}
}