Everything posted by Draco18s
-
Correct way to call/use methods/functions from Minecraft source classes?
Step 1: EntityPlayer player != EntityPlayer Step 2: Read the javadoc
-
SOLVED: How to make a non-selectable block?
public MovingObjectPosition collisionRayTrace(World par1World, int par2, int par3, int par4, Vec3 par5Vec3, Vec3 par6Vec3) { return null; }
-
If Time == ?
World world != World
-
Entity loses data client side on world loads/unloads
There's onItemPickup for EntityLivingBase...
-
Entity loses data client side on world loads/unloads
Welcome to client-server disparity. You'll want this: public Packet getDescriptionPacket() { NBTTagCompound nbtTag = new NBTTagCompound(); this.writeToNBT(nbtTag); return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbtTag); } public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) { readFromNBT(packet.data); } Assuming your read/write functions handle your TE's item contents. If it doesn't, it should.
-
Call to Item class when placed into ItemFrames
As a result of trying to do attribute boosts when the player owns an item, and trying to avoid performing a complete inventory check onEntityLivingUpdate every N frames for every living entity in order to determine if the item was no longer owned, I have run into an issue: For chests (and chest like objects) I was able to get around the problem by revoking the boost if a container GUI was active. However for ItemFrames this never occurs, the item is simply removed from the player's hand instantly. What I would like would be an additional call in ItemStack's setItemFrame method to tell the ItemStack's item class that it was placed into an ItemFrame i.e. something like this: public void setItemFrame(EntityItemFrame par1EntityItemFrame) { this.itemFrame = par1EntityItemFrame; this.getItem().nowInFrame(par1EntityItemFrame); } This function would be called once with the intent that any effect the Item normally applies to the player can be properly toggled off. It would be nice if there was a similar function for when it's placed into a chest (or other container), but not strictly necessary due to the workaround I have.
-
Function called for Items in Chests?
. Putting items into item frames doesn't trigger any kind of function either! And doing that doesn't require opening a GUI!
-
OBJ not rendering correctly
did it still rendered something, like in the image above or did it render nothing? It rendered a blank, off-white cuboid, just like in the OP.
-
Well that's a new one [facepalm, no help actually required]
"New"? I opened Eclipse this morning when the only thing that changed from yesterday was that I'd done some work on a different computer, so I moved my updated sourcecode in. The top-level "Minecraft" doodad in the project window indicated an error, but NONE of the subitems had an error. So I ran it, ignored the "project has errors" warning just to see what it would do, got the above error. So I'm redecompiling. Heh.
-
Well that's a new one [facepalm, no help actually required]
2013-10-08 11:33:12 [iNFO] [sTDOUT] ---- Minecraft Crash Report ---- 2013-10-08 11:33:12 [iNFO] [sTDOUT] // Why is it breaking 2013-10-08 11:33:12 [iNFO] [sTDOUT] 2013-10-08 11:33:12 [iNFO] [sTDOUT] Time: 10/8/13 11:33 AM 2013-10-08 11:33:12 [iNFO] [sTDOUT] Description: Initializing game 2013-10-08 11:33:12 [iNFO] [sTDOUT] 2013-10-08 11:33:12 [iNFO] [sTDOUT] java.lang.NoClassDefFoundError: net/minecraft/util/Vec3 2013-10-08 11:33:12 [iNFO] [sTDOUT] at net.minecraft.client.model.PositionTextureVertex.<init>(PositionTextureVertex.java:15) Go Minecraft, go! 9..9 You forgot where you put your Vec3s (class totally exists: I have it open). Also, best crash message ever: "Why is it breaking"
-
OBJ not rendering correctly
I had something like this happen when I forgot to register my renderer. Hehe.
-
DungeonHooks.addDungeonLoot ?
My problem was one of confusion. And the program is glorious. It messes up the orientation on dispensers frequently (still not sure why)--last use I had 6 dispeners, 3 facing the other three. In the converted code only one is facing the right direction.
-
[1.6.2]Traps and Random give
You shouldn't use hardcoded numbers. That would be bad if someone changed the ID numbers.
-
[1.6.2]Traps and Random give
ModPowderCraft.explorerKit.itemID Make sure that you set up your mod to be required-after the parent mod or you'll get a null reference error. Eg: @Mod(modid = "DecayingWorld", name = "Decaying World", version = "4.1.0", dependencies = "required-after:Mystcraft")
-
cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException
You're supposed to make a zip file. I haven't ever seen it done like that.
-
cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException
This might be the problem. Can I see a screenshot of your zip file's folder structure?
-
cpw.mods.fml.common.LoaderException: java.lang.ClassNotFoundException
You haven't correctly set up your @ModID annotation. Probably. I can't tell. You haven't shown us any code. But Forge is trying to inject your main class and can't find it.
-
[1.6.2]Traps and Random give
The second one is easier. Not sure about the first, you might try player.moveEntity(par1, par3, par5) For the second one, you're going to need a block that extends BlockContainer. That will generate a new TileEntity (which you will also need to create). This TE can now do all kinds of fancy stuff. You probably also need a custom renderer (ISimpleBlockRenderingHandler is sufficient) though you might be able to get away with metadata based icon selection (via getIcon).
-
Player username on startup
No shit, there isn't a player entity until they log into a world. You're going to need to backtrack the EntityPlayer creation to figure out where the username comes from.
-
If Time == ?
http://stackoverflow.com/questions/833768/java-code-for-getting-current-time
-
[solved][1.6.4]How to spawn entities
Nope, you have to use a line for every biome.
-
Iron Golem Spawning
I think that would only work for a short while and I'd have to constantly update it (and only if the player was nearby). Custom mob will work better for a variety of reasons. Thanks all!
-
Make a block players/entities can walk through?
Actually...it has to do with world raycast operations. Most blocks return true (and the ray is inside the block's collission bounding box), except Fire, though water can return false or true via canCollideCheck (by default it calls isCollidable). True is returned iff a player is holding a boat or lily pad.
-
Iron Golem Spawning
Yeah, that's about what I'd figured out. (And also how to alter the min/max spawn times on the spawner itself, hehe, so that the golems don't spawn as frequently)
-
Make a block players/entities can walk through?
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; }
IPS spam blocked by CleanTalk.