Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
00da7b4
Merge branch 'prod' into scope/world-generation
Paldiu Aug 7, 2026
7463c36
Merge branch 'release/v26.9-sirius' into scope/world-generation
Paldiu Aug 7, 2026
d001912
Contract Publication
Paldiu Aug 7, 2026
7d1b2c7
Update Flatlands.java
Paldiu Aug 7, 2026
c9444aa
Some more basics
Paldiu Aug 7, 2026
3863bda
committing actually implemented files
Paldiu Aug 9, 2026
0304865
skeletonized
Paldiu Aug 9, 2026
c4ddef2
adjustments
Paldiu Aug 9, 2026
f3f8b6f
I think i got this now lowkey
Paldiu Aug 9, 2026
b01bc96
Incorrectly stated that reading columnTop deadlocks
Paldiu Aug 9, 2026
287c230
Finish features
Paldiu Aug 9, 2026
255a806
Change how biomes and trees are calculated
Paldiu Aug 10, 2026
39812e0
Merge branch 'release/v26.9-sirius' into scope/world-generation
Paldiu Aug 10, 2026
17350e8
Merge remote-tracking branch 'origin/release/v26.9-sirius' into scope…
Paldiu Aug 10, 2026
b8d036c
Contract Publication
Paldiu Aug 7, 2026
1ead206
Update Flatlands.java
Paldiu Aug 7, 2026
3158ed0
Some more basics
Paldiu Aug 7, 2026
1fc5f67
committing actually implemented files
Paldiu Aug 9, 2026
1c5cc94
skeletonized
Paldiu Aug 9, 2026
23ac9c9
adjustments
Paldiu Aug 9, 2026
cc89cdc
I think i got this now lowkey
Paldiu Aug 9, 2026
741d8b0
Incorrectly stated that reading columnTop deadlocks
Paldiu Aug 9, 2026
c547efb
Finish features
Paldiu Aug 9, 2026
9fd0baf
Change how biomes and trees are calculated
Paldiu Aug 10, 2026
df7b2b6
Merge branch 'scope/world-generation' of https://github.com/tfreedomo…
Paldiu Aug 10, 2026
bcc041c
Minor logic changes ; comment revisions
Paldiu Aug 10, 2026
0d32ecf
start flatlands impl
Paldiu Aug 11, 2026
d568b4d
Merge branch 'release/v26.9-sirius' into scope/world-generation
Paldiu Aug 12, 2026
43da1c9
Merge branch 'release/v26.9-sirius' into scope/world-generation
Paldiu Aug 13, 2026
712fd65
Merge branch 'release/v26.9-sirius' into scope/world-generation
Paldiu Aug 13, 2026
1af39a6
Implement DensityGenerator & remaining Bukkit adapter classes
Paldiu Aug 13, 2026
d13dfb7
Merge changes into other branches
Ivanomoly Aug 13, 2026
e5cf784
minor logic changes
Paldiu Aug 13, 2026
23b8063
finishing up
Paldiu Aug 15, 2026
e3e31bb
Update GenerationService.java
Paldiu Aug 15, 2026
8cedbef
Update GenerationService.java
Paldiu Aug 15, 2026
7c8c4d1
final pass-through for world generation
Paldiu Aug 15, 2026
4a32e23
Merge branch 'release/v26.9-sirius' into scope/world-generation
Paldiu Aug 20, 2026
0cd822d
Kirking Upon It
Paldiu Aug 21, 2026
a628912
GET ON!!!
Paldiu Aug 21, 2026
6b95aba
fix ambiguous Book.book call against adventure 5.2.0
luke560 Aug 22, 2026
78d57e8
Merge branch 'release/v26.9-sirius' into scope/world-generation
Paldiu Sep 12, 2026
345c0be
Address Comments
Paldiu Sep 12, 2026
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ public static void unbind()
* caching the variable as in `var plugin = PluginProvider.get()` like in FCommand is fine, since the bind never changes during lifetime
* and binding is the first thing that happens in the plugins lifecycle in onLoad() and everything else is registered and initialized in the onEnable() method.
*
* This however should be avoided moving forward; I will replace plugin and server variable with overload getters that just return this get method instead.
* There are many locations in the code where this occurs, FCommand is the only one thats feasibly fixable in this scope.
* This however should be avoided moving forward.
*
* @return the live plugin instance.
* @throws IllegalStateException if the plugin is not currently bound.
Expand Down
24 changes: 11 additions & 13 deletions src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.io.File;
import java.io.InputStream;
import java.util.Optional;
import java.util.Properties;

