From 2fe32e9180f8c07d341064ad9eb6890ba06ec49f Mon Sep 17 00:00:00 2001
From: SoHugePenguin <2298566583@qq.com>
Date: Sat, 24 Dec 2022 09:57:26 +0800
Subject: [PATCH] v1.4.2
---
PNX.run.xml | 4 +-
.../plugin/testPlugin/Blocks/block1.java | 5 +-
.../plugin/testPlugin/Blocks/block10.java | 7 +-
.../plugin/testPlugin/Blocks/block11.java | 7 +-
.../plugin/testPlugin/Blocks/block12.java | 5 +-
.../plugin/testPlugin/Blocks/block13.java | 7 +-
.../plugin/testPlugin/Blocks/block14.java | 7 +-
.../plugin/testPlugin/Blocks/block15.java | 7 +-
.../plugin/testPlugin/Blocks/block16.java | 7 +-
.../plugin/testPlugin/Blocks/block17.java | 7 +-
.../plugin/testPlugin/Blocks/block18.java | 7 +-
.../plugin/testPlugin/Blocks/block19.java | 7 +-
.../plugin/testPlugin/Blocks/block2.java | 7 +-
.../plugin/testPlugin/Blocks/block20.java | 7 +-
.../plugin/testPlugin/Blocks/block21.java | 7 +-
.../plugin/testPlugin/Blocks/block22.java | 7 +-
.../plugin/testPlugin/Blocks/block23.java | 7 +-
.../plugin/testPlugin/Blocks/block24.java | 7 +-
.../plugin/testPlugin/Blocks/block25.java | 7 +-
.../plugin/testPlugin/Blocks/block26.java | 7 +-
.../plugin/testPlugin/Blocks/block27.java | 7 +-
.../plugin/testPlugin/Blocks/block28.java | 7 +-
.../plugin/testPlugin/Blocks/block29.java | 7 +-
.../plugin/testPlugin/Blocks/block3.java | 7 +-
.../plugin/testPlugin/Blocks/block30.java | 7 +-
.../plugin/testPlugin/Blocks/block31.java | 7 +-
.../plugin/testPlugin/Blocks/block32.java | 7 +-
.../plugin/testPlugin/Blocks/block33.java | 7 +-
.../plugin/testPlugin/Blocks/block34.java | 7 +-
.../plugin/testPlugin/Blocks/block35.java | 7 +-
.../plugin/testPlugin/Blocks/block36.java | 7 +-
.../plugin/testPlugin/Blocks/block37.java | 7 +-
.../plugin/testPlugin/Blocks/block38.java | 7 +-
.../plugin/testPlugin/Blocks/block39.java | 7 +-
.../plugin/testPlugin/Blocks/block4.java | 7 +-
.../plugin/testPlugin/Blocks/block40.java | 8 +-
.../plugin/testPlugin/Blocks/block5.java | 7 +-
.../plugin/testPlugin/Blocks/block6.java | 7 +-
.../plugin/testPlugin/Blocks/block7.java | 7 +-
.../plugin/testPlugin/Blocks/block8.java | 7 +-
.../plugin/testPlugin/Blocks/block9.java | 7 +-
.../plugin/testPlugin/Blocks/test_slab.java | 9 +
.../plugin/testPlugin/Entity/Anchor.java | 18 +-
.../plugin/testPlugin/Entity/BaseNpc.java | 142 +++----
.../plugin/testPlugin/Entity/Car1.java | 29 +-
.../testPlugin/Items/Armors/boots_1.java | 2 +-
.../testPlugin/Items/Armors/chests_1.java | 2 +-
.../testPlugin/Items/Armors/helmets_1.java | 2 +-
.../testPlugin/Items/Armors/leggings_1.java | 2 +-
.../testPlugin/Items/Custom_Pickaxe.java | 9 +-
.../Items/Edibles/Fire_Pepper_Item.java | 41 +-
.../testPlugin/Items/Saber/sword_1.java | 29 +-
.../testPlugin/Items/Saber/sword_2.java | 8 +-
.../Items/Summon_egg/anchor_egg.java | 12 +-
.../Items/Summon_egg/anchor_information.java | 1 +
.../testPlugin/Items/Tools/BuildGod_Item.java | 5 -
.../Items/Tools/TheWorld_Menu_Item.java | 18 +-
.../plugin/testPlugin/Main_PluginBase.java | 147 +++----
.../plugin/testPlugin/Player_Access.java | 2 +-
.../plugin/testPlugin/ServerListener.java | 395 +++++++++---------
.../plugin/testPlugin/Tool/WoodAxe.java | 13 +-
.../plugin/testPlugin/Tool/ball_tool.java | 90 ++--
.../plugin/testPlugin/Tool/round_tool.java | 44 +-
.../Windows/Build_Item_Win/Build_Menu.java | 15 +-
.../Build_Item_Win/Coordinate_sorting.java | 4 +-
.../Build_Item_Win/FillType/CommonFill.java | 24 +-
.../Build_Item_Win/FillType/KeepFill.java | 26 +-
.../Build_Item_Win/FillType/RandomFill.java | 151 +++----
.../Build_Item_Win/FillType/ReplaceFill.java | 24 +-
.../Build_Item_Win/FillType/UndoFill.java | 8 +-
.../Windows/Create_NPC/Npc_HuTao.java | 20 +-
.../Windows/Create_NPC/Npc_Menu.java | 9 +-
.../Windows/Create_NPC/Npc_Setting.java | 11 +-
.../Windows/Create_NPC/Npc_Setting_Base.java | 13 +-
.../Create_NPC/Npc_Setting_Base_Delete.java | 16 +-
.../Npc_Setting_Base_Equipment.java | 20 +-
.../Create_NPC/Npc_Setting_Base_Model.java | 28 +-
.../Create_NPC/Npc_Setting_Base_Name.java | 20 +-
.../Windows/Create_NPC/Npc_Setting_Skin.java | 27 +-
.../Windows/Create_NPC/Npc_information.java | 7 +-
.../Windows/Create_NPC/SpawnNpc.java | 14 +-
.../testPlugin/Windows/Home/CreateHome.java | 18 +-
.../plugin/testPlugin/Windows/Home/Home.java | 17 +-
.../testPlugin/Windows/Home/HomeList.java | 16 +-
.../testPlugin/Windows/Home/HomeOpMenu.java | 7 +-
.../testPlugin/Windows/Home/Managing_Do.java | 12 +-
.../Windows/Home/Managing_Homes.java | 12 +-
.../testPlugin/Windows/Home/MyHome.java | 13 +-
.../Windows/Personal/Personal_System.java | 11 +-
.../SaveBuilder/Clone_Block_To_Yml.java | 98 ++---
.../Windows/SaveBuilder/CreateFile.java | 17 +-
.../Windows/SaveBuilder/Create_To.java | 13 +-
.../Windows/SaveBuilder/FileList.java | 2 +-
.../Windows/SaveBuilder/Filecenter.java | 9 +-
.../Windows/SaveBuilder/Introduct.java | 2 +-
.../Windows/SaveBuilder/Paste_Build.java | 99 ++---
.../Windows/SaveBuilder/SaveBuild.java | 3 +-
.../Windows/SaveBuilder/Save_Success.java | 9 +-
.../Windows/SaveBuilder/Utils/BO.java | 9 +-
.../Windows/SaveBuilder/opSaveBuilder.java | 11 +-
.../testPlugin/Windows/Setting/Setting.java | 11 +-
.../plugin/testPlugin/Windows/Shop/Shop.java | 13 +-
.../Windows/Socail/Social_Contact.java | 12 +-
.../Windows/Teleport/Teleport_Menu.java | 9 +-
.../testPlugin/Windows/WorldMenuWindow.java | 22 +-
.../dimension/MyFirstDimension.java | 10 +-
src/plugin.yml | 10 +-
107 files changed, 1150 insertions(+), 1053 deletions(-)
diff --git a/PNX.run.xml b/PNX.run.xml
index 380dfb2..7481da2 100644
--- a/PNX.run.xml
+++ b/PNX.run.xml
@@ -2,8 +2,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block1.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block1.java
index a9ca7d7..c8743bc 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block1.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block1.java
@@ -13,12 +13,13 @@
public class block1 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block1";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block1")//texture name
@@ -64,7 +65,7 @@ public double getFrictionFactor() {
@Override
public BlockColor getColor() {
- return new BlockColor(180,28,48);
+ return new BlockColor(180, 28, 48);
}
//阻力
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block10.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block10.java
index 7dbedd5..26d212b 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block10.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block10.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block10 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block10";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block10")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block11.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block11.java
index 477a631..838327a 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block11.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block11.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block11 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block11";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block11")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block12.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block12.java
index 015eb56..3c86b47 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block12.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block12.java
@@ -10,6 +10,7 @@
import org.jetbrains.annotations.Nullable;
public class block12 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block12";
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block13.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block13.java
index 27aa81b..6cabbe8 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block13.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block13.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block13 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block13";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block13")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block14.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block14.java
index 4346229..a0fec36 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block14.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block14.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block14 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block14";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block14")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block15.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block15.java
index 533791b..239e5d2 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block15.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block15.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block15 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block15";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block15")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block16.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block16.java
index 7944af3..2e2a8ae 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block16.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block16.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block16 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block16";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block16")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block17.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block17.java
index 8e21579..0802b5b 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block17.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block17.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block17 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block17";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block17")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block18.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block18.java
index d31e368..5d6802b 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block18.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block18.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block18 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block18";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block18")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block19.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block19.java
index 01ed79d..29a10c1 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block19.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block19.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block19 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block19";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block19")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block2.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block2.java
index 06d383e..1ec12bc 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block2.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block2.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block2 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block2";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block2")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block20.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block20.java
index fda7ecb..838da8a 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block20.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block20.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block20 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block20";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block20")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block21.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block21.java
index 22503a2..5917257 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block21.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block21.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block21 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block21";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block21")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block22.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block22.java
index e6bcc3e..32d5bbf 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block22.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block22.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block22 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block22";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block22")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block23.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block23.java
index 1f6d2cf..458793c 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block23.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block23.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block23 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block23";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block23")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block24.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block24.java
index 2c44eac..314fe3c 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block24.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block24.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block24 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block24";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block24")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block25.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block25.java
index a1b6b23..b674041 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block25.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block25.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block25 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block25";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block25")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block26.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block26.java
index e968f0b..c38bd62 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block26.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block26.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block26 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block26";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block26")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block27.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block27.java
index dfd1e4b..bbba70f 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block27.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block27.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block27 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block27";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block27")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block28.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block28.java
index 0f84d06..9ebd11a 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block28.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block28.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block28 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block28";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block28")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block29.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block29.java
index ca62bb0..e6fe954 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block29.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block29.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block29 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block29";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block29")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block3.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block3.java
index c3bb73b..ad35f4e 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block3.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block3.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block3 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block3";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block3")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block30.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block30.java
index 991d94a..8d7dfae 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block30.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block30.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block30 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block30";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block30")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block31.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block31.java
index 69a45e1..d815674 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block31.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block31.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block31 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block31";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block31")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block32.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block32.java
index fb3399b..254e404 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block32.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block32.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block32 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block32";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block32")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block33.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block33.java
index 4b439ed..8692a04 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block33.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block33.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block33 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block33";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block33")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block34.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block34.java
index bda64fb..a107055 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block34.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block34.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block34 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block34";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block34")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block35.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block35.java
index eada6dc..b11274f 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block35.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block35.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block35 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block35";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block35")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block36.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block36.java
index 44c54e1..d92070b 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block36.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block36.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block36 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block36";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block36")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block37.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block37.java
index 15e50bc..1b1d5c3 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block37.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block37.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block37 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block37";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block37")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block38.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block38.java
index 95ba475..5da0f06 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block38.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block38.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block38 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block38";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block38")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block39.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block39.java
index 0ee70bd..8983a38 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block39.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block39.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block39 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block39";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block39")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block4.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block4.java
index 0d397b2..a845ebe 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block4.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block4.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block4 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block4";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block4")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block40.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block40.java
index 890a46f..bda30b5 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block40.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block40.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block40 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block40";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block40")//texture name
@@ -32,6 +33,7 @@ public CustomBlockDefinition getDefinition() {
.putInt("molang_version", 6))));
});
}
+
public String getTexture() {
return "color_block40";
}
@@ -41,12 +43,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block5.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block5.java
index 3a7d5a3..42d320e 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block5.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block5.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block5 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block5";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block5")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block6.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block6.java
index 3cf5127..83136f9 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block6.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block6.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block6 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block6";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block6")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block7.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block7.java
index 9cae12e..9fb67cd 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block7.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block7.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block7 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block7";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block7")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block8.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block8.java
index 9475550..9f56256 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block8.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block8.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block8 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block8";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block8")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block9.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block9.java
index 6c7fa5c..17bfe5f 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block9.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/block9.java
@@ -10,12 +10,13 @@
import org.jetbrains.annotations.Nullable;
public class block9 extends Block implements CustomBlock {
+ @NotNull
@Override
public String getNamespaceId() {
return "np:color_block9";
}
- @Override
+ @Override
public CustomBlockDefinition getDefinition() {
return CustomBlockDefinition
.builder(this, "color_block9")//texture name
@@ -38,12 +39,12 @@ public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
-//摩擦系数
+ //摩擦系数
@Override
public double getFrictionFactor() {
return 0.4;
}
-
+
//阻力
@Override
public double getResistance() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/test_slab.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/test_slab.java
index 4a8a467..4a6c84c 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/test_slab.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Blocks/test_slab.java
@@ -19,6 +19,7 @@ public class test_slab extends Block implements CustomBlock {
public final BooleanBlockProperty BRIDGE_TOP_SLOT_BIT = new BooleanBlockProperty("bridge:top_slot_bit", false);
public final BooleanBlockProperty BRIDGE_IS_FULL_BIT = new BooleanBlockProperty("bridge:is_full_bit", false);
+ @NotNull
@Override
public String getNamespaceId() {
return "blocklynukkit:blue_mahoe_slab";
@@ -86,41 +87,49 @@ public CustomBlockDefinition getDefinition() {
.putInt("molang_version", 6))));
});
}
+
//Block digging takes time
@Override
public double calculateBreakTime(@NotNull Item item, @Nullable Player player) {
return 3;
}
+
//Block friction factor
@Override
public double getFrictionFactor() {
return 0.1;
}
+
//Block explosion resistance
@Override
public double getResistance() {
return 5;
}
+
//Block emit light level
@Override
public int getLightLevel() {
return 15;
}
+
//Block absorb light level
@Override
public int getLightFilter() {
return 15;
}
+
//burn ability
@Override
public int getBurnAbility() {
return 0;
}
+
//burn chance
@Override
public int getBurnChance() {
return 0;
}
+
//Block item max stack size
@Override
public int getItemMaxStackSize() {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Anchor.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Anchor.java
index 4c40bc7..728e825 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Anchor.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Anchor.java
@@ -19,12 +19,12 @@ public class Anchor extends Entity implements CustomEntity {
.summonable(true)
.spawnEgg(true)
.build();
+ boolean a;
+ double dx, dy, dz;
public Anchor(FullChunk chunk, CompoundTag tag) {
super(chunk, tag);
}
- boolean a;
- double dx,dy,dz;
@NotNull
@Override
@@ -43,7 +43,7 @@ public int getNetworkId() {
}
@Override
- public void initEntity(){
+ public void initEntity() {
super.initEntity();
this.setMaxHealth(40);
this.spawnToAll();
@@ -54,10 +54,10 @@ public void initEntity(){
@Override
public boolean isAlive() {
- if(anchor_information.name == null || !anchor_information.name.contains(this.getNameTag())){
- anchor_info(this.getNameTag() , this.getLocation());
+ if (anchor_information.name == null || !anchor_information.name.contains(this.getNameTag())) {
+ anchor_info(this.getNameTag(), this.getLocation());
}
- if(Utils.rand(1,50) == 1) {
+ if (Utils.rand(1, 50) == 1) {
if (this.a) {
this.y += 0.1;
this.a = false;
@@ -66,11 +66,11 @@ public boolean isAlive() {
this.a = true;
}
}
- if(Utils.rand(1,80) >40){
+ if (Utils.rand(1, 80) > 40) {
this.yaw += 0.1;
- }else this.yaw-= 0.1;
+ } else this.yaw -= 0.1;
- if(Math.abs(this.dx - this.x) > 0.2 || Math.abs(this.dy - this.y) > 0.2 || Math.abs(this.dz - this.z) > 0.2){
+ if (Math.abs(this.dx - this.x) > 0.2 || Math.abs(this.dy - this.y) > 0.2 || Math.abs(this.dz - this.z) > 0.2) {
System.out.println("qwq?");
this.x = this.dx;
this.y = this.dy;
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/BaseNpc.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/BaseNpc.java
index 6582158..ea081df 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/BaseNpc.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/BaseNpc.java
@@ -29,19 +29,19 @@ public class BaseNpc extends EntityHuman implements CustomEntity {
.summonable(true)
.spawnEgg(false)
.build();
- @Override
- public CustomEntityDefinition getDefinition() {
- return def;
- }
+ public static ArrayList onlineNpcList = new ArrayList<>();
+ public boolean alive = true;
+ public Config config;
+ public Skin skin;
public BaseNpc(FullChunk chunk, CompoundTag tag) {
super(chunk, tag);
}
- public boolean alive = true;
- public static ArrayList onlineNpcList = new ArrayList<>();
- public Config config;
- public Skin skin;
+ @Override
+ public CustomEntityDefinition getDefinition() {
+ return def;
+ }
@Override
public String getOriginalName() {
@@ -54,14 +54,14 @@ public void initEntity() {
Config config;
File[] file = new File("penguin_plugin/Npc_config").listFiles();
assert file != null;
- for(File Folder : file){
- config = new Config(Folder,2);
- if(!Folder.getName().contains("npcBase") && this.namedTag.get("account").toString().contains(config.getString("uuid"))){
+ for (File Folder : file) {
+ config = new Config(Folder, 2);
+ if (!Folder.getName().contains("npcBase") && this.namedTag.get("account").toString().contains(config.getString("uuid"))) {
this.config = config;
}
}
- if(this.config == null){
- this.config = new Config("penguin_plugin/Npc_config/npcBase.yml",2);
+ if (this.config == null) {
+ this.config = new Config("penguin_plugin/Npc_config/npcBase.yml", 2);
}
this.setSkin(skin);
super.initEntity();
@@ -71,20 +71,20 @@ public void initEntity() {
@Override
public Skin getSkin() {
- if(skin == null) {
+ if (skin == null) {
skin = new Skin();
BufferedImage image;
//获取服务器npc数据文件
Config config;
File[] file = new File("penguin_plugin/Npc_config").listFiles();
assert file != null;
- for(File Folder : file){
- config = new Config(Folder,2);
- if(!Folder.getName().contains("npcBase") && this.namedTag.get("account").toString().contains(config.getString("uuid"))){
+ for (File Folder : file) {
+ config = new Config(Folder, 2);
+ if (!Folder.getName().contains("npcBase") && this.namedTag.get("account").toString().contains(config.getString("uuid"))) {
this.config = config;
}
}
- File f = new File("penguin_plugin/skins/" + (this.config.get("skin") != null ? this.config.get("skin") : "steve.png"));
+ File f = new File("penguin_plugin/skins/" + (this.config.get("skin") != null ? this.config.get("skin") : "steve.png"));
try {
image = ImageIO.read(f);
} catch (IOException e) {
@@ -112,68 +112,68 @@ public void spawnToAll() {
}
@Override
- public void setScale(float scale) {
- super.setScale(this.config.get("model_size") != null ? (float) this.config.getDouble("model_size") : 1f );
+ public float getScale() {
+ return super.getScale();
}
@Override
- public float getScale() {
- return super.getScale();
+ public void setScale(float scale) {
+ super.setScale(this.config.get("model_size") != null ? (float) this.config.getDouble("model_size") : 1f);
}
@Override
public boolean isAlive() {
- if (this.getHealth()<10){
- this.health = 40;
- }
- boolean add = true;
+ if (this.getHealth() < 10) {
+ this.health = 40;
+ }
+ boolean add = true;
for (BaseNpc baseNpc : onlineNpcList) {
if (baseNpc == this) {
add = false;
break;
}
}
- if(add){
+ if (add) {
onlineNpcList.add(this);
}
- Player p;
- int idr = 0;
- this.addEffect((new Effect(11, "test", 0, 0, 0, false)).setDuration(20).setAmplifier(5).setAmbient(true));
- if(online_players.size()>0) {
- ArrayList length = new ArrayList<>();
- for (Player online_player : online_players) {
- p = online_player;
- double dx = (p.x - this.x);
- double dy = (p.y - this.y);
- double dz = (p.z - this.z);
- double l = dx * dx + dy * dy + dz * dz;
- if (l < 200) {
- length.add(l);
- } else length.add(300D);
- }
- for (int j = 0; j < length.size(); j++) {
- if (length.get(j) < length.get(idr)) {
- idr = j;
- }
- }
- if (length.get(idr) < 200) {
- for (int k = 0; k < idr + 1; k++) {
- if (k == idr) {
- p = online_players.get(k);
- double dx = this.x - p.x;
- double dy = this.y - p.y;
- double dz = this.z - p.z;
- double yaw = Math.asin(dx / Math.sqrt(dx * dx + dz * dz)) / Math.PI * 180.0D;
- double pitch = Math.round(Math.asin(dy / Math.sqrt(dx * dx + dz * dz + dy * dy)) / Math.PI * 180.0D);
- if (dz > 0.0D) {
- yaw = -yaw + 180.0D;
- }
- this.yaw = yaw;
- this.pitch = pitch;
- }
- }
+ Player p;
+ int idr = 0;
+ this.addEffect((new Effect(11, "test", 0, 0, 0, false)).setDuration(20).setAmplifier(5).setAmbient(true));
+ if (online_players.size() > 0) {
+ ArrayList length = new ArrayList<>();
+ for (Player online_player : online_players) {
+ p = online_player;
+ double dx = (p.x - this.x);
+ double dy = (p.y - this.y);
+ double dz = (p.z - this.z);
+ double l = dx * dx + dy * dy + dz * dz;
+ if (l < 200) {
+ length.add(l);
+ } else length.add(300D);
+ }
+ for (int j = 0; j < length.size(); j++) {
+ if (length.get(j) < length.get(idr)) {
+ idr = j;
+ }
+ }
+ if (length.get(idr) < 200) {
+ for (int k = 0; k < idr + 1; k++) {
+ if (k == idr) {
+ p = online_players.get(k);
+ double dx = this.x - p.x;
+ double dy = this.y - p.y;
+ double dz = this.z - p.z;
+ double yaw = Math.asin(dx / Math.sqrt(dx * dx + dz * dz)) / Math.PI * 180.0D;
+ double pitch = Math.round(Math.asin(dy / Math.sqrt(dx * dx + dz * dz + dy * dy)) / Math.PI * 180.0D);
+ if (dz > 0.0D) {
+ yaw = -yaw + 180.0D;
}
+ this.yaw = yaw;
+ this.pitch = pitch;
}
+ }
+ }
+ }
return alive;
}
@@ -187,16 +187,16 @@ public boolean onInteract(Player p, Item item, Vector3 clickedPos) {
// this.getServer().updatePlayerListData(this.getUniqueId(),this.getId(),this.getName(),this.getSkin());
//updatePlayerListData是增加到ScoreboardList玩家列表中,皮肤刷新时需要用到,可以remove取消列表显示!
this.spawnToAll();
- this.level.addSound(this, Sound.LAND_BONE_BLOCK);
- p.showFormWindow(HuTao_Windows(p,this));
- return true;
+ this.level.addSound(this, Sound.LAND_BONE_BLOCK);
+ p.showFormWindow(HuTao_Windows(p, this));
+ return true;
}
@Override
public Item[] getDrops() {
//取消掉落物防止kill @e
List- drops = new ArrayList<>();
- drops.add(Item.get(Item.AIR, 0, 0));
+ drops.add(Item.get(Item.AIR, 0, 0));
return drops.toArray(new Item[0]);
}
@@ -246,13 +246,13 @@ public boolean canClimb() {
}
@Override
- public void setNameTag(String name) {
- super.setNameTag(this.config.get("name") != null ? this.config.getString("name") : "npc");
+ public String getNameTag() {
+ return this.config.get("name") != null ? this.config.getString("name") : "npc";
}
@Override
- public String getNameTag() {
- return this.config.get("name") != null ? this.config.getString("name") : "npc";
+ public void setNameTag(String name) {
+ super.setNameTag(this.config.get("name") != null ? this.config.getString("name") : "npc");
}
@Override
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Car1.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Car1.java
index 2118daf..de595b4 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Car1.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Entity/Car1.java
@@ -25,6 +25,10 @@ public class Car1 extends Entity implements CustomEntity, EntityRideable {
public double mx;
public double my;
+ public Car1(FullChunk chunk, CompoundTag tag) {
+ super(chunk, tag);
+ }
+
@Override
public CustomEntityDefinition getDefinition() {
return def;
@@ -41,12 +45,8 @@ public int getNetworkId() {
return NETWORK_ID;
}
- public Car1(FullChunk chunk, CompoundTag tag) {
- super(chunk, tag);
- }
-
@Override
- public void initEntity(){
+ public void initEntity() {
super.initEntity();
this.setMaxHealth(40);
this.spawnToAll();
@@ -54,7 +54,7 @@ public void initEntity(){
@Override
public boolean isAlive() {
- if(this.scale != 0.5){
+ if (this.scale != 0.5) {
this.setScale(0.5f);
}
if (online_players.size() > 0) {
@@ -85,11 +85,11 @@ public boolean isAlive() {
}
}
}
- if(this.passengers.size() == 0){
- if(this.getLevel().getBlock((int) this.x, (int) (this.y-0.15), (int) this.z).getId() == 0){
- this.fastMove(0 , -0.15 , 0);
- } else if (this.getLevel().getBlock((int) this.x, (int) (this.y-0.04), (int) this.z).getId() == 0) {
- this.fastMove(0 , -0.04 , 0);
+ if (this.passengers.size() == 0) {
+ if (this.getLevel().getBlock((int) this.x, (int) (this.y - 0.15), (int) this.z).getId() == 0) {
+ this.fastMove(0, -0.15, 0);
+ } else if (this.getLevel().getBlock((int) this.x, (int) (this.y - 0.04), (int) this.z).getId() == 0) {
+ this.fastMove(0, -0.04, 0);
}
}
return super.isAlive();
@@ -113,11 +113,11 @@ public boolean onInteract(Player p, Item item, Vector3 clickedPos) {
}
}
}
- if(!has_ride){
+ if (!has_ride) {
this.level.addSound(this, Sound.LAND_BONE_BLOCK);
p.riding = this;
byte b = 1;
- this.mountEntity(p,b);
+ this.mountEntity(p, b);
this.isControlling(p);
p.sendTip("乘坐成功");
}
@@ -133,7 +133,8 @@ public boolean mountEntity(Entity entity) {
}
return super.mountEntity(entity, mode);
}
-@Override
+
+ @Override
public boolean mountEntity(Entity entity, byte mode) {
boolean r = super.mountEntity(entity, mode);
if (entity.riding == this) {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/boots_1.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/boots_1.java
index c6cbe76..0bd7410 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/boots_1.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/boots_1.java
@@ -9,7 +9,7 @@
import java.util.List;
-public class boots_1 extends ItemCustomArmor{
+public class boots_1 extends ItemCustomArmor {
public boots_1() {
super("np:boot_1", "§d紫水晶护靴", "amethyst_boots");
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/chests_1.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/chests_1.java
index 81084fe..ae8b90f 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/chests_1.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/chests_1.java
@@ -9,7 +9,7 @@
import java.util.List;
-public class chests_1 extends ItemCustomArmor{
+public class chests_1 extends ItemCustomArmor {
public chests_1() {
super("np:chest_1", "§d紫水晶盔甲", "amethyst_chestplate");
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/helmets_1.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/helmets_1.java
index c8f1921..f923beb 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/helmets_1.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/helmets_1.java
@@ -9,7 +9,7 @@
import java.util.List;
-public class helmets_1 extends ItemCustomArmor{
+public class helmets_1 extends ItemCustomArmor {
public helmets_1() {
super("np:helmet_1", "§d紫水晶头盔", "amethyst_helmet");
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/leggings_1.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/leggings_1.java
index 92432ed..bf7318d 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/leggings_1.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Armors/leggings_1.java
@@ -9,7 +9,7 @@
import java.util.List;
-public class leggings_1 extends ItemCustomArmor{
+public class leggings_1 extends ItemCustomArmor {
public leggings_1() {
super("np:leggings_1", "§d紫水晶裤衩", "amethyst_leggings");
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Custom_Pickaxe.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Custom_Pickaxe.java
index fabd998..5cea8e8 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Custom_Pickaxe.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Custom_Pickaxe.java
@@ -5,7 +5,6 @@
import cn.nukkit.item.customitem.CustomItemDefinition;
import cn.nukkit.item.customitem.ItemCustomTool;
import cn.nukkit.item.customitem.data.ItemCreativeCategory;
-import cn.nukkit.item.customitem.data.Offset;
import cn.nukkit.item.customitem.data.RenderOffsets;
public class Custom_Pickaxe extends ItemCustomTool {
@@ -24,13 +23,7 @@ public CustomItemDefinition getDefinition() {
.handEquipped(true)
//If true is the way the tool is displayed, false is the item
.foil(false)
- .renderOffsets(new RenderOffsets(
- Offset.builder().position(-0.2f, -0.5f , -1f).rotation(60f, 35f, 90f).scale(1f,1f,1f),
- Offset.builder().position(0.7f,0.2f,-1f).rotation(120f, 70f, 160f).scale(1f,1f,1f),
- Offset.builder().position(0f,0f,0f).rotation(60f, 35f, 90f).scale(1f,1f,1f),
- Offset.builder().position(0f,0f,0f).rotation(60f, 35f, 90f).scale(1f,1f,1f)
- )
- )
+ .renderOffsets(RenderOffsets.scaleOffset(64))
//Items with enchanted light
.build();
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Edibles/Fire_Pepper_Item.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Edibles/Fire_Pepper_Item.java
index d33448d..90acdaa 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Edibles/Fire_Pepper_Item.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Edibles/Fire_Pepper_Item.java
@@ -13,18 +13,18 @@
import static cn.nukkit.network.protocol.CameraShakePacket.CameraShakeAction.ADD;
import static cn.nukkit.network.protocol.CameraShakePacket.CameraShakeType.ROTATIONAL;
-public class Fire_Pepper_Item extends ItemCustomEdible {
- private FoodNormal food;
+public class Fire_Pepper_Item extends ItemCustomEdible {
+ private FoodNormal food;
- public Fire_Pepper_Item() {
- super("np:lajiao", "绝云椒椒", "lajiao");
- }
+ public Fire_Pepper_Item() {
+ super("np:lajiao", "绝云椒椒", "lajiao");
+ }
@Override
public CustomItemDefinition getDefinition() {
return CustomItemDefinition
- .edibleBuilder(this,ItemCreativeCategory.ITEMS)
+ .edibleBuilder(this, ItemCreativeCategory.ITEMS)
.allowOffHand(true)
.handEquipped(false)
.foil(true)
@@ -32,13 +32,8 @@ public CustomItemDefinition getDefinition() {
}
@Override
- public int getTier() {
- return Item.CARROT;
- }
-
- @Override
- public Item setLore(String... lines) {
- return this;
+ public int getTier() {
+ return Item.CARROT;
}
@Override
@@ -62,16 +57,16 @@ public boolean onUse(Player player, int ticksUsed) {
return false;
} else {
Food food = Food.getByRelative(this);
- player.completeUsingItem(this.getNetworkId(), 1);
- player.getLevel().addSound(player, Sound.RANDOM_BURP);
- if (!player.isCreative() && !player.isSpectator()) {
- --this.count;
- player.getInventory().setItemInHand(this);
- //修改背包物品,此行代码不可缺少!
- player.fireTicks=160;
- player.shakeCamera(0.5F,3F,ROTATIONAL,ADD);
- player.getFoodData().addFoodLevel(2,1.5F);
- }
+ player.completeUsingItem(this.getNetworkId(), 1);
+ player.getLevel().addSound(player, Sound.RANDOM_BURP);
+ if (!player.isCreative() && !player.isSpectator()) {
+ --this.count;
+ player.getInventory().setItemInHand(this);
+ //修改背包物品,此行代码不可缺少!
+ player.fireTicks = 160;
+ player.shakeCamera(0.5F, 3F, ROTATIONAL, ADD);
+ player.getFoodData().addFoodLevel(2, 1.5F);
+ }
return true;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_1.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_1.java
index 50d4aaf..96518cd 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_1.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_1.java
@@ -18,8 +18,9 @@
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
-public class sword_1 extends ItemCustomTool{
+public class sword_1 extends ItemCustomTool {
TaskHandler handler;
+
public sword_1() {
super("np:sword_1", "§d武士刀·参之形", "sword_1");
}
@@ -38,20 +39,20 @@ public CustomItemDefinition getDefinition() {
.handEquipped(true)
.foil(false)
.renderOffsets(new RenderOffsets(
- Offset.builder().position(-0.2f, -0.5f , -1f).rotation(60f, 35f, 90f),
- Offset.builder().position(0.7f,2f,-1f),
- Offset.builder().position(0f,0f,0f),
- Offset.builder().position(0f,0f,0f)
+ Offset.builder().position(-0.2f, -0.5f, -1f).rotation(60f, 35f, 90f),
+ Offset.builder().position(0.7f, 2f, -1f),
+ Offset.builder().position(0f, 0f, 0f),
+ Offset.builder().position(0f, 0f, 0f)
)
)
.customBuild(nbt -> {
- nbt.getCompound("components")
- .putCompound("minecraft:cooldown", new CompoundTag()
- .putString("category", "sword_1")
- .putFloat("duration", 3f))
- .getCompound("item_properties").putBoolean("animates_in_toolbar", true)
- .getCompound("item_properties").putInt("use_duration", 640);
- });
+ nbt.getCompound("components")
+ .putCompound("minecraft:cooldown", new CompoundTag()
+ .putString("category", "sword_1")
+ .putFloat("duration", 3f))
+ .getCompound("item_properties").putBoolean("animates_in_toolbar", true)
+ .getCompound("item_properties").putInt("use_duration", 640);
+ });
}
@Override
@@ -66,13 +67,13 @@ public boolean onClickAir(Player player, Vector3 directionVector) {
player.addTag("noUseStab");
AtomicInteger i = new AtomicInteger();
handler = Server.getInstance().getScheduler().scheduleRepeatingTask(Server.getInstance().getPluginManager().getPlugin("Penguin_Plugin_1"), () -> {
- if(i.get() >=1){
+ if (i.get() >= 1) {
player.removeTag("noUseStab");
handler.cancel();
}
i.getAndIncrement();
}, 60);
- }else {
+ } else {
player.sendTip("冷却中!");
}
return super.onClickAir(player, directionVector);
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_2.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_2.java
index e66cdc9..bbe737f 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_2.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Saber/sword_2.java
@@ -29,10 +29,10 @@ public CustomItemDefinition getDefinition() {
.handEquipped(true)
.foil(false)
.renderOffsets(new RenderOffsets(
- Offset.builder().position(-0.2f, -0.5f , -1f).rotation(60f, 35f, 90f),
- Offset.builder().position(0.7f,2f,-1f),
- Offset.builder().position(0f,0f,0f),
- Offset.builder().position(0f,0f,0f)
+ Offset.builder().position(-0.2f, -0.5f, -1f).rotation(60f, 35f, 90f),
+ Offset.builder().position(0.7f, 2f, -1f),
+ Offset.builder().position(0f, 0f, 0f),
+ Offset.builder().position(0f, 0f, 0f)
)
)
.build();
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_egg.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_egg.java
index d35ca2a..41e4fe1 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_egg.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_egg.java
@@ -44,15 +44,15 @@ public CustomItemDefinition getDefinition() {
@Override
public boolean onClickAir(Player player, Vector3 directionVector) {
if (!player.containTag("noUseStab")) {
- if(!anchor_information.name.contains(player.getInventory().getItemInHand().getName())){
- Anchor anchor = new Anchor(player.getLocation().getChunk(), Entity.getDefaultNBT(player.getPosition())
- .putString("account","null")
+ if (!anchor_information.name.contains(player.getInventory().getItemInHand().getName())) {
+ Anchor anchor = new Anchor(player.getLocation().getChunk(), Entity.getDefaultNBT(player.getPosition())
+ .putString("account", "null")
.putCompound("Skin", (new CompoundTag()))
);
anchor.setNameTag(player.getInventory().getItemInHand().getName());
anchor.spawnTo(player);
player.sendMessage("You Create a Anchor name " + player.getInventory().getItemInHand().getName());
- }else{
+ } else {
player.sendMessage("已经有该名的传送锚点了,请用铁砧改名手中的物品");
}
@@ -61,13 +61,13 @@ public boolean onClickAir(Player player, Vector3 directionVector) {
player.addTag("noUseStab");
AtomicInteger i = new AtomicInteger();
handler = Server.getInstance().getScheduler().scheduleRepeatingTask(Server.getInstance().getPluginManager().getPlugin("Penguin_Plugin_1"), () -> {
- if(i.get() >=1){
+ if (i.get() >= 1) {
player.removeTag("noUseStab");
handler.cancel();
}
i.getAndIncrement();
}, 60);
- }else {
+ } else {
player.sendTip("冷却中!");
}
return super.onClickAir(player, directionVector);
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_information.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_information.java
index 34a9ecb..b1366dd 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_information.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Summon_egg/anchor_information.java
@@ -7,6 +7,7 @@
public class anchor_information {
public static ArrayList name = new ArrayList<>();
public static ArrayList vector3 = new ArrayList<>();
+
public static void anchor_info(String name, Vector3 vector3) {
anchor_information.name.add(name);
anchor_information.vector3.add(vector3);
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/BuildGod_Item.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/BuildGod_Item.java
index 5ef7a4a..0eae75d 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/BuildGod_Item.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/BuildGod_Item.java
@@ -45,11 +45,6 @@ public int getTier() {
return 4;
}
- @Override
- public Item setLore(String... lines) {
- return this;
- }
-
// @Override
// public boolean allowOffHand() {
// return false;
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/TheWorld_Menu_Item.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/TheWorld_Menu_Item.java
index 5abfefb..eb02823 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/TheWorld_Menu_Item.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Items/Tools/TheWorld_Menu_Item.java
@@ -11,6 +11,15 @@
public class TheWorld_Menu_Item extends ItemCustomTool implements Listener {
+ static {
+ Server.getInstance().getScheduler().scheduleRepeatingTask(Server.getInstance().getPluginManager().getPlugin("Penguin_Plugin_1"), () -> Server.getInstance().getOnlinePlayers().values().forEach(player -> {
+ if (player.getInventory().getItemInHand() instanceof TheWorld_Menu_Item) {
+ if (player.getFoodData().getLevel() == player.getFoodData().getMaxLevel())
+ player.getFoodData().setLevel(player.getFoodData().getMaxLevel() - 1);
+ }
+ }), 20);
+ }
+
public TheWorld_Menu_Item() {
super("np:world_menu", "世界菜单", "world_menu");
}
@@ -31,15 +40,6 @@ public CustomItemDefinition getDefinition() {
.build();
}
- static {
- Server.getInstance().getScheduler().scheduleRepeatingTask(Server.getInstance().getPluginManager().getPlugin("Penguin_Plugin_1"), () -> Server.getInstance().getOnlinePlayers().values().forEach(player -> {
- if (player.getInventory().getItemInHand() instanceof TheWorld_Menu_Item) {
- if (player.getFoodData().getLevel() == player.getFoodData().getMaxLevel())
- player.getFoodData().setLevel(player.getFoodData().getMaxLevel() - 1);
- }
- }), 20);
- }
-
// 旧版右键,有延迟。已迁移至监听器
// public boolean onUse(Player player, int ticksUsed) {
// PlayerItemConsumeEvent EatEvent = new PlayerItemConsumeEvent(player,this);
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Main_PluginBase.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Main_PluginBase.java
index dd23788..bb596f5 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Main_PluginBase.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Main_PluginBase.java
@@ -33,11 +33,13 @@
import cn.nukkit.nbt.tag.CompoundTag;
import cn.nukkit.plugin.PluginBase;
import cn.nukkit.plugin.PluginLogger;
+import cn.nukkit.scoreboard.data.DisplaySlot;
+import cn.nukkit.scoreboard.scoreboard.Scoreboard;
import cn.nukkit.utils.Config;
+import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -56,8 +58,8 @@ public class Main_PluginBase extends PluginBase implements Listener {
public static Map> undo_map = new HashMap<>();
static Player Plugin_player;
- ArrayList v_collect = new ArrayList<>();
static ArrayList access_p = new ArrayList<>();
+ ArrayList v_collect = new ArrayList<>();
Config player_join;
public static void access(Player player) {
@@ -66,47 +68,28 @@ public static void access(Player player) {
Plugin_player = player;
}
- private void LoadWorld() {
- File[] listFiles = new File("worlds").listFiles();
- //导入新世界(非家园)
- assert listFiles != null;
- for (File wFolder : listFiles) {
- if (wFolder.isDirectory() && !getServer().isLevelLoaded(wFolder.getName())) {
- if (!wFolder.getName().contains("的家园")) {
- getServer().loadLevel(wFolder.getName());
- }
- }
- }
- }
-
public void onLoad() {
// 注释文本abc
PluginLogger log = this.getLogger();
if (Item.fromString("np:world_menu").equals(Item.get(0))) {
- try {
- Entity.registerCustomEntity(new CustomClassEntityProvider(BaseNpc.def, BaseNpc.class));
- Entity.registerCustomEntity(new CustomClassEntityProvider(Car1.def, Car1.class));
- Entity.registerCustomEntity(new CustomClassEntityProvider(Anchor.def , Anchor.class));
- Item.registerCustomItem(List.of(Custom_Pickaxe.class , TheWorld_Menu_Item.class,
- Fire_Pepper_Item.class , BuildGod_Item.class , sword_1.class , sword_2.class ,
- anchor_egg.class , helmets_1.class , leggings_1.class , boots_1.class , chests_1.class
- ));
- Block.registerCustomBlock(List.of(test_slab.class , block1.class, block2.class, block3.class, block4.class,
- block5.class, block6.class, block7.class, block8.class, block9.class, block10.class,
- block11.class, block12.class, block13.class, block14.class, block15.class, block16.class,
- block17.class, block18.class, block19.class, block20.class, block21.class, block22.class,
- block23.class, block24.class, block25.class, block26.class, block27.class, block28.class,
- block29.class, block30.class, block31.class, block32.class, block33.class, block34.class,
- block35.class, block36.class, block37.class, block38.class, block39.class, block40.class));
- } catch (NoSuchMethodException | InstantiationException | IllegalAccessException |
- InvocationTargetException e) {
- log.info("§c实验性玩法插件启动失败!");
- e.printStackTrace();
- }
+ Entity.registerCustomEntity(new CustomClassEntityProvider(BaseNpc.def, BaseNpc.class));
+ Entity.registerCustomEntity(new CustomClassEntityProvider(Car1.def, Car1.class));
+ Entity.registerCustomEntity(new CustomClassEntityProvider(Anchor.def, Anchor.class));
+ Item.registerCustomItem(List.of(Custom_Pickaxe.class, TheWorld_Menu_Item.class,
+ Fire_Pepper_Item.class, BuildGod_Item.class, sword_1.class, sword_2.class,
+ anchor_egg.class, helmets_1.class, leggings_1.class, boots_1.class, chests_1.class
+ ));
+ Block.registerCustomBlock(List.of(test_slab.class, block1.class, block2.class, block3.class, block4.class,
+ block5.class, block6.class, block7.class, block8.class, block9.class, block10.class,
+ block11.class, block12.class, block13.class, block14.class, block15.class, block16.class,
+ block17.class, block18.class, block19.class, block20.class, block21.class, block22.class,
+ block23.class, block24.class, block25.class, block26.class, block27.class, block28.class,
+ block29.class, block30.class, block31.class, block32.class, block33.class, block34.class,
+ block35.class, block36.class, block37.class, block38.class, block39.class, block40.class));
} else {
Entity.registerCustomEntity(new CustomClassEntityProvider(BaseNpc.def, BaseNpc.class));
Entity.registerCustomEntity(new CustomClassEntityProvider(Car1.def, Car1.class));
- Entity.registerCustomEntity(new CustomClassEntityProvider(Anchor.def , Anchor.class));
+ Entity.registerCustomEntity(new CustomClassEntityProvider(Anchor.def, Anchor.class));
log.info("§b插件新增物已加载,避免Warn已经取消方块的载入");
Map online_list = Server.getInstance().getOnlinePlayers();
@@ -201,7 +184,6 @@ public void onEnable() {
}
npc_config.save();
-
this.getServer().getScheduler().scheduleRepeatingTask(this, () -> {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss");
Date date = new Date(System.currentTimeMillis());
@@ -217,7 +199,7 @@ public void onEnable() {
}
// 定时获取在线玩家列表
Map online_list = Server.getInstance().getOnlinePlayers();
- online_players = new ArrayList<>();
+ online_players = new ArrayList<>();
if (online_list.size() > 0) {
Iterator keyIterator = online_list.keySet().iterator();
for (int i = 0; i < online_list.size(); i++) {
@@ -226,15 +208,15 @@ public void onEnable() {
}
}
// reload后一键添加空对象(创世神)
- if(build_map.size() ==0){
+ if (build_map.size() == 0) {
for (Player online_player : online_players) {
- build_map.put(online_player.getName(),new ArrayList<>());
+ build_map.put(online_player.getName(), new ArrayList<>());
}
}
- if(undo_map.size() ==0){
+ if (undo_map.size() == 0) {
for (Player online_player : online_players) {
- undo_map.put(online_player.getName(),new ArrayList<>());
+ undo_map.put(online_player.getName(), new ArrayList<>());
}
}
@@ -260,9 +242,26 @@ public void onEnable() {
} else {
Biomes = Biome.getBiome(BiomesList[list_idr]).getName();
}
- p.sendActionBar("§6群系:" + Biomes + " §aPing:" + p.getPing() + "ms"
- + "\n§c方块:" + TargetBlock + " (" + ID + ":" + ID_DATA + ")"
- + "\n§b手持:" + p.getInventory().getItemInHand().getName() + " ID:" + p.getInventory().getItemInHand().getId());
+ //玩家独立显示积分榜
+ Scoreboard showInfo = new Scoreboard("playerInfo", "§o§6mc.zj.cn");
+ List line = new ArrayList<>();
+ line.add("§b群系: §f" + Biomes + " ");
+ line.add("§aPing: §f" + p.getPing() + "ms ");
+ line.add("§c世界: §f" + p.getLevelName() + " ");
+ line.add("§d玩家: §f" + online_players.size() + " / " + p.getServer().getMaxPlayers());
+ line.add("§e金币: §f0 ");
+ showInfo.setLines(line);
+
+ p.removeScoreboard(showInfo);
+ p.display(showInfo, DisplaySlot.SIDEBAR);
+
+ showInfo.removeAllLine(false);
+ showInfo.resend();
+ //resend();向所有观察者重新发送此计分板以及行信息
+ //例如当对计分板进行了大量的更改后,调用此方法可节省大量带宽
+
+ p.sendTip("§c准心:" + TargetBlock + " (" + ID + ":" + ID_DATA + ")"
+ + " §b手持:" + p.getInventory().getItemInHand().getName() + " ID:" + p.getInventory().getItemInHand().getId());
}
}
@@ -332,7 +331,7 @@ public void onEnable() {
}, 10);
}
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
+ public boolean onCommand(CommandSender sender, @NotNull Command command, String label, String[] args) {
Player p = (Player) sender;
if (command.getName().equals("get")) {
boolean NewPlayer = true;
@@ -376,10 +375,10 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
p.showFormWindow(getBuildWindow());
}
- if (command.getName().equals("biomes")){
+ if (command.getName().equals("biomes")) {
//player.onChunkChanged(FullChunk c) SuperIce666推荐,发送区块更新到玩家;
- int x = p.getChunkX(),z=p.getChunkZ();
- if(args.length==1 && !Objects.equals(args[0], "list")) {
+ int x = p.getChunkX(), z = p.getChunkZ();
+ if (args.length == 1 && !Objects.equals(args[0], "list")) {
byte id = Byte.parseByte(args[0]);
for (int i = 0; i < 16; i++) {
for (int j = 0; j < 16; j++) {
@@ -389,7 +388,7 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}
// p.getServer().getLevel(p.getLevel().getId()).generateChunk(x,z); //重载区块
p.onChunkChanged(p.getChunk());
- } else if (args.length==1 && args[0].equals("list")) {
+ } else if (args.length == 1 && args[0].equals("list")) {
p.sendMessage(Arrays.toString(Objects.requireNonNull(p.getChunk()).getBiomeIdArray()));
StringBuilder BiomesList = new StringBuilder();
for (int i = 0; i < Biome.unorderedBiomes.size(); i++) {
@@ -397,32 +396,35 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}
p.sendMessage("§b群系列表:\n" + BiomesList);
p.sendMessage("你所在块的群系为: " + Biome.getBiome(p.getLevel().getBiomeId(x, z)).getName());
- }else p.sendMessage("§a/Biomes list 列出已有全部群系类型ID\n§b/Biomes [ID] 将你所在的区块改为对应id类型的群系");
+ } else
+ p.sendMessage("§a/Biomes list 列出已有全部群系类型ID\n§b/Biomes [ID] 将你所在的区块改为对应id类型的群系");
}
if (command.getName().equals("round")) {
- if(args.length==1){
+ if (args.length == 1) {
p.sendMessage("你好像没有写要填充什么方块吗?仔细看看哦");
- }else if(args.length>1){
+ } else if (args.length > 1) {
p.sendMessage("§c严禁使用下落方块,掉落物,液体!否则立马删除OP!不管你是谁!");
- round(p,args);
- }else p.sendMessage("画圆指令用法:/round 半径(整数,必选) 方块ID(必选) 方块特殊值(可选)keep(保持,可选,使用时,方块特殊值必须要写)");
+ round(p, args);
+ } else
+ p.sendMessage("画圆指令用法:/round 半径(整数,必选) 方块ID(必选) 方块特殊值(可选)keep(保持,可选,使用时,方块特殊值必须要写)");
}
if (command.getName().equals("ball")) {
- if(args.length==1){
+ if (args.length == 1) {
p.sendMessage("你好像没有写要填充什么方块吗?仔细看看哦");
- }else if(args.length>1){
+ } else if (args.length > 1) {
p.sendMessage("§c严禁使用下落方块,掉落物,液体!否则立马删除OP!不管你是谁!");
SayCommand.broadcastCommandMessage(sender, "§a" + p.getName() + "使用了" + Arrays.toString(args));
- ball(p,args);
- }else p.sendMessage("画球指令用法:/ball 半径(整数,必选) 方块ID(必选) 方块特殊值(可选)keep(保持,可选,使用时,方块特殊值必须要写)");
+ ball(p, args);
+ } else
+ p.sendMessage("画球指令用法:/ball 半径(整数,必选) 方块ID(必选) 方块特殊值(可选)keep(保持,可选,使用时,方块特殊值必须要写)");
}
if (command.getName().equals("zoom") && args.length == 2) {
p = this.getServer().getPlayer(args[0]);
float a = Float.parseFloat(args[1]);
- if ((double)a >= 0.5 && a <= 3.0F) {
+ if ((double) a >= 0.5 && a <= 3.0F) {
p.setScale(a);
sender.sendMessage("§a§mSuccess!");
p.sendMessage("§b§m你的身体已被缩放!");
@@ -454,22 +456,22 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}
if (command.getName().equals("ping")) {
- p = (Player)sender;
+ p = (Player) sender;
String device;
if (args.length == 0) {
- if(p.getLoginChainData().getDeviceOS() ==7){
- device = "PC端";
- }else {
- device ="移动端";
+ if (p.getLoginChainData().getDeviceOS() == 7) {
+ device = "PC端";
+ } else {
+ device = "移动端";
}
p.sendMessage("§b§mPort: " + p.getPort() + "§a\nPing: " + p.getPing() + "§6ms\n你正在 " +
- device + " 上玩我的世界!");
+ device + " 上玩我的世界!");
} else {
p.sendMessage("§m/ping");
}
- Car1 anchor = new Car1(p.getLocation().getChunk(), Entity.getDefaultNBT(p.getPosition())
- .putString("account","null")
+ Car1 anchor = new Car1(p.getLocation().getChunk(), Entity.getDefaultNBT(p.getPosition())
+ .putString("account", "null")
.putCompound("Skin", (new CompoundTag()))
);
anchor.spawnToAll();
@@ -478,9 +480,9 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
}
if (command.getName().equals("achievement")) {
- p = (Player)sender;
+ p = (Player) sender;
if (args.length == 0) {
- p.sendMessage("§g§m你的成就列表:\n" + ((Player)sender).achievements);
+ p.sendMessage("§g§m你的成就列表:\n" + ((Player) sender).achievements);
} else if (args.length == 2 && args[1].equals("clear")) {
p = this.getServer().getPlayer(args[0]);
if (p == sender) {
@@ -526,6 +528,11 @@ public boolean onCommand(CommandSender sender, Command command, String label, St
sender.sendMessage("现已改为/do");
}
+ if (command.getName().equals("map")) {
+ assert p != null;
+ System.out.println("aaa");
+ }
+
return true;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Player_Access.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Player_Access.java
index efb9b88..68c5e41 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Player_Access.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Player_Access.java
@@ -5,8 +5,8 @@
import java.util.ArrayList;
public class Player_Access {
- private Player player;
private final ArrayList player_id_list = new ArrayList();
+ private Player player;
public Player_Access() {
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/ServerListener.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/ServerListener.java
index 609badf..951bb95 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/ServerListener.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/ServerListener.java
@@ -16,6 +16,7 @@
import Minecraft.nukkit.cn.sohugepenguin.plugin.testPlugin.Windows.Socail.Social_Contact;
import Minecraft.nukkit.cn.sohugepenguin.plugin.testPlugin.Windows.Teleport.Teleport_Menu;
import cn.nukkit.Player;
+import cn.nukkit.block.Block;
import cn.nukkit.event.EventHandler;
import cn.nukkit.event.Listener;
import cn.nukkit.event.entity.EntityDamageByEntityEvent;
@@ -27,7 +28,6 @@
import cn.nukkit.item.Item;
import cn.nukkit.level.Sound;
import cn.nukkit.nbt.tag.CompoundTag;
-import cn.nukkit.potion.Effect;
import java.io.IOException;
import java.util.ArrayList;
@@ -83,11 +83,12 @@
//监听事件严禁加static,否则崩溃!
public class ServerListener implements Listener {
- int idr = 0;
static ArrayList p_list = new ArrayList<>();
static ArrayList p_get_Data = new ArrayList<>();
static ArrayList p_get_text = new ArrayList<>();
static ArrayList p_get_file = new ArrayList<>();
+ int idr = 0;
+
public ServerListener() {
}
@@ -106,8 +107,8 @@ public void Damage_Test(EntityDamageByEntityEvent event) {
if (damage < 0.01) {
damage = 0.0d;
}
- player.addEffect((new Effect(1, "test", 0, 0, 0, false)).setDuration(20).setAmplifier(5).setAmbient(true));
- event.getDamager().sendPotionEffects(player);
+// player.addEffect((new Effect(1, "test", 0, 0, 0, false)).setDuration(20).setAmplifier(5).setAmbient(true));
+// event.getDamager().sendPotionEffects(player);
player.sendActionBar("§l§c" + onGround + " §b- " + damage + "§4♥");
}
}
@@ -134,17 +135,18 @@ public void PlayerJoin(PlayerJoinEvent event) {
p.sendToast("\uE100§gApotheosis Ultramarine\uE100-->§b极海群青", "\uE103\uE100§m§6欢迎来到鹅鹅服务器§c玩法:§b空岛生存§r/§a世界经济§r/§c趣味游戏§r/§d建筑休闲§r等;\uE102\uE103");
// 玩家进入后即生成一个空对象(创世神)
- build_map.put(p.getName(),new ArrayList<>());
- undo_map.put(p.getName(),new ArrayList<>());
+ build_map.put(p.getName(), new ArrayList<>());
+ undo_map.put(p.getName(), new ArrayList<>());
}
@EventHandler
// 物品互动识别
- public void RightClickTest(PlayerInteractEvent event){
+ public void RightClickTest(PlayerInteractEvent event) {
Player player = event.getPlayer();
+ Block target = event.getBlock();
- if(Objects.requireNonNull(event.getItem()).getNamespaceId().equals("np:world_menu") &&
- event.getAction().toString().contains("RIGHT_CLICK_AIR")){
+ if (Objects.requireNonNull(event.getItem()).getNamespaceId().equals("np:world_menu") &&
+ event.getAction().toString().contains("RIGHT_CLICK_AIR")) {
player.getLevel().addSound(player, Sound.BREAK_DIRT_WITH_ROOTS);
player.showFormWindow(getWindowSimple(player));
}
@@ -152,63 +154,62 @@ public void RightClickTest(PlayerInteractEvent event){
if (Objects.requireNonNull(event.getItem()).getNamespaceId().equals("np:build_item") &&
(event.getAction().toString().contains("RIGHT_CLICK") ||
event.getAction().toString().contains("LEFT_CLICK")) &&
- !Objects.requireNonNull(event.getBlock()).toString().contains("Air") &&
- player.getLoginChainData().getDeviceOS() !=7) {
+ player.getLoginChainData().getDeviceOS() != 7) {
// 移动端
- WoodAxe.AddVector(event.getBlock(),player);
+ WoodAxe.AddVector(target, player);
} else if (Objects.requireNonNull(event.getItem()).getNamespaceId().equals("np:build_item") &&
event.getAction().toString().contains("LEFT_CLICK") &&
- !Objects.requireNonNull(event.getBlock()).toString().contains("Air") &&
- player.getLoginChainData().getDeviceOS() ==7) {
+ player.getLoginChainData().getDeviceOS() == 7) {
// PC端
- WoodAxe.AddVector(event.getBlock(),player);
+ WoodAxe.AddVector(target, player);
}
}
@EventHandler
- public void wasd_test(DataPacketReceiveEvent event){
+ public void wasd_test(DataPacketReceiveEvent event) {
//坐骑前后按键判定(赛车)
- if(event.getPacket().offset == 30 &&
+ if (event.getPacket().offset == 30 &&
event.getPlayer().riding != null &&
- event.getPlayer().riding.getName().equals("np:car1")){
- String[] list = event.getPacket().toString().split("=");
- StringBuilder x = new StringBuilder();
- StringBuilder y = new StringBuilder();
- boolean empty = true;
- for (String s : list) {
- for (int j = 0; j 0){
- car1.mx = 1d;
- }else if(Double.parseDouble(x.toString())<0){
- car1.mx = -1d;
+ if (!x.isEmpty()) {
+ empty = false;
+ }
+ if (!y.isEmpty()) {
+ break;
}
- if(Double.parseDouble(y.toString())>0){
+ }
+ Car1 car1 = (Car1) event.getPlayer().riding;
+ if (Double.parseDouble(x.toString()) > 0) {
+ car1.mx = 1d;
+ } else if (Double.parseDouble(x.toString()) < 0) {
+ car1.mx = -1d;
+ }
+ if (Double.parseDouble(y.toString()) > 0) {
car1.my = 1d;
- }else if(Double.parseDouble(y.toString())<0){
+ } else if (Double.parseDouble(y.toString()) < 0) {
car1.my = -1d;
- }
}
+ }
}
+
@EventHandler
//玩家退出事件
- public void ExitGameEvent(PlayerQuitEvent event){
+ public void ExitGameEvent(PlayerQuitEvent event) {
Player p = event.getPlayer();
p.removeTag("noUseStab");
}
@@ -216,55 +217,54 @@ public void ExitGameEvent(PlayerQuitEvent event){
@EventHandler
public void ChatSetting(PlayerChatEvent event) {
Player p = event.getPlayer();
- String LevelName = p.getLevelName();
String is_op = "§b";
if (p.isOp()) is_op = "§6<管理>";
- String device ="§d|移动端|";
- if(p.getLoginChainData().getDeviceOS() ==7) device ="§d|PC端|";
- event.setMessage(device + " §b[" + date_show + "]\n " + is_op +" §a『在" + LevelName + "』 :§r " + event.getMessage());
+ String device = "§d|移动端|";
+ if (p.getLoginChainData().getDeviceOS() == 7) device = "§d|PC端|";
+ event.setMessage(device + " §b[" + date_show + "]\n " + is_op + " §a『在" + p.getLevelName() + "』 :§r " + event.getMessage());
}
@EventHandler
- public void Build_Item_Menu(PlayerFormRespondedEvent event){
+ public void Build_Item_Menu(PlayerFormRespondedEvent event) {
Player p = event.getPlayer();
if (!(event.getWindow().getResponse() == null) && event.getWindow() instanceof FormWindowSimple simple) {
int page = simple.getResponse().getClickedButtonId();
- if(simple instanceof Build_Menu){
- switch (page){
+ if (simple instanceof Build_Menu) {
+ switch (page) {
case 0 -> p.showFormWindow(common_fill());
- case 1-> p.showFormWindow( Keep_Fill());
- case 2-> p.showFormWindow( Replace_Fill());
- case 3-> p.showFormWindow(Random_Filll());
- case 4-> undo_Fill(p);
+ case 1 -> p.showFormWindow(Keep_Fill());
+ case 2 -> p.showFormWindow(Replace_Fill());
+ case 3 -> p.showFormWindow(Random_Filll());
+ case 4 -> undo_Fill(p);
}
}
}
- if (!(event.getWindow().getResponse() == null) && event.getWindow() instanceof FormWindowCustom form){
- if(form instanceof CommonFill){
+ if (!(event.getWindow().getResponse() == null) && event.getWindow() instanceof FormWindowCustom form) {
+ if (form instanceof CommonFill) {
if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(3).equals("") &&
Integer_Test(form.getResponse().getInputResponse(1), p) &&
Integer_Test(form.getResponse().getInputResponse(3), p)) {
- if(build_map.get(p.getName()).size()==2){
+ if (build_map.get(p.getName()).size() == 2) {
common_fill_do(Integer.parseInt(form.getResponse().getInputResponse(1)),
Integer.parseInt(form.getResponse().getInputResponse(3)), p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
- }else p.sendMessage(" <不合法的ID值>");
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ } else p.sendMessage(" <不合法的ID值>");
- }else if (form instanceof KeepFill){
+ } else if (form instanceof KeepFill) {
if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(3).equals("") &&
Integer_Test(form.getResponse().getInputResponse(1), p) &&
Integer_Test(form.getResponse().getInputResponse(3), p)) {
- if(build_map.get(p.getName()).size()==2){
+ if (build_map.get(p.getName()).size() == 2) {
KeepFill_do(Integer.parseInt(form.getResponse().getInputResponse(1)),
Integer.parseInt(form.getResponse().getInputResponse(3)), p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
} else p.sendMessage(" <不合法的ID值>");
- }else if (form instanceof ReplaceFill){
+ } else if (form instanceof ReplaceFill) {
if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(3).equals("") &&
!form.getResponse().getInputResponse(5).equals("") &&
@@ -272,16 +272,16 @@ public void Build_Item_Menu(PlayerFormRespondedEvent event){
Integer_Test(form.getResponse().getInputResponse(1), p) &&
Integer_Test(form.getResponse().getInputResponse(3), p) &&
Integer_Test(form.getResponse().getInputResponse(5), p) &&
- Integer_Test(form.getResponse().getInputResponse(7), p) ) {
- if(build_map.get(p.getName()).size()==2){
+ Integer_Test(form.getResponse().getInputResponse(7), p)) {
+ if (build_map.get(p.getName()).size() == 2) {
ReplaceFill_do(Integer.parseInt(form.getResponse().getInputResponse(1)),
Integer.parseInt(form.getResponse().getInputResponse(3)),
Integer.parseInt(form.getResponse().getInputResponse(5)),
- Integer.parseInt(form.getResponse().getInputResponse(7)),p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ Integer.parseInt(form.getResponse().getInputResponse(7)), p);
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
} else p.sendMessage(" <不合法的ID值>");
- }else if (form instanceof RandomFill){
+ } else if (form instanceof RandomFill) {
if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(2).equals("") &&
!form.getResponse().getInputResponse(4).equals("") &&
@@ -295,14 +295,14 @@ public void Build_Item_Menu(PlayerFormRespondedEvent event){
Integer_Test(form.getResponse().getInputResponse(1), p) &&
Integer_Test(form.getResponse().getInputResponse(2), p) &&
Integer_Test(form.getResponse().getInputResponse(4), p) &&
- Integer_Test(form.getResponse().getInputResponse(5), p)&&
+ Integer_Test(form.getResponse().getInputResponse(5), p) &&
Integer_Test(form.getResponse().getInputResponse(7), p) &&
Integer_Test(form.getResponse().getInputResponse(8), p) &&
Integer_Test(form.getResponse().getInputResponse(10), p) &&
- Integer_Test(form.getResponse().getInputResponse(11), p)&&
+ Integer_Test(form.getResponse().getInputResponse(11), p) &&
Integer_Test(form.getResponse().getInputResponse(13), p) &&
Integer_Test(form.getResponse().getInputResponse(14), p)) {
- if(build_map.get(p.getName()).size()==2){
+ if (build_map.get(p.getName()).size() == 2) {
RandomFill.Random(Integer.parseInt(form.getResponse().getInputResponse(1)),
Integer.parseInt(form.getResponse().getInputResponse(2)),
Integer.parseInt(form.getResponse().getInputResponse(4)),
@@ -312,9 +312,9 @@ public void Build_Item_Menu(PlayerFormRespondedEvent event){
Integer.parseInt(form.getResponse().getInputResponse(10)),
Integer.parseInt(form.getResponse().getInputResponse(11)),
Integer.parseInt(form.getResponse().getInputResponse(13)),
- Integer.parseInt(form.getResponse().getInputResponse(14)),p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
- }else if (!form.getResponse().getInputResponse(1).equals("") &&
+ Integer.parseInt(form.getResponse().getInputResponse(14)), p);
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ } else if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(2).equals("") &&
!form.getResponse().getInputResponse(4).equals("") &&
!form.getResponse().getInputResponse(5).equals("") &&
@@ -325,12 +325,12 @@ public void Build_Item_Menu(PlayerFormRespondedEvent event){
Integer_Test(form.getResponse().getInputResponse(1), p) &&
Integer_Test(form.getResponse().getInputResponse(2), p) &&
Integer_Test(form.getResponse().getInputResponse(4), p) &&
- Integer_Test(form.getResponse().getInputResponse(5), p)&&
+ Integer_Test(form.getResponse().getInputResponse(5), p) &&
Integer_Test(form.getResponse().getInputResponse(7), p) &&
Integer_Test(form.getResponse().getInputResponse(8), p) &&
Integer_Test(form.getResponse().getInputResponse(10), p) &&
- Integer_Test(form.getResponse().getInputResponse(11), p)){
- if(build_map.get(p.getName()).size()==2){
+ Integer_Test(form.getResponse().getInputResponse(11), p)) {
+ if (build_map.get(p.getName()).size() == 2) {
RandomFill.Random(Integer.parseInt(form.getResponse().getInputResponse(1)),
Integer.parseInt(form.getResponse().getInputResponse(2)),
Integer.parseInt(form.getResponse().getInputResponse(4)),
@@ -338,9 +338,9 @@ public void Build_Item_Menu(PlayerFormRespondedEvent event){
Integer.parseInt(form.getResponse().getInputResponse(7)),
Integer.parseInt(form.getResponse().getInputResponse(8)),
Integer.parseInt(form.getResponse().getInputResponse(10)),
- Integer.parseInt(form.getResponse().getInputResponse(11)),p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
- }else if (!form.getResponse().getInputResponse(1).equals("") &&
+ Integer.parseInt(form.getResponse().getInputResponse(11)), p);
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ } else if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(2).equals("") &&
!form.getResponse().getInputResponse(4).equals("") &&
!form.getResponse().getInputResponse(5).equals("") &&
@@ -349,17 +349,17 @@ public void Build_Item_Menu(PlayerFormRespondedEvent event){
Integer_Test(form.getResponse().getInputResponse(1), p) &&
Integer_Test(form.getResponse().getInputResponse(2), p) &&
Integer_Test(form.getResponse().getInputResponse(4), p) &&
- Integer_Test(form.getResponse().getInputResponse(5), p)&&
+ Integer_Test(form.getResponse().getInputResponse(5), p) &&
Integer_Test(form.getResponse().getInputResponse(7), p) &&
Integer_Test(form.getResponse().getInputResponse(8), p)) {
- if(build_map.get(p.getName()).size()==2){
+ if (build_map.get(p.getName()).size() == 2) {
RandomFill.Random(Integer.parseInt(form.getResponse().getInputResponse(1)),
Integer.parseInt(form.getResponse().getInputResponse(2)),
Integer.parseInt(form.getResponse().getInputResponse(4)),
Integer.parseInt(form.getResponse().getInputResponse(5)),
Integer.parseInt(form.getResponse().getInputResponse(7)),
- Integer.parseInt(form.getResponse().getInputResponse(8)),p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ Integer.parseInt(form.getResponse().getInputResponse(8)), p);
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
} else if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(2).equals("") &&
!form.getResponse().getInputResponse(4).equals("") &&
@@ -368,34 +368,34 @@ public void Build_Item_Menu(PlayerFormRespondedEvent event){
Integer_Test(form.getResponse().getInputResponse(2), p) &&
Integer_Test(form.getResponse().getInputResponse(4), p) &&
Integer_Test(form.getResponse().getInputResponse(5), p)) {
- if(build_map.get(p.getName()).size()==2){
+ if (build_map.get(p.getName()).size() == 2) {
RandomFill.Random(Integer.parseInt(form.getResponse().getInputResponse(1)),
Integer.parseInt(form.getResponse().getInputResponse(2)),
Integer.parseInt(form.getResponse().getInputResponse(4)),
- Integer.parseInt(form.getResponse().getInputResponse(5)),p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
- } else if (!form.getResponse().getInputResponse(1).equals("") &&
+ Integer.parseInt(form.getResponse().getInputResponse(5)), p);
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ } else if (!form.getResponse().getInputResponse(1).equals("") &&
!form.getResponse().getInputResponse(2).equals("") &&
Integer_Test(form.getResponse().getInputResponse(1), p) &&
Integer_Test(form.getResponse().getInputResponse(2), p)) {
- if(build_map.get(p.getName()).size()==2){
+ if (build_map.get(p.getName()).size() == 2) {
RandomFill.Random(Integer.parseInt(form.getResponse().getInputResponse(1)),
- Integer.parseInt(form.getResponse().getInputResponse(2)),p);
- }else p.sendMessage("§l§c坐标选取不完整,请检查!");
- }else p.sendMessage(" <不合法的ID值>");
+ Integer.parseInt(form.getResponse().getInputResponse(2)), p);
+ } else p.sendMessage("§l§c坐标选取不完整,请检查!");
+ } else p.sendMessage(" <不合法的ID值>");
}
}
}
@EventHandler
- public void Back(PlayerFormRespondedEvent e){
+ public void Back(PlayerFormRespondedEvent e) {
Player p = e.getPlayer();
if (!(e.getWindow().getResponse() == null) && e.getWindow() instanceof FormWindowSimple w) {
- if((w instanceof Home || w instanceof Personal_System ||
+ if ((w instanceof Home || w instanceof Personal_System ||
w instanceof opSaveBuilder || w instanceof Setting || w instanceof Shop ||
- w instanceof Social_Contact || w instanceof Teleport_Menu || w instanceof Npc_Menu) &&
- w.getResponse().getClickedButton().getText().equals("返回")){
- p.showFormWindow(getWindowSimple(p));
+ w instanceof Social_Contact || w instanceof Teleport_Menu || w instanceof Npc_Menu) &&
+ w.getResponse().getClickedButton().getText().equals("返回")) {
+ p.showFormWindow(getWindowSimple(p));
} else if ((w instanceof MyHome || w instanceof HomeOpMenu || w instanceof HomeList) &&
w.getResponse().getClickedButton().getText().equals("返回")) {
p.showFormWindow(OpHomeMenu(p));
@@ -404,98 +404,98 @@ public void Back(PlayerFormRespondedEvent e){
}
}
}
-
+
@EventHandler
public void onWindowsListener(PlayerFormRespondedEvent event) {
int page;
Player p = event.getPlayer();
- if (!(event.getWindow().getResponse() == null) && event.getWindow() instanceof FormWindowSimple simple){
+ if (!(event.getWindow().getResponse() == null) && event.getWindow() instanceof FormWindowSimple simple) {
page = simple.getResponse().getClickedButtonId();
- FormWindow window = event.getWindow();
- if (window.toString().contains("WorldMenuWindow")) {
- switch (page) {
- case 0 -> p.showFormWindow(getWindowTeleport_Menu());
- case 1 -> p.showFormWindow(OpHomeMenu(p));
- case 2 -> p.showFormWindow(getWindowShop());
- case 3 -> p.showFormWindow(getWindowSocial_Contact());
- case 4 -> p.showFormWindow(getWindowPersonal_System());
- case 5 -> p.showFormWindow(getWindowSetting());
- case 6 -> p.showFormWindow(getWindow_op_save_builder());
- case 7 -> p.showFormWindow(getNpc_Menu());
+ FormWindow window = event.getWindow();
+ if (window.toString().contains("WorldMenuWindow")) {
+ switch (page) {
+ case 0 -> p.showFormWindow(getWindowTeleport_Menu());
+ case 1 -> p.showFormWindow(OpHomeMenu(p));
+ case 2 -> p.showFormWindow(getWindowShop());
+ case 3 -> p.showFormWindow(getWindowSocial_Contact());
+ case 4 -> p.showFormWindow(getWindowPersonal_System());
+ case 5 -> p.showFormWindow(getWindowSetting());
+ case 6 -> p.showFormWindow(getWindow_op_save_builder());
+ case 7 -> p.showFormWindow(getNpc_Menu());
+ }
}
- }
- if (window instanceof Teleport_Menu) {
- switch (page) {
- case 0 -> {
- p.sendToast("§6[传送]", "§g" + p.getName() + ",§a欢迎回到主世界!");
- p.teleport(p.getServer().getLevel(1).getSpawnLocation());
+ if (window instanceof Teleport_Menu) {
+ switch (page) {
+ case 0 -> {
+ p.sendToast("§6[传送]", "§g" + p.getName() + ",§a欢迎回到主世界!");
+ p.teleport(p.getServer().getDefaultLevel().getSpawnLocation());
+ }
+ case 1 -> p.sendMessage("企鹅开发中,呜呜呜");
}
- case 1 -> p.sendMessage("企鹅开发中,呜呜呜");
}
- }
- if (window instanceof Home) {
- switch (page) {
- case 0 -> p.showFormWindow(MyHomeTest(p));
- case 1 -> p.sendMessage("别人的家园");
- case 2 -> p.sendMessage("家园权限设置");
- case 3 -> p.showFormWindow(getWindowHomeOpMenu());
- }
- } else if (window instanceof MyHome) {
- switch (page) {
- case 0 -> p.showFormWindow(getWindowCreateHome(p));
- case 1 -> {
- p.sendToast("§6[家园]", "§g" + p.getName() + ",§a欢迎回家!§d要愉快的玩耍奥!");
- p.teleport(p.getServer().getLevelByName(p.getName() + "的家园").getSpawnLocation());
+ if (window instanceof Home) {
+ switch (page) {
+ case 0 -> p.showFormWindow(MyHomeTest(p));
+ case 1 -> p.sendMessage("别人的家园");
+ case 2 -> p.sendMessage("家园权限设置");
+ case 3 -> p.showFormWindow(getWindowHomeOpMenu());
}
- }
- } else if (window instanceof CreateHome) {
- switch (page) {
- case 0 -> p.showFormWindow(CreateWorld(p));
- case 1 -> p.sendMessage("§a敬请期待");
- }
- } else if (window instanceof HomeOpMenu) {
- if(page==0){
- p.showFormWindow(Home_List(p));
- }
- } else if (window instanceof HomeList) {
- if(!((HomeList) window).getButtons().get(page).getText().contains("返回")) {
- p.showFormWindow(Managing_List(((FormWindowSimple) event.getWindow()).getButtons().get(page).getText()));
- }
- } else if (window instanceof Managing_Homes) {
- switch (page){
- case 0 -> {
- Managing(p,((Managing_Homes) window).getTitle());
- p.sendToast("§6[传送]" ,"§c尊敬的管理员,欢迎来到§a" + ((Managing_Homes) window).getTitle());
+ } else if (window instanceof MyHome) {
+ switch (page) {
+ case 0 -> p.showFormWindow(getWindowCreateHome(p));
+ case 1 -> {
+ p.sendToast("§6[家园]", "§g" + p.getName() + ",§a欢迎回家!§d要愉快的玩耍奥!");
+ p.teleport(p.getServer().getLevelByName(p.getName() + "的家园").getSpawnLocation());
+ }
+ }
+ } else if (window instanceof CreateHome) {
+ switch (page) {
+ case 0 -> p.showFormWindow(CreateWorld(p));
+ case 1 -> p.sendMessage("§a敬请期待");
+ }
+ } else if (window instanceof HomeOpMenu) {
+ if (page == 0) {
+ p.showFormWindow(Home_List(p));
+ }
+ } else if (window instanceof HomeList) {
+ if (!((HomeList) window).getButtons().get(page).getText().contains("返回")) {
+ p.showFormWindow(Managing_List(((FormWindowSimple) event.getWindow()).getButtons().get(page).getText()));
+ }
+ } else if (window instanceof Managing_Homes) {
+ switch (page) {
+ case 0 -> {
+ Managing(p, ((Managing_Homes) window).getTitle());
+ p.sendToast("§6[传送]", "§c尊敬的管理员,欢迎来到§a" + ((Managing_Homes) window).getTitle());
+ }
+ case 1 -> p.sendMessage("还在做。。");
+ case 2 -> p.sendMessage("还在做呢。。");
}
- case 1 -> p.sendMessage("还在做。。");
- case 2 -> p.sendMessage("还在做呢。。");
}
- }
- if (window instanceof opSaveBuilder){
- switch (page) {
- case 0 -> p.showFormWindow(Create_Yml());
- case 1 -> p.showFormWindow(Crate_Files());
- case 2 -> p.showFormWindow(getIntroduction());
- }
- } else if (window instanceof Filecenter) {
- if (page == 0) {
- p.showFormWindow(Window_Crate_Files(p));
- } else {
- p.showFormWindow(Window_File_List(p, ((FormWindowSimple) event.getWindow()).getButtons().get(page).getText()));
- p_get_file.set(idr,"Builder_Save\\" + ((FormWindowSimple) event.getWindow()).getButtons().get(page).getText());
+ if (window instanceof opSaveBuilder) {
+ switch (page) {
+ case 0 -> p.showFormWindow(Create_Yml());
+ case 1 -> p.showFormWindow(Crate_Files());
+ case 2 -> p.showFormWindow(getIntroduction());
+ }
+ } else if (window instanceof Filecenter) {
+ if (page == 0) {
+ p.showFormWindow(Window_Crate_Files(p));
+ } else {
+ p.showFormWindow(Window_File_List(p, ((FormWindowSimple) event.getWindow()).getButtons().get(page).getText()));
+ p_get_file.set(idr, "Builder_Save\\" + ((FormWindowSimple) event.getWindow()).getButtons().get(page).getText());
+ }
}
- }
- if(window instanceof Npc_Menu) {
- switch (page) {
- case 0 -> Spawn_Npc(p);
- case 1 -> p.sendMessage("右键NPC即可管理!");
+ if (window instanceof Npc_Menu) {
+ switch (page) {
+ case 0 -> Spawn_Npc(p);
+ case 1 -> p.sendMessage("右键NPC即可管理!");
+ }
}
}
- }
}
@EventHandler
@@ -508,7 +508,7 @@ public void data_Listener(PlayerFormRespondedEvent dataListener) throws IOExcept
if (p_list.get(i).equals(p.getName())) {
p_get_Data.set(i, dataListener.getWindow().getJSONData());
idr = i;
- }else if(i == p_list.size()-1){
+ } else if (i == p_list.size() - 1) {
p_list.add(p.getName());
p_get_Data.add(dataListener.getWindow().getJSONData());
p_get_text.add("");
@@ -527,7 +527,7 @@ public void data_Listener(PlayerFormRespondedEvent dataListener) throws IOExcept
if (window instanceof FileList) {
p.showFormWindow(Build(simple.getButtons().get(simple.getResponse().getClickedButtonId()).getText()));
p_get_text.set(idr, simple.getButtons().get(simple.getResponse().getClickedButtonId()).getText());
- p_get_file.set(idr,"penguin_plugin\\" + p_get_file.get(idr) + "\\" + simple.getButtons().get(simple.getResponse().getClickedButtonId()).getText());
+ p_get_file.set(idr, "penguin_plugin\\" + p_get_file.get(idr) + "\\" + simple.getButtons().get(simple.getResponse().getClickedButtonId()).getText());
}
if (window instanceof Paste_Build) {
int id = simple.getResponse().getClickedButtonId();
@@ -538,7 +538,7 @@ public void data_Listener(PlayerFormRespondedEvent dataListener) throws IOExcept
p.showFormWindow(DeleteBuild(p_get_file.get(idr)));
}
}
- }else if(dataListener.getWindow() instanceof FormWindowCustom window){
+ } else if (dataListener.getWindow() instanceof FormWindowCustom window) {
if (p_list.size() > 0) {
for (int i = 0; i < p_list.size(); i++) {
if (p_list.get(i).equals(p.getName())) {
@@ -553,26 +553,27 @@ public void data_Listener(PlayerFormRespondedEvent dataListener) throws IOExcept
p_get_file.add("");
}
if (window instanceof CreateFile) {
- if(p_get_Data.get(idr).length()>313) {
- p_get_text.set(idr, p_get_Data.get(idr).substring(314));
- p.showFormWindow(Super_File(get_data(p_get_text.get(idr))));
+ if (p_get_Data.get(idr).length() > 313) {
+ p_get_text.set(idr, p_get_Data.get(idr).substring(314));
+ p.showFormWindow(Super_File(get_data(p_get_text.get(idr))));
}
}
if (window instanceof SaveBuild) {
- if(p_get_Data.get(idr).length()>305) {
+ if (p_get_Data.get(idr).length() > 305) {
p_get_text.set(idr, p_get_Data.get(idr).substring(306));
p.showFormWindow(Create_Yml_To(get_data(p_get_text.get(idr))));
}
}
- if(window instanceof Npc_Setting_Base_Name){
- if(p_get_Data.get(idr).length()>198) {
+ if (window instanceof Npc_Setting_Base_Name) {
+ if (p_get_Data.get(idr).length() > 198) {
p_get_text.set(idr, p_get_Data.get(idr).substring(199));
- Npc_Name( p, get_data(p_get_text.get(idr)));
+ Npc_Name(p, get_data(p_get_text.get(idr)));
}
- }if(window instanceof Npc_Setting_Base_Model){
- if(p_get_Data.get(idr).length()>205) {
+ }
+ if (window instanceof Npc_Setting_Base_Model) {
+ if (p_get_Data.get(idr).length() > 205) {
p_get_text.set(idr, p_get_Data.get(idr).substring(206));
- Npc_Model( p, get_data(p_get_text.get(idr)));
+ Npc_Model(p, get_data(p_get_text.get(idr)));
}
}
}
@@ -591,23 +592,23 @@ public void Npc_Listener(PlayerFormRespondedEvent NpcListener) throws IOExceptio
case 1 -> p.showFormWindow(getNpc_Setting());
case 2 -> p.showFormWindow(getNpc_information(p));
}
- } else if (window instanceof Npc_Setting) {
- switch (page){
+ } else if (window instanceof Npc_Setting) {
+ switch (page) {
case 0 -> p.showFormWindow(getNpc_Setting_Base());
case 1 -> p.showFormWindow(getNpc_Setting_Skin());
case 2 -> p.sendMessage("行为设置");
}
} else if (window instanceof Npc_Setting_Base) {
- switch (page){
+ switch (page) {
case 0 -> p.showFormWindow(Change_Npc_Name());
case 1 -> p.showFormWindow(Change_Npc_Model());
case 2 -> p.showFormWindow(Change_Npc_Equipment());
case 3 -> Npc_Delete(p);
}
} else if (window instanceof Npc_Setting_Skin) {
- ChangeSkinSuccess(p , ((Npc_Setting_Skin) window).getResponse().getClickedButton().getText());
- } else if (window instanceof Npc_Setting_Base_Equipment) {
- if(page==0) Clone_Equipment(p);
+ ChangeSkinSuccess(p, ((Npc_Setting_Skin) window).getResponse().getClickedButton().getText());
+ } else if (window instanceof Npc_Setting_Base_Equipment) {
+ if (page == 0) Clone_Equipment(p);
}
}
}
@@ -625,15 +626,15 @@ private String get_data(String text) {
}
-// 判定是否带有非法字符
- private boolean Integer_Test(String text,Player p){
+ // 判定是否带有非法字符
+ private boolean Integer_Test(String text, Player p) {
int text_long = text.length();
- if(text.length()>4){
+ if (text.length() > 4) {
p.sendMessage("<错误> 字符串长度不应过长!");
return false;
}
- while (text_long>0){
- if(!"0123456789".contains(text.substring(text_long-1,text_long))){
+ while (text_long > 0) {
+ if (!"0123456789".contains(text.substring(text_long - 1, text_long))) {
return false;
}
text_long--;
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/WoodAxe.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/WoodAxe.java
index deb7769..ffe757e 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/WoodAxe.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/WoodAxe.java
@@ -12,21 +12,22 @@ public class WoodAxe extends PluginBase {
public static ArrayList player_access = new ArrayList<>();
public static ArrayList player_access_vector3s = new ArrayList<>();
public static int identifier = 0;
+
public WoodAxe() {
}
-
- public static void AddVector(Vector3 v , Player p){
+
+ public static void AddVector(Vector3 v, Player p) {
ArrayList vector3s = build_map.get(p.getName());
- if(vector3s.size()==0){
+ if (vector3s.size() == 0) {
vector3s.add(v);
p.sendMessage(" §l§a已选择坐标A");
- } else if (vector3s.size()==1) {
+ } else if (vector3s.size() == 1) {
vector3s.add(v);
p.sendMessage(" §l§a已选择坐标B");
- } else if (vector3s.size()==2) {
+ } else if (vector3s.size() == 2) {
vector3s = new ArrayList<>();
p.sendMessage(" §l§c已重置坐标选取!");
}
- build_map.put(p.getName(),vector3s);
+ build_map.put(p.getName(), vector3s);
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/ball_tool.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/ball_tool.java
index 3f043d0..b0ebed2 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/ball_tool.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/ball_tool.java
@@ -5,58 +5,58 @@
import cn.nukkit.math.Vector3;
public class ball_tool {
- public static void ball(Player p,String[] args){
- double difference_x=0,difference_y=0,difference_z=0;
+ public static void ball(Player p, String[] args) {
+ double difference_x = 0, difference_y = 0, difference_z = 0;
int radius = Integer.parseInt(args[0]);
int block_id = Integer.parseInt(args[1]);
- if(radius<=50){
- Vector3 vector3 = new Vector3();
- if(p.getLocation().x<0){
- difference_x=1;
- }
- if(p.getLocation().y<0){
- difference_y=1;
- }
- if(p.getLocation().z<0){
- difference_z=1;
- }
- vector3.x=(int)p.getLocation().x-difference_x+0.5;
- vector3.y=(int)p.getLocation().y-difference_y+0.5;
- vector3.z=(int)p.getLocation().z-difference_z+0.5;
- //传送至上方,避免卡在球体中间//
- p.teleport(new Vector3(vector3.x,vector3.y + radius + 2,vector3.z));
- double x,y,z;
- for (float i = -radius-1 ; i < radius + 1; i+=1f) {
- for (float j = -radius-1; j < radius + 1; j+=1f) {
- for (float k = -radius-1; k < radius + 1; k+=1f) {
- if (i * i + j * j + k * k <= radius * radius) {
- x = vector3.x + i;
- y = vector3.y + j;
- z = vector3.z + k;
- if (args.length == 2) {
- if(!p.level.getBlock(new Vector3(x, y, z)).equals(Block.get(block_id,0))) {
- p.getLevel().setBlock(new Vector3(x, y, z), Block.get(block_id));
- }
- } else if (args.length == 3) {
- int data = Integer.parseInt(args[2]);
- if(!p.level.getBlock(new Vector3(x, y, z)).equals(Block.get(block_id,data))) {
- p.getLevel().setBlock(new Vector3(x, y, z), Block.get(block_id,data));
- }
- } else if (args.length == 4) {
- int data = Integer.parseInt(args[2]);
- if (args[3].equals("keep")) {
- if (p.level.getBlock(new Vector3(x, y, z)).getId() == 0) {
+ if (radius <= 50) {
+ Vector3 vector3 = new Vector3();
+ if (p.getLocation().x < 0) {
+ difference_x = 1;
+ }
+ if (p.getLocation().y < 0) {
+ difference_y = 1;
+ }
+ if (p.getLocation().z < 0) {
+ difference_z = 1;
+ }
+ vector3.x = (int) p.getLocation().x - difference_x + 0.5;
+ vector3.y = (int) p.getLocation().y - difference_y + 0.5;
+ vector3.z = (int) p.getLocation().z - difference_z + 0.5;
+ //传送至上方,避免卡在球体中间//
+ p.teleport(new Vector3(vector3.x, vector3.y + radius + 2, vector3.z));
+ double x, y, z;
+ for (float i = -radius - 1; i < radius + 1; i += 1f) {
+ for (float j = -radius - 1; j < radius + 1; j += 1f) {
+ for (float k = -radius - 1; k < radius + 1; k += 1f) {
+ if (i * i + j * j + k * k <= radius * radius) {
+ x = vector3.x + i;
+ y = vector3.y + j;
+ z = vector3.z + k;
+ if (args.length == 2) {
+ if (!p.level.getBlock(new Vector3(x, y, z)).equals(Block.get(block_id, 0))) {
+ p.getLevel().setBlock(new Vector3(x, y, z), Block.get(block_id));
+ }
+ } else if (args.length == 3) {
+ int data = Integer.parseInt(args[2]);
+ if (!p.level.getBlock(new Vector3(x, y, z)).equals(Block.get(block_id, data))) {
p.getLevel().setBlock(new Vector3(x, y, z), Block.get(block_id, data));
}
- } else {
- p.sendMessage("参数有误,目前有效参数有keep。");
- return;
+ } else if (args.length == 4) {
+ int data = Integer.parseInt(args[2]);
+ if (args[3].equals("keep")) {
+ if (p.level.getBlock(new Vector3(x, y, z)).getId() == 0) {
+ p.getLevel().setBlock(new Vector3(x, y, z), Block.get(block_id, data));
+ }
+ } else {
+ p.sendMessage("参数有误,目前有效参数有keep。");
+ return;
+ }
}
}
}
- }
- }
+ }
}
- }else p.sendMessage("半径最高不能大于50格!请重新输入!");
+ } else p.sendMessage("半径最高不能大于50格!请重新输入!");
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/round_tool.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/round_tool.java
index 2213a9c..60cae06 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/round_tool.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Tool/round_tool.java
@@ -6,7 +6,7 @@
public class round_tool {
public static void round(Player p, String[] args) {
- double difference_x = 0,difference_z = 0;
+ double difference_x = 0, difference_z = 0;
int radius = Integer.parseInt(args[0]);
int block_id = Integer.parseInt(args[1]);
if (radius <= 120) {
@@ -20,32 +20,32 @@ public static void round(Player p, String[] args) {
vector3.x = (int) p.getLocation().x - difference_x + 0.5;
vector3.z = (int) p.getLocation().z - difference_z + 0.5;
p.sendMessage(String.valueOf(vector3));
- double x,z;
+ double x, z;
for (double i = -radius - 0.5; i < radius + 0.5; i += 0.2f) {
for (double j = -radius - 0.5; j < radius + 0.5; j += 0.2f) {
- if (i * i + j * j <= radius * radius) {
- x = vector3.x + i;
- z = vector3.z + j;
- if (args.length == 2) {
- if (!p.level.getBlock(new Vector3(x, p.getLocation().y, z)).equals(Block.get(block_id, 0))) {
- p.getLevel().setBlock(new Vector3(x, p.getLocation().y, z), Block.get(block_id));
- }
- } else if (args.length == 3) {
- int data = Integer.parseInt(args[2]);
- if (!p.level.getBlock(new Vector3(x, p.getLocation().y, z)).equals(Block.get(block_id, data))) {
+ if (i * i + j * j <= radius * radius) {
+ x = vector3.x + i;
+ z = vector3.z + j;
+ if (args.length == 2) {
+ if (!p.level.getBlock(new Vector3(x, p.getLocation().y, z)).equals(Block.get(block_id, 0))) {
+ p.getLevel().setBlock(new Vector3(x, p.getLocation().y, z), Block.get(block_id));
+ }
+ } else if (args.length == 3) {
+ int data = Integer.parseInt(args[2]);
+ if (!p.level.getBlock(new Vector3(x, p.getLocation().y, z)).equals(Block.get(block_id, data))) {
+ p.getLevel().setBlock(new Vector3(x, p.getLocation().y, z), Block.get(block_id, data));
+ }
+ } else if (args.length == 4) {
+ int data = Integer.parseInt(args[2]);
+ if (args[3].equals("keep")) {
+ if (p.level.getBlock(new Vector3(x, p.getLocation().y, z)).getId() == 0) {
p.getLevel().setBlock(new Vector3(x, p.getLocation().y, z), Block.get(block_id, data));
}
- } else if (args.length == 4) {
- int data = Integer.parseInt(args[2]);
- if (args[3].equals("keep")) {
- if (p.level.getBlock(new Vector3(x, p.getLocation().y, z)).getId() == 0) {
- p.getLevel().setBlock(new Vector3(x, p.getLocation().y, z), Block.get(block_id, data));
- }
- } else {
- p.sendMessage("参数有误,目前有效参数有keep。");
- return;
- }
+ } else {
+ p.sendMessage("参数有误,目前有效参数有keep。");
+ return;
}
+ }
}
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Build_Menu.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Build_Menu.java
index a795ce3..0db7a9c 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Build_Menu.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Build_Menu.java
@@ -6,16 +6,17 @@
public class Build_Menu extends FormWindowSimple {
- public Build_Menu() {
+ public Build_Menu() {
super("创世神菜单", " 选择你要使用填充方式!");
}
- public static Build_Menu getBuildWindow(){
+
+ public static Build_Menu getBuildWindow() {
Build_Menu home = new Build_Menu();
- home.addButton(new ElementButton("普通填充", new ElementButtonImageData("path","textures/ui/create")));
- home.addButton(new ElementButton("仅对空气填充", new ElementButtonImageData("path","textures/ui/create")));
- home.addButton(new ElementButton("方块替换", new ElementButtonImageData("path","textures/ui/create")));
- home.addButton(new ElementButton("百分比随机填充", new ElementButtonImageData("path","textures/ui/create")));
- home.addButton(new ElementButton("撤回上一次填充", new ElementButtonImageData("path","textures/ui/create")));
+ home.addButton(new ElementButton("普通填充", new ElementButtonImageData("path", "textures/ui/create")));
+ home.addButton(new ElementButton("仅对空气填充", new ElementButtonImageData("path", "textures/ui/create")));
+ home.addButton(new ElementButton("方块替换", new ElementButtonImageData("path", "textures/ui/create")));
+ home.addButton(new ElementButton("百分比随机填充", new ElementButtonImageData("path", "textures/ui/create")));
+ home.addButton(new ElementButton("撤回上一次填充", new ElementButtonImageData("path", "textures/ui/create")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Coordinate_sorting.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Coordinate_sorting.java
index c6fd50b..1a725d3 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Coordinate_sorting.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/Coordinate_sorting.java
@@ -5,7 +5,7 @@
import java.util.ArrayList;
public class Coordinate_sorting {
- public static ArrayList sorting(ArrayList v){
+ public static ArrayList sorting(ArrayList v) {
double data;
if (v.get(1).x < v.get(0).x) {
data = v.get(1).x;
@@ -21,7 +21,7 @@ public static ArrayList sorting(ArrayList v){
data = v.get(1).z;
v.get(1).z = v.get(0).z;
v.get(0).z = data;
- }
+ }
return v;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/CommonFill.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/CommonFill.java
index 7e4ea9d..41e0df9 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/CommonFill.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/CommonFill.java
@@ -21,7 +21,7 @@ public CommonFill(List elements) {
super("§6普通填充", elements);
}
- public static FormWindowCustom common_fill(){
+ public static FormWindowCustom common_fill() {
List el = new ArrayList<>();
el.add(new ElementLabel("§l§6请输入方块ID"));
el.add(new ElementInput(" "));
@@ -30,11 +30,11 @@ public static FormWindowCustom common_fill(){
return new CommonFill(el);
}
- public static void common_fill_do(int id , int special_id , Player player){
+ public static void common_fill_do(int id, int special_id, Player player) {
String text = "";
- if(Block.get(id,special_id).getName() !=null) {
- if(Block.get(id,special_id).getName().contains("UNKNOWN")){
- special_id=0;
+ if (Block.get(id, special_id).getName() != null) {
+ if (Block.get(id, special_id).getName().contains("UNKNOWN")) {
+ special_id = 0;
player.sendMessage("-->§c没有这种特殊值的方块,已自动改为默认值0");
}
// 从小到大排序
@@ -52,23 +52,23 @@ public static void common_fill_do(int id , int special_id , Player player){
boolean all_ok = false;
if (lengthen.get(0) <= 1000L && lengthen.get(1) <= 1000L && lengthen.get(2) <= 1000L) {
temp = lengthen.get(0) * lengthen.get(1) * lengthen.get(2);
- if (temp <= 1000000L) {
+ if (temp <= 5000000L) {
all_ok = true;
} else {
- player.sendMessage("§m§c填充方块过大(" + temp + "> 百万块)");
+ player.sendMessage("§m§c填充方块过大(" + temp + "> 500万块)");
}
} else {
player.sendMessage("§m§cxyz的延申长度不得>1000");
}
if (all_ok) {
Long[] xyz2 = new Long[]{(long) vector3s.get(1).x, (long) vector3s.get(1).y, (long) vector3s.get(1).z};
- player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + Block.get(id,special_id));
+ player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + Block.get(id, special_id));
long x_fill = xyz1[0];
long y_fill = xyz1[1];
long z_fill = xyz1[2];
// 刷新undo撤销
- undo_map.put(player.getName(),new ArrayList<>());
+ undo_map.put(player.getName(), new ArrayList<>());
ArrayList save = new ArrayList<>();
while (true) {
Vector3 vector_fill = new Vector3((double) x_fill, (double) y_fill, (double) z_fill);
@@ -94,12 +94,12 @@ public static void common_fill_do(int id , int special_id , Player player){
"\nplayer: " + player.getName() +
" §d§m已为你填充" + end_all + " §l§b块方块 §6";
- undo_map.put(player.getName(),save);
+ undo_map.put(player.getName(), save);
}
}
- }else {
- text = "id " +id +
+ } else {
+ text = "id " + id +
"\nspecial_id :" + special_id +
"\nplayer: " + player.getName() +
"\n§l§c你输入的方块ID不存在,填充失败!";
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/KeepFill.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/KeepFill.java
index d3032b9..d1c42e6 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/KeepFill.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/KeepFill.java
@@ -17,24 +17,24 @@
import static Minecraft.nukkit.cn.sohugepenguin.plugin.testPlugin.Main_PluginBase.undo_map;
public class KeepFill extends FormWindowCustom {
- public KeepFill(List elements) {
+ public KeepFill(List elements) {
super("§6保持性填充", elements);
}
- public static FormWindowCustom Keep_Fill(){
+ public static FormWindowCustom Keep_Fill() {
List el = new ArrayList<>();
el.add(new ElementLabel("§l§6请输入方块ID"));
el.add(new ElementInput(" "));
el.add(new ElementLabel("§l§6请输入方块特殊值"));
el.add(new ElementInput(" "));
- return new KeepFill(el);
+ return new KeepFill(el);
}
- public static void KeepFill_do(int id , int special_id , Player player){
+ public static void KeepFill_do(int id, int special_id, Player player) {
String text = "";
- if(Block.get(id,special_id).getName() !=null) {
- if(Block.get(id,special_id).getName().contains("UNKNOWN")){
- special_id=0;
+ if (Block.get(id, special_id).getName() != null) {
+ if (Block.get(id, special_id).getName().contains("UNKNOWN")) {
+ special_id = 0;
player.sendMessage("-->§c没有这种特殊值的方块,已自动改为默认值0");
}
// 从小到大排序
@@ -62,16 +62,16 @@ public static void KeepFill_do(int id , int special_id , Player player){
}
if (all_ok) {
Long[] xyz2 = new Long[]{(long) vector3s.get(1).x, (long) vector3s.get(1).y, (long) vector3s.get(1).z};
- player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + Block.get(id,special_id));
+ player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + Block.get(id, special_id));
long x_fill = xyz1[0];
long y_fill = xyz1[1];
long z_fill = xyz1[2];
// 刷新undo撤销
- undo_map.put(player.getName(),new ArrayList<>());
+ undo_map.put(player.getName(), new ArrayList<>());
ArrayList save = new ArrayList<>();
while (true) {
Vector3 vector_fill = new Vector3((double) x_fill, (double) y_fill, (double) z_fill);
- if(player.getLevel().getBlock(vector_fill).getId()==0){
+ if (player.getLevel().getBlock(vector_fill).getId() == 0) {
save.add(player.getLevel().getBlock(vector_fill));
player.level.setBlock(vector_fill, Block.get(id, special_id));
++end_all;
@@ -95,12 +95,12 @@ public static void KeepFill_do(int id , int special_id , Player player){
"\nplayer: " + player.getName() +
" §d§m已为你填充" + end_all + " §l§b块方块 §6";
- undo_map.put(player.getName(),save);
+ undo_map.put(player.getName(), save);
}
}
- }else {
- text = "id " +id +
+ } else {
+ text = "id " + id +
"\nspecial_id :" + special_id +
"\nplayer: " + player.getName() +
"\n§l§c你输入的方块ID不存在,填充失败!";
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/RandomFill.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/RandomFill.java
index a37063e..ecfd241 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/RandomFill.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/RandomFill.java
@@ -20,11 +20,12 @@
public class RandomFill extends FormWindowCustom {
static int[] ids;
static int[] special_ids;
+
public RandomFill(List elements) {
super("§6随机百分比填充", elements);
}
- public static FormWindowCustom Random_Filll(){
+ public static FormWindowCustom Random_Filll() {
List el = new ArrayList<>();
el.add(new ElementLabel("数量自己定,选填,但是特殊值必须要写!\n§l§6随机方块1"));
el.add(new ElementInput(" "));
@@ -44,7 +45,7 @@ public static FormWindowCustom Random_Filll(){
return new RandomFill(el);
}
- public static void RandomFill_do(int[] ids , int[] special_ids , Player player){
+ public static void RandomFill_do(int[] ids, int[] special_ids, Player player) {
String text = "";
for (int id : ids) {
if (Block.get(id).getName() == null) {
@@ -54,91 +55,95 @@ public static void RandomFill_do(int[] ids , int[] special_ids , Player player){
}
// 从小到大排序
- ArrayList vector3s = Coordinate_sorting.sorting(build_map.get(player.getName()));
-
- long end_all = 0;
- if (vector3s.size() == 2) {
- long[] xyz1 = new long[]{(long) vector3s.get(0).x, (long) vector3s.get(0).y, (long) vector3s.get(0).z};
- end_all = 0L;
- ArrayList lengthen = new ArrayList<>();
- lengthen.add((long) Math.abs(vector3s.get(0).x - vector3s.get(1).x) + 1L);
- lengthen.add((long) Math.abs(vector3s.get(0).y - vector3s.get(1).y) + 1L);
- lengthen.add((long) Math.abs(vector3s.get(0).z - vector3s.get(1).z) + 1L);
- long temp;
- boolean all_ok = false;
- if (lengthen.get(0) <= 1000L && lengthen.get(1) <= 1000L && lengthen.get(2) <= 1000L) {
- temp = lengthen.get(0) * lengthen.get(1) * lengthen.get(2);
- if (temp <= 1000000L) {
- all_ok = true;
- } else {
- player.sendMessage("§m§c填充方块过大(" + temp + "> 百万块)");
- }
+ ArrayList vector3s = Coordinate_sorting.sorting(build_map.get(player.getName()));
+
+ long end_all = 0;
+ if (vector3s.size() == 2) {
+ long[] xyz1 = new long[]{(long) vector3s.get(0).x, (long) vector3s.get(0).y, (long) vector3s.get(0).z};
+ end_all = 0L;
+ ArrayList lengthen = new ArrayList<>();
+ lengthen.add((long) Math.abs(vector3s.get(0).x - vector3s.get(1).x) + 1L);
+ lengthen.add((long) Math.abs(vector3s.get(0).y - vector3s.get(1).y) + 1L);
+ lengthen.add((long) Math.abs(vector3s.get(0).z - vector3s.get(1).z) + 1L);
+ long temp;
+ boolean all_ok = false;
+ if (lengthen.get(0) <= 1000L && lengthen.get(1) <= 1000L && lengthen.get(2) <= 1000L) {
+ temp = lengthen.get(0) * lengthen.get(1) * lengthen.get(2);
+ if (temp <= 1000000L) {
+ all_ok = true;
} else {
- player.sendMessage("§m§cxyz的延申长度不得>1000");
+ player.sendMessage("§m§c填充方块过大(" + temp + "> 百万块)");
}
- if (all_ok) {
- Long[] xyz2 = new Long[]{(long) vector3s.get(1).x, (long) vector3s.get(1).y, (long) vector3s.get(1).z};
- player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + ids.length +" 种随机方块");
- long x_fill = xyz1[0];
- long y_fill = xyz1[1];
- long z_fill = xyz1[2];
+ } else {
+ player.sendMessage("§m§cxyz的延申长度不得>1000");
+ }
+ if (all_ok) {
+ Long[] xyz2 = new Long[]{(long) vector3s.get(1).x, (long) vector3s.get(1).y, (long) vector3s.get(1).z};
+ player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + ids.length + " 种随机方块");
+ long x_fill = xyz1[0];
+ long y_fill = xyz1[1];
+ long z_fill = xyz1[2];
// 刷新undo撤销
- undo_map.put(player.getName(),new ArrayList<>());
- ArrayList save = new ArrayList<>();
-
- while (true) {
- Vector3 vector_fill = new Vector3((double) x_fill, (double) y_fill, (double) z_fill);
- int ran = Utils.rand(0,ids.length-1);
- save.add(player.getLevel().getBlock(vector_fill));
- player.level.setBlock(vector_fill, Block.get(ids[ran], special_ids[ran]));
- ++end_all;
-
- if (x_fill >= xyz2[0]) {
- x_fill = xyz1[0] - 1L;
- ++y_fill;
- }
- if (y_fill > xyz2[1]) {
- y_fill = xyz1[1];
- ++z_fill;
- }
- if (z_fill > xyz2[2]) {
- break;
- }
- ++x_fill;
- }
- text = " §d§m已为你填充" + end_all + " §l§b块方块 §6";
+ undo_map.put(player.getName(), new ArrayList<>());
+ ArrayList save = new ArrayList<>();
+
+ while (true) {
+ Vector3 vector_fill = new Vector3((double) x_fill, (double) y_fill, (double) z_fill);
+ int ran = Utils.rand(0, ids.length - 1);
+ save.add(player.getLevel().getBlock(vector_fill));
+ player.level.setBlock(vector_fill, Block.get(ids[ran], special_ids[ran]));
+ ++end_all;
- undo_map.put(player.getName(),save);
+ if (x_fill >= xyz2[0]) {
+ x_fill = xyz1[0] - 1L;
+ ++y_fill;
+ }
+ if (y_fill > xyz2[1]) {
+ y_fill = xyz1[1];
+ ++z_fill;
+ }
+ if (z_fill > xyz2[2]) {
+ break;
+ }
+ ++x_fill;
}
+ text = " §d§m已为你填充" + end_all + " §l§b块方块 §6";
+
+ undo_map.put(player.getName(), save);
}
+ }
player.sendMessage(text);
}
- public static void Random(int id , int special_id , Player player){
- ids= new int[]{id};
- special_ids=new int[special_id];
- RandomFill_do(ids,special_ids,player);
+ public static void Random(int id, int special_id, Player player) {
+ ids = new int[]{id};
+ special_ids = new int[special_id];
+ RandomFill_do(ids, special_ids, player);
}
- public static void Random(int id , int special_id , int id2 , int special_id2 , Player player){
- ids= new int[]{id,id2};
- special_ids=new int[]{special_id,special_id2};
- RandomFill_do(ids,special_ids,player);
+
+ public static void Random(int id, int special_id, int id2, int special_id2, Player player) {
+ ids = new int[]{id, id2};
+ special_ids = new int[]{special_id, special_id2};
+ RandomFill_do(ids, special_ids, player);
}
- public static void Random(int id , int special_id , int id2 , int special_id2 , int id3 , int special_id3 ,Player player){
- ids= new int[]{id,id2,id3};
- special_ids=new int[]{special_id,special_id2,special_id3};
- RandomFill_do(ids,special_ids,player);
+
+ public static void Random(int id, int special_id, int id2, int special_id2, int id3, int special_id3, Player player) {
+ ids = new int[]{id, id2, id3};
+ special_ids = new int[]{special_id, special_id2, special_id3};
+ RandomFill_do(ids, special_ids, player);
}
- public static void Random(int id , int special_id , int id2 , int special_id2 , int id3 , int special_id3 , int id4 , int special_id4 , Player player){
- ids= new int[]{id,id2,id3,id4};
- special_ids=new int[]{special_id,special_id2,special_id3,special_id4};
- RandomFill_do(ids,special_ids,player);
+
+ public static void Random(int id, int special_id, int id2, int special_id2, int id3, int special_id3, int id4, int special_id4, Player player) {
+ ids = new int[]{id, id2, id3, id4};
+ special_ids = new int[]{special_id, special_id2, special_id3, special_id4};
+ RandomFill_do(ids, special_ids, player);
}
- public static void Random(int id , int special_id , int id2 , int special_id2 , int id3 , int special_id3 , int id4 , int special_id4 , int id5 , int special_id5 , Player player){
- ids= new int[]{id,id2,id3,id4,id5};
- special_ids=new int[]{special_id,special_id2,special_id3,special_id4,special_id5};
- RandomFill_do(ids,special_ids,player);
+
+ public static void Random(int id, int special_id, int id2, int special_id2, int id3, int special_id3, int id4, int special_id4, int id5, int special_id5, Player player) {
+ ids = new int[]{id, id2, id3, id4, id5};
+ special_ids = new int[]{special_id, special_id2, special_id3, special_id4, special_id5};
+ RandomFill_do(ids, special_ids, player);
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/ReplaceFill.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/ReplaceFill.java
index e31e0a3..4237fdd 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/ReplaceFill.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/ReplaceFill.java
@@ -21,7 +21,7 @@ public ReplaceFill(List elements) {
super("§6替换方块填充", elements);
}
- public static FormWindowCustom Replace_Fill(){
+ public static FormWindowCustom Replace_Fill() {
List el = new ArrayList<>();
el.add(new ElementLabel("输入被替换方块§l§6 输入方块ID"));
el.add(new ElementInput(" "));
@@ -34,11 +34,11 @@ public static FormWindowCustom Replace_Fill(){
return new ReplaceFill(el);
}
- public static void ReplaceFill_do(int id , int special_id , int id2 , int special_id2, Player player){
+ public static void ReplaceFill_do(int id, int special_id, int id2, int special_id2, Player player) {
String text = "";
- if(Block.get(id,special_id).getName() !=null) {
- if(Block.get(id,special_id).getName().contains("UNKNOWN")){
- special_id=0;
+ if (Block.get(id, special_id).getName() != null) {
+ if (Block.get(id, special_id).getName().contains("UNKNOWN")) {
+ special_id = 0;
player.sendMessage("-->§c没有这种特殊值的方块,已自动改为默认值0");
}
// 从小到大排序
@@ -66,19 +66,19 @@ public static void ReplaceFill_do(int id , int special_id , int id2 , int specia
}
if (all_ok) {
Long[] xyz2 = new Long[]{(long) vector3s.get(1).x, (long) vector3s.get(1).y, (long) vector3s.get(1).z};
- player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + Block.get(id,special_id));
+ player.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + " §6 属性: " + Block.get(id, special_id));
long x_fill = xyz1[0];
long y_fill = xyz1[1];
long z_fill = xyz1[2];
// 刷新undo撤销
- undo_map.put(player.getName(),new ArrayList<>());
+ undo_map.put(player.getName(), new ArrayList<>());
ArrayList save = new ArrayList<>();
while (true) {
Vector3 vector_fill = new Vector3((double) x_fill, (double) y_fill, (double) z_fill);
- if(player.getLevel().getBlock(vector_fill).getId() == id &&
- player.getLevel().getBlock(vector_fill).getExactIntStorage()==special_id){
+ if (player.getLevel().getBlock(vector_fill).getId() == id &&
+ player.getLevel().getBlock(vector_fill).getExactIntStorage() == special_id) {
save.add(player.getLevel().getBlock(vector_fill));
player.level.setBlock(vector_fill, Block.get(id2, special_id2));
++end_all;
@@ -102,12 +102,12 @@ public static void ReplaceFill_do(int id , int special_id , int id2 , int specia
"\nplayer: " + player.getName() +
" §d§m已为你填充" + end_all + " §l§b块方块 §6";
- undo_map.put(player.getName(),save);
+ undo_map.put(player.getName(), save);
}
}
- }else {
- text = "id " +id +
+ } else {
+ text = "id " + id +
"\nspecial_id :" + special_id +
"\nplayer: " + player.getName() +
"\n§l§c你输入的方块ID不存在,填充失败!";
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/UndoFill.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/UndoFill.java
index 138b5cb..69ee9c6 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/UndoFill.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Build_Item_Win/FillType/UndoFill.java
@@ -8,11 +8,11 @@
import static Minecraft.nukkit.cn.sohugepenguin.plugin.testPlugin.Main_PluginBase.undo_map;
public class UndoFill {
- public static void undo_Fill(Player player){
+ public static void undo_Fill(Player player) {
ArrayList blocks = undo_map.get(player.getName());
- if(blocks.size()==0){
- player.sendToast("Warning", "目前只能撤回上一次的操作!");
+ if (blocks.size() == 0) {
+ player.sendToast("Warning", "目前只能撤回上一次的操作!");
return;
}
@@ -20,6 +20,6 @@ public static void undo_Fill(Player player){
player.getLevel().setBlock(block, block);
}
- undo_map.put(player.getName(),new ArrayList<>());
+ undo_map.put(player.getName(), new ArrayList<>());
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_HuTao.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_HuTao.java
index 14ec569..92d1999 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_HuTao.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_HuTao.java
@@ -11,28 +11,32 @@
public class Npc_HuTao extends FormWindowSimple {
public static ArrayList PlayerList = new ArrayList<>();
public static ArrayList PlayerTargetEntityList = new ArrayList<>();
+
public Npc_HuTao() {
super("NPC:往生堂堂主·胡桃", "你好哦!我是胡桃,胡了的胡,桃子的桃哦~");
}
+
public static FormWindowSimple HuTao_Windows(Player player, BaseNpc entity) {
- if(PlayerList.size()>0){
- for (int i = 0; i 0) {
+ for (int i = 0; i < PlayerList.size(); i++) {
+ if (player.getName().equals(PlayerList.get(i))) {
+ PlayerTargetEntityList.set(i, entity);
break;
- }else if(i == PlayerList.size() -1){
+ } else if (i == PlayerList.size() - 1) {
PlayerList.add(player.getName());
PlayerTargetEntityList.add(entity);
}
}
- }else {
+ } else {
PlayerList.add(player.getName());
PlayerTargetEntityList.add(entity);
}
FormWindowSimple home = new Npc_HuTao();
home.addButton(new ElementButton("唱一首歌", new ElementButtonImageData("path", "textures/ui/icon_recipe_nature")));
- if (player.isOp()) home.addButton(new ElementButton("修改NPC", new ElementButtonImageData("path", "textures/ui/setting")));
- if (player.isOp()) home.addButton(new ElementButton("查看NPC详细信息", new ElementButtonImageData("path", "textures/ui/icon_book_writable")));
+ if (player.isOp())
+ home.addButton(new ElementButton("修改NPC", new ElementButtonImageData("path", "textures/ui/setting")));
+ if (player.isOp())
+ home.addButton(new ElementButton("查看NPC详细信息", new ElementButtonImageData("path", "textures/ui/icon_book_writable")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Menu.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Menu.java
index 8d1bada..77b780f 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Menu.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Menu.java
@@ -8,11 +8,12 @@ public class Npc_Menu extends FormWindowSimple {
public Npc_Menu() {
super("§cNPC§6管理系统", "§o§b高自定义NPC系统\n§6你可以在这里生成/修改你的NPC");
}
- public static FormWindowSimple getNpc_Menu(){
+
+ public static FormWindowSimple getNpc_Menu() {
FormWindowSimple home = new Npc_Menu();
- home.addButton(new ElementButton("§6生成一个NPC", new ElementButtonImageData("path","textures/ui/mashup_PaintBrush")));
- home.addButton(new ElementButton("§o§cNPC管理", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("§6生成一个NPC", new ElementButtonImageData("path", "textures/ui/mashup_PaintBrush")));
+ home.addButton(new ElementButton("§o§cNPC管理", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting.java
index ddb52aa..33c3656 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting.java
@@ -8,12 +8,13 @@ public class Npc_Setting extends FormWindowSimple {
public Npc_Setting() {
super("§cNPC§6管理系统", "§o§b高自定义NPC系统\n§6你可以在这里生成/修改你的NPC");
}
- public static FormWindowSimple getNpc_Setting(){
+
+ public static FormWindowSimple getNpc_Setting() {
FormWindowSimple home = new Npc_Setting();
- home.addButton(new ElementButton("§a基础设置", new ElementButtonImageData("path","textures/ui/mashup_PaintBrush")));
- home.addButton(new ElementButton("§6皮肤设置", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("§b行为设置" , new ElementButtonImageData("path","textures/ui/icon_recipe_equipment")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("§a基础设置", new ElementButtonImageData("path", "textures/ui/mashup_PaintBrush")));
+ home.addButton(new ElementButton("§6皮肤设置", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("§b行为设置", new ElementButtonImageData("path", "textures/ui/icon_recipe_equipment")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base.java
index 51fa051..eb4af17 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base.java
@@ -8,13 +8,14 @@ public class Npc_Setting_Base extends FormWindowSimple {
public Npc_Setting_Base() {
super("§cNPC§6管理系统", "§o§b高自定义NPC系统\n§6你可以在这里生成/修改你的NPC");
}
- public static FormWindowSimple getNpc_Setting_Base(){
+
+ public static FormWindowSimple getNpc_Setting_Base() {
FormWindowSimple home = new Npc_Setting_Base();
- home.addButton(new ElementButton("§6名字设置", new ElementButtonImageData("path","textures/ui/mashup_PaintBrush")));
- home.addButton(new ElementButton("§6模型大小设置", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("§6装备/手持物设置", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("§c删除NPC", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("§6名字设置", new ElementButtonImageData("path", "textures/ui/mashup_PaintBrush")));
+ home.addButton(new ElementButton("§6模型大小设置", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("§6装备/手持物设置", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("§c删除NPC", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Delete.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Delete.java
index 8f0249a..ec744c3 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Delete.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Delete.java
@@ -7,20 +7,20 @@
import java.io.File;
public class Npc_Setting_Base_Delete {
- public static void Npc_Delete(Player p){
- for (int i = 0; i elements) {
super("§6修改npc模型大小", elements);
}
- public static FormWindowCustom Change_Npc_Model(){
+
+ public static FormWindowCustom Change_Npc_Model() {
List el = new ArrayList<>();
el.add(new ElementLabel("§l§6请输入模型缩放比例!"));
el.add(new ElementInput(" "));
return new Npc_Setting_Base_Model(el);
}
- public static void Npc_Model(Player p,String text){
- for (int i = 0; i < Npc_HuTao.PlayerList.size() ; i++) {
- if(p.getName().equals(Npc_HuTao.PlayerList.get(i))){
+
+ public static void Npc_Model(Player p, String text) {
+ for (int i = 0; i < Npc_HuTao.PlayerList.size(); i++) {
+ if (p.getName().equals(Npc_HuTao.PlayerList.get(i))) {
Config config;
File[] fileList = new File("penguin_plugin/Npc_config").listFiles();
assert fileList != null;
- for(File Folder : fileList){
- config = new Config(Folder,2);
+ for (File Folder : fileList) {
+ config = new Config(Folder, 2);
BaseNpc baseNpc = PlayerTargetEntityList.get(i);
- if(!Folder.getName().contains("npcBase") && baseNpc.namedTag.get("account").toString().contains(config.getString("uuid"))){
- if(Float.parseFloat(text)>=0.1 && Float.parseFloat(text)<=10){
- for (int j = 0; j = 0.1 && Float.parseFloat(text) <= 10) {
+ for (int j = 0; j < Npc_HuTao.PlayerList.size(); j++) {
+ if (p.getName().equals(Npc_HuTao.PlayerList.get(j))) {
+ config.set("model_size", Float.parseFloat(text));
config.save();
baseNpc.config = config;//重载配置文件
double bound = baseNpc.boundingBox.getMaxY() - baseNpc.boundingBox.getMinY();
@@ -48,8 +50,8 @@ public static void Npc_Model(Player p,String text){
p.getServer().updatePlayerListData(PlayerTargetEntityList.get(j).getUniqueId(), PlayerTargetEntityList.get(j).getId(), PlayerTargetEntityList.get(j).getName(), PlayerTargetEntityList.get(j).getSkin());
}
}
- p.sendToast("§6设置成功!","§a你成功更新了该npc的缩放比例!");
- }else p.sendMessage("§c你只能填写0.1~10范围的缩放比例!初始值为1");
+ p.sendToast("§6设置成功!", "§a你成功更新了该npc的缩放比例!");
+ } else p.sendMessage("§c你只能填写0.1~10范围的缩放比例!初始值为1");
}
}
break;
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Name.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Name.java
index ea452fc..5687930 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Name.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Base_Name.java
@@ -19,24 +19,26 @@ public class Npc_Setting_Base_Name extends FormWindowCustom {
public Npc_Setting_Base_Name(List elements) {
super("§6重命名npc", elements);
}
- public static FormWindowCustom Change_Npc_Name(){
+
+ public static FormWindowCustom Change_Npc_Name() {
List el = new ArrayList<>();
el.add(new ElementLabel("§l§6请输入新的名字!"));
el.add(new ElementInput(" "));
return new Npc_Setting_Base_Name(el);
}
- public static void Npc_Name(Player p,String text){
- for (int i = 0; i < Npc_HuTao.PlayerList.size() ; i++) {
- if(p.getName().equals(Npc_HuTao.PlayerList.get(i))){
+
+ public static void Npc_Name(Player p, String text) {
+ for (int i = 0; i < Npc_HuTao.PlayerList.size(); i++) {
+ if (p.getName().equals(Npc_HuTao.PlayerList.get(i))) {
Config config;
File[] fileList = new File("penguin_plugin/Npc_config").listFiles();
assert fileList != null;
- for(File Folder : fileList){
- config = new Config(Folder,2);
+ for (File Folder : fileList) {
+ config = new Config(Folder, 2);
BaseNpc baseNpc = PlayerTargetEntityList.get(i);
- if(!Folder.getName().contains("npcBase") && baseNpc.namedTag.get("account").toString().contains(config.getString("uuid"))){
- p.sendToast("§6设置成功!","§d你成功更新了该npc的命名!");
- config.set("name",text);
+ if (!Folder.getName().contains("npcBase") && baseNpc.namedTag.get("account").toString().contains(config.getString("uuid"))) {
+ p.sendToast("§6设置成功!", "§d你成功更新了该npc的命名!");
+ config.set("name", text);
config.save();
baseNpc.config = config;//重载配置文件
baseNpc.setNameTag("");//这里的setNameTag是多少都无所谓,只是一个触发的,以config返回值为准;
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Skin.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Skin.java
index 81e925e..09194ab 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Skin.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_Setting_Skin.java
@@ -19,23 +19,24 @@ public class Npc_Setting_Skin extends FormWindowSimple {
public Npc_Setting_Skin() {
super("§cNpc皮肤管理", "§o§d你正在更换该NPC的皮肤\n§6请选择你要更换的皮肤!");
}
- public static FormWindowSimple getNpc_Setting_Skin(){
+
+ public static FormWindowSimple getNpc_Setting_Skin() {
FormWindowSimple home = new Npc_Setting_Skin();
- File[] listFiles = new File("penguin_plugin","skins").listFiles();
+ File[] listFiles = new File("penguin_plugin", "skins").listFiles();
assert listFiles != null;
for (File Fold : listFiles) {
home.addButton(new ElementButton(Fold.getName(),
- new ElementButtonImageData("path" , "textures/npc_skins/" + Fold.getName())));
+ new ElementButtonImageData("path", "textures/npc_skins/" + Fold.getName())));
}
return home;
}
- public static void ChangeSkinSuccess(Player p , String text) throws IOException {
- for (int i = 0; i < Npc_HuTao.PlayerList.size() ; i++) {
- if(p.getName().equals(Npc_HuTao.PlayerList.get(i))){
+ public static void ChangeSkinSuccess(Player p, String text) throws IOException {
+ for (int i = 0; i < Npc_HuTao.PlayerList.size(); i++) {
+ if (p.getName().equals(Npc_HuTao.PlayerList.get(i))) {
BaseNpc human = Npc_HuTao.PlayerTargetEntityList.get(i);
Skin skin = new Skin();
- File file = new File("penguin_plugin","skins");
+ File file = new File("penguin_plugin", "skins");
File skin_file = new File(file, text);
BufferedImage image = ImageIO.read(skin_file); //skinData的数据类型为RGBA A为alpha
skin.setSkinData(image);
@@ -51,13 +52,13 @@ public static void ChangeSkinSuccess(Player p , String text) throws IOException
Config config;
File[] fileList = new File("penguin_plugin/Npc_config").listFiles();
assert fileList != null;
- for(File Folder : fileList){
- config = new Config(Folder,2);
- if(!Folder.getName().contains("npcBase") && human.namedTag.get("account").toString().contains(config.getString("uuid"))){
- config.set("skin",text);
+ for (File Folder : fileList) {
+ config = new Config(Folder, 2);
+ if (!Folder.getName().contains("npcBase") && human.namedTag.get("account").toString().contains(config.getString("uuid"))) {
+ config.set("skin", text);
config.save();
- human.config = config;
- p.sendToast("§6设置成功!","§b你成功更新了该npc的皮肤!");
+ human.config = config;
+ p.sendToast("§6设置成功!", "§b你成功更新了该npc的皮肤!");
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_information.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_information.java
index 8c7f15d..ec1c61d 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_information.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Create_NPC/Npc_information.java
@@ -9,10 +9,11 @@ public class Npc_information extends FormWindowSimple {
public Npc_information(String text) {
super("§cNPC§6管理系统", text);
}
- public static FormWindowSimple getNpc_information(Player p){
+
+ public static FormWindowSimple getNpc_information(Player p) {
StringBuilder text = new StringBuilder();
- for(int i = 0; i v = build_map.get(p.getName());
- if (v != null && v.size() == 2) {
- Coordinate_sorting.sorting(v);
- long[] xyz1 = new long[]{(long) v.get(0).x, (long) v.get(0).y, (long) v.get(0).z};
- ArrayList lengthen = new ArrayList<>();
- lengthen.add((long) Math.abs(v.get(0).x - v.get(1).x) + 1L);
- lengthen.add((long) Math.abs(v.get(0).y - v.get(1).y) + 1L);
- lengthen.add((long) Math.abs(v.get(0).z - v.get(1).z) + 1L);
- long temp;
- if (lengthen.get(0) <= 1000L && lengthen.get(1) <= 1000L && lengthen.get(2) <= 1000L) {
- temp = lengthen.get(0) * lengthen.get(1) * lengthen.get(2);
- if (temp <= 20000000L) {
- all_ok = true;
- } else {
- p.sendMessage("§m§c保存方块过多(" + temp + ">20000000块)");
- }
- } else {
- p.sendMessage("§m§cxyz的延申长度不得>1000");
- }
+ if (v != null && v.size() == 2) {
+ Coordinate_sorting.sorting(v);
+ long[] xyz1 = new long[]{(long) v.get(0).x, (long) v.get(0).y, (long) v.get(0).z};
+ ArrayList lengthen = new ArrayList<>();
+ lengthen.add((long) Math.abs(v.get(0).x - v.get(1).x) + 1L);
+ lengthen.add((long) Math.abs(v.get(0).y - v.get(1).y) + 1L);
+ lengthen.add((long) Math.abs(v.get(0).z - v.get(1).z) + 1L);
+ long temp;
+ if (lengthen.get(0) <= 1000L && lengthen.get(1) <= 1000L && lengthen.get(2) <= 1000L) {
+ temp = lengthen.get(0) * lengthen.get(1) * lengthen.get(2);
+ if (temp <= 20000000L) {
+ all_ok = true;
+ } else {
+ p.sendMessage("§m§c保存方块过多(" + temp + ">20000000块)");
+ }
+ } else {
+ p.sendMessage("§m§cxyz的延申长度不得>1000");
+ }
- if (all_ok) {
- Long[] xyz2 = new Long[]{(long) v.get(1).x, (long) v.get(1).y, (long) v.get(1).z};
- p.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + "\n已为你保存!");
+ if (all_ok) {
+ Long[] xyz2 = new Long[]{(long) v.get(1).x, (long) v.get(1).y, (long) v.get(1).z};
+ p.sendMessage("§e坐标1 " + Arrays.toString(xyz1) + "\n§a坐标2 " + Arrays.toString(xyz2) + "\n已为你保存!");
- long x_fill = xyz1[0];
- long y_fill = xyz1[1];
- long z_fill = xyz1[2];
+ long x_fill = xyz1[0];
+ long y_fill = xyz1[1];
+ long z_fill = xyz1[2];
- Location_Collect = new StringBuilder();
- Block_Collect = new StringBuilder();
- while (true) {
- Vector3 vector_fill = new Vector3((double) x_fill, (double) y_fill, (double) z_fill);
- if (!(p.level.getBlock(vector_fill).getId() == 0)) {
- Location_Collect.append(x_fill - xyz1[0]).append(" ").append(y_fill - xyz1[1]).append(" ").append(z_fill - xyz1[2]).append(" ");
- Block_Collect.append(p.level.getBlock(vector_fill).getId()).append(" ").append(p.level.getBlock(vector_fill).getExactIntStorage()).append(" ");
- }
- if (x_fill >= xyz2[0]) {
- x_fill = xyz1[0] - 1L;
- ++y_fill;
- }
- if (y_fill > xyz2[1]) {
- y_fill = xyz1[1];
- ++z_fill;
- }
- if (z_fill > xyz2[2]) {
- break;
- }
- ++x_fill;
- }
+ Location_Collect = new StringBuilder();
+ Block_Collect = new StringBuilder();
+ while (true) {
+ Vector3 vector_fill = new Vector3((double) x_fill, (double) y_fill, (double) z_fill);
+ if (!(p.level.getBlock(vector_fill).getId() == 0)) {
+ Location_Collect.append(x_fill - xyz1[0]).append(" ").append(y_fill - xyz1[1]).append(" ").append(z_fill - xyz1[2]).append(" ");
+ Block_Collect.append(p.level.getBlock(vector_fill).getId()).append(" ").append(p.level.getBlock(vector_fill).getExactIntStorage()).append(" ");
+ }
+ if (x_fill >= xyz2[0]) {
+ x_fill = xyz1[0] - 1L;
+ ++y_fill;
+ }
+ if (y_fill > xyz2[1]) {
+ y_fill = xyz1[1];
+ ++z_fill;
+ }
+ if (z_fill > xyz2[2]) {
+ break;
+ }
+ ++x_fill;
}
}
+ }
assert Location_Collect != null;
build.set("location", Location_Collect.toString());
build.set("block", Block_Collect.toString());
- build.set("max_x", v.get(1).x - v.get(0).x +1);
- build.set("max_y", v.get(1).y - v.get(0).y +1);
- build.set("max_z", v.get(1).z - v.get(0).z +1);
+ build.set("max_x", v.get(1).x - v.get(0).x + 1);
+ build.set("max_y", v.get(1).y - v.get(0).y + 1);
+ build.set("max_z", v.get(1).z - v.get(0).z + 1);
build.save();
}
}
\ No newline at end of file
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/CreateFile.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/CreateFile.java
index 9ed2584..8cb6562 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/CreateFile.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/CreateFile.java
@@ -16,7 +16,8 @@ public class CreateFile extends FormWindowCustom {
public CreateFile(List elements) {
super("§6创建文件夹", elements);
}
- public static FormWindowCustom Window_Crate_Files(Player p){
+
+ public static FormWindowCustom Window_Crate_Files(Player p) {
List el = new ArrayList<>();
el.add(new ElementLabel("§l§6请命名你的新文件夹!"));
el.add(new ElementLabel("§l§b如果重名,将会生成副本!\n§g名字不要太奇怪了,低概率可能会创建失败"));
@@ -24,17 +25,17 @@ public static FormWindowCustom Window_Crate_Files(Player p){
return new CreateFile(el);
}
- public static FormWindowSimple Super_File(String text){
- FormWindowSimple home = new FormWindowSimple("§6创建文件夹","");
- File file = new File("penguin_plugin","Builder_Save");
+ public static FormWindowSimple Super_File(String text) {
+ FormWindowSimple home = new FormWindowSimple("§6创建文件夹", "");
+ File file = new File("penguin_plugin", "Builder_Save");
File world_file = new File(file, text);
- if(text.equals("")){
+ if (text.equals("")) {
home.setContent("§l§c文件夹不能没有名字!!!");
- }else {
+ } else {
if (!world_file.exists()) {
- home.setContent("§你成功创建了名为 "+ text +" 的文件夹!");
+ home.setContent("§你成功创建了名为 " + text + " 的文件夹!");
world_file.mkdirs();
- }else home.setContent("§c名为 §6" + text + " §c的文件夹已经存在,请不要重名!");
+ } else home.setContent("§c名为 §6" + text + " §c的文件夹已经存在,请不要重名!");
}
home.addButton(new ElementButton("确定!"));
return home;
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Create_To.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Create_To.java
index b231e9f..901588d 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Create_To.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Create_To.java
@@ -9,16 +9,17 @@
public class Create_To extends FormWindowSimple {
public Create_To() {
- super("保存文件·菜单","");
+ super("保存文件·菜单", "");
}
- public static FormWindowSimple Create_Yml_To(String text){
+
+ public static FormWindowSimple Create_Yml_To(String text) {
FormWindowSimple home = new Create_To();
- if(text.equals("")){
- home = new FormWindowSimple("错误!","§l§c建筑储存不能没有名字!!!");
+ if (text.equals("")) {
+ home = new FormWindowSimple("错误!", "§l§c建筑储存不能没有名字!!!");
home.addButton(new ElementButton("确定!"));
- }else {
+ } else {
home.setContent("§a" + text + "\n§l§6 文件保存至>>>\n");
- File[] listFiles = new File("penguin_plugin","Builder_Save").listFiles();
+ File[] listFiles = new File("penguin_plugin", "Builder_Save").listFiles();
assert listFiles != null;
for (File wFolder : listFiles) {
home.addButton(new ElementButton(wFolder.getName(), new ElementButtonImageData("path", "textures/ui/book3")));
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/FileList.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/FileList.java
index 9f92cac..cb96812 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/FileList.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/FileList.java
@@ -14,7 +14,7 @@ public FileList() {
public static FormWindowSimple Window_File_List(Player p, String file) {
FormWindowSimple home = new FileList();
- File[] listFiles = new File("penguin_plugin","Builder_Save\\" + file).listFiles();
+ File[] listFiles = new File("penguin_plugin", "Builder_Save\\" + file).listFiles();
assert listFiles != null;
for (File wFolder : listFiles) {
home.addButton(new ElementButton(wFolder.getName(), new ElementButtonImageData("path", "textures/ui/book3")));
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Filecenter.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Filecenter.java
index 007c23e..4d7cfef 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Filecenter.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Filecenter.java
@@ -10,13 +10,14 @@ public class Filecenter extends FormWindowSimple {
public Filecenter() {
super("\uE100op用建筑储存器\uE100", "尊敬的管理员\n你正在管理服务器的建筑储存,不懂的请看介绍");
}
- public static FormWindowSimple Crate_Files(){
+
+ public static FormWindowSimple Crate_Files() {
FormWindowSimple home = new Filecenter();
- File[] listFiles = new File("penguin_plugin","Builder_Save").listFiles();
+ File[] listFiles = new File("penguin_plugin", "Builder_Save").listFiles();
assert listFiles != null;
- home.addButton(new ElementButton("新建文件夹", new ElementButtonImageData("path","textures/ui/create")));
+ home.addButton(new ElementButton("新建文件夹", new ElementButtonImageData("path", "textures/ui/create")));
for (File wFolder : listFiles) {
- home.addButton(new ElementButton(wFolder.getName(), new ElementButtonImageData("path","textures/ui/file")));
+ home.addButton(new ElementButton(wFolder.getName(), new ElementButtonImageData("path", "textures/ui/file")));
}
return home;
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Introduct.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Introduct.java
index 3153ce4..308b01a 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Introduct.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Introduct.java
@@ -13,7 +13,7 @@ public static FormWindowSimple getIntroduction() {
FormWindowSimple home = new Introduct();
home.setTitle("§6建筑储存介绍");
home.setContent("§b与创世神一起使用!§g选取好坐标1,坐标2后,可以使用储存功能保存到服务器已有的文件夹。\\n§c与此同时,你可以浏览服务器文件夹并且生成建筑在你的脚下。\\n§d注意!生成方向在XZ轴正方向延申,该操作不可逆!慎用!\"");
- home.addButton(new ElementButton("返回上级", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("返回上级", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
\ No newline at end of file
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Paste_Build.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Paste_Build.java
index 2a1427f..ff4dcb6 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Paste_Build.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Paste_Build.java
@@ -15,14 +15,15 @@
public class Paste_Build extends FormWindowSimple {
static ArrayList save;
+
public Paste_Build(String string, String con) {
super(string, con);
save = new ArrayList<>();
}
- public static FormWindowSimple Build(String button){
- FormWindowSimple home = new Paste_Build("|建筑操作|","你正在控制名为 §6"+ button +" §r的建筑\n§b粘贴将会粘贴在你的脚下(人体模型两格子第二格子)(即当前坐标)");
- home.addButton(new ElementButton("生成建筑" , new ElementButtonImageData("path","textures/ui/save")));
+ public static FormWindowSimple Build(String button) {
+ FormWindowSimple home = new Paste_Build("|建筑操作|", "你正在控制名为 §6" + button + " §r的建筑\n§b粘贴将会粘贴在你的脚下(人体模型两格子第二格子)(即当前坐标)");
+ home.addButton(new ElementButton("生成建筑", new ElementButtonImageData("path", "textures/ui/save")));
home.addButton(new ElementButton("水平旋转90°并生成建筑"));
home.addButton(new ElementButton("水平旋转180°并生成建筑"));
home.addButton(new ElementButton("水平旋转270°并生成建筑"));
@@ -31,15 +32,15 @@ public static FormWindowSimple Build(String button){
home.addButton(new ElementButton("垂直Y镜像并生成建筑"));
home.addButton(new ElementButton("垂直X旋转90°并生成建筑"));
home.addButton(new ElementButton("垂直Z旋转90°并生成建筑"));
- home.addButton(new ElementButton("删除建筑", new ElementButtonImageData("path","textures/ui/icon_trash")));
+ home.addButton(new ElementButton("删除建筑", new ElementButtonImageData("path", "textures/ui/icon_trash")));
home.addButton(new ElementButton("关闭"));
return home;
}
- public static void PasteBuild(Player p,String button,int way){
+ public static void PasteBuild(Player p, String button, int way) {
// 刷新undo撤销
- undo_map.put(p.getName(),new ArrayList<>());
+ undo_map.put(p.getName(), new ArrayList<>());
FormWindowSimple home = new FormWindowSimple("|建筑生成|", "你已生成名为 §6" + button + " §r的建筑");
Config file = new Config(button);
@@ -48,14 +49,14 @@ public static void PasteBuild(Player p,String button,int way){
String[] location_list = location.split(" ");
String[] block_list = block.split(" ");
double x = p.getX(), y = p.getY(), z = p.getZ();
- double max_x = (double) file.get("max_x"),max_y = (double) file.get("max_y"),max_z = (double) file.get("max_z");
+ double max_x = (double) file.get("max_x"), max_y = (double) file.get("max_y"), max_z = (double) file.get("max_z");
int j = 0;
home.addButton(new ElementButton("确认"));
p.showFormWindow(home);
int data = 0;
- switch (way){
+ switch (way) {
//正常放置
- case 0 ->{
+ case 0 -> {
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(Double.parseDouble(location_list[i]) + x,
Double.parseDouble(location_list[i + 1]) + y,
@@ -64,23 +65,23 @@ public static void PasteBuild(Player p,String button,int way){
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//水平旋转90度
- case 1 ->{
+ case 1 -> {
for (int i = 0; i < location_list.length; i += 3) {
- Vector3 vector3 = new Vector3(max_z - Double.parseDouble(location_list[i+2]) + x,
+ Vector3 vector3 = new Vector3(max_z - Double.parseDouble(location_list[i + 2]) + x,
Double.parseDouble(location_list[i + 1]) + y,
Double.parseDouble(location_list[i]) + z);
Block b = Block.get(Integer.parseInt(block_list[j]));
save.add(p.getLevel().getBlock(vector3));
- if(FullBlockTest(b)){
+ if (FullBlockTest(b)) {
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
}
- if(b.getName().contains("Stair")){
- switch (Integer.parseInt(block_list[j + 1])){
+ if (b.getName().contains("Stair")) {
+ switch (Integer.parseInt(block_list[j + 1])) {
case 0 -> data = 2;
case 1 -> data = 3;
case 2 -> data = 1;
@@ -92,30 +93,31 @@ public static void PasteBuild(Player p,String button,int way){
}
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), data));
} else if (b.getName().contains("Fence Gate")) {
- switch (Integer.parseInt(block_list[j + 1])){
+ switch (Integer.parseInt(block_list[j + 1])) {
case 0, 2 -> data = 1;
case 1, 3 -> data = 2;
case 4, 6 -> data = 5;
case 5, 7 -> data = 4;
}
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), data));
- }else if (b.getName().contains("Ladder")) {
- switch (Integer.parseInt(block_list[j + 1])){
+ } else if (b.getName().contains("Ladder")) {
+ switch (Integer.parseInt(block_list[j + 1])) {
case 2 -> data = 5;
case 3 -> data = 4;
case 4 -> data = 2;
case 5 -> data = 3;
}
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), data));
- }else p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
+ } else
+ p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//水平旋转180度
- case 2 ->{
+ case 2 -> {
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(max_x - Double.parseDouble(location_list[i]) + x,
Double.parseDouble(location_list[i + 1]) + y,
@@ -124,7 +126,7 @@ public static void PasteBuild(Player p,String button,int way){
save.add(p.getLevel().getBlock(vector3));
- if(FullBlockTest(b)){
+ if (FullBlockTest(b)) {
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
}
if (b.getName().contains("Stair")) {
@@ -150,14 +152,15 @@ public static void PasteBuild(Player p,String button,int way){
case 5 -> data = 3;
}
j += 2;
- }else p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
+ } else
+ p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//水平旋转270度
- case 3 ->{
+ case 3 -> {
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(Double.parseDouble(location_list[i + 2]) + x,
Double.parseDouble(location_list[i + 1]) + y,
@@ -170,11 +173,11 @@ public static void PasteBuild(Player p,String button,int way){
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//X镜像
- case 4 ->{
+ case 4 -> {
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(max_x - Double.parseDouble(location_list[i]) + x,
Double.parseDouble(location_list[i + 1]) + y,
@@ -187,11 +190,11 @@ public static void PasteBuild(Player p,String button,int way){
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//Z镜像
- case 5 ->{
+ case 5 -> {
p.sendMessage("Z镜像翻转成功!");
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(Double.parseDouble(location_list[i]) + x,
@@ -201,7 +204,7 @@ public static void PasteBuild(Player p,String button,int way){
save.add(p.getLevel().getBlock(vector3));
- if(FullBlockTest(b)){
+ if (FullBlockTest(b)) {
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
}
if (b.getName().contains("Stair")) {
@@ -210,7 +213,7 @@ public static void PasteBuild(Player p,String button,int way){
case 3 -> data = 2;
case 7 -> data = 6;
case 6 -> data = 7;
- default -> data = Integer.parseInt(block_list[j+1]);
+ default -> data = Integer.parseInt(block_list[j + 1]);
}
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), data));
} else if (b.getName().contains("Fence Gate")) {
@@ -219,25 +222,26 @@ public static void PasteBuild(Player p,String button,int way){
case 2 -> data = 0;
case 4 -> data = 6;
case 6 -> data = 4;
- default -> data = Integer.parseInt(block_list[j+1]);
+ default -> data = Integer.parseInt(block_list[j + 1]);
}
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), data));
} else if (b.getName().contains("Ladder")) {
switch (Integer.parseInt(block_list[j + 1])) {
case 3 -> data = 2;
case 2 -> data = 3;
- default -> data = Integer.parseInt(block_list[j+1]);
+ default -> data = Integer.parseInt(block_list[j + 1]);
}
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), data));
- }else p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
+ } else
+ p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//Y镜像
- case 6 ->{
+ case 6 -> {
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(Double.parseDouble(location_list[i]) + x,
max_y - Double.parseDouble(location_list[i + 1]) + y,
@@ -246,7 +250,7 @@ public static void PasteBuild(Player p,String button,int way){
save.add(p.getLevel().getBlock(vector3));
- if(FullBlockTest(b)){
+ if (FullBlockTest(b)) {
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
}
if (b.getName().contains("Stair")) {
@@ -255,18 +259,19 @@ public static void PasteBuild(Player p,String button,int way){
case 3 -> data = 2;
case 7 -> data = 6;
case 6 -> data = 7;
- default -> data = Integer.parseInt(block_list[j+1]);
+ default -> data = Integer.parseInt(block_list[j + 1]);
}
p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), data));
- } else p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
+ } else
+ p.getLevel().setBlock(vector3, Block.get(Integer.parseInt(block_list[j]), Integer.parseInt(block_list[j + 1])));
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//垂直X旋转90度
- case 7 ->{
+ case 7 -> {
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(Double.parseDouble(location_list[i + 1]) + x,
Double.parseDouble(location_list[i]) + y,
@@ -279,11 +284,11 @@ public static void PasteBuild(Player p,String button,int way){
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
//垂直Z旋转90度
- case 8 ->{
+ case 8 -> {
for (int i = 0; i < location_list.length; i += 3) {
Vector3 vector3 = new Vector3(Double.parseDouble(location_list[i]) + x,
Double.parseDouble(location_list[i + 2]) + y,
@@ -296,21 +301,21 @@ public static void PasteBuild(Player p,String button,int way){
j += 2;
}
- undo_map.put(p.getName(),save);
+ undo_map.put(p.getName(), save);
}
}
}
- public static FormWindowSimple DeleteBuild(String button){
- FormWindowSimple home = new FormWindowSimple("|建筑删除|","你已经删除 §6" + button +" §r的建筑");
+ public static FormWindowSimple DeleteBuild(String button) {
+ FormWindowSimple home = new FormWindowSimple("|建筑删除|", "你已经删除 §6" + button + " §r的建筑");
File file = new File(button);
file.delete();
home.addButton(new ElementButton("确认"));
return home;
}
- private static boolean FullBlockTest(Block b){
+ private static boolean FullBlockTest(Block b) {
return b.isFullBlock() ||
b.getName().contains("Wall") ||
(b.getName().contains("Fence") && !b.getName().contains("Gate")) ||
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/SaveBuild.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/SaveBuild.java
index be2ea29..c5d2be8 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/SaveBuild.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/SaveBuild.java
@@ -13,7 +13,8 @@ public class SaveBuild extends FormWindowCustom {
public SaveBuild(List elements) {
super("保存文件·菜单", elements);
}
- public static FormWindowCustom Create_Yml(){
+
+ public static FormWindowCustom Create_Yml() {
List el = new ArrayList();
el.add(new ElementLabel("§l§6输入建筑名称"));
el.add(new ElementLabel("§l§b禁止重名,否则无法创建!\n§g名字不要太奇怪了,低概率可能会创建失败"));
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Save_Success.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Save_Success.java
index 8cad9ee..1c5ab35 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Save_Success.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Save_Success.java
@@ -15,8 +15,9 @@
public class Save_Success extends FormWindowSimple {
public Save_Success() {
- super("保存文件·菜单","");
+ super("保存文件·菜单", "");
}
+
public static FormWindowSimple SaveSuccess(Player p, String File, String Text) throws IOException {
FormWindowSimple simple = new Save_Success();
@@ -24,12 +25,12 @@ public static FormWindowSimple SaveSuccess(Player p, String File, String Text) t
if (v != null && v.size() == 2) {
simple.setContent("§6 " + Text + " §a已成功保存至§6 " + File);
- File file = new File("penguin_plugin","Builder_Save\\" + File);
+ File file = new File("penguin_plugin", "Builder_Save\\" + File);
File yml = new File(file, Text + ".yml");
if (!yml.exists()) {
yml.createNewFile();
- clone_block(yml , p);
- }else {
+ clone_block(yml, p);
+ } else {
simple.setContent("§c[Error] " + Text + " 文件已经存在在 §6" + File + " §c中,请勿重名!");
}
} else {
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Utils/BO.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Utils/BO.java
index 6f01d65..e68e487 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Utils/BO.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/Utils/BO.java
@@ -3,13 +3,14 @@
import java.io.Serializable;
import java.util.ArrayList;
-public class BO implements Serializable{
+public class BO implements Serializable {
static ArrayList b;
- public static void setBlocks(ArrayList b){
- BO.b = b;
- }
public static ArrayList getBlocks() {
return b;
}
+
+ public static void setBlocks(ArrayList b) {
+ BO.b = b;
+ }
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/opSaveBuilder.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/opSaveBuilder.java
index 3f09db4..97ddbdf 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/opSaveBuilder.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/SaveBuilder/opSaveBuilder.java
@@ -8,12 +8,13 @@ public class opSaveBuilder extends FormWindowSimple {
public opSaveBuilder() {
super("op用建筑储存器", "尊敬的管理员\n你正在管理服务器的建筑储存,不懂的请看介绍");
}
- public static FormWindowSimple getWindow_op_save_builder(){
+
+ public static FormWindowSimple getWindow_op_save_builder() {
FormWindowSimple home = new opSaveBuilder();
- home.addButton(new ElementButton("储存建筑文件", new ElementButtonImageData("path","textures/ui/save")));
- home.addButton(new ElementButton("文件夹目录", new ElementButtonImageData("path","textures/ui/book2")));
- home.addButton(new ElementButton("功能介绍", new ElementButtonImageData("path","textures/ui/book1")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("储存建筑文件", new ElementButtonImageData("path", "textures/ui/save")));
+ home.addButton(new ElementButton("文件夹目录", new ElementButtonImageData("path", "textures/ui/book2")));
+ home.addButton(new ElementButton("功能介绍", new ElementButtonImageData("path", "textures/ui/book1")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
\ No newline at end of file
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Setting/Setting.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Setting/Setting.java
index 947f68e..ff1974c 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Setting/Setting.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Setting/Setting.java
@@ -8,12 +8,13 @@ public class Setting extends FormWindowSimple {
public Setting() {
super("系统设置", "为你的玩法手感和习惯对你的游戏做调整以适应喜好;");
}
- public static FormWindowSimple getWindowSetting(){
+
+ public static FormWindowSimple getWindowSetting() {
FormWindowSimple home = new Setting();
- home.addButton(new ElementButton("设置1", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("设置2", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("设置3", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("设置1", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("设置2", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("设置3", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Shop/Shop.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Shop/Shop.java
index 21adda5..86ce0c6 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Shop/Shop.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Shop/Shop.java
@@ -8,13 +8,14 @@ public class Shop extends FormWindowSimple {
public Shop() {
super("商店系统", "全球市场!\n在这里购买你想要的物品! 每日价格会有波动!");
}
- public static FormWindowSimple getWindowShop(){
+
+ public static FormWindowSimple getWindowShop() {
FormWindowSimple home = new Shop();
- home.addButton(new ElementButton("货币转换", new ElementButtonImageData("path","textures/ui/ball")));
- home.addButton(new ElementButton("全球市场", new ElementButtonImageData("path","textures/ui/the_world")));
- home.addButton(new ElementButton("投资理财", new ElementButtonImageData("path","textures/ui/sea_tortoise")));
- home.addButton(new ElementButton("账单流水", new ElementButtonImageData("path","textures/ui/icon_book_writable")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("货币转换", new ElementButtonImageData("path", "textures/ui/ball")));
+ home.addButton(new ElementButton("全球市场", new ElementButtonImageData("path", "textures/ui/the_world")));
+ home.addButton(new ElementButton("投资理财", new ElementButtonImageData("path", "textures/ui/sea_tortoise")));
+ home.addButton(new ElementButton("账单流水", new ElementButtonImageData("path", "textures/ui/icon_book_writable")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Socail/Social_Contact.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Socail/Social_Contact.java
index 4df7c5f..3e06be1 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Socail/Social_Contact.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Socail/Social_Contact.java
@@ -4,17 +4,17 @@
import cn.nukkit.form.element.ElementButtonImageData;
import cn.nukkit.form.window.FormWindowSimple;
-public class Social_Contact extends FormWindowSimple{
+public class Social_Contact extends FormWindowSimple {
public Social_Contact() {
super("社交系统", "在这里结交新的朋友,并与他们互动!");
}
- public static FormWindowSimple getWindowSocial_Contact(){
+ public static FormWindowSimple getWindowSocial_Contact() {
FormWindowSimple home = new Social_Contact();
- home.addButton(new ElementButton("我的好友", new ElementButtonImageData("path","textures/ui/world_friends")));
- home.addButton(new ElementButton("好友申请表", new ElementButtonImageData("path","textures/ui/icon_book_writable")));
- home.addButton(new ElementButton("社交开放权限设置", new ElementButtonImageData("path","textures/ui/setting")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("我的好友", new ElementButtonImageData("path", "textures/ui/world_friends")));
+ home.addButton(new ElementButton("好友申请表", new ElementButtonImageData("path", "textures/ui/icon_book_writable")));
+ home.addButton(new ElementButton("社交开放权限设置", new ElementButtonImageData("path", "textures/ui/setting")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Teleport/Teleport_Menu.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Teleport/Teleport_Menu.java
index 1f3123a..920b7ca 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Teleport/Teleport_Menu.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/Teleport/Teleport_Menu.java
@@ -8,11 +8,12 @@ public class Teleport_Menu extends FormWindowSimple {
public Teleport_Menu() {
super("传送系统", "便捷传送\n请选择你要传送的目的地!");
}
- public static FormWindowSimple getWindowTeleport_Menu(){
+
+ public static FormWindowSimple getWindowTeleport_Menu() {
FormWindowSimple home = new Teleport_Menu();
- home.addButton(new ElementButton("回到主世界出生地", new ElementButtonImageData("path","textures/ui/icon_spring")));
- home.addButton(new ElementButton("玩家互传", new ElementButtonImageData("path","textures/ui/promo_creeper")));
- home.addButton(new ElementButton("返回", new ElementButtonImageData("path","textures/ui/back")));
+ home.addButton(new ElementButton("回到主世界出生地", new ElementButtonImageData("path", "textures/ui/icon_spring")));
+ home.addButton(new ElementButton("玩家互传", new ElementButtonImageData("path", "textures/ui/promo_creeper")));
+ home.addButton(new ElementButton("返回", new ElementButtonImageData("path", "textures/ui/back")));
return home;
}
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/WorldMenuWindow.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/WorldMenuWindow.java
index 035031e..f2d3459 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/WorldMenuWindow.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/Windows/WorldMenuWindow.java
@@ -11,20 +11,20 @@
public class WorldMenuWindow extends FormWindowSimple {
public WorldMenuWindow() {
- super("§l§6§ka§ca§ba§da§aa§4a§7a§1a §r§m§g| WORLD MENU |§l§6§ka§1a§7a§aa§da§ba§ca§6a", "§l§a世界时间:"+date_show +" §l§6我的世界、无尽可能!");
+ super("§l§6§ka§ca§ba§da§aa§4a§7a§1a §r§m§g| WORLD MENU |§l§6§ka§1a§7a§aa§da§ba§ca§6a", "§l§a世界时间:" + date_show + " §l§6我的世界、无尽可能!");
}
- public static FormWindowSimple getWindowSimple(Player p){
+ public static FormWindowSimple getWindowSimple(Player p) {
FormWindowSimple windowSimple = new WorldMenuWindow();
- windowSimple.addButton(new ElementButton("§a传送系统", new ElementButtonImageData("path","textures/ui/Teleport")));
- windowSimple.addButton(new ElementButton("§6家园系统", new ElementButtonImageData("path","textures/ui/update_world_chunks")));
- windowSimple.addButton(new ElementButton("§c商店系统", new ElementButtonImageData("path","textures/ui/shop")));
- windowSimple.addButton(new ElementButton("§d社交系统", new ElementButtonImageData("path","textures/ui/world_friends")));
- windowSimple.addButton(new ElementButton("§g个人系统", new ElementButtonImageData("path","textures/ui/world_player")));
- windowSimple.addButton(new ElementButton(" §b设 置", new ElementButtonImageData("path","textures/ui/setting")));
- if(p.isOp()){
- windowSimple.addButton(new ElementButton("§o§6建筑存储器", new ElementButtonImageData("path","textures/ui/build")));
- windowSimple.addButton(new ElementButton("§o§6NPC生成器", new ElementButtonImageData("path","textures/ui/book2")));
+ windowSimple.addButton(new ElementButton("§a传送系统", new ElementButtonImageData("path", "textures/ui/Teleport")));
+ windowSimple.addButton(new ElementButton("§6家园系统", new ElementButtonImageData("path", "textures/ui/update_world_chunks")));
+ windowSimple.addButton(new ElementButton("§c商店系统", new ElementButtonImageData("path", "textures/ui/shop")));
+ windowSimple.addButton(new ElementButton("§d社交系统", new ElementButtonImageData("path", "textures/ui/world_friends")));
+ windowSimple.addButton(new ElementButton("§g个人系统", new ElementButtonImageData("path", "textures/ui/world_player")));
+ windowSimple.addButton(new ElementButton(" §b设 置", new ElementButtonImageData("url", "http://49.234.35.212/nasa/img/北纬63度的日晕.jpg")));
+ if (p.isOp()) {
+ windowSimple.addButton(new ElementButton("§o§6建筑存储器", new ElementButtonImageData("path", "textures/ui/build")));
+ windowSimple.addButton(new ElementButton("§o§6NPC生成器", new ElementButtonImageData("path", "textures/ui/book2")));
}
return windowSimple;
}
diff --git a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/dimension/MyFirstDimension.java b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/dimension/MyFirstDimension.java
index b3b0941..9581cc0 100644
--- a/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/dimension/MyFirstDimension.java
+++ b/src/Minecraft/nukkit/cn/sohugepenguin/plugin/testPlugin/dimension/MyFirstDimension.java
@@ -17,6 +17,11 @@ public float getBaseHeight() {
return 10F;
}
+ @Override
+ public void setBaseHeight(float baseHeight) {
+ super.setBaseHeight(0);
+ }
+
@Override
public void setId(int id) {
super.setId(id);
@@ -50,9 +55,4 @@ public Context getContext() {
public String getID() {
return null;
}
-
- @Override
- public void setBaseHeight(float baseHeight) {
- super.setBaseHeight(0);
- }
}
diff --git a/src/plugin.yml b/src/plugin.yml
index 1706169..d3786df 100644
--- a/src/plugin.yml
+++ b/src/plugin.yml
@@ -1,6 +1,6 @@
name: Penguin_Plugin_1
main: Minecraft.nukkit.cn.sohugepenguin.plugin.testPlugin.Main_PluginBase
-version: 0. 0. 3
+version: 1. 4. 3
api: [1.0.9]
author: penguin
@@ -62,6 +62,11 @@ commands:
description: "画球指令,输入/ball查看用法"
usage: "画球指令用法:/ball 半径(整数,必选) 方块ID(必选) 方块特殊值(可选)keep(保持,可选,使用时,方块特殊值必须要写)"
+ map:
+ permission: "Map.show"
+ description: "小地图测试"
+ usage: "/map"
+
permissions:
command.biomes:
default: op
@@ -96,6 +101,9 @@ permissions:
command.Model.Zoom:
default: op
+ command.Map.show:
+ default: true
+
#.....
\ No newline at end of file