NormalPlus option: faster building while holding RMB.

Wall and floor option: filled or hollow.
Slope floor option: raise along long edge or short edge.
Cube option: filled, hollow or skeleton.
Added icons for normalSpeed, fastSpeed, full, hollow, cubeFull, cubeHollow, cubeSkeleton, shortEdge, longEdge, thickness1, thickness3, thickness5.
This commit is contained in:
Christian Knaapen
2019-04-30 00:10:29 +02:00
parent e3546f9c42
commit 91ddd11b38
28 changed files with 196 additions and 62 deletions

View File

@@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
version = "1.12.2-2.8" version = "1.12.2-2.9"
group = "nl.requios.effortlessbuilding" // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = "nl.requios.effortlessbuilding" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "effortlessbuilding" archivesBaseName = "effortlessbuilding"

View File

@@ -39,7 +39,7 @@ public class EffortlessBuilding
{ {
public static final String MODID = "effortlessbuilding"; public static final String MODID = "effortlessbuilding";
public static final String NAME = "Effortless Building"; public static final String NAME = "Effortless Building";
public static final String VERSION = "1.12.2-2.8"; public static final String VERSION = "1.12.2-2.9";
@Mod.Instance(EffortlessBuilding.MODID) @Mod.Instance(EffortlessBuilding.MODID)
public static EffortlessBuilding instance; public static EffortlessBuilding instance;

View File

@@ -29,11 +29,11 @@ public class BuildModes {
public enum BuildModeEnum { public enum BuildModeEnum {
NORMAL("effortlessbuilding.mode.normal", new Normal(), new ActionEnum[]{}), NORMAL("effortlessbuilding.mode.normal", new Normal(), new ActionEnum[]{}),
NORMAL_PLUS("effortlessbuilding.mode.normal_plus", new NormalPlus(), new ActionEnum[]{ActionEnum.NORMAL_SPEED, ActionEnum.FAST_SPEED}), NORMAL_PLUS("effortlessbuilding.mode.normal_plus", new NormalPlus(), new ActionEnum[]{ActionEnum.NORMAL_SPEED, ActionEnum.FAST_SPEED}),
LINE("effortlessbuilding.mode.line", new Line(), new ActionEnum[]{ActionEnum.THICKNESS_1, ActionEnum.THICKNESS_3, ActionEnum.THICKNESS_5}), LINE("effortlessbuilding.mode.line", new Line(), new ActionEnum[]{/*ActionEnum.THICKNESS_1, ActionEnum.THICKNESS_3, ActionEnum.THICKNESS_5*/}),
WALL("effortlessbuilding.mode.wall", new Wall(), new ActionEnum[]{ActionEnum.FULL, ActionEnum.HOLLOW}), WALL("effortlessbuilding.mode.wall", new Wall(), new ActionEnum[]{ActionEnum.FULL, ActionEnum.HOLLOW}),
FLOOR("effortlessbuilding.mode.floor", new Floor(), new ActionEnum[]{ActionEnum.FULL, ActionEnum.HOLLOW}), FLOOR("effortlessbuilding.mode.floor", new Floor(), new ActionEnum[]{ActionEnum.FULL, ActionEnum.HOLLOW}),
DIAGONAL_LINE("effortlessbuilding.mode.diagonal_line", new DiagonalLine(), new ActionEnum[]{ActionEnum.THICKNESS_1, ActionEnum.THICKNESS_3, ActionEnum.THICKNESS_5}), DIAGONAL_LINE("effortlessbuilding.mode.diagonal_line", new DiagonalLine(), new ActionEnum[]{/*ActionEnum.THICKNESS_1, ActionEnum.THICKNESS_3, ActionEnum.THICKNESS_5*/}),
DIAGONAL_WALL("effortlessbuilding.mode.diagonal_wall", new DiagonalWall(), new ActionEnum[]{ActionEnum.FULL, ActionEnum.HOLLOW}), DIAGONAL_WALL("effortlessbuilding.mode.diagonal_wall", new DiagonalWall(), new ActionEnum[]{/*ActionEnum.FULL, ActionEnum.HOLLOW*/}),
SLOPE_FLOOR("effortlessbuilding.mode.slope_floor", new SlopeFloor(), new ActionEnum[]{ActionEnum.SHORT_EDGE, ActionEnum.LONG_EDGE}), SLOPE_FLOOR("effortlessbuilding.mode.slope_floor", new SlopeFloor(), new ActionEnum[]{ActionEnum.SHORT_EDGE, ActionEnum.LONG_EDGE}),
CUBE("effortlessbuilding.mode.cube", new Cube(), new ActionEnum[]{ActionEnum.CUBE_FULL, ActionEnum.CUBE_HOLLOW, ActionEnum.CUBE_SKELETON}); CUBE("effortlessbuilding.mode.cube", new Cube(), new ActionEnum[]{ActionEnum.CUBE_FULL, ActionEnum.CUBE_HOLLOW, ActionEnum.CUBE_SKELETON});

View File

@@ -98,6 +98,14 @@ public class Cube implements IBuildMode {
if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1; if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1;
if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1; if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1;
if (ModeOptions.getCubeFill() == ModeOptions.ActionEnum.CUBE_SKELETON) {
//Hollow floor
Line.addXLineBlocks(list, x1, x2, y, z1);
Line.addXLineBlocks(list, x1, x2, y, z2);
Line.addZLineBlocks(list, z1, z2, x1, y);
Line.addZLineBlocks(list, z1, z2, x2, y);
} else {
//Filled floor
for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) { for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) {
for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) { for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) {
@@ -105,6 +113,7 @@ public class Cube implements IBuildMode {
list.add(new BlockPos(l, y, n)); list.add(new BlockPos(l, y, n));
} }
} }
}
} else { } else {
BlockPos firstPos = firstPosTable.get(player.getUniqueID()); BlockPos firstPos = firstPosTable.get(player.getUniqueID());
@@ -116,7 +125,6 @@ public class Cube implements IBuildMode {
//Add whole cube //Add whole cube
//Limit amount of blocks you can place per row //Limit amount of blocks you can place per row
int axisLimit = ReachHelper.getMaxBlocksPerAxis(player); int axisLimit = ReachHelper.getMaxBlocksPerAxis(player);
int limit = ReachHelper.getMaxBlocksPlacedAtOnce(player);
int x1 = firstPos.getX(), x2 = thirdPos.getX(); int x1 = firstPos.getX(), x2 = thirdPos.getX();
int y1 = firstPos.getY(), y2 = thirdPos.getY(); int y1 = firstPos.getY(), y2 = thirdPos.getY();
@@ -130,22 +138,61 @@ public class Cube implements IBuildMode {
if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1; if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1;
if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1; if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1;
switch (ModeOptions.getCubeFill()) {
case CUBE_FULL:
addCubeBlocks(list, x1, x2, y1, y2, z1, z2);
break;
case CUBE_HOLLOW:
addHollowCubeBlocks(list, x1, x2, y1, y2, z1, z2);
break;
case CUBE_SKELETON:
addSkeletonCubeBlocks(list, x1, x2, y1, y2, z1, z2);
break;
}
}
return list;
}
public static void addCubeBlocks(List<BlockPos> list, int x1, int x2, int y1, int y2, int z1, int z2) {
for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) { for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) {
for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) { for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) {
//check if whole row fits within limit
if (Math.abs(y1 - y2) < limit - list.size()) {
for (int m = y1; y1 < y2 ? m <= y2 : m >= y2; m += y1 < y2 ? 1 : -1) { for (int m = y1; y1 < y2 ? m <= y2 : m >= y2; m += y1 < y2 ? 1 : -1) {
list.add(new BlockPos(l, m, n)); list.add(new BlockPos(l, m, n));
} }
} }
} }
} }
public static void addHollowCubeBlocks(List<BlockPos> list, int x1, int x2, int y1, int y2, int z1, int z2) {
Wall.addXWallBlocks(list, x1, y1, y2, z1, z2);
Wall.addXWallBlocks(list, x2, y1, y2, z1, z2);
Wall.addZWallBlocks(list, x1, x2, y1, y2, z1);
Wall.addZWallBlocks(list, x1, x2, y1, y2, z2);
Floor.addFloorBlocks(list, x1, x2, y1, z1, z2);
Floor.addFloorBlocks(list, x1, x2, y2, z1, z2);
} }
return list; public static void addSkeletonCubeBlocks(List<BlockPos> list, int x1, int x2, int y1, int y2, int z1, int z2) {
Line.addXLineBlocks(list, x1, x2, y1, z1);
Line.addXLineBlocks(list, x1, x2, y1, z2);
Line.addXLineBlocks(list, x1, x2, y2, z1);
Line.addXLineBlocks(list, x1, x2, y2, z2);
Line.addYLineBlocks(list, y1, y2, x1, z1);
Line.addYLineBlocks(list, y1, y2, x1, z2);
Line.addYLineBlocks(list, y1, y2, x2, z1);
Line.addYLineBlocks(list, y1, y2, x2, z2);
Line.addZLineBlocks(list, z1, z2, x1, y1);
Line.addZLineBlocks(list, z1, z2, x1, y2);
Line.addZLineBlocks(list, z1, z2, x2, y1);
Line.addZLineBlocks(list, z1, z2, x2, y2);
} }
@Override @Override
@@ -157,4 +204,5 @@ public class Cube implements IBuildMode {
public Vec3d getHitVec(EntityPlayer player) { public Vec3d getHitVec(EntityPlayer player) {
return hitVecTable.get(player.getUniqueID()); return hitVecTable.get(player.getUniqueID());
} }
} }

