添加BMP2

This commit is contained in:
Atsuihsio 2025-01-26 03:12:46 +08:00
parent 3d6f1c6f59
commit f0d409e1a5
20 changed files with 12960 additions and 43 deletions

12
.vscode/launch.json vendored
View file

@ -8,10 +8,10 @@
"mainClass": "cpw.mods.bootstraplauncher.BootstrapLauncher",
"projectName": "SuperbWarfare",
"cwd": "${workspaceFolder}\\run",
"vmArgs": "-Dmixin.dumpTargetOnFailure\u003dtrue -Dgeckolib.disable_examples\u003dtrue -DlegacyClassPath.file\u003dG:\\SuperbWarfare\\build\\classpath\\runClient_minecraftClasspath.txt -Dmixin.env.remapRefMap\u003dtrue -Dmixin.env.refMapRemappingFile\u003dG:\\SuperbWarfare/build/createSrgToMcp/output.srg -Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dG:\\SuperbWarfare\\build\\createSrgToMcp\\output.srg -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enableGameTest\u003dtrue -Dmixin.debug.verbose\u003dtrue -Dmixin.debug.export\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming -XX:HeapDumpPath\u003dMojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump",
"vmArgs": "-Dgeckolib.disable_examples\u003dtrue -Dmixin.env.remapRefMap\u003dtrue -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -Dforge.enabledGameTestNamespaces\u003dsuperbwarfare -Dforge.logging.console.level\u003dinfo -Dmixin.dumpTargetOnFailure\u003dtrue -Dforge.logging.markers\u003dREGISTRIES -DlegacyClassPath.file\u003dG:\\SuperbWarfare\\build\\classpath\\runClient_minecraftClasspath.txt -Dmixin.env.refMapRemappingFile\u003dG:\\SuperbWarfare/build/createSrgToMcp/output.srg -Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dG:\\SuperbWarfare\\build\\createSrgToMcp\\output.srg -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enableGameTest\u003dtrue -Dmixin.debug.verbose\u003dtrue -Dmixin.debug.export\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming -XX:HeapDumpPath\u003dMojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump",
"args": "--launchTarget forgeclientuserdev --version MOD_DEV --assetIndex 5 --assetsDir C:\\Users\\Atsuishio\\.gradle\\caches\\forge_gradle\\assets --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mixin.config mixins.superbwarfare.json",
"env": {
"MOD_CLASSES": "${workspaceFolder}\\build\\resources\\main;${workspaceFolder}\\build\\classes\\java\\main",
"MOD_CLASSES": "superbwarfare%%${workspaceFolder}\\build\\resources\\main;superbwarfare%%${workspaceFolder}\\build\\classes\\java\\main",
"MCP_MAPPINGS": "parchment_2023.08.13-1.20.1"
},
"preLaunchTask": "prepareRunClientCompile"
@ -23,10 +23,10 @@
"mainClass": "cpw.mods.bootstraplauncher.BootstrapLauncher",
"projectName": "SuperbWarfare",
"cwd": "${workspaceFolder}\\run",
"vmArgs": "-Dmixin.dumpTargetOnFailure\u003dtrue -Dgeckolib.disable_examples\u003dtrue -DlegacyClassPath.file\u003dG:\\SuperbWarfare\\build\\classpath\\runData_minecraftClasspath.txt -Dmixin.env.remapRefMap\u003dtrue -Dmixin.env.refMapRemappingFile\u003dG:\\SuperbWarfare/build/createSrgToMcp/output.srg -Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dG:\\SuperbWarfare\\build\\createSrgToMcp\\output.srg -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dmixin.debug.verbose\u003dtrue -Dmixin.debug.export\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming",
"vmArgs": "-Dforge.logging.console.level\u003dinfo -Dmixin.dumpTargetOnFailure\u003dtrue -Dgeckolib.disable_examples\u003dtrue -Dforge.logging.markers\u003dREGISTRIES -DlegacyClassPath.file\u003dG:\\SuperbWarfare\\build\\classpath\\runData_minecraftClasspath.txt -Dmixin.env.remapRefMap\u003dtrue -Dmixin.env.refMapRemappingFile\u003dG:\\SuperbWarfare/build/createSrgToMcp/output.srg -Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dG:\\SuperbWarfare\\build\\createSrgToMcp\\output.srg -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dmixin.debug.verbose\u003dtrue -Dmixin.debug.export\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming",
"args": "--launchTarget forgedatauserdev --assetIndex 5 --assetsDir C:\\Users\\Atsuishio\\.gradle\\caches\\forge_gradle\\assets --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mod superbwarfare --all --output G:\\SuperbWarfare\\src\\generated\\resources --existing G:\\SuperbWarfare\\src\\main\\resources --mixin.config mixins.superbwarfare.json",
"env": {
"MOD_CLASSES": "${workspaceFolder}\\build\\resources\\main;${workspaceFolder}\\build\\classes\\java\\main",
"MOD_CLASSES": "superbwarfare%%${workspaceFolder}\\build\\resources\\main;superbwarfare%%${workspaceFolder}\\build\\classes\\java\\main",
"MCP_MAPPINGS": "parchment_2023.08.13-1.20.1"
},
"preLaunchTask": "prepareRunDataCompile"
@ -38,10 +38,10 @@
"mainClass": "cpw.mods.bootstraplauncher.BootstrapLauncher",
"projectName": "SuperbWarfare",
"cwd": "${workspaceFolder}\\run",
"vmArgs": "-Dmixin.dumpTargetOnFailure\u003dtrue -Dgeckolib.disable_examples\u003dtrue -DlegacyClassPath.file\u003dG:\\SuperbWarfare\\build\\classpath\\runServer_minecraftClasspath.txt -Dmixin.env.remapRefMap\u003dtrue -Dmixin.env.refMapRemappingFile\u003dG:\\SuperbWarfare/build/createSrgToMcp/output.srg -Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dG:\\SuperbWarfare\\build\\createSrgToMcp\\output.srg -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enableGameTest\u003dtrue -Dmixin.debug.verbose\u003dtrue -Dmixin.debug.export\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming",
"vmArgs": "-Dgeckolib.disable_examples\u003dtrue -Dmixin.env.remapRefMap\u003dtrue -DignoreList\u003dbootstraplauncher,securejarhandler,asm-commons,asm-util,asm-analysis,asm-tree,asm,JarJarFileSystems,client-extra,fmlcore,javafmllanguage,lowcodelanguage,mclanguage,forge- -Dforge.enabledGameTestNamespaces\u003dsuperbwarfare -Dforge.logging.console.level\u003dinfo -Dmixin.dumpTargetOnFailure\u003dtrue -Dforge.logging.markers\u003dREGISTRIES -DlegacyClassPath.file\u003dG:\\SuperbWarfare\\build\\classpath\\runServer_minecraftClasspath.txt -Dmixin.env.refMapRemappingFile\u003dG:\\SuperbWarfare/build/createSrgToMcp/output.srg -Dnet.minecraftforge.gradle.GradleStart.srg.srg-mcp\u003dG:\\SuperbWarfare\\build\\createSrgToMcp\\output.srg -DmergeModules\u003djna-5.10.0.jar,jna-platform-5.10.0.jar -Dforge.enableGameTest\u003dtrue -Dmixin.debug.verbose\u003dtrue -Dmixin.debug.export\u003dtrue -Djava.net.preferIPv6Addresses\u003dsystem -p C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\bootstraplauncher\\1.1.2\\c546e00443d8432cda6baa1c860346980742628\\bootstraplauncher-1.1.2.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\cpw.mods\\securejarhandler\\2.1.10\\51e6a22c6c716beb11e244bf5b8be480f51dd6b5\\securejarhandler-2.1.10.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-commons\\9.5\\19ab5b5800a3910d30d3a3e64fdb00fd0cb42de0\\asm-commons-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-util\\9.5\\64b5a1fc8c1b15ed2efd6a063e976bc8d3dc5ffe\\asm-util-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-analysis\\9.5\\490bacc77de7cbc0be1a30bb3471072d705be4a4\\asm-analysis-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm-tree\\9.5\\fd33c8b6373abaa675be407082fdfda35021254a\\asm-tree-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\org.ow2.asm\\asm\\9.5\\dc6ea1875f4d64fbc85e1691c95b96a3d8569c90\\asm-9.5.jar;C:\\Users\\Atsuishio\\.gradle\\caches\\modules-2\\files-2.1\\net.minecraftforge\\JarJarFileSystems\\0.3.19\\2464eb7d6b9ddb9db36a82cf8a95193e5c6fe020\\JarJarFileSystems-0.3.19.jar --add-modules ALL-MODULE-PATH --add-opens java.base/java.util.jar\u003dcpw.mods.securejarhandler --add-opens java.base/java.lang.invoke\u003dcpw.mods.securejarhandler --add-exports java.base/sun.security.util\u003dcpw.mods.securejarhandler --add-exports jdk.naming.dns/com.sun.jndi.dns\u003djava.naming",
"args": "--launchTarget forgeserveruserdev --gameDir . --fml.forgeVersion 47.2.0 --fml.mcVersion 1.20.1 --fml.forgeGroup net.minecraftforge --fml.mcpVersion 20230612.114412 --mixin.config mixins.superbwarfare.json",
"env": {
"MOD_CLASSES": "${workspaceFolder}\\build\\resources\\main;${workspaceFolder}\\build\\classes\\java\\main",
"MOD_CLASSES": "superbwarfare%%${workspaceFolder}\\build\\resources\\main;superbwarfare%%${workspaceFolder}\\build\\classes\\java\\main",
"MCP_MAPPINGS": "parchment_2023.08.13-1.20.1"
},
"preLaunchTask": "prepareRunServerCompile"

