Push optimizations
* Attempt to fix vault screen text offsets * Begin implementation of creeper heal ** Legacy implementation of ZSchem3 will be added, along with modded implementation * Known: Will not build due to in-progress changes
This commit is contained in:
parent
04c558f2fc
commit
325a6ed11f
15 changed files with 261 additions and 68 deletions
|
@ -0,0 +1,8 @@
|
|||
package dev.zontreck.otemod.commands.antigrief;
|
||||
|
||||
// This will accelerate the healing queue, not do it instantly!
|
||||
// The queue will get processed at a rate of 10* the configured rate.
|
||||
public class HealNow
|
||||
{
|
||||
|
||||
}
|
|
@ -86,28 +86,7 @@ public class HomeCommand {
|
|||
position = dest.Position.asMinecraftVector();
|
||||
rot = dest.Rotation.asMinecraftVector();
|
||||
|
||||
String dim = dest.Dimension;
|
||||
String[] dims = dim.split(":");
|
||||
|
||||
ResourceLocation rl = new ResourceLocation(dims[0], dims[1]);
|
||||
|
||||
ServerLevel dimL = null;
|
||||
for (ServerLevel lServerLevel : p.server.getAllLevels()) {
|
||||
ResourceLocation XL = lServerLevel.dimension().location();
|
||||
|
||||
if(XL.getNamespace().equals(rl.getNamespace())){
|
||||
if(XL.getPath().equals(rl.getPath())){
|
||||
dimL = lServerLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(dimL == null)
|
||||
{
|
||||
SQL = "Failed to find the dimension";
|
||||
ctx.sendFailure(Component.literal(ChatColor.DARK_RED+ChatColor.BOLD+"FAILED TO LOCATE THAT DIMENSION. CONTACT THE SERVER ADMIN"));
|
||||
return 1;
|
||||
}
|
||||
ServerLevel dimL = dest.getActualDimension();
|
||||
|
||||
TeleportActioner.ApplyTeleportEffect(p);
|
||||
// Instantiate a Teleport Runner
|
||||
|
|
|
@ -52,7 +52,7 @@ public class SetHomeCommand {
|
|||
Vec3 position = p.position();
|
||||
Vec2 rot = p.getRotationVector();
|
||||
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3(position), new Vector2(rot), p.getLevel().dimension().location().getNamespace() + ":" + p.getLevel().dimension().location().getPath());
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3(position), new Vector2(rot), p.getLevel());
|
||||
|
||||
String SQL = "REPLACE INTO `homes` (user, home_name, teleporter) VALUES (?, ?, ?);";
|
||||
PreparedStatement pstat = con.prepareStatement(SQL);
|
||||
|
|
|
@ -49,7 +49,7 @@ public class RTPWarpCommand {
|
|||
Vec3 position = p.position();
|
||||
Vec2 rot = p.getRotationVector();
|
||||
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3(position), new Vector2(rot), p.getLevel().dimension().location().getNamespace() + ":" + p.getLevel().dimension().location().getPath());
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3(position), new Vector2(rot), p.getLevel());
|
||||
|
||||
String SQL = "REPLACE INTO `warps` (warpname, owner, warptype, teleporter) values (?, ?, ?, ?);";
|
||||
pstat = con.prepareStatement(SQL);
|
||||
|
|
|
@ -48,7 +48,7 @@ public class SetWarpCommand {
|
|||
Vec3 position = p.position();
|
||||
Vec2 rot = p.getRotationVector();
|
||||
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3(position), new Vector2(rot), p.getLevel().dimension().location().getNamespace() + ":" + p.getLevel().dimension().location().getPath());
|
||||
TeleportDestination dest = new TeleportDestination(new Vector3(position), new Vector2(rot), p.getLevel());
|
||||
|
||||
String SQL = "REPLACE INTO `warps` (warpname, owner, warptype, teleporter) values (?, ?, ?, ?);";
|
||||
pstat = con.prepareStatement(SQL);
|
||||
|
|
|
@ -59,27 +59,9 @@ public class WarpCommand {
|
|||
{
|
||||
TeleportDestination dest = new TeleportDestination(NbtUtils.snbtToStructure(rs.getString("teleporter")));
|
||||
|
||||
String dim = dest.Dimension;
|
||||
String[] dims = dim.split(":");
|
||||
|
||||
ResourceLocation rl = new ResourceLocation(dims[0], dims[1]);
|
||||
ServerLevel dimL = dest.getActualDimension();
|
||||
|
||||
ServerLevel dimL = null;
|
||||
for (ServerLevel lServerLevel : p.server.getAllLevels()) {
|
||||
ResourceLocation XL = lServerLevel.dimension().location();
|
||||
|
||||
if(XL.getNamespace().equals(rl.getNamespace())){
|
||||
if(XL.getPath().equals(rl.getPath())){
|
||||
dimL = lServerLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(dimL == null)
|
||||
{
|
||||
ChatServerOverride.broadcastTo(source.getPlayer().getUUID(), Component.literal(ChatColor.RED+"DIMENSION COULD NOT BE FOUND"), source.getServer());
|
||||
return 1;
|
||||
}
|
||||
|
||||
final int type = rs.getInt("warptype");
|
||||
final ServerLevel f_dim = dimL;
|
||||
|
|
Reference in a new issue