From c7218310c5b6329468aa5997e3cd6c3e711eaa64 Mon Sep 17 00:00:00 2001 From: Brianna Date: Thu, 14 Jan 2021 11:58:09 -0600 Subject: [PATCH 1/2] Added some crop methods. --- .../compatibility/CompatibleMaterial.java | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java b/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java index da7c8614..17735bf7 100644 --- a/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java +++ b/Core/src/main/java/com/songoda/core/compatibility/CompatibleMaterial.java @@ -2631,6 +2631,9 @@ public enum CompatibleMaterial { } /** + * Note: If using this on a legacy server without #getBlockMaterial + * you may run into issues. + * * @return true if this is a block that has a growth state */ public boolean isCrop() { @@ -2648,8 +2651,73 @@ public enum CompatibleMaterial { case SUGAR_CANE: case WHEAT: return true; + default: + return false; + } + } + + /** + * @return the yield of this crop. + */ + public CompatibleMaterial getCropYield() { + switch (this) { + case BEETROOTS: + return BEETROOT; + case CACTUS: + return CACTUS; + case CARROTS: + return CARROT; + case CHORUS_FLOWER: + return CHORUS_PLANT; + case KELP: + return KELP; + case MELON_STEM: + return MELON; + case NETHER_WART: + return NETHER_WART; + case POTATOES: + return POTATO; + case PUMPKIN_STEM: + return PUMPKIN; + case SUGAR_CANE: + return SUGAR_CANE; + case WHEAT: + return WHEAT; + default: + return null; + } + } + + /** + * @return the seed of this crop. + */ + public CompatibleMaterial getCropSeed() { + switch (this) { + case BEETROOTS: + return BEETROOT_SEEDS; + case CACTUS: + return CACTUS; + case CARROTS: + return CARROT; + case CHORUS_PLANT: + return CHORUS_FLOWER; + case KELP: + return KELP; + case MELON_STEM: + return MELON_SEEDS; + case NETHER_WART: + return NETHER_WART; + case POTATOES: + return POTATO; + case PUMPKIN_STEM: + return PUMPKIN_SEEDS; + case SUGAR_CANE: + return SUGAR_CANE; + case WHEAT: + return WHEAT_SEEDS; + default: + return null; } - return false; } public static CompatibleMaterial getSpawnEgg(EntityType type) { From 32dfc01a2a63916f3c347a243372b88dbd7ad42b Mon Sep 17 00:00:00 2001 From: Brianna Date: Thu, 14 Jan 2021 11:58:41 -0600 Subject: [PATCH 2/2] version 2.4.35 --- Core/pom.xml | 2 +- Core/src/main/java/com/songoda/core/SongodaCore.java | 2 +- NMS/NMS-API/pom.xml | 2 +- NMS/NMS-v1_10_R1/pom.xml | 2 +- NMS/NMS-v1_11_R1/pom.xml | 2 +- NMS/NMS-v1_12_R1/pom.xml | 2 +- NMS/NMS-v1_13_R1/pom.xml | 2 +- NMS/NMS-v1_13_R2/pom.xml | 2 +- NMS/NMS-v1_14_R1/pom.xml | 2 +- NMS/NMS-v1_15_R1/pom.xml | 2 +- NMS/NMS-v1_16_R1/pom.xml | 2 +- NMS/NMS-v1_16_R2/pom.xml | 2 +- NMS/NMS-v1_16_R3/pom.xml | 2 +- NMS/NMS-v1_8_R1/pom.xml | 2 +- NMS/NMS-v1_8_R2/pom.xml | 2 +- NMS/NMS-v1_8_R3/pom.xml | 2 +- NMS/NMS-v1_9_R1/pom.xml | 2 +- NMS/NMS-v1_9_R2/pom.xml | 2 +- pom.xml | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Core/pom.xml b/Core/pom.xml index d95a1ed5..ab3f6eee 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../ diff --git a/Core/src/main/java/com/songoda/core/SongodaCore.java b/Core/src/main/java/com/songoda/core/SongodaCore.java index 7df1e5be..ef962607 100644 --- a/Core/src/main/java/com/songoda/core/SongodaCore.java +++ b/Core/src/main/java/com/songoda/core/SongodaCore.java @@ -53,7 +53,7 @@ public class SongodaCore { /** * This has been added as of Rev 6 */ - private final static String coreVersion = "2.4.34"; + private final static String coreVersion = "2.4.35"; /** * This is specific to the website api diff --git a/NMS/NMS-API/pom.xml b/NMS/NMS-API/pom.xml index 1b6d60c0..236cc62a 100644 --- a/NMS/NMS-API/pom.xml +++ b/NMS/NMS-API/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_10_R1/pom.xml b/NMS/NMS-v1_10_R1/pom.xml index 9184d664..55267652 100644 --- a/NMS/NMS-v1_10_R1/pom.xml +++ b/NMS/NMS-v1_10_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_11_R1/pom.xml b/NMS/NMS-v1_11_R1/pom.xml index 22047155..ea536c89 100644 --- a/NMS/NMS-v1_11_R1/pom.xml +++ b/NMS/NMS-v1_11_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_12_R1/pom.xml b/NMS/NMS-v1_12_R1/pom.xml index e441fcdf..c83fc4cf 100644 --- a/NMS/NMS-v1_12_R1/pom.xml +++ b/NMS/NMS-v1_12_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_13_R1/pom.xml b/NMS/NMS-v1_13_R1/pom.xml index 2b77f253..a80b7f7c 100644 --- a/NMS/NMS-v1_13_R1/pom.xml +++ b/NMS/NMS-v1_13_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_13_R2/pom.xml b/NMS/NMS-v1_13_R2/pom.xml index a5e90f1b..4bb2b74f 100644 --- a/NMS/NMS-v1_13_R2/pom.xml +++ b/NMS/NMS-v1_13_R2/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_14_R1/pom.xml b/NMS/NMS-v1_14_R1/pom.xml index 12e5542e..117779d0 100644 --- a/NMS/NMS-v1_14_R1/pom.xml +++ b/NMS/NMS-v1_14_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_15_R1/pom.xml b/NMS/NMS-v1_15_R1/pom.xml index aaecc0fe..26cfc583 100644 --- a/NMS/NMS-v1_15_R1/pom.xml +++ b/NMS/NMS-v1_15_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_16_R1/pom.xml b/NMS/NMS-v1_16_R1/pom.xml index bcb62947..a13f9f37 100644 --- a/NMS/NMS-v1_16_R1/pom.xml +++ b/NMS/NMS-v1_16_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_16_R2/pom.xml b/NMS/NMS-v1_16_R2/pom.xml index a5de643b..33ed3221 100644 --- a/NMS/NMS-v1_16_R2/pom.xml +++ b/NMS/NMS-v1_16_R2/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_16_R3/pom.xml b/NMS/NMS-v1_16_R3/pom.xml index 7c9ae37b..654ce988 100644 --- a/NMS/NMS-v1_16_R3/pom.xml +++ b/NMS/NMS-v1_16_R3/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_8_R1/pom.xml b/NMS/NMS-v1_8_R1/pom.xml index d33335b0..3690d961 100644 --- a/NMS/NMS-v1_8_R1/pom.xml +++ b/NMS/NMS-v1_8_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_8_R2/pom.xml b/NMS/NMS-v1_8_R2/pom.xml index eba37201..49bc6ab7 100644 --- a/NMS/NMS-v1_8_R2/pom.xml +++ b/NMS/NMS-v1_8_R2/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_8_R3/pom.xml b/NMS/NMS-v1_8_R3/pom.xml index 3e69d77b..bf54c00c 100644 --- a/NMS/NMS-v1_8_R3/pom.xml +++ b/NMS/NMS-v1_8_R3/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_9_R1/pom.xml b/NMS/NMS-v1_9_R1/pom.xml index c885badf..a0e6982c 100644 --- a/NMS/NMS-v1_9_R1/pom.xml +++ b/NMS/NMS-v1_9_R1/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/NMS/NMS-v1_9_R2/pom.xml b/NMS/NMS-v1_9_R2/pom.xml index 11eee180..e5d84996 100644 --- a/NMS/NMS-v1_9_R2/pom.xml +++ b/NMS/NMS-v1_9_R2/pom.xml @@ -3,7 +3,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 ../../ diff --git a/pom.xml b/pom.xml index 562ef793..5e05dfe8 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ com.songoda SongodaCore-Modules - 2.4.34 + 2.4.35 4.0.0 pom