View file

@ -0,0 +1,28 @@
package com.atsuishio.superbwarfare.client.layer;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.resources.ResourceLocation;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.renderer.GeoRenderer;
import software.bernie.geckolib.renderer.layer.GeoRenderLayer;
public class Bmp2Layer extends GeoRenderLayer<Bmp2Entity> {
private static final ResourceLocation LAYER = ModUtils.loc("textures/entity/speedboat_e.png");
public Bmp2Layer(GeoRenderer<Bmp2Entity> entityRenderer) {
super(entityRenderer);
}
@Override
public void render(PoseStack poseStack, Bmp2Entity animatable, BakedGeoModel bakedModel, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, float partialTick, int packedLight, int packedOverlay) {
RenderType glowRenderType = RenderType.energySwirl(LAYER,1,1);
getRenderer().reRender(getDefaultBakedModel(animatable), poseStack, bufferSource, animatable, glowRenderType, bufferSource.getBuffer(glowRenderType), partialTick, packedLight, OverlayTexture.NO_OVERLAY, 1, 1, 1, 1);
}
}

View file

@ -0,0 +1,186 @@
package com.atsuishio.superbwarfare.client.model.entity;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import software.bernie.geckolib.core.animatable.model.CoreGeoBone;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.model.GeoModel;
import static com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity.TRACK_L;
import static com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity.TRACK_R;
public class Bmp2Model extends GeoModel<Bmp2Entity> {
@Override
public ResourceLocation getAnimationResource(Bmp2Entity entity) {
return ModUtils.loc("animations/lav.animation.json");
}
@Override
public ResourceLocation getModelResource(Bmp2Entity entity) {
return ModUtils.loc("geo/bmp2.geo.json");
// Player player = Minecraft.getInstance().player;
//
// int distance = 0;
//
// if (player != null) {
// distance = (int) player.position().distanceTo(entity.position());
// }
//
// if (distance < 32) {
// return ModUtils.loc("geo/Bmp2.geo.json");
// } else {
// return ModUtils.loc("geo/speedboat.lod1.geo.json");
// }
}
@Override
public ResourceLocation getTextureResource(Bmp2Entity entity) {
return ModUtils.loc("textures/entity/bmp2.png");
}
@Override
public void setCustomAnimations(Bmp2Entity animatable, long instanceId, AnimationState<Bmp2Entity> animationState) {
for (int i = 0; i < 50; i++) {
CoreGeoBone trackL = getAnimationProcessor().getBone("trackL" + i);
CoreGeoBone trackLRot = getAnimationProcessor().getBone("trackLRot" + i);
CoreGeoBone trackR = getAnimationProcessor().getBone("trackR" + i);
CoreGeoBone trackRRot = getAnimationProcessor().getBone("trackRRot" + i);
float t = animatable.getEntityData().get(TRACK_L) + 2 * i;
if (t >= 100) {
t -= 100;
}
if (t < 37.5) {
trackL.setPosY(0);
trackL.setPosZ(3 * t);
trackLRot.setRotX(0);
}
if (t >= 37.5 && t < 39.5) {
trackL.setPosY(-(t - 37.5f) * 3 * 0.7071f);
trackL.setPosZ(3 * 37.5f + (t - 37.5f) * 3 * 0.7071f);
trackLRot.setRotX(45 * Mth.DEG_TO_RAD);
}
if (t >= 39.5 && t < 41.5) {
trackL.setPosY(-5.3f - (t - 39.5f) * 3);
trackL.setPosZ(116);
trackLRot.setRotX(90 * Mth.DEG_TO_RAD);
}
if (t >= 41.5 && t < 43) {
trackL.setPosY(-11.6f - (t - 41.5f) * 3 * 0.7071f);
trackL.setPosZ(115 - (t - 41.5f) * 3 * 0.7071f);
trackLRot.setRotX(135 * Mth.DEG_TO_RAD);
}
if (t >= 43 && t < 49.5) {
trackL.setPosY(-15.6f - (t - 43f) * 3 * 0.45f);
trackL.setPosZ(109.5f - (t - 43f) * 3 * 0.75f);
trackLRot.setRotX(150 * Mth.DEG_TO_RAD);
}
if (t >= 49.5 && t < 76.5) {
trackL.setPosY(-23.5f);
trackL.setPosZ(95f - (t - 49.5f) * 3);
trackLRot.setRotX(180 * Mth.DEG_TO_RAD);
}
if (t >= 76.5 && t < 83.5) {
trackL.setPosY(-23.5f + (t - 76.5f) * 3 * 0.45f);
trackL.setPosZ(13.5f - (t - 76.5f) * 3 * 0.75f);
trackLRot.setRotX(210 * Mth.DEG_TO_RAD);
}
if (t >= 83.5 && t < 85.5) {
trackL.setPosY(-12.7f + (t - 83.5f) * 3 * 0.7071f);
trackL.setPosZ(-3.5f - (t - 83.5f) * 3 * 0.7071f);
trackLRot.setRotX(225 * Mth.DEG_TO_RAD);
}
if (t >= 85.5 && t < 87) {
trackL.setPosY(-9.2f + (t - 85.5f) * 3);
trackL.setPosZ(-6.9f);
trackLRot.setRotX(270 * Mth.DEG_TO_RAD);
}
if (t >= 87 && t < 89) {
trackL.setPosY(-4.3f + (t - 87f) * 3 * 0.7071f);
trackL.setPosZ(-6.9f + (t - 87f) * 3 * 0.7071f);
trackLRot.setRotX(315 * Mth.DEG_TO_RAD);
}
float t2 = animatable.getEntityData().get(TRACK_R) + 2 * i;
if (t2 >= 100) {
t2 -= 100;
}
if (t2 < 37.5) {
trackR.setPosY(0);
trackR.setPosZ(3 * t2);
trackRRot.setRotX(0);
}
if (t2>= 37.5 && t2< 39.5) {
trackR.setPosY(-(t2- 37.5f) * 3 * 0.7071f);
trackR.setPosZ(3 * 37.5f + (t2- 37.5f) * 3 * 0.7071f);
trackRRot.setRotX(45 * Mth.DEG_TO_RAD);
}
if (t2>= 39.5 && t2< 41.5) {
trackR.setPosY(-5.3f - (t2- 39.5f) * 3);
trackR.setPosZ(116);
trackRRot.setRotX(90 * Mth.DEG_TO_RAD);
}
if (t2>= 41.5 && t2< 43) {
trackR.setPosY(-11.6f - (t2- 41.5f) * 3 * 0.7071f);
trackR.setPosZ(115 - (t2- 41.5f) * 3 * 0.7071f);
trackRRot.setRotX(135 * Mth.DEG_TO_RAD);
}
if (t2>= 43 && t2< 49.5) {
trackR.setPosY(-15.6f - (t2- 43f) * 3 * 0.45f);
trackR.setPosZ(109.5f - (t2- 43f) * 3 * 0.75f);
trackRRot.setRotX(150 * Mth.DEG_TO_RAD);
}
if (t2>= 49.5 && t2< 76.5) {
trackR.setPosY(-23.5f);
trackR.setPosZ(95f - (t2- 49.5f) * 3);
trackRRot.setRotX(180 * Mth.DEG_TO_RAD);
}
if (t2>= 76.5 && t2< 83.5) {
trackR.setPosY(-23.5f + (t2- 76.5f) * 3 * 0.45f);
trackR.setPosZ(13.5f - (t2- 76.5f) * 3 * 0.75f);
trackRRot.setRotX(210 * Mth.DEG_TO_RAD);
}
if (t2>= 83.5 && t2< 85.5) {
trackR.setPosY(-12.7f + (t2- 83.5f) * 3 * 0.7071f);
trackR.setPosZ(-3.5f - (t2- 83.5f) * 3 * 0.7071f);
trackRRot.setRotX(225 * Mth.DEG_TO_RAD);
}
if (t2>= 85.5 && t2< 87) {
trackR.setPosY(-9.2f + (t2- 85.5f) * 3);
trackR.setPosZ(-6.9f);
trackRRot.setRotX(270 * Mth.DEG_TO_RAD);
}
if (t2>= 87 && t2< 89) {
trackR.setPosY(-4.3f + (t2- 87f) * 3 * 0.7071f);
trackR.setPosZ(-6.9f + (t2- 87f) * 3 * 0.7071f);
trackRRot.setRotX(315 * Mth.DEG_TO_RAD);
}
}
}
}

View file

