Add lily pad growing. Fix some warnings. Bump version number.
parent
f2bc30cd5d
commit
c98dae2854
|
@ -39,6 +39,9 @@ Instantly dry wet sponges when they are placed in the nether.
|
||||||
### Hoe harvesting
|
### Hoe harvesting
|
||||||
When breaking crops with a hoe you break a range around them. This drastically speeds up manual harvesting of crop farms.
|
When breaking crops with a hoe you break a range around them. This drastically speeds up manual harvesting of crop farms.
|
||||||
|
|
||||||
|
### Lily pad growing
|
||||||
|
When right-clicking a lily pad with bone meal it wil grow new lily pads around the one that was clicked.
|
||||||
|
|
||||||
## Planned tweaks
|
## Planned tweaks
|
||||||
- Dynamite
|
- Dynamite
|
||||||
- Sign editing
|
- Sign editing
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
pluginGroup=nl.kallestruik
|
pluginGroup=nl.kallestruik
|
||||||
pluginVersion=1.0
|
pluginVersion=1.1
|
||||||
|
|
|
@ -19,7 +19,7 @@ import java.util.UUID;
|
||||||
|
|
||||||
public class TrampleHandler implements Listener {
|
public class TrampleHandler implements Listener {
|
||||||
|
|
||||||
public static HashSet<UUID> trampleEnabled = new HashSet<>();
|
static HashSet<UUID> trampleEnabled = new HashSet<>();
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBlockBreak(EntityChangeBlockEvent event) {
|
public void onBlockBreak(EntityChangeBlockEvent event) {
|
||||||
|
@ -43,6 +43,7 @@ public class TrampleHandler implements Listener {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||||
public static void loadTrampleEnabled(File file) throws IOException, InvalidConfigurationException {
|
public static void loadTrampleEnabled(File file) throws IOException, InvalidConfigurationException {
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
|
@ -55,6 +56,7 @@ public class TrampleHandler implements Listener {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||||
public static void saveTrampleEnabled(File file) throws IOException, InvalidConfigurationException {
|
public static void saveTrampleEnabled(File file) throws IOException, InvalidConfigurationException {
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
file.createNewFile();
|
file.createNewFile();
|
||||||
|
|
|
@ -3,6 +3,7 @@ package nl.kallestruik.vanillatweaks;
|
||||||
import nl.kallestruik.vanillatweaks.ArmorStandSwapping.ArmorStandSwappingHandler;
|
import nl.kallestruik.vanillatweaks.ArmorStandSwapping.ArmorStandSwappingHandler;
|
||||||
import nl.kallestruik.vanillatweaks.CraftingTweaks.CraftingTweaks;
|
import nl.kallestruik.vanillatweaks.CraftingTweaks.CraftingTweaks;
|
||||||
import nl.kallestruik.vanillatweaks.HoeHarvesting.HoeHarvestingHandler;
|
import nl.kallestruik.vanillatweaks.HoeHarvesting.HoeHarvestingHandler;
|
||||||
|
import nl.kallestruik.vanillatweaks.LilypadGrowing.LilypadGrowingHandler;
|
||||||
import nl.kallestruik.vanillatweaks.NetherSpongeDrying.NetherSpongeHandler;
|
import nl.kallestruik.vanillatweaks.NetherSpongeDrying.NetherSpongeHandler;
|
||||||
import nl.kallestruik.vanillatweaks.SeedDropPlanting.SeedDropPlanting;
|
import nl.kallestruik.vanillatweaks.SeedDropPlanting.SeedDropPlanting;
|
||||||
import nl.kallestruik.vanillatweaks.ToggleTrample.CommandToggletrample;
|
import nl.kallestruik.vanillatweaks.ToggleTrample.CommandToggletrample;
|
||||||
|
@ -12,6 +13,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
|
||||||
|
@SuppressWarnings("ConstantConditions")
|
||||||
public final class VanillaTweaks extends JavaPlugin {
|
public final class VanillaTweaks extends JavaPlugin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -30,12 +32,6 @@ public final class VanillaTweaks extends JavaPlugin {
|
||||||
CraftingTweaks.init(this);
|
CraftingTweaks.init(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Dynamite
|
|
||||||
*
|
|
||||||
* Throwable tnt with a smaller explosion.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (config.SEED_DROP_PLANTING_ENABLED) {
|
if (config.SEED_DROP_PLANTING_ENABLED) {
|
||||||
SeedDropPlanting.init(this);
|
SeedDropPlanting.init(this);
|
||||||
}
|
}
|
||||||
|
@ -52,6 +48,10 @@ public final class VanillaTweaks extends JavaPlugin {
|
||||||
getServer().getPluginManager().registerEvents(new HoeHarvestingHandler(), this);
|
getServer().getPluginManager().registerEvents(new HoeHarvestingHandler(), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.LILYPAD_GROWING_ENABLED) {
|
||||||
|
getServer().getPluginManager().registerEvents(new LilypadGrowingHandler(), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} catch (IOException | InvalidConfigurationException | NullPointerException e) {
|
} catch (IOException | InvalidConfigurationException | NullPointerException e) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package nl.kallestruik.vanillatweaks;
|
package nl.kallestruik.vanillatweaks;
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess")
|
||||||
public class c {
|
public class c {
|
||||||
public static final String CONFIG_FILE_NAME = "config.yml";
|
public static final String CONFIG_FILE_NAME = "config.yml";
|
||||||
public static String TRAMPLE_ENABLED_FILE_NAME = "tramplestore.yml";
|
public static String TRAMPLE_ENABLED_FILE_NAME = "tramplestore.yml";
|
||||||
|
|
|
@ -6,6 +6,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@SuppressWarnings({"WeakerAccess", "ResultOfMethodCallIgnored"})
|
||||||
public class config {
|
public class config {
|
||||||
|
|
||||||
public static boolean TOGGLE_TRAMPLE_ENABLED;
|
public static boolean TOGGLE_TRAMPLE_ENABLED;
|
||||||
|
@ -33,6 +34,8 @@ public class config {
|
||||||
public static int HOE_HARVESTING_RANGE_GOLD;
|
public static int HOE_HARVESTING_RANGE_GOLD;
|
||||||
public static int HOE_HARVESTING_RANGE_DIAMOND;
|
public static int HOE_HARVESTING_RANGE_DIAMOND;
|
||||||
|
|
||||||
|
public static boolean LILYPAD_GROWING_ENABLED;
|
||||||
|
|
||||||
public static void load(File file) throws IOException, InvalidConfigurationException {
|
public static void load(File file) throws IOException, InvalidConfigurationException {
|
||||||
if (!file.getParentFile().exists())
|
if (!file.getParentFile().exists())
|
||||||
file.getParentFile().mkdirs();
|
file.getParentFile().mkdirs();
|
||||||
|
@ -66,6 +69,7 @@ public class config {
|
||||||
HOE_HARVESTING_RANGE_GOLD = config.getInt("hoe-harvesting.ranges.gold");
|
HOE_HARVESTING_RANGE_GOLD = config.getInt("hoe-harvesting.ranges.gold");
|
||||||
HOE_HARVESTING_RANGE_DIAMOND = config.getInt("hoe-harvesting.ranges.diamond");
|
HOE_HARVESTING_RANGE_DIAMOND = config.getInt("hoe-harvesting.ranges.diamond");
|
||||||
|
|
||||||
|
LILYPAD_GROWING_ENABLED = config.getBoolean("lilypad-growing.enabled");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,18 @@
|
||||||
package nl.kallestruik.vanillatweaks;
|
package nl.kallestruik.vanillatweaks;
|
||||||
|
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
@SuppressWarnings("WeakerAccess")
|
||||||
public class util {
|
public class util {
|
||||||
|
|
||||||
|
private static final Random random = new Random();
|
||||||
|
|
||||||
public static void printException(Exception e) {
|
public static void printException(Exception e) {
|
||||||
System.err.println("-------------------------------------------------------------------------------------");
|
System.err.println("-------------------------------------------------------------------------------------");
|
||||||
System.err.println("An error seems to have occurred. A detailed stacktrace of the error is printed below.");
|
System.err.println("An error seems to have occurred. A detailed stacktrace of the error is printed below.");
|
||||||
|
@ -29,4 +35,15 @@ public class util {
|
||||||
util.printException(ex);
|
util.printException(ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Vector getRandomLocationOffset(int min, int max, boolean height) {
|
||||||
|
Vector vec;
|
||||||
|
if (height)
|
||||||
|
vec = new Vector(min + random.nextInt(max - min), min + random.nextInt(max - min), min + random.nextInt(max - min));
|
||||||
|
else
|
||||||
|
vec = new Vector(min + random.nextInt(max - min), 0, min + random.nextInt(max - min));
|
||||||
|
|
||||||
|
vec.multiply(new Vector(random.nextBoolean() ? -1 : 1, random.nextBoolean() ? -1 : 1, random.nextBoolean() ? -1 : 1));
|
||||||
|
return vec;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,4 +28,7 @@ hoe-harvesting:
|
||||||
stone: 1
|
stone: 1
|
||||||
iron: 1
|
iron: 1
|
||||||
gold: 1
|
gold: 1
|
||||||
diamond: 2
|
diamond: 2
|
||||||
|
|
||||||
|
lilypad-growing:
|
||||||
|
enabled: true
|
Reference in New Issue