Jump to content

Draco18s

Members
  • Posts

    16559
  • Joined

  • Last visited

  • Days Won

    156

Everything posted by Draco18s

  1. I'm trying to get a particle to render in front of everything (i.e. blocks) but it's not working. public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { //skipping various variable setup, texture binding, etc. //turn off z-buffer GL11.glDepthFunc(GL11.GL_ALWAYS); par1Tessellator.setColorRGBA_F(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha); par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9); par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8); par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8); par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9); //set z-buffer back to normal GL11.glDepthFunc(GL11.GL_LEQUAL); } From what I understand, this should work. But it doesn't. If I remove the GL11.glDepthFunc(GL11.GL_LEQUAL); line, things do render as expected (i.e. I can see the lava at the bottom of the world, as the depth buffer is ignored). Here's one of the particles showing it being rendered half inside a block, but not fully visible: http://s7.postimg.org/r5dwbeggb/2014_01_13_13_19_36.png[/img]
  2. More information required. Possibly code.
  3. MultiMC 5 should work. MultiMC 4 would not, as locations of files have changed (they're no longer hosted on Amazon's cloud services).
  4. One of the warnings that exists looks like this: if(entity instanceof EntityZombie) { par2 = par2; } It does nothing, but that's what exists inside Mojang's code. We aren't sure what they meant to do there, and thus the warning sticks around.
  5. It appears that you are trying to specify block and item IDs. You don't need those. You should not even be aware that they exist.
  6. The new one would then throw its OWN EntityJoinWorldEvent, which would be bad. You'd be better off modifying the properties of the one that joined the world.
  7. Do this: System.out.println(event.entity); if(event.entity instanceof EntityXPOrb) That'll tell you what's going on.
  8. This is a really old block (like 1.5 or before) but I had the same problem and solved it. I thought that was it, but see if this helps you at all. package draco18s.micromods.peephole; import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockPeepHole extends Block { public BlockPeepHole(int par1, int par2, Material par3Material) { super(par1, par2, par3Material); this.setBlockName("Peephole"); setHardness(1.0F); setResistance(5.0F); setStepSound(soundStoneFootstep); setCreativeTab(CreativeTabs.tabBlock); setLightOpacity(0); } public String getTextureFile() { return CommonProxy.BLOCKS_PNG; } public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { int var6 = world.getBlockMetadata(x, y, z); switch(var6) { case 1: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); break; case 2: this.setBlockBounds(0.0F, 0.0F, 0.9375F, 1.0F, 1.0F, 1.0F); break; case 3: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.0625F); break; case 4: this.setBlockBounds(0.9375F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 5: this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.0625F, 1.0F, 1.0F); break; case 6: this.setBlockBounds(0.0F, 0.9375F, 0.0F, 1.0F, 1.0F, 1.0F); break; case 0: case 7: this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); break; } } public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return null; } public void onBlockAdded(World par1World, int par2, int par3, int par4) { super.onBlockAdded(par1World, par2, par3, par4); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setDefaultDirection(par1World, par2, par3, par4); this.onNeighborBlockChange(par1World, par2, par3, par4, this.blockID); } private void setDefaultDirection(World par1World, int par2, int par3, int par4) { if (!par1World.isRemote) { int var5 = par1World.getBlockId(par2, par3, par4 - 1); int var6 = par1World.getBlockId(par2, par3, par4 + 1); int var7 = par1World.getBlockId(par2 - 1, par3, par4); int var8 = par1World.getBlockId(par2 + 1, par3, par4); int var10 = par1World.getBlockId(par2, par3-1, par4); int var11 = par1World.getBlockId(par2, par3+1, par4); byte var9 = 7; if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6]) { var9 = 3; } if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5]) { var9 = 2; } if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8]) { var9 = 5; } if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7]) { var9 = 4; } if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11]) { var9 = 1; } if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10]) { var9 = 6; } int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0); if(var99 > 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 7); } else { par1World.setBlockMetadataWithNotify(par2, par3, par4, var9); } } } public int getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { int var6 = par1IBlockAccess.getBlockMetadata(par2, par3, par4); if(var6 == 0 || var6 == 7) { return this.blockIndexInTexture+1; } else if(var6 == 6) { var6 = 0; } return par5 != var6 ? this.blockIndexInTexture+1:this.blockIndexInTexture; } public boolean isOpaqueCube() { return true; } public boolean renderAsNormalBlock() { return false; } public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.4375F, 1.0F, 1.0F, 0.5F); } public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { //int var6 = par1World.getBlockMetadata(par2, par3, par4); boolean var7 = canPlaceBlockAt(par1World, par2, par3, par4); if (!var7) { this.dropBlockAsItem(par1World, par2, par3, par4, 0, 0); par1World.setBlockWithNotify(par2, par3, par4, 0); } super.onNeighborBlockChange(par1World, par2, par3, par4, par5); } public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4) { int var5 = par1World.getBlockId(par2, par3, par4 - 1); int var6 = par1World.getBlockId(par2, par3, par4 + 1); int var7 = par1World.getBlockId(par2 - 1, par3, par4); int var8 = par1World.getBlockId(par2 + 1, par3, par4); int var10 = par1World.getBlockId(par2, par3-1, par4); int var11 = par1World.getBlockId(par2, par3+1, par4); /*if (var5 == blockID || var6 == blockID || var7 == blockID || var8 == blockID || var10 == blockID || var11 == blockID) { return false; }*/ byte var9 = 7; if ((var5 != blockID && Block.opaqueCubeLookup[var5]) && !Block.opaqueCubeLookup[var6]) { var9 = 3; } if ((var6 != blockID && Block.opaqueCubeLookup[var6]) && !Block.opaqueCubeLookup[var5]) { var9 = 2; } if ((var7 != blockID && Block.opaqueCubeLookup[var7]) && !Block.opaqueCubeLookup[var8]) { var9 = 5; } if ((var8 != blockID && Block.opaqueCubeLookup[var8]) && !Block.opaqueCubeLookup[var7]) { var9 = 4; } if ((var10 != blockID && Block.opaqueCubeLookup[var10]) && !Block.opaqueCubeLookup[var11]) { var9 = 1; } if ((var11 != blockID && Block.opaqueCubeLookup[var11]) && !Block.opaqueCubeLookup[var10]) { var9 = 6; } if (var9 == 7) { return false; } int var99 = ((var5 != blockID && Block.opaqueCubeLookup[var5])?1:0) + ((var6 != blockID && Block.opaqueCubeLookup[var6])?1:0) + ((var7 != blockID && Block.opaqueCubeLookup[var7])?1:0) + ((var8 != blockID && Block.opaqueCubeLookup[var8])?1:0) + ((var10 != blockID && Block.opaqueCubeLookup[var10])?1:0) + ((var11 != blockID && Block.opaqueCubeLookup[var11])?1:0); if (var99 != 1) { return false; } return true; } }
  9. Ah here we are. You need to override getCollisionBoundingBoxFromPool. You'll have to work out what bounding box you need, but the syntax looks like this: public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4) { return AxisAlignedBB.getAABBPool(xmin, ymin, zmin, xmax, ymax, zmax); }
  10. Use Java 7. Because J6 is end-of-lifed there's no reason for people to still have it.
  11. I've run into this, and every time I have it's a pain in the ass to fix. I'll try and find the solution...
  12. Lets see... public String getArmorTexture(ItemStack itemstack, Entity entity, int slot, String type) { if (itemstack == new ItemStack(Your item)) { return "more:textures/models/armor/Your.png"; } return "more:textures/models/armor/Your.png"; } So first off you have an if statement checking to see if the item stack passed to this function is the same as a new item stack of this item. Under the assumption that == actually works here, that will always return true. Except that == doesn't work that was for complex data types (like ItemStack) and will always return false. Second, both returns are identical, making the if-statement redundant. The only reason it "works for you" is because the default return statement is correct for you. Here's a REAL function that DOES something USEFUL. @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { //slot will tell us helmet vs. boots //type will be either null or overlay (cloth armor) //can use stack.stackTagCompound.getString("matName") for material, etc. String layer = "1"; String material = stack.stackTagCompound.getString("matName").toLowerCase(); if(type == null) { type = ""; //all type use the same base texture (which is colorized) material = "iron"; } if(slot == 2) { layer="2"; } return "artifacts:textures/models/armor/"+material+"_layer_"+layer+type+".png"; }
  13. No. I haven't messed with chat formatting in chat strings, only addInformation() which doesn't support newlines.
  14. His problem is that it isn't effecting the whole string, it's only effecting until a new-line.
  15. Messing around with Utility Mobs for my own purposes, I mucked about with Toast's custom arrow class to allow multiple arrows to hit a single target. That would also work. Duplicate the arrow, then when it deals damage just set the entity's hurtTime (hurtResistanceTime?) to 0.
  16. More efficient code: this.currentPower += power; Usually the two compile to the same thing. += is faster to type though.
  17. You need to tweak fml.py to have different URLs. Here's my fml.py that worked for Forge 871 (its basically the same as the last non-gradle 1.6.4) so it should work for you.
  18. GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); You mean this? I already had this. Not a solution... Then either: a) meta isn't getting set correctly b) meta is getting 0'd somewhere c) you aren't reading the meta correctly
  19. Is, or is not, your thread titled "change player height"? If it is, what the fuck do you mean by that? If it isn't it sure looks like it to me!
×
×
  • Create New...

Important Information

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