Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void TwoPlayersOpenFix(PlayerInteractEvent e){
- if(e.getClickedBlock() != null && e.getPlayer() != null){
- Block b = e.getClickedBlock();
- Player p = e.getPlayer();
- String n = p.getName();
- String m = b.getType().toString();
- int id = b.getTypeId();
- int data = b.getData();
- if(m.equalsIgnoreCase("BUILDCRAFTFACTORY_AUTOWORKBENCHBLOCK") || m.equalsIgnoreCase("APPLIEDENERGISTICS2_TILEBLOCKDRIVE") || m.equalsIgnoreCase("APPLIEDENERGISTICS2_TILEBLOCKCHEST") || m.equalsIgnoreCase("EXTRABEES_ALVEARY") || (m.equalsIgnoreCase("PROJREDEXPANSION_PROJECTREDEXPANSIONMACHINE2") && (data == 11 || data == 10 || data == 6)) || m.equalsIgnoreCase("THERMALEXPANSION_WORKBENCH")){
- if(this.getplayerinblock.get(b) != null){
- if(!this.getplayerinblock.get(b).equalsIgnoreCase(n)){
- p.sendMessage(ChatColor.GOLD + "Этот блок зарегистрирован игроком: " + ChatColor.RED + this.getplayerinblock.get(b));
- e.setCancelled(true);
- }
- }else{
- this.getblockinplayer.put(n, b);
- this.getplayerinblock.put(b, n);
- }
- }else{
- if(this.getblockinplayer.get(n) != null){
- if(this.getplayerinblock.get(this.getblockinplayer.get(n)) != null){
- this.getplayerinblock.remove(this.getblockinplayer.get(n));
- this.getblockinplayer.remove(n);
- }
- }
- }
- }
- }
- @EventHandler
- public void TwoPlayersOpenFix2(BlockBreakEvent e){
- if(e.getPlayer() != null){
- String n = e.getPlayer().getName();
- if(this.getblockinplayer.get(n) != null){
- if(this.getplayerinblock.get(this.getblockinplayer.get(n)) != null){
- this.getplayerinblock.remove(this.getblockinplayer.get(n));
- this.getblockinplayer.remove(n);
- }
- }
- }
- }
- @EventHandler
- public void TwoPlayersOpenFix3(PlayerChatEvent e){
- if(e.getPlayer() != null){
- String n = e.getPlayer().getName();
- if(this.getblockinplayer.get(n) != null){
- if(this.getplayerinblock.get(this.getblockinplayer.get(n)) != null){
- this.getplayerinblock.remove(this.getblockinplayer.get(n));
- this.getblockinplayer.remove(n);
- }
- }
- }
- }
- @EventHandler
- public void TwoPlayersOpenFix4(PlayerQuitEvent e){
- if(e.getPlayer() != null){
- String n = e.getPlayer().getName();
- if(this.getblockinplayer.get(n) != null){
- if(this.getplayerinblock.get(this.getblockinplayer.get(n)) != null){
- this.getplayerinblock.remove(this.getblockinplayer.get(n));
- this.getblockinplayer.remove(n);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement