|
@@ -9,7 +9,7 @@ import me.km.exception.EntityNotFoundException;
|
|
import me.km.exception.IllegalItemStackStringException;
|
|
import me.km.exception.IllegalItemStackStringException;
|
|
import me.km.exception.IllegalStringLocationException;
|
|
import me.km.exception.IllegalStringLocationException;
|
|
import me.km.exception.PlayerNotFoundException;
|
|
import me.km.exception.PlayerNotFoundException;
|
|
-import me.km.nms.NmsUtilities;
|
|
|
|
|
|
+import me.km.utils.NBTUtils;
|
|
import me.km.plots.ProtectionBank;
|
|
import me.km.plots.ProtectionBank;
|
|
import me.km.table.TableAPI;
|
|
import me.km.table.TableAPI;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -40,10 +40,8 @@ import net.minecraft.command.ICommandSender;
|
|
import net.minecraft.enchantment.Enchantment;
|
|
import net.minecraft.enchantment.Enchantment;
|
|
import net.minecraft.enchantment.EnchantmentHelper;
|
|
import net.minecraft.enchantment.EnchantmentHelper;
|
|
import net.minecraft.entity.Entity;
|
|
import net.minecraft.entity.Entity;
|
|
-import net.minecraft.entity.EntityHanging;
|
|
|
|
import net.minecraft.entity.EntityLiving;
|
|
import net.minecraft.entity.EntityLiving;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
-import net.minecraft.entity.item.EntityArmorStand;
|
|
|
|
import net.minecraft.entity.item.EntityItemFrame;
|
|
import net.minecraft.entity.item.EntityItemFrame;
|
|
import net.minecraft.entity.monster.EntityCreeper;
|
|
import net.minecraft.entity.monster.EntityCreeper;
|
|
import net.minecraft.entity.passive.EntityVillager;
|
|
import net.minecraft.entity.passive.EntityVillager;
|
|
@@ -78,8 +76,11 @@ import me.hammerle.code.SnuviParser;
|
|
import me.hammerle.exceptions.HoldCodeException;
|
|
import me.hammerle.exceptions.HoldCodeException;
|
|
import me.hammerle.math.Fraction;
|
|
import me.hammerle.math.Fraction;
|
|
import me.km.inventory.CustomContainer;
|
|
import me.km.inventory.CustomContainer;
|
|
|
|
+import me.km.networking.ModPacketHandler;
|
|
|
|
+import me.km.pathfinder.PathfinderUtils;
|
|
import net.minecraft.entity.item.EntityItem;
|
|
import net.minecraft.entity.item.EntityItem;
|
|
import net.minecraft.util.math.MathHelper;
|
|
import net.minecraft.util.math.MathHelper;
|
|
|
|
+import net.minecraft.util.text.ITextComponent;
|
|
|
|
|
|
public class MinecraftFunctions implements ISnuviLogger
|
|
public class MinecraftFunctions implements ISnuviLogger
|
|
{
|
|
{
|
|
@@ -150,7 +151,7 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
parser.registerFunction("player.isafk", (args, qd) ->
|
|
parser.registerFunction("player.isafk", (args, qd) ->
|
|
KajetansMod.afkManager.getEvent(AfkListener.class).isAfk(((EntityPlayer) args[0])));
|
|
KajetansMod.afkManager.getEvent(AfkListener.class).isAfk(((EntityPlayer) args[0])));
|
|
parser.registerConsumer("player.speak", (args, qd) ->
|
|
parser.registerConsumer("player.speak", (args, qd) ->
|
|
- sendMessageToGroup(args[0], qd, "§7[§r" + args[1] + "§7] " + ScriptUtils.connect(args, 2)));
|
|
|
|
|
|
+ sendMessageToGroup(args[0], qd, NBTUtils.concat(2, "§7[§r" + args[1] + "§7]§r ", args)));
|
|
parser.registerConsumer("player.setcompass", (args, qd) ->
|
|
parser.registerConsumer("player.setcompass", (args, qd) ->
|
|
((EntityPlayerMP) args[0]).connection.sendPacket(new SPacketSpawnPosition(((Location) args[1]).getBlockPos())));
|
|
((EntityPlayerMP) args[0]).connection.sendPacket(new SPacketSpawnPosition(((Location) args[1]).getBlockPos())));
|
|
parser.registerFunction("player.gethunger", (args, qd) ->
|
|
parser.registerFunction("player.gethunger", (args, qd) ->
|
|
@@ -216,7 +217,7 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
parser.registerConsumer("players.toworldlist", (args, qd) ->
|
|
parser.registerConsumer("players.toworldlist", (args, qd) ->
|
|
qd.setVar(args[0].toString(), new ArrayList(ModDimensions.getWorldFromName(args[1].toString()).playerEntities)));
|
|
qd.setVar(args[0].toString(), new ArrayList(ModDimensions.getWorldFromName(args[1].toString()).playerEntities)));
|
|
parser.registerConsumer("players.near", (args, qd) ->
|
|
parser.registerConsumer("players.near", (args, qd) ->
|
|
- qd.setVar(args[0].toString(), new ArrayList(Utils.getNearbyEntities(((Location) args[1]).getWorld(), ((Location) args[1]).getPos(), ScriptUtils.getDouble(args[2]), EntityPlayer.class))));
|
|
|
|
|
|
+ nearPlayers(args, qd));
|
|
|
|
|
|
// -------------------------------------------------------------
|
|
// -------------------------------------------------------------
|
|
// Rank-Bibliothek
|
|
// Rank-Bibliothek
|
|
@@ -424,6 +425,8 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
((EntityLivingBase) args[0]).setHealth(ScriptUtils.getFloat(args[1])));
|
|
((EntityLivingBase) args[0]).setHealth(ScriptUtils.getFloat(args[1])));
|
|
parser.registerConsumer("entity.setname", (args, qd) ->
|
|
parser.registerConsumer("entity.setname", (args, qd) ->
|
|
nameEntity(args));
|
|
nameEntity(args));
|
|
|
|
+ parser.registerFunction("entity.getname", (args, qd) ->
|
|
|
|
+ ((Entity) args[0]).getDisplayName().getUnformattedText());
|
|
parser.registerConsumer("entity.throw", (args, qd) ->
|
|
parser.registerConsumer("entity.throw", (args, qd) ->
|
|
Utils.setVelocity((Entity) args[0], ScriptUtils.getDouble(args[1]), ScriptUtils.getDouble(args[2]), ScriptUtils.getDouble(args[3])));
|
|
Utils.setVelocity((Entity) args[0], ScriptUtils.getDouble(args[1]), ScriptUtils.getDouble(args[2]), ScriptUtils.getDouble(args[3])));
|
|
parser.registerConsumer("entity.teleport", (args, qd) ->
|
|
parser.registerConsumer("entity.teleport", (args, qd) ->
|
|
@@ -446,20 +449,20 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
((Entity) args[0]).setInvisible(false));
|
|
((Entity) args[0]).setInvisible(false));
|
|
parser.registerConsumer("entity.ride", (args, qd) ->
|
|
parser.registerConsumer("entity.ride", (args, qd) ->
|
|
((Entity) args[0]).startRiding(((Entity) args[1])));
|
|
((Entity) args[0]).startRiding(((Entity) args[1])));
|
|
- parser.registerConsumer("entity.setvars", (args, qd) ->
|
|
|
|
- ScriptVars.setEntityVars(qd, Utils.getNearestEntity(((Location) args[0]).getWorld(), ((Location) args[0]).getPos(), 3, (Class<? extends Entity>) getClass("net.minecraft.entity." + args[1]))));
|
|
|
|
parser.registerConsumer("entity.addeffect", (args, qd) ->
|
|
parser.registerConsumer("entity.addeffect", (args, qd) ->
|
|
addEffect(args));
|
|
addEffect(args));
|
|
parser.registerFunction("entity.haseffect", (args, qd) ->
|
|
parser.registerFunction("entity.haseffect", (args, qd) ->
|
|
((EntityLivingBase) args[0]).isPotionActive(Potion.getPotionFromResourceLocation(args[1].toString())));
|
|
((EntityLivingBase) args[0]).isPotionActive(Potion.getPotionFromResourceLocation(args[1].toString())));
|
|
parser.registerConsumer("entity.goto", (args, qd) ->
|
|
parser.registerConsumer("entity.goto", (args, qd) ->
|
|
- NmsUtilities.walkTo((EntityLiving) args[0], ((Location) args[1]).getPos(), ScriptUtils.getDouble(args[2])));
|
|
|
|
|
|
+ walkTo(args));
|
|
parser.registerConsumer("entity.explode", (args, qd) ->
|
|
parser.registerConsumer("entity.explode", (args, qd) ->
|
|
((EntityCreeper) args[0]).ignite());
|
|
((EntityCreeper) args[0]).ignite());
|
|
parser.registerConsumer("entity.spawnitemframe", (args, qd) ->
|
|
parser.registerConsumer("entity.spawnitemframe", (args, qd) ->
|
|
spawnItemFrame(args));
|
|
spawnItemFrame(args));
|
|
parser.registerFunction("entity.getitemframe", (args, qd) ->
|
|
parser.registerFunction("entity.getitemframe", (args, qd) ->
|
|
- Utils.getNearestEntity(((Location) args[0]).getWorld(), ((Location) args[0]).getPos().addVector(0.5, 0, 0.5), 1, EntityItemFrame.class).getDisplayedItem());
|
|
|
|
|
|
+ ((EntityItemFrame) args[0]).getDisplayedItem());
|
|
|
|
+ parser.registerFunction("entity.get", (args, qd) ->
|
|
|
|
+ getEntity(args));
|
|
parser.registerFunction("entity.getpotiontype", (args, qd) ->
|
|
parser.registerFunction("entity.getpotiontype", (args, qd) ->
|
|
getPotionType(args));
|
|
getPotionType(args));
|
|
parser.registerConsumer("entity.setgravity", (args, qd) ->
|
|
parser.registerConsumer("entity.setgravity", (args, qd) ->
|
|
@@ -600,6 +603,16 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
removeFromScoreBoard(args, qd));
|
|
removeFromScoreBoard(args, qd));
|
|
parser.registerConsumer("sb.reset", (args, qd) ->
|
|
parser.registerConsumer("sb.reset", (args, qd) ->
|
|
doForGroup(args[0], qd, p -> KajetansMod.scoreboard.resetScoreboard((EntityPlayerMP) p)));
|
|
doForGroup(args[0], qd, p -> KajetansMod.scoreboard.resetScoreboard((EntityPlayerMP) p)));
|
|
|
|
+
|
|
|
|
+ // -------------------------------------------------------------
|
|
|
|
+ // Display-Bibliothek
|
|
|
|
+ // -------------------------------------------------------------
|
|
|
|
+ parser.registerConsumer("display.add", (args, qd) ->
|
|
|
|
+ addToDisplay(args, qd));
|
|
|
|
+ parser.registerConsumer("display.remove", (args, qd) ->
|
|
|
|
+ removeFromDisplay(args, qd));
|
|
|
|
+ parser.registerConsumer("display.reset", (args, qd) ->
|
|
|
|
+ doForGroup(args[0], qd, p -> ModPacketHandler.sendStats((EntityPlayerMP) p, 3, -1, "")));
|
|
|
|
|
|
// -------------------------------------------------------------
|
|
// -------------------------------------------------------------
|
|
// Effect-Bibliothek
|
|
// Effect-Bibliothek
|
|
@@ -635,7 +648,7 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
parser.registerFunction("read.item", (args, qd) ->
|
|
parser.registerFunction("read.item", (args, qd) ->
|
|
ScriptHelper.getItemStack(args, 0));
|
|
ScriptHelper.getItemStack(args, 0));
|
|
parser.registerFunction("read.spawnmob", (args, qd) ->
|
|
parser.registerFunction("read.spawnmob", (args, qd) ->
|
|
- NmsUtilities.getEntityFromNbtString(qd, ScriptUtils.connect(args," ", 1).replace("'", "\""), (Location) args[0]));
|
|
|
|
|
|
+ NBTUtils.fromString(qd, ScriptUtils.connect(args," ", 1).replace("'", "\""), (Location) args[0]));
|
|
|
|
|
|
// -------------------------------------------------------------
|
|
// -------------------------------------------------------------
|
|
// Text-Bibliothek
|
|
// Text-Bibliothek
|
|
@@ -646,6 +659,10 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
((Location) args[0]).toBlockString());
|
|
((Location) args[0]).toBlockString());
|
|
parser.registerFunction("text.item", (args, qd) ->
|
|
parser.registerFunction("text.item", (args, qd) ->
|
|
ScriptHelper.getItemStackString((ItemStack) args[0]));
|
|
ScriptHelper.getItemStackString((ItemStack) args[0]));
|
|
|
|
+ parser.registerFunction("text.click", (args, qd) ->
|
|
|
|
+ NBTUtils.getClickable(args[0], args[1].toString()));
|
|
|
|
+ parser.registerFunction("text.hover", (args, qd) ->
|
|
|
|
+ NBTUtils.getHoverable(args[0], args[1].toString()));
|
|
|
|
|
|
// -------------------------------------------------------------
|
|
// -------------------------------------------------------------
|
|
// Ohne Bibliothek
|
|
// Ohne Bibliothek
|
|
@@ -659,7 +676,7 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
setGlobalVar(args));
|
|
setGlobalVar(args));
|
|
parser.registerAlias("sgv", "setglobalvar");
|
|
parser.registerAlias("sgv", "setglobalvar");
|
|
parser.registerConsumer("msg", (args, qd) ->
|
|
parser.registerConsumer("msg", (args, qd) ->
|
|
- sendMessageToGroup(args[0], qd, ScriptUtils.connect(args, 1)));
|
|
|
|
|
|
+ sendMessageToGroup(args[0], qd, NBTUtils.concat(1, args)));
|
|
parser.registerFunction("removeformat", (args, qd) ->
|
|
parser.registerFunction("removeformat", (args, qd) ->
|
|
ScriptUtils.connect(args, 0).replaceAll("§.", ""));
|
|
ScriptUtils.connect(args, 0).replaceAll("§.", ""));
|
|
parser.registerFunction("concatspace", (args, qd) ->
|
|
parser.registerFunction("concatspace", (args, qd) ->
|
|
@@ -718,7 +735,7 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
}
|
|
}
|
|
TableAPI.getTable(t, ScriptUtils.getInt(args[2]), args[3].toString(),
|
|
TableAPI.getTable(t, ScriptUtils.getInt(args[2]), args[3].toString(),
|
|
args.length >= 5 ? (boolean) args[4] : false)
|
|
args.length >= 5 ? (boolean) args[4] : false)
|
|
- .forEach(s -> sendMessageToGroup(args[0], sc, s));
|
|
|
|
|
|
+ .forEach(s -> sendMessageToGroup(args[0], sc, new TextComponentString(s)));
|
|
}
|
|
}
|
|
|
|
|
|
private static Location getBedLocation(Object[] args)
|
|
private static Location getBedLocation(Object[] args)
|
|
@@ -746,6 +763,12 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
((BlockDoor) l.getWorld().getBlockState(pos).getBlock()).toggleDoor(l.getWorld(), pos, (boolean) args[1]);
|
|
((BlockDoor) l.getWorld().getBlockState(pos).getBlock()).toggleDoor(l.getWorld(), pos, (boolean) args[1]);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static void walkTo(Object[] args)
|
|
|
|
+ {
|
|
|
|
+ Location l = (Location) args[1];
|
|
|
|
+ PathfinderUtils.walkTo((EntityLiving) args[0], l.getX(), l.getY(), l.getZ(), ScriptUtils.getDouble(args[2]));
|
|
|
|
+ }
|
|
|
|
+
|
|
private static void playerSay(Object[] args)
|
|
private static void playerSay(Object[] args)
|
|
{
|
|
{
|
|
try
|
|
try
|
|
@@ -914,11 +937,11 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
Location l = (Location) args[0];
|
|
Location l = (Location) args[0];
|
|
if(args.length >= 4)
|
|
if(args.length >= 4)
|
|
{
|
|
{
|
|
- NmsUtilities.setBlockWithData(l.getWorld(), l.getBlockPos(), ScriptUtils.getInt(args[2]), Block.getBlockFromName(args[1].toString()), ScriptUtils.connect(args, 3));
|
|
|
|
|
|
+ NBTUtils.setBlockWithData(l.getWorld(), l.getBlockPos(), ScriptUtils.getInt(args[2]), Block.getBlockFromName(args[1].toString()), ScriptUtils.connect(args, 3));
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- NmsUtilities.setBlockWithData(l.getWorld(), l.getBlockPos(), ScriptUtils.getInt(args[2]), Block.getBlockFromName(args[1].toString()), null);
|
|
|
|
|
|
+ NBTUtils.setBlockWithData(l.getWorld(), l.getBlockPos(), ScriptUtils.getInt(args[2]), Block.getBlockFromName(args[1].toString()), null);
|
|
}
|
|
}
|
|
qd.incLoopCounter();
|
|
qd.incLoopCounter();
|
|
}
|
|
}
|
|
@@ -942,8 +965,9 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
|
|
|
|
private static void playParticle(Object[] args) throws IllegalStringLocationException
|
|
private static void playParticle(Object[] args) throws IllegalStringLocationException
|
|
{
|
|
{
|
|
- Location l = ((Location) args[0]).copyAdd(0.5, 0.5, 0.5);
|
|
|
|
- EffectUtils.spawnParticle((WorldServer) l.getWorld(), EnumParticleTypes.getByName(args[1].toString()), l.getPos(), ScriptUtils.getInt(args[2]));
|
|
|
|
|
|
+ Location l = ((Location) args[0]);
|
|
|
|
+ EffectUtils.spawnParticle((WorldServer) l.getWorld(), EnumParticleTypes.getByName(args[1].toString()),
|
|
|
|
+ l.getX() + 0.5, l.getY() + 0.5, l.getZ() + 0.5, ScriptUtils.getInt(args[2]));
|
|
}
|
|
}
|
|
|
|
|
|
private static void setEntityEquip(Object[] args) throws IllegalStringLocationException, EntityNotFoundException, IllegalItemStackStringException
|
|
private static void setEntityEquip(Object[] args) throws IllegalStringLocationException, EntityNotFoundException, IllegalItemStackStringException
|
|
@@ -971,7 +995,7 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
liv.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, stack);
|
|
liv.setItemStackToSlot(EntityEquipmentSlot.OFFHAND, stack);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
private static ItemStack getEntityEquip(Object[] args) throws IllegalStringLocationException, EntityNotFoundException
|
|
private static ItemStack getEntityEquip(Object[] args) throws IllegalStringLocationException, EntityNotFoundException
|
|
{
|
|
{
|
|
EntityLivingBase liv = (EntityLivingBase) args[0];
|
|
EntityLivingBase liv = (EntityLivingBase) args[0];
|
|
@@ -1010,12 +1034,12 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
private static void removeEntities(Object[] args) throws IllegalStringLocationException
|
|
private static void removeEntities(Object[] args) throws IllegalStringLocationException
|
|
{
|
|
{
|
|
Class<? extends Entity> c = (Class<? extends Entity>) getClass(args[0].toString());
|
|
Class<? extends Entity> c = (Class<? extends Entity>) getClass(args[0].toString());
|
|
- if(c == Entity.class || c == EntityVillager.class || c == EntityArmorStand.class || c == EntityItemFrame.class || c == EntityHanging.class)
|
|
|
|
|
|
+ if(c == Entity.class)
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
Location l = (Location) args[1];
|
|
Location l = (Location) args[1];
|
|
- Utils.getNearbyEntities(l.getWorld(), l.getPos(), ScriptUtils.getDouble(args[2]), c).stream().forEach(ent ->
|
|
|
|
|
|
+ Utils.getEntities(l.getWorld(), l.getX(), l.getY(), l.getZ(), ScriptUtils.getDouble(args[2]), c).stream().forEach(ent ->
|
|
{
|
|
{
|
|
ent.setDead();
|
|
ent.setDead();
|
|
});
|
|
});
|
|
@@ -1096,11 +1120,24 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
int id = ScriptUtils.getInt(args[1]);
|
|
int id = ScriptUtils.getInt(args[1]);
|
|
doForGroup(args[0], qd, p -> KajetansMod.scoreboard.getScoreboard((EntityPlayerMP) p).removeText(id));
|
|
doForGroup(args[0], qd, p -> KajetansMod.scoreboard.getScoreboard((EntityPlayerMP) p).removeText(id));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ private static void addToDisplay(Object[] args, Script qd) throws PlayerNotFoundException
|
|
|
|
+ {
|
|
|
|
+ int id = ScriptUtils.getInt(args[1]);
|
|
|
|
+ String message = ScriptUtils.connect(args, 2);
|
|
|
|
+ doForGroup(args[0], qd, p -> ModPacketHandler.sendStats((EntityPlayerMP) p, 1, id, message));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static void removeFromDisplay(Object[] args, Script qd) throws PlayerNotFoundException
|
|
|
|
+ {
|
|
|
|
+ int id = ScriptUtils.getInt(args[1]);
|
|
|
|
+ doForGroup(args[0], qd, p -> ModPacketHandler.sendStats((EntityPlayerMP) p, 2, id, ""));
|
|
|
|
+ }
|
|
|
|
|
|
private static void sendToActionBar(Object[] args, Script qd) throws PlayerNotFoundException
|
|
private static void sendToActionBar(Object[] args, Script qd) throws PlayerNotFoundException
|
|
{
|
|
{
|
|
- String text = ScriptUtils.connect(args, 1);
|
|
|
|
- doForGroup(args[0], qd, p -> NmsUtilities.sendActionBar((EntityPlayerMP) p, text));
|
|
|
|
|
|
+ TextComponentString text = new TextComponentString(ScriptUtils.connect(args, 1));
|
|
|
|
+ doForGroup(args[0], qd, p -> ((EntityPlayerMP) p).sendStatusMessage(text, true));
|
|
}
|
|
}
|
|
|
|
|
|
private static void kickPlayerFromQuest(Object[] args, Script qd) throws PlayerNotFoundException, UnsupportedOperationException
|
|
private static void kickPlayerFromQuest(Object[] args, Script qd) throws PlayerNotFoundException, UnsupportedOperationException
|
|
@@ -1172,6 +1209,12 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
return ds.getImmediateSource();
|
|
return ds.getImmediateSource();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static void nearPlayers(Object[] args, Script sc)
|
|
|
|
+ {
|
|
|
|
+ Location l = (Location) args[1];
|
|
|
|
+ sc.setVar(args[0].toString(), Utils.getPlayers(l.getWorld(), l.getX(), l.getY(), l.getZ(), ScriptUtils.getDouble(args[2])));
|
|
|
|
+ }
|
|
|
|
+
|
|
@SuppressWarnings("")
|
|
@SuppressWarnings("")
|
|
private static SnuviInventory newInventory(Location l, MinecraftScript qd, String s)
|
|
private static SnuviInventory newInventory(Location l, MinecraftScript qd, String s)
|
|
{
|
|
{
|
|
@@ -1203,6 +1246,12 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static Entity getEntity(Object[] args)
|
|
|
|
+ {
|
|
|
|
+ Location l = (Location) args[0];
|
|
|
|
+ return Utils.getEntity(l.getWorld(), l.getX(), l.getY(), l.getZ(), ScriptUtils.getDouble(args[1]), getClass(args[2].toString()));
|
|
|
|
+ }
|
|
|
|
+
|
|
private static String getName(Object[] args)
|
|
private static String getName(Object[] args)
|
|
{
|
|
{
|
|
Object o = args[0];
|
|
Object o = args[0];
|
|
@@ -1393,12 +1442,11 @@ public class MinecraftFunctions implements ISnuviLogger
|
|
c.accept((EntityPlayer) group);
|
|
c.accept((EntityPlayer) group);
|
|
}
|
|
}
|
|
|
|
|
|
- private static void sendMessageToGroup(Object group, Script sc, String message)
|
|
|
|
|
|
+ private static void sendMessageToGroup(Object group, Script sc, ITextComponent text)
|
|
{
|
|
{
|
|
- TextComponentString comp = new TextComponentString(message);
|
|
|
|
doForGroup(group, sc, p ->
|
|
doForGroup(group, sc, p ->
|
|
{
|
|
{
|
|
- p.sendMessage(comp);
|
|
|
|
|
|
+ p.sendMessage(text);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|