Skip to content
Open
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
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ git.properties
/dist
/build
manifest.mf
# Now defines that Maven CheckStyle is used
# nb-configuration.xml

# Eclipse excludes
.project
Expand All @@ -21,10 +19,13 @@ manifest.mf
*.iml
*.ipr
*.iws
/.idea
/.idea/libraries/*
/.idea/artifacts/*
.idea/workspace.xml

# Maven excludes
/target
dependency-reduced-pom.xml

# OS generated files
.DS_Store
Expand Down
16 changes: 16 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: java
dist: trusty
jdk:
- oraclejdk8
notifications:
Expand Down
28 changes: 15 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>me.totalfreedom</groupId>
<artifactId>totalfreedom</artifactId>
<version>5.0.1</version>
<version>5.0.2</version>
<packaging>jar</packaging>

<properties>
Expand Down Expand Up @@ -48,8 +48,8 @@
</repository>

<repository>
<id>ess-repo</id>
<url>http://repo.ess3.net/content/groups/essentials</url>
<id>ender-zone</id>
<url>https://ci.ender.zone/plugin/repository/everything/</url>
<releases>
<enabled>true</enabled>
</releases>
Expand Down Expand Up @@ -94,23 +94,17 @@
<version>2.5</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
</dependency>

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<version>1.13-R0.1-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.github.Pravian</groupId>
<artifactId>Aero</artifactId>
<version>a0e1dc5</version>
<version>5f82926ab8</version>
</dependency>

<dependency>
Expand All @@ -121,8 +115,8 @@

<dependency>
<groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId>
<version>2.13.1</version>
<artifactId>EssentialsX</artifactId>
<version>2.16.0</version>
</dependency>

<!-- The following have been changed to Telesphoreo's personal repo as it is the most stable current TF-WorldEdit build. These will be changed to a TotalFreedom build in the future -->
Expand All @@ -139,6 +133,12 @@
<version>7.0.0-TF-SNAPSHOT-R0.2</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.16</version>
</dependency>

</dependencies>

<build>
Expand Down Expand Up @@ -323,6 +323,8 @@
</items>
</configuration>
</plugin>


</plugins>
</build>

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/me/totalfreedom/totalfreedommod/FrontDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ else if (ConfigEntry.ALLOW_FIRE_PLACE.getBoolean())
continue;
}

block.setType(Material.SIGN_POST);
block.setType(Material.SIGN);
org.bukkit.block.Sign sign = (org.bukkit.block.Sign) block.getState();

org.bukkit.material.Sign signData = (org.bukkit.material.Sign) sign.getData();
Expand Down Expand Up @@ -541,7 +541,8 @@ else if (ConfigEntry.ALLOW_FIRE_PLACE.getBoolean())
FUtil.adminAction("FrontDoor", "Caging " + player.getName() + " in PURE_DARTH", true);

Location targetPos = player.getLocation().clone().add(0, 1, 0);
playerdata.getCageData().cage(targetPos, Material.SKULL, Material.AIR);
playerdata.getCageData().cage(targetPos, Material.SKELETON_SKULL, Material.AIR);

break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class ServerInterface extends FreedomService
{

public static final String COMPILE_NMS_VERSION = "v1_12_R1";
public static final String COMPILE_NMS_VERSION = "v1_13_R2";

public ServerInterface(TotalFreedomMod plugin)
{
Expand Down
20 changes: 8 additions & 12 deletions src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import me.totalfreedom.totalfreedommod.fun.Trailer;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import me.totalfreedom.totalfreedommod.admin.AdminList;
Expand All @@ -14,6 +13,7 @@
import me.totalfreedom.totalfreedommod.blocking.MobBlocker;
import me.totalfreedom.totalfreedommod.blocking.PotionBlocker;
import me.totalfreedom.totalfreedommod.blocking.command.CommandBlocker;
import me.totalfreedom.totalfreedommod.blocking.PlayerBlocker;
import me.totalfreedom.totalfreedommod.bridge.BukkitTelnetBridge;
import me.totalfreedom.totalfreedommod.bridge.EssentialsBridge;
import me.totalfreedom.totalfreedommod.bridge.LibsDisguisesBridge;
Expand All @@ -33,13 +33,14 @@
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil;
import me.totalfreedom.totalfreedommod.util.MethodTimer;
import me.totalfreedom.totalfreedommod.util.Metrics;
import me.totalfreedom.totalfreedommod.world.WorldManager;
import net.pravian.aero.component.service.ServiceManager;
import net.pravian.aero.plugin.AeroPlugin;
import org.bukkit.Bukkit;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.mcstats.Metrics;


public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
{
Expand Down Expand Up @@ -97,6 +98,7 @@ public class TotalFreedomMod extends AeroPlugin<TotalFreedomMod>
public Jumppads jp;
public Trailer tr;
public HTTPDaemon hd;
public PlayerBlocker plb;
//
// Bridges
public ServiceManager<TotalFreedomMod> bridges;
Expand Down Expand Up @@ -197,6 +199,8 @@ public void enable()

// HTTPD
hd = services.registerService(HTTPDaemon.class);
plb = services.registerService(PlayerBlocker.class);
// Start Services
services.start();

// Start bridges
Expand All @@ -210,16 +214,8 @@ public void enable()
timer.update();
FLog.info("Version " + pluginVersion + " for " + ServerInterface.COMPILE_NMS_VERSION + " enabled in " + timer.getTotal() + "ms");

// Metrics @ http://mcstats.org/plugin/TotalFreedomMod
try
{
final Metrics metrics = new Metrics(plugin);
metrics.start();
}
catch (IOException ex)
{
FLog.warning("Failed to submit metrics data: " + ex.getMessage());
}
//BStats Metrics
Metrics metrics = new Metrics(this);

// Add spawnpoints later - https://github.com/TotalFreedom/TotalFreedomMod/issues/438
new BukkitRunnable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public void onBlockPlace(BlockPlaceEvent event)
switch (event.getBlockPlaced().getType())
{
case LAVA:
case STATIONARY_LAVA:
{
if (ConfigEntry.ALLOW_LAVA_PLACE.getBoolean())
{
Expand All @@ -57,7 +56,6 @@ public void onBlockPlace(BlockPlaceEvent event)
break;
}
case WATER:
case STATIONARY_WATER:
{
if (ConfigEntry.ALLOW_WATER_PLACE.getBoolean())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private void handleRightClick(PlayerInteractEvent event)
break;
}

case EXPLOSIVE_MINECART:
case TNT_MINECART:
{
if (ConfigEntry.ALLOW_TNT_MINECARTS.getBoolean())
{
Expand All @@ -97,7 +97,6 @@ private void handleRightClick(PlayerInteractEvent event)
}

case SIGN:
case SIGN_POST:
case WALL_SIGN:
{
player.sendMessage(ChatColor.GRAY + "Sign interaction is currently disabled.");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package me.totalfreedom.totalfreedommod.blocking;

import com.google.common.collect.Lists;
import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
import me.totalfreedom.totalfreedommod.util.FLog;
import me.totalfreedom.totalfreedommod.util.FUtil;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.inventory.ItemStack;

import java.util.Collection;
import java.util.List;

public class PlayerBlocker extends FreedomService
{

public static final List<String> blockedTags = Lists.newArrayList();

public PlayerBlocker(TotalFreedomMod plugin)
{
super(plugin);
}

@Override
protected void onStart()
{
// Load banned tags
blockedTags.clear();
blockedTags.addAll((Collection<? extends String>) ConfigEntry.BLOCKED_TAGS.getList());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need a separate service for loading this list. Especially since we're never adding to it. You can simply use ConfigEntry.BLOCKED_TAGS.getList() anywhere you need it. Lookup should be pretty fast and without I/O.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going to go and facepalm. Apparently I decided over-engineering it was the best way. Thanks for the heads up, I'll make appropriate changes.

FLog.info("Loaded " + blockedTags.size() + " banned tags.");
}

@Override
protected void onStop()
{
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static void generateHollowCube(Location location, int length, Material ma

final Block block = center.getRelative(xOffset, yOffset, zOffset);

if (material != Material.SKULL)
if (material != Material.SKELETON_SKULL)
{
// Glowstone light
if (material != Material.GLASS && xOffset == 0 && yOffset == 2 && zOffset == 0)
Expand All @@ -184,7 +184,7 @@ public static void generateHollowCube(Location location, int length, Material ma
continue;
}

block.setType(Material.SKULL);
block.setType(Material.SKELETON_SKULL);
final Skull skull = (Skull) block.getState();
skull.setSkullType(SkullType.PLAYER);
skull.setOwner("Prozza");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ else if ("purge".equals(args[0]))
{
if ("darth".equalsIgnoreCase(args[1]))
{
outerMaterial = Material.SKULL;
outerMaterial = Material.SKELETON_SKULL;
}
else if (Material.matchMaterial(args[1]) != null)
{
Expand All @@ -79,24 +79,12 @@ else if (Material.matchMaterial(args[1]) != null)
}
}

if (args.length >= 3)
{
if (args[2].equalsIgnoreCase("water"))
{
innerMaterial = Material.STATIONARY_WATER;
}
else if (args[2].equalsIgnoreCase("lava"))
{
innerMaterial = Material.STATIONARY_LAVA;
}
}

Location targetPos = player.getLocation().clone().add(0, 1, 0);
playerdata.getCageData().cage(targetPos, outerMaterial, innerMaterial);

player.setGameMode(GameMode.SURVIVAL);

if (outerMaterial != Material.SKULL)
if (outerMaterial != Material.SKELETON_SKULL)
{
FUtil.adminAction(sender.getName(), "Caging " + player.getName(), true);
}
Expand Down
Loading