Minecraft Sponge server Universal Market plugin trample record and repair Sinicization version download
Minecraft was bored with the original version.(the dragon has finally played.)I want to play Minecraft MOD, so I installed the 2 module of industry.I was thinking about online, and I had been looking for mcbbs for a long time.If you play too lonely, then build a suit.This is a preface, not a lot of details. In general, there are many pits, but fortunately, there are tutors from predecessors (such as http://www.mcbbs.net/thread-786074-1-1.html).In line with the spirit of serving the people, choose a pit here and summarize the process to help later friends.
Universal Market is a consignment market with a box like interface.
Because the various hints of the project are built into the code, the Sinicization needs to be recompiled, and there are source code files on it. If you don't feel comfortable, you can manually compile them according to the compilation process below.Chinese translation is provided by Tollainmear.
The server version I build is Minecraft 1.12.2, Forge 1.12.2-188.8.131.5225, SpongeForge 1.12.2-2825-7.1.6.After installing the 1.3 version of the Universal Market plugin (https://github.com/Xwaffle1/UniversalMarket/releases/tag/1.3), it was found that it was not possible to enter the store. The console reported the following error:
[xx:xx:xx] [Server thread/ERROR] [Sponge]: Error occurred while executing command'um'for for, command, command,'um', for, command, command,'um', for, command, command,'um', for, command, command,'um', for, command, command,'um', for, etc.340) ~[SimpleDispatcher.class:1.12.2-2825-7.1.6]
at org.spongepowered.common.command.SpongeCommandManager.process (SpongeCommandManager.java:337) [SpongeCommandManager.class:1.12.2-2825-7.1.6]
at net.minecraft.command.ServerCommandManager.func_71556_a (SourceFile:1156) [dh.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147361_d (NetHandlerPlayServer.java:960) [pa.class:??L$1.run (SourceFile:13) [hv$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:511) [?: 1.8.0_74]
at java.util.concurrent.FutureTask.run (FutureTask.java:266) [1.8.0_74]
at: net.minecraft.util.Util.func_181617_a (FutureTask.java:266)]?
I was a little nervous at that time, because I had not contacted Java systematically before. I only learned a little bit about the ESS/SMP Product Authorization test and Moegirl Android App.
Location and solution
Go directly to search engine.
Because this project is open source.(Open Source great law!)We can download the code and study it slowly.
Later, I looked for issue in the original project to find the https://github.com/Xwaffle1/UniversalMarket/issues/20. In some ways, I contacted a Dalao Alone that had finished patching the previous version of jar, and thanked my works for opening my hair when I had no idea.
Fortunately, with trace, we can see that the last error on this plug-in occurred.Com.xwaffle.universalmarket.utils.ItemBuilder.<init> (ItemBuilder.java:38) ~[ItemBuilder.class:?]Here:
We throw the setRawData function onto Sponge Forum to search https://forums.spongepowered.org/t/set-get-modify-subid-of-itemstack/19048/9 and find that this function is related to setting some attributes on the item, which is a comparison of Hacky.
Search for the function corresponding to this code in the project:
It is found that this code is only related to the Market.java file, and opens to find the calling place.
We found that the invocation point set up by UnsafeDamage through the meta variable is only here:
After loading the good plug-in, you can see that this is the confirmation button for the payment confirmation interface.
Presumably, this may be a function similar to the progress bar that the author wants to do, but in the end it may end up muttering (for human nature) for various reasons.
Then remove this line and the related two lines (that is, the top two lines of the bug line).
Stumbling block - compile
Minecraft uses Java 8 as its running environment. Accordingly, the Mod development around it is based on Java 8, and recommends the use of Java 8 to carry out the following work.
My local computer is MacBook development environment for MacOS, relative to Windows system, more powerful in the command line, the surrounding facilities are also more.Personal development, usually using brew as a package management, installation software quickly and quickly.But Brew does not provide Java 8 by default (presumably out of date).And downloading on Oracle's official website is impossible. (download also needs to login). There is such an answer to https://stackoverflow.com/a/55774255 on StackOverflow, which solves the problem of Java 8 installation.
See that this project uses gradle as its dependency management (or build tool?)According to my previous experience of using composer and NPM, I think that brew should be installed.As a matter of fact, it is unnecessary.The gradle version on brew is too high, and the project itself provides a package management command, that is, gradlew.Running will generate corresponding files in the project catalog and user directory.
So./gradlewOnce, after downloading the necessary files, I gave a hint. According to this hint, I should run../gradlew tasks。Run, find the options that seem to be built../gradlew build。Running, stupid, prompt error:
/xxxxxx/UniversalMarket-master/build/sources/main/java/com/xwaffle/universalmarket/market/Market.java:30: error: there is no
import org.spongepowered.common.item.inventory.adapter.impl.slots.SlotAdapter in package org.spongepowered.common.item.inventory.adapter.impl.slots;
/xxxxxx/UniversalMarket-master/build/sources/main/java/com/xwaffle/universalmarket/market/Market.java:31: error: there is no
import org.spongepowered.common.item.inventory.query.operation.InventoryPropertyQueryOperation in package org.spongepowered.common.item.inventory.query.operation;
/xxxxxx/UniversalMarket-master/build/sources/main/java/com/xwaffle/universalmarket/market/Market.java:32: error: there is no
import org.spongepowered.common.item.inventory.util in package org.spongepowered.common.item.inventory.util;Er/build/sources/main/java/com/xwaffle/universalmarket/market/MarketItem.java:10: error: there is no
import org.spongepowered.common.item.inventory.util.ItemStackUtil in the package org.spongepowered.common.item.inventory.util;
/xxxxxx/UniversalMarket-master/ build/sources/main/java/com/xwaffle/universalmarket/utils/ItemBuilder.java:11: error: there is no
import org.spongepowered.common.item.inventory.util.ItemStackUtil in the org.spongepowered.common.item.inventory.util of the package; ^ ^ note: Writing plugin, plugin, error in the wrong way.
Search for Sponge documents, and see that the examples given by the authorities are all based on IDE. However, because of insufficient MacBook space, I installed Intellij IDEA Community on another computer (Windows), and then used the build button provided by IDE for a long time to download. Finally, I hint at two errors, "PKIX path building building" and "mtv".
In the previous step, I observed one thing, why there was no other problem in the introduction, and these problems were introduced. I found that these packages started with org.spongepowered.common.xxxx.I saw the build.gradle file before, obviously passed.Compile'org.spongepowered:spongeapi:7.0.0'Introduce SpongeAPI.After the investigation of IDE, I decided to see what the Java compiler was introducing.
Because of previous gradle related experience, I know that gradle will generate folders in user directories.~/.gradleGo and search it.Find. Grep sponge。There is one of the search results../caches/modules-2/files-2.1/org.spongepowered/spongeapi/7.0.0/ada1f9981de3459b182ee16d6408173ef33a8943/spongeapi-7.0.0.jarThis is the package corresponding to API.
Decompress (no decompile):
Where does common come from?!
Back to build.gradle, look down one line.Compile files ('libs/spongeforge-1.12.2-2555-7.1.0-BETA-2837.jar')In conjunction with the description of the SpongeCommon project, the author TM directly relies on the release version of SpongeForge.And the source code has deleted this directory!!!Combined with the use of API, Sponge does not recommend plug-in writers to bypass Sponge and other behaviors, which is directly introduced by the plugin author.Net.minecraft.nbt.NBTTagCompoundNo wonder the author did not issue MOD on the Ore (probably not related to Sponge's API).
Download the latest stable version of SpongeForge (spongeforge-1.12.2-2825-7.1.6.jar) (old does not want to turn over), create LIBS directory to throw in.Then modify the corresponding filename in build.gradle (keep matching).Run again../gradlew build