Minecraft Sponge Server Universal Market Plug in Crater Record and Repair Chinese Version Download

2019-06-28

I'm tired of the original Minecraft~~(Long has finally played)~~. I want to play Minecraft MOD, so I installed the Industrial 2 module. I was thinking of going online, and I searched the mcbbs for a long time, but few of them felt reliable. It's too lonely to play alone, so let's build a service. This is the preface. I don't want to talk about the details. In short, there are many pitfalls, but fortunately, there are tutorials for seniors (such as http://www.mcbbs.net/thread-786074-1-1.html )The road was smooth. In the spirit of serving the people, select a pit here and summarize the process to help the later partners.

This article is migrated from the old blog. The original link is https://lookas2001.com/minecraft-sponge-%e6%9c%8d%e5%8a%a1%e7%ab%af -universal-market-%e6%8f%92%e4%bb%b6%e8%b8%a9%e5%9d%91%e8%ae%b0%e5%bd%95%e5%8f%8a%e4%bf%ae%e5%a4%8d%e6%b1%89%e5%8c%96%e7%89%88%e6%9c%ac%e4%b8%8b%e8%bd%bd/

brief introduction

Universal Market is a consignment market with a box like interface.

MCBBS reprint: http://www.mcbbs.net/thread-792152-1-1.html
Github original project: https://github.com/Xwaffle1/UniversalMarket

download

Update 20190628: fixed the problem that the hot load did not work, and fixed the bug of adding air to the market empty handed

UniversalMarket-1.12.2-v1.3-Bug_fix_and_chinese_translation_by_yys_and_Tollainmear_and_lookas2001.jar

UniversalMarket-master-Bug_fix_and_chinese_translation-source.7z

Because the various prompt texts of this project are built in the code, the Chinese version needs to be recompiled. There are project source code files on it. If you are not sure, you can manually compile them according to the compilation process below. The Chinese part adopts the translation provided by Tollainmear.

Something went wrong

The server versions I built are Minecraft 1.12.2, Forge 1.12.2-14.23.5.2825, and SpongeForge 1.12.2-2825-7.1.6. After installing version 1.3 of the Universal Market plug-in( https://github.com/Xwaffle1/UniversalMarket/releases/tag/1.3 )It was found that the store could not be accessed normally, and the console reported the following error:

 [xx:xx:xx]  [Server thread/ERROR]  [Sponge] : Error  occurred  while  executing  command ' um ' for  source  EntityPlayerMP [ 'lookas2001' /248, l= 'world' , x=302.00, y=64.00, z=229.00] : There ' s  no  NBT  Data  set  in  the  provided  container
 org .spongepowered .api .data .persistence .InvalidDataException : There ' s  no  NBT  Data  set  in  the  provided  container
     at  net .minecraft .item .ItemStack .setRawData (ItemStack. java : two thousand five hundred and thirty-four ) ~ [aip.class:?]
     at  com .xwaffle .universalmarket .utils .ItemBuilder .< init >(ItemBuilder. java : thirty-eight ) ~ [ItemBuilder.class:?]
     at  com .xwaffle .universalmarket .utils .ItemBuilder .< init >(ItemBuilder. java : thirty-one ) ~ [ItemBuilder.class:?]
     at  com .xwaffle .universalmarket .market .Market .openMarket (Market. java : two hundred and forty-seven ) ~ [Market.class:?]
     at  com .xwaffle .universalmarket .market .Market .openMarket (Market. java : one hundred and sixty-seven ) ~ [Market.class:?]
     at  com .xwaffle .universalmarket .commands .MarketCommand .process (MarketCommand. java : forty-five ) ~ [MarketCommand.class:?]
     at  org .spongepowered .api .command .dispatcher .SimpleDispatcher .process (SimpleDispatcher. java : three hundred and forty ) ~ [SimpleDispatcher.class:1.12.2-2825-7.1.6]
     at  org .spongepowered .common .command .SpongeCommandManager .process (SpongeCommandManager. java : three hundred and thirty-seven ) [SpongeCommandManager.class:1.12.2-2825-7.1.6]
     at  net .minecraft .command .ServerCommandManager .func_71556_a ( SourceFile : one thousand one hundred and fifty-six ) [dh.class:?]
     at  net .minecraft .network .NetHandlerPlayServer .func_147361_d (NetHandlerPlayServer. java : nine hundred and sixty ) [pa.class:?]
     at  net .minecraft .network .NetHandlerPlayServer .func_147354_a (NetHandlerPlayServer. java : nine hundred and thirty-nine ) [pa.class:?]
     at  net .minecraft .network .play .client .CPacketChatMessage .func_148833_a ( SourceFile : thirty-seven ) [la.class:?]
     at  net .minecraft .network .play .client .CPacketChatMessage .func_148833_a ( SourceFile : nine ) [la.class:?]
     at  org .spongepowered .common .event .tracking .phase .packet .PacketPhaseUtil .onProcessPacket (PacketPhaseUtil. java : one hundred and ninety-three ) [PacketPhaseUtil.class:1.12.2-2825-7.1.6]
     at  net .minecraft .network .PacketThreadUtil $ one .redirect $ onProcessPacket $ zlk000 ( SourceFile : five hundred and thirty-nine ) [hv$1.class:?]
     at  net .minecraft .network .PacketThreadUtil $ one .run ( SourceFile : thirteen ) [hv$1.class:?]
     at  java .util .concurrent .Executors $ RunnableAdapter .call (Executors. java : five hundred and eleven ) [?:1.8.0_74]
     at  java .util .concurrent .FutureTask .run (FutureTask. java : two hundred and sixty-six ) [?:1.8.0_74]
     at  net .minecraft .util .Util .func_181617_a ( SourceFile : forty-six ) [h.class:?]
     at  org .spongepowered .common .SpongeImplHooks .onUtilRunTask (SpongeImplHooks. java : three hundred and seven ) [SpongeImplHooks.class:1.12.2-2825-7.1.6]
     at  net .minecraft .server .MinecraftServer .redirect $ onRun $ zjo000 (MinecraftServer. java : three thousand nine hundred and seventy ) [MinecraftServer.class:?]
     at  net .minecraft .server .MinecraftServer .func_71190_q (MinecraftServer. java : seven hundred and twenty-three ) [MinecraftServer.class:?]
     at  net .minecraft .server .dedicated .DedicatedServer .func_71190_q (DedicatedServer. java : three hundred and ninety-seven ) [nz.class:?]
     at  net .minecraft .server .MinecraftServer .func_71217_p (MinecraftServer. java : six hundred and sixty-eight ) [MinecraftServer.class:?]
     at  net .minecraft .server .MinecraftServer .run (MinecraftServer. java : five hundred and twenty-six ) [MinecraftServer.class:?]
     at  java .lang .Thread .run (Thread. java : seven hundred and forty-five ) [?:1.8.0_74]

At this time, I was a little flustered because I had no systematic contact with Java before. I only knew a little about it when I studied the authorization verification of Ruijie Network ESS/SMP products and Moegirl Android App.

Positioning and resolution

Go directly to the search engine, but can't find

Since this project is open source, we can download the code and study it slowly.

Later, I went to the original project to find the issue and found this https://github.com/Xwaffle1/UniversalMarket/issues/20 , contacted a Dalao Alone who had patched the previous version of jar through some ways, and thanked his works for enlightening me when I had no idea.

Fortunately, with trace, we can see that the last error about this plug-in occurred in com.xwaffle.universalmarket.utils. ItemBuilder.< init>(ItemBuilder.java:38) ~[ItemBuilder.class:?] here:

Let's throw the setRawData function to the Sponge Forum to search https://forums.spongepowered.org/t/set-get-modify-subid-of-itemstack/19048/9 It is found that this function is related to setting some attributes on the item, which is a hacky approach.

Search the function corresponding to this code globally:

It is found that this code is only related to the Market.java file. Open it to find the calling place.

We find that the call point where UnsafeDamage (damage value) is actually set through the meta variable is only here:

After loading the good plug-in, you can find that this is the OK button in the payment confirmation interface.

Therefore, it is speculated that this may be a function similar to progress bar that the author wants to do, but it may finally be mumbled for various reasons (human nature).

Then remove this line and the two related lines (that is, the upper two lines of the line where the bug occurs) for a try.

Obstacles - Compilation

Minecraft uses Java 8 as its running environment. Accordingly, the surrounding Mod development is based on Java 8. It is recommended to use Java 8 for the next work.

My local computer is MacBook. The development environment is MacOS. Compared with Windows, it is more powerful on the command line and has more supporting facilities. For personal development, brew is usually used as package management, and the installation of software is fast and fast. However, Brew does not provide Java 8 by default (probably outdated?), and it is impossible to download it on Oracle's official website (the download still requires login). There is an answer on StackOverflow https://stackoverflow.com/a/55774255 , which solves the problem of Java 8 installation.

I saw that this project uses gradle as its dependency management (or building tool?). According to my previous experience with composer and npm, I thought that I should use brew to install it. In fact, it is unnecessary. It is unnecessary to install it. The version of gradle on brew is too high, and the project itself provides a package management command, namely gradle. Run it to generate corresponding files in the project directory and user directory.

so ./gradlew After downloading the necessary files, a prompt is given. According to this prompt, I should run ./gradlew tasks Run it to find options that seem to be built ./gradlew build Running, silly eyes, error prompt:

 :compileJava /xxxxxx/ UniversalMarket -master/build/sources/main/java/com/xwaffle/universalmarket/market/ Market . java : thirty : Error: package org spongepowered . common . item . inventory . adapter . impl . slots non-existent import org. spongepowered . common . item . inventory . adapter . impl . slots . SlotAdapter ; ^ /xxxxxx/ UniversalMarket -master/build/sources/main/java/com/xwaffle/universalmarket/market/ Market . java : thirty-one : Error: package org spongepowered . common . item . inventory . query . operation non-existent import org. spongepowered . common . item . inventory . query . operation . InventoryPropertyQueryOperation ; ^ /xxxxxx/ UniversalMarket -master/build/sources/main/java/com/xwaffle/universalmarket/market/ Market . java : thirty-two : Error: package org spongepowered . common . item . inventory . util non-existent import org. spongepowered . common . item . inventory . util . ItemStackUtil ; ^ /xxxxxx/ UniversalMarket -master/build/sources/main/java/com/xwaffle/universalmarket/market/ MarketItem . java : ten : Error: package org spongepowered . common . item . inventory . util non-existent import org. spongepowered . common . item . inventory . util . ItemStackUtil ; ^ /xxxxxx/ UniversalMarket -master/build/sources/main/java/com/xwaffle/universalmarket/utils/ ItemBuilder . java : eleven : Error: package org spongepowered . common . item . inventory . util non-existent import org. spongepowered . common . item . inventory . util . ItemStackUtil ; ^ Note: Writing plugin metadata to file : /xxxxxx/ UniversalMarket -master/build/classes/main/mcmod. info
 five Errors :compileJava FAILED

 FAILURE : Build failed with an exception. * What went wrong : Execution failed for task ':compileJava' . > Compilation failed;  see the compiler error output for details. * Try : Run  with --stacktrace option to get the stack trace. Run  with --info or --debug option to get more log output. BUILD  FAILED

Looking through the Sponge documentation, I found that the official examples are based on the IDE. However, due to the lack of space in my MacBook, I finally installed the Intellij IDEA Community on another computer (Windows), and then used the build button provided by the IDE, which took a long time to download. Finally, two errors were prompted, "PKIX path building failed" "Disable to find valid certification path to requested target".

In the previous step, I observed why other introductions would not cause problems, but these introductions would cause problems. I found that these packages all start with org.spongepowered.common.xxxx. I have checked the build.gradle file before, and it is clear that it has passed compile 'org.spongepowered:spongeapi:7.0.0' Introducing the SpongeAPI. After troubleshooting the IDE problem, I decided to see what the Java compiler was introducing.

Because I have experience related to gradle before, I know that gradle will generate folders in the user directory ~/.gradle , go and search find . | grep sponge One of the search results ./caches/modules-2/files-2.1/org.spongepowered/spongeapi/7.0.0/ada1f9981de3459b182ee16d6408173ef33a8943/spongeapi-7.0.0.jar This is the package corresponding to the API.

Decompress it (no need to decompile):

Autistic

Where does the 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 combination with the description of the SpongeCommon project, the author tm directly regarded the released version of SpongeForge as a dependency! And the source code also deleted this directory!!! In combination with the use of the portal API (Sponge does not recommend that the plug-in author bypass Sponge and other behaviors. The plug-in author directly introduces net.minecraft.nbt. NBTTagCompound )No wonder that the author didn't publish MOD on Ore (probably because Sponge didn't provide some APIs).

Download the latest stable version of SpongeForge (spongeforge - 1.12.2-2825-7.1.6. jar) (the old one doesn't want to scroll back), create a libs directory and throw it in. Then modify the corresponding file name in build.gradle (keep matching). Run it again ./gradlew build

Baby, I finally see you:

Finally, after testing, it works perfectly.

Maintenance of the website requires a certain amount of expense. If you agree with this article, please close the advertisement blocker and browse the advertisement. Thank you!
Loading

(∀) In other words, welcome to the small station of lookas!

This is the place where lookas records some things. From time to time, there may be some magical brain holes or unreliable ideas of lookas.

Anyway, let's have a look.