1. Le forum de Minecraft-France va définitivement fermer ses portes. Celui-ci restera en lecture seule mais vous ne pourrez plus y apporter de nouveaux topics. Nous vous invitons à nous rejoindre sur le Discord de Minecraft-France qui permet de présenter vos projets, discuter avec la communauté etc.. Merci à tous d'avoir fait vivre ce forum de nombreuses années. Pour nous rejoindre sur Discord, Cliquez ici

Résolu serveur CraftBukkit crash table d'enchantement

Discussion dans 'Serveurs' créé par Bayram, 12 Sept 2015.

  1. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme
    Bonjour à la communauté de Minecraft-France.

    Je me tourne à vous car je n'arrive malheureusement pas à régler mon souci.
    Car en effet, mon serveur Minecraft 1.7.2 tourne sous CraftBukkit que j'ai moi même moddé (oui j'ai encore les sources) Bref.

    Alors voilà mon souci, le serveur démarre correctement, mais quand on est sur le serveur et que l'on fait un clique droit (donc pour ouvrir) la table d'enchantement, le serveur crash

    Voici le Crash-Report du serveur


    ---- Minecraft Crash Report ----
    // I just don't know what went wrong :(

    Time: 06/09/15 16:40
    Description: Exception in server tick loop

    java.lang.AbstractMethodError
    at net.minecraft.server.v1_7_R1.Container.transferTo(Container.java:34)
    at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callInventoryOpenEvent(CraftEventFactory.java:575)
    at net.minecraft.server.v1_7_R1.EntityPlayer.startEnchanting(EntityPlayer.java:585)
    at net.minecraft.server.v1_7_R1.BlockEnchantmentTable.interact(BlockEnchantmentTable.java:30)
    at net.minecraft.server.v1_7_R1.PlayerInteractManager.interact(PlayerInteractManager.java:383)
    at net.minecraft.server.v1_7_R1.PlayerConnection.a(PlayerConnection.java:628)
    at net.minecraft.server.v1_7_R1.PacketPlayInBlockPlace.a(SourceFile:60)
    at net.minecraft.server.v1_7_R1.PacketPlayInBlockPlace.handle(SourceFile:9)
    at net.minecraft.server.v1_7_R1.NetworkManager.a(NetworkManager.java:146)
    at net.minecraft.server.v1_7_R1.ServerConnection.c(SourceFile:134)
    at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:655)
    at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250)
    at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545)
    at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457)
    at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617)


    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------

    -- System Details --
    Details:
    Minecraft Version: 1.7.2
    Operating System: Linux (amd64) version 3.14-0.bpo.2-amd64
    Java Version: 1.7.0, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 182784616 bytes (174 MB) / 518979584 bytes (494 MB) up to 30360076288 bytes (28953 MB)
    JVM Flags: 21 total; -Xms512M -XX:PermSize=384m -XX:MaxPermSize=768m -XX:-UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseNUMA -XX:+CMSParallelRemarkEnabled -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:UseSSE=3 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+UseCompressedOops -XX:+OptimizeStringConcat -XX:+AggressiveOpts -XX:ParallelGCThreads=1
    AABB Pool Size: 1362 (76272 bytes; 0 MB) allocated, 56 (3136 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94
    CraftBukkit Information:
    Running: CraftBukkit version git-Bukkit-unknown (MC: 1.7.2) (Implementing API version 1.7.2-R0.3) false
    Plugins: { GroupManager v2.1.31 (Phoenix) org.anjocaido.groupmanager.GroupManager [AnjoCaido, Gabriel Couto, ElgarL], WorldEdit v5.6 com.sk89q.worldedit.bukkit.WorldEditPlugin [], VoxelSniper v5.168.9-SNAPSHOT-jnks278 com.thevoxelbox.voxelsniper.VoxelSniper [przerwap, MikeMatrix, Gavjenks, giltwist, psanker, Deamon5550, DivineRage], mcore v7.0.2 com.massivecraft.mcore.MCore [Cayorion], Vault v1.2.27-b349 net.milkbowl.vault.Vault [cereal, Sleaker, mung3r], Multiverse-Core v2.5-b678 com.onarandombox.MultiverseCore.MultiverseCore [Rigby, fernferret, lithium3141, main--], HealthBar v1.8.2 com.gmail.filoghost.healthbar.Main [filoghost], JSONAPI v5.4.0 com.alecgorge.minecraft.jsonapi.JSONAPI [Alec Gorge], CombatTag v6.1.0 com.trc202.CombatTag.CombatTag [cheddar262], WorldGuard v5.9 com.sk89q.worldguard.bukkit.WorldGuardPlugin [], WarpPortals v5.6.3 com.mccraftaholics.warpportals.bukkit.PortalPlugin [], GlobalMarket v1.2.2 com.survivorserver.GlobalMarket.Market [], HyperStats v2.3 me.mcfabian99.hyperstats.Hyperstats [MCFabian99], AutoMessage v2.3.5 com.TeamNovus.AutoMessage.AutoMessage [ELCHILEN0], ColoredSignss v3.7 Release com.xErik75125690x.ColoredSigns.ColoredSigns [xErik75125690x], CoreProtect v2.0.8 net.coreprotect.CoreProtect [Intelli], ClearLag v2.8.2 me.minebuilders.clearlag.Clearlag [bob7l], HolographicDisplays v1.3.1 com.gmail.filoghost.holograms.HolographicDisplays [], Essentials v2.12.1 com.earth2me.essentials.Essentials [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, md_5, Iaccidentally], EssentialsProtect v2.12.1 com.earth2me.essentials.protect.EssentialsProtect [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits], EssentialsSpawn v2.12.1 com.earth2me.essentials.spawn.EssentialsSpawn [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits], EssentialsAntiBuild v2.12.1 com.earth2me.essentials.antibuild.EssentialsAntiBuild [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, Iaccidentally], AuthMe v3.0.4 fr.xephi.authme.AuthMe [Xephi59], EssentialsChat v2.12.1 com.earth2me.essentials.chat.EssentialsChat [Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans, Xeology, KHobbits, md_5, Okamosy, Iaccidentally], Factions v2.3.0 com.massivecraft.factions.Factions [Cayorion, Brettflan],}
    Warnings: DEFAULT
    Threads: { RUNNABLE Netty IO #3: [sun.nio.ch.PollArrayWrapper.poll0(Native Method), sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117), sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73), sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98), net.minecraft.util.io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:591), net.minecraft.util.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:301), net.minecraft.util.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-96: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], TIMED_WAITING pool-4-thread-1: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082), java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1090), java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:807), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-109: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], TIMED_WAITING Thread-49: [java.lang.Thread.sleep(Native Method), net.coreprotect.thread.CacheCleanUp.run(CacheCleanUp.java:14), java.lang.Thread.run(Thread.java:722)], TIMED_WAITING Snooper Timer: [java.lang.Object.wait(Native Method), java.util.TimerThread.mainLoop(Timer.java:552), java.util.TimerThread.run(Timer.java:505)], RUNNABLE DestroyJavaVM: [], RUNNABLE Server thread: [java.lang.Thread.dumpThreads(Native Method), java.lang.Thread.getAllStackTraces(Thread.java:1618), org.bukkit.craftbukkit.v1_7_R1.CraftCrashReport.call(CraftCrashReport.java:28), net.minecraft.server.v1_7_R1.CrashReportSystemDetails.a(SourceFile:74), net.minecraft.server.v1_7_R1.CrashReport.h(CrashReport.java:45), net.minecraft.server.v1_7_R1.CrashReport.<init>(CrashReport.java:33), net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:474), net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617)], RUNNABLE Signal Dispatcher: [], WAITING WebSocketWorker-116: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-102: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], RUNNABLE Netty IO #2: [sun.nio.ch.PollArrayWrapper.poll0(Native Method), sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117), sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73), sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98), net.minecraft.util.io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:591), net.minecraft.util.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:301), net.minecraft.util.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-123: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-125: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING Reference Handler: [java.lang.Object.wait(Native Method), java.lang.Object.wait(Object.java:503), java.lang.ref.Reference$ReferenceHandler.run(Reference.java:133)], WAITING WebSocketWorker-126: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-112: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], TIMED_WAITING process reaper: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460), java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359), java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-119: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], RUNNABLE WebsocketSelector127: [sun.nio.ch.PollArrayWrapper.poll0(Native Method), sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117), sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73), sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:102), org.java_websocket.server.WebSocketServer.run(WebSocketServer.java:298), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-118: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-124: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-110: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-104: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-99: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-97: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING Finalizer: [java.lang.Object.wait(Native Method), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151), java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:177)], WAITING Chunk I/O Executor Thread-1: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-98: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-115: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-108: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-95: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-103: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], RUNNABLE Thread-12: [java.net.PlainSocketImpl.socketAccept(Native Method), java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:396), java.net.ServerSocket.implAccept(ServerSocket.java:522), java.net.ServerSocket.accept(ServerSocket.java:490), com.alecgorge.minecraft.jsonapi.NanoHTTPD$1.run(NanoHTTPD.java:286), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-120: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], RUNNABLE Thread-14: [java.net.PlainSocketImpl.socketAccept(Native Method), java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:396), java.net.ServerSocket.implAccept(ServerSocket.java:522), java.net.ServerSocket.accept(ServerSocket.java:490), com.alecgorge.minecraft.jsonapi.JSONSocketServer.run(JSONSocketServer.java:48), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-105: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING Java2D Disposer: [java.lang.Object.wait(Native Method), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:135), java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:151), sun.java2d.Disposer.run(Disposer.java:145), java.lang.Thread.run(Thread.java:722)], TIMED_WAITING MStore ExamineThread: [java.lang.Thread.sleep(Native Method), com.massivecraft.mcore.store.ExamineThread.run(ExamineThread.java:55)], TIMED_WAITING Thread-50: [java.lang.Thread.sleep(Native Method), net.coreprotect.consumer.Consumer.run(Consumer.java:47), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-114: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], TIMED_WAITING Server Infinisleeper: [java.lang.Thread.sleep(Native Method), net.minecraft.server.v1_7_R1.ThreadSleepForever.run(SourceFile:62)], WAITING WebSocketWorker-117: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], RUNNABLE Netty IO #0: [sun.nio.ch.PollArrayWrapper.poll0(Native Method), sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117), sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73), sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98), net.minecraft.util.io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:591), net.minecraft.util.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:301), net.minecraft.util.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101), java.lang.Thread.run(Thread.java:722)], RUNNABLE Query Listener #1: [java.net.PlainDatagramSocketImpl.receive0(Native Method), java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:135), java.net.DatagramSocket.receive(DatagramSocket.java:775), net.minecraft.server.v1_7_R1.RemoteStatusListener.run(SourceFile:256), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-111: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-106: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], RUNNABLE Netty IO #4: [sun.nio.ch.PollArrayWrapper.poll0(Native Method), sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117), sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73), sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98), net.minecraft.util.io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:591), net.minecraft.util.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:301), net.minecraft.util.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101), java.lang.Thread.run(Thread.java:722)], TIMED_WAITING File IO Thread: [java.lang.Thread.sleep(Native Method), net.minecraft.server.v1_7_R1.FileIOThread.b(SourceFile:44), net.minecraft.server.v1_7_R1.FileIOThread.run(SourceFile:23), java.lang.Thread.run(Thread.java:722)], TIMED_WAITING pool-3-thread-43: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460), java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359), java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603), java.lang.Thread.run(Thread.java:722)], TIMED_WAITING pool-3-thread-44: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226), java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460), java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:359), java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:942), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603), java.lang.Thread.run(Thread.java:722)], RUNNABLE Server console handler: [java.io.FileInputStream.readBytes(Native Method), java.io.FileInputStream.read(FileInputStream.java:242), java.io.BufferedInputStream.fill(BufferedInputStream.java:235), java.io.BufferedInputStream.read(BufferedInputStream.java:254), java.io.FilterInputStream.read(FilterInputStream.java:83), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader$1.read(ConsoleReader.java:167), org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:267), org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader.read(InputStreamReader.java:204), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readCharacter(ConsoleReader.java:995), org.bukkit.craftbukkit.libs.jline.console.ConsoleReader.readLine(ConsoleReader.java:1167), net.minecraft.server.v1_7_R1.ThreadCommandReader.run(ThreadCommandReader.java:32)], WAITING WebSocketWorker-107: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING Thread-5: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), net.minecraft.util.com.mojang.util.QueueLogAppender.getNextLogEvent(QueueLogAppender.java:73), org.bukkit.craftbukkit.v1_7_R1.util.TerminalConsoleWriterThread.run(TerminalConsoleWriterThread.java:25), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-101: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-121: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-100: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING WebSocketWorker-113: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], RUNNABLE Netty IO #1: [sun.nio.ch.PollArrayWrapper.poll0(Native Method), sun.nio.ch.PollArrayWrapper.poll(PollArrayWrapper.java:117), sun.nio.ch.PollSelectorImpl.doSelect(PollSelectorImpl.java:73), sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:87), sun.nio.ch.SelectorImpl.select(SelectorImpl.java:98), net.minecraft.util.io.netty.channel.nio.NioEventLoop.select(NioEventLoop.java:591), net.minecraft.util.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:301), net.minecraft.util.io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101), java.lang.Thread.run(Thread.java:722)], WAITING WebSocketWorker-122: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), org.java_websocket.server.WebSocketServer$WebSocketWorker.run(WebSocketServer.java:705)], WAITING pool-6-thread-1: [sun.misc.Unsafe.park(Native Method), java.util.concurrent.locks.LockSupport.park(LockSupport.java:186), java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043), java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442), java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1043), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1103), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603), java.lang.Thread.run(Thread.java:722)],}
    Recent tasks from 34068-34098{WorldEdit:com.sk89q.worldedit.bukkit.SessionTimer@34109,}
    Profiler Position: N/A (disabled)
    Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
    Player Count: 2 / 9999; [EntityPlayer['_checconio84_'/39051, l='world', x=-17,62, y=48,00, z=-41,04](_checconio84_ at -17.61984971804339,48.0,-41.03763519120682), EntityPlayer['MrTazzManii9'/1442, l='world', x=-16,66, y=48,00, z=-40,20](MrTazzManii9 at -16.661828981352492,48.0,-40.198562651513)]
    Is Modded: Definitely; Server brand changed to 'CraftBukkit'
    Type: Dedicated Server (map_server.txt)



    Si il vous faut plus de précision à apporter, j'ai tout le nécessaire, merci de votre aide...


    Cordialement,
    TUS Bayram
     
    #1 Bayram, 12 Sept 2015
    Dernière édition: 12 Sept 2015
  2. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Salut,
    Tu n'a aucune erreur dans ton code moddé ? Car le crash indique une erreur java.lang.AbstractMethodError à la ligne 34 de la classe Container.
     
    • Amusant Amusant x 1
  3. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme

    D'après éclipse, aucune erreur, voici la class :


    package net.minecraft.server;

    import java.util.ArrayList;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Set;

    // CraftBukkit start
    import java.util.HashMap;
    import java.util.Map;
    import org.bukkit.craftbukkit.inventory.CraftInventory;
    import org.bukkit.craftbukkit.inventory.CraftItemStack;
    import org.bukkit.event.Event.Result;
    import org.bukkit.event.inventory.InventoryDragEvent;
    import org.bukkit.inventory.InventoryView;
    // CraftBukkit end

    public abstract class Container {

    public List b = new ArrayList();
    public List c = new ArrayList();
    public int windowId;
    private int f = -1;
    public int g; // CraftBukkit - private -> public
    private final Set h = new HashSet();
    protected List listeners = new ArrayList();
    private Set i = new HashSet();

    // CraftBukkit start
    public boolean checkReachable = true;
    public abstract InventoryView getBukkitView();
    public void transferTo(Container other, org.bukkit.craftbukkit.entity.CraftHumanEntity player) {
    InventoryView source = this.getBukkitView(), destination = other.getBukkitView();
    ((CraftInventory) source.getTopInventory()).getInventory().onClose(player);
    ((CraftInventory) source.getBottomInventory()).getInventory().onClose(player);
    ((CraftInventory) destination.getTopInventory()).getInventory().onOpen(player);
    ((CraftInventory) destination.getBottomInventory()).getInventory().onOpen(player);
    }
    // CraftBukkit end

    public Container() {}

    protected Slot a(Slot slot) {
    slot.rawSlotIndex = this.c.size();
    this.c.add(slot);
    this.b.add(null);
    return slot;
    }

    public void addSlotListener(ICrafting icrafting) {
    if (this.listeners.contains(icrafting)) {
    throw new IllegalArgumentException("Listener already listening");
    } else {
    this.listeners.add(icrafting);
    icrafting.a(this, this.a());
    this.b();
    }
    }

    public List a() {
    ArrayList arraylist = new ArrayList();

    for (int i = 0; i < this.c.size(); ++i) {
    arraylist.add(((Slot) this.c.get(i)).getItem());
    }

    return arraylist;
    }

    public void b() {
    for (int i = 0; i < this.c.size(); ++i) {
    ItemStack itemstack = ((Slot) this.c.get(i)).getItem();
    ItemStack itemstack1 = (ItemStack) this.b.get(i);

    if (!ItemStack.matches(itemstack1, itemstack)) {
    itemstack1 = itemstack == null ? null : itemstack.cloneItemStack();
    this.b.set(i, itemstack1);

    for (int j = 0; j < this.listeners.size(); ++j) {
    ((ICrafting) this.listeners.get(j)).a(this, i, itemstack1);
    }
    }
    }
    }

    public boolean a(EntityHuman entityhuman, int i) {
    return false;
    }

    public Slot a(IInventory iinventory, int i) {
    for (int j = 0; j < this.c.size(); ++j) {
    Slot slot = (Slot) this.c.get(j);

    if (slot.a(iinventory, i)) {
    return slot;
    }
    }

    return null;
    }

    public Slot getSlot(int i) {
    return (Slot) this.c.get(i);
    }

    public ItemStack b(EntityHuman entityhuman, int i) {
    Slot slot = (Slot) this.c.get(i);

    return slot != null ? slot.getItem() : null;
    }

    public ItemStack clickItem(int i, int j, int k, EntityHuman entityhuman) {
    ItemStack itemstack = null;
    PlayerInventory playerinventory = entityhuman.inventory;
    int l;
    ItemStack itemstack1;

    if (k == 5) {
    int i1 = this.g;

    this.g = c(j);
    if ((i1 != 1 || this.g != 2) && i1 != this.g) {
    this.d();
    } else if (playerinventory.getCarried() == null) {
    this.d();
    } else if (this.g == 0) {
    this.f = b(j);
    if (d(this.f)) {
    this.g = 1;
    this.h.clear();
    } else {
    this.d();
    }
    } else if (this.g == 1) {
    Slot slot = (Slot) this.c.get(i);

    if (slot != null && a(slot, playerinventory.getCarried(), true) && slot.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count > this.h.size() && this.b(slot)) {
    this.h.add(slot);
    }
    } else if (this.g == 2) {
    if (!this.h.isEmpty()) {
    itemstack1 = playerinventory.getCarried().cloneItemStack();
    l = playerinventory.getCarried().count;
    Iterator iterator = this.h.iterator();

    Map<Integer, ItemStack> draggedSlots = new HashMap<Integer, ItemStack>(); // CraftBukkit - Store slots from drag in map (raw slot id -> new stack)
    while (iterator.hasNext()) {
    Slot slot1 = (Slot) iterator.next();

    if (slot1 != null && a(slot1, playerinventory.getCarried(), true) && slot1.isAllowed(playerinventory.getCarried()) && playerinventory.getCarried().count >= this.h.size() && this.b(slot1)) {
    ItemStack itemstack2 = itemstack1.cloneItemStack();
    int j1 = slot1.e() ? slot1.getItem().count : 0;

    a(this.h, this.f, itemstack2, j1);
    if (itemstack2.count > itemstack2.getMaxStackSize()) {
    itemstack2.count = itemstack2.getMaxStackSize();
    }

    if (itemstack2.count > slot1.a()) {
    itemstack2.count = slot1.a();
    }

    l -= itemstack2.count - j1;
    draggedSlots.put(slot1.rawSlotIndex, itemstack2); // CraftBukkit - Put in map instead of setting
    }
    }

    // CraftBukkit start - InventoryDragEvent
    InventoryView view = getBukkitView();
    org.bukkit.inventory.ItemStack newcursor = CraftItemStack.asCraftMirror(itemstack1);
    newcursor.setAmount(l);
    Map<Integer, org.bukkit.inventory.ItemStack> eventmap = new HashMap<Integer, org.bukkit.inventory.ItemStack>();
    for (Map.Entry<Integer, ItemStack> ditem : draggedSlots.entrySet()) {
    eventmap.put(ditem.getKey(), CraftItemStack.asBukkitCopy(ditem.getValue()));
    }

    // It's essential that we set the cursor to the new value here to prevent item duplication if a plugin closes the inventory.
    ItemStack oldCursor = playerinventory.getCarried();
    playerinventory.setCarried(CraftItemStack.asNMSCopy(newcursor));

    InventoryDragEvent event = new InventoryDragEvent(view, (newcursor.getType() != org.bukkit.Material.AIR ? newcursor : null), CraftItemStack.asBukkitCopy(oldCursor), this.f == 1, eventmap); // Should be dragButton
    entityhuman.world.getServer().getPluginManager().callEvent(event);

    // Whether or not a change was made to the inventory that requires an update.
    boolean needsUpdate = event.getResult() != Result.DEFAULT;

    if (event.getResult() != Result.DENY) {
    for (Map.Entry<Integer, ItemStack> dslot : draggedSlots.entrySet()) {
    view.setItem(dslot.getKey(), CraftItemStack.asBukkitCopy(dslot.getValue()));
    }
    // The only time the carried item will be set to null is if the inventory is closed by the server.
    // If the inventory is closed by the server, then the cursor items are dropped. This is why we change the cursor early.
    if (playerinventory.getCarried() != null) {
    playerinventory.setCarried(CraftItemStack.asNMSCopy(event.getCursor()));
    needsUpdate = true;

    }
    } else {
    playerinventory.setCarried(oldCursor);
    }

    if (needsUpdate && entityhuman instanceof EntityPlayer) {
    ((EntityPlayer) entityhuman).updateInventory(this);
    }
    // CraftBukkit end
    }

    this.d();
    } else {
    this.d();
    }
    } else if (this.g != 0) {
    this.d();
    } else {
    Slot slot2;
    int k1;
    ItemStack itemstack3;

    if ((k == 0 || k == 1) && (j == 0 || j == 1)) {
    if (i == -999) {
    if (playerinventory.getCarried() != null && i == -999) {
    if (j == 0) {
    entityhuman.drop(playerinventory.getCarried(), true);
    playerinventory.setCarried((ItemStack) null);
    }

    if (j == 1) {
    // CraftBukkit start - Store a reference
    ItemStack itemstack4 = playerinventory.getCarried();
    if (itemstack4.count > 0) {
    entityhuman.drop(itemstack4.a(1), true);
    }

    if (itemstack4.count == 0) {
    // CraftBukkit end
    playerinventory.setCarried((ItemStack) null);
    }
    }
    }
    } else if (k == 1) {
    if (i < 0) {
    return null;
    }

    slot2 = (Slot) this.c.get(i);
    if (slot2 != null && slot2.a(entityhuman)) {
    itemstack1 = this.b(entityhuman, i);
    if (itemstack1 != null) {
    Item item = itemstack1.getItem();

    itemstack = itemstack1.cloneItemStack();
    if (slot2.getItem() != null && slot2.getItem().getItem() == item) {
    this.a(i, j, true, entityhuman);
    }
    }
    }
    } else {
    if (i < 0) {
    return null;
    }

    slot2 = (Slot) this.c.get(i);
    if (slot2 != null) {
    itemstack1 = slot2.getItem();
    ItemStack itemstack4 = playerinventory.getCarried();

    if (itemstack1 != null) {
    itemstack = itemstack1.cloneItemStack();
    }

    if (itemstack1 == null) {
    if (itemstack4 != null && slot2.isAllowed(itemstack4)) {
    k1 = j == 0 ? itemstack4.count : 1;
    if (k1 > slot2.a()) {
    k1 = slot2.a();
    }

    if (itemstack4.count >= k1) {
    slot2.set(itemstack4.a(k1));
    }

    if (itemstack4.count == 0) {
    playerinventory.setCarried((ItemStack) null);
    }
    }
    } else if (slot2.a(entityhuman)) {
    if (itemstack4 == null) {
    k1 = j == 0 ? itemstack1.count : (itemstack1.count + 1) / 2;
    itemstack3 = slot2.a(k1);
    playerinventory.setCarried(itemstack3);
    if (itemstack1.count == 0) {
    slot2.set((ItemStack) null);
    }

    slot2.a(entityhuman, playerinventory.getCarried());
    } else if (slot2.isAllowed(itemstack4)) {
    if (itemstack1.getItem() == itemstack4.getItem() && itemstack1.getData() == itemstack4.getData() && ItemStack.equals(itemstack1, itemstack4)) {
    k1 = j == 0 ? itemstack4.count : 1;
    if (k1 > slot2.a() - itemstack1.count) {
    k1 = slot2.a() - itemstack1.count;
    }

    if (k1 > itemstack4.getMaxStackSize() - itemstack1.count) {
    k1 = itemstack4.getMaxStackSize() - itemstack1.count;
    }

    itemstack4.a(k1);
    if (itemstack4.count == 0) {
    playerinventory.setCarried((ItemStack) null);
    }

    itemstack1.count += k1;
    } else if (itemstack4.count <= slot2.a()) {
    slot2.set(itemstack4);
    playerinventory.setCarried(itemstack1);
    }
    } else if (itemstack1.getItem() == itemstack4.getItem() && itemstack4.getMaxStackSize() > 1 && (!itemstack1.usesData() || itemstack1.getData() == itemstack4.getData()) && ItemStack.equals(itemstack1, itemstack4)) {
    k1 = itemstack1.count;
    if (k1 > 0 && k1 + itemstack4.count <= itemstack4.getMaxStackSize()) {
    itemstack4.count += k1;
    itemstack1 = slot2.a(k1);
    if (itemstack1.count == 0) {
    slot2.set((ItemStack) null);
    }

    slot2.a(entityhuman, playerinventory.getCarried());
    }
    }
    }

    slot2.f();
    }
    }
    } else if (k == 2 && j >= 0 && j < 9) {
    slot2 = (Slot) this.c.get(i);
    if (slot2.a(entityhuman)) {
    itemstack1 = playerinventory.getItem(j);
    boolean flag = itemstack1 == null || slot2.inventory == playerinventory && slot2.isAllowed(itemstack1);

    k1 = -1;
    if (!flag) {
    k1 = playerinventory.j();
    flag |= k1 > -1;
    }

    if (slot2.e() && flag) {
    itemstack3 = slot2.getItem();
    playerinventory.setItem(j, itemstack3.cloneItemStack());
    if ((slot2.inventory != playerinventory || !slot2.isAllowed(itemstack1)) && itemstack1 != null) {
    if (k1 > -1) {
    playerinventory.pickup(itemstack1);
    slot2.a(itemstack3.count);
    slot2.set((ItemStack) null);
    slot2.a(entityhuman, itemstack3);
    }
    } else {
    slot2.a(itemstack3.count);
    slot2.set(itemstack1);
    slot2.a(entityhuman, itemstack3);
    }
    } else if (!slot2.e() && itemstack1 != null && slot2.isAllowed(itemstack1)) {
    playerinventory.setItem(j, (ItemStack) null);
    slot2.set(itemstack1);
    }
    }
    } else if (k == 3 && entityhuman.abilities.canInstantlyBuild && playerinventory.getCarried() == null && i >= 0) {
    slot2 = (Slot) this.c.get(i);
    if (slot2 != null && slot2.e()) {
    itemstack1 = slot2.getItem().cloneItemStack();
    itemstack1.count = itemstack1.getMaxStackSize();
    playerinventory.setCarried(itemstack1);
    }
    } else if (k == 4 && playerinventory.getCarried() == null && i >= 0) {
    slot2 = (Slot) this.c.get(i);
    if (slot2 != null && slot2.e() && slot2.a(entityhuman)) {
    itemstack1 = slot2.a(j == 0 ? 1 : slot2.getItem().count);
    slot2.a(entityhuman, itemstack1);
    entityhuman.drop(itemstack1, true);
    }
    } else if (k == 6 && i >= 0) {
    slot2 = (Slot) this.c.get(i);
    itemstack1 = playerinventory.getCarried();
    if (itemstack1 != null && (slot2 == null || !slot2.e() || !slot2.a(entityhuman))) {
    l = j == 0 ? 0 : this.c.size() - 1;
    k1 = j == 0 ? 1 : -1;

    for (int l1 = 0; l1 < 2; ++l1) {
    for (int i2 = l; i2 >= 0 && i2 < this.c.size() && itemstack1.count < itemstack1.getMaxStackSize(); i2 += k1) {
    Slot slot3 = (Slot) this.c.get(i2);

    if (slot3.e() && a(slot3, itemstack1, true) && slot3.a(entityhuman) && this.a(itemstack1, slot3) && (l1 != 0 || slot3.getItem().count != slot3.getItem().getMaxStackSize())) {
    int j2 = Math.min(itemstack1.getMaxStackSize() - itemstack1.count, slot3.getItem().count);
    ItemStack itemstack5 = slot3.a(j2);

    itemstack1.count += j2;
    if (itemstack5.count <= 0) {
    slot3.set((ItemStack) null);
    }

    slot3.a(entityhuman, itemstack5);
    }
    }
    }
    }

    this.b();
    }
    }

    return itemstack;
    }

    public boolean a(ItemStack itemstack, Slot slot) {
    return true;
    }

    protected void a(int i, int j, boolean flag, EntityHuman entityhuman) {
    this.clickItem(i, j, 1, entityhuman);
    }

    public void b(EntityHuman entityhuman) {
    PlayerInventory playerinventory = entityhuman.inventory;

    if (playerinventory.getCarried() != null) {
    entityhuman.drop(playerinventory.getCarried(), false);
    playerinventory.setCarried((ItemStack) null);
    }
    }

    public void a(IInventory iinventory) {
    this.b();
    }

    public void setItem(int i, ItemStack itemstack) {
    this.getSlot(i).set(itemstack);
    }

    public boolean c(EntityHuman entityhuman) {
    return !this.i.contains(entityhuman);
    }

    public void a(EntityHuman entityhuman, boolean flag) {
    if (flag) {
    this.i.remove(entityhuman);
    } else {
    this.i.add(entityhuman);
    }
    }

    public abstract boolean a(EntityHuman entityhuman);

    protected boolean a(ItemStack itemstack, int i, int j, boolean flag) {
    boolean flag1 = false;
    int k = i;

    if (flag) {
    k = j - 1;
    }

    Slot slot;
    ItemStack itemstack1;

    if (itemstack.isStackable()) {
    while (itemstack.count > 0 && (!flag && k < j || flag && k >= i)) {
    slot = (Slot) this.c.get(k);
    itemstack1 = slot.getItem();
    if (itemstack1 != null && itemstack1.getItem() == itemstack.getItem() && (!itemstack.usesData() || itemstack.getData() == itemstack1.getData()) && ItemStack.equals(itemstack, itemstack1)) {
    int l = itemstack1.count + itemstack.count;

    if (l <= itemstack.getMaxStackSize()) {
    itemstack.count = 0;
    itemstack1.count = l;
    slot.f();
    flag1 = true;
    } else if (itemstack1.count < itemstack.getMaxStackSize()) {
    itemstack.count -= itemstack.getMaxStackSize() - itemstack1.count;
    itemstack1.count = itemstack.getMaxStackSize();
    slot.f();
    flag1 = true;
    }
    }

    if (flag) {
    --k;
    } else {
    ++k;
    }
    }
    }

    if (itemstack.count > 0) {
    if (flag) {
    k = j - 1;
    } else {
    k = i;
    }

    while (!flag && k < j || flag && k >= i) {
    slot = (Slot) this.c.get(k);
    itemstack1 = slot.getItem();
    if (itemstack1 == null) {
    slot.set(itemstack.cloneItemStack());
    slot.f();
    itemstack.count = 0;
    flag1 = true;
    break;
    }

    if (flag) {
    --k;
    } else {
    ++k;
    }
    }
    }

    return flag1;
    }

    public static int b(int i) {
    return i >> 2 & 3;
    }

    public static int c(int i) {
    return i & 3;
    }

    public static boolean d(int i) {
    return i == 0 || i == 1;
    }

    protected void d() {
    this.g = 0;
    this.h.clear();
    }

    public static boolean a(Slot slot, ItemStack itemstack, boolean flag) {
    boolean flag1 = slot == null || !slot.e();

    if (slot != null && slot.e() && itemstack != null && itemstack.doMaterialsMatch(slot.getItem()) && ItemStack.equals(slot.getItem(), itemstack)) {
    int i = flag ? 0 : itemstack.count;

    flag1 |= slot.getItem().count + i <= itemstack.getMaxStackSize();
    }

    return flag1;
    }

    public static void a(Set set, int i, ItemStack itemstack, int j) {
    switch (i) {
    case 0:
    itemstack.count = MathHelper.d((float) itemstack.count / (float) set.size());
    break;

    case 1:
    itemstack.count = 1;
    }

    itemstack.count += j;
    }

    public boolean b(Slot slot) {
    return true;
    }

    public static int b(IInventory iinventory) {
    if (iinventory == null) {
    return 0;
    } else {
    int i = 0;
    float f = 0.0F;

    for (int j = 0; j < iinventory.getSize(); ++j) {
    ItemStack itemstack = iinventory.getItem(j);

    if (itemstack != null) {
    f += (float) itemstack.count / (float) Math.min(iinventory.getMaxStackSize(), itemstack.getMaxStackSize());
    ++i;
    }
    }

    f /= (float) iinventory.getSize();
    return MathHelper.d(f * 14.0F) + (i > 0 ? 1 : 0);
    }
    }
    }





    et ceci est de la ligne 31 à 38


    public boolean checkReachable = true;
    public abstract InventoryView getBukkitView();
    public void transferTo(Container other, org.bukkit.craftbukkit.entity.CraftHumanEntity player) {
    InventoryView source = this.getBukkitView(), destination = other.getBukkitView();
    ((CraftInventory) source.getTopInventory()).getInventory().onClose(player);
    ((CraftInventory) source.getBottomInventory()).getInventory().onClose(player);
    ((CraftInventory) destination.getTopInventory()).getInventory().onOpen(player);
    ((CraftInventory) destination.getBottomInventory()).getInventory().onOpen(player);
     
  4. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    La 34 c'est celle-ci ?
    InventoryView source = this.getBukkitView(), destination = other.getBukkitView();
     
  5. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme
    InventoryView source = this.getBukkitView(), destination = other.getBukkitView();

    Oui voilà
     
  6. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    public abstract InventoryView getBukkitView();
    est bien une méthode abstraite. Je pense que dans le container de la table d’enchantement cette méthode n'est pas implémenté.
     
    • J'approuve J'approuve x 1
  7. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme
    Et comment y parvenir ? :)

    J'ai contacter un développeur pro et il ma dit "Je pense que ça vient d’incompatibilités entre la class abstraite et l’implémentation"

    mais rien d'autre :/
     
  8. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Tu peux m'envoyer la classe Container de la table d'enchantement (je ne connais plus son nom) ?
     
  9. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme
    J'en ai deux

    "ContainerEnchantTable.java"
    et
    "ContainerEnchantTableInventory.java"




    package net.minecraft.server;

    // CraftBukkit start
    import java.util.List;
    import org.bukkit.craftbukkit.entity.CraftHumanEntity;
    import org.bukkit.entity.HumanEntity;
    // CraftBukkit end

    public class ContainerEnchantTableInventory extends InventorySubcontainer { // CraftBukkit -> public

    final ContainerEnchantTable enchantTable;

    // CraftBukkit start
    public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
    public org.bukkit.entity.Player player;
    private int maxStack = MAX_STACK;

    public ItemStack[] getContents() {
    return this.items;
    }

    public void onOpen(CraftHumanEntity who) {
    transaction.add(who);
    }

    public void onClose(CraftHumanEntity who) {
    transaction.remove(who);
    }

    public List<HumanEntity> getViewers() {
    return transaction;
    }

    public org.bukkit.inventory.InventoryHolder getOwner() {
    return this.player;
    }

    public void setMaxStackSize(int size) {
    maxStack = size;
    }
    // CraftBukkit end

    ContainerEnchantTableInventory(ContainerEnchantTable containerenchanttable, String s, boolean flag, int i) {
    super(s, flag, i);
    this.enchantTable = containerenchanttable;
    this.setMaxStackSize(1); // CraftBukkit
    }

    public int getMaxStackSize() {
    return maxStack; // CraftBukkit
    }

    public void update() {
    super.update();
    this.enchantTable.a((IInventory) this);
    }
    }




    Et


    package net.minecraft.server;

    import java.util.List;
    import java.util.Random;

    // CraftBukkit start
    import java.util.Map;

    import org.bukkit.craftbukkit.inventory.CraftInventoryEnchanting;
    import org.bukkit.craftbukkit.inventory.CraftInventoryView;
    import org.bukkit.craftbukkit.inventory.CraftItemStack;
    import org.bukkit.event.enchantment.EnchantItemEvent;
    import org.bukkit.event.enchantment.PrepareItemEnchantEvent;
    import org.bukkit.entity.Player;
    // CraftBukkit end

    public class ContainerEnchantTable extends Container {

    // CraftBukkit - make type specific (changed from IInventory)
    public ContainerEnchantTableInventory enchantSlots = new ContainerEnchantTableInventory(this, "Enchant", true, 1);
    private World world;
    private int x;
    private int y;
    private int z;
    private Random l = new Random();
    public long f;
    public int[] costs = new int[3];
    // CraftBukkit start
    private CraftInventoryView bukkitEntity = null;
    private Player player;
    // CraftBukkit end

    public ContainerEnchantTable(PlayerInventory playerinventory, World world, int i, int j, int k) {
    this.world = world;
    this.x = i;
    this.y = j;
    this.z = k;
    this.a((Slot) (new SlotEnchant(this, this.enchantSlots, 0, 25, 47)));

    int l;

    for (l = 0; l < 3; ++l) {
    for (int i1 = 0; i1 < 9; ++i1) {
    this.a(new Slot(playerinventory, i1 + l * 9 + 9, 8 + i1 * 18, 84 + l * 18));
    }
    }

    for (l = 0; l < 9; ++l) {
    this.a(new Slot(playerinventory, l, 8 + l * 18, 142));
    }

    // CraftBukkit start
    player = (Player) playerinventory.player.getBukkitEntity();
    enchantSlots.player = player;
    // CraftBukkit end
    }

    public void addSlotListener(ICrafting icrafting) {
    super.addSlotListener(icrafting);
    icrafting.setContainerData(this, 0, this.costs[0]);
    icrafting.setContainerData(this, 1, this.costs[1]);
    icrafting.setContainerData(this, 2, this.costs[2]);
    }

    public void b() {
    super.b();

    for (int i = 0; i < this.listeners.size(); ++i) {
    ICrafting icrafting = (ICrafting) this.listeners.get(i);

    icrafting.setContainerData(this, 0, this.costs[0]);
    icrafting.setContainerData(this, 1, this.costs[1]);
    icrafting.setContainerData(this, 2, this.costs[2]);
    }
    }

    public void a(IInventory iinventory) {
    if (iinventory == this.enchantSlots) {
    ItemStack itemstack = iinventory.getItem(0);
    int i;

    if (itemstack != null) { // CraftBukkit - relax condition
    this.f = this.l.nextLong();
    if (!this.world.isStatic) {
    i = 0;

    int j;

    for (j = -1; j <= 1; ++j) {
    for (int k = -1; k <= 1; ++k) {
    if ((j != 0 || k != 0) && this.world.isEmpty(this.x + k, this.y, this.z + j) && this.world.isEmpty(this.x + k, this.y + 1, this.z + j)) {
    if (this.world.getType(this.x + k * 2, this.y, this.z + j * 2) == Blocks.BOOKSHELF) {
    ++i;
    }

    if (this.world.getType(this.x + k * 2, this.y + 1, this.z + j * 2) == Blocks.BOOKSHELF) {
    ++i;
    }

    if (k != 0 && j != 0) {
    if (this.world.getType(this.x + k * 2, this.y, this.z + j) == Blocks.BOOKSHELF) {
    ++i;
    }

    if (this.world.getType(this.x + k * 2, this.y + 1, this.z + j) == Blocks.BOOKSHELF) {
    ++i;
    }

    if (this.world.getType(this.x + k, this.y, this.z + j * 2) == Blocks.BOOKSHELF) {
    ++i;
    }

    if (this.world.getType(this.x + k, this.y + 1, this.z + j * 2) == Blocks.BOOKSHELF) {
    ++i;
    }
    }
    }
    }
    }

    for (j = 0; j < 3; ++j) {
    this.costs[j] = EnchantmentManager.a(this.l, j, i, itemstack);
    }

    // CraftBukkit start
    CraftItemStack item = CraftItemStack.asCraftMirror(itemstack);
    PrepareItemEnchantEvent event = new PrepareItemEnchantEvent(player, this.getBukkitView(), this.world.getWorld().getBlockAt(this.x, this.y, this.z), item, this.costs, i);
    event.setCancelled(!itemstack.x());
    this.world.getServer().getPluginManager().callEvent(event);

    if (event.isCancelled()) {
    for (i = 0; i < 3; ++i) {
    this.costs = 0;
    }
    return;
    }
    // CraftBukkit end

    this.b();
    }
    } else {
    for (i = 0; i < 3; ++i) {
    this.costs = 0;
    }
    }
    }
    }

    public boolean a(EntityHuman entityhuman, int i) {
    ItemStack itemstack = this.enchantSlots.getItem(0);

    if (this.costs > 0 && itemstack != null && (entityhuman.expLevel >= this.costs || entityhuman.abilities.canInstantlyBuild)) {
    if (!this.world.isStatic) {
    List list = EnchantmentManager.b(this.l, itemstack, this.costs);
    boolean flag = itemstack.getItem() == Items.BOOK;

    if (list != null) {
    // CraftBukkit start
    Map<org.bukkit.enchantments.Enchantment, Integer> enchants = new java.util.HashMap<org.bukkit.enchantments.Enchantment, Integer>();
    for (Object obj : list) {
    EnchantmentInstance instance = (EnchantmentInstance) obj;
    enchants.put(org.bukkit.enchantments.Enchantment.getById(instance.enchantment.id), instance.level);
    }
    CraftItemStack item = CraftItemStack.asCraftMirror(itemstack);

    EnchantItemEvent event = new EnchantItemEvent((Player) entityhuman.getBukkitEntity(), this.getBukkitView(), this.world.getWorld().getBlockAt(this.x, this.y, this.z), item, this.costs, enchants, i);
    this.world.getServer().getPluginManager().callEvent(event);

    int level = event.getExpLevelCost();
    if (event.isCancelled() || (level > entityhuman.expLevel && !entityhuman.abilities.canInstantlyBuild) || event.getEnchantsToAdd().isEmpty()) {
    return false;
    }

    if (flag) {
    itemstack.setItem(Items.ENCHANTED_BOOK);
    }

    for (Map.Entry<org.bukkit.enchantments.Enchantment, Integer> entry : event.getEnchantsToAdd().entrySet()) {
    try {
    if (flag) {
    int enchantId = entry.getKey().getId();
    if (Enchantment.byId[enchantId] == null) {
    continue;
    }

    EnchantmentInstance enchantment = new EnchantmentInstance(enchantId, entry.getValue());
    Items.ENCHANTED_BOOK.a(itemstack, enchantment);
    } else {
    item.addEnchantment(entry.getKey(), entry.getValue());
    }
    } catch (IllegalArgumentException e) {
    /* Just swallow invalid enchantments */
    }
    }

    entityhuman.levelDown(-level);
    // CraftBukkit end

    this.a(this.enchantSlots);
    }
    }

    return true;
    } else {
    return false;
    }
    }

    public void b(EntityHuman entityhuman) {
    super.b(entityhuman);
    if (!this.world.isStatic) {
    ItemStack itemstack = this.enchantSlots.splitWithoutUpdate(0);

    if (itemstack != null) {
    entityhuman.drop(itemstack, false);
    }
    }
    }

    public boolean a(EntityHuman entityhuman) {
    if (!this.checkReachable) return true; // CraftBukkit
    return this.world.getType(this.x, this.y, this.z) != Blocks.ENCHANTMENT_TABLE ? false : entityhuman.e((double) this.x + 0.5D, (double) this.y + 0.5D, (double) this.z + 0.5D) <= 64.0D;
    }

    public ItemStack b(EntityHuman entityhuman, int i) {
    ItemStack itemstack = null;
    Slot slot = (Slot) this.c.get(i);

    if (slot != null && slot.e()) {
    ItemStack itemstack1 = slot.getItem();

    itemstack = itemstack1.cloneItemStack();
    if (i == 0) {
    if (!this.a(itemstack1, 1, 37, true)) {
    return null;
    }
    } else {
    if (((Slot) this.c.get(0)).e() || !((Slot) this.c.get(0)).isAllowed(itemstack1)) {
    return null;
    }

    if (itemstack1.hasTag() && itemstack1.count == 1) {
    ((Slot) this.c.get(0)).set(itemstack1.cloneItemStack());
    itemstack1.count = 0;
    } else if (itemstack1.count >= 1) {
    ((Slot) this.c.get(0)).set(new ItemStack(itemstack1.getItem(), 1, itemstack1.getData()));
    --itemstack1.count;
    }
    }

    if (itemstack1.count == 0) {
    slot.set((ItemStack) null);
    } else {
    slot.f();
    }

    if (itemstack1.count == itemstack.count) {
    return null;
    }

    slot.a(entityhuman, itemstack1);
    }

    return itemstack;
    }

    // CraftBukkit start
    public CraftInventoryView getBukkitView() {
    if (bukkitEntity != null) {
    return bukkitEntity;
    }

    CraftInventoryEnchanting inventory = new CraftInventoryEnchanting(this.enchantSlots);
    bukkitEntity = new CraftInventoryView(this.player, inventory, this);
    return bukkitEntity;
    }
    // CraftBukkit end
    }


     
  10. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    / CraftBukkit start
    public CraftInventoryView getBukkitView() {
    if (bukkitEntity != null) {
    return bukkitEntity;
    }
    La fonction est pourtant bien présente, c'est étrange :/
    Vérifies avec un logiciel de décompilation (JD-gui), que la fonction existe bien dans le jar exporté.
     
  11. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme
    après la compilation, je lai décompiler avec JD gui et voilà



    package net.minecraft.server.v1_7_R1;

    import java.util.List;
    import java.util.Random;

    public class ContainerEnchantTable
    extends Container
    {
    public IInventory enchantSlots = new ContainerEnchantTableInventory(this, "Enchant", true, 1);
    private World world;
    private int x;
    private int y;
    private int z;
    private Random l = new Random();
    public long f;
    public int[] costs = new int[3];
    public ContainerEnchantTable(PlayerInventory paramPlayerInventory, World paramWorld, int paramInt1, int paramInt2, int paramInt3)
    {
    this.world = paramWorld;
    this.x = paramInt1;
    this.y = paramInt2;
    this.z = paramInt3;
    a(new SlotEnchant(this, this.enchantSlots, 0, 25, 47));
    for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 9; j++) {
    a(new Slot(paramPlayerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
    }
    }
    for (i = 0; i < 9; i++) {
    a(new Slot(paramPlayerInventory, i, 8 + i * 18, 142));
    }
    }
    public void addSlotListener(ICrafting paramICrafting)
    {
    super.addSlotListener(paramICrafting);

    paramICrafting.setContainerData(this, 0, this.costs[0]);
    paramICrafting.setContainerData(this, 1, this.costs[1]);
    paramICrafting.setContainerData(this, 2, this.costs[2]);
    }
    public void b()
    {
    super.b();
    for (int i = 0; i < this.listeners.size(); i++)
    {
    ICrafting localICrafting = (ICrafting)this.listeners.get(i);
    localICrafting.setContainerData(this, 0, this.costs[0]);
    localICrafting.setContainerData(this, 1, this.costs[1]);
    localICrafting.setContainerData(this, 2, this.costs[2]);
    }
    }
    public void a(IInventory paramIInventory)
    {
    if (paramIInventory == this.enchantSlots)
    {
    ItemStack localItemStack = paramIInventory.getItem(0);
    int i;
    if ((localItemStack == null) || (!localItemStack.x()))
    {
    for (i = 0; i < 3; i++) {
    this.costs = 0;
    }
    }
    else
    {
    this.f = this.l.nextLong();
    if (!this.world.isStatic)
    {
    i = 0;
    for (int j = -1; j <= 1; j++) {
    for (int k = -1; k <= 1; k++) {
    if ((j != 0) || (k != 0)) {
    if ((this.world.isEmpty(this.x + k, this.y, this.z + j)) && (this.world.isEmpty(this.x + k, this.y + 1, this.z + j)))
    {
    if (this.world.getType(this.x + k * 2, this.y, this.z + j * 2) == Blocks.BOOKSHELF) {
    i++;
    }
    if (this.world.getType(this.x + k * 2, this.y + 1, this.z + j * 2) == Blocks.BOOKSHELF) {
    i++;
    }
    if ((k != 0) && (j != 0))
    {
    if (this.world.getType(this.x + k * 2, this.y, this.z + j) == Blocks.BOOKSHELF) {
    i++;
    }
    if (this.world.getType(this.x + k * 2, this.y + 1, this.z + j) == Blocks.BOOKSHELF) {
    i++;
    }
    if (this.world.getType(this.x + k, this.y, this.z + j * 2) == Blocks.BOOKSHELF) {
    i++;
    }
    if (this.world.getType(this.x + k, this.y + 1, this.z + j * 2) == Blocks.BOOKSHELF) {
    i++;
    }
    }
    }
    }
    }
    }
    for (j = 0; j < 3; j++) {
    this.costs[j] = EnchantmentManager.a(this.l, j, i, localItemStack);
    }
    b();
    }
    }
    }
    }
    public boolean a(EntityHuman paramEntityHuman, int paramInt)
    {
    ItemStack localItemStack = this.enchantSlots.getItem(0);
    if ((this.costs[paramInt] > 0) && (localItemStack != null) && ((paramEntityHuman.expLevel >= this.costs[paramInt]) || (paramEntityHuman.abilities.canInstantlyBuild)))
    {
    if (!this.world.isStatic)
    {
    List localList = EnchantmentManager.b(this.l, localItemStack, this.costs[paramInt]);
    int i = localItemStack.getItem() == Items.BOOK ? 1 : 0;
    if (localList != null)
    {
    paramEntityHuman.levelDown(-this.costs[paramInt]);
    if (i != 0) {
    localItemStack.setItem(Items.ENCHANTED_BOOK);
    }
    int j = (i != 0) && (localList.size() > 1) ? this.l.nextInt(localList.size()) : -1;
    for (int k = 0; k < localList.size(); k++)
    {
    EnchantmentInstance localEnchantmentInstance = (EnchantmentInstance)localList.get(k);
    if ((i == 0) || (k != j)) {
    if (i != 0) {
    Items.ENCHANTED_BOOK.a(localItemStack, localEnchantmentInstance);
    } else {
    localItemStack.addEnchantment(localEnchantmentInstance.enchantment, localEnchantmentInstance.level);
    }
    }
    }
    a(this.enchantSlots);
    }
    }
    return true;
    }
    return false;
    }
    public void b(EntityHuman paramEntityHuman)
    {
    super.b(paramEntityHuman);
    if (this.world.isStatic) {
    return;
    }
    ItemStack localItemStack = this.enchantSlots.splitWithoutUpdate(0);
    if (localItemStack != null) {
    paramEntityHuman.drop(localItemStack, false);
    }
    }
    public boolean a(EntityHuman paramEntityHuman)
    {
    if (this.world.getType(this.x, this.y, this.z) != Blocks.ENCHANTMENT_TABLE) {
    return false;
    }
    if (paramEntityHuman.e(this.x + 0.5D, this.y + 0.5D, this.z + 0.5D) > 64.0D) {
    return false;
    }
    return true;
    }
    public ItemStack b(EntityHuman paramEntityHuman, int paramInt)
    {
    ItemStack localItemStack1 = null;
    Slot localSlot = (Slot)this.c.get(paramInt);
    if ((localSlot != null) && (localSlot.e()))
    {
    ItemStack localItemStack2 = localSlot.getItem();
    localItemStack1 = localItemStack2.cloneItemStack();
    if (paramInt == 0)
    {
    if (!a(localItemStack2, 1, 37, true)) {
    return null;
    }
    }
    else if ((!((Slot)this.c.get(0)).e()) && (((Slot)this.c.get(0)).isAllowed(localItemStack2)))
    {
    if ((localItemStack2.hasTag()) && (localItemStack2.count == 1))
    {
    ((Slot)this.c.get(0)).set(localItemStack2.cloneItemStack());
    localItemStack2.count = 0;
    }
    else if (localItemStack2.count >= 1)
    {
    ((Slot)this.c.get(0)).set(new ItemStack(localItemStack2.getItem(), 1, localItemStack2.getData()));
    localItemStack2.count -= 1;
    }
    }
    else {
    return null;
    }
    if (localItemStack2.count == 0) {
    localSlot.set(null);
    } else {
    localSlot.f();
    }
    if (localItemStack2.count == localItemStack1.count) {
    return null;
    }
    localSlot.a(paramEntityHuman, localItemStack2);
    }
    return localItemStack1;
    }
    }
     
  12. robin4002

    robin4002 Support Technique
    Staff

    Inscrit:
    17 Août 2012
    Messages:
    5 478
    Points:
    229
    Sexe:
    Homme
    Le problème vient bien de là. Dans le jar compilé la méthode n'est plus présente. Ce qui explique le crash. Maintenant reste à trouver comment résoudre ça. Je peux juste te dire qu'il faut regarder du côté du compilateur. Je ne sais pas exactement comment résoudre ça :/
     
  13. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme
    ra zut !

    merci quand même ;)
     
  14. Bayram

    Bayram Enter the World

    Inscrit:
    6 Sept 2015
    Messages:
    18
    Points:
    3
    Sexe:
    Homme
    Je viens de résoudre le souci ! pour ceux qui on des souci de se genre, venez en PV (Skype)
     

Partager cette page