mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-27 07:11:04 -04:00
Quick fix for /paste throwing a NullReferenceException. (Thanks goodlyay)
This commit is contained in:
parent
fbd3db48eb
commit
17eb068d51
@ -21,15 +21,15 @@ using MCGalaxy.Drawing.Brushes;
|
|||||||
|
|
||||||
namespace MCGalaxy {
|
namespace MCGalaxy {
|
||||||
|
|
||||||
public struct FillPos { public ushort X, Y, Z; }
|
public struct FillPos { public ushort X, Y, Z; }
|
||||||
|
|
||||||
public struct ExtBlock {
|
public struct ExtBlock {
|
||||||
public byte Type, ExtType;
|
public byte Type, ExtType;
|
||||||
|
|
||||||
public ExtBlock(byte type, byte extType) {
|
public ExtBlock(byte type, byte extType) {
|
||||||
Type = type; ExtType = extType;
|
Type = type; ExtType = extType;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace MCGalaxy.Drawing.Ops {
|
namespace MCGalaxy.Drawing.Ops {
|
||||||
@ -128,7 +128,7 @@ namespace MCGalaxy.Drawing.Ops {
|
|||||||
internal const int MethodBlockQueue = 0, MethodBlockChange = 1, MethodSetTile = 2;
|
internal const int MethodBlockQueue = 0, MethodBlockChange = 1, MethodSetTile = 2;
|
||||||
|
|
||||||
public static bool DoDrawOp(DrawOp op, Brush brush, Player p,
|
public static bool DoDrawOp(DrawOp op, Brush brush, Player p,
|
||||||
ushort x1, ushort y1, ushort z1, ushort x2, ushort y2, ushort z2) {
|
ushort x1, ushort y1, ushort z1, ushort x2, ushort y2, ushort z2) {
|
||||||
int affected = 0;
|
int affected = 0;
|
||||||
op.Origin = new Vector3U16(x1, y1, z1);
|
op.Origin = new Vector3U16(x1, y1, z1);
|
||||||
op.Min = Vector3U16.Min(x1, y1, z1, x2, y2, z2);
|
op.Min = Vector3U16.Min(x1, y1, z1, x2, y2, z2);
|
||||||
@ -143,8 +143,13 @@ namespace MCGalaxy.Drawing.Ops {
|
|||||||
|
|
||||||
if (!op.CanDraw(x1, y1, z1, x2, y2, z2, p, out affected))
|
if (!op.CanDraw(x1, y1, z1, x2, y2, z2, p, out affected))
|
||||||
return false;
|
return false;
|
||||||
const string format = "{0}({1}): affecting up to {2} blocks";
|
if (brush != null) {
|
||||||
Player.SendMessage(p, String.Format(format, op.Name, brush.Name, affected));
|
const string format = "{0}({1}): affecting up to {2} blocks";
|
||||||
|
Player.SendMessage(p, String.Format(format, op.Name, brush.Name, affected));
|
||||||
|
} else {
|
||||||
|
const string format = "{0}: affecting up to {1} blocks";
|
||||||
|
Player.SendMessage(p, String.Format(format, op.Name, affected));
|
||||||
|
}
|
||||||
|
|
||||||
bool needReveal = op.DetermineDrawOpMethod(p.level, affected);
|
bool needReveal = op.DetermineDrawOpMethod(p.level, affected);
|
||||||
op.Perform(x1, y1, z1, x2, y2, z2, p, p.level, brush);
|
op.Perform(x1, y1, z1, x2, y2, z2, p, p.level, brush);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user