Jump to content

Vizuall

Members
  • Posts

    40
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Vizuall's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hello, I have a pure server side mod and that mod adjust break speed, which works fine except the client visual break status. The thing is that server and client break speed is not synchronized - client has destroyed block, but it does not disappeared, because that block is controlled by server break speed. Is there any way to synchronize break speed between client and server, but preserver pure server side status Thanks.
  2. Yes this works, but I need to hold something in my hand. E.g. if I hold a sword and use onItemUse, the sword will disappear. Set<ItemStack> leafDrop = new HashSet<>(); int counter = 0; while (leafDrop.isEmpty() && counter <= 100) { leafDrop.addAll(world.getBlockState(blockPos).getBlock().getDrops(world, blockPos, world.getBlockState(blockPos), 3)); counter++; } for (ItemStack itemStack : leafDrop) { itemStack.onItemUse(entityPlayer, world, plantPos, EnumHand.MAIN_HAND, EnumFacing.NORTH, 0, 0, 0); } Am I doing something wrong?
  3. Ok I see One last question, how to plant that sapling? Because it is a ItemStack type.
  4. Ok, could you give me some hint? I am getting empty list, because sapling doesnt drop every time. world.getBlockState(blockPos).getBlock().getDrops(world, blockPos, world.getBlockState(blockPos), 0).iterator().next() Besides, I thing that apple or whatever that can drop from leaf block could be in this list, right?
  5. Cool, so I need to get drop from leaf block? Something like this? Item leafAsDrop = world.getBlockState(blockPos).getBlock().getItemDropped(world.getBlockState(blockPos), null, 100);
  6. Hello, I would like to plant sapling, based on leaf or wood type. I am in BreakEvent method and I have information about leaf and wood (log) - variable Block. Is it possible to plant specific sapling based on information given by wood (log) or leaf block? The thing is I need this planting as much flexibile as possible (across mods).. Thanks
  7. Just a single boolean, I need to work with that information.
  8. Well, I just need to send some info on client connection to the server. Is there any preferable event?
  9. that helps.. I have one more problem. This is my message class: public class ClientMessage implements IMessage { private boolean a; public ClientMessage() { } public ClientMessage(boolean a) { this.a = a; } @Override public void fromBytes(ByteBuf buf) { try { a = buf.readBoolean(); } catch (IndexOutOfBoundsException e1) { .. } } @Override public void toBytes(ByteBuf buf) { buf.writeBoolean(a); } public static class Handler implements IMessageHandler<ClientMessage, IMessage> { @Override public IMessage onMessage(ClientMessage message, MessageContext ctx) { THIS return null; } } } with this in my core class public void init(FMLInitializationEvent event) { network.registerMessage(ClientMessage.Handler.class, ClientMessage.class, 0, Side.SERVER); } Now if I call it with this: @SubscribeEvent public void onClientConnect(FMLNetworkEvent.ClientConnectedToServerEvent event) { core.network.sendToServer(new ClientMessage(a)); } Command THIS in onMessage method, never executes.
  10. Yes, I tried that, but I got an exception. [16:33:18] [Server thread/ERROR] [FML]: FMLIndexedMessageCodec exception caught java.lang.RuntimeException: Missing at net.minecraftforge.fml.server.FMLServerHandler.getClientToServerNetworkManager(FMLServerHandler.java:288) ~[FMLServerHandler.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.getClientToServerNetworkManager(FMLCommonHandler.java:545) ~[FMLCommonHandler.class:?] at net.minecraftforge.fml.common.network.FMLOutboundHandler$OutboundTarget$8.selectNetworks(FMLOutboundHandler.java:245) ~[FMLOutboundHandler$OutboundTarget$8.class:?] at net.minecraftforge.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:293) ~[FMLOutboundHandler.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:651) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:112) ~[MessageToMessageEncoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:706) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:741) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:895) ~[DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:240) ~[AbstractChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendToServer(SimpleNetworkWrapper.java:294) [SimpleNetworkWrapper.class:?] at treechopper.common.command.Commands.execute(Commands.java:157) [Commands.class:?] at net.minecraft.command.CommandHandler.tryExecute(CommandHandler.java:109) [CommandHandler.class:?] at net.minecraft.command.CommandHandler.executeCommand(CommandHandler.java:88) [CommandHandler.class:?] at net.minecraft.network.NetHandlerPlayServer.handleSlashCommand(NetHandlerPlayServer.java:955) [NetHandlerPlayServer.class:?] at net.minecraft.network.NetHandlerPlayServer.processChatMessage(NetHandlerPlayServer.java:931) [NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:47) [CPacketChatMessage.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:8) [CPacketChatMessage.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) [PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_121] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:25) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:742) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:408) [DedicatedServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121] [16:33:18] [Server thread/ERROR] [FML]: SimpleChannelHandlerWrapper exception java.lang.RuntimeException: Missing at net.minecraftforge.fml.server.FMLServerHandler.getClientToServerNetworkManager(FMLServerHandler.java:288) ~[FMLServerHandler.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.getClientToServerNetworkManager(FMLCommonHandler.java:545) ~[FMLCommonHandler.class:?] at net.minecraftforge.fml.common.network.FMLOutboundHandler$OutboundTarget$8.selectNetworks(FMLOutboundHandler.java:245) ~[FMLOutboundHandler$OutboundTarget$8.class:?] at net.minecraftforge.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:293) ~[FMLOutboundHandler.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:651) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:112) ~[MessageToMessageEncoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:706) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:741) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:895) ~[DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:240) ~[AbstractChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendToServer(SimpleNetworkWrapper.java:294) [SimpleNetworkWrapper.class:?] at treechopper.common.command.Commands.execute(Commands.java:157) [Commands.class:?] at net.minecraft.command.CommandHandler.tryExecute(CommandHandler.java:109) [CommandHandler.class:?] at net.minecraft.command.CommandHandler.executeCommand(CommandHandler.java:88) [CommandHandler.class:?] at net.minecraft.network.NetHandlerPlayServer.handleSlashCommand(NetHandlerPlayServer.java:955) [NetHandlerPlayServer.class:?] at net.minecraft.network.NetHandlerPlayServer.processChatMessage(NetHandlerPlayServer.java:931) [NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:47) [CPacketChatMessage.class:?] at net.minecraft.network.play.client.CPacketChatMessage.processPacket(CPacketChatMessage.java:8) [CPacketChatMessage.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) [PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_121] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_121] at net.minecraft.util.Util.runTask(Util.java:25) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:742) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:408) [DedicatedServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121]
  11. Hello, I would like to know, how to send a data from client to server. The situation is I have some setting on client and I need to share them with a server. Thanks
  12. private static Set<BlockPos> leaves = new HashSet<BlockPos>(); ..Some insertions.. public int treeDestroy(BlockEvent.BreakEvent event) { for (BlockPos blockPos : leaves) { event.getWorld().destroyBlock(blockPos, true); } }
  13. Well yes of course and I need some advices how to disable or dim this massive sound.. It is my mod, which does it.
  14. Ok, Lets have this situation: I have a tree. If I break one block of wood, the every leaves will fall (break). So we have a tree, with lets say 40 blocks of leaves. If you break one single log block, these 40 blocks of leaves will destroy in one moment and make very loud sound.
  15. e.g. Oak leaves.. If you break 20 of it in a one moment, it will make massive sound.
×
×
  • Create New...

Important Information

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