Hello, I'm a fairly advanced modder, but I've come across a reoccuring problem which just doesn't want to be fixed. When I try to get a block to drop an extra item (such as how wheat crop can drop seeds), the items that drop are not able to be picked up. The entities appear, but don't actually seem to exits.
Here is an example of such code.
package net.minecraft.src;
import java.util.Random;
public class BlockStone extends Block
{
public BlockStone(int par1, int par2)
{
super(par1, par2, Material.rock);
this.setCreativeTab(CreativeTabs.tabBlock);
}
/**
* Returns the ID of the items to drop on destruction.
*/
public int idDropped(int par1, Random par2Random, int par3)
{
return Block.cobblestone.blockID;
}
//added by mediate
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
super.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5);
if(rand.nextInt(4) == 0)
{
par1World.setBlockWithNotify(par2, par3, par4, 0);
EntityItem entityitem = new EntityItem(par1World, (float)par2, (float)par3, (float)par4, new ItemStack(mod_Mediate.wpnPebble));
entityitem.delayBeforeCanPickup = 10;
par1World.spawnEntityInWorld(entityitem);
}
}
public Random rand = new Random();
}
Well, for starters, never use "567" or a number like that. You must use mod_MyNameHere.itemNameHere.shiftedIndex in that field, because, well, because of the nature of shifted indeces.
Hello, UtakataJ6 here.
I'm currently working on a large mod, and I'm stuck on a particular feature. I've created stalagmites or stalactites, currently without using metadata, and by changing a single number in the following class, I can determine whether they are right-side-up or upside down.
class mecTileEntityStalaRenderer
public class mecTileEntityStalaRenderer extends TileEntitySpecialRenderer
{
public static mecTileEntityStalaRenderer instance = new mecTileEntityStalaRenderer();
public mecTileEntityStalaRenderer()
{
aModel = new mecModelStala();
}
mecTileEntityStalaRenderer renderStala = new mecTileEntityStalaRenderer();
ModLoader.registerTileEntity(mecTileEntityStala.class, "mecTileEntityStala", renderStala);
public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block m, int l)
{
if(m instanceof mecBlockCrystal)
{
super.renderInvBlock(renderblocks, m, i, j);
return true;
}
if(m instanceof mecBlockStala)
{
super.renderInvBlock(renderblocks, m, i, j);
return true;
}
return false;
}
Oh ok, I wasn't initially looking for the official thread to start, then I saw his sig and thought that was it, so i dismissed it when it brought me back, but thank you for directing my attention there.
Trust her, it's the place to be. Sounds like you'll fit in well enough, once we get rid of about 4% more ethics.
Minecraft Name: UtakataJ6
What would you like to say on your gravestone: R.I.P Ice - drowned in mercury
2 Items That you Would like to be bury with: Sign, Map
Would you like flowers on top of grave : Dandelion
Would you like Netherock lit in the corners of your grave: Nah
Checking in once again...Flower, always good to see you doing your beloved job of thinking and fixing. I appreciate your comments (that I've seen) about the most recent snapshots.
Curiosity. What are your feelings on how many mod features have been implemented into vanilla? (premium wood, slabs in new directions, sheep regrow, on and on and on...)
Hey dude! I'd suspect the best way of handling this is to create a thread for it over on the BTW forums where we can discuss it with proper moderation. PM is unfortunately not an option for someone like me that is the target of so much community "love"
I figured. That works for me, although I probably won't make it there for another 8 hours or so, at least. (6:00 my time.)
Not sure what universe that logic applies to, but I hope it's a pleasant one for you.
Hey, Flowerchild, back again with some comments that might interest you.
So, long story short, I've finally got a releasable version of MediateCraft ready for the public. This is NOT a plug for attention, because I'm not uploading it yet. I have a lot to clear with you, first of all.
I long envisioned Mediate as a BTW add-on, and with extra time over this break, I was able to somewhat duplicate (with intense difficulty, I assure you) a BTW source-code environment in MCP. Think of it as an ultra-crappy BTW api. Again, to shorten things, this means that Mediate does indeed already have some BTW cross-functionality in recipes. I have no dependencies on editing and re-releasing your base classes, because you've made it clear over and over again that won't be allowed.
In coding my way through my massive (and very unfinished) task list, I've come across a couple of things I'd like to ask you about specifically as to what I can do. Since I believe I am the first to actually accomplish this, I offer you the ability to continue this conversation over PM or such as you desire - in fact, I believe that would be quite beneficial for a number of reason.
Finally, at heart I'm a BTW fan, and so once you see exactly what I've got happening in Mediate, I offer you, with no tension at all, full right to take any parts of the mod and use them as your own, although I suspect you would not, because of my focus on world-editing.
Should you completely ignore this message, I plan on adding a few more features (in 1.2.3) before release, which would take another week at least, and would release the mod with BTW dependencies but, of course, no edited BTW files. I can only hope that, in the meantime, you ignore this silly 1.2.4 update, and that a proper BTW api is actually forthcoming in the near future.
Flowerchild, another question.
If you're using those forge source files, including the ones to avoid wasting block and item sprites, if a mod (such as More Freaks or Portal mod) updates to MC forge just for the said sprite-usage files, is there any reason said mods wouldn't work with BTW's forge files installed?
Also, I simply can't resist commenting on the redpower stuff. That's frightening. Thank ... Notch ... that your intuitive style defeats simple implementation of other features.
Why the FRICK did they add the 4096 support without implementing it???
Might I suggest a mod? something where you put in a save file, select certain block IDs, and have all instances of that become a new block ID. For instance, I am using BTW on MC 1.1, and when I update to Anvil in 1.3 (not a typo) I'm going to want to keep my creations, you know? Figure others would have a use for this.
The primary thing I'd waiting on was for something like the anvil worlds, and along they came!
I plan to have a release ready for 1.2.3 very, very soon now. All I'm waiting on is for Better Then Buildcraft and MC forge to each update, at which point I should have a basic release ready.
My java coding has greatly improved, so I'm doing less scavenging code and more writing my own functions. Check the frontpage for an update on coding work.
Hm...
Going off rumors from all areas of minecraft news, I would guess that the next few updates are centered on Volcano biome, the ocean, and the nether, in who-knows-what order. Flying biomes don't seem to be much on the itinerary.
*back to thinkin about abstract uses for buddy blocks*
0
Here is an example of such code.
0
0
0
I'm currently working on a large mod, and I'm stuck on a particular feature. I've created stalagmites or stalactites, currently without using metadata, and by changing a single number in the following class, I can determine whether they are right-side-up or upside down.
class mecTileEntityStalaRenderer
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
public class mecTileEntityStalaRenderer extends TileEntitySpecialRenderer
{
public static mecTileEntityStalaRenderer instance = new mecTileEntityStalaRenderer();
public mecTileEntityStalaRenderer()
{
aModel = new mecModelStala();
}
public void renderAModelAt(mecTileEntityStala tileentity1, double d, double d1, double d2, float f)
{
GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 0.5F, (float) d2 + 0.5F);
bindTextureByName("/UtakataJ6/limestone.png");
GL11.glPushMatrix();
GL11.glRotatef(0F, 1F, 0F, 0F); //0 is upside down, 180 is right-side up.
aModel.renderModel(0.0625F);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
public void renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f)
{
renderAModelAt((mecTileEntityStala)tileentity, d, d1, d2, f);
}
private mecModelStala aModel;
}
Here are the other relevant files:
mecBlockStala
package net.minecraft.src;
import java.util.Random;
import forge.ITextureProvider;
public class mecBlockStala extends BlockContainer implements ITextureProvider
{
private Class mecTileEntityStala;
protected mecBlockStala(int i, Class tClass)
{
super(i, Material.ground);
mecTileEntityStala = tClass;
this.blockIndexInTexture = 69;
this.setHardness(2F);
this.setStepSound(mod_FCBetterThanWolves.fcSoundSquishFootstep);
this.setBlockName("mecBlockStala");
this.setCreativeTab(CreativeTabs.tabDeco);
}
//going to need a canStay function
public TileEntity getBlockEntity()
{
try
{
return (TileEntity)mecTileEntityStala.newInstance();
}
catch(Exception exception)
{
throw new RuntimeException(exception);
}
}
public int idDropped(int i, Random random, int j)
{
return mod_Mediate.blockStala.blockID;
}
public int quantityDropped(Random random)
{
return 1;
}
public int getRenderType()
{
return mod_Mediate.mecStalaRenderID;
}
public boolean isOpaqueCube()
{
return false;
}
public boolean renderAsNormalBlock()
{
return false;
}
public TileEntity createNewTileEntity(World var1)
{
return new mecTileEntityStala();
}
public String getTextureFile()
{
return "/UtakataJ6/mediate.png";
}
}
snippets from mod_Mediate
public static int mecStalaRenderID;
public static Block blockStala;
blockStala = new mecBlockStala((mecStarterID + 6), net.minecraft.src.mecTileEntityStala.class);
ModLoader.addName(blockStala, "Lime Mud Formation");
ModLoader.registerBlock(blockStala);
mecTileEntityStalaRenderer renderStala = new mecTileEntityStalaRenderer();
ModLoader.registerTileEntity(mecTileEntityStala.class, "mecTileEntityStala", renderStala);
public boolean renderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block m, int l)
{
if(m instanceof mecBlockCrystal)
{
super.renderInvBlock(renderblocks, m, i, j);
return true;
}
if(m instanceof mecBlockStala)
{
super.renderInvBlock(renderblocks, m, i, j);
return true;
}
return false;
}
public void renderInvBlock(RenderBlocks var1, Block var2, int var3, int var4)
{
if(var2 instanceof mecBlockCrystal)
{
var2.setBlockBoundsForItemRender();
TileEntityRenderer.instance.renderTileEntityAt(new mecTileEntityCrystal(), 0.0D, 0.0D, 0.0D, 0.0F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}
if(var2 instanceof mecBlockStala)
{
var2.setBlockBoundsForItemRender();
TileEntityRenderer.instance.renderTileEntityAt(new mecTileEntityStala(), 0.0D, 0.0D, 0.0D, 0.0F);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
}
}
0
Trust her, it's the place to be. Sounds like you'll fit in well enough, once we get rid of about 4% more ethics.
0
0
What would you like to say on your gravestone: R.I.P Ice - drowned in mercury
2 Items That you Would like to be bury with: Sign, Map
Would you like flowers on top of grave : Dandelion
Would you like Netherock lit in the corners of your grave: Nah
0
Curiosity. What are your feelings on how many mod features have been implemented into vanilla? (premium wood, slabs in new directions, sheep regrow, on and on and on...)
0
I figured. That works for me, although I probably won't make it there for another 8 hours or so, at least. (6:00 my time.)
0
Hey, Flowerchild, back again with some comments that might interest you.
So, long story short, I've finally got a releasable version of MediateCraft ready for the public. This is NOT a plug for attention, because I'm not uploading it yet. I have a lot to clear with you, first of all.
I long envisioned Mediate as a BTW add-on, and with extra time over this break, I was able to somewhat duplicate (with intense difficulty, I assure you) a BTW source-code environment in MCP. Think of it as an ultra-crappy BTW api. Again, to shorten things, this means that Mediate does indeed already have some BTW cross-functionality in recipes. I have no dependencies on editing and re-releasing your base classes, because you've made it clear over and over again that won't be allowed.
In coding my way through my massive (and very unfinished) task list, I've come across a couple of things I'd like to ask you about specifically as to what I can do. Since I believe I am the first to actually accomplish this, I offer you the ability to continue this conversation over PM or such as you desire - in fact, I believe that would be quite beneficial for a number of reason.
Finally, at heart I'm a BTW fan, and so once you see exactly what I've got happening in Mediate, I offer you, with no tension at all, full right to take any parts of the mod and use them as your own, although I suspect you would not, because of my focus on world-editing.
Should you completely ignore this message, I plan on adding a few more features (in 1.2.3) before release, which would take another week at least, and would release the mod with BTW dependencies but, of course, no edited BTW files. I can only hope that, in the meantime, you ignore this silly 1.2.4 update, and that a proper BTW api is actually forthcoming in the near future.
0
If you're using those forge source files, including the ones to avoid wasting block and item sprites, if a mod (such as More Freaks or Portal mod) updates to MC forge just for the said sprite-usage files, is there any reason said mods wouldn't work with BTW's forge files installed?
Also, I simply can't resist commenting on the redpower stuff. That's frightening. Thank ... Notch ... that your intuitive style defeats simple implementation of other features.
1
Might I suggest a mod? something where you put in a save file, select certain block IDs, and have all instances of that become a new block ID. For instance, I am using BTW on MC 1.1, and when I update to Anvil in 1.3 (not a typo) I'm going to want to keep my creations, you know? Figure others would have a use for this.
0
The primary thing I'd waiting on was for something like the anvil worlds, and along they came!
I plan to have a release ready for 1.2.3 very, very soon now. All I'm waiting on is for Better Then Buildcraft and MC forge to each update, at which point I should have a basic release ready.
My java coding has greatly improved, so I'm doing less scavenging code and more writing my own functions. Check the frontpage for an update on coding work.
1
Going off rumors from all areas of minecraft news, I would guess that the next few updates are centered on Volcano biome, the ocean, and the nether, in who-knows-what order. Flying biomes don't seem to be much on the itinerary.
*back to thinkin about abstract uses for buddy blocks*
0
More fun with Buddy blocks (an block dispensers) - a familiar sight for older gamers!
Not sure how I lived without them.