commit
e696cba6ee
@ -1,4 +1,4 @@
|
|||||||
val mc_version="1.20"
|
val mc_version="1.20.2"
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.Effect;
|
|||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
@ -83,7 +83,7 @@ public class Herobrine extends JavaPlugin implements Listener {
|
|||||||
// If it is not, print an error message and disable the plugin.
|
// If it is not, print an error message and disable the plugin.
|
||||||
if (continueWithEnable) {
|
if (continueWithEnable) {
|
||||||
try {
|
try {
|
||||||
Class.forName("org.bukkit.craftbukkit.v1_20_R1.CraftArt");
|
Class.forName("org.bukkit.craftbukkit.v1_20_R2.CraftArt");
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.RED + "This version of Herobrine is not "
|
Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.RED + "This version of Herobrine is not "
|
||||||
+ "compatible with this server's Spigot version and will be disabled.");
|
+ "compatible with this server's Spigot version and will be disabled.");
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package net.theprogrammersworld.herobrine.NPC.Entity;
|
package net.theprogrammersworld.herobrine.NPC.Entity;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
|
||||||
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
|
import net.minecraft.server.level.ClientInformation;
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
import net.minecraft.world.entity.MoverType;
|
import net.minecraft.world.entity.MoverType;
|
||||||
import net.minecraft.world.level.GameType;
|
import net.minecraft.world.level.GameType;
|
||||||
@ -19,7 +20,7 @@ public class HumanEntity extends ServerPlayer {
|
|||||||
private CraftPlayer cplayer = null;
|
private CraftPlayer cplayer = null;
|
||||||
|
|
||||||
public HumanEntity(final NPCCore npcCore, final NMSWorld world, final GameProfile s) {
|
public HumanEntity(final NPCCore npcCore, final NMSWorld world, final GameProfile s) {
|
||||||
super(npcCore.getServer().getMCServer(), world.getWorldServer(), s);
|
super(npcCore.getServer().getMCServer(), world.getWorldServer(), s, ClientInformation.createDefault());
|
||||||
|
|
||||||
this.setGameMode(GameType.SURVIVAL);
|
this.setGameMode(GameType.SURVIVAL);
|
||||||
|
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
package net.theprogrammersworld.herobrine.NPC.Entity;
|
package net.theprogrammersworld.herobrine.NPC.Entity;
|
||||||
|
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
|
||||||
import net.minecraft.world.InteractionHand;
|
|
||||||
import net.theprogrammersworld.herobrine.Herobrine;
|
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
@ -11,6 +7,9 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
|
|
||||||
|
import net.minecraft.world.InteractionHand;
|
||||||
|
import net.theprogrammersworld.herobrine.Herobrine;
|
||||||
|
|
||||||
public class HumanNPC {
|
public class HumanNPC {
|
||||||
|
|
||||||
private HumanEntity entity;
|
private HumanEntity entity;
|
||||||
@ -25,7 +24,7 @@ public class HumanNPC {
|
|||||||
return this.id;
|
return this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerPlayer getEntity() {
|
public HumanEntity getEntity() {
|
||||||
return this.entity;
|
return this.entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +43,7 @@ public class HumanNPC {
|
|||||||
|
|
||||||
public void setItemInHand(ItemStack item) {
|
public void setItemInHand(ItemStack item) {
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
((org.bukkit.entity.HumanEntity) getEntity().getBukkitEntity()).getInventory().setItemInMainHand(item);
|
getEntity().getBukkitEntity().getInventory().setItemInMainHand(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +85,7 @@ public class HumanNPC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setYaw(float yaw) {
|
public void setYaw(float yaw) {
|
||||||
((ServerPlayer) getEntity()).setYRot(yaw);
|
getEntity().setYRot(yaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void lookAtPoint(Location point) {
|
public void lookAtPoint(Location point) {
|
||||||
@ -118,7 +117,7 @@ public class HumanNPC {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setYawA(float yaw) {
|
public void setYawA(float yaw) {
|
||||||
((ServerPlayer) getEntity()).setYRot(yaw);
|
getEntity().setYRot(yaw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public org.bukkit.entity.Entity getBukkitEntity() {
|
public org.bukkit.entity.Entity getBukkitEntity() {
|
||||||
|
@ -12,7 +12,7 @@ import net.minecraft.server.MinecraftServer;
|
|||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_20_R2.CraftServer;
|
||||||
|
|
||||||
public class NMSServer {
|
public class NMSServer {
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import net.minecraft.server.level.ChunkMap;
|
|||||||
import net.minecraft.server.level.ServerLevel;
|
import net.minecraft.server.level.ServerLevel;
|
||||||
|
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.CraftWorld;
|
import org.bukkit.craftbukkit.v1_20_R2.CraftWorld;
|
||||||
|
|
||||||
public class NMSWorld {
|
public class NMSWorld {
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class NPCCore {
|
|||||||
"eyJ0aW1lc3RhbXAiOjE0MjE0ODczMzk3MTMsInByb2ZpbGVJZCI6ImY4NGM2YTc5MGE0ZTQ1ZTA4NzliY2Q0OWViZDRjNGUyIiwicHJvZmlsZU5hbWUiOiJIZXJvYnJpbmUiLCJpc1B1YmxpYyI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlLzk4YjdjYTNjN2QzMTRhNjFhYmVkOGZjMThkNzk3ZmMzMGI2ZWZjODQ0NTQyNWM0ZTI1MDk5N2U1MmU2Y2IifX19",
|
"eyJ0aW1lc3RhbXAiOjE0MjE0ODczMzk3MTMsInByb2ZpbGVJZCI6ImY4NGM2YTc5MGE0ZTQ1ZTA4NzliY2Q0OWViZDRjNGUyIiwicHJvZmlsZU5hbWUiOiJIZXJvYnJpbmUiLCJpc1B1YmxpYyI6dHJ1ZSwidGV4dHVyZXMiOnsiU0tJTiI6eyJ1cmwiOiJodHRwOi8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8AwlDDuP2Xr4SS6f8nABOxjSTlWMn6bToAYiymD+KUPoO0kQJ0Uw/pVXgWHYjQeM4BYf/FAxe8Bf1cP8S7VKueULkOxqIjXAp85uqKkU7dR/s4M4yHm6fhCOCLSMv6hi5ewTaFNYyhK+NXPftFqHcOxA1LbrjOe6NyphF/2FI79n90hagxJpWwNPz3/8I5rnGbYwBZPTsTnD8PszgQTNuWSuvZwGIXPIp9zb90xuU7g7VNWjzPVoOHfRNExEs7Dn9pG8CIA/m/a8koWW3pkbP/AMMWnwgHCr/peGdvF5fN+hJwVdpbfC9sJfzGwA7AgXG/6yqhl1U7YAp/aCVM9bZ94sav+kQghvN41jqOwy4F4i/swc7R4Fx2w5HFxVY3j7FChG7iuhqjUclm79YNhTG0lBQLiZbN5FmC9QgrNHRKlzgSZrXHWoG3YXFSqfn4J+Om9w=");
|
||||||
|
|
||||||
profile.getProperties().put(textures.getName(), textures);
|
profile.getProperties().put(textures.name(), textures);
|
||||||
|
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
package net.theprogrammersworld.herobrine.NPC.Network;
|
package net.theprogrammersworld.herobrine.NPC.Network;
|
||||||
|
|
||||||
import net.minecraft.network.protocol.PacketFlow;
|
import io.netty.channel.embedded.EmbeddedChannel;
|
||||||
import net.minecraft.network.Connection;
|
import net.minecraft.network.Connection;
|
||||||
|
import net.minecraft.network.PacketListener;
|
||||||
|
import net.minecraft.network.protocol.PacketFlow;
|
||||||
|
|
||||||
public class NetworkCore extends Connection {
|
public class NetworkCore extends Connection {
|
||||||
|
|
||||||
public NetworkCore() {
|
public NetworkCore() {
|
||||||
super(PacketFlow.SERVERBOUND);
|
super(PacketFlow.SERVERBOUND);
|
||||||
|
channel = new EmbeddedChannel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override public void setListener(PacketListener packetListener) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick() {
|
public void tick() {
|
||||||
|
|
||||||
|
@ -1,19 +1,17 @@
|
|||||||
package net.theprogrammersworld.herobrine.NPC.Network;
|
package net.theprogrammersworld.herobrine.NPC.Network;
|
||||||
|
|
||||||
import net.minecraft.server.level.ServerPlayer;
|
|
||||||
import net.minecraft.network.protocol.Packet;
|
import net.minecraft.network.protocol.Packet;
|
||||||
|
import net.minecraft.server.level.ServerPlayer;
|
||||||
|
import net.minecraft.server.network.CommonListenerCookie;
|
||||||
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
import net.minecraft.server.network.ServerGamePacketListenerImpl;
|
||||||
import net.theprogrammersworld.herobrine.NPC.NPCCore;
|
import net.theprogrammersworld.herobrine.NPC.NPCCore;
|
||||||
|
|
||||||
public class NetworkHandler extends ServerGamePacketListenerImpl {
|
public class NetworkHandler extends ServerGamePacketListenerImpl {
|
||||||
|
|
||||||
public NetworkHandler(final NPCCore npcCore, final ServerPlayer entityPlayer) {
|
public NetworkHandler(final NPCCore npcCore, final ServerPlayer entityPlayer) {
|
||||||
super(npcCore.getServer().getMCServer(), npcCore.getNetworkCore(), entityPlayer);
|
super(npcCore.getServer().getMCServer(), npcCore.getNetworkCore(), entityPlayer, CommonListenerCookie.createInitial(entityPlayer.getGameProfile()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void send(final Packet<?> packet) {
|
public void send(final Packet<?> packet) {}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,7 @@ import net.minecraft.network.protocol.Packet;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ public class EntityManager {
|
|||||||
public void spawnCustomZombie(Location loc,MobType mbt){
|
public void spawnCustomZombie(Location loc,MobType mbt){
|
||||||
|
|
||||||
World world = loc.getWorld();
|
World world = loc.getWorld();
|
||||||
net.minecraft.world.level.Level mcWorld = ((org.bukkit.craftbukkit.v1_20_R1.CraftWorld) world).getHandle();
|
net.minecraft.world.level.Level mcWorld = ((org.bukkit.craftbukkit.v1_20_R2.CraftWorld) world).getHandle();
|
||||||
CustomZombie zmb = new CustomZombie(mcWorld,loc,mbt);
|
CustomZombie zmb = new CustomZombie(mcWorld,loc,mbt);
|
||||||
mcWorld.addFreshEntity(zmb, SpawnReason.CUSTOM);
|
mcWorld.addFreshEntity(zmb, SpawnReason.CUSTOM);
|
||||||
mobList.put(Integer.valueOf(zmb.getBukkitEntity().getEntityId()),zmb);
|
mobList.put(Integer.valueOf(zmb.getBukkitEntity().getEntityId()),zmb);
|
||||||
@ -24,7 +24,7 @@ public class EntityManager {
|
|||||||
public void spawnCustomSkeleton(Location loc,MobType mbt){
|
public void spawnCustomSkeleton(Location loc,MobType mbt){
|
||||||
|
|
||||||
World world = loc.getWorld();
|
World world = loc.getWorld();
|
||||||
net.minecraft.world.level.Level mcWorld = ((org.bukkit.craftbukkit.v1_20_R1.CraftWorld) world).getHandle();
|
net.minecraft.world.level.Level mcWorld = ((org.bukkit.craftbukkit.v1_20_R2.CraftWorld) world).getHandle();
|
||||||
CustomSkeleton zmb = new CustomSkeleton(mcWorld,loc,mbt);
|
CustomSkeleton zmb = new CustomSkeleton(mcWorld,loc,mbt);
|
||||||
mcWorld.addFreshEntity(zmb, SpawnReason.CUSTOM);
|
mcWorld.addFreshEntity(zmb, SpawnReason.CUSTOM);
|
||||||
mobList.put(Integer.valueOf(zmb.getBukkitEntity().getEntityId()), zmb);
|
mobList.put(Integer.valueOf(zmb.getBukkitEntity().getEntityId()), zmb);
|
||||||
|
@ -12,7 +12,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.Jukebox;
|
import org.bukkit.block.Jukebox;
|
||||||
import org.bukkit.craftbukkit.v1_20_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_20_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: Herobrine
|
name: Herobrine
|
||||||
main: net.theprogrammersworld.herobrine.Herobrine
|
main: net.theprogrammersworld.herobrine.Herobrine
|
||||||
version: 2.4.3-SNAPSHOT
|
version: 2.4.4-SNAPSHOT
|
||||||
description: "Bring Herobrine to your Spigot-based Minecraft server!"
|
description: "Bring Herobrine to your Spigot-based Minecraft server!"
|
||||||
website: https://www.theprogrammersworld.net
|
website: https://www.theprogrammersworld.net
|
||||||
api-version: '1.20'
|
api-version: '1.20'
|
||||||
|
Loading…
Reference in New Issue
Block a user