调整接口
This commit is contained in:
parent
944faf99e3
commit
51dd923b5e
2 changed files with 8 additions and 8 deletions
|
@ -41,6 +41,7 @@ import static com.atsuishio.superbwarfare.event.ClientEventHandler.drawTime;
|
|||
public class ClickHandler {
|
||||
|
||||
public static boolean switchZoom = false;
|
||||
|
||||
private static boolean notInGame() {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
if (mc.player == null) return true;
|
||||
|
@ -93,7 +94,7 @@ public class ClickHandler {
|
|||
if (player.getMainHandItem().is(ModTags.Items.GUN)
|
||||
|| stack.is(ModItems.MONITOR.get())
|
||||
|| player.hasEffect(ModMobEffects.SHOCK.get())
|
||||
|| (player.getVehicle() != null && (player.getVehicle() instanceof ICannonEntity || player.getVehicle() instanceof IVehicleEntity))) {
|
||||
|| (player.getVehicle() != null && player.getVehicle() instanceof IVehicleEntity)) {
|
||||
if (button == GLFW.GLFW_MOUSE_BUTTON_LEFT) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
|
@ -158,8 +159,7 @@ public class ClickHandler {
|
|||
var tag = stack.getOrCreateTag();
|
||||
if (tag.getBoolean("CanSwitchScope")) {
|
||||
ModUtils.PACKET_HANDLER.sendToServer(new SwitchScopeMessage(scroll));
|
||||
}
|
||||
else if (tag.getBoolean("CanAdjustZoomFov") || stack.is(ModItems.MINIGUN.get())) {
|
||||
} else if (tag.getBoolean("CanAdjustZoomFov") || stack.is(ModItems.MINIGUN.get())) {
|
||||
ModUtils.PACKET_HANDLER.sendToServer(new AdjustZoomFovMessage(scroll));
|
||||
}
|
||||
event.setCanceled(true);
|
||||
|
|
|
@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.entity;
|
|||
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
public interface ICannonEntity {
|
||||
public interface ICannonEntity extends IVehicleEntity {
|
||||
|
||||
void cannonShoot(Player player);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue