Skip to content

Commit ee93985

Browse files
Cleanup for 1.12 mc release
1 parent 3fc59f0 commit ee93985

File tree

6 files changed

+18
-42
lines changed

6 files changed

+18
-42
lines changed

config.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ block-item-transfer-in: false
1010
block-item-transfer-out: true
1111
block-hopper-minecart: remove
1212
cache-time-seconds: 0
13+
lock-expire: false
14+
lock-expire-days: 999.9
15+
lock-default-create-time-unix: -1
16+
lock-expire-string: '&3[Expired]'
17+
1318
private-signs:
1419
- '[Private]'
1520
- '[private]'
@@ -38,4 +43,4 @@ lockables:
3843
- DARK_OAK_DOOR
3944
- IRON_DOOR_BLOCK
4045
protection-exempt:
41-
- explosion
46+
- nothing

src/me/crafter/mc/lockettepro/BlockDebugListener.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -34,39 +34,14 @@ public void onDebugClick(PlayerInteractEvent event){
3434
p.sendMessage(" - now : " + (int)(System.currentTimeMillis()/1000));
3535
}
3636

37-
// p.sendMessage("isLockSign: " + formatBoolean(LocketteProAPI.isLockSign(b)));
38-
// if (LocketteProAPI.isLockSign(b)){
39-
// p.sendMessage(" - isOwnerOnSign: " + formatBoolean(LocketteProAPI.isOwnerOnSign(b, p.getName())));
40-
// }
41-
// p.sendMessage("isAdditionalSign: " + formatBoolean(LocketteProAPI.isAdditionalSign(b)));
42-
// if (LocketteProAPI.isAdditionalSign(b)){
43-
// p.sendMessage(" - isUserOnSign: " + formatBoolean(LocketteProAPI.isUserOnSign(b, p.getName())));
44-
// }
45-
// p.sendMessage("isContainer: " + formatBoolean(LocketteProAPI.isContainer(b)));
4637
p.sendMessage("Block: " + b.getType().toString() + " " + b.getTypeId() + ":" + b.getData());
4738

48-
// if (b.getType() == Material.WALL_SIGN){
49-
// for (Object line : Reflection.signToBaseComponents(b)){
50-
// Bukkit.broadcastMessage(line.toString());
51-
// }
52-
// }
5339
if (b.getType() == Material.WALL_SIGN){
54-
// List<Object> basecomponents = Reflection.signToBaseComponents(b);
55-
// p.sendMessage("Text:Clickable:Hoverable");
56-
// for (Object basecomponent : basecomponents){
57-
// //p.sendMessage(ChatColor.RED + basecomponent.toString());
58-
// p.sendMessage(ChatColor.YELLOW + Reflection.baseComponentToText(basecomponent) + ":" + Reflection.baseComponentToClickable(basecomponent) + ":" + Reflection.baseComponentToHoverable(basecomponent));
59-
// }
6040
for (String line : ((Sign)b.getState()).getLines()){
6141
p.sendMessage(ChatColor.GREEN + line);
6242
}
63-
// Object basecomponent = basecomponents.get(0);
64-
// p.sendMessage(ChatColor.RED + basecomponent.toString());
65-
// p.sendMessage(ChatColor.YELLOW + Reflection.baseComponentToText(basecomponent) + ":" + Reflection.baseComponentToClickable(basecomponent) + ":" + Reflection.baseComponentToHoverable(basecomponent));
66-
// p.sendMessage(ChatColor.GREEN + ((Sign)b.getState()).getLines()[0]);
6743
}
6844
p.sendMessage(p.getUniqueId().toString());
69-
//p.sendMessage(Utils.getUuidByUsernameFromMojang(p.getName()));
7045
}
7146
}
7247

src/me/crafter/mc/lockettepro/Config.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ public static void reload(){
113113
}
114114

