text
stringlengths
30
1.67M
<s> package net . minecraft . src ; import java . io . * ; public class Packet6SpawnPosition extends Packet { public int xPosition ; public int yPosition ; public int zPosition ; public Packet6SpawnPosition ( ) { } public Packet6SpawnPosition ( int par1 , int par2 , int par3 ) { xPosition = par1 ; yPosition = par2 ; zPosition = par3 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { xPosition = par1DataInputStream . readInt ( ) ; yPosition = par1DataInputStream . readInt ( ) ; zPosition = par1DataInputStream . readInt ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( xPosition ) ; par1DataOutputStream . writeInt ( yPosition ) ; par1DataOutputStream . writeInt ( zPosition ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleSpawnPosition ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:12> ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; import java . net . * ; import java . util . * ; import java . util . logging . Level ; import java . util . logging . Logger ; public class PostHttp { private PostHttp ( ) { } public static String func_52008_a ( Map par0Map ) { StringBuilder stringbuilder = new StringBuilder ( ) ; Iterator iterator = par0Map . entrySet ( ) . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } java . util . Map . Entry entry = ( java . util . Map . Entry ) iterator . next ( ) ; if ( stringbuilder . length ( ) > <NUM_LIT:0> ) { stringbuilder . append ( '<CHAR_LIT>' ) ; } try { stringbuilder . append ( URLEncoder . encode ( ( String ) entry . getKey ( ) , "<STR_LIT:UTF-8>" ) ) ; } catch ( UnsupportedEncodingException unsupportedencodingexception ) { unsupportedencodingexception . printStackTrace ( ) ; } if ( entry . getValue ( ) != null ) { stringbuilder . append ( '<CHAR_LIT:=>' ) ; try { stringbuilder . append ( URLEncoder . encode ( entry . getValue ( ) . toString ( ) , "<STR_LIT:UTF-8>" ) ) ; } catch ( UnsupportedEncodingException unsupportedencodingexception1 ) { unsupportedencodingexception1 . printStackTrace ( ) ; } } } while ( true ) ; return stringbuilder . toString ( ) ; } public static String func_52010_a ( URL par0URL , Map par1Map , boolean par2 ) { return func_52009_a ( par0URL , func_52008_a ( par1Map ) , par2 ) ; } public static String func_52009_a ( URL par0URL , String par1Str , boolean par2 ) { try { String s = par1Str ; HttpURLConnection httpurlconnection = ( HttpURLConnection ) par0URL . openConnection ( ) ; httpurlconnection . setRequestMethod ( "<STR_LIT:POST>" ) ; httpurlconnection . setRequestProperty ( "<STR_LIT:Content-Type>" , "<STR_LIT>" ) ; httpurlconnection . setRequestProperty ( "<STR_LIT>" , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s . getBytes ( ) . length ) . toString ( ) ) ; httpurlconnection . setRequestProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; httpurlconnection . setUseCaches ( false ) ; httpurlconnection . setDoInput ( true ) ; httpurlconnection . setDoOutput ( true ) ; DataOutputStream dataoutputstream = new DataOutputStream ( httpurlconnection . getOutputStream ( ) ) ; dataoutputstream . writeBytes ( s ) ; dataoutputstream . flush ( ) ; dataoutputstream . close ( ) ; BufferedReader bufferedreader = new BufferedReader ( new InputStreamReader ( httpurlconnection . getInputStream ( ) ) ) ; StringBuffer stringbuffer = new StringBuffer ( ) ; String s1 ; while ( ( s1 = bufferedreader . readLine ( ) ) != null ) { stringbuffer . append ( s1 ) ; stringbuffer . append ( '<STR_LIT>' ) ; } bufferedreader . close ( ) ; return stringbuffer . toString ( ) ; } catch ( Exception exception ) { if ( ! par2 ) { Logger . getLogger ( "<STR_LIT>" ) . log ( Level . SEVERE , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par0URL ) . toString ( ) , exception ) ; } } return "<STR_LIT>" ; } } </s>
<s> package net . minecraft . src ; final class StatTypeSimple implements IStatType { StatTypeSimple ( ) { } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockClay extends Block { public BlockClay ( int par1 , int par2 ) { super ( par1 , par2 , Material . clay ) ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Item . clay . shiftedIndex ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:4> ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class EntityAIVillagerMate extends EntityAIBase { private EntityVillager villagerObj ; private EntityVillager mate ; private World worldObj ; private int matingTimeout ; Village villageObj ; public EntityAIVillagerMate ( EntityVillager par1EntityVillager ) { matingTimeout = <NUM_LIT:0> ; villagerObj = par1EntityVillager ; worldObj = par1EntityVillager . worldObj ; setMutexBits ( <NUM_LIT:3> ) ; } public boolean shouldExecute ( ) { if ( villagerObj . getGrowingAge ( ) != <NUM_LIT:0> ) { return false ; } if ( villagerObj . getRNG ( ) . nextInt ( <NUM_LIT> ) != <NUM_LIT:0> ) { return false ; } villageObj = worldObj . villageCollectionObj . findNearestVillage ( MathHelper . floor_double ( villagerObj . posX ) , MathHelper . floor_double ( villagerObj . posY ) , MathHelper . floor_double ( villagerObj . posZ ) , <NUM_LIT:0> ) ; if ( villageObj == null ) { return false ; } if ( ! checkSufficientDoorsPresentForNewVillager ( ) ) { return false ; } Entity entity = worldObj . findNearestEntityWithinAABB ( net . minecraft . src . EntityVillager . class , villagerObj . boundingBox . expand ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , villagerObj ) ; if ( entity == null ) { return false ; } mate = ( EntityVillager ) entity ; return mate . getGrowingAge ( ) == <NUM_LIT:0> ; } public void startExecuting ( ) { matingTimeout = <NUM_LIT> ; villagerObj . setIsMatingFlag ( true ) ; } public void resetTask ( ) { villageObj = null ; mate = null ; villagerObj . setIsMatingFlag ( false ) ; } public boolean continueExecuting ( ) { return matingTimeout >= <NUM_LIT:0> && checkSufficientDoorsPresentForNewVillager ( ) && villagerObj . getGrowingAge ( ) == <NUM_LIT:0> ; } public void updateTask ( ) { matingTimeout -- ; villagerObj . getLookHelper ( ) . setLookPositionWithEntity ( mate , <NUM_LIT> , <NUM_LIT> ) ; if ( villagerObj . getDistanceSqToEntity ( mate ) > <NUM_LIT> ) { villagerObj . getNavigator ( ) . func_48652_a ( mate , <NUM_LIT> ) ; } else if ( matingTimeout == <NUM_LIT:0> && mate . getIsMatingFlag ( ) ) { giveBirth ( ) ; } if ( villagerObj . getRNG ( ) . nextInt ( <NUM_LIT> ) == <NUM_LIT:0> ) { spawnHeartParticles ( villagerObj ) ; } } private boolean checkSufficientDoorsPresentForNewVillager ( ) { int i = ( int ) ( ( double ) ( float ) villageObj . getNumVillageDoors ( ) * <NUM_LIT> ) ; return villageObj . getNumVillagers ( ) < i ; } private void giveBirth ( ) { EntityVillager entityvillager = new EntityVillager ( worldObj ) ; mate . setGrowingAge ( <NUM_LIT> ) ; villagerObj . setGrowingAge ( <NUM_LIT> ) ; entityvillager . setGrowingAge ( - <NUM_LIT> ) ; entityvillager . setProfession ( villagerObj . getRNG ( ) . nextInt ( <NUM_LIT:5> ) ) ; entityvillager . setLocationAndAngles ( villagerObj . posX , villagerObj . posY , villagerObj . posZ , <NUM_LIT> , <NUM_LIT> ) ; worldObj . spawnEntityInWorld ( entityvillager ) ; spawnHeartParticles ( entityvillager ) ; } private void spawnHeartParticles ( EntityLiving par1EntityLiving ) { Random random = par1EntityLiving . getRNG ( ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:5> ; i ++ ) { double d = random . nextGaussian ( ) * <NUM_LIT> ; double d1 = random . nextGaussian ( ) * <NUM_LIT> ; double d2 = random . nextGaussian ( ) * <NUM_LIT> ; worldObj . spawnParticle ( "<STR_LIT>" , ( par1EntityLiving . posX + ( double ) ( random . nextFloat ( ) * par1EntityLiving . width * <NUM_LIT> ) ) - ( double ) par1EntityLiving . width , par1EntityLiving . posY + <NUM_LIT> + ( double ) ( random . nextFloat ( ) * par1EntityLiving . height ) , ( par1EntityLiving . posZ + ( double ) ( random . nextFloat ( ) * par1EntityLiving . width * <NUM_LIT> ) ) - ( double ) par1EntityLiving . width , d , d1 , d2 ) ; } } } </s>
<s> package net . minecraft . src ; import java . util . * ; public class StructureVillagePieces { public StructureVillagePieces ( ) { } public static ArrayList getStructureVillageWeightedPieceList ( Random par0Random , int par1 ) { ArrayList arraylist = new ArrayList ( ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageHouse4_Garden . class , <NUM_LIT:4> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:2> + par1 , <NUM_LIT:4> + par1 * <NUM_LIT:2> ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageChurch . class , <NUM_LIT:20> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:0> + par1 , <NUM_LIT:1> + par1 ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageHouse1 . class , <NUM_LIT:20> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:0> + par1 , <NUM_LIT:2> + par1 ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageWoodHut . class , <NUM_LIT:3> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:2> + par1 , <NUM_LIT:5> + par1 * <NUM_LIT:3> ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageHall . class , <NUM_LIT:15> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:0> + par1 , <NUM_LIT:2> + par1 ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageField . class , <NUM_LIT:3> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:1> + par1 , <NUM_LIT:4> + par1 ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageField2 . class , <NUM_LIT:3> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:2> + par1 , <NUM_LIT:4> + par1 * <NUM_LIT:2> ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageHouse2 . class , <NUM_LIT:15> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:0> , <NUM_LIT:1> + par1 ) ) ) ; arraylist . add ( new StructureVillagePieceWeight ( net . minecraft . src . ComponentVillageHouse3 . class , <NUM_LIT:8> , MathHelper . getRandomIntegerInRange ( par0Random , <NUM_LIT:0> + par1 , <NUM_LIT:3> + par1 * <NUM_LIT:2> ) ) ) ; Iterator iterator = arraylist . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } if ( ( ( StructureVillagePieceWeight ) iterator . next ( ) ) . villagePiecesLimit == <NUM_LIT:0> ) { iterator . remove ( ) ; } } while ( true ) ; return arraylist ; } private static int getAvailablePieceWeight ( ArrayList par0ArrayList ) { boolean flag = false ; int i = <NUM_LIT:0> ; for ( Iterator iterator = par0ArrayList . iterator ( ) ; iterator . hasNext ( ) ; ) { StructureVillagePieceWeight structurevillagepieceweight = ( StructureVillagePieceWeight ) iterator . next ( ) ; if ( structurevillagepieceweight . villagePiecesLimit > <NUM_LIT:0> && structurevillagepieceweight . villagePiecesSpawned < structurevillagepieceweight . villagePiecesLimit ) { flag = true ; } i += structurevillagepieceweight . villagePieceWeight ; } return flag ? i : - <NUM_LIT:1> ; } private static ComponentVillage getVillageComponentFromWeightedPiece ( StructureVillagePieceWeight par0StructureVillagePieceWeight , List par1List , Random par2Random , int par3 , int par4 , int par5 , int par6 , int par7 ) { Class class1 = par0StructureVillagePieceWeight . villagePieceClass ; Object obj = null ; if ( class1 == ( net . minecraft . src . ComponentVillageHouse4_Garden . class ) ) { obj = ComponentVillageHouse4_Garden . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageChurch . class ) ) { obj = ComponentVillageChurch . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageHouse1 . class ) ) { obj = ComponentVillageHouse1 . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageWoodHut . class ) ) { obj = ComponentVillageWoodHut . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageHall . class ) ) { obj = ComponentVillageHall . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageField . class ) ) { obj = ComponentVillageField . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageField2 . class ) ) { obj = ComponentVillageField2 . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageHouse2 . class ) ) { obj = ComponentVillageHouse2 . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } else if ( class1 == ( net . minecraft . src . ComponentVillageHouse3 . class ) ) { obj = ComponentVillageHouse3 . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } return ( ( ComponentVillage ) ( obj ) ) ; } private static ComponentVillage getNextVillageComponent ( ComponentVillageStartPiece par0ComponentVillageStartPiece , List par1List , Random par2Random , int par3 , int par4 , int par5 , int par6 , int par7 ) { int var8 = getAvailablePieceWeight ( par0ComponentVillageStartPiece . structureVillageWeightedPieceList ) ; if ( var8 <= <NUM_LIT:0> ) { return null ; } else { int var9 = <NUM_LIT:0> ; while ( var9 < <NUM_LIT:5> ) { ++ var9 ; int var10 = par2Random . nextInt ( var8 ) ; Iterator var11 = par0ComponentVillageStartPiece . structureVillageWeightedPieceList . iterator ( ) ; while ( var11 . hasNext ( ) ) { StructureVillagePieceWeight var12 = ( StructureVillagePieceWeight ) var11 . next ( ) ; var10 -= var12 . villagePieceWeight ; if ( var10 < <NUM_LIT:0> ) { if ( ! var12 . canSpawnMoreVillagePiecesOfType ( par7 ) || var12 == par0ComponentVillageStartPiece . structVillagePieceWeight && par0ComponentVillageStartPiece . structureVillageWeightedPieceList . size ( ) > <NUM_LIT:1> ) { break ; } ComponentVillage var13 = getVillageComponentFromWeightedPiece ( var12 , par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; if ( var13 != null ) { ++ var12 . villagePiecesSpawned ; par0ComponentVillageStartPiece . structVillagePieceWeight = var12 ; if ( ! var12 . canSpawnMoreVillagePieces ( ) ) { par0ComponentVillageStartPiece . structureVillageWeightedPieceList . remove ( var12 ) ; } return var13 ; } } } } StructureBoundingBox var14 = ComponentVillageTorch . findValidPlacement ( par1List , par2Random , par3 , par4 , par5 , par6 ) ; if ( var14 != null ) { return new ComponentVillageTorch ( par7 , par2Random , var14 , par6 ) ; } else { return null ; } } } private static StructureComponent getNextVillageStructureComponent ( ComponentVillageStartPiece par0ComponentVillageStartPiece , List par1List , Random par2Random , int par3 , int par4 , int par5 , int par6 , int par7 ) { if ( par7 > <NUM_LIT> ) { return null ; } if ( Math . abs ( par3 - par0ComponentVillageStartPiece . getBoundingBox ( ) . minX ) > <NUM_LIT> || Math . abs ( par5 - par0ComponentVillageStartPiece . getBoundingBox ( ) . minZ ) > <NUM_LIT> ) { return null ; } ComponentVillage componentvillage = getNextVillageComponent ( par0ComponentVillageStartPiece , par1List , par2Random , par3 , par4 , par5 , par6 , par7 + <NUM_LIT:1> ) ; if ( componentvillage != null ) { int i = ( ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . minX + ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . maxX ) / <NUM_LIT:2> ; int j = ( ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . minZ + ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . maxZ ) / <NUM_LIT:2> ; int k = ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . maxX - ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . minX ; int l = ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . maxZ - ( ( StructureComponent ) ( componentvillage ) ) . boundingBox . minZ ; int i1 = k <= l ? l : k ; if ( par0ComponentVillageStartPiece . getWorldChunkManager ( ) . areBiomesViable ( i , j , i1 / <NUM_LIT:2> + <NUM_LIT:4> , MapGenVillage . villageSpawnBiomes ) ) { par1List . add ( componentvillage ) ; par0ComponentVillageStartPiece . field_35389_e . add ( componentvillage ) ; return componentvillage ; } } return null ; } private static StructureComponent getNextComponentVillagePath ( ComponentVillageStartPiece par0ComponentVillageStartPiece , List par1List , Random par2Random , int par3 , int par4 , int par5 , int par6 , int par7 ) { if ( par7 > <NUM_LIT:3> + par0ComponentVillageStartPiece . terrainType ) { return null ; } if ( Math . abs ( par3 - par0ComponentVillageStartPiece . getBoundingBox ( ) . minX ) > <NUM_LIT> || Math . abs ( par5 - par0ComponentVillageStartPiece . getBoundingBox ( ) . minZ ) > <NUM_LIT> ) { return null ; } StructureBoundingBox structureboundingbox = ComponentVillagePathGen . func_35378_a ( par0ComponentVillageStartPiece , par1List , par2Random , par3 , par4 , par5 , par6 ) ; if ( structureboundingbox != null && structureboundingbox . minY > <NUM_LIT:10> ) { ComponentVillagePathGen componentvillagepathgen = new ComponentVillagePathGen ( par7 , par2Random , structureboundingbox , par6 ) ; int i = ( ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . minX + ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . maxX ) / <NUM_LIT:2> ; int j = ( ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . minZ + ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . maxZ ) / <NUM_LIT:2> ; int k = ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . maxX - ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . minX ; int l = ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . maxZ - ( ( StructureComponent ) ( componentvillagepathgen ) ) . boundingBox . minZ ; int i1 = k <= l ? l : k ; if ( par0ComponentVillageStartPiece . getWorldChunkManager ( ) . areBiomesViable ( i , j , i1 / <NUM_LIT:2> + <NUM_LIT:4> , MapGenVillage . villageSpawnBiomes ) ) { par1List . add ( componentvillagepathgen ) ; par0ComponentVillageStartPiece . field_35387_f . add ( componentvillagepathgen ) ; return componentvillagepathgen ; } } return null ; } static StructureComponent getNextStructureComponent ( ComponentVillageStartPiece par0ComponentVillageStartPiece , List par1List , Random par2Random , int par3 , int par4 , int par5 , int par6 , int par7 ) { return getNextVillageStructureComponent ( par0ComponentVillageStartPiece , par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } static StructureComponent getNextStructureComponentVillagePath ( ComponentVillageStartPiece par0ComponentVillageStartPiece , List par1List , Random par2Random , int par3 , int par4 , int par5 , int par6 , int par7 ) { return getNextComponentVillagePath ( par0ComponentVillageStartPiece , par1List , par2Random , par3 , par4 , par5 , par6 , par7 ) ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet10Flying extends Packet { public double xPosition ; public double yPosition ; public double zPosition ; public double stance ; public float yaw ; public float pitch ; public boolean onGround ; public boolean moving ; public boolean rotating ; public Packet10Flying ( ) { } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleFlying ( this ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { onGround = par1DataInputStream . read ( ) != <NUM_LIT:0> ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . write ( onGround ? <NUM_LIT:1> : <NUM_LIT:0> ) ; } public int getPacketSize ( ) { return <NUM_LIT:1> ; } } </s>
<s> package net . minecraft . src ; import java . util . Iterator ; import java . util . List ; public class EntityPotion extends EntityThrowable { private int potionDamage ; public EntityPotion ( World par1World ) { super ( par1World ) ; } public EntityPotion ( World par1World , EntityLiving par2EntityLiving , int par3 ) { super ( par1World , par2EntityLiving ) ; potionDamage = par3 ; } public EntityPotion ( World par1World , double par2 , double par4 , double par6 , int par8 ) { super ( par1World , par2 , par4 , par6 ) ; potionDamage = par8 ; } protected float func_40042_e ( ) { return <NUM_LIT> ; } protected float func_40044_c ( ) { return <NUM_LIT> ; } protected float func_40040_d ( ) { return - <NUM_LIT> ; } public int getPotionDamage ( ) { return potionDamage ; } protected void onImpact ( MovingObjectPosition par1MovingObjectPosition ) { if ( ! worldObj . isRemote ) { List list = Item . potion . getEffects ( potionDamage ) ; if ( list != null && ! list . isEmpty ( ) ) { AxisAlignedBB axisalignedbb = boundingBox . expand ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; List list1 = worldObj . getEntitiesWithinAABB ( net . minecraft . src . EntityLiving . class , axisalignedbb ) ; if ( list1 != null && ! list1 . isEmpty ( ) ) { for ( Iterator iterator = list1 . iterator ( ) ; iterator . hasNext ( ) ; ) { Entity entity = ( Entity ) iterator . next ( ) ; double d = getDistanceSqToEntity ( entity ) ; if ( d < <NUM_LIT> ) { double d1 = <NUM_LIT> - Math . sqrt ( d ) / <NUM_LIT> ; if ( entity == par1MovingObjectPosition . entityHit ) { d1 = <NUM_LIT> ; } Iterator iterator1 = list . iterator ( ) ; while ( iterator1 . hasNext ( ) ) { PotionEffect potioneffect = ( PotionEffect ) iterator1 . next ( ) ; int i = potioneffect . getPotionID ( ) ; if ( Potion . potionTypes [ i ] . isInstant ( ) ) { Potion . potionTypes [ i ] . affectEntity ( thrower , ( EntityLiving ) entity , potioneffect . getAmplifier ( ) , d1 ) ; } else { int j = ( int ) ( d1 * ( double ) potioneffect . getDuration ( ) + <NUM_LIT> ) ; if ( j > <NUM_LIT:20> ) { ( ( EntityLiving ) entity ) . addPotionEffect ( new PotionEffect ( i , j , potioneffect . getAmplifier ( ) ) ) ; } } } } } } } worldObj . playAuxSFX ( <NUM_LIT> , ( int ) Math . round ( posX ) , ( int ) Math . round ( posY ) , ( int ) Math . round ( posZ ) , potionDamage ) ; setDead ( ) ; } } } </s>
<s> package net . minecraft . src ; public interface IServer { public abstract int getIntProperty ( String s , int i ) ; public abstract String getStringProperty ( String s , String s1 ) ; public abstract void setProperty ( String s , Object obj ) ; public abstract void saveProperties ( ) ; public abstract String getSettingsFilename ( ) ; public abstract String getHostname ( ) ; public abstract int getPort ( ) ; public abstract String getMotd ( ) ; public abstract String getVersionString ( ) ; public abstract int playersOnline ( ) ; public abstract int getMaxPlayers ( ) ; public abstract String [ ] getPlayerNamesAsList ( ) ; public abstract String getWorldName ( ) ; public abstract String getPlugin ( ) ; public abstract void func_40010_o ( ) ; public abstract String handleRConCommand ( String s ) ; public abstract boolean isDebuggingEnabled ( ) ; public abstract void log ( String s ) ; public abstract void logWarning ( String s ) ; public abstract void logSevere ( String s ) ; public abstract void logIn ( String s ) ; } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentNetherBridgeCorridor2 extends ComponentNetherBridgePiece { public ComponentNetherBridgeCorridor2 ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { getNextComponentZ ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:0> , <NUM_LIT:1> , true ) ; } public static ComponentNetherBridgeCorridor2 createValidComponent ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:7> , <NUM_LIT:5> , par5 ) ; if ( ! isAboveGround ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentNetherBridgeCorridor2 ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:0> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; for ( int i = <NUM_LIT:0> ; i <= <NUM_LIT:4> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j <= <NUM_LIT:4> ; j ++ ) { fillCurrentPositionBlocksDownwards ( par1World , Block . netherBrick . blockID , <NUM_LIT:0> , i , - <NUM_LIT:1> , j , par3StructureBoundingBox ) ; } } return true ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; import java . util . List ; public class Packet104WindowItems extends Packet { public int windowId ; public ItemStack itemStack [ ] ; public Packet104WindowItems ( ) { } public Packet104WindowItems ( int par1 , List par2List ) { windowId = par1 ; itemStack = new ItemStack [ par2List . size ( ) ] ; for ( int i = <NUM_LIT:0> ; i < itemStack . length ; i ++ ) { ItemStack itemstack = ( ItemStack ) par2List . get ( i ) ; itemStack [ i ] = itemstack != null ? itemstack . copy ( ) : null ; } } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { windowId = par1DataInputStream . readByte ( ) ; short word0 = par1DataInputStream . readShort ( ) ; itemStack = new ItemStack [ word0 ] ; for ( int i = <NUM_LIT:0> ; i < word0 ; i ++ ) { itemStack [ i ] = readItemStack ( par1DataInputStream ) ; } } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeByte ( windowId ) ; par1DataOutputStream . writeShort ( itemStack . length ) ; for ( int i = <NUM_LIT:0> ; i < itemStack . length ; i ++ ) { writeItemStack ( itemStack [ i ] , par1DataOutputStream ) ; } } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleWindowItems ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:3> + itemStack . length * <NUM_LIT:5> ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet35EntityHeadRotation extends Packet { public int entityId ; public byte headRotationYaw ; public Packet35EntityHeadRotation ( ) { } public Packet35EntityHeadRotation ( int par1 , byte par2 ) { entityId = par1 ; headRotationYaw = par2 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityId = par1DataInputStream . readInt ( ) ; headRotationYaw = par1DataInputStream . readByte ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityId ) ; par1DataOutputStream . writeByte ( headRotationYaw ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleEntityHeadRotation ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:5> ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockRedstoneRepeater extends BlockDirectional { public static final double repeaterTorchOffset [ ] = { - <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } ; private static final int repeaterState [ ] = { <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> } ; private final boolean isRepeaterPowered ; protected BlockRedstoneRepeater ( int par1 , boolean par2 ) { super ( par1 , <NUM_LIT:6> , Material . circuits ) ; isRepeaterPowered = par2 ; setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } public boolean renderAsNormalBlock ( ) { return false ; } public boolean canPlaceBlockAt ( World par1World , int par2 , int par3 , int par4 ) { if ( ! par1World . isBlockNormalCube ( par2 , par3 - <NUM_LIT:1> , par4 ) ) { return false ; } else { return super . canPlaceBlockAt ( par1World , par2 , par3 , par4 ) ; } } public boolean canBlockStay ( World par1World , int par2 , int par3 , int par4 ) { if ( ! par1World . isBlockNormalCube ( par2 , par3 - <NUM_LIT:1> , par4 ) ) { return false ; } else { return super . canBlockStay ( par1World , par2 , par3 , par4 ) ; } } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; boolean flag = ignoreTick ( par1World , par2 , par3 , par4 , i ) ; if ( isRepeaterPowered && ! flag ) { par1World . setBlockAndMetadataWithNotify ( par2 , par3 , par4 , Block . redstoneRepeaterIdle . blockID , i ) ; } else if ( ! isRepeaterPowered ) { par1World . setBlockAndMetadataWithNotify ( par2 , par3 , par4 , Block . redstoneRepeaterActive . blockID , i ) ; if ( ! flag ) { int j = ( i & <NUM_LIT> ) > > <NUM_LIT:2> ; par1World . scheduleBlockUpdate ( par2 , par3 , par4 , Block . redstoneRepeaterActive . blockID , repeaterState [ j ] * <NUM_LIT:2> ) ; } } } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par1 == <NUM_LIT:0> ) { return ! isRepeaterPowered ? <NUM_LIT> : <NUM_LIT> ; } if ( par1 == <NUM_LIT:1> ) { return ! isRepeaterPowered ? <NUM_LIT> : <NUM_LIT> ; } else { return <NUM_LIT:5> ; } } public int getRenderType ( ) { return <NUM_LIT:15> ; } public int getBlockTextureFromSide ( int par1 ) { return getBlockTextureFromSideAndMetadata ( par1 , <NUM_LIT:0> ) ; } public boolean isIndirectlyPoweringTo ( World par1World , int par2 , int par3 , int par4 , int par5 ) { return isPoweringTo ( par1World , par2 , par3 , par4 , par5 ) ; } public boolean isPoweringTo ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 , int par5 ) { if ( ! isRepeaterPowered ) { return false ; } int i = getDirection ( par1IBlockAccess . getBlockMetadata ( par2 , par3 , par4 ) ) ; if ( i == <NUM_LIT:0> && par5 == <NUM_LIT:3> ) { return true ; } if ( i == <NUM_LIT:1> && par5 == <NUM_LIT:4> ) { return true ; } if ( i == <NUM_LIT:2> && par5 == <NUM_LIT:2> ) { return true ; } return i == <NUM_LIT:3> && par5 == <NUM_LIT:5> ; } public void onNeighborBlockChange ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( ! canBlockStay ( par1World , par2 , par3 , par4 ) ) { dropBlockAsItem ( par1World , par2 , par3 , par4 , par1World . getBlockMetadata ( par2 , par3 , par4 ) , <NUM_LIT:0> ) ; par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; par1World . notifyBlocksOfNeighborChange ( par2 + <NUM_LIT:1> , par3 , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 - <NUM_LIT:1> , par3 , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 + <NUM_LIT:1> , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 - <NUM_LIT:1> , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 - <NUM_LIT:1> , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 + <NUM_LIT:1> , par4 , blockID ) ; return ; } int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; boolean flag = ignoreTick ( par1World , par2 , par3 , par4 , i ) ; int j = ( i & <NUM_LIT> ) > > <NUM_LIT:2> ; if ( isRepeaterPowered && ! flag ) { par1World . scheduleBlockUpdate ( par2 , par3 , par4 , blockID , repeaterState [ j ] * <NUM_LIT:2> ) ; } else if ( ! isRepeaterPowered && flag ) { par1World . scheduleBlockUpdate ( par2 , par3 , par4 , blockID , repeaterState [ j ] * <NUM_LIT:2> ) ; } } private boolean ignoreTick ( World par1World , int par2 , int par3 , int par4 , int par5 ) { int i = getDirection ( par5 ) ; switch ( i ) { case <NUM_LIT:0> : return par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 , par4 + <NUM_LIT:1> , <NUM_LIT:3> ) || par1World . getBlockId ( par2 , par3 , par4 + <NUM_LIT:1> ) == Block . redstoneWire . blockID && par1World . getBlockMetadata ( par2 , par3 , par4 + <NUM_LIT:1> ) > <NUM_LIT:0> ; case <NUM_LIT:2> : return par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 , par4 - <NUM_LIT:1> , <NUM_LIT:2> ) || par1World . getBlockId ( par2 , par3 , par4 - <NUM_LIT:1> ) == Block . redstoneWire . blockID && par1World . getBlockMetadata ( par2 , par3 , par4 - <NUM_LIT:1> ) > <NUM_LIT:0> ; case <NUM_LIT:3> : return par1World . isBlockIndirectlyProvidingPowerTo ( par2 + <NUM_LIT:1> , par3 , par4 , <NUM_LIT:5> ) || par1World . getBlockId ( par2 + <NUM_LIT:1> , par3 , par4 ) == Block . redstoneWire . blockID && par1World . getBlockMetadata ( par2 + <NUM_LIT:1> , par3 , par4 ) > <NUM_LIT:0> ; case <NUM_LIT:1> : return par1World . isBlockIndirectlyProvidingPowerTo ( par2 - <NUM_LIT:1> , par3 , par4 , <NUM_LIT:4> ) || par1World . getBlockId ( par2 - <NUM_LIT:1> , par3 , par4 ) == Block . redstoneWire . blockID && par1World . getBlockMetadata ( par2 - <NUM_LIT:1> , par3 , par4 ) > <NUM_LIT:0> ; } return false ; } public boolean blockActivated ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; int j = ( i & <NUM_LIT> ) > > <NUM_LIT:2> ; j = j + <NUM_LIT:1> << <NUM_LIT:2> & <NUM_LIT> ; par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , j | i & <NUM_LIT:3> ) ; return true ; } public boolean canProvidePower ( ) { return true ; } public void onBlockPlacedBy ( World par1World , int par2 , int par3 , int par4 , EntityLiving par5EntityLiving ) { int i = ( ( MathHelper . floor_double ( ( double ) ( ( par5EntityLiving . rotationYaw * <NUM_LIT> ) / <NUM_LIT> ) + <NUM_LIT> ) & <NUM_LIT:3> ) + <NUM_LIT:2> ) % <NUM_LIT:4> ; par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i ) ; boolean flag = ignoreTick ( par1World , par2 , par3 , par4 , i ) ; if ( flag ) { par1World . scheduleBlockUpdate ( par2 , par3 , par4 , blockID , <NUM_LIT:1> ) ; } } public void onBlockAdded ( World par1World , int par2 , int par3 , int par4 ) { par1World . notifyBlocksOfNeighborChange ( par2 + <NUM_LIT:1> , par3 , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 - <NUM_LIT:1> , par3 , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 + <NUM_LIT:1> , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 - <NUM_LIT:1> , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 - <NUM_LIT:1> , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 + <NUM_LIT:1> , par4 , blockID ) ; } public void onBlockDestroyedByPlayer ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( isRepeaterPowered ) { par1World . notifyBlocksOfNeighborChange ( par2 + <NUM_LIT:1> , par3 , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 - <NUM_LIT:1> , par3 , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 + <NUM_LIT:1> , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 - <NUM_LIT:1> , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 - <NUM_LIT:1> , par4 , blockID ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 + <NUM_LIT:1> , par4 , blockID ) ; } super . onBlockDestroyedByPlayer ( par1World , par2 , par3 , par4 , par5 ) ; } public boolean isOpaqueCube ( ) { return false ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Item . redstoneRepeater . shiftedIndex ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockLockedChest extends Block { protected BlockLockedChest ( int par1 ) { super ( par1 , Material . wood ) ; blockIndexInTexture = <NUM_LIT> ; } public int getBlockTextureFromSide ( int par1 ) { if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture - <NUM_LIT:1> ; } if ( par1 == <NUM_LIT:0> ) { return blockIndexInTexture - <NUM_LIT:1> ; } if ( par1 == <NUM_LIT:3> ) { return blockIndexInTexture + <NUM_LIT:1> ; } else { return blockIndexInTexture ; } } public boolean canPlaceBlockAt ( World par1World , int par2 , int par3 , int i ) { return true ; } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet11PlayerPosition extends Packet10Flying { public Packet11PlayerPosition ( ) { moving = true ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { xPosition = par1DataInputStream . readDouble ( ) ; yPosition = par1DataInputStream . readDouble ( ) ; stance = par1DataInputStream . readDouble ( ) ; zPosition = par1DataInputStream . readDouble ( ) ; super . readPacketData ( par1DataInputStream ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeDouble ( xPosition ) ; par1DataOutputStream . writeDouble ( yPosition ) ; par1DataOutputStream . writeDouble ( stance ) ; par1DataOutputStream . writeDouble ( zPosition ) ; super . writePacketData ( par1DataOutputStream ) ; } public int getPacketSize ( ) { return <NUM_LIT> ; } } </s>
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . * ; public class Profiler { public static boolean profilingEnabled = false ; private static List sectionList = new ArrayList ( ) ; private static List timestampList = new ArrayList ( ) ; private static String profilingSection = "<STR_LIT>" ; private static Map profilingMap = new HashMap ( ) ; public Profiler ( ) { } public static void startSection ( String par0Str ) { if ( ! profilingEnabled ) { return ; } if ( profilingSection . length ( ) > <NUM_LIT:0> ) { profilingSection = ( new StringBuilder ( ) ) . append ( profilingSection ) . append ( "<STR_LIT:.>" ) . toString ( ) ; } profilingSection = ( new StringBuilder ( ) ) . append ( profilingSection ) . append ( par0Str ) . toString ( ) ; sectionList . add ( profilingSection ) ; timestampList . add ( Long . valueOf ( System . nanoTime ( ) ) ) ; } public static void endSection ( ) { if ( ! profilingEnabled ) { return ; } long l = System . nanoTime ( ) ; long l1 = ( ( Long ) timestampList . remove ( timestampList . size ( ) - <NUM_LIT:1> ) ) . longValue ( ) ; sectionList . remove ( sectionList . size ( ) - <NUM_LIT:1> ) ; long l2 = l - l1 ; if ( profilingMap . containsKey ( profilingSection ) ) { profilingMap . put ( profilingSection , Long . valueOf ( ( ( Long ) profilingMap . get ( profilingSection ) ) . longValue ( ) + l2 ) ) ; } else { profilingMap . put ( profilingSection , Long . valueOf ( l2 ) ) ; } profilingSection = sectionList . size ( ) <= <NUM_LIT:0> ? "<STR_LIT>" : ( String ) sectionList . get ( sectionList . size ( ) - <NUM_LIT:1> ) ; if ( l2 > <NUM_LIT> ) { System . out . println ( ( new StringBuilder ( ) ) . append ( profilingSection ) . append ( "<STR_LIT:U+0020>" ) . append ( l2 ) . toString ( ) ) ; } } public static void endStartSection ( String par0Str ) { endSection ( ) ; startSection ( par0Str ) ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; import java . net . Socket ; import java . net . SocketTimeoutException ; public class RConThreadClient extends RConThreadBase { private boolean loggedIn ; private Socket clientSocket ; private byte buffer [ ] ; private String rconPassword ; RConThreadClient ( IServer par1IServer , Socket par2Socket ) { super ( par1IServer ) ; loggedIn = false ; buffer = new byte [ <NUM_LIT> ] ; clientSocket = par2Socket ; rconPassword = par1IServer . getStringProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par2Socket . getInetAddress ( ) ) . toString ( ) ) ; } public void run ( ) { try { while ( true ) { if ( ! running ) { break ; } try { BufferedInputStream bufferedinputstream = new BufferedInputStream ( clientSocket . getInputStream ( ) ) ; int i = bufferedinputstream . read ( buffer , <NUM_LIT:0> , <NUM_LIT> ) ; if ( <NUM_LIT:10> > i ) { return ; } int j = <NUM_LIT:0> ; int k = RConUtils . getBytesAsLEInt ( buffer , <NUM_LIT:0> , i ) ; if ( k != i - <NUM_LIT:4> ) { return ; } j += <NUM_LIT:4> ; int l = RConUtils . getBytesAsLEInt ( buffer , j , i ) ; j += <NUM_LIT:4> ; int i1 = RConUtils . getRemainingBytesAsLEInt ( buffer , j ) ; j += <NUM_LIT:4> ; switch ( i1 ) { case <NUM_LIT:3> : String s = RConUtils . getBytesAsString ( buffer , j , i ) ; j += s . length ( ) ; if ( <NUM_LIT:0> != s . length ( ) && s . equals ( rconPassword ) ) { loggedIn = true ; sendResponse ( l , <NUM_LIT:2> , "<STR_LIT>" ) ; } else { loggedIn = false ; sendLoginFailedResponse ( ) ; } break ; case <NUM_LIT:2> : if ( loggedIn ) { String s1 = RConUtils . getBytesAsString ( buffer , j , i ) ; try { sendMultipacketResponse ( l , server . handleRConCommand ( s1 ) ) ; } catch ( Exception exception1 ) { sendMultipacketResponse ( l , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s1 ) . append ( "<STR_LIT:U+0020(>" ) . append ( exception1 . getMessage ( ) ) . append ( "<STR_LIT:)>" ) . toString ( ) ) ; } } else { sendLoginFailedResponse ( ) ; } break ; default : sendMultipacketResponse ( l , String . format ( "<STR_LIT>" , new Object [ ] { Integer . toHexString ( i1 ) } ) ) ; break ; } } catch ( SocketTimeoutException sockettimeoutexception ) { } catch ( IOException ioexception ) { if ( running ) { log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( ioexception . getMessage ( ) ) . toString ( ) ) ; } } } } catch ( Exception exception ) { System . out . println ( exception ) ; } finally { closeSocket ( ) ; } } private void sendResponse ( int par1 , int par2 , String par3Str ) throws IOException { ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream ( <NUM_LIT> ) ; DataOutputStream dataoutputstream = new DataOutputStream ( bytearrayoutputstream ) ; dataoutputstream . writeInt ( Integer . reverseBytes ( par3Str . length ( ) + <NUM_LIT:10> ) ) ; dataoutputstream . writeInt ( Integer . reverseBytes ( par1 ) ) ; dataoutputstream . writeInt ( Integer . reverseBytes ( par2 ) ) ; dataoutputstream . writeBytes ( par3Str ) ; dataoutputstream . write ( <NUM_LIT:0> ) ; dataoutputstream . write ( <NUM_LIT:0> ) ; clientSocket . getOutputStream ( ) . write ( bytearrayoutputstream . toByteArray ( ) ) ; } private void sendLoginFailedResponse ( ) throws IOException { sendResponse ( - <NUM_LIT:1> , <NUM_LIT:2> , "<STR_LIT>" ) ; } private void sendMultipacketResponse ( int par1 , String par2Str ) throws IOException { int i = par2Str . length ( ) ; do { int j = <NUM_LIT> > i ? i : <NUM_LIT> ; sendResponse ( par1 , <NUM_LIT:0> , par2Str . substring ( <NUM_LIT:0> , j ) ) ; par2Str = par2Str . substring ( j ) ; i = par2Str . length ( ) ; } while ( <NUM_LIT:0> != i ) ; } private void closeSocket ( ) { if ( null == clientSocket ) { return ; } try { clientSocket . close ( ) ; } catch ( IOException ioexception ) { logWarning ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( ioexception . getMessage ( ) ) . toString ( ) ) ; } clientSocket = null ; } } </s>
<s> package net . minecraft . src ; class ThreadMonitorConnection extends Thread { final NetworkManager netManager ; ThreadMonitorConnection ( NetworkManager par1NetworkManager ) { netManager = par1NetworkManager ; } public void run ( ) { try { Thread . sleep ( <NUM_LIT> ) ; if ( NetworkManager . isRunning ( netManager ) ) { NetworkManager . getWriteThread ( netManager ) . interrupt ( ) ; netManager . networkShutdown ( "<STR_LIT>" , new Object [ <NUM_LIT:0> ] ) ; } } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class ItemEnderEye extends Item { public ItemEnderEye ( int par1 ) { super ( par1 ) ; } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int par4 , int par5 , int par6 , int par7 ) { int i = par3World . getBlockId ( par4 , par5 , par6 ) ; int j = par3World . getBlockMetadata ( par4 , par5 , par6 ) ; if ( par2EntityPlayer . canPlayerEdit ( par4 , par5 , par6 ) && i == Block . endPortalFrame . blockID && ! BlockEndPortalFrame . isEnderEyeInserted ( j ) ) { if ( par3World . isRemote ) { return true ; } par3World . setBlockMetadataWithNotify ( par4 , par5 , par6 , j + <NUM_LIT:4> ) ; par1ItemStack . stackSize -- ; for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:16> ; k ++ ) { double d = ( float ) par4 + ( <NUM_LIT> + itemRand . nextFloat ( ) * <NUM_LIT> ) / <NUM_LIT> ; double d1 = ( float ) par5 + <NUM_LIT> ; double d2 = ( float ) par6 + ( <NUM_LIT> + itemRand . nextFloat ( ) * <NUM_LIT> ) / <NUM_LIT> ; double d3 = <NUM_LIT> ; double d4 = <NUM_LIT> ; double d5 = <NUM_LIT> ; par3World . spawnParticle ( "<STR_LIT>" , d , d1 , d2 , d3 , d4 , d5 ) ; } int l = j & <NUM_LIT:3> ; int i1 = <NUM_LIT:0> ; int j1 = <NUM_LIT:0> ; boolean flag = false ; boolean flag1 = true ; int k1 = Direction . enderEyeMetaToDirection [ l ] ; for ( int l1 = - <NUM_LIT:2> ; l1 <= <NUM_LIT:2> ; l1 ++ ) { int l2 = par4 + Direction . offsetX [ k1 ] * l1 ; int l3 = par6 + Direction . offsetZ [ k1 ] * l1 ; int l4 = par3World . getBlockId ( l2 , par5 , l3 ) ; if ( l4 != Block . endPortalFrame . blockID ) { continue ; } int l5 = par3World . getBlockMetadata ( l2 , par5 , l3 ) ; if ( ! BlockEndPortalFrame . isEnderEyeInserted ( l5 ) ) { flag1 = false ; break ; } if ( ! flag ) { i1 = l1 ; j1 = l1 ; flag = true ; } else { j1 = l1 ; } } if ( flag1 && j1 == i1 + <NUM_LIT:2> ) { int i2 = i1 ; do { if ( i2 > j1 ) { break ; } int i3 = par4 + Direction . offsetX [ k1 ] * i2 ; int i4 = par6 + Direction . offsetZ [ k1 ] * i2 ; i3 += Direction . offsetX [ l ] * <NUM_LIT:4> ; i4 += Direction . offsetZ [ l ] * <NUM_LIT:4> ; int i5 = par3World . getBlockId ( i3 , par5 , i4 ) ; int i6 = par3World . getBlockMetadata ( i3 , par5 , i4 ) ; if ( i5 != Block . endPortalFrame . blockID || ! BlockEndPortalFrame . isEnderEyeInserted ( i6 ) ) { flag1 = false ; break ; } i2 ++ ; } while ( true ) ; label0 : for ( int j2 = i1 - <NUM_LIT:1> ; j2 <= j1 + <NUM_LIT:1> ; j2 += <NUM_LIT:4> ) { int j3 = <NUM_LIT:1> ; do { if ( j3 > <NUM_LIT:3> ) { continue label0 ; } int j4 = par4 + Direction . offsetX [ k1 ] * j2 ; int j5 = par6 + Direction . offsetZ [ k1 ] * j2 ; j4 += Direction . offsetX [ l ] * j3 ; j5 += Direction . offsetZ [ l ] * j3 ; int j6 = par3World . getBlockId ( j4 , par5 , j5 ) ; int k6 = par3World . getBlockMetadata ( j4 , par5 , j5 ) ; if ( j6 != Block . endPortalFrame . blockID || ! BlockEndPortalFrame . isEnderEyeInserted ( k6 ) ) { flag1 = false ; continue label0 ; } j3 ++ ; } while ( true ) ; } if ( flag1 ) { for ( int k2 = i1 ; k2 <= j1 ; k2 ++ ) { for ( int k3 = <NUM_LIT:1> ; k3 <= <NUM_LIT:3> ; k3 ++ ) { int k4 = par4 + Direction . offsetX [ k1 ] * k2 ; int k5 = par6 + Direction . offsetZ [ k1 ] * k2 ; k4 += Direction . offsetX [ l ] * k3 ; k5 += Direction . offsetZ [ l ] * k3 ; par3World . setBlockWithNotify ( k4 , par5 , k5 , Block . endPortal . blockID ) ; } } } } return true ; } else { return false ; } } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer ( par2World , par3EntityPlayer , false ) ; if ( movingobjectposition != null && movingobjectposition . typeOfHit == EnumMovingObjectType . TILE ) { int i = par2World . getBlockId ( movingobjectposition . blockX , movingobjectposition . blockY , movingobjectposition . blockZ ) ; if ( i == Block . endPortalFrame . blockID ) { return par1ItemStack ; } } if ( ! par2World . isRemote ) { ChunkPosition chunkposition = par2World . findClosestStructure ( "<STR_LIT>" , ( int ) par3EntityPlayer . posX , ( int ) par3EntityPlayer . posY , ( int ) par3EntityPlayer . posZ ) ; if ( chunkposition != null ) { EntityEnderEye entityendereye = new EntityEnderEye ( par2World , par3EntityPlayer . posX , ( par3EntityPlayer . posY + <NUM_LIT> ) - ( double ) par3EntityPlayer . yOffset , par3EntityPlayer . posZ ) ; entityendereye . func_40056_a ( chunkposition . x , chunkposition . y , chunkposition . z ) ; par2World . spawnEntityInWorld ( entityendereye ) ; par2World . playSoundAtEntity ( par3EntityPlayer , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> / ( itemRand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ) ; par2World . playAuxSFXAtEntity ( null , <NUM_LIT> , ( int ) par3EntityPlayer . posX , ( int ) par3EntityPlayer . posY , ( int ) par3EntityPlayer . posZ , <NUM_LIT:0> ) ; if ( ! par3EntityPlayer . capabilities . isCreativeMode ) { par1ItemStack . stackSize -- ; } } } return par1ItemStack ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class EntityCreeper extends EntityMob { int timeSinceIgnited ; int lastActiveTime ; public EntityCreeper ( World par1World ) { super ( par1World ) ; texture = "<STR_LIT>" ; tasks . addTask ( <NUM_LIT:1> , new EntityAISwimming ( this ) ) ; tasks . addTask ( <NUM_LIT:2> , new EntityAICreeperSwell ( this ) ) ; tasks . addTask ( <NUM_LIT:3> , new EntityAIAvoidEntity ( this , net . minecraft . src . EntityOcelot . class , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:4> , new EntityAIAttackOnCollide ( this , <NUM_LIT> , false ) ) ; tasks . addTask ( <NUM_LIT:5> , new EntityAIWander ( this , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:6> , new EntityAIWatchClosest ( this , net . minecraft . src . EntityPlayer . class , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:6> , new EntityAILookIdle ( this ) ) ; targetTasks . addTask ( <NUM_LIT:1> , new EntityAINearestAttackableTarget ( this , net . minecraft . src . EntityPlayer . class , <NUM_LIT> , <NUM_LIT:0> , true ) ) ; targetTasks . addTask ( <NUM_LIT:2> , new EntityAIHurtByTarget ( this , false ) ) ; } public boolean isAIEnabled ( ) { return true ; } public int getMaxHealth ( ) { return <NUM_LIT:20> ; } protected void entityInit ( ) { super . entityInit ( ) ; dataWatcher . addObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) - <NUM_LIT:1> ) ) ; dataWatcher . addObject ( <NUM_LIT> , Byte . valueOf ( ( byte ) <NUM_LIT:0> ) ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; if ( dataWatcher . getWatchableObjectByte ( <NUM_LIT> ) == <NUM_LIT:1> ) { par1NBTTagCompound . setBoolean ( "<STR_LIT>" , true ) ; } } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; dataWatcher . updateObject ( <NUM_LIT> , Byte . valueOf ( ( byte ) ( par1NBTTagCompound . getBoolean ( "<STR_LIT>" ) ? <NUM_LIT:1> : <NUM_LIT:0> ) ) ) ; } public void onUpdate ( ) { if ( isEntityAlive ( ) ) { lastActiveTime = timeSinceIgnited ; int i = getCreeperState ( ) ; if ( i > <NUM_LIT:0> && timeSinceIgnited == <NUM_LIT:0> ) { worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; } timeSinceIgnited += i ; if ( timeSinceIgnited < <NUM_LIT:0> ) { timeSinceIgnited = <NUM_LIT:0> ; } if ( timeSinceIgnited >= <NUM_LIT:30> ) { timeSinceIgnited = <NUM_LIT:30> ; if ( ! worldObj . isRemote ) { if ( getPowered ( ) ) { worldObj . createExplosion ( this , posX , posY , posZ , <NUM_LIT> ) ; } else { worldObj . createExplosion ( this , posX , posY , posZ , <NUM_LIT> ) ; } setDead ( ) ; } } } super . onUpdate ( ) ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } public void onDeath ( DamageSource par1DamageSource ) { super . onDeath ( par1DamageSource ) ; if ( par1DamageSource . getEntity ( ) instanceof EntitySkeleton ) { dropItem ( Item . record13 . shiftedIndex + rand . nextInt ( <NUM_LIT:10> ) , <NUM_LIT:1> ) ; } } public boolean attackEntityAsMob ( Entity par1Entity ) { return true ; } public boolean getPowered ( ) { return dataWatcher . getWatchableObjectByte ( <NUM_LIT> ) == <NUM_LIT:1> ; } protected int getDropItemId ( ) { return Item . gunpowder . shiftedIndex ; } public int getCreeperState ( ) { return dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) ; } public void setCreeperState ( int par1 ) { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) par1 ) ) ; } public void onStruckByLightning ( EntityLightningBolt par1EntityLightningBolt ) { super . onStruckByLightning ( par1EntityLightningBolt ) ; dataWatcher . updateObject ( <NUM_LIT> , Byte . valueOf ( ( byte ) <NUM_LIT:1> ) ) ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockFire extends Block { private int chanceToEncourageFire [ ] ; private int abilityToCatchFire [ ] ; protected BlockFire ( int par1 , int par2 ) { super ( par1 , par2 , Material . fire ) ; chanceToEncourageFire = new int [ <NUM_LIT> ] ; abilityToCatchFire = new int [ <NUM_LIT> ] ; setTickRandomly ( true ) ; } public void initializeBlock ( ) { setBurnRate ( Block . planks . blockID , <NUM_LIT:5> , <NUM_LIT:20> ) ; setBurnRate ( Block . fence . blockID , <NUM_LIT:5> , <NUM_LIT:20> ) ; setBurnRate ( Block . stairCompactPlanks . blockID , <NUM_LIT:5> , <NUM_LIT:20> ) ; setBurnRate ( Block . wood . blockID , <NUM_LIT:5> , <NUM_LIT:5> ) ; setBurnRate ( Block . leaves . blockID , <NUM_LIT:30> , <NUM_LIT> ) ; setBurnRate ( Block . bookShelf . blockID , <NUM_LIT:30> , <NUM_LIT:20> ) ; setBurnRate ( Block . tnt . blockID , <NUM_LIT:15> , <NUM_LIT:100> ) ; setBurnRate ( Block . tallGrass . blockID , <NUM_LIT> , <NUM_LIT:100> ) ; setBurnRate ( Block . cloth . blockID , <NUM_LIT:30> , <NUM_LIT> ) ; setBurnRate ( Block . vine . blockID , <NUM_LIT:15> , <NUM_LIT:100> ) ; } private void setBurnRate ( int par1 , int par2 , int par3 ) { chanceToEncourageFire [ par1 ] = par2 ; abilityToCatchFire [ par1 ] = par3 ; } public AxisAlignedBB getCollisionBoundingBoxFromPool ( World par1World , int par2 , int par3 , int i ) { return null ; } public boolean isOpaqueCube ( ) { return false ; } public boolean renderAsNormalBlock ( ) { return false ; } public int getRenderType ( ) { return <NUM_LIT:3> ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:0> ; } public int tickRate ( ) { return <NUM_LIT:30> ; } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { boolean flag = par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) == Block . netherrack . blockID ; if ( ( par1World . worldProvider instanceof WorldProviderEnd ) && par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) == Block . bedrock . blockID ) { flag = true ; } if ( ! canPlaceBlockAt ( par1World , par2 , par3 , par4 ) ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } if ( ! flag && par1World . isRaining ( ) && ( par1World . canLightningStrikeAt ( par2 , par3 , par4 ) || par1World . canLightningStrikeAt ( par2 - <NUM_LIT:1> , par3 , par4 ) || par1World . canLightningStrikeAt ( par2 + <NUM_LIT:1> , par3 , par4 ) || par1World . canLightningStrikeAt ( par2 , par3 , par4 - <NUM_LIT:1> ) || par1World . canLightningStrikeAt ( par2 , par3 , par4 + <NUM_LIT:1> ) ) ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; return ; } int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( i < <NUM_LIT:15> ) { par1World . setBlockMetadata ( par2 , par3 , par4 , i + par5Random . nextInt ( <NUM_LIT:3> ) / <NUM_LIT:2> ) ; } par1World . scheduleBlockUpdate ( par2 , par3 , par4 , blockID , tickRate ( ) + par5Random . nextInt ( <NUM_LIT:10> ) ) ; if ( ! flag && ! canNeighborBurn ( par1World , par2 , par3 , par4 ) ) { if ( ! par1World . isBlockNormalCube ( par2 , par3 - <NUM_LIT:1> , par4 ) || i > <NUM_LIT:3> ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } return ; } if ( ! flag && ! canBlockCatchFire ( par1World , par2 , par3 - <NUM_LIT:1> , par4 ) && i == <NUM_LIT:15> && par5Random . nextInt ( <NUM_LIT:4> ) == <NUM_LIT:0> ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; return ; } boolean flag1 = par1World . func_48089_z ( par2 , par3 , par4 ) ; byte byte0 = <NUM_LIT:0> ; if ( flag1 ) { byte0 = - <NUM_LIT> ; } tryToCatchBlockOnFire ( par1World , par2 + <NUM_LIT:1> , par3 , par4 , <NUM_LIT> + byte0 , par5Random , i ) ; tryToCatchBlockOnFire ( par1World , par2 - <NUM_LIT:1> , par3 , par4 , <NUM_LIT> + byte0 , par5Random , i ) ; tryToCatchBlockOnFire ( par1World , par2 , par3 - <NUM_LIT:1> , par4 , <NUM_LIT> + byte0 , par5Random , i ) ; tryToCatchBlockOnFire ( par1World , par2 , par3 + <NUM_LIT:1> , par4 , <NUM_LIT> + byte0 , par5Random , i ) ; tryToCatchBlockOnFire ( par1World , par2 , par3 , par4 - <NUM_LIT:1> , <NUM_LIT> + byte0 , par5Random , i ) ; tryToCatchBlockOnFire ( par1World , par2 , par3 , par4 + <NUM_LIT:1> , <NUM_LIT> + byte0 , par5Random , i ) ; for ( int j = par2 - <NUM_LIT:1> ; j <= par2 + <NUM_LIT:1> ; j ++ ) { for ( int k = par4 - <NUM_LIT:1> ; k <= par4 + <NUM_LIT:1> ; k ++ ) { for ( int l = par3 - <NUM_LIT:1> ; l <= par3 + <NUM_LIT:4> ; l ++ ) { if ( j == par2 && l == par3 && k == par4 ) { continue ; } int i1 = <NUM_LIT:100> ; if ( l > par3 + <NUM_LIT:1> ) { i1 += ( l - ( par3 + <NUM_LIT:1> ) ) * <NUM_LIT:100> ; } int j1 = getChanceOfNeighborsEncouragingFire ( par1World , j , l , k ) ; if ( j1 <= <NUM_LIT:0> ) { continue ; } int k1 = ( j1 + <NUM_LIT> ) / ( i + <NUM_LIT:30> ) ; if ( flag1 ) { k1 /= <NUM_LIT:2> ; } if ( k1 <= <NUM_LIT:0> || par5Random . nextInt ( i1 ) > k1 || par1World . isRaining ( ) && par1World . canLightningStrikeAt ( j , l , k ) || par1World . canLightningStrikeAt ( j - <NUM_LIT:1> , l , par4 ) || par1World . canLightningStrikeAt ( j + <NUM_LIT:1> , l , k ) || par1World . canLightningStrikeAt ( j , l , k - <NUM_LIT:1> ) || par1World . canLightningStrikeAt ( j , l , k + <NUM_LIT:1> ) ) { continue ; } int l1 = i + par5Random . nextInt ( <NUM_LIT:5> ) / <NUM_LIT:4> ; if ( l1 > <NUM_LIT:15> ) { l1 = <NUM_LIT:15> ; } par1World . setBlockAndMetadataWithNotify ( j , l , k , blockID , l1 ) ; } } } } private void tryToCatchBlockOnFire ( World par1World , int par2 , int par3 , int par4 , int par5 , Random par6Random , int par7 ) { int i = abilityToCatchFire [ par1World . getBlockId ( par2 , par3 , par4 ) ] ; if ( par6Random . nextInt ( par5 ) < i ) { boolean flag = par1World . getBlockId ( par2 , par3 , par4 ) == Block . tnt . blockID ; if ( par6Random . nextInt ( par7 + <NUM_LIT:10> ) < <NUM_LIT:5> && ! par1World . canLightningStrikeAt ( par2 , par3 , par4 ) ) { int j = par7 + par6Random . nextInt ( <NUM_LIT:5> ) / <NUM_LIT:4> ; if ( j > <NUM_LIT:15> ) { j = <NUM_LIT:15> ; } par1World . setBlockAndMetadataWithNotify ( par2 , par3 , par4 , blockID , j ) ; } else { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } if ( flag ) { Block . tnt . onBlockDestroyedByPlayer ( par1World , par2 , par3 , par4 , <NUM_LIT:1> ) ; } } } private boolean canNeighborBurn ( World par1World , int par2 , int par3 , int par4 ) { if ( canBlockCatchFire ( par1World , par2 + <NUM_LIT:1> , par3 , par4 ) ) { return true ; } if ( canBlockCatchFire ( par1World , par2 - <NUM_LIT:1> , par3 , par4 ) ) { return true ; } if ( canBlockCatchFire ( par1World , par2 , par3 - <NUM_LIT:1> , par4 ) ) { return true ; } if ( canBlockCatchFire ( par1World , par2 , par3 + <NUM_LIT:1> , par4 ) ) { return true ; } if ( canBlockCatchFire ( par1World , par2 , par3 , par4 - <NUM_LIT:1> ) ) { return true ; } return canBlockCatchFire ( par1World , par2 , par3 , par4 + <NUM_LIT:1> ) ; } private int getChanceOfNeighborsEncouragingFire ( World par1World , int par2 , int par3 , int par4 ) { int i = <NUM_LIT:0> ; if ( ! par1World . isAirBlock ( par2 , par3 , par4 ) ) { return <NUM_LIT:0> ; } else { i = getChanceToEncourageFire ( par1World , par2 + <NUM_LIT:1> , par3 , par4 , i ) ; i = getChanceToEncourageFire ( par1World , par2 - <NUM_LIT:1> , par3 , par4 , i ) ; i = getChanceToEncourageFire ( par1World , par2 , par3 - <NUM_LIT:1> , par4 , i ) ; i = getChanceToEncourageFire ( par1World , par2 , par3 + <NUM_LIT:1> , par4 , i ) ; i = getChanceToEncourageFire ( par1World , par2 , par3 , par4 - <NUM_LIT:1> , i ) ; i = getChanceToEncourageFire ( par1World , par2 , par3 , par4 + <NUM_LIT:1> , i ) ; return i ; } } public boolean isCollidable ( ) { return false ; } public boolean canBlockCatchFire ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { return chanceToEncourageFire [ par1IBlockAccess . getBlockId ( par2 , par3 , par4 ) ] > <NUM_LIT:0> ; } public int getChanceToEncourageFire ( World par1World , int par2 , int par3 , int par4 , int par5 ) { int i = chanceToEncourageFire [ par1World . getBlockId ( par2 , par3 , par4 ) ] ; if ( i > par5 ) { return i ; } else { return par5 ; } } public boolean canPlaceBlockAt ( World par1World , int par2 , int par3 , int par4 ) { return par1World . isBlockNormalCube ( par2 , par3 - <NUM_LIT:1> , par4 ) || canNeighborBurn ( par1World , par2 , par3 , par4 ) ; } public void onNeighborBlockChange ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( ! par1World . isBlockNormalCube ( par2 , par3 - <NUM_LIT:1> , par4 ) && ! canNeighborBurn ( par1World , par2 , par3 , par4 ) ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; return ; } else { return ; } } public void onBlockAdded ( World par1World , int par2 , int par3 , int par4 ) { if ( par1World . worldProvider . worldType <= <NUM_LIT:0> && par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) == Block . obsidian . blockID && Block . portal . tryToCreatePortal ( par1World , par2 , par3 , par4 ) ) { return ; } if ( ! par1World . isBlockNormalCube ( par2 , par3 - <NUM_LIT:1> , par4 ) && ! canNeighborBurn ( par1World , par2 , par3 , par4 ) ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; return ; } else { par1World . scheduleBlockUpdate ( par2 , par3 , par4 , blockID , tickRate ( ) + par1World . rand . nextInt ( <NUM_LIT:10> ) ) ; return ; } } } </s>
<s> package net . minecraft . src ; import java . util . * ; public class TileEntityPiston extends TileEntity { private int storedBlockID ; private int storedMetadata ; private int storedOrientation ; private boolean extending ; private boolean shouldHeadBeRendered ; private float progress ; private float lastProgress ; private static List pushedObjects = new ArrayList ( ) ; public TileEntityPiston ( ) { } public TileEntityPiston ( int par1 , int par2 , int par3 , boolean par4 , boolean par5 ) { storedBlockID = par1 ; storedMetadata = par2 ; storedOrientation = par3 ; extending = par4 ; shouldHeadBeRendered = par5 ; } public int getStoredBlockID ( ) { return storedBlockID ; } public int getBlockMetadata ( ) { return storedMetadata ; } public boolean isExtending ( ) { return extending ; } public int getPistonOrientation ( ) { return storedOrientation ; } public float getProgress ( float par1 ) { if ( par1 > <NUM_LIT> ) { par1 = <NUM_LIT> ; } return lastProgress + ( progress - lastProgress ) * par1 ; } private void updatePushedObjects ( float par1 , float par2 ) { if ( ! extending ) { par1 -- ; } else { par1 = <NUM_LIT> - par1 ; } AxisAlignedBB axisalignedbb = Block . pistonMoving . getAxisAlignedBB ( worldObj , xCoord , yCoord , zCoord , storedBlockID , par1 , storedOrientation ) ; if ( axisalignedbb != null ) { List list = worldObj . getEntitiesWithinAABBExcludingEntity ( null , axisalignedbb ) ; if ( ! list . isEmpty ( ) ) { pushedObjects . addAll ( list ) ; Entity entity ; for ( Iterator iterator = pushedObjects . iterator ( ) ; iterator . hasNext ( ) ; entity . moveEntity ( par2 * ( float ) Facing . offsetsXForSide [ storedOrientation ] , par2 * ( float ) Facing . offsetsYForSide [ storedOrientation ] , par2 * ( float ) Facing . offsetsZForSide [ storedOrientation ] ) ) { entity = ( Entity ) iterator . next ( ) ; } pushedObjects . clear ( ) ; } } } public void clearPistonTileEntity ( ) { if ( lastProgress < <NUM_LIT> && worldObj != null ) { lastProgress = progress = <NUM_LIT> ; worldObj . removeBlockTileEntity ( xCoord , yCoord , zCoord ) ; invalidate ( ) ; if ( worldObj . getBlockId ( xCoord , yCoord , zCoord ) == Block . pistonMoving . blockID ) { worldObj . setBlockAndMetadataWithNotify ( xCoord , yCoord , zCoord , storedBlockID , storedMetadata ) ; } } } public void updateEntity ( ) { lastProgress = progress ; if ( lastProgress >= <NUM_LIT> ) { updatePushedObjects ( <NUM_LIT> , <NUM_LIT> ) ; worldObj . removeBlockTileEntity ( xCoord , yCoord , zCoord ) ; invalidate ( ) ; if ( worldObj . getBlockId ( xCoord , yCoord , zCoord ) == Block . pistonMoving . blockID ) { worldObj . setBlockAndMetadataWithNotify ( xCoord , yCoord , zCoord , storedBlockID , storedMetadata ) ; } return ; } progress += <NUM_LIT> ; if ( progress >= <NUM_LIT> ) { progress = <NUM_LIT> ; } if ( extending ) { updatePushedObjects ( progress , ( progress - lastProgress ) + <NUM_LIT> ) ; } } public void readFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readFromNBT ( par1NBTTagCompound ) ; storedBlockID = par1NBTTagCompound . getInteger ( "<STR_LIT>" ) ; storedMetadata = par1NBTTagCompound . getInteger ( "<STR_LIT>" ) ; storedOrientation = par1NBTTagCompound . getInteger ( "<STR_LIT>" ) ; lastProgress = progress = par1NBTTagCompound . getFloat ( "<STR_LIT>" ) ; extending = par1NBTTagCompound . getBoolean ( "<STR_LIT>" ) ; } public void writeToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setInteger ( "<STR_LIT>" , storedBlockID ) ; par1NBTTagCompound . setInteger ( "<STR_LIT>" , storedMetadata ) ; par1NBTTagCompound . setInteger ( "<STR_LIT>" , storedOrientation ) ; par1NBTTagCompound . setFloat ( "<STR_LIT>" , lastProgress ) ; par1NBTTagCompound . setBoolean ( "<STR_LIT>" , extending ) ; } } </s>
<s> package net . minecraft . src ; public class GenLayerZoom extends GenLayer { public GenLayerZoom ( long par1 , GenLayer par3GenLayer ) { super ( par1 ) ; super . parent = par3GenLayer ; } public int [ ] getInts ( int par1 , int par2 , int par3 , int par4 ) { int i = par1 > > <NUM_LIT:1> ; int j = par2 > > <NUM_LIT:1> ; int k = ( par3 > > <NUM_LIT:1> ) + <NUM_LIT:3> ; int l = ( par4 > > <NUM_LIT:1> ) + <NUM_LIT:3> ; int ai [ ] = parent . getInts ( i , j , k , l ) ; int ai1 [ ] = IntCache . getIntCache ( k * <NUM_LIT:2> * ( l * <NUM_LIT:2> ) ) ; int i1 = k << <NUM_LIT:1> ; for ( int j1 = <NUM_LIT:0> ; j1 < l - <NUM_LIT:1> ; j1 ++ ) { int k1 = j1 << <NUM_LIT:1> ; int i2 = k1 * i1 ; int j2 = ai [ <NUM_LIT:0> + ( j1 + <NUM_LIT:0> ) * k ] ; int k2 = ai [ <NUM_LIT:0> + ( j1 + <NUM_LIT:1> ) * k ] ; for ( int l2 = <NUM_LIT:0> ; l2 < k - <NUM_LIT:1> ; l2 ++ ) { initChunkSeed ( l2 + i << <NUM_LIT:1> , j1 + j << <NUM_LIT:1> ) ; int i3 = ai [ l2 + <NUM_LIT:1> + ( j1 + <NUM_LIT:0> ) * k ] ; int j3 = ai [ l2 + <NUM_LIT:1> + ( j1 + <NUM_LIT:1> ) * k ] ; ai1 [ i2 ] = j2 ; ai1 [ i2 ++ + i1 ] = choose ( j2 , k2 ) ; ai1 [ i2 ] = choose ( j2 , i3 ) ; ai1 [ i2 ++ + i1 ] = func_35024_b ( j2 , i3 , k2 , j3 ) ; j2 = i3 ; k2 = j3 ; } } int ai2 [ ] = IntCache . getIntCache ( par3 * par4 ) ; for ( int l1 = <NUM_LIT:0> ; l1 < par4 ; l1 ++ ) { System . arraycopy ( ai1 , ( l1 + ( par2 & <NUM_LIT:1> ) ) * ( k << <NUM_LIT:1> ) + ( par1 & <NUM_LIT:1> ) , ai2 , l1 * par3 , par3 ) ; } return ai2 ; } protected int choose ( int par1 , int par2 ) { return nextInt ( <NUM_LIT:2> ) != <NUM_LIT:0> ? par2 : par1 ; } protected int func_35024_b ( int par1 , int par2 , int par3 , int par4 ) { if ( par2 == par3 && par3 == par4 ) { return par2 ; } if ( par1 == par2 && par1 == par3 ) { return par1 ; } if ( par1 == par2 && par1 == par4 ) { return par1 ; } if ( par1 == par3 && par1 == par4 ) { return par1 ; } if ( par1 == par2 && par3 != par4 ) { return par1 ; } if ( par1 == par3 && par2 != par4 ) { return par1 ; } if ( par1 == par4 && par2 != par3 ) { return par1 ; } if ( par2 == par1 && par3 != par4 ) { return par2 ; } if ( par2 == par3 && par1 != par4 ) { return par2 ; } if ( par2 == par4 && par1 != par3 ) { return par2 ; } if ( par3 == par1 && par2 != par4 ) { return par3 ; } if ( par3 == par2 && par1 != par4 ) { return par3 ; } if ( par3 == par4 && par1 != par2 ) { return par3 ; } if ( par4 == par1 && par2 != par3 ) { return par3 ; } if ( par4 == par2 && par1 != par3 ) { return par3 ; } if ( par4 == par3 && par1 != par2 ) { return par3 ; } int i = nextInt ( <NUM_LIT:4> ) ; if ( i == <NUM_LIT:0> ) { return par1 ; } if ( i == <NUM_LIT:1> ) { return par2 ; } if ( i == <NUM_LIT:2> ) { return par3 ; } else { return par4 ; } } public static GenLayer func_35025_a ( long par0 , GenLayer par2GenLayer , int par3 ) { Object obj = par2GenLayer ; for ( int i = <NUM_LIT:0> ; i < par3 ; i ++ ) { obj = new GenLayerZoom ( par0 + ( long ) i , ( ( GenLayer ) ( obj ) ) ) ; } return ( ( GenLayer ) ( obj ) ) ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockOre extends Block { public BlockOre ( int par1 , int par2 ) { super ( par1 , par2 , Material . rock ) ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { if ( blockID == Block . oreCoal . blockID ) { return Item . coal . shiftedIndex ; } if ( blockID == Block . oreDiamond . blockID ) { return Item . diamond . shiftedIndex ; } if ( blockID == Block . oreLapis . blockID ) { return Item . dyePowder . shiftedIndex ; } else { return blockID ; } } public int quantityDropped ( Random par1Random ) { if ( blockID == Block . oreLapis . blockID ) { return <NUM_LIT:4> + par1Random . nextInt ( <NUM_LIT:5> ) ; } else { return <NUM_LIT:1> ; } } public int quantityDroppedWithBonus ( int par1 , Random par2Random ) { if ( par1 > <NUM_LIT:0> && blockID != idDropped ( <NUM_LIT:0> , par2Random , par1 ) ) { int i = par2Random . nextInt ( par1 + <NUM_LIT:2> ) - <NUM_LIT:1> ; if ( i < <NUM_LIT:0> ) { i = <NUM_LIT:0> ; } return quantityDropped ( par2Random ) * ( i + <NUM_LIT:1> ) ; } else { return quantityDropped ( par2Random ) ; } } protected int damageDropped ( int par1 ) { return blockID != Block . oreLapis . blockID ? <NUM_LIT:0> : <NUM_LIT:4> ; } } </s>
<s> package net . minecraft . src ; public class ItemMetadata extends ItemBlock { private Block blockObj ; public ItemMetadata ( int par1 , Block par2Block ) { super ( par1 ) ; blockObj = par2Block ; setMaxDamage ( <NUM_LIT:0> ) ; setHasSubtypes ( true ) ; } public int getMetadata ( int par1 ) { return par1 ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; abstract class ComponentVillage extends StructureComponent { private int villagersSpawned ; protected ComponentVillage ( int par1 ) { super ( par1 ) ; } protected StructureComponent getNextComponentNN ( ComponentVillageStartPiece par1ComponentVillageStartPiece , List par2List , Random par3Random , int par4 , int par5 ) { switch ( coordBaseMode ) { case <NUM_LIT:2> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . minX - <NUM_LIT:1> , boundingBox . minY + par4 , boundingBox . minZ + par5 , <NUM_LIT:1> , getComponentType ( ) ) ; case <NUM_LIT:0> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . minX - <NUM_LIT:1> , boundingBox . minY + par4 , boundingBox . minZ + par5 , <NUM_LIT:1> , getComponentType ( ) ) ; case <NUM_LIT:1> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . minX + par5 , boundingBox . minY + par4 , boundingBox . minZ - <NUM_LIT:1> , <NUM_LIT:2> , getComponentType ( ) ) ; case <NUM_LIT:3> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . minX + par5 , boundingBox . minY + par4 , boundingBox . minZ - <NUM_LIT:1> , <NUM_LIT:2> , getComponentType ( ) ) ; } return null ; } protected StructureComponent getNextComponentPP ( ComponentVillageStartPiece par1ComponentVillageStartPiece , List par2List , Random par3Random , int par4 , int par5 ) { switch ( coordBaseMode ) { case <NUM_LIT:2> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . maxX + <NUM_LIT:1> , boundingBox . minY + par4 , boundingBox . minZ + par5 , <NUM_LIT:3> , getComponentType ( ) ) ; case <NUM_LIT:0> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . maxX + <NUM_LIT:1> , boundingBox . minY + par4 , boundingBox . minZ + par5 , <NUM_LIT:3> , getComponentType ( ) ) ; case <NUM_LIT:1> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . minX + par5 , boundingBox . minY + par4 , boundingBox . maxZ + <NUM_LIT:1> , <NUM_LIT:0> , getComponentType ( ) ) ; case <NUM_LIT:3> : return StructureVillagePieces . getNextStructureComponent ( par1ComponentVillageStartPiece , par2List , par3Random , boundingBox . minX + par5 , boundingBox . minY + par4 , boundingBox . maxZ + <NUM_LIT:1> , <NUM_LIT:0> , getComponentType ( ) ) ; } return null ; } protected int getAverageGroundLevel ( World par1World , StructureBoundingBox par2StructureBoundingBox ) { int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; for ( int k = boundingBox . minZ ; k <= boundingBox . maxZ ; k ++ ) { for ( int l = boundingBox . minX ; l <= boundingBox . maxX ; l ++ ) { if ( par2StructureBoundingBox . isVecInside ( l , <NUM_LIT> , k ) ) { i += Math . max ( par1World . getTopSolidOrLiquidBlock ( l , k ) , par1World . worldProvider . getAverageGroundLevel ( ) ) ; j ++ ; } } } if ( j == <NUM_LIT:0> ) { return - <NUM_LIT:1> ; } else { return i / j ; } } protected static boolean canVillageGoDeeper ( StructureBoundingBox par0StructureBoundingBox ) { return par0StructureBoundingBox != null && par0StructureBoundingBox . minY > <NUM_LIT:10> ; } protected void spawnVillagers ( World par1World , StructureBoundingBox par2StructureBoundingBox , int par3 , int par4 , int par5 , int par6 ) { if ( villagersSpawned >= par6 ) { return ; } int i = villagersSpawned ; do { if ( i >= par6 ) { break ; } int j = getXWithOffset ( par3 + i , par5 ) ; int k = getYWithOffset ( par4 ) ; int l = getZWithOffset ( par3 + i , par5 ) ; if ( ! par2StructureBoundingBox . isVecInside ( j , k , l ) ) { break ; } villagersSpawned ++ ; EntityVillager entityvillager = new EntityVillager ( par1World , getVillagerType ( i ) ) ; entityvillager . setLocationAndAngles ( ( double ) j + <NUM_LIT> , k , ( double ) l + <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; par1World . spawnEntityInWorld ( entityvillager ) ; i ++ ; } while ( true ) ; } protected int getVillagerType ( int par1 ) { return <NUM_LIT:0> ; } } </s>
<s> package net . minecraft . src ; final class MaterialWeb extends Material { MaterialWeb ( MapColor par1MapColor ) { super ( par1MapColor ) ; } public boolean blocksMovement ( ) { return false ; } } </s>
<s> package net . minecraft . src ; public class EntityPig extends EntityAnimal { public EntityPig ( World par1World ) { super ( par1World ) ; texture = "<STR_LIT>" ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; getNavigator ( ) . func_48656_a ( true ) ; float f = <NUM_LIT> ; tasks . addTask ( <NUM_LIT:0> , new EntityAISwimming ( this ) ) ; tasks . addTask ( <NUM_LIT:1> , new EntityAIPanic ( this , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:2> , new EntityAIMate ( this , f ) ) ; tasks . addTask ( <NUM_LIT:3> , new EntityAITempt ( this , <NUM_LIT> , Item . wheat . shiftedIndex , false ) ) ; tasks . addTask ( <NUM_LIT:4> , new EntityAIFollowParent ( this , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:5> , new EntityAIWander ( this , f ) ) ; tasks . addTask ( <NUM_LIT:6> , new EntityAIWatchClosest ( this , net . minecraft . src . EntityPlayer . class , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:7> , new EntityAILookIdle ( this ) ) ; } public boolean isAIEnabled ( ) { return true ; } public int getMaxHealth ( ) { return <NUM_LIT:10> ; } protected void entityInit ( ) { super . entityInit ( ) ; dataWatcher . addObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) <NUM_LIT:0> ) ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setBoolean ( "<STR_LIT>" , getSaddled ( ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; setSaddled ( par1NBTTagCompound . getBoolean ( "<STR_LIT>" ) ) ; } protected String getLivingSound ( ) { return "<STR_LIT>" ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } public boolean interact ( EntityPlayer par1EntityPlayer ) { if ( ! super . interact ( par1EntityPlayer ) ) { if ( getSaddled ( ) && ! worldObj . isRemote && ( riddenByEntity == null || riddenByEntity == par1EntityPlayer ) ) { par1EntityPlayer . mountEntity ( this ) ; return true ; } else { return false ; } } else { return true ; } } protected int getDropItemId ( ) { if ( isBurning ( ) ) { return Item . porkCooked . shiftedIndex ; } else { return Item . porkRaw . shiftedIndex ; } } public boolean getSaddled ( ) { return ( dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) & <NUM_LIT:1> ) != <NUM_LIT:0> ; } public void setSaddled ( boolean par1 ) { if ( par1 ) { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) <NUM_LIT:1> ) ) ; } else { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) <NUM_LIT:0> ) ) ; } } public void onStruckByLightning ( EntityLightningBolt par1EntityLightningBolt ) { if ( worldObj . isRemote ) { return ; } else { EntityPigZombie entitypigzombie = new EntityPigZombie ( worldObj ) ; entitypigzombie . setLocationAndAngles ( posX , posY , posZ , rotationYaw , rotationPitch ) ; worldObj . spawnEntityInWorld ( entitypigzombie ) ; setDead ( ) ; return ; } } protected void fall ( float par1 ) { super . fall ( par1 ) ; if ( par1 > <NUM_LIT> && ( riddenByEntity instanceof EntityPlayer ) ) { ( ( EntityPlayer ) riddenByEntity ) . triggerAchievement ( AchievementList . flyPig ) ; } } public EntityAnimal spawnBabyAnimal ( EntityAnimal par1EntityAnimal ) { return new EntityPig ( worldObj ) ; } } </s>
<s> package net . minecraft . src ; public interface IThreadedFileIO { public abstract boolean writeNextIO ( ) ; } </s>
<s> package net . minecraft . src ; import java . util . Random ; public abstract class EntityTameable extends EntityAnimal { protected EntityAISit aiSit ; public EntityTameable ( World par1World ) { super ( par1World ) ; aiSit = new EntityAISit ( this ) ; } protected void entityInit ( ) { super . entityInit ( ) ; dataWatcher . addObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) <NUM_LIT:0> ) ) ; dataWatcher . addObject ( <NUM_LIT> , "<STR_LIT>" ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; if ( getOwnerName ( ) == null ) { par1NBTTagCompound . setString ( "<STR_LIT>" , "<STR_LIT>" ) ; } else { par1NBTTagCompound . setString ( "<STR_LIT>" , getOwnerName ( ) ) ; } par1NBTTagCompound . setBoolean ( "<STR_LIT>" , isSitting ( ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; String s = par1NBTTagCompound . getString ( "<STR_LIT>" ) ; if ( s . length ( ) > <NUM_LIT:0> ) { setOwner ( s ) ; setTamed ( true ) ; } aiSit . func_48210_a ( par1NBTTagCompound . getBoolean ( "<STR_LIT>" ) ) ; } protected void func_48370_a ( boolean par1 ) { String s = "<STR_LIT>" ; if ( ! par1 ) { s = "<STR_LIT>" ; } for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:7> ; i ++ ) { double d = rand . nextGaussian ( ) * <NUM_LIT> ; double d1 = rand . nextGaussian ( ) * <NUM_LIT> ; double d2 = rand . nextGaussian ( ) * <NUM_LIT> ; worldObj . spawnParticle ( s , ( posX + ( double ) ( rand . nextFloat ( ) * width * <NUM_LIT> ) ) - ( double ) width , posY + <NUM_LIT> + ( double ) ( rand . nextFloat ( ) * height ) , ( posZ + ( double ) ( rand . nextFloat ( ) * width * <NUM_LIT> ) ) - ( double ) width , d , d1 , d2 ) ; } } public boolean isTamed ( ) { return ( dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) & <NUM_LIT:4> ) != <NUM_LIT:0> ; } public void setTamed ( boolean par1 ) { byte byte0 = dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) ; if ( par1 ) { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( byte0 | <NUM_LIT:4> ) ) ) ; } else { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( byte0 & - <NUM_LIT:5> ) ) ) ; } } public boolean isSitting ( ) { return ( dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) & <NUM_LIT:1> ) != <NUM_LIT:0> ; } public void func_48369_c ( boolean par1 ) { byte byte0 = dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) ; if ( par1 ) { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( byte0 | <NUM_LIT:1> ) ) ) ; } else { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( byte0 & - <NUM_LIT:2> ) ) ) ; } } public String getOwnerName ( ) { return dataWatcher . getWatchableObjectString ( <NUM_LIT> ) ; } public void setOwner ( String par1Str ) { dataWatcher . updateObject ( <NUM_LIT> , par1Str ) ; } public EntityLiving getOwner ( ) { return worldObj . getPlayerEntityByName ( getOwnerName ( ) ) ; } public EntityAISit func_50021_C ( ) { return aiSit ; } } </s>
<s> package net . minecraft . src ; public class LongHashMap { private transient LongHashMapEntry hashArray [ ] ; private transient int numHashElements ; private int capacity ; private final float percentUseable = <NUM_LIT> ; private volatile transient int modCount ; public LongHashMap ( ) { capacity = <NUM_LIT:12> ; hashArray = new LongHashMapEntry [ <NUM_LIT:16> ] ; } private static int getHashedKey ( long par0 ) { return hash ( ( int ) ( par0 ^ par0 > > > <NUM_LIT:32> ) ) ; } private static int hash ( int par0 ) { par0 ^= par0 > > > <NUM_LIT:20> ^ par0 > > > <NUM_LIT:12> ; return par0 ^ par0 > > > <NUM_LIT:7> ^ par0 > > > <NUM_LIT:4> ; } private static int getHashIndex ( int par0 , int par1 ) { return par0 & par1 - <NUM_LIT:1> ; } public int getNumHashElements ( ) { return numHashElements ; } public Object getValueByKey ( long par1 ) { int i = getHashedKey ( par1 ) ; for ( LongHashMapEntry longhashmapentry = hashArray [ getHashIndex ( i , hashArray . length ) ] ; longhashmapentry != null ; longhashmapentry = longhashmapentry . nextEntry ) { if ( longhashmapentry . key == par1 ) { return longhashmapentry . value ; } } return null ; } public boolean containsItem ( long par1 ) { return getEntry ( par1 ) != null ; } final LongHashMapEntry getEntry ( long par1 ) { int i = getHashedKey ( par1 ) ; for ( LongHashMapEntry longhashmapentry = hashArray [ getHashIndex ( i , hashArray . length ) ] ; longhashmapentry != null ; longhashmapentry = longhashmapentry . nextEntry ) { if ( longhashmapentry . key == par1 ) { return longhashmapentry ; } } return null ; } public void add ( long par1 , Object par3Obj ) { int i = getHashedKey ( par1 ) ; int j = getHashIndex ( i , hashArray . length ) ; for ( LongHashMapEntry longhashmapentry = hashArray [ j ] ; longhashmapentry != null ; longhashmapentry = longhashmapentry . nextEntry ) { if ( longhashmapentry . key == par1 ) { longhashmapentry . value = par3Obj ; } } modCount ++ ; createKey ( i , par1 , par3Obj , j ) ; } private void resizeTable ( int par1 ) { LongHashMapEntry alonghashmapentry [ ] = hashArray ; int i = alonghashmapentry . length ; if ( i == <NUM_LIT> ) { capacity = <NUM_LIT> ; return ; } else { LongHashMapEntry alonghashmapentry1 [ ] = new LongHashMapEntry [ par1 ] ; copyHashTableTo ( alonghashmapentry1 ) ; hashArray = alonghashmapentry1 ; capacity = ( int ) ( ( float ) par1 * percentUseable ) ; return ; } } private void copyHashTableTo ( LongHashMapEntry par1ArrayOfLongHashMapEntry [ ] ) { LongHashMapEntry alonghashmapentry [ ] = hashArray ; int i = par1ArrayOfLongHashMapEntry . length ; for ( int j = <NUM_LIT:0> ; j < alonghashmapentry . length ; j ++ ) { LongHashMapEntry longhashmapentry = alonghashmapentry [ j ] ; if ( longhashmapentry == null ) { continue ; } alonghashmapentry [ j ] = null ; do { LongHashMapEntry longhashmapentry1 = longhashmapentry . nextEntry ; int k = getHashIndex ( longhashmapentry . hash , i ) ; longhashmapentry . nextEntry = par1ArrayOfLongHashMapEntry [ k ] ; par1ArrayOfLongHashMapEntry [ k ] = longhashmapentry ; longhashmapentry = longhashmapentry1 ; } while ( longhashmapentry != null ) ; } } public Object remove ( long par1 ) { LongHashMapEntry longhashmapentry = removeKey ( par1 ) ; return longhashmapentry != null ? longhashmapentry . value : null ; } final LongHashMapEntry removeKey ( long par1 ) { int i = getHashedKey ( par1 ) ; int j = getHashIndex ( i , hashArray . length ) ; LongHashMapEntry longhashmapentry = hashArray [ j ] ; LongHashMapEntry longhashmapentry1 ; LongHashMapEntry longhashmapentry2 ; for ( longhashmapentry1 = longhashmapentry ; longhashmapentry1 != null ; longhashmapentry1 = longhashmapentry2 ) { longhashmapentry2 = longhashmapentry1 . nextEntry ; if ( longhashmapentry1 . key == par1 ) { modCount ++ ; numHashElements -- ; if ( longhashmapentry == longhashmapentry1 ) { hashArray [ j ] = longhashmapentry2 ; } else { longhashmapentry . nextEntry = longhashmapentry2 ; } return longhashmapentry1 ; } longhashmapentry = longhashmapentry1 ; } return longhashmapentry1 ; } private void createKey ( int par1 , long par2 , Object par4Obj , int par5 ) { LongHashMapEntry longhashmapentry = hashArray [ par5 ] ; hashArray [ par5 ] = new LongHashMapEntry ( par1 , par2 , par4Obj , longhashmapentry ) ; if ( numHashElements ++ >= capacity ) { resizeTable ( <NUM_LIT:2> * hashArray . length ) ; } } static int getHashCode ( long par0 ) { return getHashedKey ( par0 ) ; } } </s>
<s> package net . minecraft . src ; import java . io . PrintWriter ; import java . io . StringWriter ; import java . text . SimpleDateFormat ; import java . util . logging . * ; final class ConsoleLogFormatter extends Formatter { private SimpleDateFormat dateFormat ; ConsoleLogFormatter ( ) { dateFormat = new SimpleDateFormat ( "<STR_LIT>" ) ; } public String format ( LogRecord par1LogRecord ) { StringBuilder stringbuilder = new StringBuilder ( ) ; stringbuilder . append ( dateFormat . format ( Long . valueOf ( par1LogRecord . getMillis ( ) ) ) ) ; Level level = par1LogRecord . getLevel ( ) ; if ( level == Level . FINEST ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . FINER ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . FINE ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . INFO ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . WARNING ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . SEVERE ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . SEVERE ) { stringbuilder . append ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( level . getLocalizedName ( ) ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } stringbuilder . append ( par1LogRecord . getMessage ( ) ) ; stringbuilder . append ( '<STR_LIT:\n>' ) ; Throwable throwable = par1LogRecord . getThrown ( ) ; if ( throwable != null ) { StringWriter stringwriter = new StringWriter ( ) ; throwable . printStackTrace ( new PrintWriter ( stringwriter ) ) ; stringbuilder . append ( stringwriter . toString ( ) ) ; } return stringbuilder . toString ( ) ; } } </s>
<s> package net . minecraft . src ; public class TileEntityBrewingStand extends TileEntity implements IInventory { private ItemStack brewingItemStacks [ ] ; private int brewTime ; private int filledSlots ; private int ingredientID ; public TileEntityBrewingStand ( ) { brewingItemStacks = new ItemStack [ <NUM_LIT:4> ] ; } public String getInvName ( ) { return "<STR_LIT>" ; } public int getSizeInventory ( ) { return brewingItemStacks . length ; } public void updateEntity ( ) { if ( brewTime > <NUM_LIT:0> ) { brewTime -- ; if ( brewTime == <NUM_LIT:0> ) { brewPotions ( ) ; onInventoryChanged ( ) ; } else if ( ! canBrew ( ) ) { brewTime = <NUM_LIT:0> ; onInventoryChanged ( ) ; } else if ( ingredientID != brewingItemStacks [ <NUM_LIT:3> ] . itemID ) { brewTime = <NUM_LIT:0> ; onInventoryChanged ( ) ; } } else if ( canBrew ( ) ) { brewTime = <NUM_LIT> ; ingredientID = brewingItemStacks [ <NUM_LIT:3> ] . itemID ; } int i = getFilledSlots ( ) ; if ( i != filledSlots ) { filledSlots = i ; worldObj . setBlockMetadataWithNotify ( xCoord , yCoord , zCoord , i ) ; } super . updateEntity ( ) ; } public int getBrewTime ( ) { return brewTime ; } private boolean canBrew ( ) { if ( brewingItemStacks [ <NUM_LIT:3> ] == null || brewingItemStacks [ <NUM_LIT:3> ] . stackSize <= <NUM_LIT:0> ) { return false ; } ItemStack itemstack = brewingItemStacks [ <NUM_LIT:3> ] ; if ( ! Item . itemsList [ itemstack . itemID ] . isPotionIngredient ( ) ) { return false ; } boolean flag = false ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:3> ; i ++ ) { if ( brewingItemStacks [ i ] == null || brewingItemStacks [ i ] . itemID != Item . potion . shiftedIndex ) { continue ; } int j = brewingItemStacks [ i ] . getItemDamage ( ) ; int k = getPotionResult ( j , itemstack ) ; if ( ! ItemPotion . isSplash ( j ) && ItemPotion . isSplash ( k ) ) { flag = true ; break ; } java . util . List list = Item . potion . getEffects ( j ) ; java . util . List list1 = Item . potion . getEffects ( k ) ; if ( j > <NUM_LIT:0> && list == list1 || list != null && ( list . equals ( list1 ) || list1 == null ) || j == k ) { continue ; } flag = true ; break ; } return flag ; } private void brewPotions ( ) { if ( ! canBrew ( ) ) { return ; } ItemStack itemstack = brewingItemStacks [ <NUM_LIT:3> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:3> ; i ++ ) { if ( brewingItemStacks [ i ] == null || brewingItemStacks [ i ] . itemID != Item . potion . shiftedIndex ) { continue ; } int j = brewingItemStacks [ i ] . getItemDamage ( ) ; int k = getPotionResult ( j , itemstack ) ; java . util . List list = Item . potion . getEffects ( j ) ; java . util . List list1 = Item . potion . getEffects ( k ) ; if ( j > <NUM_LIT:0> && list == list1 || list != null && ( list . equals ( list1 ) || list1 == null ) ) { if ( ! ItemPotion . isSplash ( j ) && ItemPotion . isSplash ( k ) ) { brewingItemStacks [ i ] . setItemDamage ( k ) ; } continue ; } if ( j != k ) { brewingItemStacks [ i ] . setItemDamage ( k ) ; } } if ( Item . itemsList [ itemstack . itemID ] . hasContainerItem ( ) ) { brewingItemStacks [ <NUM_LIT:3> ] = new ItemStack ( Item . itemsList [ itemstack . itemID ] . getContainerItem ( ) ) ; } else { brewingItemStacks [ <NUM_LIT:3> ] . stackSize -- ; if ( brewingItemStacks [ <NUM_LIT:3> ] . stackSize <= <NUM_LIT:0> ) { brewingItemStacks [ <NUM_LIT:3> ] = null ; } } } private int getPotionResult ( int par1 , ItemStack par2ItemStack ) { if ( par2ItemStack == null ) { return par1 ; } if ( Item . itemsList [ par2ItemStack . itemID ] . isPotionIngredient ( ) ) { return PotionHelper . applyIngredient ( par1 , Item . itemsList [ par2ItemStack . itemID ] . getPotionEffect ( ) ) ; } else { return par1 ; } } public void readFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readFromNBT ( par1NBTTagCompound ) ; NBTTagList nbttaglist = par1NBTTagCompound . getTagList ( "<STR_LIT>" ) ; brewingItemStacks = new ItemStack [ getSizeInventory ( ) ] ; for ( int i = <NUM_LIT:0> ; i < nbttaglist . tagCount ( ) ; i ++ ) { NBTTagCompound nbttagcompound = ( NBTTagCompound ) nbttaglist . tagAt ( i ) ; byte byte0 = nbttagcompound . getByte ( "<STR_LIT>" ) ; if ( byte0 >= <NUM_LIT:0> && byte0 < brewingItemStacks . length ) { brewingItemStacks [ byte0 ] = ItemStack . loadItemStackFromNBT ( nbttagcompound ) ; } } brewTime = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; } public void writeToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) brewTime ) ; NBTTagList nbttaglist = new NBTTagList ( ) ; for ( int i = <NUM_LIT:0> ; i < brewingItemStacks . length ; i ++ ) { if ( brewingItemStacks [ i ] != null ) { NBTTagCompound nbttagcompound = new NBTTagCompound ( ) ; nbttagcompound . setByte ( "<STR_LIT>" , ( byte ) i ) ; brewingItemStacks [ i ] . writeToNBT ( nbttagcompound ) ; nbttaglist . appendTag ( nbttagcompound ) ; } } par1NBTTagCompound . setTag ( "<STR_LIT>" , nbttaglist ) ; } public ItemStack getStackInSlot ( int par1 ) { if ( par1 >= <NUM_LIT:0> && par1 < brewingItemStacks . length ) { return brewingItemStacks [ par1 ] ; } else { return null ; } } public ItemStack decrStackSize ( int par1 , int par2 ) { if ( par1 >= <NUM_LIT:0> && par1 < brewingItemStacks . length ) { ItemStack itemstack = brewingItemStacks [ par1 ] ; brewingItemStacks [ par1 ] = null ; return itemstack ; } else { return null ; } } public ItemStack getStackInSlotOnClosing ( int par1 ) { if ( par1 >= <NUM_LIT:0> && par1 < brewingItemStacks . length ) { ItemStack itemstack = brewingItemStacks [ par1 ] ; brewingItemStacks [ par1 ] = null ; return itemstack ; } else { return null ; } } public void setInventorySlotContents ( int par1 , ItemStack par2ItemStack ) { if ( par1 >= <NUM_LIT:0> && par1 < brewingItemStacks . length ) { brewingItemStacks [ par1 ] = par2ItemStack ; } } public int getInventoryStackLimit ( ) { return <NUM_LIT:1> ; } public boolean isUseableByPlayer ( EntityPlayer par1EntityPlayer ) { if ( worldObj . getBlockTileEntity ( xCoord , yCoord , zCoord ) != this ) { return false ; } return par1EntityPlayer . getDistanceSq ( ( double ) xCoord + <NUM_LIT> , ( double ) yCoord + <NUM_LIT> , ( double ) zCoord + <NUM_LIT> ) <= <NUM_LIT> ; } public void openChest ( ) { } public void closeChest ( ) { } public int getFilledSlots ( ) { int i = <NUM_LIT:0> ; for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:3> ; j ++ ) { if ( brewingItemStacks [ j ] != null ) { i |= <NUM_LIT:1> << j ; } } return i ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenFire extends WorldGenerator { public WorldGenFire ( ) { } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { int j = ( par3 + par2Random . nextInt ( <NUM_LIT:8> ) ) - par2Random . nextInt ( <NUM_LIT:8> ) ; int k = ( par4 + par2Random . nextInt ( <NUM_LIT:4> ) ) - par2Random . nextInt ( <NUM_LIT:4> ) ; int l = ( par5 + par2Random . nextInt ( <NUM_LIT:8> ) ) - par2Random . nextInt ( <NUM_LIT:8> ) ; if ( par1World . isAirBlock ( j , k , l ) && par1World . getBlockId ( j , k - <NUM_LIT:1> , l ) == Block . netherrack . blockID ) { par1World . setBlockWithNotify ( j , k , l , Block . fire . blockID ) ; } } return true ; } } </s>
<s> package net . minecraft . src ; import java . util . * ; public class ComponentMineshaftRoom extends StructureComponent { private LinkedList chidStructures ; public ComponentMineshaftRoom ( int par1 , Random par2Random , int par3 , int par4 ) { super ( par1 ) ; chidStructures = new LinkedList ( ) ; boundingBox = new StructureBoundingBox ( par3 , <NUM_LIT> , par4 , par3 + <NUM_LIT:7> + par2Random . nextInt ( <NUM_LIT:6> ) , <NUM_LIT> + par2Random . nextInt ( <NUM_LIT:6> ) , par4 + <NUM_LIT:7> + par2Random . nextInt ( <NUM_LIT:6> ) ) ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { int i = getComponentType ( ) ; int j1 = boundingBox . getYSize ( ) - <NUM_LIT:3> - <NUM_LIT:1> ; if ( j1 <= <NUM_LIT:0> ) { j1 = <NUM_LIT:1> ; } for ( int j = <NUM_LIT:0> ; j < boundingBox . getXSize ( ) ; j += <NUM_LIT:4> ) { j += par3Random . nextInt ( boundingBox . getXSize ( ) ) ; if ( j + <NUM_LIT:3> > boundingBox . getXSize ( ) ) { break ; } StructureComponent structurecomponent = StructureMineshaftPieces . getNextComponent ( par1StructureComponent , par2List , par3Random , boundingBox . minX + j , boundingBox . minY + par3Random . nextInt ( j1 ) + <NUM_LIT:1> , boundingBox . minZ - <NUM_LIT:1> , <NUM_LIT:2> , i ) ; if ( structurecomponent != null ) { StructureBoundingBox structureboundingbox = structurecomponent . getBoundingBox ( ) ; chidStructures . add ( new StructureBoundingBox ( structureboundingbox . minX , structureboundingbox . minY , boundingBox . minZ , structureboundingbox . maxX , structureboundingbox . maxY , boundingBox . minZ + <NUM_LIT:1> ) ) ; } } for ( int k = <NUM_LIT:0> ; k < boundingBox . getXSize ( ) ; k += <NUM_LIT:4> ) { k += par3Random . nextInt ( boundingBox . getXSize ( ) ) ; if ( k + <NUM_LIT:3> > boundingBox . getXSize ( ) ) { break ; } StructureComponent structurecomponent1 = StructureMineshaftPieces . getNextComponent ( par1StructureComponent , par2List , par3Random , boundingBox . minX + k , boundingBox . minY + par3Random . nextInt ( j1 ) + <NUM_LIT:1> , boundingBox . maxZ + <NUM_LIT:1> , <NUM_LIT:0> , i ) ; if ( structurecomponent1 != null ) { StructureBoundingBox structureboundingbox1 = structurecomponent1 . getBoundingBox ( ) ; chidStructures . add ( new StructureBoundingBox ( structureboundingbox1 . minX , structureboundingbox1 . minY , boundingBox . maxZ - <NUM_LIT:1> , structureboundingbox1 . maxX , structureboundingbox1 . maxY , boundingBox . maxZ ) ) ; } } for ( int l = <NUM_LIT:0> ; l < boundingBox . getZSize ( ) ; l += <NUM_LIT:4> ) { l += par3Random . nextInt ( boundingBox . getZSize ( ) ) ; if ( l + <NUM_LIT:3> > boundingBox . getZSize ( ) ) { break ; } StructureComponent structurecomponent2 = StructureMineshaftPieces . getNextComponent ( par1StructureComponent , par2List , par3Random , boundingBox . minX - <NUM_LIT:1> , boundingBox . minY + par3Random . nextInt ( j1 ) + <NUM_LIT:1> , boundingBox . minZ + l , <NUM_LIT:1> , i ) ; if ( structurecomponent2 != null ) { StructureBoundingBox structureboundingbox2 = structurecomponent2 . getBoundingBox ( ) ; chidStructures . add ( new StructureBoundingBox ( boundingBox . minX , structureboundingbox2 . minY , structureboundingbox2 . minZ , boundingBox . minX + <NUM_LIT:1> , structureboundingbox2 . maxY , structureboundingbox2 . maxZ ) ) ; } } for ( int i1 = <NUM_LIT:0> ; i1 < boundingBox . getZSize ( ) ; i1 += <NUM_LIT:4> ) { i1 += par3Random . nextInt ( boundingBox . getZSize ( ) ) ; if ( i1 + <NUM_LIT:3> > boundingBox . getZSize ( ) ) { break ; } StructureComponent structurecomponent3 = StructureMineshaftPieces . getNextComponent ( par1StructureComponent , par2List , par3Random , boundingBox . maxX + <NUM_LIT:1> , boundingBox . minY + par3Random . nextInt ( j1 ) + <NUM_LIT:1> , boundingBox . minZ + i1 , <NUM_LIT:3> , i ) ; if ( structurecomponent3 != null ) { StructureBoundingBox structureboundingbox3 = structurecomponent3 . getBoundingBox ( ) ; chidStructures . add ( new StructureBoundingBox ( boundingBox . maxX - <NUM_LIT:1> , structureboundingbox3 . minY , structureboundingbox3 . minZ , boundingBox . maxX , structureboundingbox3 . maxY , structureboundingbox3 . maxZ ) ) ; } } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { if ( isLiquidInStructureBoundingBox ( par1World , par3StructureBoundingBox ) ) { return false ; } fillWithBlocks ( par1World , par3StructureBoundingBox , boundingBox . minX , boundingBox . minY , boundingBox . minZ , boundingBox . maxX , boundingBox . minY , boundingBox . maxZ , Block . dirt . blockID , <NUM_LIT:0> , true ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , boundingBox . minX , boundingBox . minY + <NUM_LIT:1> , boundingBox . minZ , boundingBox . maxX , Math . min ( boundingBox . minY + <NUM_LIT:3> , boundingBox . maxY ) , boundingBox . maxZ , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; StructureBoundingBox structureboundingbox ; for ( Iterator iterator = chidStructures . iterator ( ) ; iterator . hasNext ( ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , structureboundingbox . minX , structureboundingbox . maxY - <NUM_LIT:2> , structureboundingbox . minZ , structureboundingbox . maxX , structureboundingbox . maxY , structureboundingbox . maxZ , <NUM_LIT:0> , <NUM_LIT:0> , false ) ) { structureboundingbox = ( StructureBoundingBox ) iterator . next ( ) ; } randomlyRareFillWithBlocks ( par1World , par3StructureBoundingBox , boundingBox . minX , boundingBox . minY + <NUM_LIT:4> , boundingBox . minZ , boundingBox . maxX , boundingBox . maxY , boundingBox . maxZ , <NUM_LIT:0> , false ) ; return true ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentStrongholdLeftTurn extends ComponentStronghold { protected final EnumDoor doorType ; public ComponentStrongholdLeftTurn ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; doorType = getRandomDoor ( par2Random ) ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { if ( coordBaseMode == <NUM_LIT:2> || coordBaseMode == <NUM_LIT:3> ) { getNextComponentX ( ( ComponentStrongholdStairs2 ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:1> ) ; } else { getNextComponentZ ( ( ComponentStrongholdStairs2 ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:1> ) ; } } public static ComponentStrongholdLeftTurn findValidPlacement ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:1> , - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:5> , <NUM_LIT:5> , par5 ) ; if ( ! canStrongholdGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentStrongholdLeftTurn ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { if ( isLiquidInStructureBoundingBox ( par1World , par3StructureBoundingBox ) ) { return false ; } fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:4> , true , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; placeDoor ( par1World , par2Random , par3StructureBoundingBox , doorType , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> ) ; if ( coordBaseMode == <NUM_LIT:2> || coordBaseMode == <NUM_LIT:3> ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; } else { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; } return true ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockLeaves extends BlockLeavesBase { private int baseIndexInPNG ; int adjacentTreeBlocks [ ] ; protected BlockLeaves ( int par1 , int par2 ) { super ( par1 , par2 , Material . leaves , false ) ; baseIndexInPNG = par2 ; setTickRandomly ( true ) ; } public void onBlockRemoval ( World par1World , int par2 , int par3 , int par4 ) { int i = <NUM_LIT:1> ; int j = i + <NUM_LIT:1> ; if ( par1World . checkChunksExist ( par2 - j , par3 - j , par4 - j , par2 + j , par3 + j , par4 + j ) ) { for ( int k = - i ; k <= i ; k ++ ) { for ( int l = - i ; l <= i ; l ++ ) { for ( int i1 = - i ; i1 <= i ; i1 ++ ) { int j1 = par1World . getBlockId ( par2 + k , par3 + l , par4 + i1 ) ; if ( j1 == Block . leaves . blockID ) { int k1 = par1World . getBlockMetadata ( par2 + k , par3 + l , par4 + i1 ) ; par1World . setBlockMetadata ( par2 + k , par3 + l , par4 + i1 , k1 | <NUM_LIT:8> ) ; } } } } } } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { if ( par1World . isRemote ) { return ; } int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( ( i & <NUM_LIT:8> ) != <NUM_LIT:0> && ( i & <NUM_LIT:4> ) == <NUM_LIT:0> ) { byte byte0 = <NUM_LIT:4> ; int j = byte0 + <NUM_LIT:1> ; byte byte1 = <NUM_LIT:32> ; int k = byte1 * byte1 ; int l = byte1 / <NUM_LIT:2> ; if ( adjacentTreeBlocks == null ) { adjacentTreeBlocks = new int [ byte1 * byte1 * byte1 ] ; } if ( par1World . checkChunksExist ( par2 - j , par3 - j , par4 - j , par2 + j , par3 + j , par4 + j ) ) { for ( int i1 = - byte0 ; i1 <= byte0 ; i1 ++ ) { for ( int l1 = - byte0 ; l1 <= byte0 ; l1 ++ ) { for ( int j2 = - byte0 ; j2 <= byte0 ; j2 ++ ) { int l2 = par1World . getBlockId ( par2 + i1 , par3 + l1 , par4 + j2 ) ; if ( l2 == Block . wood . blockID ) { adjacentTreeBlocks [ ( i1 + l ) * k + ( l1 + l ) * byte1 + ( j2 + l ) ] = <NUM_LIT:0> ; continue ; } if ( l2 == Block . leaves . blockID ) { adjacentTreeBlocks [ ( i1 + l ) * k + ( l1 + l ) * byte1 + ( j2 + l ) ] = - <NUM_LIT:2> ; } else { adjacentTreeBlocks [ ( i1 + l ) * k + ( l1 + l ) * byte1 + ( j2 + l ) ] = - <NUM_LIT:1> ; } } } } for ( int j1 = <NUM_LIT:1> ; j1 <= <NUM_LIT:4> ; j1 ++ ) { for ( int i2 = - byte0 ; i2 <= byte0 ; i2 ++ ) { for ( int k2 = - byte0 ; k2 <= byte0 ; k2 ++ ) { for ( int i3 = - byte0 ; i3 <= byte0 ; i3 ++ ) { if ( adjacentTreeBlocks [ ( i2 + l ) * k + ( k2 + l ) * byte1 + ( i3 + l ) ] != j1 - <NUM_LIT:1> ) { continue ; } if ( adjacentTreeBlocks [ ( ( i2 + l ) - <NUM_LIT:1> ) * k + ( k2 + l ) * byte1 + ( i3 + l ) ] == - <NUM_LIT:2> ) { adjacentTreeBlocks [ ( ( i2 + l ) - <NUM_LIT:1> ) * k + ( k2 + l ) * byte1 + ( i3 + l ) ] = j1 ; } if ( adjacentTreeBlocks [ ( i2 + l + <NUM_LIT:1> ) * k + ( k2 + l ) * byte1 + ( i3 + l ) ] == - <NUM_LIT:2> ) { adjacentTreeBlocks [ ( i2 + l + <NUM_LIT:1> ) * k + ( k2 + l ) * byte1 + ( i3 + l ) ] = j1 ; } if ( adjacentTreeBlocks [ ( i2 + l ) * k + ( ( k2 + l ) - <NUM_LIT:1> ) * byte1 + ( i3 + l ) ] == - <NUM_LIT:2> ) { adjacentTreeBlocks [ ( i2 + l ) * k + ( ( k2 + l ) - <NUM_LIT:1> ) * byte1 + ( i3 + l ) ] = j1 ; } if ( adjacentTreeBlocks [ ( i2 + l ) * k + ( k2 + l + <NUM_LIT:1> ) * byte1 + ( i3 + l ) ] == - <NUM_LIT:2> ) { adjacentTreeBlocks [ ( i2 + l ) * k + ( k2 + l + <NUM_LIT:1> ) * byte1 + ( i3 + l ) ] = j1 ; } if ( adjacentTreeBlocks [ ( i2 + l ) * k + ( k2 + l ) * byte1 + ( ( i3 + l ) - <NUM_LIT:1> ) ] == - <NUM_LIT:2> ) { adjacentTreeBlocks [ ( i2 + l ) * k + ( k2 + l ) * byte1 + ( ( i3 + l ) - <NUM_LIT:1> ) ] = j1 ; } if ( adjacentTreeBlocks [ ( i2 + l ) * k + ( k2 + l ) * byte1 + ( i3 + l + <NUM_LIT:1> ) ] == - <NUM_LIT:2> ) { adjacentTreeBlocks [ ( i2 + l ) * k + ( k2 + l ) * byte1 + ( i3 + l + <NUM_LIT:1> ) ] = j1 ; } } } } } } int k1 = adjacentTreeBlocks [ l * k + l * byte1 + l ] ; if ( k1 >= <NUM_LIT:0> ) { par1World . setBlockMetadata ( par2 , par3 , par4 , i & - <NUM_LIT:9> ) ; } else { removeLeaves ( par1World , par2 , par3 , par4 ) ; } } } private void removeLeaves ( World par1World , int par2 , int par3 , int par4 ) { dropBlockAsItem ( par1World , par2 , par3 , par4 , par1World . getBlockMetadata ( par2 , par3 , par4 ) , <NUM_LIT:0> ) ; par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } public int quantityDropped ( Random par1Random ) { return par1Random . nextInt ( <NUM_LIT:20> ) != <NUM_LIT:0> ? <NUM_LIT:0> : <NUM_LIT:1> ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Block . sapling . blockID ; } public void dropBlockAsItemWithChance ( World par1World , int par2 , int par3 , int par4 , int par5 , float par6 , int par7 ) { if ( ! par1World . isRemote ) { byte byte0 = <NUM_LIT:20> ; if ( ( par5 & <NUM_LIT:3> ) == <NUM_LIT:3> ) { byte0 = <NUM_LIT> ; } if ( par1World . rand . nextInt ( byte0 ) == <NUM_LIT:0> ) { int i = idDropped ( par5 , par1World . rand , par7 ) ; dropBlockAsItem_do ( par1World , par2 , par3 , par4 , new ItemStack ( i , <NUM_LIT:1> , damageDropped ( par5 ) ) ) ; } if ( ( par5 & <NUM_LIT:3> ) == <NUM_LIT:0> && par1World . rand . nextInt ( <NUM_LIT> ) == <NUM_LIT:0> ) { dropBlockAsItem_do ( par1World , par2 , par3 , par4 , new ItemStack ( Item . appleRed , <NUM_LIT:1> , <NUM_LIT:0> ) ) ; } } } public void harvestBlock ( World par1World , EntityPlayer par2EntityPlayer , int par3 , int par4 , int par5 , int par6 ) { if ( ! par1World . isRemote && par2EntityPlayer . getCurrentEquippedItem ( ) != null && par2EntityPlayer . getCurrentEquippedItem ( ) . itemID == Item . shears . shiftedIndex ) { par2EntityPlayer . addStat ( StatList . mineBlockStatArray [ blockID ] , <NUM_LIT:1> ) ; dropBlockAsItem_do ( par1World , par3 , par4 , par5 , new ItemStack ( Block . leaves . blockID , <NUM_LIT:1> , par6 & <NUM_LIT:3> ) ) ; } else { super . harvestBlock ( par1World , par2EntityPlayer , par3 , par4 , par5 , par6 ) ; } } protected int damageDropped ( int par1 ) { return par1 & <NUM_LIT:3> ; } public boolean isOpaqueCube ( ) { return ! graphicsLevel ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( ( par2 & <NUM_LIT:3> ) == <NUM_LIT:1> ) { return blockIndexInTexture + <NUM_LIT> ; } if ( ( par2 & <NUM_LIT:3> ) == <NUM_LIT:3> ) { return blockIndexInTexture + <NUM_LIT> ; } else { return blockIndexInTexture ; } } public void onEntityWalking ( World par1World , int par2 , int par3 , int par4 , Entity par5Entity ) { super . onEntityWalking ( par1World , par2 , par3 , par4 , par5Entity ) ; } } </s>
<s> package net . minecraft . src ; public class InventoryPlayer implements IInventory { public ItemStack mainInventory [ ] ; public ItemStack armorInventory [ ] ; public int currentItem ; public EntityPlayer player ; private ItemStack itemStack ; public boolean inventoryChanged ; public InventoryPlayer ( EntityPlayer par1EntityPlayer ) { mainInventory = new ItemStack [ <NUM_LIT> ] ; armorInventory = new ItemStack [ <NUM_LIT:4> ] ; currentItem = <NUM_LIT:0> ; inventoryChanged = false ; player = par1EntityPlayer ; } public ItemStack getCurrentItem ( ) { if ( currentItem < <NUM_LIT:9> && currentItem >= <NUM_LIT:0> ) { return mainInventory [ currentItem ] ; } else { return null ; } } public static int func_25054_e ( ) { return <NUM_LIT:9> ; } private int getInventorySlotContainItem ( int par1 ) { for ( int i = <NUM_LIT:0> ; i < mainInventory . length ; i ++ ) { if ( mainInventory [ i ] != null && mainInventory [ i ] . itemID == par1 ) { return i ; } } return - <NUM_LIT:1> ; } private int storeItemStack ( ItemStack par1ItemStack ) { for ( int i = <NUM_LIT:0> ; i < mainInventory . length ; i ++ ) { if ( mainInventory [ i ] != null && mainInventory [ i ] . itemID == par1ItemStack . itemID && mainInventory [ i ] . isStackable ( ) && mainInventory [ i ] . stackSize < mainInventory [ i ] . getMaxStackSize ( ) && mainInventory [ i ] . stackSize < getInventoryStackLimit ( ) && ( ! mainInventory [ i ] . getHasSubtypes ( ) || mainInventory [ i ] . getItemDamage ( ) == par1ItemStack . getItemDamage ( ) ) && ItemStack . func_46124_a ( mainInventory [ i ] , par1ItemStack ) ) { return i ; } } return - <NUM_LIT:1> ; } private int getFirstEmptyStack ( ) { for ( int i = <NUM_LIT:0> ; i < mainInventory . length ; i ++ ) { if ( mainInventory [ i ] == null ) { return i ; } } return - <NUM_LIT:1> ; } private int storePartialItemStack ( ItemStack par1ItemStack ) { int i = par1ItemStack . itemID ; int j = par1ItemStack . stackSize ; if ( par1ItemStack . getMaxStackSize ( ) == <NUM_LIT:1> ) { int k = getFirstEmptyStack ( ) ; if ( k < <NUM_LIT:0> ) { return j ; } if ( mainInventory [ k ] == null ) { mainInventory [ k ] = ItemStack . copyItemStack ( par1ItemStack ) ; } return <NUM_LIT:0> ; } int l = storeItemStack ( par1ItemStack ) ; if ( l < <NUM_LIT:0> ) { l = getFirstEmptyStack ( ) ; } if ( l < <NUM_LIT:0> ) { return j ; } if ( mainInventory [ l ] == null ) { mainInventory [ l ] = new ItemStack ( i , <NUM_LIT:0> , par1ItemStack . getItemDamage ( ) ) ; if ( par1ItemStack . hasTagCompound ( ) ) { mainInventory [ l ] . setTagCompound ( ( NBTTagCompound ) par1ItemStack . getTagCompound ( ) . copy ( ) ) ; } } int i1 = j ; if ( i1 > mainInventory [ l ] . getMaxStackSize ( ) - mainInventory [ l ] . stackSize ) { i1 = mainInventory [ l ] . getMaxStackSize ( ) - mainInventory [ l ] . stackSize ; } if ( i1 > getInventoryStackLimit ( ) - mainInventory [ l ] . stackSize ) { i1 = getInventoryStackLimit ( ) - mainInventory [ l ] . stackSize ; } if ( i1 == <NUM_LIT:0> ) { return j ; } else { j -= i1 ; mainInventory [ l ] . stackSize += i1 ; mainInventory [ l ] . animationsToGo = <NUM_LIT:5> ; return j ; } } public void decrementAnimations ( ) { for ( int i = <NUM_LIT:0> ; i < mainInventory . length ; i ++ ) { if ( mainInventory [ i ] != null ) { mainInventory [ i ] . updateAnimation ( player . worldObj , player , i , currentItem == i ) ; } } } public boolean consumeInventoryItem ( int par1 ) { int i = getInventorySlotContainItem ( par1 ) ; if ( i < <NUM_LIT:0> ) { return false ; } if ( -- mainInventory [ i ] . stackSize <= <NUM_LIT:0> ) { mainInventory [ i ] = null ; } return true ; } public boolean hasItem ( int par1 ) { int i = getInventorySlotContainItem ( par1 ) ; return i >= <NUM_LIT:0> ; } public boolean addItemStackToInventory ( ItemStack par1ItemStack ) { if ( ! par1ItemStack . isItemDamaged ( ) ) { int i ; do { i = par1ItemStack . stackSize ; par1ItemStack . stackSize = storePartialItemStack ( par1ItemStack ) ; } while ( par1ItemStack . stackSize > <NUM_LIT:0> && par1ItemStack . stackSize < i ) ; if ( par1ItemStack . stackSize == i && player . capabilities . isCreativeMode ) { par1ItemStack . stackSize = <NUM_LIT:0> ; return true ; } else { return par1ItemStack . stackSize < i ; } } int j = getFirstEmptyStack ( ) ; if ( j >= <NUM_LIT:0> ) { mainInventory [ j ] = ItemStack . copyItemStack ( par1ItemStack ) ; mainInventory [ j ] . animationsToGo = <NUM_LIT:5> ; par1ItemStack . stackSize = <NUM_LIT:0> ; return true ; } if ( player . capabilities . isCreativeMode ) { par1ItemStack . stackSize = <NUM_LIT:0> ; return true ; } else { return false ; } } public ItemStack decrStackSize ( int par1 , int par2 ) { ItemStack aitemstack [ ] = mainInventory ; if ( par1 >= mainInventory . length ) { aitemstack = armorInventory ; par1 -= mainInventory . length ; } if ( aitemstack [ par1 ] != null ) { if ( aitemstack [ par1 ] . stackSize <= par2 ) { ItemStack itemstack = aitemstack [ par1 ] ; aitemstack [ par1 ] = null ; return itemstack ; } ItemStack itemstack1 = aitemstack [ par1 ] . splitStack ( par2 ) ; if ( aitemstack [ par1 ] . stackSize == <NUM_LIT:0> ) { aitemstack [ par1 ] = null ; } return itemstack1 ; } else { return null ; } } public ItemStack getStackInSlotOnClosing ( int par1 ) { ItemStack aitemstack [ ] = mainInventory ; if ( par1 >= mainInventory . length ) { aitemstack = armorInventory ; par1 -= mainInventory . length ; } if ( aitemstack [ par1 ] != null ) { ItemStack itemstack = aitemstack [ par1 ] ; aitemstack [ par1 ] = null ; return itemstack ; } else { return null ; } } public void setInventorySlotContents ( int par1 , ItemStack par2ItemStack ) { ItemStack aitemstack [ ] = mainInventory ; if ( par1 >= aitemstack . length ) { par1 -= aitemstack . length ; aitemstack = armorInventory ; } aitemstack [ par1 ] = par2ItemStack ; } public float getStrVsBlock ( Block par1Block ) { float f = <NUM_LIT> ; if ( mainInventory [ currentItem ] != null ) { f *= mainInventory [ currentItem ] . getStrVsBlock ( par1Block ) ; } return f ; } public NBTTagList writeToNBT ( NBTTagList par1NBTTagList ) { for ( int i = <NUM_LIT:0> ; i < mainInventory . length ; i ++ ) { if ( mainInventory [ i ] != null ) { NBTTagCompound nbttagcompound = new NBTTagCompound ( ) ; nbttagcompound . setByte ( "<STR_LIT>" , ( byte ) i ) ; mainInventory [ i ] . writeToNBT ( nbttagcompound ) ; par1NBTTagList . appendTag ( nbttagcompound ) ; } } for ( int j = <NUM_LIT:0> ; j < armorInventory . length ; j ++ ) { if ( armorInventory [ j ] != null ) { NBTTagCompound nbttagcompound1 = new NBTTagCompound ( ) ; nbttagcompound1 . setByte ( "<STR_LIT>" , ( byte ) ( j + <NUM_LIT:100> ) ) ; armorInventory [ j ] . writeToNBT ( nbttagcompound1 ) ; par1NBTTagList . appendTag ( nbttagcompound1 ) ; } } return par1NBTTagList ; } public void readFromNBT ( NBTTagList par1NBTTagList ) { mainInventory = new ItemStack [ <NUM_LIT> ] ; armorInventory = new ItemStack [ <NUM_LIT:4> ] ; for ( int i = <NUM_LIT:0> ; i < par1NBTTagList . tagCount ( ) ; i ++ ) { NBTTagCompound nbttagcompound = ( NBTTagCompound ) par1NBTTagList . tagAt ( i ) ; int j = nbttagcompound . getByte ( "<STR_LIT>" ) & <NUM_LIT> ; ItemStack itemstack = ItemStack . loadItemStackFromNBT ( nbttagcompound ) ; if ( itemstack == null ) { continue ; } if ( j >= <NUM_LIT:0> && j < mainInventory . length ) { mainInventory [ j ] = itemstack ; } if ( j >= <NUM_LIT:100> && j < armorInventory . length + <NUM_LIT:100> ) { armorInventory [ j - <NUM_LIT:100> ] = itemstack ; } } } public int getSizeInventory ( ) { return mainInventory . length + <NUM_LIT:4> ; } public ItemStack getStackInSlot ( int par1 ) { ItemStack aitemstack [ ] = mainInventory ; if ( par1 >= aitemstack . length ) { par1 -= aitemstack . length ; aitemstack = armorInventory ; } return aitemstack [ par1 ] ; } public String getInvName ( ) { return "<STR_LIT>" ; } public int getInventoryStackLimit ( ) { return <NUM_LIT> ; } public int getDamageVsEntity ( Entity par1Entity ) { ItemStack itemstack = getStackInSlot ( currentItem ) ; if ( itemstack != null ) { return itemstack . getDamageVsEntity ( par1Entity ) ; } else { return <NUM_LIT:1> ; } } public boolean canHarvestBlock ( Block par1Block ) { if ( par1Block . blockMaterial . isHarvestable ( ) ) { return true ; } ItemStack itemstack = getStackInSlot ( currentItem ) ; if ( itemstack != null ) { return itemstack . canHarvestBlock ( par1Block ) ; } else { return false ; } } public int getTotalArmorValue ( ) { int i = <NUM_LIT:0> ; for ( int j = <NUM_LIT:0> ; j < armorInventory . length ; j ++ ) { if ( armorInventory [ j ] != null && ( armorInventory [ j ] . getItem ( ) instanceof ItemArmor ) ) { int k = ( ( ItemArmor ) armorInventory [ j ] . getItem ( ) ) . damageReduceAmount ; i += k ; } } return i ; } public void damageArmor ( int par1 ) { par1 /= <NUM_LIT:4> ; if ( par1 < <NUM_LIT:1> ) { par1 = <NUM_LIT:1> ; } for ( int i = <NUM_LIT:0> ; i < armorInventory . length ; i ++ ) { if ( armorInventory [ i ] == null || ! ( armorInventory [ i ] . getItem ( ) instanceof ItemArmor ) ) { continue ; } armorInventory [ i ] . damageItem ( par1 , player ) ; if ( armorInventory [ i ] . stackSize == <NUM_LIT:0> ) { armorInventory [ i ] . onItemDestroyedByUse ( player ) ; armorInventory [ i ] = null ; } } } public void dropAllItems ( ) { for ( int i = <NUM_LIT:0> ; i < mainInventory . length ; i ++ ) { if ( mainInventory [ i ] != null ) { player . dropPlayerItemWithRandomChoice ( mainInventory [ i ] , true ) ; mainInventory [ i ] = null ; } } for ( int j = <NUM_LIT:0> ; j < armorInventory . length ; j ++ ) { if ( armorInventory [ j ] != null ) { player . dropPlayerItemWithRandomChoice ( armorInventory [ j ] , true ) ; armorInventory [ j ] = null ; } } } public void onInventoryChanged ( ) { inventoryChanged = true ; } public void setItemStack ( ItemStack par1ItemStack ) { itemStack = par1ItemStack ; player . onItemStackChanged ( par1ItemStack ) ; } public ItemStack getItemStack ( ) { return itemStack ; } public boolean isUseableByPlayer ( EntityPlayer par1EntityPlayer ) { if ( player . isDead ) { return false ; } return par1EntityPlayer . getDistanceSqToEntity ( player ) <= <NUM_LIT> ; } public boolean hasItemStack ( ItemStack par1ItemStack ) { for ( int i = <NUM_LIT:0> ; i < armorInventory . length ; i ++ ) { if ( armorInventory [ i ] != null && armorInventory [ i ] . isStackEqual ( par1ItemStack ) ) { return true ; } } for ( int j = <NUM_LIT:0> ; j < mainInventory . length ; j ++ ) { if ( mainInventory [ j ] != null && mainInventory [ j ] . isStackEqual ( par1ItemStack ) ) { return true ; } } return false ; } public void openChest ( ) { } public void closeChest ( ) { } public void copyInventory ( InventoryPlayer par1InventoryPlayer ) { for ( int i = <NUM_LIT:0> ; i < mainInventory . length ; i ++ ) { mainInventory [ i ] = ItemStack . copyItemStack ( par1InventoryPlayer . mainInventory [ i ] ) ; } for ( int j = <NUM_LIT:0> ; j < armorInventory . length ; j ++ ) { armorInventory [ j ] = ItemStack . copyItemStack ( par1InventoryPlayer . armorInventory [ j ] ) ; } } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class EntitySlime extends EntityLiving implements IMob { public float field_40122_a ; public float field_401_a ; public float field_400_b ; private int slimeJumpDelay ; public EntitySlime ( World par1World ) { super ( par1World ) ; slimeJumpDelay = <NUM_LIT:0> ; texture = "<STR_LIT>" ; int i = <NUM_LIT:1> << rand . nextInt ( <NUM_LIT:3> ) ; yOffset = <NUM_LIT> ; slimeJumpDelay = rand . nextInt ( <NUM_LIT:20> ) + <NUM_LIT:10> ; setSlimeSize ( i ) ; } protected void entityInit ( ) { super . entityInit ( ) ; dataWatcher . addObject ( <NUM_LIT:16> , new Byte ( ( byte ) <NUM_LIT:1> ) ) ; } public void setSlimeSize ( int par1 ) { dataWatcher . updateObject ( <NUM_LIT:16> , new Byte ( ( byte ) par1 ) ) ; setSize ( <NUM_LIT> * ( float ) par1 , <NUM_LIT> * ( float ) par1 ) ; setPosition ( posX , posY , posZ ) ; setEntityHealth ( getMaxHealth ( ) ) ; experienceValue = par1 ; } public int getMaxHealth ( ) { int i = getSlimeSize ( ) ; return i * i ; } public int getSlimeSize ( ) { return dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setInteger ( "<STR_LIT>" , getSlimeSize ( ) - <NUM_LIT:1> ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; setSlimeSize ( par1NBTTagCompound . getInteger ( "<STR_LIT>" ) + <NUM_LIT:1> ) ; } protected String getSlimeParticle ( ) { return "<STR_LIT>" ; } protected String func_40118_E ( ) { return "<STR_LIT>" ; } public void onUpdate ( ) { if ( ! worldObj . isRemote && worldObj . difficultySetting == <NUM_LIT:0> && getSlimeSize ( ) > <NUM_LIT:0> ) { isDead = true ; } field_401_a = field_401_a + ( field_40122_a - field_401_a ) * <NUM_LIT> ; field_400_b = field_401_a ; boolean flag = onGround ; super . onUpdate ( ) ; if ( onGround && ! flag ) { int i = getSlimeSize ( ) ; for ( int j = <NUM_LIT:0> ; j < i * <NUM_LIT:8> ; j ++ ) { float f = rand . nextFloat ( ) * ( float ) Math . PI * <NUM_LIT> ; float f1 = rand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ; float f2 = MathHelper . sin ( f ) * ( float ) i * <NUM_LIT> * f1 ; float f3 = MathHelper . cos ( f ) * ( float ) i * <NUM_LIT> * f1 ; worldObj . spawnParticle ( getSlimeParticle ( ) , posX + ( double ) f2 , boundingBox . minY , posZ + ( double ) f3 , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } if ( func_40121_G ( ) ) { worldObj . playSoundAtEntity ( this , func_40118_E ( ) , getSoundVolume ( ) , ( ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> + <NUM_LIT> ) / <NUM_LIT> ) ; } field_40122_a = - <NUM_LIT> ; } func_40116_B ( ) ; } protected void updateEntityActionState ( ) { despawnEntity ( ) ; EntityPlayer entityplayer = worldObj . getClosestVulnerablePlayerToEntity ( this , <NUM_LIT> ) ; if ( entityplayer != null ) { faceEntity ( entityplayer , <NUM_LIT> , <NUM_LIT> ) ; } if ( onGround && slimeJumpDelay -- <= <NUM_LIT:0> ) { slimeJumpDelay = func_40115_A ( ) ; if ( entityplayer != null ) { slimeJumpDelay /= <NUM_LIT:3> ; } isJumping = true ; if ( func_40117_I ( ) ) { worldObj . playSoundAtEntity ( this , func_40118_E ( ) , getSoundVolume ( ) , ( ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> + <NUM_LIT> ) * <NUM_LIT> ) ; } field_40122_a = <NUM_LIT> ; moveStrafing = <NUM_LIT> - rand . nextFloat ( ) * <NUM_LIT> ; moveForward = <NUM_LIT:1> * getSlimeSize ( ) ; } else { isJumping = false ; if ( onGround ) { moveStrafing = moveForward = <NUM_LIT> ; } } } protected void func_40116_B ( ) { field_40122_a = field_40122_a * <NUM_LIT> ; } protected int func_40115_A ( ) { return rand . nextInt ( <NUM_LIT:20> ) + <NUM_LIT:10> ; } protected EntitySlime createInstance ( ) { return new EntitySlime ( worldObj ) ; } public void setDead ( ) { int i = getSlimeSize ( ) ; if ( ! worldObj . isRemote && i > <NUM_LIT:1> && getHealth ( ) <= <NUM_LIT:0> ) { int j = <NUM_LIT:2> + rand . nextInt ( <NUM_LIT:3> ) ; for ( int k = <NUM_LIT:0> ; k < j ; k ++ ) { float f = ( ( ( float ) ( k % <NUM_LIT:2> ) - <NUM_LIT> ) * ( float ) i ) / <NUM_LIT> ; float f1 = ( ( ( float ) ( k / <NUM_LIT:2> ) - <NUM_LIT> ) * ( float ) i ) / <NUM_LIT> ; EntitySlime entityslime = createInstance ( ) ; entityslime . setSlimeSize ( i / <NUM_LIT:2> ) ; entityslime . setLocationAndAngles ( posX + ( double ) f , posY + <NUM_LIT> , posZ + ( double ) f1 , rand . nextFloat ( ) * <NUM_LIT> , <NUM_LIT> ) ; worldObj . spawnEntityInWorld ( entityslime ) ; } } super . setDead ( ) ; } public void onCollideWithPlayer ( EntityPlayer par1EntityPlayer ) { if ( func_40119_C ( ) ) { int i = getSlimeSize ( ) ; if ( canEntityBeSeen ( par1EntityPlayer ) && ( double ) getDistanceToEntity ( par1EntityPlayer ) < <NUM_LIT> * ( double ) i && par1EntityPlayer . attackEntityFrom ( DamageSource . causeMobDamage ( this ) , func_40113_D ( ) ) ) { worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> + <NUM_LIT> ) ; } } } protected boolean func_40119_C ( ) { return getSlimeSize ( ) > <NUM_LIT:1> ; } protected int func_40113_D ( ) { return getSlimeSize ( ) ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } protected int getDropItemId ( ) { if ( getSlimeSize ( ) == <NUM_LIT:1> ) { return Item . slimeBall . shiftedIndex ; } else { return <NUM_LIT:0> ; } } public boolean getCanSpawnHere ( ) { Chunk chunk = worldObj . getChunkFromBlockCoords ( MathHelper . floor_double ( posX ) , MathHelper . floor_double ( posZ ) ) ; if ( ( getSlimeSize ( ) == <NUM_LIT:1> || worldObj . difficultySetting > <NUM_LIT:0> ) && rand . nextInt ( <NUM_LIT:10> ) == <NUM_LIT:0> && chunk . getRandomWithSeed ( <NUM_LIT> ) . nextInt ( <NUM_LIT:10> ) == <NUM_LIT:0> && posY < <NUM_LIT> ) { return super . getCanSpawnHere ( ) ; } else { return false ; } } protected float getSoundVolume ( ) { return <NUM_LIT> * ( float ) getSlimeSize ( ) ; } public int getVerticalFaceSpeed ( ) { return <NUM_LIT:0> ; } protected boolean func_40117_I ( ) { return getSlimeSize ( ) > <NUM_LIT:1> ; } protected boolean func_40121_G ( ) { return getSlimeSize ( ) > <NUM_LIT:2> ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenSand extends WorldGenerator { private int sandID ; private int radius ; public WorldGenSand ( int par1 , int par2 ) { sandID = par2 ; radius = par1 ; } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { if ( par1World . getBlockMaterial ( par3 , par4 , par5 ) != Material . water ) { return false ; } int i = par2Random . nextInt ( radius - <NUM_LIT:2> ) + <NUM_LIT:2> ; byte byte0 = <NUM_LIT:2> ; for ( int j = par3 - i ; j <= par3 + i ; j ++ ) { for ( int k = par5 - i ; k <= par5 + i ; k ++ ) { int l = j - par3 ; int i1 = k - par5 ; if ( l * l + i1 * i1 > i * i ) { continue ; } for ( int j1 = par4 - byte0 ; j1 <= par4 + byte0 ; j1 ++ ) { int k1 = par1World . getBlockId ( j , j1 , k ) ; if ( k1 == Block . dirt . blockID || k1 == Block . grass . blockID ) { par1World . setBlock ( j , j1 , k , sandID ) ; } } } } return true ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentStrongholdStraight extends ComponentStronghold { private final EnumDoor doorType ; private final boolean expandsX ; private final boolean expandsZ ; public ComponentStrongholdStraight ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; doorType = getRandomDoor ( par2Random ) ; boundingBox = par3StructureBoundingBox ; expandsX = par2Random . nextInt ( <NUM_LIT:2> ) == <NUM_LIT:0> ; expandsZ = par2Random . nextInt ( <NUM_LIT:2> ) == <NUM_LIT:0> ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { getNextComponentNormal ( ( ComponentStrongholdStairs2 ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:1> ) ; if ( expandsX ) { getNextComponentX ( ( ComponentStrongholdStairs2 ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:2> ) ; } if ( expandsZ ) { getNextComponentZ ( ( ComponentStrongholdStairs2 ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:2> ) ; } } public static ComponentStrongholdStraight findValidPlacement ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:1> , - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:5> , <NUM_LIT:7> , par5 ) ; if ( ! canStrongholdGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentStrongholdStraight ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { if ( isLiquidInStructureBoundingBox ( par1World , par3StructureBoundingBox ) ) { return false ; } fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:6> , true , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; placeDoor ( par1World , par2Random , par3StructureBoundingBox , doorType , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> ) ; placeDoor ( par1World , par2Random , par3StructureBoundingBox , EnumDoor . OPENING , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:6> ) ; randomlyPlaceBlock ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:1> , Block . torchWood . blockID , <NUM_LIT:0> ) ; randomlyPlaceBlock ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT> , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:1> , Block . torchWood . blockID , <NUM_LIT:0> ) ; randomlyPlaceBlock ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:5> , Block . torchWood . blockID , <NUM_LIT:0> ) ; randomlyPlaceBlock ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT> , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:5> , Block . torchWood . blockID , <NUM_LIT:0> ) ; if ( expandsX ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; } if ( expandsZ ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; } return true ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockFarmland extends Block { protected BlockFarmland ( int par1 ) { super ( par1 , Material . ground ) ; blockIndexInTexture = <NUM_LIT> ; setTickRandomly ( true ) ; setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; setLightOpacity ( <NUM_LIT:255> ) ; } public AxisAlignedBB getCollisionBoundingBoxFromPool ( World par1World , int par2 , int par3 , int par4 ) { return AxisAlignedBB . getBoundingBoxFromPool ( par2 + <NUM_LIT:0> , par3 + <NUM_LIT:0> , par4 + <NUM_LIT:0> , par2 + <NUM_LIT:1> , par3 + <NUM_LIT:1> , par4 + <NUM_LIT:1> ) ; } public boolean isOpaqueCube ( ) { return false ; } public boolean renderAsNormalBlock ( ) { return false ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par1 == <NUM_LIT:1> && par2 > <NUM_LIT:0> ) { return blockIndexInTexture - <NUM_LIT:1> ; } if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture ; } else { return <NUM_LIT:2> ; } } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { if ( isWaterNearby ( par1World , par2 , par3 , par4 ) || par1World . canLightningStrikeAt ( par2 , par3 + <NUM_LIT:1> , par4 ) ) { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , <NUM_LIT:7> ) ; } else { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( i > <NUM_LIT:0> ) { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i - <NUM_LIT:1> ) ; } else if ( ! isCropsNearby ( par1World , par2 , par3 , par4 ) ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , Block . dirt . blockID ) ; } } } public void onFallenUpon ( World par1World , int par2 , int par3 , int par4 , Entity par5Entity , float par6 ) { if ( par1World . rand . nextFloat ( ) < par6 - <NUM_LIT> ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , Block . dirt . blockID ) ; } } private boolean isCropsNearby ( World par1World , int par2 , int par3 , int par4 ) { int i = <NUM_LIT:0> ; for ( int j = par2 - i ; j <= par2 + i ; j ++ ) { for ( int k = par4 - i ; k <= par4 + i ; k ++ ) { int l = par1World . getBlockId ( j , par3 + <NUM_LIT:1> , k ) ; if ( l == Block . crops . blockID || l == Block . melonStem . blockID || l == Block . pumpkinStem . blockID ) { return true ; } } } return false ; } private boolean isWaterNearby ( World par1World , int par2 , int par3 , int par4 ) { for ( int i = par2 - <NUM_LIT:4> ; i <= par2 + <NUM_LIT:4> ; i ++ ) { for ( int j = par3 ; j <= par3 + <NUM_LIT:1> ; j ++ ) { for ( int k = par4 - <NUM_LIT:4> ; k <= par4 + <NUM_LIT:4> ; k ++ ) { if ( par1World . getBlockMaterial ( i , j , k ) == Material . water ) { return true ; } } } } return false ; } public void onNeighborBlockChange ( World par1World , int par2 , int par3 , int par4 , int par5 ) { super . onNeighborBlockChange ( par1World , par2 , par3 , par4 , par5 ) ; Material material = par1World . getBlockMaterial ( par2 , par3 + <NUM_LIT:1> , par4 ) ; if ( material . isSolid ( ) ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , Block . dirt . blockID ) ; } } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Block . dirt . idDropped ( <NUM_LIT:0> , par2Random , par3 ) ; } } </s>
<s> package net . minecraft . src ; public class StructureVillagePieceWeight { public Class villagePieceClass ; public final int villagePieceWeight ; public int villagePiecesSpawned ; public int villagePiecesLimit ; public StructureVillagePieceWeight ( Class par1Class , int par2 , int par3 ) { villagePieceClass = par1Class ; villagePieceWeight = par2 ; villagePiecesLimit = par3 ; } public boolean canSpawnMoreVillagePiecesOfType ( int par1 ) { return villagePiecesLimit == <NUM_LIT:0> || villagePiecesSpawned < villagePiecesLimit ; } public boolean canSpawnMoreVillagePieces ( ) { return villagePiecesLimit == <NUM_LIT:0> || villagePiecesSpawned < villagePiecesLimit ; } } </s>
<s> package net . minecraft . src ; import java . util . * ; class StructureStrongholdStart extends StructureStart { public StructureStrongholdStart ( World par1World , Random par2Random , int par3 , int par4 ) { StructureStrongholdPieces . prepareStructurePieces ( ) ; ComponentStrongholdStairs2 componentstrongholdstairs2 = new ComponentStrongholdStairs2 ( <NUM_LIT:0> , par2Random , ( par3 << <NUM_LIT:4> ) + <NUM_LIT:2> , ( par4 << <NUM_LIT:4> ) + <NUM_LIT:2> ) ; components . add ( componentstrongholdstairs2 ) ; componentstrongholdstairs2 . buildComponent ( componentstrongholdstairs2 , components , par2Random ) ; StructureComponent structurecomponent ; for ( ArrayList arraylist = componentstrongholdstairs2 . field_35328_b ; ! arraylist . isEmpty ( ) ; structurecomponent . buildComponent ( componentstrongholdstairs2 , components , par2Random ) ) { int i = par2Random . nextInt ( arraylist . size ( ) ) ; structurecomponent = ( StructureComponent ) arraylist . remove ( i ) ; } updateBoundingBox ( ) ; markAvailableHeight ( par1World , par2Random , <NUM_LIT:10> ) ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenGlowStone2 extends WorldGenerator { public WorldGenGlowStone2 ( ) { } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { if ( ! par1World . isAirBlock ( par3 , par4 , par5 ) ) { return false ; } if ( par1World . getBlockId ( par3 , par4 + <NUM_LIT:1> , par5 ) != Block . netherrack . blockID ) { return false ; } par1World . setBlockWithNotify ( par3 , par4 , par5 , Block . glowStone . blockID ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { int j = ( par3 + par2Random . nextInt ( <NUM_LIT:8> ) ) - par2Random . nextInt ( <NUM_LIT:8> ) ; int k = par4 - par2Random . nextInt ( <NUM_LIT:12> ) ; int l = ( par5 + par2Random . nextInt ( <NUM_LIT:8> ) ) - par2Random . nextInt ( <NUM_LIT:8> ) ; if ( par1World . getBlockId ( j , k , l ) != <NUM_LIT:0> ) { continue ; } int i1 = <NUM_LIT:0> ; for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:6> ; j1 ++ ) { int k1 = <NUM_LIT:0> ; if ( j1 == <NUM_LIT:0> ) { k1 = par1World . getBlockId ( j - <NUM_LIT:1> , k , l ) ; } if ( j1 == <NUM_LIT:1> ) { k1 = par1World . getBlockId ( j + <NUM_LIT:1> , k , l ) ; } if ( j1 == <NUM_LIT:2> ) { k1 = par1World . getBlockId ( j , k - <NUM_LIT:1> , l ) ; } if ( j1 == <NUM_LIT:3> ) { k1 = par1World . getBlockId ( j , k + <NUM_LIT:1> , l ) ; } if ( j1 == <NUM_LIT:4> ) { k1 = par1World . getBlockId ( j , k , l - <NUM_LIT:1> ) ; } if ( j1 == <NUM_LIT:5> ) { k1 = par1World . getBlockId ( j , k , l + <NUM_LIT:1> ) ; } if ( k1 == Block . glowStone . blockID ) { i1 ++ ; } } if ( i1 == <NUM_LIT:1> ) { par1World . setBlockWithNotify ( j , k , l , Block . glowStone . blockID ) ; } } return true ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class BiomeGenTaiga extends BiomeGenBase { public BiomeGenTaiga ( int par1 ) { super ( par1 ) ; spawnableCreatureList . add ( new SpawnListEntry ( net . minecraft . src . EntityWolf . class , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:4> ) ) ; biomeDecorator . treesPerChunk = <NUM_LIT:10> ; biomeDecorator . grassPerChunk = <NUM_LIT:1> ; } public WorldGenerator getRandomWorldGenForTrees ( Random par1Random ) { if ( par1Random . nextInt ( <NUM_LIT:3> ) == <NUM_LIT:0> ) { return new WorldGenTaiga1 ( ) ; } else { return new WorldGenTaiga2 ( false ) ; } } } </s>
<s> package net . minecraft . src ; public class BlockWorkbench extends Block { protected BlockWorkbench ( int par1 ) { super ( par1 , Material . wood ) ; blockIndexInTexture = <NUM_LIT> ; } public int getBlockTextureFromSide ( int par1 ) { if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture - <NUM_LIT:16> ; } if ( par1 == <NUM_LIT:0> ) { return Block . planks . getBlockTextureFromSide ( <NUM_LIT:0> ) ; } if ( par1 == <NUM_LIT:2> || par1 == <NUM_LIT:4> ) { return blockIndexInTexture + <NUM_LIT:1> ; } else { return blockIndexInTexture ; } } public boolean blockActivated ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { if ( par1World . isRemote ) { return true ; } else { par5EntityPlayer . displayWorkbenchGUI ( par2 , par3 , par4 ) ; return true ; } } } </s>
<s> package net . minecraft . src ; class NetworkReaderThread extends Thread { final NetworkManager netManager ; NetworkReaderThread ( NetworkManager par1NetworkManager , String par2Str ) { super ( par2Str ) ; netManager = par1NetworkManager ; } public void run ( ) { synchronized ( NetworkManager . threadSyncObject ) { NetworkManager . numReadThreads ++ ; } try { while ( NetworkManager . isRunning ( netManager ) && ! NetworkManager . isServerTerminating ( netManager ) ) { while ( NetworkManager . readNetworkPacket ( netManager ) ) ; try { sleep ( <NUM_LIT> ) ; } catch ( InterruptedException interruptedexception ) { } } } finally { synchronized ( NetworkManager . threadSyncObject ) { NetworkManager . numReadThreads -- ; } } } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class BlockSapling extends BlockFlower { protected BlockSapling ( int par1 , int par2 ) { super ( par1 , par2 ) ; float f = <NUM_LIT> ; setBlockBounds ( <NUM_LIT> - f , <NUM_LIT> , <NUM_LIT> - f , <NUM_LIT> + f , f * <NUM_LIT> , <NUM_LIT> + f ) ; } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { if ( par1World . isRemote ) { return ; } super . updateTick ( par1World , par2 , par3 , par4 , par5Random ) ; if ( par1World . getBlockLightValue ( par2 , par3 + <NUM_LIT:1> , par4 ) >= <NUM_LIT:9> && par5Random . nextInt ( <NUM_LIT:7> ) == <NUM_LIT:0> ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( ( i & <NUM_LIT:8> ) == <NUM_LIT:0> ) { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i | <NUM_LIT:8> ) ; } else { growTree ( par1World , par2 , par3 , par4 , par5Random ) ; } } } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { par2 &= <NUM_LIT:3> ; if ( par2 == <NUM_LIT:1> ) { return <NUM_LIT> ; } if ( par2 == <NUM_LIT:2> ) { return <NUM_LIT> ; } if ( par2 == <NUM_LIT:3> ) { return <NUM_LIT:30> ; } else { return super . getBlockTextureFromSideAndMetadata ( par1 , par2 ) ; } } public void growTree ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) & <NUM_LIT:3> ; Object obj = null ; int j = <NUM_LIT:0> ; int k = <NUM_LIT:0> ; boolean flag = false ; if ( i == <NUM_LIT:1> ) { obj = new WorldGenTaiga2 ( true ) ; } else if ( i == <NUM_LIT:2> ) { obj = new WorldGenForest ( true ) ; } else if ( i == <NUM_LIT:3> ) { j = <NUM_LIT:0> ; do { if ( j < - <NUM_LIT:1> ) { break ; } k = <NUM_LIT:0> ; do { if ( k < - <NUM_LIT:1> ) { break ; } if ( func_50010_f ( par1World , par2 + j , par3 , par4 + k , <NUM_LIT:3> ) && func_50010_f ( par1World , par2 + j + <NUM_LIT:1> , par3 , par4 + k , <NUM_LIT:3> ) && func_50010_f ( par1World , par2 + j , par3 , par4 + k + <NUM_LIT:1> , <NUM_LIT:3> ) && func_50010_f ( par1World , par2 + j + <NUM_LIT:1> , par3 , par4 + k + <NUM_LIT:1> , <NUM_LIT:3> ) ) { obj = new WorldGenHugeTrees ( true , <NUM_LIT:10> + par5Random . nextInt ( <NUM_LIT:20> ) , <NUM_LIT:3> , <NUM_LIT:3> ) ; flag = true ; break ; } k -- ; } while ( true ) ; if ( obj != null ) { break ; } j -- ; } while ( true ) ; if ( obj == null ) { j = k = <NUM_LIT:0> ; obj = new WorldGenTrees ( true , <NUM_LIT:4> + par5Random . nextInt ( <NUM_LIT:7> ) , <NUM_LIT:3> , <NUM_LIT:3> , false ) ; } } else { obj = new WorldGenTrees ( true ) ; if ( par5Random . nextInt ( <NUM_LIT:10> ) == <NUM_LIT:0> ) { obj = new WorldGenBigTree ( true ) ; } } if ( flag ) { par1World . setBlock ( par2 + j , par3 , par4 + k , <NUM_LIT:0> ) ; par1World . setBlock ( par2 + j + <NUM_LIT:1> , par3 , par4 + k , <NUM_LIT:0> ) ; par1World . setBlock ( par2 + j , par3 , par4 + k + <NUM_LIT:1> , <NUM_LIT:0> ) ; par1World . setBlock ( par2 + j + <NUM_LIT:1> , par3 , par4 + k + <NUM_LIT:1> , <NUM_LIT:0> ) ; } else { par1World . setBlock ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } if ( ! ( ( WorldGenerator ) ( obj ) ) . generate ( par1World , par5Random , par2 + j , par3 , par4 + k ) ) { if ( flag ) { par1World . setBlockAndMetadata ( par2 + j , par3 , par4 + k , blockID , i ) ; par1World . setBlockAndMetadata ( par2 + j + <NUM_LIT:1> , par3 , par4 + k , blockID , i ) ; par1World . setBlockAndMetadata ( par2 + j , par3 , par4 + k + <NUM_LIT:1> , blockID , i ) ; par1World . setBlockAndMetadata ( par2 + j + <NUM_LIT:1> , par3 , par4 + k + <NUM_LIT:1> , blockID , i ) ; } else { par1World . setBlockAndMetadata ( par2 , par3 , par4 , blockID , i ) ; } } } public boolean func_50010_f ( World par1World , int par2 , int par3 , int par4 , int par5 ) { return par1World . getBlockId ( par2 , par3 , par4 ) == blockID && ( par1World . getBlockMetadata ( par2 , par3 , par4 ) & <NUM_LIT:3> ) == par5 ; } protected int damageDropped ( int par1 ) { return par1 & <NUM_LIT:3> ; } } </s>
<s> package net . minecraft . src ; import net . minecraft . server . MinecraftServer ; public class ThreadServerSleep extends Thread { final MinecraftServer mc ; public ThreadServerSleep ( MinecraftServer par1MinecraftServer ) { mc = par1MinecraftServer ; setDaemon ( true ) ; start ( ) ; } public void run ( ) { do { try { Thread . sleep ( <NUM_LIT> ) ; } catch ( InterruptedException interruptedexception ) { } } while ( true ) ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class BiomeGenForest extends BiomeGenBase { public BiomeGenForest ( int par1 ) { super ( par1 ) ; spawnableCreatureList . add ( new SpawnListEntry ( net . minecraft . src . EntityWolf . class , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:4> ) ) ; biomeDecorator . treesPerChunk = <NUM_LIT:10> ; biomeDecorator . grassPerChunk = <NUM_LIT:2> ; } public WorldGenerator getRandomWorldGenForTrees ( Random par1Random ) { if ( par1Random . nextInt ( <NUM_LIT:5> ) == <NUM_LIT:0> ) { return worldGenForest ; } if ( par1Random . nextInt ( <NUM_LIT:10> ) == <NUM_LIT:0> ) { return worldGenBigTree ; } else { return worldGenTrees ; } } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class EntityAIBeg extends EntityAIBase { private EntityWolf theWolf ; private EntityPlayer field_48145_b ; private World field_48146_c ; private float field_48143_d ; private int field_48144_e ; public EntityAIBeg ( EntityWolf par1EntityWolf , float par2 ) { theWolf = par1EntityWolf ; field_48146_c = par1EntityWolf . worldObj ; field_48143_d = par2 ; setMutexBits ( <NUM_LIT:2> ) ; } public boolean shouldExecute ( ) { field_48145_b = field_48146_c . getClosestPlayerToEntity ( theWolf , field_48143_d ) ; if ( field_48145_b == null ) { return false ; } else { return func_48142_a ( field_48145_b ) ; } } public boolean continueExecuting ( ) { if ( ! field_48145_b . isEntityAlive ( ) ) { return false ; } if ( theWolf . getDistanceSqToEntity ( field_48145_b ) > ( double ) ( field_48143_d * field_48143_d ) ) { return false ; } else { return field_48144_e > <NUM_LIT:0> && func_48142_a ( field_48145_b ) ; } } public void startExecuting ( ) { theWolf . func_48378_e ( true ) ; field_48144_e = <NUM_LIT> + theWolf . getRNG ( ) . nextInt ( <NUM_LIT> ) ; } public void resetTask ( ) { theWolf . func_48378_e ( false ) ; field_48145_b = null ; } public void updateTask ( ) { theWolf . getLookHelper ( ) . setLookPosition ( field_48145_b . posX , field_48145_b . posY + ( double ) field_48145_b . getEyeHeight ( ) , field_48145_b . posZ , <NUM_LIT> , theWolf . getVerticalFaceSpeed ( ) ) ; field_48144_e -- ; } private boolean func_48142_a ( EntityPlayer par1EntityPlayer ) { ItemStack itemstack = par1EntityPlayer . inventory . getCurrentItem ( ) ; if ( itemstack == null ) { return false ; } if ( ! theWolf . isTamed ( ) && itemstack . itemID == Item . bone . shiftedIndex ) { return true ; } else { return theWolf . isWheat ( itemstack ) ; } } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet28EntityVelocity extends Packet { public int entityId ; public int motionX ; public int motionY ; public int motionZ ; public Packet28EntityVelocity ( ) { } public Packet28EntityVelocity ( Entity par1Entity ) { this ( par1Entity . entityId , par1Entity . motionX , par1Entity . motionY , par1Entity . motionZ ) ; } public Packet28EntityVelocity ( int par1 , double par2 , double par4 , double par6 ) { entityId = par1 ; double d = <NUM_LIT> ; if ( par2 < - d ) { par2 = - d ; } if ( par4 < - d ) { par4 = - d ; } if ( par6 < - d ) { par6 = - d ; } if ( par2 > d ) { par2 = d ; } if ( par4 > d ) { par4 = d ; } if ( par6 > d ) { par6 = d ; } motionX = ( int ) ( par2 * <NUM_LIT> ) ; motionY = ( int ) ( par4 * <NUM_LIT> ) ; motionZ = ( int ) ( par6 * <NUM_LIT> ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityId = par1DataInputStream . readInt ( ) ; motionX = par1DataInputStream . readShort ( ) ; motionY = par1DataInputStream . readShort ( ) ; motionZ = par1DataInputStream . readShort ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityId ) ; par1DataOutputStream . writeShort ( motionX ) ; par1DataOutputStream . writeShort ( motionY ) ; par1DataOutputStream . writeShort ( motionZ ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleEntityVelocity ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:10> ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class EntityFishHook extends Entity { private int xTile ; private int yTile ; private int zTile ; private int inTile ; private boolean inGround ; public int shake ; public EntityPlayer angler ; private int ticksInGround ; private int ticksInAir ; private int ticksCatchable ; public Entity bobber ; private int fishPosRotationIncrements ; private double fishX ; private double fishY ; private double fishZ ; private double fishYaw ; private double fishPitch ; public EntityFishHook ( World par1World ) { super ( par1World ) ; xTile = - <NUM_LIT:1> ; yTile = - <NUM_LIT:1> ; zTile = - <NUM_LIT:1> ; inTile = <NUM_LIT:0> ; inGround = false ; shake = <NUM_LIT:0> ; ticksInAir = <NUM_LIT:0> ; ticksCatchable = <NUM_LIT:0> ; bobber = null ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; ignoreFrustumCheck = true ; } public EntityFishHook ( World par1World , EntityPlayer par2EntityPlayer ) { super ( par1World ) ; xTile = - <NUM_LIT:1> ; yTile = - <NUM_LIT:1> ; zTile = - <NUM_LIT:1> ; inTile = <NUM_LIT:0> ; inGround = false ; shake = <NUM_LIT:0> ; ticksInAir = <NUM_LIT:0> ; ticksCatchable = <NUM_LIT:0> ; bobber = null ; ignoreFrustumCheck = true ; angler = par2EntityPlayer ; angler . fishEntity = this ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; setLocationAndAngles ( par2EntityPlayer . posX , ( par2EntityPlayer . posY + <NUM_LIT> ) - ( double ) par2EntityPlayer . yOffset , par2EntityPlayer . posZ , par2EntityPlayer . rotationYaw , par2EntityPlayer . rotationPitch ) ; posX -= MathHelper . cos ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * <NUM_LIT> ; posY -= <NUM_LIT> ; posZ -= MathHelper . sin ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * <NUM_LIT> ; setPosition ( posX , posY , posZ ) ; yOffset = <NUM_LIT> ; float f = <NUM_LIT> ; motionX = - MathHelper . sin ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * MathHelper . cos ( ( rotationPitch / <NUM_LIT> ) * ( float ) Math . PI ) * f ; motionZ = MathHelper . cos ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * MathHelper . cos ( ( rotationPitch / <NUM_LIT> ) * ( float ) Math . PI ) * f ; motionY = - MathHelper . sin ( ( rotationPitch / <NUM_LIT> ) * ( float ) Math . PI ) * f ; calculateVelocity ( motionX , motionY , motionZ , <NUM_LIT> , <NUM_LIT> ) ; } protected void entityInit ( ) { } public void calculateVelocity ( double par1 , double par3 , double par5 , float par7 , float par8 ) { float f = MathHelper . sqrt_double ( par1 * par1 + par3 * par3 + par5 * par5 ) ; par1 /= f ; par3 /= f ; par5 /= f ; par1 += rand . nextGaussian ( ) * <NUM_LIT> * ( double ) par8 ; par3 += rand . nextGaussian ( ) * <NUM_LIT> * ( double ) par8 ; par5 += rand . nextGaussian ( ) * <NUM_LIT> * ( double ) par8 ; par1 *= par7 ; par3 *= par7 ; par5 *= par7 ; motionX = par1 ; motionY = par3 ; motionZ = par5 ; float f1 = MathHelper . sqrt_double ( par1 * par1 + par5 * par5 ) ; prevRotationYaw = rotationYaw = ( float ) ( ( Math . atan2 ( par1 , par5 ) * <NUM_LIT> ) / Math . PI ) ; prevRotationPitch = rotationPitch = ( float ) ( ( Math . atan2 ( par3 , f1 ) * <NUM_LIT> ) / Math . PI ) ; ticksInGround = <NUM_LIT:0> ; } public void onUpdate ( ) { super . onUpdate ( ) ; if ( fishPosRotationIncrements > <NUM_LIT:0> ) { double d = posX + ( fishX - posX ) / ( double ) fishPosRotationIncrements ; double d1 = posY + ( fishY - posY ) / ( double ) fishPosRotationIncrements ; double d2 = posZ + ( fishZ - posZ ) / ( double ) fishPosRotationIncrements ; double d4 ; for ( d4 = fishYaw - ( double ) rotationYaw ; d4 < - <NUM_LIT> ; d4 += <NUM_LIT> ) { } for ( ; d4 >= <NUM_LIT> ; d4 -= <NUM_LIT> ) { } rotationYaw += d4 / ( double ) fishPosRotationIncrements ; rotationPitch += ( fishPitch - ( double ) rotationPitch ) / ( double ) fishPosRotationIncrements ; fishPosRotationIncrements -- ; setPosition ( d , d1 , d2 ) ; setRotation ( rotationYaw , rotationPitch ) ; return ; } if ( ! worldObj . isRemote ) { ItemStack itemstack = angler . getCurrentEquippedItem ( ) ; if ( angler . isDead || ! angler . isEntityAlive ( ) || itemstack == null || itemstack . getItem ( ) != Item . fishingRod || getDistanceSqToEntity ( angler ) > <NUM_LIT> ) { setDead ( ) ; angler . fishEntity = null ; return ; } if ( bobber != null ) { if ( bobber . isDead ) { bobber = null ; } else { posX = bobber . posX ; posY = bobber . boundingBox . minY + ( double ) bobber . height * <NUM_LIT> ; posZ = bobber . posZ ; return ; } } } if ( shake > <NUM_LIT:0> ) { shake -- ; } if ( inGround ) { int i = worldObj . getBlockId ( xTile , yTile , zTile ) ; if ( i != inTile ) { inGround = false ; motionX *= rand . nextFloat ( ) * <NUM_LIT> ; motionY *= rand . nextFloat ( ) * <NUM_LIT> ; motionZ *= rand . nextFloat ( ) * <NUM_LIT> ; ticksInGround = <NUM_LIT:0> ; ticksInAir = <NUM_LIT:0> ; } else { ticksInGround ++ ; if ( ticksInGround == <NUM_LIT> ) { setDead ( ) ; } return ; } } else { ticksInAir ++ ; } Vec3D vec3d = Vec3D . createVector ( posX , posY , posZ ) ; Vec3D vec3d1 = Vec3D . createVector ( posX + motionX , posY + motionY , posZ + motionZ ) ; MovingObjectPosition movingobjectposition = worldObj . rayTraceBlocks ( vec3d , vec3d1 ) ; vec3d = Vec3D . createVector ( posX , posY , posZ ) ; vec3d1 = Vec3D . createVector ( posX + motionX , posY + motionY , posZ + motionZ ) ; if ( movingobjectposition != null ) { vec3d1 = Vec3D . createVector ( movingobjectposition . hitVec . xCoord , movingobjectposition . hitVec . yCoord , movingobjectposition . hitVec . zCoord ) ; } Entity entity = null ; List list = worldObj . getEntitiesWithinAABBExcludingEntity ( this , boundingBox . addCoord ( motionX , motionY , motionZ ) . expand ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) ; double d3 = <NUM_LIT> ; for ( int j = <NUM_LIT:0> ; j < list . size ( ) ; j ++ ) { Entity entity1 = ( Entity ) list . get ( j ) ; if ( ! entity1 . canBeCollidedWith ( ) || entity1 == angler && ticksInAir < <NUM_LIT:5> ) { continue ; } float f2 = <NUM_LIT> ; AxisAlignedBB axisalignedbb = entity1 . boundingBox . expand ( f2 , f2 , f2 ) ; MovingObjectPosition movingobjectposition1 = axisalignedbb . calculateIntercept ( vec3d , vec3d1 ) ; if ( movingobjectposition1 == null ) { continue ; } double d6 = vec3d . distanceTo ( movingobjectposition1 . hitVec ) ; if ( d6 < d3 || d3 == <NUM_LIT> ) { entity = entity1 ; d3 = d6 ; } } if ( entity != null ) { movingobjectposition = new MovingObjectPosition ( entity ) ; } if ( movingobjectposition != null ) { if ( movingobjectposition . entityHit != null ) { if ( movingobjectposition . entityHit . attackEntityFrom ( DamageSource . causeThrownDamage ( this , angler ) , <NUM_LIT:0> ) ) { bobber = movingobjectposition . entityHit ; } } else { inGround = true ; } } if ( inGround ) { return ; } moveEntity ( motionX , motionY , motionZ ) ; float f = MathHelper . sqrt_double ( motionX * motionX + motionZ * motionZ ) ; rotationYaw = ( float ) ( ( Math . atan2 ( motionX , motionZ ) * <NUM_LIT> ) / Math . PI ) ; for ( rotationPitch = ( float ) ( ( Math . atan2 ( motionY , f ) * <NUM_LIT> ) / Math . PI ) ; rotationPitch - prevRotationPitch < - <NUM_LIT> ; prevRotationPitch -= <NUM_LIT> ) { } for ( ; rotationPitch - prevRotationPitch >= <NUM_LIT> ; prevRotationPitch += <NUM_LIT> ) { } for ( ; rotationYaw - prevRotationYaw < - <NUM_LIT> ; prevRotationYaw -= <NUM_LIT> ) { } for ( ; rotationYaw - prevRotationYaw >= <NUM_LIT> ; prevRotationYaw += <NUM_LIT> ) { } rotationPitch = prevRotationPitch + ( rotationPitch - prevRotationPitch ) * <NUM_LIT> ; rotationYaw = prevRotationYaw + ( rotationYaw - prevRotationYaw ) * <NUM_LIT> ; float f1 = <NUM_LIT> ; if ( onGround || isCollidedHorizontally ) { f1 = <NUM_LIT> ; } int k = <NUM_LIT:5> ; double d5 = <NUM_LIT> ; for ( int l = <NUM_LIT:0> ; l < k ; l ++ ) { double d8 = ( ( boundingBox . minY + ( ( boundingBox . maxY - boundingBox . minY ) * ( double ) ( l + <NUM_LIT:0> ) ) / ( double ) k ) - <NUM_LIT> ) + <NUM_LIT> ; double d9 = ( ( boundingBox . minY + ( ( boundingBox . maxY - boundingBox . minY ) * ( double ) ( l + <NUM_LIT:1> ) ) / ( double ) k ) - <NUM_LIT> ) + <NUM_LIT> ; AxisAlignedBB axisalignedbb1 = AxisAlignedBB . getBoundingBoxFromPool ( boundingBox . minX , d8 , boundingBox . minZ , boundingBox . maxX , d9 , boundingBox . maxZ ) ; if ( worldObj . isAABBInMaterial ( axisalignedbb1 , Material . water ) ) { d5 += <NUM_LIT> / ( double ) k ; } } if ( d5 > <NUM_LIT> ) { if ( ticksCatchable > <NUM_LIT:0> ) { ticksCatchable -- ; } else { char c = <NUM_LIT> ; if ( worldObj . canLightningStrikeAt ( MathHelper . floor_double ( posX ) , MathHelper . floor_double ( posY ) + <NUM_LIT:1> , MathHelper . floor_double ( posZ ) ) ) { c = <NUM_LIT> ; } if ( rand . nextInt ( c ) == <NUM_LIT:0> ) { ticksCatchable = rand . nextInt ( <NUM_LIT:30> ) + <NUM_LIT:10> ; motionY -= <NUM_LIT> ; worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> + ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> ) ; float f3 = MathHelper . floor_double ( boundingBox . minY ) ; for ( int i1 = <NUM_LIT:0> ; ( float ) i1 < <NUM_LIT> + width * <NUM_LIT> ; i1 ++ ) { float f4 = ( rand . nextFloat ( ) * <NUM_LIT> - <NUM_LIT> ) * width ; float f6 = ( rand . nextFloat ( ) * <NUM_LIT> - <NUM_LIT> ) * width ; worldObj . spawnParticle ( "<STR_LIT>" , posX + ( double ) f4 , f3 + <NUM_LIT> , posZ + ( double ) f6 , motionX , motionY - ( double ) ( rand . nextFloat ( ) * <NUM_LIT> ) , motionZ ) ; } for ( int j1 = <NUM_LIT:0> ; ( float ) j1 < <NUM_LIT> + width * <NUM_LIT> ; j1 ++ ) { float f5 = ( rand . nextFloat ( ) * <NUM_LIT> - <NUM_LIT> ) * width ; float f7 = ( rand . nextFloat ( ) * <NUM_LIT> - <NUM_LIT> ) * width ; worldObj . spawnParticle ( "<STR_LIT>" , posX + ( double ) f5 , f3 + <NUM_LIT> , posZ + ( double ) f7 , motionX , motionY , motionZ ) ; } } } } if ( ticksCatchable > <NUM_LIT:0> ) { motionY -= ( double ) ( rand . nextFloat ( ) * rand . nextFloat ( ) * rand . nextFloat ( ) ) * <NUM_LIT> ; } double d7 = d5 * <NUM_LIT> - <NUM_LIT> ; motionY += <NUM_LIT> * d7 ; if ( d5 > <NUM_LIT> ) { f1 = ( float ) ( ( double ) f1 * <NUM_LIT> ) ; motionY *= <NUM_LIT> ; } motionX *= f1 ; motionY *= f1 ; motionZ *= f1 ; setPosition ( posX , posY , posZ ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) xTile ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) yTile ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) zTile ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) inTile ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) shake ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) ( inGround ? <NUM_LIT:1> : <NUM_LIT:0> ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { xTile = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; yTile = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; zTile = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; inTile = par1NBTTagCompound . getByte ( "<STR_LIT>" ) & <NUM_LIT> ; shake = par1NBTTagCompound . getByte ( "<STR_LIT>" ) & <NUM_LIT> ; inGround = par1NBTTagCompound . getByte ( "<STR_LIT>" ) == <NUM_LIT:1> ; } public int catchFish ( ) { byte byte0 = <NUM_LIT:0> ; if ( bobber != null ) { double d = angler . posX - posX ; double d2 = angler . posY - posY ; double d4 = angler . posZ - posZ ; double d6 = MathHelper . sqrt_double ( d * d + d2 * d2 + d4 * d4 ) ; double d8 = <NUM_LIT> ; bobber . motionX += d * d8 ; bobber . motionY += d2 * d8 + ( double ) MathHelper . sqrt_double ( d6 ) * <NUM_LIT> ; bobber . motionZ += d4 * d8 ; byte0 = <NUM_LIT:3> ; } else if ( ticksCatchable > <NUM_LIT:0> ) { EntityItem entityitem = new EntityItem ( worldObj , posX , posY , posZ , new ItemStack ( Item . fishRaw ) ) ; double d1 = angler . posX - posX ; double d3 = angler . posY - posY ; double d5 = angler . posZ - posZ ; double d7 = MathHelper . sqrt_double ( d1 * d1 + d3 * d3 + d5 * d5 ) ; double d9 = <NUM_LIT> ; entityitem . motionX = d1 * d9 ; entityitem . motionY = d3 * d9 + ( double ) MathHelper . sqrt_double ( d7 ) * <NUM_LIT> ; entityitem . motionZ = d5 * d9 ; worldObj . spawnEntityInWorld ( entityitem ) ; angler . addStat ( StatList . fishCaughtStat , <NUM_LIT:1> ) ; byte0 = <NUM_LIT:1> ; } if ( inGround ) { byte0 = <NUM_LIT:2> ; } setDead ( ) ; angler . fishEntity = null ; return byte0 ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenSpikes extends WorldGenerator { private int replaceID ; public WorldGenSpikes ( int par1 ) { replaceID = par1 ; } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { if ( ! par1World . isAirBlock ( par3 , par4 , par5 ) || par1World . getBlockId ( par3 , par4 - <NUM_LIT:1> , par5 ) != replaceID ) { return false ; } int i = par2Random . nextInt ( <NUM_LIT:32> ) + <NUM_LIT:6> ; int j = par2Random . nextInt ( <NUM_LIT:4> ) + <NUM_LIT:1> ; for ( int k = par3 - j ; k <= par3 + j ; k ++ ) { for ( int i1 = par5 - j ; i1 <= par5 + j ; i1 ++ ) { int k1 = k - par3 ; int i2 = i1 - par5 ; if ( k1 * k1 + i2 * i2 <= j * j + <NUM_LIT:1> && par1World . getBlockId ( k , par4 - <NUM_LIT:1> , i1 ) != replaceID ) { return false ; } } } for ( int l = par4 ; l < par4 + i && l < <NUM_LIT> ; l ++ ) { for ( int j1 = par3 - j ; j1 <= par3 + j ; j1 ++ ) { for ( int l1 = par5 - j ; l1 <= par5 + j ; l1 ++ ) { int j2 = j1 - par3 ; int k2 = l1 - par5 ; if ( j2 * j2 + k2 * k2 <= j * j + <NUM_LIT:1> ) { par1World . setBlockWithNotify ( j1 , l , l1 , Block . obsidian . blockID ) ; } } } } EntityEnderCrystal entityendercrystal = new EntityEnderCrystal ( par1World ) ; entityendercrystal . setLocationAndAngles ( ( float ) par3 + <NUM_LIT> , par4 + i , ( float ) par5 + <NUM_LIT> , par2Random . nextFloat ( ) * <NUM_LIT> , <NUM_LIT> ) ; par1World . spawnEntityInWorld ( entityendercrystal ) ; par1World . setBlockWithNotify ( par3 , par4 + i , par5 , Block . bedrock . blockID ) ; return true ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class EntityEnderEye extends Entity { public int field_40062_a ; private double field_40060_b ; private double field_40061_c ; private double field_40058_d ; private int despawnTimer ; private boolean shatterOrDrop ; public EntityEnderEye ( World par1World ) { super ( par1World ) ; field_40062_a = <NUM_LIT:0> ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; } protected void entityInit ( ) { } public EntityEnderEye ( World par1World , double par2 , double par4 , double par6 ) { super ( par1World ) ; field_40062_a = <NUM_LIT:0> ; despawnTimer = <NUM_LIT:0> ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; setPosition ( par2 , par4 , par6 ) ; yOffset = <NUM_LIT> ; } public void func_40056_a ( double par1 , int par3 , double par4 ) { double d = par1 - posX ; double d1 = par4 - posZ ; float f = MathHelper . sqrt_double ( d * d + d1 * d1 ) ; if ( f > <NUM_LIT> ) { field_40060_b = posX + ( d / ( double ) f ) * <NUM_LIT> ; field_40058_d = posZ + ( d1 / ( double ) f ) * <NUM_LIT> ; field_40061_c = posY + <NUM_LIT> ; } else { field_40060_b = par1 ; field_40061_c = par3 ; field_40058_d = par4 ; } despawnTimer = <NUM_LIT:0> ; shatterOrDrop = rand . nextInt ( <NUM_LIT:5> ) > <NUM_LIT:0> ; } public void onUpdate ( ) { lastTickPosX = posX ; lastTickPosY = posY ; lastTickPosZ = posZ ; super . onUpdate ( ) ; posX += motionX ; posY += motionY ; posZ += motionZ ; float f = MathHelper . sqrt_double ( motionX * motionX + motionZ * motionZ ) ; rotationYaw = ( float ) ( ( Math . atan2 ( motionX , motionZ ) * <NUM_LIT> ) / Math . PI ) ; for ( rotationPitch = ( float ) ( ( Math . atan2 ( motionY , f ) * <NUM_LIT> ) / Math . PI ) ; rotationPitch - prevRotationPitch < - <NUM_LIT> ; prevRotationPitch -= <NUM_LIT> ) { } for ( ; rotationPitch - prevRotationPitch >= <NUM_LIT> ; prevRotationPitch += <NUM_LIT> ) { } for ( ; rotationYaw - prevRotationYaw < - <NUM_LIT> ; prevRotationYaw -= <NUM_LIT> ) { } for ( ; rotationYaw - prevRotationYaw >= <NUM_LIT> ; prevRotationYaw += <NUM_LIT> ) { } rotationPitch = prevRotationPitch + ( rotationPitch - prevRotationPitch ) * <NUM_LIT> ; rotationYaw = prevRotationYaw + ( rotationYaw - prevRotationYaw ) * <NUM_LIT> ; if ( ! worldObj . isRemote ) { double d = field_40060_b - posX ; double d1 = field_40058_d - posZ ; float f2 = ( float ) Math . sqrt ( d * d + d1 * d1 ) ; float f3 = ( float ) Math . atan2 ( d1 , d ) ; double d2 = ( double ) f + ( double ) ( f2 - f ) * <NUM_LIT> ; if ( f2 < <NUM_LIT> ) { d2 *= <NUM_LIT> ; motionY *= <NUM_LIT> ; } motionX = Math . cos ( f3 ) * d2 ; motionZ = Math . sin ( f3 ) * d2 ; if ( posY < field_40061_c ) { motionY = motionY + ( <NUM_LIT> - motionY ) * <NUM_LIT> ; } else { motionY = motionY + ( - <NUM_LIT> - motionY ) * <NUM_LIT> ; } } float f1 = <NUM_LIT> ; if ( isInWater ( ) ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:4> ; i ++ ) { worldObj . spawnParticle ( "<STR_LIT>" , posX - motionX * ( double ) f1 , posY - motionY * ( double ) f1 , posZ - motionZ * ( double ) f1 , motionX , motionY , motionZ ) ; } } else { worldObj . spawnParticle ( "<STR_LIT>" , ( ( posX - motionX * ( double ) f1 ) + rand . nextDouble ( ) * <NUM_LIT> ) - <NUM_LIT> , posY - motionY * ( double ) f1 - <NUM_LIT> , ( ( posZ - motionZ * ( double ) f1 ) + rand . nextDouble ( ) * <NUM_LIT> ) - <NUM_LIT> , motionX , motionY , motionZ ) ; } if ( ! worldObj . isRemote ) { setPosition ( posX , posY , posZ ) ; despawnTimer ++ ; if ( despawnTimer > <NUM_LIT> && ! worldObj . isRemote ) { setDead ( ) ; if ( shatterOrDrop ) { worldObj . spawnEntityInWorld ( new EntityItem ( worldObj , posX , posY , posZ , new ItemStack ( Item . eyeOfEnder ) ) ) ; } else { worldObj . playAuxSFX ( <NUM_LIT> , ( int ) Math . round ( posX ) , ( int ) Math . round ( posY ) , ( int ) Math . round ( posZ ) , <NUM_LIT:0> ) ; } } } } public void writeEntityToNBT ( NBTTagCompound nbttagcompound ) { } public void readEntityFromNBT ( NBTTagCompound nbttagcompound ) { } public void onCollideWithPlayer ( EntityPlayer entityplayer ) { } public float getBrightness ( float par1 ) { return <NUM_LIT> ; } public boolean canAttackWithItem ( ) { return false ; } } </s>
<s> package net . minecraft . src ; public class ChunkPosition { public final int x ; public final int y ; public final int z ; public ChunkPosition ( int par1 , int par2 , int par3 ) { x = par1 ; y = par2 ; z = par3 ; } public ChunkPosition ( Vec3D par1Vec3D ) { this ( MathHelper . floor_double ( par1Vec3D . xCoord ) , MathHelper . floor_double ( par1Vec3D . yCoord ) , MathHelper . floor_double ( par1Vec3D . zCoord ) ) ; } public boolean equals ( Object par1Obj ) { if ( par1Obj instanceof ChunkPosition ) { ChunkPosition chunkposition = ( ChunkPosition ) par1Obj ; return chunkposition . x == x && chunkposition . y == y && chunkposition . z == z ; } else { return false ; } } public int hashCode ( ) { return x * <NUM_LIT> + y * <NUM_LIT> + z ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenTaiga1 extends WorldGenerator { public WorldGenTaiga1 ( ) { } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { int i = par2Random . nextInt ( <NUM_LIT:5> ) + <NUM_LIT:7> ; int j = i - par2Random . nextInt ( <NUM_LIT:2> ) - <NUM_LIT:3> ; int k = i - j ; int l = <NUM_LIT:1> + par2Random . nextInt ( k + <NUM_LIT:1> ) ; boolean flag = true ; if ( par4 < <NUM_LIT:1> || par4 + i + <NUM_LIT:1> > <NUM_LIT> ) { return false ; } for ( int i1 = par4 ; i1 <= par4 + <NUM_LIT:1> + i && flag ; i1 ++ ) { int k1 = <NUM_LIT:1> ; if ( i1 - par4 < j ) { k1 = <NUM_LIT:0> ; } else { k1 = l ; } for ( int i2 = par3 - k1 ; i2 <= par3 + k1 && flag ; i2 ++ ) { for ( int l2 = par5 - k1 ; l2 <= par5 + k1 && flag ; l2 ++ ) { if ( i1 >= <NUM_LIT:0> && i1 < <NUM_LIT> ) { int k3 = par1World . getBlockId ( i2 , i1 , l2 ) ; if ( k3 != <NUM_LIT:0> && k3 != Block . leaves . blockID ) { flag = false ; } } else { flag = false ; } } } } if ( ! flag ) { return false ; } int j1 = par1World . getBlockId ( par3 , par4 - <NUM_LIT:1> , par5 ) ; if ( j1 != Block . grass . blockID && j1 != Block . dirt . blockID || par4 >= <NUM_LIT> - i - <NUM_LIT:1> ) { return false ; } func_50023_a ( par1World , par3 , par4 - <NUM_LIT:1> , par5 , Block . dirt . blockID ) ; int l1 = <NUM_LIT:0> ; for ( int j2 = par4 + i ; j2 >= par4 + j ; j2 -- ) { for ( int i3 = par3 - l1 ; i3 <= par3 + l1 ; i3 ++ ) { int l3 = i3 - par3 ; for ( int i4 = par5 - l1 ; i4 <= par5 + l1 ; i4 ++ ) { int j4 = i4 - par5 ; if ( ( Math . abs ( l3 ) != l1 || Math . abs ( j4 ) != l1 || l1 <= <NUM_LIT:0> ) && ! Block . opaqueCubeLookup [ par1World . getBlockId ( i3 , j2 , i4 ) ] ) { setBlockAndMetadata ( par1World , i3 , j2 , i4 , Block . leaves . blockID , <NUM_LIT:1> ) ; } } } if ( l1 >= <NUM_LIT:1> && j2 == par4 + j + <NUM_LIT:1> ) { l1 -- ; continue ; } if ( l1 < l ) { l1 ++ ; } } for ( int k2 = <NUM_LIT:0> ; k2 < i - <NUM_LIT:1> ; k2 ++ ) { int j3 = par1World . getBlockId ( par3 , par4 + k2 , par5 ) ; if ( j3 == <NUM_LIT:0> || j3 == Block . leaves . blockID ) { setBlockAndMetadata ( par1World , par3 , par4 + k2 , par5 , Block . wood . blockID , <NUM_LIT:1> ) ; } } return true ; } } </s>
<s> package net . minecraft . src ; public enum EnumCreatureAttribute { UNDEFINED , UNDEAD , ARTHROPOD ; } </s>
<s> package net . minecraft . src ; import java . util . * ; public class EntityAIFollowGolem extends EntityAIBase { private EntityVillager theVillager ; private EntityIronGolem theGolem ; private int field_48215_c ; private boolean field_48213_d ; public EntityAIFollowGolem ( EntityVillager par1EntityVillager ) { field_48213_d = false ; theVillager = par1EntityVillager ; setMutexBits ( <NUM_LIT:3> ) ; } public boolean shouldExecute ( ) { if ( theVillager . getGrowingAge ( ) >= <NUM_LIT:0> ) { return false ; } if ( ! theVillager . worldObj . isDaytime ( ) ) { return false ; } List list = theVillager . worldObj . getEntitiesWithinAABB ( net . minecraft . src . EntityIronGolem . class , theVillager . boundingBox . expand ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) ; if ( list . size ( ) == <NUM_LIT:0> ) { return false ; } Iterator iterator = list . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } Entity entity = ( Entity ) iterator . next ( ) ; EntityIronGolem entityirongolem = ( EntityIronGolem ) entity ; if ( entityirongolem . func_48382_m_ ( ) <= <NUM_LIT:0> ) { continue ; } theGolem = entityirongolem ; break ; } while ( true ) ; return theGolem != null ; } public boolean continueExecuting ( ) { return theGolem . func_48382_m_ ( ) > <NUM_LIT:0> ; } public void startExecuting ( ) { field_48215_c = theVillager . getRNG ( ) . nextInt ( <NUM_LIT> ) ; field_48213_d = false ; theGolem . getNavigator ( ) . clearPathEntity ( ) ; } public void resetTask ( ) { theGolem = null ; theVillager . getNavigator ( ) . clearPathEntity ( ) ; } public void updateTask ( ) { theVillager . getLookHelper ( ) . setLookPositionWithEntity ( theGolem , <NUM_LIT> , <NUM_LIT> ) ; if ( theGolem . func_48382_m_ ( ) == field_48215_c ) { theVillager . getNavigator ( ) . func_48652_a ( theGolem , <NUM_LIT> ) ; field_48213_d = true ; } if ( field_48213_d && theVillager . getDistanceSqToEntity ( theGolem ) < <NUM_LIT> ) { theGolem . func_48383_a ( false ) ; theVillager . getNavigator ( ) . clearPathEntity ( ) ; } } } </s>
<s> package net . minecraft . src ; public class ShapedRecipes implements IRecipe { private int recipeWidth ; private int recipeHeight ; private ItemStack recipeItems [ ] ; private ItemStack recipeOutput ; public final int recipeOutputItemID ; public ShapedRecipes ( int par1 , int par2 , ItemStack par3ArrayOfItemStack [ ] , ItemStack par4ItemStack ) { recipeOutputItemID = par4ItemStack . itemID ; recipeWidth = par1 ; recipeHeight = par2 ; recipeItems = par3ArrayOfItemStack ; recipeOutput = par4ItemStack ; } public ItemStack getRecipeOutput ( ) { return recipeOutput ; } public boolean matches ( InventoryCrafting par1InventoryCrafting ) { for ( int i = <NUM_LIT:0> ; i <= <NUM_LIT:3> - recipeWidth ; i ++ ) { for ( int j = <NUM_LIT:0> ; j <= <NUM_LIT:3> - recipeHeight ; j ++ ) { if ( checkMatch ( par1InventoryCrafting , i , j , true ) ) { return true ; } if ( checkMatch ( par1InventoryCrafting , i , j , false ) ) { return true ; } } } return false ; } private boolean checkMatch ( InventoryCrafting par1InventoryCrafting , int par2 , int par3 , boolean par4 ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:3> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:3> ; j ++ ) { int k = i - par2 ; int l = j - par3 ; ItemStack itemstack = null ; if ( k >= <NUM_LIT:0> && l >= <NUM_LIT:0> && k < recipeWidth && l < recipeHeight ) { if ( par4 ) { itemstack = recipeItems [ ( recipeWidth - k - <NUM_LIT:1> ) + l * recipeWidth ] ; } else { itemstack = recipeItems [ k + l * recipeWidth ] ; } } ItemStack itemstack1 = par1InventoryCrafting . getStackInRowAndColumn ( i , j ) ; if ( itemstack1 == null && itemstack == null ) { continue ; } if ( itemstack1 == null && itemstack != null || itemstack1 != null && itemstack == null ) { return false ; } if ( itemstack . itemID != itemstack1 . itemID ) { return false ; } if ( itemstack . getItemDamage ( ) != - <NUM_LIT:1> && itemstack . getItemDamage ( ) != itemstack1 . getItemDamage ( ) ) { return false ; } } } return true ; } public ItemStack getCraftingResult ( InventoryCrafting par1InventoryCrafting ) { return new ItemStack ( recipeOutput . itemID , recipeOutput . stackSize , recipeOutput . getItemDamage ( ) ) ; } public int getRecipeSize ( ) { return recipeWidth * recipeHeight ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet201PlayerInfo extends Packet { public String playerName ; public boolean isConnected ; public int ping ; public Packet201PlayerInfo ( ) { } public Packet201PlayerInfo ( String par1Str , boolean par2 , int par3 ) { playerName = par1Str ; isConnected = par2 ; ping = par3 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { playerName = readString ( par1DataInputStream , <NUM_LIT:16> ) ; isConnected = par1DataInputStream . readByte ( ) != <NUM_LIT:0> ; ping = par1DataInputStream . readShort ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { writeString ( playerName , par1DataOutputStream ) ; par1DataOutputStream . writeByte ( isConnected ? <NUM_LIT:1> : <NUM_LIT:0> ) ; par1DataOutputStream . writeShort ( ping ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handlePlayerInfo ( this ) ; } public int getPacketSize ( ) { return playerName . length ( ) + <NUM_LIT:2> + <NUM_LIT:1> + <NUM_LIT:2> ; } } </s>
<s> package net . minecraft . src ; public class GenLayerSmooth extends GenLayer { public GenLayerSmooth ( long par1 , GenLayer par3GenLayer ) { super ( par1 ) ; super . parent = par3GenLayer ; } public int [ ] getInts ( int par1 , int par2 , int par3 , int par4 ) { int i = par1 - <NUM_LIT:1> ; int j = par2 - <NUM_LIT:1> ; int k = par3 + <NUM_LIT:2> ; int l = par4 + <NUM_LIT:2> ; int ai [ ] = parent . getInts ( i , j , k , l ) ; int ai1 [ ] = IntCache . getIntCache ( par3 * par4 ) ; for ( int i1 = <NUM_LIT:0> ; i1 < par4 ; i1 ++ ) { for ( int j1 = <NUM_LIT:0> ; j1 < par3 ; j1 ++ ) { int k1 = ai [ j1 + <NUM_LIT:0> + ( i1 + <NUM_LIT:1> ) * k ] ; int l1 = ai [ j1 + <NUM_LIT:2> + ( i1 + <NUM_LIT:1> ) * k ] ; int i2 = ai [ j1 + <NUM_LIT:1> + ( i1 + <NUM_LIT:0> ) * k ] ; int j2 = ai [ j1 + <NUM_LIT:1> + ( i1 + <NUM_LIT:2> ) * k ] ; int k2 = ai [ j1 + <NUM_LIT:1> + ( i1 + <NUM_LIT:1> ) * k ] ; if ( k1 == l1 && i2 == j2 ) { initChunkSeed ( j1 + par1 , i1 + par2 ) ; if ( nextInt ( <NUM_LIT:2> ) == <NUM_LIT:0> ) { k2 = k1 ; } else { k2 = i2 ; } } else { if ( k1 == l1 ) { k2 = k1 ; } if ( i2 == j2 ) { k2 = i2 ; } } ai1 [ j1 + i1 * par3 ] = k2 ; } } return ai1 ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public abstract class EntityWaterMob extends EntityCreature implements IAnimals { public EntityWaterMob ( World par1World ) { super ( par1World ) ; } public boolean canBreatheUnderwater ( ) { return true ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; } public boolean getCanSpawnHere ( ) { return worldObj . checkIfAABBIsClear ( boundingBox ) ; } public int getTalkInterval ( ) { return <NUM_LIT> ; } protected boolean canDespawn ( ) { return true ; } protected int getExperiencePoints ( EntityPlayer par1EntityPlayer ) { return <NUM_LIT:1> + worldObj . rand . nextInt ( <NUM_LIT:3> ) ; } } </s>
<s> package net . minecraft . src ; public class BiomeGenPlains extends BiomeGenBase { protected BiomeGenPlains ( int par1 ) { super ( par1 ) ; biomeDecorator . treesPerChunk = - <NUM_LIT> ; biomeDecorator . flowersPerChunk = <NUM_LIT:4> ; biomeDecorator . grassPerChunk = <NUM_LIT:10> ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; public interface IChunkProvider { public abstract boolean chunkExists ( int i , int j ) ; public abstract Chunk provideChunk ( int i , int j ) ; public abstract Chunk loadChunk ( int i , int j ) ; public abstract void populate ( IChunkProvider ichunkprovider , int i , int j ) ; public abstract boolean saveChunks ( boolean flag , IProgressUpdate iprogressupdate ) ; public abstract boolean unload100OldestChunks ( ) ; public abstract boolean canSave ( ) ; public abstract List getPossibleCreatures ( EnumCreatureType enumcreaturetype , int i , int j , int k ) ; public abstract ChunkPosition findClosestStructure ( World world , String s , int i , int j , int k ) ; } </s>
<s> package net . minecraft . src ; import java . io . * ; import java . util . zip . GZIPInputStream ; import java . util . zip . GZIPOutputStream ; public class CompressedStreamTools { public CompressedStreamTools ( ) { } public static NBTTagCompound readCompressed ( InputStream par0InputStream ) throws IOException { DataInputStream datainputstream = new DataInputStream ( new BufferedInputStream ( new GZIPInputStream ( par0InputStream ) ) ) ; try { NBTTagCompound nbttagcompound = read ( datainputstream ) ; return nbttagcompound ; } finally { datainputstream . close ( ) ; } } public static void writeCompressed ( NBTTagCompound par0NBTTagCompound , OutputStream par1OutputStream ) throws IOException { DataOutputStream dataoutputstream = new DataOutputStream ( new GZIPOutputStream ( par1OutputStream ) ) ; try { write ( par0NBTTagCompound , dataoutputstream ) ; } finally { dataoutputstream . close ( ) ; } } public static NBTTagCompound decompress ( byte par0ArrayOfByte [ ] ) throws IOException { DataInputStream datainputstream = new DataInputStream ( new BufferedInputStream ( new GZIPInputStream ( new ByteArrayInputStream ( par0ArrayOfByte ) ) ) ) ; try { NBTTagCompound nbttagcompound = read ( datainputstream ) ; return nbttagcompound ; } finally { datainputstream . close ( ) ; } } public static byte [ ] compress ( NBTTagCompound par0NBTTagCompound ) throws IOException { ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream ( ) ; DataOutputStream dataoutputstream = new DataOutputStream ( new GZIPOutputStream ( bytearrayoutputstream ) ) ; try { write ( par0NBTTagCompound , dataoutputstream ) ; } finally { dataoutputstream . close ( ) ; } return bytearrayoutputstream . toByteArray ( ) ; } public static NBTTagCompound read ( DataInput par0DataInput ) throws IOException { NBTBase nbtbase = NBTBase . readNamedTag ( par0DataInput ) ; if ( nbtbase instanceof NBTTagCompound ) { return ( NBTTagCompound ) nbtbase ; } else { throw new IOException ( "<STR_LIT>" ) ; } } public static void write ( NBTTagCompound par0NBTTagCompound , DataOutput par1DataOutput ) throws IOException { NBTBase . writeNamedTag ( par0NBTTagCompound , par1DataOutput ) ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class EntityAIArrowAttack extends EntityAIBase { World worldObj ; EntityLiving entityHost ; EntityLiving attackTarget ; int rangedAttackTime ; float field_48180_e ; int field_48177_f ; int rangedAttackID ; int maxRangedAttackTime ; public EntityAIArrowAttack ( EntityLiving par1EntityLiving , float par2 , int par3 , int par4 ) { rangedAttackTime = <NUM_LIT:0> ; field_48177_f = <NUM_LIT:0> ; entityHost = par1EntityLiving ; worldObj = par1EntityLiving . worldObj ; field_48180_e = par2 ; rangedAttackID = par3 ; maxRangedAttackTime = par4 ; setMutexBits ( <NUM_LIT:3> ) ; } public boolean shouldExecute ( ) { EntityLiving entityliving = entityHost . getAttackTarget ( ) ; if ( entityliving == null ) { return false ; } else { attackTarget = entityliving ; return true ; } } public boolean continueExecuting ( ) { return shouldExecute ( ) || ! entityHost . getNavigator ( ) . noPath ( ) ; } public void resetTask ( ) { attackTarget = null ; } public void updateTask ( ) { double d = <NUM_LIT> ; double d1 = entityHost . getDistanceSq ( attackTarget . posX , attackTarget . boundingBox . minY , attackTarget . posZ ) ; boolean flag = entityHost . func_48318_al ( ) . canSee ( attackTarget ) ; if ( flag ) { field_48177_f ++ ; } else { field_48177_f = <NUM_LIT:0> ; } if ( d1 > d || field_48177_f < <NUM_LIT:20> ) { entityHost . getNavigator ( ) . func_48652_a ( attackTarget , field_48180_e ) ; } else { entityHost . getNavigator ( ) . clearPathEntity ( ) ; } entityHost . getLookHelper ( ) . setLookPositionWithEntity ( attackTarget , <NUM_LIT> , <NUM_LIT> ) ; rangedAttackTime = Math . max ( rangedAttackTime - <NUM_LIT:1> , <NUM_LIT:0> ) ; if ( rangedAttackTime > <NUM_LIT:0> ) { return ; } if ( d1 > d || ! flag ) { return ; } else { doRangedAttack ( ) ; rangedAttackTime = maxRangedAttackTime ; return ; } } private void doRangedAttack ( ) { if ( rangedAttackID == <NUM_LIT:1> ) { EntityArrow entityarrow = new EntityArrow ( worldObj , entityHost , attackTarget , <NUM_LIT> , <NUM_LIT> ) ; worldObj . playSoundAtEntity ( entityHost , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> / ( entityHost . getRNG ( ) . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ) ; worldObj . spawnEntityInWorld ( entityarrow ) ; } else if ( rangedAttackID == <NUM_LIT:2> ) { EntitySnowball entitysnowball = new EntitySnowball ( worldObj , entityHost ) ; double d = attackTarget . posX - entityHost . posX ; double d1 = ( attackTarget . posY + ( double ) attackTarget . getEyeHeight ( ) ) - <NUM_LIT> - entitysnowball . posY ; double d2 = attackTarget . posZ - entityHost . posZ ; float f = MathHelper . sqrt_double ( d * d + d2 * d2 ) * <NUM_LIT> ; entitysnowball . setThrowableHeading ( d , d1 + ( double ) f , d2 , <NUM_LIT> , <NUM_LIT> ) ; worldObj . playSoundAtEntity ( entityHost , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> / ( entityHost . getRNG ( ) . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ) ; worldObj . spawnEntityInWorld ( entitysnowball ) ; } } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet132TileEntityData extends Packet { public int xPosition ; public int yPosition ; public int zPosition ; public int actionType ; public int customParam1 ; public int customParam2 ; public int customParam3 ; public Packet132TileEntityData ( ) { isChunkDataPacket = true ; } public Packet132TileEntityData ( int par1 , int par2 , int par3 , int par4 , int par5 ) { isChunkDataPacket = true ; xPosition = par1 ; yPosition = par2 ; zPosition = par3 ; actionType = par4 ; customParam1 = par5 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { xPosition = par1DataInputStream . readInt ( ) ; yPosition = par1DataInputStream . readShort ( ) ; zPosition = par1DataInputStream . readInt ( ) ; actionType = par1DataInputStream . readByte ( ) ; customParam1 = par1DataInputStream . readInt ( ) ; customParam2 = par1DataInputStream . readInt ( ) ; customParam3 = par1DataInputStream . readInt ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( xPosition ) ; par1DataOutputStream . writeShort ( yPosition ) ; par1DataOutputStream . writeInt ( zPosition ) ; par1DataOutputStream . writeByte ( ( byte ) actionType ) ; par1DataOutputStream . writeInt ( customParam1 ) ; par1DataOutputStream . writeInt ( customParam2 ) ; par1DataOutputStream . writeInt ( customParam3 ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleTileEntityData ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT> ; } } </s>
<s> package net . minecraft . src ; import java . util . ArrayList ; import java . util . List ; import net . minecraft . server . MinecraftServer ; public class PlayerManager { public List players ; private LongHashMap playerInstances ; private List playerInstancesToUpdate ; private MinecraftServer mcServer ; private int playerDimension ; private int playerViewRadius ; private final int xzDirectionsConst [ ] [ ] = { { <NUM_LIT:1> , <NUM_LIT:0> } , { <NUM_LIT:0> , <NUM_LIT:1> } , { - <NUM_LIT:1> , <NUM_LIT:0> } , { <NUM_LIT:0> , - <NUM_LIT:1> } } ; public PlayerManager ( MinecraftServer par1MinecraftServer , int par2 , int par3 ) { players = new ArrayList ( ) ; playerInstances = new LongHashMap ( ) ; playerInstancesToUpdate = new ArrayList ( ) ; if ( par3 > <NUM_LIT:15> ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } if ( par3 < <NUM_LIT:3> ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } else { playerViewRadius = par3 ; mcServer = par1MinecraftServer ; playerDimension = par2 ; return ; } } public WorldServer getMinecraftServer ( ) { return mcServer . getWorldManager ( playerDimension ) ; } public void updatePlayerInstances ( ) { for ( int i = <NUM_LIT:0> ; i < playerInstancesToUpdate . size ( ) ; i ++ ) { ( ( PlayerInstance ) playerInstancesToUpdate . get ( i ) ) . onUpdate ( ) ; } playerInstancesToUpdate . clear ( ) ; if ( players . isEmpty ( ) ) { WorldServer worldserver = mcServer . getWorldManager ( playerDimension ) ; WorldProvider worldprovider = worldserver . worldProvider ; if ( ! worldprovider . canRespawnHere ( ) ) { worldserver . chunkProviderServer . unloadAllChunks ( ) ; } } } private PlayerInstance getPlayerInstance ( int par1 , int par2 , boolean par3 ) { long l = ( long ) par1 + <NUM_LIT> | ( long ) par2 + <NUM_LIT> << <NUM_LIT:32> ; PlayerInstance playerinstance = ( PlayerInstance ) playerInstances . getValueByKey ( l ) ; if ( playerinstance == null && par3 ) { playerinstance = new PlayerInstance ( this , par1 , par2 ) ; playerInstances . add ( l , playerinstance ) ; } return playerinstance ; } public void markBlockNeedsUpdate ( int par1 , int par2 , int par3 ) { int i = par1 > > <NUM_LIT:4> ; int j = par3 > > <NUM_LIT:4> ; PlayerInstance playerinstance = getPlayerInstance ( i , j , false ) ; if ( playerinstance != null ) { playerinstance . markBlockNeedsUpdate ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } } public void addPlayer ( EntityPlayerMP par1EntityPlayerMP ) { int i = ( int ) par1EntityPlayerMP . posX > > <NUM_LIT:4> ; int j = ( int ) par1EntityPlayerMP . posZ > > <NUM_LIT:4> ; par1EntityPlayerMP . managedPosX = par1EntityPlayerMP . posX ; par1EntityPlayerMP . managedPosZ = par1EntityPlayerMP . posZ ; int k = <NUM_LIT:0> ; int l = playerViewRadius ; int i1 = <NUM_LIT:0> ; int j1 = <NUM_LIT:0> ; getPlayerInstance ( i , j , true ) . addPlayer ( par1EntityPlayerMP ) ; for ( int k1 = <NUM_LIT:1> ; k1 <= l * <NUM_LIT:2> ; k1 ++ ) { for ( int i2 = <NUM_LIT:0> ; i2 < <NUM_LIT:2> ; i2 ++ ) { int ai [ ] = xzDirectionsConst [ k ++ % <NUM_LIT:4> ] ; for ( int j2 = <NUM_LIT:0> ; j2 < k1 ; j2 ++ ) { i1 += ai [ <NUM_LIT:0> ] ; j1 += ai [ <NUM_LIT:1> ] ; getPlayerInstance ( i + i1 , j + j1 , true ) . addPlayer ( par1EntityPlayerMP ) ; } } } k %= <NUM_LIT:4> ; for ( int l1 = <NUM_LIT:0> ; l1 < l * <NUM_LIT:2> ; l1 ++ ) { i1 += xzDirectionsConst [ k ] [ <NUM_LIT:0> ] ; j1 += xzDirectionsConst [ k ] [ <NUM_LIT:1> ] ; getPlayerInstance ( i + i1 , j + j1 , true ) . addPlayer ( par1EntityPlayerMP ) ; } players . add ( par1EntityPlayerMP ) ; } public void removePlayer ( EntityPlayerMP par1EntityPlayerMP ) { int i = ( int ) par1EntityPlayerMP . managedPosX > > <NUM_LIT:4> ; int j = ( int ) par1EntityPlayerMP . managedPosZ > > <NUM_LIT:4> ; for ( int k = i - playerViewRadius ; k <= i + playerViewRadius ; k ++ ) { for ( int l = j - playerViewRadius ; l <= j + playerViewRadius ; l ++ ) { PlayerInstance playerinstance = getPlayerInstance ( k , l , false ) ; if ( playerinstance != null ) { playerinstance . removePlayer ( par1EntityPlayerMP ) ; } } } players . remove ( par1EntityPlayerMP ) ; } private boolean isOutsidePlayerViewRadius ( int par1 , int par2 , int par3 , int par4 ) { int i = par1 - par3 ; int j = par2 - par4 ; if ( i < - playerViewRadius || i > playerViewRadius ) { return false ; } return j >= - playerViewRadius && j <= playerViewRadius ; } public void updateMountedMovingPlayer ( EntityPlayerMP par1EntityPlayerMP ) { int i = ( int ) par1EntityPlayerMP . posX > > <NUM_LIT:4> ; int j = ( int ) par1EntityPlayerMP . posZ > > <NUM_LIT:4> ; double d = par1EntityPlayerMP . managedPosX - par1EntityPlayerMP . posX ; double d1 = par1EntityPlayerMP . managedPosZ - par1EntityPlayerMP . posZ ; double d2 = d * d + d1 * d1 ; if ( d2 < <NUM_LIT> ) { return ; } int k = ( int ) par1EntityPlayerMP . managedPosX > > <NUM_LIT:4> ; int l = ( int ) par1EntityPlayerMP . managedPosZ > > <NUM_LIT:4> ; int i1 = i - k ; int j1 = j - l ; if ( i1 == <NUM_LIT:0> && j1 == <NUM_LIT:0> ) { return ; } for ( int k1 = i - playerViewRadius ; k1 <= i + playerViewRadius ; k1 ++ ) { for ( int l1 = j - playerViewRadius ; l1 <= j + playerViewRadius ; l1 ++ ) { if ( ! isOutsidePlayerViewRadius ( k1 , l1 , k , l ) ) { getPlayerInstance ( k1 , l1 , true ) . addPlayer ( par1EntityPlayerMP ) ; } if ( isOutsidePlayerViewRadius ( k1 - i1 , l1 - j1 , i , j ) ) { continue ; } PlayerInstance playerinstance = getPlayerInstance ( k1 - i1 , l1 - j1 , false ) ; if ( playerinstance != null ) { playerinstance . removePlayer ( par1EntityPlayerMP ) ; } } } par1EntityPlayerMP . managedPosX = par1EntityPlayerMP . posX ; par1EntityPlayerMP . managedPosZ = par1EntityPlayerMP . posZ ; } public int getMaxTrackingDistance ( ) { return playerViewRadius * <NUM_LIT:16> - <NUM_LIT:16> ; } static LongHashMap getPlayerInstances ( PlayerManager par0PlayerManager ) { return par0PlayerManager . playerInstances ; } static List getPlayerInstancesToUpdate ( PlayerManager par0PlayerManager ) { return par0PlayerManager . playerInstancesToUpdate ; } } </s>
<s> package net . minecraft . src ; public class FoodStats { private int foodLevel ; private float foodSaturationLevel ; private float foodExhaustionLevel ; private int foodTimer ; private int prevFoodLevel ; public FoodStats ( ) { foodTimer = <NUM_LIT:0> ; foodLevel = <NUM_LIT:20> ; prevFoodLevel = <NUM_LIT:20> ; foodSaturationLevel = <NUM_LIT> ; } public void addStats ( int par1 , float par2 ) { foodLevel = Math . min ( par1 + foodLevel , <NUM_LIT:20> ) ; foodSaturationLevel = Math . min ( foodSaturationLevel + ( float ) par1 * par2 * <NUM_LIT> , foodLevel ) ; } public void addStats ( ItemFood par1ItemFood ) { addStats ( par1ItemFood . getHealAmount ( ) , par1ItemFood . getSaturationModifier ( ) ) ; } public void onUpdate ( EntityPlayer par1EntityPlayer ) { int i = par1EntityPlayer . worldObj . difficultySetting ; prevFoodLevel = foodLevel ; if ( foodExhaustionLevel > <NUM_LIT> ) { foodExhaustionLevel -= <NUM_LIT> ; if ( foodSaturationLevel > <NUM_LIT> ) { foodSaturationLevel = Math . max ( foodSaturationLevel - <NUM_LIT> , <NUM_LIT> ) ; } else if ( i > <NUM_LIT:0> ) { foodLevel = Math . max ( foodLevel - <NUM_LIT:1> , <NUM_LIT:0> ) ; } } if ( foodLevel >= <NUM_LIT> && par1EntityPlayer . shouldHeal ( ) ) { foodTimer ++ ; if ( foodTimer >= <NUM_LIT> ) { par1EntityPlayer . heal ( <NUM_LIT:1> ) ; foodTimer = <NUM_LIT:0> ; } } else if ( foodLevel <= <NUM_LIT:0> ) { foodTimer ++ ; if ( foodTimer >= <NUM_LIT> ) { if ( par1EntityPlayer . getHealth ( ) > <NUM_LIT:10> || i >= <NUM_LIT:3> || par1EntityPlayer . getHealth ( ) > <NUM_LIT:1> && i >= <NUM_LIT:2> ) { par1EntityPlayer . attackEntityFrom ( DamageSource . starve , <NUM_LIT:1> ) ; } foodTimer = <NUM_LIT:0> ; } } else { foodTimer = <NUM_LIT:0> ; } } public void readNBT ( NBTTagCompound par1NBTTagCompound ) { if ( par1NBTTagCompound . hasKey ( "<STR_LIT>" ) ) { foodLevel = par1NBTTagCompound . getInteger ( "<STR_LIT>" ) ; foodTimer = par1NBTTagCompound . getInteger ( "<STR_LIT>" ) ; foodSaturationLevel = par1NBTTagCompound . getFloat ( "<STR_LIT>" ) ; foodExhaustionLevel = par1NBTTagCompound . getFloat ( "<STR_LIT>" ) ; } } public void writeNBT ( NBTTagCompound par1NBTTagCompound ) { par1NBTTagCompound . setInteger ( "<STR_LIT>" , foodLevel ) ; par1NBTTagCompound . setInteger ( "<STR_LIT>" , foodTimer ) ; par1NBTTagCompound . setFloat ( "<STR_LIT>" , foodSaturationLevel ) ; par1NBTTagCompound . setFloat ( "<STR_LIT>" , foodExhaustionLevel ) ; } public int getFoodLevel ( ) { return foodLevel ; } public boolean needFood ( ) { return foodLevel < <NUM_LIT:20> ; } public void addExhaustion ( float par1 ) { foodExhaustionLevel = Math . min ( foodExhaustionLevel + par1 , <NUM_LIT> ) ; } public float getSaturationLevel ( ) { return foodSaturationLevel ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentNetherBridgeStraight extends ComponentNetherBridgePiece { public ComponentNetherBridgeStraight ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { getNextComponentNormal ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:3> , false ) ; } public static ComponentNetherBridgeStraight createValidComponent ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:1> , - <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:10> , <NUM_LIT> , par5 ) ; if ( ! isAboveGround ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentNetherBridgeStraight ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:7> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:5> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:3> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:15> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; for ( int i = <NUM_LIT:0> ; i <= <NUM_LIT:4> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j <= <NUM_LIT:2> ; j ++ ) { fillCurrentPositionBlocksDownwards ( par1World , Block . netherBrick . blockID , <NUM_LIT:0> , i , - <NUM_LIT:1> , j , par3StructureBoundingBox ) ; fillCurrentPositionBlocksDownwards ( par1World , Block . netherBrick . blockID , <NUM_LIT:0> , i , - <NUM_LIT:1> , <NUM_LIT> - j , par3StructureBoundingBox ) ; } } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:1> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; return true ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenBigTree extends WorldGenerator { static final byte otherCoordPairs [ ] = { <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:1> } ; Random rand ; World worldObj ; int basePos [ ] = { <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> } ; int heightLimit ; int height ; double heightAttenuation ; double branchDensity ; double branchSlope ; double scaleWidth ; double leafDensity ; int trunkSize ; int heightLimitLimit ; int leafDistanceLimit ; int leafNodes [ ] [ ] ; public WorldGenBigTree ( boolean par1 ) { super ( par1 ) ; rand = new Random ( ) ; heightLimit = <NUM_LIT:0> ; heightAttenuation = <NUM_LIT> ; branchDensity = <NUM_LIT> ; branchSlope = <NUM_LIT> ; scaleWidth = <NUM_LIT> ; leafDensity = <NUM_LIT> ; trunkSize = <NUM_LIT:1> ; heightLimitLimit = <NUM_LIT:12> ; leafDistanceLimit = <NUM_LIT:4> ; } void generateLeafNodeList ( ) { height = ( int ) ( ( double ) heightLimit * heightAttenuation ) ; if ( height >= heightLimit ) { height = heightLimit - <NUM_LIT:1> ; } int i = ( int ) ( <NUM_LIT> + Math . pow ( ( leafDensity * ( double ) heightLimit ) / <NUM_LIT> , <NUM_LIT> ) ) ; if ( i < <NUM_LIT:1> ) { i = <NUM_LIT:1> ; } int ai [ ] [ ] = new int [ i * heightLimit ] [ <NUM_LIT:4> ] ; int j = ( basePos [ <NUM_LIT:1> ] + heightLimit ) - leafDistanceLimit ; int k = <NUM_LIT:1> ; int l = basePos [ <NUM_LIT:1> ] + height ; int i1 = j - basePos [ <NUM_LIT:1> ] ; ai [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] = basePos [ <NUM_LIT:0> ] ; ai [ <NUM_LIT:0> ] [ <NUM_LIT:1> ] = j ; ai [ <NUM_LIT:0> ] [ <NUM_LIT:2> ] = basePos [ <NUM_LIT:2> ] ; ai [ <NUM_LIT:0> ] [ <NUM_LIT:3> ] = l ; j -- ; while ( i1 >= <NUM_LIT:0> ) { int j1 = <NUM_LIT:0> ; float f = layerSize ( i1 ) ; if ( f < <NUM_LIT> ) { j -- ; i1 -- ; } else { double d = <NUM_LIT> ; for ( ; j1 < i ; j1 ++ ) { double d1 = scaleWidth * ( ( double ) f * ( ( double ) rand . nextFloat ( ) + <NUM_LIT> ) ) ; double d2 = ( double ) rand . nextFloat ( ) * <NUM_LIT> * Math . PI ; int k1 = MathHelper . floor_double ( d1 * Math . sin ( d2 ) + ( double ) basePos [ <NUM_LIT:0> ] + d ) ; int l1 = MathHelper . floor_double ( d1 * Math . cos ( d2 ) + ( double ) basePos [ <NUM_LIT:2> ] + d ) ; int ai1 [ ] = { k1 , j , l1 } ; int ai2 [ ] = { k1 , j + leafDistanceLimit , l1 } ; if ( checkBlockLine ( ai1 , ai2 ) != - <NUM_LIT:1> ) { continue ; } int ai3 [ ] = { basePos [ <NUM_LIT:0> ] , basePos [ <NUM_LIT:1> ] , basePos [ <NUM_LIT:2> ] } ; double d3 = Math . sqrt ( Math . pow ( Math . abs ( basePos [ <NUM_LIT:0> ] - ai1 [ <NUM_LIT:0> ] ) , <NUM_LIT> ) + Math . pow ( Math . abs ( basePos [ <NUM_LIT:2> ] - ai1 [ <NUM_LIT:2> ] ) , <NUM_LIT> ) ) ; double d4 = d3 * branchSlope ; if ( ( double ) ai1 [ <NUM_LIT:1> ] - d4 > ( double ) l ) { ai3 [ <NUM_LIT:1> ] = l ; } else { ai3 [ <NUM_LIT:1> ] = ( int ) ( ( double ) ai1 [ <NUM_LIT:1> ] - d4 ) ; } if ( checkBlockLine ( ai3 , ai1 ) == - <NUM_LIT:1> ) { ai [ k ] [ <NUM_LIT:0> ] = k1 ; ai [ k ] [ <NUM_LIT:1> ] = j ; ai [ k ] [ <NUM_LIT:2> ] = l1 ; ai [ k ] [ <NUM_LIT:3> ] = ai3 [ <NUM_LIT:1> ] ; k ++ ; } } j -- ; i1 -- ; } } leafNodes = new int [ k ] [ <NUM_LIT:4> ] ; System . arraycopy ( ai , <NUM_LIT:0> , leafNodes , <NUM_LIT:0> , k ) ; } void genTreeLayer ( int par1 , int par2 , int par3 , float par4 , byte par5 , int par6 ) { int i = ( int ) ( ( double ) par4 + <NUM_LIT> ) ; byte byte0 = otherCoordPairs [ par5 ] ; byte byte1 = otherCoordPairs [ par5 + <NUM_LIT:3> ] ; int ai [ ] = { par1 , par2 , par3 } ; int ai1 [ ] = { <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> } ; int j = - i ; int k = - i ; ai1 [ par5 ] = ai [ par5 ] ; for ( ; j <= i ; j ++ ) { ai1 [ byte0 ] = ai [ byte0 ] + j ; for ( int l = - i ; l <= i ; ) { double d = Math . sqrt ( Math . pow ( ( double ) Math . abs ( j ) + <NUM_LIT> , <NUM_LIT> ) + Math . pow ( ( double ) Math . abs ( l ) + <NUM_LIT> , <NUM_LIT> ) ) ; if ( d > ( double ) par4 ) { l ++ ; } else { ai1 [ byte1 ] = ai [ byte1 ] + l ; int i1 = worldObj . getBlockId ( ai1 [ <NUM_LIT:0> ] , ai1 [ <NUM_LIT:1> ] , ai1 [ <NUM_LIT:2> ] ) ; if ( i1 != <NUM_LIT:0> && i1 != <NUM_LIT> ) { l ++ ; } else { setBlockAndMetadata ( worldObj , ai1 [ <NUM_LIT:0> ] , ai1 [ <NUM_LIT:1> ] , ai1 [ <NUM_LIT:2> ] , par6 , <NUM_LIT:0> ) ; l ++ ; } } } } } float layerSize ( int par1 ) { if ( ( double ) par1 < ( double ) ( float ) heightLimit * <NUM_LIT> ) { return - <NUM_LIT> ; } float f = ( float ) heightLimit / <NUM_LIT> ; float f1 = ( float ) heightLimit / <NUM_LIT> - ( float ) par1 ; float f2 ; if ( f1 == <NUM_LIT> ) { f2 = f ; } else if ( Math . abs ( f1 ) >= f ) { f2 = <NUM_LIT> ; } else { f2 = ( float ) Math . sqrt ( Math . pow ( Math . abs ( f ) , <NUM_LIT> ) - Math . pow ( Math . abs ( f1 ) , <NUM_LIT> ) ) ; } f2 *= <NUM_LIT> ; return f2 ; } float leafSize ( int par1 ) { if ( par1 < <NUM_LIT:0> || par1 >= leafDistanceLimit ) { return - <NUM_LIT> ; } return par1 != <NUM_LIT:0> && par1 != leafDistanceLimit - <NUM_LIT:1> ? <NUM_LIT> : <NUM_LIT> ; } void generateLeafNode ( int par1 , int par2 , int par3 ) { int i = par2 ; for ( int j = par2 + leafDistanceLimit ; i < j ; i ++ ) { float f = leafSize ( i - par2 ) ; genTreeLayer ( par1 , i , par3 , f , ( byte ) <NUM_LIT:1> , <NUM_LIT> ) ; } } void placeBlockLine ( int par1ArrayOfInteger [ ] , int par2ArrayOfInteger [ ] , int par3 ) { int ai [ ] = { <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> } ; byte byte0 = <NUM_LIT:0> ; int i = <NUM_LIT:0> ; for ( ; byte0 < <NUM_LIT:3> ; byte0 ++ ) { ai [ byte0 ] = par2ArrayOfInteger [ byte0 ] - par1ArrayOfInteger [ byte0 ] ; if ( Math . abs ( ai [ byte0 ] ) > Math . abs ( ai [ i ] ) ) { i = byte0 ; } } if ( ai [ i ] == <NUM_LIT:0> ) { return ; } byte byte1 = otherCoordPairs [ i ] ; byte byte2 = otherCoordPairs [ i + <NUM_LIT:3> ] ; byte byte3 ; if ( ai [ i ] > <NUM_LIT:0> ) { byte3 = <NUM_LIT:1> ; } else { byte3 = - <NUM_LIT:1> ; } double d = ( double ) ai [ byte1 ] / ( double ) ai [ i ] ; double d1 = ( double ) ai [ byte2 ] / ( double ) ai [ i ] ; int ai1 [ ] = { <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> } ; int j = <NUM_LIT:0> ; for ( int k = ai [ i ] + byte3 ; j != k ; j += byte3 ) { ai1 [ i ] = MathHelper . floor_double ( ( double ) ( par1ArrayOfInteger [ i ] + j ) + <NUM_LIT> ) ; ai1 [ byte1 ] = MathHelper . floor_double ( ( double ) par1ArrayOfInteger [ byte1 ] + ( double ) j * d + <NUM_LIT> ) ; ai1 [ byte2 ] = MathHelper . floor_double ( ( double ) par1ArrayOfInteger [ byte2 ] + ( double ) j * d1 + <NUM_LIT> ) ; setBlockAndMetadata ( worldObj , ai1 [ <NUM_LIT:0> ] , ai1 [ <NUM_LIT:1> ] , ai1 [ <NUM_LIT:2> ] , par3 , <NUM_LIT:0> ) ; } } void generateLeaves ( ) { int i = <NUM_LIT:0> ; for ( int j = leafNodes . length ; i < j ; i ++ ) { int k = leafNodes [ i ] [ <NUM_LIT:0> ] ; int l = leafNodes [ i ] [ <NUM_LIT:1> ] ; int i1 = leafNodes [ i ] [ <NUM_LIT:2> ] ; generateLeafNode ( k , l , i1 ) ; } } boolean leafNodeNeedsBase ( int par1 ) { return ( double ) par1 >= ( double ) heightLimit * <NUM_LIT> ; } void generateTrunk ( ) { int i = basePos [ <NUM_LIT:0> ] ; int j = basePos [ <NUM_LIT:1> ] ; int k = basePos [ <NUM_LIT:1> ] + height ; int l = basePos [ <NUM_LIT:2> ] ; int ai [ ] = { i , j , l } ; int ai1 [ ] = { i , k , l } ; placeBlockLine ( ai , ai1 , <NUM_LIT> ) ; if ( trunkSize == <NUM_LIT:2> ) { ai [ <NUM_LIT:0> ] ++ ; ai1 [ <NUM_LIT:0> ] ++ ; placeBlockLine ( ai , ai1 , <NUM_LIT> ) ; ai [ <NUM_LIT:2> ] ++ ; ai1 [ <NUM_LIT:2> ] ++ ; placeBlockLine ( ai , ai1 , <NUM_LIT> ) ; ai [ <NUM_LIT:0> ] -- ; ai1 [ <NUM_LIT:0> ] -- ; placeBlockLine ( ai , ai1 , <NUM_LIT> ) ; } } void generateLeafNodeBases ( ) { int i = <NUM_LIT:0> ; int j = leafNodes . length ; int ai [ ] = { basePos [ <NUM_LIT:0> ] , basePos [ <NUM_LIT:1> ] , basePos [ <NUM_LIT:2> ] } ; for ( ; i < j ; i ++ ) { int ai1 [ ] = leafNodes [ i ] ; int ai2 [ ] = { ai1 [ <NUM_LIT:0> ] , ai1 [ <NUM_LIT:1> ] , ai1 [ <NUM_LIT:2> ] } ; ai [ <NUM_LIT:1> ] = ai1 [ <NUM_LIT:3> ] ; int k = ai [ <NUM_LIT:1> ] - basePos [ <NUM_LIT:1> ] ; if ( leafNodeNeedsBase ( k ) ) { placeBlockLine ( ai , ai2 , <NUM_LIT> ) ; } } } int checkBlockLine ( int par1ArrayOfInteger [ ] , int par2ArrayOfInteger [ ] ) { int ai [ ] = { <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> } ; byte byte0 = <NUM_LIT:0> ; int i = <NUM_LIT:0> ; for ( ; byte0 < <NUM_LIT:3> ; byte0 ++ ) { ai [ byte0 ] = par2ArrayOfInteger [ byte0 ] - par1ArrayOfInteger [ byte0 ] ; if ( Math . abs ( ai [ byte0 ] ) > Math . abs ( ai [ i ] ) ) { i = byte0 ; } } if ( ai [ i ] == <NUM_LIT:0> ) { return - <NUM_LIT:1> ; } byte byte1 = otherCoordPairs [ i ] ; byte byte2 = otherCoordPairs [ i + <NUM_LIT:3> ] ; byte byte3 ; if ( ai [ i ] > <NUM_LIT:0> ) { byte3 = <NUM_LIT:1> ; } else { byte3 = - <NUM_LIT:1> ; } double d = ( double ) ai [ byte1 ] / ( double ) ai [ i ] ; double d1 = ( double ) ai [ byte2 ] / ( double ) ai [ i ] ; int ai1 [ ] = { <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> } ; int j = <NUM_LIT:0> ; int k = ai [ i ] + byte3 ; do { if ( j == k ) { break ; } ai1 [ i ] = par1ArrayOfInteger [ i ] + j ; ai1 [ byte1 ] = MathHelper . floor_double ( ( double ) par1ArrayOfInteger [ byte1 ] + ( double ) j * d ) ; ai1 [ byte2 ] = MathHelper . floor_double ( ( double ) par1ArrayOfInteger [ byte2 ] + ( double ) j * d1 ) ; int l = worldObj . getBlockId ( ai1 [ <NUM_LIT:0> ] , ai1 [ <NUM_LIT:1> ] , ai1 [ <NUM_LIT:2> ] ) ; if ( l != <NUM_LIT:0> && l != <NUM_LIT> ) { break ; } j += byte3 ; } while ( true ) ; if ( j == k ) { return - <NUM_LIT:1> ; } else { return Math . abs ( j ) ; } } boolean validTreeLocation ( ) { int ai [ ] = { basePos [ <NUM_LIT:0> ] , basePos [ <NUM_LIT:1> ] , basePos [ <NUM_LIT:2> ] } ; int ai1 [ ] = { basePos [ <NUM_LIT:0> ] , ( basePos [ <NUM_LIT:1> ] + heightLimit ) - <NUM_LIT:1> , basePos [ <NUM_LIT:2> ] } ; int i = worldObj . getBlockId ( basePos [ <NUM_LIT:0> ] , basePos [ <NUM_LIT:1> ] - <NUM_LIT:1> , basePos [ <NUM_LIT:2> ] ) ; if ( i != <NUM_LIT:2> && i != <NUM_LIT:3> ) { return false ; } int j = checkBlockLine ( ai , ai1 ) ; if ( j == - <NUM_LIT:1> ) { return true ; } if ( j < <NUM_LIT:6> ) { return false ; } else { heightLimit = j ; return true ; } } public void setScale ( double par1 , double par3 , double par5 ) { heightLimitLimit = ( int ) ( par1 * <NUM_LIT> ) ; if ( par1 > <NUM_LIT> ) { leafDistanceLimit = <NUM_LIT:5> ; } scaleWidth = par3 ; leafDensity = par5 ; } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { worldObj = par1World ; long l = par2Random . nextLong ( ) ; rand . setSeed ( l ) ; basePos [ <NUM_LIT:0> ] = par3 ; basePos [ <NUM_LIT:1> ] = par4 ; basePos [ <NUM_LIT:2> ] = par5 ; if ( heightLimit == <NUM_LIT:0> ) { heightLimit = <NUM_LIT:5> + rand . nextInt ( heightLimitLimit ) ; } if ( ! validTreeLocation ( ) ) { return false ; } else { generateLeafNodeList ( ) ; generateLeaves ( ) ; generateTrunk ( ) ; generateLeafNodeBases ( ) ; return true ; } } } </s>
<s> package net . minecraft . src ; import java . io . PrintWriter ; import java . io . StringWriter ; import java . util . logging . * ; class GuiLogFormatter extends Formatter { final GuiLogOutputHandler outputHandler ; GuiLogFormatter ( GuiLogOutputHandler par1GuiLogOutputHandler ) { outputHandler = par1GuiLogOutputHandler ; } public String format ( LogRecord par1LogRecord ) { StringBuilder stringbuilder = new StringBuilder ( ) ; Level level = par1LogRecord . getLevel ( ) ; if ( level == Level . FINEST ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . FINER ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . FINE ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . INFO ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . WARNING ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . SEVERE ) { stringbuilder . append ( "<STR_LIT>" ) ; } else if ( level == Level . SEVERE ) { stringbuilder . append ( ( new StringBuilder ( ) ) . append ( "<STR_LIT:[>" ) . append ( level . getLocalizedName ( ) ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } stringbuilder . append ( par1LogRecord . getMessage ( ) ) ; stringbuilder . append ( '<STR_LIT:\n>' ) ; Throwable throwable = par1LogRecord . getThrown ( ) ; if ( throwable != null ) { StringWriter stringwriter = new StringWriter ( ) ; throwable . printStackTrace ( new PrintWriter ( stringwriter ) ) ; stringbuilder . append ( stringwriter . toString ( ) ) ; } return stringbuilder . toString ( ) ; } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentNetherBridgeCrossing extends ComponentNetherBridgePiece { public ComponentNetherBridgeCrossing ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { getNextComponentNormal ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:2> , <NUM_LIT:0> , false ) ; getNextComponentX ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:0> , <NUM_LIT:2> , false ) ; getNextComponentZ ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:0> , <NUM_LIT:2> , false ) ; } public static ComponentNetherBridgeCrossing createValidComponent ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:7> , <NUM_LIT:9> , <NUM_LIT:7> , par5 ) ; if ( ! isAboveGround ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentNetherBridgeCrossing ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:6> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:6> , <NUM_LIT:0> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:6> , <NUM_LIT:6> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:0> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:6> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:1> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:6> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:1> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:6> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:0> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:0> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:6> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:6> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:6> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; for ( int i = <NUM_LIT:0> ; i <= <NUM_LIT:6> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j <= <NUM_LIT:6> ; j ++ ) { fillCurrentPositionBlocksDownwards ( par1World , Block . netherBrick . blockID , <NUM_LIT:0> , i , - <NUM_LIT:1> , j , par3StructureBoundingBox ) ; } } return true ; } } </s>
<s> package net . minecraft . src ; import java . io . File ; import java . io . FileInputStream ; public class SaveFormatOld implements ISaveFormat { protected final File savesDirectory ; public SaveFormatOld ( File par1File ) { if ( ! par1File . exists ( ) ) { par1File . mkdirs ( ) ; } savesDirectory = par1File ; } public WorldInfo getWorldInfo ( String par1Str ) { File file = new File ( savesDirectory , par1Str ) ; if ( ! file . exists ( ) ) { return null ; } File file1 = new File ( file , "<STR_LIT>" ) ; if ( file1 . exists ( ) ) { try { NBTTagCompound nbttagcompound = CompressedStreamTools . readCompressed ( new FileInputStream ( file1 ) ) ; NBTTagCompound nbttagcompound2 = nbttagcompound . getCompoundTag ( "<STR_LIT>" ) ; return new WorldInfo ( nbttagcompound2 ) ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } file1 = new File ( file , "<STR_LIT>" ) ; if ( file1 . exists ( ) ) { try { NBTTagCompound nbttagcompound1 = CompressedStreamTools . readCompressed ( new FileInputStream ( file1 ) ) ; NBTTagCompound nbttagcompound3 = nbttagcompound1 . getCompoundTag ( "<STR_LIT>" ) ; return new WorldInfo ( nbttagcompound3 ) ; } catch ( Exception exception1 ) { exception1 . printStackTrace ( ) ; } } return null ; } public ISaveHandler getSaveLoader ( String par1Str , boolean par2 ) { return new SaveHandler ( savesDirectory , par1Str , par2 ) ; } public boolean isOldMapFormat ( String par1Str ) { return false ; } public boolean convertMapFormat ( String par1Str , IProgressUpdate par2IProgressUpdate ) { return false ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet107CreativeSetSlot extends Packet { public int slot ; public ItemStack itemStack ; public Packet107CreativeSetSlot ( ) { } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleCreativeSetSlot ( this ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { slot = par1DataInputStream . readShort ( ) ; itemStack = readItemStack ( par1DataInputStream ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeShort ( slot ) ; writeItemStack ( itemStack , par1DataOutputStream ) ; } public int getPacketSize ( ) { return <NUM_LIT:8> ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet29DestroyEntity extends Packet { public int entityId ; public Packet29DestroyEntity ( ) { } public Packet29DestroyEntity ( int par1 ) { entityId = par1 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityId = par1DataInputStream . readInt ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityId ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleDestroyEntity ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:4> ; } } </s>
<s> package net . minecraft . src ; import java . util . * ; class PlayerInstance { private List players ; private int chunkX ; private int chunkZ ; private ChunkCoordIntPair currentChunk ; private short blocksToUpdate [ ] ; private int numBlocksToUpdate ; private int field_48475_h ; final PlayerManager playerManager ; public PlayerInstance ( PlayerManager par1PlayerManager , int par2 , int par3 ) { playerManager = par1PlayerManager ; players = new ArrayList ( ) ; blocksToUpdate = new short [ <NUM_LIT> ] ; numBlocksToUpdate = <NUM_LIT:0> ; chunkX = par2 ; chunkZ = par3 ; currentChunk = new ChunkCoordIntPair ( par2 , par3 ) ; par1PlayerManager . getMinecraftServer ( ) . chunkProviderServer . loadChunk ( par2 , par3 ) ; } public void addPlayer ( EntityPlayerMP par1EntityPlayerMP ) { if ( players . contains ( par1EntityPlayerMP ) ) { throw new IllegalStateException ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1EntityPlayerMP ) . append ( "<STR_LIT>" ) . append ( chunkX ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( chunkZ ) . toString ( ) ) ; } else { par1EntityPlayerMP . listeningChunks . add ( currentChunk ) ; par1EntityPlayerMP . playerNetServerHandler . sendPacket ( new Packet50PreChunk ( currentChunk . chunkXPos , currentChunk . chunkZPos , true ) ) ; players . add ( par1EntityPlayerMP ) ; par1EntityPlayerMP . loadedChunks . add ( currentChunk ) ; return ; } } public void removePlayer ( EntityPlayerMP par1EntityPlayerMP ) { if ( ! players . contains ( par1EntityPlayerMP ) ) { return ; } players . remove ( par1EntityPlayerMP ) ; if ( players . size ( ) == <NUM_LIT:0> ) { long l = ( long ) chunkX + <NUM_LIT> | ( long ) chunkZ + <NUM_LIT> << <NUM_LIT:32> ; PlayerManager . getPlayerInstances ( playerManager ) . remove ( l ) ; if ( numBlocksToUpdate > <NUM_LIT:0> ) { PlayerManager . getPlayerInstancesToUpdate ( playerManager ) . remove ( this ) ; } playerManager . getMinecraftServer ( ) . chunkProviderServer . dropChunk ( chunkX , chunkZ ) ; } par1EntityPlayerMP . loadedChunks . remove ( currentChunk ) ; if ( par1EntityPlayerMP . listeningChunks . contains ( currentChunk ) ) { par1EntityPlayerMP . playerNetServerHandler . sendPacket ( new Packet50PreChunk ( chunkX , chunkZ , false ) ) ; } } public void markBlockNeedsUpdate ( int par1 , int par2 , int par3 ) { if ( numBlocksToUpdate == <NUM_LIT:0> ) { PlayerManager . getPlayerInstancesToUpdate ( playerManager ) . add ( this ) ; } field_48475_h |= <NUM_LIT:1> << ( par2 > > <NUM_LIT:4> ) ; if ( numBlocksToUpdate < <NUM_LIT> ) { short word0 = ( short ) ( par1 << <NUM_LIT:12> | par3 << <NUM_LIT:8> | par2 ) ; for ( int i = <NUM_LIT:0> ; i < numBlocksToUpdate ; i ++ ) { if ( blocksToUpdate [ i ] == word0 ) { return ; } } blocksToUpdate [ numBlocksToUpdate ++ ] = word0 ; } } public void sendPacketToPlayersInInstance ( Packet par1Packet ) { for ( int i = <NUM_LIT:0> ; i < players . size ( ) ; i ++ ) { EntityPlayerMP entityplayermp = ( EntityPlayerMP ) players . get ( i ) ; if ( entityplayermp . listeningChunks . contains ( currentChunk ) && ! entityplayermp . loadedChunks . contains ( currentChunk ) ) { entityplayermp . playerNetServerHandler . sendPacket ( par1Packet ) ; } } } public void onUpdate ( ) { WorldServer worldserver = playerManager . getMinecraftServer ( ) ; if ( numBlocksToUpdate == <NUM_LIT:0> ) { return ; } if ( numBlocksToUpdate == <NUM_LIT:1> ) { int i = chunkX * <NUM_LIT:16> + ( blocksToUpdate [ <NUM_LIT:0> ] > > <NUM_LIT:12> & <NUM_LIT> ) ; int l = blocksToUpdate [ <NUM_LIT:0> ] & <NUM_LIT> ; int k1 = chunkZ * <NUM_LIT:16> + ( blocksToUpdate [ <NUM_LIT:0> ] > > <NUM_LIT:8> & <NUM_LIT> ) ; sendPacketToPlayersInInstance ( new Packet53BlockChange ( i , l , k1 , worldserver ) ) ; if ( worldserver . func_48084_h ( i , l , k1 ) ) { updateTileEntity ( worldserver . getBlockTileEntity ( i , l , k1 ) ) ; } } else if ( numBlocksToUpdate == <NUM_LIT> ) { int j = chunkX * <NUM_LIT:16> ; int i1 = chunkZ * <NUM_LIT:16> ; sendPacketToPlayersInInstance ( new Packet51MapChunk ( worldserver . getChunkFromChunkCoords ( chunkX , chunkZ ) , false , field_48475_h ) ) ; for ( int l1 = <NUM_LIT:0> ; l1 < <NUM_LIT:16> ; l1 ++ ) { if ( ( field_48475_h & <NUM_LIT:1> << l1 ) != <NUM_LIT:0> ) { int j2 = l1 << <NUM_LIT:4> ; List list = worldserver . getTileEntityList ( j , j2 , i1 , j + <NUM_LIT:16> , j2 + <NUM_LIT:16> , i1 + <NUM_LIT:16> ) ; for ( int l2 = <NUM_LIT:0> ; l2 < list . size ( ) ; l2 ++ ) { updateTileEntity ( ( TileEntity ) list . get ( l2 ) ) ; } } } } else { sendPacketToPlayersInInstance ( new Packet52MultiBlockChange ( chunkX , chunkZ , blocksToUpdate , numBlocksToUpdate , worldserver ) ) ; for ( int k = <NUM_LIT:0> ; k < numBlocksToUpdate ; k ++ ) { int j1 = chunkX * <NUM_LIT:16> + ( blocksToUpdate [ k ] > > <NUM_LIT:12> & <NUM_LIT> ) ; int i2 = blocksToUpdate [ k ] & <NUM_LIT> ; int k2 = chunkZ * <NUM_LIT:16> + ( blocksToUpdate [ k ] > > <NUM_LIT:8> & <NUM_LIT> ) ; if ( worldserver . func_48084_h ( j1 , i2 , k2 ) ) { updateTileEntity ( worldserver . getBlockTileEntity ( j1 , i2 , k2 ) ) ; } } } numBlocksToUpdate = <NUM_LIT:0> ; field_48475_h = <NUM_LIT:0> ; } private void updateTileEntity ( TileEntity par1TileEntity ) { if ( par1TileEntity != null ) { Packet packet = par1TileEntity . getDescriptionPacket ( ) ; if ( packet != null ) { sendPacketToPlayersInInstance ( packet ) ; } } } } </s>
<s> package net . minecraft . src ; public class SlotFurnace extends Slot { private EntityPlayer thePlayer ; private int field_48419_f ; public SlotFurnace ( EntityPlayer par1EntityPlayer , IInventory par2IInventory , int par3 , int par4 , int par5 ) { super ( par2IInventory , par3 , par4 , par5 ) ; thePlayer = par1EntityPlayer ; } public boolean isItemValid ( ItemStack par1ItemStack ) { return false ; } public ItemStack decrStackSize ( int par1 ) { if ( getHasStack ( ) ) { field_48419_f += Math . min ( par1 , getStack ( ) . stackSize ) ; } return super . decrStackSize ( par1 ) ; } public void onPickupFromSlot ( ItemStack par1ItemStack ) { func_48416_b ( par1ItemStack ) ; super . onPickupFromSlot ( par1ItemStack ) ; } protected void func_48415_a ( ItemStack par1ItemStack , int par2 ) { field_48419_f += par2 ; func_48416_b ( par1ItemStack ) ; } protected void func_48416_b ( ItemStack par1ItemStack ) { par1ItemStack . onCrafting ( thePlayer . worldObj , thePlayer , field_48419_f ) ; field_48419_f = <NUM_LIT:0> ; if ( par1ItemStack . itemID == Item . ingotIron . shiftedIndex ) { thePlayer . addStat ( AchievementList . acquireIron , <NUM_LIT:1> ) ; } if ( par1ItemStack . itemID == Item . fishCooked . shiftedIndex ) { thePlayer . addStat ( AchievementList . cookFish , <NUM_LIT:1> ) ; } } } </s>
<s> package net . minecraft . src ; class SlotBrewingStandIngredient extends Slot { final ContainerBrewingStand container ; public SlotBrewingStandIngredient ( ContainerBrewingStand par1ContainerBrewingStand , IInventory par2IInventory , int par3 , int par4 , int par5 ) { super ( par2IInventory , par3 , par4 , par5 ) ; container = par1ContainerBrewingStand ; } public boolean isItemValid ( ItemStack par1ItemStack ) { if ( par1ItemStack != null ) { return Item . itemsList [ par1ItemStack . itemID ] . isPotionIngredient ( ) ; } else { return false ; } } public int getSlotStackLimit ( ) { return <NUM_LIT> ; } } </s>
<s> package net . minecraft . src ; public class RecipesTools { private String recipePatterns [ ] [ ] = { { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" } , { "<STR_LIT:X>" , "<STR_LIT:#>" , "<STR_LIT:#>" } , { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" } , { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" } } ; private Object recipeItems [ ] [ ] ; public RecipesTools ( ) { recipeItems = ( new Object [ ] [ ] { new Object [ ] { Block . planks , Block . cobblestone , Item . ingotIron , Item . diamond , Item . ingotGold } , new Object [ ] { Item . pickaxeWood , Item . pickaxeStone , Item . pickaxeSteel , Item . pickaxeDiamond , Item . pickaxeGold } , new Object [ ] { Item . shovelWood , Item . shovelStone , Item . shovelSteel , Item . shovelDiamond , Item . shovelGold } , new Object [ ] { Item . axeWood , Item . axeStone , Item . axeSteel , Item . axeDiamond , Item . axeGold } , new Object [ ] { Item . hoeWood , Item . hoeStone , Item . hoeSteel , Item . hoeDiamond , Item . hoeGold } } ) ; } public void addRecipes ( CraftingManager par1CraftingManager ) { for ( int i = <NUM_LIT:0> ; i < recipeItems [ <NUM_LIT:0> ] . length ; i ++ ) { Object obj = recipeItems [ <NUM_LIT:0> ] [ i ] ; for ( int j = <NUM_LIT:0> ; j < recipeItems . length - <NUM_LIT:1> ; j ++ ) { Item item = ( Item ) recipeItems [ j + <NUM_LIT:1> ] [ i ] ; par1CraftingManager . addRecipe ( new ItemStack ( item ) , new Object [ ] { recipePatterns [ j ] , '<CHAR_LIT>' , Item . stick , '<CHAR_LIT>' , obj } ) ; } } par1CraftingManager . addRecipe ( new ItemStack ( Item . shears ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron } ) ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet4UpdateTime extends Packet { public long time ; public Packet4UpdateTime ( ) { } public Packet4UpdateTime ( long par1 ) { time = par1 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { time = par1DataInputStream . readLong ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeLong ( time ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleUpdateTime ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:8> ; } } </s>
<s> package net . minecraft . src ; public class EnchantmentData extends WeightedRandomChoice { public final Enchantment enchantmentobj ; public final int enchantmentLevel ; public EnchantmentData ( Enchantment par1Enchantment , int par2 ) { super ( par1Enchantment . getWeight ( ) ) ; enchantmentobj = par1Enchantment ; enchantmentLevel = par2 ; } } </s>
<s> package net . minecraft . src ; import java . io . * ; public class Packet41EntityEffect extends Packet { public int entityId ; public byte effectId ; public byte effectAmp ; public short duration ; public Packet41EntityEffect ( ) { } public Packet41EntityEffect ( int par1 , PotionEffect par2PotionEffect ) { entityId = par1 ; effectId = ( byte ) ( par2PotionEffect . getPotionID ( ) & <NUM_LIT> ) ; effectAmp = ( byte ) ( par2PotionEffect . getAmplifier ( ) & <NUM_LIT> ) ; duration = ( short ) par2PotionEffect . getDuration ( ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityId = par1DataInputStream . readInt ( ) ; effectId = par1DataInputStream . readByte ( ) ; effectAmp = par1DataInputStream . readByte ( ) ; duration = par1DataInputStream . readShort ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityId ) ; par1DataOutputStream . writeByte ( effectId ) ; par1DataOutputStream . writeByte ( effectAmp ) ; par1DataOutputStream . writeShort ( duration ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleEntityEffect ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:8> ; } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public final class ItemStack { public int stackSize ; public int animationsToGo ; public int itemID ; public NBTTagCompound stackTagCompound ; private int itemDamage ; public ItemStack ( Block par1Block ) { this ( par1Block , <NUM_LIT:1> ) ; } public ItemStack ( Block par1Block , int par2 ) { this ( par1Block . blockID , par2 , <NUM_LIT:0> ) ; } public ItemStack ( Block par1Block , int par2 , int par3 ) { this ( par1Block . blockID , par2 , par3 ) ; } public ItemStack ( Item par1Item ) { this ( par1Item . shiftedIndex , <NUM_LIT:1> , <NUM_LIT:0> ) ; } public ItemStack ( Item par1Item , int par2 ) { this ( par1Item . shiftedIndex , par2 , <NUM_LIT:0> ) ; } public ItemStack ( Item par1Item , int par2 , int par3 ) { this ( par1Item . shiftedIndex , par2 , par3 ) ; } public ItemStack ( int par1 , int par2 , int par3 ) { stackSize = <NUM_LIT:0> ; itemID = par1 ; stackSize = par2 ; itemDamage = par3 ; } public static ItemStack loadItemStackFromNBT ( NBTTagCompound par0NBTTagCompound ) { ItemStack itemstack = new ItemStack ( ) ; itemstack . readFromNBT ( par0NBTTagCompound ) ; return itemstack . getItem ( ) == null ? null : itemstack ; } private ItemStack ( ) { stackSize = <NUM_LIT:0> ; } public ItemStack splitStack ( int par1 ) { ItemStack itemstack = new ItemStack ( itemID , par1 , itemDamage ) ; if ( stackTagCompound != null ) { itemstack . stackTagCompound = ( NBTTagCompound ) stackTagCompound . copy ( ) ; } stackSize -= par1 ; return itemstack ; } public Item getItem ( ) { return Item . itemsList [ itemID ] ; } public boolean useItem ( EntityPlayer par1EntityPlayer , World par2World , int par3 , int par4 , int par5 , int par6 ) { boolean flag = getItem ( ) . onItemUse ( this , par1EntityPlayer , par2World , par3 , par4 , par5 , par6 ) ; if ( flag ) { par1EntityPlayer . addStat ( StatList . objectUseStats [ itemID ] , <NUM_LIT:1> ) ; } return flag ; } public float getStrVsBlock ( Block par1Block ) { return getItem ( ) . getStrVsBlock ( this , par1Block ) ; } public ItemStack useItemRightClick ( World par1World , EntityPlayer par2EntityPlayer ) { return getItem ( ) . onItemRightClick ( this , par1World , par2EntityPlayer ) ; } public ItemStack onFoodEaten ( World par1World , EntityPlayer par2EntityPlayer ) { return getItem ( ) . onFoodEaten ( this , par1World , par2EntityPlayer ) ; } public NBTTagCompound writeToNBT ( NBTTagCompound par1NBTTagCompound ) { par1NBTTagCompound . setShort ( "<STR_LIT:id>" , ( short ) itemID ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) stackSize ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) itemDamage ) ; if ( stackTagCompound != null ) { par1NBTTagCompound . setTag ( "<STR_LIT>" , stackTagCompound ) ; } return par1NBTTagCompound ; } public void readFromNBT ( NBTTagCompound par1NBTTagCompound ) { itemID = par1NBTTagCompound . getShort ( "<STR_LIT:id>" ) ; stackSize = par1NBTTagCompound . getByte ( "<STR_LIT>" ) ; itemDamage = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; if ( par1NBTTagCompound . hasKey ( "<STR_LIT>" ) ) { stackTagCompound = par1NBTTagCompound . getCompoundTag ( "<STR_LIT>" ) ; } } public int getMaxStackSize ( ) { return getItem ( ) . getItemStackLimit ( ) ; } public boolean isStackable ( ) { return getMaxStackSize ( ) > <NUM_LIT:1> && ( ! isItemStackDamageable ( ) || ! isItemDamaged ( ) ) ; } public boolean isItemStackDamageable ( ) { return Item . itemsList [ itemID ] . getMaxDamage ( ) > <NUM_LIT:0> ; } public boolean getHasSubtypes ( ) { return Item . itemsList [ itemID ] . getHasSubtypes ( ) ; } public boolean isItemDamaged ( ) { return isItemStackDamageable ( ) && itemDamage > <NUM_LIT:0> ; } public int getItemDamageForDisplay ( ) { return itemDamage ; } public int getItemDamage ( ) { return itemDamage ; } public void setItemDamage ( int par1 ) { itemDamage = par1 ; } public int getMaxDamage ( ) { return Item . itemsList [ itemID ] . getMaxDamage ( ) ; } public void damageItem ( int par1 , EntityLiving par2EntityLiving ) { if ( ! isItemStackDamageable ( ) ) { return ; } if ( par1 > <NUM_LIT:0> && ( par2EntityLiving instanceof EntityPlayer ) ) { int i = EnchantmentHelper . getUnbreakingModifier ( ( ( EntityPlayer ) par2EntityLiving ) . inventory ) ; if ( i > <NUM_LIT:0> && par2EntityLiving . worldObj . rand . nextInt ( i + <NUM_LIT:1> ) > <NUM_LIT:0> ) { return ; } } itemDamage += par1 ; if ( itemDamage > getMaxDamage ( ) ) { par2EntityLiving . renderBrokenItemStack ( this ) ; if ( par2EntityLiving instanceof EntityPlayer ) { ( ( EntityPlayer ) par2EntityLiving ) . addStat ( StatList . objectBreakStats [ itemID ] , <NUM_LIT:1> ) ; } stackSize -- ; if ( stackSize < <NUM_LIT:0> ) { stackSize = <NUM_LIT:0> ; } itemDamage = <NUM_LIT:0> ; } } public void hitEntity ( EntityLiving par1EntityLiving , EntityPlayer par2EntityPlayer ) { boolean flag = Item . itemsList [ itemID ] . hitEntity ( this , par1EntityLiving , par2EntityPlayer ) ; if ( flag ) { par2EntityPlayer . addStat ( StatList . objectUseStats [ itemID ] , <NUM_LIT:1> ) ; } } public void onDestroyBlock ( int par1 , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { boolean flag = Item . itemsList [ itemID ] . onBlockDestroyed ( this , par1 , par2 , par3 , par4 , par5EntityPlayer ) ; if ( flag ) { par5EntityPlayer . addStat ( StatList . objectUseStats [ itemID ] , <NUM_LIT:1> ) ; } } public int getDamageVsEntity ( Entity par1Entity ) { return Item . itemsList [ itemID ] . getDamageVsEntity ( par1Entity ) ; } public boolean canHarvestBlock ( Block par1Block ) { return Item . itemsList [ itemID ] . canHarvestBlock ( par1Block ) ; } public void onItemDestroyedByUse ( EntityPlayer entityplayer ) { } public void useItemOnEntity ( EntityLiving par1EntityLiving ) { Item . itemsList [ itemID ] . useItemOnEntity ( this , par1EntityLiving ) ; } public ItemStack copy ( ) { ItemStack itemstack = new ItemStack ( itemID , stackSize , itemDamage ) ; if ( stackTagCompound != null ) { itemstack . stackTagCompound = ( NBTTagCompound ) stackTagCompound . copy ( ) ; if ( ! itemstack . stackTagCompound . equals ( stackTagCompound ) ) { return itemstack ; } } return itemstack ; } public static boolean func_46124_a ( ItemStack par0ItemStack , ItemStack par1ItemStack ) { if ( par0ItemStack == null && par1ItemStack == null ) { return true ; } if ( par0ItemStack == null || par1ItemStack == null ) { return false ; } if ( par0ItemStack . stackTagCompound == null && par1ItemStack . stackTagCompound != null ) { return false ; } return par0ItemStack . stackTagCompound == null || par0ItemStack . stackTagCompound . equals ( par1ItemStack . stackTagCompound ) ; } public static boolean areItemStacksEqual ( ItemStack par0ItemStack , ItemStack par1ItemStack ) { if ( par0ItemStack == null && par1ItemStack == null ) { return true ; } if ( par0ItemStack == null || par1ItemStack == null ) { return false ; } else { return par0ItemStack . isItemStackEqual ( par1ItemStack ) ; } } private boolean isItemStackEqual ( ItemStack par1ItemStack ) { if ( stackSize != par1ItemStack . stackSize ) { return false ; } if ( itemID != par1ItemStack . itemID ) { return false ; } if ( itemDamage != par1ItemStack . itemDamage ) { return false ; } if ( stackTagCompound == null && par1ItemStack . stackTagCompound != null ) { return false ; } return stackTagCompound == null || stackTagCompound . equals ( par1ItemStack . stackTagCompound ) ; } public boolean isItemEqual ( ItemStack par1ItemStack ) { return itemID == par1ItemStack . itemID && itemDamage == par1ItemStack . itemDamage ; } public String getItemName ( ) { return Item . itemsList [ itemID ] . getItemNameIS ( this ) ; } public static ItemStack copyItemStack ( ItemStack par0ItemStack ) { return par0ItemStack != null ? par0ItemStack . copy ( ) : null ; } public String toString ( ) { return ( new StringBuilder ( ) ) . append ( stackSize ) . append ( "<STR_LIT:x>" ) . append ( Item . itemsList [ itemID ] . getItemName ( ) ) . append ( "<STR_LIT:@>" ) . append ( itemDamage ) . toString ( ) ; } public void updateAnimation ( World par1World , Entity par2Entity , int par3 , boolean par4 ) { if ( animationsToGo > <NUM_LIT:0> ) { animationsToGo -- ; } Item . itemsList [ itemID ] . onUpdate ( this , par1World , par2Entity , par3 , par4 ) ; } public void onCrafting ( World par1World , EntityPlayer par2EntityPlayer , int par3 ) { par2EntityPlayer . addStat ( StatList . objectCraftStats [ itemID ] , par3 ) ; Item . itemsList [ itemID ] . onCreated ( this , par1World , par2EntityPlayer ) ; } public boolean isStackEqual ( ItemStack par1ItemStack ) { return itemID == par1ItemStack . itemID && stackSize == par1ItemStack . stackSize && itemDamage == par1ItemStack . itemDamage ; } public int getMaxItemUseDuration ( ) { return getItem ( ) . getMaxItemUseDuration ( this ) ; } public EnumAction getItemUseAction ( ) { return getItem ( ) . getItemUseAction ( this ) ; } public void onPlayerStoppedUsing ( World par1World , EntityPlayer par2EntityPlayer , int par3 ) { getItem ( ) . onPlayerStoppedUsing ( this , par1World , par2EntityPlayer , par3 ) ; } public boolean hasTagCompound ( ) { return stackTagCompound != null ; } public NBTTagCompound getTagCompound ( ) { return stackTagCompound ; } public NBTTagList getEnchantmentTagList ( ) { if ( stackTagCompound == null ) { return null ; } else { return ( NBTTagList ) stackTagCompound . getTag ( "<STR_LIT>" ) ; } } public void setTagCompound ( NBTTagCompound par1NBTTagCompound ) { stackTagCompound = par1NBTTagCompound ; } public boolean isItemEnchantable ( ) { if ( ! getItem ( ) . isItemTool ( this ) ) { return false ; } return ! isItemEnchanted ( ) ; } public void addEnchantment ( Enchantment par1Enchantment , int par2 ) { if ( stackTagCompound == null ) { setTagCompound ( new NBTTagCompound ( ) ) ; } if ( ! stackTagCompound . hasKey ( "<STR_LIT>" ) ) { stackTagCompound . setTag ( "<STR_LIT>" , new NBTTagList ( "<STR_LIT>" ) ) ; } NBTTagList nbttaglist = ( NBTTagList ) stackTagCompound . getTag ( "<STR_LIT>" ) ; NBTTagCompound nbttagcompound = new NBTTagCompound ( ) ; nbttagcompound . setShort ( "<STR_LIT:id>" , ( short ) par1Enchantment . effectId ) ; nbttagcompound . setShort ( "<STR_LIT>" , ( byte ) par2 ) ; nbttaglist . appendTag ( nbttagcompound ) ; } public boolean isItemEnchanted ( ) { return stackTagCompound != null && stackTagCompound . hasKey ( "<STR_LIT>" ) ; } } </s>
<s> package net . minecraft . src ; class NetworkMasterThread extends Thread { final NetworkManager netManager ; NetworkMasterThread ( NetworkManager par1NetworkManager ) { netManager = par1NetworkManager ; } @ SuppressWarnings ( "<STR_LIT:deprecation>" ) public void run ( ) { try { Thread . sleep ( <NUM_LIT> ) ; if ( NetworkManager . getReadThread ( netManager ) . isAlive ( ) ) { try { NetworkManager . getReadThread ( netManager ) . stop ( ) ; } catch ( Throwable throwable ) { } } if ( NetworkManager . getWriteThread ( netManager ) . isAlive ( ) ) { try { NetworkManager . getWriteThread ( netManager ) . stop ( ) ; } catch ( Throwable throwable1 ) { } } } catch ( InterruptedException interruptedexception ) { interruptedexception . printStackTrace ( ) ; } } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentVillageWoodHut extends ComponentVillage { private int averageGroundLevel ; private final boolean isTallHouse ; private final int tablePosition ; public ComponentVillageWoodHut ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; averageGroundLevel = - <NUM_LIT:1> ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; isTallHouse = par2Random . nextBoolean ( ) ; tablePosition = par2Random . nextInt ( <NUM_LIT:3> ) ; } public void buildComponent ( StructureComponent structurecomponent , List list , Random random ) { } public static ComponentVillageWoodHut findValidPlacement ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:5> , par5 ) ; if ( ! canVillageGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentVillageWoodHut ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { if ( averageGroundLevel < <NUM_LIT:0> ) { averageGroundLevel = getAverageGroundLevel ( par1World , par3StructureBoundingBox ) ; if ( averageGroundLevel < <NUM_LIT:0> ) { return true ; } boundingBox . offset ( <NUM_LIT:0> , ( ( averageGroundLevel - boundingBox . maxY ) + <NUM_LIT:6> ) - <NUM_LIT:1> , <NUM_LIT:0> ) ; } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:4> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:3> , Block . dirt . blockID , Block . dirt . blockID , false ) ; if ( isTallHouse ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:3> , Block . wood . blockID , Block . wood . blockID , false ) ; } else { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:5> , <NUM_LIT:3> , Block . wood . blockID , Block . wood . blockID , false ) ; } placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , par3StructureBoundingBox ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:0> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:0> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:4> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:4> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:3> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:3> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:0> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:4> , Block . planks . blockID , Block . planks . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; if ( tablePosition > <NUM_LIT:0> ) { placeBlockAtCurrentPosition ( par1World , Block . fence . blockID , <NUM_LIT:0> , tablePosition , <NUM_LIT:1> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . pressurePlatePlanks . blockID , <NUM_LIT:0> , tablePosition , <NUM_LIT:2> , <NUM_LIT:3> , par3StructureBoundingBox ) ; } placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeDoorAtCurrentPosition ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , getMetadataWithOffset ( Block . doorWood . blockID , <NUM_LIT:1> ) ) ; if ( getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) == <NUM_LIT:0> && getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:1> , - <NUM_LIT:1> , - <NUM_LIT:1> , par3StructureBoundingBox ) != <NUM_LIT:0> ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:3> ) , <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) ; } for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:5> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:4> ; j ++ ) { clearCurrentPositionBlocksUpwards ( par1World , j , <NUM_LIT:6> , i , par3StructureBoundingBox ) ; fillCurrentPositionBlocksDownwards ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , j , - <NUM_LIT:1> , i , par3StructureBoundingBox ) ; } } spawnVillagers ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:1> ) ; return true ; } } </s>
<s> package net . minecraft . src ; public abstract class NoiseGenerator { public NoiseGenerator ( ) { } } </s>
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentNetherBridgeCorridor extends ComponentNetherBridgePiece { public ComponentNetherBridgeCorridor ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { getNextComponentX ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:0> , <NUM_LIT:1> , true ) ; } public static ComponentNetherBridgeCorridor createValidComponent ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:7> , <NUM_LIT:5> , par5 ) ; if ( ! isAboveGround ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentNetherBridgeCorridor ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:1> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:3> , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:0> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:4> , Block . netherFence . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; for ( int i = <NUM_LIT:0> ; i <= <NUM_LIT:4> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j <= <NUM_LIT:4> ; j ++ ) { fillCurrentPositionBlocksDownwards ( par1World , Block . netherBrick . blockID , <NUM_LIT:0> , i , - <NUM_LIT:1> , j , par3StructureBoundingBox ) ; } } return true ; } } </s>
<s> package net . minecraft . src ; import java . util . ArrayList ; import java . util . Random ; public class BlockPistonBase extends Block { private boolean isSticky ; private static boolean ignoreUpdates ; public BlockPistonBase ( int par1 , int par2 , boolean par3 ) { super ( par1 , par2 , Material . piston ) ; isSticky = par3 ; setStepSound ( soundStoneFootstep ) ; setHardness ( <NUM_LIT> ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { int i = getOrientation ( par2 ) ; if ( i > <NUM_LIT:5> ) { return blockIndexInTexture ; } if ( par1 == i ) { if ( isExtended ( par2 ) || minX > <NUM_LIT> || minY > <NUM_LIT> || minZ > <NUM_LIT> || maxX < <NUM_LIT> || maxY < <NUM_LIT> || maxZ < <NUM_LIT> ) { return <NUM_LIT> ; } else { return blockIndexInTexture ; } } return par1 != Facing . faceToSide [ i ] ? <NUM_LIT> : <NUM_LIT> ; } public int getRenderType ( ) { return <NUM_LIT:16> ; } public boolean isOpaqueCube ( ) { return false ; } public boolean blockActivated ( World par1World , int par2 , int par3 , int i , EntityPlayer entityplayer ) { return false ; } public void onBlockPlacedBy ( World par1World , int par2 , int par3 , int par4 , EntityLiving par5EntityLiving ) { int i = determineOrientation ( par1World , par2 , par3 , par4 , ( EntityPlayer ) par5EntityLiving ) ; par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i ) ; if ( ! par1World . isRemote && ! ignoreUpdates ) { updatePistonState ( par1World , par2 , par3 , par4 ) ; } } public void onNeighborBlockChange ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( ! par1World . isRemote && ! ignoreUpdates ) { updatePistonState ( par1World , par2 , par3 , par4 ) ; } } public void onBlockAdded ( World par1World , int par2 , int par3 , int par4 ) { if ( ! par1World . isRemote && par1World . getBlockTileEntity ( par2 , par3 , par4 ) == null && ! ignoreUpdates ) { updatePistonState ( par1World , par2 , par3 , par4 ) ; } } private void updatePistonState ( World par1World , int par2 , int par3 , int par4 ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; int j = getOrientation ( i ) ; boolean flag = isIndirectlyPowered ( par1World , par2 , par3 , par4 , j ) ; if ( i == <NUM_LIT:7> ) { return ; } if ( flag && ! isExtended ( i ) ) { if ( canExtend ( par1World , par2 , par3 , par4 , j ) ) { par1World . setBlockMetadata ( par2 , par3 , par4 , j | <NUM_LIT:8> ) ; par1World . playNoteAt ( par2 , par3 , par4 , <NUM_LIT:0> , j ) ; } } else if ( ! flag && isExtended ( i ) ) { par1World . setBlockMetadata ( par2 , par3 , par4 , j ) ; par1World . playNoteAt ( par2 , par3 , par4 , <NUM_LIT:1> , j ) ; } } private boolean isIndirectlyPowered ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( par5 != <NUM_LIT:0> && par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ) { return true ; } if ( par5 != <NUM_LIT:1> && par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 + <NUM_LIT:1> , par4 , <NUM_LIT:1> ) ) { return true ; } if ( par5 != <NUM_LIT:2> && par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 , par4 - <NUM_LIT:1> , <NUM_LIT:2> ) ) { return true ; } if ( par5 != <NUM_LIT:3> && par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 , par4 + <NUM_LIT:1> , <NUM_LIT:3> ) ) { return true ; } if ( par5 != <NUM_LIT:5> && par1World . isBlockIndirectlyProvidingPowerTo ( par2 + <NUM_LIT:1> , par3 , par4 , <NUM_LIT:5> ) ) { return true ; } if ( par5 != <NUM_LIT:4> && par1World . isBlockIndirectlyProvidingPowerTo ( par2 - <NUM_LIT:1> , par3 , par4 , <NUM_LIT:4> ) ) { return true ; } if ( par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 , par4 , <NUM_LIT:0> ) ) { return true ; } if ( par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 + <NUM_LIT:2> , par4 , <NUM_LIT:1> ) ) { return true ; } if ( par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 + <NUM_LIT:1> , par4 - <NUM_LIT:1> , <NUM_LIT:2> ) ) { return true ; } if ( par1World . isBlockIndirectlyProvidingPowerTo ( par2 , par3 + <NUM_LIT:1> , par4 + <NUM_LIT:1> , <NUM_LIT:3> ) ) { return true ; } if ( par1World . isBlockIndirectlyProvidingPowerTo ( par2 - <NUM_LIT:1> , par3 + <NUM_LIT:1> , par4 , <NUM_LIT:4> ) ) { return true ; } return par1World . isBlockIndirectlyProvidingPowerTo ( par2 + <NUM_LIT:1> , par3 + <NUM_LIT:1> , par4 , <NUM_LIT:5> ) ; } public void powerBlock ( World par1World , int par2 , int par3 , int par4 , int par5 , int par6 ) { ignoreUpdates = true ; int i = par6 ; if ( par5 == <NUM_LIT:0> ) { if ( tryExtend ( par1World , par2 , par3 , par4 , i ) ) { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i | <NUM_LIT:8> ) ; par1World . playSoundEffect ( ( double ) par2 + <NUM_LIT> , ( double ) par3 + <NUM_LIT> , ( double ) par4 + <NUM_LIT> , "<STR_LIT>" , <NUM_LIT> , par1World . rand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ; } else { par1World . setBlockMetadata ( par2 , par3 , par4 , i ) ; } } else if ( par5 == <NUM_LIT:1> ) { TileEntity tileentity = par1World . getBlockTileEntity ( par2 + Facing . offsetsXForSide [ i ] , par3 + Facing . offsetsYForSide [ i ] , par4 + Facing . offsetsZForSide [ i ] ) ; if ( tileentity != null && ( tileentity instanceof TileEntityPiston ) ) { ( ( TileEntityPiston ) tileentity ) . clearPistonTileEntity ( ) ; } par1World . setBlockAndMetadata ( par2 , par3 , par4 , Block . pistonMoving . blockID , i ) ; par1World . setBlockTileEntity ( par2 , par3 , par4 , BlockPistonMoving . getTileEntity ( blockID , i , i , false , true ) ) ; if ( isSticky ) { int j = par2 + Facing . offsetsXForSide [ i ] * <NUM_LIT:2> ; int k = par3 + Facing . offsetsYForSide [ i ] * <NUM_LIT:2> ; int l = par4 + Facing . offsetsZForSide [ i ] * <NUM_LIT:2> ; int i1 = par1World . getBlockId ( j , k , l ) ; int j1 = par1World . getBlockMetadata ( j , k , l ) ; boolean flag = false ; if ( i1 == Block . pistonMoving . blockID ) { TileEntity tileentity1 = par1World . getBlockTileEntity ( j , k , l ) ; if ( tileentity1 != null && ( tileentity1 instanceof TileEntityPiston ) ) { TileEntityPiston tileentitypiston = ( TileEntityPiston ) tileentity1 ; if ( tileentitypiston . getPistonOrientation ( ) == i && tileentitypiston . isExtending ( ) ) { tileentitypiston . clearPistonTileEntity ( ) ; i1 = tileentitypiston . getStoredBlockID ( ) ; j1 = tileentitypiston . getBlockMetadata ( ) ; flag = true ; } } } if ( ! flag && i1 > <NUM_LIT:0> && canPushBlock ( i1 , par1World , j , k , l , false ) && ( Block . blocksList [ i1 ] . getMobilityFlag ( ) == <NUM_LIT:0> || i1 == Block . pistonBase . blockID || i1 == Block . pistonStickyBase . blockID ) ) { par2 += Facing . offsetsXForSide [ i ] ; par3 += Facing . offsetsYForSide [ i ] ; par4 += Facing . offsetsZForSide [ i ] ; par1World . setBlockAndMetadata ( par2 , par3 , par4 , Block . pistonMoving . blockID , j1 ) ; par1World . setBlockTileEntity ( par2 , par3 , par4 , BlockPistonMoving . getTileEntity ( i1 , j1 , i , false , false ) ) ; ignoreUpdates = false ; par1World . setBlockWithNotify ( j , k , l , <NUM_LIT:0> ) ; ignoreUpdates = true ; } else if ( ! flag ) { ignoreUpdates = false ; par1World . setBlockWithNotify ( par2 + Facing . offsetsXForSide [ i ] , par3 + Facing . offsetsYForSide [ i ] , par4 + Facing . offsetsZForSide [ i ] , <NUM_LIT:0> ) ; ignoreUpdates = true ; } } else { ignoreUpdates = false ; par1World . setBlockWithNotify ( par2 + Facing . offsetsXForSide [ i ] , par3 + Facing . offsetsYForSide [ i ] , par4 + Facing . offsetsZForSide [ i ] , <NUM_LIT:0> ) ; ignoreUpdates = true ; } par1World . playSoundEffect ( ( double ) par2 + <NUM_LIT> , ( double ) par3 + <NUM_LIT> , ( double ) par4 + <NUM_LIT> , "<STR_LIT>" , <NUM_LIT> , par1World . rand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ; } ignoreUpdates = false ; } public void setBlockBoundsBasedOnState ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { int i = par1IBlockAccess . getBlockMetadata ( par2 , par3 , par4 ) ; if ( isExtended ( i ) ) { switch ( getOrientation ( i ) ) { case <NUM_LIT:0> : setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; break ; case <NUM_LIT:1> : setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; break ; case <NUM_LIT:2> : setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; break ; case <NUM_LIT:3> : setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; break ; case <NUM_LIT:4> : setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; break ; case <NUM_LIT:5> : setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; break ; } } else { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } } public void setBlockBoundsForItemRender ( ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } public void getCollidingBoundingBoxes ( World par1World , int par2 , int par3 , int par4 , AxisAlignedBB par5AxisAlignedBB , ArrayList par6ArrayList ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; super . getCollidingBoundingBoxes ( par1World , par2 , par3 , par4 , par5AxisAlignedBB , par6ArrayList ) ; } public AxisAlignedBB getCollisionBoundingBoxFromPool ( World par1World , int par2 , int par3 , int par4 ) { setBlockBoundsBasedOnState ( par1World , par2 , par3 , par4 ) ; return super . getCollisionBoundingBoxFromPool ( par1World , par2 , par3 , par4 ) ; } public boolean renderAsNormalBlock ( ) { return false ; } public static int getOrientation ( int par0 ) { return par0 & <NUM_LIT:7> ; } public static boolean isExtended ( int par0 ) { return ( par0 & <NUM_LIT:8> ) != <NUM_LIT:0> ; } private static int determineOrientation ( World par0World , int par1 , int par2 , int par3 , EntityPlayer par4EntityPlayer ) { if ( MathHelper . abs ( ( float ) par4EntityPlayer . posX - ( float ) par1 ) < <NUM_LIT> && MathHelper . abs ( ( float ) par4EntityPlayer . posZ - ( float ) par3 ) < <NUM_LIT> ) { double d = ( par4EntityPlayer . posY + <NUM_LIT> ) - ( double ) par4EntityPlayer . yOffset ; if ( d - ( double ) par2 > <NUM_LIT> ) { return <NUM_LIT:1> ; } if ( ( double ) par2 - d > <NUM_LIT> ) { return <NUM_LIT:0> ; } } int i = MathHelper . floor_double ( ( double ) ( ( par4EntityPlayer . rotationYaw * <NUM_LIT> ) / <NUM_LIT> ) + <NUM_LIT> ) & <NUM_LIT:3> ; if ( i == <NUM_LIT:0> ) { return <NUM_LIT:2> ; } if ( i == <NUM_LIT:1> ) { return <NUM_LIT:5> ; } if ( i == <NUM_LIT:2> ) { return <NUM_LIT:3> ; } return i != <NUM_LIT:3> ? <NUM_LIT:0> : <NUM_LIT:4> ; } private static boolean canPushBlock ( int par0 , World par1World , int par2 , int par3 , int par4 , boolean par5 ) { if ( par0 == Block . obsidian . blockID ) { return false ; } if ( par0 == Block . pistonBase . blockID || par0 == Block . pistonStickyBase . blockID ) { if ( isExtended ( par1World . getBlockMetadata ( par2 , par3 , par4 ) ) ) { return false ; } } else { if ( Block . blocksList [ par0 ] . getHardness ( ) == - <NUM_LIT> ) { return false ; } if ( Block . blocksList [ par0 ] . getMobilityFlag ( ) == <NUM_LIT:2> ) { return false ; } if ( ! par5 && Block . blocksList [ par0 ] . getMobilityFlag ( ) == <NUM_LIT:1> ) { return false ; } } return ! ( Block . blocksList [ par0 ] instanceof BlockContainer ) ; } private static boolean canExtend ( World par0World , int par1 , int par2 , int par3 , int par4 ) { int i = par1 + Facing . offsetsXForSide [ par4 ] ; int j = par2 + Facing . offsetsYForSide [ par4 ] ; int k = par3 + Facing . offsetsZForSide [ par4 ] ; int l = <NUM_LIT:0> ; do { if ( l >= <NUM_LIT> ) { break ; } if ( j <= <NUM_LIT:0> || j >= <NUM_LIT:255> ) { return false ; } int i1 = par0World . getBlockId ( i , j , k ) ; if ( i1 == <NUM_LIT:0> ) { break ; } if ( ! canPushBlock ( i1 , par0World , i , j , k , true ) ) { return false ; } if ( Block . blocksList [ i1 ] . getMobilityFlag ( ) == <NUM_LIT:1> ) { break ; } if ( l == <NUM_LIT:12> ) { return false ; } i += Facing . offsetsXForSide [ par4 ] ; j += Facing . offsetsYForSide [ par4 ] ; k += Facing . offsetsZForSide [ par4 ] ; l ++ ; } while ( true ) ; return true ; } private boolean tryExtend ( World par1World , int par2 , int par3 , int par4 , int par5 ) { int i = par2 + Facing . offsetsXForSide [ par5 ] ; int j = par3 + Facing . offsetsYForSide [ par5 ] ; int k = par4 + Facing . offsetsZForSide [ par5 ] ; int l = <NUM_LIT:0> ; do { if ( l >= <NUM_LIT> ) { break ; } if ( j <= <NUM_LIT:0> || j >= <NUM_LIT:255> ) { return false ; } int j1 = par1World . getBlockId ( i , j , k ) ; if ( j1 == <NUM_LIT:0> ) { break ; } if ( ! canPushBlock ( j1 , par1World , i , j , k , true ) ) { return false ; } if ( Block . blocksList [ j1 ] . getMobilityFlag ( ) == <NUM_LIT:1> ) { Block . blocksList [ j1 ] . dropBlockAsItem ( par1World , i , j , k , par1World . getBlockMetadata ( i , j , k ) , <NUM_LIT:0> ) ; par1World . setBlockWithNotify ( i , j , k , <NUM_LIT:0> ) ; break ; } if ( l == <NUM_LIT:12> ) { return false ; } i += Facing . offsetsXForSide [ par5 ] ; j += Facing . offsetsYForSide [ par5 ] ; k += Facing . offsetsZForSide [ par5 ] ; l ++ ; } while ( true ) ; int l1 ; for ( ; i != par2 || j != par3 || k != par4 ; k = l1 ) { int i1 = i - Facing . offsetsXForSide [ par5 ] ; int k1 = j - Facing . offsetsYForSide [ par5 ] ; l1 = k - Facing . offsetsZForSide [ par5 ] ; int i2 = par1World . getBlockId ( i1 , k1 , l1 ) ; int j2 = par1World . getBlockMetadata ( i1 , k1 , l1 ) ; if ( i2 == blockID && i1 == par2 && k1 == par3 && l1 == par4 ) { par1World . setBlockAndMetadata ( i , j , k , Block . pistonMoving . blockID , par5 | ( isSticky ? <NUM_LIT:8> : <NUM_LIT:0> ) ) ; par1World . setBlockTileEntity ( i , j , k , BlockPistonMoving . getTileEntity ( Block . pistonExtension . blockID , par5 | ( isSticky ? <NUM_LIT:8> : <NUM_LIT:0> ) , par5 , true , false ) ) ; } else { par1World . setBlockAndMetadata ( i , j , k , Block . pistonMoving . blockID , j2 ) ; par1World . setBlockTileEntity ( i , j , k , BlockPistonMoving . getTileEntity ( i2 , j2 , par5 , true , false ) ) ; } i = i1 ; j = k1 ; } return true ; } } </s>
<s> package net . minecraft . src ; public class RecipesDyes { public RecipesDyes ( ) { } public void addRecipes ( CraftingManager par1CraftingManager ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:16> ; i ++ ) { par1CraftingManager . addShapelessRecipe ( new ItemStack ( Block . cloth , <NUM_LIT:1> , BlockCloth . getDyeFromBlock ( i ) ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , i ) , new ItemStack ( Item . itemsList [ Block . cloth . blockID ] , <NUM_LIT:1> , <NUM_LIT:0> ) } ) ; } par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:11> ) , new Object [ ] { Block . plantYellow } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:1> ) , new Object [ ] { Block . plantRed } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:3> , <NUM_LIT:15> ) , new Object [ ] { Item . bone } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:9> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:1> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:1> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:11> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:10> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:2> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:8> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:0> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:7> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:8> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:3> , <NUM_LIT:7> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:0> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:12> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:4> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:6> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:4> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:2> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT:5> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:4> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:1> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:2> , <NUM_LIT> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:5> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:9> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:3> , <NUM_LIT> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:4> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:1> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:9> ) } ) ; par1CraftingManager . addShapelessRecipe ( new ItemStack ( Item . dyePowder , <NUM_LIT:4> , <NUM_LIT> ) , new Object [ ] { new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:4> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:1> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:1> ) , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:15> ) } ) ; } } </s>
<s> package net . minecraft . src ; public class SlotCrafting extends Slot { private final IInventory craftMatrix ; private EntityPlayer thePlayer ; private int field_48418_g ; public SlotCrafting ( EntityPlayer par1EntityPlayer , IInventory par2IInventory , IInventory par3IInventory , int par4 , int par5 , int par6 ) { super ( par3IInventory , par4 , par5 , par6 ) ; thePlayer = par1EntityPlayer ; craftMatrix = par2IInventory ; } public boolean isItemValid ( ItemStack par1ItemStack ) { return false ; } public ItemStack decrStackSize ( int par1 ) { if ( getHasStack ( ) ) { field_48418_g += Math . min ( par1 , getStack ( ) . stackSize ) ; } return super . decrStackSize ( par1 ) ; } protected void func_48415_a ( ItemStack par1ItemStack , int par2 ) { field_48418_g += par2 ; func_48416_b ( par1ItemStack ) ; } protected void func_48416_b ( ItemStack par1ItemStack ) { par1ItemStack . onCrafting ( thePlayer . worldObj , thePlayer , field_48418_g ) ; field_48418_g = <NUM_LIT:0> ; if ( par1ItemStack . itemID == Block . workbench . blockID ) { thePlayer . addStat ( AchievementList . buildWorkBench , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Item . pickaxeWood . shiftedIndex ) { thePlayer . addStat ( AchievementList . buildPickaxe , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Block . stoneOvenIdle . blockID ) { thePlayer . addStat ( AchievementList . buildFurnace , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Item . hoeWood . shiftedIndex ) { thePlayer . addStat ( AchievementList . buildHoe , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Item . bread . shiftedIndex ) { thePlayer . addStat ( AchievementList . makeBread , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Item . cake . shiftedIndex ) { thePlayer . addStat ( AchievementList . bakeCake , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Item . pickaxeStone . shiftedIndex ) { thePlayer . addStat ( AchievementList . buildBetterPickaxe , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Item . swordWood . shiftedIndex ) { thePlayer . addStat ( AchievementList . buildSword , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Block . enchantmentTable . blockID ) { thePlayer . addStat ( AchievementList . enchantments , <NUM_LIT:1> ) ; } else if ( par1ItemStack . itemID == Block . bookShelf . blockID ) { thePlayer . addStat ( AchievementList . bookcase , <NUM_LIT:1> ) ; } } public void onPickupFromSlot ( ItemStack par1ItemStack ) { func_48416_b ( par1ItemStack ) ; for ( int i = <NUM_LIT:0> ; i < craftMatrix . getSizeInventory ( ) ; i ++ ) { ItemStack itemstack = craftMatrix . getStackInSlot ( i ) ; if ( itemstack == null ) { continue ; } craftMatrix . decrStackSize ( i , <NUM_LIT:1> ) ; if ( ! itemstack . getItem ( ) . hasContainerItem ( ) ) { continue ; } ItemStack itemstack1 = new ItemStack ( itemstack . getItem ( ) . getContainerItem ( ) ) ; if ( itemstack . getItem ( ) . doesContainerItemLeaveCraftingGrid ( itemstack ) && thePlayer . inventory . addItemStackToInventory ( itemstack1 ) ) { continue ; } if ( craftMatrix . getStackInSlot ( i ) == null ) { craftMatrix . setInventorySlotContents ( i , itemstack1 ) ; } else { thePlayer . dropPlayerItem ( itemstack1 ) ; } } } } </s>
<s> package net . minecraft . src ; import java . util . Random ; public class Teleporter { private Random random ; public Teleporter ( ) { random = new Random ( ) ; } public void placeInPortal ( World par1World , Entity par2Entity ) { if ( par1World . worldProvider . worldType == <NUM_LIT:1> ) { int i = MathHelper . floor_double ( par2Entity . posX ) ; int j = MathHelper . floor_double ( par2Entity . posY ) - <NUM_LIT:1> ; int k = MathHelper . floor_double ( par2Entity . posZ ) ; int l = <NUM_LIT:1> ; int i1 = <NUM_LIT:0> ; for ( int j1 = - <NUM_LIT:2> ; j1 <= <NUM_LIT:2> ; j1 ++ ) { for ( int k1 = - <NUM_LIT:2> ; k1 <= <NUM_LIT:2> ; k1 ++ ) { for ( int l1 = - <NUM_LIT:1> ; l1 < <NUM_LIT:3> ; l1 ++ ) { int i2 = i + k1 * l + j1 * i1 ; int j2 = j + l1 ; int k2 = ( k + k1 * i1 ) - j1 * l ; boolean flag = l1 < <NUM_LIT:0> ; par1World . setBlockWithNotify ( i2 , j2 , k2 , flag ? Block . obsidian . blockID : <NUM_LIT:0> ) ; } } } par2Entity . setLocationAndAngles ( i , j , k , par2Entity . rotationYaw , <NUM_LIT> ) ; par2Entity . motionX = par2Entity . motionY = par2Entity . motionZ = <NUM_LIT> ; return ; } if ( placeInExistingPortal ( par1World , par2Entity ) ) { return ; } else { createPortal ( par1World , par2Entity ) ; placeInExistingPortal ( par1World , par2Entity ) ; return ; } } public boolean placeInExistingPortal ( World par1World , Entity par2Entity ) { char c = '<STR_LIT>' ; double d = - <NUM_LIT> ; int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; int k = <NUM_LIT:0> ; int l = MathHelper . floor_double ( par2Entity . posX ) ; int i1 = MathHelper . floor_double ( par2Entity . posZ ) ; for ( int j1 = l - c ; j1 <= l + c ; j1 ++ ) { double d1 = ( ( double ) j1 + <NUM_LIT> ) - par2Entity . posX ; for ( int j2 = i1 - c ; j2 <= i1 + c ; j2 ++ ) { double d3 = ( ( double ) j2 + <NUM_LIT> ) - par2Entity . posZ ; for ( int k2 = <NUM_LIT> ; k2 >= <NUM_LIT:0> ; k2 -- ) { if ( par1World . getBlockId ( j1 , k2 , j2 ) != Block . portal . blockID ) { continue ; } for ( ; par1World . getBlockId ( j1 , k2 - <NUM_LIT:1> , j2 ) == Block . portal . blockID ; k2 -- ) { } double d5 = ( ( double ) k2 + <NUM_LIT> ) - par2Entity . posY ; double d7 = d1 * d1 + d5 * d5 + d3 * d3 ; if ( d < <NUM_LIT> || d7 < d ) { d = d7 ; i = j1 ; j = k2 ; k = j2 ; } } } } if ( d >= <NUM_LIT> ) { int k1 = i ; int l1 = j ; int i2 = k ; double d2 = ( double ) k1 + <NUM_LIT> ; double d4 = ( double ) l1 + <NUM_LIT> ; double d6 = ( double ) i2 + <NUM_LIT> ; if ( par1World . getBlockId ( k1 - <NUM_LIT:1> , l1 , i2 ) == Block . portal . blockID ) { d2 -= <NUM_LIT> ; } if ( par1World . getBlockId ( k1 + <NUM_LIT:1> , l1 , i2 ) == Block . portal . blockID ) { d2 += <NUM_LIT> ; } if ( par1World . getBlockId ( k1 , l1 , i2 - <NUM_LIT:1> ) == Block . portal . blockID ) { d6 -= <NUM_LIT> ; } if ( par1World . getBlockId ( k1 , l1 , i2 + <NUM_LIT:1> ) == Block . portal . blockID ) { d6 += <NUM_LIT> ; } par2Entity . setLocationAndAngles ( d2 , d4 , d6 , par2Entity . rotationYaw , <NUM_LIT> ) ; par2Entity . motionX = par2Entity . motionY = par2Entity . motionZ = <NUM_LIT> ; return true ; } else { return false ; } } public boolean createPortal ( World par1World , Entity par2Entity ) { byte byte0 = <NUM_LIT:16> ; double d = - <NUM_LIT> ; int i = MathHelper . floor_double ( par2Entity . posX ) ; int j = MathHelper . floor_double ( par2Entity . posY ) ; int k = MathHelper . floor_double ( par2Entity . posZ ) ; int l = i ; int i1 = j ; int j1 = k ; int k1 = <NUM_LIT:0> ; int l1 = random . nextInt ( <NUM_LIT:4> ) ; for ( int i2 = i - byte0 ; i2 <= i + byte0 ; i2 ++ ) { double d1 = ( ( double ) i2 + <NUM_LIT> ) - par2Entity . posX ; for ( int j3 = k - byte0 ; j3 <= k + byte0 ; j3 ++ ) { double d3 = ( ( double ) j3 + <NUM_LIT> ) - par2Entity . posZ ; for ( int k4 = <NUM_LIT> ; k4 >= <NUM_LIT:0> ; k4 -- ) { if ( ! par1World . isAirBlock ( i2 , k4 , j3 ) ) { continue ; } for ( ; k4 > <NUM_LIT:0> && par1World . isAirBlock ( i2 , k4 - <NUM_LIT:1> , j3 ) ; k4 -- ) { } label0 : for ( int k5 = l1 ; k5 < l1 + <NUM_LIT:4> ; k5 ++ ) { int l6 = k5 % <NUM_LIT:2> ; int i8 = <NUM_LIT:1> - l6 ; if ( k5 % <NUM_LIT:4> >= <NUM_LIT:2> ) { l6 = - l6 ; i8 = - i8 ; } for ( int j9 = <NUM_LIT:0> ; j9 < <NUM_LIT:3> ; j9 ++ ) { for ( int k10 = <NUM_LIT:0> ; k10 < <NUM_LIT:4> ; k10 ++ ) { for ( int l11 = - <NUM_LIT:1> ; l11 < <NUM_LIT:4> ; l11 ++ ) { int j12 = i2 + ( k10 - <NUM_LIT:1> ) * l6 + j9 * i8 ; int l12 = k4 + l11 ; int j13 = ( j3 + ( k10 - <NUM_LIT:1> ) * i8 ) - j9 * l6 ; if ( l11 < <NUM_LIT:0> && ! par1World . getBlockMaterial ( j12 , l12 , j13 ) . isSolid ( ) || l11 >= <NUM_LIT:0> && ! par1World . isAirBlock ( j12 , l12 , j13 ) ) { break label0 ; } } } } double d5 = ( ( double ) k4 + <NUM_LIT> ) - par2Entity . posY ; double d7 = d1 * d1 + d5 * d5 + d3 * d3 ; if ( d < <NUM_LIT> || d7 < d ) { d = d7 ; l = i2 ; i1 = k4 ; j1 = j3 ; k1 = k5 % <NUM_LIT:4> ; } } } } } if ( d < <NUM_LIT> ) { for ( int j2 = i - byte0 ; j2 <= i + byte0 ; j2 ++ ) { double d2 = ( ( double ) j2 + <NUM_LIT> ) - par2Entity . posX ; for ( int k3 = k - byte0 ; k3 <= k + byte0 ; k3 ++ ) { double d4 = ( ( double ) k3 + <NUM_LIT> ) - par2Entity . posZ ; for ( int l4 = <NUM_LIT> ; l4 >= <NUM_LIT:0> ; l4 -- ) { if ( ! par1World . isAirBlock ( j2 , l4 , k3 ) ) { continue ; } for ( ; l4 > <NUM_LIT:0> && par1World . isAirBlock ( j2 , l4 - <NUM_LIT:1> , k3 ) ; l4 -- ) { } label1 : for ( int l5 = l1 ; l5 < l1 + <NUM_LIT:2> ; l5 ++ ) { int i7 = l5 % <NUM_LIT:2> ; int j8 = <NUM_LIT:1> - i7 ; for ( int k9 = <NUM_LIT:0> ; k9 < <NUM_LIT:4> ; k9 ++ ) { for ( int l10 = - <NUM_LIT:1> ; l10 < <NUM_LIT:4> ; l10 ++ ) { int i12 = j2 + ( k9 - <NUM_LIT:1> ) * i7 ; int k12 = l4 + l10 ; int i13 = k3 + ( k9 - <NUM_LIT:1> ) * j8 ; if ( l10 < <NUM_LIT:0> && ! par1World . getBlockMaterial ( i12 , k12 , i13 ) . isSolid ( ) || l10 >= <NUM_LIT:0> && ! par1World . isAirBlock ( i12 , k12 , i13 ) ) { break label1 ; } } } double d6 = ( ( double ) l4 + <NUM_LIT> ) - par2Entity . posY ; double d8 = d2 * d2 + d6 * d6 + d4 * d4 ; if ( d < <NUM_LIT> || d8 < d ) { d = d8 ; l = j2 ; i1 = l4 ; j1 = k3 ; k1 = l5 % <NUM_LIT:2> ; } } } } } } int k2 = k1 ; int l2 = l ; int i3 = i1 ; int l3 = j1 ; int i4 = k2 % <NUM_LIT:2> ; int j4 = <NUM_LIT:1> - i4 ; if ( k2 % <NUM_LIT:4> >= <NUM_LIT:2> ) { i4 = - i4 ; j4 = - j4 ; } if ( d < <NUM_LIT> ) { if ( i1 < <NUM_LIT> ) { i1 = <NUM_LIT> ; } if ( i1 > <NUM_LIT> ) { i1 = <NUM_LIT> ; } i3 = i1 ; for ( int i5 = - <NUM_LIT:1> ; i5 <= <NUM_LIT:1> ; i5 ++ ) { for ( int i6 = <NUM_LIT:1> ; i6 < <NUM_LIT:3> ; i6 ++ ) { for ( int j7 = - <NUM_LIT:1> ; j7 < <NUM_LIT:3> ; j7 ++ ) { int k8 = l2 + ( i6 - <NUM_LIT:1> ) * i4 + i5 * j4 ; int l9 = i3 + j7 ; int i11 = ( l3 + ( i6 - <NUM_LIT:1> ) * j4 ) - i5 * i4 ; boolean flag = j7 < <NUM_LIT:0> ; par1World . setBlockWithNotify ( k8 , l9 , i11 , flag ? Block . obsidian . blockID : <NUM_LIT:0> ) ; } } } } for ( int j5 = <NUM_LIT:0> ; j5 < <NUM_LIT:4> ; j5 ++ ) { par1World . editingBlocks = true ; for ( int j6 = <NUM_LIT:0> ; j6 < <NUM_LIT:4> ; j6 ++ ) { for ( int k7 = - <NUM_LIT:1> ; k7 < <NUM_LIT:4> ; k7 ++ ) { int l8 = l2 + ( j6 - <NUM_LIT:1> ) * i4 ; int i10 = i3 + k7 ; int j11 = l3 + ( j6 - <NUM_LIT:1> ) * j4 ; boolean flag1 = j6 == <NUM_LIT:0> || j6 == <NUM_LIT:3> || k7 == - <NUM_LIT:1> || k7 == <NUM_LIT:3> ; par1World . setBlockWithNotify ( l8 , i10 , j11 , flag1 ? Block . obsidian . blockID : Block . portal . blockID ) ; } } par1World . editingBlocks = false ; for ( int k6 = <NUM_LIT:0> ; k6 < <NUM_LIT:4> ; k6 ++ ) { for ( int l7 = - <NUM_LIT:1> ; l7 < <NUM_LIT:4> ; l7 ++ ) { int i9 = l2 + ( k6 - <NUM_LIT:1> ) * i4 ; int j10 = i3 + l7 ; int k11 = l3 + ( k6 - <NUM_LIT:1> ) * j4 ; par1World . notifyBlocksOfNeighborChange ( i9 , j10 , k11 , par1World . getBlockId ( i9 , j10 , k11 ) ) ; } } } return true ; } } </s>
<s> package net . minecraft . src ; public class NibbleArray { public final byte data [ ] ; private final int depthBits ; private final int depthBitsPlusFour ; public NibbleArray ( int par1 , int par2 ) { data = new byte [ par1 > > <NUM_LIT:1> ] ; depthBits = par2 ; depthBitsPlusFour = par2 + <NUM_LIT:4> ; } public NibbleArray ( byte par1ArrayOfByte [ ] , int par2 ) { data = par1ArrayOfByte ; depthBits = par2 ; depthBitsPlusFour = par2 + <NUM_LIT:4> ; } public int get ( int par1 , int par2 , int par3 ) { int i = par2 << depthBitsPlusFour | par3 << depthBits | par1 ; int j = i > > <NUM_LIT:1> ; int k = i & <NUM_LIT:1> ; if ( k == <NUM_LIT:0> ) { return data [ j ] & <NUM_LIT> ; } else { return data [ j ] > > <NUM_LIT:4> & <NUM_LIT> ; } } public void set ( int par1 , int par2 , int par3 , int par4 ) { int i = par2 << depthBitsPlusFour | par3 << depthBits | par1 ; int j = i > > <NUM_LIT:1> ; int k = i & <NUM_LIT:1> ; if ( k == <NUM_LIT:0> ) { data [ j ] = ( byte ) ( data [ j ] & <NUM_LIT> | par4 & <NUM_LIT> ) ; } else { data [ j ] = ( byte ) ( data [ j ] & <NUM_LIT> | ( par4 & <NUM_LIT> ) << <NUM_LIT:4> ) ; } } } </s>
<s> package net . minecraft . src ; public enum EnumMovingObjectType { TILE , ENTITY ; } </s>
<s> package net . minecraft . src ; import java . io . PrintStream ; public class PotionEffect { private int potionID ; private int duration ; private int amplifier ; public PotionEffect ( int par1 , int par2 , int par3 ) { potionID = par1 ; duration = par2 ; amplifier = par3 ; } public PotionEffect ( PotionEffect par1PotionEffect ) { potionID = par1PotionEffect . potionID ; duration = par1PotionEffect . duration ; amplifier = par1PotionEffect . amplifier ; } public void combine ( PotionEffect par1PotionEffect ) { if ( potionID != par1PotionEffect . potionID ) { System . err . println ( "<STR_LIT>" ) ; } if ( par1PotionEffect . amplifier > amplifier ) { amplifier = par1PotionEffect . amplifier ; duration = par1PotionEffect . duration ; } else if ( par1PotionEffect . amplifier == amplifier && duration < par1PotionEffect . duration ) { duration = par1PotionEffect . duration ; } } public int getPotionID ( ) { return potionID ; } public int getDuration ( ) { return duration ; } public int getAmplifier ( ) { return amplifier ; } public boolean onUpdate ( EntityLiving par1EntityLiving ) { if ( duration > <NUM_LIT:0> ) { if ( Potion . potionTypes [ potionID ] . isReady ( duration , amplifier ) ) { performEffect ( par1EntityLiving ) ; } deincrementDuration ( ) ; } return duration > <NUM_LIT:0> ; } private int deincrementDuration ( ) { return -- duration ; } public void performEffect ( EntityLiving par1EntityLiving ) { if ( duration > <NUM_LIT:0> ) { Potion . potionTypes [ potionID ] . performEffect ( par1EntityLiving , amplifier ) ; } } public String getEffectName ( ) { return Potion . potionTypes [ potionID ] . getName ( ) ; } public int hashCode ( ) { return potionID ; } public String toString ( ) { String s = "<STR_LIT>" ; if ( getAmplifier ( ) > <NUM_LIT:0> ) { s = ( new StringBuilder ( ) ) . append ( getEffectName ( ) ) . append ( "<STR_LIT>" ) . append ( getAmplifier ( ) + <NUM_LIT:1> ) . append ( "<STR_LIT>" ) . append ( getDuration ( ) ) . toString ( ) ; } else { s = ( new StringBuilder ( ) ) . append ( getEffectName ( ) ) . append ( "<STR_LIT>" ) . append ( getDuration ( ) ) . toString ( ) ; } if ( Potion . potionTypes [ potionID ] . isUsable ( ) ) { return ( new StringBuilder ( ) ) . append ( "<STR_LIT:(>" ) . append ( s ) . append ( "<STR_LIT:)>" ) . toString ( ) ; } else { return s ; } } public boolean equals ( Object par1Obj ) { if ( ! ( par1Obj instanceof PotionEffect ) ) { return false ; } else { PotionEffect potioneffect = ( PotionEffect ) par1Obj ; return potionID == potioneffect . potionID && amplifier == potioneffect . amplifier && duration == potioneffect . duration ; } } } </s>
<s> package net . minecraft . src ; public abstract class BlockDirectional extends Block { protected BlockDirectional ( int par1 , int par2 , Material par3Material ) { super ( par1 , par2 , par3Material ) ; } protected BlockDirectional ( int par1 , Material par2Material ) { super ( par1 , par2Material ) ; } public static int getDirection ( int par0 ) { return par0 & <NUM_LIT:3> ; } } </s>
<s> package net . minecraft . src ; public abstract class WorldSavedData { public final String mapName ; private boolean dirty ; public WorldSavedData ( String par1Str ) { mapName = par1Str ; } public abstract void readFromNBT ( NBTTagCompound nbttagcompound ) ; public abstract void writeToNBT ( NBTTagCompound nbttagcompound ) ; public void markDirty ( ) { setDirty ( true ) ; } public void setDirty ( boolean par1 ) { dirty = par1 ; } public boolean isDirty ( ) { return dirty ; } } </s>
<s> package net . minecraft . src ; import java . awt . event . WindowAdapter ; import java . awt . event . WindowEvent ; import net . minecraft . server . MinecraftServer ; final class ServerWindowAdapter extends WindowAdapter { final MinecraftServer mcServer ; ServerWindowAdapter ( MinecraftServer par1MinecraftServer ) { mcServer = par1MinecraftServer ; } public void windowClosing ( WindowEvent par1WindowEvent ) { mcServer . initiateShutdown ( ) ; while ( ! mcServer . serverStopped ) { try { Thread . sleep ( <NUM_LIT> ) ; } catch ( InterruptedException interruptedexception ) { interruptedexception . printStackTrace ( ) ; } } System . exit ( <NUM_LIT:0> ) ; } } </s>