diff --git a/README.md b/README.md
index 1eeada1..bd7aaad 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
MCBBS发布帖: https://www.mcbbs.net/thread-1342178-1-1.html
+
+MineDown: https://github.com/Phoenix616/MineDown
diff --git a/pom.xml b/pom.xml
index 4cd83e8..27bf4bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,7 +93,7 @@
de.themoep.minedown
- net.momirealms.customcrops.libraries.minedown
+ net.momirealms.customcrops.Libs.minedown
diff --git a/src/main/java/net/momirealms/customcrops/CustomCrops.java b/src/main/java/net/momirealms/customcrops/CustomCrops.java
index 051ffbf..efd8fe6 100644
--- a/src/main/java/net/momirealms/customcrops/CustomCrops.java
+++ b/src/main/java/net/momirealms/customcrops/CustomCrops.java
@@ -54,7 +54,6 @@ public final class CustomCrops extends JavaPlugin {
List components = packet.getChatComponents().getValues();
for (WrappedChatComponent component : components) {
if(component.toString().contains("Ender Chest")){
- //component.setJson("{\"text\":\"收纳袋\"}");
component.setJson("{\"translate\":\"container.enderchest\"}");
packet.getChatComponents().write(components.indexOf(component), component);
}
diff --git a/src/main/java/net/momirealms/customcrops/DataManager/BackUp.java b/src/main/java/net/momirealms/customcrops/DataManager/BackUp.java
index 3ed8120..80a5f84 100644
--- a/src/main/java/net/momirealms/customcrops/DataManager/BackUp.java
+++ b/src/main/java/net/momirealms/customcrops/DataManager/BackUp.java
@@ -10,7 +10,6 @@ import java.text.SimpleDateFormat;
import java.util.Date;
public class BackUp {
-
public static void backUpData(){
Date date = new Date();
@@ -23,11 +22,13 @@ public class BackUp {
try {
BackUp.backUp(crop_data,cropBackUp);
+
} catch (IOException e) {
e.printStackTrace();
}
try {
BackUp.backUp(sprinkler_data,sprinklerBackUp);
+
} catch (IOException e) {
e.printStackTrace();
}
diff --git a/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java b/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java
index 0b7167a..a29e2ad 100644
--- a/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java
+++ b/src/main/java/net/momirealms/customcrops/DataManager/MaxCropsPerChunk.java
@@ -3,15 +3,13 @@ package net.momirealms.customcrops.DataManager;
import dev.lone.itemsadder.api.CustomBlock;
import net.momirealms.customcrops.CustomCrops;
import org.bukkit.Location;
-import org.bukkit.block.Block;
import org.bukkit.configuration.file.FileConfiguration;
public class MaxCropsPerChunk {
- static FileConfiguration config = CustomCrops.instance.getConfig();
-
public static boolean maxCropsPerChunk(Location location){
+ FileConfiguration config = CustomCrops.instance.getConfig();
if(!config.getBoolean("config.enable-limit")){
return false;
}
@@ -26,10 +24,10 @@ public class MaxCropsPerChunk {
Label_out:
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
- Location square = chunkLocation.clone().add(i, 0.0, j);
+ final Location square = chunkLocation.clone().add((double)i, 0.0, (double)j);
for (int k = minY; k <= maxY; ++k) {
square.add(0.0, 1.0, 0.0);
- Block b = location.getWorld().getBlockAt(square);
+ Blcok b = location.getWorld().getBlcokAt(square);
if(CustomBlock.byAlreadyPlaced(b)!= null){
if (CustomBlock.byAlreadyPlaced(b).getNamespacedID().contains("stage")) {
if (n++ > maxAmount) {
diff --git a/src/main/java/net/momirealms/customcrops/DataManager/MaxSprinklersPerChunk.java b/src/main/java/net/momirealms/customcrops/DataManager/MaxSprinklersPerChunk.java
index b7a3228..191d18c 100644
--- a/src/main/java/net/momirealms/customcrops/DataManager/MaxSprinklersPerChunk.java
+++ b/src/main/java/net/momirealms/customcrops/DataManager/MaxSprinklersPerChunk.java
@@ -7,11 +7,8 @@ import org.bukkit.World;
import org.bukkit.configuration.file.FileConfiguration;
public class MaxSprinklersPerChunk {
-
- static FileConfiguration config = CustomCrops.instance.getConfig();
-
public static boolean maxSprinklersPerChunk(Location location){
-
+ FileConfiguration config = CustomCrops.instance.getConfig();
if(!config.getBoolean("config.enable-limit")){
return false;
}
@@ -27,7 +24,7 @@ public class MaxSprinklersPerChunk {
Label_out:
for (int i = 0; i < 16; ++i) {
for (int j = 0; j < 16; ++j) {
- Location square = chunkLocation.clone().add(i+0.5, 0.5, j+0.5);
+ final Location square = chunkLocation.clone().add((double)(i+0.5), 0.5, (double)(j+0.5));
for (int k = minY; k <= maxY; ++k) {
square.add(0.0, 1.0, 0.0);
if(IAFurniture.getFromLocation(square, world)){
@@ -40,7 +37,4 @@ public class MaxSprinklersPerChunk {
}
return n > maxAmount;
}
- public static boolean alreadyPlaced(Location location){
- return IAFurniture.getFromLocation(location.clone().add(0.5, 1.5, 0.5), location.getWorld());
- }
}