mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-11 11:49:12 +00:00
Minor cleanup
This commit is contained in:
parent
f1930e76d6
commit
f2b4bb00b6
8 changed files with 18 additions and 24 deletions
|
@ -269,11 +269,11 @@ public final class DescParseTickFormat
|
||||||
|
|
||||||
// How many ingame days have passed since the server start?
|
// How many ingame days have passed since the server start?
|
||||||
final long days = ticks / ticksPerDay;
|
final long days = ticks / ticksPerDay;
|
||||||
ticks = ticks - days * ticksPerDay;
|
ticks -= days * ticksPerDay;
|
||||||
|
|
||||||
// How many hours on the last day?
|
// How many hours on the last day?
|
||||||
final long hours = ticks / ticksPerHour;
|
final long hours = ticks / ticksPerHour;
|
||||||
ticks = ticks - hours * ticksPerHour;
|
ticks -= hours * ticksPerHour;
|
||||||
|
|
||||||
// How many minutes on the last day?
|
// How many minutes on the last day?
|
||||||
final long minutes = (long)Math.floor(ticks / ticksPerMinute);
|
final long minutes = (long)Math.floor(ticks / ticksPerMinute);
|
||||||
|
|
|
@ -143,7 +143,7 @@ public class I18n implements II18n
|
||||||
{
|
{
|
||||||
private final transient File dataFolder;
|
private final transient File dataFolder;
|
||||||
|
|
||||||
public FileResClassLoader(final ClassLoader classLoader, final IEssentials ess)
|
FileResClassLoader(final ClassLoader classLoader, final IEssentials ess)
|
||||||
{
|
{
|
||||||
super(classLoader);
|
super(classLoader);
|
||||||
this.dataFolder = ess.getDataFolder();
|
this.dataFolder = ess.getDataFolder();
|
||||||
|
|
|
@ -21,13 +21,13 @@ public class Teleport implements Runnable, ITeleport
|
||||||
private final Location location;
|
private final Location location;
|
||||||
private final String name;
|
private final String name;
|
||||||
|
|
||||||
public Target(Location location)
|
Target(Location location)
|
||||||
{
|
{
|
||||||
this.location = location;
|
this.location = location;
|
||||||
this.name = null;
|
this.name = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Target(Player entity)
|
Target(Player entity)
|
||||||
{
|
{
|
||||||
this.name = entity.getName();
|
this.name = entity.getName();
|
||||||
this.location = null;
|
this.location = null;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.earth2me.essentials.perm;
|
package com.earth2me.essentials.perm;
|
||||||
|
|
||||||
import com.earth2me.essentials.IEssentials;
|
import com.earth2me.essentials.IEssentials;
|
||||||
import java.util.List;
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
|
|
|
@ -440,7 +440,7 @@ public class EssentialsSign
|
||||||
private final transient Block block;
|
private final transient Block block;
|
||||||
private final transient Sign sign;
|
private final transient Sign sign;
|
||||||
|
|
||||||
public EventSign(final SignChangeEvent event)
|
EventSign(final SignChangeEvent event)
|
||||||
{
|
{
|
||||||
this.event = event;
|
this.event = event;
|
||||||
this.block = event.getBlock();
|
this.block = event.getBlock();
|
||||||
|
@ -480,7 +480,7 @@ public class EssentialsSign
|
||||||
private final transient Sign sign;
|
private final transient Sign sign;
|
||||||
private final transient Block block;
|
private final transient Block block;
|
||||||
|
|
||||||
public BlockSign(final Block block)
|
BlockSign(final Block block)
|
||||||
{
|
{
|
||||||
this.block = block;
|
this.block = block;
|
||||||
this.sign = (Sign)block.getState();
|
this.sign = (Sign)block.getState();
|
||||||
|
|
|
@ -89,7 +89,7 @@ public abstract class AsyncStorageObjectHolder<T extends StorageObject> implemen
|
||||||
|
|
||||||
private class StorageObjectDataWriter extends AbstractDelayedYamlFileWriter
|
private class StorageObjectDataWriter extends AbstractDelayedYamlFileWriter
|
||||||
{
|
{
|
||||||
public StorageObjectDataWriter()
|
StorageObjectDataWriter()
|
||||||
{
|
{
|
||||||
super(ess, getStorageFile());
|
super(ess, getStorageFile());
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ public abstract class AsyncStorageObjectHolder<T extends StorageObject> implemen
|
||||||
|
|
||||||
private class StorageObjectDataReader extends AbstractDelayedYamlFileReader<T>
|
private class StorageObjectDataReader extends AbstractDelayedYamlFileReader<T>
|
||||||
{
|
{
|
||||||
public StorageObjectDataReader()
|
StorageObjectDataReader()
|
||||||
{
|
{
|
||||||
super(ess, getStorageFile(), clazz);
|
super(ess, getStorageFile(), clazz);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
package com.earth2me.essentials.textreader;
|
package com.earth2me.essentials.textreader;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
public class SimpleTextInput implements IText
|
public class SimpleTextInput implements IText
|
||||||
|
@ -11,9 +8,7 @@ public class SimpleTextInput implements IText
|
||||||
private final transient List<String> lines = new ArrayList<String>();
|
private final transient List<String> lines = new ArrayList<String>();
|
||||||
|
|
||||||
public SimpleTextInput (final String input) {
|
public SimpleTextInput (final String input) {
|
||||||
for (String line : input.split("\\n")) {
|
lines.addAll(Arrays.asList(input.split("\\n")));
|
||||||
lines.add(line);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class EssentialsAntiBuildListener implements Listener
|
||||||
this.ess = prot.getEssentialsConnect().getEssentials();
|
this.ess = prot.getEssentialsConnect().getEssentials();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean metaPermCheck(User user, String action, Block block)
|
private boolean metaPermCheck(final User user, final String action, final Block block)
|
||||||
{
|
{
|
||||||
if (block == null)
|
if (block == null)
|
||||||
{
|
{
|
||||||
|
@ -41,13 +41,13 @@ public class EssentialsAntiBuildListener implements Listener
|
||||||
return metaPermCheck(user, action, block.getTypeId(), block.getData());
|
return metaPermCheck(user, action, block.getTypeId(), block.getData());
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean metaPermCheck(User user, String action, int blockId)
|
private boolean metaPermCheck(final User user, final String action, final int blockId)
|
||||||
{
|
{
|
||||||
final String blockPerm = "essentials.build." + action + "." + blockId;
|
final String blockPerm = "essentials.build." + action + "." + blockId;
|
||||||
return user.isAuthorized(blockPerm);
|
return user.isAuthorized(blockPerm);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean metaPermCheck(User user, String action, int blockId, byte data)
|
private boolean metaPermCheck(final User user, final String action, final int blockId, final byte data)
|
||||||
{
|
{
|
||||||
final String blockPerm = "essentials.build." + action + "." + blockId;
|
final String blockPerm = "essentials.build." + action + "." + blockId;
|
||||||
final String dataPerm = blockPerm + ":" + data;
|
final String dataPerm = blockPerm + ":" + data;
|
||||||
|
@ -141,7 +141,7 @@ public class EssentialsAntiBuildListener implements Listener
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onPaintingBreak(PaintingBreakByEntityEvent event)
|
public void onPaintingBreak(final PaintingBreakByEntityEvent event)
|
||||||
{
|
{
|
||||||
final Entity entity = event.getRemover();
|
final Entity entity = event.getRemover();
|
||||||
if (entity instanceof Player)
|
if (entity instanceof Player)
|
||||||
|
@ -160,7 +160,7 @@ public class EssentialsAntiBuildListener implements Listener
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockPistonExtend(BlockPistonExtendEvent event)
|
public void onBlockPistonExtend(final BlockPistonExtendEvent event)
|
||||||
{
|
{
|
||||||
for (Block block : event.getBlocks())
|
for (Block block : event.getBlocks())
|
||||||
{
|
{
|
||||||
|
@ -173,7 +173,7 @@ public class EssentialsAntiBuildListener implements Listener
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onBlockPistonRetract(BlockPistonRetractEvent event)
|
public void onBlockPistonRetract(final BlockPistonRetractEvent event)
|
||||||
{
|
{
|
||||||
if (!event.isSticky())
|
if (!event.isSticky())
|
||||||
{
|
{
|
||||||
|
@ -272,7 +272,7 @@ public class EssentialsAntiBuildListener implements Listener
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
|
||||||
public void onPlayerDropItem(PlayerDropItemEvent event)
|
public void onPlayerDropItem(final PlayerDropItemEvent event)
|
||||||
{
|
{
|
||||||
|
|
||||||
final User user = ess.getUser(event.getPlayer());
|
final User user = ess.getUser(event.getPlayer());
|
||||||
|
|
Loading…
Reference in a new issue