@ -184,7 +184,9 @@ public class VehicleHudOverlay {
if (player == null) return;
if (player.getVehicle() instanceof Lav150Entity lav150 && lav150.isDriver(player) && player.getVehicle() instanceof MultiWeaponVehicleEntity multiWeaponVehicle) {
if (player.getVehicle() instanceof ILandArmorEntity iLand && iLand.isDriver(player)
&& iLand instanceof MultiWeaponVehicleEntity multiWeaponVehicle
&& iLand instanceof MobileVehicleEntity mobileVehicle) {
poseStack.pushPose();
poseStack.translate(Mth.clamp(-8 * ClientEventHandler.turnRot[1], -10, 10), Mth.clamp(-8 * ClientEventHandler.turnRot[0], -10, 10), 0);
@ -219,21 +221,21 @@ public class VehicleHudOverlay {
//炮塔方向
poseStack.pushPose();
poseStack.rotateAround(Axis.ZP.rotationDegrees(Mth.lerp(event.getPartialTick(), lav150.turretYRotO, lav150.getTurretYRot())),w / 2 + 112, h - 56, 0);
poseStack.rotateAround(Axis.ZP.rotationDegrees(Mth.lerp(event.getPartialTick(), iLand.turretYRotO(), iLand.turretYRot())),w / 2 + 112, h - 56, 0);
preciseBlit(guiGraphics, ModUtils.loc("textures/screens/land/body.png"), w / 2 + 96, h - 72, 0, 0.0F, 32, 32, 32, 32);
poseStack.popPose();
//时速
guiGraphics.drawString(mc.font, Component.literal(new DecimalFormat("##").format(lav150.getDeltaMovement().length() * 72) + " KM/H"),
guiGraphics.drawString(mc.font, Component.literal(new DecimalFormat("##").format(mobileVehicle.getDeltaMovement().length() * 72) + " KM/H"),
w / 2 + 160, h / 2 - 48, 0x66FF00, false);
//低电量警告
if (lav150.getEnergy() < 0.02 * lav150.getMaxEnergy()) {
if (mobileVehicle.getEnergy() < 0.02 * mobileVehicle.getMaxEnergy()) {
guiGraphics.drawString(mc.font, Component.literal("NO POWER!"),
w / 2 - 144, h / 2 + 14, -65536, false);
} else if (lav150.getEnergy() < 0.2 * lav150.getMaxEnergy()) {
} else if (mobileVehicle.getEnergy() < 0.2 * mobileVehicle.getMaxEnergy()) {
guiGraphics.drawString(mc.font, Component.literal("LOW POWER"),
w / 2 - 144, h / 2 + 14, 0xFF6B00, false);
}
@ -242,7 +244,7 @@ public class VehicleHudOverlay {
boolean lookAtEntity = false;
double blockRange = cameraPos.distanceTo((Vec3.atLowerCornerOf(player.level().clip(
new ClipContext(player.getEyePosition(), player.getEyePosition().add(lav150.getBarrelVector(1).scale(520)),
new ClipContext(player.getEyePosition(), player.getEyePosition().add(iLand.getBarrelVec(event.getPartialTick()).scale(520)),
ClipContext.Block.OUTLINE, ClipContext.Fluid.NONE, player)).getBlockPos())));
double entityRange = 0;
@ -278,15 +280,26 @@ public class VehicleHudOverlay {
}
if (player.getVehicle() instanceof Bmp2Entity bmp2) {
if (multiWeaponVehicle.getWeaponType() == 0) {
double heat = 1 - bmp2.getEntityData().get(HEAT) / 100.0F;
guiGraphics.drawString(mc.font, Component.literal(" 30MM 2A42 " + (player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get())) ? "" : bmp2.getAmmoCount(player))), w / 2 - 33, h - 65, Mth.hsvToRgb((float) heat / 3.745318352059925F, 1.0F, 1.0F), false);
} else {
double heat = 1 - bmp2.getEntityData().get(COAX_HEAT) / 100.0F;
guiGraphics.drawString(mc.font, Component.literal(" 7.62MM ПКТ " + (player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get())) ? "" : bmp2.getAmmoCount(player))), w / 2 - 33, h - 65, Mth.hsvToRgb((float) heat / 3.745318352059925F, 1.0F, 1.0F), false);
}
}
//血量
double heal = lav150.getHealth() / lav150.getMaxHealth();
double heal = mobileVehicle.getHealth() / mobileVehicle.getMaxHealth();
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(new DecimalFormat("##").format(100 * heal)), w / 2 - 165, h / 2 - 46, Mth.hsvToRgb((float) heal / 3.745318352059925F, 1.0F, 1.0F), false);
renderKillIndicator(guiGraphics, w, h);
} else if (Minecraft.getInstance().options.getCameraType() == CameraType.THIRD_PERSON_BACK && !ClientEventHandler.zoomVehicle) {
Vec3 p = RenderHelper.worldToScreen(new Vec3(player.getX(), player.getY(), player.getZ()).add(lav150.getBarrelVector(event.getPartialTick()).scale(192)), cameraPos);
Vec3 p = RenderHelper.worldToScreen(new Vec3(player.getX(), player.getY(), player.getZ()).add(iLand.getBarrelVec(event.getPartialTick()).scale(192)), cameraPos);
if (p != null) {
poseStack.pushPose();
@ -312,9 +325,19 @@ public class VehicleHudOverlay {
}
}
double heal = 1 - lav150.getHealth() / lav150.getMaxHealth();
if (multiWeaponVehicle instanceof Bmp2Entity bmp201) {
if (multiWeaponVehicle.getWeaponType() == 0) {
double heat = bmp201.getEntityData().get(HEAT) / 100.0F;
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(" 30MM 2A42 " + (player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get())) ? "" : bmp201.getAmmoCount(player))), 30, -9, Mth.hsvToRgb(0F, (float) heat, 1.0F), false);
} else {
double heat2 = bmp201.getEntityData().get(COAX_HEAT) / 100.0F;
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal(" 7.62MM ПКТ " + (player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get())) ? "" : bmp201.getAmmoCount(player))), 30, -9, Mth.hsvToRgb(0F, (float) heat2, 1.0F), false);
}
}
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal("HP " + new DecimalFormat("##").format(100 * lav150.getHealth() / lav150.getMaxHealth())), 30, 1, Mth.hsvToRgb(0F, (float) heal, 1.0F), false);
double heal = 1 - mobileVehicle.getHealth() / mobileVehicle.getMaxHealth();
guiGraphics.drawString(Minecraft.getInstance().font, Component.literal("HP " + new DecimalFormat("##").format(100 * mobileVehicle.getHealth() / mobileVehicle.getMaxHealth())), 30, 1, Mth.hsvToRgb(0F, (float) heal, 1.0F), false);
poseStack.popPose();
poseStack.popPose();

View file

@ -0,0 +1,83 @@
package com.atsuishio.superbwarfare.client.renderer.entity;
import com.atsuishio.superbwarfare.client.layer.Bmp2Layer;
import com.atsuishio.superbwarfare.client.model.entity.Bmp2Model;
import com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.math.Axis;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import software.bernie.geckolib.cache.object.BakedGeoModel;
import software.bernie.geckolib.cache.object.GeoBone;
import software.bernie.geckolib.renderer.GeoEntityRenderer;
public class Bmp2Renderer extends GeoEntityRenderer<Bmp2Entity> {
public Bmp2Renderer(EntityRendererProvider.Context renderManager) {
super(renderManager, new Bmp2Model());
this.addRenderLayer(new Bmp2Layer(this));
}
@Override
public RenderType getRenderType(Bmp2Entity animatable, ResourceLocation texture, MultiBufferSource bufferSource, float partialTick) {
return RenderType.entityTranslucent(getTextureLocation(animatable));
}
@Override
public void preRender(PoseStack poseStack, Bmp2Entity entity, BakedGeoModel model, MultiBufferSource bufferSource, VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, float red, float green,
float blue, float alpha) {
float scale = 1f;
this.scaleHeight = scale;
this.scaleWidth = scale;
super.preRender(poseStack, entity, model, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, red, green, blue, alpha);
}
@Override
public void render(Bmp2Entity entityIn, float entityYaw, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int packedLightIn) {
poseStack.pushPose();
poseStack.mulPose(Axis.YP.rotationDegrees(-Mth.lerp(partialTicks, entityIn.yRotO, entityIn.getYRot())));
super.render(entityIn, entityYaw, partialTicks, poseStack, bufferIn, packedLightIn);
poseStack.popPose();
}
@Override
public void renderRecursively(PoseStack poseStack, Bmp2Entity animatable, GeoBone bone, RenderType renderType, MultiBufferSource bufferSource, VertexConsumer buffer, boolean isReRender, float partialTick, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) {
String name = bone.getName();
for (int i = 0; i < 8; i++) {
if (name.equals("wheelL" + i)) {
bone.setRotX(1.5f * Mth.lerp(partialTick, animatable.leftWheelRotO, animatable.getLeftWheelRot()));
}
}
for (int i = 0; i < 8; i++) {
if (name.equals("wheelR" + i)) {
bone.setRotX(1.5f * Mth.lerp(partialTick, animatable.rightWheelRotO, animatable.getRightWheelRot()));
}
}
if (name.equals("cannon")) {
bone.setRotY(Mth.lerp(partialTick, animatable.turretYRotO, animatable.getTurretYRot()) * Mth.DEG_TO_RAD);
}
if (name.equals("barrel")) {
bone.setRotX(-Mth.lerp(partialTick, animatable.turretXRotO, animatable.getTurretXRot()) * Mth.DEG_TO_RAD);
}
if (name.equals("flare")) {
bone.setRotZ((float) (0.5 * (Math.random() - 0.5)));
}
if (name.equals("flare2")) {
bone.setRotZ((float) (0.5 * (Math.random() - 0.5)));
}
super.renderRecursively(poseStack, animatable, bone, renderType, bufferSource, buffer, isReRender, partialTick, packedLight, packedOverlay, red, green, blue, alpha);
}
@Override
protected float getDeathMaxRotation(Bmp2Entity entityLivingBaseIn) {
return 0.0F;
}
}

