unzip, make the plugin public
This commit is contained in:
commit
05c91a8d03
113
CursedPlugin-master/.gitignore
vendored
Normal file
113
CursedPlugin-master/.gitignore
vendored
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
# User-specific stuff
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
|
||||||
|
# IntelliJ
|
||||||
|
out/
|
||||||
|
|
||||||
|
# Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
# Windows thumbnail cache files
|
||||||
|
Thumbs.db
|
||||||
|
Thumbs.db:encryptable
|
||||||
|
ehthumbs.db
|
||||||
|
ehthumbs_vista.db
|
||||||
|
|
||||||
|
# Dump file
|
||||||
|
*.stackdump
|
||||||
|
|
||||||
|
# Folder config file
|
||||||
|
[Dd]esktop.ini
|
||||||
|
|
||||||
|
# Recycle Bin used on file shares
|
||||||
|
$RECYCLE.BIN/
|
||||||
|
|
||||||
|
# Windows Installer files
|
||||||
|
*.cab
|
||||||
|
*.msi
|
||||||
|
*.msix
|
||||||
|
*.msm
|
||||||
|
*.msp
|
||||||
|
|
||||||
|
# Windows shortcuts
|
||||||
|
*.lnk
|
||||||
|
|
||||||
|
target/
|
||||||
|
|
||||||
|
pom.xml.tag
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
pom.xml.next
|
||||||
|
|
||||||
|
release.properties
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
buildNumber.properties
|
||||||
|
.mvn/timing.properties
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
|
.flattened-pom.xml
|
||||||
|
|
||||||
|
# Common working directory
|
||||||
|
run/
|
5
CursedPlugin-master/README.md
Normal file
5
CursedPlugin-master/README.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# CursedPlugin
|
||||||
|
A cursed plugin because why not
|
||||||
|
|
||||||
|
### What does it do?
|
||||||
|
That's not easy to answer. Honestly, I don't know.
|
114
CursedPlugin-master/pom.xml
Normal file
114
CursedPlugin-master/pom.xml
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.mikedeejay2</groupId>
|
||||||
|
<artifactId>cursedplugin</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<name>Cursed</name>
|
||||||
|
|
||||||
|
<description>A very cursed plugin for cursed things</description>
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.8.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.2.4</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
|
<transformers>
|
||||||
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
|
<mainClass>com.mikedeejay2.cursedplugin.CursedPlugin</mainClass>
|
||||||
|
</transformer>
|
||||||
|
</transformers>
|
||||||
|
<filters>
|
||||||
|
<filter>
|
||||||
|
<artifact>com.mikedeejay2:mikedeejay2lib</artifact>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
</filter>
|
||||||
|
</filters>
|
||||||
|
<minimizeJar>true</minimizeJar>
|
||||||
|
<!-- This is the location to my development server. You should change this. -->
|
||||||
|
<outputFile>C:\Users\mdeej\IdeaProjects\MINECRAFT SPIGOT PLUGIN TOOLS\Dev Server Latest\plugins\${project.artifactId}-${project.version}.jar</outputFile>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>spigotmc-repo</id>
|
||||||
|
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>sonatype</id>
|
||||||
|
<url>https://oss.sonatype.org/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>minecraft-repo</id>
|
||||||
|
<url>https://libraries.minecraft.net/</url>
|
||||||
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>Mikedeejay2Lib-mvn-repo</id>
|
||||||
|
<url>https://github.com/Mikedeejay2/Mikedeejay2Lib/raw/mvn-repo/</url>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
<updatePolicy>always</updatePolicy>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.spigotmc</groupId>
|
||||||
|
<artifactId>spigot-api</artifactId>
|
||||||
|
<version>1.17.1-R0.1-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mojang</groupId>
|
||||||
|
<artifactId>authlib</artifactId>
|
||||||
|
<version>1.5.25</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mikedeejay2</groupId>
|
||||||
|
<artifactId>mikedeejay2lib</artifactId>
|
||||||
|
<version>1.17.1-SNAPSHOT</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.mikedeejay2.cursedplugin;
|
||||||
|
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.runnable.EnhancedRunnable;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.util.raytrace.RayTracer;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.World;
|
||||||
|
import org.bukkit.entity.Creeper;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class CreeperDrop extends EnhancedRunnable
|
||||||
|
{
|
||||||
|
private Player player;
|
||||||
|
private Random random;
|
||||||
|
|
||||||
|
public CreeperDrop(Player player)
|
||||||
|
{
|
||||||
|
this.player = player;
|
||||||
|
this.random = new Random();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRun()
|
||||||
|
{
|
||||||
|
Location upLoc = player.getLocation();
|
||||||
|
upLoc.setPitch(-90);
|
||||||
|
Vector hitVec = RayTracer.rayTraceVector(upLoc, entity -> entity != player);
|
||||||
|
World world = player.getWorld();
|
||||||
|
if(hitVec != null) return;
|
||||||
|
Location spawnLoc = player.getLocation();
|
||||||
|
spawnLoc.setY(100);
|
||||||
|
int num = random.nextInt(10000);
|
||||||
|
if(num > 10) return;
|
||||||
|
Creeper creeper = (Creeper) world.spawnEntity(spawnLoc, EntityType.CREEPER);
|
||||||
|
creeper.setFallDistance(-1000);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package com.mikedeejay2.cursedplugin;
|
||||||
|
|
||||||
|
import com.mikedeejay2.cursedplugin.data.DataManager;
|
||||||
|
import com.mikedeejay2.cursedplugin.listeners.Listeners;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.BukkitPlugin;
|
||||||
|
|
||||||
|
public final class CursedPlugin extends BukkitPlugin
|
||||||
|
{
|
||||||
|
private DataManager data;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEnable()
|
||||||
|
{
|
||||||
|
super.onEnable();
|
||||||
|
|
||||||
|
this.registerEvent(new Listeners(this));
|
||||||
|
|
||||||
|
this.data = new DataManager(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDisable()
|
||||||
|
{
|
||||||
|
super.onDisable();
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataManager getData()
|
||||||
|
{
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
package com.mikedeejay2.cursedplugin;
|
||||||
|
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.runnable.EnhancedRunnable;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.util.math.MathUtil;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.util.particle.ParticleUtil;
|
||||||
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class PigStep extends EnhancedRunnable
|
||||||
|
{
|
||||||
|
private Player player;
|
||||||
|
private boolean enabled;
|
||||||
|
private long countDown;
|
||||||
|
private List<LivingEntity> pigs;
|
||||||
|
|
||||||
|
public PigStep(Player player)
|
||||||
|
{
|
||||||
|
this.player = player;
|
||||||
|
this.enabled = false;
|
||||||
|
this.countDown = 0;
|
||||||
|
this.pigs = new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRun()
|
||||||
|
{
|
||||||
|
--countDown;
|
||||||
|
if(countDown <= 0) disable();
|
||||||
|
for(Entity entity : player.getNearbyEntities(20, 20, 20))
|
||||||
|
{
|
||||||
|
if(entity.getType() != EntityType.PIG) continue;
|
||||||
|
processPig(entity);
|
||||||
|
}
|
||||||
|
for(LivingEntity pig : pigs)
|
||||||
|
{
|
||||||
|
if(pig.isDead())
|
||||||
|
{
|
||||||
|
countDown -= 2400;
|
||||||
|
pigs.remove(pig);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
Vector velocity = MathUtil.getFacingVector(player.getLocation(), pig.getLocation(), 0.1f);
|
||||||
|
pig.setVelocity(velocity);
|
||||||
|
}
|
||||||
|
if(pigs.size() > 0)
|
||||||
|
{
|
||||||
|
Location pigLoc = pigs.get(0).getLocation();
|
||||||
|
pigLoc.setY(pigLoc.getY() - 1);
|
||||||
|
Location newPlayerLoc = player.getLocation();
|
||||||
|
newPlayerLoc.setDirection(MathUtil.getFacingVector(pigLoc, player.getLocation(), 1));
|
||||||
|
Vector velocity = MathUtil.getFacingVector(pigLoc, newPlayerLoc, 0.1f);
|
||||||
|
player.teleport(newPlayerLoc);
|
||||||
|
player.setVelocity(velocity);
|
||||||
|
World world = pigs.get(0).getWorld();
|
||||||
|
for(int x = (int) (pigLoc.getX() - 1); x <= pigLoc.getX() + 1; x++)
|
||||||
|
{
|
||||||
|
for(int y = (int) (pigLoc.getY() - 1); y <= pigLoc.getY() + 2; y++)
|
||||||
|
{
|
||||||
|
for(int z = (int) (pigLoc.getZ() - 1); z <= pigLoc.getZ() + 1; z++)
|
||||||
|
{
|
||||||
|
world.getBlockAt(x, y, z).setType(Material.AIR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(newPlayerLoc.distance(pigLoc) < 2)
|
||||||
|
{
|
||||||
|
plugin.sendMessage(player, "&4&oPIG STEPPED ON YOU");
|
||||||
|
world.spawnEntity(newPlayerLoc, EntityType.PRIMED_TNT);
|
||||||
|
disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processPig(Entity pig)
|
||||||
|
{
|
||||||
|
if(pigs.contains(pig)) return;
|
||||||
|
pigs.add((LivingEntity) pig);
|
||||||
|
ParticleUtil.addParticleToEntity(plugin, pig, Particle.VILLAGER_ANGRY, 1000, 10, 1, 1, 1, 1, false);
|
||||||
|
countDown += 2400;
|
||||||
|
player.playSound(player.getLocation(), Sound.MUSIC_DISC_PIGSTEP, 1000, 1);
|
||||||
|
if(enabled) return;
|
||||||
|
enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void disable()
|
||||||
|
{
|
||||||
|
pigs.clear();
|
||||||
|
enabled = false;
|
||||||
|
player.stopSound(Sound.MUSIC_DISC_PIGSTEP);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package com.mikedeejay2.cursedplugin.data;
|
||||||
|
|
||||||
|
import com.mikedeejay2.cursedplugin.CursedPlugin;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public class DataManager
|
||||||
|
{
|
||||||
|
private final CursedPlugin plugin;
|
||||||
|
private HashMap<Player, PlayerData> data;
|
||||||
|
|
||||||
|
public DataManager(CursedPlugin plugin)
|
||||||
|
{
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.data = new HashMap<>();
|
||||||
|
|
||||||
|
for(Player player : Bukkit.getOnlinePlayers())
|
||||||
|
{
|
||||||
|
addPlayer(player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addPlayer(Player player)
|
||||||
|
{
|
||||||
|
data.put(player, new PlayerData(plugin, player));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removePlayer(Player player)
|
||||||
|
{
|
||||||
|
data.get(player).disable();
|
||||||
|
data.remove(player);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.mikedeejay2.cursedplugin.data;
|
||||||
|
|
||||||
|
import com.mikedeejay2.cursedplugin.CreeperDrop;
|
||||||
|
import com.mikedeejay2.cursedplugin.CursedPlugin;
|
||||||
|
import com.mikedeejay2.cursedplugin.PigStep;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class PlayerData
|
||||||
|
{
|
||||||
|
private final CursedPlugin plugin;
|
||||||
|
private Player player;
|
||||||
|
private PigStep pigStep;
|
||||||
|
private CreeperDrop creeperDrop;
|
||||||
|
|
||||||
|
public PlayerData(CursedPlugin plugin, Player player)
|
||||||
|
{
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.player = player;
|
||||||
|
this.pigStep = new PigStep(player);
|
||||||
|
pigStep.runTaskTimer(plugin);
|
||||||
|
this.creeperDrop = new CreeperDrop(player);
|
||||||
|
creeperDrop.runTaskTimer(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disable()
|
||||||
|
{
|
||||||
|
pigStep.cancel();
|
||||||
|
creeperDrop.cancel();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,219 @@
|
|||||||
|
package com.mikedeejay2.cursedplugin.listeners;
|
||||||
|
|
||||||
|
import com.mikedeejay2.cursedplugin.CursedPlugin;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.item.ItemBuilder;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.runnable.EnhancedRunnable;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.util.block.BlockIterator;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.util.block.FallingBlockUtil;
|
||||||
|
import com.mikedeejay2.mikedeejay2lib.util.chat.Colors;
|
||||||
|
import org.bukkit.*;
|
||||||
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.block.Furnace;
|
||||||
|
import org.bukkit.block.data.BlockData;
|
||||||
|
import org.bukkit.entity.*;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
|
import org.bukkit.event.block.MoistureChangeEvent;
|
||||||
|
import org.bukkit.event.entity.*;
|
||||||
|
import org.bukkit.event.inventory.FurnaceBurnEvent;
|
||||||
|
import org.bukkit.event.inventory.FurnaceSmeltEvent;
|
||||||
|
import org.bukkit.event.player.*;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
import org.bukkit.potion.PotionEffect;
|
||||||
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class Listeners implements Listener
|
||||||
|
{
|
||||||
|
private final CursedPlugin plugin;
|
||||||
|
private Random random;
|
||||||
|
|
||||||
|
public Listeners(CursedPlugin plugin)
|
||||||
|
{
|
||||||
|
this.plugin = plugin;
|
||||||
|
this.random = new Random();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void playerJoinEvent(PlayerJoinEvent event)
|
||||||
|
{
|
||||||
|
plugin.getData().addPlayer(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void playerLeaveEvent(PlayerQuitEvent event)
|
||||||
|
{
|
||||||
|
plugin.getData().removePlayer(event.getPlayer());
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void walkEvent(PlayerMoveEvent event)
|
||||||
|
{
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
Location playerLoc = player.getEyeLocation();
|
||||||
|
World world = player.getWorld();
|
||||||
|
int randomNum = random.nextInt(2000);
|
||||||
|
if(randomNum < 2)
|
||||||
|
{
|
||||||
|
Block block = world.getBlockAt(playerLoc);
|
||||||
|
block.setType(Material.LAVA);
|
||||||
|
new EnhancedRunnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onRun()
|
||||||
|
{
|
||||||
|
block.setType(Material.AIR);
|
||||||
|
}
|
||||||
|
}.runTaskLater(plugin, 5 * 20);
|
||||||
|
}
|
||||||
|
Location blockLoc = player.getLocation();
|
||||||
|
blockLoc.setY(blockLoc.getY()-1);
|
||||||
|
Block blockfeet = world.getBlockAt(blockLoc);
|
||||||
|
switch(blockfeet.getType())
|
||||||
|
{
|
||||||
|
case SAND:
|
||||||
|
blockfeet.setType(Material.GLASS);
|
||||||
|
break;
|
||||||
|
case CACTUS:
|
||||||
|
for(int y = blockLoc.getBlockY(); y < 256; y++)
|
||||||
|
{
|
||||||
|
world.getBlockAt(blockLoc.getBlockX(), y, blockLoc.getBlockZ()).setType(Material.CACTUS);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case GRASS_BLOCK:
|
||||||
|
blockfeet.setType(Material.DIRT);
|
||||||
|
break;
|
||||||
|
case STONE:
|
||||||
|
blockfeet.setType(Material.COBBLESTONE);
|
||||||
|
break;
|
||||||
|
case DIAMOND_ORE:
|
||||||
|
blockfeet.setType(Material.COAL);
|
||||||
|
break;
|
||||||
|
case DEAD_BUSH:
|
||||||
|
player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, 200, 1, true, false, false));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
BlockIterator.iterateBlocks(player.getLocation(), 10, 10, 10, (location, block) -> {
|
||||||
|
Location blockBelow = location.clone();
|
||||||
|
blockBelow.setY(blockBelow.getY() - 1);
|
||||||
|
Block newBloc = world.getBlockAt(blockBelow);
|
||||||
|
if(block.getType().toString().endsWith("AIR")) return;
|
||||||
|
if(newBloc.getType().toString().endsWith("AIR"))
|
||||||
|
{
|
||||||
|
FallingBlockUtil.makeBlockFall(block);
|
||||||
|
}
|
||||||
|
}, plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void shootBowEvent(ProjectileLaunchEvent event)
|
||||||
|
{
|
||||||
|
Projectile proj = event.getEntity();
|
||||||
|
float offX = ((random.nextFloat()) - 0.5f);
|
||||||
|
float offY = ((random.nextFloat()) - 0.5f);
|
||||||
|
float offZ = ((random.nextFloat()) - 0.5f);
|
||||||
|
proj.setVelocity(proj.getVelocity().add(new Vector(offX, offY, offZ)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onExplode(EntityExplodeEvent event)
|
||||||
|
{
|
||||||
|
Entity entity = event.getEntity();
|
||||||
|
Location location = entity.getLocation();
|
||||||
|
BlockIterator.iterateBlocksSphere(location, 5, (location1, block) -> FallingBlockUtil.makeBlockExplode(block, 2), plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void blockSpreadEvent(BlockSpreadEvent event)
|
||||||
|
{
|
||||||
|
Block block = event.getSource();
|
||||||
|
BlockData blockData = block.getBlockData();
|
||||||
|
Location location = block.getLocation();
|
||||||
|
BlockIterator.iterateBlocks(location, 3, 3, 3, ((newLoc, newBlock) -> {
|
||||||
|
if(newBlock.getType() != Material.AIR && newBlock.getType() != Material.FIRE)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
newBlock.setBlockData(blockData);
|
||||||
|
}), plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void moistureChangeEvent(MoistureChangeEvent event)
|
||||||
|
{
|
||||||
|
Location location = event.getBlock().getLocation();
|
||||||
|
World world = event.getBlock().getWorld();
|
||||||
|
BlockIterator.iterateBlocks(location, 3, 3, 3, ((newLoc, newBlock) -> {
|
||||||
|
world.getBlockAt(newLoc).setType(Material.OBSIDIAN);
|
||||||
|
}), plugin);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void furnaceBurnEvent(FurnaceBurnEvent event)
|
||||||
|
{
|
||||||
|
Furnace furnace = (Furnace) event.getBlock().getState();
|
||||||
|
furnace.setCookTimeTotal(1000);
|
||||||
|
furnace.update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void furnaceSmeltEvent(FurnaceSmeltEvent event)
|
||||||
|
{
|
||||||
|
Furnace furnace = (Furnace) event.getBlock().getState();
|
||||||
|
ItemStack result = furnace.getInventory().getResult();
|
||||||
|
furnace.setCookTimeTotal(1000);
|
||||||
|
furnace.update();
|
||||||
|
Location location = furnace.getLocation();
|
||||||
|
World world = location.getWorld();
|
||||||
|
new EnhancedRunnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void onRun()
|
||||||
|
{
|
||||||
|
Item item = world.dropItemNaturally(location, result);
|
||||||
|
item.setVelocity(new Vector(random.nextFloat()-0.5f, random.nextFloat()-0.5f, random.nextFloat()-0.5f).multiply(2));
|
||||||
|
world.playSound(location, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1, 1);
|
||||||
|
for(int i = 0; i < 10; i++)
|
||||||
|
{
|
||||||
|
Entity entity = world.spawnEntity(location, EntityType.EXPERIENCE_ORB);
|
||||||
|
entity.setVelocity(new Vector(random.nextFloat() - 0.5f, random.nextFloat() - 0.5f, random.nextFloat() - 0.5f).multiply(2));
|
||||||
|
}
|
||||||
|
world.spawnParticle(Particle.CRIT, location, 10, 1, 1, 1);
|
||||||
|
}
|
||||||
|
}.runTaskTimerCounted(plugin, 1, 64);
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void spawnEvent(EntitySpawnEvent event)
|
||||||
|
{
|
||||||
|
Entity entity = event.getEntity();
|
||||||
|
Location location = entity.getLocation();
|
||||||
|
World world = entity.getWorld();
|
||||||
|
|
||||||
|
switch(entity.getType())
|
||||||
|
{
|
||||||
|
case BAT:
|
||||||
|
{
|
||||||
|
world.spawnEntity(location, EntityType.PRIMED_TNT);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ZOMBIE:
|
||||||
|
{
|
||||||
|
Zombie zombie = (Zombie)entity;
|
||||||
|
zombie.setBaby();
|
||||||
|
zombie.setCustomName(Colors.format("&4&l&kWEOIFJOWIEJFOIEWJFOIWEJFJOWEIFJWEOJFOWIEJFOWEIJFJOWEIJOWEIJFOIWEJFOIWEJOIWEJOFIWEJFOIWEJOIFJWEOIFJWEWEOIFJOWIEJFOIEWJFOIWEJFJOWEIFJWEOJFOWIEJFOWEIJFJOWEIJOWEIJFOIWEJFOIWEJOIWEJOFIWEJFOIWEJOIFJWEOIFJWEWEOIFJOWIEJFOIEWJFOIWEJFJOWEIFJWEOJFOWIEJFOWEIJFJOWEIJOWEIJFOIWEJFOIWEJOIWEJOFIWEJFOIWEJOIFJWEOIFJWE"));
|
||||||
|
zombie.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 999999, 100, false, false, false));
|
||||||
|
zombie.getEquipment().setBoots(
|
||||||
|
ItemBuilder.of(Material.DIAMOND_BOOTS)
|
||||||
|
.setAmount(10)
|
||||||
|
.setName("&4&l&kWEOIFJOWIEJFOIEWJFOIWEJFJOWEIFJWEOJFOWIEJFOWEIJFJOWEIJOWEIJFOIWEJFOIWEJOIWEJOFIWEJFOIWEJOIFJWEOIFJWEWEOIFJOWIEJFOIEWJFOIWEJFJOWEIFJWEOJFOWIEJFOWEIJFJOWEIJOWEIJFOIWEJFOIWEJOIWEJOFIWEJFOIWEJOIFJWEOIFJWEWEOIFJOWIEJFOIEWJFOIWEJFJOWEIFJWEOJFOWIEJFOWEIJFJOWEIJOWEIJFOIWEJFOIWEJOIWEJOFIWEJFOIWEJOIFJWEOIFJWE")
|
||||||
|
.get());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
CursedPlugin-master/src/main/resources/plugin.yml
Normal file
6
CursedPlugin-master/src/main/resources/plugin.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
name: Cursed
|
||||||
|
version: ${project.version}
|
||||||
|
main: com.mikedeejay2.cursedplugin.CursedPlugin
|
||||||
|
api-version: 1.16
|
||||||
|
authors: [ Mikedeejay2, ThatCoolDevGuy ]
|
||||||
|
description: A very cursed plugin for cursed things
|
Loading…
x
Reference in New Issue
Block a user