Jump to content

Recommended Posts

Posted

Hi everyone

 

I am fairly new to modding but know java pretty well. I have been practising basic skills e.g. Creating blocks, Custom Renders, Items, Gui's etc but then i came across particle fx. Ive had a scratch about the mine craft code and made some basic particles.

 

recently i found this video of a mod and decided i wanted to do something similar to it. The video:

 

How would i go about creating Similar like this in which the particle is "projected out" as such and follows the wall line?

 

Thanks if anyone could help me.

Posted

Has anyone done this before? I have a basic particle(copied large smoke) but now i want it so it will float from the walls in the room. The mod i am aiming to design is a mod that adds "ghost" effects using a single block. That block has a gui(completed) that has different selections. I would like it if that block could have particles coming from it and whizzing around the walls similar to the one in the video i posted.

Posted
  On 6/4/2014 at 7:19 AM, CodeLover said:

I thought i would need to override it and add my own but i don't know how i would Implement the movement and i don't know how it would spawn on the walls

 

If you look at the constructor it sets the initial motion and the life of the particles and then the onUpdate() updates the position.  So you would put in what you want -- do you want them to start out in specific directions, move fast or slow, move randomly, move straight or in circles, etc.

 

And to spawn on the walls you just need to set their initial position to be where the wall is.  Whether or not the wall is easy to detect would depend on whether the size and shape of the room is already expected to be a certain way or whether you want your particles to be smart enough to go around any shape and size of room.

 

However, I looked at that video you posted again and it is possible that they did not use particles.  They may just be doing some sort of render effect.

 

Anyway, I think it would be possible for the disco ball in that example to have a TileEntity associated which is controlling the effect.  In fact, if you keep track of the particles that are created, the TileEntity itself should be able to update the position.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted
  On 6/4/2014 at 10:23 PM, jabelar said:

  Quote

I thought i would need to override it and add my own but i don't know how i would Implement the movement and i don't know how it would spawn on the walls

 

If you look at the constructor it sets the initial motion and the life of the particles and then the onUpdate() updates the position.  So you would put in what you want -- do you want them to start out in specific directions, move fast or slow, move randomly, move straight or in circles, etc.

 

And to spawn on the walls you just need to set their initial position to be where the wall is.  Whether or not the wall is easy to detect would depend on whether the size and shape of the room is already expected to be a certain way or whether you want your particles to be smart enough to go around any shape and size of room.

 

However, I looked at that video you posted again and it is possible that they did not use particles.  They may just be doing some sort of render effect.

 

Anyway, I think it would be possible for the disco ball in that example to have a TileEntity associated which is controlling the effect.  In fact, if you keep track of the particles that are created, the TileEntity itself should be able to update the position.

 

I downloaded this mod to play with some mates and found that the classes to do with the Block are as followed:

BlockClass

and a TileEntityBlockClass

