fix all compile errors
This commit is contained in:
@@ -126,4 +126,6 @@ public interface Terminator {
|
|||||||
boolean isInPlayerList();
|
boolean isInPlayerList();
|
||||||
|
|
||||||
World.Environment getDimension();
|
World.Environment getDimension();
|
||||||
|
|
||||||
|
void setShield(boolean b);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ import org.bukkit.*;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.data.Waterlogged;
|
import org.bukkit.block.data.Waterlogged;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.CraftEquipmentSlot;
|
import org.bukkit.craftbukkit.v1_19_R2.CraftEquipmentSlot;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_19_R2.CraftServer;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
|
import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_19_R2.inventory.CraftItemStack;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Damageable;
|
import org.bukkit.entity.Damageable;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -49,11 +49,7 @@ import org.bukkit.util.BoundingBox;
|
|||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public class Bot extends ServerPlayer implements Terminator {
|
public class Bot extends ServerPlayer implements Terminator {
|
||||||
|
|
||||||
@@ -79,7 +75,7 @@ public class Bot extends ServerPlayer implements Terminator {
|
|||||||
private boolean inPlayerList;
|
private boolean inPlayerList;
|
||||||
|
|
||||||
private Bot(MinecraftServer minecraftServer, ServerLevel worldServer, GameProfile profile, boolean addToPlayerList) {
|
private Bot(MinecraftServer minecraftServer, ServerLevel worldServer, GameProfile profile, boolean addToPlayerList) {
|
||||||
super(minecraftServer, worldServer, profile, null);
|
super(minecraftServer, worldServer, profile);
|
||||||
|
|
||||||
this.plugin = TerminatorPlus.getInstance();
|
this.plugin = TerminatorPlus.getInstance();
|
||||||
this.scheduler = Bukkit.getScheduler();
|
this.scheduler = Bukkit.getScheduler();
|
||||||
@@ -126,7 +122,7 @@ public class Bot extends ServerPlayer implements Terminator {
|
|||||||
bot.setRot(loc.getYaw(), loc.getPitch());
|
bot.setRot(loc.getYaw(), loc.getPitch());
|
||||||
bot.getBukkitEntity().setNoDamageTicks(0);
|
bot.getBukkitEntity().setNoDamageTicks(0);
|
||||||
Bukkit.getOnlinePlayers().forEach(p -> ((CraftPlayer) p).getHandle().connection.send(
|
Bukkit.getOnlinePlayers().forEach(p -> ((CraftPlayer) p).getHandle().connection.send(
|
||||||
new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, bot)));
|
new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, bot)));
|
||||||
if (addPlayerList)
|
if (addPlayerList)
|
||||||
nmsWorld.addNewPlayer(bot);
|
nmsWorld.addNewPlayer(bot);
|
||||||
else
|
else
|
||||||
@@ -205,9 +201,10 @@ public class Bot extends ServerPlayer implements Terminator {
|
|||||||
|
|
||||||
private Packet<?>[] getRenderPackets() {
|
private Packet<?>[] getRenderPackets() {
|
||||||
return new Packet[]{
|
return new Packet[]{
|
||||||
new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, this),
|
new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, this),
|
||||||
new ClientboundAddPlayerPacket(this),
|
new ClientboundAddPlayerPacket(this),
|
||||||
new ClientboundSetEntityDataPacket(this.getId(), this.entityData, true),
|
//new ClientboundSetEntityDataPacket(this.getId(), this.entityData, true),
|
||||||
|
new ClientboundSetEntityDataPacket(this.getId(), this.entityData.packDirty()),
|
||||||
new ClientboundRotateHeadPacket(this, (byte) ((this.yHeadRot * 256f) / 360f))
|
new ClientboundRotateHeadPacket(this, (byte) ((this.yHeadRot * 256f) / 360f))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -215,7 +212,8 @@ public class Bot extends ServerPlayer implements Terminator {
|
|||||||
private Packet<?>[] getRenderPacketsNoInfo() {
|
private Packet<?>[] getRenderPacketsNoInfo() {
|
||||||
return new Packet[]{
|
return new Packet[]{
|
||||||
new ClientboundAddPlayerPacket(this),
|
new ClientboundAddPlayerPacket(this),
|
||||||
new ClientboundSetEntityDataPacket(this.getId(), this.entityData, true),
|
//new ClientboundSetEntityDataPacket(this.getId(), this.entityData, true),
|
||||||
|
new ClientboundSetEntityDataPacket(this.getId(), this.entityData.packDirty()),
|
||||||
new ClientboundRotateHeadPacket(this, (byte) ((this.yHeadRot * 256f) / 360f))
|
new ClientboundRotateHeadPacket(this, (byte) ((this.yHeadRot * 256f) / 360f))
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -411,14 +409,16 @@ public class Bot extends ServerPlayer implements Terminator {
|
|||||||
this.blocking = true;
|
this.blocking = true;
|
||||||
this.blockUse = true;
|
this.blockUse = true;
|
||||||
startUsingItem(InteractionHand.OFF_HAND);
|
startUsingItem(InteractionHand.OFF_HAND);
|
||||||
sendPacket(new ClientboundSetEntityDataPacket(getId(), entityData, true));
|
//sendPacket(new ClientboundSetEntityDataPacket(getId(), entityData, true));
|
||||||
|
sendPacket(new ClientboundSetEntityDataPacket(getId(), entityData.packDirty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stopBlocking(int cooldown) {
|
private void stopBlocking(int cooldown) {
|
||||||
this.blocking = false;
|
this.blocking = false;
|
||||||
stopUsingItem();
|
stopUsingItem();
|
||||||
scheduler.runTaskLater(plugin, () -> this.blockUse = false, cooldown);
|
scheduler.runTaskLater(plugin, () -> this.blockUse = false, cooldown);
|
||||||
sendPacket(new ClientboundSetEntityDataPacket(getId(), entityData, true));
|
//sendPacket(new ClientboundSetEntityDataPacket(getId(), entityData, true));
|
||||||
|
sendPacket(new ClientboundSetEntityDataPacket(getId(), entityData.packDirty()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -426,6 +426,7 @@ public class Bot extends ServerPlayer implements Terminator {
|
|||||||
return isBlocking();
|
return isBlocking();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setShield(boolean enabled) {
|
public void setShield(boolean enabled) {
|
||||||
this.shield = enabled;
|
this.shield = enabled;
|
||||||
|
|
||||||
@@ -621,7 +622,7 @@ public class Bot extends ServerPlayer implements Terminator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void removeTab() {
|
private void removeTab() {
|
||||||
sendPacket(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, this));
|
sendPacket(new ClientboundPlayerInfoRemovePacket(Arrays.asList(this.getUUID())));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRemoveOnDeath(boolean enabled) {
|
public void setRemoveOnDeath(boolean enabled) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import net.nuggetmc.tplus.api.agent.legacyagent.ai.NeuralNetwork;
|
|||||||
import net.nuggetmc.tplus.api.event.BotDeathEvent;
|
import net.nuggetmc.tplus.api.event.BotDeathEvent;
|
||||||
import net.nuggetmc.tplus.api.utils.MojangAPI;
|
import net.nuggetmc.tplus.api.utils.MojangAPI;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import net.nuggetmc.tplus.api.InternalBridge;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
|
import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.entity.CraftPlayer;
|
import org.bukkit.craftbukkit.v1_19_R2.entity.CraftPlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class InternalBridgeImpl implements InternalBridge {
|
public class InternalBridgeImpl implements InternalBridge {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import net.nuggetmc.tplus.command.commands.MainCommand;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.command.SimpleCommandMap;
|
import org.bukkit.command.SimpleCommandMap;
|
||||||
import org.bukkit.craftbukkit.v1_19_R1.CraftServer;
|
import org.bukkit.craftbukkit.v1_19_R2.CraftServer;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|||||||
@@ -237,6 +237,10 @@ public class Debugger {
|
|||||||
TerminatorPlus.getInstance().getManager().fetch().forEach(bot -> bot.block(10, 10));
|
TerminatorPlus.getInstance().getManager().fetch().forEach(bot -> bot.block(10, 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void shield() {
|
||||||
|
TerminatorPlus.getInstance().getManager().fetch().forEach(bot -> bot.setShield(true));
|
||||||
|
}
|
||||||
|
|
||||||
public void offsets(boolean b) {
|
public void offsets(boolean b) {
|
||||||
Agent agent = TerminatorPlus.getInstance().getManager().getAgent();
|
Agent agent = TerminatorPlus.getInstance().getManager().getAgent();
|
||||||
if (!(agent instanceof LegacyAgent)) {
|
if (!(agent instanceof LegacyAgent)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user