Skip to content

Commit c7181f1

Browse files
committed
Moved package
1 parent a1ed007 commit c7181f1

File tree

9 files changed

+19
-31
lines changed

9 files changed

+19
-31
lines changed

src/main/java/world/bentobox/stranger/Settings.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,24 @@ public class Settings implements WorldSettings {
3535
/* Commands */
3636
@ConfigComment("Player Command. What command users will run to access their claim.")
3737
@ConfigComment("To define alias, just separate commands with white space.")
38-
@ConfigEntry(path = "stranger.command.player")
38+
@ConfigEntry(path = "strangerrealms.command.player")
3939
private String playerCommandAliases = "cb stranger";
4040

4141
@ConfigComment("The admin command.")
4242
@ConfigComment("To define alias, just separate commands with white space.")
43-
@ConfigEntry(path = "stranger.command.admin")
43+
@ConfigEntry(path = "strangerrealms.command.admin")
4444
private String adminCommandAliases = "crowd";
4545

4646
@ConfigComment("The default action for new player command call.")
4747
@ConfigComment("Sub-command of main player command that will be run on first player command call.")
4848
@ConfigComment("By default it is sub-command 'create'.")
49-
@ConfigEntry(path = "stranger.command.new-player-action")
49+
@ConfigEntry(path = "strangerrealms.command.new-player-action")
5050
private String defaultNewPlayerAction = "create";
5151

5252
@ConfigComment("The default action for player command.")
5353
@ConfigComment("Sub-command of main player command that will be run on each player command call.")
5454
@ConfigComment("By default it is sub-command 'go'.")
55-
@ConfigEntry(path = "stranger.command.default-action")
55+
@ConfigEntry(path = "strangerrealms.command.default-action")
5656
private String defaultPlayerAction = "go";
5757

5858
/* WORLD */

src/main/java/world/bentobox/stranger/StrangerRealms.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
import world.bentobox.stranger.commands.player.SpawnCommand;
4141
import world.bentobox.stranger.commands.player.UnclaimCommand;
4242
import world.bentobox.stranger.generator.NetherBiomeProvider;
43+
import world.bentobox.stranger.generator.NetherChunkMaker;
4344
import world.bentobox.stranger.generator.NetherChunks;
4445
import world.bentobox.stranger.listeners.BorderShower;
45-
import world.bentobox.stranger.listeners.NetherChunkMaker;
4646
import world.bentobox.stranger.listeners.NetherRedstoneListener;
4747
import world.bentobox.stranger.listeners.PlayerListener;
4848
import world.bentobox.stranger.listeners.TeamListener;
@@ -302,14 +302,12 @@ public double getBorderSize() {
302302
task.cancel();
303303
// Trigger gradual reduction of border
304304
task = Bukkit.getScheduler().runTaskTimer(getPlugin(), () -> {
305-
//BentoBox.getInstance().logDebug("Get border size = " + newBorderSize + " old = " + borderSize);
306305
if (borderSize > newBorderSize) {
307306
borderSize--;
308307
// Update the border for any online players
309308
Bukkit.getOnlinePlayers().stream().filter(p -> inWorld(p.getWorld())).forEach(borderShower::showBorder);
310309
} else {
311310
// We are done
312-
//BentoBox.getInstance().logDebug("canceled");
313311
task.cancel();
314312
}
315313
}, this.getSettings().getBarrierReductionSpeed() * 20L, this.getSettings().getBarrierReductionSpeed() * 20L);

src/main/java/world/bentobox/stranger/border/ShowBarrier.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public void showBorder(Player player) {
6060
// If the player is not in a world governed by this addon, skip
6161
return;
6262
}
63-
//BentoBox.getInstance().logDebug("showing barrier border for " + player.getName());
6463
if (!Objects.requireNonNull(User.getInstance(player)).getMetaData(BORDER_STATE_META_DATA).map(MetaDataValue::asBoolean).orElse(true)) {
6564
return;
6665
}

src/main/java/world/bentobox/stranger/border/ShowWorldBorder.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public ShowWorldBorder(StrangerRealms addon) {
3232

3333
@Override
3434
public void showBorder(Player player) {
35-
//BentoBox.getInstance().logDebug("showing world border for " + player.getName());
3635
if (addon.getSettings().isDisableWorldBorder() || !Objects.requireNonNull(User.getInstance(player)).getMetaData(BORDER_STATE_META_DATA).map(MetaDataValue::asBoolean).orElse(true)) {
3736
return;
3837
}
@@ -47,7 +46,6 @@ public void showBorder(Player player) {
4746
showWorldBarrier(player);
4847
return;
4948
}
50-
//BentoBox.getInstance().logDebug("Claim is not within the world barrier");
5149
// Claim is isolated so show the world barrier
5250
WorldBorder wb = Bukkit.createWorldBorder();
5351
wb.setCenter(l);
@@ -61,24 +59,20 @@ public void showBorder(Player player) {
6159
}
6260

6361
private void showWorldBarrier(Player player) {
64-
//BentoBox.getInstance().logDebug("Show world barrier");
6562
if (!addon.inWorld(player.getWorld())) {
6663
// If the player is not in a world governed by this addon, skip
67-
// BentoBox.getInstance().logDebug("Wrong world");
6864
return;
6965
}
7066
// Get the center of the barrier
7167
Location center = Objects.requireNonNullElse(addon.getIslands().getSpawnPoint(player.getWorld()), player.getWorld().getSpawnLocation());
72-
//BentoBox.getInstance().logDebug("Spawn point = " + center);
7368
WorldBorder wb = Bukkit.createWorldBorder();
7469
wb.setCenter(center);
7570
double size = addon.getBorderSize();
7671
wb.setSize(size);
7772
wb.setWarningDistance(5);
7873

7974
if (!wb.isInside(player.getLocation())) {
80-
//BentoBox.getInstance().logDebug("Player is outside the barrier");
81-
User.getInstance(player).sendMessage("stranger.teleporting-to-spawn");
75+
User.getInstance(player).sendMessage("strangerrealms.teleporting-to-spawn");
8276
new SafeSpotTeleport.Builder(addon.getPlugin()).entity(player).location(center).build();
8377
}
8478
player.setWorldBorder(wb);

src/main/java/world/bentobox/stranger/commands/player/ClaimLocationStrategy.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public ClaimLocationStrategy(StrangerRealms addon) {
2424
@Override
2525
public Location getNextLocation(World world, User user) {
2626
if (!Util.getWorld(user.getWorld()).equals(world)) {
27-
user.sendMessage("stranger.errors.not-in-world");
27+
user.sendMessage("strangerrealms.errors.not-in-world");
2828
return null;
2929
}
3030
Location location = user.getLocation();
3131
// Quick check using the claim grid cache.
3232
if (plugin.getIslands().isIslandAt(location)) {
33-
user.sendMessage("stranger.errors.already-claimed");
33+
user.sendMessage("strangerrealms.errors.already-claimed");
3434
return null;
3535
}
3636

@@ -48,13 +48,12 @@ public Location getNextLocation(World world, User user) {
4848
for (Location l : locs) {
4949
// Check if a claim exists
5050
if (plugin.getIslands().getIslandAt(l).isPresent()) {
51-
user.sendMessage("stranger.errors.overlap", "[xyz]", Util.xyz(l.toVector()));
51+
user.sendMessage("strangerrealms.errors.overlap", "[xyz]", Util.xyz(l.toVector()));
5252
return null;
5353
}
5454
// Check that everything is within the global world border
5555
if (!addon.getSettings().isDisableWorldBorder() && !user.getPlayer().getWorldBorder().isInside(l)) {
56-
user.sendMessage("stranger.errors.no-fit-inside");
57-
//BentoBox.getInstance().logDebug(l + " would be outside the world border");
56+
user.sendMessage("strangerrealms.errors.no-fit-inside");
5857
return null;
5958
}
6059
}

src/main/java/world/bentobox/stranger/listeners/NetherChunkMaker.java renamed to src/main/java/world/bentobox/stranger/generator/NetherChunkMaker.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package world.bentobox.stranger.listeners;
1+
package world.bentobox.stranger.generator;
22

33
import java.util.ArrayList;
44
import java.util.Arrays;
@@ -63,7 +63,7 @@ public class NetherChunkMaker implements Listener {
6363

6464
private static final int ROOF_HEIGHT = 107;
6565
private static final int CEILING_START = 100; // Blocks above this height are left as natural nether blocks
66-
private static final int NETHER_FLOOR = 30; // Blocks below this are left as natural nether world blocks
66+
protected static final int NETHER_FLOOR = 20; // Blocks below this are left as natural nether world blocks
6767
private static final String NETHER_CHUNKS_TABLE = "StrangerChunks";
6868
private static final Set<Material> NETHER_STRUCTURE_BLOCKS = Set.of(Material.NETHER_BRICKS, Material.NETHER_BRICK_FENCE,
6969
Material.NETHER_BRICK_SLAB, Material.NETHER_BRICK_STAIRS, Material.NETHER_BRICK_WALL, Material.CHISELED_NETHER_BRICKS
@@ -181,7 +181,7 @@ public void onNetherPortalEnter(EntityPortalEnterEvent e) {
181181
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
182182
public void onNetherEnterViaTeleport(PlayerChangedWorldEvent e) {
183183
if (addon.inWorld(e.getPlayer().getWorld()) && e.getPlayer().getWorld().getEnvironment() == Environment.NETHER) {
184-
User.getInstance(e.getPlayer()).notify(addon.getNetherWorld(), "stranger.nether.welcome");
184+
User.getInstance(e.getPlayer()).notify(addon.getNetherWorld(), "strangerrealms.nether.welcome");
185185
}
186186
}
187187

@@ -202,7 +202,7 @@ private void refreshNetherChunks(Player p) {
202202
}
203203
}
204204
handler.saveObject(netherChunksMade);
205-
User.getInstance(p).sendMessage("stranger.nether.refresh");
205+
User.getInstance(p).sendMessage("strangerrealms.nether.refresh");
206206
Bukkit.getScheduler().runTask(addon.getPlugin(), () -> p.playSound(p, Sound.ENTITY_LIGHTNING_BOLT_IMPACT, 1F, 1F));
207207

208208
// Reduce the amount of the warped compass used

src/main/java/world/bentobox/stranger/generator/NetherChunks.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public void generateNoise(@NotNull WorldInfo worldInfo, @NotNull Random random,
3636

3737
// Define the Y-range for cave generation
3838
final int minCaveY = worldInfo.getMinHeight() + 7;
39-
final int maxCaveY = minCaveY + 30;
39+
final int maxCaveY = minCaveY + NetherChunkMaker.NETHER_FLOOR;
4040
final double caveRange = maxCaveY - minCaveY;
4141

4242
for (int x = 0; x < 16; x++) {
@@ -112,7 +112,7 @@ public boolean shouldGenerateStructures() {
112112
public void generateSurface(@NotNull WorldInfo worldInfo, @NotNull Random random, int chunkX, int chunkZ, @NotNull ChunkData chunkData) {
113113
// Define the Y-range
114114
final int minY = worldInfo.getMinHeight() + 7;
115-
final int maxY = minY + 30;
115+
final int maxY = minY + NetherChunkMaker.NETHER_FLOOR;
116116

117117
for (int y = minY; y < maxY; y++) {
118118
for (int x = 0; x < 16; x++) {

src/main/java/world/bentobox/stranger/listeners/PlayerListener.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,7 @@ public void onProtectionRangeChange(IslandProtectionRangeChangeEvent e) {
374374
// Hide and show again
375375
e.getIsland().getPlayersOnIsland().forEach(player -> {
376376
if (isOn(player)) {
377-
//BentoBox.getInstance().logDebug("Hiding for "+ player.getName());
378377
show.hideBorder(User.getInstance(player));
379-
//BentoBox.getInstance().logDebug("Showing for "+ player.getName());
380378
show.showBorder(player);
381379
}
382380
});

src/main/java/world/bentobox/stranger/listeners/TeamListener.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public void onTeamJoin(TeamJoinedEvent e) {
6161
int change = resize(e.getIsland());
6262
// If there is no difference in size, explain why
6363
if (change == 0 && e.getIsland().getOwner() != null) {
64-
User.getInstance(e.getIsland().getOwner()).sendMessage("stranger.claim.team-no-change");
64+
User.getInstance(e.getIsland().getOwner()).sendMessage("strangerrealms.claim.team-no-change");
6565
}
6666
}
6767

@@ -107,14 +107,14 @@ protected int resize(Island claim) {
107107
// Notify players
108108
if (claim.isOwned()) {
109109
// Tell owner
110-
User.getInstance(claim.getOwner()).sendMessage("stranger.claim.team-" + suffix + "-owner");
110+
User.getInstance(claim.getOwner()).sendMessage("strangerrealms.claim.team-" + suffix + "-owner");
111111
}
112112

113113
// Tell players on the claim (excluding the owner, if one exists)
114114
claim.getPlayersOnIsland().stream()
115115
.filter(p -> claim.getOwner() == null || !p.getUniqueId().equals(claim.getOwner()))
116116
.map(User::getInstance)
117-
.forEach(u -> u.sendMessage("stranger.claim.team-" + suffix));
117+
.forEach(u -> u.sendMessage("strangerrealms.claim.team-" + suffix));
118118

119119
return size - oldSize;
120120
}

0 commit comments

Comments
 (0)