(I can't quite remember what they were named)

 

How would i achieve a similar effect with the tile entity because i have never seen anything like this before.

 

EDIT: I have opened the class file to try and see what is going on. This is it:

package maaatin.disco;

import abw;
import asp;
import asx;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.Random;

public class TileEntityDiscoBall extends asp
{
  public int lightsPerRow;
  public int height;
  public int resolution;
  public double[][][] possibleLightCoords;
  public int[][] orientations;
  public double[][][] allLightXCoordinates;
  public double[][][] allLightYCoordinates;
  public double[][][] allLightZCoordinates;
  public int[][][] allOrientations;
  public int lightRange;
  public double angle;
  public boolean initialized;
  public int[][] rand;
  public int counter;
  public double orientationAngle;
  public int speed;

  public TileEntityDiscoBall()
  {
    this.lightsPerRow = 16;
    this.height = 9;
    this.resolution = 300;

    this.possibleLightCoords = new double[3][this.resolution][this.height];
    this.orientations = new int[this.resolution][this.height];

    this.allLightXCoordinates = new double[this.lightsPerRow][this.height][this.resolution];
    this.allLightYCoordinates = new double[this.lightsPerRow][this.height][this.resolution];
    this.allLightZCoordinates = new double[this.lightsPerRow][this.height][this.resolution];
    this.allOrientations = new int[this.lightsPerRow][this.height][this.resolution];

    this.lightRange = 16;
    this.angle = 0.0D;

    this.initialized = false;

    this.rand = new int[60][60];

    this.speed = 100;
  }

  public void h()
  {
    if (!this.initialized)
    {
      initialize();
    }
  }

  @SideOnly(Side.CLIENT)
  public asx getRenderBoundingBox()
  {
    return INFINITE_EXTENT_AABB;
  }

  public void initialize()
  {
    boolean stopLoop = false;
    for (int h = 1; h < this.height; h++)
    {
      if ((!this.k.c(this.l, this.m - h, this.n)) && (!stopLoop))
      {
        this.height = h;
        stopLoop = true;
      }
    }

    for (int h = 0; h < this.height; h++)
    {
      for (int i = 0; i < this.lightsPerRow; i++)
      {
        this.rand[i][h] = this.k.s.nextInt(this.resolution / 10);
      }

    }

    for (int h = 0; h < this.height; h++)
    {
      this.counter = (this.resolution - 1);
      this.angle = 0.0D;
      for (int i = this.resolution - 1; i >= 0; i--)
      {
        getCoords(this.l + 0.5D, this.m + 0.5D - h, this.n + 0.5D, this.k, this.angle, h);
        this.angle += 3.141592653589793D / (this.resolution / 2.0D);
        this.counter -= 1;
      }
    }

    for (int h = 0; h < this.height; h++)
    {
      for (int i = 0; i < this.lightsPerRow; i++)
      {
        for (int j = 0; j < this.resolution; j++)
        {
          this.allLightXCoordinates[i][h][j] = this.possibleLightCoords[0][((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h];
          this.allLightYCoordinates[i][h][j] = this.possibleLightCoords[1][((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h];
          this.allLightZCoordinates[i][h][j] = this.possibleLightCoords[2][((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h];

          this.allOrientations[i][h][j] = this.orientations[((j + (this.rand[i][h] + this.resolution * i / this.lightsPerRow)) % this.resolution)][h];
        }
      }
    }

    this.initialized = true;
  }

  public void getCoords(double x, double y, double z, abw world, double angle, int h)
  {
    boolean coordinateFilled = false;

    for (int i = 1; i < this.lightRange; i++)
    {
      if ((!coordinateFilled) && (!world.c(truncateDoubleToInt(x + i * Math.cos(angle)), (int)y, truncateDoubleToInt(z + i * Math.sin(angle)))))
      {
        if (world.c(truncateDoubleToInt(x + (i - 0.1D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.1D) * Math.sin(angle))))
        {
          fillCoords(0.1D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.2D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.2D) * Math.sin(angle))))
        {
          fillCoords(0.2D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.3D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.3D) * Math.sin(angle))))
        {
          fillCoords(0.3D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.4D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.4D) * Math.sin(angle))))
        {
          fillCoords(0.4D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.5D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.5D) * Math.sin(angle))))
        {
          fillCoords(0.5D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.6D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.6D) * Math.sin(angle))))
        {
          fillCoords(0.6D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.7D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.7D) * Math.sin(angle))))
        {
          fillCoords(0.7D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.8D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.8D) * Math.sin(angle))))
        {
          fillCoords(0.8D, x, y, z, i, h);
        }
        else if (world.c(truncateDoubleToInt(x + (i - 0.9D) * Math.cos(angle)), (int)y, truncateDoubleToInt(z + (i - 0.9D) * Math.sin(angle))))
        {
          fillCoords(0.9D, x, y, z, i, h);
        }
        else
        {
          fillCoords(1.0D, x, y, z, i, h);
        }

        coordinateFilled = true;
      }
    }
  }

  public void fillCoords(double j, double x, double y, double z, int i, int h)
  {
    this.possibleLightCoords[0][this.counter][h] = (x + (i - j) * Math.cos(this.angle));
    this.possibleLightCoords[1][this.counter][h] = y;
    this.possibleLightCoords[2][this.counter][h] = (z + (i - j) * Math.sin(this.angle));

    this.orientations[this.counter][h] = getOrientation(this.possibleLightCoords[0][this.counter][h], this.possibleLightCoords[1][this.counter][h], this.possibleLightCoords[2][this.counter][h]);
  }

  public int getOrientation(double x, double y, double z)
  {
    this.orientationAngle = 0.0D;

    for (int i = 0; i < 4; i++)
    {
      double j = 0.2D;

      if (!this.k.c(truncateDoubleToInt(x + j * Math.cos(this.orientationAngle)), truncateDoubleToInt(y), truncateDoubleToInt(z + j * Math.sin(this.orientationAngle))))
      {
        return i;
      }

      this.orientationAngle += 1.570796326794897D;
    }

    return 0;
  }

  public static int truncateDoubleToInt(double par0)
  {
    return (int)(par0 + 1024.0D) - 1024;
  }
}

 

