BedCraftGP - [*Fix 95% off ALL griefing*] ~Ultimate ~Unleashed

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

darkdeath1332

New Member
Jul 29, 2019
102
0
0
Just wanted to let you know I altered your code to allow for an area protection that's cords are customized in the config. You did a great job and I can even moreso see that when I alter the source code, it's flexible and simple.

I also wanted to know why you chose 11 as the number of blocks away from a towny protection. Does the power tool reach 11 blocks?

I could add the range to the config if people want to, 11 is the range a quarry hits. Most items like power tool cant be shot trough a wall in the claim.
 

darkdeath1332

New Member
Jul 29, 2019
102
0
0
New update,

Towny & Gp version.
# Added config support for metadata (Sub ID's) Normal items will be "<Id>:*"
Items with data "<Id>:<Sub Id>"

# Added config for 2 fixes;
FixMinimumStone: 'true'
FixWrathIgniter: 'true'

# More information in the config.

# Added a couple items;
- '27307:*'
- '25296:*'
- '27306:*'
- '30482:*'
- '20258:*'

!! when you update, overwrite the plugin and delete the old config !!

Downloads: (My own download server 100mbps download.)
TOWNY; http://www.bedcraft.eu/download/BedCraftTOWNY.jar
GRIEFPREVENTION; http://www.bedcraft.eu/download/BedCraftGP.jar
 
  • Like
Reactions: Jared39

darkdeath1332

New Member
Jul 29, 2019
102
0
0
Just wanted to let you know I altered your code to allow for an area protection that's cords are customized in the config. You did a great job and I can even moreso see that when I alter the source code, it's flexible and simple.

I also wanted to know why you chose 11 as the number of blocks away from a towny protection. Does the power tool reach 11 blocks?

As long the name of the plugin is still [BedCraft] and the message prefix is the same its okay.
 

Jared39

New Member
Jul 29, 2019
125
0
0
New update,

Towny & Gp version.
# Added config support for metadata (Sub ID's) Normal items will be "<Id>:*"
Items with data "<Id>:<Sub Id>"

# Added config for 2 fixes;
FixMinimumStone: 'true'
FixWrathIgniter: 'true'

# More information in the config.

# Added a couple items;
- '27307:*'
- '25296:*'
- '27306:*'
- '30482:*'
- '20258:*'

!! when you update, overwrite the plugin and delete the old config !!

Downloads: (My own download server 100mbps download.)
TOWNY; http://www.bedcraft.eu/download/BedCraftTOWNY.jar
GRIEFPREVENTION; http://www.bedcraft.eu/download/BedCraftGP.jar
Thanks, I appreciate it greatly.
 

darkdeath1332

New Member
Jul 29, 2019
102
0
0
Towny version wasent working! I recoded it a bit and now works 100% again.