115115
lockexpire = config.getBoolean("lock-expire", false);
116-
lockexpiredays = config.getDouble("lock-expire-days", 0D);
116+
lockexpiredays = config.getDouble("lock-expire-days", 999.9D);
117117
lockdefaultcreatetime = config.getLong("lock-default-create-time-unix", -1L);
118118
if (lockdefaultcreatetime < -1L) lockdefaultcreatetime = -1L;
119119
lockexpirestring = ChatColor.translateAlternateColorCodes('&',
@@ -186,9 +186,9 @@ public static void initDefaultConfig(){
186186
config.addDefault("protection-exempt", protection_exempt);
187187

188188
config.addDefault("lock-expire", false);
189-
config.addDefault("lock-expire-days", 30D);
189+
config.addDefault("lock-expire-days", 999.9D);
190190
config.addDefault("lock-default-create-time-unix", -1L);
191-
config.addDefault("lock-expire-string", ChatColor.RED + "[Expired]");
191+
config.addDefault("lock-expire-string", "&3[Expired]");
192192

193193
config.options().copyDefaults(true);
194194
try {

src/me/crafter/mc/lockettepro/LockettePro.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
import org.bukkit.entity.Player;
99
import org.bukkit.plugin.Plugin;
1010
import org.bukkit.plugin.java.JavaPlugin;
11-
import org.mcstats.MetricsLite;
11+
//import org.mcstats.MetricsLite;
1212

1313
public class LockettePro extends JavaPlugin {
1414

1515
private static Plugin plugin;
16-
private boolean debug = true;
16+
private boolean debug = false;
1717
private static Version version = Version.UNKNOWN;
1818
private static boolean needcheckhand = false;
1919

@@ -63,10 +63,11 @@ public void onEnable(){
6363
}
6464
}
6565
// Metrics
66-
try {
67-
MetricsLite metrics = new MetricsLite(this);
68-
metrics.start();
69-
} catch (Exception ex){}
66+
// mcstats sucks
67+
// try {
68+
// MetricsLite metrics = new MetricsLite(this);
69+
// metrics.start();
70+
// } catch (Exception ex){}
7071
}
7172

7273
public void onDisable(){
@@ -123,9 +124,6 @@ public boolean onCommand(CommandSender sender, Command cmd, String commandLabel,
123124
case "4":
124125
if (player.hasPermission("lockettepro.edit")){
125126
String message = "";
126-
// if (args.length == 1){
127-
// message = "";
128-
// }
129127
Block block = Utils.getSelectedSign(player);
130128
if (block == null){
131129
Utils.sendMessages(player, Config.getLang("no-sign-selected"));

src/me/crafter/mc/lockettepro/LocketteProAPI.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class LocketteProAPI {
1616
public static BlockFace[] allfaces = {BlockFace.NORTH, BlockFace.EAST, BlockFace.SOUTH, BlockFace.WEST, BlockFace.UP, BlockFace.DOWN};
1717

1818
public static boolean isLocked(Block block){
19+
if (block == null) return false;
1920
switch (block.getType()){
2021
// Double Doors
2122
case WOODEN_DOOR:

src/me/crafter/mc/lockettepro/Utils.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import org.bukkit.metadata.MetadataValue;
2424

2525
import com.comphenix.protocol.wrappers.WrappedChatComponent;
26-
import com.google.common.base.Strings;
2726
import com.google.gson.JsonObject;
2827
import com.google.gson.JsonParser;
2928

@@ -33,9 +32,7 @@ public class Utils {
3332

3433
private static Map<Player, Block> selectedsign = new HashMap<Player, Block>();
3534
private static Set<Player> notified = new HashSet<Player>();
36-
37-
private static int SECONDSPERDAY = 86400;
38-
35+
3936
// Helper functions
4037
@SuppressWarnings("deprecation")
4138
public static Block putSignOn(Block block, BlockFace blockface, String line1, String line2){

0 commit comments

Comments
 (0)