Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

ShetiPhian

Members
  • Posts

    198
  • Joined

  • Last visited

Posts posted by ShetiPhian

  1. ~4days ago, I accidentally cause an infinite notifyBlockOfNeighborChange loop.

    The error I was getting was exactly the same as you posted.

     

    My block was receiving a neighbor change event doing some logic, updating and telling neighbors it changed.

    When I placed two beside each other and the conditions where right the one would update and tell the other, who would then update and tell the first one, who would update again and this continued forever.

  2. Found another issue.

    Clients can't connect to a server after replacements have been made.

     

    SinglePlayer works fine, and the Server launches but clients can't connect.

     

     

    Short Message:

    java.lang.IllegalStateException: Can't map item minecraft:tallgrass to id 31 (seen at: 280), already occupied by null, blocked false, ItemBlock false
    

     

    and uncut:

     

     

    HandshakeMessageHandler exception
    java.lang.IllegalStateException: Can't map item minecraft:tallgrass to id 31 (seen at: 280), already occupied by null, blocked false, ItemBlock false
    at cpw.mods.fml.common.registry.GameData.injectWorldIDMap(GameData.java:525) ~[GameData.class:?]
    at cpw.mods.fml.common.registry.GameData.injectWorldIDMap(GameData.java:430) ~[GameData.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$4.accept(FMLHandshakeClientState.java:88) ~[FMLHandshakeClientState$4.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$4.accept(FMLHandshakeClientState.java:82) ~[FMLHandshakeClientState$4.class:?]
    at cpw.mods.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:27) ~[HandshakeMessageHandler.class:?]
    at cpw.mods.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:9) ~[HandshakeMessageHandler.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:?]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) [MessageToMessageCodec.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:32) [ChannelRegistrationHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15) [ChannelRegistrationHandler.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) [simpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:257) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:185) [NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:43) [NetworkDispatcher.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) [simpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [byteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [byteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_67]
    [01:43:22] [Netty Client IO #3/ERROR] [FML/]: NetworkDispatcher exception
    java.lang.IllegalStateException: Can't map item minecraft:tallgrass to id 31 (seen at: 280), already occupied by null, blocked false, ItemBlock false
    at cpw.mods.fml.common.registry.GameData.injectWorldIDMap(GameData.java:525) ~[GameData.class:?]
    at cpw.mods.fml.common.registry.GameData.injectWorldIDMap(GameData.java:430) ~[GameData.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$4.accept(FMLHandshakeClientState.java:88) ~[FMLHandshakeClientState$4.class:?]
    at cpw.mods.fml.common.network.handshake.FMLHandshakeClientState$4.accept(FMLHandshakeClientState.java:82) ~[FMLHandshakeClientState$4.class:?]
    at cpw.mods.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:27) ~[HandshakeMessageHandler.class:?]
    at cpw.mods.fml.common.network.handshake.HandshakeMessageHandler.channelRead0(HandshakeMessageHandler.java:9) ~[HandshakeMessageHandler.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?]
    at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:32) ~[ChannelRegistrationHandler.class:?]
    at cpw.mods.fml.common.network.handshake.ChannelRegistrationHandler.channelRead0(ChannelRegistrationHandler.java:15) ~[ChannelRegistrationHandler.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?]
    at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(NetworkDispatcher.java:257) ~[NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:185) ~[NetworkDispatcher.class:?]
    at cpw.mods.fml.common.network.handshake.NetworkDispatcher.channelRead0(NetworkDispatcher.java:43) ~[NetworkDispatcher.class:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [byteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173) [byteToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) [DefaultChannelHandlerContext.class:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:?]
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100) [AbstractNioByteChannel$NioByteUnsafe.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:480) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447) [NioEventLoop.class:?]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341) [NioEventLoop.class:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.7.0_67]
    

     

     

     

    And for those wanting it, my replacement code;

    Values.blockTallGrass = new AltBlockTallGrass();
    ItemColored itemTallGrass = (new ItemColored(Values.blockTallGrass, true)).func_150943_a(new String[] { "shrub", "grass", "fern" });
    try {
    GameRegistry.addSubstitutionAlias("minecraft:tallgrass", GameRegistry.Type.BLOCK, Values.blockTallGrass);
    GameRegistry.addSubstitutionAlias("minecraft:tallgrass", GameRegistry.Type.ITEM, itemTallGrass);
    } catch (Exception e) {
    Values.logCore.error("Could not replace tall grass");
    }
    

  3. I know by default the tool classes that exist are 'pickaxe', 'axe', 'shovel', with harvest levels 0 (wood, gold), 1 (stone), 2 (iron), 3 (diamond)

     

    Why don't mods expand this with other tools? are we not to do so?

     

     

    Background:

    I have a block that is rotatable on right-click with a wrench, so Block.rotateBlock works perfectly for this.

    It also dismantles with sneak + left-click with a wrench, so I check Item.getHarvestLevel if it is a "wrench"

     

    In my own wrench tool I set the tool class to "wrench" (harvest 0)

     

    Every thing works perfectly,

    But when testing wrenches added by other mods they do nothing, after looking through their code none have set their wrenches with a custom tool class.

     

    To go another step further I have yet to see any mod adding custom toolClasses (some do set harvest levels higher then 3)

     

    Now I'm wondering, is setting a custom tool class an over-looked unused feature, or a modding faux pas?

  4. In this case: Always return true;

     

    The client thinks nothing happened and places the held block, the server however knows the gui should open and doesn't place the block.

    The false block is removed when the server tells the client nothing is there.

     

    ---

     

    If you open a gui both client and server need to return true.

     

    Here is one of mine that doesn't always open a gui.

    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int face, float posX, float posY, float posZ)
    {
        if (world.getBlockMetadata(x, y, z) == 15) {
            if (!world.isRemote) {
                entityPlayer.openGui(PixelPowersWorld.INSTANCE, 5, world, x, y, z);
            }
            return true;
        }
        return false;
    }
    

  5. @EventHandler
    public void serverLoad(FMLServerStartingEvent event)
    {
        event.registerServerCommand(new MyCommand()); // Change to whatever name you want
    }
    

     

    MyCommand needs to implement ICommand

     

    As for examples anything in the package net.minecraft.command will help.

  6. When netty was first added the sirgingalot tutorials where the first ones I found, they worked well so I converted everything to it.

     

    I never bothered looking for anything else, so never noticed how similar they where ::)

     

    Now however I have so many packets across my mods I'll probably just leave it :)

     

    Edit:

    Thinking about it,

    I'm sure I settled on this as the only other ways did much more then I needed and where over complex.

    FML didn't have anything SimpleNetwork (why else would every other tutorial have something way different and sirgingalot basically clone it)

    And all the warnings and do not use messages didn't exist either ;)

     

    Edit2:

    So I finished what I was working on and took a better look at the network.simpleimpl files.

    It does look a lot cleaner and is still very simple.

    Just when I was thinking "it looks like each packet needs two classes, maybe I'm reading it wrong, I should see if someone else has an example"

     

    I found this: http://www.minecraftforge.net/forum/index.php?topic=20135.0

  7. @diesieben07

    I haven't noticed any, but maybe its a good thing to post my code so it can be looked over, and problems fixed :)

     

     

    These are in my core and are used by all of my mods:

    PacketPipeline: http://pastebin.com/5ixeHzzN

    PacketBase: http://pastebin.com/iLHeGGjt

     

    Here is an in use example:

    NetworkHandler (extends PacketPipeline): http://pastebin.com/R5PqSKvq

    Packet Example (PacketPlatFormer extends PacketBase): http://pastebin.com/U3UuMT11

    Don't use this, there is a better way.

  8. Whov

    The new system is far easier and cleaner then the old one, but it takes some prep work.

     

    sirgingalot has tutorials for the Packet pipeline and AbstractPacket  (I use a modified version of both)

     

    Let me pastebin code and I'll edit this with links.

    Don't use those.

  9. Reflection will not be possible in the future, cpw will be locking down the registry once he knows the replacement system is working.

     

    From playing with the system,

    - You don not register replacement blocks or items outside of the addSubstitutionAlias  (this will log an error otherwise)

    - The first parameter is the block/item id (found in Blocks and Items) with the prefix 'minecraft:'  (if your not replacing a mod added one that is)

    - When replacing a block you must replace the item also (an error is caused otherwise and the worlds backup file is used)

    - The replacement class needs to extend original (at least this appears to be the case)

  10. Add this to your block:

    @Override
    public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player)
    {
    
    }
    

     

     

    Without learning the basics first or at least reading a few tutorials you'll likely end up frustrated and quit before getting very far.

    Minecraft code can be a pita to read at times ;)

  11. If you extend GuiScreen

    public void drawScreen(int mouseX, int mouseY, float par3)

     

     

    If you extend GuiContainer

    public void drawScreen(int mouseX, int mouseY, float par3)

    public void drawGuiContainerBackgroundLayer(float par1, int mouseX, int mouseY)

    public void drawGuiContainerForegroundLayer(int mouseX, int mouseY)

     

     

    Check if the mouse is over the bar.

    mouseX >= energybarX && mouseX <= energybarX + energybarWidth && mouseY >= energybarY && mouseY <= energybarY + energybarHeight

    Then draw your tooltip

  12. Ok, been playing around with the Item and Block per-world aliasing.

     

    Well I can't get it to work  :-\

     

    The line I'm using : GameRegistry.addSubstitutionAlias("minecraft:tallgrass", GameRegistry.Type.BLOCK, new BlockNewTallGrass());

    Note: BlockNewTallGrass extends BlockTallGrass

     

     

    FMLControlledNamespace.addSubstitutionAlias

    I replacement : contains my block

    I original: contains  net.minecraft.block.BlockTallGrass

     

    No errors are thrown, and the data is added to persistentSubstitutions

     

    In world block, creative inventory, give command, and pick block all give the original.

     

    The only thing that seems to happen is an error "Forge Mod Loader detected that the backup level.dat is being used."

    Even on new worlds I get that error.

    Removing the substitution also removes the error.

     

     

     

    EDIT:

    Well with a clear and rested mind I took another crack at replacing blocks.

    It does work, it was completely me overlooking a step.

     

    When replacing a block you need to replace the block and replace the item.  ::)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.