Skip to content

Commit

Permalink
remove Object.requireNonNull
Browse files Browse the repository at this point in the history
  • Loading branch information
C10udburst committed Apr 16, 2022
1 parent 8d155e2 commit 7f7faf6
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/main/java/widecat/meteorcrashaddon/modules/BoatCrash.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import net.minecraft.network.packet.c2s.play.BoatPaddleStateC2SPacket;
import widecat.meteorcrashaddon.CrashAddon;

import java.util.Objects;

public class BoatCrash extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import net.minecraft.util.math.Vec3d;
import widecat.meteorcrashaddon.CrashAddon;

import java.util.Objects;

public class EntityCrash extends Module {
private final SettingGroup sgGeneral = settings.getDefaultGroup();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@
import net.minecraft.screen.slot.SlotActionType;
import widecat.meteorcrashaddon.CrashAddon;

import java.util.Objects;

public class LecternCrash extends Module {

public LecternCrash() { super(CrashAddon.CATEGORY, "Lectern-Crash", "Sends a funny packet when you open a lectern"); }

@EventHandler
private void onOpenScreenEvent(OpenScreenEvent event) {
if (!(event.screen instanceof LecternScreen)) return;
if (!(event.screen instanceof LecternScreen) || mc.getNetworkHandler() == null) return;
ClickSlotC2SPacket PACKET = new ClickSlotC2SPacket(mc.player.currentScreenHandler.syncId, mc.player.currentScreenHandler.getRevision(), 0, 0, SlotActionType.QUICK_MOVE, mc.player.currentScreenHandler.getCursorStack().copy(), Int2ObjectMaps.emptyMap());
Objects.requireNonNull(mc.getNetworkHandler()).sendPacket(PACKET);
mc.getNetworkHandler().sendPacket(PACKET);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3d;
import java.util.Objects;
import java.util.Random;

public class NoComCrash extends Module {
Expand All @@ -38,10 +37,11 @@ private Vec3d pickRandomPos() {

@EventHandler
private void onTick(TickEvent.Post event) {
if (mc.getNetworkHandler() == null) return;
for (int i = 0; i < amount.get(); i++) {
Vec3d cpos = pickRandomPos();
PlayerInteractBlockC2SPacket PACKET = new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(cpos, Direction.DOWN, new BlockPos(cpos), false));
Objects.requireNonNull(mc.getNetworkHandler()).sendPacket(PACKET);
mc.getNetworkHandler().sendPacket(PACKET);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import net.minecraft.network.packet.c2s.play.UpdateSignC2SPacket;
import widecat.meteorcrashaddon.CrashAddon;

import java.util.Objects;
import java.util.Random;

public class SignCrash extends Module {
Expand Down

0 comments on commit 7f7faf6

Please sign in to comment.