Skip to content

Commit

Permalink
-Added UUID compatibility.
Browse files Browse the repository at this point in the history
-Added panic button.
-Added claymore. (1.8 only)
-Added password-protected furnace. (1.8 only)
-Added a "back" button to the keypad, password-protected chest, and password-protected furnace (1.8 only) GUIs.
-Added an animated texture to the username logger. (thanks, BlackHawk8100!)
-Added a ""Use /module to add players." message to customizable modules.
-Fixed texture issue/rotation in inventory. (1.7.2, 1.7.10 only)
-Fixed codebreaker hand rendering issue, where it would be held like a sword/pickaxe.
-Fixed bug when sending a message to the player via IRC, adding a comma after the message instead of a colon will not send the message.
-Changed the default alarm volume from 1.0F to 0.8F.

Plus, probably a few more changes that I forgot.
  • Loading branch information
Geforce132 committed Feb 6, 2015
1 parent f3c8efc commit bc4b125
Show file tree
Hide file tree
Showing 189 changed files with 2,391 additions and 1,060 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
Expand Down Expand Up @@ -81,7 +82,7 @@ public void onBlockAdded(World par1World, int par2, int par3, int par4) {
*/
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack p_149689_6_)
{
((TileEntityAlarm) par1World.getTileEntity(par2, par3, par4)).setOwner(par5EntityLivingBase.getCommandSenderName());
((TileEntityAlarm) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName());

int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, E
return true;
}else{

if(((TileEntityOwnable)par1World.getTileEntity(par2, par3, par4)).getOwner() != null){
mod_SecurityCraft.network.sendToAll(new PacketCUpdateOwner(par2, par3, par4, ((TileEntityOwnable)par1World.getTileEntity(par2, par3, par4)).getOwner(), true));
if(((TileEntityOwnable)par1World.getTileEntity(par2, par3, par4)).getOwnerUUID() != null && ((TileEntityOwnable)par1World.getTileEntity(par2, par3, par4)).getOwnerName() != null){
mod_SecurityCraft.network.sendToAll(new PacketCUpdateOwner(par2, par3, par4, ((TileEntityOwnable)par1World.getTileEntity(par2, par3, par4)).getOwnerUUID(), ((TileEntityOwnable)par1World.getTileEntity(par2, par3, par4)).getOwnerName(), true));
}

if(this.isFacingAnotherBlock(par1World, par2, par3, par4)){
Expand All @@ -123,7 +123,7 @@ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, Entit
{
int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

((TileEntityInventoryScanner) par1World.getTileEntity(par2, par3, par4)).setOwner(par5EntityLivingBase.getCommandSenderName());
((TileEntityInventoryScanner) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName());

if (l == 0)
{
Expand Down Expand Up @@ -255,6 +255,10 @@ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int p
*/
public IIcon getIcon(int par1, int par2)
{
if(par1 == 3 && par2 == 0){
return this.furnaceIconFront;
}

return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ public BlockKeycardReader(Material par2Material) {
@SideOnly(Side.CLIENT)
public IIcon getIcon(int par1, int par2)
{
if(par1 == 3 && par2 == 0){
return this.keypadIconFront;
}

if(par2 == 7 || par2 == 8 || par2 == 9 || par2 == 10){
return par1 == 1 ? this.keypadIconTop : (par1 == 0 ? this.keypadIconTop : (par1 != (par2 - 5) ? this.blockIcon : this.keypadIconFrontActive));
}else{
Expand All @@ -71,7 +75,7 @@ public void registerBlockIcons(IIconRegister par1IconRegister)
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack){
int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(par5EntityLivingBase.getCommandSenderName());
((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName());

if (l == 0)
{
Expand Down Expand Up @@ -101,7 +105,7 @@ public void insertCard(World par1World, int par2, int par3, int par4, ItemStack

if(HelpfulMethods.checkForModule(par1World, par2, par3, par4, par6EntityPlayer, EnumCustomModules.WHITELIST) || HelpfulMethods.checkForModule(par1World, par2, par3, par4, par6EntityPlayer, EnumCustomModules.BLACKLIST)){ return; }

if(((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).getPassLV() != 0 && ((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).getPassLV() <= ((ItemKeycardBase) par5ItemStack.getItem()).getKeycardLV(par5ItemStack)){
if(((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).getPassLV() != 0 && (!((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).doesRequireExactKeycard() && ((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).getPassLV() <= ((ItemKeycardBase) par5ItemStack.getItem()).getKeycardLV(par5ItemStack) || ((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).doesRequireExactKeycard() && ((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).getPassLV() == ((ItemKeycardBase) par5ItemStack.getItem()).getKeycardLV(par5ItemStack))){
((TileEntityKeycardReader)par1World.getTileEntity(par2, par3, par4)).setIsProvidingPower(true);
new ScheduleKeycardUpdate(3, par1World, par2, par3, par4, meta);
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class BlockKeypad extends BlockContainer{

public BlockKeypad(Material par2Material) {
super(par2Material);

}

@SideOnly(Side.CLIENT)
Expand All @@ -38,24 +37,6 @@ public BlockKeypad(Material par2Material) {
private IIcon keypadIconFrontActive;

public static boolean canSend = true;


/**
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
*/
public boolean isOpaqueCube()
{
return false;
}

/**
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
*/
public boolean renderAsNormalBlock()
{
return false;
}

@SuppressWarnings("static-access")
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){
Expand Down Expand Up @@ -148,6 +129,10 @@ public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int p
*/
public IIcon getIcon(int par1, int par2)
{
if(par1 == 3 && par2 == 0){
return this.keypadIconFront;
}

if(par2 == 7 || par2 == 8 || par2 == 9 || par2 == 10){
return par1 == 1 ? this.keypadIconTop : (par1 == 0 ? this.keypadIconTop : (par1 != (par2 - 5) ? this.blockIcon : this.keypadIconFrontActive));
}else{
Expand Down Expand Up @@ -175,7 +160,7 @@ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, Entit
{
int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(par5EntityLivingBase.getCommandSenderName());
((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName());

if (l == 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public boolean onBlockActivated(World par1World, int par2, int par3, int par4, E
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack){
super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack);

((TileEntityKeypadChest) par1World.getTileEntity(par2, par3, par4)).setOwner(par5EntityLivingBase.getCommandSenderName());
((TileEntityKeypadChest) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName());

if(par1World.getTileEntity(par2 + 1, par3, par4) != null && par1World.getTileEntity(par2 + 1, par3, par4) instanceof TileEntityKeypadChest){
((TileEntityKeypadChest)(par1World.getTileEntity(par2, par3, par4))).setKeypadCode(((TileEntityKeypadChest) par1World.getTileEntity(par2 + 1, par3, par4)).getKeypadCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,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(((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(((CustomizableSCTE) par1World.getTileEntity(par2 - i, par3, par4)).hasModule(EnumCustomModules.WHITELIST) && HelpfulMethods.getPlayersFromModule(par1World, par2 - i, par3, par4, EnumCustomModules.WHITELIST).contains(((EntityLivingBase) par5Entity).getCommandSenderName())){ return; }
//par1World.setBlock(par2 - i, par3, par4, mod_SecurityCraft.LaserBlock, 2, 3);
par1World.setBlockMetadataWithNotify(par2 - i, par3, par4, 2, 3);
par1World.notifyBlocksOfNeighborChange(par2 - i, par3, par4, mod_SecurityCraft.LaserBlock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
Expand Down Expand Up @@ -40,7 +41,7 @@ public void onBlockAdded(World par1World, int par2, int par3, int par4)
*/
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
{
((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(par5EntityLivingBase.getCommandSenderName());
((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName());

if(!par1World.isRemote){
this.setLaser(par1World, par2, par3, par4);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,28 @@
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityFurnace;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

import org.freeforums.geforce.securitycraft.main.mod_SecurityCraft;
import org.freeforums.geforce.securitycraft.tileentity.TileEntityLogger;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;

public class BlockLogger extends BlockContainer{

@SideOnly(Side.CLIENT)
private IIcon field_149935_N;
@SideOnly(Side.CLIENT)
private IIcon field_149936_O;

public BlockLogger(Material par1Material) {
super(par1Material);
Expand Down Expand Up @@ -38,7 +52,56 @@ public void onNeighborBlockChange(World par1World, int par2, int par3, int par4,
}
}
}

/**
* Called when the block is placed in the world.
*/
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_)
{
int l = MathHelper.floor_double((double)(p_149689_5_.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;

if (l == 0)
{
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 2, 2);
}

if (l == 1)
{
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 5, 2);
}

if (l == 2)
{
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 3, 2);
}

if (l == 3)
{
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, 4, 2);
}

}

/**
* Gets the block's texture. Args: side, meta
*/
@SideOnly(Side.CLIENT)
public IIcon getIcon(int p_149691_1_, int p_149691_2_)
{
if(p_149691_1_ == 3 && p_149691_2_ == 0){
return this.field_149936_O;
}

return p_149691_1_ == 1 ? this.field_149935_N : (p_149691_1_ == 0 ? this.field_149935_N : (p_149691_1_ != p_149691_2_ ? this.blockIcon : this.field_149936_O));
}

@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister p_149651_1_)
{
this.blockIcon = p_149651_1_.registerIcon("securitycraft:usernameLoggerSide");
this.field_149936_O = p_149651_1_.registerIcon("securitycraft:usernameLoggerFront");
this.field_149935_N = p_149651_1_.registerIcon("securitycraft:usernameLoggerTop");
}

public TileEntity createNewTileEntity(World world, int par1) {
return new TileEntityLogger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, Entit
return;
}else{
if(par5EntityLivingBase instanceof EntityPlayer){
((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(par5EntityLivingBase.getCommandSenderName());
((TileEntityOwnable) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName());
}
}
}
Expand Down
Loading

0 comments on commit bc4b125

Please sign in to comment.