Now i this abw is World. asp is TileEntity and asx is maybe Block.

I cannot see how this is working just due to the lack of methods actually listed.

 

 

Posted

Look up examples of EntityFX tutorials.

 

The EntityFX will be your custom particle.  It will only reside on the client.

 

What I have done is create a packet class, where my server can say where to generate a particle.  You specifcy a name, location, motion.  I suggest only sending the particle to the world of interest.  You could try area around, but I stuck with world.

 

On the client side, it takes that and if the name is for one of my customFX particles, it generates it for the clients.  If it is a minecraft basic, it generates it as well.

 

 

This has served me well in my mods.

 

 

Long time Bukkit & Forge Programmer

Happy to try and help

Posted

The disco ball is a TileEntity which is just fancy way of saying a block that executes logic.  All that codes seems to obviously be calculating the positions of the little lights.  I suppose that those could positions could be used to control particles but it isn't clear since there is no mention of particles in the code you showed.  It could still be some sort of render effect.

 

Anyway, let's go back to what you want to do -- make some ghostly smoke come from some blocks.  The main point is that you should have a TileEntity somewhere (I assume that would be your custom block you mentioned that already has a guy) that searches for the blocks you care about (the walls) and then creates the effect with your particles. 

 

There are probably several ways to do this, but basically your TileEntity just needs to do a "search" around itself to find where the blocks that form the walls are, and then you just control the particle position according to what you find.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

If he just wants smoke particles out of block, that could be done without a tilentity.

Long time Bukkit & Forge Programmer

Happy to try and help

  • 3 weeks later...
Posted

