mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-06-11 20:13:55 +00:00
Merge master, update to texts
This commit is contained in:
@ -31,9 +31,11 @@ import com.sk89q.worldedit.math.Vector3;
|
||||
import com.sk89q.worldedit.session.SessionKey;
|
||||
import com.sk89q.worldedit.util.HandSide;
|
||||
import com.sk89q.worldedit.util.Location;
|
||||
import com.sk89q.worldedit.util.formatting.text.TextComponent;
|
||||
import com.sk89q.worldedit.util.formatting.text.serializer.gson.GsonComponentSerializer;
|
||||
import com.sk89q.worldedit.world.block.BaseBlock;
|
||||
import com.sk89q.worldedit.world.block.BlockStateHolder;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
@ -42,6 +44,7 @@ import net.minecraft.network.play.server.SPacketUpdateTileEntity;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
@ -49,8 +52,6 @@ import java.util.UUID;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
public class ForgePlayer extends AbstractPlayerActor {
|
||||
|
||||
private final EntityPlayerMP player;
|
||||
@ -141,6 +142,11 @@ public class ForgePlayer extends AbstractPlayerActor {
|
||||
sendColorized(msg, TextFormatting.RED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void print(TextComponent component) {
|
||||
this.player.sendMessage(ITextComponent.Serializer.fromJson(GsonComponentSerializer.INSTANCE.serialize(component)));
|
||||
}
|
||||
|
||||
private void sendColorized(String msg, TextFormatting formatting) {
|
||||
for (String part : msg.split("\n")) {
|
||||
TextComponentString component = new TextComponentString(part);
|
||||
|
@ -178,7 +178,7 @@ public class ForgeWorld extends AbstractWorld {
|
||||
}
|
||||
|
||||
if (successful && notifyAndLight) {
|
||||
//world.checkLight(pos);
|
||||
world.checkLight(pos);
|
||||
world.markAndNotifyBlock(pos, chunk, old, newState, UPDATE | NOTIFY);
|
||||
}
|
||||
|
||||
@ -426,6 +426,11 @@ public class ForgeWorld extends AbstractWorld {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxY() {
|
||||
return getWorld().getHeight() - 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockVector3 getSpawnPosition() {
|
||||
return ForgeAdapter.adapt(getWorld().getSpawnPoint());
|
||||
|
@ -22,9 +22,9 @@ package com.sk89q.worldedit.forge;
|
||||
import com.sk89q.worldedit.forge.gui.GuiReferenceCard;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraftforge.client.event.InputEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
import net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class KeyHandler {
|
||||
@ -37,11 +37,9 @@ public class KeyHandler {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKey(KeyInputEvent evt) {
|
||||
public void onKey(InputEvent.KeyInputEvent evt) {
|
||||
if (mc.player != null && mc.world != null && mainKey.isPressed()) {
|
||||
mc.displayGuiScreen(new GuiReferenceCard());
|
||||
// TODO Seems GuiHandlers don't work on client right now
|
||||
// NetworkHooks.openGui(mc.player, new ResourceLocationInteractionObject(ServerProxy.REFERENCE_GUI));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,16 +25,8 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@OnlyIn(Dist.DEDICATED_SERVER)
|
||||
public class ServerProxy implements CommonProxy {
|
||||
|
||||
// public static ResourceLocation REFERENCE_GUI = new ResourceLocation("worldedit", "resource_gui");
|
||||
|
||||
@Override
|
||||
public void registerHandlers() {
|
||||
// ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.GUIFACTORY, () -> openContainer -> {
|
||||
// if (openContainer.getId().equals(REFERENCE_GUI)) {
|
||||
// return new GuiReferenceCard();
|
||||
// }
|
||||
// return null;
|
||||
// });
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user