package org.granitemc.granite.utils;

import org.granitemc.granite.chat.GraniteChatComponentText;

public class MinecraftUtils {
    // Todo: This method was missing from the repo, and I really have no idea what it's supposed to do. I have recreated it to the best of my abilities. ~Jckf
    public static Object wrap(Object object) {
        if (Mappings.getClass("net.minecraft.command.ICommandSender").isInstance(object)) {
            // return new GraniteCommandSender(object);
        } else if (Mappings.getClass("net.minecraft.util.IChatComponent").isInstance(object)) {
            return new GraniteChatComponentText(object);
        }

        return null;
    }
}

@@ -35,370 +35,1762 @@
 s;%0A%0A
-import org.granitemc.
+/*****************************************************************************************%0A * License (MIT)%0A *%0A * Copyright (c) 2014. Granite Team%0A *%0A * Permission is hereby 
 gran
-i
 te
-.chat.GraniteChatComponentText;%0A%0Apublic class MinecraftUtils %7B%0A    // Todo: This method was missing from the repo, and I really have no idea what it's supposed to do. I have recreated it to the best of my abilities. ~Jckf%0A    public static Object wrap(Object object) %7B%0A        if (Mappings.getClass(%22net.minecraft.command.ICommandSend
+d, free of charge, to any person obtaining a copy of this%0A * software and associated documentation files (the %22Software%22), to deal in the%0A * Software without restriction, including without limitation the rights to use, copy,%0A * modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,%0A * and to permit persons to whom the Software is furnished to do so, subject to the%0A * following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in all%0A * copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,%0A * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A%0A * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT%0A * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION%0A * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE%0A * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A ****************************************************************************************/%0A%0Aimport org.granitemc.granite.chat.GraniteChatComponentText;%0Aimport org.granitemc.granite.entity.player.GranitePlayer;%0Aimport org.granitemc.granite.reflect.ServerComposite;%0A%0Apublic class MinecraftUtils %7B%0A    public static Object wrap(Object object) %7B%0A        if (Mappings.getClass(%22n.m.server.MinecraftServer%22).isInstance(object)) %7B%0A            return ServerComposite.instance;%0A        %7D else if (Mappings.getClass(%22n.m.entity.player.EntityPlay
 er%22)
@@ -1827,11 +1827,8 @@
     
- //
  ret
@@ -1846,19 +1846,12 @@
 nite
-CommandSend
+Play
 er(o
@@ -1915,17 +1915,16 @@
 ft.util.
-I
 ChatComp
@@ -1928,16 +1928,20 @@
 omponent
+Text
 %22).isIns
@@ -2024,17 +2024,16 @@
       %7D%0A
-%0A
         

Fix MinecraftUtils