Everything posted by M4thG33k
-
[1.7.10] Forcing a large render slightly outside of view
Greetings! I have a large tile entity (with a TESR) that is working exactly as I want it. The only issue is that, since the render is so large, the render vanishes the block in charge of the render is out of view (which, of course, is expected). I was just wondering if there was a way to force the renderer to keep the TESR active even when the block is slightly out of view. Perhaps there is some sort of viewing angle parameter you can pass in somewhere, like tricking the program to think that for this specific block we have a wider FOV? Am I chasing a unicorn here, or is this something that can be done? Thank you for your time! :-)
-
[1.7.10] Extracting/inserting fluids into buckets
Helpful as usual, Diesieben07. Thanks! :-)
-
[1.7.10] Extracting/inserting fluids into buckets
First off, I know that filled and empty buckets are completely different items and that filling/emptying them is swapping out one item type with another. I'm working on a tank block and would like to be able to insert/extract fluids by using filled/empty buckets, respectively. In my block class, I have performed a check in the onBlockActivated method to see if the held item is an instance of ItemBucket, but this only detects water and lava buckets (no buckets from other mods). From the research I've done, I was under the assumption that all fluid buckets are extensions of the ItemBucket class. I assumed incorrectly, didn't I? The second portion is that if my tank has a fluid, I would like to be able to swap out the held (empty) bucket and replace it with a filled bucket of whichever fluid is currently in the tank. I also could not find any useful information concerning this topic. I was assuming with Forge's whole fluid system that these two things would be fairly trivial, but I must have missed something in the process of research. Any help whatsoever would be greatly appreciated. Thank you in advance as usual! :-)
-
[1.7.10] Rendering block in inventory (has a custom render)
I added another if statement, checking if the RenderType was INVENTORY (after seeing that was a thing) and I think I can work from here. Thanks for the help!
-
[1.7.10] Rendering block in inventory (has a custom render)
I have placed a break point in the if-statement in which I am supposedly rendering the item in my inventory, but it does not catch until after I have dropped the item on the ground.
-
[1.7.10] Rendering block in inventory (has a custom render)
Well, that fixed the issue of the item rendering when dropped on the ground (which I expected since we were only using the new class to render the item if the render type was ENTITY), but I still don't have the item being shown in my inventory. (The inventory space still looks blank.) I don't see how to adapt this to fix my issue...
-
[1.7.10] Stop pipes from connecting to my block
I'll be going back and re-writing the code using FluidTank; I actually didn't see that before I (basically finished) my TE. I wouldn't think that you'd have to use mod-specific APIs to keep their pipes from connecting, since most of them don't connect to everything anyway (the ground/non-tank blocks). I mean, ExtraUtilies pipes won't connect to anything that doesn't allow fluids/items in a specific side iirc (for example: Thermal Expansion machines have sides which can be toggled on/off). Maybe I just need to do more digging...
-
[1.7.10] Rendering block in inventory (has a custom render)
Greetings! I have been Googling for a few hours now, but I haven't seemed to be able to find what I'm looking for here. I have a block/TE combination that has a custom render (via the TESR I created for it). I also have been able to render the Item when held by a player (by the use of a class which extends IItemRenderer), but nothing I've tried is able to render the block as an item in my inventory. (I don't have current code to show since I deleted everything that didn't work after multiple attempts). I don't necessarily need the 3D render of the block to show up in the inventory (that would be ideal), but I would like to get some sort of icon there so that the player know what they are holding. Does anyone know of any methods to accomplish this task? (Feel free to point me toward tutorials for this sort of thing that already exists if there are any.) Thanks in advance!
-
[1.7.10] Stop pipes from connecting to my block
I have a class which implements IFluidTank and IFluidHandler. I have it worked out so that fluid can only be piped in/out through the top/bottom of the block, but pipes from other mods still connect to the sides of my tank. Is there something I can do to my block to disallow pipe connections from specific sides? Thank you!
-
[1.7.10] Using Fluid textures for a UV map
Just thought I should post an update here: I simplified my model to have less than 200 vertices and created a Python script to create Tessellator code from the OBJ file. So, in short, I got what I wanted! I have my model that takes on the (animated) texture of any fluid I choose!
-
[1.7.10] Using Fluid textures for a UV map
I was afraid of that...haha. My model has 482 vertices, so I think I'm going to have to simplify it a bit. Thanks for the help, though!
-
[1.7.10] Using Fluid textures for a UV map
Alright. Do you know of any other file types that could be used then? If you don't, that's fine; I'll just have to figure something else out...
-
[1.7.10] Using Fluid textures for a UV map
Maybe I'm not completely clear as to what I'm trying to accomplish: I want my model to be textured with the fluid's texture. I know the fluid's texture is dynamic, but at this point I don't care about having it play its animation when rendered, I just want the entire model to look somewhat like the fluid. As for "draw[ing] the fluid separate from the model", are you implying that I should use the Tessellator to do this? If so, then it's going to be very difficult for me to get my desired effect...
-
[1.7.10] Using Fluid textures for a UV map
I understand that much, I just can't figure out how to do that. I've been using .obj models for my TESR and using bindTexture(texture) method (where texture is a ResourceLocation). What you're saying is to use the TextureMap.locationsBlockTexture as the aforementioned texture, but then to (somehow) use the IIcon u/v info to limit the domain of the map which is being used correct? If so, I can't figure out how this is done. Is there any example I can learn from?
-
[1.7.10] Using Fluid textures for a UV map
I really don't see how IIcon is used in this way. I see that you can get the max/min U/V values from an IIcon, but I still don't understand how to use this in conjunction with the TextureMap in order to extract the specific texture desired. Is there a Vanilla class that does this sort of thing that I could look at for more information?
-
[1.7.10] Using Fluid textures for a UV map
I saw that TextureMap.locationBlocksTexture returns a ResourceLocation (of course), but (correct me if I'm wrong), isn't this a giant map of all block textures in the game? How would I tell the renderer which portion of the map I would like to use to do the actual rendering? Thanks.
-
[1.7.10] Using Fluid textures for a UV map
I know how to grab a fluid's IIcon and use the Tessellator to render this in a GUI, but I can't find any way to bind this as the resource in the bindTexture() method...
-
[1.7.10] Using Fluid textures for a UV map
Greetings! I have been dabbling with the TESR to create some interesting blocks and had an idea. Is it possible to use a fluid's texture (either flowing or still) as the UV map for the renderer? For a dumb example, if I wanted a cube to look like flowing water, is there a way for me to get that (animated) texture information into the ResourceLocation variable I'm using for my TESR? Thank you in advance! :-)
-
[1.7.10] Explosion particles not rendering
Doh...forgot about that class. Thanks for the help!
-
[1.7.10] Explosion particles not rendering
I'm sorry, but I can't for the life of me figure out where world.createExplosion sends a packet. /** * Creates an explosion. Args: entity, x, y, z, strength */ public Explosion createExplosion(Entity p_72876_1_, double p_72876_2_, double p_72876_4_, double p_72876_6_, float p_72876_8_, boolean p_72876_9_) { return this.newExplosion(p_72876_1_, p_72876_2_, p_72876_4_, p_72876_6_, p_72876_8_, false, p_72876_9_); } /** * returns a new explosion. Does initiation (at time of writing Explosion is not finished) */ public Explosion newExplosion(Entity p_72885_1_, double p_72885_2_, double p_72885_4_, double p_72885_6_, float p_72885_8_, boolean p_72885_9_, boolean p_72885_10_) { Explosion explosion = new Explosion(this, p_72885_1_, p_72885_2_, p_72885_4_, p_72885_6_, p_72885_8_); explosion.isFlaming = p_72885_9_; explosion.isSmoking = p_72885_10_; if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this, explosion)) return explosion; explosion.doExplosionA(); explosion.doExplosionB(true); return explosion; } Is it embedded somewhere within the ForgeEventFactory?
-
[1.7.10] Explosion particles not rendering
I've been scanning the EntityCreeper class for hints as to how I would go about doing this, but I can't figure it out. Is there a related class I could look at to help myself out?
-
[1.7.10] Explosion particles not rendering
So here's the snippet inside the entity class which is calling the explosion (which is basically copying the Creeper's code): protected void makeExplosions() { if (!this.worldObj.isRemote) { boolean flag = this.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing"); if (this.getPowered()) { M4thThings.explosionHandler.createExplosion(this.worldObj,this,this.posX,this.posY,this.posZ,(float)(this.radius*2),flag,soundChoice); //this.worldObj.createExplosion(this,this.posX,this.posY,this.posZ,(float)(this.radius * 2), flag); } else { M4thThings.explosionHandler.createExplosion(this.worldObj,this,this.posX,this.posY,this.posZ,(float)this.radius,flag,soundChoice); //this.worldObj.createExplosion(this,this.posX,this.posY,this.posZ,(float)this.radius,flag); } this.setDead(); } } Then here's the ExplosionHandler class which starts creating the explosion (which is adapted from the Vanilla World class object): public class ExplosionHandler { public static M4thCustomExplosion createExplosion(World world,Entity entity, double x, double y, double z, float size, boolean destroyBlocks,int explosionSoundChoice) { return newExplosion(world,entity,x,y,z,size,false,destroyBlocks,explosionSoundChoice); } public static M4thCustomExplosion newExplosion(World world, Entity entity, double x, double y, double z, float size, boolean par9, boolean destroyBlocks,int explosionSoundChoice) { M4thCustomExplosion explosion = new M4thCustomExplosion(world,entity,x,y,z,size); explosion.setExplosionSound(explosionSoundChoice); explosion.isFlaming = par9; explosion.isSmoking = destroyBlocks; if (net.minecraftforge.event.ForgeEventFactory.onExplosionStart(world,explosion)) { return explosion; } explosion.doExplosionA(); explosion.doExplosionB(true); return explosion; } } And then we have the M4thCustomExplosion class which extends the Vanilla Explosion class. The Only method of the superclass that is being overridden is doExplosionB (where the only code that has been altered is the first 15 or so lines): @Override public void doExplosionB(boolean p_77279_1_) { this.worldObj.playSoundEffect(this.explosionX, this.explosionY, this.explosionZ, soundString, soundVolume, soundPitch); if (this.explosionSize >= 2.0F && this.isSmoking) { LogHelper.info("I'm spawning a HUGE explosion particle at " + this.explosionX + ", " + this.explosionY + ", " + this.explosionZ); //try something new EntityFX partExpl = new EntityHugeExplodeFX(this.worldObj,this.explosionX,this.explosionY,this.explosionZ,1.0D,1.0D,1.0D); Minecraft.getMinecraft().effectRenderer.addEffect(partExpl); //this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); } else { LogHelper.info("I'm spawning a large explosion particle at " + this.explosionX + ", " + this.explosionY + ", " + this.explosionZ); this.worldObj.spawnParticle("largeexplode", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); } Iterator iterator; ChunkPosition chunkposition; int i; int j; int k; Block block; if (this.isSmoking) { iterator = this.affectedBlockPositions.iterator(); while (iterator.hasNext()) { chunkposition = (ChunkPosition) iterator.next(); i = chunkposition.chunkPosX; j = chunkposition.chunkPosY; k = chunkposition.chunkPosZ; block = this.worldObj.getBlock(i, j, k); if (p_77279_1_) { double d0 = (double) ((float) i + this.worldObj.rand.nextFloat()); double d1 = (double) ((float) j + this.worldObj.rand.nextFloat()); double d2 = (double) ((float) k + this.worldObj.rand.nextFloat()); double d3 = d0 - this.explosionX; double d4 = d1 - this.explosionY; double d5 = d2 - this.explosionZ; double d6 = (double) MathHelper.sqrt_double(d3 * d3 + d4 * d4 + d5 * d5); d3 /= d6; d4 /= d6; d5 /= d6; double d7 = 0.5D / (d6 / (double) this.explosionSize + 0.1D); d7 *= (double) (this.worldObj.rand.nextFloat() * this.worldObj.rand.nextFloat() + 0.3F); d3 *= d7; d4 *= d7; d5 *= d7; this.worldObj.spawnParticle("explode", (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, (d2 + this.explosionZ * 1.0D) / 2.0D, d3, d4, d5); this.worldObj.spawnParticle("smoke", d0, d1, d2, d3, d4, d5); } if (block.getMaterial() != Material.air) { if (block.canDropFromExplosion(this)) { block.dropBlockAsItemWithChance(this.worldObj, i, j, k, this.worldObj.getBlockMetadata(i, j, k), 1.0F / this.explosionSize, 0); } block.onBlockExploded(this.worldObj, i, j, k, this); } } } }
-
[1.7.10] Explosion particles not rendering
Hello all! I have extended the Explosion base class and am overriding the doExplosionB(boolean b) function. For some reason, the explosion particles are not rendering. This is the code that is being executed: LogHelper.info("I'm spawning a HUGE explosion particle at " + this.explosionX + ", " + this.explosionY + ", " + this.explosionZ); EntityFX partExpl = new EntityHugeExplodeFX(this.worldObj,this.explosionX,this.explosionY,this.explosionZ,1.0D,1.0D,1.0D); Minecraft.getMinecraft().effectRenderer.addEffect(partExpl); //this.worldObj.spawnParticle("hugeexplosion", this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); The LogHelper is printing out to chat, so I know the code is being executed, but the particles just won't render. (The last line which is commented out is what was originally there and also did not work.) Any suggestions as to what I could be doing wrong? (If more code is needed, let me know.) Thanks in advance!
-
[1.7.10] Item renders in hand but not in inventory
Awesome sauce! That worked perfectly! Thanks a ton!
-
[1.7.10] Item renders in hand but not in inventory
I'm not sure the question is clear: I want the item's inventory icon to be changing with the hand-rendered item. The hand-rendered image *is* changing, but the inventory image is not. I have updated my code to reflect what you (McNutty) have said, but the issue still persists as I expected. (The updated code still exists at https://goo.gl/93HpTr.) So, in short, I still have not solution to this issue. Here are two screenshots of the issue if clarification is needed:
IPS spam blocked by CleanTalk.