import org.bukkit.generator.ChunkGenerator;
Expand Down Expand Up @@ -46,7 +47,7 @@
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil;
import me.totalfreedom.totalfreedommod.util.MethodTimer;
import me.totalfreedom.totalfreedommod.world.CleanroomChunkGenerator;
import me.totalfreedom.totalfreedommod.world.GenerationService;
import me.totalfreedom.totalfreedommod.world.WorldManager;

public class TotalFreedomMod extends JavaPlugin
Expand All @@ -66,6 +67,7 @@ public class TotalFreedomMod extends JavaPlugin
public FreedomDatabase dm; // FreedomDatabase - Manages SQL database connections
public SavedFlags sf; // SavedFlags - Stores saved flag states
public WorldManager wm; // WorldManager - Manages world operations
public GenerationService gs; // GenerationService - Loads and serves world-generation profiles
public AdminList al; // AdminList - Manages admin list and permissions
public RankManager rm; // RankManager - Handles player ranks and display
public TitleManager tm; // TitleManager - Flat, non-inheriting capability grants shown alongside ranks
Expand Down Expand Up @@ -182,6 +184,8 @@ public void onEnable()
dm = services.registerService(FreedomDatabase.class);

sf = services.registerService(SavedFlags.class);
// Before WorldManager: profiles must be loaded before anything tries to spin up a world from one.
gs = services.registerService(GenerationService.class);
wm = services.registerService(WorldManager.class);
al = services.registerService(AdminList.class);

Expand Down Expand Up @@ -290,20 +294,14 @@ public void onEnable()
@Override
public ChunkGenerator getDefaultWorldGenerator(String worldName, String id)
{
if ("flatlands".equals(worldName))
if (gs != null)
{
String params;
if (config != null)
{
params = ConfigEntry.FLATLANDS_GENERATE_PARAMS.getString();
}
else
{
saveDefaultConfig();
params = getConfig().getString("flatlands.generate_params", "16|stone|32|dirt|1|grass_block");
}
return new CleanroomChunkGenerator(params);
final Optional<ChunkGenerator> generator = gs.generatorFor(worldName);

if (generator.isPresent())
return generator.get();
}

return super.getDefaultWorldGenerator(worldName, id);
}

Expand Down
27 changes: 9 additions & 18 deletions src/main/java/me/totalfreedom/totalfreedommod/admin/AdminList.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.sql.SQLException;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
Expand Down Expand Up @@ -287,27 +286,19 @@ public Admin getAdmin(CommandSender sender)
Admin admin = getEntryByName(player.getName());

// Admin by name
if (admin != null)
if (admin != null && (Bukkit.getOnlineMode() || admin.getIps().contains(ip)))
{
// Check if we're in online mode,
// Or the players IP is in the admin entry
if (Bukkit.getOnlineMode() || admin.getIps().contains(ip))
if (!admin.getIps().contains(ip))
{
if (!admin.getIps().contains(ip))
{
// Add the new IP if we have to
admin.addIp(ip);
ipTable.put(ip, admin);
saveAdminAsync(admin);
}
return admin;
// Add the new IP if we have to
admin.addIp(ip);
ipTable.put(ip, admin);
saveAdminAsync(admin);
}

// Impostor: the name is ours but the IP is not. Fall through to
// the IP lookup, which will not match this entry.
return admin;
}

