Creation of 1.16.3 branch

Initial publishing of the 1.16.3 branch of the mod. A lot of systems are missing (such as Rituals and Living Armour), but enough is present for a decent Alpha release.
This commit is contained in:
WayofTime 2020-10-24 08:59:04 -04:00
parent 0e02b983f1
commit d617911d7a
1662 changed files with 18791 additions and 85075 deletions

View file

@ -1,37 +1,47 @@
package WayofTime.bloodmagic.network;
package wayoftime.bloodmagic.network;
import WayofTime.bloodmagic.BloodMagic;
import WayofTime.bloodmagic.util.ChatUtil;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fml.network.simple.SimpleChannel;
import wayoftime.bloodmagic.BloodMagic;
import wayoftime.bloodmagic.util.ChatUtil;
public class BloodMagicPacketHandler {
public static final SimpleNetworkWrapper INSTANCE = new SimpleNetworkWrapper(BloodMagic.MODID);
public class BloodMagicPacketHandler extends BasePacketHandler
{
// public static final SimpleChannel INSTANCE = NetworkRegistry.newSimpleChannel(new ResourceLocation(BloodMagic.MODID, "main"), () -> PROTOCOL_VERSION, PROTOCOL_VERSION::equals, PROTOCOL_VERSION::equals);
public static final SimpleChannel INSTANCE = createChannel(new ResourceLocation(BloodMagic.MODID, "main"));
public static void init() {
INSTANCE.registerMessage(ChatUtil.PacketNoSpamChat.Handler.class, ChatUtil.PacketNoSpamChat.class, 0, Side.CLIENT);
INSTANCE.registerMessage(ItemRouterButtonPacketProcessor.class, ItemRouterButtonPacketProcessor.class, 1, Side.SERVER);
INSTANCE.registerMessage(PlayerVelocityPacketProcessor.class, PlayerVelocityPacketProcessor.class, 2, Side.CLIENT);
INSTANCE.registerMessage(PlayerFallDistancePacketProcessor.class, PlayerFallDistancePacketProcessor.class, 3, Side.SERVER);
INSTANCE.registerMessage(SigilHoldingPacketProcessor.class, SigilHoldingPacketProcessor.class, 4, Side.SERVER);
INSTANCE.registerMessage(KeyProcessor.class, KeyProcessor.class, 5, Side.SERVER);
INSTANCE.registerMessage(DemonAuraPacketProcessor.class, DemonAuraPacketProcessor.class, 6, Side.CLIENT);
INSTANCE.registerMessage(ItemRouterAmountPacketProcessor.class, ItemRouterAmountPacketProcessor.class, 7, Side.SERVER);
}
@Override
public void initialize()
{
registerServerToClient(ChatUtil.PacketNoSpamChat.class, ChatUtil.PacketNoSpamChat::encode, ChatUtil.PacketNoSpamChat::decode, ChatUtil.PacketNoSpamChat::handle);
// INSTANCE.registerMessage(id, messageType, encoder, decoder, messageConsumer);
// INSTANCE.registerMessage(ChatUtil.PacketNoSpamChat.Handler.class, ChatUtil.PacketNoSpamChat.class, 0, Side.CLIENT);
// INSTANCE.registerMessage(ItemRouterButtonPacketProcessor.class, ItemRouterButtonPacketProcessor.class, 1, Side.SERVER);
// INSTANCE.registerMessage(PlayerVelocityPacketProcessor.class, PlayerVelocityPacketProcessor.class, 2, Side.CLIENT);
// INSTANCE.registerMessage(PlayerFallDistancePacketProcessor.class, PlayerFallDistancePacketProcessor.class, 3, Side.SERVER);
// INSTANCE.registerMessage(SigilHoldingPacketProcessor.class, SigilHoldingPacketProcessor.class, 4, Side.SERVER);
// INSTANCE.registerMessage(KeyProcessor.class, KeyProcessor.class, 5, Side.SERVER);
// INSTANCE.registerMessage(DemonAuraPacketProcessor.class, DemonAuraPacketProcessor.class, 6, Side.CLIENT);
// INSTANCE.registerMessage(ItemRouterAmountPacketProcessor.class, ItemRouterAmountPacketProcessor.class, 7, Side.SERVER);
}
public static void sendToAllAround(IMessage message, TileEntity te, int range) {
INSTANCE.sendToAllAround(message, new NetworkRegistry.TargetPoint(te.getWorld().provider.getDimension(), te.getPos().getX(), te.getPos().getY(), te.getPos().getZ(), range));
}
protected SimpleChannel getChannel()
{
return INSTANCE;
}
public static void sendToAllAround(IMessage message, TileEntity te) {
sendToAllAround(message, te, 64);
}
public static void sendTo(IMessage message, ServerPlayerEntity player) {
INSTANCE.sendTo(message, player);
}
}
// public static void sendToAllAround(IMessage message, TileEntity te, int range)
// {
// INSTANCE.sendToAllAround(message, new NetworkRegistry.TargetPoint(te.getWorld().provider.getDimension(), te.getPos().getX(), te.getPos().getY(), te.getPos().getZ(), range));
// }
//
// public static void sendToAllAround(IMessage message, TileEntity te)
// {
// sendToAllAround(message, te, 64);
// }
//
// public static void sendTo(IMessage message, EntityPlayerMP player)
// {
// INSTANCE.sendTo(message, player);
// }
}