-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reeling in a catch will move the players look direction slightly thus canceling out auto fishing clients/machines
- Loading branch information
1 parent
21f53c1
commit a3d6fdd
Showing
2 changed files
with
15 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 13 additions & 13 deletions
26
src/main/java/com/julianbooleanlau/antifishing/FishingListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
package com.julianbooleanlau.antifishing; | ||
|
||
import org.bukkit.Bukkit; | ||
import org.bukkit.ChatColor; | ||
import org.bukkit.Location; | ||
import org.bukkit.Material; | ||
import org.bukkit.entity.Player; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.block.BlockPlaceEvent; | ||
import org.bukkit.event.player.PlayerFishEvent; | ||
import java.util.Random; | ||
|
||
public class FishingListener implements Listener { | ||
|
||
@EventHandler | ||
public void onFishReel(PlayerFishEvent event) { | ||
public void onFish(PlayerFishEvent event) { | ||
if (event.getCaught() != null) { | ||
Player player = event.getPlayer(); | ||
player.sendMessage("Fishing!"); | ||
player.giveExp(100); | ||
} | ||
} | ||
//player.sendMessage("Nice Catch!"); | ||
|
||
Location location = player.getLocation(); | ||
location.setYaw(location.getYaw() + 2.0f); | ||
location.setPitch(location.getPitch() + 2.0f); | ||
|
||
@EventHandler | ||
public void onBlockPlace(BlockPlaceEvent event) { | ||
Material type = event.getBlock().getType(); | ||
if (type == Material.TORCH) { | ||
Player player = event.getPlayer(); | ||
player.sendMessage("Hello there"); | ||
//player.sendMessage("Yaw: " + location.getYaw() + 10.0f); | ||
//player.sendMessage("Yaw: " + location.getPitch() + 10.0f); | ||
|
||
player.teleport(location); | ||
} | ||
} | ||
|
||
} |