mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 03:55:18 -04:00
Fix rotate transform with /paste, make 'centre' option actually scale/rotate from centre.
This commit is contained in:
parent
6d2ab937ce
commit
b1faf7c502
@ -42,10 +42,6 @@ namespace MCGalaxy.Commands.Building {
|
||||
CopyState cState = p.CopyBuffer;
|
||||
m[0] += cState.Offset;
|
||||
|
||||
if (cState.X != cState.OriginX) m[0].X -= (cState.Width - 1);
|
||||
if (cState.Y != cState.OriginY) m[0].Y -= (cState.Height - 1);
|
||||
if (cState.Z != cState.OriginZ) m[0].Z -= (cState.Length - 1);
|
||||
|
||||
if (message == "") {
|
||||
SimplePasteDrawOp simpleOp = new SimplePasteDrawOp();
|
||||
simpleOp.CopyState = p.CopyBuffer;
|
||||
|
@ -28,6 +28,17 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
return CopyState.UsedBlocks;
|
||||
}
|
||||
|
||||
public override void SetMarks(Vec3S32[] m) {
|
||||
Origin = m[0];
|
||||
CopyState cState = CopyState;
|
||||
if (cState.X != cState.OriginX) m[0].X -= (cState.Width - 1);
|
||||
if (cState.Y != cState.OriginY) m[0].Y -= (cState.Height - 1);
|
||||
if (cState.Z != cState.OriginZ) m[0].Z -= (cState.Length - 1);
|
||||
|
||||
Min = m[0]; Max = m[0];
|
||||
Max.X += cState.Width; Max.Y += cState.Height; Max.Z += cState.Length;
|
||||
}
|
||||
|
||||
public override void Perform(Vec3S32[] marks, Player p, Level lvl, Brush brush, Action<DrawOpBlock> output) {
|
||||
CopyState state = CopyState;
|
||||
bool pasteAir = state.PasteAir;
|
||||
@ -46,17 +57,12 @@ namespace MCGalaxy.Drawing.Ops {
|
||||
}
|
||||
}
|
||||
|
||||
public class PasteDrawOp : DrawOp {
|
||||
public class PasteDrawOp : SimplePasteDrawOp {
|
||||
|
||||
public CopyState CopyState;
|
||||
public ExtBlock[] Include, Exclude;
|
||||
|
||||
public override string Name { get { return "Paste"; } }
|
||||
|
||||
public override long BlocksAffected(Level lvl, Vec3S32[] marks) {
|
||||
return CopyState.UsedBlocks;
|
||||
}
|
||||
|
||||
public override void Perform(Vec3S32[] marks, Player p, Level lvl, Brush brush, Action<DrawOpBlock> output) {
|
||||
CopyState state = CopyState;
|
||||
bool pasteAir = state.PasteAir;
|
||||
|
@ -46,6 +46,7 @@ namespace MCGalaxy.Drawing.Transforms {
|
||||
if (!args[args.Length - 1].CaselessEq("centre")) {
|
||||
Player.Message(p, "The mode must be either \"centre\", or not given."); return null;
|
||||
}
|
||||
rotater.CentreOrigin = true;
|
||||
return rotater;
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ namespace MCGalaxy.Drawing.Transforms {
|
||||
if (!args[args.Length - 1].CaselessEq("centre")) {
|
||||
Player.Message(p, "The mode must be either \"centre\", or not given."); return null;
|
||||
}
|
||||
scaler.CentreOrigin = true;
|
||||
return scaler;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user