Skip to content

Commit

Permalink
Version 0.15.0
Browse files Browse the repository at this point in the history
 * Update for compatibility with LuckPerms v5.x in host key
   checking code (dropping admin perms to default).
 * Fix 1.14.4 API compatibility, notably, when untaming cats.
 * Fix portal lighting handler, also broken by API changes.
 * Drop LogBlock queries during mob death logging.
 * Fix some interactible materials (particularly shulkers) and try
   to use Tags where possible.
  • Loading branch information
totemo committed Mar 22, 2020
1 parent 0359ee2 commit 7308364
Show file tree
Hide file tree
Showing 4 changed files with 268 additions and 236 deletions.
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>nu.nerd</groupId>
<artifactId>KitchenSink</artifactId>
<name>KitchenSink</name>
<version>0.14.9</version>
<version>0.15.0</version>
<packaging>jar</packaging>
<description>A plugin for miscellaneous functionality that hasn't found a home elsewhere.</description>
<url>https://github.com/NerdNu/KitchenSink</url>
Expand Down Expand Up @@ -37,20 +37,20 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.13.2-R0.1-SNAPSHOT</version>
<version>1.14.4-R0.1-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>de.diddiz</groupId>
<artifactId>logblock</artifactId>
<version>1.13.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>me.lucko.luckperms</groupId>
<artifactId>luckperms-api</artifactId>
<version>4.3</version>
<scope>provided</scope>
<version>1.14.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
Expand Down
67 changes: 39 additions & 28 deletions src/nu/nerd/kitchensink/KitchenSink.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
package nu.nerd.kitchensink;

import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import de.diddiz.LogBlock.LogBlock;
import nu.nerd.kitchensink.ServerListPing17.StatusResponse;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;

import org.bukkit.Art;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
Expand All @@ -26,21 +38,11 @@
import org.bukkit.scheduler.BukkitTask;
import org.bukkit.util.BlockIterator;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.SortedMap;
import java.util.TreeMap;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;

import de.diddiz.LogBlock.LogBlock;
import nu.nerd.kitchensink.ServerListPing17.StatusResponse;

public class KitchenSink extends JavaPlugin {

Expand Down Expand Up @@ -119,6 +121,7 @@ public class KitchenSink extends JavaPlugin {
ENCHANTMENT_NAMES.put("flame", Enchantment.ARROW_FIRE);
ENCHANTMENT_NAMES.put("infinity", Enchantment.ARROW_INFINITE);
ENCHANTMENT_NAMES.put("punch", Enchantment.ARROW_KNOCKBACK);
ENCHANTMENT_NAMES.put("curse_of_binding", Enchantment.BINDING_CURSE);
ENCHANTMENT_NAMES.put("sharpness", Enchantment.DAMAGE_ALL);
ENCHANTMENT_NAMES.put("bane_of_arthropods", Enchantment.DAMAGE_ARTHROPODS);
ENCHANTMENT_NAMES.put("smite", Enchantment.DAMAGE_UNDEAD);
Expand All @@ -132,6 +135,7 @@ public class KitchenSink extends JavaPlugin {
ENCHANTMENT_NAMES.put("feather_falling", Enchantment.PROTECTION_FALL);
ENCHANTMENT_NAMES.put("fire_protection", Enchantment.PROTECTION_FIRE);
ENCHANTMENT_NAMES.put("projectile_protection", Enchantment.PROTECTION_PROJECTILE);
ENCHANTMENT_NAMES.put("curse_of_vanishing", Enchantment.VANISHING_CURSE);
ENCHANTMENT_NAMES.put("aqua_affinity", Enchantment.WATER_WORKER);
}

Expand Down Expand Up @@ -376,8 +380,9 @@ public boolean onCommand(CommandSender sender, Command command, String name, Str
if (block != null && block.getType() == Material.OBSIDIAN) {
nextPortal = block.getLocation();
sender.sendMessage(
String.format("%sYou can now light a single portal containing the block at (%d, %d, %d).",
ChatColor.GOLD.toString(), nextPortal.getBlockX(), nextPortal.getBlockY(), nextPortal.getBlockZ()));
String.format("%sYou can now light a single portal containing the block at (%d, %d, %d).",
ChatColor.GOLD.toString(), nextPortal.getBlockX(), nextPortal.getBlockY(),
nextPortal.getBlockZ()));
} else {
sender.sendMessage(ChatColor.RED + "You need to be looking at the non-corner parts of an obsidian portal frame.");
}
Expand Down Expand Up @@ -545,15 +550,19 @@ public boolean onCommand(CommandSender sender, Command command, String name, Str
countdownTask = this.getServer().getScheduler().runTaskTimer(this, () -> {
if (countdownTime > 0) {
getServer().broadcastMessage(
ChatColor.translateAlternateColorCodes('&', config.COUNTDOWN_COLOR + config.COUNTDOWN_STYLE)
+ config.COUNTDOWN_FORMAT.split("\\$s")[0] + countdownTime
+ (config.COUNTDOWN_FORMAT.split("\\$s").length > 1 ? config.COUNTDOWN_FORMAT.split("\\$s")[1] : ""));
ChatColor.translateAlternateColorCodes('&', config.COUNTDOWN_COLOR + config.COUNTDOWN_STYLE)
+ config.COUNTDOWN_FORMAT.split("\\$s")[0] + countdownTime
+ (config.COUNTDOWN_FORMAT.split("\\$s").length > 1
? config.COUNTDOWN_FORMAT
.split("\\$s")[1]
: ""));
countdownTime--;
} else {
countdownActive = false;
getServer().broadcastMessage(
ChatColor.translateAlternateColorCodes('&', config.COUNTDOWN_MSG_COLOR + config.COUNTDOWN_MSG_STYLE)
+ countdownMessage);
ChatColor
.translateAlternateColorCodes('&', config.COUNTDOWN_MSG_COLOR + config.COUNTDOWN_MSG_STYLE)
+ countdownMessage);
countdownMessage = "";
countdownTask.cancel();
countdownTask = null;
Expand Down Expand Up @@ -652,7 +661,8 @@ public boolean onCommand(CommandSender sender, Command command, String name, Str
config.setCountDownSetting(countdown.msgcolor, args[1]);
sender.sendMessage(ChatColor.GRAY + "Message color changed to: "
+ ChatColor.translateAlternateColorCodes('&', config.COUNTDOWN_MSG_COLOR
+ config.COUNTDOWN_MSG_STYLE) + "Go!");
+ config.COUNTDOWN_MSG_STYLE)
+ "Go!");
} else {
sender.sendMessage(ChatColor.GRAY + "Valid countdown color codes: http://minecraft.gamepedia.com/Formatting_codes.");
return false;
Expand All @@ -667,7 +677,8 @@ public boolean onCommand(CommandSender sender, Command command, String name, Str
config.setCountDownSetting(countdown.msgstyle, args[1]);
sender.sendMessage(ChatColor.GRAY + "Message style changed to: "
+ ChatColor.translateAlternateColorCodes('&', config.COUNTDOWN_MSG_COLOR
+ config.COUNTDOWN_MSG_STYLE) + "Go!");
+ config.COUNTDOWN_MSG_STYLE)
+ "Go!");
} else {
sender.sendMessage(ChatColor.GRAY + "Valid countdown style codes: http://minecraft.gamepedia.com/Formatting_codes.");
return false;
Expand Down
Loading

0 comments on commit 7308364

Please sign in to comment.