Skip to content

Commit

Permalink
BrokeTrainers
Browse files Browse the repository at this point in the history
  • Loading branch information
Neovitalism committed Nov 8, 2024
1 parent fa14a91 commit ce20b64
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 15 deletions.
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!");
}
}
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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_8",
"mixins": [

"NPCTrainerMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down
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!");
}
}
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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"target": "@env(DEFAULT)",
"compatibilityLevel": "JAVA_17",
"mixins": [

"NPCTrainerMixin
],
"injectors": {
"defaultRequire": 1
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
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
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'NeoMixins'
rootProject.name = 'BrokeTrainers'
include 'forge116'
include 'forge120'

0 comments on commit ce20b64

Please sign in to comment.