Jump to content

Mark136

Members
  • Posts

    77
  • Joined

  • Last visited

Everything posted by Mark136

  1. yeah! i did it, but now have some other things what i don't understand, i want blacken/fading out a slot, as some conditions are true, this is possible with OpenGL, right? and i want to know how to hide an item in the slot without removing the item from the slot. i mean, it needs to be hidden behind a texture. how do i do that? drawGuiContainerForegroundLayer only hides that white glow when i hovering with my mouse on the slot.
  2. Hello all, i'm currently busy with creating a custom Crafting table, and i want to show the craftable items in the gui. i have a gui that shows 4 colums and 5 rows slots and i want to extend it with scrolling(more colums), like in the creative tab. but i have no idea how to begin. do i need to add a buttom (like guiSlider) or something like that? or is it just trying to understand whats in the GuiContainerCreative class? EDIT: done with the scrollbar, i now need to know how to draw a texture in the foreground if an Item in a slot
  3. hey there, one short question, i see that some things in AttachCapabilitiesEvent are depricated, and I'm using the AttachCapabilitiesEvent.Entity for my Capability. where it is in favor of? when will it be removed. i cannot find anything that says something about "better use... instead of this." i'm using version 1.10.2-12.18.2.2099 what should be the latest recommened version
  4. Fixed it, i now storing the UUID to the block and i have a event wich checks if the UUIDs are the same like: if(event.getPlayer().getUniqueID().equals(TE.getPlayerUUID)){ [do something] } now i gonna do some update with saplings that gives xp when fully grown(pretty easy for me now) and then i create an own set of crafting tables with custum gui.(this will be a bit harder part i think)
  5. i found something that works: public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) { TileEntity tileentity = worldIn.getTileEntity(pos); if (tileentity instanceof TETrap) { TETrap TE = (TETrap) tileentity; if(entityIn instanceof EntityRabbit){ ChangeBlock(pos, worldIn, entityIn, MarkBlocks.MarkTrap01, true, TE.getPlayer(), TE.getTrapLevel()); } }} private void ChangeBlock(BlockPos pos, World world, Entity entity, Block newBlock, Boolean isCaught, EntityPlayer player, int Level){ world.setBlockState(pos, newBlock.getDefaultState()); if(isCaught){ entity.attackEntityFrom(MarkDamageSrc.CapturedByTrap, 50000.0F); } if(world.getBlockState(pos) == newBlock.getDefaultState()){ if(world.getTileEntity(pos) != null){ if(player != null && Level != 0){ TileEntity tileentity = world.getTileEntity(pos); if (tileentity instanceof TETrap) { TETrap TE = (TETrap) tileentity; TE.setPlayer(player); TE.setTrapLevel(Level); } } else{ System.err.println((player == null) + " / " + (Level == 0)); } } else{ System.err.println("TE = null!"); } } else{ System.err.println("Block = " + world.getBlockState(pos).getBlock().toString()); } } sorry about the mess. now an other problem with my tile entity what i can't figure out. while reading the player from NBT, i need a worldObj to call world#getPlayerEntityByUUID. but the worldObj in Tile entity seems to be null when readFromNBT is called while loading the game. here is code of my WritetoNBT and readfromNBT: @Override public NBTTagCompound writeToNBT(NBTTagCompound Compound) { super.writeToNBT(Compound); String uuid = "null"; Compound.setInteger("Hunter13695", this.HuntLvl); if(this.player != null){ uuid = this.player.getUniqueID().toString(); } Compound.setString("Player13695", uuid); String g = this.player == null ? "No Player" : this.player.getName(); System.out.println("Tile Entity Saved, with hunter lvl: " + this.HuntLvl + ". Player: " + g); return Compound; } @Override public void readFromNBT(NBTTagCompound Compound) { if(this.worldObj != null){ super.readFromNBT(Compound); int ReadLvl = 1; String a = "null"; EntityPlayer ReadPlayer = null; if(Compound.hasKey("Hunter13695", 3)){ ReadLvl = Compound.getInteger("Hunter13695"); } if(Compound.hasKey("Player13695", ){ a = Compound.getString("Player13695"); if(!a.equals("null")){ ReadPlayer = this.worldObj.getPlayerEntityByUUID(UUID.fromString(a)); } } this.HuntLvl = ReadLvl; System.out.println("Has key lvl/Player : " + Compound.hasKey("Hunter13695", 3) + " : " + Compound.hasKey("Player13695", + " : " + a); this.player = ReadPlayer; String g = this.player == null ? "No Player" : this.player.getName(); System.out.println("Tile Entity Saved, with hunter lvl: " + this.HuntLvl + ". Player: " + g); } else{ System.err.println("World is null?"); } } and here is the code how i Registered my TE : public class MarkTE { public static void init(){ GameRegistry.registerTileEntity(TETrap.class, "mark13695"); // I know I gonna make more TEs later } } @EventHandler public void PreInit(FMLPreInitializationEvent Event){ .. .. MarkTE.init(); .. .. }
  6. hello all, I have a TE Block that have stored the player who has placed the block, and after something happened, i want to change that TE block to an other TE block and migrate the TE Data(the player) to that other block is this possible? and if it is possible, how can i do that?
  7. okay, found an alternative solution to generate my grass and trees in the nether simply just add some code to my worldGenerator Class checking what biome it is with: @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.getDimension()) { case 0: //the surface dimension ... break; case -1: // the nether dimension ... if(world.getBiomeForCoordsBody(new BlockPos(chunkX * 16, 0, chunkZ * 16)) == the biome i want) { //then here the "this.RunGenerator(parameters);" }
  8. Bump... I even cant find the surface biomes... flew 50km again without succes, have seen every minecraft biome. and 80% of the biomes i Saw was Taiga btw. What's wrong with my code (previous post for where I register the biomes, and my mainclass: @EventHandler public void init(FMLInitializationEvent Event){ ... ClientProxy.registerRenderers(); MarkBiome.init(); } what is wrong with it am I so unlucky or...? and got another problem, with My custom mob not rendering correctly(it's a white box now) it worked in 1.8.9 Clientproxy: public static void registerRenderers(){ RenderingRegistry.registerEntityRenderingHandler(EntitySalaCommon.class, RenderSalaCommon::new); RenderingRegistry.registerEntityRenderingHandler(EntitySalaDesert.class, RenderSalaDesert::new); } and here is the render class: @SideOnly(Side.CLIENT) public class RenderSalaCommon extends RenderLiving { public static final ResourceLocation Texture_SalaCommon = new ResourceLocation(ReferenceStrings.MODID + ":textures/entity/salacommon.png"); public RenderSalaCommon(RenderManager rendermanagerIn) { super(rendermanagerIn, new ModelSalamander(), 0.5f); } protected ResourceLocation getEntityTexture1(EntitySalaCommon entity) { return Texture_SalaCommon; } @Override protected ResourceLocation getEntityTexture(Entity entity) { return this.getEntityTexture1((EntitySalaCommon)entity); } } this code fully worked in 1.8.9 until I updated the mod to 1.10.2
  9. have you try to do something like this? block.getDefaultState().withProperty(property, value) with the property BlockStone.VARIANT , and the value = Integer.valueOf(5)
  10. I already created A BiomeDecorater where I Spawned Trees and tall grass in the overworld and this worked for 1.8.9 but I don't know if this still works in 1.10.2 because i havend found my own Biome yet. I placed coins on the W button to let me flew 50 Km with a print that says ("Biome is here at" + pos.getX() + "x/ " + pos.getZ() + "z") when it is generated and i know this works because i tested it with the netherBiomes if it would work. take a look at my BiomeDecorator here public class MarkDecorator extends BiomeDecorator { public MarkDecorator(Biome biome) { } public void decorate(World world, Random random, Biome base, BlockPos pos) { if (this.decorating) { throw new RuntimeException("Already decorating!!"); } else { this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(world.getWorldInfo().getGeneratorOptions()).build(); this.chunkPos = pos; this.genDecorations(base, world, random); this.decorating = false; } } protected void genDecorations(Biome base, World world, Random random) { System.out.println("Decorating one of the biomes at : " + this.chunkPos.getX() + " / " + this.chunkPos.getZ()); net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.event.terraingen.DecorateBiomeEvent.Pre(world, random, chunkPos)); if(base == MarkBiome.Biome_1_Enriched || base == MarkBiome.Biome_2_NetherDesert || base == MarkBiome.Biome_2_BlueNetherDesert) { if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.GRASS)) for (int i3 = 0; i3 < this.grassPerChunk; ++i3) { int j7 = random.nextInt(16) + 8; int i11 = random.nextInt(16) + 8; int k14 = world.getHeight(this.chunkPos.add(j7, 0, i11)).getY() * 2; if (k14 > 0) { int l17 = random.nextInt(k14); if(base == MarkBiome.Biome_1_Enriched){ ((BiomeGenEnriched)base).getRandomWorldGenForGrass(random).generate(world, random, chunkPos.add(j7, l17, i11)); } else if(base == MarkBiome.Biome_2_NetherDesert){ ((BiomeNetherD)base).getRandomWorldGenForGrass(random).generate(world, random, chunkPos.add(j7, l17, i11)); } else if(base == MarkBiome.Biome_2_BlueNetherDesert){ ((BiomeNetherBD)base).getRandomWorldGenForGrass(random).generate(world, random, chunkPos.add(j7, l17, i11)); } } } int k1 = this.treesPerChunk; if (random.nextInt(10) == 0) { ++k1; } if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.TREE)){ for (int j2 = 0; j2 < k1; ++j2) { int k6 = random.nextInt(16) + 8; int l = random.nextInt(16) + 8; WorldGenAbstractTree worldgenabstracttree = base.genBigTreeChance(random); worldgenabstracttree.setDecorationDefaults(); BlockPos blockpos = world.getHeight(chunkPos.add(k6, 0, l)); if (worldgenabstracttree.generate(world, random, blockpos)) { worldgenabstracttree.generateSaplings(world, random, blockpos); } } }} if(base == MarkBiome.Biome_1_Enriched) { if(net.minecraftforge.event.terraingen.TerrainGen.decorate(world, random, chunkPos, net.minecraftforge.event.terraingen.DecorateBiomeEvent.Decorate.EventType.DEAD_BUSH)){ for (int j3 = 0; j3 < 1; ++j3) { int k7 = random.nextInt(16) + 8; int j11 = random.nextInt(16) + 8; int l14 = world.getHeight(chunkPos.add(k7, 0, j11)).getY() * 2; if (l14 > 0) { int i18 = random.nextInt(l14); (new WorldGenMarkCrystalBush()).generate(world, random, chunkPos.add(k7, i18, j11)); } } } } } } and my BiomeGenBase Class public class MarkBiome extends Biome { public MarkBiome(BiomeProperties properties) { super(properties); this.theBiomeDecorator = new MarkDecorator(this); } public static void init(){ initBiome(); regBiome(); } private static Set<BiomeManager.BiomeEntry> NetherEntries = Sets.newHashSet(); public static Biome Biome_1_Enriched; public static Biome Biome_2_Nether; public static Biome Biome_2_NetherDesert; public static Biome Biome_2_BlueNether; public static Biome Biome_2_BlueNetherDesert; ; public static void initBiome(){ DimensionManager.unregisterDimension(-1); DimensionType nether = DimensionType.register("Nether", "_nether", -1, NetherWorldProvider.class, false); DimensionManager.registerDimension(-1, nether); Biome_1_Enriched = new BiomeGenEnriched((new Biome.BiomeProperties("Enriched")).setBaseBiome("Enriched").setTemperature(1.2F).setRainfall(0.9F).setWaterColor(2653061)); Biome_2_Nether = new BiomeNether((new Biome.BiomeProperties("Nether")).setRainDisabled()); Biome_2_NetherDesert = new BiomeNetherD((new Biome.BiomeProperties("NetherDesert")).setRainDisabled()); Biome_2_BlueNether = new BiomeCryst((new Biome.BiomeProperties("Cryst")).setRainDisabled()); Biome_2_BlueNetherDesert = new BiomeCrystD((new Biome.BiomeProperties("CrystDesert")).setRainDisabled()); } public static void regBiome(){ BiomeDictionary.registerBiomeType(Biome_1_Enriched, Type.MAGICAL); BiomeManager.addBiome(BiomeType.WARM, new BiomeEntry(Biome_1_Enriched, 10)); BiomeManager.addSpawnBiome(Biome_1_Enriched); AddNetherBiome(Biome_2_Nether, 45, 180, "Nether"); AddNetherBiome(Biome_2_NetherDesert, 25, 181, "NetherDesert"); AddNetherBiome(Biome_2_BlueNether, 17, 182, "BlueNether"); AddNetherBiome(Biome_2_BlueNetherDesert, 13, 183, "BlueNetherDesert"); } public static void AddNetherBiome(Biome biome, int Weight, int ID, String Name) { Biome.registerBiome(ID, Name, biome); NetherEntries.add(new BiomeEntry(biome, Weight)); } public static ImmutableList<BiomeManager.BiomeEntry> getBiomeEntries() { return ImmutableList.copyOf(NetherEntries); } } the NetherBiomes were Registered with Biome.registerBiome because I needed a int ID to generate the biomes in the nether.
  11. Solved. thanks. i used a wrong setter for BiomeForGeneration. only thing what i need to do is to generate trees and tall grass in the nether.
  12. ok, got it to work. the only problem i have with this. is that the biomes are way to small. sometimes its like 1 or 2 chunks big per biome. where can i change that so they got the size of a overworld Biome? is this bug because of (if you travel through the nether like 100 meters and you build a portal again to go through the overworld. and al the meters you traveled wil be multiplied by 7.( so you have moved 700 meters away).) and the biome uses this type of calculation too. or is there something wrong with my code? i unregistered and registered the nether so I can add my own worldProvider. something LogicTechCorp also did in his code. and I have copied(and changed a little bit) the vanilla GenLayer/Providers Stuff. everything is working( except a little bit lag in the nether and the XXS biomes
  13. Why are your recipes in post init? have you tried to put them in the normal Init? i mean: @EventHandler public void preInit(FMLPreInitializationEvent event) { not here } @EventHandler public void init(FMLInitializationEvent event) { [u][b]here[/b][/u] } @EventHandler public void postInit(FMLPostInitializationEvent event) { Not Here }
  14. Extended RPG Hello, I'm Mark136 and i'm busy (for months now) with creating a Huge RPG mod. it will have: - 35 skills(think of Melee, Woodcutting, Mining ect) - a Combat system!(some bugs but i'm working on them) - gui's! - toolboxes! - new Biomes + netherbiomes - new dimensions(still not created yet ) I'm currently busy with finishing the basics of the Dexterity Skill(0.15). after that i'm going to do something with Structures --> village update --> adding dimentions and storylines ect. and yes this mod is mostly influenced by Runescape, Terraria and Skyrim, and much other games. pictures will come asap! ---------------------------------- i hope you like this idea Mark136
  15. can you show whats in the proxies( i mean the pre-init, init and post-init methods)?
  16. Hello All, I'm building a huge RPG mod.(and finally updated it to 1.10.2) but i'm currently stuck at the part where i need to create NetherBiomes. Overworld biomes are relatively easy to add. but i have no idea how to begin with the netherbiomes. I want some parts of the nether(biomes) to generate my custom block instead of netherrack. with some flowers and trees. can someone give me some intructions on what classes i need to create to create biomes in the nether?
  17. Thx, that worked! got 2 another questions. is there a way to get IEEP Data from offline players(players that were on the server but not online atm)? how to get a list of all players that have been on the server "MinecraftServer.getServer().getConfigurationManager().playerEntityList" works only for online player. or do i need to create one?
  18. full error log [14:39:22] [Netty Local Client IO #0/ERROR] [FML]: FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.NullPointerException at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:158) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:54) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:389) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:255) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:53) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_101] Caused by: java.lang.NullPointerException at com.modMark.Packets.HiscorePacketC.fromBytes(HiscorePacketC.java:49) ~[HiscorePacketC.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:17) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:7) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:81) ~[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.23.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final] ... 24 more [14:39:22] [Netty Local Client IO #0/ERROR] [FML]: SimpleChannelHandlerWrapper exception io.netty.handler.codec.DecoderException: java.lang.NullPointerException at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:158) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:54) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:389) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:255) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:53) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_101] Caused by: java.lang.NullPointerException at com.modMark.Packets.HiscorePacketC.fromBytes(HiscorePacketC.java:49) ~[HiscorePacketC.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:17) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:7) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:81) ~[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.23.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final] ... 24 more [14:39:22] [Netty Local Client IO #0/ERROR] [FML]: SimpleChannelHandlerWrapper exception io.netty.handler.codec.DecoderException: java.lang.NullPointerException at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:158) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:54) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:389) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:255) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:53) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_101] Caused by: java.lang.NullPointerException at com.modMark.Packets.HiscorePacketC.fromBytes(HiscorePacketC.java:49) ~[HiscorePacketC.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:17) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:7) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:81) ~[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.23.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final] ... 24 more [14:39:22] [Netty Local Client IO #0/ERROR] [FML]: SimpleChannelHandlerWrapper exception io.netty.handler.codec.DecoderException: java.lang.NullPointerException at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:158) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:54) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:389) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:255) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:53) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_101] Caused by: java.lang.NullPointerException at com.modMark.Packets.HiscorePacketC.fromBytes(HiscorePacketC.java:49) ~[HiscorePacketC.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:17) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:7) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:81) ~[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.23.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final] ... 24 more [14:39:22] [Netty Local Client IO #0/ERROR] [FML]: There was a critical exception handling a packet on channel mark13695 io.netty.handler.codec.DecoderException: java.lang.NullPointerException at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) ~[DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:158) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:54) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:389) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:255) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:53) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) [simpleChannelInboundHandler.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:326) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:45) [LocalChannel.class:4.0.23.Final] at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:312) [LocalChannel$5.class:4.0.23.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_101] Caused by: java.lang.NullPointerException at com.modMark.Packets.HiscorePacketC.fromBytes(HiscorePacketC.java:49) ~[HiscorePacketC.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:17) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(SimpleIndexedCodec.java:7) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:81) ~[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.23.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.23.Final] ... 24 more and here is the Handler: public static class MarkHandler4 implements IMessageHandler<HiscorePacketC, IMessage > { @Override public IMessage onMessage(final HiscorePacketC message, MessageContext ctx) { IThreadListener ThreadListener = Minecraft.getMinecraft(); ThreadListener.addScheduledTask(new Runnable() { @Override public void run() { String[] player = new String[message.ID.length]; for (int i = 0;i < message.ID.length; i++){ player[i] = ((EntityPlayer) Minecraft.getMinecraft().theWorld.getEntityByID(message.PlayerID[i])).getName(); } GuiHiscoreList.Data = message.Data; GuiHiscoreList.PlayerD = player; } }); return null; } } }
  19. Hey guys, I want to Receive and Show Data From other players in the server in the Same Gui. So, if I Click on the button in the Gui. the Client Will sent a Packet with some values that i need to get the right Data from the server. This works Perfectly. and if it's gonna Send A packet Back using a Sync Method. public void sync2{ List <EntityPlayerMP> players = MinecraftServer.getServer().getConfigurationManager().playerEntityList; EntityPlayerMP[] Player = new EntityPlayerMP[players.size()]; Player = players.toArray(Player); Int[] PlayerData = new int[Player.Length]; for (int i = 0;i < Player.Length; i++){ IEEP ieep = IEEP.Get(Player[i]) PlayerData[i] = IEEP.GetData(); } MainRegistry.network.sendTo(new Packet2(PlayerData, Player), (EntityPlayerMP) PacketPlayer); // PacketPlayer is the player That have Sent the packet Player to the Server. and now he is getting it back System.out.println("first player: " + Player[0] + " Data: " + PlayerData[0]); // shows the first player and data in the array. this is correct. } but in the PacketHandler public class HiscorePacketA implements IMessage{ private int[] Data; Private int[] ID; public HiscorePacketA() {} public HiscorePacketA(int data, EntityPlayer Player){ this.Data = data; this.ID = new int[Data.length]; for (int i = 0; i < Data.length; i++){ this.ID = Player[i].getEntityId(); } System.out.println("first player: " + Player[0] + " Data: " + PlayerData[0]); // this gives correct values } @Override public void fromBytes(ByteBuf buf) { // in this method, the fields are null. and ofc also in the Handere for (int i = 0; i < this.ID.length; i++){ this.Data[i] = buf.readInt(); this.ID[i] = buf.readInt(); } System.out.println("first player: " + Player[0] + " Data: " + PlayerData[0]); // this gives a nullpointer because the arrays are null } @Override public void toBytes(ByteBuf buf) { for (int i = 0; i < this.ID.length; i++){ buf.writeInt(this.Data[i]); buf.writeInt(this.ID[i]); } System.out.println("first player: " + Player[0] + " Data: " + PlayerData[0]); the values here are correct } here is the error log: [14:39:22] [Netty Local Client IO #0/ERROR] [FML]: FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.NullPointerException at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) [DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:90) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:158) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(NetworkManager.java:54) [NetworkManager.class:?] ....... What did I wrong here, that the packet does'nt work? oh yeah, this alse freezes the game i removed the "first post" , i think i accidentally hitted Enter while typing
  20. thx, gonna work on it ............................................ It Worked! thx
  21. Hello all I'm writing an RPG mod. but i'm stuck at the part with creating custom fluids. there aren't much tutorials for custom fluids. but i have found and followed that one from Choonster. the problem is that the code ignores my modelResource location and uses the path that i filled in here: block.setRegistryName("fluid." + block.getFluid().getName()) instead of: private void registerFluidModels() { ModFluids.modFluidBlocks.forEach(this::registerFluidModel); } private void registerFluidModel(IFluidBlock fluidBlock) { Item item = Item.getItemFromBlock((Block) fluidBlock); ModelBakery.registerItemVariants(item); ModelResourceLocation MRL = new ModelResourceLocation(modid + ":fluid", fluidBlock.getFluid().getName()); System.out.println("modelResourceLocation is : " + MRL.toString()); ModelLoader.setCustomMeshDefinition(item, MeshDefinitionFix.create(stack -> MRL)); ModelLoader.setCustomStateMapper((Block) fluidBlock, new StateMapperBase() { @Override protected ModelResourceLocation getModelResourceLocation(IBlockState state) { return MRL; } }); } he gives a FileNotFoundExeption with the location : mark13695:blockstates/fluid.bluelava with as variant #level=(Number 1 to 15) metadata from BlockFluidBase. ModelResourceLocation MRL must be right as in the console: modelResourceLocation is : mark13695:fluid#bluelava here is my fluidinit class: package com.modMark.Fluids; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.function.Consumer; import java.util.function.Function; import com.modMark.Main.MainRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.MapColor; import net.minecraft.block.material.Material; import net.minecraft.block.material.MaterialLiquid; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fml.common.registry.GameRegistry; public class MarkFluids { public static Fluid BlueLava; public static final Set<Fluid> fluids = new HashSet<>(); public static Set<IFluidBlock> fluidBlocks = new HashSet<IFluidBlock>(); public static void init() { BlueLava = createFluid("bluelava", "mark13695:blocks/LavaBlue", Material.lava, fluid -> fluid.setViscosity(5500).setDensity(1100).setLuminosity(15), fluid -> new BlockMarkLiquid("LavaBlue", fluid, Material.lava)); } private static <T extends Block & IFluidBlock> Fluid createFluid(String name, String textureName, Material material, Consumer<Fluid> fluidPropertyApplier, Function<Fluid, T> blockFactory) { return createFluid(name, textureName, material, 0x0F44E4 , fluidPropertyApplier, blockFactory); } private static <T extends Block & IFluidBlock> Fluid createFluid(String name, String textureName, Material material, int color, Consumer<Fluid> fluidPropertyApplier, Function<Fluid, T> blockFactory) { if(material == Material.lava){ Fluid fluid = new MarkLava(name, textureName + "_still", textureName + "_flowing"); boolean useOwnFluid = FluidRegistry.registerFluid(fluid); if (useOwnFluid) { fluidPropertyApplier.accept(fluid); registerFluidBlock(blockFactory.apply(fluid)); } else { fluid = FluidRegistry.getFluid(name); } fluids.add(fluid); return fluid; } else{ Fluid fluid = new MarkWater(name, textureName + "_still", textureName + "_flowing", color); boolean useOwnFluid = FluidRegistry.registerFluid(fluid); if (useOwnFluid) { fluidPropertyApplier.accept(fluid); registerFluidBlock(blockFactory.apply(fluid)); } else { fluid = FluidRegistry.getFluid(name); } fluids.add(fluid); return fluid; } } private static <T extends Block & IFluidBlock> T registerFluidBlock(T block) { block.setRegistryName("fluid." + block.getFluid().getName()); GameRegistry.registerBlock(block); fluidBlocks.add(block); return block; } } anyone who knows what i did wrong? sorry for copypasting most of his fluid code, I could'nt make it better that this
  22. yeah solve it, the error did'nt came from my mod but from something from internet connection it works fine now. but you know, i'm writing a big mod so maybe i think i have more questions for other things that i can't get to work thanks for the help
  23. hhm, ok but my tester has gone to bed, so we need to wait till tomorrow
  24. found something out... [22:59:44] [Netty Server IO #4/ERROR] [FML/]: NetworkDispatcher exception java.io.IOException: De externe host heeft een verbinding verbroken at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_25] at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:1.8.0_25] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_25] at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_25] at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) ~[?:1.8.0_25] at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:446) ~[unpooledUnsafeDirectByteBuf.class:4.0.23.Final] at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:881) ~[AbstractByteBuf.class:4.0.23.Final] at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:225) ~[NioSocketChannel.class:4.0.23.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [NioEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25] [22:59:44] [server thread/INFO] [sTDOUT/]: [com.modMark.Skill.MarkData:saveNBTData:99]: Saving Xp Levels for Player2 ,{Skill136:[0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,]} [22:59:56] [server thread/INFO] [sTDOUT/]: [com.modMark.Skill.MarkData:register:72]: register Player [22:59:56] [server thread/INFO] [sTDOUT/]: [com.modMark.Skill.EventHandlerMark:onEntityConstructing:61]: Registering Player! [22:59:56] [Netty Server IO #5/TRACE] [FML/]: Handshake channel activating [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: FMLHandshakeServerState: null->FMLHandshakeServerState$1:START [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: Next: HELLO [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: FMLHandshakeServerState: $ClientHello->FMLHandshakeServerState$2:HELLO [22:59:56] [Netty Server IO #5/INFO] [FML/]: Client protocol version 2 [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: Next: HELLO [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: FMLHandshakeServerState: $ModList:4 mods->FMLHandshakeServerState$2:HELLO [22:59:56] [Netty Server IO #5/INFO] [FML/]: Client attempting to join with 4 mods : FML@8.0.99.99,Forge@11.15.1.1722,mcp@9.19,mark13695@0.0.1 test-6 [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: Next: WAITINGCACK [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: FMLHandshakeServerState: $HandshakeAck:{2}->FMLHandshakeServerState$3:WAITINGCACK [22:59:56] [Netty Server IO #5/DEBUG] [FML/]: Next: COMPLETE [23:00:15] [Netty Server IO #5/ERROR] [FML/]: NetworkDispatcher exception java.io.IOException: De externe host heeft een verbinding verbroken at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_25] at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:1.8.0_25] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_25] at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_25] at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) ~[?:1.8.0_25] at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:446) ~[unpooledUnsafeDirectByteBuf.class:4.0.23.Final] at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:881) ~[AbstractByteBuf.class:4.0.23.Final] at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:225) ~[NioSocketChannel.class:4.0.23.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [NioEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25] I think the issue here is that during the first login the handshake is processed fully as it should be, but later, it is'nt. the first login he payloads the Register but SHOULD'NT on a second login or third. and i still know always if i join a world he well registry. ok, if i check the onEntityConstructing event: @SubscribeEvent public void onEntityConstructing(EntityConstructing event) { //event.entity instanceof EntityPlayer = is the Entity a player //MarkData.get((EntityPlayer) event.entity) == null , this checks if there is already data saved for the player if (event.entity instanceof EntityPlayer && MarkData.get((EntityPlayer) event.entity) == null){ MarkData.register((EntityPlayer) event.entity); System.out.println("Registering Player!"); } } but strangly he will always tell that te if statment is true, because he always registers when log in, but if he register, the system noticed that theres already data available for the player
  25. in the Methode sync in my IEEP class i Changed this: public void sync() { if (this.isServerSide()){ MainRegistry.network.sendTo(new SkillPacket(), (EntityPlayerMP) player); System.out.println("Player: " + player); } } to this public void sync() { if (this.isServerSide()){ MainRegistry.network.sendTo(new SkillPacket([code]this.XP, this.player ), (EntityPlayerMP) player); System.out.println("Player: " + player); } }[/code] and again my Packet class: package com.modMark.Packets; import com.modMark.Main.GuiStatlist; import com.modMark.Skill.MarkData; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IThreadListener; import net.minecraft.world.World; 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 SkillPacket implements IMessage{ private int ID; private int[] XP = new int[35]; public SkillPacket() {} public SkillPacket(int[] s, EntityPlayer player){ this.ID = player.getEntityId(); this.XP = s; System.out.println("Test-1 Packet" + player); } @Override public void fromBytes(ByteBuf buf) { for (int k = 0; k < 35; k++){ this.XP[k] = buf.readInt(); } this.ID = buf.readInt(); System.out.println("Test-2 Packet " + ID + " Excavation XP: " + this.XP[10]); } @Override public void toBytes(ByteBuf buf) { for (int j = 0; j < 35; j++){ buf.writeInt(this.XP[j]); } buf.writeInt(this.ID); System.out.println("Test-3 Packet " + ID + " Excavation XP: " + XP[10]); } //----------------------------------------------------------------------------------------------- public static class MarkHandler implements IMessageHandler<SkillPacket, IMessage > { @Override public IMessage onMessage(final SkillPacket message, MessageContext ctx) { IThreadListener ThreadListener = Minecraft.getMinecraft(); ThreadListener.addScheduledTask(new Runnable() { @Override public void run() { final EntityPlayer player = (EntityPlayer) Minecraft.getMinecraft().theWorld.getEntityByID(message.ID); MarkData p = MarkData.get(player); p.setXP(message.XP); GuiStatlist.XP = p.XP; System.out.println("PlayerData is send to " + player); } }); return null; } } } it seems to work, but got one problem, unfortunatly its when a player gets XP, the player will be kicked out of the server, but i saw i don't get xp anymore from othore players breaking a block this are the only logs i could found from the kick: [22:59:11] [server thread/INFO]: Player2[/iP:Port] logged in with entity id 5742 at (25.5, 70.0, -96.5) [22:59:11] [server thread/INFO]: Player2 joined the game [22:59:12] [Client thread/INFO]: [CHAT] Player2 joined the game [22:59:17] [server thread/INFO]: Player2 has just earned the achievement [Taking Inventory] [22:59:17] [Client thread/INFO]: [CHAT] Player2 has just earned the achievement [Taking Inventory] [22:59:44] [server thread/INFO]: Player2 lost connection: TextComponent{text='Disconnected', siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}} [22:59:44] [server thread/INFO]: Player2 left the game [22:59:44] [Client thread/INFO]: [CHAT] Player2 left the game [22:59:56] [user Authenticator #2/INFO]: UUID of player Player2 is e3b2d6e7-01a6-447d-ba3b-a08bc8adc2eb [23:00:15] [server thread/INFO]: Player2 lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: java.io.IOException: The external host has lost connextion], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}} [23:00:15] [server thread/INFO]: Player2 left the game [23:00:15] [Client thread/INFO]: [CHAT] Player2 left the game [23:00:32] [user Authenticator #3/INFO]: UUID of player Player2 is e3b2d6e7-01a6-447d-ba3b-a08bc8adc2eb [23:00:51] [server thread/INFO]: Player2 lost connection: TranslatableComponent{key='disconnect.genericReason', args=[internal Exception: java.io.IOException: The external host has lost connextion], siblings=[], style=Style{hasParent=false, color=null, bold=null, italic=null, underlined=null, obfuscated=null, clickEvent=null, hoverEvent=null, insertion=null}} oh well checked the wrong log this is the error [22:59:44] [Netty Server IO #4/ERROR] [FML/]: NetworkDispatcher exception java.io.IOException: De externe host heeft een verbinding verbroken at sun.nio.ch.SocketDispatcher.read0(Native Method) ~[?:1.8.0_25] at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:43) ~[?:1.8.0_25] at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223) ~[?:1.8.0_25] at sun.nio.ch.IOUtil.read(IOUtil.java:192) ~[?:1.8.0_25] at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379) ~[?:1.8.0_25] at io.netty.buffer.UnpooledUnsafeDirectByteBuf.setBytes(UnpooledUnsafeDirectByteBuf.java:446) ~[unpooledUnsafeDirectByteBuf.class:4.0.23.Final] at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:881) ~[AbstractByteBuf.class:4.0.23.Final] at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:225) ~[NioSocketChannel.class:4.0.23.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:119) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) [NioEventLoop.class:4.0.23.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) [NioEventLoop.class:4.0.23.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [singleThreadEventExecutor$2.class:4.0.23.Final] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25]
×
×
  • Create New...

Important Information

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