Jump to content

DrZhark

Members
  • Posts

    9
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

DrZhark's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Thanks Nuchaz it worked. I had to replace some parameters on the addVertexWithUV, as the previous code was calculating the particle coordinates within the particles.png sheet, and binding a single texture wouldn't need that. I'm showing the code for others to profit: @Override public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { //func_98187_b() = bindTexture(); FMLClientHandler.instance().getClient().renderEngine.func_98187_b("/mods/mocreatures/textures/misc/FXvanish.png"); float scale = 0.1F * this.particleScale; float xPos = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX); float yPos = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); float zPos = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); float colorIntensity = 1.0F; par1Tessellator.setColorOpaque_F(this.particleRed * colorIntensity, this.particleGreen * colorIntensity, this.particleBlue * colorIntensity);//, 1.0F); par1Tessellator.addVertexWithUV((double) (xPos - par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos - par5 * scale - par7 * scale), 0D, 1D); par1Tessellator.addVertexWithUV((double) (xPos - par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos - par5 * scale + par7 * scale), 1D, 1D); par1Tessellator.addVertexWithUV((double) (xPos + par3 * scale + par6 * scale), (double) (yPos + par4 * scale), (double) (zPos + par5 * scale + par7 * scale), 1D, 0D); par1Tessellator.addVertexWithUV((double) (xPos + par3 * scale - par6 * scale), (double) (yPos - par4 * scale), (double) (zPos + par5 * scale - par7 * scale), 0D, 0D); }
  2. Hi I'm on the slow painful process of updating my mod, I can't seem to find a way to render custom particles as before, as the ForgeHooksClient.bindTexture has been removed and I don't see any hooks on the RenderGlobal.class Anyone can please enlighten me? @SideOnly(Side.CLIENT) public class MoCEntityFXStar extends EntityFX { /** * sets which texture to use (2 = items.png) */ @Override public int getFXLayer() { return 2; } @Override public String getTexture() { return "/mocreatures/items.png"; } @Override public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { ForgeHooksClient.bindTexture(getTexture(), 0); float var8 = (float) (this.getParticleTextureIndex() % 16) / 16.0F; float var9 = var8 + 0.0624375F; float var10 = (float) (this.getParticleTextureIndex() / 16) / 16.0F; float var11 = var10 + 0.0624375F; float var12 = 0.1F * this.particleScale; float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX); float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY); float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ); float var16 = 1.2F - ((float) Math.random() * 0.5F); par1Tessellator.setColorOpaque_F(this.particleRed * var16, this.particleGreen * var16, this.particleBlue * var16); par1Tessellator.addVertexWithUV((double) (var13 - par3 * var12 - par6 * var12), (double) (var14 - par4 * var12), (double) (var15 - par5 * var12 - par7 * var12), (double) var9, (double) var11); par1Tessellator.addVertexWithUV((double) (var13 - par3 * var12 + par6 * var12), (double) (var14 + par4 * var12), (double) (var15 - par5 * var12 + par7 * var12), (double) var9, (double) var10); par1Tessellator.addVertexWithUV((double) (var13 + par3 * var12 + par6 * var12), (double) (var14 + par4 * var12), (double) (var15 + par5 * var12 + par7 * var12), (double) var8, (double) var10); par1Tessellator.addVertexWithUV((double) (var13 + par3 * var12 - par6 * var12), (double) (var14 - par4 * var12), (double) (var15 + par5 * var12 - par7 * var12), (double) var8, (double) var11); } }
  3. Hmm tried with your suggestion, but the creepers still spawn.
  4. Hi I'm currently on Forge 4.2.5 I'm trying to control the spawn of vanilla mobs, using: EntityRegistry.removeSpawn(EntityCreeper.class, EnumCreatureType.monster); this used to work without issues with ModLoader: ModLoader.removeSpawn(EntityCreeper.class, EnumCreatureType.monster); However the entities are still spawning. I'm even calling that command frequently (every time after exiting menus)... any ideas?
  5. As I'm porting my mod to Forge, the mod now has its own package package.drzhark.mocreatures; import net.minecraft.src.*; There are many places in my code where I need to access or change the value of a protected variable, i.e entitymob.entityToAttack in the following method: public static void repelMobs(Entity entity1, Double dist, World worldObj) { List list = worldObj.getEntitiesWithinAABBExcludingEntity(entity1, entity1.boundingBox.expand(dist, 4D, dist)); for(int i = 0; i < list.size(); i++) { Entity entity = (Entity) list.get(i); if(!(entity instanceof EntityMob)) { continue; } EntityMob entitymob = (EntityMob) entity; entitymob.entityToAttack = null; entitymob.setPathToEntity(null); } } However that variable entityToAttack is now unaccessible from my package, as it is a protected variable that does not have a Getter/Setter. Is there a way around this? I guess it could be done with reflection (which I'm not too familiar with). Or if there is an easier way, I'm all ears. Thanks in advance!
  6. @Hobos Thanks I found out that @SideOnly(Side.CLIENT) works fine. I'll work around things with that
  7. Thanks for your help... However I'm still stuck. @vroominator didn't work @keepcalm using this: if (FMLCommonHandler.getEffectiveSide() == Side.CLIENT) gives me the following error message, so it doesn't compile Cannot make a static reference to the non-static method getEffectiveSide() from the type FMLCommonHandler also using @SideOnly(Side="CLIENT") gives me the following error: The annotation @SideOnly must define the attribute value
  8. Hi I'm updating Mo'Creatures. Some of my creatures do mountEntity(entityplayer), like the bunnies and birds. So when the player right clicks on the entity, the entity mounts the player. However with the new code I've noticed that the interact method seems to be called twice, I'm assuming once for client and once for server. So when the player interacts with these creatures, they mount and then rapidly unmount the player. Any ideas for workarounds? @Override public boolean interact(EntityPlayer entityplayer) { if (this.riddenByEntity == null) { mountEntity(entityplayer); } return true; }
×
×
  • Create New...

Important Information

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