Giter Site home page Giter Site logo

risu729 / erutcurts_old Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 253 KB

Discord bot supports Minecraft Bedrock Tech Community.

Home Page: https://discord.com/api/oauth2/authorize?client_id=989728847899541504&permissions=274878024704&scope=bot%20applications.commands

License: MIT License

Java 99.85% mcfunction 0.15%
discord discord-bot mcbe minecraft

erutcurts_old's People

Contributors

dependabot[bot] avatar risu729 avatar

Watchers

 avatar  avatar

erutcurts_old's Issues

throws `IllegalArgumentException`

It seems tick_queue_data contains two values.

java.lang.IllegalArgumentException: expected one element but was: <nl.itslars.mcpenbt.tags.CompoundTag@5d, nl.itslars.mcpenbt.tags.CompoundTag@5d>
at com.google.common.collect.MoreCollectors$ToOptionalState.multiples(MoreCollectors.java:114)
at com.google.common.collect.MoreCollectors$ToOptionalState.getOptional(MoreCollectors.java:156)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:686)
at io.github.risu729.erutcurts.structure.nbt.Structure.lambda$fromNbt$5(Structure.java:120)
at java.base/java.util.Optional.map(Optional.java:260)
at io.github.risu729.erutcurts.structure.nbt.Structure.lambda$fromNbt$6(Structure.java:106)
at com.google.common.collect.Streams$2.tryAdvance(Streams.java:446)
at java.base/java.util.Spliterator.forEachRemaining(Spliterator.java:332)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at io.github.risu729.erutcurts.structure.nbt.Structure.fromNbt(Structure.java:126)
at io.github.risu729.erutcurts.structure.nbt.Structure.fromNbt(Structure.java:53)
at io.github.risu729.erutcurts.structure.behavior.Behavior.<init>(Behavior.java:81)
at io.github.risu729.erutcurts.structure.behavior.Behavior.generate(Behavior.java:138)
at io.github.risu729.erutcurts.structure.behavior.Behavior.generate(Behavior.java:128)
at io.github.risu729.erutcurts.structure.TargetType.convert(TargetType.java:95)
at io.github.risu729.erutcurts.structure.StructureListener.onMessageReceived(StructureListener.java:63)
at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:426)
at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70)
at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:181)
at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:136)
at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39)
at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:983)
at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:869)
at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:847)
at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1022)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

Throws `IllegalStateException: This message event did not happen in a guild`

The bot throws IllegalStateException while the pack auto-generation.
It occurs because the settings check whether pack auto-generation is enabled.
To fix this, skip the check if the message is in DMs.

java.lang.IllegalStateException: This message event did not happen in a guild
at net.dv8tion.jda.api.events.message.GenericMessageEvent.getGuild(GenericMessageEvent.java:163)
at io.github.risu729.erutcurts.structure.StructureListener.onMessageReceived(StructureListener.java:46)
at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:425)
at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70)
at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:181)
at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:136)
at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39)
at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:983)
at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:869)
at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:847)
at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1022)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

Add conversion to Structura

Structura is a tool that converts the .mcstructure file to a resource pack to show the structure as ghost blocks.

A Discord bot exists for this in Structura official server, but it is not an OSS.

Since Structura is written in Python, I plan to build an API server for this.

Add an option to specify the prefix of structure identifiers

The structure identifiers' prefix is "mystructure", the default one now.
This is the same as importing using the structure block in-game.

To increase the unique feature of this bot, add an option to specify the prefix to the "convert" command.

Load some structures below y=0

Load structures with a height larger than 320 below y=0 to avoid structure loading failure.

The ground level of each structure should be the same, so align with the lowest.

`bedrock-samples` not found

bedrock-samples/ was not found because of lack of the submodule.

https://github.com/Mojang/bedrock-samples

Exception in thread "main" java.lang.ExceptionInInitializerError
at io.github.risu729.erutcurts.misc.Help$1.<init>(Help.java:52)
at io.github.risu729.erutcurts.misc.Help.<clinit>(Help.java:46)
at io.github.risu729.erutcurts.misc.MiscListener.<init>(MiscListener.java:28)
at io.github.risu729.erutcurts.Erutcurts.<clinit>(Erutcurts.java:55)
Caused by: java.io.UncheckedIOException: java.nio.file.NoSuchFileException: src/main/resources/bedrock-samples/version.json
at io.github.risu729.erutcurts.BotInfo.<clinit>(BotInfo.java:61)
... 4 more
Caused by: java.nio.file.NoSuchFileException: src/main/resources/bedrock-samples/version.json
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
at java.base/java.nio.file.Files.readAllBytes(Files.java:3287)
at java.base/java.nio.file.Files.readString(Files.java:3365)
at java.base/java.nio.file.Files.readString(Files.java:3324)
at io.github.risu729.erutcurts.BotInfo.<clinit>(BotInfo.java:56)
... 4 more

Mojira embed

Send an embed of a bug on Mojira to show the content in Discord.

Just a copy of EigenBot.
This bot is written in JavaScript, so I must rewrite it in Java.
Also, there are no libraries of Jira API in Java; we should use the raw API of Jira.

Minecraft change logs translation

Add a feature to translate Minecraft change logs.

