Skip to content

Commit

Permalink
Fix resources reload command in 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed May 6, 2016
1 parent f397bd5 commit 6609e31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.BlockPos;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import org.cyclops.cyclopscore.CyclopsCore;
import org.cyclops.cyclopscore.init.ModBase;
import org.cyclops.cyclopscore.network.packet.ReloadResourcesPacket;
Expand All @@ -23,17 +24,17 @@ public CommandReloadResources(ModBase mod) {
}

@Override
public List addTabCompletionOptions(ICommandSender sender, String[] parts, BlockPos blockPos) {
public List getTabCompletionOptions(MinecraftServer server, ICommandSender icommandsender, String[] astring, BlockPos blockPos) {
return null;
}

@Override
public boolean canCommandSenderUseCommand(ICommandSender sender) {
public boolean checkPermission(MinecraftServer server, ICommandSender sender) {
return sender instanceof EntityPlayerMP;
}

@Override
public void processCommand(ICommandSender sender, String[] parts) {
public void execute(MinecraftServer server, ICommandSender sender, String[] parts) {
CyclopsCore._instance.getPacketHandler().sendToPlayer(new ReloadResourcesPacket(), (EntityPlayerMP) sender);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
Expand Down Expand Up @@ -34,7 +34,7 @@ public void actionClient(World world, EntityPlayer player) {
long start = System.currentTimeMillis();
Minecraft.getMinecraft().refreshResources();
long end = System.currentTimeMillis();
player.addChatMessage(new ChatComponentText(String.format("Reloaded all resources in %s ms", end - start)));
player.addChatMessage(new TextComponentString(String.format("Reloaded all resources in %s ms", end - start)));
}

@Override
Expand Down

0 comments on commit 6609e31

Please sign in to comment.