package com.elmakers.mine.bukkit.action.builtin;

import com.elmakers.mine.bukkit.api.action.CastContext;
import org.bukkit.configuration.ConfigurationSection;

public class PlaneAction extends VolumeAction
{
	protected enum Axis { X, Y, Z };
	protected Axis axis;

	@Override
	public void prepare(CastContext context, ConfigurationSection parameters) {
		super.prepare(context, parameters);
		String axisType = parameters.getString("axis");
		if (axisType.equalsIgnoreCase("x")) {
			axis = Axis.X;
		} else if (axisType.equalsIgnoreCase("z")) {
			axis = Axis.Z;
		} else {
			axis = Axis.Y;
		}
		switch (axis)
		{
			case X:
				xSize = 0;
				break;
			case Z:
				zSize = 0;
				break;
			default:
				ySize = 0;
				break;
		}
	}

	protected boolean containsPoint(int x, int y, int z)
	{
		return true;
	}
}

@@ -435,16 +435,43 @@
 axis%22);%0A
+%09%09if (axisType != null) %7B%0A%09
 %09%09if (ax
@@ -497,32 +497,33 @@
 Case(%22x%22)) %7B%0A%09%09%09
+%09
 axis = Axis.X;%0A%09
@@ -521,16 +521,17 @@
 Axis.X;%0A
+%09
 %09%09%7D else
@@ -568,24 +568,25 @@
 (%22z%22)) %7B%0A%09%09%09
+%09
 axis = Axis.
@@ -588,16 +588,52 @@
 Axis.Z;%0A
+%09%09%09%7D else %7B%0A%09%09%09%09axis = Axis.Y;%0A%09%09%09%7D%0A
 %09%09%7D else

Fix Plane action with default axis