Merge pull request #27 from zeroeightysix/fix-tpssync

Fix tpssync
This commit is contained in:
Ridan Vandenbergh 2018-10-03 16:56:28 +02:00 committed by GitHub
commit d17b27a942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

View File

@ -0,0 +1,25 @@
package me.zeroeightsix.kami.mixin.client;
import me.zeroeightsix.kami.module.modules.player.TpsSync;
import me.zeroeightsix.kami.util.LagCompensator;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.multiplayer.PlayerControllerMP;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
/**
* Created by 086 on 3/10/2018.
*/
@Mixin(PlayerControllerMP.class)
public class MixinPlayerControllerMP {
@Redirect(method = "onPlayerDamageBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/state/IBlockState;getPlayerRelativeBlockHardness(Lnet/minecraft/entity/player/EntityPlayer;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)F"))
float getPlayerRelativeBlockHardness(IBlockState state, EntityPlayer player, World worldIn, BlockPos pos) {
return state.getPlayerRelativeBlockHardness(player, worldIn, pos) * (TpsSync.isSync() ? (LagCompensator.INSTANCE.getTickRate() / 20f) : 1);
}
}

View File

@ -20,6 +20,7 @@
"MixinGuiPlayerTabOverlay",
"MixinC00Handshake",
"MixinNetHandlerPlayClient",
"MixinRenderLiving"
"MixinRenderLiving",
"MixinPlayerControllerMP"
]
}