Everything posted by Draco18s
-
How does Minecraft internally store blocks in memory?
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;
-
What is the best way to do this?
I don't know, that's what you're supposed to go ask XCompWiz.
-
[1.6.4] Potion Effect Texture In Player's GUI
new ResourceLocation("modID:textures/gui/potion_icon.png")
-
How do you get a projectile to show a texture?
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.
-
How do you get a projectile to show a texture?
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).
-
New Scattered Features
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; }
-
New Scattered Features
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.
-
New Scattered Features
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.
-
Damaging Item Help
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
-
Damaging Item Help
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.
-
New Scattered Features
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?
-
What is the best way to do this?
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.
-
Deny item placement
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.
-
What is the best way to do this?
That's dumb. Do what Alix suggested. XCW is very approachable.
-
Deny item placement
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
-
Deny item placement
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.
-
Damaging Item Help
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase) { //damage par1ItemStack }
-
set ItemID
int myItemID = congif.getItem("someItem",4500) - 256; MAGIC Seriously. It's called MATH.
-
set ItemID
Holdover from when BlockIDs and ItemIDs shared the same "0" and blocks were the first 256 in the array. You can't fix that. Blame Mojang.
-
set ItemID
Let me guess. 3100 is LESS than 3840
-
How to override classes
Reflections. Also, what do you mean by "overriding a class"? Do you want to replace another mod's block/item with your block/item or do you want to disable the other mod's block/item? Or what?
-
RESOLVED: How to a make 2D texture that always faces player.
For me, that's in a TileEntitySpecialRenderer, as for a texture, you would just need to bind a texture: ResourceLocation rl = new ResourceLocation("artifacts:textures/blocks/pedestal.png"); Minecraft.getMinecraft().renderEngine.bindTexture(rl); (Do that instead of the GL11.glColor(...) call; or rather, do it after and change the color to white)
-
How to get unique itemID???
There is a suggestions forum for a reason.
-
How to get unique itemID???
My conflict resolver does NOT assign IDs, it simply flags conflicts and says, "Hey user, this is conflicting, you need to fix it." AND it's not 100% reliable. It's simply the best I could do with the access that I had. Its a known issue that RedPower2's config is not parsed properly, but I am unable to fix it. The problem with automatically assigning IDs has to do with mod load order. Yes, the server should be able to tell the client what IDs go where, but Minecraft (vanilla, that is) was never built that way. If you have a mismatch, the client will TRY to do something, but the server will go "wait, what?" and revert the change. If its two blocks that are functionally identical (say birtch logs and oak logs) with swapped IDs on the client, then the server won't give two shits. It'll place down oak, your client places down birtch. Things get weird (or could) if the blocks have vastly different functions, for instance soul sand vs. sand. The server will slow you down because it's soul sand, but the client will think its regular sand and display it as such, and you'll get some rubber banding as you try to walk across it. This can be easily demonstrated by installing a mod on your client (like Mystcraft or IC2) and not on a server. You can join the server, you can attempt to craft the blocks/items, the client will show a valid result. You won't be able to pick it up. And because items and blocks are referred to by ID number alone there is no guaranteed method to synch the client and server's ID listings. Forge can detect mismatches and changes, but only because it goes out of its way to save block/item names (as unlocalized strings) into the world save file, so that if a mod is removed it can alert you to the fact that some block/item was detected that is in disparity between the current mod set and what was last known for that save.
-
How to get unique itemID???
Now tell them to go here: http://www.minecraftforum.net/topic/1597274-tool-block-id-conflict-resolver/
IPS spam blocked by CleanTalk.