use of com.glisco.isometricrenders.client.gui.AreaIsometricRenderScreen in project isometric-renders by gliscowo.
the class IsoRenderCommand method register.
public static void register(CommandDispatcher<FabricClientCommandSource> dispatcher) {
dispatcher.register(literal("isorender").then(literal("block").executes(context -> executeBlockTarget(context.getSource())).then(argument("block", BlockStateArgumentType.blockState()).executes(context -> {
final BlockStateArgument blockStateArgument = context.getArgument("block", BlockStateArgument.class);
final BlockState blockState = blockStateArgument.getBlockState();
return executeBlockState(context.getSource(), blockState, ((BlockStateArgumentAccessor) blockStateArgument).getData());
}))).then(literal("item").executes(context -> {
return executeItem(context.getSource(), context.getSource().getPlayer().getMainHandStack().copy());
}).then(argument("item", ItemStackArgumentType.itemStack()).executes(context -> {
final ItemStack stack = ItemStackArgumentType.getItemStackArgument(context, "item").createStack(1, false);
return executeItem(context.getSource(), stack);
}))).then(literal("entity").then(argument("entity", EntitySummonArgumentType.entitySummon()).suggests(CLIENT_SUMMONABLE_ENTITIES).executes(context -> {
Identifier id = context.getArgument("entity", Identifier.class);
return executeEntity(context.getSource(), EntitySummonArgumentTypeAccessor.invokeValidate(id), new CompoundTag());
}).then(argument("nbt", NbtCompoundTagArgumentType.nbtCompound()).executes(context -> {
Identifier id = context.getArgument("entity", Identifier.class);
return executeEntity(context.getSource(), EntitySummonArgumentTypeAccessor.invokeValidate(id), context.getArgument("nbt", CompoundTag.class));
})))).then(literal("insanity").executes(context -> {
RuntimeConfig.allowInsaneResolutions = !RuntimeConfig.allowInsaneResolutions;
if (RuntimeConfig.allowInsaneResolutions) {
context.getSource().sendFeedback(prefix("Insane resolutions §cunlocked§7. I will not be your place to cry if this blows up your computer."));
} else {
context.getSource().sendFeedback(prefix("Insane resolutions §alocked§7. You're safe again"));
}
return 0;
})).then(literal("area").then(argument("start", BlockPosArgumentType.blockPos()).then(argument("end", BlockPosArgumentType.blockPos()).executes(context -> {
DefaultPosArgument startArg = context.getArgument("start", DefaultPosArgument.class);
DefaultPosArgument endArg = context.getArgument("end", DefaultPosArgument.class);
BlockPos pos1 = IsometricRenderHelper.getPosFromArgument(startArg, context.getSource());
BlockPos pos2 = IsometricRenderHelper.getPosFromArgument(endArg, context.getSource());
BlockPos start = new BlockPos(Math.min(pos1.getX(), pos2.getX()), Math.min(pos1.getY(), pos2.getY()), Math.min(pos1.getZ(), pos2.getZ()));
BlockPos end = new BlockPos(Math.max(pos1.getX(), pos2.getX()), Math.max(pos1.getY(), pos2.getY()), Math.max(pos1.getZ(), pos2.getZ()));
AreaIsometricRenderScreen screen = new AreaIsometricRenderScreen();
IsometricRenderPresets.setupAreaRender(screen, start, end);
IsometricRenderHelper.scheduleScreen(screen);
return 0;
})))).then(literal("creative_tab").then(argument("itemgroup", ItemGroupArgumentType.itemGroup()).suggests(ITEM_GROUPS).then(literal("batch").then(literal("blocks").executes(context -> {
ItemGroup group = context.getArgument("itemgroup", ItemGroup.class);
IsometricRenderHelper.batchRenderItemGroupBlocks(group);
return 0;
})).then(literal("items").executes(context -> {
ItemGroup group = context.getArgument("itemgroup", ItemGroup.class);
IsometricRenderHelper.batchRenderItemGroupItems(group);
return 0;
}))).then(literal("atlas").executes(context -> {
ItemGroup group = context.getArgument("itemgroup", ItemGroup.class);
IsometricRenderHelper.renderItemGroupAtlas(group);
return 0;
})))));
}
Aggregations