View file

@ -43,13 +43,20 @@ public class VehicleConfig {
public static ForgeConfigSpec.IntValue LAV_150_MAX_ENERGY;
public static ForgeConfigSpec.IntValue LAV_150_CANNON_DAMAGE;
public static ForgeConfigSpec.IntValue LAV_150_CANNON_EXPLOSION_DAMAGE;
public static ForgeConfigSpec.IntValue LAV_150_CANNON_EXPLOSION_RADIUS;
public static ForgeConfigSpec.DoubleValue LAV_150_CANNON_EXPLOSION_RADIUS;
public static ForgeConfigSpec.IntValue TOM_6_HP;
public static ForgeConfigSpec.IntValue TOM_6_MAX_ENERGY;
public static ForgeConfigSpec.IntValue TOM_6_ENERGY_COST;
public static ForgeConfigSpec.IntValue TOM_6_BOMB_EXPLOSION_DAMAGE;
public static ForgeConfigSpec.IntValue TOM_6_BOMB_EXPLOSION_RADIUS;
public static ForgeConfigSpec.DoubleValue TOM_6_BOMB_EXPLOSION_RADIUS;
public static ForgeConfigSpec.IntValue BMP_2_HP;
public static ForgeConfigSpec.IntValue BMP_2_ENERGY_COST;
public static ForgeConfigSpec.IntValue BMP_2_MAX_ENERGY;
public static ForgeConfigSpec.IntValue BMP_2_CANNON_DAMAGE;
public static ForgeConfigSpec.IntValue BMP_2_CANNON_EXPLOSION_DAMAGE;
public static ForgeConfigSpec.DoubleValue BMP_2_CANNON_EXPLOSION_RADIUS;
public static void init(ForgeConfigSpec.Builder builder) {
@ -178,7 +185,7 @@ public class VehicleConfig {
LAV_150_CANNON_EXPLOSION_DAMAGE = builder.defineInRange("lav_150_cannon_explosion_damage", 12, 1, 10000000);
builder.comment("The rocket explosion radius of Lav_150");
LAV_150_CANNON_EXPLOSION_RADIUS = builder.defineInRange("lav_150_cannon_explosion_radius", 3, 1, 10000000);
LAV_150_CANNON_EXPLOSION_RADIUS = builder.defineInRange("lav_150_cannon_explosion_radius", 3d, 1d, 10000000d);
builder.pop();
@ -197,9 +204,30 @@ public class VehicleConfig {
TOM_6_BOMB_EXPLOSION_DAMAGE = builder.defineInRange("tom_6_bomb_explosion_damage", 1000, 1, 10000000);
builder.comment("The Melon Bomb explosion radius of Tom_6");
TOM_6_BOMB_EXPLOSION_RADIUS = builder.defineInRange("tom_6_bomb_explosion_radius", 16, 1, 10000000);
TOM_6_BOMB_EXPLOSION_RADIUS = builder.defineInRange("tom_6_bomb_explosion_radius", 16d, 1d, 10000000d);
builder.pop();
builder.push("bmp_2");
builder.comment("The HealthPoint of Bmp_2");
BMP_2_HP = builder.defineInRange("bmp_2_hp", 1000, 1, 10000000);
builder.comment("The energy cost of Bmp_2 per tick");
BMP_2_ENERGY_COST = builder.defineInRange("bmp_2_energy_cost", 64, 0, 2147483647);
builder.comment("The max energy storage of Bmp_2");
BMP_2_MAX_ENERGY = builder.defineInRange("bmp_2_max_energy", 3000000, 0, 2147483647);
builder.comment("The cannon damage of Bmp_2");
BMP_2_CANNON_DAMAGE = builder.defineInRange("bmp_2_cannon_damage", 55, 1, 10000000);
builder.comment("The rocket explosion damage of Bmp_2");
BMP_2_CANNON_EXPLOSION_DAMAGE = builder.defineInRange("bmp_2_cannon_explosion_damage", 15, 1, 10000000);
builder.comment("The rocket explosion radius of Bmp_2");
BMP_2_CANNON_EXPLOSION_RADIUS = builder.defineInRange("bmp_2_cannon_explosion_radius", 4d, 1d, 10000000d);
builder.pop();
}
}

View file

@ -47,7 +47,7 @@ public class MelonBombEntity extends ThrowableItemProjectile {
@Override
public void onHitBlock(BlockHitResult blockHitResult) {
super.onHitBlock(blockHitResult);
ProjectileTool.causeCustomExplode(this, VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get(), 1.5f);
ProjectileTool.causeCustomExplode(this, VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get().floatValue(), 1.5f);
this.discard();
}
@ -57,7 +57,7 @@ public class MelonBombEntity extends ThrowableItemProjectile {
if (tickCount > 600) {
this.discard();
if (!this.level().isClientSide) {
ProjectileTool.causeCustomExplode(this, VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get(), 1.5f);
ProjectileTool.causeCustomExplode(this, VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get().floatValue(), 1.5f);
}
}

View file

@ -0,0 +1,746 @@
package com.atsuishio.superbwarfare.entity.vehicle;
import com.atsuishio.superbwarfare.ModUtils;
import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig;
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.init.*;
import com.atsuishio.superbwarfare.network.ModVariables;
import com.atsuishio.superbwarfare.network.message.ShakeClientMessage;
import com.atsuishio.superbwarfare.tools.CustomExplosion;
import com.atsuishio.superbwarfare.tools.EntityFindUtil;
import com.atsuishio.superbwarfare.tools.ParticleTool;
import com.atsuishio.superbwarfare.tools.SoundTool;
import com.mojang.math.Axis;
import net.minecraft.core.BlockPos;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.ClientGamePacketListener;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundSource;
import net.minecraft.util.Mth;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.MoverType;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Explosion;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.fluids.FluidType;
import net.minecraftforge.network.NetworkHooks;
import net.minecraftforge.network.PacketDistributor;
import net.minecraftforge.network.PlayMessages;
import net.minecraftforge.registries.ForgeRegistries;
import org.jetbrains.annotations.NotNull;
import org.joml.Math;
import org.joml.Matrix4f;
import org.joml.Vector4f;
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.core.animation.AnimationController;
import software.bernie.geckolib.core.animation.AnimationState;
import software.bernie.geckolib.core.animation.RawAnimation;
import software.bernie.geckolib.core.object.PlayState;
import software.bernie.geckolib.util.GeckoLibUtil;
import java.util.Comparator;
import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, IChargeEntity, ILandArmorEntity, 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);
public static final EntityDataAccessor<Integer> HEAT = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> COAX_HEAT = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> AMMO = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> LOADED_COAX_AMMO = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Integer> WEAPON_TYPE = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.INT);
public static final EntityDataAccessor<Float> TRACK_L = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.FLOAT);
public static final EntityDataAccessor<Float> TRACK_R = SynchedEntityData.defineId(Bmp2Entity.class, EntityDataSerializers.FLOAT);
public static final float MAX_HEALTH = VehicleConfig.LAV_150_HP.get();
public static final int MAX_ENERGY = VehicleConfig.LAV_150_MAX_ENERGY.get();
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
public float turretYRot;
public float turretXRot;
public float turretYRotO;
public float turretXRotO;
public float leftWheelRot;
public float rightWheelRot;
public float leftWheelRotO;
public float rightWheelRotO;
public boolean cannotFire;
public boolean cannotFireCoax;
public Bmp2Entity(PlayMessages.SpawnEntity packet, Level world) {
this(ModEntities.BMP_2.get(), world);
}
public Bmp2Entity(EntityType<Bmp2Entity> type, Level world) {
super(type, world);
this.setMaxUpStep(1.5f);
}
@Override
protected void defineSynchedData() {
super.defineSynchedData();
this.entityData.define(AMMO, 0);
this.entityData.define(FIRE_ANIM, 0);
this.entityData.define(DELTA_ROT, 0f);
this.entityData.define(HEAT, 0);
this.entityData.define(COAX_HEAT, 0);
this.entityData.define(WEAPON_TYPE, 0);
this.entityData.define(LOADED_COAX_AMMO, 0);
this.entityData.define(TRACK_L, 0f);
this.entityData.define(TRACK_R, 0f);
}
@Override
public void addAdditionalSaveData(CompoundTag compound) {
super.addAdditionalSaveData(compound);
compound.putInt("LoadedCoaxAmmo", this.entityData.get(LOADED_COAX_AMMO));
}
@Override
public void readAdditionalSaveData(CompoundTag compound) {
super.readAdditionalSaveData(compound);
this.entityData.set(LOADED_COAX_AMMO, compound.getInt("LoadedCoaxAmmo"));
}
@Override
public Packet<ClientGamePacketListener> getAddEntityPacket() {
return NetworkHooks.getEntitySpawningPacket(this);
}
@Override
public boolean hurt(DamageSource source, float amount) {
super.hurt(source, amount);
if (this.level() instanceof ServerLevel serverLevel) {
sendParticle(serverLevel, ModParticleTypes.FIRE_STAR.get(), this.getX(), this.getY() + 2.5, this.getZ(), 4, 0.2, 0.2, 0.2, 0.2, false);
}
if (source.is(ModDamageTypes.PROJECTILE_BOOM)) {
amount *= 1.2f;
}
if (source.is(ModDamageTypes.CANNON_FIRE)) {
amount *= 2f;
}
if (source.is(ModDamageTypes.GUN_FIRE)) {
amount *= 0.2f;
}
if (source.is(ModDamageTypes.GUN_FIRE_ABSOLUTE)) {
amount *= 0.3f;
}
if (source.is(ModDamageTypes.VEHICLE_STRIKE)) {
amount *= 0.4f;
}
this.level().playSound(null, this.getOnPos(), ModSounds.HIT.get(), SoundSource.PLAYERS, 1, 1);
this.hurt(0.5f * Math.max(amount - 13, 0));
return true;
}
public double getSubmergedHeight(Entity entity) {
for (FluidType fluidType : ForgeRegistries.FLUID_TYPES.get().getValues()) {
if (entity.level().getFluidState(entity.blockPosition()).getFluidType() == fluidType)
return entity.getFluidTypeHeight(fluidType);
}
return 0;
}
@Override
public void baseTick() {
turretYRotO = this.getTurretYRot();
turretXRotO = this.getTurretXRot();
leftWheelRotO = this.getLeftWheelRot();
rightWheelRotO = this.getRightWheelRot();
super.baseTick();
if (this.entityData.get(TRACK_R) < 0) {
this.entityData.set(TRACK_R, 100f);
}
if (this.entityData.get(TRACK_R) > 100) {
this.entityData.set(TRACK_R, 0f);
}
if (this.entityData.get(TRACK_L) < 0) {
this.entityData.set(TRACK_L, 100f);
}
if (this.entityData.get(TRACK_L) > 100) {
this.entityData.set(TRACK_L, 0f);
}
if (this.entityData.get(HEAT) > 0) {
this.entityData.set(HEAT, this.entityData.get(HEAT) - 1);
}
if (this.entityData.get(FIRE_ANIM) > 0) {
this.entityData.set(FIRE_ANIM, this.entityData.get(FIRE_ANIM) - 1);
}
if (this.entityData.get(HEAT) < 40) {
cannotFire = false;
}
if (this.entityData.get(COAX_HEAT) > 0) {
this.entityData.set(COAX_HEAT, this.entityData.get(COAX_HEAT) - 1);
}
if (this.entityData.get(COAX_HEAT) < 40) {
cannotFireCoax = false;
}
if (this.level() instanceof ServerLevel) {
Player player = (Player) this.getFirstPassenger();
if (player != null) {
if ((this.getItemStacks().stream().filter(stack -> stack.is(ModItems.RIFLE_AMMO_BOX.get())).mapToInt(ItemStack::getCount).sum() > 0 && this.getEntityData().get(LOADED_COAX_AMMO) < 500)) {
this.entityData.set(LOADED_COAX_AMMO, this.getEntityData().get(LOADED_COAX_AMMO) + 30);
this.getItemStacks().stream().filter(stack -> stack.is(ModItems.RIFLE_AMMO_BOX.get())).findFirst().ifPresent(stack -> stack.shrink(1));
}
if ((this.getItemStacks().stream().filter(stack -> stack.is(ModItems.RIFLE_AMMO.get())).mapToInt(ItemStack::getCount).sum() > 0 && this.getEntityData().get(LOADED_COAX_AMMO) < 500)) {
this.entityData.set(LOADED_COAX_AMMO, this.getEntityData().get(LOADED_COAX_AMMO) + 5);
this.getItemStacks().stream().filter(stack -> stack.is(ModItems.RIFLE_AMMO.get())).findFirst().ifPresent(stack -> stack.shrink(1));
}
}
if (this.getEntityData().get(WEAPON_TYPE) == 0) {
this.entityData.set(AMMO, this.getItemStacks().stream().filter(stack -> stack.is(ModItems.SMALL_SHELL.get())).mapToInt(ItemStack::getCount).sum());
} else {
this.entityData.set(AMMO, this.getEntityData().get(LOADED_COAX_AMMO));
}
}
// if (this.level() instanceof ServerLevel) {
// this.entityData.set(AMMO, this.getItemStacks().stream().filter(stack -> stack.is(ModItems.HEAVY_AMMO.get())).mapToInt(ItemStack::getCount).sum());
// }
Entity driver = this.getFirstPassenger();
if (driver instanceof Player player) {
if (this.entityData.get(HEAT) > 100) {
cannotFire = true;
if (!player.level().isClientSide() && player instanceof ServerPlayer serverPlayer) {
SoundTool.playLocalSound(serverPlayer, ModSounds.MINIGUN_OVERHEAT.get(), 1f, 1f);
}
}
if (this.entityData.get(COAX_HEAT) > 100) {
cannotFireCoax = true;
if (!player.level().isClientSide() && player instanceof ServerPlayer serverPlayer) {
SoundTool.playLocalSound(serverPlayer, ModSounds.MINIGUN_OVERHEAT.get(), 1f, 1f);
}
}
}
double fluidFloat;
fluidFloat = 0.052 * getSubmergedHeight(this);
this.setDeltaMovement(this.getDeltaMovement().add(0.0, fluidFloat, 0.0));
if (this.onGround()) {
float f0 = 0.54f + 0.25f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.05 * this.getDeltaMovement().horizontalDistance())));
this.setDeltaMovement(this.getDeltaMovement().multiply(f0, 0.85, f0));
} else if (this.isInWater()) {
float f1 = 0.74f + 0.09f * Mth.abs(90 - (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1))) / 90;
this.setDeltaMovement(this.getDeltaMovement().add(this.getViewVector(1).normalize().scale(0.04 * this.getDeltaMovement().horizontalDistance())));
this.setDeltaMovement(this.getDeltaMovement().multiply(f1, 0.85, f1));
} else {
this.setDeltaMovement(this.getDeltaMovement().multiply(0.99, 0.95, 0.99));
}
if (this.level() instanceof ServerLevel serverLevel && this.isInWater() && this.getDeltaMovement().length() > 0.1) {
sendParticle(serverLevel, ParticleTypes.CLOUD, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 4 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true);
sendParticle(serverLevel, ParticleTypes.BUBBLE_COLUMN_UP, this.getX() + 0.5 * this.getDeltaMovement().x, this.getY() + getSubmergedHeight(this) - 0.2, this.getZ() + 0.5 * this.getDeltaMovement().z, (int) (2 + 10 * this.getDeltaMovement().length()), 0.65, 0, 0.65, 0, true);
}
float deltaT = Math.abs(getTurretYRot() - turretYRotO);
while (getTurretYRot() > 180F) {
setTurretYRot(getTurretYRot() - 360F);
turretYRotO = getTurretYRot() - deltaT;
}
while (getTurretYRot() <= -180F) {
setTurretYRot(getTurretYRot() + 360F);
turretYRotO = deltaT + getTurretYRot();
}
collideBlock();
gunnerAngle();
lowHealthWarning();
this.refreshDimensions();
}
@Override
public void move(@NotNull MoverType movementType, @NotNull Vec3 movement) {
super.move(movementType, movement);
if (this.isInWater() && horizontalCollision) {
setDeltaMovement(this.getDeltaMovement().add(0,0.07,0));
}
}
public boolean zooming() {
Entity driver = this.getFirstPassenger();
if (driver == null) return false;
if (driver instanceof Player player) {
return player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).zoom;
}
return false;
}
@Override
public void vehicleShoot(Player player) {
Matrix4f transform = getBarrelTransform();
if (entityData.get(WEAPON_TYPE) == 0) {
if (this.cannotFire) return;
float x = -0.1125f;
float y = 0.174025f;
float z = 4.2f;
Vector4f worldPosition = transformPosition(transform, x, y, z);
SmallCannonShellEntity smallCannonShell = new SmallCannonShellEntity(player, this.level(),
VehicleConfig.BMP_2_CANNON_DAMAGE.get(),
VehicleConfig.BMP_2_CANNON_EXPLOSION_DAMAGE.get(),
VehicleConfig.BMP_2_CANNON_EXPLOSION_RADIUS.get().floatValue());
smallCannonShell.setPos(worldPosition.x - 1.1 * this.getDeltaMovement().x, worldPosition.y, worldPosition.z - 1.1 * this.getDeltaMovement().z);
smallCannonShell.shoot(getBarrelVector(1).x, getBarrelVector(1).y + 0.005f, getBarrelVector(1).z, 22,
0.25f);
this.level().addFreshEntity(smallCannonShell);
sendParticle((ServerLevel) this.level(), ParticleTypes.LARGE_SMOKE, worldPosition.x - 1.1 * this.getDeltaMovement().x, worldPosition.y, worldPosition.z - 1.1 * this.getDeltaMovement().z, 1, 0.02, 0.02, 0.02, 0, false);
float pitch = this.entityData.get(HEAT) <= 60 ? 1 : (float) (1 - 0.011 * java.lang.Math.abs(60 - this.entityData.get(HEAT)));
if (!player.level().isClientSide) {
if (player instanceof ServerPlayer serverPlayer) {
serverPlayer.playSound(ModSounds.LAV_CANNON_FIRE_3P.get(), 4, pitch);
serverPlayer.playSound(ModSounds.LAV_CANNON_FAR.get(), 12, pitch);
serverPlayer.playSound(ModSounds.LAV_CANNON_VERYFAR.get(), 24, pitch);
}
}
Level level = player.level();
final Vec3 center = new Vec3(this.getX(), this.getEyeY(), this.getZ());
for (Entity target : level.getEntitiesOfClass(Entity.class, new AABB(center, center).inflate(4), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) {
if (target instanceof ServerPlayer serverPlayer) {
ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new ShakeClientMessage(6, 5, 9, this.getX(), this.getEyeY(), this.getZ()));
}
}
this.entityData.set(HEAT, this.entityData.get(HEAT) + 7);
this.entityData.set(FIRE_ANIM, 3);
this.getItemStacks().stream().filter(stack -> stack.is(ModItems.SMALL_SHELL.get())).findFirst().ifPresent(stack -> stack.shrink(1));
} else if (entityData.get(WEAPON_TYPE) == 1) {
if (this.cannotFireCoax) return;
float x = 0.1125f;
float y = 0.174025f;
float z = 2f;
Vector4f worldPosition = transformPosition(transform, x, y, z);
if (this.entityData.get(LOADED_COAX_AMMO) > 0 || player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))) {
ProjectileEntity projectileRight = new ProjectileEntity(player.level())
.shooter(player)
.damage(9.5f)
.headShot(2f)
.zoom(false);
projectileRight.bypassArmorRate(0.2f);
projectileRight.setPos(worldPosition.x - 1.1 * this.getDeltaMovement().x, worldPosition.y, worldPosition.z - 1.1 * this.getDeltaMovement().z);
projectileRight.shoot(player, getBarrelVector(1).x, getBarrelVector(1).y + 0.002f, getBarrelVector(1).z, 36,
0.25f);
this.level().addFreshEntity(projectileRight);
if (!player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))) {
this.entityData.set(LOADED_COAX_AMMO, this.getEntityData().get(LOADED_COAX_AMMO) - 1);
}
}
this.entityData.set(COAX_HEAT, this.entityData.get(COAX_HEAT) + 3);
this.entityData.set(FIRE_ANIM, 2);
if (!player.level().isClientSide) {
if (player instanceof ServerPlayer serverPlayer) {
serverPlayer.playSound(ModSounds.M_60_FIRE_3P.get(), 3, 1);
serverPlayer.playSound(ModSounds.M_60_FAR.get(), 6, 1);
serverPlayer.playSound(ModSounds.M_60_VERYFAR.get(), 12, 1);
}
}
}
}
public final Vec3 getBarrelVector(float pPartialTicks) {
return this.calculateViewVector(this.getBarrelXRot(pPartialTicks), this.getBarrelYRot(pPartialTicks));
}
public float getBarrelXRot(float pPartialTicks) {
return Mth.lerp(pPartialTicks, turretXRotO - this.xRotO, getTurretXRot() - this.getXRot());
}
public float getBarrelYRot(float pPartialTick) {
return -Mth.lerp(pPartialTick, turretYRotO - this.yRotO, getTurretYRot() - this.getYRot());
}
/**
* 撞掉莲叶和冰块
*/
public void collideBlock() {
AABB aabb = AABB.ofSize(new Vec3(this.getX(), this.getY() + this.getBbHeight() * 0.5, this.getZ()), 3.6, 2.6, 3.6);
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
if (blockstate.is(Blocks.LILY_PAD)) {
this.level().destroyBlock(pos, true);
}
});
}
@Override
public void travel() {
Entity passenger0 = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
if (this.getEnergy() <= 0) return;
if (passenger0 == null) {
this.leftInputDown = false;
this.rightInputDown = false;
this.forwardInputDown = false;
this.backInputDown = false;
this.entityData.set(POWER, 0f);
}
if (forwardInputDown) {
this.entityData.set(POWER, Math.min(this.entityData.get(POWER) + (this.entityData.get(POWER) < 0 ? 0.016f : 0.0024f), 0.21f));
}
if (backInputDown) {
this.entityData.set(POWER, Math.max(this.entityData.get(POWER) - (this.entityData.get(POWER) > 0 ? 0.016f : 0.0024f), -0.16f));
}
if (rightInputDown) {
this.entityData.set(DELTA_ROT, this.entityData.get(DELTA_ROT) - 0.1f);
} else if (this.leftInputDown) {
this.entityData.set(DELTA_ROT, this.entityData.get(DELTA_ROT) + 0.1f);
}
if (this.forwardInputDown || this.backInputDown) {
this.extraEnergy(VehicleConfig.SPEEDBOAT_ENERGY_COST.get());
}
this.entityData.set(POWER, this.entityData.get(POWER) * (upInputDown ? 0.5f : (rightInputDown || leftInputDown) ? 0.947f : 0.96f));
this.entityData.set(DELTA_ROT, this.entityData.get(DELTA_ROT) * (float)Math.max(0.76f - 0.1f * this.getDeltaMovement().horizontalDistance(), 0.3));
float angle = (float) calculateAngle(this.getDeltaMovement(), this.getViewVector(1));
double s0;
if (Mth.abs(angle) < 90) {
s0 = this.getDeltaMovement().horizontalDistance();
} else {
s0 = -this.getDeltaMovement().horizontalDistance();
}
this.setLeftWheelRot((float) ((this.getLeftWheelRot() - 1.25 * s0) + Mth.clamp(0.75f * this.entityData.get(DELTA_ROT), -5f, 5f)));
this.setRightWheelRot((float) ((this.getRightWheelRot() - 1.25 * s0) - Mth.clamp(0.75f * this.entityData.get(DELTA_ROT), -5f, 5f)));
this.entityData.set(TRACK_L, (float) ((entityData.get(TRACK_L) - 1.7 * Math.PI * s0) + Mth.clamp(0.75f * Math.PI * this.entityData.get(DELTA_ROT), -5f, 5f)));
this.entityData.set(TRACK_R, (float) ((entityData.get(TRACK_R) - 1.7 * Math.PI * s0) - Mth.clamp(0.75f * Math.PI * this.entityData.get(DELTA_ROT), -5f, 5f)));
if (this.isInWater() || onGround()) {
this.setYRot((float) (this.getYRot() - Math.max(isInWater() && !onGround() ? 2.5 : 6, 0) * entityData.get(DELTA_ROT) * (this.entityData.get(POWER) >= 0 ? 1 : -1)));
this.setDeltaMovement(this.getDeltaMovement().add(Mth.sin(-this.getYRot() * 0.017453292F) * (!isInWater() && !onGround() ? 0.13f : (isInWater() && !onGround() ? 2f : 2.4)) * this.entityData.get(POWER), 0.0, Mth.cos(this.getYRot() * 0.017453292F) * (!isInWater() && !onGround() ? 0.13f : (isInWater() && !onGround() ? 2f : 2.4)) * this.entityData.get(POWER)));
}
}
private void gunnerAngle() {
Entity driver = this.getFirstPassenger();
if (driver == null) return;
float gunAngle = -Mth.wrapDegrees(driver.getYHeadRot() - this.getYRot());
float diffY;
float diffX;
diffY = Mth.wrapDegrees(gunAngle - getTurretYRot() + 0.05f);
diffX = Mth.wrapDegrees(driver.getXRot() - this.getTurretXRot());
this.setTurretXRot(Mth.clamp(this.getTurretXRot() + Mth.clamp(0.95f * diffX, -5, 5), -74f, 7.5f));
this.setTurretYRot(this.getTurretYRot() + Mth.clamp(0.95f * diffY, -15, 15));
}
@Override
public float turretYRotO() {
return turretYRotO;
}
@Override
public float turretYRot() {
return turretYRot;
}
@Override
public Vec3 getBarrelVec(float ticks) {
return getBarrelVector(ticks);
}
public float getTurretYRot() {
return this.turretYRot;
}
public void setTurretYRot(float pTurretYRot) {
this.turretYRot = pTurretYRot;
}
public float getTurretXRot() {
return this.turretXRot;
}
public void setTurretXRot(float pTurretXRot) {
this.turretXRot = pTurretXRot;
}
public float getLeftWheelRot() {
return this.leftWheelRot;
}
public void setLeftWheelRot(float pLeftWheelRot) {
this.leftWheelRot = pLeftWheelRot;
}
public float getRightWheelRot() {
return this.rightWheelRot;
}
public void setRightWheelRot(float pRightWheelRot) {
this.rightWheelRot = pRightWheelRot;
}
@Override
public SoundEvent getEngineSound() {
return ModSounds.LAV_ENGINE.get();
}
@Override
public void positionRider(@NotNull Entity passenger, @NotNull MoveFunction callback) {
// From Immersive_Aircraft
if (!this.hasPassenger(passenger)) {
return;
}
Matrix4f transform = getTurretTransform();
float x = 0.5f;
float y = 0.1f;
float z = 0.75f;
y += (float) passenger.getMyRidingOffset();
int i = this.getPassengers().indexOf(passenger);
if (i == 0) {
Vector4f worldPosition = transformPosition(transform, x, y, z);
passenger.setPos(worldPosition.x, worldPosition.y, worldPosition.z);
callback.accept(passenger, worldPosition.x, worldPosition.y, worldPosition.z);
}
}
public Matrix4f getBarrelTransform() {
Matrix4f transformT = getTurretTransform();
float x = 0f;
float y = 0.5541f;
float z = 0.83004375f;
Vector4f worldPosition = transformPosition(transformT, x, y, z);
Matrix4f transform = new Matrix4f();
transform.translate(worldPosition.x, worldPosition.y, worldPosition.z);
transform.rotate(Axis.YP.rotationDegrees(getTurretYRot() - getYRot()));
transform.rotate(Axis.XP.rotationDegrees(getTurretXRot()));
transform.rotate(Axis.ZP.rotationDegrees(getRoll()));
return transform;
}
public Matrix4f getTurretTransform() {
Matrix4f transformT = getVehicleTransform();
float x = 0f;
float y = 2f;
float z = -0.703125f;
Vector4f worldPosition = transformPosition(transformT, x, y, z);
Matrix4f transform = new Matrix4f();
transform.translate(worldPosition.x, worldPosition.y, worldPosition.z);
transform.rotate(Axis.YP.rotationDegrees(getTurretYRot() - getYRot()));
transform.rotate(Axis.XP.rotationDegrees(getXRot()));
transform.rotate(Axis.ZP.rotationDegrees(getRoll()));
return transform;
}
@Override
public void destroy() {
Entity attacker = EntityFindUtil.findEntity(this.level(), this.entityData.get(LAST_ATTACKER_UUID));
if (level() instanceof ServerLevel) {
CustomExplosion explosion = new CustomExplosion(this.level(), this,
ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 80f,
this.getX(), this.getY(), this.getZ(), 5f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1);
explosion.explode();
net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion);
explosion.finalizeExplosion(false);
ParticleTool.spawnMediumExplosionParticles(this.level(), this.position());
}
List<Entity> passengers = this.getPassengers();
for (var entity : passengers) {
if (entity instanceof LivingEntity living) {
var tempAttacker = living == attacker ? null : attacker;
living.hurt(ModDamageTypes.causeVehicleExplosionDamage(this.level().registryAccess(), null, tempAttacker), Integer.MAX_VALUE);
living.invulnerableTime = 0;
living.hurt(ModDamageTypes.causeVehicleExplosionDamage(this.level().registryAccess(), null, tempAttacker), Integer.MAX_VALUE);
living.invulnerableTime = 0;
living.hurt(ModDamageTypes.causeVehicleExplosionDamage(this.level().registryAccess(), null, tempAttacker), Integer.MAX_VALUE);
living.invulnerableTime = 0;
living.hurt(ModDamageTypes.causeVehicleExplosionDamage(this.level().registryAccess(), null, tempAttacker), Integer.MAX_VALUE);
living.invulnerableTime = 0;
living.hurt(ModDamageTypes.causeVehicleExplosionDamage(this.level().registryAccess(), null, tempAttacker), Integer.MAX_VALUE);
}
}
this.discard();
}
protected void clampRotation(Entity entity) {
float f = Mth.wrapDegrees(entity.getXRot());
float f1 = Mth.clamp(f, -74F, 7.5F);
entity.xRotO += f1 - f;
entity.setXRot(entity.getXRot() + f1 - f);
}
@Override
public void onPassengerTurned(Entity entity) {
this.clampRotation(entity);
}
private PlayState firePredicate(AnimationState<Bmp2Entity> event) {
if (this.entityData.get(FIRE_ANIM) > 1 && entityData.get(WEAPON_TYPE) == 0) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.lav.fire"));
}
if (this.entityData.get(FIRE_ANIM) > 0 && entityData.get(WEAPON_TYPE) == 1) {
return event.setAndContinue(RawAnimation.begin().thenPlay("animation.lav.fire2"));
}
return event.setAndContinue(RawAnimation.begin().thenLoop("animation.lav.idle"));
}
@Override
public void registerControllers(AnimatableManager.ControllerRegistrar data) {
data.add(new AnimationController<>(this, "movement", 0, this::firePredicate));
}
@Override
public AnimatableInstanceCache getAnimatableInstanceCache() {
return this.cache;
}
@Override
public float ignoreExplosionHorizontalKnockBack() {
return -0.9f;
}
@Override
public float ignoreExplosionVerticalKnockBack() {
return -0.9f;
}
@Override
public int getMaxEnergy() {
return MAX_ENERGY;
}
@Override
public float getMaxHealth() {
return MAX_HEALTH;
}
@Override
public boolean isDriver(Player player) {
return player == this.getFirstPassenger();
}
@Override
public int mainGunRpm() {
if (entityData.get(WEAPON_TYPE) == 0) {
return 250;
} else if (entityData.get(WEAPON_TYPE) == 1) {
return 750;
}
return 250;
}
@Override
public boolean canShoot(Player player) {
if (entityData.get(WEAPON_TYPE) == 0) {
return (this.entityData.get(AMMO) > 0 || player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))) && !cannotFire;
} else if (entityData.get(WEAPON_TYPE) == 1) {
return (this.entityData.get(LOADED_COAX_AMMO) > 0 || player.getInventory().hasAnyMatching(s -> s.is(ModItems.CREATIVE_AMMO_BOX.get()))) && !cannotFireCoax;
}
return false;
}
@Override
public int getAmmoCount(Player player) {
return this.entityData.get(AMMO);
}
@Override
public boolean banHand() {
return true;
}
@Override
public boolean hidePassenger() {
return true;
}
@Override
public int zoomFov() {
return 3;
}
@Override
public void changeWeapon() {
if (entityData.get(WEAPON_TYPE) == 0) {
this.level().playSound(null, this, ModSounds.INTO_MISSILE.get(), this.getSoundSource(), 1, 1);
entityData.set(WEAPON_TYPE, 1);
} else if (entityData.get(WEAPON_TYPE) == 1) {
entityData.set(WEAPON_TYPE, 0);
this.level().playSound(null, this, ModSounds.INTO_CANNON.get(), this.getSoundSource(), 1, 1);
}
}
@Override
public int getWeaponType() {
return entityData.get(WEAPON_TYPE);
}
}

