Advertisement
funkemunky

Shitty Scaffold Check v2

Aug 16th, 2018
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. package cc.funkemunky.fiona.detections.world.scaffold.detections;
  2.  
  3. import cc.funkemunky.fiona.data.PlayerData;
  4. import cc.funkemunky.fiona.detections.Check;
  5. import cc.funkemunky.fiona.detections.Detection;
  6. import cc.funkemunky.fiona.events.custom.PacketRecieveEvent;
  7. import cc.funkemunky.fiona.utils.FionaLocation;
  8. import cc.funkemunky.fiona.utils.MathUtils;
  9. import com.ngxdev.tinyprotocol.api.Packet;
  10. import com.ngxdev.tinyprotocol.packet.in.WrappedInBlockPlacePacket;
  11. import org.bukkit.event.Event;
  12. import org.bukkit.event.block.BlockPlaceEvent;
  13.  
  14. public class Top extends Detection {
  15.  
  16. public Top(Check parentCheck, String id, boolean enabled, boolean executable) {
  17. super(parentCheck, id, enabled, executable);
  18. }
  19. @Override
  20. public void onBukkitEvent(Event event, PlayerData data) {
  21. if(event instanceof BlockPlaceEvent) {
  22. BlockPlaceEvent e = (BlockPlaceEvent) event;
  23.  
  24. if(data.generalCancel
  25. || e.getPlayer().getLocation().getBlockY() <= e.getBlockPlaced().getY()
  26. || e.getPlayer().isSneaking()
  27. || data.deltaXZ == 0
  28. || !data.onGround) {
  29. return;
  30. }
  31.  
  32. if(e.getPlayer().getLocation().clone().subtract(0,1,0).getBlock().getType().isSolid()
  33. && !e.getPlayer().getLocation().clone().subtract(0,2,0).getBlock().getType().isSolid()) {
  34. if(data.scaffoldTopVerbose.flag(3, 1000L)) {
  35. flag(data, "t: air", 1, true);
  36. }
  37. flag(data, "test", 1, true);
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement