-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
TheDutchMC
committed
Nov 7, 2020
1 parent
7dae9eb
commit ffa5495
Showing
6 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apply plugin: 'java' | ||
dependencies { | ||
compileOnly 'org.spigotmc:spigot:1.16.4-R0.1-SNAPSHOT' | ||
} |
65 changes: 65 additions & 0 deletions
65
..._16_R3/src/main/java/nl/thedutchmc/harotorch/commands/torchSubCmds/Highlight_1_16_r3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package nl.thedutchmc.harotorch.commands.torchSubCmds; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.bukkit.Location; | ||
import org.bukkit.craftbukkit.v1_16_R3.CraftWorld; | ||
import org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer; | ||
import org.bukkit.entity.Player; | ||
|
||
import net.minecraft.server.v1_16_R3.EntityMagmaCube; | ||
import net.minecraft.server.v1_16_R3.EntityPlayer; | ||
import net.minecraft.server.v1_16_R3.EntityTypes; | ||
import net.minecraft.server.v1_16_R3.PacketPlayOutEntityDestroy; | ||
import net.minecraft.server.v1_16_R3.PacketPlayOutEntityMetadata; | ||
import net.minecraft.server.v1_16_R3.PacketPlayOutSpawnEntityLiving; | ||
import net.minecraft.server.v1_16_R3.PlayerConnection; | ||
import net.minecraft.server.v1_16_R3.World; | ||
|
||
public class Highlight_1_16_r3 { | ||
|
||
public static List<Integer> spawnHighlight(Player p, List<Location> locations) { | ||
|
||
List<Integer> result = new ArrayList<>(); | ||
|
||
EntityPlayer ep = ((CraftPlayer) p).getHandle(); | ||
PlayerConnection conn = ep.playerConnection; | ||
|
||
for(Location loc : locations) { | ||
|
||
World nmsWorld = ((CraftWorld) loc.getWorld()).getHandle(); | ||
|
||
EntityMagmaCube nmsEntity = new EntityMagmaCube(EntityTypes.MAGMA_CUBE, nmsWorld); | ||
|
||
nmsEntity.setInvisible(false); | ||
nmsEntity.collides = false; //Colllision | ||
nmsEntity.setFlag(6, true); //Glowing | ||
nmsEntity.setFlag(5, true); //Invisibility | ||
nmsEntity.setSize(2, true); //Set the size of the magma cube to be a full block | ||
nmsEntity.setLocation(loc.getBlockX() + 0.5D, loc.getBlockY(), loc.getBlockZ() + 0.5D, 0f, 0f); | ||
|
||
PacketPlayOutSpawnEntityLiving spawnPacket = new PacketPlayOutSpawnEntityLiving(nmsEntity); | ||
PacketPlayOutEntityMetadata metaPacket = new PacketPlayOutEntityMetadata(nmsEntity.getId(), nmsEntity.getDataWatcher(), true); | ||
|
||
conn.sendPacket(spawnPacket); | ||
conn.sendPacket(metaPacket); | ||
|
||
result.add(nmsEntity.getId()); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
public static void killHighlighted(List<Integer> ids, Player p) { | ||
|
||
EntityPlayer ep = ((CraftPlayer) p).getHandle(); | ||
PlayerConnection conn = ep.playerConnection; | ||
|
||
for(int id : ids) { | ||
PacketPlayOutEntityDestroy killPacket = new PacketPlayOutEntityDestroy(id); | ||
|
||
conn.sendPacket(killPacket); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pluginVersion = 2.1.3 | ||
pluginVersion = 2.1.4 | ||
pluginGroup = nl.thedutchmc.harotorch | ||
pluginName = HaroTorch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
|
||
rootProject.name = 'HaroTorch' | ||
include ':Spigot_1_16_R2' | ||
include ':Spigot_1_16_R3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters