Skip to content

Commit

Permalink
Merge branch '1.20.4' into server-renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
MATRIX-feather committed Jan 14, 2024
2 parents 2ef2f82 + 522f05e commit 9868c93
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project_version=1.0.0
project_version=1.0.2

# FM Protocols
protocols_version=09b2b0a077
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ private void onHeadRotation(ClientboundRotateHeadPacket packet, PacketEvent even
var sourceNmsEntity = packet.getEntity(NmsUtils.getNmsLevel(event.getPlayer().getWorld()));
if (sourceNmsEntity == null)
{
logger.warn("A packet from a player that doesn't exist in its world?!");
logger.warn("Packet: " + event.getPacketType());
if (isDebugEnabled())
{
logger.warn("A packet from a player that doesn't exist in its world?!");
logger.warn("Packet: " + event.getPacketType());
}

return;
}

Expand All @@ -134,8 +138,12 @@ private void onLookPacket(ClientboundMoveEntityPacket packet, PacketEvent event)
var sourceNmsEntity = packet.getEntity(NmsUtils.getNmsLevel(event.getPlayer().getWorld()));
if (sourceNmsEntity == null)
{
logger.warn("A packet from a player that doesn't exist in its world?!");
logger.warn("Packet: " + event.getPacketType());
if (isDebugEnabled())
{
logger.warn("A packet from a player that doesn't exist in its world?!");
logger.warn("Packet: " + event.getPacketType());
}

return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public org.bukkit.plugin.Plugin getPlugin()

private final Bindable<Boolean> debugOutput = new Bindable<>(false);

protected boolean isDebugEnabled()
{
return debugOutput.get();
}

@Initializer
private void load(MorphConfigManager configManager)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import xiamomc.morph.MorphManager;
import xiamomc.morph.MorphPluginObject;
import xiamomc.morph.messages.CommandStrings;
import xiamomc.morph.messages.MessageUtils;
import xiamomc.morph.misc.permissions.CommonPermissions;
import xiamomc.pluginbase.Annotations.Resolved;
import xiamomc.pluginbase.Command.ISubCommand;
import xiamomc.pluginbase.Messages.FormattableMessage;
Expand All @@ -21,6 +23,12 @@ public class LookupSubCommand extends MorphPluginObject implements ISubCommand
return "lookup";
}

@Override
public @Nullable String getPermissionRequirement()
{
return CommonPermissions.LOOKUP;
}

/**
* 获取此指令的帮助信息
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ public class CommonPermissions
public final static String DISGUISE_REVEALING = PERM_ROOT + "disguise_revealing";

public final static String CHECK_UPDATE = PERM_ROOT + "check_update";

public final static String LOOKUP = PERM_ROOT + "lookup";
}

0 comments on commit 9868c93

Please sign in to comment.