Skip to content

Commit

Permalink
Moved battlegear API package into backhand package.
Browse files Browse the repository at this point in the history
  • Loading branch information
c0508383 committed Jun 26, 2024
1 parent 23dd30c commit 3ac4531
Show file tree
Hide file tree
Showing 35 changed files with 46 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.battlegear2.api.PlayerEventChild;
import mods.battlegear2.api.core.*;
import xonin.backhand.api.PlayerEventChild;
import mods.battlegear2.packet.BattlegearSyncItemPacket;
import mods.battlegear2.packet.OffhandConfigSyncPacket;
import mods.battlegear2.packet.OffhandPlaceBlockPacket;
Expand All @@ -36,6 +35,7 @@
import org.apache.logging.log4j.Level;
import xonin.backhand.Backhand;
import xonin.backhand.CommonProxy;
import xonin.backhand.api.core.*;

public final class BattlemodeHookContainerClass {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.battlegear2.BattlemodeHookContainerClass;
import mods.battlegear2.api.PlayerEventChild;
import mods.battlegear2.api.core.BattlegearUtils;
import mods.battlegear2.api.core.IBattlePlayer;
import mods.battlegear2.api.core.InventoryPlayerBattle;
import xonin.backhand.api.PlayerEventChild;
import xonin.backhand.api.core.BattlegearUtils;
import xonin.backhand.api.core.IBattlePlayer;
import xonin.backhand.api.core.InventoryPlayerBattle;
import mods.battlegear2.packet.OffhandPlaceBlockPacket;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.client.utils;

import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.item.ItemStack;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import mods.battlegear2.api.core.IBattlePlayer;
import xonin.backhand.api.core.IBattlePlayer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions;
import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;

import java.io.File;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;
import org.objectweb.asm.tree.MethodNode;

public final class EntityAIControlledByPlayerTransformer extends TransformerMethodProcess {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;
import org.objectweb.asm.tree.*;

import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import mods.battlegear2.api.core.IBattlePlayer;
import xonin.backhand.api.core.BattlegearTranslator;
import xonin.backhand.api.core.IBattlePlayer;
import net.tclproject.mysteriumlib.asm.common.CustomLoadingPlugin;

import org.apache.logging.log4j.Level;
Expand Down Expand Up @@ -67,11 +67,11 @@ boolean processMethods(List<MethodNode> methods) {
AbstractInsnNode insn = it.next();
if (insn instanceof TypeInsnNode) {
if (((TypeInsnNode) insn).desc.equals(inventoryClassName)) {
((TypeInsnNode) insn).desc = "mods/battlegear2/api/core/InventoryPlayerBattle";
((TypeInsnNode) insn).desc = "xonin/backhand/api/core/InventoryPlayerBattle";
}
} else if (insn instanceof MethodInsnNode) {
if (((MethodInsnNode) insn).owner.equals(inventoryClassName)) {
((MethodInsnNode) insn).owner = "mods/battlegear2/api/core/InventoryPlayerBattle";
((MethodInsnNode) insn).owner = "xonin/backhand/api/core/InventoryPlayerBattle";
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;
import org.objectweb.asm.tree.*;

import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;
import org.objectweb.asm.tree.*;

import java.util.Iterator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import org.objectweb.asm.tree.*;

import java.util.List;
Expand Down Expand Up @@ -32,7 +31,7 @@ boolean processMethods(List<MethodNode> methods) {

if (nextNode instanceof JumpInsnNode && nextNode.getOpcode() == IFLT) {
LabelNode label = ((JumpInsnNode) nextNode).label;
newList.add(new MethodInsnNode(INVOKESTATIC, "mods/battlegear2/api/core/InventoryPlayerBattle", "isValidSwitch", "(I)Z"));
newList.add(new MethodInsnNode(INVOKESTATIC, "xonin/backhand/api/core/InventoryPlayerBattle", "isValidSwitch", "(I)Z"));
newList.add(new JumpInsnNode(IFEQ, label));//"if equal" branch

found++;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;
import org.objectweb.asm.tree.MethodNode;

public final class PlayerControllerMPTransformer extends TransformerMethodProcess {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;
import mods.battlegear2.coremod.BattlegearLoadingPlugin;
import net.minecraft.launchwrapper.IClassTransformer;
import org.apache.logging.log4j.Level;
Expand All @@ -18,7 +18,7 @@
import java.util.List;

public abstract class TransformerBase implements IClassTransformer, Opcodes {
public static final String UTILITY_CLASS = "mods/battlegear2/api/core/BattlegearUtils";
public static final String UTILITY_CLASS = "xonin/backhand/api/core/BattlegearUtils";
public static final String SIMPLEST_METHOD_DESC = "()V";
public Logger logger = LogManager.getLogger("battlegear2");
protected final String classPath;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package mods.battlegear2.coremod.transformers;

import mods.battlegear2.api.core.BattlegearTranslator;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import mods.battlegear2.api.core.IBattlePlayer;
import xonin.backhand.api.core.IBattlePlayer;
import mods.battlegear2.utils.EnumBGAnimations;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.WorldServer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import mods.battlegear2.api.core.BattlegearUtils;
import mods.battlegear2.api.core.InventoryPlayerBattle;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import mods.battlegear2.api.core.IBattlePlayer;
import xonin.backhand.api.core.IBattlePlayer;
import mods.battlegear2.utils.EnumBGAnimations;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import cpw.mods.fml.relauncher.Side;
import io.netty.buffer.ByteBuf;
import mods.battlegear2.BattlemodeHookContainerClass;
import mods.battlegear2.api.PlayerEventChild;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.PlayerEventChild;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@

import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import mods.battlegear2.api.core.BattlegearUtils;
import mods.battlegear2.api.core.InventoryPlayerBattle;
import xonin.backhand.api.core.BattlegearUtils;
import xonin.backhand.api.core.InventoryPlayerBattle;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import xonin.backhand.client.ClientTickHandler;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cpw.mods.fml.common.network.ByteBufUtils;
import io.netty.buffer.ByteBuf;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mods/battlegear2/utils/EnumBGAnimations.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package mods.battlegear2.utils;

import mods.battlegear2.api.core.IBattlePlayer;
import xonin.backhand.api.core.IBattlePlayer;

public enum EnumBGAnimations {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import cpw.mods.fml.common.asm.transformers.DeobfuscationTransformer;
import cpw.mods.fml.relauncher.CoreModManager;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import mods.battlegear2.api.core.BattlegearTranslator;
import xonin.backhand.api.core.BattlegearTranslator;
import mods.battlegear2.coremod.BattlegearLoadingPlugin;
import net.tclproject.mysteriumlib.asm.core.ASMFix;
import net.tclproject.mysteriumlib.asm.core.MetaReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import invtweaks.InvTweaksContainerSectionManager;
import invtweaks.api.container.ContainerSection;
import mods.battlegear2.BattlemodeHookContainerClass;
import mods.battlegear2.api.core.BattlegearUtils;
import mods.battlegear2.api.core.IBattlePlayer;
import mods.battlegear2.api.core.InventoryPlayerBattle;
import xonin.backhand.api.core.BattlegearUtils;
import xonin.backhand.api.core.IBattlePlayer;
import xonin.backhand.api.core.InventoryPlayerBattle;
import mods.battlegear2.client.BattlegearClientTickHandler;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/xonin/backhand/ServerEventsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.relauncher.Side;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.ArrowNockEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerUseItemEvent;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/xonin/backhand/ServerTickHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import cpw.mods.fml.relauncher.Side;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import mods.battlegear2.packet.BattlegearSyncItemPacket;
import mods.battlegear2.packet.OffhandWorldHotswapPacket;
import net.minecraft.entity.player.EntityPlayer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
package mods.battlegear2.api;
package xonin.backhand.api;

import cpw.mods.fml.common.eventhandler.Cancelable;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemStack;
import net.minecraft.util.DamageSource;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.ArrowLooseEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import net.minecraftforge.event.entity.player.PlayerEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mods.battlegear2.api.core;
package xonin.backhand.api.core;

import net.tclproject.mysteriumlib.asm.common.CustomLoadingPlugin;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mods.battlegear2.api.core;
package xonin.backhand.api.core;

import java.io.Closeable;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mods.battlegear2.api.core;
package xonin.backhand.api.core;

import net.minecraft.entity.Entity;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mods.battlegear2.api.core;
package xonin.backhand.api.core;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mods.battlegear2.api.core;
package xonin.backhand.api.core;

import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiIngame;
import net.minecraft.client.model.ModelBiped;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/xonin/backhand/client/ClientTickHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
import cpw.mods.fml.relauncher.SideOnly;
import invtweaks.InvTweaks;
import mods.battlegear2.BattlemodeHookContainerClass;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import mods.battlegear2.client.BattlegearClientTickHandler;
import mods.battlegear2.packet.OffhandSwapPacket;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import org.lwjgl.input.Keyboard;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
package xonin.backhand.client.renderer;

import mods.battlegear2.api.core.IBattlePlayer;
import xonin.backhand.client.ClientEventHandler;
import mods.battlegear2.api.core.BattlegearUtils;
import xonin.backhand.api.core.BattlegearUtils;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityClientPlayerMP;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.*;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.*;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.IItemRenderer;
Expand All @@ -25,7 +21,6 @@
import org.lwjgl.opengl.GL12;

import static net.minecraftforge.client.IItemRenderer.ItemRenderType.*;
import static net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D;

public class ItemRendererOffhand extends ItemRenderer {
private static final ResourceLocation RES_ITEM_GLINT = new ResourceLocation("textures/misc/enchanted_item_glint.png");
Expand Down

0 comments on commit 3ac4531

Please sign in to comment.