Jump to content

sequituri

Forge Modder
  • Posts

    669
  • Joined

  • Last visited

Posts posted by sequituri

  1. while(tileEntity instanceof TileEntityWindmill && world.getBlockMetadata(x, y, z) < ;
    

    Yeah, that is an infinite loop.

     

    Sorry I'm sure I'm being an idiot here. Could you explain how please? I copied that piece of code from a tutorial video, and theirs worked fine.

     

    Okay, there are two kinds of loops that use

    while

    . One is:

    do BLOCK while (boolean-expression);

    (note the ';' after the keyword. The other is:

    while (boolean-expression) BLOCK;

    (notice the ';' after the body of the loop). In both cases BLOCK is usually an actualy block ('

    { statement; ... }

    '), but it may also be a single statement.

     

    Your while loop appears to be executing a null statement (';' alone is a null statement), and that is why the loop repeats forever.

  2. A nice addition to the time functionality would be to have two types of dimensions, synced and time-independent. Synced would check for players asleep in all synced dimensions and reset the synced clock to daytime. Time-independent would check for players all sleeping in that dimension and reset the independent clock in that dimension only.

    This allows great flexibility.

  3. Here's the class extender:

     

    
        public BlockExtender(String texture, CreativeTabs tab)
        {
            droppedItemID = this.getIdFromBlock(this);
    ...
            GameRegistry.registerBlock(this, this.getUnlocalizedName().substring(5));
        }
    
        @Deprecated // Removed in 1.7.2
        public int idDropped(int par1, Random par2Random, int par3)
        {
            return droppedItemID;
        }
    
        @Deprecated // Removed in 1.7.2
        public int quantityDropped(Random random)
        {
            return quantityDrop;
        }
    }
    

     

    This may not be your main problem, but your code cannot work as written with IDs. Even if you registered your block before trying to use its ID (which you cannot), you are using deprecated methods which have no purpose in 1.7.2. Using the

    @deprecated

    annotation is the same as saying ignore this error. But, there is no reason to cheat like that.

     

  4. The log points to a booboo made in the Ars Magica 2 mod. Something to do with particle rendering where they modify a list through an iterator improperly or not thread safely.

    I'd bring this problem to the Ars Magica 2 forum and see if they can help solve it.

  5. Your init method does not get called before your addNames method. See below:

     

        @EventHandler
        public void preInit(FMLInitializationEvent event) {
            Cfitems.init();
    }
        @EventHandler
        public void load(FMLInitializationEvent event) {
           Cfitems.addNames();
           }    
    

     

     

    In your code you have 2 event handlers for the very same event. Obviously Forge is not going to call them both, and if it did what order would you expect them to be called in?

    The names of your event handlers makes no difference to the event bus mechanism, only the argument types do. I'd suggest you make the one you want to execute first use FMLPreinitializationEvent and leave the other one the same.

     

  6. You would probably want two transformations for your gun model. One is used when the gun is just being carried/held in the hand. The other would be used when you are actively firing the gun (like when the box is activated and drawn.)

    For my purposes, I'd find a way to determine the hand location - translate so the pistol grip of the gun is at that point, then do my rotations to align with sight or carry attitude. Then reverse translate back to model coordinates and draw your model.

    glRotatef(angle, ax, ay, az)

    expects that (ax, ay, az) form a unit vector, so if you know the vector normal to the plane of rotation that is the axis of rotation. Use the right hand rule (make s fist and point extended thumb in direction of axis, then curled fingers point in positive direction of rotation) to find angle of rotation (angle).

    A unit vector is a vector whose magnitude is exactly 1. so, (1.0,0.0,0,0) is one, as is (0.0,1.0,0.0). The magnitude is found with the square-root of the sum of the squares formula.

    sqrt(x*x + y*y + z*z)

    To make a vector into a unit vector divide each ordinate by the magnitude of the vector thus: unitize(V) = vector(V.x/M, V.y/M, v.z/M) where M is given above as the magnitude formula.

  7. I know how to listen in on the event, but I want the buttons to appear on screen when a key is pressed, and remove them with the another key. How should I make the buttons appear by listening in on an event which basically just allows me to get the x and y position of the rendered element?

    I'm guessing you don't realize why these events exist. Look at the code in GuiIngameForge for some clues as to when and why this (and its subevents) are fired. You should understand that these events occur while rendering the screen you see in game. Your little icons at the top of said screen would be rendered at such a time.

  8. Your log gives a pretty good clue as to what is happening. You are opening a GoldOven gui when you click on an IronOven, it fails because the TE is not, in fact, a GoldOven at all.

       at com.volt.dev.morefurnaces.goldfurnace.GuiHandlerGoldOven.getServerGuiElement(GuiHandlerGoldOven.java:16) <-- your GoldOven gui opens (5)
       at cpw.mods.fml.common.network.NetworkRegistry.getRemoteGuiContainer(NetworkRegistry.java:241) <-- server triggers container (4)
       at cpw.mods.fml.common.network.internal.FMLNetworkHandler.openGui(FMLNetworkHandler.java:75) <-- server got arguments (3)
       at net.minecraft.entity.player.EntityPlayer.openGui(EntityPlayer.java:2510) <-- opening GUI with given argument (2)
       at com.volt.dev.morefurnaces.ironfurnace.IronOven.onBlockActivated(IronOven.java:142) <-- clicked on IronOven (1)
    

    You need to make sure you open the correct Gui when you activate a furnace. When you register a guiHandler (two different times) the second one overwrites the first. You only get one GuiHandler per mod. Use it to open all Gui's.

  9. So, are you saying that this is not your log which specifically says the below mod (MinersHeaven) does not appear in your 1.6.4 log?

     

    java.lang.NoSuchFieldError: field_150594_b
       at com.gim949.mods.MinersHeaven.world.biome.BiomeGenMine.<init>(BiomeGenMine.java:14)
       at com.gim949.mods.MinersHeaven.MinersHeaven.<clinit>(MinersHeaven.java:47)
    

     

    My eyes must be deceiving me, and LexManos's and deiseibens07's too. We are all calling it like it is. Denying the obvious is kind of ridiculous!

×
×
  • Create New...

Important Information

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