View File

@@ -184,7 +184,7 @@ public class DiagonalLine implements IBuildMode {
} }
//Add diagonal line from first to second //Add diagonal line from first to second
public static List<BlockPos> getDiagonalLineBlocks(EntityPlayer player, BlockPos firstPos, BlockPos secondPos, int sampleMultiplier) { public static List<BlockPos> getDiagonalLineBlocks(EntityPlayer player, BlockPos firstPos, BlockPos secondPos, float sampleMultiplier) {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
int axisLimit = ReachHelper.getMaxBlocksPerAxis(player); int axisLimit = ReachHelper.getMaxBlocksPerAxis(player);
@@ -204,7 +204,7 @@ public class DiagonalLine implements IBuildMode {
Vec3d first = new Vec3d(x1, y1, z1).add(0.5, 0.5, 0.5); Vec3d first = new Vec3d(x1, y1, z1).add(0.5, 0.5, 0.5);
Vec3d second = new Vec3d(x2, y2, z2).add(0.5, 0.5, 0.5); Vec3d second = new Vec3d(x2, y2, z2).add(0.5, 0.5, 0.5);
int iterations = (int) Math.ceil(first.distanceTo(second)) * sampleMultiplier; int iterations = (int) Math.ceil(first.distanceTo(second) * sampleMultiplier);
for (double t = 0; t <= 1.0; t += 1.0/iterations) { for (double t = 0; t <= 1.0; t += 1.0/iterations) {
Vec3d lerp = first.add(second.subtract(first).scale(t)); Vec3d lerp = first.add(second.subtract(first).scale(t));
BlockPos candidate = new BlockPos(lerp); BlockPos candidate = new BlockPos(lerp);

View File

@@ -145,6 +145,16 @@ public class Floor implements IBuildMode {
if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1; if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1;
if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1; if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1;
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
addFloorBlocks(list, x1, x2, y, z1, z2);
else
addHollowFloorBlocks(list, x1, x2, y, z1, z2);
return list;
}
public static void addFloorBlocks(List<BlockPos> list, int x1, int x2, int y, int z1, int z2) {
for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) { for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) {
for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) { for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) {
@@ -152,8 +162,13 @@ public class Floor implements IBuildMode {
list.add(new BlockPos(l, y, n)); list.add(new BlockPos(l, y, n));
} }
} }
}
return list; public static void addHollowFloorBlocks(List<BlockPos> list, int x1, int x2, int y, int z1, int z2) {
Line.addXLineBlocks(list, x1, x2, y, z1);
Line.addXLineBlocks(list, x1, x2, y, z2);
Line.addZLineBlocks(list, z1, z2, x1, y);
Line.addZLineBlocks(list, z1, z2, x2, y);
} }
@Override @Override

View File

@@ -189,21 +189,43 @@ public class Line implements IBuildMode {
int y1 = firstPos.getY(), y2 = secondPos.getY(); int y1 = firstPos.getY(), y2 = secondPos.getY();
int z1 = firstPos.getZ(), z2 = secondPos.getZ(); int z1 = firstPos.getZ(), z2 = secondPos.getZ();
outerloop: //limit axis
for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) { if (x2 - x1 >= axisLimit) x2 = x1 + axisLimit - 1;
if (x1 - x2 >= axisLimit) x2 = x1 - axisLimit + 1;
if (y2 - y1 >= axisLimit) y2 = y1 + axisLimit - 1;
if (y1 - y2 >= axisLimit) y2 = y1 - axisLimit + 1;
if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1;
if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1;
for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) { if (x1 != x2) {
addXLineBlocks(list, x1, x2, y1, z1);
for (int m = y1; y1 < y2 ? m <= y2 : m >= y2; m += y1 < y2 ? 1 : -1) { } else if (y1 != y2) {
if (list.size() >= axisLimit) break outerloop; addYLineBlocks(list, y1, y2, x1, z1);
list.add(new BlockPos(l, m, n)); } else {
} addZLineBlocks(list, z1, z2, x1, y1);
}
} }
return list; return list;
} }
public static void addXLineBlocks(List<BlockPos> list, int x1, int x2, int y, int z) {
for (int x = x1; x1 < x2 ? x <= x2 : x >= x2; x += x1 < x2 ? 1 : -1) {
list.add(new BlockPos(x, y, z));
}
}
public static void addYLineBlocks(List<BlockPos> list, int y1, int y2, int x, int z) {
for (int y = y1; y1 < y2 ? y <= y2 : y >= y2; y += y1 < y2 ? 1 : -1) {
list.add(new BlockPos(x, y, z));
}
}
public static void addZLineBlocks(List<BlockPos> list, int z1, int z2, int x, int y) {
for (int z = z1; z1 < z2 ? z <= z2 : z >= z2; z += z1 < z2 ? 1 : -1) {
list.add(new BlockPos(x, y, z));
}
}
@Override @Override
public EnumFacing getSideHit(EntityPlayer player) { public EnumFacing getSideHit(EntityPlayer player) {
return sideHitTable.get(player.getUniqueID()); return sideHitTable.get(player.getUniqueID());
@@ -213,4 +235,5 @@ public class Line implements IBuildMode {
public Vec3d getHitVec(EntityPlayer player) { public Vec3d getHitVec(EntityPlayer player) {
return hitVecTable.get(player.getUniqueID()); return hitVecTable.get(player.getUniqueID());
} }
} }

View File

@@ -94,7 +94,7 @@ public class SlopeFloor implements IBuildMode {
BlockPos thirdPos = DiagonalLine.findHeight(player, secondPos, skipRaytrace); BlockPos thirdPos = DiagonalLine.findHeight(player, secondPos, skipRaytrace);
if (thirdPos == null) return list; if (thirdPos == null) return list;
//Add whole cube //Add slope floor blocks
list.addAll(getSlopeFloorBlocks(player, firstPos, secondPos, thirdPos)); list.addAll(getSlopeFloorBlocks(player, firstPos, secondPos, thirdPos));
} }
@@ -113,18 +113,20 @@ public class SlopeFloor implements IBuildMode {
int xLength = Math.abs(secondPos.getX() - firstPos.getX()); int xLength = Math.abs(secondPos.getX() - firstPos.getX());
int zLength = Math.abs(secondPos.getZ() - firstPos.getZ()); int zLength = Math.abs(secondPos.getZ() - firstPos.getZ());
if (ModeOptions.getRaisedEdge() == ModeOptions.ActionEnum.SHORT_EDGE) {
//Slope along short edge //Slope along short edge
if (zLength > xLength) onXAxis = false; if (zLength > xLength) onXAxis = false;
} else {
//TODO add option for Slope along long edge //Slope along long edge
//if (zLength > xLength) onXAxis = true; if (zLength <= xLength) onXAxis = false;
}
if (onXAxis) { if (onXAxis) {
//Along X goes up //Along X goes up
//Get diagonal line blocks //Get diagonal line blocks
BlockPos linePoint = new BlockPos(secondPos.getX(), thirdPos.getY(), firstPos.getZ()); BlockPos linePoint = new BlockPos(secondPos.getX(), thirdPos.getY(), firstPos.getZ());
List<BlockPos> diagonalLineBlocks = DiagonalLine.getDiagonalLineBlocks(player, firstPos, linePoint, 1); List<BlockPos> diagonalLineBlocks = DiagonalLine.getDiagonalLineBlocks(player, firstPos, linePoint, 1f);
//Limit amount of blocks we can place //Limit amount of blocks we can place
int lowest = Math.min(firstPos.getZ(), secondPos.getZ()); int lowest = Math.min(firstPos.getZ(), secondPos.getZ());
@@ -144,7 +146,7 @@ public class SlopeFloor implements IBuildMode {
//Get diagonal line blocks //Get diagonal line blocks
BlockPos linePoint = new BlockPos(firstPos.getX(), thirdPos.getY(), secondPos.getZ()); BlockPos linePoint = new BlockPos(firstPos.getX(), thirdPos.getY(), secondPos.getZ());
List<BlockPos> diagonalLineBlocks = DiagonalLine.getDiagonalLineBlocks(player, firstPos, linePoint, 1); List<BlockPos> diagonalLineBlocks = DiagonalLine.getDiagonalLineBlocks(player, firstPos, linePoint, 1f);
//Limit amount of blocks we can place //Limit amount of blocks we can place
int lowest = Math.min(firstPos.getX(), secondPos.getX()); int lowest = Math.min(firstPos.getX(), secondPos.getX());

View File

@@ -151,7 +151,6 @@ public class Wall implements IBuildMode {
List<BlockPos> list = new ArrayList<>(); List<BlockPos> list = new ArrayList<>();
//Limit amount of blocks we can place per row //Limit amount of blocks we can place per row
int limit = ReachHelper.getMaxBlocksPlacedAtOnce(player);
int axisLimit = ReachHelper.getMaxBlocksPerAxis(player); int axisLimit = ReachHelper.getMaxBlocksPerAxis(player);
int x1 = firstPos.getX(), x2 = secondPos.getX(); int x1 = firstPos.getX(), x2 = secondPos.getX();
@@ -166,23 +165,55 @@ public class Wall implements IBuildMode {
if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1; if (z2 - z1 >= axisLimit) z2 = z1 + axisLimit - 1;
if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1; if (z1 - z2 >= axisLimit) z2 = z1 - axisLimit + 1;
for (int l = x1; x1 < x2 ? l <= x2 : l >= x2; l += x1 < x2 ? 1 : -1) { if (x1 == x2) {
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
for (int n = z1; z1 < z2 ? n <= z2 : n >= z2; n += z1 < z2 ? 1 : -1) { addXWallBlocks(list, x1, y1, y2, z1, z2);
else
//check if whole row fits within limit addXHollowWallBlocks(list, x1, y1, y2, z1, z2);
if (Math.abs(y1 - y2) < limit - list.size()) { } else {
if (ModeOptions.getFill() == ModeOptions.ActionEnum.FULL)
for (int m = y1; y1 < y2 ? m <= y2 : m >= y2; m += y1 < y2 ? 1 : -1) { addZWallBlocks(list, x1, x2, y1, y2, z1);
list.add(new BlockPos(l, m, n)); else
} addZHollowWallBlocks(list, x1, x2, y1, y2, z1);
}
}
} }
return list; return list;
} }
public static void addXWallBlocks(List<BlockPos> list, int x, int y1, int y2, int z1, int z2) {
for (int z = z1; z1 < z2 ? z <= z2 : z >= z2; z += z1 < z2 ? 1 : -1) {
for (int y = y1; y1 < y2 ? y <= y2 : y >= y2; y += y1 < y2 ? 1 : -1) {
list.add(new BlockPos(x, y, z));
}
}
}
public static void addZWallBlocks(List<BlockPos> list, int x1, int x2, int y1, int y2, int z) {
for (int x = x1; x1 < x2 ? x <= x2 : x >= x2; x += x1 < x2 ? 1 : -1) {
for (int y = y1; y1 < y2 ? y <= y2 : y >= y2; y += y1 < y2 ? 1 : -1) {
list.add(new BlockPos(x, y, z));
}
}
}
public static void addXHollowWallBlocks(List<BlockPos> list, int x, int y1, int y2, int z1, int z2) {
Line.addZLineBlocks(list, z1, z2, x, y1);
Line.addZLineBlocks(list, z1, z2, x, y2);
Line.addYLineBlocks(list, y1, y2, x, z1);
Line.addYLineBlocks(list, y1, y2, x, z2);
}
public static void addZHollowWallBlocks(List<BlockPos> list, int x1, int x2, int y1, int y2, int z) {
Line.addXLineBlocks(list, x1, x2, y1, z);
Line.addXLineBlocks(list, x1, x2, y2, z);
Line.addYLineBlocks(list, y1, y2, x1, z);
Line.addYLineBlocks(list, y1, y2, x2, z);
}
@Override @Override
public EnumFacing getSideHit(EntityPlayer player) { public EnumFacing getSideHit(EntityPlayer player) {
return sideHitTable.get(player.getUniqueID()); return sideHitTable.get(player.getUniqueID());

View File

@@ -166,12 +166,13 @@ public class RadialMenu extends GuiScreen {
ModeOptions.ActionEnum[] options = currentBuildMode.options; ModeOptions.ActionEnum[] options = currentBuildMode.options;
for (int i = 0; i < options.length; i++) { for (int i = 0; i < options.length; i++) {
ModeOptions.ActionEnum action = options[i]; ModeOptions.ActionEnum action = options[i];
buttons.add(new MenuButton(action.name, action, buttonDistance + i * 26, -20, EnumFacing.DOWN)); buttons.add(new MenuButton(action.name, action, buttonDistance + i * 26, -13, EnumFacing.DOWN));
} }
switchTo = null; switchTo = null;
doAction = null; doAction = null;
//Draw buildmode backgrounds
if (!modes.isEmpty()) { if (!modes.isEmpty()) {
final int totalModes = Math.max( 3, modes.size() ); final int totalModes = Math.max( 3, modes.size() );
int currentMode = 0; int currentMode = 0;
@@ -236,6 +237,7 @@ public class RadialMenu extends GuiScreen {
} }
} }
//Draw action backgrounds
for (final MenuButton btn : buttons) { for (final MenuButton btn : buttons) {
float r = 0.5f; float r = 0.5f;
float g = 0.5f; float g = 0.5f;
@@ -283,6 +285,7 @@ public class RadialMenu extends GuiScreen {
buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
//Draw buildmode icons
for (final MenuRegion menuRegion : modes) { for (final MenuRegion menuRegion : modes) {
final double x = (menuRegion.x1 + menuRegion.x2) * 0.5 * (ringOuterEdge * 0.6 + 0.4 * ringInnerEdge); final double x = (menuRegion.x1 + menuRegion.x2) * 0.5 * (ringOuterEdge * 0.6 + 0.4 * ringInnerEdge);
@@ -309,6 +312,7 @@ public class RadialMenu extends GuiScreen {
buffer.pos(middleX + x2, middleY + y1, zLevel).tex(sprite.getInterpolatedU(u2), sprite.getInterpolatedV(v1)).color(f, f, f, a).endVertex(); buffer.pos(middleX + x2, middleY + y1, zLevel).tex(sprite.getInterpolatedU(u2), sprite.getInterpolatedV(v1)).color(f, f, f, a).endVertex();
} }
//Draw action icons
for (final MenuButton button : buttons) { for (final MenuButton button : buttons) {
final float f = 1f; final float f = 1f;
@@ -336,36 +340,39 @@ public class RadialMenu extends GuiScreen {
tessellator.draw(); tessellator.draw();
//Draw strings
//fontRenderer.drawStringWithShadow("Actions", (int) (middleX - buttonDistance - 13) - fontRenderer.getStringWidth("Actions") * 0.5f, (int) middleY - 38, 0xffffffff); //fontRenderer.drawStringWithShadow("Actions", (int) (middleX - buttonDistance - 13) - fontRenderer.getStringWidth("Actions") * 0.5f, (int) middleY - 38, 0xffffffff);
String title = ""; String title = "";
if (currentBuildMode.options.length > 0) { if (currentBuildMode.options.length > 0) {
switch (currentBuildMode.options[0]) { switch (currentBuildMode.options[0]) {
case NORMAL_SPEED: case NORMAL_SPEED:
case FAST_SPEED: case FAST_SPEED:
title = "Build Speed"; title = I18n.format("effortlessbuilding.action.build_speed");
break; break;
case FULL: case FULL:
case HOLLOW: case HOLLOW:
case CUBE_FULL: case CUBE_FULL:
case CUBE_HOLLOW: case CUBE_HOLLOW:
case CUBE_SKELETON: case CUBE_SKELETON:
title = "Fill"; title = I18n.format("effortlessbuilding.action.filling");
break; break;
case SHORT_EDGE: case SHORT_EDGE:
case LONG_EDGE: case LONG_EDGE:
title = "Raised Edge"; title = I18n.format("effortlessbuilding.action.raised_edge");
break; break;
case THICKNESS_1: case THICKNESS_1:
case THICKNESS_3: case THICKNESS_3:
case THICKNESS_5: case THICKNESS_5:
title = "Line Thickness"; title = I18n.format("effortlessbuilding.action.thickness");
break; break;
} }
} }
fontRenderer.drawStringWithShadow(title, (int) (middleX + buttonDistance - 9), (int) middleY - 44, 0xffffffff); fontRenderer.drawStringWithShadow(title, (int) (middleX + buttonDistance - 9), (int) middleY - 37, 0xeeeeeeff);
String credits = "Effortless Building";
fontRenderer.drawStringWithShadow(credits, width - fontRenderer.getStringWidth(credits) - 4, height - 10, 0x88888888);
//Draw buildmode text
for (final MenuRegion menuRegion : modes) { for (final MenuRegion menuRegion : modes) {
if (menuRegion.highlighted) { if (menuRegion.highlighted) {
@@ -386,6 +393,7 @@ public class RadialMenu extends GuiScreen {
} }
} }
//Draw action text
for (final MenuButton button : buttons) { for (final MenuButton button : buttons) {
if (button.highlighted) { if (button.highlighted) {
String text = TextFormatting.AQUA + button.name; String text = TextFormatting.AQUA + button.name;

View File

@@ -249,6 +249,7 @@ public class ClientProxy implements IProxy {
} }
} else if (buildMode == BuildModes.BuildModeEnum.NORMAL_PLUS) { } else if (buildMode == BuildModes.BuildModeEnum.NORMAL_PLUS) {
placeCooldown--; placeCooldown--;
if (ModeOptions.getBuildSpeed() == ModeOptions.ActionEnum.FAST_SPEED) placeCooldown = 0;
} }
} else { } else {
placeCooldown = 0; placeCooldown = 0;

View File

@@ -25,9 +25,15 @@ effortlessbuilding.action.undo=Undo
effortlessbuilding.action.redo=Redo effortlessbuilding.action.redo=Redo
effortlessbuilding.action.replace=Replace effortlessbuilding.action.replace=Replace
effortlessbuilding.action.open_modifier_settings=Open Modifier Settings effortlessbuilding.action.open_modifier_settings=Open Modifier Settings
effortlessbuilding.action.build_speed=Build Speed
effortlessbuilding.action.filling=Filling
effortlessbuilding.action.raised_edge=Raised Edge
effortlessbuilding.action.thickness=Line Thickness
effortlessbuilding.action.normal_speed=Normal effortlessbuilding.action.normal_speed=Normal
effortlessbuilding.action.fast_speed=Fast effortlessbuilding.action.fast_speed=Fast
effortlessbuilding.action.full=Full effortlessbuilding.action.full=Filled
effortlessbuilding.action.hollow=Hollow effortlessbuilding.action.hollow=Hollow
effortlessbuilding.action.skeleton=Skeleton effortlessbuilding.action.skeleton=Skeleton
effortlessbuilding.action.short_edge=Short Edge effortlessbuilding.action.short_edge=Short Edge

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB