Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Voxel List #347

Open
wants to merge 4 commits into
base: sponge-1.12
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions src/main/java/com/thevoxelbox/voxelsniper/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/
package com.thevoxelbox.voxelsniper;

import com.thevoxelbox.voxelsniper.brush.PerformBrush;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.block.BlockType;
import org.spongepowered.api.text.Text;
Expand Down Expand Up @@ -62,7 +63,8 @@ public void brushName(String brushName) {
* Display Center Parameter.
*/
public void center() {
this.snipeData.sendMessage(TextColors.DARK_BLUE, "Brush Center: ", TextColors.DARK_RED, this.snipeData.getCylinderCenter());
this.snipeData.sendMessage(TextColors.DARK_BLUE, "Brush Center: ",
TextColors.DARK_RED, this.snipeData.getCylinderCenter());
}

/**
Expand All @@ -86,19 +88,38 @@ public void height() {
}

/**
* Display performer.
* Display performer data.
*
* @param performerName
* @param placeMethod
* @param replaceMethod
* @param usePhysics
*/
public void performerName(String performerName) {
this.snipeData.sendMessage(TextColors.DARK_PURPLE, "Performer: ", TextColors.DARK_GREEN, performerName);
public void performerData(PerformBrush.PerformerType placeMethod,
PerformBrush.PerformerType replaceMethod,
boolean usePhysics) {
String physics = usePhysics ? "On" : "Off";
this.snipeData.sendMessage(
TextColors.DARK_PURPLE,
"Performers:",
TextColors.GREEN,
" place=",
TextColors.AQUA,
placeMethod,
TextColors.GREEN,
" replace=",
TextColors.AQUA,
replaceMethod,
TextColors.GREEN,
" physics=",
TextColors.AQUA,
physics);
}

/**
* Display replace material.
*/
public void replace() {
this.snipeData.sendMessage(TextColors.AQUA, "Replace Material: ", TextColors.RED, this.snipeData.getReplaceId());
this.snipeData.sendMessage(TextColors.DARK_BLUE, "Replace Material: ", TextColors.RED, this.snipeData.getReplaceId());
}

/**
Expand Down Expand Up @@ -148,24 +169,6 @@ public void voxel() {
* Display voxel list.
*/
public void voxelList() {
if (this.snipeData.getVoxelList().isEmpty()) {
this.snipeData.sendMessage(TextColors.DARK_GREEN, "No blocks selected!");
} else {
Text.Builder returnValueBuilder = Text.builder();
returnValueBuilder.append(Text.of(TextColors.DARK_GREEN, "Block Types Selected: "));

StringBuilder vl = new StringBuilder();
for (BlockType type : this.snipeData.getVoxelList().getWildcardTypes()) {
vl.append(type.getId());
vl.append(" ");
}
for (BlockState type : this.snipeData.getVoxelList().getSpecificTypes()) {
vl.append(type.getId());
vl.append(" ");
}
returnValueBuilder.append(Text.of(TextColors.AQUA, vl.toString().trim()));

this.snipeData.sendMessage(returnValueBuilder.toText());
}
this.snipeData.sendMessage(Text.of(TextColors.DARK_GREEN, this.snipeData.getVoxelList()));
}
}
Loading