View file

@ -0,0 +1,9 @@
package com.atsuishio.superbwarfare.entity.vehicle;
import net.minecraft.world.phys.Vec3;
public interface ILandArmorEntity extends IArmedVehicleEntity {
float turretYRotO();
float turretYRot();
Vec3 getBarrelVec(float ticks);
}

View file

@ -62,7 +62,7 @@ import java.util.List;
import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle;
public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IChargeEntity, IArmedVehicleEntity, MultiWeaponVehicleEntity {
public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IChargeEntity, ILandArmorEntity, 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);
@ -343,10 +343,10 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
SmallCannonShellEntity smallCannonShell = new SmallCannonShellEntity(player, this.level(),
VehicleConfig.LAV_150_CANNON_DAMAGE.get(),
VehicleConfig.LAV_150_CANNON_EXPLOSION_DAMAGE.get(),
VehicleConfig.LAV_150_CANNON_EXPLOSION_RADIUS.get());
VehicleConfig.LAV_150_CANNON_EXPLOSION_RADIUS.get().floatValue());
smallCannonShell.setPos(worldPosition.x - 1.1 * this.getDeltaMovement().x, worldPosition.y, worldPosition.z - 1.1 * this.getDeltaMovement().z);
smallCannonShell.shoot(getBarrelVector(1).x, getBarrelVector(1).y + 0.005f, getBarrelVector(1).z, 22,
smallCannonShell.shoot(getBarrelVector(1).x, getBarrelVector(1).y + 0.005f, getBarrelVector(1).z, 24,
0.25f);
this.level().addFreshEntity(smallCannonShell);
@ -406,9 +406,9 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
if (!player.level().isClientSide) {
if (player instanceof ServerPlayer serverPlayer) {
serverPlayer.playSound(ModSounds.M_60_FIRE_3P.get(), 3, 1);
serverPlayer.playSound(ModSounds.M_60_FAR.get(), 6, 1);
serverPlayer.playSound(ModSounds.M_60_VERYFAR.get(), 12, 1);
serverPlayer.playSound(ModSounds.RPK_FIRE_3P.get(), 3, 1);
serverPlayer.playSound(ModSounds.RPK_FAR.get(), 6, 1);
serverPlayer.playSound(ModSounds.RPK_VERYFAR.get(), 12, 1);
}
}
}
@ -434,17 +434,7 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
AABB aabb = AABB.ofSize(new Vec3(this.getX(), this.getY() + this.getBbHeight() * 0.5, this.getZ()), 3.6, 2.6, 3.6);
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
if (blockstate.is(Blocks.LILY_PAD) || blockstate.is(Blocks.ICE) || blockstate.is(Blocks.FROSTED_ICE)
// || blockstate.is(Blocks.BAMBOO)
// || blockstate.is(Blocks.GLASS_PANE)
// || blockstate.getBlock() instanceof FenceBlock
// || blockstate.getBlock() instanceof DoorBlock
// || blockstate.getBlock() instanceof LeavesBlock
// || blockstate.getBlock() instanceof FenceGateBlock
// || blockstate.getBlock() instanceof BambooSaplingBlock
// || blockstate.getBlock() instanceof GlassBlock
// || blockstate.getBlock() instanceof StainedGlassPaneBlock
) {
if (blockstate.is(Blocks.LILY_PAD)) {
this.level().destroyBlock(pos, true);
}
});
@ -522,6 +512,21 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
this.setTurretYRot(this.getTurretYRot() + Mth.clamp(0.95f * diffY, -20, 20));
}
@Override
public float turretYRotO() {
return turretYRotO;
}
@Override
public float turretYRot() {
return turretYRot;
}
@Override
public Vec3 getBarrelVec(float ticks) {
return getBarrelVector(ticks);
}
public float getTurretYRot() {
return this.turretYRot;
}

