Closed Ghostlyr closed 2 years ago
The project is incompatible on windows unfortunately.
But same on linux:
Patching failed: net/minecraft/network/NetHandlerPlayServer.java Cannot find hunk target
41: Cannot find hunk target @ 0
42: Cannot find hunk target @ 0
2/47 failed
Rejects written to /home/ghostlyr/Crucible/patches/net/minecraft/network/NetHandlerPlayServer.java.patch.rej
Seems you have another decompiled minecraft sources and we have a differences =\
Are you using the same project you used on windows? in this case, the same files or a clean clone of the repo? Windows adds some invisible characters that makes the project break.
Absolutely clean cloned repo from master fork. Also changing EOL git settings on Windows doesn't give effect. Just compare rejected patch and my decompiled source side-by-side:
if ("MC|BEdit".equals(p_147349_1_.func_149559_c()))
{
packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e()));
try
{
itemstack = packetbuffer.readItemStackFromBuffer();
if (itemstack != null)
{
if (!ItemWritableBook.func_150930_a(itemstack.getTagCompound()))
{
throw new IOException("Invalid book tag!");
}
itemstack1 = this.playerEntity.inventory.getCurrentItem();
if (itemstack1 == null)
{
return;
}
if (itemstack.getItem() == Items.writable_book && itemstack.getItem() == itemstack1.getItem())
{
itemstack1.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8));
}
return;
}
}
catch (Exception exception4)
{
logger.error("Couldn\'t handle book info", exception4);
return;
}
finally
{
packetbuffer.release();
}
return;
}
else if ("MC|BSign".equals(p_147349_1_.func_149559_c()))
{
packetbuffer = new PacketBuffer(Unpooled.wrappedBuffer(p_147349_1_.func_149558_e()));
try
{
itemstack = packetbuffer.readItemStackFromBuffer();
if (itemstack == null)
{
return;
}
if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound()))
{
throw new IOException("Invalid book tag!");
}
itemstack1 = this.playerEntity.inventory.getCurrentItem();
if (itemstack1 != null)
{
if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book)
{
itemstack1.setTagInfo("author", new NBTTagString(this.playerEntity.getCommandSenderName()));
itemstack1.setTagInfo("title", new NBTTagString(itemstack.getTagCompound().getString("title")));
itemstack1.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8));
itemstack1.func_150996_a(Items.written_book);
}
return;
}
}
catch (Exception exception3)
{
logger.error("Couldn\'t sign book", exception3);
return;
}
finally
{
packetbuffer.release();
}
return;
}
There some inconsistencies.
What's your environment? I never had that problem before on linux and it builds just fine on my TeamCity https://juanmuscaria.beta.teamcity.com/project/Crucible
I doubt that this is a POSIX CR LF or environment problem.
Just for unknown reasons I have different decompiled source. Specifically: reverted and shifted if (itemstack1 != null) conditions. So here my fixed patch: https://github.com/Ghostlyr/Crucible/commit/c650eafc189807012880193fc7acdbb53634d2a0
With your patch version I get that error
Applying Cauldron patches
Patching failed: net/minecraft/network/NetHandlerPlayServer.java Cannot find hunk target
41: Cannot find hunk target @ 0
42: Cannot find hunk target @ 0
2/47 failed
Rejects written to /home/juan/Área de Trabalho/Pasta sem título/Crucible/patches/net/minecraft/network/NetHandlerPlayServer.java.patch.rej
that's the only patch that breaks for some reason. Either it's an environment problem or some gradle inconsistency because of how old the version is.
Our default source does not work for me.
We used a custom NetHandlerPlayServer.java since always, so i never bothered to understand and try to fix this issue. (probably the same source as you?)
Your changes fixed the issue on my pc, tried on windows (clean git clone, setup and jar) and worked.
Before we merge, i will try to understand why the error ocurred in first place.
How have you solved it? I was going to try to just genPatches from our correct version of NetHandlerPlayServer.java, have you just done that?
Merging that will break TeamCity auto build setup and probably break with my current work in the dev branch. So yeah the only solution is actually finding out why that happens in the first place.
Tested on Ubuntu, same steps, (clean git clone, setup and jar) and got the error i used to get on Windows.
It has the correct patch:
But does not have the correct generated file:
I met this issue, too.Please bear with my poor English I guess it's the library file problem, because I found that the libraries packaged by ./gradlew jar are incomplete, such as server.jar Only a few dozen KB I don't know much about the process of decompiling MCP, but I can be sure that there is a problem with the decompiler source, and the problem is solved by deleting /home/.gradle/ But why can incomplete files be decompiled successfully? I'm not really sure
Can you test if the issue persists with the build system change and update?
This issue will need to be re-opened or addressed.
In a LXD container
OS:
.-/+oossssoo+/-. s
`:+ssssssssssssssssss+:` ---------------------
-+ssssssssssssssssssyyssss+- OS: Ubuntu 20.04.3 LTS x86_64
.ossssssssssssssssssdMMMNysssso. Kernel: 5.10.60-qnap
/ssssssssssshdmmNNmmyNMMMMhssssss/ Uptime: 2 days, 4 hours, 31 mins
+ssssssssshmydMMMMMMMNddddyssssssss+ Packages: 463 (dpkg)
/sssssssshNMMMyhhyyyyhmNMMMNhssssssss/ Shell: bash 5.0.17
.ssssssssdMMMNhsssssssssshNMMMdssssssss. Terminal: /dev/pts/0
+sssshhhyNMMNyssssssssssssyNMMMysssssss+ CPU: AMD Ryzen 7 PRO 1700 (16) @ 3.000GHz
ossyNMMMNyMMhsssssssssssssshmmmhssssssso Memory: 2458MiB / 15960MiB
ossyNMMMNyMMhsssssssssssssshmmmhssssssso
+sssshhhyNMMNyssssssssssssyNMMMysssssss+
.ssssssssdMMMNhsssssssssshNMMMdssssssss.
/sssssssshNMMMyhhyyyyhdNMMMNhssssssss/
+sssssssssdmydMMMMMMMMddddyssssssss+
/ssssssssssshdmNNNNmyNMMMMhssssss/
.ossssssssssssssssssdMMMNysssso.
-+sssssssssssssssssyyyssss+-
`:+ssssssssssssssssss+:`
.-/+oossssoo+/-.
git clone -b v5.3 https://github.com/CrucibleMC/Crucible.git
- testing to build tag v5.3
./gradlew setupCrucible
To honour the JVM settings for this build a new JVM will be forked. Please consider using the daemon: https://docs.gradle.org/5.6.4/userguide/gradle_daemon.html.
Daemon will be stopped at the end of the build stopping after processing
> Configure project :
Etag download for http://export.mcpbot.bspk.rs/versions.json failed with code 522
[Fatal Error] argo-2.25.pom:3:10: Already seen doctype.
[Fatal Error] argo-2.25.pom:3:10: Already seen doctype.
#################################################
ForgeGradle 1.2-1.3.3-SNAPSHOT-994b613d
https://github.com/juanmuscaria/ForgeGradle
#################################################
Powered by MCP 9.08
http://modcoderpack.com
by: Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
Reissued by:
juanmuscaria, Aizistral
#################################################
> Task :getAssets
Current status: 5/686 0%
Current status: 29/686 4%
Current status: 53/686 7%
Current status: 91/686 13%
Current status: 132/686 19%
Current status: 185/686 26%
Current status: 251/686 36%
Current status: 306/686 44%
Current status: 364/686 53%
Current status: 420/686 61%
Current status: 474/686 69%
Current status: 510/686 74%
Current status: 553/686 80%
Current status: 597/686 87%
Current status: 641/686 93%
Current status: 686/686 100%
Current status: 686/686 100%
Current status: 686/686 100%
Current status: 686/686 100%
Current status: 686/686 100%
Current status: 686/686 100%
Current status: 686/686 100%
Current status: 686/686 100%
> Task :deobfuscateJar
Applying SpecialSource...
Applying Exceptor...
> Task :forgePatchJar
Injecting fml files
Applying fml patches
Injecting forge files
Applying forge patches
Injecting bukkit files
> Task :cauldronPatchJar
Applying Cauldron patches
Patching failed: net/minecraft/network/NetHandlerPlayServer.java Cannot find hunk target
42: Cannot find hunk target @ 0
1/47 failed
Rejects written to /home/spannerman/Crucible/patches/net/minecraft/network/NetHandlerPlayServer.java.patch.rej
> Task :eclipseCauldron
:eclipse:cauldron:eclipseJdt
:eclipse:cauldron:eclipseProject
:eclipse:cauldron:eclipseClasspath
:eclipse:cauldron:eclipseProject
:eclipse:cauldron:eclipse
> Task :eclipseClean
:eclipse:Clean:eclipseJdt
:eclipse:Clean:eclipseProject
:eclipse:Clean:eclipseProject
:eclipse:Clean:eclipseClasspath
:eclipse:Clean:eclipse
BUILD SUCCESSFUL in 5m 48s
31 actionable tasks: 31 executed
Contents of /home/spannerman/Crucible/patches/net/minecraft/network/NetHandlerPlayServer.java.patch.rej
++++ REJECTED PATCH 42
try
{
- itemstack = packetbuffer.readItemStackFromBuffer();
+ push = packetbuffer.readItemStackFromBuffer();
- if (itemstack != null)
+ if (push != null)
{
- if (!ItemEditableBook.validBookTagContents(itemstack.getTagCompound()))
+ if (!ItemEditableBook.validBookTagContents(push.getTagCompound()))
{
throw new IOException("Invalid book tag!");
}
- itemstack1 = this.playerEntity.inventory.getCurrentItem();
+ stack = this.playerEntity.inventory.getCurrentItem();
- if (itemstack1 == null)
+ if (stack == null)
{
return;
}
- if (itemstack.getItem() == Items.written_book && itemstack1.getItem() == Items.writable_book)
+ if (push.getItem() == Items.written_book && stack.getItem() == Items.writable_book)
{
- itemstack1.setTagInfo("author", new NBTTagString(this.playerEntity.getCommandSenderName()));
- itemstack1.setTagInfo("title", new NBTTagString(itemstack.getTagCompound().getString("title")));
- itemstack1.setTagInfo("pages", itemstack.getTagCompound().getTagList("pages", 8));
- itemstack1.func_150996_a(Items.written_book);
+ nouveau = stack.copy();
+ nouveau.func_150996_a(Items.written_book);
+ nouveau.setTagInfo("author", new NBTTagString(this.playerEntity.getCommandSenderName()));
+ ItemWritableBook.shadowUpdate(nouveau, push, true);
+ this.playerEntity.inventory.setInventorySlotContents(this.playerEntity.inventory.currentItem, nouveau);
+ CraftEventFactory.handleEditBookEvent(playerEntity,nouveau);
}
return;
}
}
- catch (Exception exception3)
+ // CraftBukkit start
+ catch (Throwable throwable)
{
- logger.error("Couldn\'t sign book", exception3);
- return;
+ logger.error("Couldn\'t sign book", throwable);
+ if (throwable instanceof RuntimeException && !(throwable instanceof IOException))
+ {
+ this.kickPlayerFromServer(throwable.getMessage());
+ }
+ else
+ {
+ this.kickPlayerFromServer("Invalid book data!");
+ }
+ // CraftBukkit end
}
finally
{
++++ END PATCH
I once was capable of building on Windows, but after that, juan was not able to build his linux.
I will try again on a near future
That's it, the patching now should be a lot more reliable across systems, there may be some hiccups here and there, but compared to the horrors it was before it should not be a problem