-
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.
- Loading branch information
Showing
47 changed files
with
427 additions
and
311 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
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
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,17 @@ | ||
package cn.enaium.vac.mixin; | ||
|
||
import net.minecraft.world.World; | ||
import net.minecraft.world.chunk.BlockEntityTickInvoker; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Accessor; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Enaium | ||
*/ | ||
@Mixin(World.class) | ||
public interface IWorldMixin { | ||
@Accessor | ||
List<BlockEntityTickInvoker> getBlockEntityTickers(); | ||
} |
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
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
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
39 changes: 39 additions & 0 deletions
39
src/main/kotlin/cn/enaium/vac/client/module/player/AutoTool.kt
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,39 @@ | ||
package cn.enaium.vac.client.module.player | ||
|
||
import cn.enaium.cf4m.annotation.Event | ||
import cn.enaium.cf4m.annotation.module.Module | ||
import cn.enaium.vac.client.event.BlockBreakingProgressEvent | ||
import cn.enaium.vac.client.mc | ||
import cn.enaium.vac.client.module.PLAYER | ||
import cn.enaium.vac.client.util.BlockUtil | ||
import net.minecraft.item.ItemStack | ||
|
||
|
||
/** | ||
* @author Enaium | ||
*/ | ||
@Module("AutoTool", description = "Auto select tool", type = PLAYER) | ||
class AutoTool { | ||
@Event | ||
fun onBreaking(breakingProgressEvent: BlockBreakingProgressEvent) { | ||
|
||
if (mc.player!!.abilities.creativeMode) return | ||
|
||
if (mc.player!!.isBlockBreakingRestricted( | ||
mc.world, | ||
breakingProgressEvent.pos, | ||
mc.interactionManager!!.currentGameMode | ||
) | ||
) return | ||
|
||
for (i in 0..8) { | ||
val stack = mc.player!!.inventory.getStack(i) | ||
|
||
val speed = stack.getMiningSpeedMultiplier(BlockUtil.getState(breakingProgressEvent.pos)) | ||
|
||
if (speed > mc.player!!.mainHandStack.getMiningSpeedMultiplier(BlockUtil.getState(breakingProgressEvent.pos))) { | ||
mc.player!!.inventory.selectedSlot = i | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.