Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TFM-2062 #9

Open
wants to merge 24 commits into
base: TFM1.12-Alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4b302dc
Added invsee command
commodore64x Jun 10, 2017
6c5f049
Added Vanish Command
commodore64x Jun 10, 2017
6423600
Added vanish and invsee variables
commodore64x Jun 10, 2017
b680341
Added in methods and events to handle vanish and invsee
commodore64x Jun 10, 2017
fbcc65e
Update /list to hide vanished users
commodore64x Jun 10, 2017
ef7588d
Take 2
commodore64x Jun 10, 2017
85005aa
Removed aliases
commodore64x Jun 10, 2017
3563758
Remove aliases
commodore64x Jun 10, 2017
1afee27
Removed Invsee and Vanish Listeners
commodore64x Jun 10, 2017
7244e65
New file just for Vanish listeners
commodore64x Jun 10, 2017
c214748
Invsee listener file
commodore64x Jun 10, 2017
28fdc20
Added services to TFM
commodore64x Jun 10, 2017
8b2ef40
Removed Whitespacing
commodore64x Jun 10, 2017
7734ee7
Removed whitespacing
commodore64x Jun 10, 2017
48f0f4d
Now sets you to spectator
commodore64x Jun 10, 2017
a60404c
Remove change of gamemode
commodore64x Jun 17, 2017
eef25c2
Vanished users no longer display in radar
commodore64x Jul 17, 2017
ab12add
Fixed import error
commodore64x Jul 26, 2017
19bace7
Frontdoor IP update (#2064)
Jun 30, 2017
61d0c29
Increased text limit. Resolves #1941 (#2039)
Wild1145 Jun 30, 2017
1735810
Update /smite (#2009)
Jun 30, 2017
ecfc731
Corrected player message for /disguisetoggle. Resolves #1872 (#2042)
Wild1145 Jun 30, 2017
67600fd
Added a catch for if a player is caged and kicked. Resolves #1789 (#2…
Wild1145 Jun 30, 2017
cec8e25
Wild's changes (#2)
commodore64x Aug 5, 2017
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
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
language: java
jdk:
- oraclejdk8
notifications:
email: false
addons:
apt:
packages:
- sshpass
script: mvn clean install
after_success:
- ./travis-upload.sh
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TotalFreedomMod #

[![Build Status](https://travis-ci.org/TotalFreedom/TotalFreedomMod.svg?branch=devel)](https://travis-ci.org/TotalFreedom/TotalFreedomMod)

TotalFreedomMod is a CraftBukkit server plugin designed primarily to support the [Official TotalFreedom Minecraft Server](http://totalfreedom.me/). However, you are more than welcome to adapt the source for your own server.

This plugin was originally coded by StevenLawson (Madgeek1450), with Jerom van der Sar (Prozza) becoming heavily involved in its development some time later. It consists of over 85 custom coded commands and a large variety of distinguishable features not included in any other plugin. The plugin has since its beginning grown immensely. Together, with the main TotalFreedom server, TotalFreedomMod has a long-standing reputation of effectiveness whilst maintaining a clear feeling of openness towards the administrators and the players themselves.
Expand Down
82 changes: 49 additions & 33 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tfm.build.version>${project.version}</tfm.build.version>
<tfm.build.codename>Electrum</tfm.build.codename>
<tfm.build.number>${maven.buildnumber}</tfm.build.number>
<!-- <tfm.build.number>${maven.buildnumber}</tfm.build.number> -->
<tfm.build.date>${maven.build.timestamp}</tfm.build.date>
<tfm.build.author>${buildAuthor}</tfm.build.author>
<tfm.build.head>${buildHead}</tfm.build.head>
Expand Down Expand Up @@ -43,67 +43,83 @@

<repositories>
<repository>
<id>spigot</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
<id>ess-repo</id>
<url>http://repo.ess3.net</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<!-- <repository>
<id>elmakers-repo</id>
<url>http://maven.elmakers.com/repository/</url>
</repository>-->
<repository>
<id>sk89q-snapshots</id>
<url>http://maven.sk89q.com/artifactory/repo</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.6</version>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
</dependency>

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

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-server</artifactId>
<version>1.12</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Spigot-1.12.jar</systemPath>
<artifactId>spigot-api</artifactId>
<version>1.12-pre5-SNAPSHOT</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>net.pravian</groupId>
<artifactId>aero</artifactId>
<version>2.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/Aero-2.0.jar</systemPath>
<groupId>com.github.Pravian</groupId>
<artifactId>Aero</artifactId>
<version>a0e1dc5</version>
</dependency>

<dependency>
<groupId>net.totalfreedom</groupId>
<artifactId>bukkittelnet</artifactId>
<version>4.2</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/BukkitTelnet-4.3.jar</systemPath>
<groupId>com.github.TotalFreedom</groupId>
<artifactId>BukkitTelnet</artifactId>
<version>4.5-pre1</version>
</dependency>

<dependency>
<groupId>net.totalfreedom</groupId>
<artifactId>tf-worldedit</artifactId>
<version>6.1.0-TF</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/TF-WorldEdit-6.1.1.jar</systemPath>
<groupId>net.ess3</groupId>
<artifactId>Essentials</artifactId>
<version>2.13.1</version>
</dependency>

<dependency>
<groupId>net.totalfreedom</groupId>
<artifactId>tf-essentials</artifactId>
<version>2.0-TF</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/TF-Essentials-2.1.jar</systemPath>
<groupId>com.github.TotalFreedom.TF-WorldEdit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>6.1.0-TF</version>
</dependency>

<dependency>
<groupId>me.libaryaddict.disguise</groupId>
<artifactId>LibsDisguises</artifactId>
<version>9.0.9</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/LibsDisguises-9.0.9.jar</systemPath>
<groupId>com.github.TotalFreedom.TF-WorldEdit</groupId>
<artifactId>worldedit-core</artifactId>
<version>6.1.0-TF</version>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ private void handleChatEvent(AsyncPlayerChatEvent event)
// Strip color from messages
message = ChatColor.stripColor(message);

// Truncate messages that are too long - 100 characters is vanilla client max
if (message.length() > 100)
// Truncate messages that are too long - 256 characters is vanilla client max
if (message.length() > 256)
{
message = message.substring(0, 100);
message = message.substring(0, 256);
FSync.playerMsg(player, "Message was shortened because it was too long to send.");
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/me/totalfreedom/totalfreedommod/FrontDoor.java
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public void run()
case 3: // Displays a message
{
FUtil.bcastMsg("TotalFreedom rocks!!", ChatColor.BLUE);
FUtil.bcastMsg("To join this great server, join " + ChatColor.GOLD + "tf.sauc.in", ChatColor.BLUE);
FUtil.bcastMsg("To join this great server, join " + ChatColor.GOLD + "play.totalfreedom.me", ChatColor.BLUE);
break;
}

Expand Down Expand Up @@ -472,7 +472,7 @@ else if (ConfigEntry.ALLOW_FIRE_PLACE.getBoolean())
sign.setLine(0, ChatColor.BLUE + "TotalFreedom");
sign.setLine(1, ChatColor.DARK_GREEN + "is");
sign.setLine(2, ChatColor.YELLOW + "Awesome!");
sign.setLine(3, ChatColor.DARK_GRAY + "tf.sauc.in");
sign.setLine(3, ChatColor.DARK_GRAY + "play.totalfreedom.me");
sign.update();
}
break;
Expand Down Expand Up @@ -501,7 +501,7 @@ else if (ConfigEntry.ALLOW_FIRE_PLACE.getBoolean())
ChatColor.DARK_GREEN + "Why you should go to TotalFreedom instead\n"
+ ChatColor.DARK_GRAY + "---------\n"
+ ChatColor.BLACK + "TotalFreedom is the original TotalFreedomMod server. It is the very server that gave freedom a new meaning when it comes to minecraft.\n"
+ ChatColor.BLUE + "Join now! " + ChatColor.RED + "tf.sauc.in");
+ ChatColor.BLUE + "Join now! " + ChatColor.RED + "play.totalfreedom.me");
bookStack.setItemMeta(book);

for (Player player : Bukkit.getOnlinePlayers())
Expand Down
106 changes: 106 additions & 0 deletions src/main/java/me/totalfreedom/totalfreedommod/Invsee.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package me.totalfreedom.totalfreedommod;

import me.totalfreedom.totalfreedommod.player.FPlayer;
import me.totalfreedom.totalfreedommod.rank.Rank;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.scheduler.BukkitRunnable;

public class Invsee extends FreedomService
{

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

@Override
protected void onStart()
{

}

@Override
protected void onStop()
{

}

@EventHandler(priority = EventPriority.MONITOR)
public void onInventoryClickEvent(final InventoryClickEvent event)
{
Player refreshPlayer = null;
final Inventory top = event.getView().getTopInventory();
final InventoryType type = top.getType();
final Player playerdata = (Player) event.getWhoClicked();
FPlayer fPlayer = plugin.pl.getPlayer(playerdata);
if (type == InventoryType.PLAYER && fPlayer.isInvsee())
{
final InventoryHolder invHolder = top.getHolder();
if (invHolder != null && invHolder instanceof HumanEntity)
{
final Player invOwner = (Player) invHolder;
final Rank recieverRank = plugin.rm.getRank(playerdata);
final Rank playerRank = plugin.rm.getRank(invOwner);
if (playerRank.ordinal() >= recieverRank.ordinal() || !(invOwner.isOnline()))
{
event.setCancelled(true);
refreshPlayer = playerdata;
}
}
}

if (refreshPlayer != null)
{
final Player player = refreshPlayer;
new BukkitRunnable()
{

@Override
public void run()
{
player.updateInventory();
}

}.runTaskLater(this.plugin, 20);
}
}

@EventHandler(priority = EventPriority.MONITOR)
public void onInventoryCloseEvent(final InventoryCloseEvent event)
{
Player refreshPlayer = null;
final Inventory top = event.getView().getTopInventory();
final InventoryType type = top.getType();
final Player playerdata = (Player) event.getPlayer();
FPlayer fPlayer = plugin.pl.getPlayer(playerdata);
if (type == InventoryType.PLAYER && fPlayer.isInvsee())
{
fPlayer.setInvsee(false);
refreshPlayer = playerdata;
}

if (refreshPlayer != null)
{
final Player player = refreshPlayer;
new BukkitRunnable()
{

@Override
public void run()
{
player.updateInventory();
}

}.runTaskLater(this.plugin, 20);
}
}

}
Loading