Skip to content

Commit

Permalink
Merge pull request #51 from Thorfusion/sec-patch-1
Browse files Browse the repository at this point in the history
Remove voiceserver, cape module and update downloader
  • Loading branch information
DrParadox7 committed Nov 21, 2022
2 parents c955c80 + 2850dbf commit 6da1c70
Show file tree
Hide file tree
Showing 36 changed files with 4 additions and 1,233 deletions.
1 change: 0 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
push:
paths-ignore:
- '**/README.md'
pull_request:
schedule:
- cron: '0 12 1 * *'

Expand Down
4 changes: 2 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ FMP_version=1.2.0.347
CCLIB_version=1.1.3.141
NEI_version=1.0.5.120
CCC_version=1.0.7.48
mod_version=9.10.18
alt_version=9, 10, 18
mod_version=9.10.19
alt_version=9, 10, 19
3 changes: 0 additions & 3 deletions src/main/java/mekanism/api/MekanismConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public static class general
public static boolean controlCircuitOreDict = true;
public static boolean logPackets = false;
public static boolean dynamicTankEasterEgg = false;
public static boolean voiceServerEnabled = true;
public static boolean cardboardSpawners = true;
public static boolean enableWorldRegeneration = true;
public static boolean spawnBabySkeletons = true;
Expand All @@ -27,7 +26,6 @@ public static class general
public static int saltPerChunk = 2;
public static int obsidianTNTDelay = 100;
public static int UPDATE_DELAY = 10;
public static int VOICE_PORT = 36123;
public static int maxUpgradeMultiplier = 10;
public static int userWorldGenVersion = 0;
public static double ENERGY_PER_REDSTONE = 10000;
Expand Down Expand Up @@ -259,7 +257,6 @@ public static class recipes
public static boolean enableTeleporterCore = true;
public static boolean enableConfigurator = true;
public static boolean enableNetworkReader = true;
public static boolean enableWalkieTalkie = true;
public static boolean enableJetpacks = true;
public static boolean enableScubaSet = true;
public static boolean enableFreeRunners = true;
Expand Down
43 changes: 0 additions & 43 deletions src/main/java/mekanism/client/ClientConnectionHandler.java

This file was deleted.

