Skip to content

Commit

Permalink
final dust color transistion type name
Browse files Browse the repository at this point in the history
  • Loading branch information
Fierioziy committed Jun 20, 2021
1 parent f7c7734 commit 3b2367d
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface ParticleNativeAPI {
/**
* <p>Gets instance of <code>ServerConnection</code>.</p>
*
* This method will throw <code>ParticleException</code> if class
* <p>This method will throw <code>ParticleException</code> if class
* generation failed (by a plugin).</p>
*
* @return a valid <code>ServerConnection</code> instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public interface Particles_1_13 extends ServerConnection {
// 1.17
ParticleType LIGHT();

ParticleTypeDustTransition DUST_COLOR_TRANSITION();
ParticleTypeDustColorTransition DUST_COLOR_TRANSITION();
ParticleTypeVibration VIBRATION();

ParticleType FALLING_SPORE_BLOSSOM();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @see ParticleType
*/
public class ParticleTypeDustTransition {
public class ParticleTypeDustColorTransition {

/**
* <p>Selects a color this particle should get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class ParticleTypeVibration {
* spawn 1 vibration particle at specified position
* flying toward target position.</p>
*
* <p>Currently, positions are aligned to block centers.</p>
*
* <p>Parameters are not validated in any way.</p>
*
* <p>It is wise to check, if particle is supported by current Spigot version
Expand Down Expand Up @@ -47,6 +49,8 @@ public Object packet(boolean far, Location loc, Location target, int ticks) {
* spawn 1 vibration particle at specified position
* flying toward target position.</p>
*
* <p>Currently, positions are aligned to block centers.</p>
*
* <p>Parameters are not validated in any way.</p>
*
* <p>It is wise to check, if particle is supported by current Spigot version
Expand Down Expand Up @@ -75,6 +79,8 @@ public Object packet(boolean far, Location loc, Vector target, int ticks) {
* spawn 1 vibration particle at specified position
* flying toward target position.</p>
*
* <p>Currently, positions are aligned to block centers.</p>
*
* <p>Parameters are not validated in any way.</p>
*
* <p>It is wise to check, if particle is supported by current Spigot version
Expand Down Expand Up @@ -103,6 +109,8 @@ public Object packet(boolean far, Vector loc, Location target, int ticks) {
* spawn 1 vibration particle at specified position
* flying toward target position.</p>
*
* <p>Currently, positions are aligned to block centers.</p>
*
* <p>Parameters are not validated in any way.</p>
*
* <p>It is wise to check, if particle is supported by current Spigot version
Expand Down Expand Up @@ -131,6 +139,8 @@ public Object packet(boolean far, Vector loc, Vector target, int ticks) {
* spawn 1 vibration particle at specified position
* flying toward target position.</p>
*
* <p>Currently, positions are aligned to block centers.</p>
*
* <p>Parameters are not validated in any way.</p>
*
* <p><b>This method is overridden by dynamically generated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@


@RunWith(MockitoJUnitRunner.class)
public class ParticleTypeDustTransitionTest {
public class ParticleTypeDustColorTransitionTest {

@Spy
private ParticleTypeDustTransition invalidParticleType = new ParticleTypeDustTransition();
private ParticleTypeDustColorTransition invalidParticleType = new ParticleTypeDustColorTransition();

@Spy
private ParticleTypeDustTransition particleType = new ParticleTypeDustTransition();
private ParticleTypeDustColorTransition particleType = new ParticleTypeDustColorTransition();

@Before
public void prepareParticleType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class BaseASM implements Opcodes {
protected static Type particleTypeColorable = Type.getType(ParticleTypeColorable.class);
protected static Type particleTypeMotion = Type.getType(ParticleTypeMotion.class);
protected static Type particleTypeDust = Type.getType(ParticleTypeDust.class);
protected static Type particleTypeDustTransition = Type.getType(ParticleTypeDustTransition.class);
protected static Type particleTypeDustTransition = Type.getType(ParticleTypeDustColorTransition.class);
protected static Type particleTypeItemMotion = Type.getType(ParticleTypeItemMotion.class);
protected static Type particleTypeNote = Type.getType(ParticleTypeNote.class);
protected static Type particleTypeRedstone = Type.getType(ParticleTypeRedstone.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ else if (particleType instanceof ParticleTypeItemMotion) {
else if (particleType instanceof ParticleTypeDust) {
((ParticleTypeDust) particleType).color(255F, 0F, 0F, 2F);
}
else if (particleType instanceof ParticleTypeDustTransition) {
((ParticleTypeDustTransition) particleType).color(255F, 0F, 0F, 255F, 0F, 0F, 2F);
else if (particleType instanceof ParticleTypeDustColorTransition) {
((ParticleTypeDustColorTransition) particleType).color(255F, 0F, 0F, 255F, 0F, 0F, 2F);
}
else if (particleType instanceof ParticleTypeVibration) {
((ParticleTypeVibration) particleType).packet(true, 0D, 0D, 0D, 0D, 0D, 0D, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ public void test_ParticleTypeDust() {
}

@Test
public void test_ParticleTypeDustTransition() {
public void test_ParticleTypeDustColorTransition() {
Particles_1_13 particles_1_13 = api.getParticles_1_13();

ParticleTypeDustTransition type = particles_1_13.DUST_COLOR_TRANSITION();
ParticleTypeDustColorTransition type = particles_1_13.DUST_COLOR_TRANSITION();

assertTrue("Particle type is invalid for some reason", type.isValid());

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ There are currently 11 types of particle type in this API:
- `ParticleTypeColorable extends ParticleType`,
- `ParticleTypeMotion extends ParticleType`,
- `ParticleTypeDust`,
- `ParticleTypeDustTransition`,
- `ParticleTypeDustColorTransition`,
- `ParticleTypeItemMotion`,
- `ParticleTypeNote extends ParticleType`,
- `ParticleTypeRedstone extends ParticleType`,
Expand Down Expand Up @@ -414,8 +414,8 @@ Object packetDust = particles_1_13.DUST()
.color(new Color(255, 255, 0), 2D)// this return object can be cached in variable
.packet(true, loc);
// ParticleTypeDustTransition (yellow dust fading into green of size 2x)
Object packetDustTransition = particles_1_13.DUST_COLOR_TRANSITION()
// ParticleTypeDustColorTransition (yellow dust fading into green of size 2x)
Object packetDustColorTransition = particles_1_13.DUST_COLOR_TRANSITION()
.color(new Color(255, 255, 0),
new Color(0, 255, 0), 2D)// this return object can be cached in variable
.packet(true, loc);
Expand Down

0 comments on commit 3b2367d

Please sign in to comment.