-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
somehow or other get lombok and mixin working alongside each other
- Loading branch information
Showing
5 changed files
with
78 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/java/net/daporkchop/pepsimod/mixin/MixinGuiMainMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Adapted from the Wizardry License | ||
* | ||
* Copyright (c) 2017-2019 DaPorkchop_ | ||
* | ||
* Permission is hereby granted to any persons and/or organizations using this software to copy, modify, merge, publish, and distribute it. | ||
* Said persons and/or organizations are not allowed to use the software or any derivatives of the work for commercial use or any other means to generate income, nor are they allowed to claim this software as their own. | ||
* | ||
* The persons and/or organizations are also disallowed from sub-licensing and/or trademarking this software without explicit permission from DaPorkchop_. | ||
* | ||
* Any persons and/or organizations using this software must disclose their source code and have it publicly available, include this license, provide sufficient credit to the original author of the project (IE: DaPorkchop_), as well as provide a link to the original project. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
* | ||
*/ | ||
|
||
package net.daporkchop.pepsimod.mixin; | ||
|
||
import lombok.NonNull; | ||
import net.daporkchop.pepsimod.Pepsimod; | ||
import net.daporkchop.pepsimod.util.PepsiConstants; | ||
import net.minecraft.client.gui.GuiMainMenu; | ||
import net.minecraft.client.gui.GuiScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
/** | ||
* @author DaPorkchop_ | ||
*/ | ||
@Mixin(GuiMainMenu.class) | ||
public abstract class MixinGuiMainMenu extends GuiScreen { | ||
@Shadow | ||
private String splashText; | ||
|
||
@ModifyConstant( | ||
method = "Lnet/minecraft/client/gui/GuiMainMenu;drawScreen(IIF)V", | ||
constant = @Constant(stringValue = "Copyright Mojang AB. Do not distribute!") | ||
) | ||
public String changeMinecraftVersionText(@NonNull String orig) { | ||
return String.format("pepsimod %s", Pepsimod.getINSTANCE().getVersion()); | ||
//return String.format("pepsimod %s", PepsiConstants.VERSION_FULL); | ||
} | ||
|
||
@Inject( | ||
method = "Lnet/minecraft/client/gui/GuiMainMenu;initGui()V", | ||
at = @At("RETURN") | ||
) | ||
public void postInitGui(CallbackInfo ci) { | ||
this.splashText = "pepsimod xd"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38cb636
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cringe 📸
38cb636
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imagine NOT using lombok
38cb636
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imagine using pozzok
38cb636
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imagine writing accessors by hand
38cb636
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cringe
38cb636
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯\_(ツ)_/¯