1 package com.irtimaled.bbor.client.interop;
3 import com.irtimaled.bbor.client.PlayerCoords;
4 import com.irtimaled.bbor.client.events.DisconnectedFromRemoteServer;
5 import com.irtimaled.bbor.client.events.Render;
6 import com.irtimaled.bbor.client.events.SeedCommandTyped;
7 import com.irtimaled.bbor.client.events.UpdateWorldSpawnReceived;
8 import com.irtimaled.bbor.common.EventBus;
9 import net.minecraft.client.entity.EntityPlayerSP;
10 import net.minecraft.util.math.BlockPos;
12 public class ClientInterop {
13 public static void disconnectedFromRemoteServer() {
14 EventBus.publish(new DisconnectedFromRemoteServer());
17 public static void render(float partialTicks, EntityPlayerSP player) {
18 PlayerCoords.setPlayerPosition(partialTicks, player);
19 EventBus.publish(new Render(player.dimension));
22 public static boolean interceptChatMessage(String message) {
23 if (message.startsWith("/bbor:seed")) {
24 if (message.length() > 11) {
25 String argument = message.substring(11);
26 Long seed = parseNumericSeed(argument);
28 seed = (long) argument.hashCode();
30 EventBus.publish(new SeedCommandTyped(seed));
37 private static Long parseNumericSeed(String argument) {
39 return Long.parseLong(argument);
40 } catch (final NumberFormatException ex) {
45 public static void updateWorldSpawnReceived(BlockPos blockPos) {
46 EventBus.publish(new UpdateWorldSpawnReceived(blockPos.getX(), blockPos.getZ()));