Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't edit damage on Non-GenericGuns (Grenades,,MiningDrill,Chainsaw,CombatKnife,PowerHammer) #294

Open
RobinTeens opened this issue Sep 17, 2023 · 0 comments

Comments

@RobinTeens
Copy link

Using CraftTweaker to edit gun damages, using:
import mods.techguns.GunStats;
GunStats.setWeaponStat("handcannon","DAMAGE",20);
It works very well.

However, when editing Grenades, using this:
GunStats.setWeaponStat("fraggrenade","DAMAGE",50);
GunStats.setWeaponStat("fraggrenade","DAMAGE_MIN",50);
I get this on minecraft text:
techgun.items.guns.GenericGrenade cannot be cast to techguns.items.guns.GenericGun

I change those grenades order to the bottom, but instead getting error from other gun types (non-genericguns).
Here's the error log:

crafttweaker.log


> [INITIALIZATION][CLIENT][ERROR] [crafttweaker]: Error executing {[0:crafttweaker]: Techgun_Tweak_Damage.zs}: techguns.items.tools.TGSword cannot be cast to techguns.items.guns.GenericGun
> java.lang.ClassCastException: techguns.items.tools.TGSword cannot be cast to techguns.items.guns.GenericGun
> 	at techguns.plugins.crafttweaker.GunStatTweaker$setGunStatAction.<init>(GunStatTweaker.java:40)
> 	at techguns.plugins.crafttweaker.GunStatTweaker.setWeaponStat(GunStatTweaker.java:18)
> 	at Techgun_Tweak_Damage.__script__(Techgun_Tweak_Damage.zs:72)
> 	at __ZenMain__.run(Techgun_Tweak_Damage)
> 	at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:240)
> 	at crafttweaker.runtime.CrTTweaker.loadScript(CrTTweaker.java:105)
> 	at crafttweaker.mc1120.events.CommonEventHandler.registerRecipes(CommonEventHandler.java:71)
> 	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_716_CommonEventHandler_registerRecipes_Register.invoke(.dynamic)
> 	at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)
> 	at net.minecraftforge.fml.common.eventhandler.EventBus$1.invoke(EventBus.java:144)
> 	at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)
> 	at net.minecraftforge.registries.GameData.fireRegistryEvents(GameData.java:857)
> 	at net.minecraftforge.common.crafting.CraftingHelper.loadRecipes(CraftingHelper.java:636)
> 	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:747)
> 	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336)
> 	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535)
> 	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378)
> 	at net.minecraft.client.main.Main.main(SourceFile:123)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:497)
> 	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
> 	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

Lookin deeper on GunStatTweaker.java,, it doesn't have import for other guns/weapons, except:
import techguns.items.guns.GenericGun;
Is that what preventing me to edit damage on non-GenericGuns?
Any idea how to implement damage tweaking to other non-GenericGuns?

@RobinTeens RobinTeens changed the title Can't edit damage on Non-GenericGuns (Grenades,Rockets,MiningDrill,Chainsaw,etc) Can't edit damage on Non-GenericGuns (Grenades,,MiningDrill,Chainsaw,CombatKnife,PowerHammer) Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant