sequituri
-
Posts
669 -
Joined
-
Last visited
Posts posted by sequituri
-
-
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.
-
Eclipse and debuggers in general usage involves placing breakpoints and stepping through code a line at a time while examining variables in the method. Use eclipse help if you need to learn how.
-
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.
-
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.
-
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.
-
See: Block metadata. There is also ItemStack metadata, which you should probably look at too.
-
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.
-
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.
-
It went away, that's all I know for sure.
I had updated Forge and cleaned out the gradle cache.
-
I don't think a name : value is allowed inside an array.
{"name1": "value", "name2": 3} <- is object form
["value1", "value2", "value3"] <- is array form
[{"name": "value here"}, {"name": "another value"}] <- objects inside array are allowed
-
There is a mod that allows the player to morph into creatures and mobs, such as a bat. The mod author must surely have solved this issue. I wonder if the author would share his experience.
-
EnumHelper then.
-
Look at the sources in net.minecraftforge.fluids package. It has all the stuff you need for custom fluids and gases.
-
There is an ID in there ... V ...
par5EntityPlayer.openGui(MoreFurnaces.instance, 0, par1World, par2, par3, par4);
And it is 0 in both furnaces.
-
I don't see the code for the ItemBlock that was constructed with a null Block. Could you post that?
p.s. The field field_150939_a in ItemBlock is your null.
-
First translate to the center of your model. Then, scale the model if needed. Then...
You want to rotate about either the X or Z axis by 180 or pi.
Then translate back to the original position
-
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.
-
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.
-
Yes, it is. You should ask for help on the Mo'creatures forum thread over there at Minecraftforum.com or wherever he has an official forum.
-
Subscribe to it in your event handler (probably init or postinit) and handle the event when it fires.
P.S. Do you have any ideas how to work with events? If not there are some tutorials available - google is your friend.
-
That message is from a keyboard handler somewhere in your game: It is saying that whatever modifier (Shift,Control,Alt,Meta etc.) you are holding when you press ESC (keycode 0) is confusing it. It doesn't appear to be fatal.
-
If you're using 1.7.2, there is Forge RenderGameOverlayEvent event.
-
Did your results involve eliminating the time required for an empty timing loop of x times per tick? For a reasonably accurate answer, the loop should be called X number of times with no load, then that time should be subtracted from the same x loops with the actual code used.
-
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!
[1.7.2] [solved] Achievements not activating?
in Modder Support
Posted
The object identity test
will never be true when using "new ItemStack". So, check the item the stack contains and learn Java.