Skip to content

Commit

Permalink
null
Browse files Browse the repository at this point in the history
  • Loading branch information
nullaqua committed Feb 12, 2022
1 parent 5657546 commit 4bb3bc7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 8 deletions.
20 changes: 16 additions & 4 deletions src/main/java/me/lanzhi/bluestargame/BluestarGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.Plugin;
import org.bukkit.scheduler.BukkitTask;
Expand Down Expand Up @@ -42,10 +43,21 @@ public void onEnable()
{
CTRL.runAuto(true);
}
ShapedRecipe recipe = new ShapedRecipe(new org.bukkit.NamespacedKey(this, "supersponge"), superSponge.getSuperSponge().getItem());
recipe = recipe.shape("aaa", "aaa", "aaa");
recipe = recipe.setIngredient('a', Material.SPONGE);
Bukkit.addRecipe(recipe);

ShapedRecipe bluestarsponge = new ShapedRecipe(new org.bukkit.NamespacedKey(this, "bluestarsponge"), superSponge.getSuperSponge().getItem());
bluestarsponge = bluestarsponge.shape("aaa", "aaa", "aaa");
bluestarsponge = bluestarsponge.setIngredient('a', Material.SPONGE);
Bukkit.addRecipe(bluestarsponge);

ShapedRecipe supersponge = new ShapedRecipe(new org.bukkit.NamespacedKey(this, "supersponge"), superSponge.getSuperSponge().getItem());
supersponge = supersponge.shape("a");
supersponge = supersponge.setIngredient('a', new RecipeChoice.ExactChoice(superSponge.getlavaSponge().getItem()));
Bukkit.addRecipe(supersponge);

ShapedRecipe lavasponge = new ShapedRecipe(new org.bukkit.NamespacedKey(this, "lavasponge"), superSponge.getlavaSponge().getItem());
lavasponge = lavasponge.shape("a");
lavasponge = lavasponge.setIngredient('a', new RecipeChoice.ExactChoice(superSponge.getSuperSponge().getItem()));
Bukkit.addRecipe(lavasponge);
this.task = new CtrlSponge().ctrlsponge.runTaskTimer(getPlugin(BluestarGame.class), 0L, 2L);
System.out.println("BluestarGame已加载");
}
Expand Down
24 changes: 20 additions & 4 deletions src/main/java/me/lanzhi/bluestargame/Type/superSponge.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@

public final class superSponge implements ConfigurationSerializable {
private static NBTItem superSponge = null;
private static NBTItem lavaSponge = null;
private final int age;
private final Location location;
private final Player player;

public superSponge(Map<String, Object> map)
{
this.age = ((Integer) map.get("age")).intValue();
this.age = (int)map.get("age");
this.location = ((Location) map.get("location"));
this.player = Bukkit.getPlayer((String) map.get("player"));
}
Expand All @@ -39,22 +40,37 @@ public static NBTItem getSuperSponge()
if (superSponge == null)
{
superSponge = new NBTItem(new ItemStack(Material.END_STONE));
superSponge.setBoolean("BluestarGameSponge", Boolean.valueOf(true));
superSponge.setBoolean("BluestarGameSponge",true);
NBTCompound display = superSponge.addCompound("display");
display.setString("Name", "\"" + ChatColor.GOLD + "超级海绵\"");
display.setString("Name", "\"" + ChatColor.GOLD + "超级海绵(原版)\"");
List<String> list = display.getStringList("Lore");
list.add("\"" + ChatColor.AQUA + "放在 水/岩浆 中或 水/岩浆 旁边\"");
list.add("\"" + ChatColor.AQUA + "即可吸干附近" + BluestarGame.config.getConfig().getInt("spongeR") + "格的 水/岩浆\"");
list.add("\"" + ChatColor.RED + "放在没 水/岩浆 的地方会直接消失哦!\"");
}
return superSponge;
}
public static NBTItem getlavaSponge()
{
if (lavaSponge == null)
{
lavaSponge = new NBTItem(new ItemStack(Material.OBSIDIAN));
lavaSponge.setBoolean("BluestarGameSponge",true);
NBTCompound display = lavaSponge.addCompound("display");
display.setString("Name", "\"" + ChatColor.GOLD + "超级海绵(岩浆版)\"");
List<String> list = display.getStringList("Lore");
list.add("\"" + ChatColor.AQUA + "放在 水/岩浆 中或 水/岩浆 旁边\"");
list.add("\"" + ChatColor.AQUA + "即可吸干附近" + BluestarGame.config.getConfig().getInt("spongeR") + "格的 水/岩浆\"");
list.add("\"" + ChatColor.RED + "放在没 水/岩浆 的地方会直接消失哦!\"");
}
return lavaSponge;
}

@Override
public Map<String, Object> serialize()
{
Map<String, Object> map = new HashMap();
map.put("age", Integer.valueOf(this.age));
map.put("age",this.age);
map.put("location", this.location);
map.put("player", this.player.getName());
return map;
Expand Down

0 comments on commit 4bb3bc7

Please sign in to comment.