Everything posted by Draco18s
-
[SOLVED] Wait (x) seconds *WITHOUT PAUSING GAME*
Eeehh, close enough.
-
[1.9] TileEntity - Assigne new NBTCompound
I unno. Does your code run now?
-
[SOLVED] Wait (x) seconds *WITHOUT PAUSING GAME*
if(harvest_enabled) { do_stuff(); } not while(harvest_enabled) { do_stuff(); } Yes, I realized that you want to "do stuff while harvest is enabled" but "while" has a different meaning in code. It means "do this thing over and over again until the condition is false, even if that means hogging the CPU and doing nothing else until the universe experiences heat death." What you need to do is press the key and stop doing anything else the rest of this tick. Then you count ticks. Then when the counter is big enough, release the key. If it helps, write out what you want to do as a Finite State Machine.
-
[1.9] TileEntity - Assigne new NBTCompound
You did something wrong, because you didn't do this: Please do the latter, do not use BlockContainer.
-
[SOLVED] Wait (x) seconds *WITHOUT PAUSING GAME*
*Defeats the whole purpose. DO NOT USE A LOOP ANYWHERE IN YOUR CODE. The tick event handler IS the loop.
-
[SOLVED] Wait (x) seconds *WITHOUT PAUSING GAME*
Bingo. @EventHandler public void onTick(TickEvent event) { //a tick happened //increment counter pressTime++; }
-
[SOLVED] Wait (x) seconds *WITHOUT PAUSING GAME*
Dude. Seriously. All of that code runs in a single tick. It doesn't actually "wait" (even if real-time it takes it four seconds). That's why the game appears to freeze. In order for you to perform an operation over time you need to count ticks. Open up TileEntityFurnace and look at the burnTime variable. Look at what it does.
-
[1.10.2] Client and Server desync
You need to override and implement getUpdateTag
-
[1.9] TileEntity - Assigne new NBTCompound
"GUI" and "NBT" should never be used in the same sentence. And GUIs don't contain Inventory items, they display Inventory items. TL;DR: You're doing everything wrong. Block -> creates TileEntity TileEntity -> contains Items Container -> wraps around TileEntity GuiContainer -> displays Container
-
[SOLVED] Wait (x) seconds *WITHOUT PAUSING GAME*
You can't use a while loop to check passage of time. They explicitly do not exit (forcing thread halt) until their conditions are met, in this case, the release of the pressed key.
-
[1.10] Actions when player step on entity
I can't tell from the code snippet. There may be also something else they did that I can't see.
-
[1.10] Actions when player step on entity
You can't store information in the Block class, you must store it elsewhere (TileEntity, Player Capability, etc.)
-
[1.10.2 - 1249] entityIn.motionZ/X limit?
This is basically wrong. For onCollide to work, the block needs to be smaller than a full cube, that's it. I don't know why his code isn't working though.
-
[SOLVED] NullPointerException when adding Slots in the Container
Good Jorb
-
Repair item for armor material
if(NullPointer) { GoTo $Location; CheckForPossibleNullObjects(); Debug(); }
-
[1.10.2] Animated Block is only animated in inventory
You won't be ABLE to get it to work without switching.
-
[1.7.10] Get item in current mod registered to an ore dictionary entry
OreDictionary.getName(stack) iirc. I don't have a working environment at the moment, but there IS a method to get all the names a given stack is registered as.
-
Detect new day/morning
Or check % 23999 .
-
Detect new day/morning
Actually, world#getWorldTime() is not %24000, TheMasterGabriel is incorrect about that (or rather, his assumption based off a particular piece of lying Javadoc). If you trace its usage you will find that it is not moduloed anywhere in the code, and in fact is used to track the current world time (cough, as expected, cough) and (IIRC) is used to calculate the current moon phase. World#getTotalWorldTime() on the other hand, returns the realtime the world has existed, meaning that if you sleep, the timer is not incremented respective to world#getWorldTime() .
-
[1.10.2] directional blocks
There are three methods that are important. If you do a search in BlockFurnace for where it uses the PropertyDirection, you'll find what you need. We are not here to GIVE you code, we're here to HELP you code.
-
[1.10.2] directional blocks
Yeah, you've done NONE of the things required for a block to have blockstates. Congrats, you have a PropertyDirection static enum. You never use it.
-
[1.10.2] directional blocks
Show your Block class.
-
[SOLVED] [1.10.2] Collection in config
Please use strongly typed lists.
-
How to bypass setLightLevel limit?
Quick note: Your fake light block should return true for all checks that ask if the block is Air. Otherwise you'll get some funky behavior with other mods. e.g. a while back Computer Craft turtles would bump into the light columns produced by...I think it was Atomic Stryker's Dynamic Lights mod: the floodlights would point downwards and produce a column of fake light blocks until it encountered another block. Those blocks did not detect as "air" or anything else that the turtle could path through, so it would get stuck on it.
-
[SOLVED] [1.10] Fuel smelting time constant values
I'm away from my dev space, but if you know how to register the burn time for an item, use your IDE to Find All References and you should be able to find where the vanilla items are set.
IPS spam blocked by CleanTalk.