net.minecraft.network.play.client.C07PacketPlayerDigging Java Examples

The following examples show how to use net.minecraft.network.play.client.C07PacketPlayerDigging. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FastEat.java    From ehacks-pro with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void onTicks() {
    if (this.isActive() && Mouse.getEventButton() == 1 && Mouse.isButtonDown(1)) {
        if (this.mode == 1) {
            int[] ignoredBlockIds = new int[]{23, 25, 26, 54, 58, 61, 62, 64, 69, 71, 77, 84, 92, 96, 107, 116, 117, 118, 120, 130, 137, 143, 145, 146, 149, 150, 154, 158};
            for (int id : ignoredBlockIds) {
                if (Block.getIdFromBlock(Wrapper.INSTANCE.world().getBlock(Wrapper.INSTANCE.mc().objectMouseOver.blockX, Wrapper.INSTANCE.mc().objectMouseOver.blockY, Wrapper.INSTANCE.mc().objectMouseOver.blockZ)) != id) {
                    continue;
                }
                return;
            }
        }
        if (Wrapper.INSTANCE.player().inventory.getCurrentItem() == null) {
            return;
        }
        Item item = Wrapper.INSTANCE.player().inventory.getCurrentItem().getItem();
        if (Wrapper.INSTANCE.player().onGround && (item instanceof ItemFood || item instanceof ItemPotion) && (Wrapper.INSTANCE.player().getFoodStats().needFood() || item instanceof ItemPotion || item instanceof ItemAppleGold)) {
            Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C09PacketHeldItemChange(Wrapper.INSTANCE.player().inventory.currentItem));
            for (int i = 0; i < 1000; ++i) {
                Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C03PacketPlayer(false));
            }
            Wrapper.INSTANCE.player().sendQueue.addToSendQueue(new C07PacketPlayerDigging(5, 0, 0, 0, 255));
        }
    }
}
 
Example #2
Source File: FakeNetServerHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void processPlayerDigging(C07PacketPlayerDigging p_147345_1_) {
}