View file

@ -731,6 +731,17 @@ public class ClientEventHandler {
}
}
if (iVehicle instanceof Bmp2Entity bmp2) {
if (multiWeaponVehicle.getWeaponType() == 0) {
float pitch = bmp2.getEntityData().get(HEAT) <= 60 ? 1 : (float) (1 - 0.011 * java.lang.Math.abs(60 - bmp2.getEntityData().get(HEAT)));
player.playSound(ModSounds.LAV_CANNON_FIRE_1P.get(), 1f, pitch);
player.playSound(ModSounds.SHELL_CASING_50CAL.get(), 0.3f, 1);
} else if (multiWeaponVehicle.getWeaponType() == 1) {
float pitch = bmp2.getEntityData().get(COAX_HEAT) <= 60 ? 1 : (float) (1 - 0.011 * java.lang.Math.abs(60 - bmp2.getEntityData().get(COAX_HEAT)));
player.playSound(ModSounds.COAX_FIRE_1P.get(), 1f, pitch);
}
}
}
}

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.event;
import com.atsuishio.superbwarfare.entity.vehicle.Ah6Entity;
import com.atsuishio.superbwarfare.entity.vehicle.Bmp2Entity;
import com.atsuishio.superbwarfare.entity.vehicle.Lav150Entity;
import com.atsuishio.superbwarfare.entity.vehicle.MobileVehicleEntity;
import com.atsuishio.superbwarfare.init.ModSounds;
@ -21,6 +22,7 @@ import org.joml.Math;
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;
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
@ -63,6 +65,14 @@ public class ClientSoundHandler {
player.level().playLocalSound(BlockPos.containing(engineSoundPos), engineSound, mobileVehicle.getSoundSource(), 5 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) - 0.006f) * distanceReduce * distanceReduce, (float) ((2 * Math.random() - 1) * 0.1f + 1), false);
}
}
if (e instanceof Bmp2Entity bmp2) {
distanceReduce = (float) Math.max((1 - distance / 64), 0);
if (player.getVehicle() == bmp2) {
player.playSound(ModSounds.LAV_ENGINE_1P.get(), 2 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) + Mth.abs(0.08f * mobileVehicle.getEntityData().get(DELTA_ROT)) - 0.004f), (float) ((2 * Math.random() - 1) * 0.1f + 0.95f));
} else {
player.level().playLocalSound(BlockPos.containing(engineSoundPos), engineSound, mobileVehicle.getSoundSource(), 5 * (Mth.abs(mobileVehicle.getEntityData().get(POWER)) + Mth.abs(0.08f * mobileVehicle.getEntityData().get(DELTA_ROT)) - 0.004f) * distanceReduce * distanceReduce, (float) ((2 * Math.random() - 1) * 0.1f + 1), false);
}
}
}
}
}

