Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set-back handling: * Make the VehicleSetBack a class in the moving package. * For set-backs use the debug flag from the time of checking. Debugging: * Alter debug output for moves slightly (differing locations). * Add debug output for vehicle moves with players involved. Note on 1.6: * Not even PlayerMove is fired for pigs and horses, so no tracking.
- Loading branch information
Showing
6 changed files
with
207 additions
and
48 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
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
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
41 changes: 41 additions & 0 deletions
41
NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/moving/VehicleSetBack.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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package fr.neatmonster.nocheatplus.checks.moving; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.entity.Entity; | ||
import org.bukkit.entity.Player; | ||
|
||
import fr.neatmonster.nocheatplus.logging.LogUtil; | ||
import fr.neatmonster.nocheatplus.utilities.TeleportUtil; | ||
|
||
/** | ||
* Task for scheduling a vehicle set back. Resets the morePacketsVehicleTaskId in the MovingData for the player. | ||
* @author mc_dev | ||
* | ||
*/ | ||
public class VehicleSetBack implements Runnable{ | ||
private final Entity vehicle; | ||
private final Player player; | ||
private final Location location; | ||
private final boolean debug; | ||
|
||
public VehicleSetBack(Entity vehicle, Player player, Location location, boolean debug) { | ||
this.vehicle = vehicle; | ||
this.player = player; | ||
this.location = location; | ||
this.debug = debug; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
final MovingData data = MovingData.getData(player); | ||
data.morePacketsVehicleTaskId = -1; | ||
try{ | ||
data.setTeleported(location); | ||
TeleportUtil.teleport(vehicle, player, location, debug); | ||
} | ||
catch(Throwable t){ | ||
LogUtil.logSevere(t); | ||
} | ||
} | ||
|
||
} |
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
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