mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Renamed classes for standardization.
This commit is contained in:
parent
ff88c7bffe
commit
36e7de0a08
@ -13,12 +13,12 @@ import org.bukkit.event.block.BlockListener;
|
|||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class TotalFreedomModBlockListener extends BlockListener
|
public class TFM_BlockListener extends BlockListener
|
||||||
{
|
{
|
||||||
public static TotalFreedomMod plugin;
|
public static TotalFreedomMod plugin;
|
||||||
private static final Logger log = Logger.getLogger("Minecraft");
|
private static final Logger log = Logger.getLogger("Minecraft");
|
||||||
|
|
||||||
TotalFreedomModBlockListener(TotalFreedomMod instance)
|
TFM_BlockListener(TotalFreedomMod instance)
|
||||||
{
|
{
|
||||||
plugin = instance;
|
plugin = instance;
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ public class TotalFreedomModBlockListener extends BlockListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TFUserInfo playerdata = (TFUserInfo) plugin.userinfo.get(p);
|
TFM_UserInfo playerdata = (TFM_UserInfo) plugin.userinfo.get(p);
|
||||||
if (playerdata != null)
|
if (playerdata != null)
|
||||||
{
|
{
|
||||||
playerdata.incrementBlockDestroyCount();
|
playerdata.incrementBlockDestroyCount();
|
||||||
@ -86,7 +86,7 @@ public class TotalFreedomModBlockListener extends BlockListener
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerdata = new TFUserInfo();
|
playerdata = new TFM_UserInfo();
|
||||||
playerdata.incrementBlockDestroyCount();
|
playerdata.incrementBlockDestroyCount();
|
||||||
plugin.userinfo.put(p, playerdata);
|
plugin.userinfo.put(p, playerdata);
|
||||||
}
|
}
|
@ -7,11 +7,11 @@ import org.bukkit.event.entity.EntityExplodeEvent;
|
|||||||
import org.bukkit.event.entity.EntityListener;
|
import org.bukkit.event.entity.EntityListener;
|
||||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||||
|
|
||||||
public class TotalFreedomModEntityListener extends EntityListener
|
public class TFM_EntityListener extends EntityListener
|
||||||
{
|
{
|
||||||
public static TotalFreedomMod plugin;
|
public static TotalFreedomMod plugin;
|
||||||
|
|
||||||
TotalFreedomModEntityListener(TotalFreedomMod instance)
|
TFM_EntityListener(TotalFreedomMod instance)
|
||||||
{
|
{
|
||||||
plugin = instance;
|
plugin = instance;
|
||||||
}
|
}
|
@ -13,12 +13,12 @@ import org.bukkit.event.player.PlayerListener;
|
|||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
class TotalFreedomModPlayerListener extends PlayerListener
|
class TFM_PlayerListener extends PlayerListener
|
||||||
{
|
{
|
||||||
public static TotalFreedomMod plugin;
|
public static TotalFreedomMod plugin;
|
||||||
private static final Logger log = Logger.getLogger("Minecraft");
|
private static final Logger log = Logger.getLogger("Minecraft");
|
||||||
|
|
||||||
TotalFreedomModPlayerListener(TotalFreedomMod instance)
|
TFM_PlayerListener(TotalFreedomMod instance)
|
||||||
{
|
{
|
||||||
plugin = instance;
|
plugin = instance;
|
||||||
}
|
}
|
||||||
@ -74,7 +74,7 @@ class TotalFreedomModPlayerListener extends PlayerListener
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TFUserInfo playerdata = (TFUserInfo) plugin.userinfo.get(p);
|
TFM_UserInfo playerdata = (TFM_UserInfo) plugin.userinfo.get(p);
|
||||||
if (playerdata != null)
|
if (playerdata != null)
|
||||||
{
|
{
|
||||||
if (playerdata.isFrozen())
|
if (playerdata.isFrozen())
|
||||||
@ -107,7 +107,7 @@ class TotalFreedomModPlayerListener extends PlayerListener
|
|||||||
{
|
{
|
||||||
Player p = event.getPlayer();
|
Player p = event.getPlayer();
|
||||||
|
|
||||||
TFUserInfo playerdata = (TFUserInfo) plugin.userinfo.get(p);
|
TFM_UserInfo playerdata = (TFM_UserInfo) plugin.userinfo.get(p);
|
||||||
if (playerdata != null)
|
if (playerdata != null)
|
||||||
{
|
{
|
||||||
playerdata.incrementMsgCount();
|
playerdata.incrementMsgCount();
|
||||||
@ -124,7 +124,7 @@ class TotalFreedomModPlayerListener extends PlayerListener
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerdata = new TFUserInfo();
|
playerdata = new TFM_UserInfo();
|
||||||
playerdata.incrementMsgCount();
|
playerdata.incrementMsgCount();
|
||||||
plugin.userinfo.put(p, playerdata);
|
plugin.userinfo.put(p, playerdata);
|
||||||
}
|
}
|
@ -4,25 +4,25 @@ import java.util.Comparator;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class RadarData implements Comparator<RadarData>
|
public class TFM_RadarData implements Comparator<TFM_RadarData>
|
||||||
{
|
{
|
||||||
Player player;
|
Player player;
|
||||||
double distance;
|
double distance;
|
||||||
Location location;
|
Location location;
|
||||||
|
|
||||||
public RadarData(Player inplayer, double indistance, Location inlocation)
|
public TFM_RadarData(Player inplayer, double indistance, Location inlocation)
|
||||||
{
|
{
|
||||||
this.player = inplayer;
|
this.player = inplayer;
|
||||||
this.distance = indistance;
|
this.distance = indistance;
|
||||||
this.location = inlocation;
|
this.location = inlocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RadarData()
|
public TFM_RadarData()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare(RadarData t1, RadarData t2)
|
public int compare(TFM_RadarData t1, TFM_RadarData t2)
|
||||||
{
|
{
|
||||||
if (t1.distance > t2.distance)
|
if (t1.distance > t2.distance)
|
||||||
{
|
{
|
@ -1,12 +1,12 @@
|
|||||||
package me.StevenLawson.TotalFreedomMod;
|
package me.StevenLawson.TotalFreedomMod;
|
||||||
|
|
||||||
public class TFUserInfo
|
public class TFM_UserInfo
|
||||||
{
|
{
|
||||||
private boolean user_frozen = false;
|
private boolean user_frozen = false;
|
||||||
private int msg_count = 0;
|
private int msg_count = 0;
|
||||||
private int bd_count = 0;
|
private int bd_count = 0;
|
||||||
|
|
||||||
public TFUserInfo()
|
public TFM_UserInfo()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
@ -29,9 +29,9 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
{
|
{
|
||||||
public TotalFreedomMod tfm = this;
|
public TotalFreedomMod tfm = this;
|
||||||
|
|
||||||
private final TotalFreedomModEntityListener entityListener = new TotalFreedomModEntityListener(this);
|
private final TFM_EntityListener entityListener = new TFM_EntityListener(this);
|
||||||
private final TotalFreedomModBlockListener blockListener = new TotalFreedomModBlockListener(this);
|
private final TFM_BlockListener blockListener = new TFM_BlockListener(this);
|
||||||
private final TotalFreedomModPlayerListener playerListener = new TotalFreedomModPlayerListener(this);
|
private final TFM_PlayerListener playerListener = new TFM_PlayerListener(this);
|
||||||
|
|
||||||
private static final Logger log = Logger.getLogger("Minecraft");
|
private static final Logger log = Logger.getLogger("Minecraft");
|
||||||
|
|
||||||
@ -775,17 +775,17 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
Location sender_pos = sender_player.getLocation();
|
Location sender_pos = sender_player.getLocation();
|
||||||
String sender_world = sender_player.getWorld().getName();
|
String sender_world = sender_player.getWorld().getName();
|
||||||
|
|
||||||
List<RadarData> radar_data = new ArrayList<RadarData>();
|
List<TFM_RadarData> radar_data = new ArrayList<TFM_RadarData>();
|
||||||
|
|
||||||
for (Player p : Bukkit.getOnlinePlayers())
|
for (Player p : Bukkit.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
if (sender_world.equals(p.getWorld().getName()) && !p.getName().equals(sender.getName()))
|
if (sender_world.equals(p.getWorld().getName()) && !p.getName().equals(sender.getName()))
|
||||||
{
|
{
|
||||||
radar_data.add(new RadarData(p, sender_pos.distance(p.getLocation()), p.getLocation()));
|
radar_data.add(new TFM_RadarData(p, sender_pos.distance(p.getLocation()), p.getLocation()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Collections.sort(radar_data, new RadarData());
|
Collections.sort(radar_data, new TFM_RadarData());
|
||||||
|
|
||||||
sender.sendMessage(ChatColor.YELLOW + "People nearby in " + sender_world + ":");
|
sender.sendMessage(ChatColor.YELLOW + "People nearby in " + sender_world + ":");
|
||||||
|
|
||||||
@ -796,7 +796,7 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (RadarData i : radar_data)
|
for (TFM_RadarData i : radar_data)
|
||||||
{
|
{
|
||||||
if (count++ > countmax)
|
if (count++ > countmax)
|
||||||
{
|
{
|
||||||
@ -952,14 +952,14 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
}
|
}
|
||||||
else if (mode.equals("fr"))
|
else if (mode.equals("fr"))
|
||||||
{
|
{
|
||||||
TFUserInfo playerdata = (TFUserInfo) this.userinfo.get(p);
|
TFM_UserInfo playerdata = (TFM_UserInfo) this.userinfo.get(p);
|
||||||
if (playerdata != null)
|
if (playerdata != null)
|
||||||
{
|
{
|
||||||
playerdata.setFrozen(!playerdata.isFrozen());
|
playerdata.setFrozen(!playerdata.isFrozen());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerdata = new TFUserInfo();
|
playerdata = new TFM_UserInfo();
|
||||||
playerdata.setFrozen(true);
|
playerdata.setFrozen(true);
|
||||||
this.userinfo.put(p, playerdata);
|
this.userinfo.put(p, playerdata);
|
||||||
}
|
}
|
||||||
@ -1024,14 +1024,14 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
p = matches.get(0);
|
p = matches.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
TFUserInfo playerdata = (TFUserInfo) this.userinfo.get(p);
|
TFM_UserInfo playerdata = (TFM_UserInfo) this.userinfo.get(p);
|
||||||
if (playerdata != null)
|
if (playerdata != null)
|
||||||
{
|
{
|
||||||
playerdata.setFrozen(!playerdata.isFrozen());
|
playerdata.setFrozen(!playerdata.isFrozen());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
playerdata = new TFUserInfo();
|
playerdata = new TFM_UserInfo();
|
||||||
playerdata.setFrozen(true);
|
playerdata.setFrozen(true);
|
||||||
this.userinfo.put(p, playerdata);
|
this.userinfo.put(p, playerdata);
|
||||||
}
|
}
|
||||||
@ -1218,7 +1218,7 @@ public class TotalFreedomMod extends JavaPlugin
|
|||||||
{
|
{
|
||||||
for (Player p : Bukkit.getOnlinePlayers())
|
for (Player p : Bukkit.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
TFUserInfo playerdata = (TFUserInfo) this.userinfo.get(p);
|
TFM_UserInfo playerdata = (TFM_UserInfo) this.userinfo.get(p);
|
||||||
if (playerdata != null)
|
if (playerdata != null)
|
||||||
{
|
{
|
||||||
playerdata.resetMsgCount();
|
playerdata.resetMsgCount();
|
||||||
|
Loading…
Reference in New Issue
Block a user