Skip to content

Commit

Permalink
-Updated to SecurityCraft v1.7.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
Geforce132 committed Feb 21, 2015
1 parent 5fab0cf commit 6fa5cfd
Show file tree
Hide file tree
Showing 25 changed files with 337 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,31 +126,31 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p
for(int i = 0; i < 10; i++){
if(((TileEntityInventoryScanner)par1World.getTileEntity(par2 - 1, par3, par4)).getStackInSlotCopy(i) != null){
if(((EntityItem) par5Entity).getEntityItem() != null){
checkInventory(((EntityPlayer) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2 - 1, par3, par4)), ((TileEntityInventoryScanner)par1World.getTileEntity(par2 - 1, par3, par4)).getStackInSlotCopy(i));
checkEntity(((EntityItem) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2 - 1, par3, par4)).getStackInSlotCopy(i));
}
}
}
}else if(par1World.getTileEntity(par2 + 1, par3, par4) != null && par1World.getTileEntity(par2 + 1, par3, par4) instanceof TileEntityInventoryScanner){
for(int i = 0; i < 10; i++){
if(((TileEntityInventoryScanner)par1World.getTileEntity(par2 + 1, par3, par4)).getStackInSlotCopy(i) != null){
if(((EntityItem) par5Entity).getEntityItem() != null){
checkInventory(((EntityPlayer) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2 + 1, par3, par4)), ((TileEntityInventoryScanner)par1World.getTileEntity(par2 + 1, par3, par4)).getStackInSlotCopy(i));
checkEntity(((EntityItem) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2 + 1, par3, par4)).getStackInSlotCopy(i));
}
}
}
}else if(par1World.getTileEntity(par2, par3, par4 - 1) != null && par1World.getTileEntity(par2, par3, par4 - 1) instanceof TileEntityInventoryScanner){
for(int i = 0; i < 10; i++){
if(((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 - 1)).getStackInSlotCopy(i) != null){
if(((EntityItem) par5Entity).getEntityItem() != null){
checkInventory(((EntityPlayer) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 - 1)), ((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 - 1)).getStackInSlotCopy(i));
checkEntity(((EntityItem) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 - 1)).getStackInSlotCopy(i));
}
}
}
}else if(par1World.getTileEntity(par2, par3, par4 + 1) != null && par1World.getTileEntity(par2, par3, par4 + 1) instanceof TileEntityInventoryScanner){
for(int i = 0; i < 10; i++){
if(((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 + 1)).getStackInSlotCopy(i) != null){
if(((EntityItem) par5Entity).getEntityItem() != null){
checkInventory(((EntityPlayer) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 + 1)), ((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 + 1)).getStackInSlotCopy(i));
checkEntity(((EntityItem) par5Entity), ((TileEntityInventoryScanner)par1World.getTileEntity(par2, par3, par4 + 1)).getStackInSlotCopy(i));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p
for(int i = 1; i <= mod_SecurityCraft.configHandler.laserBlockRange; i++){
Block id = par1World.getBlock(par2 + i, par3, par4);
if(id == mod_SecurityCraft.LaserBlock){
if(par1World.getTileEntity(par2 + i, par3, par4) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2 + i, par3, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2 + i, par3, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName())){ return; }
if(par1World.getTileEntity(par2 + i, par3, par4) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2 + i, par3, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2 + i, par3, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName().toLowerCase())){ return; }
par1World.setBlockMetadataWithNotify(par2 + i, par3, par4, 2, 3);
par1World.notifyBlocksOfNeighborChange(par2 + i, par3, par4, mod_SecurityCraft.LaserBlock);
par1World.scheduleBlockUpdate(par2 + i, par3, par4, mod_SecurityCraft.LaserBlock, 50);
Expand All @@ -74,7 +74,7 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p
for(int i = 0; i <= mod_SecurityCraft.configHandler.laserBlockRange; i++){
Block id = par1World.getBlock(par2 - i, par3, par4);
if(id == mod_SecurityCraft.LaserBlock){
if(par1World.getTileEntity(par2 - i, par3, par4) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2 - i, par3, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2 - i, par3, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName())){ return; }
if(par1World.getTileEntity(par2 - i, par3, par4) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2 - i, par3, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2 - i, par3, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName().toLowerCase())){ return; }
par1World.setBlockMetadataWithNotify(par2 - i, par3, par4, 2, 3);
par1World.notifyBlocksOfNeighborChange(par2 - i, par3, par4, mod_SecurityCraft.LaserBlock);
par1World.scheduleBlockUpdate(par2 - i, par3, par4, mod_SecurityCraft.LaserBlock, 50);
Expand All @@ -91,7 +91,7 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p
for(int i = 0; i <= mod_SecurityCraft.configHandler.laserBlockRange; i++){
Block id = par1World.getBlock(par2, par3, par4 + i);
if(id == mod_SecurityCraft.LaserBlock){
if(par1World.getTileEntity(par2, par3, par4 + i) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3, par4 + i)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4 + i, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName())){ return; }
if(par1World.getTileEntity(par2, par3, par4 + i) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3, par4 + i)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4 + i, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName().toLowerCase())){ return; }
par1World.setBlockMetadataWithNotify(par2, par3, par4 + i, 2, 3);
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 + i, mod_SecurityCraft.LaserBlock);
par1World.scheduleBlockUpdate(par2, par3, par4 + i, mod_SecurityCraft.LaserBlock, 50);
Expand All @@ -108,7 +108,7 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p
for(int i = 0; i <= mod_SecurityCraft.configHandler.laserBlockRange; i++){
Block id = par1World.getBlock(par2, par3, par4 - i);
if(id == mod_SecurityCraft.LaserBlock){
if(par1World.getTileEntity(par2, par3, par4 - i) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3, par4 - i)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4 - i, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName())){ return; }
if(par1World.getTileEntity(par2, par3, par4 - i) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3, par4 - i)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3, par4 - i, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName().toLowerCase())){ return; }
par1World.setBlockMetadataWithNotify(par2, par3, par4 - i, 2, 3);
par1World.notifyBlocksOfNeighborChange(par2, par3, par4 - i, mod_SecurityCraft.LaserBlock);
par1World.scheduleBlockUpdate(par2, par3, par4 - i, mod_SecurityCraft.LaserBlock, 50);
Expand All @@ -125,7 +125,7 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p
for(int i = 0; i <= mod_SecurityCraft.configHandler.laserBlockRange; i++){
Block id = par1World.getBlock(par2, par3 + i, par4);
if(id == mod_SecurityCraft.LaserBlock){
if(par1World.getTileEntity(par2, par3 + i, par4 ) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3 + i, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3 + i, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName())){ return; }
if(par1World.getTileEntity(par2, par3 + i, par4 ) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3 + i, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3 + i, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName().toLowerCase())){ return; }
par1World.setBlockMetadataWithNotify(par2, par3 + i, par4 , 2, 3);
par1World.notifyBlocksOfNeighborChange(par2, par3 + i, par4, mod_SecurityCraft.LaserBlock);
par1World.scheduleBlockUpdate(par2, par3 + i, par4, mod_SecurityCraft.LaserBlock, 50);
Expand All @@ -142,7 +142,7 @@ public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int p
for(int i = 0; i <= mod_SecurityCraft.configHandler.laserBlockRange; i++){
Block id = par1World.getBlock(par2, par3 - i, par4);
if(id == mod_SecurityCraft.LaserBlock){
if(par1World.getTileEntity(par2, par3 - i, par4 ) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3 - i, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3 - i, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName())){ return; }
if(par1World.getTileEntity(par2, par3 - i, par4 ) instanceof CustomizableSCTE && ((CustomizableSCTE) par1World.getTileEntity(par2, par3 - i, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2, par3 - i, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName().toLowerCase())){ return; }
par1World.setBlockMetadataWithNotify(par2, par3 - i, par4 , 2, 3);
par1World.notifyBlocksOfNeighborChange(par2, par3 - i, par4, mod_SecurityCraft.LaserBlock);
par1World.scheduleBlockUpdate(par2, par3 - i, par4, mod_SecurityCraft.LaserBlock, 50);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Random;

import org.freeforums.geforce.securitycraft.blocks.BlockOwnable;
import org.freeforums.geforce.securitycraft.main.mod_SecurityCraft;

import net.minecraft.block.Block;
Expand All @@ -16,7 +17,7 @@
import net.minecraft.world.Explosion;
import net.minecraft.world.World;

public class BlockFullMineBase extends Block{
public class BlockFullMineBase extends BlockOwnable{



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class CommandModule extends CommandBase implements ICommand {

private List nicknames;

private final String usage = "/module add <playerName> OR /module copy OR /module paste";
private final String usage = "/module add <playerName> OR /module remove <playerName> OR /module copy OR /module paste";

public CommandModule() {
this.nicknames = new ArrayList();
Expand Down Expand Up @@ -94,6 +94,7 @@ public void processCommand(ICommandSender par1ICommandSender, String[] par2Strin
}

player.getCurrentEquippedItem().stackTagCompound.setString("Player" + getNextSlot(player.getCurrentEquippedItem().stackTagCompound), par2String[1]);
HelpfulMethods.sendMessageToPlayer(player, "Added " + par2String[1] + " to the held module.", EnumChatFormatting.GREEN);
return;
}else{
HelpfulMethods.sendMessageToPlayer(player, "You must be holding the module you wish to modify!", EnumChatFormatting.RED);
Expand All @@ -113,6 +114,7 @@ public void processCommand(ICommandSender par1ICommandSender, String[] par2Strin
}
}

HelpfulMethods.sendMessageToPlayer(player, "Removed " + par2String[1] + " from the held module.", EnumChatFormatting.GREEN);
return;
}else{
HelpfulMethods.sendMessageToPlayer(player, "You must be holding the module you wish to modify!", EnumChatFormatting.RED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.minecraftforge.event.world.WorldEvent.Unload;

import org.freeforums.geforce.securitycraft.blocks.BlockLaserBlock;
import org.freeforums.geforce.securitycraft.blocks.BlockOwnable;
import org.freeforums.geforce.securitycraft.main.HelpfulMethods;
import org.freeforums.geforce.securitycraft.main.mod_SecurityCraft;
import org.freeforums.geforce.securitycraft.network.packets.PacketCheckRetinalScanner;
Expand Down Expand Up @@ -305,7 +306,7 @@ private void checkForReinforcedDoor(World par1World, int par2, int par3, int par
}

private boolean isOwnableBlock(Block par1Block){
if(par1Block == mod_SecurityCraft.doorIndestructableIron || par1Block == mod_SecurityCraft.Keypad || par1Block == mod_SecurityCraft.keycardReader || par1Block == mod_SecurityCraft.retinalScanner || par1Block == mod_SecurityCraft.reinforcedGlass || par1Block == mod_SecurityCraft.alarm || par1Block == mod_SecurityCraft.reinforcedStone || par1Block == mod_SecurityCraft.unbreakableIronBars || par1Block == mod_SecurityCraft.reinforcedFencegate || par1Block == mod_SecurityCraft.LaserBlock || par1Block == mod_SecurityCraft.keypadChest || par1Block == mod_SecurityCraft.reinforcedWoodPlanks || par1Block == mod_SecurityCraft.inventoryScanner || par1Block == mod_SecurityCraft.panicButton){
if(par1Block == mod_SecurityCraft.doorIndestructableIron || par1Block == mod_SecurityCraft.Keypad || par1Block == mod_SecurityCraft.keycardReader || par1Block == mod_SecurityCraft.retinalScanner || par1Block == mod_SecurityCraft.reinforcedGlass || par1Block == mod_SecurityCraft.alarm || par1Block == mod_SecurityCraft.reinforcedStone || par1Block == mod_SecurityCraft.unbreakableIronBars || par1Block == mod_SecurityCraft.reinforcedFencegate || par1Block == mod_SecurityCraft.LaserBlock || par1Block == mod_SecurityCraft.keypadChest || par1Block == mod_SecurityCraft.reinforcedWoodPlanks || par1Block == mod_SecurityCraft.inventoryScanner || par1Block == mod_SecurityCraft.panicButton || par1Block == mod_SecurityCraft.FurnaceMine || par1Block instanceof BlockOwnable){
return true;
}else{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ protected void onPrivateMessage(String sender, String login, String hostname, St
sendMessageToPlayer(EnumChatFormatting.YELLOW + "[Reply]: " + EnumChatFormatting.RESET + trimmedMessage, getPlayerFromName((this.getNick().replace("SCUser_", ""))));
}
}

protected void onKick(String channel, String user, String login, String hostname, String userKicked, String reason){
if(mod_SecurityCraft.instance.getIrcBot() != null){
mod_SecurityCraft.instance.getIrcBot().disconnect();
}

mod_SecurityCraft.instance.setIrcBot(null);

try{
sendMessageToPlayer(EnumChatFormatting.RED + "You have been disconnected from EsperNet for reason: " + reason, getPlayerFromName((this.getNick().replace("SCUser_", ""))));
}catch(PlayerNotFoundException e){
e.printStackTrace();
}
}

private void sendMessageToPlayer(String par1String, EntityPlayer par2EntityPlayer){
ChatComponentTranslation component = new ChatComponentTranslation(par1String, new Object[0]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,29 @@
package org.freeforums.geforce.securitycraft.items;

import java.util.List;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class ItemUniversalBlockModifier extends Item{

public ItemUniversalBlockModifier() {
super();
}

@SideOnly(Side.CLIENT)
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
par3List.add("Customizable blocks:");
par3List.add("- Laser Block");
par3List.add("- Keypad");
par3List.add("- Keycard Reader");
par3List.add("- Inventory Scanner");
par3List.add("- Portable Radar");
par3List.add("- Retinal Scanner");

}

}
Loading

0 comments on commit 6fa5cfd

Please sign in to comment.