-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to SecurityCraft v1.7.4 for 1.7.10 and 1.8.
There are lots of updates, so here is a post containing all the changes: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1291001-v1-7-4-securitycraft-keypads-retinal-scanners-and?comment=687
- Loading branch information
1 parent
ad962e4
commit a8a4574
Showing
70 changed files
with
2,059 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 82 additions & 0 deletions
82
1.7.10/src/main/java/org/freeforums/geforce/securitycraft/blocks/BlockKeypadFrame.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package org.freeforums.geforce.securitycraft.blocks; | ||
|
||
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.util.MathHelper; | ||
import net.minecraft.world.World; | ||
|
||
import org.freeforums.geforce.securitycraft.interfaces.IHelpInfo; | ||
import org.freeforums.geforce.securitycraft.tileentity.TileEntityKeypadFrame; | ||
import org.freeforums.geforce.securitycraft.tileentity.TileEntityOwnable; | ||
|
||
public class BlockKeypadFrame extends BlockOwnable implements IHelpInfo { | ||
|
||
public BlockKeypadFrame(Material par1) { | ||
super(par1); | ||
} | ||
|
||
public boolean renderAsNormalBlock(){ | ||
return false; | ||
} | ||
|
||
public boolean isNormalCube(){ | ||
return false; | ||
} | ||
|
||
public boolean isOpaqueCube(){ | ||
return false; | ||
} | ||
|
||
public int getRenderType(){ | ||
return -1; | ||
} | ||
|
||
/** | ||
* Called when the block is placed in the world. | ||
*/ | ||
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(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName()); | ||
|
||
if(l == 0){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); | ||
} | ||
|
||
if(l == 1){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); | ||
} | ||
|
||
if(l == 2){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); | ||
} | ||
|
||
if(l == 3){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); | ||
}else{ | ||
return; | ||
} | ||
|
||
} | ||
|
||
public void registerBlockIcons(IIconRegister icon){ | ||
this.blockIcon = icon.registerIcon("stone"); | ||
} | ||
|
||
public TileEntity createNewTileEntity(World var1, int var2) { | ||
return new TileEntityKeypadFrame(); | ||
} | ||
|
||
public String getHelpInfo() { | ||
return "The keypad frame is used in the keypad's crafting recipe."; | ||
} | ||
|
||
public String[] getRecipe() { | ||
return new String[]{"The keypad frame requires: 8 stone, 1 redstone", "XXX", "XYX", "X X", "X = stone, Y = redstone"}; | ||
} | ||
|
||
} |
148 changes: 148 additions & 0 deletions
148
1.7.10/src/main/java/org/freeforums/geforce/securitycraft/blocks/BlockKeypadFurnace.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
package org.freeforums.geforce.securitycraft.blocks; | ||
|
||
import java.util.Random; | ||
|
||
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.item.EntityItem; | ||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
import net.minecraft.tileentity.TileEntity; | ||
import net.minecraft.util.MathHelper; | ||
import net.minecraft.world.World; | ||
|
||
import org.freeforums.geforce.securitycraft.interfaces.IHelpInfo; | ||
import org.freeforums.geforce.securitycraft.main.mod_SecurityCraft; | ||
import org.freeforums.geforce.securitycraft.tileentity.TileEntityKeypadFurnace; | ||
|
||
public class BlockKeypadFurnace extends BlockContainer implements IHelpInfo { | ||
|
||
private Random random = new Random(); | ||
|
||
public BlockKeypadFurnace(Material materialIn) { | ||
super(materialIn); | ||
} | ||
|
||
public boolean renderAsNormalBlock(){ | ||
return false; | ||
} | ||
|
||
public boolean isNormalCube(){ | ||
return false; | ||
} | ||
|
||
public boolean isOpaqueCube(){ | ||
return false; | ||
} | ||
|
||
public int getRenderType(){ | ||
return -1; | ||
} | ||
|
||
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9){ | ||
if(par1World.isRemote){ | ||
return true; | ||
}else{ | ||
System.out.println(mod_SecurityCraft.instance.ircBots.size()); | ||
TileEntityKeypadFurnace TE = (TileEntityKeypadFurnace) par1World.getTileEntity(par2, par3, par4); | ||
if(TE.getKeypadCode() != null && !TE.getKeypadCode().isEmpty()){ | ||
par5EntityPlayer.openGui(mod_SecurityCraft.instance, 15, par1World, par2, par3, par4); | ||
}else{ | ||
par5EntityPlayer.openGui(mod_SecurityCraft.instance, 14, par1World, par2, par3, par4); | ||
} | ||
|
||
return true; | ||
} | ||
} | ||
|
||
/** | ||
* Called when the block is placed in the world. | ||
*/ | ||
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; | ||
|
||
((TileEntityKeypadFurnace) par1World.getTileEntity(par2, par3, par4)).setOwner(((EntityPlayer) par5EntityLivingBase).getGameProfile().getId().toString(), par5EntityLivingBase.getCommandSenderName()); | ||
|
||
if(l == 0){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2); | ||
} | ||
|
||
if(l == 1){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); | ||
} | ||
|
||
if(l == 2){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); | ||
} | ||
|
||
if(l == 3){ | ||
par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); | ||
}else{ | ||
return; | ||
} | ||
} | ||
|
||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5Block, int par6){ | ||
TileEntityKeypadFurnace tileentityfurnace = (TileEntityKeypadFurnace) par1World.getTileEntity(par2, par3, par4); | ||
|
||
if (tileentityfurnace != null) | ||
{ | ||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) | ||
{ | ||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1); | ||
|
||
if (itemstack != null) | ||
{ | ||
float f = this.random.nextFloat() * 0.8F + 0.1F; | ||
float f1 = this.random.nextFloat() * 0.8F + 0.1F; | ||
float f2 = this.random.nextFloat() * 0.8F + 0.1F; | ||
|
||
while (itemstack.stackSize > 0) | ||
{ | ||
int j1 = this.random.nextInt(21) + 10; | ||
|
||
if (j1 > itemstack.stackSize) | ||
{ | ||
j1 = itemstack.stackSize; | ||
} | ||
|
||
itemstack.stackSize -= j1; | ||
EntityItem entityitem = new EntityItem(par1World, (double)((float)par2 + f), (double)((float)par3 + f1), (double)((float)par4 + f2), new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage())); | ||
|
||
if (itemstack.hasTagCompound()) | ||
{ | ||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy()); | ||
} | ||
|
||
float f3 = 0.05F; | ||
entityitem.motionX = (double)((float)this.random.nextGaussian() * f3); | ||
entityitem.motionY = (double)((float)this.random.nextGaussian() * f3 + 0.2F); | ||
entityitem.motionZ = (double)((float)this.random.nextGaussian() * f3); | ||
par1World.spawnEntityInWorld(entityitem); | ||
} | ||
} | ||
} | ||
|
||
par1World.func_147453_f(par2, par3, par4, par5Block); | ||
} | ||
|
||
super.breakBlock(par1World, par2, par3, par4, par5Block, par6); | ||
} | ||
|
||
public TileEntity createNewTileEntity(World var1, int var2) { | ||
return new TileEntityKeypadFurnace(); | ||
} | ||
|
||
public String getHelpInfo() { | ||
return "The password-protected furnace will require you to enter a passcode when you first place it down. After that, entering the correct code into the GUI will allow you to access the furnace's inventory."; | ||
} | ||
|
||
public String[] getRecipe() { | ||
return new String[]{"The password-protected furnace requires: 7 iron ingot, 1 keypad, 1 furnace", "XYX", "XZX", "XXX", "X = iron ingot, Y = keypad, Z = furnace"}; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.