Ex Nihilo: Sequentia

Ex Nihilo: Sequentia

9M Downloads

Your code doesn't work as intended

MelanX opened this issue ยท 1 comments

commented

https://github.com/NovaMachina-Mods/ExNihiloSequentia/blob/1.16/src/main/java/novamachina/exnihilosequentia/common/tileentity/SieveTile.java#L153-L165

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.

commented

Yeah, I realized this and never went back and fixed it. I'll probably do that now. Thanks.