
Your code doesn't work as intended
MelanX opened this issue ยท 1 comments
This will make it impossible to set the player on fire. You should move line 159-165 under line 154 or put this above line 154.
Like this:
// 4 ticks is the same period of holding down right click
if (getLevel().getLevelData().getGameTime() - lastSieveAction < 4) {
// Really good chance that they're using a macro
if (player != null && getLevel().getLevelData().getGameTime() - lastSieveAction == 0 && lastPlayer.equals(player.getUUID())) {
player.setSecondsOnFire(1);
ITextComponent message = new StringTextComponent("Bad").setStyle(Style.EMPTY.withColor(Color.fromRgb(16711680)).withBold(true));
player.sendMessage(message, null);
}
return;
}
or this
// Really good chance that they're using a macro
if (player != null && getLevel().getLevelData().getGameTime() - lastSieveAction == 0 && lastPlayer.equals(player.getUUID())) {
player.setSecondsOnFire(1);
ITextComponent message = new StringTextComponent("Bad").setStyle(Style.EMPTY.withColor(Color.fromRgb(16711680)).withBold(true));
player.sendMessage(message, null);
}
// 4 ticks is the same period of holding down right click
if (getLevel().getLevelData().getGameTime() - lastSieveAction < 4) {
return;
}
Personally, I prefer solution one.