diff --git a/src/main/java/mods/battlegear2/BattlemodeHookContainerClass.java b/src/main/java/mods/battlegear2/BattlemodeHookContainerClass.java index 2b0b431..2f26b2c 100644 --- a/src/main/java/mods/battlegear2/BattlemodeHookContainerClass.java +++ b/src/main/java/mods/battlegear2/BattlemodeHookContainerClass.java @@ -10,9 +10,9 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import xonin.backhand.api.PlayerEventChild; -import mods.battlegear2.packet.BattlegearSyncItemPacket; -import mods.battlegear2.packet.OffhandConfigSyncPacket; -import mods.battlegear2.packet.OffhandPlaceBlockPacket; +import xonin.backhand.packet.OffhandSyncItemPacket; +import xonin.backhand.packet.OffhandConfigSyncPacket; +import xonin.backhand.packet.OffhandPlaceBlockPacket; import xonin.backhand.utils.EnumAnimations; import net.minecraft.block.Block; import net.minecraft.entity.Entity; @@ -352,7 +352,7 @@ private boolean hasEntityInteraction(ItemStack itemStack, Entity entity, EntityP @SubscribeEvent public void addTracking(PlayerEvent.StartTracking event){ if(event.target instanceof EntityPlayer && !isFake(event.target)){ - ((EntityPlayerMP)event.entityPlayer).playerNetServerHandler.sendPacket(new BattlegearSyncItemPacket((EntityPlayer) event.target).generatePacket()); + ((EntityPlayerMP)event.entityPlayer).playerNetServerHandler.sendPacket(new OffhandSyncItemPacket((EntityPlayer) event.target).generatePacket()); } } } diff --git a/src/main/java/xonin/backhand/Backhand.java b/src/main/java/xonin/backhand/Backhand.java index b879509..6caca24 100644 --- a/src/main/java/xonin/backhand/Backhand.java +++ b/src/main/java/xonin/backhand/Backhand.java @@ -8,7 +8,7 @@ import cpw.mods.fml.common.network.FMLEventChannel; import cpw.mods.fml.common.network.NetworkRegistry; import mods.battlegear2.BattlemodeHookContainerClass; -import mods.battlegear2.packet.BattlegearPacketHandler; +import xonin.backhand.packet.BackhandPacketHandler; import xonin.backhand.utils.BackhandConfig; import net.minecraft.item.ItemStack; import net.minecraft.server.MinecraftServer; @@ -25,7 +25,7 @@ public class Backhand { @SidedProxy(clientSide = "xonin.backhand.client.ClientProxy", serverSide = "xonin.backhand.CommonProxy") public static CommonProxy proxy; - public static BattlegearPacketHandler packetHandler; + public static BackhandPacketHandler packetHandler; public static boolean OffhandAttack = false; public static boolean EmptyOffhand = false; @@ -62,7 +62,7 @@ public void load(FMLPreInitializationEvent event) { @Mod.EventHandler public void init(FMLInitializationEvent event) { - packetHandler = new BattlegearPacketHandler(); + packetHandler = new BackhandPacketHandler(); packetHandler.register(); } diff --git a/src/main/java/xonin/backhand/ServerTickHandler.java b/src/main/java/xonin/backhand/ServerTickHandler.java index 4b28419..6716007 100644 --- a/src/main/java/xonin/backhand/ServerTickHandler.java +++ b/src/main/java/xonin/backhand/ServerTickHandler.java @@ -6,8 +6,8 @@ import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.relauncher.Side; import xonin.backhand.api.core.BattlegearUtils; -import mods.battlegear2.packet.BattlegearSyncItemPacket; -import mods.battlegear2.packet.OffhandWorldHotswapPacket; +import xonin.backhand.packet.OffhandSyncItemPacket; +import xonin.backhand.packet.OffhandWorldHotswapPacket; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.init.Items; @@ -115,7 +115,7 @@ public void onUpdatePlayer(TickEvent.PlayerTickEvent event) if (BattlegearUtils.getOffhandEP(player).syncOffhand) { if (!tickStartItems.containsKey(player.getUniqueID())) { - Backhand.packetHandler.sendPacketToAll(new BattlegearSyncItemPacket(player).generatePacket()); + Backhand.packetHandler.sendPacketToAll(new OffhandSyncItemPacket(player).generatePacket()); } BattlegearUtils.getOffhandEP(player).syncOffhand = false; } diff --git a/src/main/java/xonin/backhand/client/BackhandClientTickHandler.java b/src/main/java/xonin/backhand/client/BackhandClientTickHandler.java index 9bf1fc0..34c4f3f 100644 --- a/src/main/java/xonin/backhand/client/BackhandClientTickHandler.java +++ b/src/main/java/xonin/backhand/client/BackhandClientTickHandler.java @@ -1,7 +1,7 @@ package xonin.backhand.client; -import mods.battlegear2.packet.OffhandAttackPacket; -import mods.battlegear2.packet.OffhandToServerPacket; +import xonin.backhand.packet.OffhandAttackPacket; +import xonin.backhand.packet.OffhandToServerPacket; import net.minecraft.block.BlockGrass; import net.minecraft.block.BlockLog; import net.minecraft.block.material.Material; @@ -21,7 +21,7 @@ import xonin.backhand.api.core.BattlegearUtils; import xonin.backhand.api.core.IBattlePlayer; import xonin.backhand.api.core.InventoryPlayerBattle; -import mods.battlegear2.packet.OffhandPlaceBlockPacket; +import xonin.backhand.packet.OffhandPlaceBlockPacket; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.multiplayer.PlayerControllerMP; @@ -34,7 +34,6 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.tclproject.mysteriumlib.asm.fixes.MysteriumPatchesFixesO; import xonin.backhand.CommonProxy; -import xonin.backhand.client.ClientTickHandler; public final class BackhandClientTickHandler { public final Minecraft mc = Minecraft.getMinecraft(); diff --git a/src/main/java/xonin/backhand/client/ClientProxy.java b/src/main/java/xonin/backhand/client/ClientProxy.java index 75ddb49..f0c6ce4 100644 --- a/src/main/java/xonin/backhand/client/ClientProxy.java +++ b/src/main/java/xonin/backhand/client/ClientProxy.java @@ -2,7 +2,7 @@ import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.FMLCommonHandler; -import mods.battlegear2.packet.BattlegearAnimationPacket; +import xonin.backhand.packet.OffhandAnimationPacket; import xonin.backhand.utils.EnumAnimations; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; @@ -39,7 +39,7 @@ public EntityPlayer getClientPlayer() { public void sendAnimationPacket(EnumAnimations animation, EntityPlayer entityPlayer) { if (entityPlayer instanceof EntityClientPlayerMP) { ((EntityClientPlayerMP) entityPlayer).sendQueue.addToSendQueue( - new BattlegearAnimationPacket(animation, entityPlayer).generatePacket()); + new OffhandAnimationPacket(animation, entityPlayer).generatePacket()); } } diff --git a/src/main/java/xonin/backhand/client/ClientTickHandler.java b/src/main/java/xonin/backhand/client/ClientTickHandler.java index 71c40d8..0f85e1a 100644 --- a/src/main/java/xonin/backhand/client/ClientTickHandler.java +++ b/src/main/java/xonin/backhand/client/ClientTickHandler.java @@ -9,7 +9,7 @@ import invtweaks.InvTweaks; import mods.battlegear2.BattlemodeHookContainerClass; import xonin.backhand.api.core.BattlegearUtils; -import mods.battlegear2.packet.OffhandSwapPacket; +import xonin.backhand.packet.OffhandSwapPacket; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityClientPlayerMP; import net.minecraft.item.ItemStack; diff --git a/src/main/java/mods/battlegear2/packet/AbstractMBPacket.java b/src/main/java/xonin/backhand/packet/AbstractPacket.java similarity index 88% rename from src/main/java/mods/battlegear2/packet/AbstractMBPacket.java rename to src/main/java/xonin/backhand/packet/AbstractPacket.java index ab12bee..02c81ef 100644 --- a/src/main/java/mods/battlegear2/packet/AbstractMBPacket.java +++ b/src/main/java/xonin/backhand/packet/AbstractPacket.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import io.netty.buffer.ByteBuf; @@ -10,7 +10,7 @@ * Date: 26/06/13 * Time: 1:35 PM */ -public abstract class AbstractMBPacket { +public abstract class AbstractPacket { public final FMLProxyPacket generatePacket() { ByteBuf buf = Unpooled.buffer(); diff --git a/src/main/java/mods/battlegear2/packet/BattlegearPacketHandler.java b/src/main/java/xonin/backhand/packet/BackhandPacketHandler.java similarity index 89% rename from src/main/java/mods/battlegear2/packet/BattlegearPacketHandler.java rename to src/main/java/xonin/backhand/packet/BackhandPacketHandler.java index 8a3d8c7..976ab3d 100644 --- a/src/main/java/mods/battlegear2/packet/BattlegearPacketHandler.java +++ b/src/main/java/xonin/backhand/packet/BackhandPacketHandler.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import java.util.Hashtable; import java.util.Map; @@ -15,14 +15,14 @@ import net.minecraft.network.NetHandlerPlayServer; import xonin.backhand.Backhand; -public final class BattlegearPacketHandler { +public final class BackhandPacketHandler { - public Map map = new Hashtable<>(); + public Map map = new Hashtable<>(); public Map channels = new Hashtable<>(); - public BattlegearPacketHandler() { - map.put(BattlegearSyncItemPacket.packetName, new BattlegearSyncItemPacket()); - map.put(BattlegearAnimationPacket.packetName, new BattlegearAnimationPacket()); + public BackhandPacketHandler() { + map.put(OffhandSyncItemPacket.packetName, new OffhandSyncItemPacket()); + map.put(OffhandAnimationPacket.packetName, new OffhandAnimationPacket()); map.put(OffhandPlaceBlockPacket.packetName, new OffhandPlaceBlockPacket()); map.put(OffhandToServerPacket.packetName, new OffhandToServerPacket()); map.put(OffhandSwapPacket.packetName, new OffhandSwapPacket()); diff --git a/src/main/java/mods/battlegear2/packet/BattlegearAnimationPacket.java b/src/main/java/xonin/backhand/packet/OffhandAnimationPacket.java similarity index 86% rename from src/main/java/mods/battlegear2/packet/BattlegearAnimationPacket.java rename to src/main/java/xonin/backhand/packet/OffhandAnimationPacket.java index fae8b48..89c2f9e 100644 --- a/src/main/java/mods/battlegear2/packet/BattlegearAnimationPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandAnimationPacket.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.network.ByteBufUtils; import io.netty.buffer.ByteBuf; @@ -12,18 +12,18 @@ * Date: 26/06/13 * Time: 1:47 PM */ -public final class BattlegearAnimationPacket extends AbstractMBPacket { +public final class OffhandAnimationPacket extends AbstractPacket { public static final String packetName = "MB2|Animation"; private EnumAnimations animation; private String username; - public BattlegearAnimationPacket(EnumAnimations animation, EntityPlayer user) { + public OffhandAnimationPacket(EnumAnimations animation, EntityPlayer user) { this.animation = animation; this.username = user.getCommandSenderName(); } - public BattlegearAnimationPacket() { + public OffhandAnimationPacket() { } @Override diff --git a/src/main/java/mods/battlegear2/packet/OffhandAttackPacket.java b/src/main/java/xonin/backhand/packet/OffhandAttackPacket.java similarity index 90% rename from src/main/java/mods/battlegear2/packet/OffhandAttackPacket.java rename to src/main/java/xonin/backhand/packet/OffhandAttackPacket.java index f1bdfec..048b411 100644 --- a/src/main/java/mods/battlegear2/packet/OffhandAttackPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandAttackPacket.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.network.ByteBufUtils; import io.netty.buffer.ByteBuf; @@ -11,7 +11,7 @@ import net.minecraft.entity.projectile.EntityArrow; import xonin.backhand.Backhand; -public class OffhandAttackPacket extends AbstractMBPacket { +public class OffhandAttackPacket extends AbstractPacket { public static final String packetName = "MB2|Attack"; private String user; private int targetId; @@ -51,7 +51,7 @@ public void process(ByteBuf inputStream, EntityPlayer sender) { return; } ((IBattlePlayer) player).attackTargetEntityWithCurrentOffItem(target); - Backhand.packetHandler.sendPacketAround(player, 120, new BattlegearAnimationPacket(EnumAnimations.OffHandSwing, player).generatePacket()); + Backhand.packetHandler.sendPacketAround(player, 120, new OffhandAnimationPacket(EnumAnimations.OffHandSwing, player).generatePacket()); } } } diff --git a/src/main/java/mods/battlegear2/packet/OffhandConfigSyncPacket.java b/src/main/java/xonin/backhand/packet/OffhandConfigSyncPacket.java similarity index 91% rename from src/main/java/mods/battlegear2/packet/OffhandConfigSyncPacket.java rename to src/main/java/xonin/backhand/packet/OffhandConfigSyncPacket.java index 6d7171a..20952a2 100644 --- a/src/main/java/mods/battlegear2/packet/OffhandConfigSyncPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandConfigSyncPacket.java @@ -1,13 +1,12 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ContainerPlayer; import net.tclproject.mysteriumlib.asm.fixes.MysteriumPatchesFixesO; import xonin.backhand.Backhand; -public final class OffhandConfigSyncPacket extends AbstractMBPacket { +public final class OffhandConfigSyncPacket extends AbstractPacket { public static final String packetName = "MB2|ConfigSync"; private EntityPlayer player; diff --git a/src/main/java/mods/battlegear2/packet/OffhandPlaceBlockPacket.java b/src/main/java/xonin/backhand/packet/OffhandPlaceBlockPacket.java similarity index 98% rename from src/main/java/mods/battlegear2/packet/OffhandPlaceBlockPacket.java rename to src/main/java/xonin/backhand/packet/OffhandPlaceBlockPacket.java index 71ff013..09f85b0 100644 --- a/src/main/java/mods/battlegear2/packet/OffhandPlaceBlockPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandPlaceBlockPacket.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.eventhandler.Event; @@ -21,7 +21,7 @@ import net.minecraftforge.event.ForgeEventFactory; import net.minecraftforge.event.entity.player.PlayerInteractEvent; -public final class OffhandPlaceBlockPacket extends AbstractMBPacket{ +public final class OffhandPlaceBlockPacket extends AbstractPacket { public static final String packetName = "MB2|Place"; private int xPosition; private int yPosition; diff --git a/src/main/java/mods/battlegear2/packet/OffhandSwapClientPacket.java b/src/main/java/xonin/backhand/packet/OffhandSwapClientPacket.java similarity index 93% rename from src/main/java/mods/battlegear2/packet/OffhandSwapClientPacket.java rename to src/main/java/xonin/backhand/packet/OffhandSwapClientPacket.java index e478916..236ccc8 100644 --- a/src/main/java/mods/battlegear2/packet/OffhandSwapClientPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandSwapClientPacket.java @@ -1,5 +1,5 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.network.ByteBufUtils; import io.netty.buffer.ByteBuf; @@ -13,7 +13,7 @@ * Date: 26/06/13 * Time: 1:40 PM */ -public final class OffhandSwapClientPacket extends AbstractMBPacket { +public final class OffhandSwapClientPacket extends AbstractPacket { public static final String packetName = "MB2|SwapClient"; private String user; diff --git a/src/main/java/mods/battlegear2/packet/OffhandSwapPacket.java b/src/main/java/xonin/backhand/packet/OffhandSwapPacket.java similarity index 94% rename from src/main/java/mods/battlegear2/packet/OffhandSwapPacket.java rename to src/main/java/xonin/backhand/packet/OffhandSwapPacket.java index d2a12cd..b374bb2 100644 --- a/src/main/java/mods/battlegear2/packet/OffhandSwapPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandSwapPacket.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.network.ByteBufUtils; import io.netty.buffer.ByteBuf; @@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack; import xonin.backhand.Backhand; -public class OffhandSwapPacket extends AbstractMBPacket { +public class OffhandSwapPacket extends AbstractPacket { public static final String packetName = "MB2|Swap"; private String user; diff --git a/src/main/java/mods/battlegear2/packet/BattlegearSyncItemPacket.java b/src/main/java/xonin/backhand/packet/OffhandSyncItemPacket.java similarity index 86% rename from src/main/java/mods/battlegear2/packet/BattlegearSyncItemPacket.java rename to src/main/java/xonin/backhand/packet/OffhandSyncItemPacket.java index c2c4253..ebdcc98 100644 --- a/src/main/java/mods/battlegear2/packet/BattlegearSyncItemPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandSyncItemPacket.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.network.ByteBufUtils; import io.netty.buffer.ByteBuf; @@ -12,24 +12,24 @@ * Date: 26/06/13 * Time: 1:40 PM */ -public final class BattlegearSyncItemPacket extends AbstractMBPacket { +public final class OffhandSyncItemPacket extends AbstractPacket { public static final String packetName = "MB2|SyncItem"; private String user; private InventoryPlayer inventory; private EntityPlayer player; - public BattlegearSyncItemPacket(EntityPlayer player){ + public OffhandSyncItemPacket(EntityPlayer player){ this(player.getCommandSenderName(), player.inventory, player); } - public BattlegearSyncItemPacket(String user, InventoryPlayer inventory, EntityPlayer player) { + public OffhandSyncItemPacket(String user, InventoryPlayer inventory, EntityPlayer player) { this.user = user; this.inventory = inventory; this.player = player; } - public BattlegearSyncItemPacket() { + public OffhandSyncItemPacket() { } @Override diff --git a/src/main/java/mods/battlegear2/packet/OffhandToServerPacket.java b/src/main/java/xonin/backhand/packet/OffhandToServerPacket.java similarity index 93% rename from src/main/java/mods/battlegear2/packet/OffhandToServerPacket.java rename to src/main/java/xonin/backhand/packet/OffhandToServerPacket.java index b9b071d..6b701a4 100644 --- a/src/main/java/mods/battlegear2/packet/OffhandToServerPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandToServerPacket.java @@ -1,4 +1,4 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import cpw.mods.fml.common.network.ByteBufUtils; import io.netty.buffer.ByteBuf; @@ -6,7 +6,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -public class OffhandToServerPacket extends AbstractMBPacket { +public class OffhandToServerPacket extends AbstractPacket { public static final String packetName = "MB2|OffhandToServer"; private ItemStack offhandItem; diff --git a/src/main/java/mods/battlegear2/packet/OffhandWorldHotswapPacket.java b/src/main/java/xonin/backhand/packet/OffhandWorldHotswapPacket.java similarity index 88% rename from src/main/java/mods/battlegear2/packet/OffhandWorldHotswapPacket.java rename to src/main/java/xonin/backhand/packet/OffhandWorldHotswapPacket.java index f3f99e5..591b762 100644 --- a/src/main/java/mods/battlegear2/packet/OffhandWorldHotswapPacket.java +++ b/src/main/java/xonin/backhand/packet/OffhandWorldHotswapPacket.java @@ -1,10 +1,10 @@ -package mods.battlegear2.packet; +package xonin.backhand.packet; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.tclproject.mysteriumlib.asm.fixes.MysteriumPatchesFixesO; -public class OffhandWorldHotswapPacket extends AbstractMBPacket { +public class OffhandWorldHotswapPacket extends AbstractPacket { public static final String packetName = "MB2|WorldHotswap"; boolean ignoreSwitching;