Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* */ package me.blackhawklex.blackarrowtorching.listeners;
- /* */
- /* */ import java.util.ArrayList;
- /* */ import java.util.List;
- /* */ import me.blackhawklex.blackarrowtorching.BlackArrowTorching;
- /* */ import org.bukkit.Location;
- /* */ import org.bukkit.World;
- /* */ import org.bukkit.block.Block;
- /* */ import org.bukkit.entity.Arrow;
- /* */ import org.bukkit.entity.Entity;
- /* */ import org.bukkit.event.entity.EntityListener;
- /* */ import org.bukkit.event.entity.ProjectileHitEvent;
- /* */
- /* */ public class Listener_Entity extends EntityListener
- /* */ {
- /* */ private BlackArrowTorching plugin;
- /* */
- /* */ public Listener_Entity(BlackArrowTorching plugin)
- /* */ {
- /* 35 */ this.plugin = plugin;
- /* */ }
- /* */
- /* */ public void onProjectileHit(ProjectileHitEvent event)
- /* */ {
- /* 40 */ if (event.getEntity() instanceof Arrow) {
- /* 41 */ Arrow arrow = (Arrow)event.getEntity();
- /* 42 */ Location arrowLoc = arrow.getLocation();
- /* 43 */ World world = event.getEntity().getWorld();
- /* 44 */ Block block = world.getBlockAt(arrowLoc);
- /* 45 */ List blockList = new ArrayList();
- /* 46 */ for (int i = -1; i < 1; ++i) {
- /* 47 */ int x = arrowLoc.getBlockX() - i;
- /* 48 */ for (int j = -1; j < 1; ++j) {
- /* 49 */ int y = arrowLoc.getBlockY() - j;
- /* 50 */ for (int k = -1; k < 1; ++k) {
- /* 51 */ int z = arrowLoc.getBlockZ() - k;
- /* 52 */ Block blockToBeAdded = world.getBlockAt(x, y, z);
- /* 53 */ blockList.add(blockToBeAdded);
- /* */ }
- /* */ }
- /* */ }
- /* 57 */ blockList.add(block);
- /* */
- /* 59 */ for (Block b : blockList)
- /* 60 */ if (b.getTypeId() == 50)
- /* */ {
- /* 62 */ event.getEntity().getWorld().getBlockAt(b.getLocation()).setTypeId(0);
- /* */ }
- /* */ }
- /* */ }
- /* */ }
- /* Location: C:\Ali\Java\Plugins\BlackArrowTorching.jar
- * Qualified Name: me.blackhawklex.blackarrowtorching.listeners.Listener_Entity
- * Java Class Version: 6 (50.0)
- * JD-Core Version: 0.5.3
- */
Add Comment
Please, Sign In to add comment