Skip to content

Commit

Permalink
Init 1.21.2 neoforge
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 22, 2024
1 parent d9324da commit 1a32f96
Show file tree
Hide file tree
Showing 1,581 changed files with 18,541 additions and 19,269 deletions.
10 changes: 5 additions & 5 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<div align="center">
<h1>Youer 1.21.1</h1>
<h1>Youer 1.21.2</h1>

<span style="color:red;font-size:20px;">The project is experimental, we are not available, and it is expected that it will not be released stably until after 1.21.2 or 1.22.</span>

### Minecraft NeoForge Hybrid server implementing the Spigot/Bukkit API

[![](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.codemc.io%2Fjob%2FMohistMC%2Fjob%2FYouer-1.21.1)](https://ci.codemc.io/job/MohistMC/job/Youer-1.21.1)
[![](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.codemc.io%2Fjob%2FMohistMC%2Fjob%2FYouer-1.21.2)](https://ci.codemc.io/job/MohistMC/job/Youer-1.21.2)
[![](https://img.shields.io/github/stars/MohistMC/Mohist.svg?label=Stars&logo=github)](https://github.com/MohistMC/Mohist/stargazers)
[![](https://img.shields.io/badge/NeoForge-21.1.4-brightgreen.svg?colorB=26303d)](https://neoforged.net/)
[![](https://img.shields.io/badge/NeoForge-21.2.0-brightgreen.svg?colorB=26303d)](https://neoforged.net/)
[![](https://img.shields.io/badge/JDK-21.0.3-brightgreen.svg?colorB=469C00&logo=java)](https://www.azul.com/downloads/?version=java-21-lts#zulu)
[![](https://img.shields.io/badge/Gradle-8.3-brightgreen.svg?colorB=469C00&logo=gradle)](https://docs.gradle.org/8.3/release-notes.html)
[![](https://img.shields.io/badge/Gradle-8.10.2-brightgreen.svg?colorB=469C00&logo=gradle)](https://docs.gradle.org/8.10.2/release-notes.html)
[![](https://img.shields.io/bstats/servers/6762?label=bStats)](https://bstats.org/plugin/server-implementation/Mohist/6762)
[![](https://badges.crowdin.net/mohist/localized.svg)](https://crowdin.com/project/mohist)
[![](https://img.shields.io/discord/311256119005937665.svg?color=%237289da&label=Discord&logo=discord&logoColor=%237289da)](https://discord.gg/mohistmc)
Expand All @@ -21,7 +21,7 @@
Progress
------

- [x] Rectify NeoForge([**bdda6d296d**](https://github.com/neoforged/NeoForge/commit/bdda6d296d))
- [x] Rectify NeoForge([**91303b6970**](https://github.com/neoforged/NeoForge/commit/91303b6970))
- [ ] Start patch
* [x] Bukkit([**69fa4695**](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/69fa4695))
* [ ] CraftBukkit([**661afb43c**](https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/commits/661afb43c))
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,28 @@ org.gradle.debug=false

java_version=21

minecraft_version=1.21.1
neoform_version=20240808.144430
minecraft_version=1.21.2
neoform_version=20241022.151510
# on snapshot versions, used to prefix the version
neoforge_snapshot_next_stable=22.0
neoforge_snapshot_next_stable=21.3

mergetool_version=2.0.0
accesstransformers_version=10.0.1
coremods_version=6.0.4
eventbus_version=8.0.1
eventbus_version=8.0.2
modlauncher_version=11.0.4
securejarhandler_version=3.0.8
bootstraplauncher_version=2.0.2
asm_version=9.7
installer_version=2.1.+
mixin_version=0.15.2+mixin.0.8.7
terminalconsoleappender_version=1.3.0
jline_version=3.12.+
nightconfig_version=3.8.0
jetbrains_annotations_version=24.0.1
slf4j_api_version=2.0.7
apache_maven_artifact_version=3.8.5
jarjar_version=0.4.1
fancy_mod_loader_version=4.0.24
fancy_mod_loader_version=4.0.29
mojang_logging_version=1.1.1
log4j_version=2.22.1
guava_version=31.1.2-jre
Expand All @@ -54,4 +53,5 @@ neogradle.subsystems.conventions.sourcesets.automatic-inclusion=false
neogradle.subsystems.conventions.enabled=false
neogradle.subsystems.tools.jst=net.neoforged.jst:jst-cli-bundle:1.0.45


neoforge_version=21.0.52-beta
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
10 changes: 10 additions & 0 deletions nms-patches/net/minecraft/CrashReport.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- a/net/minecraft/CrashReport.java
+++ b/net/minecraft/CrashReport.java
@@ -36,6 +36,7 @@
public CrashReport(String s, Throwable throwable) {
this.title = s;
this.exception = throwable;
+ this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit
}

public String getTitle() {
25 changes: 25 additions & 0 deletions nms-patches/net/minecraft/advancements/AdvancementHolder.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
--- a/net/minecraft/advancements/AdvancementHolder.java
+++ b/net/minecraft/advancements/AdvancementHolder.java
@@ -6,6 +6,11 @@
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.resources.MinecraftKey;

+// CraftBukkit start
+import org.bukkit.craftbukkit.advancement.CraftAdvancement;
+import org.bukkit.craftbukkit.util.CraftNamespacedKey;
+// CraftBukkit end
+
public record AdvancementHolder(MinecraftKey id, Advancement value) {

public static final StreamCodec<RegistryFriendlyByteBuf, AdvancementHolder> STREAM_CODEC = StreamCodec.composite(MinecraftKey.STREAM_CODEC, AdvancementHolder::id, Advancement.STREAM_CODEC, AdvancementHolder::value, AdvancementHolder::new);
@@ -38,4 +43,10 @@
public String toString() {
return this.id.toString();
}
+
+ // CraftBukkit start
+ public final org.bukkit.advancement.Advancement toBukkit() {
+ return new CraftAdvancement(this);
+ }
+ // CraftBukkit end
}
11 changes: 11 additions & 0 deletions nms-patches/net/minecraft/advancements/AdvancementTree.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/net/minecraft/advancements/AdvancementTree.java
+++ b/net/minecraft/advancements/AdvancementTree.java
@@ -77,7 +77,7 @@
}
}

- AdvancementTree.LOGGER.info("Loaded {} advancements", this.nodes.size());
+ // AdvancementTree.LOGGER.info("Loaded {} advancements", this.nodes.size()); // CraftBukkit - moved to AdvancementDataWorld#reload
}

private boolean tryInsert(AdvancementHolder advancementholder) {
24 changes: 12 additions & 12 deletions nms-patches/net/minecraft/commands/CommandDispatcher.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/CommandDispatcher.java
+++ b/net/minecraft/commands/CommandDispatcher.java
@@ -135,6 +135,14 @@
@@ -139,6 +139,14 @@
import net.minecraft.world.level.GameRules;
import org.slf4j.Logger;

Expand All @@ -15,15 +15,15 @@
public class CommandDispatcher {

private static final ThreadLocal<ExecutionContext<CommandListenerWrapper>> CURRENT_EXECUTION_CONTEXT = new ThreadLocal();
@@ -147,6 +155,7 @@
@@ -151,6 +159,7 @@
private final com.mojang.brigadier.CommandDispatcher<CommandListenerWrapper> dispatcher = new com.mojang.brigadier.CommandDispatcher();

public CommandDispatcher(CommandDispatcher.ServerType commanddispatcher_servertype, CommandBuildContext commandbuildcontext) {
+ this(); // CraftBukkit
CommandAdvancement.register(this.dispatcher);
CommandAttribute.register(this.dispatcher, commandbuildcontext);
CommandExecute.register(this.dispatcher, commandbuildcontext);
@@ -247,6 +256,11 @@
@@ -252,6 +261,11 @@
CommandPublish.register(this.dispatcher);
}

Expand All @@ -35,7 +35,7 @@
this.dispatcher.setConsumer(ExecutionCommandSource.resultConsumer());
}

@@ -257,18 +271,65 @@
@@ -262,18 +276,65 @@
return new ParseResults(commandcontextbuilder1, parseresults.getReader(), parseresults.getExceptions());
}

Expand Down Expand Up @@ -95,15 +95,15 @@
+ public void performCommand(ParseResults<CommandListenerWrapper> parseresults, String s, String label) { // CraftBukkit
CommandListenerWrapper commandlistenerwrapper = (CommandListenerWrapper) parseresults.getContext().getSource();

commandlistenerwrapper.getServer().getProfiler().push(() -> {
Profiler.get().push(() -> {
return "/" + s;
});
- ContextChain<CommandListenerWrapper> contextchain = finishParsing(parseresults, s, commandlistenerwrapper);
+ ContextChain<CommandListenerWrapper> contextchain = finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit

try {
if (contextchain != null) {
@@ -302,7 +363,7 @@
@@ -307,7 +368,7 @@
}

@Nullable
Expand All @@ -112,7 +112,7 @@
try {
validateParseResults(parseresults);
return (ContextChain) ContextChain.tryFlatten(parseresults.getContext().build(s)).orElseThrow(() -> {
@@ -313,7 +374,7 @@
@@ -318,7 +379,7 @@
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
int i = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
IChatMutableComponent ichatmutablecomponent = IChatBaseComponent.empty().withStyle(EnumChatFormat.GRAY).withStyle((chatmodifier) -> {
Expand All @@ -121,7 +121,7 @@
});

if (i > 10) {
@@ -363,7 +424,7 @@
@@ -368,7 +429,7 @@

executioncontext1.close();
} finally {
Expand All @@ -130,7 +130,7 @@
}
} else {
consumer.accept(executioncontext);
@@ -372,11 +433,36 @@
@@ -377,11 +438,36 @@
}

public void sendCommands(EntityPlayer entityplayer) {
Expand Down Expand Up @@ -168,7 +168,7 @@
entityplayer.connection.send(new PacketPlayOutCommands(rootcommandnode));
}

@@ -387,7 +473,7 @@
@@ -392,7 +478,7 @@
CommandNode<CommandListenerWrapper> commandnode2 = (CommandNode) iterator.next();

if (commandnode2.canUse(commandlistenerwrapper)) {
Expand All @@ -177,7 +177,7 @@

argumentbuilder.requires((icompletionprovider) -> {
return true;
@@ -410,7 +496,7 @@
@@ -415,7 +501,7 @@
argumentbuilder.redirect((CommandNode) map.get(argumentbuilder.getRedirect()));
}

Expand All @@ -186,7 +186,7 @@

map.put(commandnode2, commandnode3);
commandnode1.addChild(commandnode3);
@@ -471,7 +557,7 @@
@@ -481,7 +567,7 @@
}

private <T> HolderLookup.b.a<T> createLookup(final HolderLookup.b<T> holderlookup_b) {
Expand Down
14 changes: 7 additions & 7 deletions nms-patches/net/minecraft/commands/CommandListenerWrapper.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/commands/CommandListenerWrapper.java
+++ b/net/minecraft/commands/CommandListenerWrapper.java
@@ -44,6 +44,8 @@
@@ -46,6 +46,8 @@
import net.minecraft.world.phys.Vec2F;
import net.minecraft.world.phys.Vec3D;

Expand All @@ -9,15 +9,15 @@
public class CommandListenerWrapper implements ExecutionCommandSource<CommandListenerWrapper>, ICompletionProvider {

public static final SimpleCommandExceptionType ERROR_NOT_PLAYER = new SimpleCommandExceptionType(IChatBaseComponent.translatable("permissions.requires.player"));
@@ -63,6 +65,7 @@
@@ -65,6 +67,7 @@
private final Vec2F rotation;
private final CommandSigningContext signingContext;
private final TaskChainer chatMessageChainer;
+ public volatile CommandNode currentCommand; // CraftBukkit

public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) {
this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, CommandResultCallback.EMPTY, ArgumentAnchor.Anchor.FEET, CommandSigningContext.ANONYMOUS, TaskChainer.immediate(minecraftserver));
@@ -169,9 +172,23 @@
@@ -171,9 +174,23 @@

@Override
public boolean hasPermission(int i) {
Expand All @@ -41,16 +41,16 @@
public Vec3D getPosition() {
return this.worldPosition;
}
@@ -300,7 +317,7 @@
@@ -302,7 +319,7 @@
while (iterator.hasNext()) {
EntityPlayer entityplayer = (EntityPlayer) iterator.next();

- if (entityplayer != this.source && this.server.getPlayerList().isOp(entityplayer.getGameProfile())) {
+ if (entityplayer != this.source && entityplayer.getBukkitEntity().hasPermission("minecraft.admin.command_feedback")) { // CraftBukkit
- if (entityplayer.commandSource() != this.source && this.server.getPlayerList().isOp(entityplayer.getGameProfile())) {
+ if (entityplayer.commandSource() != this.source && entityplayer.getBukkitEntity().hasPermission("minecraft.admin.command_feedback")) { // CraftBukkit
entityplayer.sendSystemMessage(ichatmutablecomponent);
}
}
@@ -393,4 +410,10 @@
@@ -400,4 +417,10 @@
public boolean isSilent() {
return this.silent;
}
Expand Down
Loading

0 comments on commit 1a32f96

Please sign in to comment.