mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 12:36:41 +00:00
Compare commits
1 Commits
2022.02-RC
...
FS-283
Author | SHA1 | Date | |
---|---|---|---|
fb914734ce |
@ -1,9 +1,9 @@
|
|||||||
name: Java17-Maven-Build
|
name: Java16-Maven-Build
|
||||||
|
|
||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-java-17:
|
build-java-16:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
@ -12,10 +12,10 @@ jobs:
|
|||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
# Java 16 Builds
|
# Java 16 Builds
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 16
|
||||||
uses: actions/setup-java@v2.3.0
|
uses: actions/setup-java@v2.3.0
|
||||||
with:
|
with:
|
||||||
java-version: 17
|
java-version: 16
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn -B package --file pom.xml
|
@ -11,23 +11,20 @@ These versions are currently actively supported by our team, and you should expe
|
|||||||
|
|
||||||
| Version | Supported | Support End: |
|
| Version | Supported | Support End: |
|
||||||
| ------------------- | ------------------ | ------------------------------ |
|
| ------------------- | ------------------ | ------------------------------ |
|
||||||
| 2021.09 | :white_check_mark: | No Earlier than December 2021 |
|
| 2021.05 | :white_check_mark: | No Earlier than August 2021 |
|
||||||
|
|
||||||
### Legacy Supported
|
### Legacy Supported
|
||||||
These versions are no longer under active development, however we will look to release critical secuirty patches where appropriate.
|
These versions are no longer under active development, however we will look to release critical secuirty patches where appropriate.
|
||||||
|
|
||||||
| Version | Supported | Support End: |
|
| Version | Supported | Support End: |
|
||||||
| ------------------- | ------------------ | ------------ |
|
| ------------------- | ------------------ | ------------ |
|
||||||
| 2021.06 | :white_check_mark: | October 2021 |
|
| 2021.04 | :white_check_mark: | July 2021 |
|
||||||
|
|
||||||
|
|
||||||
### No Longer Supported
|
### No Longer Supported
|
||||||
These versions are no longer supported at all. It is strongly advised to update if you are running any of these versions.
|
These versions are no longer supported at all. It is strongly advised to update if you are running any of these versions.
|
||||||
|
|
||||||
| Version | Supported | Support Ended: |
|
| Version | Supported | Support Ended: |
|
||||||
| ------------------- | ------------------ | ------------------- |
|
| ------------------- | ------------------ | ------------------- |
|
||||||
| 2021.05 | :white_check_mark: | September 2021 |
|
|
||||||
| 2021.04 | :white_check_mark: | July 2021 |
|
|
||||||
| 2021.02 | :x: | 6 June 2021 |
|
| 2021.02 | :x: | 6 June 2021 |
|
||||||
| 2020.11 | :x: | 3 May 2021 |
|
| 2020.11 | :x: | 3 May 2021 |
|
||||||
| 6.0.x (Pre-Release) | :x: | December 2020 |
|
| 6.0.x (Pre-Release) | :x: | December 2020 |
|
||||||
|
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<groupId>me.totalfreedom</groupId>
|
<groupId>me.totalfreedom</groupId>
|
||||||
<artifactId>TotalFreedomMod</artifactId>
|
<artifactId>TotalFreedomMod</artifactId>
|
||||||
<version>2021.09</version>
|
<version>2021.06</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -276,25 +276,8 @@ public class CoreProtectBridge extends FreedomService
|
|||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
final CoreProtectAPI coreProtect = getCoreProtectAPI();
|
final CoreProtectAPI coreProtect = getCoreProtectAPI();
|
||||||
|
|
||||||
// TODO: Rewrite this
|
|
||||||
if (data.hasInspection())
|
if (data.hasInspection())
|
||||||
{
|
{
|
||||||
int cooldownTime = 3;
|
|
||||||
|
|
||||||
// Cooldown check
|
|
||||||
if ((event.getAction() == Action.LEFT_CLICK_BLOCK || event.getAction() == Action.RIGHT_CLICK_BLOCK)
|
|
||||||
&& cooldown.containsKey(player.getName()))
|
|
||||||
{
|
|
||||||
long secondsLeft = getSecondsLeft(cooldown.get(player.getName()), cooldownTime);
|
|
||||||
if (secondsLeft > 0L)
|
|
||||||
{
|
|
||||||
event.setCancelled(true);
|
|
||||||
player.sendMessage(ChatColor.RED + String.valueOf(secondsLeft) + " seconds left before next query.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Actual lookup time
|
|
||||||
if (event.getAction() == Action.LEFT_CLICK_BLOCK)
|
if (event.getAction() == Action.LEFT_CLICK_BLOCK)
|
||||||
{
|
{
|
||||||
if (block != null)
|
if (block != null)
|
||||||
@ -302,6 +285,19 @@ public class CoreProtectBridge extends FreedomService
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
List<String[]> lookup = coreProtect.blockLookup(block, -1);
|
List<String[]> lookup = coreProtect.blockLookup(block, -1);
|
||||||
|
|
||||||
|
int cooldownTime = 3;
|
||||||
|
|
||||||
|
if (cooldown.containsKey(player.getName()))
|
||||||
|
{
|
||||||
|
long secondsLeft = getSecondsLeft(cooldown.get(player.getName()), cooldownTime);
|
||||||
|
if (secondsLeft > 0L)
|
||||||
|
{
|
||||||
|
event.setCancelled(true);
|
||||||
|
player.sendMessage(ChatColor.RED + String.valueOf(secondsLeft) + " seconds left before next query.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!plugin.al.isAdmin(player))
|
if (!plugin.al.isAdmin(player))
|
||||||
{
|
{
|
||||||
cooldown.put(player.getName(), System.currentTimeMillis());
|
cooldown.put(player.getName(), System.currentTimeMillis());
|
||||||
@ -368,75 +364,91 @@ public class CoreProtectBridge extends FreedomService
|
|||||||
{
|
{
|
||||||
if (block != null)
|
if (block != null)
|
||||||
{
|
{
|
||||||
BlockState blockState = block.getRelative(event.getBlockFace()).getState();
|
if (data.hasInspection())
|
||||||
Block placedBlock = blockState.getBlock();
|
|
||||||
event.setCancelled(true);
|
|
||||||
List<String[]> lookup = coreProtect.blockLookup(placedBlock, -1);
|
|
||||||
|
|
||||||
if (lookup.isEmpty())
|
|
||||||
{
|
{
|
||||||
lookup = coreProtect.blockLookup(block, -1);
|
BlockState blockState = block.getRelative(event.getBlockFace()).getState();
|
||||||
}
|
Block placedBlock = blockState.getBlock();
|
||||||
|
event.setCancelled(true);
|
||||||
|
List<String[]> lookup = coreProtect.blockLookup(placedBlock, -1);
|
||||||
|
|
||||||
if (!plugin.al.isAdmin(player))
|
|
||||||
{
|
|
||||||
cooldown.put(player.getName(), System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lookup != null)
|
|
||||||
{
|
|
||||||
if (lookup.isEmpty())
|
if (lookup.isEmpty())
|
||||||
{
|
{
|
||||||
player.sendMessage(net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector " + ChatColor.WHITE + "- " + "No block data found for this location");
|
lookup = coreProtect.blockLookup(block, -1);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HISTORY_MAP.remove(event.getPlayer());
|
int cooldownTime = 3;
|
||||||
HISTORY_MAP.put(event.getPlayer(), new FUtil.PaginationList<>(10));
|
|
||||||
FUtil.PaginationList<String> paged = HISTORY_MAP.get(event.getPlayer());
|
|
||||||
|
|
||||||
player.sendMessage("---- " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector" + ChatColor.WHITE + " ---- " +
|
if (cooldown.containsKey(player.getName()))
|
||||||
ChatColor.GRAY + "(x" + block.getX() + "/" + "y" + block.getY() + "/" + "z" + block.getZ() + ")");
|
|
||||||
|
|
||||||
for (String[] value : lookup)
|
|
||||||
{
|
{
|
||||||
CoreProtectAPI.ParseResult result = coreProtect.parseResult(value);
|
long secondsLeft = getSecondsLeft(cooldown.get(player.getName()), cooldownTime);
|
||||||
BlockData bl = result.getBlockData();
|
if (secondsLeft > 0L)
|
||||||
|
|
||||||
String s;
|
|
||||||
String st = "";
|
|
||||||
|
|
||||||
if (result.getActionString().equals("Placement"))
|
|
||||||
{
|
{
|
||||||
s = " placed ";
|
event.setCancelled(true);
|
||||||
|
player.sendMessage(ChatColor.RED + String.valueOf(secondsLeft) + " seconds left before next query.");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (result.getActionString().equals("Removal"))
|
|
||||||
{
|
|
||||||
s = " broke ";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
s = " interacted with ";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result.isRolledBack())
|
|
||||||
{
|
|
||||||
st += "§m";
|
|
||||||
}
|
|
||||||
|
|
||||||
int time = (int)(System.currentTimeMillis() / 1000L);
|
|
||||||
|
|
||||||
paged.add(ChatColor.GRAY + getTimeAgo(result.getTime(), time) + ChatColor.WHITE + " - " + net.md_5.bungee.api.ChatColor.of("#30ade4") +
|
|
||||||
st + result.getPlayer() + ChatColor.WHITE + st + s + net.md_5.bungee.api.ChatColor.of("#30ade4") + st + bl.getMaterial().toString().toLowerCase());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> page = paged.getPage(1);
|
if (!plugin.al.isAdmin(player))
|
||||||
for (String entries : page)
|
|
||||||
{
|
{
|
||||||
player.sendMessage(entries);
|
cooldown.put(player.getName(), System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage("Page 1/" + paged.getPageCount() + " | To index through the pages, type " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "/ins history <page>");
|
if (lookup != null)
|
||||||
|
{
|
||||||
|
if (lookup.isEmpty())
|
||||||
|
{
|
||||||
|
player.sendMessage(net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector " + ChatColor.WHITE + "- " + "No block data found for this location");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
HISTORY_MAP.remove(event.getPlayer());
|
||||||
|
HISTORY_MAP.put(event.getPlayer(), new FUtil.PaginationList<>(10));
|
||||||
|
FUtil.PaginationList<String> paged = HISTORY_MAP.get(event.getPlayer());
|
||||||
|
|
||||||
|
player.sendMessage("---- " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector" + ChatColor.WHITE + " ---- " +
|
||||||
|
ChatColor.GRAY + "(x" + block.getX() + "/" + "y" + block.getY() + "/" + "z" + block.getZ() + ")");
|
||||||
|
|
||||||
|
for (String[] value : lookup)
|
||||||
|
{
|
||||||
|
CoreProtectAPI.ParseResult result = coreProtect.parseResult(value);
|
||||||
|
BlockData bl = result.getBlockData();
|
||||||
|
|
||||||
|
String s;
|
||||||
|
String st = "";
|
||||||
|
|
||||||
|
if (result.getActionString().equals("Placement"))
|
||||||
|
{
|
||||||
|
s = " placed ";
|
||||||
|
}
|
||||||
|
else if (result.getActionString().equals("Removal"))
|
||||||
|
{
|
||||||
|
s = " broke ";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
s = " interacted with ";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.isRolledBack())
|
||||||
|
{
|
||||||
|
st += "§m";
|
||||||
|
}
|
||||||
|
|
||||||
|
int time = (int)(System.currentTimeMillis() / 1000L);
|
||||||
|
|
||||||
|
paged.add(ChatColor.GRAY + getTimeAgo(result.getTime(), time) + ChatColor.WHITE + " - " + net.md_5.bungee.api.ChatColor.of("#30ade4") +
|
||||||
|
st + result.getPlayer() + ChatColor.WHITE + st + s + net.md_5.bungee.api.ChatColor.of("#30ade4") + st + bl.getMaterial().toString().toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> page = paged.getPage(1);
|
||||||
|
for (String entries : page)
|
||||||
|
{
|
||||||
|
player.sendMessage(entries);
|
||||||
|
}
|
||||||
|
|
||||||
|
player.sendMessage("Page 1/" + paged.getPageCount() + " | To index through the pages, type " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "/ins history <page>");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
|
import org.bukkit.command.Command;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@CommandPermissions(level = Rank.NON_OP, source = SourceType.ONLY_IN_GAME)
|
||||||
|
@CommandParameters(description = "Go to the Floatlands (not to be confused with the Flatlands).", usage = "/<command>", aliases = "void")
|
||||||
|
public class Command_floatlands extends FreedomCommand
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
|
{
|
||||||
|
plugin.wm.floatlands.sendToWorld(playerSender);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
@ -40,6 +40,11 @@ public class CleanroomChunkGenerator extends ChunkGenerator
|
|||||||
}
|
}
|
||||||
|
|
||||||
public CleanroomChunkGenerator(String id)
|
public CleanroomChunkGenerator(String id)
|
||||||
|
{
|
||||||
|
this(id, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CleanroomChunkGenerator(String id, boolean generateBedrock)
|
||||||
{
|
{
|
||||||
if (id != null)
|
if (id != null)
|
||||||
{
|
{
|
||||||
@ -48,7 +53,11 @@ public class CleanroomChunkGenerator extends ChunkGenerator
|
|||||||
int y = 0;
|
int y = 0;
|
||||||
|
|
||||||
materials = new Material[128]; // Default to 128, will be resized later if required
|
materials = new Material[128]; // Default to 128, will be resized later if required
|
||||||
materials[y++] = Material.BEDROCK;
|
|
||||||
|
if (generateBedrock)
|
||||||
|
{
|
||||||
|
materials[y++] = Material.BEDROCK;
|
||||||
|
}
|
||||||
|
|
||||||
if (id.length() > 0)
|
if (id.length() > 0)
|
||||||
{
|
{
|
||||||
@ -115,14 +124,24 @@ public class CleanroomChunkGenerator extends ChunkGenerator
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
||||||
materials = new Material[65];
|
materials = new Material[65];
|
||||||
materials[0] = Material.BEDROCK;
|
|
||||||
|
if (generateBedrock)
|
||||||
|
{
|
||||||
|
materials[0] = Material.BEDROCK;
|
||||||
|
}
|
||||||
|
|
||||||
Arrays.fill(materials, 1, 65, Material.STONE);
|
Arrays.fill(materials, 1, 65, Material.STONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
materials = new Material[65];
|
materials = new Material[65];
|
||||||
materials[0] = Material.BEDROCK;
|
|
||||||
|
if (generateBedrock)
|
||||||
|
{
|
||||||
|
materials[0] = Material.BEDROCK;
|
||||||
|
}
|
||||||
|
|
||||||
Arrays.fill(materials, 1, 65, Material.STONE);
|
Arrays.fill(materials, 1, 65, Material.STONE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
package me.totalfreedom.totalfreedommod.world;
|
||||||
|
|
||||||
|
import org.bukkit.*;
|
||||||
|
|
||||||
|
public class Floatlands extends CustomWorld
|
||||||
|
{
|
||||||
|
|
||||||
|
public Floatlands()
|
||||||
|
{
|
||||||
|
super("floatlands");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected World generateWorld()
|
||||||
|
{
|
||||||
|
final WorldCreator worldCreator = new WorldCreator(getName());
|
||||||
|
worldCreator.generateStructures(false);
|
||||||
|
worldCreator.type(WorldType.NORMAL);
|
||||||
|
worldCreator.environment(World.Environment.NORMAL);
|
||||||
|
worldCreator.generator(new CleanroomChunkGenerator("", false));
|
||||||
|
|
||||||
|
final World world = Bukkit.getServer().createWorld(worldCreator);
|
||||||
|
|
||||||
|
assert world != null;
|
||||||
|
world.setSpawnFlags(false, false);
|
||||||
|
world.setSpawnLocation(0, 50, 0);
|
||||||
|
|
||||||
|
plugin.gr.commitGameRules();
|
||||||
|
|
||||||
|
return world;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -20,12 +20,14 @@ public class WorldManager extends FreedomService
|
|||||||
public Flatlands flatlands;
|
public Flatlands flatlands;
|
||||||
public AdminWorld adminworld;
|
public AdminWorld adminworld;
|
||||||
public MasterBuilderWorld masterBuilderWorld;
|
public MasterBuilderWorld masterBuilderWorld;
|
||||||
|
public Floatlands floatlands;
|
||||||
|
|
||||||
public WorldManager()
|
public WorldManager()
|
||||||
{
|
{
|
||||||
this.flatlands = new Flatlands();
|
this.flatlands = new Flatlands();
|
||||||
this.adminworld = new AdminWorld();
|
this.adminworld = new AdminWorld();
|
||||||
this.masterBuilderWorld = new MasterBuilderWorld();
|
this.masterBuilderWorld = new MasterBuilderWorld();
|
||||||
|
this.floatlands = new Floatlands();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -34,6 +36,7 @@ public class WorldManager extends FreedomService
|
|||||||
flatlands.getWorld();
|
flatlands.getWorld();
|
||||||
adminworld.getWorld();
|
adminworld.getWorld();
|
||||||
masterBuilderWorld.getWorld();
|
masterBuilderWorld.getWorld();
|
||||||
|
floatlands.getWorld();
|
||||||
|
|
||||||
// Disable weather
|
// Disable weather
|
||||||
if (ConfigEntry.DISABLE_WEATHER.getBoolean())
|
if (ConfigEntry.DISABLE_WEATHER.getBoolean())
|
||||||
|
Reference in New Issue
Block a user