-
Posts
16559 -
Joined
-
Last visited
-
Days Won
156
Everything posted by Draco18s
-
Honestly, I wouldn't both with UE. An opinion I can agree with, due to having looked at UE and gone "why would I want this?" So there's the grain of salt that will come with your mod.
-
Based on some trouble I had the other day, item entity's rotation is based on age.
-
I'd suggest just updating the entity's rotation/age/etc. through your TE's update, rather than calling the EntityItem's update function. That would give you better control over the animation (e.g. rotating but not bobbing). I'm actually using that for some animation one of of my blocks right now: tweaking the Entity's age, then using that value in the render process.
-
There is a difference between the entity having a null world and the entity not being spawned into the world. You can totally construct an entity with a valid world, but never spawn it. Touche. Just checked my code and I am setting a world object, but I suspect he isn't. As that's the only reason that line would crash.
-
He totally is, because he's never spawning it in the world (he's doing the same thing I'm doing right now, except he wants it to rotate, and I don't).
-
Because you're using a "fake" EntityItem that isn't added to the world, the EntityItem is causing a NPE when it attempts to access its world object (which is null): public void onEntityUpdate() { this.worldObj.theProfiler.startSection("entityBaseTick"); It's cashing at "this.worldObj.theProfiler" because "worldObj" is null.
-
That probably isn't worth the effort. It's not that important, it just would have been "nice" that this one block would be in both the redstone tab and in my custom tab. But for one or two blocks I'm not going to go to that much effort.
-
BLOCK, NOT ITEM The item class has this function: public CreativeTabs[] getCreativeTabs() { return new CreativeTabs[]{ getCreativeTab() }; } The block class does NOT have this function. How do I get a block into more than one creative tab? And no, calling setCreativeTab(...) twice is not going to work, that function looks like this: public Block setCreativeTab(CreativeTabs par1CreativeTabs) { this.displayOnCreativeTab = par1CreativeTabs; return this; } So the second call will just overwrite the first.
-
this.setCreativeTab(null); ?
-
Advanced Model Loader: The resource name could not be found
Draco18s replied to ss7's topic in Modder Support
Huh? Wha? Where am I? D: -
Advanced Model Loader: The resource name could not be found
Draco18s replied to ss7's topic in Modder Support
this.setCreativeTab(null); ? -
[Solved] "Ticking memory connection"-error at onItemRightClick
Draco18s replied to Galidor's topic in Modder Support
It's called a null check. if(someObject != null) { //if the object isn't null if(someObject.property) { //then do things with it //do stuff } } -
Ah! I see your problem. This is from my tile entity: @Override public void onInventoryChanged() { super.onInventoryChanged(); if(contents[0] != null) { itemEnt = new EntityItem(this.worldObj, this.xCoord, this.yCoord, this.zCoord, contents[0]); itemEnt.hoverStart = 0; //this is making it be off-center itemEnt.rotationYaw = 0; //this is what's making it rotate for you itemEnt.motionX = 0; //zero out these just in case itemEnt.motionY = 0; itemEnt.motionZ = 0; } else { itemEnt = null; } }
-
It shouldn't. That code was where I stopped last night, before I did placement angles (my TE now has 4 facings).
-
I have that as part of the Model (public class MyModel extends ModelBase). es.itemEnt is just an EntityItem that is stored in the custom tile entity so that I'm not creating a new one all the time (I also force its position, rotation, and age to zero).
-
Potions will be a huge pain in the ass, just FYI. isPotionIngredient isn't enough, as there's a whole bitflag system in place to handle what brews into what and what constitutes a valid result.
-
Entites Despawn on World / Chunk unload and won't reload
Draco18s replied to tlr38usd's topic in Modder Support
By "despawn when the chunk unloads" do you mean that it ceases to exist because the chunk is not there, or do you mean that even after you reload the chunk the entity is still gone? -
So I've learned Java... How do I learn minecraft?
Draco18s replied to EliteCreature's topic in Modder Support
Screw that, edit core classes as you get started. Go crazy, see what happens, try to do stuff intentionally. Play around, have fun. What would happen if you forged every sign to start with a chat enum formatting character (just the § symbol, which tells the renderer that the next character defines color)? Once you have an understanding of what CAN be done and what DOES what, then pull back, reinstall the original source, and get started on a mod you can release. -
Rendering Custom Chest Contents - Getting Contents from Server
Draco18s replied to Draco18s's topic in Modder Support
Thanks, though I figured it out on my own late last night. I'd been going in all the wrong directions based on the scant info I had available. Then threw a google search at the problem and found what I needed: 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); } -
Here's the render function for my TE model: public void render(TileEntity te, double x, double y, double z) { TEDisplayPedestal es = (TEDisplayPedestal)te; if(es.itemEnt != null) { //store the item entity in the tile entity GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F, (float)z + 0.25F);//position where I want it GL11.glRotatef(90, 1, 0, 0); //lay the item flat RenderHelper.enableStandardItemLighting(); RenderManager.instance.renderEntityWithPosYaw(es.itemEnt, 0, 0, 0, 0, 0); GL11.glPopMatrix(); } GL11.glPushMatrix(); GL11.glTranslatef((float)x + 0.5f, (float)y - 0.5f, (float)z + 0.5f); ResourceLocation rl = new ResourceLocation(es.getModelTexture()); Minecraft.getMinecraft().renderEngine.bindTexture(rl); this.render(); GL11.glPopMatrix(); }
-
Multiplayer still won't work.... forge 884 ???
Draco18s replied to TheyCallMeDanger's topic in Modder Support
You're not running the right jar. minecraft_server.1.6.4.jar <-- vanilla minecraftforge-universal-1.6.4-9.11.0.884.jar <-- with forge -
Rendering Custom Chest Contents - Getting Contents from Server
Draco18s replied to Draco18s's topic in Modder Support
When should I pass this packet? -
Multiplayer still won't work.... forge 884 ???
Draco18s replied to TheyCallMeDanger's topic in Modder Support
No no, the Forge log. ForgeModLoader-server-0.log Also, most recent file in /crash-reports, if any -
Multiplayer still won't work.... forge 884 ???
Draco18s replied to TheyCallMeDanger's topic in Modder Support
Error messages make it easier to help you.