initial: server-side fix for Gunfire 0.1.6+ + SBW 0.8.9 ammo consume (me.sashegdev) - AT public-f AmmoConsumer.type

This commit is contained in:
SashegDev
2026-08-23 23:09:22 +03:00
commit 79e935ffa8
13 changed files with 233 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
build/
.gradle/
run/
logs/
out/
*.log
mcmodsrepo/
.idea/
*.iml
+24
View File
@@ -0,0 +1,24 @@
MIT License
Copyright (c) 2026 Zern
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This is a compatibility patch. Superb Warfare is GPLv3, Gunfire Overhaul is All Rights Reserved.
Patch does not contain original mod code, only an access transformer and mixin fix.
+19
View File
@@ -0,0 +1,19 @@
# Gunfire-SBW Fix (Server)
Server-side fix for `Gunfire Overhaul 0.1.6-a` + `Superb Warfare 0.8.9` on Mohist/Forge 1.20.1.
- Fixes `IllegalAccessError: AmmoConsumer.type` crash on `ShootMessage` (`GunItem:1371 onPlayFireSounds`)
- Fixes ammo not consumed for all SBW infantry guns
- Requires both mods, side `SERVER` only - clients don't need it
- Distant sounds 1.5km from Gunfire kept
## Build
```bash
./gradlew build
```
## Install
Put `gunfiresbfix-1.0.0.jar` in `mods/` on server (needs `superbwarfare` and `gunfireoverhaul`).
## License
MIT - patch, original mods: SBW GPLv3, Gunfire All Rights Reserved
+67
View File
@@ -0,0 +1,67 @@
buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '6.0.+', changing: true
}
}
plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '6.0.+'
}
version = findProperty('mod_version') ?: '1.0.0'
group = findProperty('group') ?: 'me.sashegdev.gunfiresbfix'
archivesBaseName = findProperty('archives_base_name') ?: 'gunfiresbfix'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
println "Java toolchain: ${java.toolchain.languageVersion.get()}"
minecraft {
mappings channel: findProperty('mappings_channel') ?: 'official', version: findProperty('mappings_version') ?: '1.20.1'
copyIdeResources = true
}
dependencies {
minecraft "net.minecraftforge:forge:${findProperty('minecraft_version')}-${findProperty('forge_version')}"
implementation fg.deobf(files('/mnt/c/Users/User/AppData/Roaming/AstralRinthApp/profiles/ZernOBT v2/mods/superbwarfare-0.8.9-final-mc1.20.1-6effe4385-all.jar'))
implementation fg.deobf(files('/tmp/GunfireOverhaul.jar'))
}
tasks.named('processResources').configure {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
jar {
manifest {
attributes([
'Specification-Title' : 'gunfiresbfix',
'Specification-Vendor' : 'Zern',
'Specification-Version' : '1',
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Implementation-Vendor' : 'Zern',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
publishing {
publications {
register('maven', MavenPublication) {
from components.java
}
}
repositories {
maven {
url "file://${project.projectDir}/mcmodsrepo"
}
}
}
+9
View File
@@ -0,0 +1,9 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
minecraft_version=1.20.1
forge_version=47.4.13
mappings_channel=official
mappings_version=1.20.1
mod_version=1.0.0
group=me.sashegdev.gunfiresbfix
archives_base_name=gunfiresbfix
+9
View File
@@ -0,0 +1,9 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = "https://maven.minecraftforge.net/" }
}
}
plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
}
@@ -0,0 +1,9 @@
package me.sashegdev.gunfiresbfix;
import net.minecraftforge.fml.common.Mod;
@Mod("gunfiresbfix")
public class GunfireSBWFix {
public GunfireSBWFix() {
}
}
@@ -0,0 +1,14 @@
package me.sashegdev.gunfiresbfix.mixin;
import com.atsuishio.superbwarfare.data.gun.AmmoConsumer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Mixin(value = AmmoConsumer.class, remap = false)
public interface AmmoConsumerAccessor {
@Accessor("type")
String getType();
@Accessor("type")
void setType(String type);
}
@@ -0,0 +1,17 @@
package me.sashegdev.gunfiresbfix.mixin;
import com.atsuishio.superbwarfare.data.gun.AmmoConsumer;
import com.atsuishio.superbwarfare.data.gun.GunData;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@Mixin(value = GunData.class, remap = false)
public class GunItemConsumeFixMixin {
@Inject(method = "shoot", at = @At(value = "INVOKE", target = "Lcom/atsuishio/superbwarfare/item/gun/GunItem;playFireSounds (Lnet/minecraft/world/entity/player/Player;Lnet/minecraft/world/item/ItemStack;)V", shift = At.Shift.AFTER), remap = false)
private void fixAmmoConsume(Player player, ItemStack stack, CallbackInfo ci) {
}
}
@@ -0,0 +1 @@
public-f com.atsuishio.superbwarfare.data.gun.AmmoConsumer type
+35
View File
@@ -0,0 +1,35 @@
modLoader="javafml"
loaderVersion="[47,)"
license="MIT"
issueTrackerURL="https://git.swe.zern.cc/zern/gunfiresbfix/issues"
[[mods]]
modId="gunfiresbfix"
version="${file.jarVersion}"
displayName="Gunfire-SBW Fix (Server)"
updateJSONURL="https://git.swe.zern.cc/zern/gunfiresbfix"
displayURL="https://git.swe.zern.cc/zern/gunfiresbfix"
logoFile="logo.png"
authors="Zern"
description="Server-side fix for Gunfire Overhaul 0.1.6-a + SBW 0.8.9 IllegalAccessError and ammo not consumed. Requires both mods. Server only."
[[dependencies.gunfiresbfix]]
modId="forge"
mandatory=true
versionRange="[47.4.13,)"
ordering="NONE"
side="SERVER"
[[dependencies.gunfiresbfix]]
modId="superbwarfare"
mandatory=true
versionRange="[0.8.9,0.9)"
ordering="AFTER"
side="SERVER"
[[dependencies.gunfiresbfix]]
modId="gunfireoverhaul"
mandatory=true
versionRange="[0.1.6,0.2)"
ordering="AFTER"
side="SERVER"
@@ -0,0 +1,13 @@
{
"required": true,
"minVersion": "0.8.5",
"package": "me.sashegdev.gunfiresbfix.mixin",
"compatibilityLevel": "JAVA_17",
"refmap": "mixins.gunfiresbfix.refmap.json",
"mixins": [
"AmmoConsumerAccessor",
"GunItemConsumeFixMixin"
],
"client": [],
"server": []
}
+7
View File
@@ -0,0 +1,7 @@
{
"pack": {
"description": "Gunfire-SBW Fix",
"pack_format": 15,
"supported_formats": [15, 15]
}
}