Skip to content

Commit

Permalink
Fix EntityFramed
Browse files Browse the repository at this point in the history
also typo fix and extra meta note
  • Loading branch information
mcmonkey4eva committed Jul 24, 2021
1 parent 180da25 commit 81b4c00
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Expand Up @@ -105,7 +105,7 @@ default void setMapData(MapCanvas canvas, byte[] bytes, int x, int y, MapImage i
}
}

default void showDebugTestMaker(Player player, Location location, ColorTag color, int alpha, String name, int time) {
default void showDebugTestMarker(Player player, Location location, ColorTag color, int alpha, String name, int time) {
throw new UnsupportedOperationException();
}

Expand Down
Expand Up @@ -11,14 +11,13 @@
import com.denizenscript.denizencore.utilities.CoreUtilities;
import org.bukkit.Material;
import org.bukkit.Rotation;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.ItemFrame;

public class EntityFramed implements Property {

// TODO: Possibly merge class with EntityItem?
public static boolean describes(ObjectTag entity) {
return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntityType() == EntityType.ITEM_FRAME;
return entity instanceof EntityTag && ((EntityTag) entity).getBukkitEntity() instanceof ItemFrame;
}

public static EntityFramed getFrom(ObjectTag entity) {
Expand Down
Expand Up @@ -130,7 +130,7 @@ public void execute(ScriptEntry scriptEntry) {
int alphaInt = (int) (alpha.asFloat() * 255);
for (LocationTag location : locations) {
for (PlayerTag player : players) {
NMSHandler.getPacketHelper().showDebugTestMaker(player.getPlayerEntity(), location, color, alphaInt, name == null ? "" : name.asString(), (int) duration.getMillis());
NMSHandler.getPacketHelper().showDebugTestMarker(player.getPlayerEntity(), location, color, alphaInt, name == null ? "" : name.asString(), (int) duration.getMillis());
}
}
}
Expand Down
Expand Up @@ -155,6 +155,7 @@ public class EnchantmentScriptContainer extends ScriptContainer {
// - narrate "You attacked <context.victim.name> with a <context.level> enchantment!"
//
// # Triggered after an enchanted armor is used to defend against an attack.
// # Also fires if an entity is holding a weapon with this enchantment while being hit.
// # Has <context.attacker> (EntityTag), <context.victim> (EntityTag), and <context.level>.
// # | Some enchantment scripts should have this key.
// after hurt:
Expand Down
Expand Up @@ -450,7 +450,7 @@ public void setNetworkManagerFor(Player player) {
}

@Override
public void showDebugTestMaker(Player player, Location location, ColorTag color, int alpha, String name, int time) {
public void showDebugTestMarker(Player player, Location location, ColorTag color, int alpha, String name, int time) {
ResourceLocation packetKey = new ResourceLocation("minecraft", "debug/game_test_add_marker");
FriendlyByteBuf buf = new FriendlyByteBuf(Unpooled.buffer());
buf.writeBlockPos(new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
Expand Down

0 comments on commit 81b4c00

Please sign in to comment.