BattlePlugins / BattleArena

A complete match and event framework for creating arenas and minigames in Minecraft. Supports creating modes through config files, or fully custom modes through plugins.
https://docs.battleplugins.org/shelves/battlearena
GNU General Public License v3.0
20 stars 22 forks source link

hats being lost #69

Closed tara81 closed 2 months ago

tara81 commented 8 years ago

Battlearena does not save any item on the head that is worn besides helmets.

This is bad for servers with custom hats /hat as they will lose their hat.

Europia79 commented 8 years ago

What plugin are you using for custom hats ? with the /hat command ?

tara81 commented 8 years ago

its called customhats

tara81 commented 8 years ago

http://dev.bukkit.org/bukkit-plugins/custom-hat/

Zach443 commented 8 years ago

Do you have woolTeams enabled?

tara81 commented 8 years ago

only in my minigames that have teams. Kind of like it that way especially since now I cannot use the scoreboard ..

Zach443 commented 8 years ago

Right no, this shouldn't be a problem. If you were it might hint that BA isn't handling the switch between wool and your hats properly. Just trying to figure out where the problem is occurring.

On Apr 15, 2016, at 11:41 AM, tara81 notifications@github.com wrote:

only in my minigames that have teams. Kind of like it that way especially since now I cannot use the scoreboard ..

— You are receiving this because you commented. Reply to this email directly or view it on GitHub

tara81 commented 8 years ago

It appears from testing it is when using woolheads :/

Zach443 commented 8 years ago

Is there anything like a NullPointerException when players leave the arena where this occurs? Also can you paste your ArenaConfig.yml (or whichever game type this is happening)

Zach443 commented 8 years ago

Test this out for that fix ^ http://rainbowcraft.sytes.net/download/plugins/BattleArena/v3.9.10.15/

tara81 commented 8 years ago

your fix didnt fix it.

Europia79 commented 8 years ago

Can you paste your entire /BattleArena/ folder... this is probably caused by a mis-configuration in one of your files.

tara81 commented 8 years ago

BombArena.zip BattleArena.zip yes yes you know i pasted my folder in the bombarena tickets -.-

Europia79 commented 8 years ago

Just as one example, here is your /plugins/BattleArena/competitions/ArenaConfig.yml

configVersion: 2.0
Arena:
    enabled: true
    type: arena
    database: arena
    rated: true
    prefix: "&6[Arena]&e"
    teamSize: 1
    nTeams: 2
    times:
      matchTime: 300
    onPrestart:
        options: [pvpOff, teleportIn, deEnchant, teleportWaitroom, itemDropOff]
    onStart:
        options: [dropItemOff]
    onJoin:
        options: [pvpOff, blockBreakOff, itemDropOff]
    preReqs:
        options: []
    onEnter:
        options: [storeAll]
    onLeave:
        options: [restoreAll]
    onStart:
        options: [teleportIn, pvpOn, blockBreakOff, itemDropOff]
    onSpawn:
        options: [deEnchant, giveItems, hunger=20, health=20]
        giveClass:
            default: champion
        items: # ignored if options doesnt have "giveItems"
            - bread: 5
    onDeath: 
        options: [clearInventory]
    onVictory:
        options: [dropItemOff, dontannounce]
    onComplete:
        options: [teleportOut, clearInventory, wgClearRegion, wgNoEnter]
    winner:
        options: [health=20, hunger=20, money=40]
        doCommands:
            - console loot give player arenawin
    losers:
        doCommands:
            - console loot give player arenalose  
    firstPlace:
        options: [enchants, experience=100, giveItems]
        enchants:
            - speed:2:900
            - resistance:2:200
            - haste:1:900
            - regen:1:200
        items: 
            - cake: 1
            - iron_ingot: 1
        doCommands:
            - console loot give player tourneywin

Here's the default:

Arena:
  prefix: '&6[Arena]&e'
  signDisplayName: '&6[Arena]'
  gameSize:
    nTeams: '2'
    teamSize: '1'
  nLives: '1'
  victoryCondition: LastManStanding
  times: {}
  tracking:
    database: arena
    rated: true
    useTrackerMessages: false
  defaults:
    options:
    - woolTeams
  onEnter:
    options:
    - storeExperience
    - storeGamemode
    - storeItems
    - storeHealth
    - storeHunger
    - storeMagic
    - storeHeroClass
    - clearInventory
    - clearExperience
    - deEnchant
    - gameMode=SURVIVAL
    - flightOff
  onLeave:
    options:
    - restoreExperience
    - restoreGamemode
    - restoreItems
    - restoreHealth
    - restoreHunger
    - restoreMagic
    - restoreHeroClass
    - clearInventory
    - deEnchant
  onStart:
    options:
    - teleportIn
    - pvpOn
    - blockBreakOff
  onComplete:
    options:
    - teleportOut
  onSpawn:
    giveClass:
      default: gladiator
    options:
    - health=20
    - hunger=20
    - respawnWithClass
  onDeath:
    options:
    - clearInventory
  winner:
    options:
    - health=20
    - hunger=20

The default ArenaConfig.yml has the clearInventory option for onEnter, onLeave and onDeath whereas yours has clearInventory for onComplete and onDeath. This could be the source of the missing hats.

https://github.com/BattlePlugins/BattleArena/blob/a489c906d497ee79041ab157850758c48cd8eadb/src/java/mc/alk/arena/util/InventoryUtil.java#L428-L466

Maybe you can test it out with the default ArenaConfig.yml and lemme know if that restores customs hats ? If so, changing the location of clearInventory option would be one possible solution. Another would be to change the above method to handle these types of scenarios differently.

tara81 commented 8 years ago

my arenaconfig doesnt have wool heads, so it doesnt cause custom hats to disapear.. Only my minigames with wool heads does it .. lol... BG and CTF

tara81 commented 8 years ago

so restoreitems and clearinventory in : OnLeave isn't clashing with each other ?

Europia79 commented 8 years ago

I think option woolTeams should be in arena.defaults.options: woolTeams ?

like this

arena:
    defaults:
        options: woolTeams

Did you test the default ArenaConfig.yml ?

Which one of your arena configs should i look at btw ? As in, which arena type(s) is giving you problems ?

tara81 commented 8 years ago

With this setup, the woolhats option still takes the players hat after they leave the game. I tested your default options . Still the wool hats minigames are taking the player hats !

http://pastebin.com/dnpLzqpS

tara81 commented 8 years ago

bump - woolhead causes the problem