perromercenary00
Members-
Posts
849 -
Joined
-
Last visited
-
Days Won
5
Everything posted by perromercenary00
-
yap but I alredy take another way, an in that way another troubles apear the keybind i shall solv later, well tere is not only the keybind error but a lot of diferent things failing in the logs , so i decide to clean up. I download the lastest version of forge and start again, just the basic mercenarimod whith the first basic 10 materials, the bow and the arrow so until this, all works well on eclipse, compile the mod, and put it on the server now get [20:54:03] [server thread/ERROR] [FML]: Caught exception from modmercenario java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft at mercenarymod.Mercenary.init(Mercenary.java:67) ~[Mercenary.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] there is an error in the line 67 from mi main class and that is in the textures part @Mod.EventHandler public void init(FMLInitializationEvent event) { // materials Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.aceroMercenario,0,new //this is line 67 ModelResourceLocation("modmercenario:aceromercenario", "inventory")); //steel Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.redstoneMercenaria,0 , new ModelResourceLocation("modmercenario:redstonemercenaria", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.carbonoMercenario,0 , new ModelResourceLocation("modmercenario:carbonomercenario", "inventory")); //graphene Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.inertebarradeCarbon,0 , new ModelResourceLocation("modmercenario:inertebarradecarbon", "inventory")); //graphene bar Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.hierroAlrojo,0 , new ModelResourceLocation("modmercenario:hierroalrojo", "inventory")); //red hot iron Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.coalCompreso,0 , new ModelResourceLocation("modmercenario:coalcompreso", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.charcoalCompreso,0 , new ModelResourceLocation("modmercenario:charcoalcompreso", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.obsidianaMercenaria,0 , new ModelResourceLocation("modmercenario:obsidianamercenaria", "inventory")); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.nokiaMercenaria,0 , new ModelResourceLocation("modmercenario:nokiamercenaria", "inventory")); //nokia material just for fun Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.barradeAcero,0 , new ModelResourceLocation("modmercenario:barradeacero", "inventory")); //steel pipe //bows ModelBakery.addVariantName(MercenaryModItems.arcoMercenario, new String[]{ "modmercenario:arcos/arcomercenario/arcomercenario00", "modmercenario:arcos/arcomercenario/arcomercenario01", "modmercenario:arcos/arcomercenario/arcomercenario02", "modmercenario:arcos/arcomercenario/arcomercenario03", "modmercenario:arcos/arcomercenario/flechaMercenaria" }); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.arcoMercenario,0 , new ModelResourceLocation("modmercenario:arcos/arcomercenario/arcomercenario00", "inventory")); //arrows Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(MercenaryModItems.flechaMercenaria,0 , new ModelResourceLocation("modmercenario:arcos/arcomercenario/flechaMercenaria", "inventory")); } for some reason the sever dont like the way i declare the textures for the items repet miself in eclipse it gives no error of any kind this 12 items works and has their current texture at display, everiting is normal the errors ocurr in the server console at the moment of fire up server very tankfull
-
soo this was all about i have wrong installed the forged server, an this is just the begin p [18:42:32] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker [18:42:32] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker [18:42:32] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker [18:42:33] [main/INFO] [FML]: Forge Mod Loader version 8.0.32.1322 for Minecraft 1.8 loading [18:42:33] [main/INFO] [FML]: Java is Java HotSpot(TM) Server VM, version 1.7.0_76, running on Linux:i386:3.16.0-4-686-pae, installed at /usr/lib/jvm/java-7-oracle/jre [18:42:33] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [18:42:33] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [18:42:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [18:42:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [18:42:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [18:42:35] [main/INFO] [FML]: Found valid fingerprint for Minecraft Forge. Certificate fingerprint e3c3d50c7c986df74c645c0ac54639741c90a557 [18:42:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [18:42:35] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [18:42:37] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [18:42:37] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [18:42:39] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer} [18:42:48] [server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer]: Starting minecraft server version 1.8 [18:42:48] [server thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [18:42:49] [server thread/INFO] [FML]: MinecraftForge v11.14.1.1322 Initialized [18:42:49] [server thread/INFO] [FML]: Replaced 204 ore recipies [18:42:49] [server thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [18:42:50] [server thread/INFO] [FML]: Searching /home/tenchi/server/mods for mods [18:42:51] [server thread/INFO] [modmercenario]: Mod modmercenario is missing the required element 'name'. Substituting modmercenario [18:42:52] [server thread/INFO] [estructurasmercenarias]: Mod estructurasmercenarias is missing the required element 'name'. Substituting estructurasmercenarias [18:42:52] [server thread/INFO] [FML]: Forge Mod Loader has identified 6 mods to load [18:42:53] [server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, modmercenario, examplemod, estructurasmercenarias] at CLIENT [18:42:53] [server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, modmercenario, examplemod, estructurasmercenarias] at SERVER [18:42:57] [server thread/INFO] [FML]: Processing ObjectHolder annotations [18:42:57] [server thread/INFO] [FML]: Found 384 ObjectHolder annotations [18:42:57] [server thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [18:42:58] [server thread/INFO] [FML]: Applying holder lookups [18:42:58] [server thread/INFO] [FML]: Holder lookups applied [18:42:58] [server thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue [18:42:58] [server thread/ERROR] [FML]: mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{8.0.32.1322} [Forge Mod Loader] (forge-1.8-11.14.1.1322-universal.jar) Unloaded->Constructed->Pre-initialized Forge{11.14.1.1322} [Minecraft Forge] (forge-1.8-11.14.1.1322-universal.jar) Unloaded->Constructed->Pre-initialized modmercenario{1.5} [modmercenario] (modMercenario-1.6.jar) Unloaded->Constructed->Errored examplemod{1.0} [Example Mod] (modMercenario-1.6.jar) Unloaded->Constructed->Pre-initialized estructurasmercenarias{0.0} [estructurasmercenarias] (modMercenario-1.6.jar) Unloaded->Constructed->Pre-initialized [18:42:58] [server thread/ERROR] [FML]: The following problems were captured during this phase [18:42:58] [server thread/ERROR] [FML]: Caught exception from modmercenario java.lang.NoClassDefFoundError: net/minecraft/client/settings/KeyBinding at mercenarymod.utilidades.KeyBindings.init(KeyBindings.java:23) ~[KeyBindings.class:?] at mercenarymod.Mercenary.preInit(Mercenary.java:57) ~[Mercenary.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:517) ~[FMLModContainer.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.8.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.8.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514) [Loader.class:?] at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) [FMLServerHandler.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:355) [FMLCommonHandler.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:117) [po.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:438) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.7.0_76] Caused by: java.lang.ClassNotFoundException: net.minecraft.client.settings.KeyBinding at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.11.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_76] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_76] ... 34 more Caused by: java.lang.NullPointerException [18:42:58] [server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/settings/KeyBinding at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:162) ~[LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:516) ~[Loader.class:?] at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) ~[FMLServerHandler.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:355) ~[FMLCommonHandler.class:?] at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:117) ~[po.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:438) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.7.0_76] Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/settings/KeyBinding at mercenarymod.utilidades.KeyBindings.init(KeyBindings.java:23) ~[KeyBindings.class:?] at mercenarymod.Mercenary.preInit(Mercenary.java:57) ~[Mercenary.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:517) ~[FMLModContainer.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.8.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.8.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) ~[LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514) ~[Loader.class:?] ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.settings.KeyBinding at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.11.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_76] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_76] at mercenarymod.utilidades.KeyBindings.init(KeyBindings.java:23) ~[KeyBindings.class:?] at mercenarymod.Mercenary.preInit(Mercenary.java:57) ~[Mercenary.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:517) ~[FMLModContainer.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.8.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[LoadController.class:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[LoadController.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_76] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_76] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_76] at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_76] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[minecraft_server.1.8.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[minecraft_server.1.8.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) ~[LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:514) ~[Loader.class:?] ... 5 more Caused by: java.lang.NullPointerException [18:42:58] [server thread/ERROR] [net.minecraft.server.MinecraftServer]: This crash report has been saved to: /home/tenchi/server/./crash-reports/crash-2015-03-05_18.42.58-server.txt mi code is full of errors that crash server and is curious coz eclipse tell mi nothing about all this, and normal minecraft either show errors in the console it just works arrfff what comes next s a long journey of remake the mod looking in every class for the defectives lines an maiby redoo the code for the more complez tools
-
bueno its goes this way the server i download for minecrafts web is minecraft_server.1.8.3.jar, when install forge it creates the minecraft_server.1.8.jar so i launch the server whith cd server/ java -Xmx1024M -Xms1024M -jar minecraft_server.1.8.jar and launch normal vainilla minecraft whith java -jar Minecraft.jar this two has the same forge version instaled forge-1.8-11.14.1.1322-installer.jar aniway i do the test launching minecraft_server.1.8.3.jar for server but happends the same. mods are in server/mods/ there is some command to return the list of mods the server has loaded ? may server is not loading the mod
-
not english perfecto entonces pero se quedan afuera los usuarios que solo hablan ingles, por el lado de los nombres de las variables, creia que solo afectaban a esta instancia de este item especifico, a menos de que se declaren como public static, entonces si afectarian a todas las instancias de este mismo item, bueno mas tarde hago unas pruebas tengo eso en duda aun hace tiempo trate de meter todas las variables como nbttags en el itemStack pero me estrelle con el problemita de que si trato de leer cada nbt cada tick entonces int municion= nbtMercenaria.getInttag(arco, "municion"); int texturajson = nbtMercenaria.getInttag(arco, "texturajson"); //define la textura que se va a usar en este instante empiezan a devolver null, bueno por la forma en que hize la classe nbtMercenaria devuelve 9999 al encuentrar error al leer nbttag asi que me frustre y deje de hacerlo de esa manera, lo reduje a una sola nbttag "animacion" que solo se comprueba cada 10 tics y si es false no deja que el item cambie o actue de ninguna manera. de cualquier manera ese es otro problema y otro post, siendo este el unico arco en el servidor nada mas deberia interferir con el. aun asi onItemRightClick bueno en general las partes del codigo que se suponen corren cuando if (!worldIn.isRemote){} no estan funcionando, o hacen cosas raras bueno nunca e vista el codigo para un arma de fuego en minecraft todo esto que tengo hecho a salido de experimentar, preguntar en los foros y guiarme con lo que hay en la classe bow, y lo que me trae loco es ver que mi codigo funciona en el mundo normal pero no funciona en el servidor, entonces pense hay que hacer un arco sencillo el arco vainilla funciona bien tanto en el mundo local como en el servidor asi que si hago un arco sencillo este deberia funcionar el server sin dar problemas , pero no lo hace entonces falta algo for the names of the variables, i believe that only affect this instance of this specific item, unless it is declared as public static, then if would affect all instances of the same item, may is wrong but later test will done time ago i try to set all variables as nbttags in the itemStack but I stuck with this little problem, if I try to read every nbt each tick then int ammunition = nbtMercenaria.getInttag (bow, "ammunition"); int texturajson = nbtMercenaria.getInttag (bow, "texturajson"); //set current texture for the item they begin to return null, for the way I code the class nbtMercenaria it returns 9999 when it encounters an error reading nbt, just get tired of this and quit to do that way , so I reduced to a single nbttag "animation" this one is checked only every 10 tics and if false it shall not allow the item to changed or acts in any way. anyway that's another problem and another post, in this case being the only bow on the server nothing else should interfere with it . but still onItemRightClick well the parts in the code that are supposed to run when if (! worldIn.isRemote) {} are not working, or do strange things. well i never see the code the for a gun in minecraft before, all i have done has come from experiment whith code do questions on the forums and lok what is inside the bow class, drives me mad see mi code work on normal minecraft, but do nothing when on a server, then i think the bow class works well on normal and on server then if i do a custom bow based on thath code it may worksl, but dont' it dont' work there must be something i miss. bueno gracias.
-
good nigths lately been far away from the minecraft coding soo until tonigth i test the code public ItemStack onItemRightClick(ItemStack arco, World worldIn, EntityPlayer playerIn) { if (!worldIn.isRemote){ BlockPos ppos=playerIn.getPosition(); double x=ppos.getX(); double y=ppos.getY(); double z=ppos.getZ(); EntityBreakingFX(worldIn, x, y, z, Items.emerald); it returns The method EntityBreakingFX(World, double, double, double, Item) is undefined for the type arcoMercenario and it has no options to imprt the EntityBreakingFX, could be that this method has another name in 1.8 ?
-
good nigths i have this issue from some long weeks , and lately i have little time to spend whith code for working reasons. i have made a lot of items , tools mostly and some fireguns , all of them works well on single player but on a server do absolutly nothing and sometimes disapear or become another items. to aknowledge why is this happend i create a simple item a bow, reducing the code to the simples thing trying to realize whats its making this items useless but reach the point of not idea what its the trouble in this video: i set the server and the normal minecraft whith just mi mod and fireup the two at same time, in the first part i test the bow and the shotgun on a normal world in the vainilla minecraft and this two items work well, in the second part i test the items in the server world neither the shotgun or the bow works and the first shotgun becomes in to two musrooms whithout aparent reason. this is the code from the bow for now it just work whith vainilla arrows arcoMercenario.java package mercenarymod.items.arcos; import mercenarymod.Mercenary; import mercenarymod.items.MercenaryModItems; import mercenarymod.utilidades.chat; import mercenarymod.utilidades.nbtMercenaria; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.stats.StatList; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; public class arcoMercenario extends Item { public static String name = "arcoMercenario"; int tick=0; int texturajson=0; boolean tighten=false; boolean animacion=false; boolean continuar=false; float f=0.0F; int municion=0; int municionMax=0; static int municionMax0=32; public arcoMercenario() { setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerItem(this, name); setCreativeTab(Mercenary.herramientas); this.maxStackSize = 1; this.setMaxDamage(500); } //######################################################################################3 @Override public ModelResourceLocation getModel(ItemStack arco, EntityPlayer playerIn, int useRemaining){ ModelResourceLocation modelresourcelocation = new ModelResourceLocation("modmercenario:arcos/arcomercenario/arcomercenario00", "inventory"); animacion(arco, playerIn); if ((tick%10)==0){ //just to not check it every tick or it lags animacion=nbtMercenaria.getBooleantag(arco, "animacion"); //System.out.println("Animacion="+animacion); if(!animacion){ tighten=false; } } //System.out.println("textura="+textura); switch(this.texturajson){ default:modelresourcelocation = new ModelResourceLocation("modmercenario:arcos/arcomercenario/arcomercenario00", "inventory") ;break; case 1:modelresourcelocation = new ModelResourceLocation("modmercenario:arcos/arcomercenario/arcomercenario01", "inventory") ;break; case 2:modelresourcelocation = new ModelResourceLocation("modmercenario:arcos/arcomercenario/arcomercenario02", "inventory") ;break; case 3:modelresourcelocation = new ModelResourceLocation("modmercenario:arcos/arcomercenario/arcomercenario03", "inventory") ;break; } tick++; if (tick>100){tick=0;nbtMercenaria.setBooleantag(arco, "animacion",false);animacion=false;} return modelresourcelocation; } //####################################################################################3 void animacion(ItemStack arco, EntityPlayer playerIn){ //int tick //System.out.println("()this.thick="+tick+" cambioDeBotella="+cambioDeBotella+" giro="+giro); if ((tighten)){ System.out.println("tighten="+tick); switch (tick){ case 0: texturajson=0;f=0.50F;break; case 7: texturajson=1;f=1.00F;break; case 14: texturajson=2;f=1.50F;break; case 21: texturajson=3;f=2.00F;break; case 28: if(continuar){tick=20;};break; case 30: texturajson=0;tick=0;nbtMercenaria.setBooleantag(arco, "animacion",false);tighten=false;break; } } else{texturajson=0;} } //####################################################################################3 void inicializar(ItemStack arco){ //this do nothing for now int municion=0; int metadata=arco.getMetadata(); switch(metadata){ case 1: municion=municionMax0/2;break; case 2: municion=municionMax0;break; default:municion=0;break; } nbtMercenaria.setInttag(arco, "municion", municion); nbtMercenaria.setBooleantag(arco, "animacion", false); nbtMercenaria.setBooleantag(arco, "liberar", false); nbtMercenaria.setInttag(arco, "cargador", 0); nbtMercenaria.setInttag(arco, "textura", 0); } //####################################################################################3 public void onPlayerStoppedUsing(ItemStack arco, World worldIn, EntityPlayer playerIn, int timeLeft) { if (!worldIn.isRemote){ playerIn.inventory.consumeInventoryItem(MercenaryModItems.flechaMercenaria); EntityArrow entityarrow = new EntityArrow(worldIn, playerIn, f ); worldIn.spawnEntityInWorld(entityarrow); chat.chatdp(playerIn, "shooting f="+f); f=0.0F; nbtMercenaria.setBooleantag(arco, "animacion", false); } texturajson=0;tick=0;tighten=false;continuar=false; } public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) { //texturajson=0;tick=0;tighten=false; return stack; } public int getMaxItemUseDuration(ItemStack stack) { return 72000; } public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.BOW; } //#####################################################################################3 public ItemStack onItemRightClick(ItemStack arco, World worldIn, EntityPlayer playerIn) { if (!worldIn.isRemote){ if (playerIn.capabilities.isCreativeMode || playerIn.inventory.hasItem(MercenaryModItems.flechaMercenaria)){ //mercenaryArrow //|| playerIn.inventory.hasItem(Items.arrow)){ //municion=nbtMercenaria.getInttag(arco, "municion"); //not now nbtMercenaria.setBooleantag(arco, "animacion", true); animacion=true; tighten=true; // tight the bow //chat.chatdp(playerIn, "has item "+tick); }} if (tighten){ playerIn.setItemInUse(arco, this.getMaxItemUseDuration(arco)); tick=0; continuar=true; // tighten it until i tell you to release the arrow //chat.chatdp(playerIn, "En Uso"+tick); // in use } return arco; } public int getItemEnchantability() { return 1; } } what do you think i coulbe doing wrong ?
-
well i dunot know what its "EntityParticleEmitter" its something eclipse put to correct another error the point, how i get or do ,declare particles to use in this, this case it must spawn the particles in accordance with the block im rightcliking so there must be somewhere something like worldIn.getParticleFromblock(BlockPos);
-
in reality im using the code from that guide in internet that is for 1.7 but has to change something to meet mi needs //##################################################################3 void particulas(World worldIn, BlockPos pos){ //if (!worldObj.isRemote && rand.nextFloat()<0.1F) //{ Random rand = new Random(); int posX=pos.getX(); int posY=pos.getY(); int posZ=pos.getZ(); int width=5; int height=5; //float height=5.0F; //* height double motionX = rand.nextGaussian() * 0.02D; double motionY = rand.nextGaussian() * 0.02D; double motionZ = rand.nextGaussian() * 0.02D; worldIn.spawnParticle( "happyVillager", posX + rand.nextFloat() * width * 2.0F - width, posY + 0.5D + rand.nextFloat() * height, posZ + rand.nextFloat() * width * 2.0F - width, motionX, motionY, motionZ); } //##################################################################3 error: The method spawnParticle(EnumParticleTypes, double, double, double, double, double, double, int...) in the type World is not applicable for the arguments (String, float, double, float, double, double, double) and there is this object "EnumParticleTypes" i dont have idea how to use
-
good nigths i need to spam particles from diferent blocks when i use a custom item on them soo when i rigth click oak wood it spawns oak particles, but when i rigth click stone it spawn stone particles, http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-modding-tips.html im using this guide but icould'n make it work error "The constructor EntityParticleEmitter(World, float, double, float, double, double, double) is undefined" and ¿ who is lex What is Lex's full nick name?: thanks
-
sip is posible yes, you must create the first json and define in this the first texture then asing a parental json to define the form of the block , then make the second block json define the second texture and set the same parental json , i must question if this two blocks are just one texture for all the faces (parental cubeall.json) or is an multitexture (parental cube.json)
-
good days long ago i post this same question but let it behind unsolved for things create this 3d item and make it animated swiching json files, when aim this drill at a block it begins to goin down and up like crazy, and thats anoing, worst is to see it in hand guns. in this video if aim the drill to a block it begins to bounse but aiming to air works well, the shotgun goes down when shoot and its not suppouse to goin down when shoot , if aiming to a block it bounse mad as well. if i dont use playerIn.setItemInUse() and EnumAction it swings even when aiming to air. Using the bow EnumAction, i like the way it looks in thirth view but is shitti in first person, the animation stop until getMaxItemUseDuration() run out of time and restart so help how i stop the swing animations at item rigth click ? the use i been using of playerIn.setItemInUse() is rigth? or Unnecessary this is mi code i been geting the tics to switch the animations from the getModel() method to avoid mesing whith onUpdate() method and events package mercenarymod.items.herraminetas; import mercenarymod.materialesMercenarios; import mercenarymod.Mercenary; import net.minecraft.block.Block; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumAction; import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import mercenarymod.blocks.MercenaryModBlocks; import mercenarymod.items.MercenaryModItems; import mercenarymod.utilidades.chat; import mercenarymod.utilidades.nbtMercenaria; import java.lang.Math; import java.util.ArrayList; import java.util.List; import mercenarymod.utilidades.util; //############################################################################3 public class drillMercenario extends ItemPickaxe{ public static String name = "drillMercenario"; boolean giro=false; int munitionMax=0; static int munitionMax0=64; int tick=0; int textura; boolean continuar=false; public static ArrayList<Integer> coor0 = new ArrayList<Integer>(); public static final PropertyDirection FACING = PropertyDirection.create("facing"); //############################################################################3 public drillMercenario(){ super(materialesMercenarios.carbono_carbono()); setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerItem(this, name); setCreativeTab(Mercenary.herramientas); this.maxStackSize = 1; } //######################################################################################3 @Override public ModelResourceLocation getModel(ItemStack drill, EntityPlayer playerIn, int useRemaining){ ModelResourceLocation modelresourcelocation = new ModelResourceLocation("modmercenario:herramientas/drill/drillMercenario_04", "inventory"); animation(drill, playerIn,tick); if ((tick%10)==0){ boolean animation=nbtMercenaria.getBooleantag(drill, "animation"); //System.out.println("animation="+animation); if(!animation){ //animation(drill, playerIn,tick); //textura=nbtMercenaria.getInttag(drill, "textura"); giro=false; } } System.out.println("textura="+textura); switch(textura){ default:modelresourcelocation = new ModelResourceLocation("modmercenario:herramientas/drill/drillMercenario", "inventory") ;break; case 1:modelresourcelocation = new ModelResourceLocation("modmercenario:herramientas/drill/drillMercenario_00", "inventory") ;break; case 2:modelresourcelocation = new ModelResourceLocation("modmercenario:herramientas/drill/drillMercenario_01", "inventory") ; break; case 3:modelresourcelocation = new ModelResourceLocation("modmercenario:herramientas/drill/drillMercenario_02", "inventory") ;break; case 4:modelresourcelocation = new ModelResourceLocation("modmercenario:herramientas/drill/drillMercenario_03", "inventory") ;break; case 5:modelresourcelocation = new ModelResourceLocation("modmercenario:herramientas/drill/drillMercenario_04", "inventory") ;break; } tick++; if (tick>100){tick=0;nbtMercenaria.setBooleantag(drill, "animation",false);} return modelresourcelocation; } //####################################################################################3 void animation(ItemStack drill, EntityPlayer playerIn,int tick){ if (giro){ System.out.println("Giro="+tick); switch (tick){ case 0: case 12: case 49: textura=1;break; case 3: case 15: case 46: textura=2;break; case 6: case 18: case 43: textura=3;break; case 9: case 21: case 40: textura=4;break; case 23: textura=5;break; case 33: if(continuar){this.tick=22;continuar=false;}break; case 52: textura=0;this.tick=0;nbtMercenaria.setBooleantag(drill, "animation",false);giro=false;break; } } } //####################################################################################3 void inicializar(ItemStack drill){ //this do nothing for now int munition=0; int metadata=drill.getMetadata(); switch(metadata){ case 1: munition=munitionMax0/2;break; case 2: munition=munitionMax0;break; default:munition=0;break; } nbtMercenaria.setInttag(drill, "munition", munition); nbtMercenaria.setBooleantag(drill, "animation", false); nbtMercenaria.setBooleantag(drill, "liberar", false); nbtMercenaria.setInttag(drill, "bulletClip", 0); nbtMercenaria.setInttag(drill, "textura", 0); } //####################################################################################3 public ItemStack onItemRightClick(ItemStack drill, World worldIn, EntityPlayer playerIn){ System.out.println("onItemRightClick"); playerIn.setItemInUse(drill, this.getMaxItemUseDuration(drill)); boolean animation=nbtMercenaria.getBooleantag(drill, "animation"); if (!animation){ System.out.println("if (!animation)"); playerIn.setItemInUse(drill, this.getMaxItemUseDuration(drill)); int munition=nbtMercenaria.getInttag(drill,"munition"); //if (munition>0){} giro=true; tick=0; nbtMercenaria.setBooleantag(drill, "animation", true); System.out.println("\n\n acivar"); } if (animation & giro){ continuar=true; } return drill;} //############################################################################3 public int getMaxItemUseDuration(ItemStack stack) { return 1; } public EnumAction getItemUseAction(ItemStack stack) { return EnumAction.NONE; } //######################################################################################3 @SideOnly(Side.CLIENT) public void addInformation(ItemStack drill, EntityPlayer player, List list, boolean aBoolean) { int munition=nbtMercenaria.getInttag(drill, "munition"); if((munition>9998)||(munition<0)){ //inicializar int metadata=drill.getMetadata(); switch(metadata){ case 1: munition=munitionMax0/2;break; case 2: munition=munitionMax0;break; default:munition=0;break; } } String lore="redstone="+munition; String lore0="requiere suspencion de redstone para funcionar"; if(lore != "") { list.add(lore); list.add(lore0); } } }//fin de la classe
-
Good days i have a series of little issues to be tested on multiplayer but lacks of another pc to run minecraft. soo i wass tinking, i could launch two minecraft sesions from eclipse so lets set one of this open to lan and conect the other in multiplayer to the first But nop dont works the second see the first in the net but when try to connect returns "Failed to login: invalid session (Try restarting your game)" i try conect from eclipse session0 >eclipse session1 normal Minecraft > eclipse session0 eclipse session0 > normal Minecraft all the cases return the same error user in the first "Player669", user in the Second "Player256" user in the normal game "perromercenary" but says "player" and nop restatrting the minecrafts dont solve the trouble is way to have two minecrafts games runing at the same time playing in the same world multiplayer at the same pc at same time ?
-
done alredy it kkeps just one instance of event class runing at same time , its waits like a little more than a second to blow up, if i detonate more packages when is alredy running dont crash but add the new blocks to the list to break and break them but disapoint it is even seting the event class to break one single block per tick it stills lag but you can see how breaks everything one block at time so its gonna have to deal whith the lag and keep explosions the less bigger //###########################################################3 public boolean destroyBlockes(BlockPos pos_initial,World worldIn_initial){ int x=pos_initial.getX(),y=pos_initial.getY(),z=pos_initial.getZ(); int xmax=0,xmin=0, ymax=0,ymin=0, zmax=0,zmin=0; ArrayList<BlockPos> blockes = new ArrayList<BlockPos>(); blockes.clear(); BlockPos pos1=null; int R=2; //sizew //int C=2; //deep //cuadrado xmax=x+R; xmin=x-R; ymax=y+R; ymin=y-R; zmax=z+R; zmin=z-R; for (int dx=xmin ; dx <=xmax ;dx++){ for (int dy=ymin ; dy <=ymax ;dy++){ for (int dz=zmin ; dz <=zmax ;dz++){ BlockPos posx=new BlockPos(dx,dy,dz); IBlockState iblk0=worldIn_initial.getBlockState(posx); Block blk0=iblk0.getBlock(); int Hard=(int)blk0.getBlockHardness(worldIn_initial, posx); if ((Hard > -1 & Hard < 4)||(blk0.equals(Blocks.obsidian))){//ignore to hard except obsidiana blockes.add(posx); //worldIn_initial.destroyBlock(posx, true); } }}} mercenaryEvent.blockes.addAll(blockes); mercenaryEvent.explosions.add(pos_initial); mercenaryEvent.worldIn=worldIn_initial; //worldIn_entrada.newExplosion((Entity)null, x, y, z, 2.0F, true, true); //setDead(); return true; } //###########################################################3 package mercenarymod; import java.util.ArrayList; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; // import mercenarymod.mercenaryEvent //mercenaryEvent.blockes; //mercenaryEvent.worldIn; public class mercenaryEvent { int count=0; boolean countwassreset=false; public static ArrayList<BlockPos> blockes = new ArrayList<BlockPos>(); public static ArrayList<BlockPos> explosions = new ArrayList<BlockPos>(); public static World worldIn=null; //Called when the client ticks. @SubscribeEvent public void onClientTick(TickEvent.ClientTickEvent event) { //System.out.println("==============Cliente tick=============="); } //Called when the server ticks. Usually 20 ticks a second. @SubscribeEvent public void onServerTick(TickEvent.ServerTickEvent event) { //System.out.println("==============Servidor tick=============="); if (worldIn!=null){ if (!countwassreset){count=0;countwassreset=true;} int ticks=30; //wait until begin if(count==ticks){//explosiones; int l_explosions=explosions.size(); for (int explotar=0; explotar < l_explosions ; explotar++){ BlockPos poss=explosions.get(explotar); worldIn.newExplosion((Entity)null, poss.getX(), poss.getY(),poss.getZ(), 2.0F, true, true); } } if(count>ticks){ int l_blockes=blockes.size(); System.out.println("blockes has="+l_blockes+" conteo="+count); int T=8; //amount of blocks per tick int bmin=((count-ticks-1)*T) ,bmax=((count-ticks)*T); if ( bmax >= l_blockes ){bmax=(l_blockes-1);} System.out.println("\n break from bmin="+bmin+" to bmax="+bmax); for (int romper=bmin; romper < bmax ; romper++){ BlockPos posx=blockes.get(romper); worldIn.destroyBlock(posx, true); } if ( bmax >= (l_blockes-1) ){worldIn=null;countwassreset=false;blockes.clear();explosions.clear();} } count++; }}}
-
well the post now become about minecraft events well i read and alredy have create a events class and register it to preinit and have this on console [20:40:44] [server thread/INFO] [sTDOUT]: [mercenarymod.mercenaryEvent:onServerTick:28]: ==============Server tick============== [20:40:44] [server thread/INFO] [sTDOUT]: [mercenarymod.mercenaryEvent:onServerTick:28]: ==============Server tick============== [20:40:44] [server thread/INFO] [sTDOUT]: [mercenarymod.mercenaryEvent:onServerTick:28]: ==============Server tick============== [20:40:44] [Client thread/INFO] [sTDOUT]: [mercenarymod.mercenaryEvent:onClientTick:21]: ==============Client tick============== [20:40:44] [Client thread/INFO] [sTDOUT]: [mercenarymod.mercenaryEvent:onClientTick:21]: ==============Client tick============== [20:40:44] [Client thread/INFO] [sTDOUT]: [mercenarymod.mercenaryEvent:onClientTick:21]: ==============Client tick============== tinking in the posibilities i gona play a few days whit this and see what happen later
-
weel not getting mad but there is thing named google traductor it will gve you what tamaño is and other things in other langs the ticks thing sound interesting ServerTickEvent / WorldTickEvent al ready read http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-forge-1-6-4-1-8-eventhandler-and and other thinks but from i read, ¿ there is alredy a //Called when the server ticks. Usually 20 ticks a second. @SubscribeEvent public void onServerTick(TickEvent.ServerTickEvent event) { } to use in 1.8 or this must be created? and ?i could do watever i want here , like create in this event class a public static blockArray and fill the whit hundreds of blocks to break then in public void onServerTick(TickEvent.ServerTickEvent event) { if (pass == 0){break all the frist 100 blocks } if (pass == 1){break all the second 100 blocks } soo on soo on pass++ }
-
ñaa is a thing of features and feelings i wanna chain explosions so when the block recives the pulse its wait a full second to get the data of all the charges and then bllow up all the fucking thing in one single shot the simple way thath give no troubles but freeze temporaly the game when get to may blocks is package mercenarymod.blocks.explosivos; import java.util.ArrayList; import java.util.List; import java.util.Random; import org.apache.logging.log4j.core.config.Property; import mercenarymod.Mercenary; import mercenarymod.blocks.MercenaryModBlocks; import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import mercenarymod.mensajes.mensajeMercenarioalServidor; import mercenarymod.utilidades.chat; import net.minecraft.entity.EntityLivingBase; import mercenarymod.blocks.explosivos.tiempoDinamita; //import net.minecraft.command.CommandFill; public class dinamitaParaPerforaciones3 extends Block { public String name = "dinamitaParaPerforaciones3"; public static final PropertyDirection FACING = PropertyDirection.create("facing"); public int conteo=0; private BlockPos posa=null; public dinamitaParaPerforaciones3() { super(Material.tnt); setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerBlock(this, name); setCreativeTab(Mercenary.herramientas); //this.maxStackSize = 1; } //###########################################################3 public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { String F=""+state.getValue(FACING); System.out.println("\n\n\nFacing="+F); if ( F.contains("east") & worldIn.isAirBlock(pos.east()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("west") & worldIn.isAirBlock(pos.west()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("north") & worldIn.isAirBlock(pos.north()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("south") & worldIn.isAirBlock(pos.south()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("up") & worldIn.isAirBlock(pos.up()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("down") & worldIn.isAirBlock(pos.down()) ){worldIn.destroyBlock(pos, false);} //Minecraft mc = Minecraft.getMinecraft(); //EntityPlayer playerIn= mc.thePlayer; if (worldIn.isBlockPowered(pos)){ if (pos.equals(posa)){System.out.println("%%%%%%\n ignorar posicion por estar repetida\n"+pos+"\n"+posa);/*do nothing*/;} else { posa=pos; destruirBlockes(pos,worldIn); //tiempoDinamita.habilitar(worldIn,pos); } } } //###########################################################3 public Block setBlockUnbreakable() { this.setHardness(-1.0F); return this; } //###########################################################3 public Item getItemDropped(IBlockState state, Random rand, int fortune) { return null; //Item.getItemFromBlock(MercenaryModBlocks.romper); } //###########################################################3 public boolean isOpaqueCube() { return false; } @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } //###########################################################3 public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { IBlockState bs0 = worldIn.getBlockState(pos.north()); IBlockState bs1 = worldIn.getBlockState(pos.south()); IBlockState bs2 = worldIn.getBlockState(pos.east()); IBlockState bs3 = worldIn.getBlockState(pos.west()); System.out.println("Norte="+bs0.getBlock().getUnlocalizedName()); System.out.println("Sur="+bs1.getBlock().getUnlocalizedName()); System.out.println("Este="+bs2.getBlock().getUnlocalizedName()); System.out.println("Oeste="+bs3.getBlock().getUnlocalizedName()); System.out.println("\n\n\nmundo="+worldIn.isRemote); /* net.minecraft.command.CommandFill fill = new net.minecraft.command.CommandFill(); //String [] comando= {"-136","41","215","-140","44","217","minecraft:glass"}; String [] comando= {"-136","41","215","-140","44","217","minecraft:air","0","destroy"}; try { if (!worldIn.isRemote){fill.execute(playerIn, comando);} } catch (CommandException e) { e.printStackTrace(); } */ return false;} //###########################################################3 public void destruirBlockes(BlockPos pos_entrada,World worldIn_entrada){ //Minecraft mc = Minecraft.getMinecraft(); //EntityPlayer playerIn= mc.thePlayer; int x=pos_entrada.getX(),y=pos_entrada.getY(),z=pos_entrada.getZ(); int xmax=0,xmin=0, ymax=0,ymin=0, zmax=0,zmin=0; IBlockState state_entrada = worldIn_entrada.getBlockState(pos_entrada); Block iblk_entrada=state_entrada.getBlock(); String F=""+state_entrada.getValue(FACING); BlockPos pos1=null; int T=3; //tamaño int C=6; //profundidad if(F.contains("down")){ pos1= new BlockPos(x,(y-1),z); xmax=x+T; xmin=x-T; ymax=y; ymin=y-(T*2)-C; zmax=z+T; zmin=z-T; } if(F.contains("up")){ pos1= new BlockPos(x,(y+1),z); xmax=x+T; xmin=x-T; ymax=y+(T*2)+C; ymin=y; zmax=z+T; zmin=z-T; } if(F.contains("north")){ pos1= new BlockPos(x,y,(z-1)); xmax=x+T; xmin=x-T; ymax=y+T; ymin=y-T; zmax=z; zmin=z-(T*2)-C; } if(F.contains("south")){ pos1= new BlockPos(x,y,(z+1)); xmax=x+T; xmin=x-T; ymax=y+T; ymin=y-T; zmax=z+(T*2)+C; zmin=z; } if(F.contains("east")){ pos1= new BlockPos((x+1),y,z); xmax=x+(T*2)+C; xmin=x; ymax=y+T; ymin=y-T; zmax=z+T; zmin=z-T; } if(F.contains("west")){ pos1= new BlockPos((x-1),y,z); xmax=x; xmin=x-(T*2)-C; ymax=y+T; ymin=y-T; zmax=z+T; zmin=z-T; } for (int dx=xmin ; dx <=xmax ;dx++){ for (int dy=ymin ; dy <=ymax ;dy++){ for (int dz=zmin ; dz <=zmax ;dz++){ BlockPos posx=new BlockPos(dx,dy,dz); worldIn_entrada.destroyBlock(posx, true); }}} worldIn_entrada.newExplosion((Entity)null, x, y, z, 2.0F, true, true); //setDead(); //return comando; } //###########################################################3 public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { EnumFacing cara = getFacingFromEntity(worldIn, pos, placer); worldIn.setBlockState(pos, state.withProperty(FACING, cara.getOpposite()), 2); //worldIn.setBlockState(pos, state.withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)), 2); } //###########################################################3 public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)); } //###########################################################3 public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); float f = 0.25F; EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); if (enumfacing != null) { switch (dinamitaParaPerforaciones.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.01F, 1.0F); break; case 2: this.setBlockBounds(0.0F, 0.99F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 3: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.01F); break; case 4: this.setBlockBounds(0.0F, 0.0F, 0.99F, 1.0F, 1.0F, 1.0F); break; case 5: this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.01F, 1.0F, 1.0F); break; case 6: this.setBlockBounds(0.99F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } } //###########################################################3 public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } //###########################################################3 public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn) { if (MathHelper.abs((float)entityIn.posX - (float)clickedBlock.getX()) < 2.0F && MathHelper.abs((float)entityIn.posZ - (float)clickedBlock.getZ()) < 2.0F) { double d0 = entityIn.posY + (double)entityIn.getEyeHeight(); if (d0 - (double)clickedBlock.getY() > 2.0D) { return EnumFacing.UP; } if ((double)clickedBlock.getY() - d0 > 0.0D) { return EnumFacing.DOWN; } } return entityIn.getHorizontalFacing().getOpposite(); } //###########################################################3 @SideOnly(Side.CLIENT) public IBlockState getStateForEntityRender(IBlockState state) { return this.getDefaultState().withProperty(FACING, EnumFacing.UP); } //###########################################################3 protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {FACING}); } //###########################################################3 public int getMetaFromState(IBlockState state) { byte b0 = 0; int i = b0 | ((EnumFacing)state.getValue(FACING)).getIndex(); return i; } //###########################################################3 static final class SwitchEnumFacing { static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; private static final String __OBFID = "CL_00002037"; static { try { FACING_LOOKUP[EnumFacing.DOWN.ordinal()] = 1; } catch (NoSuchFieldError var6) { ; } try { FACING_LOOKUP[EnumFacing.UP.ordinal()] = 2; } catch (NoSuchFieldError var5) { ; } try { FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 3; } catch (NoSuchFieldError var4) { ; } try { FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 4; } catch (NoSuchFieldError var3) { ; } try { FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 5; } catch (NoSuchFieldError var2) { ; } try { FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 6; } catch (NoSuchFieldError var1) { ; } } } //###########################################################3 /* public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); } */ /* public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { this.setBlockBoundsBasedOnState(worldIn, pos); return super.getCollisionBoundingBox(worldIn, pos, state); } */ public boolean isFullCube() { return false; } //###########################################################3 public String getUnlocalizedName(ItemStack stack) { int m= stack.getMetadata(); if (m == 0){return name+"0" ;} if (m == 1){return name+"1" ;} if (m == 2){return name+"2" ;} if (m == 3){return name+"3" ;} if (m == 4){return name+"4" ;} if (m == 5){return name+"5" ;} if (m == 5){return name+"6" ;} if (m == 5){return name+"7" ;} return name+"0"; } @SideOnly(Side.CLIENT) public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { subItems.add(new ItemStack(itemIn, 1, 0)); subItems.add(new ItemStack(itemIn, 1, 1)); subItems.add(new ItemStack(itemIn, 1, 2)); subItems.add(new ItemStack(itemIn, 1, 3)); subItems.add(new ItemStack(itemIn, 1, 4)); subItems.add(new ItemStack(itemIn, 1, 5)); subItems.add(new ItemStack(itemIn, 1, 6)); subItems.add(new ItemStack(itemIn, 1, 7)); } //###########################################################3 }//fin de la clase
-
well lets working i get ride of the unnesesary static almos all and get ride from all the Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; make a set in an execute.class to load the int[] array whit the data of the blocks to break and set the mesenger class to run execute and break the blocks on the comand "romper " but still get the exeption. Question ? im executing code in the server using the packages trick how do to get the current world to use in worldIn.destroy(blockpos , drops); im geting the player from the message public static class Handler0 implements IMessageHandler<mensajeMercenarioalServidor, IMessage> { @Override public IMessage onMessage(mensajeMercenarioalServidor message, MessageContext ctx) { EntityPlayer playerIn=ctx.getServerHandler().playerEntity; EntityPlayerMP playerMp=(EntityPlayerMP)playerIn; ejecutar.esto(texto0,playerIn);//this pas the "mesage" and the player get from the message sender return null; // no response in this case } in the ejecutar.class i get world from the player using World worldIn=playerIn.getEntityWorld(); and then do //load comandofill whit max and mins public void setComando(int[] comando0){ comandofill=comando0; System.out.println("comando reciviod="+comando0); } //"romper" if (comando.equals("romper")){ //destruir maxivamente Blockes en el mundo System.out.println("Mundo="+worldIn.isRemote); int xmin=comandofill[0], ymin=comandofill[1], zmin=comandofill[2]; int xmax=comandofill[3], ymax=comandofill[4], zmax=comandofill[5]; for (int dx=xmin;dx <= xmax; dx++ ){ for (int dy=ymin;dy <= ymax; dy++ ){ for (int dz=zmin;dz <= zmax; dz++ ){ BlockPos posx= new BlockPos(dx,dy,dz); System.out.println("romper="+posx) ; worldIn.destroyBlock(posx, true); }}} } //##########################################################33
-
i get it from the minecraft class doing the Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; but if its the guilty on the player where i could get the player entity? and from the packages i been triyng write the array directly to an execute.class then send to the server a message to execute the code in the execude class but in this case it only gets the array the server class. sounds legit i gonna try thath the class is long but here is package mercenarymod.blocks.explosivos; import java.util.ArrayList; import java.util.List; import java.util.Random; import org.apache.logging.log4j.core.config.Property; import mercenarymod.Mercenary; import mercenarymod.blocks.MercenaryModBlocks; import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import mercenarymod.utilidades.chat; import net.minecraft.entity.EntityLivingBase; import mercenarymod.blocks.explosivos.tiempoDinamita; //import net.minecraft.command.CommandFill; public class dinamitaParaPerforaciones3 extends Block { public static String name = "dinamitaParaPerforaciones3"; public static final PropertyDirection FACING = PropertyDirection.create("facing"); public static int conteo=0; public static ArrayList<tiempoDinamita> listaDinamita = new ArrayList<tiempoDinamita>(); private static BlockPos posa=null; public dinamitaParaPerforaciones3() { super(Material.tnt); setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerBlock(this, name); setCreativeTab(Mercenary.herramientas); //this.maxStackSize = 1; } //###########################################################3 public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { String F=""+state.getValue(FACING); System.out.println("\n\n\nFacing="+F); if ( F.contains("east") & worldIn.isAirBlock(pos.east()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("west") & worldIn.isAirBlock(pos.west()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("north") & worldIn.isAirBlock(pos.north()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("south") & worldIn.isAirBlock(pos.south()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("up") & worldIn.isAirBlock(pos.up()) ){worldIn.destroyBlock(pos, false);} if ( F.contains("down") & worldIn.isAirBlock(pos.down()) ){worldIn.destroyBlock(pos, false);} Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; if (worldIn.isBlockPowered(pos)){ if (pos.equals(posa)){System.out.println("%%%%%%\n ignorar posicion por estar repetida\n"+pos+"\n"+posa);/*do nothing*/;} else { posa=pos; destruirBlockes(pos,worldIn); //tiempoDinamita.habilitar(worldIn,pos); } } } //###########################################################3 public Block setBlockUnbreakable() { this.setHardness(-1.0F); return this; } //###########################################################3 public Item getItemDropped(IBlockState state, Random rand, int fortune) { return null; //Item.getItemFromBlock(MercenaryModBlocks.romper); } //###########################################################3 public boolean isOpaqueCube() { return false; } @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } //###########################################################3 public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { IBlockState bs0 = worldIn.getBlockState(pos.north()); IBlockState bs1 = worldIn.getBlockState(pos.south()); IBlockState bs2 = worldIn.getBlockState(pos.east()); IBlockState bs3 = worldIn.getBlockState(pos.west()); System.out.println("Norte="+bs0.getBlock().getUnlocalizedName()); System.out.println("Sur="+bs1.getBlock().getUnlocalizedName()); System.out.println("Este="+bs2.getBlock().getUnlocalizedName()); System.out.println("Oeste="+bs3.getBlock().getUnlocalizedName()); System.out.println("\n\n\nmundo="+worldIn.isRemote); /* net.minecraft.command.CommandFill fill = new net.minecraft.command.CommandFill(); //String [] comando= {"-136","41","215","-140","44","217","minecraft:glass"}; String [] comando= {"-136","41","215","-140","44","217","minecraft:air","0","destroy"}; try { if (!worldIn.isRemote){fill.execute(playerIn, comando);} } catch (CommandException e) { e.printStackTrace(); } */ return false;} //###########################################################3 public static String[] destruirBlockes(BlockPos pos_entrada,World worldIn_entrada){ Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; int x=pos_entrada.getX(),y=pos_entrada.getY(),z=pos_entrada.getZ(); int xmax=0,xmin=0, ymax=0,ymin=0, zmax=0,zmin=0; IBlockState state_entrada = worldIn_entrada.getBlockState(pos_entrada); Block iblk_entrada=state_entrada.getBlock(); String F=""+state_entrada.getValue(FACING); BlockPos pos1=null; int T=3; //tamaño int C=6; //profundidad if(F.contains("down")){ pos1= new BlockPos(x,(y-1),z); xmax=x+T; xmin=x-T; ymax=y; ymin=y-(T*2)-C; zmax=z+T; zmin=z-T; } if(F.contains("up")){ pos1= new BlockPos(x,(y+1),z); xmax=x+T; xmin=x-T; ymax=y+(T*2)+C; ymin=y; zmax=z+T; zmin=z-T; } if(F.contains("north")){ pos1= new BlockPos(x,y,(z-1)); xmax=x+T; xmin=x-T; ymax=y+T; ymin=y-T; zmax=z; zmin=z-(T*2)-C; } if(F.contains("south")){ pos1= new BlockPos(x,y,(z+1)); xmax=x+T; xmin=x-T; ymax=y+T; ymin=y-T; zmax=z+(T*2)+C; zmin=z; } if(F.contains("east")){ pos1= new BlockPos((x+1),y,z); xmax=x+(T*2)+C; xmin=x; ymax=y+T; ymin=y-T; zmax=z+T; zmin=z-T; } if(F.contains("west")){ pos1= new BlockPos((x-1),y,z); xmax=x; xmin=x-(T*2)-C; ymax=y+T; ymin=y-T; zmax=z+T; zmin=z-T; } chat.chatga(playerIn, "mundo="+worldIn_entrada.isRemote); net.minecraft.command.CommandFill fill = new net.minecraft.command.CommandFill(); //String [] comando= {"-136","41","215","-140","44","217","minecraft:glass"}; String [] comando= {xmin+"",ymin+"",zmin+"",xmax+"",ymax+"",zmax+"","minecraft:air","0","destroy"}; try { if (!worldIn_entrada.isRemote){fill.execute(playerIn, comando);} } catch (CommandException e) { e.printStackTrace(); } boolean flag=true; int explosionPower = 1; worldIn_entrada.newExplosion((Entity)null, x, y, z, (float)explosionPower, flag, flag); //setDead(); return comando; } //###########################################################3 public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { EnumFacing cara = getFacingFromEntity(worldIn, pos, placer); worldIn.setBlockState(pos, state.withProperty(FACING, cara.getOpposite()), 2); //worldIn.setBlockState(pos, state.withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)), 2); } //###########################################################3 public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return this.getDefaultState().withProperty(FACING, getFacingFromEntity(worldIn, pos, placer)); } //###########################################################3 public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { IBlockState iblockstate = worldIn.getBlockState(pos); float f = 0.25F; EnumFacing enumfacing = (EnumFacing)iblockstate.getValue(FACING); if (enumfacing != null) { switch (dinamitaParaPerforaciones3.SwitchEnumFacing.FACING_LOOKUP[enumfacing.ordinal()]) { case 1: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.01F, 1.0F); break; case 2: this.setBlockBounds(0.0F, 0.99F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 3: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.01F); break; case 4: this.setBlockBounds(0.0F, 0.0F, 0.99F, 1.0F, 1.0F, 1.0F); break; case 5: this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.01F, 1.0F, 1.0F); break; case 6: this.setBlockBounds(0.99F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } } //###########################################################3 public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } //###########################################################3 public static EnumFacing getFacingFromEntity(World worldIn, BlockPos clickedBlock, EntityLivingBase entityIn) { if (MathHelper.abs((float)entityIn.posX - (float)clickedBlock.getX()) < 2.0F && MathHelper.abs((float)entityIn.posZ - (float)clickedBlock.getZ()) < 2.0F) { double d0 = entityIn.posY + (double)entityIn.getEyeHeight(); if (d0 - (double)clickedBlock.getY() > 2.0D) { return EnumFacing.UP; } if ((double)clickedBlock.getY() - d0 > 0.0D) { return EnumFacing.DOWN; } } return entityIn.getHorizontalFacing().getOpposite(); } //###########################################################3 @SideOnly(Side.CLIENT) public IBlockState getStateForEntityRender(IBlockState state) { return this.getDefaultState().withProperty(FACING, EnumFacing.UP); } //###########################################################3 protected BlockState createBlockState() { return new BlockState(this, new IProperty[] {FACING}); } //###########################################################3 public int getMetaFromState(IBlockState state) { byte b0 = 0; int i = b0 | ((EnumFacing)state.getValue(FACING)).getIndex(); return i; } //###########################################################3 static final class SwitchEnumFacing { static final int[] FACING_LOOKUP = new int[EnumFacing.values().length]; private static final String __OBFID = "CL_00002037"; static { try { FACING_LOOKUP[EnumFacing.DOWN.ordinal()] = 1; } catch (NoSuchFieldError var6) { ; } try { FACING_LOOKUP[EnumFacing.UP.ordinal()] = 2; } catch (NoSuchFieldError var5) { ; } try { FACING_LOOKUP[EnumFacing.NORTH.ordinal()] = 3; } catch (NoSuchFieldError var4) { ; } try { FACING_LOOKUP[EnumFacing.SOUTH.ordinal()] = 4; } catch (NoSuchFieldError var3) { ; } try { FACING_LOOKUP[EnumFacing.WEST.ordinal()] = 5; } catch (NoSuchFieldError var2) { ; } try { FACING_LOOKUP[EnumFacing.EAST.ordinal()] = 6; } catch (NoSuchFieldError var1) { ; } } } //###########################################################3 /* public void addCollisionBoxesToList(World worldIn, BlockPos pos, IBlockState state, AxisAlignedBB mask, List list, Entity collidingEntity) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); super.addCollisionBoxesToList(worldIn, pos, state, mask, list, collidingEntity); } */ /* public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state) { this.setBlockBoundsBasedOnState(worldIn, pos); return super.getCollisionBoundingBox(worldIn, pos, state); } */ public boolean isFullCube() { return false; } //###########################################################3 public String getUnlocalizedName(ItemStack stack) { int m= stack.getMetadata(); if (m == 0){return name+"0" ;} if (m == 1){return name+"1" ;} if (m == 2){return name+"2" ;} if (m == 3){return name+"3" ;} if (m == 4){return name+"4" ;} if (m == 5){return name+"5" ;} if (m == 5){return name+"6" ;} if (m == 5){return name+"7" ;} return name+"0"; } @SideOnly(Side.CLIENT) public void getSubItems(Item itemIn, CreativeTabs tab, List subItems) { subItems.add(new ItemStack(itemIn, 1, 0)); subItems.add(new ItemStack(itemIn, 1, 1)); subItems.add(new ItemStack(itemIn, 1, 2)); subItems.add(new ItemStack(itemIn, 1, 3)); subItems.add(new ItemStack(itemIn, 1, 4)); subItems.add(new ItemStack(itemIn, 1, 5)); subItems.add(new ItemStack(itemIn, 1, 6)); subItems.add(new ItemStack(itemIn, 1, 7)); } //###########################################################3 }//fin de la clase
-
yap i google it but i wass wrong i think it refers to mi arrays but nop this is something in minecraft so mi new teory is that when i wrote masively blocks it just coincide whit minecraft updating or sync the worlds and crash soo if this is the true how i syncronize mi destructions to make then happend in safe moments ?
-
goo days i been working in this project, and to achive it i need to break masive amounts of blocks. heres the video heres happen but not all the times the hole make by the explosion just happen apparently in server only soo i cant get in the hole becose the local world think there is still blocks inside to cause this explosion and remove blocks im using the fill command but where im executing the code is inside a public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { } in the explosive block from then i execute chat.chatga(playerIn, "mundo="+worldIn_entrada.isRemote); net.minecraft.command.CommandFill fill = new net.minecraft.command.CommandFill(); //String [] comando= {"-136","41","215","-140","44","217","minecraft:glass"}; String [] comando= {xmin+"",ymin+"",zmin+"",xmax+"",ymax+"",zmax+"","minecraft:air","0","destroy"}; try { fill.execute(playerIn, comando); } catch (CommandException e) { e.printStackTrace(); } and the message part chat.chatga(playerIn, "mundo="+worldIn_entrada.isRemote); always return false on player screen this means this code only execute in server. to avoid this trouble i need to execute this in server and in local at same time ###### packets i alredy have a working class to send messages to server and local world but just allow to send strings from 6 to 14 char and to work the fill a need to send it to blocks coordentes or a String[] array exem: String [] comando= {xmin+"",ymin+"",zmin+"",xmax+"",ymax+"",zmax+"","minecraft:air","0","destroy"}; ?? is workaround to send complex packages to the server ??
-
well the packets idea is sound nice but i gonna doo that in other post in the other side the fill method works but also crash the game whit the same mesagge from time to time java.util.ConcurrentModificationException and happen too, that it just broke bloks in one side soo you end whit a clean area where you can't enter but when testing this dont happen i and now i have a diferent theory but i goona take an few hours to confirm .
-
yaa irealize how to use it net.minecraft.command.CommandFill fill = new net.minecraft.command.CommandFill(); String [] comando= {"-136","41","215","-140","44","217","minecraft:glass"}; //String [] comando= {"-136","41","215","-140","44","217","minecraft:air","0","destroy"}; try { if (!worldIn.isRemote){fill.execute(playerIn, comando);} } catch (CommandException e) { e.printStackTrace(); } if it gets execute when (worldIn.isRemote) it destroy the blocks just in local but no in server im buged by thi question this code trow errors in the console but works when puting blocks net.minecraft.command.NumberInvalidException: commands.generic.num.tooBig and its just an area of 24 blocks when destroying blocks net.minecraft.command.CommandException: commands.fill.failed but all the blocks get break and afther restart minecraft theres no blcks coming back from death, ñaa i must reddo the code whith this
-
yaaa get extresed and reddo all the code and make something more simple, now it workd like it must but from time to time get stuck and have to restar minecraft [16:16:25] [server thread/ERROR]: Encountered an unexpected exception java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.nextEntry(Unknown Source) ~[?:1.7.0_71] at java.util.HashMap$KeyIterator.next(Unknown Source) ~[?:1.7.0_71] the interesting part is that i have made this thread in way it cannot be two instances of this runing at same time soo i dont know were is coming this modification uu maiby is a thing from minecraft for change to many blocks in one single shoot i read or hear something about of minecraft 1.8 having comands to clean multiplex blocks at once and to refill areas like a magic wand but now in vainilla package mercenarymod.blocks.explosivos; import java.util.ArrayList; import mercenarymod.Mercenary; import mercenarymod.items.MercenaryModItems; import mercenarymod.mensajes.mensajeMercenarioalServidor; import mercenarymod.utilidades.chat; import mercenarymod.utilidades.registrarTextura; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; import net.minecraft.world.World; import mercenarymod.mensajes.ejecutar; //importar tiempo //import mercenarymod.blocks.explosivos.tiempoDinamita; //crear objeto tiempo //tiempo0 t0=new tiempo0(); //ejecuta run en tiempo //new Thread(t0).start(); //###################################################################################3 public class tiempoDinamita implements Runnable{ private static final IProperty FACING= PropertyDirection.create("facing");; private static int tiempo=3000; private static int conteo=0; private static boolean corriendo=false; public static boolean getEstado() {return corriendo;} public static void setEstado(boolean st) {corriendo=st;} private static tiempoDinamita tD=new tiempoDinamita(); private static World worldIn; private static BlockPos posd; private static BlockPos pos; private static BlockPos posx; private static String F;//facing private static int T;//tamaño private static IBlockState iblk0; private static Block blk0; private static BlockPos pos1; private static IBlockState iblk1; private static Block blk1; private static BlockPos pos2; private static IBlockState iblk2; private static Block blk2; private static int Hard; private static int lblockesParaRomper; private static int lblockesConExplosivos; private static boolean aceptarmas=true; private static ArrayList<BlockPos> blockesConExplosivos = new ArrayList<BlockPos>(); private static ArrayList<BlockPos> blockesARomper = new ArrayList<BlockPos>(); //###################################################################################3 //el metodo habilitar inicia todo public static boolean habilitado=false; public static boolean gethabilitar() {return habilitado;} public static void habilitar(World worldIn0,BlockPos pos0) { //if (corriendo){/*habilitado=true*/;} worldIn=worldIn0; if(aceptarmas){ blockesConExplosivos.add(pos0); } if (!corriendo){new Thread(tD).start(); habilitado=true;} } //###################################################################################3 //contructor vacio public tiempoDinamita(){;} //###################################################################################3 public static void m(String message){System.out.println(message);} //###################################################################################3 @Override public void run(){ corriendo=true; try { while (habilitado){ habilitado=false; //##### inicio del try Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; aceptarmas=true; Thread.sleep(1000);//1000 milliseconds is one second. aceptarmas=false; //seleccionar los blockes que se van a romper lblockesConExplosivos= blockesConExplosivos.size(); for (int explotar=0 ;explotar < lblockesConExplosivos ;explotar++){ escojerBlockesaRomper(blockesConExplosivos.get(explotar)); } int lblockesARomper=blockesARomper.size(); ArrayList<BlockPos> experiment = new ArrayList<BlockPos>(); experiment.addAll(blockesARomper); int lexperiment=experiment.size(); if (lexperiment>0){ for(int bd=0 ;bd< lexperiment;bd++){ BlockPos bdx=experiment.get(bd); worldIn.destroyBlock(bdx, true); //worldIn.markBlockForUpdate(bdx); //Thread.sleep(10); //if ((bd%50)==0){Thread.sleep(500);} } } /* //mandar a romper los blockes if (lblockesARomper>0){ for(int bd=0 ;bd< lblockesARomper;bd++){ BlockPos bdx=blockesARomper.get(bd); worldIn.destroyBlock(bdx, true); //Thread.sleep(10); //if ((bd%50)==0){Thread.sleep(500);} } } */ blockesConExplosivos.clear(); blockesARomper.clear(); aceptarmas=true; Thread.sleep(100); }//fin del while //##### fin de try }catch(InterruptedException ex) { Thread.currentThread().interrupt(); } corriendo=false;}//fin de run //###################################################################################3 private static void escojerBlockesaRomper(BlockPos pos_entrada){ Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; if (!worldIn.isAirBlock(pos_entrada)){ IBlockState iblk_entrada=worldIn.getBlockState(pos_entrada); Block blk_entrada=iblk_entrada.getBlock(); String F=""+iblk_entrada.getValue(FACING); int T=1; int C=2; //chat.chatgr(playerIn, "Blocke ="+pos_entrada+" redstone facing="+F+" T="+T); int x=pos_entrada.getX(),y=pos_entrada.getY(),z=pos_entrada.getZ(); int xmax=0,xmin=0, ymax=0,ymin=0, zmax=0,zmin=0; if(F.contains("down")){ pos1= new BlockPos(x,(y-1),z); xmax=x+T; xmin=x-T; ymax=y; ymin=y-(T*2)-C; zmax=z+T; zmin=z-T; } if(F.contains("up")){ pos1= new BlockPos(x,(y+1),z); xmax=x+T; xmin=x-T; ymax=y+(T*2)+C; ymin=y; zmax=z+T; zmin=z-T; } if(F.contains("north")){ pos1= new BlockPos(x,y,(z-1)); xmax=x+T; xmin=x-T; ymax=y+T; ymin=y-T; zmax=z; zmin=z-(T*2)-C; } if(F.contains("south")){ pos1= new BlockPos(x,y,(z+1)); xmax=x+T; xmin=x-T; ymax=y+T; ymin=y-T; zmax=z+(T*2)+C; zmin=z; } if(F.contains("east")){ pos1= new BlockPos((x+1),y,z); xmax=x+(T*2)+C; xmin=x; ymax=y+T; ymin=y-T; zmax=z+T; zmin=z-T; } if(F.contains("west")){ pos1= new BlockPos((x-1),y,z); xmax=x; xmin=x-(T*2)-C; ymax=y+T; ymin=y-T; zmax=z+T; zmin=z-T; } //este x+ for (int dx=xmin ;dx<=xmax;dx++){ for (int dy=ymin ;dy<=ymax;dy++){ for (int dz=zmin ;dz<=zmax;dz++){ posx=new BlockPos(dx,dy,dz); iblk0=worldIn.getBlockState(posx); blk0=iblk0.getBlock(); Material mblk0=blk0.getMaterial(); if( mblk0==Material.barrier | mblk0==Material.air){/*Ignorar estos materiales*/;} else{ Hard=(int)blk0.getBlockHardness(worldIn, posx); if (posx.equals(pos1)){/*chat.chatgo(playerIn, "Blocke objetivo"+posx+" = "+pos1+" 0 "+pos)*/;} if (Hard > -1 & Hard < 4){//ignorar muy duros e irrompibles blockesARomper.add(posx); }} }}} //worldIn.destroyBlock(pos, false); }//fin de is is air } //###################################################################################3 }//fin de la classe