TheXFactor117 / Levels

A small, Minecraft mod focused around the aspect of weapon and armor leveling.
GNU General Public License v2.0
24 stars 19 forks source link

References to Client code on Server #119

Closed dshadowwolf closed 7 years ago

dshadowwolf commented 7 years ago

It appears you are trying to do the right thing in not referencing deprecated code, but the non-deprecated I18n code is client-side only. Got this when crafting an axe on a server with the most recent release of Levels on Curse (3.0.0-beta):

java.lang.NoClassDefFoundError: net/minecraft/client/resources/I18n
        at com.thexfactor117.levels.leveling.Attribute.getName(Attribute.java:145) ~[Attribute.class:?]
        at com.thexfactor117.levels.leveling.Attribute.addAttribute(Attribute.java:111) ~[Attribute.class:?]
        at com.thexfactor117.levels.util.WeaponHelper.getRandomizedAttributes(WeaponHelper.java:168) ~[WeaponHelper.class:?]
        at com.thexfactor117.levels.util.WeaponHelper.create(WeaponHelper.java:64) ~[WeaponHelper.class:?]
        at com.thexfactor117.levels.event.EventCreateWeapon.create(EventCreateWeapon.java:62) ~[EventCreateWeapon.class:?]
        at com.thexfactor117.levels.event.EventCreateWeapon.onPlayerTick(EventCreateWeapon.java:37) ~[EventCreateWeapon.class:?]
Cntrldfusion commented 7 years ago

Same here, causes a server crash every time.

crash-2017-05-10_12.49.41-server.txt crash-2017-05-10_12.51.21-server.txt crash-2017-05-10_12.53.34-server.txt crash-2017-05-10_12.55.19-server.txt

Nachtflame commented 7 years ago

For me, it's not causing a server crash, just dumping the client every time they connect until I delete their player data.

Terpo commented 7 years ago

As far as I can see it also is kind of game breaking when its getting fixed. Problem is, that the localized name is saved as the nbt value. Somehow you have to split your getName calls. One that only shows up when the client is displaying the tooltip and one that is used for everything else on server side. I really hope this can be fixed in the near future. For now I deactivated the mod on the server. :(

TheXFactor117 commented 7 years ago

Ah that's my fault. I'll fix this.

TheXFactor117 commented 7 years ago

This should be fixed now.

Terpo commented 7 years ago

There is still something wrong: https://gist.githubusercontent.com/Terpo/a820b1a6c81ec3f2c463d11141836a7b/raw/4ef5c9f1e73afabee323afb94640e87941d9ec2f/gistfile1.txt

Its stilll a server <-> client problem where the client gets kicked from the game.

Search for:

java.lang.NoSuchMethodError: net.minecraft.item.ItemArmor.func_185083_B_()Lnet/minecraft/inventory/EntityEquipmentSlot;
at com.thexfactor117.levels.util.WeaponHelper.setAttributeModifiers(WeaponHelper.java:107) ~[WeaponHelper.class:?]
at com.thexfactor117.levels.util.WeaponHelper.create(WeaponHelper.java:67) ~[WeaponHelper.class:?]
at com.thexfactor117.levels.event.EventCreateWeapon.create(EventCreateWeapon.java:62) ~[EventCreateWeapon.class:?]
at com.thexfactor117.levels.event.EventCreateWeapon.onPlayerTick(EventCreateWeapon.java:37) ~[EventCreateWeapon.class:?]
    @SideOnly(Side.CLIENT)
    public EntityEquipmentSlot getEquipmentSlot()
    {
        return this.armorType;
    }