// Admin by ip
admin = getEntryByIp(ip);
if (admin != null)
{
Expand Down Expand Up @@ -500,9 +491,9 @@ public void updateTables()
.filter(this::isAdmin)
.forEach(onlineAdminPlayers::add);

if (plugin.wm != null && plugin.wm.adminworld != null)
if (plugin.wm != null)
{
plugin.wm.adminworld.wipeAccessCache();
plugin.wm.invalidateAccessCaches();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void onBlockPlace(BlockPlaceEvent event)
}
case SPAWNER:
{
if (ConfigEntry.DISABLE_SPAWNER_PLACE.getBoolean())
if (plugin.gs.blocking(event.getBlock().getWorld().getName()).spawnerPlace())
{
player.sendMessage(Component.text("Spawners are currently disabled.", NamedTextColor.GRAY));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package me.totalfreedom.totalfreedommod.blocking;

import java.util.Optional;

import io.papermc.paper.event.block.BlockPreDispenseEvent;
import org.bukkit.GameMode;
import org.bukkit.Material;
Expand Down Expand Up @@ -229,7 +231,7 @@ public void onLeavesDecay(LeavesDecayEvent event)
@EventHandler(priority = EventPriority.HIGH)
public void onSpawnerSpawn(SpawnerSpawnEvent event)
{
if (ConfigEntry.DISABLE_SPAWNERS.getBoolean())
if (plugin.gs.blocking(event.getEntity().getWorld().getName()).spawners())
{
event.setCancelled(true);
}
Expand All @@ -238,7 +240,22 @@ public void onSpawnerSpawn(SpawnerSpawnEvent event)
@EventHandler(priority = EventPriority.HIGH)
public void onTrialSpawnerSpawn(TrialSpawnerSpawnEvent event)
{
if (ConfigEntry.DISABLE_SPAWNERS.getBoolean())
if (plugin.gs.blocking(event.getEntity().getWorld().getName()).spawners())
{
event.setCancelled(true);
}
}

/** Reads {@code blocking.monsters} live on every natural spawn attempt rather than pushing it onto the world once at creation, so editing a profile takes effect on the very next spawn with nothing to reload. */
@EventHandler(priority = EventPriority.HIGH)
public void onCreatureSpawn(CreatureSpawnEvent event)
{
if (event.getSpawnReason() != CreatureSpawnEvent.SpawnReason.NATURAL)
{
return;
}

if (event.getEntity() instanceof Monster && plugin.gs.blocking(event.getEntity().getWorld().getName()).monsters())
{
event.setCancelled(true);
}
Expand All @@ -247,7 +264,7 @@ public void onTrialSpawnerSpawn(TrialSpawnerSpawnEvent event)
@EventHandler(priority = EventPriority.HIGH)
public void onPortalCreate(PortalCreateEvent event)
{
if (ConfigEntry.DISABLE_PORTAL_CREATE.getBoolean())
if (plugin.gs.blocking(event.getWorld().getName()).portalCreate())
{
event.setCancelled(true);
}
Expand All @@ -256,7 +273,7 @@ public void onPortalCreate(PortalCreateEvent event)
@EventHandler(priority = EventPriority.HIGH)
public void onPistonExtend(BlockPistonExtendEvent event)
{
if (ConfigEntry.DISABLE_PISTONS.getBoolean() || redstoneBlocked())
if (plugin.gs.blocking(event.getBlock().getWorld().getName()).pistons() || redstoneBlocked())
{
event.setCancelled(true);
}
Expand All @@ -265,7 +282,7 @@ public void onPistonExtend(BlockPistonExtendEvent event)
@EventHandler(priority = EventPriority.HIGH)
public void onPistonRetract(BlockPistonRetractEvent event)
{
if (ConfigEntry.DISABLE_PISTONS.getBoolean() || redstoneBlocked())
if (plugin.gs.blocking(event.getBlock().getWorld().getName()).pistons() || redstoneBlocked())
{
event.setCancelled(true);
}
Expand All @@ -274,7 +291,8 @@ public void onPistonRetract(BlockPistonRetractEvent event)
@EventHandler(priority = EventPriority.NORMAL)
public void onEntitySpawn(EntitySpawnEvent event)
{
if (!ConfigEntry.DISABLE_ENTITY_SPAM.getBoolean())
final Optional<Integer> max = plugin.gs.blocking(event.getLocation().getWorld().getName()).entitySpamMax();
if (max.isEmpty())
{
return;
}
Expand All @@ -291,8 +309,7 @@ public void onEntitySpawn(EntitySpawnEvent event)
return;
}

final int max = ConfigEntry.DISABLE_ENTITY_SPAM_MAX.getInteger();
if (max > 0 && event.getLocation().getWorld().getEntities().size() > max)
if (max.get() > 0 && event.getLocation().getWorld().getEntities().size() > max.get())
{
event.setCancelled(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void blockWindChargeFromSpawner(SpawnerSpawnEvent event)

private void blockHangingFromSpawner(EntitySpawnEvent event, String reason, String label)
{
if (Boolean.TRUE.equals(ConfigEntry.DISABLE_SPAWNERS.getBoolean()))
if (plugin.gs.blocking(event.getEntity().getWorld().getName()).spawners())
{
return;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void crashUsingSpecificMethods(final CommandSender sender, final Player p
{
return;
}

msg(sender, method.performOperationIfAllowed(player) ?
"<gray>Crashed <player> using method <method>." :
"<red>Method <method> has a set of requirements which aren't currently met.",
Expand Down

This file was deleted.

Loading