From d8c53d2060aa3029c41b9746f6c8b0a35fd6cbd4 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Tue, 29 Mar 2016 00:22:56 -0400 Subject: [PATCH] Fix CoFH-locked drawers crashing clients --- .../thermalfoundation/CoFHSecurityProvider.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/com/jaquadro/minecraft/storagedrawers/integration/thermalfoundation/CoFHSecurityProvider.java b/src/com/jaquadro/minecraft/storagedrawers/integration/thermalfoundation/CoFHSecurityProvider.java index 0ffe93e..68f3243 100644 --- a/src/com/jaquadro/minecraft/storagedrawers/integration/thermalfoundation/CoFHSecurityProvider.java +++ b/src/com/jaquadro/minecraft/storagedrawers/integration/thermalfoundation/CoFHSecurityProvider.java @@ -5,7 +5,6 @@ import com.jaquadro.minecraft.storagedrawers.api.storage.attribute.IProtectable; import com.jaquadro.minecraft.storagedrawers.integration.ThermalFoundation; import com.jaquadro.minecraft.storagedrawers.security.DefaultSecurityProvider; import com.mojang.authlib.GameProfile; -import net.minecraft.server.MinecraftServer; public class CoFHSecurityProvider implements ISecurityProvider { @@ -31,9 +30,9 @@ public class CoFHSecurityProvider implements ISecurityProvider if (target.getOwner() == null) return true; - GameProfile ownerProfile = MinecraftServer.getServer().func_152358_ax().func_152652_a(target.getOwner()); - if (ownerProfile == null) - return false; + GameProfile ownerProfile = (profile.getId().equals(target.getOwner())) + ? new GameProfile(profile.getId(), profile.getName()) + : new GameProfile(target.getOwner(), null); return foundation.playerHasAccess(profile.getName(), ownerProfile); }