|
@@ -34,8 +34,6 @@ skill.add("Cobweb Miner", "skill.cobweb_miner", "minecraft:cobweb", "Swords incr
|
|
|
|
|
|
clan.loadData();
|
|
|
|
|
|
-items_list = list.new(); //Array-List: Alle Items mit Rezepten
|
|
|
-recipe_site_map = map.new();
|
|
|
tp_list = list.new();
|
|
|
tp_map = map.new();
|
|
|
tp_set = set.new();
|
|
@@ -70,131 +68,12 @@ gambler_loc = loc.new(overworld, 185, 68, 225);
|
|
|
prefix_money = "§2Money";
|
|
|
prefix_skill = "§2Skill";
|
|
|
|
|
|
-air = "minecraft:air";
|
|
|
-air_item = read.item(air);
|
|
|
-leather = "minecraft:leather";
|
|
|
-string = "minecraft:string";
|
|
|
-iron_ingot = "minecraft:iron_ingot";
|
|
|
-bronze_ingot = "km:bronze_ingot";
|
|
|
-copper_ingot = "km:copper_ingot";
|
|
|
-tin_ingot = "km:tin_ingot";
|
|
|
-silver_ingot = "km:silver_ingot";
|
|
|
-stick = "minecraft:stick";
|
|
|
-planks = "minecraft:oak_planks";
|
|
|
-cobblestone = "minecraft:cobblestone";
|
|
|
-iron_ingot = "minecraft:iron_ingot";
|
|
|
-gold_ingot = "minecraft:gold_ingot";
|
|
|
-diamond = "minecraft:diamond";
|
|
|
-book = "minecraft:book";
|
|
|
-birch_planks = "minecraft:birch_planks";
|
|
|
-dark_oak_planks = "minecraft:dark_oak_planks";
|
|
|
-jungle_planks = "minecraft:jungle_planks";
|
|
|
-spruce_planks = "minecraft:spruce_planks";
|
|
|
-acacia_planks = "minecraft:acacia_planks";
|
|
|
-coarse_dirt = "minecraft:coarse_dirt";
|
|
|
-gravel = "minecraft:gravel";
|
|
|
-wheat = "minecraft:wheat";
|
|
|
-grass = "minecraft:grass";
|
|
|
-iron_nugget = "minecraft:iron_nugget";
|
|
|
-hay_bundle = "km:hay_bundle";
|
|
|
-real_hay_block = "km:real_hay_block";
|
|
|
sword_tag = item.getTag("km:sword");
|
|
|
dye_tag = item.getTag("km:dye");
|
|
|
leaves_tag = block.getTag("minecraft:leaves");
|
|
|
sign_tag = block.getTag("minecraft:signs");
|
|
|
prop_persistent = block.getProperty("persistent");
|
|
|
|
|
|
-recipe.add(1, "minecraft:saddle", leather, leather, leather, leather, string, leather, air, iron_ingot, air);
|
|
|
-recipe.add(1, "km:bronze_helmet", bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, air, bronze_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:bronze_chestplate", bronze_ingot, air, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot);
|
|
|
-recipe.add(1, "km:bronze_leggings", bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, air, bronze_ingot, bronze_ingot, air, bronze_ingot);
|
|
|
-recipe.add(1, "km:bronze_boots", bronze_ingot, air, bronze_ingot, bronze_ingot, air, bronze_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:copper_helmet", copper_ingot, copper_ingot, copper_ingot, copper_ingot, air, copper_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:copper_chestplate", copper_ingot, air, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot);
|
|
|
-recipe.add(1, "km:copper_leggings", copper_ingot, copper_ingot, copper_ingot, copper_ingot, air, copper_ingot, copper_ingot, air, copper_ingot);
|
|
|
-recipe.add(1, "km:copper_boots", copper_ingot, air, copper_ingot, copper_ingot, air, copper_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:bookshelf_acacia", acacia_planks, acacia_planks, acacia_planks, book, book, book, acacia_planks, acacia_planks, acacia_planks);
|
|
|
-recipe.add(1, "km:bookshelf_birch", birch_planks, birch_planks, birch_planks, book, book, book, birch_planks, birch_planks, birch_planks);
|
|
|
-recipe.add(1, "km:bookshelf_dark_oak", dark_oak_planks, dark_oak_planks, dark_oak_planks, book, book, book, dark_oak_planks, dark_oak_planks, dark_oak_planks);
|
|
|
-recipe.add(1, "km:bookshelf_jungle", jungle_planks, jungle_planks, jungle_planks, book, book, book, jungle_planks, jungle_planks, jungle_planks);
|
|
|
-recipe.add(1, "km:bookshelf_spruce", spruce_planks, spruce_planks, spruce_planks, book, book, book, spruce_planks, spruce_planks, spruce_planks);
|
|
|
-recipe.add(1, "km:copper_block", copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot);
|
|
|
-recipe.add(1, "km:bronze_block", bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot);
|
|
|
-recipe.add(1, "km:tin_block", tin_ingot, tin_ingot, tin_ingot, tin_ingot, tin_ingot, tin_ingot, tin_ingot, tin_ingot, tin_ingot);
|
|
|
-recipe.add(1, "km:silver_block", silver_ingot, silver_ingot, silver_ingot, silver_ingot, silver_ingot, silver_ingot, silver_ingot, silver_ingot, silver_ingot);
|
|
|
-recipe.add(1, "km:cooking_pot_copper", copper_ingot, air, copper_ingot, copper_ingot, air, copper_ingot, copper_ingot, copper_ingot, copper_ingot);
|
|
|
-recipe.add(1, bronze_ingot, tin_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot, copper_ingot);
|
|
|
-recipe.add(1, copper_ingot, air, air, air, air, "km:copper_ore", air, air, air, air);
|
|
|
-recipe.add(1, tin_ingot, air, air, air, air, "km:tin_ore", air, air, air, air);
|
|
|
-recipe.add(1, silver_ingot, air, air, air, air, "km:silver_ore", air, air, air, air);
|
|
|
-recipe.add(1, "km:spikes_bronze", air, bronze_ingot, air, bronze_ingot, bronze_ingot, bronze_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:spikes_copper", air, copper_ingot, air, copper_ingot, copper_ingot, copper_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:spikes_gold", air, gold_ingot, air, gold_ingot, gold_ingot, gold_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:spikes_iron", air, iron_ingot, air, iron_ingot, iron_ingot, iron_ingot, air, air, air);
|
|
|
-recipe.add(1, "km:wooden_battleaxe", air, planks, planks, air, stick, planks, stick, air, air);
|
|
|
-recipe.add(1, "km:stone_battleaxe", air, cobblestone, cobblestone, air, stick, cobblestone, stick, air, air);
|
|
|
-recipe.add(1, "km:iron_battleaxe", air, iron_ingot, iron_ingot, air, stick, iron_ingot, stick, air, air);
|
|
|
-recipe.add(1, "km:golden_battleaxe", air, gold_ingot, gold_ingot, air, stick, gold_ingot, stick, air, air);
|
|
|
-recipe.add(1, "km:diamond_battleaxe", air, diamond, diamond, air, stick, diamond, stick, air, air);
|
|
|
-recipe.add(1, "km:copper_battleaxe", air, copper_ingot, copper_ingot, air, stick, copper_ingot, stick, air, air);
|
|
|
-recipe.add(1, "km:bronze_battleaxe", air, bronze_ingot, bronze_ingot, air, stick, bronze_ingot, stick, air, air);
|
|
|
-recipe.add(1, "km:copper_axe", air, copper_ingot, copper_ingot, air, copper_ingot, stick, air, air, stick);
|
|
|
-recipe.add(1, "km:bronze_axe", air, bronze_ingot, bronze_ingot, air, bronze_ingot, stick, air, air, stick);
|
|
|
-recipe.add(1, "km:wooden_dagger", air, air, planks, air, stick, air, air, air, air);
|
|
|
-recipe.add(1, "km:stone_dagger", air, air, cobblestone, air, stick, air, air, air, air);
|
|
|
-recipe.add(1, "km:iron_dagger", air, air, iron_ingot, air, stick, air, air, air, air);
|
|
|
-recipe.add(1, "km:golden_dagger", air, air, gold_ingot, air, stick, air, air, air, air);
|
|
|
-recipe.add(1, "km:diamond_dagger", air, air, diamond, air, stick, air, air, air, air);
|
|
|
-recipe.add(1, "km:copper_dagger", air, air, copper_ingot, air, stick, air, air, air, air);
|
|
|
-recipe.add(1, "km:bronze_dagger", air, air, bronze_ingot, air, stick, air, air, air, air);
|
|
|
-recipe.add(1, "km:copper_hoe", air, copper_ingot, copper_ingot, air, air, stick, air, air, stick);
|
|
|
-recipe.add(1, "km:bronze_hoe", air, bronze_ingot, bronze_ingot, air, air, stick, air, air, stick);
|
|
|
-recipe.add(1, "km:wooden_hammer", planks, planks, planks, planks, stick, planks, air, stick, air);
|
|
|
-recipe.add(1, "km:stone_hammer", cobblestone, cobblestone, cobblestone, cobblestone, stick, cobblestone, air, stick, air);
|
|
|
-recipe.add(1, "km:iron_hammer", iron_ingot, iron_ingot, iron_ingot, iron_ingot, stick, iron_ingot, air, stick, air);
|
|
|
-recipe.add(1, "km:golden_hammer", gold_ingot, gold_ingot, gold_ingot, gold_ingot, stick, gold_ingot, air, stick, air);
|
|
|
-recipe.add(1, "km:diamond_hammer", diamond, diamond, diamond, diamond, stick, diamond, air, stick, air);
|
|
|
-recipe.add(1, "km:copper_hammer", copper_ingot, copper_ingot, copper_ingot, copper_ingot, stick, copper_ingot, air, stick, air);
|
|
|
-recipe.add(1, "km:bronze_hammer", bronze_ingot, bronze_ingot, bronze_ingot, bronze_ingot, stick, bronze_ingot, air, stick, air);
|
|
|
-recipe.add(1, "km:copper_shovel", air, copper_ingot, air, air, stick, air, air, stick, air);
|
|
|
-recipe.add(1, "km:bronze_shovel", air, bronze_ingot, air, air, stick, air, air, stick, air);
|
|
|
-recipe.add(1, "km:wooden_scepter", air, stick, planks, air, stick, stick, stick, air, air);
|
|
|
-recipe.add(1, "km:stone_scepter", air, stick, cobblestone, air, stick, stick, stick, air, air);
|
|
|
-recipe.add(1, "km:iron_scepter", air, stick, iron_ingot, air, stick, stick, stick, air, air);
|
|
|
-recipe.add(1, "km:golden_scepter", air, stick, gold_ingot, air, stick, stick, stick, air, air);
|
|
|
-recipe.add(1, "km:diamond_scepter", air, stick, diamond, air, stick, stick, stick, air, air);
|
|
|
-recipe.add(1, "km:copper_scepter", air, stick, copper_ingot, air, stick, stick, stick, air, air);
|
|
|
-recipe.add(1, "km:bronze_scepter", air, stick, bronze_ingot, air, stick, stick, stick, air, air);
|
|
|
-recipe.add(1, "km:copper_pickaxe", copper_ingot, copper_ingot, copper_ingot, air, stick, air, air, stick, air);
|
|
|
-recipe.add(1, "km:bronze_pickaxe", bronze_ingot, bronze_ingot, bronze_ingot, air, stick, air, air, stick, air);
|
|
|
-recipe.add(1, "km:wooden_stick", air, air, planks, air, stick, air, planks, air, air);
|
|
|
-recipe.add(1, "km:stone_stick", air, air, cobblestone, air, stick, air, cobblestone, air, air);
|
|
|
-recipe.add(1, "km:iron_stick", air, air, iron_ingot, air, stick, air, iron_ingot, air, air);
|
|
|
-recipe.add(1, "km:golden_stick", air, air, gold_ingot, air, stick, air, gold_ingot, air, air);
|
|
|
-recipe.add(1, "km:diamond_stick", air, air, diamond, air, stick, air, diamond, air, air);
|
|
|
-recipe.add(1, "km:copper_stick", air, air, copper_ingot, air, stick, air, copper_ingot, air, air);
|
|
|
-recipe.add(1, "km:bronze_stick", air, air, bronze_ingot, air, stick, air, bronze_ingot, air, air);
|
|
|
-recipe.add(1, "km:copper_sword", air, copper_ingot, air, air, copper_ingot, air, air, stick, air);
|
|
|
-recipe.add(1, "km:bronze_sword", air, bronze_ingot, air, air, bronze_ingot, air, air, stick, air);
|
|
|
-recipe.add(1, "km:mushroom_stick_raw", air, "minecraft:brown_mushroom", "minecraft:brown_mushroom", air, stick, "minecraft:red_mushroom", air, air, air);
|
|
|
-recipe.add(1, "km:mushroom_stick_cooked", air, air, air, air, "km:mushroom_stick_raw", air, air, air, air);
|
|
|
-recipe.add(1, "km:fried_egg", air, air, air, air, "minecraft:egg", air, air, air, air);
|
|
|
-recipe.add(1, "km:crate_acacia", acacia_planks, acacia_planks, acacia_planks, acacia_planks, acacia_planks, acacia_planks, acacia_planks, acacia_planks, acacia_planks);
|
|
|
-recipe.add(1, "km:crate_birch", birch_planks, birch_planks, birch_planks, birch_planks, birch_planks, birch_planks, birch_planks, birch_planks, birch_planks);
|
|
|
-recipe.add(1, "km:crate_big_oak", dark_oak_planks, dark_oak_planks, dark_oak_planks, dark_oak_planks, dark_oak_planks, dark_oak_planks, dark_oak_planks, dark_oak_planks, dark_oak_planks);
|
|
|
-recipe.add(1, "km:crate_oak", planks, planks, planks, planks, planks, planks, planks, planks, planks);
|
|
|
-recipe.add(1, "km:crate_jungle", jungle_planks, jungle_planks, jungle_planks, jungle_planks, jungle_planks, jungle_planks, jungle_planks, jungle_planks, jungle_planks);
|
|
|
-recipe.add(1, "km:crate_spruce", spruce_planks, spruce_planks, spruce_planks, spruce_planks, spruce_planks, spruce_planks, spruce_planks, spruce_planks, spruce_planks);
|
|
|
-recipe.add(1, "km:coarse_dirt_slab", air, air, air, coarse_dirt, coarse_dirt, coarse_dirt, air, air, air);
|
|
|
-recipe.add(1, "km:gravel_slab", air, air, air, gravel, gravel, gravel, air, air, air);
|
|
|
-recipe.add(1, "km:straw_hat", air, wheat, air, wheat, wheat, wheat, air, air, air);
|
|
|
-recipe.add(1, hay_bundle, grass, grass, grass, grass, grass, grass, grass, grass, grass);
|
|
|
-recipe.add(1, real_hay_block, hay_bundle, hay_bundle, hay_bundle, hay_bundle, hay_bundle, hay_bundle, hay_bundle, hay_bundle, hay_bundle);
|
|
|
-recipe.add(1, "km:real_hay_bed", air, air, air, real_hay_block, real_hay_block, real_hay_block, air, air, air);
|
|
|
-recipe.add(1, "km:lantern", iron_nugget, iron_nugget, iron_nugget, "minecraft:glass_pane", "minecraft:torch", "minecraft:glass_pane", iron_nugget, iron_nugget, iron_nugget);
|
|
|
-recipe.add(1, "km:sling", stick, string, stick, stick, air, stick, air, stick, air);
|
|
|
-recipe.add(4, "minecraft:string", air, air, air, air, "minecraft:white_wool", air, air, air, air);
|
|
|
-
|
|
|
ench_flame = enchantment.get("flame");
|
|
|
ench_unbreaking = enchantment.get("unbreaking");
|
|
|
ench_sharpness = enchantment.get("sharpness");
|
|
@@ -209,7 +88,9 @@ inv.setItem(gambler_inv, 1, read.item("km:coin_silver", 1, "§f64 snuvis"));
|
|
|
inv.setItem(gambler_inv, 2, read.item("km:coin_gold", 1, "§f4096 snuvis"));
|
|
|
inv.setItem(gambler_inv, 3, read.item("minecraft:netherite_block", 1, "§fAll in"));
|
|
|
|
|
|
-bankmenu = inv.new("233302332233302332");
|
|
|
+//bankmenu = inv.new("233302332233302332");
|
|
|
+bankmenu = inv.new("233330000233330000000000000233200000233200000");
|
|
|
+//bankmenu = inv.new("233330000 233330000 000000000 233200000 233200000");
|
|
|
bankinvid = inv.getId(bankmenu);
|
|
|
coin_gold = read.item("km:coin_gold");
|
|
|
coin_silver = read.item("km:coin_silver");
|
|
@@ -223,18 +104,20 @@ inv.setItem(bankmenu, 0, read.item("km:plus_green", 1, "§fDeposit..."));
|
|
|
inv.setItem(bankmenu, 1, read.item("km:coin_copper", 1, "§f1 snuvi"));
|
|
|
inv.setItem(bankmenu, 2, read.item("km:coin_silver", 1, "§f64 snuvis"));
|
|
|
inv.setItem(bankmenu, 3, read.item("km:coin_gold", 1, "§f4096 snuvis"));
|
|
|
-inv.setItem(bankmenu, 4, read.item("km:coin_copper", 64, "§f64 snuvis"));
|
|
|
-inv.setItem(bankmenu, 5, arrow_left);
|
|
|
-inv.setItem(bankmenu, 6, arrow_right);
|
|
|
+inv.setItem(bankmenu, 4, read.item("minecraft:netherite_block", 1, "§fAll snuvis"));
|
|
|
+inv.setItem(bankmenu, 5, read.item("km:minus_red", 1, "§fWithdraw..."));
|
|
|
+inv.setItem(bankmenu, 6, read.item("km:coin_copper", 1, "§f1 snuvi"));
|
|
|
inv.setItem(bankmenu, 7, read.item("km:coin_silver", 1, "§f64 snuvis"));
|
|
|
-inv.setItem(bankmenu, 8, read.item("km:minus_red", 1, "§fWithdraw..."));
|
|
|
-inv.setItem(bankmenu, 9, read.item("km:coin_copper", 1, "§f1 snuvi"));
|
|
|
-inv.setItem(bankmenu, 10, read.item("km:coin_silver", 1, "§f64 snuvis"));
|
|
|
-inv.setItem(bankmenu, 11, read.item("km:coin_gold", 1, "§f4096 snuvis"));
|
|
|
-inv.setItem(bankmenu, 12, read.item("km:coin_silver", 64, "§f4096 snuvis"));
|
|
|
-inv.setItem(bankmenu, 13, arrow_left);
|
|
|
-inv.setItem(bankmenu, 14, arrow_right);
|
|
|
-inv.setItem(bankmenu, 15, read.item("km:coin_gold", 1, "§f4096 snuvis"));
|
|
|
+inv.setItem(bankmenu, 8, read.item("km:coin_gold", 1, "§f4096 snuvis"));
|
|
|
+inv.setItem(bankmenu, 9, read.item("minecraft:netherite_block", 1, "§fAll snuvis"));
|
|
|
+inv.setItem(bankmenu, 10, read.item("km:coin_copper", 64, "§f64 snuvis"));
|
|
|
+inv.setItem(bankmenu, 11, arrow_left);
|
|
|
+inv.setItem(bankmenu, 12, arrow_right);
|
|
|
+inv.setItem(bankmenu, 13, read.item("km:coin_silver", 1, "§f64 snuvis"));
|
|
|
+inv.setItem(bankmenu, 14, read.item("km:coin_silver", 64, "§f4096 snuvis"));
|
|
|
+inv.setItem(bankmenu, 15, arrow_left);
|
|
|
+inv.setItem(bankmenu, 16, arrow_right);
|
|
|
+inv.setItem(bankmenu, 17, read.item("km:coin_gold", 1, "§f4096 snuvis"));
|
|
|
|
|
|
msg("dev", "§bSurvival §rloaded.");
|
|
|
@wait
|
|
@@ -276,7 +159,7 @@ if(event == "living_death" || event == "living_pre_hurt") {
|
|
|
loc = entity.getLocation(player);
|
|
|
}
|
|
|
world_name = world.getName(loc.getWorld(loc));
|
|
|
-if(word.isSurvName(world_name)) {
|
|
|
+if(world.isSurvName(world_name)) {
|
|
|
ignoreGoto(event);
|
|
|
}
|
|
|
goto("wait");
|
|
@@ -403,17 +286,12 @@ if(entity.getType(entity) == "human") {
|
|
|
msg(player, text.click("§r [§cclick§r] [§eShops§r]", "/infopoint6"));
|
|
|
msg(player, text.click("§r [§cclick§r] [§eMinigames§r]", "/infopoint7"), " ", text.click("§f[§bTeleport§f]", "/games"));
|
|
|
msg(player, text.click("§r [§cclick§r] [§eQuests§r]", "/infopoint8"), " ", text.click("§f[§bTeleport§f]", "/story"));
|
|
|
+ msg(player, text.click("§r [§cclick§r] [§eCreative§r]", "/infopoint12"), " ", text.click("§f[§bTeleport§f]", "/creative"));
|
|
|
msg(player, text.click("§r [§cclick§r] [§eRanking§r]", "/infopoint9"), " ", text.link("§f[§bRanks§f]", "https://minecraft.hammerle.me/?site=ranks"));
|
|
|
msg(player, text.click("§r [§cclick§r] [§eRules§r]", "/infopoint10"), " ", text.link("§f[§bFake Rules§f]", "https://minecraft.hammerle.me/?site=rules"));
|
|
|
msg(player, text.click("§r [§cclick§r] [§eNote§r]", "/infopoint11"));
|
|
|
goto("wait");
|
|
|
}
|
|
|
- if(entity_name == "Recipes") {
|
|
|
- recipe_menu = inv.new("333333333333333333333333333333333333333333333200000022");
|
|
|
- recipe.setPage(player, recipe_menu, 1);
|
|
|
- inv.open(recipe_menu, player, "Recipes");
|
|
|
- goto("wait");
|
|
|
- }
|
|
|
if(entity_name == "Banker") {
|
|
|
inv.open(bankmenu, player, "Banker");
|
|
|
goto("wait");
|
|
@@ -451,6 +329,7 @@ if(player.isOnAdventure(player)) {
|
|
|
goto("wait");
|
|
|
|
|
|
@container_click
|
|
|
+//Verhindert während eines (Abenteuer-)Teleports, die Benutzung des Spielerinventars (inkl. Crafting-Bereich!)
|
|
|
player_uuid = player.getUuid(player);
|
|
|
if(set.contains(tp_set, player_uuid)) {
|
|
|
cancel = true;
|
|
@@ -458,14 +337,17 @@ if(set.contains(tp_set, player_uuid)) {
|
|
|
goto("wait");
|
|
|
|
|
|
@inv_click
|
|
|
-cancel = true;
|
|
|
if(inv_id == bankinvid) { //Bankmenü
|
|
|
+ factor = 1;
|
|
|
+ if(click_type == "QUICK_MOVE") {
|
|
|
+ factor = 8;
|
|
|
+ }
|
|
|
gold_inv = player.getItemAmount(player, false, coin_gold);
|
|
|
silver_inv = player.getItemAmount(player, false, coin_silver);
|
|
|
copper_inv = player.getItemAmount(player, false, coin_copper);
|
|
|
//Wechseln
|
|
|
- if(inv_slot == 5 || inv_slot == 6 || inv_slot == 13 || inv_slot == 14) {
|
|
|
- if(inv_slot == 5) {
|
|
|
+ if(inv_slot == 11 || inv_slot == 12 || inv_slot == 15 || inv_slot == 16) {
|
|
|
+ if(inv_slot == 11) {
|
|
|
//1 Silbermünze --> 64 Kupfermünzen
|
|
|
item1 = coin_silver;
|
|
|
item2 = coin_copper64;
|
|
@@ -473,7 +355,7 @@ if(inv_id == bankinvid) { //Bankmenü
|
|
|
item_type = "km:coin_copper";
|
|
|
coin_inv = silver_inv;
|
|
|
}
|
|
|
- elseif(inv_slot == 6) {
|
|
|
+ elseif(inv_slot == 12) {
|
|
|
//64 Kupfermünzen --> 1 Silbermünze
|
|
|
item1 = coin_copper64;
|
|
|
item2 = coin_silver;
|
|
@@ -481,7 +363,7 @@ if(inv_id == bankinvid) { //Bankmenü
|
|
|
item_type = "km:coin_silver";
|
|
|
coin_inv = copper_inv;
|
|
|
}
|
|
|
- elseif(inv_slot == 13) {
|
|
|
+ elseif(inv_slot == 15) {
|
|
|
//1 Goldmünze --> 64 Silbermünzen
|
|
|
item1 = coin_gold;
|
|
|
item2 = coin_silver64;
|
|
@@ -489,7 +371,7 @@ if(inv_id == bankinvid) { //Bankmenü
|
|
|
item_type = "km:coin_silver";
|
|
|
coin_inv = gold_inv;
|
|
|
}
|
|
|
- elseif(inv_slot == 14) {
|
|
|
+ elseif(inv_slot == 16) {
|
|
|
//64 Silbermünzen --> 1 Goldmünze
|
|
|
item1 = coin_silver64;
|
|
|
item2 = coin_gold;
|
|
@@ -497,18 +379,22 @@ if(inv_id == bankinvid) { //Bankmenü
|
|
|
item_type = "km:coin_gold";
|
|
|
coin_inv = silver_inv;
|
|
|
}
|
|
|
- amount1 = item.getAmount(item1);
|
|
|
- amount2 = item.getAmount(item2);
|
|
|
- if(coin_inv < amount1) {
|
|
|
+ item_1 = item.clone(item1);
|
|
|
+ item.setAmount(item_1, item.getAmount(item_1) * factor);
|
|
|
+ item_2 = item.clone(item2);
|
|
|
+ item.setAmount(item_2, item.getAmount(item_2) * factor);
|
|
|
+ amount1 = item.getAmount(item_1);
|
|
|
+ amount2 = item.getAmount(item_2);
|
|
|
+ if(coin_inv * factor < amount1) {
|
|
|
msg.prefix(player, prefix_money, message);
|
|
|
goto("wait");
|
|
|
}
|
|
|
- player.removeItemNbt(player, item1);
|
|
|
- notgiven = player.giveItem(player, item2);
|
|
|
+ player.removeItemNbt(player, item_1);
|
|
|
+ notgiven = player.giveItem(player, item_2);
|
|
|
if(item.getType(notgiven) != "minecraft:air") {
|
|
|
amount = item.getAmount(notgiven);
|
|
|
player.removeItemNbt(player, read.item(item_type, amount2 - amount));
|
|
|
- player.giveItem(player, item1);
|
|
|
+ player.giveItem(player, item_1);
|
|
|
msg.prefix(player, prefix_money, "Not enough space in inventory.");
|
|
|
goto("wait");
|
|
|
}
|
|
@@ -517,40 +403,72 @@ if(inv_id == bankinvid) { //Bankmenü
|
|
|
goto("wait");
|
|
|
}
|
|
|
//Kontobewegungen
|
|
|
- if(inv_slot == 1 || inv_slot == 9) {
|
|
|
- betrag = 1;
|
|
|
+ if(inv_slot == 1 || inv_slot == 6) {
|
|
|
+ betrag = 1 * factor;
|
|
|
coin_inv = copper_inv;
|
|
|
}
|
|
|
- elseif(inv_slot == 2 || inv_slot == 10) {
|
|
|
- betrag = 64;
|
|
|
+ elseif(inv_slot == 2 || inv_slot == 7) {
|
|
|
+ betrag = 64 * factor;
|
|
|
coin_inv = silver_inv;
|
|
|
}
|
|
|
- elseif(inv_slot == 3 || inv_slot == 11) {
|
|
|
- betrag = 4096;
|
|
|
+ elseif(inv_slot == 3 || inv_slot == 8) {
|
|
|
+ betrag = 4096 * factor;
|
|
|
coin_inv = gold_inv;
|
|
|
}
|
|
|
+ elseif(inv_slot == 4 || inv_slot == 9) {
|
|
|
+ if(inv_slot == 4) {
|
|
|
+ betrag = copper_inv + silver_inv * 64 + gold_inv * 4096;
|
|
|
+ coin_inv = 8;
|
|
|
+ } elseif(inv_slot == 9) {
|
|
|
+ betrag = getMoney(player);
|
|
|
+ coin_inv = 8;
|
|
|
+ }
|
|
|
+ }
|
|
|
//Einzahlen
|
|
|
- if(inv_slot > 0 && inv_slot < 4) {
|
|
|
- player_id = player.getId(player);
|
|
|
- if(coin_inv < 1) {
|
|
|
- msg.prefix(player, prefix_money, "Coin not in inventory.");
|
|
|
+ if(inv_slot > 0 && inv_slot < 5) {
|
|
|
+ if(coin_inv < 1 * factor) {
|
|
|
+ msg.prefix(player, prefix_money, "Coins not in inventory.");
|
|
|
+ goto("wait");
|
|
|
+ }
|
|
|
+ if(betrag == 0) {
|
|
|
+ msg.prefix(player, prefix_money, "No coins in your inventory.");
|
|
|
+ goto("wait");
|
|
|
+ }
|
|
|
+ addMoney(player, betrag);
|
|
|
+ if(inv_slot == 4) {
|
|
|
+ player.removeItemNbt(player, read.item("km:coin_gold", gold_inv));
|
|
|
+ player.removeItemNbt(player, read.item("km:coin_silver", silver_inv));
|
|
|
+ player.removeItemNbt(player, read.item("km:coin_copper", copper_inv));
|
|
|
} else {
|
|
|
- addMoney(player, betrag);
|
|
|
- player.removeItemNbt(player, inv.getItem(bankmenu, inv_slot));
|
|
|
- inv.update(player);
|
|
|
+ remove_item = item.clone(inv.getItem(bankmenu, inv_slot));
|
|
|
+ item.setAmount(remove_item, item.getAmount(remove_item) * factor);
|
|
|
+ player.removeItemNbt(player, remove_item);
|
|
|
}
|
|
|
+ inv.update(player);
|
|
|
goto("wait");
|
|
|
}
|
|
|
//Auszahlen
|
|
|
- if(inv_slot > 8 && inv_slot < 12) {
|
|
|
- player_id = player.getId(player);
|
|
|
- if(!hasEnoughMoney(player_id, betrag)) {
|
|
|
+ if(inv_slot > 5 && inv_slot < 10) {
|
|
|
+ if(!hasEnoughMoney(player, betrag)) {
|
|
|
msg.prefix(player, prefix_money, "Not enough snuvis on your account.");
|
|
|
} else {
|
|
|
subMoney(player, betrag);
|
|
|
- item = inv.getItem(bankmenu, inv_slot);
|
|
|
- new_item = read.item(item.getType(item), item.getAmount(item));
|
|
|
- player.giveItem(player, new_item);
|
|
|
+ if(inv_slot == 9) {
|
|
|
+ gold_amount = math.roundDown(betrag / 4096);
|
|
|
+ betrag %= 4096;
|
|
|
+ silver_amount = math.roundDown(betrag / 64);
|
|
|
+ copper_amount = math.roundDown(betrag % 64);
|
|
|
+ coin_item = read.item("km:coin_gold", gold_amount);
|
|
|
+ player.giveItem(player, coin_item);
|
|
|
+ coin_item = read.item("km:coin_silver", silver_amount);
|
|
|
+ player.giveItem(player, coin_item);
|
|
|
+ coin_item = read.item("km:coin_copper", copper_amount);
|
|
|
+ player.giveItem(player, coin_item);
|
|
|
+ } else {
|
|
|
+ item = inv.getItem(bankmenu, inv_slot);
|
|
|
+ new_item = read.item(item.getType(item), item.getAmount(item) * factor);
|
|
|
+ player.giveItem(player, new_item);
|
|
|
+ }
|
|
|
inv.update(player);
|
|
|
}
|
|
|
goto("wait");
|
|
@@ -588,40 +506,14 @@ if(inv_id == gambler_inv_id) {
|
|
|
} else {
|
|
|
message = concat(player.getName(player), temp, text.number(amount), " snuvis.");
|
|
|
}
|
|
|
- msg.radius("§2Gambler", message, entity.getLocation(player), 50);
|
|
|
- goto("wait");
|
|
|
-}
|
|
|
-if(inv_name == "Recipes") {
|
|
|
- item_type = item.getType(item);
|
|
|
- if(item_type == "minecraft:air") {
|
|
|
- goto("wait");
|
|
|
- }
|
|
|
- if(item_type == "km:return_red") {
|
|
|
- page = map.getOrDefault($recipe_site_map, player.getUuid(player), 1);
|
|
|
- recipe.setPage(player, inv, page);
|
|
|
- goto("wait");
|
|
|
- }
|
|
|
- if(item_type == "minecraft:paper") {
|
|
|
- name = item.getName(item);
|
|
|
- if(text.contains(name, "<<") || text.contains(name, ">>")) {
|
|
|
- page = removeFormat(name);
|
|
|
- page = text.replace(page, "<<", "");
|
|
|
- page = text.replace(page, ">>", "");
|
|
|
- page = read.number(page);
|
|
|
- if(inv_slot == 46) {
|
|
|
- recipe.setPage(player, inv, page);
|
|
|
- }
|
|
|
- if(inv_slot == 47) {
|
|
|
- recipe.setPage(player, inv, page);
|
|
|
- }
|
|
|
- goto("wait");
|
|
|
- }
|
|
|
- }
|
|
|
- index = recipe.getIndexFromItemType(item_type);
|
|
|
- if(index == null) {
|
|
|
- goto("wait");
|
|
|
+ if(amount < 64) {
|
|
|
+ msg.prefix(player, "§2Gambler", message);
|
|
|
+ } elseif(amount >= 131072) {
|
|
|
+ msg.online("§2Gambler", message);
|
|
|
+ } else {
|
|
|
+ msg.radius("§2Gambler", message, entity.getLocation(player), 10);
|
|
|
}
|
|
|
- recipe.showRecipe(player, inv, index);
|
|
|
+ goto("wait");
|
|
|
}
|
|
|
goto("wait");
|
|
|
|
|
@@ -1151,83 +1043,6 @@ function lottery.add(location, amount) {
|
|
|
return amount;
|
|
|
}
|
|
|
|
|
|
-function recipe.add(result_amount, result_item, item1, item2, item3, item4, item5, item6, item7, item8, item9) {
|
|
|
- array = array.new(11);
|
|
|
- array[0] = result_amount;
|
|
|
- array[1] = result_item;
|
|
|
- array[2] = item1;
|
|
|
- array[3] = item2;
|
|
|
- array[4] = item3;
|
|
|
- array[5] = item4;
|
|
|
- array[6] = item5;
|
|
|
- array[7] = item6;
|
|
|
- array[8] = item7;
|
|
|
- array[9] = item8;
|
|
|
- array[10] = item9;
|
|
|
- list.add($items_list, array);
|
|
|
-}
|
|
|
-
|
|
|
-function recipe.getIndexFromItemType(item_type) {
|
|
|
- for(i = 0; i < list.getSize($items_list); i++) {
|
|
|
- array = list.getIndex($items_list, i);
|
|
|
- if(array[1] == item_type) {
|
|
|
- return i;
|
|
|
- }
|
|
|
- }
|
|
|
- return null;
|
|
|
-}
|
|
|
-
|
|
|
-function recipe.showRecipe(player, menu, index) {
|
|
|
- for(i = 0; i < 48; i++) {
|
|
|
- inv.setItem(menu, i, $air_item);
|
|
|
- }
|
|
|
- array = list.getIndex($items_list, index);
|
|
|
- inv.setItem(menu, 23, read.item("km:arrow_right"));
|
|
|
- inv.setItem(menu, 45, read.item("km:return_red", 1, "§fReturn to overview"));
|
|
|
- inv.setItem(menu, 10, read.item(array[2]));
|
|
|
- inv.setItem(menu, 11, read.item(array[3]));
|
|
|
- inv.setItem(menu, 12, read.item(array[4]));
|
|
|
- inv.setItem(menu, 19, read.item(array[5]));
|
|
|
- inv.setItem(menu, 20, read.item(array[6]));
|
|
|
- inv.setItem(menu, 21, read.item(array[7]));
|
|
|
- inv.setItem(menu, 28, read.item(array[8]));
|
|
|
- inv.setItem(menu, 29, read.item(array[9]));
|
|
|
- inv.setItem(menu, 30, read.item(array[10]));
|
|
|
- inv.setItem(menu, 25, read.item(array[1], array[0]));
|
|
|
- inv.update(player);
|
|
|
-}
|
|
|
-
|
|
|
-function recipe.setPage(player, menu, page) {
|
|
|
- map.add($recipe_site_map, player.getUuid(player), page);
|
|
|
- size = list.getSize($items_list);
|
|
|
- max_page = math.roundUp(size / 45);
|
|
|
- if(page > max_page) {
|
|
|
- return;
|
|
|
- }
|
|
|
- inv.setItem(menu, 45, $air_item);
|
|
|
- if(page > 1) {
|
|
|
- inv.setItem(menu, 46, read.item("minecraft:paper", 1, concat("§e", text.number(page - 1), " <<")));
|
|
|
- } else {
|
|
|
- inv.setItem(menu, 46, $air_item);
|
|
|
- }
|
|
|
- if(page < max_page) {
|
|
|
- inv.setItem(menu, 47, read.item("minecraft:paper", 1, concat("§e>> ", text.number(page + 1))));
|
|
|
- } else {
|
|
|
- inv.setItem(menu, 47, $air_item);
|
|
|
- }
|
|
|
- max_index = size - 1;
|
|
|
- for(i = 0; i < 45; i++) {
|
|
|
- list_index = i + 45 * (page - 1);
|
|
|
- if(list_index > max_index) {
|
|
|
- inv.setItem(menu, i, $air_item);
|
|
|
- } else {
|
|
|
- array = list.getIndex($items_list, list_index);
|
|
|
- inv.setItem(menu, i, read.item(array[1]));
|
|
|
- }
|
|
|
- }
|
|
|
- inv.update(player);
|
|
|
-}
|
|
|
-
|
|
|
function setDeathLoc(player) {
|
|
|
map.add($death_loc_map, player.getUuid(player), entity.getLocation(player));
|
|
|
}
|