Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. I get around it by not updating the light block every tick, but rather every 3.5 blocks between where the light SHOULD be and where it IS.
  2. AxisAlignedBB.getAABBPool().getAABB(double, double, double, double, double, double)
  3. Return a new AABB that is the right size. The collission box, the boundary size, and the MovingObjectPosition collisionRayTrace box are all used for different purposes. You'll need to set all three of them to being your 2x2x2 box.
  4. I did this. The way I did it is not...very clean but it works. Essentially check during the item's onUpdate call to see if it's the current item (I did all the time, even when dropped, but this is what you're looking for). Then if so, spawn at the player's head (if air) a block that has the following properties: 1) Emits Light 2) Material.air 3) Resistance and Hardness 0 4) getCollisionBoundingBoxFromPool returns null 5) collisionRayTrace returns null 6) shouldSideBeRendered, isOpaqueCube, renderAsNormalBlock returns false Mind that placing and removing a light-emitting block is laggy if you do it all the time (lighting updates) so you'll want to use your item's ItemStack stackTagCompound to store both WHERE you placed the light (so you can remove it) and WHEN (so you can count up/down towards the next time you'll place a light block).
  5. I have an item that applies a passive effect to the player that's carrying it, and I can remove this effect when the item is dropped, but I can't seem to find a spot that will let me know that the item was removed from the player's inventory and placed into another object's inventory.
  6. /** * Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been * cleared to be reused) */ public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { }
  7. A chunk is an array of ExtendedBlockStorage objects, each of which is 16x16x16. So 16 of them. (An ExtendedBlockStorage is a fancy class that stores blocks as two arrays: one for the least significant bits as a byte and one, complex data type that is effectively a byte with some other functions, for the most significant bits).
  8. public class Chunk { /** * Used to store block IDs, block MSBs, Sky-light maps, Block-light maps, and metadata. Each entry corresponds to a * logical segment of 16x16x16 blocks, stacked vertically. */ private ExtendedBlockStorage[] storageArrays;
  9. I don't know, that's what you're supposed to go ask XCompWiz.
  10. new ResourceLocation("modID:textures/gui/potion_icon.png")
  11. The snowball projectile takes an item Icon as its texture. I was able to figure out how just by looking at how Vanilla created its snowballs. Hint: ender pearls also use the snowball projectile.
  12. If you have an item (even if its never available any other way) it's easy to use that item as the projectile (as I assume you're using the snowball entity).
  13. The stronghold generator holds references to the three it creates and there's a special magical function in the IChunkProvider that allows retrieving that info. Not really valid for a structure that isn't limited, nor does it work for arbitrary structures: public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5) { return "Stronghold".equals(par2Str) && this.strongholdGenerator != null ? this.strongholdGenerator.getNearestInstance(par1World, par3, par4, par5) : null; }
  14. I'm not making a massive structure. The one converter I was looking at has a limit of...1500 blocks in a single segment. Waaay more than I need.
  15. ScatteredFeatures has code to insuring that they don't generate in neighboring chunks (cursory glance indicates minimum distance of 8 chunks, maximum 32 chunks). Which implies that that code has some method of determining where other instances of it are. That isn't going to be something I can replicate with an IWorldProvider. I was going to be designing via schematic anyway. Then use a schematic -> Java converter I'd found (it was last updated for 1.3.2, but that is still sufficient to use replacement blocks, ie. "iron ore is my blockA, coal ore is my blockB...." so I could go in and replace blockID references) I was unaware that there was a direct schematic loading API. Neat.
  16. Step 1: Tell the server via packet handler that the item has been used. Step 2: Find the block's location. This can be done through math, as well as knowing where the player currently is (which you have access to) Step 3: Determine correct block. You have a location and a world. Step 4: Damage the item
  17. public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { //perform magic } Where 'magic' is sending a packet to the server to perform the action you desire.
  18. Anyone have any experience with this? I would like to add to world generation additional structures that are on the same level as pyramids and temples. Other than having to build the code for the structure itself, what do I need to do to get this to happen in the cleanest way possible?
  19. Because removing the limitation on (btye) is an actual solution, which works, and requires no base class edits (as evidenced by Mystcraft) and is highly flexible. Like having ores generate. If your base material isn't stone, vanilla ores will not populate.
  20. Indeed! well spoken Draco lol If I can ever get around by NOT making a custom GUIcontainer I will, like when I created a different kind of dispenser (it had different behaviors but was for all intents and purposes still a dispenser) I just extended TileEntityDispenser and used the Dispenser GUI.
  21. That's dumb. Do what Alix suggested. XCW is very approachable.
  22. You should create your own GUI container classes. They aren't that difficult. Annoying, time consuming, and taking a ton of classes. But not difficult. http://www.minecraftforge.net/wiki/Containers_and_GUIs
  23. You would need to create a custom Slot class that returns false for isValid. The TE would be able to move inventory items around all it wants, as the isValid check only applies to players (there's another, separate function for sided inventories for things like pipes). Check the GUI for the furnace. The slot on the right is the kind you're looking at.
  24. public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { //damage par1ItemStack }
  25. int myItemID = congif.getItem("someItem",4500) - 256; MAGIC Seriously. It's called MATH.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.