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

Switch to kyori nbt, also add various simple commands #12

Open
wants to merge 4 commits into
base: master
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
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ repositories {
}

dependencies {
compile("com.flowpowered:flow-nbt:1.0.1-SNAPSHOT")
compile("io.github.opencubicchunks:regionlib:0.78.0-SNAPSHOT")
compile("com.carrotsearch:hppc:0.8.1")
compile("com.google.guava:guava:27.0.1-jre")
Expand Down
2 changes: 1 addition & 1 deletion nbt
28 changes: 1 addition & 27 deletions relocatingConfig.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1 @@
cut all #cuts EVERYTHING and replaces it with air (newly generated chunks will be normal)
cut 0 0 0 1 1 1 #Cuts out the area from 0 0 0 to 1 1 1 and replaces it with air
cut 2 0 0 3 1 1 to 5 0 0 #Cut out the area from 2 0 0 to 3 1 1 and moves it TO 5 0 0 (meaning it's at 5 0 0), leaving AIR behind
cut 4 0 0 5 1 1 by 5 0 0 #Cut out the area from 4 0 0 to 5 1 1 and moves it BY 5 0 0 (meaning it's at 9 0 0), leaving AIR behind

config relight dst off #disables relighting destination cubes from this point

copy 0 0 0 1 1 1 to 5 0 0 #Copies the area from 0 0 0 to 1 1 1 and moves it TO 5 0 0 (meaning it's at 5 0 0), leaving a COPY behind
copy 2 0 0 3 1 1 by 5 0 0 #Copies the area from 2 0 0 to 3 1 1 and moves it BY 5 0 0 (meaning it's at 7 0 0), leaving a COPY behind

config relight src off #disables relighting source cubes from this point

move 0 0 0 1 1 1 to 5 0 0 #Moves the area from 0 0 0 to 1 1 1 and moves it TO 5 0 0 (meaning it's at 5 0 0), The world will regenerate this area
move 2 0 0 3 1 1 by 5 0 0 #Moves the area from 2 0 0 to 3 1 1 and moves it BY 5 0 0 (meaning it's at 7 0 0), The world will regenerate this area

remove all #removes EVERYTHING. The world will regenerate everything
remove 0 0 0 1 1 1 #Removes the area from 0 0 0 to 1 1 1. The world will regenerate this area

#first number is the block ID, second is the meta data value
set all to 1 0 #Sets the entire world to stone
set 0 0 0 1 1 1 to 1 0 #Sets the area from 0 0 0 to 1 1 1 to stone

config relight dst on #re-enable relighting all cubes
config relight src on

replace all like 0 1 with 1 1 #Replaces every stone with granite
replace 0 0 0 1 1 1 like 0 1 with 1 1 #Replaces all stone with granite in the area 0 0 0 1 1 1
setpopulated all true
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class EditTaskCommands {

private static final CommandDispatcher<EditTaskContext> dispatcher = new CommandDispatcher<>();


static {
CutCommand.register(dispatcher);
CopyCommand.register(dispatcher);
Expand All @@ -47,6 +46,9 @@ public class EditTaskCommands {
SetCommand.register(dispatcher);
ReplaceCommand.register(dispatcher);
SchematicCommand.register(dispatcher);
ReLightCommand.register(dispatcher);
ReTrackCommand.register(dispatcher);
SetPopulatedCommand.register(dispatcher);
ConfigCommand.register(dispatcher);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* This file is part of CubicChunksConverter, licensed under the MIT License (MIT).
*
* Copyright (c) 2017-2021 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package cubicchunks.converter.lib.conf.command.commands;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import cubicchunks.converter.lib.conf.command.EditTaskContext;
import cubicchunks.converter.lib.conf.command.arguments.BoundingBoxArgument;
import cubicchunks.converter.lib.util.BoundingBox;
import cubicchunks.converter.lib.util.edittask.ReLightEditTask;

public class ReLightCommand {
public static void register(CommandDispatcher<EditTaskContext> dispatcher) {
dispatcher.register(LiteralArgumentBuilder.<EditTaskContext>literal("relight")
.then(RequiredArgumentBuilder.<EditTaskContext, BoundingBox>argument("box", new BoundingBoxArgument())
.executes(info -> {
info.getSource().addEditTask(new ReLightEditTask(info.getArgument("box", BoundingBox.class)));
return 1;
})
)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* This file is part of CubicChunksConverter, licensed under the MIT License (MIT).
*
* Copyright (c) 2017-2021 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package cubicchunks.converter.lib.conf.command.commands;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import cubicchunks.converter.lib.conf.command.EditTaskContext;
import cubicchunks.converter.lib.conf.command.arguments.BoundingBoxArgument;
import cubicchunks.converter.lib.util.BoundingBox;
import cubicchunks.converter.lib.util.edittask.ReTrackEditTask;

public class ReTrackCommand {
public static void register(CommandDispatcher<EditTaskContext> dispatcher) {
dispatcher.register(LiteralArgumentBuilder.<EditTaskContext>literal("relight")
.then(RequiredArgumentBuilder.<EditTaskContext, BoundingBox>argument("box", new BoundingBoxArgument())
.executes(info -> {
info.getSource().addEditTask(new ReTrackEditTask(info.getArgument("box", BoundingBox.class)));
return 1;
})
)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* This file is part of CubicChunksConverter, licensed under the MIT License (MIT).
*
* Copyright (c) 2017-2021 contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package cubicchunks.converter.lib.conf.command.commands;

import com.mojang.brigadier.CommandDispatcher;
import com.mojang.brigadier.arguments.BoolArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import cubicchunks.converter.lib.conf.command.EditTaskContext;
import cubicchunks.converter.lib.conf.command.arguments.BoundingBoxArgument;
import cubicchunks.converter.lib.util.BoundingBox;
import cubicchunks.converter.lib.util.edittask.SetPopulatedEditTask;

public class SetPopulatedCommand {
public static void register(CommandDispatcher<EditTaskContext> dispatcher) {
dispatcher.register(LiteralArgumentBuilder.<EditTaskContext>literal("setpopulated")
.then(RequiredArgumentBuilder.<EditTaskContext, BoundingBox>argument("box", new BoundingBoxArgument())
.then(RequiredArgumentBuilder.<EditTaskContext, Boolean>argument("populated", BoolArgumentType.bool())
.executes(info -> {
info.getSource().addEditTask(
new SetPopulatedEditTask(
info.getArgument("box", BoundingBox.class),
info.getArgument("populated", boolean.class)
)
);
return 1;
})
)
)
);
}
}
Loading