elBukkit / PreciousStones

Self-service protection for Minecraft servers
http://dev.bukkit.org/server-mods/preciousstones/
10 stars 10 forks source link

Two new flags added... #119

Closed xGlenor closed 3 years ago

xGlenor commented 3 years ago

Hello, since I have been using this plugin for 5 years, I decided that sometimes I can help with something.

I would like to propose two new flags that will allow us to secure water mobs and secure traffic, among others wagons.

Added flags: PROTECT_WATERMOBS PREVENT_VEHICLE_MOVE

Added Event VehicleEntityCollisionEvent in PSVehicleListener.java file

Don't take into account the name of my first update: "Added new flag Prevent_Vehicle_Event ..." I made a flag mistake, I wrote Event instead of Move

I think that the flags I added may be useful to someone

xtomyserrax commented 3 years ago

Hey, how are you? Help is more than welcome so thanks for taking your time on this project.

Have you tested the code?

So about PREVENT_VEHICLE_MOVE, what is the main goal of that flag? Because from what I read in the code, that flag will prevent a vehicle from colliding with a Player. getEntity returns the entity which the vehicle collided with.

About PROTECT_WATERMOBS I checked the code and it seems perfect, so thanks, its a cool idea.

Please remember to document this two new flags here: https://github.com/marcelo-mason/PreciousStones/wiki/Flag-Reference

Thanks for everything!

xGlenor commented 3 years ago

I once reported a bug where people were being robbed using a minecart with hopper. The problem is that the player has the option to push such a cart onto someone else's field. Which allows the player to steal items from chests. The flag I created prevents collisions so I think it might fix the problem.

Let me add that my programming skills are very basic, so there are definitely things that will be difficult for me to understand

I tested the code. The code I wrote prevents my expectations, so I guess it's okay. In case of problems, I can fix it at any time

edit>>> I will add flags to the file in my free time

xtomyserrax commented 3 years ago

Could we change the name to PREVENT_VEHICLE_PUSH instead of MOVE? Now I understand the idea of this flag!

Also if you want I think the variable vehicle can be removed because its not used.

Thanks mate

xGlenor commented 3 years ago

Changing the name of the flag will be a good idea. I think the variable will also be removed. I'm busy studying right now so I can't make any changes in a few hours. If I have time, I will update

xtomyserrax commented 3 years ago

Ill merge as everything seems to be fine. Thanks for your work and time and please remember to document so others can easily find these new flags you added!

xGlenor commented 3 years ago

Hi, edited the file with all the flags. Everything should be fine.