Giter Site home page Giter Site logo

Armour Dupe about battlearena HOT 12 CLOSED

alkarinv avatar alkarinv commented on August 24, 2024
Armour Dupe

from battlearena.

Comments (12)

netherfoam avatar netherfoam commented on August 24, 2024

I'm also getting this issue with wool teams:
14:01:59 [WARNING] [BattleArena] Task #206 for BattleArena v3.6.8 generated an e
xception
java.lang.NullPointerException
at mc.alk.arena.util.TeamUtil.removeTeamHead(TeamUtil.java:70)
at mc.alk.arena.competition.match.PerformTransition.transition(PerformTr
ansition.java:193)
at mc.alk.arena.competition.match.PerformTransition.transition(PerformTr
ansition.java:71)
at mc.alk.arena.competition.match.PerformTransition.transition(PerformTr
ansition.java:49)
at mc.alk.arena.competition.match.Match$MatchCompleted.run(Match.java:30
7)
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:52)
at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(C
raftScheduler.java:321)
at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:509)
at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:213)
at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:473)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:405)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)

and after respawning I think its you I'm getting debug from, "Saved?" after respawning, i think.

The NPE may be caused by me not hitting respawn when the match ended?

from battlearena.

alkarinv avatar alkarinv commented on August 24, 2024

I save the armor and inventory at the same time, and only right before they are teleported in (within the same tick). It might be that I need to reupdate their inventory manually before I teleport them. Minecraft sometimes lazily updates players ( for example I had to make a workaround for experience because a player would craft something, and bukkit literally would not update their experience for minutes, so I would store their experience and it would really be wrong because bukkit hadn't updated it).

Here is a thread about that experience issue which i put in a fix for. http://forums.bukkit.org/threads/giving-player-experience-not-updating.81838/

That NPE I'll fix, should be easy.

Thanks for bringing this to me though.. Dupes are the worst sort of bug, and I'll try my best to fix this by tomorrow or the next day.

from battlearena.

alkarinv avatar alkarinv commented on August 24, 2024

So I've been trying to duplicate this dupe and I can't get it to work with or without MultiInv. I follow the same steps but it does nothing for me.

Is this still happening on your main server? If so I'd like to come on and take a look at it.

from battlearena.

netherfoam avatar netherfoam commented on August 24, 2024

I've "fixed" it by making it storeItems on start instead of clear inventory on preReq on the main server. So it's alright for now

from battlearena.

alkarinv avatar alkarinv commented on August 24, 2024

Thats bizarre, behind the scenes the preReqs clearInventory stores items/gamemode/exp when they teleport in.
Here is an example for an arena match. ( you can see these transitions by doing /bad enableDebugging transitions true
02:07:19 [INFO] transition arena1 onStart p= player1 ops=[MatchOptions=[blockBreakOff, teleportIn]] inArena=false
02:07:19 [INFO] transition arena1 onEnter p= player1 ops=[MatchOptions=[storeExperience, storeGamemode, storeItems, clearInventoryOnFirstEnter]] inArena=true

That was a very complicated way of saying I'm confused why your way would work, but the preReqs doesnt.

Happy you found a workaround though!!

Going to put up a most recent version of the code so you can compile, PluginUpdater will be on github too.

from battlearena.

alkarinv avatar alkarinv commented on August 24, 2024

Let me know if this still is happening? Or did the recent BattleArena changes fix this?

from battlearena.

netherfoam avatar netherfoam commented on August 24, 2024

If I run into it again I'll let you know

Still waiting on bukkit to approve your latest version

from battlearena.

netherfoam avatar netherfoam commented on August 24, 2024

Strange, I'm encountering this armour thing again.

How to replicate:

  1. /bg join - Battleground is in "arena" world. You start in "challenge_7" world
    (Battleground begins)
  2. Relog
    (Kicked out of battleground, plugin still thinks i'm playing when i /bg join again though )
    (Teleported back to challenge_7 world)
  3. You have your armour and wool team head

Replicated with http://pastebin.com/GYrhwLqz as the config.

Maybe related to wool teams?

I'm going to try add clearInventory to onComplete but I don't see that working?

Also question: Does the order matter in your event config? E.g. if I do
onComplete:
options: [ClearInventory, teleportOut]
Will it clear their inventory, and teleport them out after, the opposite order, or a 'random' order?

from battlearena.

netherfoam avatar netherfoam commented on August 24, 2024

Okay, clearInventory added to onComplete fixes players keeping armour but not wool heads.

But restoreItems should handle armour too?

from battlearena.

alkarinv avatar alkarinv commented on August 24, 2024

So restoreItems should handle items, if it's not then thats a bug.

clearInventory when used in onComplete is really a bad name.. it really does 4 things

  1. clears their inventory
  2. restores their items
  3. restores their game mode
  4. restores their experience

I should really change it to something different, i just didnt want people to have to write 4 things in an option where they will almost always want to do all of them.

The wool heads issue I'm sure is a bug, I will try to fix it as soon as I get back from vacation.

Let me know if you have more questions.. I can also talk via skype or come on teamspeak etc.

from battlearena.

netherfoam avatar netherfoam commented on August 24, 2024

Mmmhmm, thanks for helping even on vacation :P

Can I ask how does restoreItems work? Does it remove any new items the player has acquired since saveItems?

from battlearena.

alkarinv avatar alkarinv commented on August 24, 2024

restoreItems doesn't remove any items. So it's safe to call anywhere.

What it does is give back the players items from whenever saveItems was called.

Once it's used once, it remove the player from a hash, so repeatedly calling restoreItems does nothing.

from battlearena.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.