mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-02-01 00:10:15 +00:00
Add button to view computer's folder
Implementation is a little awkward, as we can't send OPEN_FILE links from the server, so we ensure the client runs a /computercraft open-computer ID command instead. We then intercept this on the client side and use that to open the folder.
This commit is contained in:
@@ -57,14 +57,15 @@ public enum UserLevel implements Predicate<CommandSource>
|
||||
{
|
||||
if( this == ANYONE ) return true;
|
||||
|
||||
// We *always* allow level 0 stuff, even if the
|
||||
MinecraftServer server = source.getServer();
|
||||
Entity sender = source.getEntity();
|
||||
|
||||
if( server.isSingleplayer() && sender instanceof PlayerEntity &&
|
||||
((PlayerEntity) sender).getGameProfile().getName().equalsIgnoreCase( server.getServerModName() ) )
|
||||
if( this == OWNER || this == OWNER_OP )
|
||||
{
|
||||
if( this == OWNER || this == OWNER_OP ) return true;
|
||||
MinecraftServer server = source.getServer();
|
||||
Entity sender = source.getEntity();
|
||||
if( server.isSingleplayer() && sender instanceof PlayerEntity &&
|
||||
((PlayerEntity) sender).getGameProfile().getName().equalsIgnoreCase( server.getServerModName() ) )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return source.hasPermission( toLevel() );
|
||||
|
||||
Reference in New Issue
Block a user