mirror of
https://github.com/GTNewHorizons/CraftTweaker.git
synced 2026-11-28 15:36:06 +00:00
- Fixed crash when using mt command from server console
- Forum command now leads to the new forums - Checked in some missing files from previous commit
This commit is contained in:
1 parent
1b72abb2b4
commit
e644398505
17 files changed
+923
-9
No files matched your search
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package minetweaker.mc172.server;
|
||||
|
||||
import java.awt.Desktop;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import minetweaker.api.chat.IChatMessage;
|
||||
import minetweaker.api.data.IData;
|
||||
import minetweaker.api.item.IItemStack;
|
||||
import minetweaker.api.player.IPlayer;
|
||||
import net.minecraft.server.dedicated.DedicatedServer;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Stan
|
||||
*/
|
||||
public class ServerPlayer implements IPlayer {
|
||||
public static final ServerPlayer INSTANCE = new ServerPlayer();
|
||||
|
||||
private ServerPlayer() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "server";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Server";
|
||||
}
|
||||
|
||||
@Override
|
||||
public IData getData() {
|
||||
// TODO: implement
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(IData data) {
|
||||
// TODO: implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendChat(IChatMessage message) {
|
||||
DedicatedServer.getServer().addChatMessage((IChatComponent) message.getInternal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHotbarSize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemStack getHotbarStack(int i) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getInventorySize() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemStack getInventoryStack(int i) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemStack getCurrentItem() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openBrowser(String url) {
|
||||
if (Desktop.isDesktopSupported()) {
|
||||
try {
|
||||
Desktop.getDesktop().browse(URI.create(url));
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(ServerPlayer.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user