Jump to content

perromercenary00

Members
  • Posts

    849
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by perromercenary00

  1. good days getting a lot of troubles maken a method to clean an area minecraft gets overload and stop and freeze or end crashed im using this to break a list of blocks //##########################################################33 //"romper" if (comando.equals("romper")){ //destruir maxivamente Blockes en el mundo int lblockesParaRomper=blockesParaRomper.size(); //chat.chatr(playerIn, "Rompiendo mundo="+worldIn.isRemote+" b="+lblockesParaRomper); try{ for(int bd=0 ; bd < 100 ; bd++){ //lblockesParaRomper BlockPos bdx=blockesParaRomper.get(bd); // worldIn.destroyBlock(bdx, true); Thread.sleep(100); } }catch(InterruptedException ex) { Thread.currentThread().interrupt(); } } //##########################################################33 im loading a list whith the blocks i wanna brek public static ArrayList<BlockPos> blockesParaRomper = new ArrayList<BlockPos>(); //lista de blockes a romper then execute this this is it event seting t a time of 100ms betwin every block break ill end freezze but sometimes it gets the job done in 1.7 i do something similar and only gives problem went the list goes over 400 blocks this list are just for max 150 some ifdea of what could use
  2. wo like year and half playing minecrat and now get informet than the milk healts poison an anormal status playerIn.curePotionEffects(new ItemStack(Items.milk_bucket,1,0));
  3. goo days i been working in some food items for mi mod an get to this i wanna this item to cures poison an other anomral status i dont know how is calling inside minecraft mining fatigue blindness alredi have the part of the healt hungry and starvation public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityPlayer playerIn) { --stack.stackSize; playerIn.getFoodStats().addStats(2, 2); playerIn.setHealth(playerIn.getHealth()+2); worldIn.playSoundAtEntity(playerIn, "random.burp", 0.5F, worldIn.rand.nextFloat() * 0.1F + 0.9F); this.onFoodEaten(stack, worldIn, playerIn); //playerIn.triggerAchievement(StatList.objectUseStats[item.getIdFromItem(this)]); return stack; } this gives one heart a food unit plus one of starvation i play minecraft in spanish so i not used to names in english and think blindness is part of the lord of rings mod if its the case i let it aside for a while but poison it must be vanilla
  4. see i alredy see the little mistake now is working like it must but tired i gonna end this code otherday thnaks public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { chat.chatdp(playerIn, "activado"); ArrayList<EntityLivingBase> lisanimales = new ArrayList<EntityLivingBase>(); List lista=null; int f=2; int x=pos.getX(),y=pos.getY(),z=pos.getZ(); BlockPos posMin = new BlockPos(x-f,y-1,z-f); BlockPos posMax = new BlockPos(x+f,y+1,z+f); AxisAlignedBB boundingBox=new AxisAlignedBB(posMin, posMax); lista = worldIn.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); int llist=lista.size(); for(int l=0 ;l<llist;l++){ EntityLivingBase mob= (EntityLivingBase) lista.get(l); chat.chatda(playerIn, ""+mob.getName()+" hp="+mob.getHealth() ); mob.setHealth(mob.getHealth()-20); ;}
  5. well i do this public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { chat.chatdp(playerIn, "activado"); ArrayList<EntityLivingBase> lisanimales = new ArrayList<EntityLivingBase>(); List lista=null; int f=5; int x=pos.getX(),y=pos.getY(),z=pos.getZ(); BlockPos posMin = new BlockPos(x-5,y-1,z-5); BlockPos posMax = new BlockPos(x+5,y+1,z+5); AxisAlignedBB boundingBox=new AxisAlignedBB(pos, pos); lista = worldIn.getEntitiesWithinAABB(EntityLivingBase.class, boundingBox); int llist=lista.size(); for(int l=0 ;l<llist;l++){ chat.chatda(playerIn, ""+lista.get(l).toString()); ;} return false; } it must return on player screen a list of all the entity living aroun the block. but no works also no errors it execute i get message "activado" but no list is display
  6. goo days what I want is to get all entities within a distance of 5 blocks of this particular block in a list and then causes damage to each according to distance from the block in the code I found this command worldIn.getEntitiesWithinAABB (clazz, AABB, filter), who says to return a list, I alredy have an idea that is AABB but not know how to load and use this object in minecraft as for others have no idea of whath are the required values and this clazz and filter i been doing an explosive box it explodes and all but behaves like box means more destrucction than damage over the closes entites i wanna this barrel behaves diferent causing more damage to creatures than destruction over the world. i need guide to use getEntitiesWithinAAB or maiby a diferent method to achive the list thing. very gratefull.
  7. well now i have something and is working but im afraid to crash a server because i have done keybind > gearbox > sendtoservercomad > sendToLocalcomand i wann reduce the need of code in the event of trigering the accion put in my invetory so in gearbox now i just execute gearbox.java public static void liberar0() { System.out.println("\n\n\n=============liberar=true;============"); //just to mark whent it start this code in the console Mercenary.network.sendToServer(new mensajeMercenarioalServidor("liberar")); liberar=true; } notece i just send the packge to server im not executing the class ejecutar.java from here in the Server handler i do this i execute ejecutar.esto() and resend the mesage from here to the local world System.out.println("Mensaje en el Servidor="+texto0); EntityPlayer playerIn=ctx.getServerHandler().playerEntity; //method taken from diesieben07 EntityPlayerMP playerMp=(EntityPlayerMP)playerIn; World mundo=playerIn.getEntityWorld(); chat.chatda(playerIn, "in server mundo="+mundo.isRemote); ejecutar.esto(texto0,playerIn); Mercenary.network.sendTo(new mensajeMercenarioalMundoLocal("texto0"),playerMp); in the ClientHandler ido this and here is mi fear gets a craddle @Override public IMessage onMessage(mensajeMercenarioalMundoLocal message, MessageContext ctx) { System.out.println("MensajeLocal="+texto1); Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; //EntityPlayer playerIn=ctx.getServerHandler().playerEntity; //EntityPlayerMP playerMp=(EntityPlayerMP)playerIn; World mundo=playerIn.getEntityWorld(); chat.chatda(playerIn, "in local mundo="+mundo.isRemote); ejecutar.esto(texto1,playerIn); return null; // no response in this case } a have ended using Minecraft mc = Minecraft.getMinecraft(); to get the user but alredy told me that this could crash the server but here is no server here is the client so is teoricaly safe is this true or i have to find other way to get server , idont wanna include playerIn.getUnlocalizatedName in the mesage coz i read there is a limit of 16 characters and i gonna use thath to make this code do a lot of diferent things EntityPlayer playerIn=ctx.getServerHandler().playerEntity; dont works here and dont find equivalent EntityPlayer playerIn=ctx.getClientHandler().playerEntity; for this code, is working rigth no crash no errors on player screen i have in local mundo=true ejecutar mundo=true in server mundo=false ejecutar mundo=false in console i have =============liberar=true;============ [06:23:47] [Netty Server IO #1/INFO] [sTDOUT]: [mercenarymod.mensajes.mensajeMercenarioalServidor$Handler0:onMessage:65]: Mensaje en el Servidor=liberar [06:23:47] [Netty Local Client IO #0/INFO] [sTDOUT]: [mercenarymod.mensajes.mensajeMercenarioalMundoLocal$Handler1:onMessage:66]: MensajeLocal=texto0 [06:23:47] [Netty Local Client IO #0/INFO]: [CHAT] §3in local mundo=true [06:23:47] [Netty Local Client IO #0/INFO]: [CHAT] §3ejecutar mundo=true [06:23:47] [Client thread/INFO]: [CHAT] §3in server mundo=false [06:23:47] [Client thread/INFO]: [CHAT] §3ejecutar mundo=false the items gets to the player inventory whithout weirdness ineed to find i guide to mount a server whith mods for minecraft 1.8 and another pc whit videoCard to make tests to the code
  8. the troube is that the code end being execute in the local world only but there is like seven clases involving sending from one to other but this is the one launchiing the package to execute remotly and execute the code localy to the keybind trigers this in the gearbox class public static void liberar0() { Mercenary.network.sendToServer(new mensajeMercenarioalServidor("liberar"));//execute in server mercenarymod.mensajes.ejecutar.esto("liberar"); //execute here localy liberar=true; } the server handler0 catch the message and do this public IMessage onMessage(mensajeMercenarioalServidor message, MessageContext ctx) { //System.out.println(String.format("Received %s from %s", message, ctx.getServerHandler().playerEntity.getDisplayName())); System.out.println("### Mensaje en el Servidor="+texto0); //pruebaDeMundos.prueba(); ejecutar.esto(texto0); //execute this aparently in the server world } ihave this in console , and i assume it means the server is geting the message [21:32:32] [Netty Server IO #1/INFO] [sTDOUT]: [mercenarymod.mensajes.mensajeMercenarioalServidor$Handler0:onMessage:65]: ### Mensaje en el Servidor=liberar [21:32:32] [Netty Server IO #1/INFO]: [CHAT] §3mundo=true lastly the ejecutar class have this public static void esto(String comando){ Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; World mundo=playerIn.getEntityWorld(); chat.chatda(playerIn, "mundo="+mundo.isRemote); ItemStack objetoprueba = new ItemStack(MercenaryModItems.camaEl,1,0); playerIn.inventory.setInventorySlotContents(8, objetoprueba); } } the chat.chatda(playerIn, "mundo="+mundo.isRemote); apears 2 times in the screen and say two times mundo=true that means the code is executed two times but just local world , i get the item in inventory but behaves wrong becose is not synced whit server
  9. well good nigths i been create a keybind class and works now i wanna use that keybind to do something i set the key.MULTIPLY i want to put in mi inventory an item when this key is pressed but not know how to achive this, i think i must use packages so alredy have a funtional package handler and do this keybind.MULTIPLY > gearbox.class > packageToserver.class > executeCustonClassThatputTheitemInInventory. in efect i hit multiply and have the item created in inventory but just in the local world so it behaves wrong and can disapear i any moment or is there but dont works . these are just conjuteras whit code and has become long am clumsy like to put here the classes involved soo i gona leave it as a simple question for now how you would do for at pressing particular key on the keyboard will spawn a particular item in inventory
  10. https://drive.google.com/file/d/0B8sU_NyZQBd7WVo4NW1tTVJzZDQ/view?usp=sharing
  11. public ItemStack onItemRightClick(ItemStack cargador, World worldIn, EntityPlayer playerIn) { System.out.println("%%%%= es worldIn remoto ="+worldIn.isRemote); Mercenary.network.sendToServer(new mensajeMercenarioalServidor("es remoto este mundo")); if (!worldIn.isRemote){ EntityPlayerMP playerMp= (EntityPlayerMP) playerIn; Mercenary.network.sendTo(new mensajeMercenarioalMundoLocal("Es este el mundo local"),playerMp); } return cargador; } then this must be the rigth way to send the mesage to local and server at same time so that means (world.isRemote)=true then this is local world (!world.isRemote)=true then this is server world and it means to the bulletclip thing gonna get messy
  12. then you're saying that whith no server I still can send packets to the local world from the "local server" i think i need thath for wath im triying to do but. ¿how i get a instance of EntityPlayerMP. for my local player becose the method onitemrigthclick only give EntityPlayer whithout the MP and the network.sendTo( is demanding a playerMP look at this if i load this whith EntityPlayer playerIn eclipse starts complaining Mercenary.network.sendTo(new mensajeMercenarioalMundoLocal("Es este el mundo local"),playerIn); minecraft runs but crash wen i hit rigth click whit error java.util.concurrent.ExecutionException: java.lang.Error: Unresolved compilation problem: The method sendTo(IMessage, EntityPlayerMP) in the type SimpleNetworkWrapper is not applicable for the arguments (mensajeMercenarioalMundoLocal, EntityPlayer) ### if i do public ItemStack onItemRightClick(ItemStack cargador, World worldIn, EntityPlayer playerIn) { //EntityPlayerMP playerMp= (EntityPlayerMP) playerIn; //crash error java.lang.ClassCastException: net.minecraft.client.entity.EntityPlayerSP cannot be cast to net.minecraft.entity.player.EntityPlayerMP EntityPlayerMP playerMp=null; System.out.println("%%%%= es worldIn remoto ="+worldIn.isRemote); //Mercenary.network.sendToServer(new mensajeMercenarioalServidor("es remoto este mundo")); if (worldIn.isRemote){Mercenary.network.sendTo(new mensajeMercenarioalMundoLocal("Es este el mundo local"),playerMp);} return cargador; } eclipse does not bother me but anyway dont crash but dont work it fail for the null player java.lang.RuntimeException: PLAYER target expects a Player arg ### is geting to long i need to know how i get an instance of EntityPlayerMP or maiby i have wrong the mensajeMercenarioalMundoLocal.java or this need an extra trick to work ? or everithing is wrong from the same start
  13. ya alredy founded a gramatical error and fixit The part to send messages to server is working but send mesages to local world demand i use a stance of EntityPlayerMP, and it happens that is diferent than EntityPlayerMC and cannot cast it from player using trics like EntityPlayerMP player =(EntityPlayerMP) playerIn; anyway i think that is a server thing an no work unless i have a server runing thiis my working Mesage code i put the clases in a folder named mensajes to avoid disorder in the main folder main class Mercenary.java preiniti public static SimpleNetworkWrapper network; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); MercenaryModBlocks.init(); MercenaryModItems.init(); MercenaryModRecipes.init(); //KeyInputHandler FMLCommonHandler.instance().bus().register(new mercenarymod.utilidades.KeyInputHandler()); mercenarymod.utilidades.KeyBindings.init(); //enviar paquetes network=NetworkRegistry.INSTANCE.newSimpleChannel("canalM00"); network.registerMessage(mensajeMercenarioalServidor.Handler0.class, mensajeMercenarioalServidor.class, 0, Side.SERVER); network.registerMessage(mensajeMercenarioalMundoLocal.Handler1.class, mensajeMercenarioalMundoLocal.class, 1, Side.CLIENT); mensajeMercenarioalServidor.java package mercenarymod.mensajes; import io.netty.buffer.ByteBuf; import mercenarymod.Mercenary; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class mensajeMercenarioalServidor implements IMessage { private static String texto0; public mensajeMercenarioalServidor(){;} public mensajeMercenarioalServidor(String text) { //this.setText(text); texto0=text; //System.out.println("Aqui en el mensaje al servidor"); } @Override public void fromBytes(ByteBuf buf) { setText(ByteBufUtils.readUTF8String(buf)); // this class is very useful in general for writing more complex objects } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, getText()); } public String getText() { return texto0; } public void setText(String text) { this.texto0 = text; } //Mercenary.network.sendToServer(new mensajeMercenarioalServidor("es remoto este mundo")); public static class Handler0 implements IMessageHandler<mensajeMercenarioalServidor, IMessage> { @Override public IMessage onMessage(mensajeMercenarioalServidor message, MessageContext ctx) { //System.out.println(String.format("Received %s from %s", message, ctx.getServerHandler().playerEntity.getDisplayName())); System.out.println("Mensaje en el Servidor="+texto0); pruebaDeMundos.prueba(); return null; // no response in this case } } } mensajeMercenarioalMundoLocal.java package mercenarymod.mensajes; import io.netty.buffer.ByteBuf; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class mensajeMercenarioalMundoLocal implements IMessage { private static String texto1; public mensajeMercenarioalMundoLocal(){;} public mensajeMercenarioalMundoLocal(String text) { //this.setText(text); texto1=text; //System.out.println("Aqui en el mensaje al mundo Local"); } @Override public void fromBytes(ByteBuf buf) { setText(ByteBufUtils.readUTF8String(buf)); // this class is very useful in general for writing more complex objects } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, getText()); } public String getText() { return texto1; } public void setText(String text) { this.texto1 = text; } //Mercenary.network.sendTo(new mensajeMercenarioalMundoLocal("Es este el mundo local"),playerMP); public static class Handler1 implements IMessageHandler<mensajeMercenarioalMundoLocal, IMessage> { @Override public IMessage onMessage(mensajeMercenarioalMundoLocal message, MessageContext ctx) { //System.out.println(String.format("Received %s from %s", message, ctx.getServerHandler().playerEntity.getDisplayName())); System.out.println("MensajeLocal="+texto1); pruebaDeMundos.prueba(); return null; // no response in this case } } } pruebaDeMundos.java package mercenarymod.mensajes; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraft.world.WorldProvider; public class pruebaDeMundos{ public pruebaDeMundos() {;} public static void prueba(){ Minecraft mc = Minecraft.getMinecraft(); EntityPlayer playerIn= mc.thePlayer; World worldIn=mc.theWorld; World worldOn= playerIn.getEntityWorld(); WorldProvider worldUn=worldOn.provider; System.out.println("$$$$= es worldIn remoto ="+worldIn.isRemote); //System.out.println("\n\n\nes worldIn remoto ="+worldOn.isRemote); } } i been testing this using this code public ItemStack onItemRightClick(ItemStack cargador, World worldIn, EntityPlayer playerIn) { System.out.println("%%%%= es worldIn remoto ="+worldIn.isRemote); Mercenary.network.sendToServer(new mensajeMercenarioalServidor("es remoto este mundo")); //Mercenary.network.sendTo(new mensajeMercenarioalMundoLocal("Es este el mundo local"),???PlayerMp); return cargador; } [12:18:28] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.pruebas.itemPrueba00:onItemRightClick:70]: %%%%= es worldIn remoto =true [12:18:28] [Netty Server IO #1/INFO] [sTDOUT]: [mercenarymod.mensajes.mensajeMercenarioalServidor$Handler0:onMessage:65]: Mensaje en el Servidor=es remoto este mundo [12:18:28] [Netty Server IO #1/INFO] [sTDOUT]: [mercenarymod.mensajes.pruebaDeMundos:prueba:27]: $$$$= es worldIn remoto =true [12:18:28] [server thread/INFO] [sTDOUT]: [mercenarymod.items.pruebas.itemPrueba00:onItemRightClick:70]: %%%%= es worldIn remoto =false [12:18:28] [Netty Server IO #1/INFO] [sTDOUT]: [mercenarymod.mensajes.mensajeMercenarioalServidor$Handler0:onMessage:65]: Mensaje en el Servidor=es remoto este mundo [12:18:28] [Netty Server IO #1/INFO] [sTDOUT]: [mercenarymod.mensajes.pruebaDeMundos:prueba:27]: $$$$= es worldIn remoto =true
  14. i check and no abstracks remain. eclipse says no errors but reading again the guides they say in the old ways you must define the chanel in the sending code , i dont see thath here the game crash wen try to send this from a testItem public ItemStack onItemRightClick(ItemStack cargador, World worldIn, EntityPlayer playerIn) { if (!worldIn.isRemote){ Mercenary.network.sendToServer(new mensajeMercenario("foobar")); } return cargador; } ñaa i can realize whats wrong someone can show me a code whith a working package system whith the preinit part the clasess and example of sending and reciving
  15. eclipse make a handler.class method abstrack and i dint notice it ñaa just fix that and get a new one wen try to send the message it break the world [17:56:56] [Netty Server IO #1/ERROR] [FML]: FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.InstantiationException: mercenarymod.mensajeMercenario at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:79) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:136) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:414) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:377) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:215) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:47) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:312) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:44) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:298) [LocalChannel$6.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.7.0_71] Caused by: java.lang.InstantiationException: mercenarymod.mensajeMercenario at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:79) ~[FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:21) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.15.Final] ... 25 more [17:56:56] [Netty Server IO #1/ERROR] [FML]: SimpleChannelHandlerWrapper exception io.netty.handler.codec.DecoderException: java.lang.InstantiationException: mercenarymod.mensajeMercenario at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:79) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:136) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:414) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:377) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:215) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:47) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:312) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:44) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:298) [LocalChannel$6.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.7.0_71] Caused by: java.lang.InstantiationException: mercenarymod.mensajeMercenario at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:79) ~[FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:21) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.15.Final] ... 25 more [17:56:56] [Netty Server IO #1/ERROR] [FML]: There was a critical exception handling a packet on channel canalM00 io.netty.handler.codec.DecoderException: java.lang.InstantiationException: mercenarymod.mensajeMercenario at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) ~[DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) ~[DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:79) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:136) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:414) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleServerSideCustomPacket(NetworkDispatcher.java:377) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:215) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:47) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:312) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:44) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:298) [LocalChannel$6.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354) [singleThreadEventExecutor.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.7.0_71] Caused by: java.lang.InstantiationException: mercenarymod.mensajeMercenario at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:79) ~[FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:21) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.15.Final] ... 25 more [17:56:56] [server thread/INFO]: Player267 lost connection: TextComponent{text='A fatal error has occured, this
  16. alredy have reading no errors market in eclipse but crash the game on start up, i have to fix this code changin the code to adapit to mi needs in mi main class preinit i have Mercenary.class //declaro el network public static SimpleNetworkWrapper network; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); MercenaryModBlocks.init(); MercenaryModItems.init(); MercenaryModRecipes.init(); //KeyInputHandler FMLCommonHandler.instance().bus().register(new mercenarymod.utilidades.KeyInputHandler()); mercenarymod.utilidades.KeyBindings.init(); //send packages network=NetworkRegistry.INSTANCE.newSimpleChannel("canalM00"); network.registerMessage(Handler.class, mensajeMercenario.class, 0, Side.SERVER); // Sending packets: //Mercenary.network.sendToServer(new MyMessage("foobar")); //Mercenary.network.sendTo(new SomeMessage(), somePlayer); } Handler.java package mercenarymod; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public abstract class Handler implements IMessageHandler<mensajeMercenario, IMessage> { @Override public IMessage onMessage(mensajeMercenario message, MessageContext ctx) { System.out.println(String.format("Received %s from %s", message, ctx.getServerHandler().playerEntity.getDisplayName())); return null; // no response in this case } } mensajeMercenario.java package mercenarymod; import io.netty.buffer.ByteBuf; import net.minecraftforge.fml.common.network.ByteBufUtils; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; public class mensajeMercenario implements IMessage { private String text; public mensajeMercenario() { } public mensajeMercenario(String text) { this.setText(text); } @Override public void fromBytes(ByteBuf buf) { setText(ByteBufUtils.readUTF8String(buf)); // this class is very useful in general for writing more complex objects } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, getText()); } public String getText() { return text; } public void setText(String text) { this.text = text; } } /* // Sending packets: Mercenary.network.sendToServer(new MyMessage("foobar")); Mercenary.network.sendTo(new SomeMessage(), somePlayer); */ it breaks at start up whith error 17:35:14] [Client thread/ERROR] [FML]: Caught exception from modmercenario java.lang.RuntimeException: java.lang.InstantiationException at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-17.0.jar:?] [17:35:00] [main/INFO] [GradleStart]: Extra: [] [17:35:01] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --accessToken, {REDACTED}, --assetIndex, 1.8, --assetsDir, /home/tenchi/.gradle/caches/minecraft/assets, --version, 1.8, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker] [17:35:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [17:35:01] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [17:35:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [17:35:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [17:35:01] [main/INFO] [FML]: Forge Mod Loader version 8.0.12.1261 for Minecraft 1.8 loading [17:35:01] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_71, running on Linux:amd64:3.2.0-4-amd64, installed at /opt/oracle/jre1.7.0_71 [17:35:01] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [17:35:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker [17:35:01] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [17:35:01] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [17:35:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:35:01] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [17:35:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:35:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [17:35:01] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [17:35:01] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [17:35:02] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [17:35:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [17:35:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [17:35:03] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [17:35:03] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [17:35:03] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main} [17:35:04] [Client thread/INFO]: Setting user: Player411 [17:35:08] [Client thread/INFO]: LWJGL Version: 2.9.1 [17:35:09] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization [17:35:09] [Client thread/INFO] [FML]: MinecraftForge v11.14.0.1261 Initialized [17:35:09] [Client thread/INFO] [FML]: Replaced 215 ore recipies [17:35:09] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization [17:35:09] [Client thread/INFO] [FML]: Searching /home/tenchi/Modding/forge-1.8-11.14.0.1261-1.8-src/eclipse/mods for mods [17:35:09] [Client thread/INFO] [modmercenario]: Mod modmercenario is missing the required element 'name'. Substituting modmercenario [17:35:13] [Client thread/INFO] [FML]: Forge Mod Loader has identified 5 mods to load [17:35:13] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod, modmercenario] at CLIENT [17:35:13] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, examplemod, modmercenario] at SERVER [17:35:14] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Example Mod, FMLFileResourcePack:modmercenario [17:35:14] [Client thread/INFO] [FML]: Processing ObjectHolder annotations [17:35:14] [Client thread/INFO] [FML]: Found 384 ObjectHolder annotations [17:35:14] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [17:35:14] [Client thread/INFO] [FML]: Applying holder lookups [17:35:14] [Client thread/INFO] [FML]: Holder lookups applied [17:35:14] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue [17:35:14] [Client thread/ERROR] [FML]: mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{8.0.12.1261} [Forge Mod Loader] (forgeSrc-1.8-11.14.0.1261-1.8.jar) Unloaded->Constructed->Pre-initialized Forge{11.14.0.1261} [Minecraft Forge] (forgeSrc-1.8-11.14.0.1261-1.8.jar) Unloaded->Constructed->Pre-initialized examplemod{1.0} [Example Mod] (bin) Unloaded->Constructed->Pre-initialized modmercenario{1.1} [modmercenario] (bin) Unloaded->Constructed->Errored [17:35:14] [Client thread/ERROR] [FML]: The following problems were captured during this phase [17:35:14] [Client thread/ERROR] [FML]: Caught exception from modmercenario java.lang.RuntimeException: java.lang.InstantiationException at com.google.common.base.Throwables.propagate(Throwables.java:160) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:116) ~[forgeSrc-1.8-11.14.0.1261-1.8.jar:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) ~[forgeSrc-1.8-11.14.0.1261-1.8.jar:?] at mercenarymod.Mercenary.preInit(Mercenary.java:60) ~[bin/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71] at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515) ~[forgeSrc-1.8-11.14.0.1261-1.8.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) ~[forgeSrc-1.8-11.14.0.1261-1.8.jar:?] at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) ~[forgeSrc-1.8-11.14.0.1261-1.8.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71] at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?] at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?] at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?] at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) [LoadController.class:?] at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:513) [Loader.class:?] at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:235) [FMLClientHandler.class:?] at net.minecraft.client.Minecraft.startGame(Minecraft.java:413) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:325) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:117) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_71] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_71] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78) [start/:?] at GradleStart.main(GradleStart.java:45) [start/:?] Caused by: java.lang.InstantiationException at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.7.0_71] at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.7.0_71] at java.lang.Class.newInstance(Unknown Source) ~[?:1.7.0_71] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:113) ~[forgeSrc-1.8-11.14.0.1261-1.8.jar:?] ... 41 more [17:35:14] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: ---- Minecraft Crash Report ---- // I'm sorry, Dave. Time: 6/01/15 05:35 PM Description: Initializing game java.lang.RuntimeException: java.lang.InstantiationException at com.google.common.base.Throwables.propagate(Throwables.java:160) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:116) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) at mercenarymod.Mercenary.preInit(Mercenary.java:60) 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:515) 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.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:513) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:235) at net.minecraft.client.Minecraft.startGame(Minecraft.java:413) at net.minecraft.client.Minecraft.run(Minecraft.java:325) at net.minecraft.client.main.Main.main(Main.java:117) 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 net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78) at GradleStart.main(GradleStart.java:45) Caused by: java.lang.InstantiationException at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:113) ... 41 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at com.google.common.base.Throwables.propagate(Throwables.java:160) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.instantiate(SimpleNetworkWrapper.java:116) at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.registerMessage(SimpleNetworkWrapper.java:106) at mercenarymod.Mercenary.preInit(Mercenary.java:60) 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:515) 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.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:513) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:235) at net.minecraft.client.Minecraft.startGame(Minecraft.java:413) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:325) at net.minecraft.client.main.Main.main(Main.java:117) 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 net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78) at GradleStart.main(GradleStart.java:45) -- System Details -- Details: Minecraft Version: 1.8 Operating System: Linux (amd64) version 3.2.0-4-amd64 Java Version: 1.7.0_71, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 878426176 bytes (837 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.12.1261 Minecraft Forge 11.14.0.1261 5 mods loaded, 5 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{8.0.12.1261} [Forge Mod Loader] (forgeSrc-1.8-11.14.0.1261-1.8.jar) Unloaded->Constructed->Pre-initialized Forge{11.14.0.1261} [Minecraft Forge] (forgeSrc-1.8-11.14.0.1261-1.8.jar) Unloaded->Constructed->Pre-initialized examplemod{1.0} [Example Mod] (bin) Unloaded->Constructed->Pre-initialized modmercenario{1.1} [modmercenario] (bin) Unloaded->Constructed->Errored Launched Version: 1.8 LWJGL: 2.9.1 OpenGL: GeForce GT 520/PCIe/SSE2 GL version 4.2.0 NVIDIA 304.117, 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: No Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: Español (México) Profiler Position: N/A (disabled) [17:35:14] [Client thread/INFO] [sTDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:568]: #@!@# Game crashed! Crash report saved to: #@!@# /home/tenchi/Modding/forge-1.8-11.14.0.1261-1.8-src/eclipse/./crash-reports/crash-2015-01-06_17.35.14-client.txt jumm nop idont get whats is wrong
  17. well first i have like 3 months in this is moding i been struglking in the monecraft code and i think im getting mad, but what i need to solve now is the thing of sending packages and later catchit again tha anyway i gonna if not for this maiby for later but. i reead this http://www.minecraftforge.net/wiki/Packet_Handling but its old and the imports needit just are not in the same place and probably now are named diferent cuz eclipse dont find suitable candidates What are the replace import for this ? import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet250CustomPayload; import cpw.mods.fml.common.network.IPacketHandler; import cpw.mods.fml.common.network.Player; solvig this i could advance whit this guide but What i wanna Do? I have this weapon a colt1911 that took me days adding spinning things and stuff i have a KeyBindings and set a custom keybind to key.MULTIPLY i wanna do wen i hit the key.MULTIPLY and the item in hand is the colt1911 it trigers the animation of steve taken out the bullets clip from the gun leting the gun whithout clip in the hand of steve someone tell me time ago i need packages to du such thing but now i before read the packages tutorial idont get how to use this for thath bether explain it bether i dont speak english to well so here o go the colt1911 is a class alredy exist has 3d model, funtional bullets that does damage, I alredy add animations for shoting and change the bulletclip wen empty and all thats works and alredy hass an item colt1911_bulletclip, 3d model and stuf wen i hit key.MULTIPLY it must triger the take out clip animation in the gun in hand and must, this is the part troublesome, add an ItemStack whith one colt1911_bulletclip to inventory in order to add an item whithout trouble in inventory it must be done first in remote and the in the local world but KeyBindings just execute code in the remote world and i need to execute the too in the local playerIn1.inventory.setInventorySlotContents(firstEmptySlot , modMercenarioItems.colt1911_bulletclip,1,0); is this achivable via this methods ??
  18. good days this gona be a llittle long well i get done a block whit 2 textures overlayed for each side but thats a childs game wath im triying to do is a block that counts from 0 to 99 folowing the block states / json logic it means i must create a blockstate definig 100 states representing the counting from 0 - 99 and if i wanna rotate it becomes 600 states but there is only rom for 16 states so this plan is dead before start well i spend the last nigth playing whit jsons reading things in internet there is like 3 apis thath allow you to load a json file edit it and saved the changes to json again .jum load a esternal api and add it to a minecraft mod ñaaaa i prefer to do use stream reader and java nio and do something just to the size of mi needs ñaa beter explain mi idea before it gets more messy, in the code for the texture overlayed well is just two perfects cubes one a little bit more big than the other,the two are defined in a parental cube_layer0_parental.json andd is called from mi blockeprueba.json where i define every texture to load lets say i do the 3 perfects cubes each one a little bit bigger than the last, the first the inner holds the yellow background texture the second is for display the units in the count and the thirth is for the tens in the count soo is something like BlockState blockeprueba.json > blockmodel blockeprueba.json > parental cube_layer0_parental.json in blockeprueba.json just define for textures just the backgrond an numbers from 0 -9 and so i wanna do something like create mi own class to load text files a edit it using imput string and java nio or something like to do //JsonObject b = new JsonObject("modmercenario:block/cube_layer0_parental"); miclasse b = new miclasse("modmercenario:block/cube_layer0_parental"); then change the value from the second north face from "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#north" }, to "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#number0" }, saved the file and force somehow minecraft to reload cube_layer0_parental to display in game the change this part is wath i dont like the accion of reading and writing text files looks like it gonna demand a good piece of resources soo i sit and think again, minecraft uses jsons so it must have its own methods to read and likely to edit and change, minecraft just load jsons at the beginig soo it you minecraft runing and change something in the jsons files it dont get the changes until you close and fireup again soo it must load the jsons values somewhere in the memory and maiby there is alredy some class allowing to change this values in memory on the fly whithout having to restart minecraft for wath i tested minecraft it using import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSyntaxException; i gets this from the errors it shows wen dont find a json file or json has errors well this wen get stuck the class JsonObject.class define methods to read and writte values in a json but dont get how to set whath json gonna read or write values there is this class reosuce locations wo aparently is the on in charge of load the jsons in the models folder but dont get it alwais return the name of the json dont matters if exist or not example "modmercenario:gato" dont exist but anyway it returns "gato in the exit " ResourceLocation jsona = new ResourceLocation("modmercenario:cube_top"); System.out.println("####a="+jsona.getResourcePath()); ResourceLocation jsonb = new ResourceLocation("modmercenario:blockePrueba"); System.out.println("####b="+jsonb.getResourcePath()); ResourceLocation jsonc = new ResourceLocation("modmercenario:test/gato"); System.out.println("####c="+jsonc.getResourcePath()); ResourceLocation jsond = new ResourceLocation("modmercenario:gato"); System.out.println("####d="+jsond.getResourcePath()); go back to the teory well wath i need is a method to return a list of the jsons models minecraft has loaded on the start a method to return the values of an specific json to string to knows whats inside realize how to use JsonObject to edit this jsons on fly and make minecraft load this change on the fly in the world this is code from the overlayed block main class blockePrueba.class package mercenarymod.blocks.pruebas; import java.util.Random; 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.state.IBlockState; import net.minecraft.client.resources.FallbackResourceManager; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumWorldBlockLayer; 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 net.minecraft.util.JsonUtils; import com.google.gson.JsonObject; import net.minecraft.util.ResourceLocation; public class blockePrueba extends Block { public static String name = "blockeprueba"; //###########################################################3 public blockePrueba() { super(Material.rock); setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerBlock(this, name); setCreativeTab(Mercenary.herramientas); //this.maxStackSize = 1; } //###########################################################3 public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(MercenaryModBlocks.blockePrueba); } //###########################################################3 public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { //"modmercenario:blockePrueba" ResourceLocation jsona = new ResourceLocation("modmercenario:cube_top"); System.out.println("####a="+jsona.getResourcePath()); ResourceLocation jsonb = new ResourceLocation("modmercenario:blockePrueba"); System.out.println("####b="+jsonb.getResourcePath()); ResourceLocation jsonc = new ResourceLocation("modmercenario:test/gato"); System.out.println("####c="+jsonc.getResourcePath()); ResourceLocation jsond = new ResourceLocation("modmercenario:gato"); System.out.println("####d="+jsond.getResourcePath()); JsonObject b = new JsonObject(); return false;} //###########################################################3 public boolean isOpaqueCube() { return false; } public boolean translucent() { return true; } public int lightValue() { return 1; } public boolean fullBlock() { return false; } @SideOnly(Side.CLIENT) public EnumWorldBlockLayer getBlockLayer() { //return EnumWorldBlockLayer.CUTOUT; return EnumWorldBlockLayer.TRANSLUCENT; } } BlockState blockeprueba.json { "variants": { "normal": { "model": "modmercenario:blockePrueba" } } } model block json blockePrueba.json { "parent": "modmercenario:block/cube_layer0_parental", "textures": { "all": "modmercenario:blocks/charcoal", "down": "modmercenario:blocks/metablockes/metablockemercenario18", "up": "modmercenario:blocks/metablockes/metablockemercenario19", "north": "modmercenario:blocks/metablockes/metablockemercenario20", "south": "modmercenario:blocks/metablockes/metablockemercenario21", "west": "modmercenario:blocks/metablockes/metablockemercenario22", "east": "modmercenario:blocks/metablockes/metablockemercenario23", "down0": "modmercenario:items/hachas/hacha_acero_diamante", "up0": "modmercenario:items/hachas/hacha_acero_esmeralda", "north0":"modmercenario:items/hachas/hacha_acero_redstone", "south0":"modmercenario:items/palas/pala_madera_nokia", "west0": "modmercenario:items/palas/pala_madera_obsidiana", "east0": "modmercenario:items/palas/pala_madera_oro" } } paretal whit the two cubes cube_layer0_parental.json { "elements": [ { "from": [0.1, 0.1, 0.1 ], "to": [15.9, 15.9, 15.9 ], "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#north" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#south" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#west" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#east" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#up" }, "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#down" } } }, { "from": [ 0, 0, 0 ], "to": [ 16, 16, 16 ], "faces": { "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#north0" }, "south": { "uv": [ 0, 0, 16, 16 ], "texture": "#south0" }, "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#west0" }, "east": { "uv": [ 0, 0, 16, 16 ], "texture": "#east0" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#up0" }, "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#down0" } } } ] } well at this point i have this bunch of theories it i could get this in order it will grant the posibility to make more complex animated blocks and items, using code to get over the 16 metastates limit and for why not do animations muve using sen cos in the code
  19. i think tath should crash the minecraft but works
  20. good days i have an anoying issue normaly i remove an item from the inventory using Item ap=Items.applet; playerIn.inventory.consumeInventoryItem(app); but that just remove an unity from the stack so to remove a complete stack i create a null item named itemvacio replace the complete stack whit a stak of one single itemvacio and then consume the itemvacio whith playerIn.inventory.consumeInventoryItem(MercenaryModItems.itemvacio); but there comes the pain has happen whith mi itemvacio and whith mi others custome bullets at the remove whith consumeInventoryItem event it lets behind and stack of zero items and gets stuck in inventory, i cant throw it whit q, i cant muve it whith the mouse the only way is put over another itemvacio to make the stack go up to one then it behaves again normaly this way to delete stacks has this bug there is another way of removing a full stack ? or at lest a way to make minecraft get ride of this staks of zero items
  21. is so easy that i get embarrased public boolean onEntitySwing(EntityLivingBase entityLiving, ItemStack stack) { World worldIn=entityLiving.getEntityWorld(); EntityPlayer playerIn=(EntityPlayer) entityLiving; System.out.println("SWING"+"entityLiving="+entityLiving.getName()+"\n Mundo="+worldIn.isRemote+"\n playerIn="+playerIn.getName()); return false; } [19:30:40] [Client thread/INFO] [sTDOUT]: SWINGentityLiving=Player380 Mundo=true playerIn=Player380 [19:30:40] [server thread/INFO] [sTDOUT]: SWINGentityLiving=Player380 Mundo=false playerIn=Player380 [19:30:43] [Client thread/INFO] [sTDOUT]: SWINGentityLiving=Player380 Mundo=true playerIn=Player380 [19:30:43] [server thread/INFO] [sTDOUT]: SWINGentityLiving=Player380 Mundo=false playerIn=Player380
  22. good days i wanna use left click to make somethink whith a custome item a sort of onItemRightClick() but onItemLeftClick() version time ago someone tell that a must create a custom event thath time i tink wass done whit a KeyInputHandler class and let it for later and now i realize thath nop dont works this way package mercenarymod.utilidades; import org.lwjgl.input.Mouse; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import mercenarymod.utilidades.gearbox; public class KeyInputHandler { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if(KeyBindings.gearup.isPressed()){ System.out.println("gearUp"); gearbox.up();} if(KeyBindings.geardown.isPressed()){ System.out.println("geardown"); gearbox.down();} if(KeyBindings.extraer.isPressed()){ System.out.println("extraer"); //todavia nu se que hacer con el pero nesesita world and entityplayer ; } if (Mouse.isButtonDown(0)){System.out.println("Botton Zero");} if (Mouse.isButtonDown(1)){System.out.println("Botton Uno");} if (Mouse.isButtonDown(2)){System.out.println("Botton Dos");} } } well i get stuck an have no idea of wtha i m doing how do you make a custom event trigger by left click ??
  23. ñaa you have to deal whith it i been leaving a dummy json whith the name of mi items just to not see the error in the output of eclipse in the other hand it makes more clean the code of the items and blocks you have not to deal whith gl11 or tesellators for simple rotations or scalations all that goes now in the json but idunat know how to do a animation whith sen or cos andd a oot of thinks i like would be documented or at least a few examples there scatter in the code
  24. yap i do it and works like i wan just the inhand item change the other remain still
  25. it cost me but i solved and solved other issue using the code for the custom bow from robin4002 i realize how to change the model of the item in hand whithout mess whit the item in inventory this way i can set the in hand texture based in whatever i want soo NBTtag goes there and in the same shoot using this you can set a 2d item icon for inventory and at the same define a 3d model for the item in hand package mercenarymod.items.pruebas; import java.util.ArrayList; import java.util.List; import java.util.Properties; import java.util.Random; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.stats.StatList; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; 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.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.entity.projectile.EntitySnowball; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import mercenarymod.items.MercenaryModItems; import mercenarymod.utilidades.nbtMercenaria; import mercenarymod.utilidades.registrarTextura; import mercenarymod.utilidades.chat; import mercenarymod.utilidades.util; import net.minecraft.block.state.IBlockState; import mercenarymod.utilidades.nbtMercenariaConTiempoInt; //######################################################################################3 public class cartuchodePrueba extends Item{ public static String name = "cartuchodePrueba"; public static int meta; public static int bullets; //######################################################################################3 public cartuchodePrueba(){ setUnlocalizedName(Mercenary.MODID + "_" + name); GameRegistry.registerItem(this, name); setCreativeTab(Mercenary.herramientas); this.setHasSubtypes(false); this.maxStackSize = 1; ;} //######################################################################################3 @Override public ModelResourceLocation getModel(ItemStack cargador, EntityPlayer playerIn, int useRemaining){ ModelResourceLocation modelresourcelocation = new ModelResourceLocation("modmercenario:cargadorColt1911_zero", "inventory"); //bullets=nbtMercenariaConTiempoInt.habilitar(cargador, "municionRestante"); bullets=nbtMercenaria.getInttag(cargador, "municionRestante"); if(bullets==0){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_zero" , "inventory");} if(bullets==1){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_uno" , "inventory");} if(bullets==2){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_dos" , "inventory");} if(bullets==3){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_tres", "inventory");} if(bullets==4){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_cuatro" , "inventory");} if(bullets==5){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_cinco" , "inventory");} if(bullets==6){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_seis" , "inventory");} if(bullets==7){modelresourcelocation = new ModelResourceLocation( "modmercenario:cargadorColt1911_siete" , "inventory");} return modelresourcelocation; } //#################################################################################### public ItemStack onItemRightClick(ItemStack cargador, World worldIn, EntityPlayer playerIn) { Random r=new Random(100); bullets = 0 + (int)(Math.random()*7); nbtMercenaria.setInttag(cargador,"municionRestante",bullets); //chat.chatda(playerIn, "bullets="+bullets); return cargador; } //######################################################################################3 public String getUnlocalizedName(ItemStack stack) { int m= stack.getMetadata(); if (bullets == 0){return name+"_vacio";} return name; } //######################################################################################3 /* @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, 7)); } */ //######################################################################################3 @SideOnly(Side.CLIENT) public void addInformation(ItemStack cargador, EntityPlayer player, List list, boolean aBoolean) { int municion=nbtMercenaria.getInttag(cargador, "municionRestante"); String lore="balas="+municion; if(lore != "") { list.add(lore); } } //######################################################################################3 }//fin de la classe
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.