Non résolu Création d'un mod client-side qui notifie son utilisateur quand son inventaire est full
-
ya une fonction pour detecter un message client side?
si c’est pas le cas au pire j’ai juste à utiliser une variable right? -
Pourquoi tu veux une fonction pour ça ?
Tu as justement besoin d’une variable en effet. -
@robin4002 a dit dans Création d'un mod client-side qui notifie son utilisateur quand son inventaire est full :
Vu comment ton code est fait c’est normal.
Il faudrait utiliser un boolean et mettre ceci sur false dès que le message est affiché et si elle est sur false lancer le compteur puis remettre sur true à la fin du compteur.
donc je créer une bolean timer = true; au début de ma method chkInv, après mon message je met timer = !timer;:
mais je suis sensé lancer le check comment si je ne peux pas lancer le compteur en dehors de la boucle if?
je suis sensé run if(Minecraft.getMinecraft().world.getTotalWorldTime() % 240 == 3L ) comme première commande? comme genreEDIT: le message n’est plus déclenché donc j’ai ya un truc qui va pas, j’me relis 2s pour voir.
RE: je vois pas ce qui empêche le message de s’envoyer.
—> bon bas ma method n’a plus l’air de fonctionner dutout, pas d’errors, impossible de savoir d’où ça vient. même avec un manual undoEDIT2: les backups, c’est la vie. ducoup ma class de backup marche, juste perdu la boolean.
quand j’ai supprimé la bolean et que j’ai remis la fonction worldgetTotalWorldTime() manuellement à sa place, le problème étais toujours là, donc aucune idée de pourquoi j’ai eu le problème d’avant.@SubscribeEvent public static void chkInv(TickEvent.ClientTickEvent event) throws InterruptedException { boolean timer = false; if(Minecraft.getMinecraft().player != null ) { if(Minecraft.getMinecraft().world.getTotalWorldTime() % 200 == 3L && timer = false) int s = 0; for(int i=0; i < 37; i++) { if(!Minecraft.getMinecraft().player.inventory.getStackInSlot(i).isEmpty() && Minecraft.getMinecraft() .player.inventory.getStackInSlot(i).getCount() == Minecraft.getMinecraft().player.inventory.getStackInSlot(i).getMaxStackSize()) { s++; if(s > 35) { if(event.phase == TickEvent.Phase.END && timer == false) { Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Your inventory is full")); timer = !timer; return; } } return; } } } { return; } }
-
j’étais en train de créer mon fichier de config puis j’ai tenté de démarrer le jeu mais ça a crash et la ligne “if(cfg.haschanged()) {” en serait la cause
mon fichier configpublic static void readConfig() { Configuration cfg = CommonProxy.config; try { cfg.load(); initGeneralConfig(cfg); } finally { if (cfg.hasChanged()) { cfg.save(); } } }
le crash report :
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Full Inventory Checker (fullinvchecker) Caused by: java.lang.NullPointerException at Gess.mod.config.Config.readConfig(Config.java:21) at Gess.mod.Main.preInit(Main.java:41) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:611) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:253) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:231) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:148) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:604) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:266) at net.minecraft.client.Minecraft.init(Minecraft.java:508) at net.minecraft.client.Minecraft.run(Minecraft.java:416) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25)
si jamais tu veux voir ma method preInit :
line 41 = Config.readConfig();@EventHandler public void preInit(FMLPreInitializationEvent event){ File directory = event.getModConfigurationDirectory(); config = new Configuration(new File(directory.getPath(), "FullInventoryChecker.cfg")); Config.readConfig(); }
j’ai aussi éssayer de faire jouer un son du côté client avec Minecraft.getMinecraft().getSoundHandler().playSound(); mais ya une erreur dans mon code, quelque soit le code, j’ai éssayé de voir dans des exemples ou d’autres mods open source, mais ya rien qui marche
pour finir, je me demandais si dans
if(!Minecraft.getMinecraft().player.inventory.getStackInSlot(i).isEmpty() && Minecraft.getMinecraft() .player.inventory.getStackInSlot(i).getCount() == Minecraft.getMinecraft().player.inventory.getStackInSlot(i).getMaxStackSize())
je pouvais ajouter l’ID d’un item comme exception car sur certain serveurs comme hypixel skyblock ou wynncraft, ya une limite custom de stacks par items .
je vais passer par un else et ajouter les ID manuellement, et si j’arrive à faire fonctionner ce fichier de config, alors j’ajouterais un filtre d’exception. je n’arrive pas à trouver comment comparer le stack trouvé avec getStackInSlot avec un item genre mineccraft:head (je supose je dois utiliser getItem() mais ya aucun moyen de savoir comment elle marche)
-
vu que j’avais plus de réponses sur ce forum, j’ai utilisé le forum officiel, puis j’ai fais une pause, car perdre son temps pour rien et pas spécialement mon truc, j’éssaye de faire marcher “e.entity” pour trouver un moyen de faire fonctionner le mod sur un serveur, le problème étant que “e.” ne marche pas, donc je me demandais à quoi ça correspondait.
je viens de faire un texte et genre event.getEntityPlayer() et tous les autres arguments pour minecraft ne fonctionnent plus et remplacé par ça :
event.[autre argument en rapport avec mc] ne marche plus sur tous mes projets.
-
C’est quoi le contexte complet dans lequel se trouve ta variable event ?
-
dans une methode test avec comme genre
@SubscribeEvent public void test(TickEvent.ClientTickEvent event) { if(event. }
et ya rien qui s’affiche alors que c’était le cas avant
-
TickEvent.ClientTickEvent est bien reconnu ?
-
yep, sur mes autres methodes aussi
Edit: pour ma méthode qui détecte client-side quand mon inventaire change (je cherche toujouts à la faire marcher):
private ItemStack[] previous; private ItemStack[] now; @SubscribeEvent public void PckUpItm(TickEvent.ClientTickEvent event) { if(Minecraft.getMinecraft().player != null) { EntityPlayer player = Minecraft.getMinecraft().player; int g = 0; for(int e=0; e < 36; e++) { System.out.println("checking slot " + e); ItemStack stack = player.inventory.getStackInSlot(e); if(previous[e] != stack) { if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); previous[e] = stack; System.out.println("Itemstack " + e + "copied"); if(g > 34) { Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Your inventory is full")); return; } } } } } }
la méthode ne trigger même pas ingame, elle est sesné être déclenchée tous les ticks pourtant non?
-
Étrange, essaies de refaire un setup de la workspace ?
Et pour l’event, vérifies que la classe d’event est bien enregistré.
-
j’ai refais un workspace, j’ai utilisé le build recommandé de forge 1.12.2 cette fois, j’ai remis le code, tous semble fonctionner sauf ma fonction de detection, lorsque j’éssaie de debug, je rejoinds un serveur et là, le jeu crash, à cause de ma ligne
if(previous[e] != stack) {
pourquoi cette ligne par contre ?
j’avais vu que d’utiliser [e] permetrais de stocker plusieurs valeur dans une même variable, comme une genre de liste de supose, mais ça a pas l’air de fonctionner donc je me demande si je devrais pas stocker chaque item dans chaque slot 1 / 1. à moins qu’il y ai un moyen de fix ça.
car c’est sensé pouvoir stocker chaque item en fonction de la valeur de e, c’est à dire des slots de l’inventaire (de 0 à 35)EDIT: j’ai edit quelques truc, maintenant ça crash pas quand je vais sur le serveur, mais ça me timeout .5s après avoir rejoinds le serveur, et la méthode ne marcge toujours pas en solo
-
Ton array
previous
n’est jamais initialisé, donc normal que ça plante …Il faudrait les logs pour savoir pourquoi tu timeout.
-
[20:43:41] [main/INFO] [minecraft/GuiConnecting]: Connecting to localhost, 25565 [20:43:41] [Netty Client IO #4/INFO] [FML]: Aborting client handshake "VANILLA" [20:43:41] [Netty Client IO #4/INFO] [FML]: [Netty Client IO #4] Client side vanilla connection established [20:44:06] [Netty Client IO #4/ERROR] [FML]: NetworkDispatcher exception java.io.IOException: Une connexion existante a dû être fermée par l’hôte distant // timeout at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_212] at sun.nio.ch.SocketDispatcher.read(Unknown Source) ~[?:1.8.0_212] at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source) ~[?:1.8.0_212] at sun.nio.ch.IOUtil.read(Unknown Source) ~[?:1.8.0_212] at sun.nio.ch.SocketChannelImpl.read(Unknown Source) ~[?:1.8.0_212] at io.netty.buffer.PooledUnsafeDirectByteBuf.setBytes(PooledUnsafeDirectByteBuf.java:288) ~[PooledUnsafeDirectByteBuf.class:4.1.9.Final] at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1100) ~[AbstractByteBuf.class:4.1.9.Final] at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:372) ~[NioSocketChannel.class:4.1.9.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:123) [AbstractNioByteChannel$NioByteUnsafe.class:4.1.9.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:624) [NioEventLoop.class:4.1.9.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:559) [NioEventLoop.class:4.1.9.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:476) [NioEventLoop.class:4.1.9.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) [NioEventLoop.class:4.1.9.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) [SingleThreadEventExecutor$5.class:4.1.9.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_212] [20:44:07] [main/INFO] [FML]: Applying holder lookups [20:44:07] [main/INFO] [FML]: Holder lookups applied
Les logs pour le timeout
Un autre mod a fais la même chose et ça marche -
Ce sont les logs du client ou du serveur ça ?
Car si c’est le client qui timeout, ça veut dire que le serveur ne répond plus, donc l’erreur est probablement sur le serveur. -
@robin4002 nan, le serveur marche parfaitement, je peux me connecter dessus avec mon compte mc sans problème, ce sont des logs client btw, car ya aucune info côté serveur sur la raison du timeout, il dit juste que tel client a timeout. Le serveur run en local.
-
Je ne sais pas du tout d’où cela peut venir dans ce cas
-
@robin4002 il ont aussi l’air de galérer du côté du forum officiel ahahah, moi ça me dépasse complêtement, j’ai enviee de le terminer, mais forge veux pas =/
j’étais tester de initialize previous avec null, les crash ont arrêté, la method ne fonctionne toujours pas donc je supose que ya un problème avec ma variable previous
forcer le jeu à faire marcher la method via un call fais crash le jeu avec comme erreur ma ligne pour comparer previous au stack actuel e
je pensse que je vais devoir hard code tous mes slots pour stock tous mes items vu que ça marche pas avec ce que forge me donne
-
j’ai éssayé de hardcode les stacks, et ç crash quand je rejoinds un monde / serveur ptdr, jugez pas mon code, comme la première ligne du code le stipule:
/Welcome to hell package Gess.mod; import Gess.mod.proxy.iProxy; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextComponentString; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import util.Reference; @EventBusSubscriber @Mod(modid=Reference.MODID, name=Reference.MODNAME, version=Reference.VERSION) public class Main { public static Configuration config; //public static int time = 10; public static Main instance; //float lastMessageTime = 0; public boolean inventoryIsFull; public static final String CLIENT = "gess.mod.proxy.ClientProxy"; public static final String SERVER = "gess.mod.proxy.CommonProxy"; @SidedProxy(clientSide = Reference.CLIENT, serverSide = Reference.COMMON) public static iProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent e){ //File directory = event.getModConfigurationDirectory(); //config = new Configuration(new File(directory.getPath(), "FullInventoryChecker.cfg")); //Config.readConfig(); } @EventHandler public void init(FMLInitializationEvent e){} @EventHandler public void postInit(FMLPostInitializationEvent e){ // if (config.hasChanged()) // config.save(); //} } public void log() { System.out.println("Does PckUpItm actually output anything?"); } private ItemStack[] previous; private ItemStack slot0; private ItemStack slot1; private ItemStack slot2; private ItemStack slot3; private ItemStack slot4; private ItemStack slot5; private ItemStack slot6; private ItemStack slot7; private ItemStack slot8; private ItemStack slot9; private ItemStack slot10; private ItemStack slot11; private ItemStack slot12; private ItemStack slot13; private ItemStack slot14; private ItemStack slot15; private ItemStack slot16; private ItemStack slot17; private ItemStack slot18; private ItemStack slot19; private ItemStack slot20; private ItemStack slot21; private ItemStack slot22; private ItemStack slot23; private ItemStack slot24; private ItemStack slot25; private ItemStack slot26; private ItemStack slot27; private ItemStack slot28; private ItemStack slot29; private ItemStack slot30; private ItemStack slot31; private ItemStack slot32; private ItemStack slot33; private ItemStack slot34; private ItemStack slot35; private ItemStack[] now; @SubscribeEvent public void PckUpItm() { if(Minecraft.getMinecraft().player != null) { Main pui = new Main(); pui.log(); EntityPlayer player = Minecraft.getMinecraft().player; int g = 0; System.out.println("starting to count e"); for(int e=0; e < 36; e++) { System.out.println("checking slot " + e); ItemStack stack = player.inventory.getStackInSlot(e); if (e == 0) { if(ItemStack.areItemStacksEqual(slot0, stack) == false) { slot0 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 1) { if(ItemStack.areItemStacksEqual(slot1, stack) == false) { slot1 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 2) { if(ItemStack.areItemStacksEqual(slot2, stack) == false) { slot2 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 3) { if(ItemStack.areItemStacksEqual(slot3, stack) == false) { slot3 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 4) { if(ItemStack.areItemStacksEqual(slot4, stack) == false) { slot4 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 5) { if(ItemStack.areItemStacksEqual(slot5, stack) == false) { slot5 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 6) { if(ItemStack.areItemStacksEqual(slot6, stack) == false) { slot6 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 7) { if(ItemStack.areItemStacksEqual(slot7, stack) == false) { slot7 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 8) { if(ItemStack.areItemStacksEqual(slot8, stack) == false) { slot8 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 9) { if(ItemStack.areItemStacksEqual(slot9, stack) == false) { slot9 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 10) { if(ItemStack.areItemStacksEqual(slot10, stack) == false) { slot10 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 11) { if(ItemStack.areItemStacksEqual(slot11, stack) == false) { slot11 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 12) { if(ItemStack.areItemStacksEqual(slot12, stack) == false) { slot12 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 13) { if(ItemStack.areItemStacksEqual(slot13, stack) == false) { slot13 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 14) { if(ItemStack.areItemStacksEqual(slot14, stack) == false) { slot14 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 15) { if(ItemStack.areItemStacksEqual(slot15, stack) == false) { slot15 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 16) { if(ItemStack.areItemStacksEqual(slot16, stack) == false) { slot16 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 17) { if(ItemStack.areItemStacksEqual(slot17, stack) == false) { slot17 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 18) { if(ItemStack.areItemStacksEqual(slot18, stack) == false) { slot18 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 19) { if(ItemStack.areItemStacksEqual(slot19, stack) == false) { slot19 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 20) { if(ItemStack.areItemStacksEqual(slot20, stack) == false) { slot20 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 21) { if(ItemStack.areItemStacksEqual(slot21, stack) == false) { slot21 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 22) { if(ItemStack.areItemStacksEqual(slot22, stack) == false) { slot22 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 23) { if(ItemStack.areItemStacksEqual(slot23, stack) == false) { slot23 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 24) { if(ItemStack.areItemStacksEqual(slot24, stack) == false) { slot24 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 25) { if(ItemStack.areItemStacksEqual(slot25, stack) == false) { slot25 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 26) { if(ItemStack.areItemStacksEqual(slot26, stack) == false) { slot26 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 27) { if(ItemStack.areItemStacksEqual(slot27, stack) == false) { slot27 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 28) { if(ItemStack.areItemStacksEqual(slot28, stack) == false) { slot28 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 29) { if(ItemStack.areItemStacksEqual(slot29, stack) == false) { slot29 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 30) { if(ItemStack.areItemStacksEqual(slot30, stack) == false) { slot30 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 31) { if(ItemStack.areItemStacksEqual(slot31, stack) == false) { slot31 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 32) { if(ItemStack.areItemStacksEqual(slot32, stack) == false) { slot32 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 33) { if(ItemStack.areItemStacksEqual(slot33, stack) == false) { slot33 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 34) { if(ItemStack.areItemStacksEqual(slot34, stack) == false) { slot34 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if (e == 35) { if(ItemStack.areItemStacksEqual(slot35, stack) == false) { slot35 = stack; if(!stack.isEmpty() && stack.getCount() == stack.getMaxStackSize()) { g++; System.out.println("g = " + g); System.out.println("Itemstack " + e + "copied"); } } } if(g == 35) { Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Your inventory is full")); return; } } } } @SubscribeEvent public static void chkInv(TickEvent.ClientTickEvent event) throws InterruptedException { if(Minecraft.getMinecraft().player != null) { int s = 0; Main m = new Main(); m.PckUpItm(); for(int i=0; i < 37; i++) { if(!Minecraft.getMinecraft().player.inventory.getStackInSlot(i).isEmpty() && Minecraft.getMinecraft() .player.inventory.getStackInSlot(i).getCount() == Minecraft.getMinecraft().player.inventory.getStackInSlot(i).getMaxStackSize()) { s++; if(s > 35) { if(Minecraft.getMinecraft().world.getTotalWorldTime() % 200 == 3L && event.phase == TickEvent.Phase.END) { Minecraft.getMinecraft().player.sendMessage(new TextComponentString("Your inventory is full")); System.out.println("chkInv: Triggerred with s = " + s); return; } } //else { //for(int t=0; i < 37; t++) { //if(!Minecraft.getMinecraft().player.inventory.getStackInSlot(i).isEmpty() && Minecraft.getMinecraft().player.inventory.getStackInSlot(t).getItem() == ) { //} //} //} } } return; } } } //@SideOnly(Side.CLIENT) //public void TickhHandler(TickEvent.ClientTickEvent event) throws InterruptedException { //wait(200); //}
et ça me donne ce crash report:
[00:31:25] [main/INFO] [GradleStart]: Extra: [] [00:31:25] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/[user]/.gradle/caches/minecraft/assets, --assetIndex, 1.12, --accessToken{REDACTED}, --version, 1.12.2, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [00:31:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [00:31:25] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [00:31:25] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [00:31:25] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [00:31:25] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2768 for Minecraft 1.12.2 loading [00:31:25] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_212, running on Windows 8.1:amd64:6.3, installed at C:\Program Files\Java\jre1.8.0_212 [00:31:25] [main/ERROR] [FML]: Apache Maven library folder was not in the format expected. Using default libraries directory. [00:31:25] [main/ERROR] [FML]: Full: C:\Users[user]\.gradle\caches\modules-2\files-2.1\org.apache.maven\maven-artifact\3.5.3\7dc72b6d6d8a6dced3d294ed54c2cc3515ade9f4\maven-artifact-3.5.3.jar [00:31:25] [main/ERROR] [FML]: Trimmed: c:/users/[user]/.gradle/caches/modules-2/files-2.1/org.apache.maven/maven-artifact/3.5.3/ [00:31:25] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [00:31:25] [main/INFO] [FML]: Detected deobfuscated environment, loading log configs for colored console logs. 2019-10-20 00:31:26,922 main WARN Disabling terminal, you're running in an unsupported environment. [00:31:26] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLCorePlugin (net.minecraftforge.fml.relauncher.FMLCorePlugin), we are in deobf and it's a forge core plugin [00:31:26] [main/INFO] [FML]: Ignoring missing certificate for coremod FMLForgePlugin (net.minecraftforge.classloading.FMLForgePlugin), we are in deobf and it's a forge core plugin [00:31:26] [main/INFO] [FML]: Searching D:\Modding\Minecraft\FullinventorycheckerRenewal\run\.\mods for mods [00:31:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [00:31:26] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [00:31:26] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [00:31:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [00:31:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [00:31:26] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [00:31:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [00:31:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [00:31:26] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [00:31:29] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [00:31:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [00:31:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [00:31:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [00:31:29] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [00:31:29] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [00:31:29] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [00:31:30] [main/INFO] [minecraft/Minecraft]: Setting user: Player865 [00:31:35] [main/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer: [00:31:35] [main/INFO] [minecraft/Minecraft]: LWJGL Version: 2.9.4 [00:31:36] [main/INFO] [FML]: -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_212, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 846860768 bytes (807 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 431.60' Renderer: 'GeForce GT 1030/PCIe/SSE2' [00:31:36] [main/INFO] [FML]: MinecraftForge v14.23.5.2768 Initialized [00:31:36] [main/INFO] [FML]: Starts to replace vanilla recipe ingredients with ore ingredients. [00:31:37] [main/INFO] [FML]: Replaced 1036 ore ingredients [00:31:38] [main/INFO] [FML]: Searching D:\Modding\Minecraft\FullinventorycheckerRenewal\run\.\mods for mods [00:31:40] [main/INFO] [FML]: Forge Mod Loader has identified 5 mods to load [00:31:40] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, fullinvchecker] at CLIENT [00:31:40] [main/INFO] [FML]: Attempting connection with missing mods [minecraft, mcp, FML, forge, fullinvchecker] at SERVER [00:31:41] [main/INFO] [minecraft/SimpleReloadableResourceManager]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Full Inventory Checker [00:31:41] [main/INFO] [FML]: Processing ObjectHolder annotations [00:31:41] [main/INFO] [FML]: Found 1168 ObjectHolder annotations [00:31:41] [main/INFO] [FML]: Identifying ItemStackHolder annotations [00:31:41] [main/INFO] [FML]: Found 0 ItemStackHolder annotations [00:31:41] [main/INFO] [FML]: Configured a dormant chunk cache size of 0 [00:31:41] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json [00:31:41] [main/INFO] [FML]: Applying holder lookups [00:31:41] [main/INFO] [FML]: Holder lookups applied [00:31:41] [main/INFO] [FML]: Applying holder lookups [00:31:41] [main/INFO] [FML]: Holder lookups applied [00:31:41] [main/INFO] [FML]: Applying holder lookups [00:31:41] [main/INFO] [FML]: Holder lookups applied [00:31:41] [main/INFO] [FML]: Applying holder lookups [00:31:41] [main/INFO] [FML]: Holder lookups applied [00:31:41] [main/INFO] [FML]: Injecting itemstacks [00:31:41] [main/INFO] [FML]: Itemstack injection complete [00:31:42] [Thread-3/INFO] [FML]: Using alternative sync timing : 200 frames of Display.update took 4789231038 nanos [00:31:42] [Forge Version Check/INFO] [forge.VersionCheck]: [forge] Found status: UP_TO_DATE Target: null [00:31:47] [Sound Library Loader/INFO] [minecraft/SoundManager]: Starting up SoundSystem... [00:31:47] [Thread-5/INFO] [minecraft/SoundManager]: Initializing LWJGL OpenAL [00:31:47] [Thread-5/INFO] [minecraft/SoundManager]: (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) [00:31:47] [Thread-5/INFO] [minecraft/SoundManager]: OpenAL initialized. [00:31:47] [Sound Library Loader/INFO] [minecraft/SoundManager]: Sound engine started [00:31:55] [main/INFO] [FML]: Max texture size: 16384 [00:31:56] [main/INFO] [minecraft/TextureMap]: Created: 512x512 textures-atlas [00:31:58] [main/INFO] [FML]: Applying holder lookups [00:31:58] [main/INFO] [FML]: Holder lookups applied [00:31:58] [main/INFO] [FML]: Injecting itemstacks [00:31:58] [main/INFO] [FML]: Itemstack injection complete [00:31:58] [main/INFO] [FML]: Forge Mod Loader has successfully loaded 5 mods [00:31:59] [main/WARN] [minecraft/GameSettings]: Skipping bad option: lastServer: [00:31:59] [main/INFO] [mojang/NarratorWindows]: Narrator library for x64 successfully loaded [00:32:00] [Realms Notification Availability checker #1/INFO] [mojang/RealmsClient]: Could not authorize you against Realms server: Invalid session id [00:32:03] [main/INFO] [minecraft/GuiConnecting]: Connecting to localhost, 25565 [00:32:03] [Netty Client IO #1/INFO] [FML]: Aborting client handshake "VANILLA" [00:32:03] [Netty Client IO #1/INFO] [FML]: [Netty Client IO #1] Client side vanilla connection established [00:32:05] [main/INFO] [STDOUT]: [Gess.mod.Main:log:52]: Does PckUpItm actually output anything? [00:32:05] [main/INFO] [STDOUT]: [Gess.mod.Main:PckUpItm:103]: starting to count e [00:32:05] [main/INFO] [STDOUT]: [Gess.mod.Main:PckUpItm:105]: checking slot 0 [00:32:05] [main/ERROR] [FML]: Exception caught during firing event net.minecraftforge.fml.common.gameevent.TickEvent$ClientTickEvent@3928de1c: java.lang.NullPointerException: null at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:495) ~[ItemStack.class:?] at Gess.mod.Main.PckUpItm(Main.java:108) ~[Main.class:?] at Gess.mod.Main.chkInv(Main.java:486) ~[Main.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_Main_chkInv_ClientTickEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) [EventBus.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:344) [FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1834) [Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1187) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_212] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_212] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] [00:32:05] [main/ERROR] [FML]: Index: 1 Listeners: [00:32:05] [main/ERROR] [FML]: 0: NORMAL [00:32:05] [main/ERROR] [FML]: 1: ASM: class Gess.mod.Main chkInv(Lnet/minecraftforge/fml/common/gameevent/TickEvent$ClientTickEvent;)V [00:32:05] [main/ERROR] [FML]: 2: ASM: net.minecraftforge.common.ForgeInternalHandler@15c900be checkSettings(Lnet/minecraftforge/fml/common/gameevent/TickEvent$ClientTickEvent;)V [00:32:06] [main/INFO] [FML]: Applying holder lookups [00:32:06] [main/INFO] [FML]: Holder lookups applied [00:32:06] [main/FATAL] [minecraft/Minecraft]: Unreported exception thrown! java.lang.NullPointerException: null at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:495) ~[ItemStack.class:?] at Gess.mod.Main.PckUpItm(Main.java:108) ~[Main.class:?] at Gess.mod.Main.chkInv(Main.java:486) ~[Main.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_Main_chkInv_ClientTickEvent.invoke(.dynamic) ~[?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) ~[ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) ~[EventBus.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:344) ~[FMLCommonHandler.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1834) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1187) ~[Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:441) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:118) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_212] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_212] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_212] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_212] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:25) [start/:?] [00:32:06] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: ---- Minecraft Crash Report ---- // Would you like a cupcake? Time: 10/20/19 12:32 AM Description: Unexpected error java.lang.NullPointerException: Unexpected error at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:495) at Gess.mod.Main.PckUpItm(Main.java:108) at Gess.mod.Main.chkInv(Main.java:486) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_Main_chkInv_ClientTickEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:344) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1834) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1187) at net.minecraft.client.Minecraft.run(Minecraft.java:441) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Client thread Stacktrace: at net.minecraft.item.ItemStack.areItemStacksEqual(ItemStack.java:495) at Gess.mod.Main.PckUpItm(Main.java:108) at Gess.mod.Main.chkInv(Main.java:486) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_4_Main_chkInv_ClientTickEvent.invoke(.dynamic) at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182) at net.minecraftforge.fml.common.FMLCommonHandler.onPreClientTick(FMLCommonHandler.java:344) -- Affected level -- Details: Level name: MpServer All players: 1 total; [EntityPlayerSP['Player865'/1491, l='MpServer', x=8.50, y=65.00, z=8.50]] Chunk stats: MultiplayerChunkCache: 19, 19 Level seed: 0 Level generator: ID 00 - default, ver 1. Features enabled: false Level generator options: Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511) Level time: 0 game time, 0 day time Level dimension: 0 Level storage version: 0x00000 - Unknown? Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false Forced entities: 1 total; [EntityPlayerSP['Player865'/1491, l='MpServer', x=8.50, y=65.00, z=8.50]] Retry entities: 0 total; [] Server brand: vanilla Server type: Non-integrated multiplayer server Stacktrace: at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:461) at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2888) at net.minecraft.client.Minecraft.run(Minecraft.java:470) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:25) -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_212, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 882644536 bytes (841 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.42 Powered by Forge 14.23.5.2768 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored | State | ID | Version | Source | Signature | |:------ |:-------------- |:----------------------------------- |:-------------------------------- |:--------- | | UCHIJA | minecraft | 1.12.2 | minecraft.jar | None | | UCHIJA | mcp | 9.42 | minecraft.jar | None | | UCHIJA | FML | 8.0.99.99 | forgeSrc-1.12.2-14.23.5.2768.jar | None | | UCHIJA | forge | 14.23.5.2768 | forgeSrc-1.12.2-14.23.5.2768.jar | None | | UCHIJA | fullinvchecker | 0.3 - Compatible in 1.12.1 & 1.12.2 | bin | None | Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 431.60' Renderer: 'GeForce GT 1030/PCIe/SSE2' Launched Version: 1.12.2 LWJGL: 2.9.4 OpenGL: GeForce GT 1030/PCIe/SSE2 GL version 4.6.0 NVIDIA 431.60, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported. Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: Current Language: English (US) Profiler Position: N/A (disabled) CPU: 4x Intel(R) Core(TM) i3-4150T CPU @ 3.00GHz [00:32:06] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# D:\Modding\Minecraft\FullinventorycheckerRenewal\run\.\crash-reports\crash-2019-10-20_00.32.06-client.txt AL lib: (EE) alc_cleanup: 1 device not closed Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
-
apparement mon array étais pas initialisé, mais ducoup seulement ajouter
this.previous = new ItemStack[player.inventory.getSizeInventory()];
ne suffit pas, il faudrait que je soit sûr que les value ne soient pas égal à nul mais à ItemStack.EMPTY à la place, mais je sait pas où et comment le faire vu que le moyen que j’ai utilisé pour éssayer ne marche pas
-
Faut faire comment les inventaires, utiliser des non null list.
NonNullList<ItemStack> previous = NonNullList.withSize(player.inventory.getSizeInventory(), ItemStack.EMPTY);
Faudra adapter le reste du code.