import: de.tr7zw.nbtapi.NBTItem de.tr7zw.nbtapi.NBTContainer de.tr7zw.nbtapi.NBTTileEntity de.tr7zw.nbtapi.NBTCompoundList de.tr7zw.nbtapi.NBTListCompound java.lang.Long java.lang.String java.util.Arrays java.util.Iterator org.bukkit.inventory.ItemStack org.bukkit.Material org.bukkit.event.block.BlockBreakEvent org.bukkit.event.block.BlockPlaceEvent org.bukkit.event.player.PlayerInteractEvent org.bukkit.event.player.PlayerMoveEvent org.bukkit.event.player.PlayerInteractEntityEvent org.bukkit.event.hanging.HangingBreakByEntityEvent org.bukkit.event.entity.EntityDamageByEntityEvent org.bukkit.event.hanging.HangingPlaceEvent org.bukkit.event.player.PlayerArmorStandManipulateEvent org.bukkit.event.entity.EntityExplodeEvent org.bukkit.event.vehicle.VehicleEnterEvent org.bukkit.event.vehicle.VehicleDamageEvent org.bukkit.event.vehicle.VehicleMoveEvent org.bukkit.event.hanging.HangingBreakEvent org.bukkit.event.block.BlockPistonExtendEvent org.bukkit.event.block.BlockPistonRetractEvent org.bukkit.event.world.StructureGrowEvent org.bukkit.event.block.BlockGrowEvent org.bukkit.event.block.BlockFromToEvent org.bukkit.event.player.PlayerTeleportEvent options: prefix: &7[&6Tereny&7] primarycolor: &6 secondarycolor: &e backgroundcolor: &7 forbiddencolor: &c perm: tereny.admin blok: diamond ore function getBlokTerenu() :: item: set {_i} to new NBTItem({@blok} of infinity 69 named "{@primarycolor}Blok Terenu" with lore "{@backgroundcolor}Postaw go na ziemii by%nl%{@backgroundcolor}zabezpieczyć chunk na%nl%{@backgroundcolor}który patrzysz!") set {_t} to new NBTContainer("{HideFlags:1}") {_i}.mergeCompound({_t}) {_i}.setBoolean("blok.terenu", true) set {_i} to {_i}.getItem() return {_i} on PlayerTeleportEvent: if event.getCause() is ender pearl or chorus: if {teren::%chunk at event.getTo()%::isProtected} is true: if {teren::%chunk at event.getTo()%::terenOwner} is not event.getPlayer(): if {teren::%chunk at event.getTo()%::dodani::*} does not contain event.getPlayer(): cancel event set {_loc} to event.getTo() if event.getCause() is chorus: set {_loc} to event.getPlayer().getLocation() add 1.5 to y-location of {_loc} add 0.5 to x-location of {_loc} add 0.5 to z-location of {_loc} set {_holo} to new hologram at {_loc} add text "{@forbiddencolor}&lZablokowano czynność!" to hologram {_holo} add item barrier to hologram {_holo} wait 1.5 seconds delete hologram {_holo} on PlayerMoveEvent: if {teren::%chunk at event.getFrom()%::isProtected} is true: if {teren::%chunk at event.getFrom()%::terenOwner} is {teren::%chunk at event.getTo()%::terenOwner}: stop if {teren::%chunk at event.getFrom()%::isProtected} is true: send "{@prefix} {@secondarycolor}Opuściłeś teren gracza {@primarycolor}%{teren::%chunk at event.getFrom()%::terenOwner}%{@secondarycolor}." to event.getPlayer() if {teren::%chunk at event.getTo()%::isProtected} is true: send "{@prefix} {@secondarycolor}Wszedłeś na teren gracza {@primarycolor}%{teren::%chunk at event.getTo()%::terenOwner}%{@secondarycolor}" to event.getPlayer() on BlockFromToEvent: if {teren::%chunk at event.getBlock()%::isProtected} is true: if {teren::%chunk at event.getToBlock()%::isProtected} is true: if {teren::%chunk at event.getBlock()%::terenOwner} is not {teren::%chunk at event.getToBlock()%::terenOwner}: if {teren::%chunk at event.getToBlock()%::flow} is not true: if event.getBlock() is water or lava: cancel event else: if {teren::%chunk at event.getToBlock()%::isProtected} is true: if {teren::%chunk at event.getToBlock()%::flow} is not true: if event.getBlock() is water or lava: cancel event on StructureGrowEvent: set {_list} to event.getBlocks() loop {_list}.size() times: if {teren::%chunk at {_list}.get((loop-number -1).intValue()).getLocation()%::isProtected} is true: if {teren::%chunk at {_list}.get((loop-number -1).intValue()).getLocation()%::terenOwner} is event.getPlayer(): continue if {teren::%chunk at {_list}.get((loop-number -1).intValue()).getLocation()%::dodani::*} contains event.getPlayer(): continue if event.getPlayer() has permission "{@perm}": stop stop on HangingBreakEvent: if "%event.getCause()%" is "PHYSICS": if event.getEntity().getLocation().getBlock().getRelative(event.getEntity().getAttachedFace()) is not air: cancel event on EntityExplodeEvent: set {_list} to event.blockList() loop {_list}.size() times: if {teren::%chunk at {_list}.get((loop-number -1).intValue())%::isProtected} is true: cancel event set {_loc} to location of block over event.getEntity() add 0.5 to y-location of {_loc} set {_holo} to new hologram at {_loc} add text "{@forbiddencolor}&lZablokowano czynność!" to hologram {_holo} add item barrier to hologram {_holo} wait 1.5 seconds delete hologram {_holo} stop on PlayerArmorStandManipulateEvent: if {teren::%chunk at event.getRightClicked()%::isProtected} is true: if {teren::%chunk at event.getRightClicked()%::terenOwner} is event.getPlayer(): stop if {teren::%chunk at event.getRightClicked()%::dodani::*} contains event.getPlayer(): stop if event.getPlayer() has permission "{@perm}": stop send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer() cancel event on BlockPistonRetractEvent: set {_list} to event.getBlocks() loop {_list}.size() times: if {teren::%chunk at {_list}.get((loop-number -1).intValue()).getRelative(event.getDirection())%::terenOwner} is not {teren::%chunk at {_list}.get((loop-number -1).intValue())%::terenOwner}: cancel event set {_loc} to location of block over event.getBlock() add 0.5 to y-location of {_loc} set {_holo} to new hologram at {_loc} add text "{@forbiddencolor}&lZablokowano czynność!" to hologram {_holo} add item barrier to hologram {_holo} wait 1.5 seconds delete hologram {_holo} stop on BlockPistonExtendEvent: set {_list} to event.getBlocks() loop {_list}.size() times: if {teren::%chunk at {_list}.get((loop-number -1).intValue()).getRelative(event.getDirection())%::isProtected} is true: if {teren::%chunk at event.getBlock().getRelative(event.getDirection())%::terenOwner} is not {teren::%chunk at event.getBlock()%::terenOwner}: cancel event set {_loc} to location of block over event.getBlock() add 0.5 to y-location of {_loc} set {_holo} to new hologram at {_loc} add text "{@forbiddencolor}&lZablokowano czynność!" to hologram {_holo} add item barrier to hologram {_holo} wait 1.5 seconds delete hologram {_holo} stop else: if {teren::%chunk at {_list}.get((loop-number -1).intValue()).getRelative(event.getDirection())%::terenOwner} is not {teren::%chunk at {_list}.get((loop-number -1).intValue())%::terenOwner}: cancel event set {_loc} to location of block over {_list}.get((loop-number -1).intValue()) add 0.5 to y-location of {_loc} set {_holo} to new hologram at {_loc} add text "{@forbiddencolor}&lZablokowano czynność!" to hologram {_holo} add item barrier to hologram {_holo} wait 1.5 seconds delete hologram {_holo} stop on EntityDamageByEntityEvent: if "%event.getDamager()%" is "thrown potion" or "area effect cloud": if {teren::%chunk at event.getEntity()%::isProtected} is true: cancel event send "{@prefix} {@forbiddencolor}PvP jest wyłączone na zabezpieczonych terenach!" to event.getDamager() stop if event.getEntity() is a player: if event.getDamager() is a player: if {teren::%chunk at event.getDamager()%::isProtected} is true: cancel event send "{@prefix} {@forbiddencolor}PvP jest wyłączone na zabezpieczonych terenach!" to event.getDamager() stop if {teren::%chunk at event.getEntity()%::isProtected} is true: cancel event send "{@prefix} {@forbiddencolor}PvP jest wyłączone na zabezpieczonych terenach!" to event.getDamager() stop if {teren::%chunk at event.getEntity() %::isProtected} is true: if {teren::%chunk at event.getEntity() %::terenOwner} is event.getDamager(): stop if {teren::%chunk at event.getEntity()%::dodani::*} contains event.getDamager(): stop if event.getEntity() is not armor stand or item frame or painting or boat or any minecart or ender crystal: stop if event.getDamager() is a player: send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getDamager() cancel event on HangingPlaceEvent: if {teren::%chunk at event.getEntity() %::isProtected} is true: if event.getPlayer() has permission "{@perm}": stop if {teren::%chunk at event.getEntity() %::terenOwner} is event.getPlayer(): stop if {teren::%chunk at event.getEntity()%::dodani::*} contains event.getPlayer(): stop if event.getEntity() is not item frame or painting: stop send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer() cancel event on HangingBreakByEntityEvent: if {teren::%chunk at event.getEntity() %::isProtected} is true: if event.getRemover() has permission "{@perm}": stop if {teren::%chunk at event.getEntity() %::terenOwner} is event.getRemover(): stop if {teren::%chunk at event.getEntity()%::dodani::*} contains event.getRemover(): stop if event.getEntity() is not item frame or painting: stop if event.getRemover() is a player: send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getRemover() else: set {_holo} to new hologram at event.getEntity() add text "{@forbiddencolor}&lZablokowano czynność!" to hologram {_holo} add item barrier to hologram {_holo} wait 1.5 seconds delete hologram {_holo} cancel event on PlayerInteractEntityEvent: if {teren::%chunk at event.getRightClicked()%::isProtected} is true: if event.getPlayer() has permission "{@perm}": stop if {teren::%chunk at event.getRightClicked()%::terenOwner} is event.getPlayer(): stop if {teren::%chunk at event.getRightClicked()%::dodani::*} contains event.getPlayer(): stop if event.getRightClicked() is not item frame or painting: stop send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer() cancel event on PlayerInteractEvent: if {teren::%chunk at event.getClickedBlock()%::isProtected} is true: if {teren::%chunk at event.getClickedBlock()%::terenOwner} is event.getPlayer(): if event.getClickedBlock().getLocation() is {teren::%chunk at event.getClickedBlock()%::homeLocation}: if event.getPlayer().isSneaking() is true: cancel event set block at event.getClickedBlock().getLocation() to air send "{@prefix} {@secondarycolor}Zdjąłeś teren o nazwie {@primarycolor}%{teren::%chunk at event.getClickedBlock()%::terenName}% {@secondarycolor}znajdujący się na koordynatach {@primarycolor}X: %x-location of event.getClickedBlock()%{@primarycolor}, Y: %y-locatioN of event.getClickedBlock()%{@primarycolor}, Z: %z-location of event.getClickedBlock()%{@secondarycolor}. Blok terenu został zwrócony do twojego ekwipunku (jeżeli masz w nim miejsce)." to event.getPlayer() if "%event.getPlayer()%" parsed as player has enough space for 1 of getBlokTerenu(): give 1 of getBlokTerenu() to "%event.getPlayer()%" parsed as player else: drop 1 of getBlokTerenu() at "%event.getPlayer()%" parsed as player send "{@prefix} {@forbiddencolor}Nie masz wystarczająco miejsca w ekwipunku, blok terenu wypadł na ziemię! Podnieś go jak najszybciej!" to event.getPlayer() clear {teren::%chunk at event.getClickedBlock()%::isProtected} clear {teren::%chunk at event.getClickedBlock()%::terenOwner} clear {teren::%chunk at event.getClickedBlock()%::homeLocation} clear {teren::%chunk at event.getClickedBlock()%::flow} clear {teren::%chunk at event.getClickedBlock()%::dodani::*} clear {terenygracza::%event.getPlayer()%::%{teren::%chunk at event.getClickedBlock()%::terenName}%} clear {teren::%chunk at event.getClickedBlock()%::terenName} stop if {teren::%chunk at event.getClickedBlock()%::dodani::*} contains event.getPlayer(): stop if event.getPlayer() has permission "{@perm}": stop if event.getItem() is bone meal: send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer() cancel event if event.getClickedBlock() is not chest or trapped chest or any shulker box or hopper or lever or any button or any doors or any sapling or dispenser or dropper or furnace or note block or spawner or tnt or jukebox or ender dragon or beacon or any fence gate or repeater or brewing stand or cauldron or comparator or daylight sensor: if event.getItem() is not armor stand or any boat: stop send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer() cancel event on VehicleMoveEvent: if {teren::%chunk at event.getTo()%::isProtected} is true: if event.getVehicle() is not hopper minecart: stop if block over event.getTo() is chest or trapped chest or any shulker box or dropper or dispenser or hopper: event.getVehicle().remove() set {_loc} to location of event.getVehicle() add 1 to y-location of {_loc} set {_holo} to new hologram at {_loc} add text "{@forbiddencolor}&lUsunięto wagonik!" to hologram {_holo} add item barrier to hologram {_holo} wait 1.5 seconds delete hologram {_holo} on VehicleDamageEvent: if {teren::%chunk at event.getVehicle()%::isProtected} is true: if event.getAttacker() has permission "{@perm}": stop if {teren::%chunk at event.getVehicle()%::terenOwner} is event.getAttacker(): stop if {teren::%chunk at event.getVehicle()%::dodani::*} contains event.getAttacker(): stop if event.getAttacker() is a player: send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getAttacker() cancel event on VehicleEnterEvent: if {teren::%chunk at event.getVehicle()%::isProtected} is true: if event.getEntered() has permission "{@perm}": stop if {teren::%chunk at event.getVehicle()%::terenOwner} is event.getEntered(): stop if {teren::%chunk at event.getVehicle()%::dodani::*} contains event.getEntered(): stop if event.getEntered() is a player: send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getEntered() cancel event on BlockPlaceEvent: set {_i} to new NBTItem(event.getItemInHand()) if event.getPlayer() does not have permission "{@perm}": if event.getBlockPlaced() is any bed: if {teren::%chunk at event.getBlockPlaced().getRelative(event.getBlockPlaced().getBlockData().getFacing())%::isProtected} is true: if {teren::%chunk at event.getBlockPlaced().getRelative(event.getBlockPlaced().getBlockData().getFacing())%::terenOwner} is not event.getPlayer(): if {teren::%chunk at event.getBlockPlaced().getRelative(event.getBlockPlaced().getBlockData().getFacing())%::dodani::*} does not contain event.getPlayer(): send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer() cancel event stop if {teren::%chunk at event.getBlockPlaced()%::isProtected} is true: if {teren::%chunk at event.getBlockPlaced()%::terenOwner} is event.getPlayer(): if {_i}.getBoolean("blok.terenu") is true: cancel event send "{@prefix} {@forbiddencolor}Ten chunk jest już zajęty! Połóż blok terenu w innym miejscu." to event.getPlayer() stop stop if {teren::%chunk at event.getBlockPlaced()%::dodani::*} contains event.getPlayer(): if {_i}.getBoolean("blok.terenu") is true: cancel event send "{@prefix} {@forbiddencolor}Ten chunk jest już zajęty! Połóż blok terenu w innym miejscu." to event.getPlayer() stop stop if event.getPlayer() has permission "{@perm}": if {_i}.getBoolean("blok.terenu") is true: cancel event send "{@prefix} {@forbiddencolor}Ten chunk jest już zajęty! Połóż blok terenu w innym miejscu." to event.getPlayer() stop stop cancel event send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer() stop if {_i}.getBoolean("blok.terenu") is true: cancel event if {teren::%chunk at event.getBlockPlaced()%::isProtected} is true: send "{@prefix} {@forbiddencolor}Ten chunk jest już zajęty! Połóż blok terenu w innym miejscu." to event.getPlayer() stop remove 1 from item amount of event.getItemInHand().setAmount(event.getItemInHand().getAmount()-1) set {teren::%chunk at event.getBlockPlaced()%::isProtected} to true set {teren::%chunk at event.getBlockPlaced()%::homeLocation} to event.getBlockPlaced().getLocation() set {teren::%chunk at event.getBlockPlaced()%::terenOwner} to event.getPlayer() add 1 to {iletere} set {teren::%chunk at event.getBlockPlaced()%::terenName} to "teren-%{iletere}%" set {terenygracza::%event.getPlayer()%::teren-%{iletere}%} to chunk at event.getBlockPlaced() wait 1 tick set block at event.getBlockPlaced().getLocation() to bedrock send "{@prefix} {@secondarycolor}Położyłeś teren, jego nazwa to {@primarycolor}teren-%{iletere}%{@secondarycolor}." to event.getPlayer() command /terenadm [] [] []: permission: {@perm} permission message: {@prefix} {@forbiddencolor}Nie masz dostępu do tej komendy! trigger: if arg-1 is not set: send "{@prefix} {@secondarycolor}Komendy administracyjne zarządzania terenami:%nl%{@backgroundcolor}» {@primarycolor}/terenadm delete {@backgroundcolor}- {@secondarycolor}Usuwa teren na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm deleteall (gracz){@backgroundcolor}- {@secondarycolor}Usuwa wszystkie tereny danego gracza.%nl%{@backgroundcolor}» {@primarycolor}/terenadm list (gracz) {@backgroundcolor}- {@secondarycolor}Otwiera menu z listą terenów danego gracza.%nl%{@backgroundcolor}» {@primarycolor}/terenadm nazwa (nazwa) {@backgroundcolor}- {@secondarycolor}Zmienia nazwę terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm dodaj (nazwa gracza) {@backgroundcolor}- {@secondarycolor}Dodaje gracza do terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm usuń (nazwa gracza) {@backgroundcolor}- {@secondarycolor}Usuwa gracza z terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm info {@backgroundcolor}- {@secondarycolor}Podaje informacje na temat chunka na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm get [ilość] {@backgroundcolor}- {@secondarycolor}Daje Tobie daną ilość bloków terenu.%nl%{@backgroundcolor}» {@primarycolor}/terenadm flow {@backgroundcolor}- {@secondarycolor}" to player if arg-1 is not "delete" or "deleteall" or "get" or "list" or "nazwa" or "dodaj" or "usun" or "usuń" or "info" or "flow": send "{@prefix} {@secondarycolor}Komendy administracyjne zarządzania terenami:%nl%{@backgroundcolor}» {@primarycolor}/terenadm delete {@backgroundcolor}- {@secondarycolor}Usuwa teren na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm deleteall (gracz){@backgroundcolor}- {@secondarycolor}Usuwa wszystkie tereny danego gracza.%nl%{@backgroundcolor}» {@primarycolor}/terenadm list (gracz) {@backgroundcolor}- {@secondarycolor}Otwiera menu z listą terenów danego gracza.%nl%{@backgroundcolor}» {@primarycolor}/terenadm nazwa (nazwa) {@backgroundcolor}- {@secondarycolor}Zmienia nazwę terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm dodaj (nazwa gracza) {@backgroundcolor}- {@secondarycolor}Dodaje gracza do terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm usuń (nazwa gracza) {@backgroundcolor}- {@secondarycolor}Usuwa gracza z terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm info {@backgroundcolor}- {@secondarycolor}Podaje informacje na temat chunka na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/terenadm get [ilość] {@backgroundcolor}- {@secondarycolor}Daje Tobie daną ilość bloków terenu.%nl%{@backgroundcolor}» {@primarycolor}/terenadm flow {@backgroundcolor}- {@secondarycolor}Ustawia status rozlewania wody i lawy na terenie." to player if arg-1 is "delete": set block at {teren::%chunk at player%::homeLocation} to air send "{@prefix} {@secondarycolor}Teren został usunięty!" to player clear {teren::%chunk at player%::isProtected} clear {teren::%chunk at player%::dodani::*} clear {teren::%chunk at player%::flow} clear {terenygracza::%{teren::%chunk at player%::terenOwner}%::%{teren::%chunk at player%::terenName}%} clear {teren::%chunk at player%::terenOwner} clear {teren::%chunk at player%::homeLocation} clear {teren::%chunk at player%::terenName} if arg-1 is "get": if arg-2 is not set: give 1 of getBlokTerenu() to player send "{@prefix} {@secondarycolor}Dostałeś {@primarycolor}1 Blok terenu{@secondarycolor}!" to player stop if "%arg-2 parsed as integer%" is not arg-2: send "{@prefix} {@forbiddencolor}Musisz podać ilość terenów które chcesz otrzymać!" to player else: give arg-2 parsed as integer of getBlokTerenu() to player send "{@prefix} {@secondarycolor}Dostałeś {@primarycolor}%arg-2%{@primarycolor} Blok terenu{@secondarycolor}!" to player if arg-1 is "deleteall": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nazwy gracza którego tereny chcesz usunąć!" to player else: loop {terenygracza::%arg-2%::*}: clear {teren::%loop-value%::isProtected} clear {teren::%loop-value%::terenOwner} clear {teren::%loop-value%::dodani::*} clear {teren::%loop-value%::flow} set block at {teren::%loop-value%::homeLocation} to air clear {teren::%loop-value%::homeLocation} clear {terenygracza::%arg-2%::%{teren::%loop-value%::terenName}%} clear {teren::%loop-value%::terenName} clear {terenygracza::%arg-2%::*} send "{@prefix} {@secondarycolor}Tereny zostały usunięte!" if arg-1 is "info": set {_terenname} to {teren::%chunk at player%::terenName} if {teren::%chunk at player%::dodani::*} is set: set {_addedplayers} to "%{teren::%chunk at player%::dodani::*}%" else: set {_addedplayers} to "Brak" set {_terenkoordy} to "{@primarycolor}X: %x-location of {teren::%chunk at player%::homeLocation}%{@primarycolor}, Y: %y-location of {teren::%chunk at player%::homeLocation}%{@primarycolor}, Z: %z-location of {teren::%chunk at player%::homeLocation}%" replace all " and " with " i " in {_addedplayers} if {teren::%chunk at player%::isProtected} is true: send "{@prefix} {@secondarycolor}Informacje o terenie:%nl%{@backgroundcolor}» {@secondarycolor}Właściciel terenu: {@primarycolor}%{teren::%chunk at player%::terenOwner}%%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty chunka: {@primarycolor}X: %(chunk at player).getX()%{@primarycolor}, Z: %(chunk at player).getZ()%%nl%{@backgroundcolor}» {@secondarycolor}Nazwa terenu: {@primarycolor}%{_terenname}%%nl%{@backgroundcolor}» {@secondarycolor}Dodani gracze: {@primarycolor}%{_addedplayers}%%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty bloku terenu: {@primarycolor}%{_terenkoordy}%" to player else: send "{@prefix} {@secondarycolor}Informacje o terenie:%nl%{@backgroundcolor}» {@secondarycolor}Właściciel terenu: {@primarycolor}Brak &a(Teren jest wolny!)%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty chunka: {@primarycolor}X: %(chunk at player).getX()%{@primarycolor}, Z: %(chunk at player).getZ()%%nl%{@backgroundcolor}» {@secondarycolor}Nazwa terenu: {@primarycolor}Brak &a(Teren jest wolny!)%nl%{@backgroundcolor}» {@secondarycolor}Dodani gracze: {@primarycolor}Brak &a(Teren jest wolny!)%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty bloku terenu: {@primarycolor}Brak &a(Teren jest wolny!)" to player if arg-1 is "list": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nazwy gracza którego listę terenów chcesz zobaczyć!" to player else: openTerenList(arg-2 parsed as player, 1, player) if arg-1 is "nazwa": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nowej nazwy dla terenu na którym stoisz!" to player stop if {terenygracza::%{teren::%chunk at player%::terenOwner}%::%arg-2%} is set: send "{@prefix} {@forbiddencolor}Jeden z terenów tego gracza ma już taką nazwę!" to player stop set {terenygracza::%{teren::%chunk at player%::terenOwner}%::%arg-2%} to {terenygracza::%{teren::%chunk at player%::terenOwner}%::%{teren::%chunk at player%::terenName}%} clear {terenygracza::%{teren::%chunk at player%::terenOwner}%::%{teren::%chunk at player%::terenName}%} set {teren::%chunk at player%::terenName} to arg-2 send "{@prefix} {@secondarycolor}Zmieniono nazwę terenu na {@primarycolor}%arg-2%{@secondarycolor}!" to player if arg-1 is "dodaj": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nazwy gracza którego chcesz dodać!" to player stop set {_p} to arg-2 parsed as offline player if {teren::%chunk at player%::dodani::*} contains {_p}: send "{@prefix} {@forbiddencolor}Ten gracz jest już dodany do terenu na którym stoisz!" to player stop add {_p} to {teren::%chunk at player%::dodani::*} send "{@prefix} {@secondarycolor}Gracz {@primarycolor}%{_p}% {@secondarycolor}został dodany do terenu na którym stoisz!" to player if arg-1 is "usun" or "usuń": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nazwy gracza którego chcesz usunąć!" to player stop set {_p} to arg-2 parsed as offline player if {teren::%chunk at player%::dodani::*} does not contain {_p}: send "{@prefix} {@forbiddencolor}Ten gracz nie jest dodany do terenu na którym stoisz!" to player stop remove {_p} from {teren::%chunk at player%::dodani::*} send "{@prefix} {@secondarycolor}Gracz {@primarycolor}%{_p}% {@secondarycolor}został usunięty z terenu na którym stoisz!" to player if arg-1 is "flow": if {teren::%chunk at player%::flow} is true: clear {teren::%chunk at player%::flow} send "{@prefix} {@secondarycolor}Rozlewanie płynów jest teraz wyłączone!" to player else: set {teren::%chunk at player%::flow} to true send "{@prefix} {@secondarycolor}Rozlewanie płynów jest teraz włączone!" to player function openTerenList(p: player, n: integer, w: player): loop {terenygracza::%{_p}%::*}: add {teren::%loop-value%::terenName} to {_terenlist::*} set {_terenlist::*} to alphabetically sorted {_terenlist::*} set {_inv} to chest inventory with 6 rows named "{@prefix} {@secondarycolor}Lista terenów {@backgroundcolor}({@primarycolor}%{_n}%{@backgroundcolor})" loop 45 times: if {_terenlist::%loop-number+45*({_n}-1)%} is not set: set slot loop-number -1 of {_inv} to red stained glass pane named "&c&lKONIEC WYNIKÓW" continue set {_i} to new NBTItem(player head) set {_c} to new NBTContainer("{SkullOwner:{Id:[I;-1618445871,827017924,-2053502089,429124224],Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvODIxMTU0OWM5MGI5OWRhYzE2ZjVmNzA5YjY2ZDkxODMwMzAwYmI5N2YzYjY1YzdjNTVhMmZkNjJhY2U2MzJmYyJ9fX0=""}]}}}") {_i}.mergeCompound({_c}) {_i}.setString("terenOwner", "%{_p}%") {_i}.setString("terenName", {_terenlist::%loop-number+45*({_n}-1)%}) set {_i} to {_i}.getItem() if loop-number+45*({_n}-1) is higher than 64: set slot loop-number -1 of {_inv} to 1 of {_i} named "{@primarycolor}%{_terenlist::%loop-number+45*({_n}-1)%}%" with lore "{@backgroundcolor}Kliknij by teleportować%nl%{@backgroundcolor}się do terenu!" else: set slot loop-number -1 of {_inv} to loop-number+45*({_n}-1) of {_i} named "{@primarycolor}%{_terenlist::%loop-number+45*({_n}-1)%}%" with lore "{@backgroundcolor}Kliknij by teleportować%nl%{@backgroundcolor}się do terenu!" loop 9 times: set slot loop-number +44 of {_inv} to red stained glass pane named "{@prefix}" if {_n} is 1: if size of {_terenlist::*} is higher than 45: set {_i} to new NBTItem(paper named "{@primarycolor}-->" with lore "{@backgroundcolor}Kliknij aby przejść%nl%{@backgroundcolor}na następną stronę!") {_i}.setInteger("terenlist.strona", ({_n}+1).intValue()) set {_i} to {_i}.getItem() set slot 53 of {_inv} to {_i} if {_n} is higher than 1: if size of {_terenlist::*} is higher than 45*{_n}: set {_i} to new NBTItem(paper named "{@primarycolor}-->" with lore "{@backgroundcolor}Kliknij aby przejść%nl%{@backgroundcolor}na następną stronę!") {_i}.setInteger("terenlist.strona", ({_n}+1).intValue()) set {_i} to {_i}.getItem() set slot 53 of {_inv} to {_i} set {_i} to new NBTItem(paper named "{@primarycolor}<--" with lore "{@backgroundcolor}Kliknij aby przejść%nl%{@backgroundcolor}na poprzednią stronę!") {_i}.setInteger("terenlist.strona", ({_n}-1).intValue()) set {_i} to {_i}.getItem() set slot 52 of {_inv} to {_i} open {_inv} to {_w} on inventory click: if name of event-inventory contains "{@prefix} {@secondarycolor}Lista terenów": if event-inventory is not player's inventory: cancel event if type of clicked item is player head: close player's inventory set {_i} to new NBTItem(clicked item) teleport player to block over {teren::%{terenygracza::%{_i}.getString("terenOwner")%::%{_i}.getString("terenName")%}%::homeLocation} if clicked item is paper: set {_i} to new NBTItem(clicked item) openTerenList(player, {_i}.getInteger("terenlist.strona"), player) command /teren [] [] []: trigger: if arg-1 is not set: send "{@prefix} {@secondarycolor}Komendy zarządzania terenami:%nl%{@backgroundcolor}» {@primarycolor}/teren tp (nazwa terenu) {@backgroundcolor}- {@secondarycolor}Teleportuje do twojego wybranego terenu.%nl%{@backgroundcolor}» {@primarycolor}/teren list [numer strony] {@backgroundcolor}- {@secondarycolor}Otwiera menu z listą twoich terenów.%nl%{@backgroundcolor}» {@primarycolor}/teren nazwa (nazwa) {@backgroundcolor}- {@secondarycolor}Zmienia nazwę terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/teren dodaj (nazwa gracza) [*] {@backgroundcolor}- {@secondarycolor}Dodaje gracza do terenu na którym stoisz (lub do wszystkich, gdy dodasz '*').%nl%{@backgroundcolor}» {@primarycolor}/teren usuń (nazwa gracza) [*] {@backgroundcolor}- {@secondarycolor}Usuwa gracza z terenu na którym stoisz (lub z wszystkich, gdy dodasz '*')%nl%{@backgroundcolor}» {@primarycolor}/teren info {@backgroundcolor}- {@secondarycolor}Podaje informacje na temat chunka na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/teren flow {@backgroundcolor}- {@secondarycolor}Ustawia status rozlewania wody i lawy na terenie." to player if arg-1 is not "tp" or "list" or "nazwa" or "dodaj" or "usun" or "usuń" or "info" or "flow": send "{@prefix} {@secondarycolor}Komendy zarządzania terenami:%nl%{@backgroundcolor}» {@primarycolor}/teren tp (nazwa terenu) {@backgroundcolor}- {@secondarycolor}Teleportuje do twojego wybranego terenu.%nl%{@backgroundcolor}» {@primarycolor}/teren list [numer strony] {@backgroundcolor}- {@secondarycolor}Otwiera menu z listą twoich terenów.%nl%{@backgroundcolor}» {@primarycolor}/teren nazwa (nazwa) {@backgroundcolor}- {@secondarycolor}Zmienia nazwę terenu na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/teren dodaj (nazwa gracza) [*] {@backgroundcolor}- {@secondarycolor}Dodaje gracza do terenu na którym stoisz (lub do wszystkich, gdy dodasz '*').%nl%{@backgroundcolor}» {@primarycolor}/teren usuń (nazwa gracza) [*] {@backgroundcolor}- {@secondarycolor}Usuwa gracza z terenu na którym stoisz (lub z wszystkich, gdy dodasz '*')%nl%{@backgroundcolor}» {@primarycolor}/teren info {@backgroundcolor}- {@secondarycolor}Podaje informacje na temat chunka na którym stoisz.%nl%{@backgroundcolor}» {@primarycolor}/teren flow {@backgroundcolor}- {@secondarycolor}Ustawia status rozlewania wody i lawy na terenie." to player if arg-1 is "tp": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nazwy terenu do którego chcesz się teleportować!" to player stop if block over {teren::%{terenygracza::%player%::%arg-2%}%::homeLocation} is not air: break block over {teren::%{terenygracza::%player%::%arg-2%}%::homeLocation} if block over block over {teren::%{terenygracza::%player%::%arg-2%}%::homeLocation} is not air: break block over block over {teren::%{terenygracza::%player%::%arg-2%}%::homeLocation} teleport player to block over {teren::%{terenygracza::%player%::%arg-2%}%::homeLocation} send "{@prefix} {@secondarycolor}Przeteleportowano do terenu o nazwie {@primarycolor}%arg-2%{@secondarycolor}!" to player if arg-1 is "list": if arg-2 is not set: openTerenList(player, 1, player) else: if "%arg-2 parsed as integer%" is not arg-2: send "{@prefix} {@forbiddencolor}Musisz podać numer strony!" to player else: if arg-2 parsed as integer is less than 1: send "{@prefix} {@forbiddencolor}Numer strony nie może być mniejszy od 1!" to player else: if size of {terenygracza::%player%::*} is higher than 45*((arg-2 parsed as integer) -1): openTerenList(player, arg-2 parsed as integer, player) else: send "{@prefix} {@forbiddencolor}Nie masz tylu terenów!" to player if arg-1 is "nazwa": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nowej nazwy dla terenu na którym stoisz!" to player stop if arg-2 contains "-": send "{@prefix} {@forbiddencolor}Nazwa terenu nie może zawierać symbolu {@backgroundcolor}'{@primarycolor}-{@backgroundcolor}'{@forbiddencolor}!" to player stop if {terenygracza::%player%::%arg-2%} is set: send "{@prefix} {@forbiddencolor}Jeden z twoich terenów ma już taką nazwę!" to player stop set {terenygracza::%player%::%arg-2%} to {terenygracza::%player%::%{teren::%chunk at player%::terenName}%} clear {terenygracza::%player%::%{teren::%chunk at player%::terenName}%} set {teren::%chunk at player%::terenName} to arg-2 send "{@prefix} {@secondarycolor}Zmieniono nazwę terenu na {@primarycolor}%arg-2%{@secondarycolor}!" to player if arg-1 is "dodaj": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nazwy gracza którego chcesz dodać!" to player stop if arg-3 is "*": loop {terenygracza::%player%::*}: if {teren::%loop-value%::dodani::*} does not contain arg-2: add arg-2 to {teren::%loop-value%::dodani::*} send "{@prefix} {@secondarycolor}Gracz {@primarycolor}%arg-2% {@secondarycolor}został dodany do twoich wszystkich terenów!" to player stop if {teren::%chunk at player%::terenOwner} is not player: send "{@prefix} {@forbiddencolor}Nie jesteś właścicielem tego terenu!" to player stop set {_p} to arg-2 if {teren::%chunk at player%::dodani::*} contains {_p}: send "{@prefix} {@forbiddencolor}Ten gracz jest już dodany do terenu na którym stoisz!" to player stop add {_p} to {teren::%chunk at player%::dodani::*} send "{@prefix} {@secondarycolor}Gracz {@primarycolor}%{_p}% {@secondarycolor}został dodany do terenu na którym stoisz!" to player if arg-1 is "usun" or "usuń": if arg-2 is not set: send "{@prefix} {@forbiddencolor}Nie podałeś nazwy gracza którego chcesz usunąć!" to player stop if arg-3 is "*": loop {terenygracza::%player%::*}: if {teren::%loop-value%::dodani::*} contains arg-2: if {teren::%loop-value%::dodani::*} contains arg-2: remove arg-2 from {teren::%loop-value%::dodani::*} send "{@prefix} {@secondarycolor}Gracz {@primarycolor}%arg-2% {@secondarycolor}został usunięty z twoich wszystkich terenów!" to player stop if {teren::%chunk at player%::terenOwner} is not player: send "{@prefix} {@forbiddencolor}Nie jesteś właścicielem tego terenu!" to player stop set {_p} to arg-2 if {teren::%chunk at player%::dodani::*} does not contain {_p}: send "{@prefix} {@forbiddencolor}Ten gracz nie jest dodany do terenu na którym stoisz!" to player stop remove {_p} from {teren::%chunk at player%::dodani::*} send "{@prefix} {@secondarycolor}Gracz {@primarycolor}%{_p}% {@secondarycolor}został usunięty z terenu na którym stoisz!" to player if arg-1 is "info": if {teren::%chunk at player%::terenOwner} is not player: if {teren::%chunk at player%::dodani::*} contains player: set {_terenname} to {teren::%chunk at player%::terenName} if {teren::%chunk at player%::dodani::*} is set: set {_addedplayers} to "%{teren::%chunk at player%::dodani::*}%" else: set {_addedplayers} to "Brak" set {_terenkoordy} to "{@primarycolor}X: %x-location of {teren::%chunk at player%::homeLocation}%{@primarycolor}, Y: %y-location of {teren::%chunk at player%::homeLocation}%{@primarycolor}, Z: %z-location of {teren::%chunk at player%::homeLocation}%" else: set {_terenname} to "{@forbiddencolor}UKRYTO" set {_addedplayers} to "{@forbiddencolor}UKRYTO" set {_terenkoordy} to "{@forbiddencolor}UKRYTO" else: set {_terenname} to {teren::%chunk at player%::terenName} if {teren::%chunk at player%::dodani::*} is set: set {_addedplayers} to "%{teren::%chunk at player%::dodani::*}%" else: set {_addedplayers} to "Brak" set {_terenkoordy} to "{@primarycolor}X: %x-location of {teren::%chunk at player%::homeLocation}%{@primarycolor}, Y: %y-location of {teren::%chunk at player%::homeLocation}%{@primarycolor}, Z: %z-location of {teren::%chunk at player%::homeLocation}%" replace all " and " with " i " in {_addedplayers} if {teren::%chunk at player%::isProtected} is true: send "{@prefix} {@secondarycolor}Informacje o terenie:%nl%{@backgroundcolor}» {@secondarycolor}Właściciel terenu: {@primarycolor}%{teren::%chunk at player%::terenOwner}%%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty chunka: {@primarycolor}X: %(chunk at player).getX()%{@primarycolor}, Z: %(chunk at player).getZ()%%nl%{@backgroundcolor}» {@secondarycolor}Nazwa terenu: {@primarycolor}%{_terenname}%%nl%{@backgroundcolor}» {@secondarycolor}Dodani gracze: {@primarycolor}%{_addedplayers}%%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty bloku terenu: {@primarycolor}%{_terenkoordy}%" to player else: send "{@prefix} {@secondarycolor}Informacje o terenie:%nl%{@backgroundcolor}» {@secondarycolor}Właściciel terenu: {@primarycolor}Brak &a(Teren jest wolny!)%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty chunka: {@primarycolor}X: %(chunk at player).getX()%{@primarycolor}, Z: %(chunk at player).getZ()%%nl%{@backgroundcolor}» {@secondarycolor}Nazwa terenu: {@primarycolor}Brak &a(Teren jest wolny!)%nl%{@backgroundcolor}» {@secondarycolor}Dodani gracze: {@primarycolor}Brak &a(Teren jest wolny!)%nl%{@backgroundcolor}» {@secondarycolor}Koordynaty bloku terenu: {@primarycolor}Brak &a(Teren jest wolny!)" to player if arg-1 is "flow": if {teren::%chunk at player%::terenOwner} is not player: send "{@prefix} {@forbiddencolor}Nie jesteś właścicielem tego terenu!" to player stop if {teren::%chunk at player%::flow} is true: clear {teren::%chunk at player%::flow} send "{@prefix} {@secondarycolor}Rozlewanie płynów jest teraz wyłączone!" to player else: set {teren::%chunk at player%::flow} to true send "{@prefix} {@secondarycolor}Rozlewanie płynów jest teraz włączone!" to player on BlockBreakEvent: if {teren::%chunk at event.getBlock()%::isProtected} is true: if {teren::%chunk at event.getBlock()%::terenOwner} is event.getPlayer(): stop if {teren::%chunk at event.getBlock()%::dodani::*} contains event.getPlayer(): stop if event.getPlayer() has permission "{@perm}": stop cancel event send "{@prefix} {@forbiddencolor}Nie masz dostępu do tego terenu!" to event.getPlayer()