I have been trying for a while now to get a similar effect but with just white squares or grey squares and i couldn't figure it out. Could someone pls run me through this?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Temu  bunch of Coupon Codes for Temu  to get FTemuREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!   Temu  coupon codes for New users 100€ Off - acy240173 Temu  discount code for New customers- acy240173 Temu  100€ coupon code- acy240173 what are Temu  codes - acy240173  does Temu  give you €300- acy240173 Yes Verified Temu  coupon code October2025- acy240173 Temu  New customer offer acy240173 Temu  discount code2025 acy240173 100 off coupon code Temu  acy240173 Temu  100 off any order acy240173 100 dollar off Temu  code acy240173 Temu  Coupon Code ( acy240173 ) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173 ) or ( acy240173 ). Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173 ) at checkout!! Temu  coupon code for First Order - {acy240173} Temu  coupon code for New Users- {acy240173} Temu  coupon code for Existing Users- {acy240173} Temu  coupon code 100€ Off- {acy240173} Temu  coupon 30% Off code - {acy240173} - Temu  new user coupon code: acy240173 - Free gift on Temu : acy240173 - Temu  90% discount coupon code: acy240173 - Temu  100€ coupon code for first order: acy240173   Is the Temu  100€ Coupon Legit?  Yes, there are several legit Temu  coupon codes [ acy240173] available for 100€ off. Here are the options you can use: Code [acy240173]: This code provides a 100€ discount legit on your first order when you register and is reported to work effectively during checkout. Code [acy240173]: New users can also use this code to receive a 100€ discount on purchases over €249. Code [acy240173]: This code is available for both new and existing users, offering a 100€ discount on your order. Code [acy240173]: Another option for both new and existing users, this code allows you to save 100€ on your purchase.   Temu  Coupon code 100€ off for this month For October2025, several active Temu  coupon codes can help you save on your purchases: 40% Off Site-Wide: Use code "acy240173" to get 40% off everything. This code is widely used and verified for site-wide discounts on orders over €20. 40€ Off for New Customers: New customers can receive a €20 voucher by downloading the Temu  app and participating in an H5 page game. This voucher can be redeemed using a specific coupon “acy240173”. 40% Off Selected Items: There is also a 40% off coupon “acy240173” available for select items on the Temu  website. Remember to check the specific terms and conditions for each coupon, such as minimum purchase requirements and applicable product categories.   Temu  coupon code 100€ off for new and existing customer Temu  90% OFF promo code "acy240173 " will save you 100€ on your order. To get a discount, click on the item to purchase and enter the code. Yes, Temu  offers 100€ off coupon code [acy240173] Temu  Coupon code [acy240173 ] for existing users can get up to 50% discount on product during checkout. Temu  Coupon Codes for Existing Customers-[acy240173 ] Temu  values its loyal customers and offers various promo codes, including the Legit Temu  Coupon Code [acy240173 ] or [acy240173 ], which existing users can use. This ensures that repeat shoppers can also benefit from significant discounts on their purchases. Keep an eye out for special promotions and offers that are periodically available to enhance your shopping experience.   Temu  Coupon Code 100€ Off for all users  There are specific Temu  coupon codes [acy240173] mentioned for South Africa in the provided search results. The results focus on general Temu  coupon codes [acy240173] and discounts, as well as codes for other countries like the Germany, UK, Canada, Mexico, Kuwait, Austria, Italy, Australia, France , Switzerland, Poland, Saudi Arabia, Germany, Sweden, Portugal, New Zealand, UAE, Belgium, Germany, and France.   Temu  Coupon Code 30% Off: acy240173 Temu  Coupon Code 100€ Off: acy240173 Temu  Coupon Code 100€ Off United States : acy240173 Temu  Coupon Code 100€ Off Germany: acy240173 Temu  Coupon Code 100€ Off Sweden : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 50% : acy240173 Temu  Coupon Code 100€ Off United Kingdom : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Italy : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Belgium : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Canada : acy240173 Temu  Coupon Code 100€ Off : acy240173 Temu  Coupon Code 100€ Off Estonia : acy240173 Temu  Coupon Code 100€ Off Switzerland : acy240173 Temu  Coupon Code  100€ Off : acy240173 Temu  Coupon 30% Off + Free Shipping & More There are a bunch of Coupon Codes for Temu  to get FREE GIFTS, DISCOUNTS, SAVINGS, and MORE. Check out below and download the Temu  app now !!! Temu  Coupon Code ( acy240173) 30% Off + 100€ OFF in Coupons + Free Shipping + More for Temu  NEW / EXISTING Users. Get 100€ OFF in Coupons + 30% OFF + More; Temu  promo code (acy240173) \ Temu  Sitewide Sales up to 95% OFF sitewide. Temu  30% Off and 100€ Off in Coupons for NEW and EXISTING users. Use promo code ( acy240173) at checkout!!Temu  Coupon Code Mexico : acy240173 Temu  Coupon Code 100€ Off Ireland : acy240173 Temu  Coupon Code 100€ Off Norway: acy240173 Temu  Coupon Code 100€ Off New Zealand : acy240173 Temu  Coupon Code 100€ Off Poland : acy240173 Temu  Coupon Code 100€ Off Serbia : acy240173 Temu  Coupon Code 100€ Off Armenia : acy240173 Temu  Coupon Code 100€ Off Austria : acy240173 Temu  Coupon Code 100€ Off Greece : acy240173 Temu  Coupon Code 100€ Off Japan : acy240173 Temu  Coupon Code 100€ Off Iceland : acy240173 Temu  Coupon Code 100€ Off Bahrain : acy240173 Temu  Coupon Code 100€ Off Philippines : acy240173 Temu  Coupon Code 100€ Off Portugal : acy240173 Temu  Coupon Code 100€ Off Romania: acy240173 Temu  Coupon Code 100€ Off Slovakia : acy240173 Temu  Coupon Code 100€ Off Malta: acy240173 Temu  Coupon Code 100€ Off France  : acy240173 Temu  Coupon Code 100€ Off South Africa : acy240173 Temu  Coupon Code 100€ Off Hungary : acy240173 Temu  Coupon Code 100€ Off Brazil : acy240173 Temu  Coupon Code 100€ Off Finland : acy240173 Temu  Coupon Code 100€ Off Morocco : acy240173 Temu  Coupon Code 100€ Off Kazakhstan : acy240173 Temu  Coupon Code 100€ Off Colombia : acy240173 Temu  Coupon Code 100€ Off Chile : acy240173 Temu  Coupon Code 100€ Off Israel : acy240173 Temu  Coupon Code 100€ Off Qatar: acy240173 Temu  Coupon Code 100€ Off Slovenia : acy240173 Temu  Coupon Code 100€ Off Uruguay : acy240173 Temu  Coupon Code 100€ Off Latvia: acy240173 Temu  Coupon Code 100€ Off Jordan : acy240173 Temu  Coupon Code 100€ Off Ukraine : acy240173 Temu  Coupon Code 100€ Off Moldova : acy240173 Temu  Coupon Code 100€ Off Oman: acy240173 Temu  Coupon Code 100€ Off Mauritius : acy240173 Temu  Coupon Code 100€ Off Republic of Korea : acy240173 Temu  Coupon Code 100€ Off Dominican Republic: acy240173 Temu  Coupon Code 100€ Off Czech Republic : acy240173 Temu  Coupon Code 100€ Off United Arab Emirates : acy240173 Temu  Coupon Code 100€ Off Peru : acy240173 Temu  Coupon Code 100€ Off Azerbaijan : acy240173 Temu  Coupon Code 100€ Off Saudi Arabia : acy240173 Temu  Coupon Code 100€ Off Croatia : acy240173   Conclusion The Temu  Coupon Code 100€ Off "acy240173" provides a significant discount of 100€ for users in Bahrain. This offer is available for both new and existing customers, allowing them to save substantially on their purchases.In addition to the 100€ discount, customers can also enjoy a 50% off on their orders. To redeem this coupon, simply sign up for a Temu  account, add items worth 100€ or more to your cart, and enter the code during checkout to apply the discounts automatically.   FAQs about the 100€ Off Coupon Code Q1: Who can use the 100€ off coupon? A: The coupon is available for both new and existing users, although different codes may apply to each group. Q2: Can multiple coupon codes be used at once? A: Generally, only one coupon code can be applied per transaction. However, some codes may offer bundled benefits. Q3: Do these coupons expire? A: Many Temu  coupons do not have an expiration date, making them convenient for users to redeem at their leisure. Q4: Are there specific conditions for using these coupons? A: Yes, some coupons may require a minimum purchase amount or specific item categories to be eligible for the discount. Q5: How can I find the latest Temu  Coupon Code 100€ Off 100€ Offs? A: Users can check within their account under "Coupons & offers" or look for updates on promotional websites and forums.
    • You could try this script: https://inconnu-plugins.de/tutorial/server-auto-restart
    • I have already tried other versions of MCP, from 2841 to 2860.
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • The official documentation says next to nothing and I have had no success finding reference snippets (e.g. minimap mods and other stuff that involves directly drawing to the screen). Google searches and GPT outputs reference deprecated and/or removed content from older versions. Legends speak of a layered rendering system that also has next to no documentation. Any help is appreciated. Even drawing just a single pixel is enough.
  • Topics

×
×
  • Create New...

Important Information

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