mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2025-01-21 07:41:42 +01:00
Fix 1.8 tile sending
This commit is contained in:
parent
ca12752b78
commit
424bcc5d05
@ -41,6 +41,7 @@ import net.minecraft.server.v1_8_R3.LongHashMap;
|
|||||||
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
import net.minecraft.server.v1_8_R3.MinecraftServer;
|
||||||
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
import net.minecraft.server.v1_8_R3.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_8_R3.NibbleArray;
|
import net.minecraft.server.v1_8_R3.NibbleArray;
|
||||||
|
import net.minecraft.server.v1_8_R3.Packet;
|
||||||
import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunk;
|
import net.minecraft.server.v1_8_R3.PacketPlayOutMapChunk;
|
||||||
import net.minecraft.server.v1_8_R3.PlayerChunkMap;
|
import net.minecraft.server.v1_8_R3.PlayerChunkMap;
|
||||||
import net.minecraft.server.v1_8_R3.ServerNBTManager;
|
import net.minecraft.server.v1_8_R3.ServerNBTManager;
|
||||||
@ -466,6 +467,14 @@ public class BukkitQueue18R3 extends BukkitQueue_0<Chunk, ChunkSection[], ChunkS
|
|||||||
for (EntityPlayer player : players) {
|
for (EntityPlayer player : players) {
|
||||||
player.playerConnection.sendPacket(packet);
|
player.playerConnection.sendPacket(packet);
|
||||||
}
|
}
|
||||||
|
// Send tiles
|
||||||
|
for (Map.Entry<BlockPosition, TileEntity> entry : nmsChunk.getTileEntities().entrySet()) {
|
||||||
|
TileEntity tile = entry.getValue();
|
||||||
|
Packet tilePacket = tile.getUpdatePacket();
|
||||||
|
for (EntityPlayer player : players) {
|
||||||
|
player.playerConnection.sendPacket(tilePacket);
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
MainUtil.handleError(e);
|
MainUtil.handleError(e);
|
||||||
}
|
}
|
||||||
|
@ -12,4 +12,9 @@ public class FaweVersion {
|
|||||||
this.hash = Integer.parseInt(split[1], 16);
|
this.hash = Integer.parseInt(split[1], 16);
|
||||||
this.build = Integer.parseInt(split[2]);
|
this.build = Integer.parseInt(split[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "FastAsyncWorldEdit-" + year + "." + month + "." + day + "-" + Integer.toHexString(hash) + "-" + build;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
package com.boydti.fawe.command;
|
package com.boydti.fawe.command;
|
||||||
|
|
||||||
import com.boydti.fawe.Fawe;
|
import com.boydti.fawe.Fawe;
|
||||||
|
import com.boydti.fawe.FaweVersion;
|
||||||
|
import com.boydti.fawe.config.BBC;
|
||||||
import com.boydti.fawe.object.FaweCommand;
|
import com.boydti.fawe.object.FaweCommand;
|
||||||
import com.boydti.fawe.object.FawePlayer;
|
import com.boydti.fawe.object.FawePlayer;
|
||||||
import com.boydti.fawe.util.MainUtil;
|
import com.boydti.fawe.util.MainUtil;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
public class Reload extends FaweCommand {
|
public class Reload extends FaweCommand {
|
||||||
|
|
||||||
@ -13,8 +16,30 @@ public class Reload extends FaweCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(final FawePlayer player, final String... args) {
|
public boolean execute(final FawePlayer player, final String... args) {
|
||||||
Fawe.get().setupConfigs();
|
if (args.length != 1) {
|
||||||
MainUtil.sendMessage(player, "Reloaded configuration");
|
BBC.COMMAND_SYNTAX.send(player, "/fawe [reload|version");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
switch (args[0].toLowerCase()) {
|
||||||
|
case "version": {
|
||||||
|
FaweVersion version = Fawe.get().getVersion();
|
||||||
|
if (version == null) {
|
||||||
|
MainUtil.sendMessage(player, "No version information available.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
MainUtil.sendMessage(player, "Version Date: " + new Date(version.year, version.month, version.day).toLocaleString());
|
||||||
|
MainUtil.sendMessage(player, "Version Commit: " + Integer.toHexString(version.hash));
|
||||||
|
MainUtil.sendMessage(player, "Version Build: #" + version.build);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case "reload": {
|
||||||
|
Fawe.get().setupConfigs();
|
||||||
|
MainUtil.sendMessage(player, "Reloaded (" + Fawe.get().getVersion() + ").");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
BBC.COMMAND_SYNTAX.send(player, "/fawe [reload|version]");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,12 +25,20 @@ public class FaweException extends RuntimeException {
|
|||||||
return get(cause);
|
return get(cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This exception is thrown when a chunk fails to load in time
|
||||||
|
* - Chunks are loaded on the main thread to be accessed async
|
||||||
|
*/
|
||||||
public static class FaweChunkLoadException extends FaweException {
|
public static class FaweChunkLoadException extends FaweException {
|
||||||
public FaweChunkLoadException() {
|
public FaweChunkLoadException() {
|
||||||
super(BBC.WORLDEDIT_FAILED_LOAD_CHUNK);
|
super(BBC.WORLDEDIT_FAILED_LOAD_CHUNK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Faster exception throwing if you don't fill the stacktrace
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Throwable fillInStackTrace() {
|
public Throwable fillInStackTrace() {
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user