-
-
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.
- Loading branch information
1 parent
fa14a91
commit ce20b64
Showing
8 changed files
with
49 additions
and
15 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
...a/me/neovitalism/neomixins/NeoMixins.java → ...vitalism/broketrainers/BrokeTrainers.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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package me.neovitalism.neomixins; | ||
package me.neovitalism.broketrainers; | ||
|
||
import net.minecraftforge.fml.common.Mod; | ||
import org.apache.logging.log4j.Level; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
@Mod("neomixins") | ||
public class NeoMixins { | ||
@Mod("broketrainers") | ||
public class BrokeTrainers { | ||
private static final Logger LOGGER = LogManager.getLogger(); | ||
|
||
public NeoMixins() { | ||
public BrokeTrainers() { | ||
LOGGER.log(Level.INFO, "Loaded!"); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
forge116/src/main/java/me/neovitalism/broketrainers/mixins/NPCTrainerMixin.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,18 @@ | ||
package me.neovitalism.broketrainers.mixins; | ||
|
||
import com.pixelmonmod.pixelmon.api.economy.BankAccount; | ||
import com.pixelmonmod.pixelmon.entities.npcs.NPCTrainer; | ||
import net.minecraft.entity.player.ServerPlayerEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import java.util.Optional; | ||
|
||
@Mixin(value = NPCTrainer.class, remap = false) | ||
public class NPCTrainerMixin { // We make the account null to avoid sending without altering the winMoney variable. | ||
@Redirect(method = "loseBattle", at = @At(value = "INVOKE", target = "Lcom/pixelmonmod/pixelmon/api/economy/BankAccountProxy;getBankAccount(Lnet/minecraft/entity/player/ServerPlayerEntity;)Ljava/util/Optional;")) | ||
public Optional<BankAccount> getBankAccount(ServerPlayerEntity player) { | ||
return Optional.empty(); | ||
} | ||
} |
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
8 changes: 4 additions & 4 deletions
8
...a/me/neovitalism/neomixins/NeoMixins.java → ...vitalism/broketrainers/BrokeTrainers.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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package me.neovitalism.neomixins; | ||
package me.neovitalism.broketrainers; | ||
|
||
import net.minecraftforge.fml.common.Mod; | ||
import org.apache.logging.log4j.Level; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
@Mod("neomixins") | ||
public class NeoMixins { | ||
@Mod("broketrainers") | ||
public class BrokeTrainers { | ||
private static final Logger LOGGER = LogManager.getLogger(); | ||
|
||
public NeoMixins() { | ||
public BrokeTrainers() { | ||
LOGGER.log(Level.INFO, "Loaded!"); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
forge120/src/main/java/me/neovitalism/broketrainers/mixins/NPCTrainerMixin.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,16 @@ | ||
package me.neovitalism.broketrainers.mixins; | ||
|
||
import com.pixelmonmod.pixelmon.api.economy.BankAccount; | ||
import com.pixelmonmod.pixelmon.entities.npcs.NPCTrainer; | ||
import net.minecraft.world.entity.player.Player; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
@Mixin(value = NPCTrainer.class, remap = false) | ||
public class NPCTrainerMixin { // We make the account null to avoid sending without altering the winMoney variable. | ||
@Redirect(method = "loseBattle", at = @At(value = "INVOKE", target = "Lcom/pixelmonmod/pixelmon/api/economy/BankAccountProxy;getBankAccountNow(Lnet/minecraft/server/level/ServerPlayer;)Lcom/pixelmonmod/pixelmon/api/economy/BankAccount;")) | ||
public BankAccount getBankAccount(Player player) { | ||
return null; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
mod_version = 1.0.0 | ||
mod_id = neomixins | ||
mod_name = NeoMixins | ||
mod_description = Mixins for use with Pixelmon | ||
github_page = https://github.com/Neovitalism/NeoMixins | ||
mod_id = broketrainers | ||
mod_name = BrokeTrainers | ||
mod_description = A mixin to remove trainer money rewards. | ||
github_page = https://github.com/Neovitalism/NeoMixins/tree/broke-trainers |
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,4 +1,4 @@ | ||
rootProject.name = 'NeoMixins' | ||
rootProject.name = 'BrokeTrainers' | ||
include 'forge116' | ||
include 'forge120' | ||
|