View file

@ -82,6 +82,8 @@ public class ModEntities {
EntityType.Builder.<Tom6Entity>of(Tom6Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Tom6Entity::new).fireImmune().sized(1.05f, 1.0f));
public static final RegistryObject<EntityType<MelonBombEntity>> MELON_BOMB = register("melon_bomb",
EntityType.Builder.<MelonBombEntity>of(MelonBombEntity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(1).setCustomClientFactory(MelonBombEntity::new).sized(1f, 1f));
public static final RegistryObject<EntityType<Bmp2Entity>> BMP_2 = register("bmp_2",
EntityType.Builder.<Bmp2Entity>of(Bmp2Entity::new, MobCategory.MISC).setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(Bmp2Entity::new).fireImmune().sized(4f, 3f));
private static <T extends Entity> RegistryObject<EntityType<T>> register(String name, EntityType.Builder<T> entityTypeBuilder) {
return REGISTRY.register(name, () -> entityTypeBuilder.build(name));

View file

@ -39,5 +39,6 @@ public class ModEntityRenderers {
event.registerEntityRenderer(ModEntities.SMALL_CANNON_SHELL.get(), SmallCannonShellRenderer::new);
event.registerEntityRenderer(ModEntities.TOM_6.get(), Tom6Renderer::new);
event.registerEntityRenderer(ModEntities.MELON_BOMB.get(), MelonBombEntityRenderer::new);
event.registerEntityRenderer(ModEntities.BMP_2.get(), Bmp2Renderer::new);
}
}

View file

@ -107,9 +107,10 @@ public class ModTabs {
output.accept(ContainerBlockItem.createInstance(ModEntities.MLE_1934.get()));
output.accept(ContainerBlockItem.createInstance(ModEntities.ANNIHILATOR.get()));
output.accept(ContainerBlockItem.createInstance(ModEntities.SPEEDBOAT.get(), true));
output.accept(ContainerBlockItem.createInstance(ModEntities.WHEEL_CHAIR.get()));
output.accept(ContainerBlockItem.createInstance(ModEntities.AH_6.get()));
output.accept(ContainerBlockItem.createInstance(ModEntities.LAV_150.get()));
output.accept(ContainerBlockItem.createInstance(ModEntities.BMP_2.get()));
output.accept(ContainerBlockItem.createInstance(ModEntities.WHEEL_CHAIR.get()));
output.accept(ContainerBlockItem.createInstance(ModEntities.TOM_6.get()));
} else {
output.accept(registryObject.get());

View file

@ -58,16 +58,20 @@ public abstract class CameraMixin {
setRotation(Mth.lerp(partialTicks, player.yBobO, player.yBob), Mth.lerp(partialTicks, player.xBobO, player.xBob));
setPosition(Mth.lerp(partialTicks, boat.xo + CameraPos.x, boat.getX() + CameraPos.x), Mth.lerp(partialTicks, boat.yo + CameraPos.y, boat.getY() + CameraPos.y), Mth.lerp(partialTicks, boat.zo + CameraPos.z, boat.getZ() + CameraPos.z));
info.cancel();
return;
}
if ((player.getVehicle() instanceof Lav150Entity lav150 && lav150.getFirstPassenger() == player) && (Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON || ClientEventHandler.zoomVehicle)) {
setRotation(-Mth.lerp(partialTicks, lav150.turretYRotO - lav150.yRotO, lav150.getTurretYRot() - lav150.getYRot()), Mth.lerp(partialTicks, lav150.turretXRotO - lav150.xRotO, lav150.getTurretXRot() - lav150.getXRot()));
setPosition(Mth.lerp(partialTicks, player.xo, player.getX()), Mth.lerp(partialTicks, player.yo + player.getEyeHeight(), player.getEyeY()), Mth.lerp(partialTicks, player.zo, player.getZ()));
info.cancel();
return;
}
if ((player.getVehicle() instanceof Bmp2Entity bmp2 && bmp2.getFirstPassenger() == player) && (Minecraft.getInstance().options.getCameraType() == CameraType.FIRST_PERSON || ClientEventHandler.zoomVehicle)) {
setRotation(-Mth.lerp(partialTicks, bmp2.turretYRotO - bmp2.yRotO, bmp2.getTurretYRot() - bmp2.getYRot()), Mth.lerp(partialTicks, bmp2.turretXRotO - bmp2.xRotO, bmp2.getTurretXRot() - bmp2.getXRot()));
setPosition(Mth.lerp(partialTicks, player.xo, player.getX()), Mth.lerp(partialTicks, player.yo + player.getEyeHeight(), player.getEyeY()), Mth.lerp(partialTicks, player.zo, player.getZ()));
info.cancel();
return;
}
@ -136,6 +140,11 @@ public abstract class CameraMixin {
move(-getMaxZoom(2.75), 1, 0.0);
return;
}
if (thirdPerson && entity.getVehicle() instanceof Bmp2Entity && !ClientEventHandler.zoomVehicle) {
move(-getMaxZoom(3), 1, 0.0);
return;
}
if (Minecraft.getInstance().options.getCameraType() == CameraType.THIRD_PERSON_BACK && entity instanceof Player player && player.getMainHandItem().is(ModTags.Items.GUN)) {
move(-getMaxZoom(-2.9 * Math.max(ClientEventHandler.pullPos, ClientEventHandler.zoomPos)), 0, -ClientEventHandler.cameraLocation * Math.max(ClientEventHandler.pullPos, ClientEventHandler.zoomPos));
}

View file

@ -50,6 +50,10 @@ public class MouseHandlerMixin {
return ClientEventHandler.zoomVehicle ? 0.23 : 0.3;
}
if (player.getVehicle() instanceof Bmp2Entity) {
return ClientEventHandler.zoomVehicle ? 0.22 : 0.27;
}
if (player.getVehicle() instanceof Ah6Entity ah6Entity && !ah6Entity.onGround() && ah6Entity.getFirstPassenger() == player) {
return 0.3;
}

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 KiB

After

Width:  |  Height:  |  Size: 28 KiB