You will have to redownload if you use the towny version :(
 

waddle1463

New Member
Jul 29, 2019
28
0
0
As long the name of the plugin is still [BedCraft] and the message prefix is the same its okay.
Ok... Now for my own purposes I will create a seperate quarry event that will check 11 blocks... Then the other items will be set to another number because my users complain that they cannot destroy close to a claim. Thank you
 

waddle1463

New Member
Jul 29, 2019
28
0
0
I have found a better method for your player interact event that works better and does not use as much time and processing power

Your original code:
Code:
//Block c9 = world.getBlockAt(x, y, z);
    //Block c1 = world.getBlockAt(x + 8, y, z);
    //Block c2 = world.getBlockAt(x - 8, y, z);
    //Block c3 = world.getBlockAt(x, y, z + 8);
    //Block c4 = world.getBlockAt(x, y, z - 8);
    //Block c5 = world.getBlockAt(x + 8, y, z + 8);
    //Block c6 = world.getBlockAt(x + 11, y, z - 8);
    //Block c7 = world.getBlockAt(x - 8, y, z + 8);
    //Block c8 = world.getBlockAt(x - 8, y, z - 8);
            boolean check = false;
   
    //if (!checkBlock(player,c1)){check = true;}
    //if (!checkBlock(player,c2)){check = true;}
    //if (!checkBlock(player,c3)){check = true;}
    //if (!checkBlock(player,c4)){check = true;}
    //if (!chekBlock(player,c5)){check = true;}
    //if (!checkBlock(player,c6)){check = true;}
    //if (!checkBlock(player,c7)){check = true;}
    //if (!checkBlcock(player,c8)){check = true;}
    //if (!checkBlock(player,c9)){check = true;}

Can be replaced with just 2 lines:
Code:
boolean check = false;
if (!checkBlock(player,player.getTargetBlock(null, 200))

This also allows players to use wands right outside protection without destroying inside protection.

I continue to support your plugin and am constantly making changes to fit my own needs. If you do not want this source up, just reply and I will take it down. Just wanted to share with you a possible method you could use instead. I got this method off of the bukkit wiki: http://wiki.bukkit.org/Plugin_Tutorial#Spawn_Lightning_Bolt_Where_Player_is_Looking
 

darkdeath1332

New Member
Jul 29, 2019
102
0
0
Th
I have found a better method for your player interact event that works better and does not use as much time and processing power

Your original code:
Code:
//Block c9 = world.getBlockAt(x, y, z);
    //Block c1 = world.getBlockAt(x + 8, y, z);
    //Block c2 = world.getBlockAt(x - 8, y, z);
    //Block c3 = world.getBlockAt(x, y, z + 8);
    //Block c4 = world.getBlockAt(x, y, z - 8);
    //Block c5 = world.getBlockAt(x + 8, y, z + 8);
    //Block c6 = world.getBlockAt(x + 11, y, z - 8);
    //Block c7 = world.getBlockAt(x - 8, y, z + 8);
    //Block c8 = world.getBlockAt(x - 8, y, z - 8);
            boolean check = false;
 
    //if (!checkBlock(player,c1)){check = true;}
    //if (!checkBlock(player,c2)){check = true;}
    //if (!checkBlock(player,c3)){check = true;}
    //if (!checkBlock(player,c4)){check = true;}
    //if (!chekBlock(player,c5)){check = true;}
    //if (!checkBlock(player,c6)){check = true;}
    //if (!checkBlock(player,c7)){check = true;}
    //if (!checkBlcock(player,c8)){check = true;}
    //if (!checkBlock(player,c9)){check = true;}

Can be replaced with just 2 lines:
Code:
boolean check = false;
if (!checkBlock(player,player.getTargetBlock(null, 200))

This also allows players to use wands right outside protection without destroying inside protection.

I continue to support your plugin and am constantly making changes to fit my own needs. If you do not want this source up, just reply and I will take it down. Just wanted to share with you a possible method you could use instead. I got this method off of the bukkit wiki: http://wiki.bukkit.org/Plugin_Tutorial#Spawn_Lightning_Bolt_Where_Player_is_Looking
This will not work when you click it inside the claim into the air and then toggle down, same for PvP bypassing tools.

EDIT: Same for wand of exc. You click it on a block next to claim on air distance so plugin will detect no block. You hold the click and move into the claim.
 

waddle1463

New Member
Jul 29, 2019
28
0
0
Th
This will not work when you click it inside the claim into the air and then toggle down, same for PvP bypassing tools.

EDIT: Same for wand of exc. You click it on a block next to claim on air distance so plugin will detect no block. You hold the click and move into the claim.
I've tested wand of exc and that does not bypass that way but the right click air event idk. But you have a point there. If it does work then I can just use your previous code for that event specifically or something along those lines.

EDIT: If you click into the air the event is still called because you are still looking at a block, it is an air block but... Don't quote me on this...
 

darkdeath1332

New Member
Jul 29, 2019
102
0
0
I've tested wand of exc and that does not bypass that way but the right click air event idk. But you have a point there. If it does work then I can just use your previous code for that event specifically or something along those lines.

EDIT: If you click into the air the event is still called because you are still looking at a block, it is an air block but... Don't quote me on this...

Wont work, if you target a block far out the claim and then move with the wand on air range into the claim it still griefs.

The reason my code works is becouse I get the posistion of the player on a click, wich is denied around the claim.
 

waddle1463

New Member
Jul 29, 2019
28
0
0
Wont work, if you target a block far out the claim and then move with the wand on air range into the claim it still griefs.

The reason my code works is becouse I get the posistion of the player on a click, wich is denied around the claim.
Yes I realize that. I now have just banned wand of excavation because it is just a world destroying tool. All the other wands still work. I also added some code to prevent access of project tables and the latter. I have also tweaked the quarry code to get the direction it is being placed so users can place a quarry right outside a plot but it has to be facing away from the towny area to be valid.
Also I was on your server the other day just while I was checking out a list of server and I have to say it is a very nice server. I used to play on dadecraft and that was just terrible, the admins and mods were not caring, but on your server the moderators come on and say good morning and interact with the players. How nice.
 

darkdeath1332

New Member
Jul 29, 2019
102
0
0
Yes I realize that. I now have just banned wand of excavation because it is just a world destroying tool. All the other wands still work. I also added some code to prevent access of project tables and the latter. I have also tweaked the quarry code to get the direction it is being placed so users can place a quarry right outside a plot but it has to be facing away from the towny area to be valid.
Also I was on your server the other day just while I was checking out a list of server and I have to say it is a very nice server. I used to play on dadecraft and that was just terrible, the admins and mods were not caring, but on your server the moderators come on and say good morning and interact with the players. How nice.

Could you share your code with me?

Thanks!
 

waddle1463

New Member
Jul 29, 2019
28
0
0
BlockPlace Class:
Code:
if (block.getTypeId() == 516 ){
           
        int y = block.getY();
        int x = block.getX();
        int z = block.getZ();
        World world = block.getWorld();
        boolean check = false;
        if(main.getF(player)==1 || main.getF(player)==-3){ //Facing West
            Block c6 = world.getBlockAt(x, y, z);
            Block c1 = world.getBlockAt(x - 11, y, z);
            Block c2 = world.getBlockAt(x, y, z + 5);
            Block c3 = world.getBlockAt(x, y, z - 5);
            Block c4 = world.getBlockAt(x - 11, y, z + 5);
            Block c5 = world.getBlockAt(x - 11, y, z - 5);
           
            if (!checkBlock(player,c1)){check = true;}
            if (!checkBlock(player,c2)){check = true;}
            if (!checkBlock(player,c3)){check = true;}
            if (!checkBlock(player,c4)){check = true;}
            if (!checkBlock(player,c5)){check = true;}
            if (!checkBlock(player,c6)){check = true;}   
           
           
        }else if(main.getF(player)==2 || main.getF(player)==-2){ //Facing North
            Block c6 = world.getBlockAt(x, y, z);
            Block c1 = world.getBlockAt(x + 5, y, z);
            Block c2 = world.getBlockAt(x - 5, y, z);
            Block c3 = world.getBlockAt(x, y, z - 11);
            Block c4 = world.getBlockAt(x + 5, y, z - 11);
            Block c5 = world.getBlockAt(x - 5, y, z - 11);
       
            if (!checkBlock(player,c1)){check = true;}
            if (!checkBlock(player,c2)){check = true;}
            if (!checkBlock(player,c3)){check = true;}
            if (!checkBlock(player,c4)){check = true;}
            if (!checkBlock(player,c5)){check = true;}
            if (!checkBlock(player,c6)){check = true;}   
           
           
        }else if(main.getF(player)==3 || main.getF(player)==-1){ //Facing East
          Block c6 = world.getBlockAt(x, y, z);
          Block c1 = world.getBlockAt(x + 11, y, z);
          Block c2 = world.getBlockAt(x, y, z + 5);
          Block c3 = world.getBlockAt(x, y, z - 5);
          Block c4 = world.getBlockAt(x + 11, y, z + 5);
          Block c5 = world.getBlockAt(x + 11, y, z - 5);
   
          if (!checkBlock(player,c1)){check = true;}
          if (!checkBlock(player,c2)){check = true;}
          if (!checkBlock(player,c3)){check = true;}
          if (!checkBlock(player,c4)){check = true;}
          if (!checkBlock(player,c5)){check = true;}
          if (!checkBlock(player,c6)){check = true;}
           
           
        }else if(main.getF(player)==4 || main.getF(player)==0 || main.getF(player)==-4){
            Block c6 = world.getBlockAt(x, y, z);
            Block c1 = world.getBlockAt(x + 5, y, z);
            Block c2 = world.getBlockAt(x - 5, y, z);
            Block c3 = world.getBlockAt(x, y, z + 11);
            Block c4 = world.getBlockAt(x + 5, y, z + 11);
            Block c5 = world.getBlockAt(x - 5, y, z + 11);
       
            if (!checkBlock(player,c1)){check = true;}
            if (!checkBlock(player,c2)){check = true;}
            if (!checkBlock(player,c3)){check = true;}
            if (!checkBlock(player,c4)){check = true;}
            if (!checkBlock(player,c5)){check = true;}
            if (!checkBlock(player,c6)){check = true;}       
           
        }
       
        if (check) {
           
            event.setCancelled(true);
            String player2 = event.getPlayer().getName();
            player.sendMessage(ChatColor.GOLD + "[BedcraftGP] " + ChatColor.RED + "Your Quarry would break blocks in a claim!");
        }
        }
        }
main class:
Code:
      public static int getF(Player player) {
            double d = (player.getLocation().getYaw() * 4.0F / 360.0F) + 0.5D;
            int i = (int) d;
            return d < i ? i - 1 : i;
        }
Basically it retrieves the player's F value(which can be seen in the client debug menu) and checks the direction in which they are looking to see if it would bypass protection. This code is still in the works and I plan to try to shorten it and make it more compact and I am still testing it, but I believe it will do.
 

darkdeath1332

New Member
Jul 29, 2019
102
0
0
BlockPlace Class:
Code:
if (block.getTypeId() == 516 ){
         
        int y = block.getY();
        int x = block.getX();
        int z = block.getZ();
        World world = block.getWorld();
        boolean check = false;
        if(main.getF(player)==1 || main.getF(player)==-3){ //Facing West
            Block c6 = world.getBlockAt(x, y, z);
            Block c1 = world.getBlockAt(x - 11, y, z);
            Block c2 = world.getBlockAt(x, y, z + 5);
            Block c3 = world.getBlockAt(x, y, z - 5);
            Block c4 = world.getBlockAt(x - 11, y, z + 5);
            Block c5 = world.getBlockAt(x - 11, y, z - 5);
         
            if (!checkBlock(player,c1)){check = true;}
            if (!checkBlock(player,c2)){check = true;}
            if (!checkBlock(player,c3)){check = true;}
            if (!checkBlock(player,c4)){check = true;}
            if (!checkBlock(player,c5)){check = true;}
            if (!checkBlock(player,c6)){check = true;} 
         
         
        }else if(main.getF(player)==2 || main.getF(player)==-2){ //Facing North
            Block c6 = world.getBlockAt(x, y, z);
            Block c1 = world.getBlockAt(x + 5, y, z);
            Block c2 = world.getBlockAt(x - 5, y, z);
            Block c3 = world.getBlockAt(x, y, z - 11);
            Block c4 = world.getBlockAt(x + 5, y, z - 11);
            Block c5 = world.getBlockAt(x - 5, y, z - 11);
     
            if (!checkBlock(player,c1)){check = true;}
            if (!checkBlock(player,c2)){check = true;}
            if (!checkBlock(player,c3)){check = true;}
            if (!checkBlock(player,c4)){check = true;}
            if (!checkBlock(player,c5)){check = true;}
            if (!checkBlock(player,c6)){check = true;} 
         
         
        }else if(main.getF(player)==3 || main.getF(player)==-1){ //Facing East
          Block c6 = world.getBlockAt(x, y, z);
          Block c1 = world.getBlockAt(x + 11, y, z);
          Block c2 = world.getBlockAt(x, y, z + 5);
          Block c3 = world.getBlockAt(x, y, z - 5);
          Block c4 = world.getBlockAt(x + 11, y, z + 5);
          Block c5 = world.getBlockAt(x + 11, y, z - 5);
 
          if (!checkBlock(player,c1)){check = true;}
          if (!checkBlock(player,c2)){check = true;}
          if (!checkBlock(player,c3)){check = true;}
          if (!checkBlock(player,c4)){check = true;}
          if (!checkBlock(player,c5)){check = true;}
          if (!checkBlock(player,c6)){check = true;}
         
         
        }else if(main.getF(player)==4 || main.getF(player)==0 || main.getF(player)==-4){
            Block c6 = world.getBlockAt(x, y, z);
            Block c1 = world.getBlockAt(x + 5, y, z);
            Block c2 = world.getBlockAt(x - 5, y, z);
            Block c3 = world.getBlockAt(x, y, z + 11);
            Block c4 = world.getBlockAt(x + 5, y, z + 11);
            Block c5 = world.getBlockAt(x - 5, y, z + 11);
     
            if (!checkBlock(player,c1)){check = true;}
            if (!checkBlock(player,c2)){check = true;}
            if (!checkBlock(player,c3)){check = true;}
            if (!checkBlock(player,c4)){check = true;}
            if (!checkBlock(player,c5)){check = true;}
            if (!checkBlock(player,c6)){check = true;}     
         
        }
     
        if (check) {
         
            event.setCancelled(true);
            String player2 = event.getPlayer().getName();
            player.sendMessage(ChatColor.GOLD + "[BedcraftGP] " + ChatColor.RED + "Your Quarry would break blocks in a claim!");
        }
        }
        }
main class:
Code:
      public static int getF(Player player) {
            double d = (player.getLocation().getYaw() * 4.0F / 360.0F) + 0.5D;
            int i = (int) d;
            return d < i ? i - 1 : i;
        }
Basically it retrieves the player's F value(which can be seen in the client debug menu) and checks the direction in which they are looking to see if it would bypass protection. This code is still in the works and I plan to try to shorten it and make it more compact and I am still testing it, but I believe it will do.

You put 8 checks on the face check and then 6 on the range. My code is more lightweight then.

I just do 9 check on placement, you do 14.
 

wolfvuki

New Member
Jul 29, 2019
12
0
0
Great Plugin! I use it on my Feed the Beast Mindcrack Server.

Is there any chance that this could be editted as a minor fix for the XyCraft Fab Dupe?
Such as Detecting the Block and preventing certain items/blocks from being placed near it.
 

waddle1463

New Member
Jul 29, 2019
28
0
0
You put 8 checks on the face check and then 6 on the range. My code is more lightweight then.

I just do 9 check on placement, you do 14.
True true, but my code allows users to place their quarry inside their plot and quarry out the area right outside their plot. This allows them to protect their quarry without a plugin like LWC

Edit: this code is only called on the block place event when a user places a quarry. It doesn't get called very often.
 

darkdeath1332

New Member
Jul 29, 2019
102
0
0
Great Plugin! I use it on my Feed the Beast Mindcrack Server.

Is there any chance that this could be editted as a minor fix for the XyCraft Fab Dupe?
Such as Detecting the Block and preventing certain items/blocks from being placed near it.


Thats possible, what items should be blocked to be placed near it?[DOUBLEPOST=1374594294][/DOUBLEPOST]
True true, but my code allows users to place their quarry inside their plot and quarry out the area right outside their plot. This allows them to protect their quarry without a plugin like LWC

Edit: this code is only called on the block place event when a user places a quarry. It doesn't get called very often.

Unless people get mad they cant grief and spam placements :)