Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ByteZ1337 committed Jun 13, 2021
1 parent d6cb6af commit 8140014
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 4 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ dependencies {

## Usage

#### For more advanced usage explanations check out the [Wiki](https://github.com/ByteZ1337/ParticleLib/wiki) or the [Javadoc](https://xenondevs.xyz/particledoc/).
<b>For more advanced usage explanations check out the [Wiki](https://github.com/ByteZ1337/ParticleLib/wiki) or the [Javadoc](https://xenondevs.xyz/particledoc/). </b>

### Simple

Expand Down Expand Up @@ -126,8 +126,7 @@ To see if a particle is colorable check if it has the ``COLORABLE`` PropertyType

**Note:**

* Since 1.13 ``Redstone`` particles are storing their color values in another property. Therefore, the offset properties
can be properly used on servers above 1.13.
* Since 1.13 ``Redstone`` particles are storing their color values in another property. Therefore, the offset properties can be properly used on servers above 1.13.
* ``Note`` particles don't accept a custom color. Instead, they support a note value from 0 to 24. Use ``NoteColor`` for
this particle.

Expand Down
66 changes: 66 additions & 0 deletions src/main/java/xyz/xenondevs/particle/ParticleLib.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* MIT License
*
* Copyright (c) 2021 ByteZ1337
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package xyz.xenondevs.particle;

import com.google.common.collect.Lists;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.plugin.java.JavaPlugin;
import xyz.xenondevs.particle.data.ParticleData;
import xyz.xenondevs.particle.data.VibrationData;
import xyz.xenondevs.particle.task.TaskManager;

import java.util.List;

public class ParticleLib extends JavaPlugin {

@Override
public void onEnable() {
World world = Bukkit.getWorld("world");
TaskManager.startGlobalTask(getPackets(), 100);
TaskManager.startGlobalTask(Lists.newArrayList(
new ParticleBuilder(ParticleEffect.FLAME, new Location(world, 5, 100, 0))
.toPacket(),
new ParticleBuilder(ParticleEffect.FLAME, new Location(world, -5, 100, 0))
.toPacket()
), 1);
}

private List<Object> getPackets() {
World world = Bukkit.getWorld("world");
List<Object> packets = Lists.newArrayList();
ParticleData vibrationData = new VibrationData(
new Location(world, 5, 100, 0),
new Location(world, -5, 100, 0),
100
);
packets.add(new ParticleBuilder(ParticleEffect.VIBRATION)
.setParticleData(vibrationData)
.setLocation(new Location(world, 0, 100, 0))
.toPacket());
return packets;
}
}
1 change: 0 additions & 1 deletion src/main/java/xyz/xenondevs/particle/ParticlePacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ private Object createGenericParticlePacket(Location location, Object param) {
*/
private Object createTexturedParticlePacket(Location location, Object param) {
ParticleEffect effect = getParticle();
ParticleData data = getParticleData();
int version = ReflectionUtils.MINECRAFT_VERSION;
return createPacket(version < 13 ? effect.getNMSObject() : param,
(float) location.getX(), (float) location.getY(), (float) location.getZ(),
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: ParticleLib
version: 1.6.2-SNAPSHOT
main: xyz.xenondevs.particle.ParticleLib
api-version: 1.13

0 comments on commit 8140014

Please sign in to comment.