missing tools and motd fixed
This commit is contained in:
1 parent
bb555386d0
commit
76334f9a68
10 files changed
+106
-66
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.settings.CarpetSettings;
|
||||
import net.minecraft.server.ServerMetadata;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
@Mixin(ServerMetadata.class)
|
||||
public class ServerMetadata_motdMixin
|
||||
{
|
||||
@Inject(method = "getDescription", at = @At("HEAD"), cancellable = true)
|
||||
private void getDescriptionAlternative(CallbackInfoReturnable<Text> cir)
|
||||
{
|
||||
if (!CarpetSettings.customMOTD.equals("_"))
|
||||
{
|
||||
cir.setReturnValue(new LiteralText(CarpetSettings.customMOTD));
|
||||
cir.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user