重构载具相关文件结构

This commit is contained in:
Light_Quanta 2025-03-05 02:31:42 +08:00
parent 296f8d30e6
commit f722c6a90c
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
65 changed files with 304 additions and 172 deletions

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.block;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.registries.Registries;

View file

@ -1,7 +1,7 @@
package com.atsuishio.superbwarfare.block;
import com.atsuishio.superbwarfare.entity.TargetEntity;
import com.atsuishio.superbwarfare.entity.vehicle.ICannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.network.ModVariables;
import net.minecraft.core.BlockPos;
@ -99,7 +99,7 @@ public class JumpPadBlock extends Block {
super.entityInside(blockstate, level, pos, entity);
// 禁止套娃
if (entity instanceof TargetEntity || entity instanceof ICannonEntity) return;
if (entity instanceof TargetEntity || entity instanceof CannonEntity) return;
if (entity.isShiftKeyDown()) {
if (entity.onGround()) {

View file

@ -5,7 +5,7 @@ import com.atsuishio.superbwarfare.compat.CompatHolder;
import com.atsuishio.superbwarfare.compat.clothconfig.ClothConfigHelper;
import com.atsuishio.superbwarfare.config.client.ReloadConfig;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.*;
import com.atsuishio.superbwarfare.entity.vehicle.base.*;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.gun.GunItem;
@ -94,7 +94,7 @@ public class ClickHandler {
int button = event.getButton();
if (stack.is(ModTags.Items.GUN) || stack.is(ModItems.MONITOR.get()) || stack.is(ModItems.LUNGE_MINE.get()) || player.hasEffect(ModMobEffects.SHOCK.get())
|| (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))) {
|| (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))) {
if (button == GLFW.GLFW_MOUSE_BUTTON_LEFT) {
event.setCanceled(true);
}
@ -106,7 +106,7 @@ public class ClickHandler {
if (button == GLFW.GLFW_MOUSE_BUTTON_RIGHT) {
if (stack.is(ModTags.Items.GUN)
|| (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && !stack.getItem().isEdible())) {
|| (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && !stack.getItem().isEdible())) {
event.setCanceled(true);
}
}
@ -120,7 +120,7 @@ public class ClickHandler {
if (stack.is(ModTags.Items.GUN)
|| stack.is(ModItems.MONITOR.get())
|| stack.is(ModItems.LUNGE_MINE.get())
|| (player.getVehicle() instanceof IArmedVehicleEntity iVehicle && iVehicle.isDriver(player))
|| (player.getVehicle() instanceof ArmedVehicleEntity iVehicle && iVehicle.isDriver(player))
|| (stack.is(Items.SPYGLASS) && player.isScoping() && player.getOffhandItem().is(ModItems.FIRING_PARAMETERS.get()))) {
if (button == ModKeyMappings.FIRE.getKey().getValue()) {
handleWeaponFirePress(player, stack);
@ -266,7 +266,7 @@ public class ClickHandler {
if (stack.is(ModTags.Items.GUN)
|| stack.is(ModItems.MONITOR.get())
|| (player.getVehicle() instanceof IArmedVehicleEntity iVehicle && iVehicle.isDriver(player))
|| (player.getVehicle() instanceof ArmedVehicleEntity iVehicle && iVehicle.isDriver(player))
|| (stack.is(Items.SPYGLASS) && player.isScoping() && player.getOffhandItem().is(ModItems.FIRING_PARAMETERS.get()))) {
if (key == ModKeyMappings.FIRE.getKey().getValue()) {
handleWeaponFirePress(player, stack);
@ -334,7 +334,7 @@ public class ClickHandler {
}
if (player.getVehicle() instanceof IArmedVehicleEntity iVehicle && iVehicle.banHand(player)) {
if (player.getVehicle() instanceof ArmedVehicleEntity iVehicle && iVehicle.banHand(player)) {
if (iVehicle.isDriver(player)) {
ClientEventHandler.holdFireVehicle = true;
}
@ -345,7 +345,7 @@ public class ClickHandler {
ClientEventHandler.holdFire = true;
}
if (stack.getItem() instanceof GunItem gunItem && !(player.getVehicle() != null && player.getVehicle() instanceof ICannonEntity)) {
if (stack.getItem() instanceof GunItem gunItem && !(player.getVehicle() != null && player.getVehicle() instanceof CannonEntity)) {
if ((!(stack.getOrCreateTag().getBoolean("is_normal_reloading") || stack.getOrCreateTag().getBoolean("is_empty_reloading"))
&& !GunsTool.getGunBooleanTag(stack, "Reloading")
&& !GunsTool.getGunBooleanTag(stack, "Charging")
@ -382,7 +382,7 @@ public class ClickHandler {
public static void handleWeaponZoomPress(Player player, ItemStack stack) {
ModUtils.PACKET_HANDLER.sendToServer(new ZoomMessage(0));
if (player.getVehicle() instanceof IArmedVehicleEntity iVehicle && iVehicle.banHand(player)) {
if (player.getVehicle() instanceof ArmedVehicleEntity iVehicle && iVehicle.banHand(player)) {
if (iVehicle.isDriver(player)) {
ClientEventHandler.zoomVehicle = true;
}

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.client.model.entity;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModTags;
@ -31,7 +31,7 @@ public class ProjectileEntityModel extends GeoModel<ProjectileEntity> {
|| player.getMainHandItem().is(ModItems.GLOCK_17.get())
|| player.getMainHandItem().is(ModItems.GLOCK_18.get())
|| player.getMainHandItem().is(ModItems.BOCEK.get())
|| (player.getVehicle() instanceof IArmedVehicleEntity iVehicle && iVehicle.isDriver(player) && !player.getMainHandItem().is(ModTags.Items.GUN))) {
|| (player.getVehicle() instanceof ArmedVehicleEntity iVehicle && iVehicle.isDriver(player) && !player.getMainHandItem().is(ModTags.Items.GUN))) {
return ModUtils.loc("geo/projectile_entity.geo.json");
} else {
return ModUtils.loc("geo/projectile_entity2.geo.json");

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.vehicle.AnnihilatorEntity;
import com.atsuishio.superbwarfare.entity.vehicle.ICannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.tools.FormatTool;
import com.atsuishio.superbwarfare.tools.TraceTool;
@ -127,6 +127,6 @@ public class CannonHudOverlay {
private static boolean shouldRenderCrossHair(Player player) {
if (player == null) return false;
return !player.isSpectator()
&& (player.getVehicle() != null && (player.getVehicle() instanceof ICannonEntity));
&& (player.getVehicle() != null && (player.getVehicle() instanceof CannonEntity));
}
}

View file

@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.client.DisplayConfig;
import com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModTags;
@ -57,7 +57,8 @@ public class CrossHairOverlay {
if (player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).edit)
return;
if (!player.getMainHandItem().is(ModTags.Items.GUN) || (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))) return;
if (!player.getMainHandItem().is(ModTags.Items.GUN) || (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player)))
return;
GuiGraphics guiGraphics = event.getGuiGraphics();

View file

@ -1,8 +1,8 @@
package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.ICannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.network.ModVariables;
@ -30,7 +30,7 @@ public class GrenadeLauncherOverlay {
if (player != null && player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).edit)
return;
if (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
if (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
return;
if (!shouldRenderCrossHair(player)) return;
@ -60,7 +60,7 @@ public class GrenadeLauncherOverlay {
if (player == null) return false;
return !player.isSpectator()
&& (player.getMainHandItem().getItem() == ModItems.M_79.get() || player.getMainHandItem().getItem() == ModItems.SECONDARY_CATACLYSM.get())
&& (Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON || (player.isPassenger() && player.getVehicle() instanceof ICannonEntity))
&& (Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON || (player.isPassenger() && player.getVehicle() instanceof CannonEntity))
&& !ClientEventHandler.zoom;
}
}

View file

@ -2,7 +2,11 @@ package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.RenderHelper;
import com.atsuishio.superbwarfare.entity.vehicle.*;
import com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity;
import com.atsuishio.superbwarfare.entity.vehicle.base.HelicopterEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiWeaponVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.network.ModVariables;
@ -58,7 +62,7 @@ public class HelicopterHudOverlay {
if (player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).edit)
return;
if (player.getVehicle() instanceof IHelicopterEntity iHelicopterEntity && player.getVehicle() instanceof MobileVehicleEntity mobileVehicle && iHelicopterEntity.isDriver(player) && player.getVehicle() instanceof MultiWeaponVehicleEntity multiWeaponVehicle) {
if (player.getVehicle() instanceof HelicopterEntity iHelicopterEntity && player.getVehicle() instanceof MobileVehicleEntity mobileVehicle && iHelicopterEntity.isDriver(player) && player.getVehicle() instanceof MultiWeaponVehicleEntity multiWeaponVehicle) {
poseStack.pushPose();
poseStack.translate(-6 * ClientEventHandler.turnRot[1], -6 * ClientEventHandler.turnRot[0], 0);

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.RenderHelper;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.network.ModVariables;
@ -55,7 +55,8 @@ public class JavelinHudOverlay {
if (player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).edit)
return;
if (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player)) return;
if (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
return;
if ((stack.getItem() == ModItems.JAVELIN.get() && !stack.getOrCreateTag().getBoolean("HoloHidden")) && Minecraft.getInstance().options.getCameraType().isFirstPerson() && ClientEventHandler.zoom) {
RenderSystem.disableDepthTest();

View file

@ -2,8 +2,8 @@ package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.client.KillMessageConfig;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.event.KillMessageHandler;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModItems;
@ -178,7 +178,7 @@ public class KillMessageOverlay {
if (player != null && player.getVehicle() instanceof VehicleEntity vehicleEntity) {
// 载具图标
if ((vehicleEntity instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && iArmedVehicle.banHand(player)) || record.damageType == ModDamageTypes.VEHICLE_STRIKE) {
if ((vehicleEntity instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && iArmedVehicle.banHand(player)) || record.damageType == ModDamageTypes.VEHICLE_STRIKE) {
renderItem = true;
ResourceLocation resourceLocation = vehicleEntity.getVehicleIcon();

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.RenderHelper;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.tools.SeekTool;
import com.mojang.blaze3d.systems.RenderSystem;
@ -37,7 +37,7 @@ public class RedTriangleOverlay {
ItemStack stack = player.getMainHandItem();
if (!stack.is(ModItems.RPG.get())) return;
if (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
if (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
return;
Entity idf = SeekTool.seekLivingEntity(player, player.level(), 128, 6);

View file

@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.RenderHelper;
import com.atsuishio.superbwarfare.config.client.DisplayConfig;
import com.atsuishio.superbwarfare.entity.vehicle.*;
import com.atsuishio.superbwarfare.entity.vehicle.base.*;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.tools.FormatTool;
@ -95,7 +96,7 @@ public class VehicleHudOverlay {
}
poseStack.popPose();
if (vehicle instanceof IArmedVehicleEntity iVehicle && iVehicle.getAmmoCount(player) != -1 && iVehicle.isDriver(player)) {
if (vehicle instanceof ArmedVehicleEntity iVehicle && iVehicle.getAmmoCount(player) != -1 && iVehicle.isDriver(player)) {
boolean iCharge = iVehicle instanceof EnergyVehicleEntity;
// 渲染当前弹药量
@ -104,7 +105,7 @@ public class VehicleHudOverlay {
float v = h / 1.5f - (iCharge ? 42 : 29) / 1.5f;
if (player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))
&& !(iVehicle instanceof ICannonEntity
&& !(iVehicle instanceof CannonEntity
|| (iVehicle instanceof Ah6Entity ah6Entity && ah6Entity.getWeaponType(0) == 1))
) {
event.getGuiGraphics().drawString(
@ -146,11 +147,11 @@ public class VehicleHudOverlay {
return !player.isSpectator() && (player.getVehicle() != null && player.getVehicle() instanceof VehicleEntity);
}
private static String getVehicleAmmoType(ItemStack stack, IArmedVehicleEntity iVehicle) {
if (stack.getItem() == ModItems.AP_5_INCHES.get() && iVehicle instanceof ICannonEntity) {
private static String getVehicleAmmoType(ItemStack stack, ArmedVehicleEntity iVehicle) {
if (stack.getItem() == ModItems.AP_5_INCHES.get() && iVehicle instanceof CannonEntity) {
return Component.translatable("des.superbwarfare.tips.ammo_type.ap").getString();
}
if (stack.getItem() == ModItems.HE_5_INCHES.get() && iVehicle instanceof ICannonEntity) {
if (stack.getItem() == ModItems.HE_5_INCHES.get() && iVehicle instanceof CannonEntity) {
return Component.translatable("des.superbwarfare.tips.ammo_type.he").getString();
}
if (iVehicle instanceof SpeedboatEntity) {
@ -185,7 +186,7 @@ public class VehicleHudOverlay {
if (player == null) return;
if (player.getVehicle() instanceof ILandArmorEntity iLand && iLand.isDriver(player)
if (player.getVehicle() instanceof LandArmorEntity iLand && iLand.isDriver(player)
&& iLand instanceof MultiWeaponVehicleEntity multiWeaponVehicle
&& iLand instanceof MobileVehicleEntity mobileVehicle) {
poseStack.pushPose();

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.client.overlay;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.tools.FormatTool;
import com.atsuishio.superbwarfare.tools.TraceTool;
import com.mojang.blaze3d.vertex.PoseStack;

View file

@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.client.screens;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.block.entity.FuMO25BlockEntity;
import com.atsuishio.superbwarfare.client.RenderHelper;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.menu.FuMO25Menu;
import com.atsuishio.superbwarfare.network.message.RadarChangeModeMessage;
import com.atsuishio.superbwarfare.network.message.RadarSetParametersMessage;

View file

@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.compat.jade;
import com.atsuishio.superbwarfare.block.ContainerBlock;
import com.atsuishio.superbwarfare.compat.jade.providers.ContainerEntityProvider;
import com.atsuishio.superbwarfare.compat.jade.providers.VehicleHealthProvider;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import snownee.jade.api.IWailaClientRegistration;
import snownee.jade.api.IWailaCommonRegistration;
import snownee.jade.api.IWailaPlugin;

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.compat.jade.providers;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.compat.jade.elements.WrenchHealthElement;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import net.minecraft.resources.ResourceLocation;
import snownee.jade.api.EntityAccessor;
import snownee.jade.api.IEntityComponentProvider;

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.entity;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModItems;

View file

@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.entity;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.tools.CustomExplosion;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;

View file

@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.entity;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.gui.RangeHelper;
import com.atsuishio.superbwarfare.entity.projectile.MortarShellEntity;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModSounds;
@ -36,6 +36,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraftforge.items.ItemHandlerHelper;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PlayMessages;
import org.jetbrains.annotations.NotNull;
import org.joml.Math;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
@ -120,7 +121,7 @@ public class MortarEntity extends VehicleEntity implements GeoEntity, AnimatedEn
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
ItemStack stack = player.getMainHandItem();
if (stack.getItem() instanceof MortarShell shell && !player.isShiftKeyDown() && this.entityData.get(FIRE_TIME) == 0) {

View file

@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.entity.projectile;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.entity.AnimatedEntity;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ClientIndicatorMessage;
import com.atsuishio.superbwarfare.tools.ChunkLoadTool;

View file

@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.entity.projectile;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.entity.AnimatedEntity;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModItems;

View file

@ -4,7 +4,7 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.block.BarbedWireBlock;
import com.atsuishio.superbwarfare.entity.ICustomKnockback;
import com.atsuishio.superbwarfare.entity.TargetEntity;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.Transcript;
import com.atsuishio.superbwarfare.network.message.ClientIndicatorMessage;

View file

@ -6,6 +6,10 @@ import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity;
import com.atsuishio.superbwarfare.entity.projectile.HeliRocketEntity;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.HelicopterEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiSeatVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiWeaponVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
@ -61,7 +65,7 @@ import java.util.Objects;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity, IHelicopterEntity, MultiWeaponVehicleEntity, MultiSeatVehicleEntity {
public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity, HelicopterEntity, MultiWeaponVehicleEntity, MultiSeatVehicleEntity {
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public static final float MAX_HEALTH = VehicleConfig.AH_6_HP.get();
@ -667,7 +671,7 @@ public class Ah6Entity extends ContainerMobileVehicleEntity implements GeoEntity
}
@Override
public Vec3 getDismountLocationForPassenger(LivingEntity passenger) {
public @NotNull Vec3 getDismountLocationForPassenger(LivingEntity passenger) {
Vec3 vec3d = getDismountOffset(getBbWidth() * Mth.SQRT_OF_TWO, passenger.getBbWidth() * Mth.SQRT_OF_TWO);
double ox = getX() + vec3d.x;
int i = this.getOrderedPassengers().indexOf(passenger);

View file

@ -3,6 +3,8 @@ package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.EnergyVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
@ -41,6 +43,7 @@ import net.minecraftforge.event.ForgeEventFactory;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.network.PlayMessages;
import org.jetbrains.annotations.NotNull;
import org.joml.Math;
import org.joml.Vector3d;
import software.bernie.geckolib.animatable.GeoEntity;
@ -55,7 +58,7 @@ import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.Comparator;
import java.util.List;
public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, ICannonEntity {
public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, CannonEntity {
public static final EntityDataAccessor<Integer> COOL_DOWN = SynchedEntityData.defineId(AnnihilatorEntity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Float> LASER_LEFT_LENGTH = SynchedEntityData.defineId(AnnihilatorEntity.class, EntityDataSerializers.FLOAT);
@ -109,7 +112,7 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity,
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
ItemStack stack = player.getMainHandItem();
if (player.getMainHandItem().getItem() == ModItems.FIRING_PARAMETERS.get() && player.isCrouching()) {

View file

@ -6,6 +6,9 @@ import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.projectile.SmallCannonShellEntity;
import com.atsuishio.superbwarfare.entity.projectile.WgMissileEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.LandArmorEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiWeaponVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
@ -56,7 +59,7 @@ import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntity, ILandArmorEntity, MultiWeaponVehicleEntity {
public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntity, LandArmorEntity, MultiWeaponVehicleEntity {
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.FLOAT);

View file

@ -6,6 +6,7 @@ import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity;
import com.atsuishio.superbwarfare.entity.projectile.LaserEntity;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.projectile.RgoGrenadeEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModItems;
@ -287,7 +288,7 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
ItemStack stack = player.getMainHandItem();
if (stack.getItem() == ModItems.MONITOR.get()) {
if (!player.isCrouching()) {

View file

@ -1,22 +0,0 @@
package com.atsuishio.superbwarfare.entity.vehicle;
import net.minecraft.world.entity.player.Player;
public interface IArmedVehicleEntity {
void vehicleShoot(Player player);
boolean isDriver(Player player);
int mainGunRpm();
boolean canShoot(Player player);
int getAmmoCount(Player player);
boolean banHand(Player player);
boolean hidePassenger();
int zoomFov();
}

View file

@ -1,5 +0,0 @@
package com.atsuishio.superbwarfare.entity.vehicle;
public interface ICannonEntity extends IArmedVehicleEntity {
}

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.entity.TargetEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.EnergyVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.ContainerBlockItem;
@ -35,6 +36,7 @@ import net.minecraft.world.phys.HitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PlayMessages;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.joml.Math;
import software.bernie.geckolib.animatable.GeoEntity;
@ -166,7 +168,7 @@ public class LaserTowerEntity extends EnergyVehicleEntity implements GeoEntity,
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
ItemStack stack = player.getMainHandItem();
if (player.isCrouching()) {
if (stack.is(ModItems.CROWBAR.get()) && (getOwner() == null || player == getOwner())) {

View file

@ -5,6 +5,9 @@ import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.projectile.SmallCannonShellEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.LandArmorEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiWeaponVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
@ -58,7 +61,7 @@ import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEntity, ILandArmorEntity, MultiWeaponVehicleEntity {
public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEntity, LandArmorEntity, MultiWeaponVehicleEntity {
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(Lav150Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(Lav150Entity.class, EntityDataSerializers.FLOAT);

View file

@ -4,6 +4,8 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.CannonShellEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.common.ammo.CannonShellItem;
@ -37,6 +39,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.network.PlayMessages;
import org.jetbrains.annotations.NotNull;
import org.joml.Math;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
@ -50,7 +53,7 @@ import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.Comparator;
import java.util.List;
public class Mk42Entity extends VehicleEntity implements GeoEntity, ICannonEntity {
public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity {
public static final EntityDataAccessor<Integer> COOL_DOWN = SynchedEntityData.defineId(Mk42Entity.class, EntityDataSerializers.INT);
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
@ -91,7 +94,7 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, ICannonEntit
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
ItemStack stack = player.getMainHandItem();
if (player.getMainHandItem().getItem() == ModItems.FIRING_PARAMETERS.get() && player.isCrouching()) {

View file

@ -4,6 +4,8 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.CannonShellEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.common.ammo.CannonShellItem;
@ -37,6 +39,7 @@ import net.minecraft.world.phys.Vec3;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.network.PlayMessages;
import org.jetbrains.annotations.NotNull;
import org.joml.Math;
import org.joml.Vector3d;
import software.bernie.geckolib.animatable.GeoEntity;
@ -51,7 +54,7 @@ import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.Comparator;
import java.util.List;
public class Mle1934Entity extends VehicleEntity implements GeoEntity, ICannonEntity {
public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEntity {
public static final EntityDataAccessor<Integer> COOL_DOWN = SynchedEntityData.defineId(Mle1934Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> TYPE = SynchedEntityData.defineId(Mle1934Entity.class, EntityDataSerializers.INT);
@ -96,7 +99,7 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, ICannonEn
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
ItemStack stack = player.getMainHandItem();
if (player.getMainHandItem().getItem() == ModItems.FIRING_PARAMETERS.get() && player.isCrouching()) {

View file

@ -1,17 +0,0 @@
package com.atsuishio.superbwarfare.entity.vehicle;
import net.minecraft.world.entity.Entity;
import java.util.List;
public interface MultiSeatVehicleEntity {
List<Entity> getOrderedPassengers();
Entity getNthEntity(int index);
boolean changeSeat(Entity entity, int index);
int getSeatIndex(Entity entity);
int getSeatCount();
}

View file

@ -4,6 +4,8 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.ModVariables;
@ -49,7 +51,7 @@ import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class SpeedboatEntity extends ContainerMobileVehicleEntity implements GeoEntity, IArmedVehicleEntity {
public class SpeedboatEntity extends ContainerMobileVehicleEntity implements GeoEntity, ArmedVehicleEntity {
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(SpeedboatEntity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(SpeedboatEntity.class, EntityDataSerializers.FLOAT);

View file

@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModEntities;
@ -107,7 +108,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity {
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
if (player.getMainHandItem().is(Items.MELON) && !entityData.get(MELON)) {
entityData.set(MELON, true);
player.getMainHandItem().shrink(1);

View file

@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.entity.MortarEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModSounds;

View file

@ -4,6 +4,9 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.projectile.CannonShellEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.LandArmorEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiWeaponVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
@ -62,7 +65,7 @@ import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEntity, ILandArmorEntity, MultiWeaponVehicleEntity {
public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEntity, LandArmorEntity, MultiWeaponVehicleEntity {
public static final EntityDataAccessor<Integer> FIRE_ANIM = SynchedEntityData.defineId(Yx100Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Float> DELTA_ROT = SynchedEntityData.defineId(Yx100Entity.class, EntityDataSerializers.FLOAT);

View file

@ -1,6 +1,8 @@
package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModEntities;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.tools.AmmoType;
@ -21,12 +23,13 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PlayMessages;
import org.jetbrains.annotations.NotNull;
import software.bernie.geckolib.animatable.GeoEntity;
import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
import software.bernie.geckolib.core.animation.AnimatableManager;
import software.bernie.geckolib.util.GeckoLibUtil;
public class Yx100GunEntity extends VehicleEntity implements GeoEntity, ICannonEntity {
public class Yx100GunEntity extends VehicleEntity implements GeoEntity, CannonEntity {
public static final EntityDataAccessor<Integer> AMMO = SynchedEntityData.defineId(Yx100GunEntity.class, EntityDataSerializers.INT);
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
@ -56,7 +59,7 @@ public class Yx100GunEntity extends VehicleEntity implements GeoEntity, ICannonE
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
return super.interact(player, hand);
}

View file

@ -0,0 +1,66 @@
package com.atsuishio.superbwarfare.entity.vehicle.base;
import net.minecraft.world.entity.player.Player;
public interface ArmedVehicleEntity {
/**
* 载具开火
*
* @param player 玩家
*/
void vehicleShoot(Player player);
/**
* 判断指定玩家是否是载具驾驶员
*
* @param player 玩家
* @return 是否是驾驶员
*/
boolean isDriver(Player player);
/**
* 主武器射速
*
* @return 射速
*/
int mainGunRpm();
/**
* 当前情况载具是否可以开火
*
* @param player 玩家
* @return 是否可以开火
*/
boolean canShoot(Player player);
/**
* 获取当前选择的主武器的备弹数量
*
* @param player 玩家
* @return 备弹数量
*/
int getAmmoCount(Player player);
/**
* 是否隐藏玩家手臂
*
* @param player 玩家
* @return 是否隐藏
*/
boolean banHand(Player player);
/**
* 是否隐藏载具上的玩家
*
* @return 是否隐藏
*/
boolean hidePassenger();
/**
* 瞄准时的放大倍率
*
* @return 放大倍率
*/
int zoomFov();
}

View file

@ -0,0 +1,5 @@
package com.atsuishio.superbwarfare.entity.vehicle.base;
public interface CannonEntity extends ArmedVehicleEntity {
}

View file

@ -1,4 +1,4 @@
package com.atsuishio.superbwarfare.entity.vehicle;
package com.atsuishio.superbwarfare.entity.vehicle.base;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.menu.VehicleMenu;
@ -29,11 +29,11 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.joml.Math;
public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements HasCustomInventoryScreen, ContainerEntity {
public abstract class ContainerMobileVehicleEntity extends MobileVehicleEntity implements HasCustomInventoryScreen, ContainerEntity {
public static final int CONTAINER_SIZE = 102;
private NonNullList<ItemStack> items = NonNullList.withSize(CONTAINER_SIZE, ItemStack.EMPTY);
private final NonNullList<ItemStack> items = NonNullList.withSize(CONTAINER_SIZE, ItemStack.EMPTY);
private LazyOptional<?> itemHandler = LazyOptional.of(() -> new InvWrapper(this));
public ContainerMobileVehicleEntity(EntityType<?> pEntityType, Level pLevel) {
@ -58,7 +58,7 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
if (player.getVehicle() == this) return InteractionResult.PASS;
ItemStack stack = player.getMainHandItem();
@ -71,7 +71,7 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public void remove(RemovalReason pReason) {
public void remove(@NotNull RemovalReason pReason) {
if (!this.level().isClientSide && pReason != RemovalReason.DISCARDED) {
Containers.dropContents(this.level(), this, this);
}
@ -128,7 +128,7 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public NonNullList<ItemStack> getItemStacks() {
public @NotNull NonNullList<ItemStack> getItemStacks() {
return this.items;
}
@ -207,17 +207,17 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public ItemStack getItem(int pSlot) {
public @NotNull ItemStack getItem(int pSlot) {
return this.items.get(pSlot);
}
@Override
public ItemStack removeItem(int pSlot, int pAmount) {
public @NotNull ItemStack removeItem(int pSlot, int pAmount) {
return ContainerHelper.removeItem(this.items, pSlot, pAmount);
}
@Override
public ItemStack removeItemNoUpdate(int pSlot) {
public @NotNull ItemStack removeItemNoUpdate(int pSlot) {
ItemStack itemstack = this.getItemStacks().get(pSlot);
if (itemstack.isEmpty()) {
return ItemStack.EMPTY;
@ -228,7 +228,7 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public void setItem(int pSlot, ItemStack pStack) {
public void setItem(int pSlot, @NotNull ItemStack pStack) {
this.getItemStacks().set(pSlot, pStack);
if (!pStack.isEmpty() && pStack.getCount() > this.getMaxStackSize()) {
pStack.setCount(this.getMaxStackSize());
@ -240,7 +240,7 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public boolean stillValid(Player pPlayer) {
public boolean stillValid(@NotNull Player pPlayer) {
return !this.isRemoved() && this.position().closerThan(pPlayer.position(), 8.0D);
}
@ -260,7 +260,7 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing) {
public <T> @NotNull LazyOptional<T> getCapability(@NotNull Capability<T> capability, @Nullable Direction facing) {
if (this.isAlive() && capability == ForgeCapabilities.ITEM_HANDLER) {
return itemHandler.cast();
}
@ -280,7 +280,7 @@ public class ContainerMobileVehicleEntity extends MobileVehicleEntity implements
}
@Override
public void stopOpen(Player pPlayer) {
public void stopOpen(@NotNull Player pPlayer) {
this.level().gameEvent(GameEvent.CONTAINER_CLOSE, this.position(), GameEvent.Context.of(pPlayer));
}
}

View file

@ -1,4 +1,4 @@
package com.atsuishio.superbwarfare.entity.vehicle;
package com.atsuishio.superbwarfare.entity.vehicle.base;
import com.atsuishio.superbwarfare.capability.energy.SyncedEntityEnergyStorage;
import net.minecraft.nbt.CompoundTag;
@ -15,7 +15,7 @@ import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.energy.IEnergyStorage;
import org.jetbrains.annotations.NotNull;
public class EnergyVehicleEntity extends VehicleEntity {
public abstract class EnergyVehicleEntity extends VehicleEntity {
public static final EntityDataAccessor<Integer> ENERGY = SynchedEntityData.defineId(EnergyVehicleEntity.class, EntityDataSerializers.INT);

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.entity.vehicle;
package com.atsuishio.superbwarfare.entity.vehicle.base;
public interface IHelicopterEntity extends IArmedVehicleEntity {
public interface HelicopterEntity extends ArmedVehicleEntity {
float getRotX(float tickDelta);

View file

@ -1,8 +1,8 @@
package com.atsuishio.superbwarfare.entity.vehicle;
package com.atsuishio.superbwarfare.entity.vehicle.base;
import net.minecraft.world.phys.Vec3;
public interface ILandArmorEntity extends IArmedVehicleEntity {
public interface LandArmorEntity extends ArmedVehicleEntity {
float turretYRotO();

View file

@ -1,4 +1,4 @@
package com.atsuishio.superbwarfare.entity.vehicle;
package com.atsuishio.superbwarfare.entity.vehicle.base;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.C4Entity;
@ -6,6 +6,7 @@ import com.atsuishio.superbwarfare.entity.TargetEntity;
import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity;
import com.atsuishio.superbwarfare.entity.projectile.LaserEntity;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.vehicle.DroneEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.init.ModTags;
@ -38,7 +39,7 @@ import org.jetbrains.annotations.NotNull;
import org.joml.Math;
import org.joml.Vector3f;
public class MobileVehicleEntity extends EnergyVehicleEntity {
public abstract class MobileVehicleEntity extends EnergyVehicleEntity {
public static final EntityDataAccessor<Float> POWER = SynchedEntityData.defineId(MobileVehicleEntity.class, EntityDataSerializers.FLOAT);
@ -137,7 +138,7 @@ public class MobileVehicleEntity extends EnergyVehicleEntity {
Entity driver = EntityFindUtil.findEntity(this.level(), this.entityData.get(LAST_DRIVER_UUID));
if ((verticalCollision)) {
if (this instanceof IHelicopterEntity) {
if (this instanceof HelicopterEntity) {
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, driver == null ? this : driver), (float) (20 * ((lastTickSpeed - 0.3) * (lastTickSpeed - 0.3))));
this.bounceVertical(Direction.getNearest(this.getDeltaMovement().x(), this.getDeltaMovement().y(), this.getDeltaMovement().z()).getOpposite());
} else if (Mth.abs((float) lastTickVerticalSpeed) > 0.6) {

View file

@ -0,0 +1,56 @@
package com.atsuishio.superbwarfare.entity.vehicle.base;
import net.minecraft.world.entity.Entity;
import java.util.List;
/**
* 拥有多个按顺序排列的座位的载具每个座位可以为空
* <p>
* 需要为实体自己重写addPassengergetControllingPassengergetFirstPassengerremovePassenger等方法
*/
public interface MultiSeatVehicleEntity {
/**
* 获取按顺序排列的成员列表
*
* @return 按顺序排列的成员列表
*/
List<Entity> getOrderedPassengers();
/**
* 获取第index个乘客
*
* @param index 目标座位
* @return 目标座位的乘客
*/
Entity getNthEntity(int index);
/**
* 尝试切换座位
*
* @param entity 乘客
* @param index 目标座位
* @return 是否切换成功
*/
boolean changeSeat(Entity entity, int index);
/**
* 获取乘客所在座位索引
*
* @param entity 乘客
* @return 座位索引
*/
int getSeatIndex(Entity entity);
/**
* 获取座位数量
*
* @return 座位数量
*/
int getSeatCount();
}

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.entity.vehicle;
package com.atsuishio.superbwarfare.entity.vehicle.base;
public interface MultiWeaponVehicleEntity extends IArmedVehicleEntity {
public interface MultiWeaponVehicleEntity extends ArmedVehicleEntity {
/**
* 检测该槽位是否有可用武器
*

View file

@ -1,7 +1,8 @@
package com.atsuishio.superbwarfare.entity.vehicle;
package com.atsuishio.superbwarfare.entity.vehicle.base;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.entity.vehicle.DroneEntity;
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModItems;
@ -53,7 +54,7 @@ import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class VehicleEntity extends Entity {
public abstract class VehicleEntity extends Entity {
public static final EntityDataAccessor<Float> HEALTH = SynchedEntityData.defineId(VehicleEntity.class, EntityDataSerializers.FLOAT);
protected static final EntityDataAccessor<String> LAST_ATTACKER_UUID = SynchedEntityData.defineId(VehicleEntity.class, EntityDataSerializers.STRING);
@ -119,7 +120,7 @@ public class VehicleEntity extends Entity {
}
@Override
public InteractionResult interact(Player player, InteractionHand hand) {
public @NotNull InteractionResult interact(Player player, @NotNull InteractionHand hand) {
if (player.getVehicle() == this) return InteractionResult.PASS;
ItemStack stack = player.getMainHandItem();
@ -292,7 +293,7 @@ public class VehicleEntity extends Entity {
}
@Override
protected boolean canAddPassenger(Entity pPassenger) {
protected boolean canAddPassenger(@NotNull Entity pPassenger) {
return this.getPassengers().size() < this.getMaxPassengers();
}
@ -489,7 +490,7 @@ public class VehicleEntity extends Entity {
}
@Override
public Vec3 getDismountLocationForPassenger(LivingEntity passenger) {
public @NotNull Vec3 getDismountLocationForPassenger(LivingEntity passenger) {
Vec3 vec3d = getDismountOffset(getBbWidth() * Mth.SQRT_OF_TWO, passenger.getBbWidth() * Mth.SQRT_OF_TWO);
double ox = getX() - vec3d.x;
double oz = getZ() + vec3d.z;

View file

@ -4,6 +4,10 @@ import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.client.ClickHandler;
import com.atsuishio.superbwarfare.config.client.DisplayConfig;
import com.atsuishio.superbwarfare.entity.vehicle.*;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiWeaponVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.gun.GunItem;
import com.atsuishio.superbwarfare.network.ModVariables;
@ -275,7 +279,7 @@ public class ClientEventHandler {
if (stack.getItem() instanceof GunItem gunItem) {
if (gunItem.canUseMelee(stack) && gunMelee == 0 && drawTime < 0.01
&& ModKeyMappings.MELEE.isDown()
&& !(player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
&& !(player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
&& !holdFireVehicle
&& !notInGame()
&& !player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).edit
@ -431,7 +435,7 @@ public class ClientEventHandler {
}
if ((holdFire || burstFireSize > 0)
&& !(player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
&& !(player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
&& !holdFireVehicle
&& (stack.is(ModTags.Items.NORMAL_GUN)
&& cantFireTime == 0
@ -697,7 +701,7 @@ public class ClientEventHandler {
holdFireVehicle = false;
}
if (player.getVehicle() instanceof IArmedVehicleEntity iVehicle && iVehicle.isDriver(player) && iVehicle.canShoot(player)) {
if (player.getVehicle() instanceof ArmedVehicleEntity iVehicle && iVehicle.isDriver(player) && iVehicle.canShoot(player)) {
int rpm = iVehicle.mainGunRpm();
if (rpm == 0) {
rpm = 240;
@ -726,7 +730,7 @@ public class ClientEventHandler {
}
}
public static void playVehicleClientSounds(Player player, IArmedVehicleEntity iVehicle) {
public static void playVehicleClientSounds(Player player, ArmedVehicleEntity iVehicle) {
if (iVehicle instanceof SpeedboatEntity speedboat) {
float pitch = speedboat.getEntityData().get(HEAT) <= 60 ? 1 : (float) (1 - 0.011 * Math.abs(60 - speedboat.getEntityData().get(HEAT)));
player.playSound(ModSounds.M_2_FIRE_1P.get(), 1f, pitch);
@ -778,7 +782,7 @@ public class ClientEventHandler {
if (player == null) return;
ItemStack stack = player.getMainHandItem();
if (!(stack.getItem() instanceof GunItem gunItem)) return;
if (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && iArmedVehicle.hidePassenger())
if (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && iArmedVehicle.hidePassenger())
return;
float pose;
@ -861,7 +865,7 @@ public class ClientEventHandler {
cameraYaw = event.getYaw();
cameraRoll = event.getRoll();
if (player != null && player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player)) {
if (player != null && player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player)) {
return;
}
@ -927,7 +931,7 @@ public class ClientEventHandler {
}
}
if (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player)) {
if (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player)) {
event.setCanceled(true);
}
}
@ -1024,7 +1028,7 @@ public class ClientEventHandler {
double speed = 1.5 - (0.07 * weight);
if (zoom
&& !(player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
&& !(player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.banHand(player))
&& !notInGame()
&& drawTime < 0.01
&& !player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).edit) {
@ -1326,7 +1330,7 @@ public class ClientEventHandler {
ItemStack stack = player.getMainHandItem();
if (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && iArmedVehicle.banHand(player) && zoomVehicle) {
if (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player) && iArmedVehicle.banHand(player) && zoomVehicle) {
event.setFOV(event.getFOV() / iArmedVehicle.zoomFov());
return;
}
@ -1394,7 +1398,7 @@ public class ClientEventHandler {
public static void setPlayerInvisible(RenderPlayerEvent.Pre event) {
var otherPlayer = event.getEntity();
if (otherPlayer.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.hidePassenger()) {
if (otherPlayer.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.hidePassenger()) {
event.setCanceled(true);
}
}
@ -1421,7 +1425,7 @@ public class ClientEventHandler {
event.setCanceled(true);
}
if (player.getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player)) {
if (player.getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.isDriver(player)) {
event.setCanceled(true);
}

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.event;
import com.atsuishio.superbwarfare.entity.vehicle.*;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.tools.SeekTool;
@ -22,7 +23,7 @@ import java.util.List;
import static com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity.PROPELLER_ROT;
import static com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity.DELTA_ROT;
import static com.atsuishio.superbwarfare.entity.vehicle.MobileVehicleEntity.POWER;
import static com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity.POWER;
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
public class ClientSoundHandler {

View file

@ -7,9 +7,9 @@ import com.atsuishio.superbwarfare.config.common.GameplayConfig;
import com.atsuishio.superbwarfare.entity.ICustomKnockback;
import com.atsuishio.superbwarfare.entity.TargetEntity;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.vehicle.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ContainerMobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.item.gun.GunItem;
import com.atsuishio.superbwarfare.network.ModVariables;
@ -54,7 +54,7 @@ public class LivingEventHandler {
@SubscribeEvent
public static void onEntityAttacked(LivingAttackEvent event) {
if (!event.getSource().is(ModDamageTypes.VEHICLE_EXPLOSION) && event.getEntity().getVehicle() instanceof VehicleEntity vehicle) {
if (event.getEntity().getVehicle() instanceof IArmedVehicleEntity iArmedVehicle && iArmedVehicle.hidePassenger()) {
if (event.getEntity().getVehicle() instanceof ArmedVehicleEntity iArmedVehicle && iArmedVehicle.hidePassenger()) {
if (!(event.getSource().is(DamageTypes.EXPLOSION)
|| event.getSource().is(DamageTypes.PLAYER_EXPLOSION)
|| event.getSource().is(ModDamageTypes.CUSTOM_EXPLOSION)
@ -101,7 +101,7 @@ public class LivingEventHandler {
private static void handleVehicleHurt(LivingHurtEvent event) {
var vehicle = event.getEntity().getVehicle();
if (vehicle instanceof VehicleEntity) {
if (vehicle instanceof IArmedVehicleEntity iArmedVehicle) {
if (vehicle instanceof ArmedVehicleEntity iArmedVehicle) {
if (iArmedVehicle.hidePassenger()) {
if (!event.getSource().is(ModDamageTypes.VEHICLE_EXPLOSION)) {
event.setCanceled(true);
@ -779,7 +779,7 @@ public class LivingEventHandler {
Player player = event.getAttackingPlayer();
if (player == null) return;
if (player.getVehicle() instanceof IArmedVehicleEntity) {
if (player.getVehicle() instanceof ArmedVehicleEntity) {
player.giveExperiencePoints(event.getDroppedExperience());
event.setCanceled(true);
return;

View file

@ -5,7 +5,7 @@ import com.atsuishio.superbwarfare.client.PoseTool;
import com.atsuishio.superbwarfare.client.renderer.item.JavelinItemRenderer;
import com.atsuishio.superbwarfare.client.tooltip.component.LauncherImageComponent;
import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModSounds;

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.mixins;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModKeyMappings;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.mixins;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.mojang.authlib.GameProfile;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.player.AbstractClientPlayer;

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.mixins;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.phys.Vec3;
import org.spongepowered.asm.mixin.Final;

View file

@ -2,6 +2,8 @@ package com.atsuishio.superbwarfare.mixins;
import com.atsuishio.superbwarfare.config.client.VehicleControlConfig;
import com.atsuishio.superbwarfare.entity.vehicle.*;
import com.atsuishio.superbwarfare.entity.vehicle.base.CannonEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.event.ClientEventHandler;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModMobEffects;
@ -47,7 +49,7 @@ public class MouseHandlerMixin {
return 0;
}
if (player.getVehicle() instanceof ICannonEntity) {
if (player.getVehicle() instanceof CannonEntity) {
return ClientEventHandler.zoomVehicle ? 0.15 : 0.3;
}

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.mixins;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.Pose;

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.entity.vehicle.MultiSeatVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiSeatVehicleEntity;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.network.NetworkEvent;

View file

@ -1,7 +1,7 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import com.atsuishio.superbwarfare.init.ModDamageTypes;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.tools.CustomExplosion;

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.VehicleEntity;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.network.NetworkEvent;

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.entity.vehicle.MultiWeaponVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MultiWeaponVehicleEntity;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.Mth;

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.network.NetworkEvent;
@ -28,7 +28,7 @@ public class VehicleFireMessage {
if (context.getSender() != null) {
var player = context.getSender();
if (player.getVehicle() instanceof IArmedVehicleEntity iVehicle) {
if (player.getVehicle() instanceof ArmedVehicleEntity iVehicle) {
iVehicle.vehicleShoot(player);
}
}

View file

@ -1,6 +1,6 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.entity.vehicle.MobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
import net.minecraft.network.FriendlyByteBuf;

View file

@ -1,8 +1,8 @@
package com.atsuishio.superbwarfare.network.message;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.vehicle.IArmedVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.WheelChairEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
import com.atsuishio.superbwarfare.init.ModItems;
import com.atsuishio.superbwarfare.init.ModSounds;
import com.atsuishio.superbwarfare.network.ModVariables;
@ -45,7 +45,7 @@ public class ZoomMessage {
capability.syncPlayerVariables(player);
});
if (player.isPassenger() && player.getVehicle() instanceof IArmedVehicleEntity && !(player.getVehicle() instanceof WheelChairEntity)) {
if (player.isPassenger() && player.getVehicle() instanceof ArmedVehicleEntity && !(player.getVehicle() instanceof WheelChairEntity)) {
SoundTool.playLocalSound(player, ModSounds.CANNON_ZOOM_IN.get(), 2, 1);
}
}
@ -57,7 +57,7 @@ public class ZoomMessage {
capability.syncPlayerVariables(player);
});
if (player.isPassenger() && player.getVehicle() instanceof IArmedVehicleEntity && !(player.getVehicle() instanceof WheelChairEntity)) {
if (player.isPassenger() && player.getVehicle() instanceof ArmedVehicleEntity && !(player.getVehicle() instanceof WheelChairEntity)) {
SoundTool.playLocalSound(player, ModSounds.CANNON_ZOOM_OUT.get(), 2, 1);
}

View file

@ -3,7 +3,7 @@ package com.atsuishio.superbwarfare.tools;
import com.atsuishio.superbwarfare.entity.C4Entity;
import com.atsuishio.superbwarfare.entity.ClaymoreEntity;
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
import com.atsuishio.superbwarfare.entity.vehicle.MobileVehicleEntity;
import com.atsuishio.superbwarfare.entity.vehicle.base.MobileVehicleEntity;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.AreaEffectCloud;
import net.minecraft.world.entity.Entity;