Change logs are sent from the Minecraft official Discord server via Channel Following.

Translate messages using DeepL and then send them to the channel.

Add a command to add words and their translation to the glossary for this feature.
This mainly aimed to translate Minecraft-only words accurately.
The submitted translation requires approval from Bot's admin.

Markdown notation and Emojis should be escaped before sending to DeepL to avoid unexpected or wrong translations.
Since the Bot can't send them, use alternative texts for the Minecraft server emojis.

Also, translate changelog websites, whose URLs are attached to the messages, using DeepL website translation.

The websites can be scraped using JSoup. However, the CSS or JS might not work.
A possible solution is hosting the translated change log websites using GitHub pages.

Make a website

Make a website for this bot to convert .mcstructure files on the browser.

To increase options for conversion, the Discord bot has limits and is inconvenient.

In this project, I plan to add endpoints to Spring-boot that can be accessed via API.

Add conversion to sliced images

Structure files represent 3D data, so it is hard to use it on paper.
Add the conversion to sliced images to resolve this problem, which generates images for each y-levels.

This feature may be complicated, so this might be a website-only feature.

Fix the spawn point in worlds

The player's spawn point in the converted void world is (0, -104, 0), the lowest.
This is because the player falls during the world generation.

A floor around (0, 0, 0) might be a solution to avoid this.
In this way, the floor might interfere with loaded structures, so shifting the structures is needed.

Throws `IllegalStateException`

Threw IllegalStateException on pack auto-generation.

java.lang.IllegalArgumentException
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:131)
at io.github.risu729.erutcurts.structure.nbt.Block.<init>(Block.java:64)
at io.github.risu729.erutcurts.structure.nbt.Block.<init>(Block.java:53)
at io.github.risu729.erutcurts.structure.nbt.Structure.lambda$fromNbt$5(Structure.java:124)
at java.base/java.util.Optional.map(Optional.java:260)
at io.github.risu729.erutcurts.structure.nbt.Structure.lambda$fromNbt$6(Structure.java:106)
at com.google.common.collect.Streams$2.tryAdvance(Streams.java:446)
at java.base/java.util.Spliterator.forEachRemaining(Spliterator.java:332)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
at io.github.risu729.erutcurts.structure.nbt.Structure.fromNbt(Structure.java:126)
at io.github.risu729.erutcurts.structure.nbt.Structure.fromNbt(Structure.java:53)
at io.github.risu729.erutcurts.structure.behavior.Behavior.<init>(Behavior.java:81)
at io.github.risu729.erutcurts.structure.behavior.Behavior.generate(Behavior.java:138)
at io.github.risu729.erutcurts.structure.behavior.Behavior.generate(Behavior.java:128)
at io.github.risu729.erutcurts.structure.TargetType.convert(TargetType.java:95)
at io.github.risu729.erutcurts.structure.StructureListener.onMessageReceived(StructureListener.java:63)
at net.dv8tion.jda.api.hooks.ListenerAdapter.onEvent(ListenerAdapter.java:426)
at net.dv8tion.jda.api.hooks.InterfacedEventManager.handle(InterfacedEventManager.java:96)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handleInternally(EventManagerProxy.java:88)
at net.dv8tion.jda.internal.hooks.EventManagerProxy.handle(EventManagerProxy.java:70)
at net.dv8tion.jda.internal.JDAImpl.handleEvent(JDAImpl.java:181)
at net.dv8tion.jda.internal.handle.MessageCreateHandler.handleInternally(MessageCreateHandler.java:136)
at net.dv8tion.jda.internal.handle.SocketHandler.handle(SocketHandler.java:39)
at net.dv8tion.jda.internal.requests.WebSocketClient.onDispatch(WebSocketClient.java:983)
at net.dv8tion.jda.internal.requests.WebSocketClient.onEvent(WebSocketClient.java:869)
at net.dv8tion.jda.internal.requests.WebSocketClient.handleEvent(WebSocketClient.java:847)
at net.dv8tion.jda.internal.requests.WebSocketClient.onBinaryMessage(WebSocketClient.java:1022)
at com.neovisionaries.ws.client.ListenerManager.callOnBinaryMessage(ListenerManager.java:385)
at com.neovisionaries.ws.client.ReadingThread.callOnBinaryMessage(ReadingThread.java:276)
at com.neovisionaries.ws.client.ReadingThread.handleBinaryFrame(ReadingThread.java:996)
at com.neovisionaries.ws.client.ReadingThread.handleFrame(ReadingThread.java:755)
at com.neovisionaries.ws.client.ReadingThread.main(ReadingThread.java:108)
at com.neovisionaries.ws.client.ReadingThread.runMain(ReadingThread.java:64)
at com.neovisionaries.ws.client.WebSocketThread.run(WebSocketThread.java:45)

Keyword search

Add a command to search in bedrock samples and Minecraft wiki by a keyword to make searching about features easier.

The bedrock samples are in this repository by using Git submodules.

Non-ASCII characters in structures' filenames are not supported

All non-ASCII characters are omitted by Discord, so Japanese structure names are unavailable to convert.
This restriction affects all attachments in Discord, including attachments in command arguments.

One solution is to specify the filename in the command argument instead of the filename.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.