8 changes: 0 additions & 8 deletions src/main/java/mekanism/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import cpw.mods.fml.common.Loader;
import mekanism.api.Coord4D;
import mekanism.api.MekanismConfig.client;
import mekanism.api.MekanismConfig.general;
import mekanism.api.Pos3D;
import mekanism.client.SparkleAnimation.INodeChecker;
import mekanism.client.entity.EntityLaser;
Expand Down Expand Up @@ -351,7 +350,6 @@ public void registerRenderInformation()
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MekanismBlocks.MachineBlock2), handler);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MekanismBlocks.MachineBlock3), handler);
MinecraftForgeClient.registerItemRenderer(MekanismItems.Robit, handler);
MinecraftForgeClient.registerItemRenderer(MekanismItems.WalkieTalkie, handler);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MekanismBlocks.GasTank), handler);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MekanismBlocks.ObsidianTNT), handler);
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(MekanismBlocks.BasicBlock), handler);
Expand Down Expand Up @@ -585,7 +583,6 @@ public void loadUtilities()
{
super.loadUtilities();

FMLCommonHandler.instance().bus().register(new ClientConnectionHandler());
FMLCommonHandler.instance().bus().register(new ClientPlayerTracker());
FMLCommonHandler.instance().bus().register(new ClientTickHandler());
FMLCommonHandler.instance().bus().register(new RenderTickHandler());
Expand Down Expand Up @@ -646,11 +643,6 @@ public File getMinecraftDir()
public void onConfigSync(boolean fromPacket)
{
super.onConfigSync(fromPacket);

if(fromPacket && general.voiceServerEnabled && MekanismClient.voiceClient != null)
{
MekanismClient.voiceClient.start();
}
}

@Override
Expand Down
69 changes: 0 additions & 69 deletions src/main/java/mekanism/client/ClientTickHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import static mekanism.client.sound.SoundHandler.Channel.GASMASK;
import static mekanism.client.sound.SoundHandler.Channel.JETPACK;

import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import mekanism.api.IClientTicker;
Expand All @@ -32,13 +30,9 @@
import mekanism.common.network.PacketScubaTankData.ScubaTankPacket;
import mekanism.common.util.MekanismUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.StringUtils;

import com.mojang.authlib.minecraft.MinecraftProfileTexture;

import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
Expand All @@ -57,21 +51,10 @@ public class ClientTickHandler
{
public boolean hasNotified = false;
public boolean initHoliday = false;

public boolean preloadedSounds = false;

public boolean lastTickUpdate;

public boolean shouldReset = false;

public static Minecraft mc = FMLClientHandler.instance().getClient();

public static final String DONATE_CAPE = "http://aidancbrady.com/data/capes/donate.png";
public static final String AIDAN_CAPE = "http://aidancbrady.com/data/capes/aidan.png";

private Map<String, CapeBufferDownload> donateDownload = new HashMap<String, CapeBufferDownload>();
private Map<String, CapeBufferDownload> aidanDownload = new HashMap<String, CapeBufferDownload>();

public static Set<IClientTicker> tickingSet = new HashSet<IClientTicker>();

@SubscribeEvent
Expand Down Expand Up @@ -127,58 +110,6 @@ else if(shouldReset)
initHoliday = true;
}

for(EntityPlayer entityPlayer : (List<EntityPlayer>)mc.theWorld.playerEntities)
{
if(entityPlayer instanceof AbstractClientPlayer)
{
AbstractClientPlayer player = (AbstractClientPlayer)entityPlayer;

if(player != null)
{
if(StringUtils.stripControlCodes(player.getCommandSenderName()).equals("aidancbrady"))
{
CapeBufferDownload download = aidanDownload.get(player.getCommandSenderName());

if(download == null)
{
download = new CapeBufferDownload(player.getCommandSenderName(), AIDAN_CAPE);
aidanDownload.put(player.getCommandSenderName(), download);

download.start();
}
else {
if(!download.downloaded)
{
continue;
}

player.func_152121_a(MinecraftProfileTexture.Type.CAPE, download.getResourceLocation());
}
}
else if(Mekanism.donators.contains(StringUtils.stripControlCodes(player.getCommandSenderName())))
{
CapeBufferDownload download = donateDownload.get(player.getCommandSenderName());

if(download == null)
{
download = new CapeBufferDownload(player.getCommandSenderName(), DONATE_CAPE);
donateDownload.put(player.getCommandSenderName(), download);

download.start();
}
else {
if(!download.downloaded)
{
continue;
}

player.func_152121_a(MinecraftProfileTexture.Type.CAPE, download.getResourceLocation());
}
}
}
}
}

if(mc.thePlayer.getEquipmentInSlot(1) != null && mc.thePlayer.getEquipmentInSlot(1).getItem() instanceof ItemFreeRunners)
{
mc.thePlayer.stepHeight = 1.002F;
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/mekanism/client/MekanismClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@

import mekanism.api.MekanismAPI;
import mekanism.api.MekanismAPI.BoxBlacklistEvent;
import mekanism.api.MekanismConfig.general;
import mekanism.client.sound.SoundHandler;
import mekanism.client.voice.VoiceClient;
import mekanism.common.Mekanism;
import mekanism.common.base.IModule;
import mekanism.common.content.boiler.SynchronizedBoilerData;
Expand All @@ -20,8 +18,6 @@
public class MekanismClient extends Mekanism
{
public static Map<String, SecurityData> clientSecurityMap = new HashMap<String, SecurityData>();

public static VoiceClient voiceClient;

public static long ticksPassed = 0;

Expand All @@ -39,15 +35,6 @@ public static void updateKey(KeyBinding key, int type)
public static void reset()
{
clientSecurityMap.clear();

if(general.voiceServerEnabled)
{
if(MekanismClient.voiceClient != null)
{
MekanismClient.voiceClient.disconnect();
MekanismClient.voiceClient = null;
}
}

ClientTickHandler.tickingSet.clear();

Expand Down
18 changes: 1 addition & 17 deletions src/main/java/mekanism/client/MekanismKeyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import mekanism.common.item.ItemJetpack;
import mekanism.common.item.ItemJetpack.JetpackMode;
import mekanism.common.item.ItemScubaTank;
import mekanism.common.item.ItemWalkieTalkie;
import mekanism.common.network.PacketConfiguratorState.ConfiguratorStateMessage;
import mekanism.common.network.PacketElectricBowState.ElectricBowStateMessage;
import mekanism.common.network.PacketFlamethrowerData;
Expand All @@ -22,7 +21,6 @@
import mekanism.common.network.PacketPortableTankState.PortableTankStateMessage;
import mekanism.common.network.PacketScubaTankData.ScubaTankDataMessage;
import mekanism.common.network.PacketScubaTankData.ScubaTankPacket;
import mekanism.common.network.PacketWalkieTalkieState.WalkieTalkieStateMessage;
import mekanism.common.util.LangUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.settings.KeyBinding;
Expand All @@ -47,17 +45,15 @@ public class MekanismKeyHandler extends MekKeyHandler
public static final String keybindCategory = "Mekanism";
public static KeyBinding modeSwitchKey = new KeyBinding("Mekanism " + LangUtils.localize("key.mode"), Keyboard.KEY_M, keybindCategory);
public static KeyBinding armorModeSwitchKey = new KeyBinding("Mekanism " + LangUtils.localize("key.armorMode"), Keyboard.KEY_F, keybindCategory);
public static KeyBinding voiceKey = new KeyBinding("Mekanism " + LangUtils.localize("key.voice"), Keyboard.KEY_U, keybindCategory);
public static KeyBinding sneakKey = Minecraft.getMinecraft().gameSettings.keyBindSneak;
public static KeyBinding jumpKey = Minecraft.getMinecraft().gameSettings.keyBindJump;

public MekanismKeyHandler()
{
super(new KeyBinding[] {modeSwitchKey, armorModeSwitchKey, voiceKey}, new boolean[] {false, false, true});
super(new KeyBinding[] {modeSwitchKey, armorModeSwitchKey}, new boolean[] {false, false, true});

ClientRegistry.registerKeyBinding(modeSwitchKey);
ClientRegistry.registerKeyBinding(armorModeSwitchKey);
ClientRegistry.registerKeyBinding(voiceKey);

FMLCommonHandler.instance().bus().register(this);
}
Expand Down Expand Up @@ -106,18 +102,6 @@ else if(player.isSneaking() && item instanceof ItemBlockMachine)
player.addChatMessage(new ChatComponentText(EnumColor.DARK_BLUE + "[Mekanism] " + EnumColor.GREY + LangUtils.localize("tooltip.portableTank.bucketMode") + ": " + (machine.getBucketMode(toolStack) ? EnumColor.DARK_GREEN : EnumColor.DARK_RED) + LangUtils.transOnOff(machine.getBucketMode(toolStack))));
}
}
else if(player.isSneaking() && item instanceof ItemWalkieTalkie)
{
ItemWalkieTalkie wt = (ItemWalkieTalkie)item;

if(wt.getOn(toolStack))
{
int newChan = wt.getChannel(toolStack) < 9 ? wt.getChannel(toolStack) + 1 : 1;
wt.setChannel(toolStack, newChan);
Mekanism.packetHandler.sendToServer(new WalkieTalkieStateMessage(newChan));
SoundHandler.playSound("mekanism:etc.Ding");
}
}
else if(player.isSneaking() && item instanceof ItemFlamethrower)
{
ItemFlamethrower flamethrower = (ItemFlamethrower)item;
Expand Down
Loading

0 comments on commit 6da1c70

Please sign in to comment.