-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uno is now obtainable via wandering trader
right now its guaranteed from every trader for 15 emeralds, but i might change that sometime idk its not like its all that important since its literally just a deck of cards
- Loading branch information
Showing
2 changed files
with
42 additions
and
7 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/main/java/net/awakaxis/uno/mixin/WanderingTraderMixin.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,34 @@ | ||
package net.awakaxis.uno.mixin; | ||
|
||
import net.awakaxis.uno.UNOBlocks; | ||
import net.awakaxis.uno.UNOItems; | ||
import net.awakaxis.uno.item.UnoCardItem; | ||
import net.minecraft.world.entity.npc.WanderingTrader; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.item.trading.MerchantOffer; | ||
import net.minecraft.world.item.trading.MerchantOffers; | ||
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.CallbackInfo; | ||
|
||
@Mixin(WanderingTrader.class) | ||
public abstract class WanderingTraderMixin { | ||
|
||
@Inject(method="updateTrades", at=@At("RETURN")) | ||
private void appendUnoCard(CallbackInfo ci) { | ||
WanderingTrader wanderingTrader = (WanderingTrader) (Object) this; | ||
|
||
MerchantOffers merchantOffers = wanderingTrader.getOffers(); | ||
|
||
MerchantOffer unoCardOffer = new MerchantOffer( | ||
new ItemStack(Items.EMERALD, 15), | ||
ItemStack.EMPTY, | ||
UNOBlocks.CARD_DECK.asItem().getDefaultInstance(), | ||
1, 5, 0.05f | ||
); | ||
|
||
merchantOffers.add(unoCardOffer); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
{ | ||
"required": true, | ||
"package": "net.awakaxis.uno.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
"required": true, | ||
"package": "net.awakaxis.uno.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
"WanderingTraderMixin" | ||
], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |