text
stringlengths 30
1.67M
|
|---|
<s> package net . minecraft . src ; import java . util . Random ; public class ItemBow extends Item { public ItemBow ( int par1 ) { super ( par1 ) ; maxStackSize = <NUM_LIT:1> ; setMaxDamage ( <NUM_LIT> ) ; } public void onPlayerStoppedUsing ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer , int par4 ) { boolean flag = par3EntityPlayer . capabilities . isCreativeMode || EnchantmentHelper . getEnchantmentLevel ( Enchantment . infinity . effectId , par1ItemStack ) > <NUM_LIT:0> ; if ( flag || par3EntityPlayer . inventory . hasItem ( Item . arrow . shiftedIndex ) ) { int i = getMaxItemUseDuration ( par1ItemStack ) - par4 ; float f = ( float ) i / <NUM_LIT> ; f = ( f * f + f * <NUM_LIT> ) / <NUM_LIT> ; if ( ( double ) f < <NUM_LIT> ) { return ; } if ( f > <NUM_LIT> ) { f = <NUM_LIT> ; } EntityArrow entityarrow = new EntityArrow ( par2World , par3EntityPlayer , f * <NUM_LIT> ) ; if ( f == <NUM_LIT> ) { entityarrow . arrowCritical = true ; } int j = EnchantmentHelper . getEnchantmentLevel ( Enchantment . power . effectId , par1ItemStack ) ; if ( j > <NUM_LIT:0> ) { entityarrow . setDamage ( entityarrow . getDamage ( ) + ( double ) j * <NUM_LIT> + <NUM_LIT> ) ; } int k = EnchantmentHelper . getEnchantmentLevel ( Enchantment . punch . effectId , par1ItemStack ) ; if ( k > <NUM_LIT:0> ) { entityarrow . func_46007_b ( k ) ; } if ( EnchantmentHelper . getEnchantmentLevel ( Enchantment . flame . effectId , par1ItemStack ) > <NUM_LIT:0> ) { entityarrow . setFire ( <NUM_LIT:100> ) ; } par1ItemStack . damageItem ( <NUM_LIT:1> , par3EntityPlayer ) ; par2World . playSoundAtEntity ( par3EntityPlayer , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> / ( itemRand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) + f * <NUM_LIT> ) ; if ( ! flag ) { par3EntityPlayer . inventory . consumeInventoryItem ( Item . arrow . shiftedIndex ) ; } else { entityarrow . doesArrowBelongToPlayer = false ; } if ( ! par2World . isRemote ) { par2World . spawnEntityInWorld ( entityarrow ) ; } } } public ItemStack onFoodEaten ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { return par1ItemStack ; } public int getMaxItemUseDuration ( ItemStack par1ItemStack ) { return <NUM_LIT> ; } public EnumAction getItemUseAction ( ItemStack par1ItemStack ) { return EnumAction . bow ; } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { if ( par3EntityPlayer . capabilities . isCreativeMode || par3EntityPlayer . inventory . hasItem ( Item . arrow . shiftedIndex ) ) { par3EntityPlayer . setItemInUse ( par1ItemStack , getMaxItemUseDuration ( par1ItemStack ) ) ; } return par1ItemStack ; } public int getItemEnchantability ( ) { return <NUM_LIT:1> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Comparator ; class RecipeSorter implements Comparator { final CraftingManager craftingManager ; RecipeSorter ( CraftingManager par1CraftingManager ) { craftingManager = par1CraftingManager ; } public int compareRecipes ( IRecipe par1IRecipe , IRecipe par2IRecipe ) { if ( ( par1IRecipe instanceof ShapelessRecipes ) && ( par2IRecipe instanceof ShapedRecipes ) ) { return <NUM_LIT:1> ; } if ( ( par2IRecipe instanceof ShapelessRecipes ) && ( par1IRecipe instanceof ShapedRecipes ) ) { return - <NUM_LIT:1> ; } if ( par2IRecipe . getRecipeSize ( ) < par1IRecipe . getRecipeSize ( ) ) { return - <NUM_LIT:1> ; } return par2IRecipe . getRecipeSize ( ) <= par1IRecipe . getRecipeSize ( ) ? <NUM_LIT:0> : <NUM_LIT:1> ; } public int compare ( Object par1Obj , Object par2Obj ) { return compareRecipes ( ( IRecipe ) par1Obj , ( IRecipe ) par2Obj ) ; } } </s>
|
<s> package net . minecraft . src ; import java . awt . * ; import java . text . DecimalFormat ; import javax . swing . JComponent ; import javax . swing . Timer ; import net . minecraft . server . MinecraftServer ; public class GuiStatsComponent extends JComponent { private static final DecimalFormat field_40573_a = new DecimalFormat ( "<STR_LIT>" ) ; private int memoryUse [ ] ; private int updateCounter ; private String displayStrings [ ] ; private final MinecraftServer field_40572_e ; public GuiStatsComponent ( MinecraftServer par1MinecraftServer ) { memoryUse = new int [ <NUM_LIT> ] ; updateCounter = <NUM_LIT:0> ; displayStrings = new String [ <NUM_LIT:10> ] ; field_40572_e = par1MinecraftServer ; setPreferredSize ( new Dimension ( <NUM_LIT> , <NUM_LIT> ) ) ; setMinimumSize ( new Dimension ( <NUM_LIT> , <NUM_LIT> ) ) ; setMaximumSize ( new Dimension ( <NUM_LIT> , <NUM_LIT> ) ) ; ( new Timer ( <NUM_LIT> , new GuiStatsListener ( this ) ) ) . start ( ) ; setBackground ( Color . BLACK ) ; } private void updateStats ( ) { int i ; long l = Runtime . getRuntime ( ) . totalMemory ( ) - Runtime . getRuntime ( ) . freeMemory ( ) ; System . gc ( ) ; displayStrings [ <NUM_LIT:0> ] = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( l / <NUM_LIT> / <NUM_LIT> ) . append ( "<STR_LIT>" ) . append ( ( Runtime . getRuntime ( ) . freeMemory ( ) * <NUM_LIT> ) / Runtime . getRuntime ( ) . maxMemory ( ) ) . append ( "<STR_LIT>" ) . toString ( ) ; displayStrings [ <NUM_LIT:1> ] = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( NetworkManager . numReadThreads ) . append ( "<STR_LIT>" ) . append ( NetworkManager . numWriteThreads ) . toString ( ) ; displayStrings [ <NUM_LIT:2> ] = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( field_40573_a . format ( func_48551_a ( field_40572_e . field_40027_f ) * <NUM_LIT> ) ) . append ( "<STR_LIT>" ) . toString ( ) ; displayStrings [ <NUM_LIT:3> ] = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( ( int ) func_48551_a ( field_40572_e . field_48080_u ) ) . append ( "<STR_LIT>" ) . append ( ( int ) func_48551_a ( field_40572_e . field_48079_v ) ) . toString ( ) ; displayStrings [ <NUM_LIT:4> ] = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( ( int ) func_48551_a ( field_40572_e . field_48078_w ) ) . append ( "<STR_LIT>" ) . append ( ( int ) func_48551_a ( field_40572_e . field_48082_x ) ) . toString ( ) ; if ( this . field_40572_e . worldMngr != null ) { for ( int var3 = <NUM_LIT:0> ; var3 < this . field_40572_e . worldMngr . length ; ++ var3 ) { this . displayStrings [ <NUM_LIT:5> + var3 ] = "<STR_LIT>" + var3 + "<STR_LIT>" + field_40573_a . format ( this . func_48551_a ( this . field_40572_e . field_40028_g [ var3 ] ) * <NUM_LIT> ) + "<STR_LIT>" ; if ( this . field_40572_e . worldMngr [ var3 ] != null && this . field_40572_e . worldMngr [ var3 ] . chunkProviderServer != null ) { this . displayStrings [ <NUM_LIT:5> + var3 ] = this . displayStrings [ <NUM_LIT:5> + var3 ] + "<STR_LIT:U+002CU+0020>" + this . field_40572_e . worldMngr [ var3 ] . chunkProviderServer . func_46040_d ( ) ; } } } memoryUse [ updateCounter ++ & <NUM_LIT> ] = ( int ) ( ( func_48551_a ( field_40572_e . field_48079_v ) * <NUM_LIT> ) / <NUM_LIT> ) ; repaint ( ) ; return ; } private double func_48551_a ( long par1ArrayOfLong [ ] ) { long l = <NUM_LIT> ; for ( int i = <NUM_LIT:0> ; i < par1ArrayOfLong . length ; i ++ ) { l += par1ArrayOfLong [ i ] ; } return ( double ) l / ( double ) par1ArrayOfLong . length ; } public void paint ( Graphics par1Graphics ) { par1Graphics . setColor ( new Color ( <NUM_LIT> ) ) ; par1Graphics . fillRect ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { int k = memoryUse [ i + updateCounter & <NUM_LIT> ] ; par1Graphics . setColor ( new Color ( k + <NUM_LIT> << <NUM_LIT:16> ) ) ; par1Graphics . fillRect ( i , <NUM_LIT:100> - k , <NUM_LIT:1> , k ) ; } par1Graphics . setColor ( Color . BLACK ) ; for ( int j = <NUM_LIT:0> ; j < displayStrings . length ; j ++ ) { String s = displayStrings [ j ] ; if ( s != null ) { par1Graphics . drawString ( s , <NUM_LIT:32> , <NUM_LIT> + j * <NUM_LIT:16> ) ; } } } static void update ( GuiStatsComponent par0GuiStatsComponent ) { par0GuiStatsComponent . updateStats ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class EntityAIMate extends EntityAIBase { private EntityAnimal theAnimal ; World theWorld ; private EntityAnimal targetMate ; int field_48201_b ; float field_48202_c ; public EntityAIMate ( EntityAnimal par1EntityAnimal , float par2 ) { field_48201_b = <NUM_LIT:0> ; theAnimal = par1EntityAnimal ; theWorld = par1EntityAnimal . worldObj ; field_48202_c = par2 ; setMutexBits ( <NUM_LIT:3> ) ; } public boolean shouldExecute ( ) { if ( ! theAnimal . isInLove ( ) ) { return false ; } else { targetMate = func_48198_f ( ) ; return targetMate != null ; } } public boolean continueExecuting ( ) { return targetMate . isEntityAlive ( ) && targetMate . isInLove ( ) && field_48201_b < <NUM_LIT> ; } public void resetTask ( ) { targetMate = null ; field_48201_b = <NUM_LIT:0> ; } public void updateTask ( ) { theAnimal . getLookHelper ( ) . setLookPositionWithEntity ( targetMate , <NUM_LIT> , theAnimal . getVerticalFaceSpeed ( ) ) ; theAnimal . getNavigator ( ) . func_48652_a ( targetMate , field_48202_c ) ; field_48201_b ++ ; if ( field_48201_b == <NUM_LIT> ) { func_48197_i ( ) ; } } private EntityAnimal func_48198_f ( ) { float f = <NUM_LIT> ; List list = theWorld . getEntitiesWithinAABB ( theAnimal . getClass ( ) , theAnimal . boundingBox . expand ( f , f , f ) ) ; for ( Iterator iterator = list . iterator ( ) ; iterator . hasNext ( ) ; ) { Entity entity = ( Entity ) iterator . next ( ) ; EntityAnimal entityanimal = ( EntityAnimal ) entity ; if ( theAnimal . func_48362_b ( entityanimal ) ) { return entityanimal ; } } return null ; } private void func_48197_i ( ) { EntityAnimal entityanimal = theAnimal . spawnBabyAnimal ( targetMate ) ; if ( entityanimal == null ) { return ; } theAnimal . setGrowingAge ( <NUM_LIT> ) ; targetMate . setGrowingAge ( <NUM_LIT> ) ; theAnimal . resetInLove ( ) ; targetMate . resetInLove ( ) ; entityanimal . setGrowingAge ( - <NUM_LIT> ) ; entityanimal . setLocationAndAngles ( theAnimal . posX , theAnimal . posY , theAnimal . posZ , <NUM_LIT> , <NUM_LIT> ) ; theWorld . spawnEntityInWorld ( entityanimal ) ; Random random = theAnimal . getRNG ( ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:7> ; i ++ ) { double d = random . nextGaussian ( ) * <NUM_LIT> ; double d1 = random . nextGaussian ( ) * <NUM_LIT> ; double d2 = random . nextGaussian ( ) * <NUM_LIT> ; theWorld . spawnParticle ( "<STR_LIT>" , ( theAnimal . posX + ( double ) ( random . nextFloat ( ) * theAnimal . width * <NUM_LIT> ) ) - ( double ) theAnimal . width , theAnimal . posY + <NUM_LIT> + ( double ) ( random . nextFloat ( ) * theAnimal . height ) , ( theAnimal . posZ + ( double ) ( random . nextFloat ( ) * theAnimal . width * <NUM_LIT> ) ) - ( double ) theAnimal . width , d , d1 , d2 ) ; } } } </s>
|
<s> package net . minecraft . src ; public class EntityDamageSource extends DamageSource { protected Entity damageSourceEntity ; public EntityDamageSource ( String par1Str , Entity par2Entity ) { super ( par1Str ) ; damageSourceEntity = par2Entity ; } public Entity getEntity ( ) { return damageSourceEntity ; } public String getDeathMessage ( EntityPlayer par1EntityPlayer ) { return StatCollector . translateToLocalFormatted ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( damageType ) . toString ( ) , new Object [ ] { par1EntityPlayer . username , damageSourceEntity . getUsername ( ) } ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import net . minecraft . server . MinecraftServer ; public class ThreadCommandReader extends Thread { final MinecraftServer mcServer ; public ThreadCommandReader ( MinecraftServer par1MinecraftServer ) { mcServer = par1MinecraftServer ; } public void run ( ) { BufferedReader bufferedreader = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String s = null ; try { while ( ! mcServer . serverStopped && MinecraftServer . isServerRunning ( mcServer ) && ( s = bufferedreader . readLine ( ) ) != null ) { mcServer . addCommand ( s , mcServer ) ; } } catch ( IOException ioexception ) { ioexception . printStackTrace ( ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . io . IOException ; import java . net . * ; import java . util . ArrayList ; import java . util . HashMap ; import java . util . logging . Level ; import java . util . logging . Logger ; import net . minecraft . server . MinecraftServer ; public class NetworkListenThread { public static Logger logger = Logger . getLogger ( "<STR_LIT>" ) ; private ServerSocket serverSocket ; private Thread networkAcceptThread ; public volatile boolean isListening ; private int field_977_f ; private ArrayList pendingConnections ; private ArrayList playerList ; public MinecraftServer mcServer ; private HashMap field_35506_i ; public NetworkListenThread ( MinecraftServer par1MinecraftServer , InetAddress par2InetAddress , int par3 ) throws IOException { isListening = false ; field_977_f = <NUM_LIT:0> ; pendingConnections = new ArrayList ( ) ; playerList = new ArrayList ( ) ; field_35506_i = new HashMap ( ) ; mcServer = par1MinecraftServer ; serverSocket = new ServerSocket ( par3 , <NUM_LIT:0> , par2InetAddress ) ; serverSocket . setPerformancePreferences ( <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> ) ; isListening = true ; networkAcceptThread = new NetworkAcceptThread ( this , "<STR_LIT>" , par1MinecraftServer ) ; networkAcceptThread . start ( ) ; } public void func_35505_a ( Socket par1Socket ) { InetAddress inetaddress = par1Socket . getInetAddress ( ) ; synchronized ( field_35506_i ) { field_35506_i . remove ( inetaddress ) ; } } public void addPlayer ( NetServerHandler par1NetServerHandler ) { playerList . add ( par1NetServerHandler ) ; } private void addPendingConnection ( NetLoginHandler par1NetLoginHandler ) { if ( par1NetLoginHandler == null ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } else { pendingConnections . add ( par1NetLoginHandler ) ; return ; } } public void handleNetworkListenThread ( ) { for ( int i = <NUM_LIT:0> ; i < pendingConnections . size ( ) ; i ++ ) { NetLoginHandler netloginhandler = ( NetLoginHandler ) pendingConnections . get ( i ) ; try { netloginhandler . tryLogin ( ) ; } catch ( Exception exception ) { netloginhandler . kickUser ( "<STR_LIT>" ) ; logger . log ( Level . WARNING , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( exception ) . toString ( ) , exception ) ; } if ( netloginhandler . finishedProcessing ) { pendingConnections . remove ( i -- ) ; } netloginhandler . netManager . wakeThreads ( ) ; } for ( int j = <NUM_LIT:0> ; j < playerList . size ( ) ; j ++ ) { NetServerHandler netserverhandler = ( NetServerHandler ) playerList . get ( j ) ; try { netserverhandler . handlePackets ( ) ; } catch ( Exception exception1 ) { logger . log ( Level . WARNING , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( exception1 ) . toString ( ) , exception1 ) ; netserverhandler . kickPlayer ( "<STR_LIT>" ) ; } if ( netserverhandler . connectionClosed ) { playerList . remove ( j -- ) ; } netserverhandler . netManager . wakeThreads ( ) ; } } static ServerSocket getServerSocket ( NetworkListenThread par0NetworkListenThread ) { return par0NetworkListenThread . serverSocket ; } static HashMap func_35504_b ( NetworkListenThread par0NetworkListenThread ) { return par0NetworkListenThread . field_35506_i ; } static int func_712_b ( NetworkListenThread par0NetworkListenThread ) { return par0NetworkListenThread . field_977_f ++ ; } static void func_716_a ( NetworkListenThread par0NetworkListenThread , NetLoginHandler par1NetLoginHandler ) { par0NetworkListenThread . addPendingConnection ( par1NetLoginHandler ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . IOException ; import java . net . Socket ; import java . util . * ; import java . util . logging . Logger ; import net . minecraft . server . MinecraftServer ; public class NetLoginHandler extends NetHandler { public static Logger logger = Logger . getLogger ( "<STR_LIT>" ) ; private static Random rand = new Random ( ) ; public NetworkManager netManager ; public boolean finishedProcessing ; private MinecraftServer mcServer ; private int loginTimer ; private String username ; private Packet1Login packet1login ; private String serverId ; public NetLoginHandler ( MinecraftServer par1MinecraftServer , Socket par2Socket , String par3Str ) throws IOException { finishedProcessing = false ; loginTimer = <NUM_LIT:0> ; username = null ; packet1login = null ; serverId = "<STR_LIT>" ; mcServer = par1MinecraftServer ; netManager = new NetworkManager ( par2Socket , par3Str , this ) ; netManager . chunkDataSendCounter = <NUM_LIT:0> ; } public void tryLogin ( ) { if ( packet1login != null ) { doLogin ( packet1login ) ; packet1login = null ; } if ( loginTimer ++ == <NUM_LIT> ) { kickUser ( "<STR_LIT>" ) ; } else { netManager . processReadPackets ( ) ; } } public void kickUser ( String par1Str ) { try { logger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( getUserAndIPString ( ) ) . append ( "<STR_LIT::U+0020>" ) . append ( par1Str ) . toString ( ) ) ; netManager . addToSendQueue ( new Packet255KickDisconnect ( par1Str ) ) ; netManager . serverShutdown ( ) ; finishedProcessing = true ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } public void handleHandshake ( Packet2Handshake par1Packet2Handshake ) { if ( mcServer . onlineMode ) { serverId = Long . toString ( rand . nextLong ( ) , <NUM_LIT:16> ) ; netManager . addToSendQueue ( new Packet2Handshake ( serverId ) ) ; } else { netManager . addToSendQueue ( new Packet2Handshake ( "<STR_LIT:->" ) ) ; } } public void handleLogin ( Packet1Login par1Packet1Login ) { username = par1Packet1Login . username ; if ( par1Packet1Login . protocolVersion != <NUM_LIT> ) { if ( par1Packet1Login . protocolVersion > <NUM_LIT> ) { kickUser ( "<STR_LIT>" ) ; } else { kickUser ( "<STR_LIT>" ) ; } return ; } if ( ! mcServer . onlineMode ) { doLogin ( par1Packet1Login ) ; } else { ( new ThreadLoginVerifier ( this , par1Packet1Login ) ) . start ( ) ; } } public void doLogin ( Packet1Login par1Packet1Login ) { EntityPlayerMP entityplayermp = mcServer . configManager . login ( this , par1Packet1Login . username ) ; if ( entityplayermp != null ) { mcServer . configManager . readPlayerDataFromFile ( entityplayermp ) ; entityplayermp . setWorld ( mcServer . getWorldManager ( entityplayermp . dimension ) ) ; entityplayermp . itemInWorldManager . setWorld ( ( WorldServer ) entityplayermp . worldObj ) ; logger . info ( ( new StringBuilder ( ) ) . append ( getUserAndIPString ( ) ) . append ( "<STR_LIT>" ) . append ( entityplayermp . entityId ) . append ( "<STR_LIT>" ) . append ( entityplayermp . posX ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( entityplayermp . posY ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( entityplayermp . posZ ) . append ( "<STR_LIT:)>" ) . toString ( ) ) ; WorldServer worldserver = mcServer . getWorldManager ( entityplayermp . dimension ) ; ChunkCoordinates chunkcoordinates = worldserver . getSpawnPoint ( ) ; entityplayermp . itemInWorldManager . func_35695_b ( worldserver . getWorldInfo ( ) . getGameType ( ) ) ; NetServerHandler netserverhandler = new NetServerHandler ( mcServer , netManager , entityplayermp ) ; netserverhandler . sendPacket ( new Packet1Login ( "<STR_LIT>" , entityplayermp . entityId , worldserver . getWorldInfo ( ) . getTerrainType ( ) , entityplayermp . itemInWorldManager . getGameType ( ) , worldserver . worldProvider . worldType , ( byte ) worldserver . difficultySetting , ( byte ) worldserver . getHeight ( ) , ( byte ) mcServer . configManager . getMaxPlayers ( ) ) ) ; netserverhandler . sendPacket ( new Packet6SpawnPosition ( chunkcoordinates . posX , chunkcoordinates . posY , chunkcoordinates . posZ ) ) ; netserverhandler . sendPacket ( new Packet202PlayerAbilities ( entityplayermp . capabilities ) ) ; mcServer . configManager . func_28170_a ( entityplayermp , worldserver ) ; mcServer . configManager . sendPacketToAllPlayers ( new Packet3Chat ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( entityplayermp . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ) ; mcServer . configManager . playerLoggedIn ( entityplayermp ) ; netserverhandler . teleportTo ( entityplayermp . posX , entityplayermp . posY , entityplayermp . posZ , entityplayermp . rotationYaw , entityplayermp . rotationPitch ) ; mcServer . networkServer . addPlayer ( netserverhandler ) ; netserverhandler . sendPacket ( new Packet4UpdateTime ( worldserver . getWorldTime ( ) ) ) ; PotionEffect potioneffect ; for ( Iterator iterator = entityplayermp . getActivePotionEffects ( ) . iterator ( ) ; iterator . hasNext ( ) ; netserverhandler . sendPacket ( new Packet41EntityEffect ( entityplayermp . entityId , potioneffect ) ) ) { potioneffect = ( PotionEffect ) iterator . next ( ) ; } entityplayermp . func_20057_k ( ) ; } finishedProcessing = true ; } public void handleErrorMessage ( String par1Str , Object par2ArrayOfObj [ ] ) { logger . info ( ( new StringBuilder ( ) ) . append ( getUserAndIPString ( ) ) . append ( "<STR_LIT>" ) . toString ( ) ) ; finishedProcessing = true ; } public void handleServerPing ( Packet254ServerPing par1Packet254ServerPing ) { try { String s = ( new StringBuilder ( ) ) . append ( mcServer . motd ) . append ( "<STR_LIT>" ) . append ( mcServer . configManager . playersOnline ( ) ) . append ( "<STR_LIT>" ) . append ( mcServer . configManager . getMaxPlayers ( ) ) . toString ( ) ; netManager . addToSendQueue ( new Packet255KickDisconnect ( s ) ) ; netManager . serverShutdown ( ) ; mcServer . networkServer . func_35505_a ( netManager . getSocket ( ) ) ; finishedProcessing = true ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } public void registerPacket ( Packet par1Packet ) { kickUser ( "<STR_LIT>" ) ; } public String getUserAndIPString ( ) { if ( username != null ) { return ( new StringBuilder ( ) ) . append ( username ) . append ( "<STR_LIT>" ) . append ( netManager . getRemoteAddress ( ) . toString ( ) ) . append ( "<STR_LIT:]>" ) . toString ( ) ; } else { return netManager . getRemoteAddress ( ) . toString ( ) ; } } public boolean isServerHandler ( ) { return true ; } static String getServerId ( NetLoginHandler par0NetLoginHandler ) { return par0NetLoginHandler . serverId ; } static Packet1Login setLoginPacket ( NetLoginHandler par0NetLoginHandler , Packet1Login par1Packet1Login ) { return par0NetLoginHandler . packet1login = par1Packet1Login ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class ComponentNetherBridgeStartPiece extends ComponentNetherBridgeCrossing3 { public StructureNetherBridgePieceWeight field_40296_a ; public List field_40294_b ; public List field_40295_c ; public ArrayList field_40293_d ; public ComponentNetherBridgeStartPiece ( Random par1Random , int par2 , int par3 ) { super ( par1Random , par2 , par3 ) ; field_40293_d = new ArrayList ( ) ; field_40294_b = new ArrayList ( ) ; StructureNetherBridgePieceWeight astructurenetherbridgepieceweight [ ] = StructureNetherBridgePieces . getPrimaryComponents ( ) ; int i = astructurenetherbridgepieceweight . length ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { StructureNetherBridgePieceWeight structurenetherbridgepieceweight = astructurenetherbridgepieceweight [ j ] ; structurenetherbridgepieceweight . field_40654_c = <NUM_LIT:0> ; field_40294_b . add ( structurenetherbridgepieceweight ) ; } field_40295_c = new ArrayList ( ) ; astructurenetherbridgepieceweight = StructureNetherBridgePieces . getSecondaryComponents ( ) ; i = astructurenetherbridgepieceweight . length ; for ( int k = <NUM_LIT:0> ; k < i ; k ++ ) { StructureNetherBridgePieceWeight structurenetherbridgepieceweight1 = astructurenetherbridgepieceweight [ k ] ; structurenetherbridgepieceweight1 . field_40654_c = <NUM_LIT:0> ; field_40295_c . add ( structurenetherbridgepieceweight1 ) ; } } } </s>
|
<s> package net . minecraft . src ; public abstract class GenLayer { private long worldGenSeed ; protected GenLayer parent ; private long chunkSeed ; private long baseSeed ; public static GenLayer [ ] func_48391_a ( long par0 , WorldType par2WorldType ) { GenLayer obj = new GenLayerIsland ( <NUM_LIT:1L> ) ; obj = new GenLayerFuzzyZoom ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerAddIsland ( <NUM_LIT:1L> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerZoom ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerAddIsland ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerAddSnow ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerZoom ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerAddIsland ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerZoom ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerAddIsland ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; obj = new GenLayerAddMushroomIsland ( <NUM_LIT> , ( ( GenLayer ) ( obj ) ) ) ; byte byte0 = <NUM_LIT:4> ; GenLayer obj1 = obj ; obj1 = GenLayerZoom . func_35025_a ( <NUM_LIT> , ( ( GenLayer ) ( obj1 ) ) , <NUM_LIT:0> ) ; obj1 = new GenLayerRiverInit ( <NUM_LIT> , ( ( GenLayer ) ( obj1 ) ) ) ; obj1 = GenLayerZoom . func_35025_a ( <NUM_LIT> , ( ( GenLayer ) ( obj1 ) ) , byte0 + <NUM_LIT:2> ) ; obj1 = new GenLayerRiver ( <NUM_LIT:1L> , ( ( GenLayer ) ( obj1 ) ) ) ; obj1 = new GenLayerSmooth ( <NUM_LIT> , ( ( GenLayer ) ( obj1 ) ) ) ; GenLayer obj2 = obj ; obj2 = GenLayerZoom . func_35025_a ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) , <NUM_LIT:0> ) ; obj2 = new GenLayerBiome ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) , par2WorldType ) ; obj2 = GenLayerZoom . func_35025_a ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) , <NUM_LIT:2> ) ; obj2 = new GenLayerHills ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) ) ; for ( int i = <NUM_LIT:0> ; i < byte0 ; i ++ ) { obj2 = new GenLayerZoom ( <NUM_LIT:1000> + i , ( ( GenLayer ) ( obj2 ) ) ) ; if ( i == <NUM_LIT:0> ) { obj2 = new GenLayerAddIsland ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) ) ; } if ( i == <NUM_LIT:1> ) { obj2 = new GenLayerShore ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) ) ; } if ( i == <NUM_LIT:1> ) { obj2 = new GenLayerSwampRivers ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) ) ; } } obj2 = new GenLayerSmooth ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) ) ; obj2 = new GenLayerRiverMix ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) , ( ( GenLayer ) ( obj1 ) ) ) ; GenLayerRiverMix genlayerrivermix = ( ( GenLayerRiverMix ) ( obj2 ) ) ; GenLayerVoronoiZoom genlayervoronoizoom = new GenLayerVoronoiZoom ( <NUM_LIT> , ( ( GenLayer ) ( obj2 ) ) ) ; ( ( GenLayer ) ( obj2 ) ) . initWorldGenSeed ( par0 ) ; genlayervoronoizoom . initWorldGenSeed ( par0 ) ; return ( new GenLayer [ ] { obj2 , genlayervoronoizoom , genlayerrivermix } ) ; } public GenLayer ( long par1 ) { baseSeed = par1 ; baseSeed *= baseSeed * <NUM_LIT> + <NUM_LIT> ; baseSeed += par1 ; baseSeed *= baseSeed * <NUM_LIT> + <NUM_LIT> ; baseSeed += par1 ; baseSeed *= baseSeed * <NUM_LIT> + <NUM_LIT> ; baseSeed += par1 ; } public void initWorldGenSeed ( long par1 ) { worldGenSeed = par1 ; if ( parent != null ) { parent . initWorldGenSeed ( par1 ) ; } worldGenSeed *= worldGenSeed * <NUM_LIT> + <NUM_LIT> ; worldGenSeed += baseSeed ; worldGenSeed *= worldGenSeed * <NUM_LIT> + <NUM_LIT> ; worldGenSeed += baseSeed ; worldGenSeed *= worldGenSeed * <NUM_LIT> + <NUM_LIT> ; worldGenSeed += baseSeed ; } public void initChunkSeed ( long par1 , long par3 ) { chunkSeed = worldGenSeed ; chunkSeed *= chunkSeed * <NUM_LIT> + <NUM_LIT> ; chunkSeed += par1 ; chunkSeed *= chunkSeed * <NUM_LIT> + <NUM_LIT> ; chunkSeed += par3 ; chunkSeed *= chunkSeed * <NUM_LIT> + <NUM_LIT> ; chunkSeed += par1 ; chunkSeed *= chunkSeed * <NUM_LIT> + <NUM_LIT> ; chunkSeed += par3 ; } protected int nextInt ( int par1 ) { int i = ( int ) ( ( chunkSeed > > <NUM_LIT:24> ) % ( long ) par1 ) ; if ( i < <NUM_LIT:0> ) { i += par1 ; } chunkSeed *= chunkSeed * <NUM_LIT> + <NUM_LIT> ; chunkSeed += worldGenSeed ; return i ; } public abstract int [ ] getInts ( int i , int j , int k , int l ) ; } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class TileEntityMobSpawner extends TileEntity { public int delay ; private String mobID ; public double yaw ; public double yaw2 ; public TileEntityMobSpawner ( ) { delay = - <NUM_LIT:1> ; yaw2 = <NUM_LIT> ; mobID = "<STR_LIT>" ; delay = <NUM_LIT:20> ; } public void setMobID ( String par1Str ) { mobID = par1Str ; } public boolean anyPlayerInRange ( ) { return worldObj . getClosestPlayer ( ( double ) xCoord + <NUM_LIT> , ( double ) yCoord + <NUM_LIT> , ( double ) zCoord + <NUM_LIT> , <NUM_LIT> ) != null ; } public void updateEntity ( ) { yaw2 = yaw ; if ( ! anyPlayerInRange ( ) ) { return ; } double d = ( float ) xCoord + worldObj . rand . nextFloat ( ) ; double d1 = ( float ) yCoord + worldObj . rand . nextFloat ( ) ; double d2 = ( float ) zCoord + worldObj . rand . nextFloat ( ) ; worldObj . spawnParticle ( "<STR_LIT>" , d , d1 , d2 , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; worldObj . spawnParticle ( "<STR_LIT>" , d , d1 , d2 , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; for ( yaw += <NUM_LIT> / ( ( float ) delay + <NUM_LIT> ) ; yaw > <NUM_LIT> ; ) { yaw -= <NUM_LIT> ; yaw2 -= <NUM_LIT> ; } if ( ! worldObj . isRemote ) { if ( delay == - <NUM_LIT:1> ) { updateDelay ( ) ; } if ( delay > <NUM_LIT:0> ) { delay -- ; return ; } byte byte0 = <NUM_LIT:4> ; for ( int i = <NUM_LIT:0> ; i < byte0 ; i ++ ) { EntityLiving entityliving = ( EntityLiving ) EntityList . createEntityByName ( mobID , worldObj ) ; if ( entityliving == null ) { return ; } int j = worldObj . getEntitiesWithinAABB ( entityliving . getClass ( ) , AxisAlignedBB . getBoundingBoxFromPool ( xCoord , yCoord , zCoord , xCoord + <NUM_LIT:1> , yCoord + <NUM_LIT:1> , zCoord + <NUM_LIT:1> ) . expand ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) . size ( ) ; if ( j >= <NUM_LIT:6> ) { updateDelay ( ) ; return ; } if ( entityliving == null ) { continue ; } double d3 = ( double ) xCoord + ( worldObj . rand . nextDouble ( ) - worldObj . rand . nextDouble ( ) ) * <NUM_LIT> ; double d4 = ( yCoord + worldObj . rand . nextInt ( <NUM_LIT:3> ) ) - <NUM_LIT:1> ; double d5 = ( double ) zCoord + ( worldObj . rand . nextDouble ( ) - worldObj . rand . nextDouble ( ) ) * <NUM_LIT> ; entityliving . setLocationAndAngles ( d3 , d4 , d5 , worldObj . rand . nextFloat ( ) * <NUM_LIT> , <NUM_LIT> ) ; if ( entityliving . getCanSpawnHere ( ) ) { worldObj . spawnEntityInWorld ( entityliving ) ; worldObj . playAuxSFX ( <NUM_LIT> , xCoord , yCoord , zCoord , <NUM_LIT:0> ) ; entityliving . spawnExplosionParticle ( ) ; updateDelay ( ) ; } } } super . updateEntity ( ) ; } private void updateDelay ( ) { delay = <NUM_LIT> + worldObj . rand . nextInt ( <NUM_LIT> ) ; } public void readFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readFromNBT ( par1NBTTagCompound ) ; mobID = par1NBTTagCompound . getString ( "<STR_LIT>" ) ; delay = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; } public void writeToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setString ( "<STR_LIT>" , mobID ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) delay ) ; } public Packet getDescriptionPacket ( ) { int i = EntityList . getIDFromString ( mobID ) ; return new Packet132TileEntityData ( xCoord , yCoord , zCoord , <NUM_LIT:1> , i ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet7UseEntity extends Packet { public int playerEntityId ; public int targetEntity ; public int isLeftClick ; public Packet7UseEntity ( ) { } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { playerEntityId = par1DataInputStream . readInt ( ) ; targetEntity = par1DataInputStream . readInt ( ) ; isLeftClick = par1DataInputStream . readByte ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( playerEntityId ) ; par1DataOutputStream . writeInt ( targetEntity ) ; par1DataOutputStream . writeByte ( isLeftClick ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleUseEntity ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:9> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet5PlayerInventory extends Packet { public int entityID ; public int slot ; public int itemID ; public int itemDamage ; public Packet5PlayerInventory ( ) { } public Packet5PlayerInventory ( int par1 , int par2 , ItemStack par3ItemStack ) { entityID = par1 ; slot = par2 ; if ( par3ItemStack == null ) { itemID = - <NUM_LIT:1> ; itemDamage = <NUM_LIT:0> ; } else { itemID = par3ItemStack . itemID ; itemDamage = par3ItemStack . getItemDamage ( ) ; } } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityID = par1DataInputStream . readInt ( ) ; slot = par1DataInputStream . readShort ( ) ; itemID = par1DataInputStream . readShort ( ) ; itemDamage = par1DataInputStream . readShort ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityID ) ; par1DataOutputStream . writeShort ( slot ) ; par1DataOutputStream . writeShort ( itemID ) ; par1DataOutputStream . writeShort ( itemDamage ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handlePlayerInventory ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:8> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet2Handshake extends Packet { public String username ; public Packet2Handshake ( ) { } public Packet2Handshake ( String par1Str ) { username = par1Str ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { username = readString ( par1DataInputStream , <NUM_LIT> ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { writeString ( username , par1DataOutputStream ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleHandshake ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:4> + username . length ( ) + <NUM_LIT:4> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . Arrays ; public class NBTTagByteArray extends NBTBase { public byte byteArray [ ] ; public NBTTagByteArray ( String par1Str ) { super ( par1Str ) ; } public NBTTagByteArray ( String par1Str , byte par2ArrayOfByte [ ] ) { super ( par1Str ) ; byteArray = par2ArrayOfByte ; } void write ( DataOutput par1DataOutput ) throws IOException { par1DataOutput . writeInt ( byteArray . length ) ; par1DataOutput . write ( byteArray ) ; } void load ( DataInput par1DataInput ) throws IOException { int i = par1DataInput . readInt ( ) ; byteArray = new byte [ i ] ; par1DataInput . readFully ( byteArray ) ; } public byte getId ( ) { return <NUM_LIT:7> ; } public String toString ( ) { return ( new StringBuilder ( ) ) . append ( "<STR_LIT:[>" ) . append ( byteArray . length ) . append ( "<STR_LIT>" ) . toString ( ) ; } public NBTBase copy ( ) { byte abyte0 [ ] = new byte [ byteArray . length ] ; System . arraycopy ( byteArray , <NUM_LIT:0> , abyte0 , <NUM_LIT:0> , byteArray . length ) ; return new NBTTagByteArray ( getName ( ) , abyte0 ) ; } public boolean equals ( Object par1Obj ) { if ( super . equals ( par1Obj ) ) { return Arrays . equals ( byteArray , ( ( NBTTagByteArray ) par1Obj ) . byteArray ) ; } else { return false ; } } public int hashCode ( ) { return super . hashCode ( ) ^ Arrays . hashCode ( byteArray ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class ItemPotion extends Item { private HashMap effectCache ; public ItemPotion ( int par1 ) { super ( par1 ) ; effectCache = new HashMap ( ) ; setMaxStackSize ( <NUM_LIT:1> ) ; setHasSubtypes ( true ) ; setMaxDamage ( <NUM_LIT:0> ) ; } public List getEffects ( ItemStack par1ItemStack ) { return getEffects ( par1ItemStack . getItemDamage ( ) ) ; } public List getEffects ( int par1 ) { List list = ( List ) effectCache . get ( Integer . valueOf ( par1 ) ) ; if ( list == null ) { list = PotionHelper . getPotionEffects ( par1 , false ) ; effectCache . put ( Integer . valueOf ( par1 ) , list ) ; } return list ; } public ItemStack onFoodEaten ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { par1ItemStack . stackSize -- ; if ( ! par2World . isRemote ) { List list = getEffects ( par1ItemStack ) ; if ( list != null ) { PotionEffect potioneffect ; for ( Iterator iterator = list . iterator ( ) ; iterator . hasNext ( ) ; par3EntityPlayer . addPotionEffect ( new PotionEffect ( potioneffect ) ) ) { potioneffect = ( PotionEffect ) iterator . next ( ) ; } } } if ( par1ItemStack . stackSize <= <NUM_LIT:0> ) { return new ItemStack ( Item . glassBottle ) ; } else { par3EntityPlayer . inventory . addItemStackToInventory ( new ItemStack ( Item . glassBottle ) ) ; return par1ItemStack ; } } public int getMaxItemUseDuration ( ItemStack par1ItemStack ) { return <NUM_LIT:32> ; } public EnumAction getItemUseAction ( ItemStack par1ItemStack ) { return EnumAction . drink ; } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { if ( isSplash ( par1ItemStack . getItemDamage ( ) ) ) { par1ItemStack . stackSize -- ; par2World . playSoundAtEntity ( par3EntityPlayer , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> / ( itemRand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ) ; if ( ! par2World . isRemote ) { par2World . spawnEntityInWorld ( new EntityPotion ( par2World , par3EntityPlayer , par1ItemStack . getItemDamage ( ) ) ) ; } return par1ItemStack ; } else { par3EntityPlayer . setItemInUse ( par1ItemStack , getMaxItemUseDuration ( par1ItemStack ) ) ; return par1ItemStack ; } } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int i , int j , int k , int l ) { return false ; } public static boolean isSplash ( int par0 ) { return ( par0 & <NUM_LIT> ) != <NUM_LIT:0> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . logging . Logger ; import net . minecraft . server . MinecraftServer ; public class ConvertProgressUpdater implements IProgressUpdate { private long lastTimeMillis ; final MinecraftServer mcServer ; public ConvertProgressUpdater ( MinecraftServer par1MinecraftServer ) { mcServer = par1MinecraftServer ; lastTimeMillis = System . currentTimeMillis ( ) ; } public void displaySavingString ( String s ) { } public void setLoadingProgress ( int par1 ) { if ( System . currentTimeMillis ( ) - lastTimeMillis >= <NUM_LIT> ) { lastTimeMillis = System . currentTimeMillis ( ) ; MinecraftServer . logger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1 ) . append ( "<STR_LIT:%>" ) . toString ( ) ) ; } } public void displayLoadingString ( String s ) { } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet31RelEntityMove extends Packet30Entity { public Packet31RelEntityMove ( ) { } public Packet31RelEntityMove ( int par1 , byte par2 , byte par3 , byte par4 ) { super ( par1 ) ; xPosition = par2 ; yPosition = par3 ; zPosition = par4 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { super . readPacketData ( par1DataInputStream ) ; xPosition = par1DataInputStream . readByte ( ) ; yPosition = par1DataInputStream . readByte ( ) ; zPosition = par1DataInputStream . readByte ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { super . writePacketData ( par1DataOutputStream ) ; par1DataOutputStream . writeByte ( xPosition ) ; par1DataOutputStream . writeByte ( yPosition ) ; par1DataOutputStream . writeByte ( zPosition ) ; } public int getPacketSize ( ) { return <NUM_LIT:7> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet22Collect extends Packet { public int collectedEntityId ; public int collectorEntityId ; public Packet22Collect ( ) { } public Packet22Collect ( int par1 , int par2 ) { collectedEntityId = par1 ; collectorEntityId = par2 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { collectedEntityId = par1DataInputStream . readInt ( ) ; collectorEntityId = par1DataInputStream . readInt ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( collectedEntityId ) ; par1DataOutputStream . writeInt ( collectorEntityId ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleCollect ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:8> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentStrongholdPrison extends ComponentStronghold { protected final EnumDoor doorType ; public ComponentStrongholdPrison ( 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 ) { getNextComponentNormal ( ( ComponentStrongholdStairs2 ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:1> ) ; } public static ComponentStrongholdPrison 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:9> , <NUM_LIT:5> , <NUM_LIT:11> , par5 ) ; if ( ! canStrongholdGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentStrongholdPrison ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { if ( isLiquidInStructureBoundingBox ( par1World , par3StructureBoundingBox ) ) { return false ; } else { fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:10> , true , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; placeDoor ( par1World , par2Random , par3StructureBoundingBox , doorType , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:10> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:10> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:1> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:3> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:7> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:7> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:9> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:9> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:6> , Block . fenceIron . blockID , Block . fenceIron . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:5> , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:5> , Block . fenceIron . blockID , Block . fenceIron . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . fenceIron . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . fenceIron . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . doorSteel . blockID , getMetadataWithOffset ( Block . doorSteel . blockID , <NUM_LIT:3> ) , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . doorSteel . blockID , getMetadataWithOffset ( Block . doorSteel . blockID , <NUM_LIT:3> ) + <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . doorSteel . blockID , getMetadataWithOffset ( Block . doorSteel . blockID , <NUM_LIT:3> ) , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . doorSteel . blockID , getMetadataWithOffset ( Block . doorSteel . blockID , <NUM_LIT:3> ) + <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:8> , par3StructureBoundingBox ) ; return true ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntityEnderPearl extends EntityThrowable { public EntityEnderPearl ( World par1World ) { super ( par1World ) ; } public EntityEnderPearl ( World par1World , EntityLiving par2EntityLiving ) { super ( par1World , par2EntityLiving ) ; } public EntityEnderPearl ( World par1World , double par2 , double par4 , double par6 ) { super ( par1World , par2 , par4 , par6 ) ; } protected void onImpact ( MovingObjectPosition par1MovingObjectPosition ) { if ( par1MovingObjectPosition . entityHit != null ) { if ( ! par1MovingObjectPosition . entityHit . attackEntityFrom ( DamageSource . causeThrownDamage ( this , thrower ) , <NUM_LIT:0> ) ) ; } for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:32> ; i ++ ) { worldObj . spawnParticle ( "<STR_LIT>" , posX , posY + rand . nextDouble ( ) * <NUM_LIT> , posZ , rand . nextGaussian ( ) , <NUM_LIT> , rand . nextGaussian ( ) ) ; } if ( ! worldObj . isRemote ) { if ( thrower != null ) { thrower . setPositionAndUpdate ( posX , posY , posZ ) ; thrower . fallDistance = <NUM_LIT> ; thrower . attackEntityFrom ( DamageSource . fall , <NUM_LIT:5> ) ; } setDead ( ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntityItem extends Entity { public ItemStack item ; public int age ; public int delayBeforeCanPickup ; private int health ; public float field_432_ae ; public EntityItem ( World par1World , double par2 , double par4 , double par6 , ItemStack par8ItemStack ) { super ( par1World ) ; age = <NUM_LIT:0> ; health = <NUM_LIT:5> ; field_432_ae = ( float ) ( Math . random ( ) * Math . PI * <NUM_LIT> ) ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; yOffset = height / <NUM_LIT> ; setPosition ( par2 , par4 , par6 ) ; item = par8ItemStack ; rotationYaw = ( float ) ( Math . random ( ) * <NUM_LIT> ) ; motionX = ( float ) ( Math . random ( ) * <NUM_LIT> - <NUM_LIT> ) ; motionY = <NUM_LIT> ; motionZ = ( float ) ( Math . random ( ) * <NUM_LIT> - <NUM_LIT> ) ; } protected boolean canTriggerWalking ( ) { return false ; } public EntityItem ( World par1World ) { super ( par1World ) ; age = <NUM_LIT:0> ; health = <NUM_LIT:5> ; field_432_ae = ( float ) ( Math . random ( ) * Math . PI * <NUM_LIT> ) ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; yOffset = height / <NUM_LIT> ; } protected void entityInit ( ) { } public void onUpdate ( ) { super . onUpdate ( ) ; if ( delayBeforeCanPickup > <NUM_LIT:0> ) { delayBeforeCanPickup -- ; } prevPosX = posX ; prevPosY = posY ; prevPosZ = posZ ; motionY -= <NUM_LIT> ; if ( worldObj . getBlockMaterial ( MathHelper . floor_double ( posX ) , MathHelper . floor_double ( posY ) , MathHelper . floor_double ( posZ ) ) == Material . lava ) { motionY = <NUM_LIT> ; motionX = ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> ; motionZ = ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> ; worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> + rand . nextFloat ( ) * <NUM_LIT> ) ; } pushOutOfBlocks ( posX , ( boundingBox . minY + boundingBox . maxY ) / <NUM_LIT> , posZ ) ; moveEntity ( motionX , motionY , motionZ ) ; float f = <NUM_LIT> ; if ( onGround ) { f = <NUM_LIT> ; int i = worldObj . getBlockId ( MathHelper . floor_double ( posX ) , MathHelper . floor_double ( boundingBox . minY ) - <NUM_LIT:1> , MathHelper . floor_double ( posZ ) ) ; if ( i > <NUM_LIT:0> ) { f = Block . blocksList [ i ] . slipperiness * <NUM_LIT> ; } } motionX *= f ; motionY *= <NUM_LIT> ; motionZ *= f ; if ( onGround ) { motionY *= - <NUM_LIT> ; } age ++ ; if ( age >= <NUM_LIT> ) { setDead ( ) ; } } public void func_48316_k ( ) { age = <NUM_LIT> ; } public boolean handleWaterMovement ( ) { return worldObj . handleMaterialAcceleration ( boundingBox , Material . water , this ) ; } protected void dealFireDamage ( int par1 ) { attackEntityFrom ( DamageSource . inFire , par1 ) ; } public boolean attackEntityFrom ( DamageSource par1DamageSource , int par2 ) { setBeenAttacked ( ) ; health -= par2 ; if ( health <= <NUM_LIT:0> ) { setDead ( ) ; } return false ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { par1NBTTagCompound . setShort ( "<STR_LIT>" , ( byte ) health ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) age ) ; par1NBTTagCompound . setCompoundTag ( "<STR_LIT>" , item . writeToNBT ( new NBTTagCompound ( ) ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { health = par1NBTTagCompound . getShort ( "<STR_LIT>" ) & <NUM_LIT> ; age = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; NBTTagCompound nbttagcompound = par1NBTTagCompound . getCompoundTag ( "<STR_LIT>" ) ; item = ItemStack . loadItemStackFromNBT ( nbttagcompound ) ; if ( item == null ) { setDead ( ) ; } } public void onCollideWithPlayer ( EntityPlayer par1EntityPlayer ) { if ( worldObj . isRemote ) { return ; } int i = item . stackSize ; if ( delayBeforeCanPickup == <NUM_LIT:0> && par1EntityPlayer . inventory . addItemStackToInventory ( item ) ) { if ( item . itemID == Block . wood . blockID ) { par1EntityPlayer . triggerAchievement ( AchievementList . mineWood ) ; } if ( item . itemID == Item . leather . shiftedIndex ) { par1EntityPlayer . triggerAchievement ( AchievementList . killCow ) ; } if ( item . itemID == Item . diamond . shiftedIndex ) { par1EntityPlayer . triggerAchievement ( AchievementList . diamonds ) ; } if ( item . itemID == Item . blazeRod . shiftedIndex ) { par1EntityPlayer . triggerAchievement ( AchievementList . blazeRod ) ; } worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , ( ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> + <NUM_LIT> ) * <NUM_LIT> ) ; par1EntityPlayer . onItemPickup ( this , i ) ; if ( item . stackSize <= <NUM_LIT:0> ) { setDead ( ) ; } } } public String getUsername ( ) { return StatCollector . translateToLocal ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( item . getItemName ( ) ) . toString ( ) ) ; } public boolean canAttackWithItem ( ) { return false ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; public class BiomeGenHell extends BiomeGenBase { public BiomeGenHell ( int par1 ) { super ( par1 ) ; spawnableMonsterList . clear ( ) ; spawnableCreatureList . clear ( ) ; spawnableWaterCreatureList . clear ( ) ; spawnableMonsterList . add ( new SpawnListEntry ( net . minecraft . src . EntityGhast . class , <NUM_LIT> , <NUM_LIT:4> , <NUM_LIT:4> ) ) ; spawnableMonsterList . add ( new SpawnListEntry ( net . minecraft . src . EntityPigZombie . class , <NUM_LIT:100> , <NUM_LIT:4> , <NUM_LIT:4> ) ) ; spawnableMonsterList . add ( new SpawnListEntry ( net . minecraft . src . EntityMagmaCube . class , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:4> ) ) ; } } </s>
|
<s> package net . minecraft . src ; public class WatchableObject { private final int objectType ; private final int dataValueId ; private Object watchedObject ; private boolean isWatching ; public WatchableObject ( int par1 , int par2 , Object par3Obj ) { dataValueId = par2 ; watchedObject = par3Obj ; objectType = par1 ; isWatching = true ; } public int getDataValueId ( ) { return dataValueId ; } public void setObject ( Object par1Obj ) { watchedObject = par1Obj ; } public Object getObject ( ) { return watchedObject ; } public int getObjectType ( ) { return objectType ; } public boolean getWatching ( ) { return isWatching ; } public void setWatching ( boolean par1 ) { isWatching = par1 ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockVine extends Block { public BlockVine ( int par1 ) { super ( par1 , <NUM_LIT> , Material . vine ) ; setTickRandomly ( true ) ; } public void setBlockBoundsForItemRender ( ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } public int getRenderType ( ) { return <NUM_LIT:20> ; } public boolean isOpaqueCube ( ) { return false ; } public boolean renderAsNormalBlock ( ) { return false ; } public void setBlockBoundsBasedOnState ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { int i = par1IBlockAccess . getBlockMetadata ( par2 , par3 , par4 ) ; float f = <NUM_LIT> ; float f1 = <NUM_LIT> ; float f2 = <NUM_LIT> ; float f3 = <NUM_LIT> ; float f4 = <NUM_LIT> ; float f5 = <NUM_LIT> ; boolean flag = i > <NUM_LIT:0> ; if ( ( i & <NUM_LIT:2> ) != <NUM_LIT:0> ) { f3 = Math . max ( f3 , <NUM_LIT> ) ; f = <NUM_LIT> ; f1 = <NUM_LIT> ; f4 = <NUM_LIT> ; f2 = <NUM_LIT> ; f5 = <NUM_LIT> ; flag = true ; } if ( ( i & <NUM_LIT:8> ) != <NUM_LIT:0> ) { f = Math . min ( f , <NUM_LIT> ) ; f3 = <NUM_LIT> ; f1 = <NUM_LIT> ; f4 = <NUM_LIT> ; f2 = <NUM_LIT> ; f5 = <NUM_LIT> ; flag = true ; } if ( ( i & <NUM_LIT:4> ) != <NUM_LIT:0> ) { f5 = Math . max ( f5 , <NUM_LIT> ) ; f2 = <NUM_LIT> ; f = <NUM_LIT> ; f3 = <NUM_LIT> ; f1 = <NUM_LIT> ; f4 = <NUM_LIT> ; flag = true ; } if ( ( i & <NUM_LIT:1> ) != <NUM_LIT:0> ) { f2 = Math . min ( f2 , <NUM_LIT> ) ; f5 = <NUM_LIT> ; f = <NUM_LIT> ; f3 = <NUM_LIT> ; f1 = <NUM_LIT> ; f4 = <NUM_LIT> ; flag = true ; } if ( ! flag && canBePlacedOn ( par1IBlockAccess . getBlockId ( par2 , par3 + <NUM_LIT:1> , par4 ) ) ) { f1 = Math . min ( f1 , <NUM_LIT> ) ; f4 = <NUM_LIT> ; f = <NUM_LIT> ; f3 = <NUM_LIT> ; f2 = <NUM_LIT> ; f5 = <NUM_LIT> ; } setBlockBounds ( f , f1 , f2 , f3 , f4 , f5 ) ; } public AxisAlignedBB getCollisionBoundingBoxFromPool ( World par1World , int par2 , int par3 , int i ) { return null ; } public boolean canPlaceBlockOnSide ( World par1World , int par2 , int par3 , int par4 , int par5 ) { switch ( par5 ) { default : return false ; case <NUM_LIT:1> : return canBePlacedOn ( par1World . getBlockId ( par2 , par3 + <NUM_LIT:1> , par4 ) ) ; case <NUM_LIT:2> : return canBePlacedOn ( par1World . getBlockId ( par2 , par3 , par4 + <NUM_LIT:1> ) ) ; case <NUM_LIT:3> : return canBePlacedOn ( par1World . getBlockId ( par2 , par3 , par4 - <NUM_LIT:1> ) ) ; case <NUM_LIT:5> : return canBePlacedOn ( par1World . getBlockId ( par2 - <NUM_LIT:1> , par3 , par4 ) ) ; case <NUM_LIT:4> : return canBePlacedOn ( par1World . getBlockId ( par2 + <NUM_LIT:1> , par3 , par4 ) ) ; } } private boolean canBePlacedOn ( int par1 ) { if ( par1 == <NUM_LIT:0> ) { return false ; } Block block = Block . blocksList [ par1 ] ; return block . renderAsNormalBlock ( ) && block . blockMaterial . blocksMovement ( ) ; } private boolean canVineStay ( World par1World , int par2 , int par3 , int par4 ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; int j = i ; if ( j > <NUM_LIT:0> ) { for ( int k = <NUM_LIT:0> ; k <= <NUM_LIT:3> ; k ++ ) { int l = <NUM_LIT:1> << k ; if ( ( i & l ) != <NUM_LIT:0> && ! canBePlacedOn ( par1World . getBlockId ( par2 + Direction . offsetX [ k ] , par3 , par4 + Direction . offsetZ [ k ] ) ) && ( par1World . getBlockId ( par2 , par3 + <NUM_LIT:1> , par4 ) != blockID || ( par1World . getBlockMetadata ( par2 , par3 + <NUM_LIT:1> , par4 ) & l ) == <NUM_LIT:0> ) ) { j &= ~ l ; } } } if ( j == <NUM_LIT:0> && ! canBePlacedOn ( par1World . getBlockId ( par2 , par3 + <NUM_LIT:1> , par4 ) ) ) { return false ; } if ( j != i ) { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , j ) ; } return true ; } public void onNeighborBlockChange ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( ! par1World . isRemote && ! canVineStay ( 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> ) ; } } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { if ( ! par1World . isRemote && par1World . rand . nextInt ( <NUM_LIT:4> ) == <NUM_LIT:0> ) { byte byte0 = <NUM_LIT:4> ; int i = <NUM_LIT:5> ; boolean flag = false ; int j = par2 - byte0 ; label0 : do { if ( j > par2 + byte0 ) { break ; } label1 : for ( int k = par4 - byte0 ; k <= par4 + byte0 ; k ++ ) { int i1 = par3 - <NUM_LIT:1> ; do { if ( i1 > par3 + <NUM_LIT:1> ) { continue label1 ; } if ( par1World . getBlockId ( j , i1 , k ) == blockID && -- i <= <NUM_LIT:0> ) { flag = true ; break label0 ; } i1 ++ ; } while ( true ) ; } j ++ ; } while ( true ) ; j = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; int l = par1World . rand . nextInt ( <NUM_LIT:6> ) ; int j1 = Direction . vineGrowth [ l ] ; if ( l == <NUM_LIT:1> && par3 < <NUM_LIT:255> && par1World . isAirBlock ( par2 , par3 + <NUM_LIT:1> , par4 ) ) { if ( flag ) { return ; } int k1 = par1World . rand . nextInt ( <NUM_LIT:16> ) & j ; if ( k1 > <NUM_LIT:0> ) { for ( int j2 = <NUM_LIT:0> ; j2 <= <NUM_LIT:3> ; j2 ++ ) { if ( ! canBePlacedOn ( par1World . getBlockId ( par2 + Direction . offsetX [ j2 ] , par3 + <NUM_LIT:1> , par4 + Direction . offsetZ [ j2 ] ) ) ) { k1 &= ~ ( <NUM_LIT:1> << j2 ) ; } } if ( k1 > <NUM_LIT:0> ) { par1World . setBlockAndMetadataWithNotify ( par2 , par3 + <NUM_LIT:1> , par4 , blockID , k1 ) ; } } } else if ( l >= <NUM_LIT:2> && l <= <NUM_LIT:5> && ( j & <NUM_LIT:1> << j1 ) == <NUM_LIT:0> ) { if ( flag ) { return ; } int l1 = par1World . getBlockId ( par2 + Direction . offsetX [ j1 ] , par3 , par4 + Direction . offsetZ [ j1 ] ) ; if ( l1 == <NUM_LIT:0> || Block . blocksList [ l1 ] == null ) { int k2 = j1 + <NUM_LIT:1> & <NUM_LIT:3> ; int j3 = j1 + <NUM_LIT:3> & <NUM_LIT:3> ; if ( ( j & <NUM_LIT:1> << k2 ) != <NUM_LIT:0> && canBePlacedOn ( par1World . getBlockId ( par2 + Direction . offsetX [ j1 ] + Direction . offsetX [ k2 ] , par3 , par4 + Direction . offsetZ [ j1 ] + Direction . offsetZ [ k2 ] ) ) ) { par1World . setBlockAndMetadataWithNotify ( par2 + Direction . offsetX [ j1 ] , par3 , par4 + Direction . offsetZ [ j1 ] , blockID , <NUM_LIT:1> << k2 ) ; } else if ( ( j & <NUM_LIT:1> << j3 ) != <NUM_LIT:0> && canBePlacedOn ( par1World . getBlockId ( par2 + Direction . offsetX [ j1 ] + Direction . offsetX [ j3 ] , par3 , par4 + Direction . offsetZ [ j1 ] + Direction . offsetZ [ j3 ] ) ) ) { par1World . setBlockAndMetadataWithNotify ( par2 + Direction . offsetX [ j1 ] , par3 , par4 + Direction . offsetZ [ j1 ] , blockID , <NUM_LIT:1> << j3 ) ; } else if ( ( j & <NUM_LIT:1> << k2 ) != <NUM_LIT:0> && par1World . isAirBlock ( par2 + Direction . offsetX [ j1 ] + Direction . offsetX [ k2 ] , par3 , par4 + Direction . offsetZ [ j1 ] + Direction . offsetZ [ k2 ] ) && canBePlacedOn ( par1World . getBlockId ( par2 + Direction . offsetX [ k2 ] , par3 , par4 + Direction . offsetZ [ k2 ] ) ) ) { par1World . setBlockAndMetadataWithNotify ( par2 + Direction . offsetX [ j1 ] + Direction . offsetX [ k2 ] , par3 , par4 + Direction . offsetZ [ j1 ] + Direction . offsetZ [ k2 ] , blockID , <NUM_LIT:1> << ( j1 + <NUM_LIT:2> & <NUM_LIT:3> ) ) ; } else if ( ( j & <NUM_LIT:1> << j3 ) != <NUM_LIT:0> && par1World . isAirBlock ( par2 + Direction . offsetX [ j1 ] + Direction . offsetX [ j3 ] , par3 , par4 + Direction . offsetZ [ j1 ] + Direction . offsetZ [ j3 ] ) && canBePlacedOn ( par1World . getBlockId ( par2 + Direction . offsetX [ j3 ] , par3 , par4 + Direction . offsetZ [ j3 ] ) ) ) { par1World . setBlockAndMetadataWithNotify ( par2 + Direction . offsetX [ j1 ] + Direction . offsetX [ j3 ] , par3 , par4 + Direction . offsetZ [ j1 ] + Direction . offsetZ [ j3 ] , blockID , <NUM_LIT:1> << ( j1 + <NUM_LIT:2> & <NUM_LIT:3> ) ) ; } else if ( canBePlacedOn ( par1World . getBlockId ( par2 + Direction . offsetX [ j1 ] , par3 + <NUM_LIT:1> , par4 + Direction . offsetZ [ j1 ] ) ) ) { par1World . setBlockAndMetadataWithNotify ( par2 + Direction . offsetX [ j1 ] , par3 , par4 + Direction . offsetZ [ j1 ] , blockID , <NUM_LIT:0> ) ; } } else if ( Block . blocksList [ l1 ] . blockMaterial . isOpaque ( ) && Block . blocksList [ l1 ] . renderAsNormalBlock ( ) ) { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , j | <NUM_LIT:1> << j1 ) ; } } else if ( par3 > <NUM_LIT:1> ) { int i2 = par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) ; if ( i2 == <NUM_LIT:0> ) { int l2 = par1World . rand . nextInt ( <NUM_LIT:16> ) & j ; if ( l2 > <NUM_LIT:0> ) { par1World . setBlockAndMetadataWithNotify ( par2 , par3 - <NUM_LIT:1> , par4 , blockID , l2 ) ; } } else if ( i2 == blockID ) { int i3 = par1World . rand . nextInt ( <NUM_LIT:16> ) & j ; int k3 = par1World . getBlockMetadata ( par2 , par3 - <NUM_LIT:1> , par4 ) ; if ( k3 != ( k3 | i3 ) ) { par1World . setBlockMetadataWithNotify ( par2 , par3 - <NUM_LIT:1> , par4 , k3 | i3 ) ; } } } } } public void onBlockPlaced ( World par1World , int par2 , int par3 , int par4 , int par5 ) { byte byte0 = <NUM_LIT:0> ; switch ( par5 ) { case <NUM_LIT:2> : byte0 = <NUM_LIT:1> ; break ; case <NUM_LIT:3> : byte0 = <NUM_LIT:4> ; break ; case <NUM_LIT:4> : byte0 = <NUM_LIT:8> ; break ; case <NUM_LIT:5> : byte0 = <NUM_LIT:2> ; break ; } if ( byte0 != <NUM_LIT:0> ) { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , byte0 ) ; } } public int idDropped ( int par1 , Random par2Random , int par3 ) { return <NUM_LIT:0> ; } public int quantityDropped ( Random par1Random ) { return <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 . vine , <NUM_LIT:1> , <NUM_LIT:0> ) ) ; } else { super . harvestBlock ( par1World , par2EntityPlayer , par3 , par4 , par5 , par6 ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . io . BufferedReader ; import java . io . InputStreamReader ; public class ChatAllowedCharacters { public static final String allowedCharacters = getAllowedCharacters ( ) ; public static final char allowedCharactersArray [ ] = { '<CHAR_LIT:/>' , '<STR_LIT:\n>' , '<STR_LIT>' , '<STR_LIT:\t>' , '<STR_LIT>' , '<STR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<STR_LIT:\\>' , '<CHAR_LIT>' , '<CHAR_LIT:>>' , '<CHAR_LIT>' , '<CHAR_LIT:">' , '<CHAR_LIT::>' } ; public ChatAllowedCharacters ( ) { } private static String getAllowedCharacters ( ) { String s = "<STR_LIT>" ; try { BufferedReader bufferedreader = new BufferedReader ( new InputStreamReader ( ( net . minecraft . src . ChatAllowedCharacters . class ) . getResourceAsStream ( "<STR_LIT>" ) , "<STR_LIT:UTF-8>" ) ) ; String s1 = "<STR_LIT>" ; do { String s2 ; if ( ( s2 = bufferedreader . readLine ( ) ) == null ) { break ; } if ( ! s2 . startsWith ( "<STR_LIT:#>" ) ) { s = ( new StringBuilder ( ) ) . append ( s ) . append ( s2 ) . toString ( ) ; } } while ( true ) ; bufferedreader . close ( ) ; } catch ( Exception exception ) { } return s ; } public static final boolean isAllowedCharacter ( char par0 ) { return par0 != '<STR_LIT>' && ( allowedCharacters . indexOf ( par0 ) >= <NUM_LIT:0> || par0 > '<CHAR_LIT:U+0020>' ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . ArrayList ; import java . util . Iterator ; public class EntityAITasks { private ArrayList tasksToDo ; private ArrayList executingTasks ; public EntityAITasks ( ) { tasksToDo = new ArrayList ( ) ; executingTasks = new ArrayList ( ) ; } public void addTask ( int par1 , EntityAIBase par2EntityAIBase ) { tasksToDo . add ( new EntityAITaskEntry ( this , par1 , par2EntityAIBase ) ) ; } public void onUpdateTasks ( ) { ArrayList arraylist = new ArrayList ( ) ; Iterator iterator = tasksToDo . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } EntityAITaskEntry entityaitaskentry = ( EntityAITaskEntry ) iterator . next ( ) ; boolean flag1 = executingTasks . contains ( entityaitaskentry ) ; if ( flag1 ) { if ( func_46136_a ( entityaitaskentry ) && entityaitaskentry . action . continueExecuting ( ) ) { continue ; } entityaitaskentry . action . resetTask ( ) ; executingTasks . remove ( entityaitaskentry ) ; } if ( func_46136_a ( entityaitaskentry ) && entityaitaskentry . action . shouldExecute ( ) ) { arraylist . add ( entityaitaskentry ) ; executingTasks . add ( entityaitaskentry ) ; } } while ( true ) ; boolean flag = false ; if ( flag && arraylist . size ( ) > <NUM_LIT:0> ) { System . out . println ( "<STR_LIT>" ) ; } EntityAITaskEntry entityaitaskentry1 ; for ( Iterator iterator1 = arraylist . iterator ( ) ; iterator1 . hasNext ( ) ; entityaitaskentry1 . action . startExecuting ( ) ) { entityaitaskentry1 = ( EntityAITaskEntry ) iterator1 . next ( ) ; if ( flag ) { System . out . println ( ( new StringBuilder ( ) ) . append ( entityaitaskentry1 . action . toString ( ) ) . append ( "<STR_LIT:U+002CU+0020>" ) . toString ( ) ) ; } } if ( flag && executingTasks . size ( ) > <NUM_LIT:0> ) { System . out . println ( "<STR_LIT>" ) ; } EntityAITaskEntry entityaitaskentry2 ; for ( Iterator iterator2 = executingTasks . iterator ( ) ; iterator2 . hasNext ( ) ; entityaitaskentry2 . action . updateTask ( ) ) { entityaitaskentry2 = ( EntityAITaskEntry ) iterator2 . next ( ) ; if ( flag ) { System . out . println ( entityaitaskentry2 . action . toString ( ) ) ; } } } private boolean func_46136_a ( EntityAITaskEntry par1EntityAITaskEntry ) { label0 : { Iterator iterator = tasksToDo . iterator ( ) ; EntityAITaskEntry entityaitaskentry ; label1 : do { do { do { if ( ! iterator . hasNext ( ) ) { break label0 ; } entityaitaskentry = ( EntityAITaskEntry ) iterator . next ( ) ; } while ( entityaitaskentry == par1EntityAITaskEntry ) ; if ( par1EntityAITaskEntry . priority < entityaitaskentry . priority ) { continue label1 ; } } while ( ! executingTasks . contains ( entityaitaskentry ) || areTasksCompatible ( par1EntityAITaskEntry , entityaitaskentry ) ) ; return false ; } while ( ! executingTasks . contains ( entityaitaskentry ) || entityaitaskentry . action . isContinuous ( ) ) ; return false ; } return true ; } private boolean areTasksCompatible ( EntityAITaskEntry par1EntityAITaskEntry , EntityAITaskEntry par2EntityAITaskEntry ) { return ( par1EntityAITaskEntry . action . getMutexBits ( ) & par2EntityAITaskEntry . action . getMutexBits ( ) ) == <NUM_LIT:0> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockCake extends Block { protected BlockCake ( int par1 , int par2 ) { super ( par1 , par2 , Material . cake ) ; setTickRandomly ( true ) ; } public void setBlockBoundsBasedOnState ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { int i = par1IBlockAccess . getBlockMetadata ( par2 , par3 , par4 ) ; float f = <NUM_LIT> ; float f1 = ( float ) ( <NUM_LIT:1> + i * <NUM_LIT:2> ) / <NUM_LIT> ; float f2 = <NUM_LIT> ; setBlockBounds ( f1 , <NUM_LIT> , f , <NUM_LIT> - f , f2 , <NUM_LIT> - f ) ; } public void setBlockBoundsForItemRender ( ) { float f = <NUM_LIT> ; float f1 = <NUM_LIT> ; setBlockBounds ( f , <NUM_LIT> , f , <NUM_LIT> - f , f1 , <NUM_LIT> - f ) ; } public AxisAlignedBB getCollisionBoundingBoxFromPool ( World par1World , int par2 , int par3 , int par4 ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; float f = <NUM_LIT> ; float f1 = ( float ) ( <NUM_LIT:1> + i * <NUM_LIT:2> ) / <NUM_LIT> ; float f2 = <NUM_LIT> ; return AxisAlignedBB . getBoundingBoxFromPool ( ( float ) par2 + f1 , par3 , ( float ) par4 + f , ( float ) ( par2 + <NUM_LIT:1> ) - f , ( ( float ) par3 + f2 ) - f , ( float ) ( par4 + <NUM_LIT:1> ) - f ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture ; } if ( par1 == <NUM_LIT:0> ) { return blockIndexInTexture + <NUM_LIT:3> ; } if ( par2 > <NUM_LIT:0> && par1 == <NUM_LIT:4> ) { return blockIndexInTexture + <NUM_LIT:2> ; } else { return blockIndexInTexture + <NUM_LIT:1> ; } } public int getBlockTextureFromSide ( int par1 ) { if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture ; } if ( par1 == <NUM_LIT:0> ) { return blockIndexInTexture + <NUM_LIT:3> ; } else { return blockIndexInTexture + <NUM_LIT:1> ; } } public boolean renderAsNormalBlock ( ) { return false ; } public boolean isOpaqueCube ( ) { return false ; } public boolean blockActivated ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { eatCakeSlice ( par1World , par2 , par3 , par4 , par5EntityPlayer ) ; return true ; } public void onBlockClicked ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { eatCakeSlice ( par1World , par2 , par3 , par4 , par5EntityPlayer ) ; } private void eatCakeSlice ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { if ( par5EntityPlayer . canEat ( false ) ) { par5EntityPlayer . getFoodStats ( ) . addStats ( <NUM_LIT:2> , <NUM_LIT> ) ; int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) + <NUM_LIT:1> ; if ( i >= <NUM_LIT:6> ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } else { par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i ) ; par1World . markBlockAsNeedsUpdate ( par2 , par3 , par4 ) ; } } } public boolean canPlaceBlockAt ( World par1World , int par2 , int par3 , int par4 ) { if ( ! super . canPlaceBlockAt ( par1World , par2 , par3 , par4 ) ) { return false ; } else { return canBlockStay ( par1World , par2 , par3 , par4 ) ; } } 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> ) ; } } public boolean canBlockStay ( World par1World , int par2 , int par3 , int par4 ) { return par1World . getBlockMaterial ( par2 , par3 - <NUM_LIT:1> , par4 ) . isSolid ( ) ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:0> ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return <NUM_LIT:0> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentStrongholdChestCorridor extends ComponentStronghold { private static final StructurePieceTreasure chestLoot [ ] ; private final EnumDoor doorType ; private boolean hasMadeChest ; public ComponentStrongholdChestCorridor ( 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 ) { getNextComponentNormal ( ( ComponentStrongholdStairs2 ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:1> ) ; } public static ComponentStrongholdChestCorridor 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 ComponentStrongholdChestCorridor ( 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> ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:4> , Block . stoneBrick . blockID , Block . stoneBrick . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . stairSingle . blockID , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairSingle . blockID , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairSingle . blockID , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairSingle . blockID , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:4> , par3StructureBoundingBox ) ; for ( int i = <NUM_LIT:2> ; i <= <NUM_LIT:4> ; i ++ ) { placeBlockAtCurrentPosition ( par1World , Block . stairSingle . blockID , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; } if ( ! hasMadeChest ) { int j = getYWithOffset ( <NUM_LIT:2> ) ; int k = getXWithOffset ( <NUM_LIT:3> , <NUM_LIT:3> ) ; int l = getZWithOffset ( <NUM_LIT:3> , <NUM_LIT:3> ) ; if ( par3StructureBoundingBox . isVecInside ( k , j , l ) ) { hasMadeChest = true ; createTreasureChestAtCurrentPosition ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:3> , chestLoot , <NUM_LIT:2> + par2Random . nextInt ( <NUM_LIT:2> ) ) ; } } return true ; } static { chestLoot = ( new StructurePieceTreasure [ ] { new StructurePieceTreasure ( Item . enderPearl . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:10> ) , new StructurePieceTreasure ( Item . diamond . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:3> ) , new StructurePieceTreasure ( Item . ingotIron . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:10> ) , new StructurePieceTreasure ( Item . ingotGold . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . redstone . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . bread . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:15> ) , new StructurePieceTreasure ( Item . appleRed . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:15> ) , new StructurePieceTreasure ( Item . pickaxeSteel . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . swordSteel . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . plateSteel . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . helmetSteel . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . legsSteel . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . bootsSteel . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> ) , new StructurePieceTreasure ( Item . appleGold . shiftedIndex , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) } ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . logging . * ; import javax . swing . JTextArea ; import javax . swing . text . Document ; public class GuiLogOutputHandler extends Handler { private int field_998_b [ ] ; private int field_1001_c ; Formatter field_999_a ; private JTextArea field_1000_d ; public GuiLogOutputHandler ( JTextArea par1JTextArea ) { field_998_b = new int [ <NUM_LIT> ] ; field_1001_c = <NUM_LIT:0> ; field_999_a = new GuiLogFormatter ( this ) ; setFormatter ( field_999_a ) ; field_1000_d = par1JTextArea ; } public void close ( ) { } public void flush ( ) { } public void publish ( LogRecord par1LogRecord ) { int i = field_1000_d . getDocument ( ) . getLength ( ) ; field_1000_d . append ( field_999_a . format ( par1LogRecord ) ) ; field_1000_d . setCaretPosition ( field_1000_d . getDocument ( ) . getLength ( ) ) ; int j = field_1000_d . getDocument ( ) . getLength ( ) - i ; if ( field_998_b [ field_1001_c ] != <NUM_LIT:0> ) { field_1000_d . replaceRange ( "<STR_LIT>" , <NUM_LIT:0> , field_998_b [ field_1001_c ] ) ; } field_998_b [ field_1001_c ] = j ; field_1001_c = ( field_1001_c + <NUM_LIT:1> ) % <NUM_LIT> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet52MultiBlockChange extends Packet { public int xPosition ; public int zPosition ; public byte metadataArray [ ] ; public int size ; private static byte field_48123_e [ ] = new byte [ <NUM_LIT:0> ] ; public Packet52MultiBlockChange ( ) { isChunkDataPacket = true ; } public Packet52MultiBlockChange ( int par1 , int par2 , short par3ArrayOfShort [ ] , int par4 , World par5World ) { isChunkDataPacket = true ; xPosition = par1 ; zPosition = par2 ; size = par4 ; int i = <NUM_LIT:4> * par4 ; Chunk chunk = par5World . getChunkFromChunkCoords ( par1 , par2 ) ; try { if ( par4 >= <NUM_LIT> ) { System . out . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par4 ) . toString ( ) ) ; if ( field_48123_e . length < i ) { field_48123_e = new byte [ i ] ; } } else { ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream ( i ) ; DataOutputStream dataoutputstream = new DataOutputStream ( bytearrayoutputstream ) ; for ( int j = <NUM_LIT:0> ; j < par4 ; j ++ ) { int k = par3ArrayOfShort [ j ] > > <NUM_LIT:12> & <NUM_LIT> ; int l = par3ArrayOfShort [ j ] > > <NUM_LIT:8> & <NUM_LIT> ; int i1 = par3ArrayOfShort [ j ] & <NUM_LIT> ; dataoutputstream . writeShort ( par3ArrayOfShort [ j ] ) ; dataoutputstream . writeShort ( ( short ) ( ( chunk . getBlockID ( k , i1 , l ) & <NUM_LIT> ) << <NUM_LIT:4> | chunk . getBlockMetadata ( k , i1 , l ) & <NUM_LIT> ) ) ; } metadataArray = bytearrayoutputstream . toByteArray ( ) ; if ( metadataArray . length != i ) { throw new RuntimeException ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( i ) . append ( "<STR_LIT>" ) . append ( metadataArray . length ) . toString ( ) ) ; } } } catch ( IOException ioexception ) { System . err . println ( ioexception . getMessage ( ) ) ; metadataArray = null ; } } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { xPosition = par1DataInputStream . readInt ( ) ; zPosition = par1DataInputStream . readInt ( ) ; size = par1DataInputStream . readShort ( ) & <NUM_LIT> ; int i = par1DataInputStream . readInt ( ) ; if ( i > <NUM_LIT:0> ) { metadataArray = new byte [ i ] ; par1DataInputStream . readFully ( metadataArray ) ; } } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( xPosition ) ; par1DataOutputStream . writeInt ( zPosition ) ; par1DataOutputStream . writeShort ( ( short ) size ) ; if ( metadataArray != null ) { par1DataOutputStream . writeInt ( metadataArray . length ) ; par1DataOutputStream . write ( metadataArray ) ; } else { par1DataOutputStream . writeInt ( <NUM_LIT:0> ) ; } } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleMultiBlockChange ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:10> + size * <NUM_LIT:4> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . * ; import java . util . logging . Logger ; import net . minecraft . server . MinecraftServer ; public class NetServerHandler extends NetHandler implements ICommandListener { public static Logger logger = Logger . getLogger ( "<STR_LIT>" ) ; public NetworkManager netManager ; public boolean connectionClosed ; private MinecraftServer mcServer ; private EntityPlayerMP playerEntity ; private int field_35009_f ; private int playerInAirTime ; private boolean field_22003_h ; private int field_35013_i ; private long field_35011_j ; private static Random rndmObj = new Random ( ) ; private long field_35010_l ; private int field_45001_m ; private int field_48073_n ; private double lastPosX ; private double lastPosY ; private double lastPosZ ; private boolean hasMoved ; private IntHashMap field_10_k ; public NetServerHandler ( MinecraftServer par1MinecraftServer , NetworkManager par2NetworkManager , EntityPlayerMP par3EntityPlayerMP ) { connectionClosed = false ; field_45001_m = <NUM_LIT:0> ; field_48073_n = <NUM_LIT:0> ; hasMoved = true ; field_10_k = new IntHashMap ( ) ; mcServer = par1MinecraftServer ; netManager = par2NetworkManager ; par2NetworkManager . setNetHandler ( this ) ; playerEntity = par3EntityPlayerMP ; par3EntityPlayerMP . playerNetServerHandler = this ; } public void handlePackets ( ) { field_22003_h = false ; field_35009_f ++ ; netManager . processReadPackets ( ) ; if ( ( long ) field_35009_f - field_35010_l > <NUM_LIT> ) { field_35010_l = field_35009_f ; field_35011_j = System . nanoTime ( ) / <NUM_LIT> ; field_35013_i = rndmObj . nextInt ( ) ; sendPacket ( new Packet0KeepAlive ( field_35013_i ) ) ; } if ( field_45001_m > <NUM_LIT:0> ) { field_45001_m -- ; } if ( field_48073_n > <NUM_LIT:0> ) { field_48073_n -- ; } } public void kickPlayer ( String par1Str ) { if ( connectionClosed ) { return ; } else { playerEntity . func_30002_A ( ) ; sendPacket ( new Packet255KickDisconnect ( par1Str ) ) ; netManager . serverShutdown ( ) ; mcServer . configManager . sendPacketToAllPlayers ( new Packet3Chat ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ) ; mcServer . configManager . playerLoggedOut ( playerEntity ) ; connectionClosed = true ; return ; } } public void handleFlying ( Packet10Flying par1Packet10Flying ) { WorldServer worldserver = mcServer . getWorldManager ( playerEntity . dimension ) ; field_22003_h = true ; if ( playerEntity . gameOver ) { return ; } if ( ! hasMoved ) { double d = par1Packet10Flying . yPosition - lastPosY ; if ( par1Packet10Flying . xPosition == lastPosX && d * d < <NUM_LIT> && par1Packet10Flying . zPosition == lastPosZ ) { hasMoved = true ; } } if ( hasMoved ) { if ( playerEntity . ridingEntity != null ) { float f = playerEntity . rotationYaw ; float f1 = playerEntity . rotationPitch ; playerEntity . ridingEntity . updateRiderPosition ( ) ; double d2 = playerEntity . posX ; double d4 = playerEntity . posY ; double d6 = playerEntity . posZ ; double d8 = <NUM_LIT> ; double d9 = <NUM_LIT> ; if ( par1Packet10Flying . rotating ) { f = par1Packet10Flying . yaw ; f1 = par1Packet10Flying . pitch ; } if ( par1Packet10Flying . moving && par1Packet10Flying . yPosition == - <NUM_LIT> && par1Packet10Flying . stance == - <NUM_LIT> ) { if ( par1Packet10Flying . xPosition > <NUM_LIT> || par1Packet10Flying . zPosition > <NUM_LIT> ) { System . err . println ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ; kickPlayer ( "<STR_LIT>" ) ; return ; } d8 = par1Packet10Flying . xPosition ; d9 = par1Packet10Flying . zPosition ; } playerEntity . onGround = par1Packet10Flying . onGround ; playerEntity . onUpdateEntity ( true ) ; playerEntity . moveEntity ( d8 , <NUM_LIT> , d9 ) ; playerEntity . setPositionAndRotation ( d2 , d4 , d6 , f , f1 ) ; playerEntity . motionX = d8 ; playerEntity . motionZ = d9 ; if ( playerEntity . ridingEntity != null ) { worldserver . func_12017_b ( playerEntity . ridingEntity , true ) ; } if ( playerEntity . ridingEntity != null ) { playerEntity . ridingEntity . updateRiderPosition ( ) ; } mcServer . configManager . serverUpdateMountedMovingPlayer ( playerEntity ) ; lastPosX = playerEntity . posX ; lastPosY = playerEntity . posY ; lastPosZ = playerEntity . posZ ; worldserver . updateEntity ( playerEntity ) ; return ; } if ( playerEntity . isPlayerSleeping ( ) ) { playerEntity . onUpdateEntity ( true ) ; playerEntity . setPositionAndRotation ( lastPosX , lastPosY , lastPosZ , playerEntity . rotationYaw , playerEntity . rotationPitch ) ; worldserver . updateEntity ( playerEntity ) ; return ; } double d1 = playerEntity . posY ; lastPosX = playerEntity . posX ; lastPosY = playerEntity . posY ; lastPosZ = playerEntity . posZ ; double d3 = playerEntity . posX ; double d5 = playerEntity . posY ; double d7 = playerEntity . posZ ; float f2 = playerEntity . rotationYaw ; float f3 = playerEntity . rotationPitch ; if ( par1Packet10Flying . moving && par1Packet10Flying . yPosition == - <NUM_LIT> && par1Packet10Flying . stance == - <NUM_LIT> ) { par1Packet10Flying . moving = false ; } if ( par1Packet10Flying . moving ) { d3 = par1Packet10Flying . xPosition ; d5 = par1Packet10Flying . yPosition ; d7 = par1Packet10Flying . zPosition ; double d10 = par1Packet10Flying . stance - par1Packet10Flying . yPosition ; if ( ! playerEntity . isPlayerSleeping ( ) && ( d10 > <NUM_LIT> || d10 < <NUM_LIT> ) ) { kickPlayer ( "<STR_LIT>" ) ; logger . warning ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . append ( d10 ) . toString ( ) ) ; return ; } if ( Math . abs ( par1Packet10Flying . xPosition ) > <NUM_LIT> || Math . abs ( par1Packet10Flying . zPosition ) > <NUM_LIT> ) { kickPlayer ( "<STR_LIT>" ) ; return ; } } if ( par1Packet10Flying . rotating ) { f2 = par1Packet10Flying . yaw ; f3 = par1Packet10Flying . pitch ; } playerEntity . onUpdateEntity ( true ) ; playerEntity . ySize = <NUM_LIT> ; playerEntity . setPositionAndRotation ( lastPosX , lastPosY , lastPosZ , f2 , f3 ) ; if ( ! hasMoved ) { return ; } double d11 = d3 - playerEntity . posX ; double d12 = d5 - playerEntity . posY ; double d13 = d7 - playerEntity . posZ ; double d14 = d11 * d11 + d12 * d12 + d13 * d13 ; if ( d14 > <NUM_LIT> ) { logger . warning ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ; kickPlayer ( "<STR_LIT>" ) ; return ; } float f4 = <NUM_LIT> ; boolean flag = worldserver . getCollidingBoundingBoxes ( playerEntity , playerEntity . boundingBox . copy ( ) . contract ( f4 , f4 , f4 ) ) . size ( ) == <NUM_LIT:0> ; if ( playerEntity . onGround && ! par1Packet10Flying . onGround && d12 > <NUM_LIT> ) { playerEntity . addExhaustion ( <NUM_LIT> ) ; } playerEntity . moveEntity ( d11 , d12 , d13 ) ; playerEntity . onGround = par1Packet10Flying . onGround ; playerEntity . addMovementStat ( d11 , d12 , d13 ) ; double d15 = d12 ; d11 = d3 - playerEntity . posX ; d12 = d5 - playerEntity . posY ; if ( d12 > - <NUM_LIT> || d12 < <NUM_LIT> ) { d12 = <NUM_LIT> ; } d13 = d7 - playerEntity . posZ ; d14 = d11 * d11 + d12 * d12 + d13 * d13 ; boolean flag1 = false ; if ( d14 > <NUM_LIT> && ! playerEntity . isPlayerSleeping ( ) && ! playerEntity . itemInWorldManager . isCreative ( ) ) { flag1 = true ; logger . warning ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ; System . out . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( d3 ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( d5 ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( d7 ) . toString ( ) ) ; System . out . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( playerEntity . posX ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( playerEntity . posY ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( playerEntity . posZ ) . toString ( ) ) ; } playerEntity . setPositionAndRotation ( d3 , d5 , d7 , f2 , f3 ) ; boolean flag2 = worldserver . getCollidingBoundingBoxes ( playerEntity , playerEntity . boundingBox . copy ( ) . contract ( f4 , f4 , f4 ) ) . size ( ) == <NUM_LIT:0> ; if ( flag && ( flag1 || ! flag2 ) && ! playerEntity . isPlayerSleeping ( ) ) { teleportTo ( lastPosX , lastPosY , lastPosZ , f2 , f3 ) ; return ; } AxisAlignedBB axisalignedbb = playerEntity . boundingBox . copy ( ) . expand ( f4 , f4 , f4 ) . addCoord ( <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> ) ; if ( ! mcServer . allowFlight && ! playerEntity . itemInWorldManager . isCreative ( ) && ! worldserver . isAABBEmpty ( axisalignedbb ) ) { if ( d15 >= - <NUM_LIT> ) { playerInAirTime ++ ; if ( playerInAirTime > <NUM_LIT> ) { logger . warning ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ; kickPlayer ( "<STR_LIT>" ) ; return ; } } } else { playerInAirTime = <NUM_LIT:0> ; } playerEntity . onGround = par1Packet10Flying . onGround ; mcServer . configManager . serverUpdateMountedMovingPlayer ( playerEntity ) ; playerEntity . handleFalling ( playerEntity . posY - d1 , par1Packet10Flying . onGround ) ; } } public void teleportTo ( double par1 , double par3 , double par5 , float par7 , float par8 ) { hasMoved = false ; lastPosX = par1 ; lastPosY = par3 ; lastPosZ = par5 ; playerEntity . setPositionAndRotation ( par1 , par3 , par5 , par7 , par8 ) ; playerEntity . playerNetServerHandler . sendPacket ( new Packet13PlayerLookMove ( par1 , par3 + <NUM_LIT> , par3 , par5 , par7 , par8 , false ) ) ; } public void handleBlockDig ( Packet14BlockDig par1Packet14BlockDig ) { WorldServer worldserver = mcServer . getWorldManager ( playerEntity . dimension ) ; if ( par1Packet14BlockDig . status == <NUM_LIT:4> ) { playerEntity . dropOneItem ( ) ; return ; } if ( par1Packet14BlockDig . status == <NUM_LIT:5> ) { playerEntity . stopUsingItem ( ) ; return ; } boolean flag = worldserver . disableSpawnProtection = worldserver . worldProvider . worldType != <NUM_LIT:0> || mcServer . configManager . isOp ( playerEntity . username ) ; boolean flag1 = false ; if ( par1Packet14BlockDig . status == <NUM_LIT:0> ) { flag1 = true ; } if ( par1Packet14BlockDig . status == <NUM_LIT:2> ) { flag1 = true ; } int i = par1Packet14BlockDig . xPosition ; int j = par1Packet14BlockDig . yPosition ; int k = par1Packet14BlockDig . zPosition ; if ( flag1 ) { double d = playerEntity . posX - ( ( double ) i + <NUM_LIT> ) ; double d1 = ( playerEntity . posY - ( ( double ) j + <NUM_LIT> ) ) + <NUM_LIT> ; double d3 = playerEntity . posZ - ( ( double ) k + <NUM_LIT> ) ; double d5 = d * d + d1 * d1 + d3 * d3 ; if ( d5 > <NUM_LIT> ) { return ; } if ( j >= mcServer . buildLimit ) { return ; } } ChunkCoordinates chunkcoordinates = worldserver . getSpawnPoint ( ) ; int l = MathHelper . abs ( i - chunkcoordinates . posX ) ; int i1 = MathHelper . abs ( k - chunkcoordinates . posZ ) ; if ( l > i1 ) { i1 = l ; } if ( par1Packet14BlockDig . status == <NUM_LIT:0> ) { if ( i1 > <NUM_LIT:16> || flag ) { playerEntity . itemInWorldManager . blockClicked ( i , j , k , par1Packet14BlockDig . face ) ; } else { playerEntity . playerNetServerHandler . sendPacket ( new Packet53BlockChange ( i , j , k , worldserver ) ) ; } } else if ( par1Packet14BlockDig . status == <NUM_LIT:2> ) { playerEntity . itemInWorldManager . blockRemoving ( i , j , k ) ; if ( worldserver . getBlockId ( i , j , k ) != <NUM_LIT:0> ) { playerEntity . playerNetServerHandler . sendPacket ( new Packet53BlockChange ( i , j , k , worldserver ) ) ; } } else if ( par1Packet14BlockDig . status == <NUM_LIT:3> ) { double d2 = playerEntity . posX - ( ( double ) i + <NUM_LIT> ) ; double d4 = playerEntity . posY - ( ( double ) j + <NUM_LIT> ) ; double d6 = playerEntity . posZ - ( ( double ) k + <NUM_LIT> ) ; double d7 = d2 * d2 + d4 * d4 + d6 * d6 ; if ( d7 < <NUM_LIT> ) { playerEntity . playerNetServerHandler . sendPacket ( new Packet53BlockChange ( i , j , k , worldserver ) ) ; } } worldserver . disableSpawnProtection = false ; } public void handlePlace ( Packet15Place par1Packet15Place ) { WorldServer worldserver = mcServer . getWorldManager ( playerEntity . dimension ) ; ItemStack itemstack = playerEntity . inventory . getCurrentItem ( ) ; boolean flag = false ; int i = par1Packet15Place . xPosition ; int j = par1Packet15Place . yPosition ; int k = par1Packet15Place . zPosition ; int l = par1Packet15Place . direction ; boolean flag1 = worldserver . disableSpawnProtection = worldserver . worldProvider . worldType != <NUM_LIT:0> || mcServer . configManager . isOp ( playerEntity . username ) ; if ( par1Packet15Place . direction == <NUM_LIT:255> ) { if ( itemstack == null ) { return ; } playerEntity . itemInWorldManager . itemUsed ( playerEntity , worldserver , itemstack ) ; } else if ( par1Packet15Place . yPosition < mcServer . buildLimit - <NUM_LIT:1> || par1Packet15Place . direction != <NUM_LIT:1> && par1Packet15Place . yPosition < mcServer . buildLimit ) { ChunkCoordinates chunkcoordinates = worldserver . getSpawnPoint ( ) ; int i1 = MathHelper . abs ( i - chunkcoordinates . posX ) ; int j1 = MathHelper . abs ( k - chunkcoordinates . posZ ) ; if ( i1 > j1 ) { j1 = i1 ; } if ( hasMoved && playerEntity . getDistanceSq ( ( double ) i + <NUM_LIT> , ( double ) j + <NUM_LIT> , ( double ) k + <NUM_LIT> ) < <NUM_LIT> && ( j1 > <NUM_LIT:16> || flag1 ) ) { playerEntity . itemInWorldManager . activeBlockOrUseItem ( playerEntity , worldserver , itemstack , i , j , k , l ) ; } flag = true ; } else { playerEntity . playerNetServerHandler . sendPacket ( new Packet3Chat ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( mcServer . buildLimit ) . toString ( ) ) ) ; flag = true ; } if ( flag ) { playerEntity . playerNetServerHandler . sendPacket ( new Packet53BlockChange ( i , j , k , worldserver ) ) ; if ( l == <NUM_LIT:0> ) { j -- ; } if ( l == <NUM_LIT:1> ) { j ++ ; } if ( l == <NUM_LIT:2> ) { k -- ; } if ( l == <NUM_LIT:3> ) { k ++ ; } if ( l == <NUM_LIT:4> ) { i -- ; } if ( l == <NUM_LIT:5> ) { i ++ ; } playerEntity . playerNetServerHandler . sendPacket ( new Packet53BlockChange ( i , j , k , worldserver ) ) ; } itemstack = playerEntity . inventory . getCurrentItem ( ) ; if ( itemstack != null && itemstack . stackSize == <NUM_LIT:0> ) { playerEntity . inventory . mainInventory [ playerEntity . inventory . currentItem ] = null ; itemstack = null ; } if ( itemstack == null || itemstack . getMaxItemUseDuration ( ) == <NUM_LIT:0> ) { playerEntity . isChangingQuantityOnly = true ; playerEntity . inventory . mainInventory [ playerEntity . inventory . currentItem ] = ItemStack . copyItemStack ( playerEntity . inventory . mainInventory [ playerEntity . inventory . currentItem ] ) ; Slot slot = playerEntity . craftingInventory . func_20127_a ( playerEntity . inventory , playerEntity . inventory . currentItem ) ; playerEntity . craftingInventory . updateCraftingResults ( ) ; playerEntity . isChangingQuantityOnly = false ; if ( ! ItemStack . areItemStacksEqual ( playerEntity . inventory . getCurrentItem ( ) , par1Packet15Place . itemStack ) ) { sendPacket ( new Packet103SetSlot ( playerEntity . craftingInventory . windowId , slot . slotNumber , playerEntity . inventory . getCurrentItem ( ) ) ) ; } } worldserver . disableSpawnProtection = false ; } public void handleErrorMessage ( String par1Str , Object par2ArrayOfObj [ ] ) { logger . info ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . append ( par1Str ) . toString ( ) ) ; mcServer . configManager . sendPacketToAllPlayers ( new Packet3Chat ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ) ; mcServer . configManager . playerLoggedOut ( playerEntity ) ; connectionClosed = true ; } public void registerPacket ( Packet par1Packet ) { logger . warning ( ( new StringBuilder ( ) ) . append ( getClass ( ) ) . append ( "<STR_LIT>" ) . append ( par1Packet . getClass ( ) ) . toString ( ) ) ; kickPlayer ( "<STR_LIT>" ) ; } public void sendPacket ( Packet par1Packet ) { netManager . addToSendQueue ( par1Packet ) ; } public void handleBlockItemSwitch ( Packet16BlockItemSwitch par1Packet16BlockItemSwitch ) { if ( par1Packet16BlockItemSwitch . id < <NUM_LIT:0> || par1Packet16BlockItemSwitch . id >= InventoryPlayer . func_25054_e ( ) ) { logger . warning ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ; return ; } else { playerEntity . inventory . currentItem = par1Packet16BlockItemSwitch . id ; return ; } } public void handleChat ( Packet3Chat par1Packet3Chat ) { String s = par1Packet3Chat . message ; if ( s . length ( ) > <NUM_LIT:100> ) { kickPlayer ( "<STR_LIT>" ) ; return ; } s = s . trim ( ) ; for ( int i = <NUM_LIT:0> ; i < s . length ( ) ; i ++ ) { if ( ! ChatAllowedCharacters . isAllowedCharacter ( s . charAt ( i ) ) ) { kickPlayer ( "<STR_LIT>" ) ; return ; } } if ( s . startsWith ( "<STR_LIT:/>" ) ) { handleSlashCommand ( s ) ; } else { s = ( new StringBuilder ( ) ) . append ( "<STR_LIT:<>" ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . append ( s ) . toString ( ) ; logger . info ( s ) ; mcServer . configManager . sendPacketToAllPlayers ( new Packet3Chat ( s ) ) ; } field_45001_m += <NUM_LIT:20> ; if ( field_45001_m > <NUM_LIT> ) { kickPlayer ( "<STR_LIT>" ) ; } } private void handleSlashCommand ( String par1Str ) { if ( par1Str . toLowerCase ( ) . startsWith ( "<STR_LIT>" ) ) { par1Str = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( playerEntity . username ) . append ( "<STR_LIT:U+0020>" ) . append ( par1Str . substring ( par1Str . indexOf ( "<STR_LIT:U+0020>" ) ) . trim ( ) ) . toString ( ) ; logger . info ( par1Str ) ; mcServer . configManager . sendPacketToAllPlayers ( new Packet3Chat ( par1Str ) ) ; } else if ( par1Str . toLowerCase ( ) . startsWith ( "<STR_LIT>" ) ) { playerEntity . attackEntityFrom ( DamageSource . generic , <NUM_LIT:1000> ) ; } else if ( par1Str . toLowerCase ( ) . startsWith ( "<STR_LIT>" ) ) { String as [ ] = par1Str . split ( "<STR_LIT:U+0020>" ) ; if ( as . length >= <NUM_LIT:3> ) { par1Str = par1Str . substring ( par1Str . indexOf ( "<STR_LIT:U+0020>" ) ) . trim ( ) ; par1Str = par1Str . substring ( par1Str . indexOf ( "<STR_LIT:U+0020>" ) ) . trim ( ) ; par1Str = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . append ( par1Str ) . toString ( ) ; logger . info ( ( new StringBuilder ( ) ) . append ( par1Str ) . append ( "<STR_LIT:U+0020toU+0020>" ) . append ( as [ <NUM_LIT:1> ] ) . toString ( ) ) ; if ( ! mcServer . configManager . sendPacketToPlayer ( as [ <NUM_LIT:1> ] , new Packet3Chat ( par1Str ) ) ) { sendPacket ( new Packet3Chat ( "<STR_LIT>" ) ) ; } } } else if ( mcServer . configManager . isOp ( playerEntity . username ) ) { String s = par1Str . substring ( <NUM_LIT:1> ) ; logger . info ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . append ( s ) . toString ( ) ) ; mcServer . addCommand ( s , this ) ; } else { String s1 = par1Str . substring ( <NUM_LIT:1> ) ; logger . info ( ( new StringBuilder ( ) ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . append ( s1 ) . toString ( ) ) ; } } public void handleAnimation ( Packet18Animation par1Packet18Animation ) { if ( par1Packet18Animation . animate == <NUM_LIT:1> ) { playerEntity . swingItem ( ) ; } } public void handleEntityAction ( Packet19EntityAction par1Packet19EntityAction ) { if ( par1Packet19EntityAction . state == <NUM_LIT:1> ) { playerEntity . setSneaking ( true ) ; } else if ( par1Packet19EntityAction . state == <NUM_LIT:2> ) { playerEntity . setSneaking ( false ) ; } else if ( par1Packet19EntityAction . state == <NUM_LIT:4> ) { playerEntity . setSprinting ( true ) ; } else if ( par1Packet19EntityAction . state == <NUM_LIT:5> ) { playerEntity . setSprinting ( false ) ; } else if ( par1Packet19EntityAction . state == <NUM_LIT:3> ) { playerEntity . wakeUpPlayer ( false , true , true ) ; hasMoved = false ; } } public void handleKickDisconnect ( Packet255KickDisconnect par1Packet255KickDisconnect ) { netManager . networkShutdown ( "<STR_LIT>" , new Object [ <NUM_LIT:0> ] ) ; } public int getNumChunkDataPackets ( ) { return netManager . getNumChunkDataPackets ( ) ; } public void log ( String par1Str ) { sendPacket ( new Packet3Chat ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1Str ) . toString ( ) ) ) ; } public String getUsername ( ) { return playerEntity . username ; } public void handleUseEntity ( Packet7UseEntity par1Packet7UseEntity ) { WorldServer worldserver = mcServer . getWorldManager ( playerEntity . dimension ) ; Entity entity = worldserver . func_6158_a ( par1Packet7UseEntity . targetEntity ) ; if ( entity != null ) { boolean flag = playerEntity . canEntityBeSeen ( entity ) ; double d = <NUM_LIT> ; if ( ! flag ) { d = <NUM_LIT> ; } if ( playerEntity . getDistanceSqToEntity ( entity ) < d ) { if ( par1Packet7UseEntity . isLeftClick == <NUM_LIT:0> ) { playerEntity . useCurrentItemOnEntity ( entity ) ; } else if ( par1Packet7UseEntity . isLeftClick == <NUM_LIT:1> ) { playerEntity . attackTargetEntityWithCurrentItem ( entity ) ; } } } } public void handleRespawn ( Packet9Respawn par1Packet9Respawn ) { if ( playerEntity . gameOver ) { playerEntity = mcServer . configManager . recreatePlayerEntity ( playerEntity , <NUM_LIT:0> , true ) ; } else { if ( playerEntity . getHealth ( ) > <NUM_LIT:0> ) { return ; } playerEntity = mcServer . configManager . recreatePlayerEntity ( playerEntity , <NUM_LIT:0> , false ) ; } } public void handleCloseWindow ( Packet101CloseWindow par1Packet101CloseWindow ) { playerEntity . closeCraftingGui ( ) ; } public void handleWindowClick ( Packet102WindowClick par1Packet102WindowClick ) { if ( playerEntity . craftingInventory . windowId == par1Packet102WindowClick . window_Id && playerEntity . craftingInventory . getCanCraft ( playerEntity ) ) { ItemStack itemstack = playerEntity . craftingInventory . slotClick ( par1Packet102WindowClick . inventorySlot , par1Packet102WindowClick . mouseClick , par1Packet102WindowClick . holdingShift , playerEntity ) ; if ( ItemStack . areItemStacksEqual ( par1Packet102WindowClick . itemStack , itemstack ) ) { playerEntity . playerNetServerHandler . sendPacket ( new Packet106Transaction ( par1Packet102WindowClick . window_Id , par1Packet102WindowClick . action , true ) ) ; playerEntity . isChangingQuantityOnly = true ; playerEntity . craftingInventory . updateCraftingResults ( ) ; playerEntity . updateHeldItem ( ) ; playerEntity . isChangingQuantityOnly = false ; } else { field_10_k . addKey ( playerEntity . craftingInventory . windowId , Short . valueOf ( par1Packet102WindowClick . action ) ) ; playerEntity . playerNetServerHandler . sendPacket ( new Packet106Transaction ( par1Packet102WindowClick . window_Id , par1Packet102WindowClick . action , false ) ) ; playerEntity . craftingInventory . setCanCraft ( playerEntity , false ) ; ArrayList arraylist = new ArrayList ( ) ; for ( int i = <NUM_LIT:0> ; i < playerEntity . craftingInventory . inventorySlots . size ( ) ; i ++ ) { arraylist . add ( ( ( Slot ) playerEntity . craftingInventory . inventorySlots . get ( i ) ) . getStack ( ) ) ; } playerEntity . updateCraftingInventory ( playerEntity . craftingInventory , arraylist ) ; } } } public void handleEnchantItem ( Packet108EnchantItem par1Packet108EnchantItem ) { if ( playerEntity . craftingInventory . windowId == par1Packet108EnchantItem . windowId && playerEntity . craftingInventory . getCanCraft ( playerEntity ) ) { playerEntity . craftingInventory . enchantItem ( playerEntity , par1Packet108EnchantItem . enchantment ) ; playerEntity . craftingInventory . updateCraftingResults ( ) ; } } public void handleCreativeSetSlot ( Packet107CreativeSetSlot par1Packet107CreativeSetSlot ) { if ( playerEntity . itemInWorldManager . isCreative ( ) ) { boolean flag = par1Packet107CreativeSetSlot . slot < <NUM_LIT:0> ; ItemStack itemstack = par1Packet107CreativeSetSlot . itemStack ; boolean flag1 = par1Packet107CreativeSetSlot . slot >= <NUM_LIT> && par1Packet107CreativeSetSlot . slot < <NUM_LIT> + InventoryPlayer . func_25054_e ( ) ; boolean flag2 = itemstack == null || itemstack . itemID < Item . itemsList . length && itemstack . itemID >= <NUM_LIT:0> && Item . itemsList [ itemstack . itemID ] != null ; boolean flag3 = itemstack == null || itemstack . getItemDamage ( ) >= <NUM_LIT:0> && itemstack . getItemDamage ( ) >= <NUM_LIT:0> && itemstack . stackSize <= <NUM_LIT> && itemstack . stackSize > <NUM_LIT:0> ; if ( flag1 && flag2 && flag3 ) { if ( itemstack == null ) { playerEntity . inventorySlots . putStackInSlot ( par1Packet107CreativeSetSlot . slot , null ) ; } else { playerEntity . inventorySlots . putStackInSlot ( par1Packet107CreativeSetSlot . slot , itemstack ) ; } playerEntity . inventorySlots . setCanCraft ( playerEntity , true ) ; } else if ( flag && flag2 && flag3 && field_48073_n < <NUM_LIT> ) { field_48073_n += <NUM_LIT:20> ; EntityItem entityitem = playerEntity . dropPlayerItem ( itemstack ) ; if ( entityitem != null ) { entityitem . func_48316_k ( ) ; } } } } public void handleTransaction ( Packet106Transaction par1Packet106Transaction ) { Short short1 = ( Short ) field_10_k . lookup ( playerEntity . craftingInventory . windowId ) ; if ( short1 != null && par1Packet106Transaction . shortWindowId == short1 . shortValue ( ) && playerEntity . craftingInventory . windowId == par1Packet106Transaction . windowId && ! playerEntity . craftingInventory . getCanCraft ( playerEntity ) ) { playerEntity . craftingInventory . setCanCraft ( playerEntity , true ) ; } } public void handleUpdateSign ( Packet130UpdateSign par1Packet130UpdateSign ) { WorldServer worldserver = mcServer . getWorldManager ( playerEntity . dimension ) ; if ( worldserver . blockExists ( par1Packet130UpdateSign . xPosition , par1Packet130UpdateSign . yPosition , par1Packet130UpdateSign . zPosition ) ) { TileEntity tileentity = worldserver . getBlockTileEntity ( par1Packet130UpdateSign . xPosition , par1Packet130UpdateSign . yPosition , par1Packet130UpdateSign . zPosition ) ; if ( tileentity instanceof TileEntitySign ) { TileEntitySign tileentitysign = ( TileEntitySign ) tileentity ; if ( ! tileentitysign . isEditable ( ) ) { mcServer . logWarning ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( playerEntity . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ; return ; } } for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:4> ; i ++ ) { boolean flag = true ; if ( par1Packet130UpdateSign . signLines [ i ] . length ( ) > <NUM_LIT:15> ) { flag = false ; } else { for ( int l = <NUM_LIT:0> ; l < par1Packet130UpdateSign . signLines [ i ] . length ( ) ; l ++ ) { if ( ChatAllowedCharacters . allowedCharacters . indexOf ( par1Packet130UpdateSign . signLines [ i ] . charAt ( l ) ) < <NUM_LIT:0> ) { flag = false ; } } } if ( ! flag ) { par1Packet130UpdateSign . signLines [ i ] = "<STR_LIT>" ; } } if ( tileentity instanceof TileEntitySign ) { int j = par1Packet130UpdateSign . xPosition ; int k = par1Packet130UpdateSign . yPosition ; int i1 = par1Packet130UpdateSign . zPosition ; TileEntitySign tileentitysign1 = ( TileEntitySign ) tileentity ; for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:4> ; j1 ++ ) { tileentitysign1 . signText [ j1 ] = par1Packet130UpdateSign . signLines [ j1 ] ; } tileentitysign1 . onInventoryChanged ( ) ; worldserver . markBlockNeedsUpdate ( j , k , i1 ) ; } } } public void handleKeepAlive ( Packet0KeepAlive par1Packet0KeepAlive ) { if ( par1Packet0KeepAlive . randomId == field_35013_i ) { int i = ( int ) ( System . nanoTime ( ) / <NUM_LIT> - field_35011_j ) ; playerEntity . ping = ( playerEntity . ping * <NUM_LIT:3> + i ) / <NUM_LIT:4> ; } } public boolean isServerHandler ( ) { return true ; } public void func_50003_a ( Packet202PlayerAbilities par1Packet202PlayerAbilities ) { playerEntity . capabilities . isFlying = par1Packet202PlayerAbilities . field_50005_b && playerEntity . capabilities . allowFlying ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntityAILookIdle extends EntityAIBase { private EntityLiving idleEntity ; private double lookX ; private double lookZ ; private int idleTime ; public EntityAILookIdle ( EntityLiving par1EntityLiving ) { idleTime = <NUM_LIT:0> ; idleEntity = par1EntityLiving ; setMutexBits ( <NUM_LIT:3> ) ; } public boolean shouldExecute ( ) { return idleEntity . getRNG ( ) . nextFloat ( ) < <NUM_LIT> ; } public boolean continueExecuting ( ) { return idleTime >= <NUM_LIT:0> ; } public void startExecuting ( ) { double d = ( Math . PI * <NUM_LIT> ) * idleEntity . getRNG ( ) . nextDouble ( ) ; lookX = Math . cos ( d ) ; lookZ = Math . sin ( d ) ; idleTime = <NUM_LIT:20> + idleEntity . getRNG ( ) . nextInt ( <NUM_LIT:20> ) ; } public void updateTask ( ) { idleTime -- ; idleEntity . getLookHelper ( ) . setLookPosition ( idleEntity . posX + lookX , idleEntity . posY + ( double ) idleEntity . getEyeHeight ( ) , idleEntity . posZ + lookZ , <NUM_LIT> , idleEntity . getVerticalFaceSpeed ( ) ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class TileEntityChest extends TileEntity implements IInventory { private ItemStack chestContents [ ] ; public boolean adjacentChestChecked ; public TileEntityChest adjacentChestZNeg ; public TileEntityChest adjacentChestXPos ; public TileEntityChest adjacentChestXNeg ; public TileEntityChest adjacentChestZPos ; public float lidAngle ; public float prevLidAngle ; public int numUsingPlayers ; private int ticksSinceSync ; public TileEntityChest ( ) { chestContents = new ItemStack [ <NUM_LIT> ] ; adjacentChestChecked = false ; } public int getSizeInventory ( ) { return <NUM_LIT> ; } public ItemStack getStackInSlot ( int par1 ) { return chestContents [ par1 ] ; } public ItemStack decrStackSize ( int par1 , int par2 ) { if ( chestContents [ par1 ] != null ) { if ( chestContents [ par1 ] . stackSize <= par2 ) { ItemStack itemstack = chestContents [ par1 ] ; chestContents [ par1 ] = null ; onInventoryChanged ( ) ; return itemstack ; } ItemStack itemstack1 = chestContents [ par1 ] . splitStack ( par2 ) ; if ( chestContents [ par1 ] . stackSize == <NUM_LIT:0> ) { chestContents [ par1 ] = null ; } onInventoryChanged ( ) ; return itemstack1 ; } else { return null ; } } public ItemStack getStackInSlotOnClosing ( int par1 ) { if ( chestContents [ par1 ] != null ) { ItemStack itemstack = chestContents [ par1 ] ; chestContents [ par1 ] = null ; return itemstack ; } else { return null ; } } public void setInventorySlotContents ( int par1 , ItemStack par2ItemStack ) { chestContents [ par1 ] = par2ItemStack ; if ( par2ItemStack != null && par2ItemStack . stackSize > getInventoryStackLimit ( ) ) { par2ItemStack . stackSize = getInventoryStackLimit ( ) ; } onInventoryChanged ( ) ; } public String getInvName ( ) { return "<STR_LIT>" ; } public void readFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readFromNBT ( par1NBTTagCompound ) ; NBTTagList nbttaglist = par1NBTTagCompound . getTagList ( "<STR_LIT>" ) ; chestContents = new ItemStack [ getSizeInventory ( ) ] ; for ( int i = <NUM_LIT:0> ; i < nbttaglist . tagCount ( ) ; i ++ ) { NBTTagCompound nbttagcompound = ( NBTTagCompound ) nbttaglist . tagAt ( i ) ; int j = nbttagcompound . getByte ( "<STR_LIT>" ) & <NUM_LIT> ; if ( j >= <NUM_LIT:0> && j < chestContents . length ) { chestContents [ j ] = ItemStack . loadItemStackFromNBT ( nbttagcompound ) ; } } } public void writeToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeToNBT ( par1NBTTagCompound ) ; NBTTagList nbttaglist = new NBTTagList ( ) ; for ( int i = <NUM_LIT:0> ; i < chestContents . length ; i ++ ) { if ( chestContents [ i ] != null ) { NBTTagCompound nbttagcompound = new NBTTagCompound ( ) ; nbttagcompound . setByte ( "<STR_LIT>" , ( byte ) i ) ; chestContents [ i ] . writeToNBT ( nbttagcompound ) ; nbttaglist . appendTag ( nbttagcompound ) ; } } par1NBTTagCompound . setTag ( "<STR_LIT>" , nbttaglist ) ; } public int getInventoryStackLimit ( ) { return <NUM_LIT> ; } 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 updateContainingBlockInfo ( ) { super . updateContainingBlockInfo ( ) ; adjacentChestChecked = false ; } public void checkForAdjacentChests ( ) { if ( adjacentChestChecked ) { return ; } adjacentChestChecked = true ; adjacentChestZNeg = null ; adjacentChestXPos = null ; adjacentChestXNeg = null ; adjacentChestZPos = null ; if ( worldObj . getBlockId ( xCoord - <NUM_LIT:1> , yCoord , zCoord ) == Block . chest . blockID ) { adjacentChestXNeg = ( TileEntityChest ) worldObj . getBlockTileEntity ( xCoord - <NUM_LIT:1> , yCoord , zCoord ) ; } if ( worldObj . getBlockId ( xCoord + <NUM_LIT:1> , yCoord , zCoord ) == Block . chest . blockID ) { adjacentChestXPos = ( TileEntityChest ) worldObj . getBlockTileEntity ( xCoord + <NUM_LIT:1> , yCoord , zCoord ) ; } if ( worldObj . getBlockId ( xCoord , yCoord , zCoord - <NUM_LIT:1> ) == Block . chest . blockID ) { adjacentChestZNeg = ( TileEntityChest ) worldObj . getBlockTileEntity ( xCoord , yCoord , zCoord - <NUM_LIT:1> ) ; } if ( worldObj . getBlockId ( xCoord , yCoord , zCoord + <NUM_LIT:1> ) == Block . chest . blockID ) { adjacentChestZPos = ( TileEntityChest ) worldObj . getBlockTileEntity ( xCoord , yCoord , zCoord + <NUM_LIT:1> ) ; } if ( adjacentChestZNeg != null ) { adjacentChestZNeg . updateContainingBlockInfo ( ) ; } if ( adjacentChestZPos != null ) { adjacentChestZPos . updateContainingBlockInfo ( ) ; } if ( adjacentChestXPos != null ) { adjacentChestXPos . updateContainingBlockInfo ( ) ; } if ( adjacentChestXNeg != null ) { adjacentChestXNeg . updateContainingBlockInfo ( ) ; } } public void updateEntity ( ) { super . updateEntity ( ) ; checkForAdjacentChests ( ) ; if ( ( ++ ticksSinceSync % <NUM_LIT:20> ) * <NUM_LIT:4> == <NUM_LIT:0> ) { worldObj . playNoteAt ( xCoord , yCoord , zCoord , <NUM_LIT:1> , numUsingPlayers ) ; } prevLidAngle = lidAngle ; float f = <NUM_LIT> ; if ( numUsingPlayers > <NUM_LIT:0> && lidAngle == <NUM_LIT> && adjacentChestZNeg == null && adjacentChestXNeg == null ) { double d = ( double ) xCoord + <NUM_LIT> ; double d1 = ( double ) zCoord + <NUM_LIT> ; if ( adjacentChestZPos != null ) { d1 += <NUM_LIT> ; } if ( adjacentChestXPos != null ) { d += <NUM_LIT> ; } worldObj . playSoundEffect ( d , ( double ) yCoord + <NUM_LIT> , d1 , "<STR_LIT>" , <NUM_LIT> , worldObj . rand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ; } if ( numUsingPlayers == <NUM_LIT:0> && lidAngle > <NUM_LIT> || numUsingPlayers > <NUM_LIT:0> && lidAngle < <NUM_LIT> ) { float f1 = lidAngle ; if ( numUsingPlayers > <NUM_LIT:0> ) { lidAngle += f ; } else { lidAngle -= f ; } if ( lidAngle > <NUM_LIT> ) { lidAngle = <NUM_LIT> ; } float f2 = <NUM_LIT> ; if ( lidAngle < f2 && f1 >= f2 && adjacentChestZNeg == null && adjacentChestXNeg == null ) { double d2 = ( double ) xCoord + <NUM_LIT> ; double d3 = ( double ) zCoord + <NUM_LIT> ; if ( adjacentChestZPos != null ) { d3 += <NUM_LIT> ; } if ( adjacentChestXPos != null ) { d2 += <NUM_LIT> ; } worldObj . playSoundEffect ( d2 , ( double ) yCoord + <NUM_LIT> , d3 , "<STR_LIT>" , <NUM_LIT> , worldObj . rand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ; } if ( lidAngle < <NUM_LIT> ) { lidAngle = <NUM_LIT> ; } } } public void onTileEntityPowered ( int par1 , int par2 ) { if ( par1 == <NUM_LIT:1> ) { numUsingPlayers = par2 ; } } public void openChest ( ) { numUsingPlayers ++ ; worldObj . playNoteAt ( xCoord , yCoord , zCoord , <NUM_LIT:1> , numUsingPlayers ) ; } public void closeChest ( ) { numUsingPlayers -- ; worldObj . playNoteAt ( xCoord , yCoord , zCoord , <NUM_LIT:1> , numUsingPlayers ) ; } public void invalidate ( ) { updateContainingBlockInfo ( ) ; checkForAdjacentChests ( ) ; super . invalidate ( ) ; } } </s>
|
<s> package net . minecraft . src ; public class WeightedRandomChoice { protected int itemWeight ; public WeightedRandomChoice ( int par1 ) { itemWeight = par1 ; } } </s>
|
<s> package net . minecraft . src ; public class EnchantmentLootBonus extends Enchantment { protected EnchantmentLootBonus ( int par1 , int par2 , EnumEnchantmentType par3EnumEnchantmentType ) { super ( par1 , par2 , par3EnumEnchantmentType ) ; setName ( "<STR_LIT>" ) ; if ( par3EnumEnchantmentType == EnumEnchantmentType . digger ) { setName ( "<STR_LIT>" ) ; } } public int getMinEnchantability ( int par1 ) { return <NUM_LIT:20> + ( par1 - <NUM_LIT:1> ) * <NUM_LIT:12> ; } public int getMaxEnchantability ( int par1 ) { return super . getMinEnchantability ( par1 ) + <NUM_LIT> ; } public int getMaxLevel ( ) { return <NUM_LIT:3> ; } public boolean canApplyTogether ( Enchantment par1Enchantment ) { return super . canApplyTogether ( par1Enchantment ) && par1Enchantment . effectId != silkTouch . effectId ; } } </s>
|
<s> package net . minecraft . src ; public class ItemSeeds extends Item { private int blockType ; private int soilBlockID ; public ItemSeeds ( int par1 , int par2 , int par3 ) { super ( par1 ) ; blockType = par2 ; soilBlockID = par3 ; } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int par4 , int par5 , int par6 , int par7 ) { if ( par7 != <NUM_LIT:1> ) { return false ; } if ( ! par2EntityPlayer . canPlayerEdit ( par4 , par5 , par6 ) || ! par2EntityPlayer . canPlayerEdit ( par4 , par5 + <NUM_LIT:1> , par6 ) ) { return false ; } int i = par3World . getBlockId ( par4 , par5 , par6 ) ; if ( i == soilBlockID && par3World . isAirBlock ( par4 , par5 + <NUM_LIT:1> , par6 ) ) { par3World . setBlockWithNotify ( par4 , par5 + <NUM_LIT:1> , par6 , blockType ) ; par1ItemStack . stackSize -- ; return true ; } else { return false ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockBookshelf extends Block { public BlockBookshelf ( int par1 , int par2 ) { super ( par1 , par2 , Material . wood ) ; } public int getBlockTextureFromSide ( int par1 ) { if ( par1 <= <NUM_LIT:1> ) { return <NUM_LIT:4> ; } else { return blockIndexInTexture ; } } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:3> ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Item . book . shiftedIndex ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockMelon extends Block { protected BlockMelon ( int par1 ) { super ( par1 , Material . pumpkin ) ; blockIndexInTexture = <NUM_LIT> ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { return par1 != <NUM_LIT:1> && par1 != <NUM_LIT:0> ? <NUM_LIT> : <NUM_LIT> ; } public int getBlockTextureFromSide ( int par1 ) { return par1 != <NUM_LIT:1> && par1 != <NUM_LIT:0> ? <NUM_LIT> : <NUM_LIT> ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Item . melon . shiftedIndex ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:3> + par1Random . nextInt ( <NUM_LIT:5> ) ; } public int quantityDroppedWithBonus ( int par1 , Random par2Random ) { int i = quantityDropped ( par2Random ) + par2Random . nextInt ( <NUM_LIT:1> + par1 ) ; if ( i > <NUM_LIT:9> ) { i = <NUM_LIT:9> ; } return i ; } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . Random ; public class WorldGenDungeons extends WorldGenerator { public WorldGenDungeons ( ) { } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { byte byte0 = <NUM_LIT:3> ; int i = par2Random . nextInt ( <NUM_LIT:2> ) + <NUM_LIT:2> ; int j = par2Random . nextInt ( <NUM_LIT:2> ) + <NUM_LIT:2> ; int k = <NUM_LIT:0> ; for ( int l = par3 - i - <NUM_LIT:1> ; l <= par3 + i + <NUM_LIT:1> ; l ++ ) { for ( int k1 = par4 - <NUM_LIT:1> ; k1 <= par4 + byte0 + <NUM_LIT:1> ; k1 ++ ) { for ( int j2 = par5 - j - <NUM_LIT:1> ; j2 <= par5 + j + <NUM_LIT:1> ; j2 ++ ) { Material material = par1World . getBlockMaterial ( l , k1 , j2 ) ; if ( k1 == par4 - <NUM_LIT:1> && ! material . isSolid ( ) ) { return false ; } if ( k1 == par4 + byte0 + <NUM_LIT:1> && ! material . isSolid ( ) ) { return false ; } if ( ( l == par3 - i - <NUM_LIT:1> || l == par3 + i + <NUM_LIT:1> || j2 == par5 - j - <NUM_LIT:1> || j2 == par5 + j + <NUM_LIT:1> ) && k1 == par4 && par1World . isAirBlock ( l , k1 , j2 ) && par1World . isAirBlock ( l , k1 + <NUM_LIT:1> , j2 ) ) { k ++ ; } } } } if ( k < <NUM_LIT:1> || k > <NUM_LIT:5> ) { return false ; } for ( int i1 = par3 - i - <NUM_LIT:1> ; i1 <= par3 + i + <NUM_LIT:1> ; i1 ++ ) { for ( int l1 = par4 + byte0 ; l1 >= par4 - <NUM_LIT:1> ; l1 -- ) { for ( int k2 = par5 - j - <NUM_LIT:1> ; k2 <= par5 + j + <NUM_LIT:1> ; k2 ++ ) { if ( i1 == par3 - i - <NUM_LIT:1> || l1 == par4 - <NUM_LIT:1> || k2 == par5 - j - <NUM_LIT:1> || i1 == par3 + i + <NUM_LIT:1> || l1 == par4 + byte0 + <NUM_LIT:1> || k2 == par5 + j + <NUM_LIT:1> ) { if ( l1 >= <NUM_LIT:0> && ! par1World . getBlockMaterial ( i1 , l1 - <NUM_LIT:1> , k2 ) . isSolid ( ) ) { par1World . setBlockWithNotify ( i1 , l1 , k2 , <NUM_LIT:0> ) ; continue ; } if ( ! par1World . getBlockMaterial ( i1 , l1 , k2 ) . isSolid ( ) ) { continue ; } if ( l1 == par4 - <NUM_LIT:1> && par2Random . nextInt ( <NUM_LIT:4> ) != <NUM_LIT:0> ) { par1World . setBlockWithNotify ( i1 , l1 , k2 , Block . cobblestoneMossy . blockID ) ; } else { par1World . setBlockWithNotify ( i1 , l1 , k2 , Block . cobblestone . blockID ) ; } } else { par1World . setBlockWithNotify ( i1 , l1 , k2 , <NUM_LIT:0> ) ; } } } } for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:2> ; j1 ++ ) { label0 : for ( int i2 = <NUM_LIT:0> ; i2 < <NUM_LIT:3> ; i2 ++ ) { int l2 = ( par3 + par2Random . nextInt ( i * <NUM_LIT:2> + <NUM_LIT:1> ) ) - i ; int i3 = par4 ; int j3 = ( par5 + par2Random . nextInt ( j * <NUM_LIT:2> + <NUM_LIT:1> ) ) - j ; if ( ! par1World . isAirBlock ( l2 , i3 , j3 ) ) { continue ; } int k3 = <NUM_LIT:0> ; if ( par1World . getBlockMaterial ( l2 - <NUM_LIT:1> , i3 , j3 ) . isSolid ( ) ) { k3 ++ ; } if ( par1World . getBlockMaterial ( l2 + <NUM_LIT:1> , i3 , j3 ) . isSolid ( ) ) { k3 ++ ; } if ( par1World . getBlockMaterial ( l2 , i3 , j3 - <NUM_LIT:1> ) . isSolid ( ) ) { k3 ++ ; } if ( par1World . getBlockMaterial ( l2 , i3 , j3 + <NUM_LIT:1> ) . isSolid ( ) ) { k3 ++ ; } if ( k3 != <NUM_LIT:1> ) { continue ; } par1World . setBlockWithNotify ( l2 , i3 , j3 , Block . chest . blockID ) ; TileEntityChest tileentitychest = ( TileEntityChest ) par1World . getBlockTileEntity ( l2 , i3 , j3 ) ; if ( tileentitychest == null ) { break ; } int l3 = <NUM_LIT:0> ; do { if ( l3 >= <NUM_LIT:8> ) { break label0 ; } ItemStack itemstack = pickCheckLootItem ( par2Random ) ; if ( itemstack != null ) { tileentitychest . setInventorySlotContents ( par2Random . nextInt ( tileentitychest . getSizeInventory ( ) ) , itemstack ) ; } l3 ++ ; } while ( true ) ; } } par1World . setBlockWithNotify ( par3 , par4 , par5 , Block . mobSpawner . blockID ) ; TileEntityMobSpawner tileentitymobspawner = ( TileEntityMobSpawner ) par1World . getBlockTileEntity ( par3 , par4 , par5 ) ; if ( tileentitymobspawner != null ) { tileentitymobspawner . setMobID ( pickMobSpawner ( par2Random ) ) ; } else { System . err . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par3 ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( par4 ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( par5 ) . append ( "<STR_LIT:)>" ) . toString ( ) ) ; } return true ; } private ItemStack pickCheckLootItem ( Random par1Random ) { int i = par1Random . nextInt ( <NUM_LIT:11> ) ; if ( i == <NUM_LIT:0> ) { return new ItemStack ( Item . saddle ) ; } if ( i == <NUM_LIT:1> ) { return new ItemStack ( Item . ingotIron , par1Random . nextInt ( <NUM_LIT:4> ) + <NUM_LIT:1> ) ; } if ( i == <NUM_LIT:2> ) { return new ItemStack ( Item . bread ) ; } if ( i == <NUM_LIT:3> ) { return new ItemStack ( Item . wheat , par1Random . nextInt ( <NUM_LIT:4> ) + <NUM_LIT:1> ) ; } if ( i == <NUM_LIT:4> ) { return new ItemStack ( Item . gunpowder , par1Random . nextInt ( <NUM_LIT:4> ) + <NUM_LIT:1> ) ; } if ( i == <NUM_LIT:5> ) { return new ItemStack ( Item . silk , par1Random . nextInt ( <NUM_LIT:4> ) + <NUM_LIT:1> ) ; } if ( i == <NUM_LIT:6> ) { return new ItemStack ( Item . bucketEmpty ) ; } if ( i == <NUM_LIT:7> && par1Random . nextInt ( <NUM_LIT:100> ) == <NUM_LIT:0> ) { return new ItemStack ( Item . appleGold ) ; } if ( i == <NUM_LIT:8> && par1Random . nextInt ( <NUM_LIT:2> ) == <NUM_LIT:0> ) { return new ItemStack ( Item . redstone , par1Random . nextInt ( <NUM_LIT:4> ) + <NUM_LIT:1> ) ; } if ( i == <NUM_LIT:9> && par1Random . nextInt ( <NUM_LIT:10> ) == <NUM_LIT:0> ) { return new ItemStack ( Item . itemsList [ Item . record13 . shiftedIndex + par1Random . nextInt ( <NUM_LIT:2> ) ] ) ; } if ( i == <NUM_LIT:10> ) { return new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:3> ) ; } else { return null ; } } private String pickMobSpawner ( Random par1Random ) { int i = par1Random . nextInt ( <NUM_LIT:4> ) ; if ( i == <NUM_LIT:0> ) { return "<STR_LIT>" ; } if ( i == <NUM_LIT:1> ) { return "<STR_LIT>" ; } if ( i == <NUM_LIT:2> ) { return "<STR_LIT>" ; } if ( i == <NUM_LIT:3> ) { return "<STR_LIT>" ; } else { return "<STR_LIT>" ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntitySheep extends EntityAnimal { public static final float fleeceColorTable [ ] [ ] = { { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } , { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } } ; private int sheepTimer ; private EntityAIEatGrass aiEatGrass ; public EntitySheep ( World par1World ) { super ( par1World ) ; aiEatGrass = new EntityAIEatGrass ( this ) ; texture = "<STR_LIT>" ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; float f = <NUM_LIT> ; getNavigator ( ) . func_48656_a ( true ) ; 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> , aiEatGrass ) ; tasks . addTask ( <NUM_LIT:6> , new EntityAIWander ( this , f ) ) ; tasks . addTask ( <NUM_LIT:7> , new EntityAIWatchClosest ( this , net . minecraft . src . EntityPlayer . class , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:8> , new EntityAILookIdle ( this ) ) ; } protected boolean isAIEnabled ( ) { return true ; } protected void updateAITasks ( ) { sheepTimer = aiEatGrass . func_48227_f ( ) ; super . updateAITasks ( ) ; } public void onLivingUpdate ( ) { if ( worldObj . isRemote ) { sheepTimer = Math . max ( <NUM_LIT:0> , sheepTimer - <NUM_LIT:1> ) ; } super . onLivingUpdate ( ) ; } public int getMaxHealth ( ) { return <NUM_LIT:8> ; } protected void entityInit ( ) { super . entityInit ( ) ; dataWatcher . addObject ( <NUM_LIT:16> , new Byte ( ( byte ) <NUM_LIT:0> ) ) ; } protected void dropFewItems ( boolean par1 , int par2 ) { if ( ! getSheared ( ) ) { entityDropItem ( new ItemStack ( Block . cloth . blockID , <NUM_LIT:1> , getFleeceColor ( ) ) , <NUM_LIT> ) ; } } protected int getDropItemId ( ) { return Block . cloth . blockID ; } public boolean interact ( EntityPlayer par1EntityPlayer ) { ItemStack itemstack = par1EntityPlayer . inventory . getCurrentItem ( ) ; if ( itemstack != null && itemstack . itemID == Item . shears . shiftedIndex && ! getSheared ( ) && ! isChild ( ) ) { if ( ! worldObj . isRemote ) { setSheared ( true ) ; int i = <NUM_LIT:1> + rand . nextInt ( <NUM_LIT:3> ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { EntityItem entityitem = entityDropItem ( new ItemStack ( Block . cloth . blockID , <NUM_LIT:1> , getFleeceColor ( ) ) , <NUM_LIT> ) ; entityitem . motionY += rand . nextFloat ( ) * <NUM_LIT> ; entityitem . motionX += ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> ; entityitem . motionZ += ( rand . nextFloat ( ) - rand . nextFloat ( ) ) * <NUM_LIT> ; } } itemstack . damageItem ( <NUM_LIT:1> , par1EntityPlayer ) ; } return super . interact ( par1EntityPlayer ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setBoolean ( "<STR_LIT>" , getSheared ( ) ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) getFleeceColor ( ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; setSheared ( par1NBTTagCompound . getBoolean ( "<STR_LIT>" ) ) ; setFleeceColor ( par1NBTTagCompound . getByte ( "<STR_LIT>" ) ) ; } protected String getLivingSound ( ) { return "<STR_LIT>" ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } public int getFleeceColor ( ) { return dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) & <NUM_LIT> ; } public void setFleeceColor ( int par1 ) { byte byte0 = dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) ; dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( byte0 & <NUM_LIT> | par1 & <NUM_LIT> ) ) ) ; } public boolean getSheared ( ) { return ( dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) & <NUM_LIT> ) != <NUM_LIT:0> ; } public void setSheared ( boolean par1 ) { byte byte0 = dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) ; if ( par1 ) { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( byte0 | <NUM_LIT> ) ) ) ; } else { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( byte0 & <NUM_LIT> ) ) ) ; } } public static int getRandomFleeceColor ( Random par0Random ) { int i = par0Random . nextInt ( <NUM_LIT:100> ) ; if ( i < <NUM_LIT:5> ) { return <NUM_LIT:15> ; } if ( i < <NUM_LIT:10> ) { return <NUM_LIT:7> ; } if ( i < <NUM_LIT:15> ) { return <NUM_LIT:8> ; } if ( i < <NUM_LIT> ) { return <NUM_LIT:12> ; } return par0Random . nextInt ( <NUM_LIT> ) != <NUM_LIT:0> ? <NUM_LIT:0> : <NUM_LIT:6> ; } public EntityAnimal spawnBabyAnimal ( EntityAnimal par1EntityAnimal ) { EntitySheep entitysheep = ( EntitySheep ) par1EntityAnimal ; EntitySheep entitysheep1 = new EntitySheep ( worldObj ) ; if ( rand . nextBoolean ( ) ) { entitysheep1 . setFleeceColor ( getFleeceColor ( ) ) ; } else { entitysheep1 . setFleeceColor ( entitysheep . getFleeceColor ( ) ) ; } return entitysheep1 ; } public void eatGrassBonus ( ) { setSheared ( false ) ; if ( isChild ( ) ) { int i = getGrowingAge ( ) + <NUM_LIT> ; if ( i > <NUM_LIT:0> ) { i = <NUM_LIT:0> ; } setGrowingAge ( i ) ; } } } </s>
|
<s> package net . minecraft . src ; class Empty3 { } </s>
|
<s> package net . minecraft . src ; public class EntityGiantZombie extends EntityMob { public EntityGiantZombie ( World par1World ) { super ( par1World ) ; texture = "<STR_LIT>" ; moveSpeed = <NUM_LIT> ; attackStrength = <NUM_LIT> ; yOffset *= <NUM_LIT> ; setSize ( width * <NUM_LIT> , height * <NUM_LIT> ) ; } public int getMaxHealth ( ) { return <NUM_LIT:100> ; } public float getBlockPathWeight ( int par1 , int par2 , int par3 ) { return worldObj . getLightBrightness ( par1 , par2 , par3 ) - <NUM_LIT> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class ItemFireball extends Item { public ItemFireball ( int par1 ) { super ( par1 ) ; } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int par4 , int par5 , int par6 , int par7 ) { if ( par3World . isRemote ) { return true ; } if ( par7 == <NUM_LIT:0> ) { par5 -- ; } if ( par7 == <NUM_LIT:1> ) { par5 ++ ; } if ( par7 == <NUM_LIT:2> ) { par6 -- ; } if ( par7 == <NUM_LIT:3> ) { par6 ++ ; } if ( par7 == <NUM_LIT:4> ) { par4 -- ; } if ( par7 == <NUM_LIT:5> ) { par4 ++ ; } if ( ! par2EntityPlayer . canPlayerEdit ( par4 , par5 , par6 ) ) { return false ; } int i = par3World . getBlockId ( par4 , par5 , par6 ) ; if ( i == <NUM_LIT:0> ) { par3World . playSoundEffect ( ( double ) par4 + <NUM_LIT> , ( double ) par5 + <NUM_LIT> , ( double ) par6 + <NUM_LIT> , "<STR_LIT>" , <NUM_LIT> , itemRand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ; par3World . setBlockWithNotify ( par4 , par5 , par6 , Block . fire . blockID ) ; } if ( ! par2EntityPlayer . capabilities . isCreativeMode ) { par1ItemStack . stackSize -- ; } return true ; } } </s>
|
<s> package net . minecraft . src ; final class StepSoundSand extends StepSound { StepSoundSand ( String par1Str , float par2 , float par3 ) { super ( par1Str , par2 , par3 ) ; } } </s>
|
<s> package net . minecraft . src ; public class TileEntityFurnace extends TileEntity implements IInventory { private ItemStack furnaceItemStacks [ ] ; public int furnaceBurnTime ; public int currentItemBurnTime ; public int furnaceCookTime ; public TileEntityFurnace ( ) { furnaceItemStacks = new ItemStack [ <NUM_LIT:3> ] ; furnaceBurnTime = <NUM_LIT:0> ; currentItemBurnTime = <NUM_LIT:0> ; furnaceCookTime = <NUM_LIT:0> ; } public int getSizeInventory ( ) { return furnaceItemStacks . length ; } public ItemStack getStackInSlot ( int par1 ) { return furnaceItemStacks [ par1 ] ; } public ItemStack decrStackSize ( int par1 , int par2 ) { if ( furnaceItemStacks [ par1 ] != null ) { if ( furnaceItemStacks [ par1 ] . stackSize <= par2 ) { ItemStack itemstack = furnaceItemStacks [ par1 ] ; furnaceItemStacks [ par1 ] = null ; return itemstack ; } ItemStack itemstack1 = furnaceItemStacks [ par1 ] . splitStack ( par2 ) ; if ( furnaceItemStacks [ par1 ] . stackSize == <NUM_LIT:0> ) { furnaceItemStacks [ par1 ] = null ; } return itemstack1 ; } else { return null ; } } public ItemStack getStackInSlotOnClosing ( int par1 ) { if ( furnaceItemStacks [ par1 ] != null ) { ItemStack itemstack = furnaceItemStacks [ par1 ] ; furnaceItemStacks [ par1 ] = null ; return itemstack ; } else { return null ; } } public void setInventorySlotContents ( int par1 , ItemStack par2ItemStack ) { furnaceItemStacks [ par1 ] = par2ItemStack ; if ( par2ItemStack != null && par2ItemStack . stackSize > getInventoryStackLimit ( ) ) { par2ItemStack . stackSize = getInventoryStackLimit ( ) ; } } public String getInvName ( ) { return "<STR_LIT>" ; } public void readFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readFromNBT ( par1NBTTagCompound ) ; NBTTagList nbttaglist = par1NBTTagCompound . getTagList ( "<STR_LIT>" ) ; furnaceItemStacks = 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 < furnaceItemStacks . length ) { furnaceItemStacks [ byte0 ] = ItemStack . loadItemStackFromNBT ( nbttagcompound ) ; } } furnaceBurnTime = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; furnaceCookTime = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; currentItemBurnTime = getItemBurnTime ( furnaceItemStacks [ <NUM_LIT:1> ] ) ; } public void writeToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) furnaceBurnTime ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) furnaceCookTime ) ; NBTTagList nbttaglist = new NBTTagList ( ) ; for ( int i = <NUM_LIT:0> ; i < furnaceItemStacks . length ; i ++ ) { if ( furnaceItemStacks [ i ] != null ) { NBTTagCompound nbttagcompound = new NBTTagCompound ( ) ; nbttagcompound . setByte ( "<STR_LIT>" , ( byte ) i ) ; furnaceItemStacks [ i ] . writeToNBT ( nbttagcompound ) ; nbttaglist . appendTag ( nbttagcompound ) ; } } par1NBTTagCompound . setTag ( "<STR_LIT>" , nbttaglist ) ; } public int getInventoryStackLimit ( ) { return <NUM_LIT> ; } public boolean isBurning ( ) { return furnaceBurnTime > <NUM_LIT:0> ; } public void updateEntity ( ) { boolean flag = furnaceBurnTime > <NUM_LIT:0> ; boolean flag1 = false ; if ( furnaceBurnTime > <NUM_LIT:0> ) { furnaceBurnTime -- ; } if ( ! worldObj . isRemote ) { if ( furnaceBurnTime == <NUM_LIT:0> && canSmelt ( ) ) { currentItemBurnTime = furnaceBurnTime = getItemBurnTime ( furnaceItemStacks [ <NUM_LIT:1> ] ) ; if ( furnaceBurnTime > <NUM_LIT:0> ) { flag1 = true ; if ( furnaceItemStacks [ <NUM_LIT:1> ] != null ) { furnaceItemStacks [ <NUM_LIT:1> ] . stackSize -- ; if ( furnaceItemStacks [ <NUM_LIT:1> ] . stackSize == <NUM_LIT:0> ) { furnaceItemStacks [ <NUM_LIT:1> ] = null ; } } } } if ( isBurning ( ) && canSmelt ( ) ) { furnaceCookTime ++ ; if ( furnaceCookTime == <NUM_LIT> ) { furnaceCookTime = <NUM_LIT:0> ; smeltItem ( ) ; flag1 = true ; } } else { furnaceCookTime = <NUM_LIT:0> ; } if ( flag != ( furnaceBurnTime > <NUM_LIT:0> ) ) { flag1 = true ; BlockFurnace . updateFurnaceBlockState ( furnaceBurnTime > <NUM_LIT:0> , worldObj , xCoord , yCoord , zCoord ) ; } } if ( flag1 ) { onInventoryChanged ( ) ; } } private boolean canSmelt ( ) { if ( furnaceItemStacks [ <NUM_LIT:0> ] == null ) { return false ; } ItemStack itemstack = FurnaceRecipes . smelting ( ) . getSmeltingResult ( furnaceItemStacks [ <NUM_LIT:0> ] . getItem ( ) . shiftedIndex ) ; if ( itemstack == null ) { return false ; } if ( furnaceItemStacks [ <NUM_LIT:2> ] == null ) { return true ; } if ( ! furnaceItemStacks [ <NUM_LIT:2> ] . isItemEqual ( itemstack ) ) { return false ; } if ( furnaceItemStacks [ <NUM_LIT:2> ] . stackSize < getInventoryStackLimit ( ) && furnaceItemStacks [ <NUM_LIT:2> ] . stackSize < furnaceItemStacks [ <NUM_LIT:2> ] . getMaxStackSize ( ) ) { return true ; } return furnaceItemStacks [ <NUM_LIT:2> ] . stackSize < itemstack . getMaxStackSize ( ) ; } public void smeltItem ( ) { if ( ! canSmelt ( ) ) { return ; } ItemStack itemstack = FurnaceRecipes . smelting ( ) . getSmeltingResult ( furnaceItemStacks [ <NUM_LIT:0> ] . getItem ( ) . shiftedIndex ) ; if ( furnaceItemStacks [ <NUM_LIT:2> ] == null ) { furnaceItemStacks [ <NUM_LIT:2> ] = itemstack . copy ( ) ; } else if ( furnaceItemStacks [ <NUM_LIT:2> ] . itemID == itemstack . itemID ) { furnaceItemStacks [ <NUM_LIT:2> ] . stackSize ++ ; } furnaceItemStacks [ <NUM_LIT:0> ] . stackSize -- ; if ( furnaceItemStacks [ <NUM_LIT:0> ] . stackSize <= <NUM_LIT:0> ) { furnaceItemStacks [ <NUM_LIT:0> ] = null ; } } public static int getItemBurnTime ( ItemStack par1ItemStack ) { if ( par1ItemStack == null ) { return <NUM_LIT:0> ; } int i = par1ItemStack . getItem ( ) . shiftedIndex ; if ( i < <NUM_LIT> && Block . blocksList [ i ] . blockMaterial == Material . wood ) { return <NUM_LIT> ; } if ( i == Item . stick . shiftedIndex ) { return <NUM_LIT:100> ; } if ( i == Item . coal . shiftedIndex ) { return <NUM_LIT> ; } if ( i == Item . bucketLava . shiftedIndex ) { return <NUM_LIT> ; } if ( i == Block . sapling . blockID ) { return <NUM_LIT:100> ; } return i != Item . blazeRod . shiftedIndex ? <NUM_LIT:0> : <NUM_LIT> ; } public static boolean func_52006_b ( ItemStack par0ItemStack ) { return getItemBurnTime ( par0ItemStack ) > <NUM_LIT:0> ; } 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 ( ) { } } </s>
|
<s> package net . minecraft . src ; import net . minecraft . server . MinecraftServer ; public class WorldServerMulti extends WorldServer { public WorldServerMulti ( MinecraftServer par1MinecraftServer , ISaveHandler par2ISaveHandler , String par3Str , int par4 , WorldSettings par5WorldSettings , WorldServer par6WorldServer ) { super ( par1MinecraftServer , par2ISaveHandler , par3Str , par4 , par5WorldSettings ) ; mapStorage = par6WorldServer . mapStorage ; } } </s>
|
<s> package net . minecraft . src ; public class RConUtils { public static char hexDigits [ ] = { '<CHAR_LIT:0>' , '<CHAR_LIT:1>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT>' , '<CHAR_LIT:9>' , '<CHAR_LIT:a>' , '<CHAR_LIT:b>' , '<CHAR_LIT:c>' , '<CHAR_LIT>' , '<CHAR_LIT:e>' , '<CHAR_LIT>' } ; public RConUtils ( ) { } public static String getBytesAsString ( byte par0ArrayOfByte [ ] , int par1 , int par2 ) { int i = par2 - <NUM_LIT:1> ; int j ; for ( j = par1 <= i ? par1 : i ; <NUM_LIT:0> != par0ArrayOfByte [ j ] && j < i ; j ++ ) { } return new String ( par0ArrayOfByte , par1 , j - par1 ) ; } public static int getRemainingBytesAsLEInt ( byte par0ArrayOfByte [ ] , int par1 ) { return getBytesAsLEInt ( par0ArrayOfByte , par1 , par0ArrayOfByte . length ) ; } public static int getBytesAsLEInt ( byte par0ArrayOfByte [ ] , int par1 , int par2 ) { if ( <NUM_LIT:0> > par2 - par1 - <NUM_LIT:4> ) { return <NUM_LIT:0> ; } else { return par0ArrayOfByte [ par1 + <NUM_LIT:3> ] << <NUM_LIT:24> | ( par0ArrayOfByte [ par1 + <NUM_LIT:2> ] & <NUM_LIT> ) << <NUM_LIT:16> | ( par0ArrayOfByte [ par1 + <NUM_LIT:1> ] & <NUM_LIT> ) << <NUM_LIT:8> | par0ArrayOfByte [ par1 ] & <NUM_LIT> ; } } public static int getBytesAsBEint ( byte par0ArrayOfByte [ ] , int par1 , int par2 ) { if ( <NUM_LIT:0> > par2 - par1 - <NUM_LIT:4> ) { return <NUM_LIT:0> ; } else { return par0ArrayOfByte [ par1 ] << <NUM_LIT:24> | ( par0ArrayOfByte [ par1 + <NUM_LIT:1> ] & <NUM_LIT> ) << <NUM_LIT:16> | ( par0ArrayOfByte [ par1 + <NUM_LIT:2> ] & <NUM_LIT> ) << <NUM_LIT:8> | par0ArrayOfByte [ par1 + <NUM_LIT:3> ] & <NUM_LIT> ; } } public static String getByteAsHexString ( byte par0 ) { return ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( hexDigits [ ( par0 & <NUM_LIT> ) > > > <NUM_LIT:4> ] ) . append ( hexDigits [ par0 & <NUM_LIT> ] ) . toString ( ) ; } } </s>
|
<s> package net . minecraft . src ; public class ItemShears extends Item { public ItemShears ( int par1 ) { super ( par1 ) ; setMaxStackSize ( <NUM_LIT:1> ) ; setMaxDamage ( <NUM_LIT> ) ; } public boolean onBlockDestroyed ( ItemStack par1ItemStack , int par2 , int par3 , int par4 , int par5 , EntityLiving par6EntityLiving ) { if ( par2 == Block . leaves . blockID || par2 == Block . web . blockID || par2 == Block . tallGrass . blockID || par2 == Block . vine . blockID ) { par1ItemStack . damageItem ( <NUM_LIT:1> , par6EntityLiving ) ; return true ; } else { return super . onBlockDestroyed ( par1ItemStack , par2 , par3 , par4 , par5 , par6EntityLiving ) ; } } public boolean canHarvestBlock ( Block par1Block ) { return par1Block . blockID == Block . web . blockID ; } public float getStrVsBlock ( ItemStack par1ItemStack , Block par2Block ) { if ( par2Block . blockID == Block . web . blockID || par2Block . blockID == Block . leaves . blockID ) { return <NUM_LIT> ; } if ( par2Block . blockID == Block . cloth . blockID ) { return <NUM_LIT> ; } else { return super . getStrVsBlock ( par1ItemStack , par2Block ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . net . * ; import java . util . * ; public class NetworkManager { public static final Object threadSyncObject = new Object ( ) ; public static int numReadThreads ; public static int numWriteThreads ; private Object sendQueueLock ; private Socket networkSocket ; private final SocketAddress remoteSocketAddress ; private DataInputStream socketInputStream ; private DataOutputStream socketOutputStream ; private boolean isRunning ; private List readPackets ; private List dataPackets ; private List chunkDataPackets ; private NetHandler netHandler ; private boolean isServerTerminating ; private Thread writeThread ; private Thread readThread ; private boolean isTerminating ; private String terminationReason ; private Object field_20176_t [ ] ; private int timeSinceLastRead ; private int sendQueueByteLength ; public static int field_28141_d [ ] = new int [ <NUM_LIT> ] ; public static int field_28140_e [ ] = new int [ <NUM_LIT> ] ; public int chunkDataSendCounter ; private int field_20175_w ; public NetworkManager ( Socket par1Socket , String par2Str , NetHandler par3NetHandler ) throws IOException { sendQueueLock = new Object ( ) ; isRunning = true ; readPackets = Collections . synchronizedList ( new ArrayList ( ) ) ; dataPackets = Collections . synchronizedList ( new ArrayList ( ) ) ; chunkDataPackets = Collections . synchronizedList ( new ArrayList ( ) ) ; isServerTerminating = false ; isTerminating = false ; terminationReason = "<STR_LIT>" ; timeSinceLastRead = <NUM_LIT:0> ; sendQueueByteLength = <NUM_LIT:0> ; chunkDataSendCounter = <NUM_LIT:0> ; field_20175_w = <NUM_LIT> ; networkSocket = par1Socket ; remoteSocketAddress = par1Socket . getRemoteSocketAddress ( ) ; netHandler = par3NetHandler ; try { par1Socket . setSoTimeout ( <NUM_LIT> ) ; par1Socket . setTrafficClass ( <NUM_LIT:24> ) ; } catch ( SocketException socketexception ) { System . err . println ( socketexception . getMessage ( ) ) ; } socketInputStream = new DataInputStream ( par1Socket . getInputStream ( ) ) ; socketOutputStream = new DataOutputStream ( new BufferedOutputStream ( par1Socket . getOutputStream ( ) , <NUM_LIT> ) ) ; readThread = new NetworkReaderThread ( this , ( new StringBuilder ( ) ) . append ( par2Str ) . append ( "<STR_LIT>" ) . toString ( ) ) ; writeThread = new NetworkWriterThread ( this , ( new StringBuilder ( ) ) . append ( par2Str ) . append ( "<STR_LIT>" ) . toString ( ) ) ; readThread . start ( ) ; writeThread . start ( ) ; } public void setNetHandler ( NetHandler par1NetHandler ) { netHandler = par1NetHandler ; } public void addToSendQueue ( Packet par1Packet ) { if ( isServerTerminating ) { return ; } synchronized ( sendQueueLock ) { sendQueueByteLength += par1Packet . getPacketSize ( ) + <NUM_LIT:1> ; if ( par1Packet . isChunkDataPacket ) { chunkDataPackets . add ( par1Packet ) ; } else { dataPackets . add ( par1Packet ) ; } } } private boolean sendPacket ( ) { boolean flag = false ; try { if ( ! dataPackets . isEmpty ( ) && ( chunkDataSendCounter == <NUM_LIT:0> || System . currentTimeMillis ( ) - ( ( Packet ) dataPackets . get ( <NUM_LIT:0> ) ) . creationTimeMillis >= ( long ) chunkDataSendCounter ) ) { Packet packet ; synchronized ( sendQueueLock ) { packet = ( Packet ) dataPackets . remove ( <NUM_LIT:0> ) ; sendQueueByteLength -= packet . getPacketSize ( ) + <NUM_LIT:1> ; } Packet . writePacket ( packet , socketOutputStream ) ; field_28140_e [ packet . getPacketId ( ) ] += packet . getPacketSize ( ) + <NUM_LIT:1> ; flag = true ; } if ( field_20175_w -- <= <NUM_LIT:0> && ! chunkDataPackets . isEmpty ( ) && ( chunkDataSendCounter == <NUM_LIT:0> || System . currentTimeMillis ( ) - ( ( Packet ) chunkDataPackets . get ( <NUM_LIT:0> ) ) . creationTimeMillis >= ( long ) chunkDataSendCounter ) ) { Packet packet1 ; synchronized ( sendQueueLock ) { packet1 = ( Packet ) chunkDataPackets . remove ( <NUM_LIT:0> ) ; sendQueueByteLength -= packet1 . getPacketSize ( ) + <NUM_LIT:1> ; } Packet . writePacket ( packet1 , socketOutputStream ) ; field_28140_e [ packet1 . getPacketId ( ) ] += packet1 . getPacketSize ( ) + <NUM_LIT:1> ; field_20175_w = <NUM_LIT:0> ; flag = true ; } } catch ( Exception exception ) { if ( ! isTerminating ) { onNetworkError ( exception ) ; } return false ; } return flag ; } public void wakeThreads ( ) { readThread . interrupt ( ) ; writeThread . interrupt ( ) ; } private boolean readPacket ( ) { boolean flag = false ; try { Packet packet = Packet . readPacket ( socketInputStream , netHandler . isServerHandler ( ) ) ; if ( packet != null ) { field_28141_d [ packet . getPacketId ( ) ] += packet . getPacketSize ( ) + <NUM_LIT:1> ; if ( ! isServerTerminating ) { readPackets . add ( packet ) ; } flag = true ; } else { networkShutdown ( "<STR_LIT>" , new Object [ <NUM_LIT:0> ] ) ; } } catch ( Exception exception ) { if ( ! isTerminating ) { onNetworkError ( exception ) ; } return false ; } return flag ; } private void onNetworkError ( Exception par1Exception ) { par1Exception . printStackTrace ( ) ; networkShutdown ( "<STR_LIT>" , new Object [ ] { ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1Exception . toString ( ) ) . toString ( ) } ) ; } public void networkShutdown ( String par1Str , Object par2ArrayOfObj [ ] ) { if ( ! isRunning ) { return ; } isTerminating = true ; terminationReason = par1Str ; field_20176_t = par2ArrayOfObj ; ( new NetworkMasterThread ( this ) ) . start ( ) ; isRunning = false ; try { socketInputStream . close ( ) ; socketInputStream = null ; } catch ( Throwable throwable ) { } try { socketOutputStream . close ( ) ; socketOutputStream = null ; } catch ( Throwable throwable1 ) { } try { networkSocket . close ( ) ; networkSocket = null ; } catch ( Throwable throwable2 ) { } } public void processReadPackets ( ) { if ( sendQueueByteLength > <NUM_LIT> ) { networkShutdown ( "<STR_LIT>" , new Object [ <NUM_LIT:0> ] ) ; } if ( readPackets . isEmpty ( ) ) { if ( timeSinceLastRead ++ == <NUM_LIT> ) { networkShutdown ( "<STR_LIT>" , new Object [ <NUM_LIT:0> ] ) ; } } else { timeSinceLastRead = <NUM_LIT:0> ; } Packet packet ; for ( int i = <NUM_LIT:1000> ; ! readPackets . isEmpty ( ) && i -- >= <NUM_LIT:0> ; packet . processPacket ( netHandler ) ) { packet = ( Packet ) readPackets . remove ( <NUM_LIT:0> ) ; } wakeThreads ( ) ; if ( isTerminating && readPackets . isEmpty ( ) ) { netHandler . handleErrorMessage ( terminationReason , field_20176_t ) ; } } public SocketAddress getRemoteAddress ( ) { return remoteSocketAddress ; } public void serverShutdown ( ) { if ( isServerTerminating ) { return ; } else { wakeThreads ( ) ; isServerTerminating = true ; readThread . interrupt ( ) ; ( new ThreadMonitorConnection ( this ) ) . start ( ) ; return ; } } public int getNumChunkDataPackets ( ) { return chunkDataPackets . size ( ) ; } public Socket getSocket ( ) { return networkSocket ; } static boolean isRunning ( NetworkManager par0NetworkManager ) { return par0NetworkManager . isRunning ; } static boolean isServerTerminating ( NetworkManager par0NetworkManager ) { return par0NetworkManager . isServerTerminating ; } static boolean readNetworkPacket ( NetworkManager par0NetworkManager ) { return par0NetworkManager . readPacket ( ) ; } static boolean sendNetworkPacket ( NetworkManager par0NetworkManager ) { return par0NetworkManager . sendPacket ( ) ; } static DataOutputStream getOutputStream ( NetworkManager par0NetworkManager ) { return par0NetworkManager . socketOutputStream ; } static boolean isTerminating ( NetworkManager par0NetworkManager ) { return par0NetworkManager . isTerminating ; } static void sendError ( NetworkManager par0NetworkManager , Exception par1Exception ) { par0NetworkManager . onNetworkError ( par1Exception ) ; } static Thread getReadThread ( NetworkManager par0NetworkManager ) { return par0NetworkManager . readThread ; } static Thread getWriteThread ( NetworkManager par0NetworkManager ) { return par0NetworkManager . writeThread ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class ItemDye extends Item { public static final String dyeColorNames [ ] = { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" } ; public static final int dyeColors [ ] = { <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> } ; public ItemDye ( int par1 ) { super ( par1 ) ; setHasSubtypes ( true ) ; setMaxDamage ( <NUM_LIT:0> ) ; } public String getItemNameIS ( ItemStack par1ItemStack ) { int i = MathHelper . clamp_int ( par1ItemStack . getItemDamage ( ) , <NUM_LIT:0> , <NUM_LIT:15> ) ; return ( new StringBuilder ( ) ) . append ( super . getItemName ( ) ) . append ( "<STR_LIT:.>" ) . append ( dyeColorNames [ i ] ) . toString ( ) ; } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int par4 , int par5 , int par6 , int par7 ) { if ( ! par2EntityPlayer . canPlayerEdit ( par4 , par5 , par6 ) ) { return false ; } if ( par1ItemStack . getItemDamage ( ) == <NUM_LIT:15> ) { int i = par3World . getBlockId ( par4 , par5 , par6 ) ; if ( i == Block . sapling . blockID ) { if ( ! par3World . isRemote ) { ( ( BlockSapling ) Block . sapling ) . growTree ( par3World , par4 , par5 , par6 , par3World . rand ) ; par1ItemStack . stackSize -- ; } return true ; } if ( i == Block . mushroomBrown . blockID || i == Block . mushroomRed . blockID ) { if ( ! par3World . isRemote && ( ( BlockMushroom ) Block . blocksList [ i ] ) . fertilizeMushroom ( par3World , par4 , par5 , par6 , par3World . rand ) ) { par1ItemStack . stackSize -- ; } return true ; } if ( i == Block . melonStem . blockID || i == Block . pumpkinStem . blockID ) { if ( ! par3World . isRemote ) { ( ( BlockStem ) Block . blocksList [ i ] ) . fertilizeStem ( par3World , par4 , par5 , par6 ) ; par1ItemStack . stackSize -- ; } return true ; } if ( i == Block . crops . blockID ) { if ( ! par3World . isRemote ) { ( ( BlockCrops ) Block . crops ) . fertilize ( par3World , par4 , par5 , par6 ) ; par1ItemStack . stackSize -- ; } return true ; } if ( i == Block . grass . blockID ) { if ( ! par3World . isRemote ) { par1ItemStack . stackSize -- ; label0 : for ( int j = <NUM_LIT:0> ; j < <NUM_LIT> ; j ++ ) { int k = par4 ; int l = par5 + <NUM_LIT:1> ; int i1 = par6 ; for ( int j1 = <NUM_LIT:0> ; j1 < j / <NUM_LIT:16> ; j1 ++ ) { k += itemRand . nextInt ( <NUM_LIT:3> ) - <NUM_LIT:1> ; l += ( ( itemRand . nextInt ( <NUM_LIT:3> ) - <NUM_LIT:1> ) * itemRand . nextInt ( <NUM_LIT:3> ) ) / <NUM_LIT:2> ; i1 += itemRand . nextInt ( <NUM_LIT:3> ) - <NUM_LIT:1> ; if ( par3World . getBlockId ( k , l - <NUM_LIT:1> , i1 ) != Block . grass . blockID || par3World . isBlockNormalCube ( k , l , i1 ) ) { continue label0 ; } } if ( par3World . getBlockId ( k , l , i1 ) != <NUM_LIT:0> ) { continue ; } if ( itemRand . nextInt ( <NUM_LIT:10> ) != <NUM_LIT:0> ) { par3World . setBlockAndMetadataWithNotify ( k , l , i1 , Block . tallGrass . blockID , <NUM_LIT:1> ) ; continue ; } if ( itemRand . nextInt ( <NUM_LIT:3> ) != <NUM_LIT:0> ) { par3World . setBlockWithNotify ( k , l , i1 , Block . plantYellow . blockID ) ; } else { par3World . setBlockWithNotify ( k , l , i1 , Block . plantRed . blockID ) ; } } } return true ; } } return false ; } public void useItemOnEntity ( ItemStack par1ItemStack , EntityLiving par2EntityLiving ) { if ( par2EntityLiving instanceof EntitySheep ) { EntitySheep entitysheep = ( EntitySheep ) par2EntityLiving ; int i = BlockCloth . getBlockFromDye ( par1ItemStack . getItemDamage ( ) ) ; if ( ! entitysheep . getSheared ( ) && entitysheep . getFleeceColor ( ) != i ) { entitysheep . setFleeceColor ( i ) ; par1ItemStack . stackSize -- ; } } } } </s>
|
<s> package net . minecraft . src ; public class GenLayerRiverMix extends GenLayer { private GenLayer field_35033_b ; private GenLayer field_35034_c ; public GenLayerRiverMix ( long par1 , GenLayer par3GenLayer , GenLayer par4GenLayer ) { super ( par1 ) ; field_35033_b = par3GenLayer ; field_35034_c = par4GenLayer ; } public void initWorldGenSeed ( long par1 ) { field_35033_b . initWorldGenSeed ( par1 ) ; field_35034_c . initWorldGenSeed ( par1 ) ; super . initWorldGenSeed ( par1 ) ; } public int [ ] getInts ( int par1 , int par2 , int par3 , int par4 ) { int ai [ ] = field_35033_b . getInts ( par1 , par2 , par3 , par4 ) ; int ai1 [ ] = field_35034_c . getInts ( par1 , par2 , par3 , par4 ) ; int ai2 [ ] = IntCache . getIntCache ( par3 * par4 ) ; for ( int i = <NUM_LIT:0> ; i < par3 * par4 ; i ++ ) { if ( ai [ i ] == BiomeGenBase . ocean . biomeID ) { ai2 [ i ] = ai [ i ] ; continue ; } if ( ai1 [ i ] >= <NUM_LIT:0> ) { if ( ai [ i ] == BiomeGenBase . icePlains . biomeID ) { ai2 [ i ] = BiomeGenBase . frozenRiver . biomeID ; continue ; } if ( ai [ i ] == BiomeGenBase . mushroomIsland . biomeID || ai [ i ] == BiomeGenBase . mushroomIslandShore . biomeID ) { ai2 [ i ] = BiomeGenBase . mushroomIslandShore . biomeID ; } else { ai2 [ i ] = ai1 [ i ] ; } } else { ai2 [ i ] = ai [ i ] ; } } return ai2 ; } } </s>
|
<s> package net . minecraft . src ; public enum EnumArt { Kebab ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:0> , <NUM_LIT:0> ) , Aztec ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:0> ) , Alban ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:32> , <NUM_LIT:0> ) , Aztec2 ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT:0> ) , Bomb ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT:0> ) , Plant ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT:0> ) , Wasteland ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT:0> ) , Pool ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:16> , <NUM_LIT:0> , <NUM_LIT:32> ) , Courbet ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:16> , <NUM_LIT:32> , <NUM_LIT:32> ) , Sea ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT:32> ) , Sunset ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT:32> ) , Creebet ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:16> , <NUM_LIT> , <NUM_LIT:32> ) , Wanderer ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:32> , <NUM_LIT:0> , <NUM_LIT> ) , Graham ( "<STR_LIT>" , <NUM_LIT:16> , <NUM_LIT:32> , <NUM_LIT:16> , <NUM_LIT> ) , Match ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:32> , <NUM_LIT:0> , <NUM_LIT> ) , Bust ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:32> , <NUM_LIT:32> , <NUM_LIT> ) , Stage ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:32> , <NUM_LIT> , <NUM_LIT> ) , Void ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:32> , <NUM_LIT> , <NUM_LIT> ) , SkullAndRoses ( "<STR_LIT>" , <NUM_LIT:32> , <NUM_LIT:32> , <NUM_LIT> , <NUM_LIT> ) , Fighters ( "<STR_LIT>" , <NUM_LIT> , <NUM_LIT:32> , <NUM_LIT:0> , <NUM_LIT> ) , Pointer ( "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT> ) , Pigscene ( "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , BurningSkull ( "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , Skeleton ( "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) , DonkeyKong ( "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; public static final int maxArtTitleLength = "<STR_LIT>" . length ( ) ; public final String title ; public final int sizeX ; public final int sizeY ; public final int offsetX ; public final int offsetY ; private EnumArt ( String par3Str , int par4 , int par5 , int par6 , int par7 ) { title = par3Str ; sizeX = par4 ; sizeY = par5 ; offsetX = par6 ; offsetY = par7 ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Comparator ; public class EntityAINearestAttackableTargetSorter implements Comparator { private Entity theEntity ; final EntityAINearestAttackableTarget parent ; public EntityAINearestAttackableTargetSorter ( EntityAINearestAttackableTarget par1EntityAINearestAttackableTarget , Entity par2Entity ) { parent = par1EntityAINearestAttackableTarget ; theEntity = par2Entity ; } public int func_48470_a ( Entity par1Entity , Entity par2Entity ) { double d = theEntity . getDistanceSqToEntity ( par1Entity ) ; double d1 = theEntity . getDistanceSqToEntity ( par2Entity ) ; if ( d < d1 ) { return - <NUM_LIT:1> ; } return d <= d1 ? <NUM_LIT:0> : <NUM_LIT:1> ; } public int compare ( Object par1Obj , Object par2Obj ) { return func_48470_a ( ( Entity ) par1Obj , ( Entity ) par2Obj ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockWeb extends Block { public BlockWeb ( int par1 , int par2 ) { super ( par1 , par2 , Material . web ) ; } public void onEntityCollidedWithBlock ( World par1World , int par2 , int par3 , int par4 , Entity par5Entity ) { par5Entity . setInWeb ( ) ; } public boolean isOpaqueCube ( ) { return false ; } public AxisAlignedBB getCollisionBoundingBoxFromPool ( World par1World , int par2 , int par3 , int i ) { return null ; } public int getRenderType ( ) { return <NUM_LIT:1> ; } public boolean renderAsNormalBlock ( ) { return false ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Item . silk . shiftedIndex ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenPumpkin extends WorldGenerator { public WorldGenPumpkin ( ) { } 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 . grass . blockID && Block . pumpkin . canPlaceBlockAt ( par1World , j , k , l ) ) { par1World . setBlockAndMetadata ( j , k , l , Block . pumpkin . blockID , par2Random . nextInt ( <NUM_LIT:4> ) ) ; } } return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; public class BiomeGenEnd extends BiomeGenBase { public BiomeGenEnd ( int par1 ) { super ( par1 ) ; spawnableMonsterList . clear ( ) ; spawnableCreatureList . clear ( ) ; spawnableWaterCreatureList . clear ( ) ; spawnableMonsterList . add ( new SpawnListEntry ( net . minecraft . src . EntityEnderman . class , <NUM_LIT:10> , <NUM_LIT:4> , <NUM_LIT:4> ) ) ; topBlock = ( byte ) Block . dirt . blockID ; fillerBlock = ( byte ) Block . dirt . blockID ; biomeDecorator = new BiomeEndDecorator ( this ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenLakes extends WorldGenerator { private int blockIndex ; public WorldGenLakes ( int par1 ) { blockIndex = par1 ; } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { par3 -= <NUM_LIT:8> ; for ( par5 -= <NUM_LIT:8> ; par4 > <NUM_LIT:5> && par1World . isAirBlock ( par3 , par4 , par5 ) ; par4 -- ) { } if ( par4 <= <NUM_LIT:4> ) { return false ; } par4 -= <NUM_LIT:4> ; boolean aflag [ ] = new boolean [ <NUM_LIT> ] ; int i = par2Random . nextInt ( <NUM_LIT:4> ) + <NUM_LIT:4> ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { double d = par2Random . nextDouble ( ) * <NUM_LIT> + <NUM_LIT> ; double d1 = par2Random . nextDouble ( ) * <NUM_LIT> + <NUM_LIT> ; double d2 = par2Random . nextDouble ( ) * <NUM_LIT> + <NUM_LIT> ; double d3 = par2Random . nextDouble ( ) * ( <NUM_LIT> - d - <NUM_LIT> ) + <NUM_LIT> + d / <NUM_LIT> ; double d4 = par2Random . nextDouble ( ) * ( <NUM_LIT> - d1 - <NUM_LIT> ) + <NUM_LIT> + d1 / <NUM_LIT> ; double d5 = par2Random . nextDouble ( ) * ( <NUM_LIT> - d2 - <NUM_LIT> ) + <NUM_LIT> + d2 / <NUM_LIT> ; for ( int i4 = <NUM_LIT:1> ; i4 < <NUM_LIT:15> ; i4 ++ ) { for ( int j4 = <NUM_LIT:1> ; j4 < <NUM_LIT:15> ; j4 ++ ) { for ( int k4 = <NUM_LIT:1> ; k4 < <NUM_LIT:7> ; k4 ++ ) { double d6 = ( ( double ) i4 - d3 ) / ( d / <NUM_LIT> ) ; double d7 = ( ( double ) k4 - d4 ) / ( d1 / <NUM_LIT> ) ; double d8 = ( ( double ) j4 - d5 ) / ( d2 / <NUM_LIT> ) ; double d9 = d6 * d6 + d7 * d7 + d8 * d8 ; if ( d9 < <NUM_LIT> ) { aflag [ ( i4 * <NUM_LIT:16> + j4 ) * <NUM_LIT:8> + k4 ] = true ; } } } } } for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:16> ; k ++ ) { for ( int l1 = <NUM_LIT:0> ; l1 < <NUM_LIT:16> ; l1 ++ ) { for ( int i3 = <NUM_LIT:0> ; i3 < <NUM_LIT:8> ; i3 ++ ) { boolean flag = ! aflag [ ( k * <NUM_LIT:16> + l1 ) * <NUM_LIT:8> + i3 ] && ( k < <NUM_LIT:15> && aflag [ ( ( k + <NUM_LIT:1> ) * <NUM_LIT:16> + l1 ) * <NUM_LIT:8> + i3 ] || k > <NUM_LIT:0> && aflag [ ( ( k - <NUM_LIT:1> ) * <NUM_LIT:16> + l1 ) * <NUM_LIT:8> + i3 ] || l1 < <NUM_LIT:15> && aflag [ ( k * <NUM_LIT:16> + ( l1 + <NUM_LIT:1> ) ) * <NUM_LIT:8> + i3 ] || l1 > <NUM_LIT:0> && aflag [ ( k * <NUM_LIT:16> + ( l1 - <NUM_LIT:1> ) ) * <NUM_LIT:8> + i3 ] || i3 < <NUM_LIT:7> && aflag [ ( k * <NUM_LIT:16> + l1 ) * <NUM_LIT:8> + ( i3 + <NUM_LIT:1> ) ] || i3 > <NUM_LIT:0> && aflag [ ( k * <NUM_LIT:16> + l1 ) * <NUM_LIT:8> + ( i3 - <NUM_LIT:1> ) ] ) ; if ( ! flag ) { continue ; } Material material = par1World . getBlockMaterial ( par3 + k , par4 + i3 , par5 + l1 ) ; if ( i3 >= <NUM_LIT:4> && material . isLiquid ( ) ) { return false ; } if ( i3 < <NUM_LIT:4> && ! material . isSolid ( ) && par1World . getBlockId ( par3 + k , par4 + i3 , par5 + l1 ) != blockIndex ) { return false ; } } } } for ( int l = <NUM_LIT:0> ; l < <NUM_LIT:16> ; l ++ ) { for ( int i2 = <NUM_LIT:0> ; i2 < <NUM_LIT:16> ; i2 ++ ) { for ( int j3 = <NUM_LIT:0> ; j3 < <NUM_LIT:8> ; j3 ++ ) { if ( aflag [ ( l * <NUM_LIT:16> + i2 ) * <NUM_LIT:8> + j3 ] ) { par1World . setBlock ( par3 + l , par4 + j3 , par5 + i2 , j3 < <NUM_LIT:4> ? blockIndex : <NUM_LIT:0> ) ; } } } } for ( int i1 = <NUM_LIT:0> ; i1 < <NUM_LIT:16> ; i1 ++ ) { for ( int j2 = <NUM_LIT:0> ; j2 < <NUM_LIT:16> ; j2 ++ ) { for ( int k3 = <NUM_LIT:4> ; k3 < <NUM_LIT:8> ; k3 ++ ) { if ( ! aflag [ ( i1 * <NUM_LIT:16> + j2 ) * <NUM_LIT:8> + k3 ] || par1World . getBlockId ( par3 + i1 , ( par4 + k3 ) - <NUM_LIT:1> , par5 + j2 ) != Block . dirt . blockID || par1World . getSavedLightValue ( EnumSkyBlock . Sky , par3 + i1 , par4 + k3 , par5 + j2 ) <= <NUM_LIT:0> ) { continue ; } BiomeGenBase biomegenbase = par1World . getBiomeGenForCoords ( par3 + i1 , par5 + j2 ) ; if ( biomegenbase . topBlock == Block . mycelium . blockID ) { par1World . setBlock ( par3 + i1 , ( par4 + k3 ) - <NUM_LIT:1> , par5 + j2 , Block . mycelium . blockID ) ; } else { par1World . setBlock ( par3 + i1 , ( par4 + k3 ) - <NUM_LIT:1> , par5 + j2 , Block . grass . blockID ) ; } } } } if ( Block . blocksList [ blockIndex ] . blockMaterial == Material . lava ) { for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:16> ; j1 ++ ) { for ( int k2 = <NUM_LIT:0> ; k2 < <NUM_LIT:16> ; k2 ++ ) { for ( int l3 = <NUM_LIT:0> ; l3 < <NUM_LIT:8> ; l3 ++ ) { boolean flag1 = ! aflag [ ( j1 * <NUM_LIT:16> + k2 ) * <NUM_LIT:8> + l3 ] && ( j1 < <NUM_LIT:15> && aflag [ ( ( j1 + <NUM_LIT:1> ) * <NUM_LIT:16> + k2 ) * <NUM_LIT:8> + l3 ] || j1 > <NUM_LIT:0> && aflag [ ( ( j1 - <NUM_LIT:1> ) * <NUM_LIT:16> + k2 ) * <NUM_LIT:8> + l3 ] || k2 < <NUM_LIT:15> && aflag [ ( j1 * <NUM_LIT:16> + ( k2 + <NUM_LIT:1> ) ) * <NUM_LIT:8> + l3 ] || k2 > <NUM_LIT:0> && aflag [ ( j1 * <NUM_LIT:16> + ( k2 - <NUM_LIT:1> ) ) * <NUM_LIT:8> + l3 ] || l3 < <NUM_LIT:7> && aflag [ ( j1 * <NUM_LIT:16> + k2 ) * <NUM_LIT:8> + ( l3 + <NUM_LIT:1> ) ] || l3 > <NUM_LIT:0> && aflag [ ( j1 * <NUM_LIT:16> + k2 ) * <NUM_LIT:8> + ( l3 - <NUM_LIT:1> ) ] ) ; if ( flag1 && ( l3 < <NUM_LIT:4> || par2Random . nextInt ( <NUM_LIT:2> ) != <NUM_LIT:0> ) && par1World . getBlockMaterial ( par3 + j1 , par4 + l3 , par5 + k2 ) . isSolid ( ) ) { par1World . setBlock ( par3 + j1 , par4 + l3 , par5 + k2 , Block . stone . blockID ) ; } } } } } if ( Block . blocksList [ blockIndex ] . blockMaterial == Material . water ) { for ( int k1 = <NUM_LIT:0> ; k1 < <NUM_LIT:16> ; k1 ++ ) { for ( int l2 = <NUM_LIT:0> ; l2 < <NUM_LIT:16> ; l2 ++ ) { byte byte0 = <NUM_LIT:4> ; if ( par1World . isBlockHydratedDirectly ( par3 + k1 , par4 + byte0 , par5 + l2 ) ) { par1World . setBlock ( par3 + k1 , par4 + byte0 , par5 + l2 , Block . ice . blockID ) ; } } } } return true ; } } </s>
|
<s> package net . minecraft . src ; public class NibbleArrayReader { public final byte data [ ] ; private final int depthBits ; private final int depthBitsPlusFour ; public NibbleArrayReader ( byte par1ArrayOfByte [ ] , int par2 ) { data = par1ArrayOfByte ; depthBits = par2 ; depthBitsPlusFour = par2 + <NUM_LIT:4> ; } public int get ( int par1 , int par2 , int par3 ) { int i = par1 << depthBitsPlusFour | par3 << depthBits | par2 ; 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> ; } } } </s>
|
<s> package net . minecraft . src ; public class GenLayerRiverInit extends GenLayer { public GenLayerRiverInit ( long par1 , GenLayer par3GenLayer ) { super ( par1 ) ; parent = par3GenLayer ; } public int [ ] getInts ( int par1 , int par2 , int par3 , int par4 ) { int ai [ ] = parent . getInts ( par1 , par2 , par3 , par4 ) ; int ai1 [ ] = IntCache . getIntCache ( par3 * par4 ) ; for ( int i = <NUM_LIT:0> ; i < par4 ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < par3 ; j ++ ) { initChunkSeed ( j + par1 , i + par2 ) ; ai1 [ j + i * par3 ] = ai [ j + i * par3 ] <= <NUM_LIT:0> ? <NUM_LIT:0> : nextInt ( <NUM_LIT:2> ) + <NUM_LIT:2> ; } } return ai1 ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentVillageField2 extends ComponentVillage { private int averageGroundLevel ; public ComponentVillageField2 ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; averageGroundLevel = - <NUM_LIT:1> ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent structurecomponent , List list , Random random ) { } public static ComponentVillageField2 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:7> , <NUM_LIT:4> , <NUM_LIT:9> , par5 ) ; if ( ! canVillageGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentVillageField2 ( 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:4> ) - <NUM_LIT:1> , <NUM_LIT:0> ) ; } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:7> , Block . tilledField . blockID , Block . tilledField . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:7> , Block . tilledField . blockID , Block . tilledField . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:8> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:8> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:0> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:8> , Block . wood . blockID , Block . wood . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:7> , Block . waterMoving . blockID , Block . waterMoving . blockID , false ) ; for ( int i = <NUM_LIT:1> ; i <= <NUM_LIT:7> ; i ++ ) { placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:1> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:2> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:4> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:5> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; } for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:9> ; j ++ ) { for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:7> ; k ++ ) { clearCurrentPositionBlocksUpwards ( par1World , k , <NUM_LIT:4> , j , par3StructureBoundingBox ) ; fillCurrentPositionBlocksDownwards ( par1World , Block . dirt . blockID , <NUM_LIT:0> , k , - <NUM_LIT:1> , j , par3StructureBoundingBox ) ; } } return true ; } } </s>
|
<s> package net . minecraft . src ; public class EnchantmentDurability extends Enchantment { protected EnchantmentDurability ( int par1 , int par2 ) { super ( par1 , par2 , EnumEnchantmentType . digger ) ; setName ( "<STR_LIT>" ) ; } public int getMinEnchantability ( int par1 ) { return <NUM_LIT:5> + ( par1 - <NUM_LIT:1> ) * <NUM_LIT:10> ; } public int getMaxEnchantability ( int par1 ) { return super . getMinEnchantability ( par1 ) + <NUM_LIT> ; } public int getMaxLevel ( ) { return <NUM_LIT:3> ; } } </s>
|
<s> package net . minecraft . src ; public class ChunkCoordIntPair { public final int chunkXPos ; public final int chunkZPos ; public ChunkCoordIntPair ( int par1 , int par2 ) { chunkXPos = par1 ; chunkZPos = par2 ; } public static long chunkXZ2Int ( int par0 , int par1 ) { long l = par0 ; long l1 = par1 ; return l & <NUM_LIT> | ( l1 & <NUM_LIT> ) << <NUM_LIT:32> ; } public int hashCode ( ) { long l = chunkXZ2Int ( chunkXPos , chunkZPos ) ; int i = ( int ) l ; int j = ( int ) ( l > > <NUM_LIT:32> ) ; return i ^ j ; } public boolean equals ( Object par1Obj ) { ChunkCoordIntPair chunkcoordintpair = ( ChunkCoordIntPair ) par1Obj ; return chunkcoordintpair . chunkXPos == chunkXPos && chunkcoordintpair . chunkZPos == chunkZPos ; } public double func_48477_a ( Entity par1Entity ) { double d = chunkXPos * <NUM_LIT:16> + <NUM_LIT:8> ; double d1 = chunkZPos * <NUM_LIT:16> + <NUM_LIT:8> ; double d2 = d - par1Entity . posX ; double d3 = d1 - par1Entity . posZ ; return d2 * d2 + d3 * d3 ; } public int getCenterXPos ( ) { return ( chunkXPos << <NUM_LIT:4> ) + <NUM_LIT:8> ; } public int getCenterZPos ( ) { return ( chunkZPos << <NUM_LIT:4> ) + <NUM_LIT:8> ; } public ChunkPosition getChunkPosition ( int par1 ) { return new ChunkPosition ( getCenterXPos ( ) , par1 , getCenterZPos ( ) ) ; } public String toString ( ) { return ( new StringBuilder ( ) ) . append ( "<STR_LIT:[>" ) . append ( chunkXPos ) . append ( "<STR_LIT:U+002CU+0020>" ) . append ( chunkZPos ) . append ( "<STR_LIT:]>" ) . toString ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class WorldChunkManager { private GenLayer genBiomes ; private GenLayer biomeIndexLayer ; private BiomeCache biomeCache ; private List biomesToSpawnIn ; protected WorldChunkManager ( ) { biomeCache = new BiomeCache ( this ) ; biomesToSpawnIn = new ArrayList ( ) ; biomesToSpawnIn . add ( BiomeGenBase . forest ) ; biomesToSpawnIn . add ( BiomeGenBase . plains ) ; biomesToSpawnIn . add ( BiomeGenBase . taiga ) ; biomesToSpawnIn . add ( BiomeGenBase . taigaHills ) ; biomesToSpawnIn . add ( BiomeGenBase . forestHills ) ; biomesToSpawnIn . add ( BiomeGenBase . jungle ) ; biomesToSpawnIn . add ( BiomeGenBase . jungleHills ) ; } public WorldChunkManager ( long par1 , WorldType par3WorldType ) { this ( ) ; GenLayer agenlayer [ ] = GenLayer . func_48391_a ( par1 , par3WorldType ) ; genBiomes = agenlayer [ <NUM_LIT:0> ] ; biomeIndexLayer = agenlayer [ <NUM_LIT:1> ] ; } public WorldChunkManager ( World par1World ) { this ( par1World . getSeed ( ) , par1World . getWorldInfo ( ) . getTerrainType ( ) ) ; } public List getBiomesToSpawnIn ( ) { return biomesToSpawnIn ; } public BiomeGenBase getBiomeGenAt ( int par1 , int par2 ) { return biomeCache . getBiomeGenAt ( par1 , par2 ) ; } public float [ ] getRainfall ( float par1ArrayOfFloat [ ] , int par2 , int par3 , int par4 , int par5 ) { IntCache . resetIntCache ( ) ; if ( par1ArrayOfFloat == null || par1ArrayOfFloat . length < par4 * par5 ) { par1ArrayOfFloat = new float [ par4 * par5 ] ; } int ai [ ] = biomeIndexLayer . getInts ( par2 , par3 , par4 , par5 ) ; for ( int i = <NUM_LIT:0> ; i < par4 * par5 ; i ++ ) { float f = ( float ) BiomeGenBase . biomeList [ ai [ i ] ] . getIntRainfall ( ) / <NUM_LIT> ; if ( f > <NUM_LIT> ) { f = <NUM_LIT> ; } par1ArrayOfFloat [ i ] = f ; } return par1ArrayOfFloat ; } public float [ ] getTemperatures ( float par1ArrayOfFloat [ ] , int par2 , int par3 , int par4 , int par5 ) { IntCache . resetIntCache ( ) ; if ( par1ArrayOfFloat == null || par1ArrayOfFloat . length < par4 * par5 ) { par1ArrayOfFloat = new float [ par4 * par5 ] ; } int ai [ ] = biomeIndexLayer . getInts ( par2 , par3 , par4 , par5 ) ; for ( int i = <NUM_LIT:0> ; i < par4 * par5 ; i ++ ) { float f = ( float ) BiomeGenBase . biomeList [ ai [ i ] ] . getIntTemperature ( ) / <NUM_LIT> ; if ( f > <NUM_LIT> ) { f = <NUM_LIT> ; } par1ArrayOfFloat [ i ] = f ; } return par1ArrayOfFloat ; } public BiomeGenBase [ ] getBiomesForGeneration ( BiomeGenBase par1ArrayOfBiomeGenBase [ ] , int par2 , int par3 , int par4 , int par5 ) { IntCache . resetIntCache ( ) ; if ( par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase . length < par4 * par5 ) { par1ArrayOfBiomeGenBase = new BiomeGenBase [ par4 * par5 ] ; } int ai [ ] = genBiomes . getInts ( par2 , par3 , par4 , par5 ) ; for ( int i = <NUM_LIT:0> ; i < par4 * par5 ; i ++ ) { par1ArrayOfBiomeGenBase [ i ] = BiomeGenBase . biomeList [ ai [ i ] ] ; } return par1ArrayOfBiomeGenBase ; } public BiomeGenBase [ ] loadBlockGeneratorData ( BiomeGenBase par1ArrayOfBiomeGenBase [ ] , int par2 , int par3 , int par4 , int par5 ) { return getBiomeGenAt ( par1ArrayOfBiomeGenBase , par2 , par3 , par4 , par5 , true ) ; } public BiomeGenBase [ ] getBiomeGenAt ( BiomeGenBase par1ArrayOfBiomeGenBase [ ] , int par2 , int par3 , int par4 , int par5 , boolean par6 ) { IntCache . resetIntCache ( ) ; if ( par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase . length < par4 * par5 ) { par1ArrayOfBiomeGenBase = new BiomeGenBase [ par4 * par5 ] ; } if ( par6 && par4 == <NUM_LIT:16> && par5 == <NUM_LIT:16> && ( par2 & <NUM_LIT> ) == <NUM_LIT:0> && ( par3 & <NUM_LIT> ) == <NUM_LIT:0> ) { BiomeGenBase abiomegenbase [ ] = biomeCache . getCachedBiomes ( par2 , par3 ) ; System . arraycopy ( abiomegenbase , <NUM_LIT:0> , par1ArrayOfBiomeGenBase , <NUM_LIT:0> , par4 * par5 ) ; return par1ArrayOfBiomeGenBase ; } int ai [ ] = biomeIndexLayer . getInts ( par2 , par3 , par4 , par5 ) ; for ( int i = <NUM_LIT:0> ; i < par4 * par5 ; i ++ ) { par1ArrayOfBiomeGenBase [ i ] = BiomeGenBase . biomeList [ ai [ i ] ] ; } return par1ArrayOfBiomeGenBase ; } public boolean areBiomesViable ( int par1 , int par2 , int par3 , List par4List ) { int i = par1 - par3 > > <NUM_LIT:2> ; int j = par2 - par3 > > <NUM_LIT:2> ; int k = par1 + par3 > > <NUM_LIT:2> ; int l = par2 + par3 > > <NUM_LIT:2> ; int i1 = ( k - i ) + <NUM_LIT:1> ; int j1 = ( l - j ) + <NUM_LIT:1> ; int ai [ ] = genBiomes . getInts ( i , j , i1 , j1 ) ; for ( int k1 = <NUM_LIT:0> ; k1 < i1 * j1 ; k1 ++ ) { BiomeGenBase biomegenbase = BiomeGenBase . biomeList [ ai [ k1 ] ] ; if ( ! par4List . contains ( biomegenbase ) ) { return false ; } } return true ; } public ChunkPosition findBiomePosition ( int par1 , int par2 , int par3 , List par4List , Random par5Random ) { int i = par1 - par3 > > <NUM_LIT:2> ; int j = par2 - par3 > > <NUM_LIT:2> ; int k = par1 + par3 > > <NUM_LIT:2> ; int l = par2 + par3 > > <NUM_LIT:2> ; int i1 = ( k - i ) + <NUM_LIT:1> ; int j1 = ( l - j ) + <NUM_LIT:1> ; int ai [ ] = genBiomes . getInts ( i , j , i1 , j1 ) ; ChunkPosition chunkposition = null ; int k1 = <NUM_LIT:0> ; for ( int l1 = <NUM_LIT:0> ; l1 < ai . length ; l1 ++ ) { int i2 = i + l1 % i1 << <NUM_LIT:2> ; int j2 = j + l1 / i1 << <NUM_LIT:2> ; BiomeGenBase biomegenbase = BiomeGenBase . biomeList [ ai [ l1 ] ] ; if ( par4List . contains ( biomegenbase ) && ( chunkposition == null || par5Random . nextInt ( k1 + <NUM_LIT:1> ) == <NUM_LIT:0> ) ) { chunkposition = new ChunkPosition ( i2 , <NUM_LIT:0> , j2 ) ; k1 ++ ; } } return chunkposition ; } public void cleanupCache ( ) { biomeCache . cleanupCache ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . File ; import java . util . List ; public class AnvilSaveHandler extends SaveHandler { public AnvilSaveHandler ( File par1File , String par2Str , boolean par3 ) { super ( par1File , par2Str , par3 ) ; } public IChunkLoader getChunkLoader ( WorldProvider par1WorldProvider ) { File file = getWorldDirectory ( ) ; if ( par1WorldProvider instanceof WorldProviderHell ) { File file1 = new File ( file , "<STR_LIT>" ) ; file1 . mkdirs ( ) ; return new AnvilChunkLoader ( file1 ) ; } if ( par1WorldProvider instanceof WorldProviderEnd ) { File file2 = new File ( file , "<STR_LIT>" ) ; file2 . mkdirs ( ) ; return new AnvilChunkLoader ( file2 ) ; } else { return new AnvilChunkLoader ( file ) ; } } public void saveWorldInfoAndPlayer ( WorldInfo par1WorldInfo , List par2List ) { par1WorldInfo . setSaveVersion ( <NUM_LIT> ) ; super . saveWorldInfoAndPlayer ( par1WorldInfo , par2List ) ; } public void func_22093_e ( ) { try { ThreadedFileIOBase . threadedIOInstance . waitForFinish ( ) ; } catch ( InterruptedException interruptedexception ) { interruptedexception . printStackTrace ( ) ; } RegionFileCache . clearRegionFileReferences ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . * ; public class World implements IBlockAccess { public boolean scheduledUpdatesAreImmediate ; public List loadedEntityList ; private List unloadedEntityList ; private TreeSet scheduledTickTreeSet ; private Set scheduledTickSet ; public List loadedTileEntityList ; private List addedTileEntityList ; private List entityRemoval ; public List playerEntities ; public List weatherEffects ; private long cloudColour ; public int skylightSubtracted ; protected int updateLCG ; protected final int DIST_HASH_MAGIC = <NUM_LIT> ; protected float prevRainingStrength ; protected float rainingStrength ; protected float prevThunderingStrength ; protected float thunderingStrength ; protected int lastLightningBolt ; public int lightningFlash ; public boolean editingBlocks ; private long lockTimestamp ; protected int autosavePeriod ; public int difficultySetting ; public Random rand ; public boolean isNewWorld ; public final WorldProvider worldProvider ; protected List worldAccesses ; protected IChunkProvider chunkProvider ; protected final ISaveHandler saveHandler ; protected WorldInfo worldInfo ; public boolean findingSpawnPoint ; private boolean allPlayersSleeping ; public MapStorage mapStorage ; public final VillageCollection villageCollectionObj = new VillageCollection ( this ) ; private final VillageSiege villageSiegeObj = new VillageSiege ( this ) ; private ArrayList collidingBoundingBoxes ; private boolean scanningTileEntities ; protected boolean spawnHostileMobs ; protected boolean spawnPeacefulMobs ; protected Set activeChunkSet ; private int ambientTickCountdown ; int lightUpdateBlockList [ ] ; private List entitiesWithinAABBExcludingEntity ; public boolean isRemote ; public BiomeGenBase getBiomeGenForCoords ( int par1 , int par2 ) { if ( blockExists ( par1 , <NUM_LIT:0> , par2 ) ) { Chunk chunk = getChunkFromBlockCoords ( par1 , par2 ) ; if ( chunk != null ) { return chunk . func_48560_a ( par1 & <NUM_LIT> , par2 & <NUM_LIT> , worldProvider . worldChunkMgr ) ; } } return worldProvider . worldChunkMgr . getBiomeGenAt ( par1 , par2 ) ; } public WorldChunkManager getWorldChunkManager ( ) { return worldProvider . worldChunkMgr ; } public World ( ISaveHandler par1ISaveHandler , String par2Str , WorldSettings par3WorldSettings , WorldProvider par4WorldProvider ) { scheduledUpdatesAreImmediate = false ; loadedEntityList = new ArrayList ( ) ; unloadedEntityList = new ArrayList ( ) ; scheduledTickTreeSet = new TreeSet ( ) ; scheduledTickSet = new HashSet ( ) ; loadedTileEntityList = new ArrayList ( ) ; addedTileEntityList = new ArrayList ( ) ; entityRemoval = new ArrayList ( ) ; playerEntities = new ArrayList ( ) ; weatherEffects = new ArrayList ( ) ; cloudColour = <NUM_LIT> ; skylightSubtracted = <NUM_LIT:0> ; updateLCG = ( new Random ( ) ) . nextInt ( ) ; lastLightningBolt = <NUM_LIT:0> ; lightningFlash = <NUM_LIT:0> ; editingBlocks = false ; lockTimestamp = System . currentTimeMillis ( ) ; autosavePeriod = <NUM_LIT> ; rand = new Random ( ) ; isNewWorld = false ; worldAccesses = new ArrayList ( ) ; collidingBoundingBoxes = new ArrayList ( ) ; spawnHostileMobs = true ; spawnPeacefulMobs = true ; activeChunkSet = new HashSet ( ) ; ambientTickCountdown = rand . nextInt ( <NUM_LIT> ) ; lightUpdateBlockList = new int [ <NUM_LIT> ] ; entitiesWithinAABBExcludingEntity = new ArrayList ( ) ; isRemote = false ; saveHandler = par1ISaveHandler ; mapStorage = new MapStorage ( par1ISaveHandler ) ; worldInfo = par1ISaveHandler . loadWorldInfo ( ) ; isNewWorld = worldInfo == null ; if ( par4WorldProvider != null ) { worldProvider = par4WorldProvider ; } else if ( worldInfo != null && worldInfo . getDimension ( ) != <NUM_LIT:0> ) { worldProvider = WorldProvider . getProviderForDimension ( worldInfo . getDimension ( ) ) ; } else { worldProvider = WorldProvider . getProviderForDimension ( <NUM_LIT:0> ) ; } boolean flag = false ; if ( worldInfo == null ) { worldInfo = new WorldInfo ( par3WorldSettings , par2Str ) ; flag = true ; } else { worldInfo . setWorldName ( par2Str ) ; } worldProvider . registerWorld ( this ) ; chunkProvider = createChunkProvider ( ) ; if ( flag ) { generateSpawnPoint ( ) ; } calculateInitialSkylight ( ) ; calculateInitialWeather ( ) ; } protected IChunkProvider createChunkProvider ( ) { IChunkLoader ichunkloader = saveHandler . getChunkLoader ( worldProvider ) ; return new ChunkProvider ( this , ichunkloader , worldProvider . getChunkProvider ( ) ) ; } protected void generateSpawnPoint ( ) { if ( ! worldProvider . canRespawnHere ( ) ) { worldInfo . setSpawnPosition ( <NUM_LIT:0> , worldProvider . getAverageGroundLevel ( ) , <NUM_LIT:0> ) ; return ; } findingSpawnPoint = true ; WorldChunkManager worldchunkmanager = worldProvider . worldChunkMgr ; List list = worldchunkmanager . getBiomesToSpawnIn ( ) ; Random random = new Random ( getSeed ( ) ) ; ChunkPosition chunkposition = worldchunkmanager . findBiomePosition ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT> , list , random ) ; int i = <NUM_LIT:0> ; int j = worldProvider . getAverageGroundLevel ( ) ; int k = <NUM_LIT:0> ; if ( chunkposition != null ) { i = chunkposition . x ; k = chunkposition . z ; } else { System . out . println ( "<STR_LIT>" ) ; } int l = <NUM_LIT:0> ; do { if ( worldProvider . canCoordinateBeSpawn ( i , k ) ) { break ; } i += random . nextInt ( <NUM_LIT> ) - random . nextInt ( <NUM_LIT> ) ; k += random . nextInt ( <NUM_LIT> ) - random . nextInt ( <NUM_LIT> ) ; } while ( ++ l != <NUM_LIT:1000> ) ; worldInfo . setSpawnPosition ( i , j , k ) ; findingSpawnPoint = false ; } public ChunkCoordinates getEntrancePortalLocation ( ) { return worldProvider . getEntrancePortalLocation ( ) ; } public int getFirstUncoveredBlock ( int par1 , int par2 ) { int i ; for ( i = <NUM_LIT> ; ! isAirBlock ( par1 , i + <NUM_LIT:1> , par2 ) ; i ++ ) { } return getBlockId ( par1 , i , par2 ) ; } public void saveWorld ( boolean par1 , IProgressUpdate par2IProgressUpdate ) { if ( ! chunkProvider . canSave ( ) ) { return ; } if ( par2IProgressUpdate != null ) { par2IProgressUpdate . displaySavingString ( "<STR_LIT>" ) ; } saveLevel ( ) ; if ( par2IProgressUpdate != null ) { par2IProgressUpdate . displayLoadingString ( "<STR_LIT>" ) ; } chunkProvider . saveChunks ( par1 , par2IProgressUpdate ) ; } private void saveLevel ( ) { checkSessionLock ( ) ; saveHandler . saveWorldInfoAndPlayer ( worldInfo , playerEntities ) ; mapStorage . saveAllData ( ) ; } public int getBlockId ( int par1 , int par2 , int par3 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } if ( par2 < <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } else { return getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) . getBlockID ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } } public int func_48092_f ( int par1 , int par2 , int par3 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } if ( par2 < <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } else { return getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) . getBlockLightOpacity ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } } public boolean isAirBlock ( int par1 , int par2 , int par3 ) { return getBlockId ( par1 , par2 , par3 ) == <NUM_LIT:0> ; } public boolean func_48084_h ( int par1 , int par2 , int par3 ) { int i = getBlockId ( par1 , par2 , par3 ) ; return Block . blocksList [ i ] != null && Block . blocksList [ i ] . hasTileEntity ( ) ; } public boolean blockExists ( int par1 , int par2 , int par3 ) { if ( par2 < <NUM_LIT:0> || par2 >= <NUM_LIT> ) { return false ; } else { return chunkExists ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; } } public boolean doChunksNearChunkExist ( int par1 , int par2 , int par3 , int par4 ) { return checkChunksExist ( par1 - par4 , par2 - par4 , par3 - par4 , par1 + par4 , par2 + par4 , par3 + par4 ) ; } public boolean checkChunksExist ( int par1 , int par2 , int par3 , int par4 , int par5 , int par6 ) { if ( par5 < <NUM_LIT:0> || par2 >= <NUM_LIT> ) { return false ; } par1 >>= <NUM_LIT:4> ; par3 >>= <NUM_LIT:4> ; par4 >>= <NUM_LIT:4> ; par6 >>= <NUM_LIT:4> ; for ( int i = par1 ; i <= par4 ; i ++ ) { for ( int j = par3 ; j <= par6 ; j ++ ) { if ( ! chunkExists ( i , j ) ) { return false ; } } } return true ; } private boolean chunkExists ( int par1 , int par2 ) { return chunkProvider . chunkExists ( par1 , par2 ) ; } public Chunk getChunkFromBlockCoords ( int par1 , int par2 ) { return getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par2 > > <NUM_LIT:4> ) ; } public Chunk getChunkFromChunkCoords ( int par1 , int par2 ) { return chunkProvider . provideChunk ( par1 , par2 ) ; } public boolean setBlockAndMetadata ( int par1 , int par2 , int par3 , int par4 , int par5 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return false ; } if ( par2 < <NUM_LIT:0> ) { return false ; } if ( par2 >= <NUM_LIT> ) { return false ; } else { Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; boolean flag = chunk . setBlockIDWithMetadata ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> , par4 , par5 ) ; Profiler . startSection ( "<STR_LIT>" ) ; updateAllLightTypes ( par1 , par2 , par3 ) ; Profiler . endSection ( ) ; return flag ; } } public boolean setBlock ( int par1 , int par2 , int par3 , int par4 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return false ; } if ( par2 < <NUM_LIT:0> ) { return false ; } if ( par2 >= <NUM_LIT> ) { return false ; } else { Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; boolean flag = chunk . setBlockID ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> , par4 ) ; Profiler . startSection ( "<STR_LIT>" ) ; updateAllLightTypes ( par1 , par2 , par3 ) ; Profiler . endSection ( ) ; return flag ; } } public Material getBlockMaterial ( int par1 , int par2 , int par3 ) { int i = getBlockId ( par1 , par2 , par3 ) ; if ( i == <NUM_LIT:0> ) { return Material . air ; } else { return Block . blocksList [ i ] . blockMaterial ; } } public int getBlockMetadata ( int par1 , int par2 , int par3 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } if ( par2 < <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } else { Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; par1 &= <NUM_LIT> ; par3 &= <NUM_LIT> ; return chunk . getBlockMetadata ( par1 , par2 , par3 ) ; } } public void setBlockMetadataWithNotify ( int par1 , int par2 , int par3 , int par4 ) { if ( setBlockMetadata ( par1 , par2 , par3 , par4 ) ) { int i = getBlockId ( par1 , par2 , par3 ) ; if ( Block . requiresSelfNotify [ i & <NUM_LIT> ] ) { notifyBlockChange ( par1 , par2 , par3 , i ) ; } else { notifyBlocksOfNeighborChange ( par1 , par2 , par3 , i ) ; } } } public boolean setBlockMetadata ( int par1 , int par2 , int par3 , int par4 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return false ; } if ( par2 < <NUM_LIT:0> ) { return false ; } if ( par2 >= <NUM_LIT> ) { return false ; } else { Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; par1 &= <NUM_LIT> ; par3 &= <NUM_LIT> ; return chunk . setBlockMetadata ( par1 , par2 , par3 , par4 ) ; } } public boolean setBlockWithNotify ( int par1 , int par2 , int par3 , int par4 ) { if ( setBlock ( par1 , par2 , par3 , par4 ) ) { notifyBlockChange ( par1 , par2 , par3 , par4 ) ; return true ; } else { return false ; } } public boolean setBlockAndMetadataWithNotify ( int par1 , int par2 , int par3 , int par4 , int par5 ) { if ( setBlockAndMetadata ( par1 , par2 , par3 , par4 , par5 ) ) { notifyBlockChange ( par1 , par2 , par3 , par4 ) ; return true ; } else { return false ; } } public void markBlockNeedsUpdate ( int par1 , int par2 , int par3 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . markBlockNeedsUpdate ( par1 , par2 , par3 ) ; } } public void notifyBlockChange ( int par1 , int par2 , int par3 , int par4 ) { markBlockNeedsUpdate ( par1 , par2 , par3 ) ; notifyBlocksOfNeighborChange ( par1 , par2 , par3 , par4 ) ; } public void markBlocksDirtyVertical ( int par1 , int par2 , int par3 , int par4 ) { if ( par3 > par4 ) { int i = par4 ; par4 = par3 ; par3 = i ; } if ( ! worldProvider . hasNoSky ) { for ( int j = par3 ; j <= par4 ; j ++ ) { updateLightByType ( EnumSkyBlock . Sky , par1 , j , par2 ) ; } } markBlocksDirty ( par1 , par3 , par2 , par1 , par4 , par2 ) ; } public void markBlockAsNeedsUpdate ( int par1 , int par2 , int par3 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . markBlockRangeNeedsUpdate ( par1 , par2 , par3 , par1 , par2 , par3 ) ; } } public void markBlocksDirty ( int par1 , int par2 , int par3 , int par4 , int par5 , int par6 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . markBlockRangeNeedsUpdate ( par1 , par2 , par3 , par4 , par5 , par6 ) ; } } public void notifyBlocksOfNeighborChange ( int par1 , int par2 , int par3 , int par4 ) { notifyBlockOfNeighborChange ( par1 - <NUM_LIT:1> , par2 , par3 , par4 ) ; notifyBlockOfNeighborChange ( par1 + <NUM_LIT:1> , par2 , par3 , par4 ) ; notifyBlockOfNeighborChange ( par1 , par2 - <NUM_LIT:1> , par3 , par4 ) ; notifyBlockOfNeighborChange ( par1 , par2 + <NUM_LIT:1> , par3 , par4 ) ; notifyBlockOfNeighborChange ( par1 , par2 , par3 - <NUM_LIT:1> , par4 ) ; notifyBlockOfNeighborChange ( par1 , par2 , par3 + <NUM_LIT:1> , par4 ) ; } private void notifyBlockOfNeighborChange ( int par1 , int par2 , int par3 , int par4 ) { if ( editingBlocks || isRemote ) { return ; } Block block = Block . blocksList [ getBlockId ( par1 , par2 , par3 ) ] ; if ( block != null ) { block . onNeighborBlockChange ( this , par1 , par2 , par3 , par4 ) ; } } public boolean canBlockSeeTheSky ( int par1 , int par2 , int par3 ) { return getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) . canBlockSeeTheSky ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } public int getFullBlockLightValue ( int par1 , int par2 , int par3 ) { if ( par2 < <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 >= <NUM_LIT> ) { par2 = <NUM_LIT:255> ; } return getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) . getBlockLightValue ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> , <NUM_LIT:0> ) ; } public int getBlockLightValue ( int par1 , int par2 , int par3 ) { return getBlockLightValue_do ( par1 , par2 , par3 , true ) ; } public int getBlockLightValue_do ( int par1 , int par2 , int par3 , boolean par4 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return <NUM_LIT:15> ; } if ( par4 ) { int i = getBlockId ( par1 , par2 , par3 ) ; if ( i == Block . stairSingle . blockID || i == Block . tilledField . blockID || i == Block . stairCompactCobblestone . blockID || i == Block . stairCompactPlanks . blockID ) { int j = getBlockLightValue_do ( par1 , par2 + <NUM_LIT:1> , par3 , false ) ; int k = getBlockLightValue_do ( par1 + <NUM_LIT:1> , par2 , par3 , false ) ; int l = getBlockLightValue_do ( par1 - <NUM_LIT:1> , par2 , par3 , false ) ; int i1 = getBlockLightValue_do ( par1 , par2 , par3 + <NUM_LIT:1> , false ) ; int j1 = getBlockLightValue_do ( par1 , par2 , par3 - <NUM_LIT:1> , false ) ; if ( k > j ) { j = k ; } if ( l > j ) { j = l ; } if ( i1 > j ) { j = i1 ; } if ( j1 > j ) { j = j1 ; } return j ; } } if ( par2 < <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 >= <NUM_LIT> ) { par2 = <NUM_LIT:255> ; } Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; par1 &= <NUM_LIT> ; par3 &= <NUM_LIT> ; return chunk . getBlockLightValue ( par1 , par2 , par3 , skylightSubtracted ) ; } public int getHeightValue ( int par1 , int par2 ) { if ( par1 < <NUM_LIT> || par2 < <NUM_LIT> || par1 >= <NUM_LIT> || par2 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } if ( ! chunkExists ( par1 > > <NUM_LIT:4> , par2 > > <NUM_LIT:4> ) ) { return <NUM_LIT:0> ; } else { Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par2 > > <NUM_LIT:4> ) ; return chunk . getHeightValue ( par1 & <NUM_LIT> , par2 & <NUM_LIT> ) ; } } public int getSavedLightValue ( EnumSkyBlock par1EnumSkyBlock , int par2 , int par3 , int par4 ) { if ( par3 < <NUM_LIT:0> ) { par3 = <NUM_LIT:0> ; } if ( par3 >= <NUM_LIT> ) { par3 = <NUM_LIT:255> ; } if ( par2 < <NUM_LIT> || par4 < <NUM_LIT> || par2 >= <NUM_LIT> || par4 >= <NUM_LIT> ) { return par1EnumSkyBlock . defaultLightValue ; } int i = par2 > > <NUM_LIT:4> ; int j = par4 > > <NUM_LIT:4> ; if ( ! chunkExists ( i , j ) ) { return par1EnumSkyBlock . defaultLightValue ; } else { Chunk chunk = getChunkFromChunkCoords ( i , j ) ; return chunk . getSavedLightValue ( par1EnumSkyBlock , par2 & <NUM_LIT> , par3 , par4 & <NUM_LIT> ) ; } } public void setLightValue ( EnumSkyBlock par1EnumSkyBlock , int par2 , int par3 , int par4 , int par5 ) { if ( par2 < <NUM_LIT> || par4 < <NUM_LIT> || par2 >= <NUM_LIT> || par4 >= <NUM_LIT> ) { return ; } if ( par3 < <NUM_LIT:0> ) { return ; } if ( par3 >= <NUM_LIT> ) { return ; } if ( ! chunkExists ( par2 > > <NUM_LIT:4> , par4 > > <NUM_LIT:4> ) ) { return ; } Chunk chunk = getChunkFromChunkCoords ( par2 > > <NUM_LIT:4> , par4 > > <NUM_LIT:4> ) ; chunk . setLightValue ( par1EnumSkyBlock , par2 & <NUM_LIT> , par3 , par4 & <NUM_LIT> , par5 ) ; for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . markBlockNeedsUpdate2 ( par2 , par3 , par4 ) ; } } public void func_48086_o ( int par1 , int par2 , int par3 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . markBlockNeedsUpdate2 ( par1 , par2 , par3 ) ; } } public float getLightBrightness ( int par1 , int par2 , int par3 ) { return worldProvider . lightBrightnessTable [ getBlockLightValue ( par1 , par2 , par3 ) ] ; } public boolean isDaytime ( ) { return skylightSubtracted < <NUM_LIT:4> ; } public MovingObjectPosition rayTraceBlocks ( Vec3D par1Vec3D , Vec3D par2Vec3D ) { return rayTraceBlocks_do_do ( par1Vec3D , par2Vec3D , false , false ) ; } public MovingObjectPosition rayTraceBlocks_do ( Vec3D par1Vec3D , Vec3D par2Vec3D , boolean par3 ) { return rayTraceBlocks_do_do ( par1Vec3D , par2Vec3D , par3 , false ) ; } public MovingObjectPosition rayTraceBlocks_do_do ( Vec3D par1Vec3D , Vec3D par2Vec3D , boolean par3 , boolean par4 ) { if ( Double . isNaN ( par1Vec3D . xCoord ) || Double . isNaN ( par1Vec3D . yCoord ) || Double . isNaN ( par1Vec3D . zCoord ) ) { return null ; } if ( Double . isNaN ( par2Vec3D . xCoord ) || Double . isNaN ( par2Vec3D . yCoord ) || Double . isNaN ( par2Vec3D . zCoord ) ) { return null ; } int i = MathHelper . floor_double ( par2Vec3D . xCoord ) ; int j = MathHelper . floor_double ( par2Vec3D . yCoord ) ; int k = MathHelper . floor_double ( par2Vec3D . zCoord ) ; int l = MathHelper . floor_double ( par1Vec3D . xCoord ) ; int i1 = MathHelper . floor_double ( par1Vec3D . yCoord ) ; int j1 = MathHelper . floor_double ( par1Vec3D . zCoord ) ; int k1 = getBlockId ( l , i1 , j1 ) ; int i2 = getBlockMetadata ( l , i1 , j1 ) ; Block block = Block . blocksList [ k1 ] ; if ( ( ! par4 || block == null || block . getCollisionBoundingBoxFromPool ( this , l , i1 , j1 ) != null ) && k1 > <NUM_LIT:0> && block . canCollideCheck ( i2 , par3 ) ) { MovingObjectPosition movingobjectposition = block . collisionRayTrace ( this , l , i1 , j1 , par1Vec3D , par2Vec3D ) ; if ( movingobjectposition != null ) { return movingobjectposition ; } } for ( int l1 = <NUM_LIT> ; l1 -- >= <NUM_LIT:0> ; ) { if ( Double . isNaN ( par1Vec3D . xCoord ) || Double . isNaN ( par1Vec3D . yCoord ) || Double . isNaN ( par1Vec3D . zCoord ) ) { return null ; } if ( l == i && i1 == j && j1 == k ) { return null ; } boolean flag = true ; boolean flag1 = true ; boolean flag2 = true ; double d = <NUM_LIT> ; double d1 = <NUM_LIT> ; double d2 = <NUM_LIT> ; if ( i > l ) { d = ( double ) l + <NUM_LIT> ; } else if ( i < l ) { d = ( double ) l + <NUM_LIT> ; } else { flag = false ; } if ( j > i1 ) { d1 = ( double ) i1 + <NUM_LIT> ; } else if ( j < i1 ) { d1 = ( double ) i1 + <NUM_LIT> ; } else { flag1 = false ; } if ( k > j1 ) { d2 = ( double ) j1 + <NUM_LIT> ; } else if ( k < j1 ) { d2 = ( double ) j1 + <NUM_LIT> ; } else { flag2 = false ; } double d3 = <NUM_LIT> ; double d4 = <NUM_LIT> ; double d5 = <NUM_LIT> ; double d6 = par2Vec3D . xCoord - par1Vec3D . xCoord ; double d7 = par2Vec3D . yCoord - par1Vec3D . yCoord ; double d8 = par2Vec3D . zCoord - par1Vec3D . zCoord ; if ( flag ) { d3 = ( d - par1Vec3D . xCoord ) / d6 ; } if ( flag1 ) { d4 = ( d1 - par1Vec3D . yCoord ) / d7 ; } if ( flag2 ) { d5 = ( d2 - par1Vec3D . zCoord ) / d8 ; } byte byte0 = <NUM_LIT:0> ; if ( d3 < d4 && d3 < d5 ) { if ( i > l ) { byte0 = <NUM_LIT:4> ; } else { byte0 = <NUM_LIT:5> ; } par1Vec3D . xCoord = d ; par1Vec3D . yCoord += d7 * d3 ; par1Vec3D . zCoord += d8 * d3 ; } else if ( d4 < d5 ) { if ( j > i1 ) { byte0 = <NUM_LIT:0> ; } else { byte0 = <NUM_LIT:1> ; } par1Vec3D . xCoord += d6 * d4 ; par1Vec3D . yCoord = d1 ; par1Vec3D . zCoord += d8 * d4 ; } else { if ( k > j1 ) { byte0 = <NUM_LIT:2> ; } else { byte0 = <NUM_LIT:3> ; } par1Vec3D . xCoord += d6 * d5 ; par1Vec3D . yCoord += d7 * d5 ; par1Vec3D . zCoord = d2 ; } Vec3D vec3d = Vec3D . createVector ( par1Vec3D . xCoord , par1Vec3D . yCoord , par1Vec3D . zCoord ) ; l = ( int ) ( vec3d . xCoord = MathHelper . floor_double ( par1Vec3D . xCoord ) ) ; if ( byte0 == <NUM_LIT:5> ) { l -- ; vec3d . xCoord ++ ; } i1 = ( int ) ( vec3d . yCoord = MathHelper . floor_double ( par1Vec3D . yCoord ) ) ; if ( byte0 == <NUM_LIT:1> ) { i1 -- ; vec3d . yCoord ++ ; } j1 = ( int ) ( vec3d . zCoord = MathHelper . floor_double ( par1Vec3D . zCoord ) ) ; if ( byte0 == <NUM_LIT:3> ) { j1 -- ; vec3d . zCoord ++ ; } int j2 = getBlockId ( l , i1 , j1 ) ; int k2 = getBlockMetadata ( l , i1 , j1 ) ; Block block1 = Block . blocksList [ j2 ] ; if ( ( ! par4 || block1 == null || block1 . getCollisionBoundingBoxFromPool ( this , l , i1 , j1 ) != null ) && j2 > <NUM_LIT:0> && block1 . canCollideCheck ( k2 , par3 ) ) { MovingObjectPosition movingobjectposition1 = block1 . collisionRayTrace ( this , l , i1 , j1 , par1Vec3D , par2Vec3D ) ; if ( movingobjectposition1 != null ) { return movingobjectposition1 ; } } } return null ; } public void playSoundAtEntity ( Entity par1Entity , String par2Str , float par3 , float par4 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . playSound ( par2Str , par1Entity . posX , par1Entity . posY - ( double ) par1Entity . yOffset , par1Entity . posZ , par3 , par4 ) ; } } public void playSoundEffect ( double par1 , double par3 , double par5 , String par7Str , float par8 , float par9 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . playSound ( par7Str , par1 , par3 , par5 , par8 , par9 ) ; } } public void playRecord ( String par1Str , int par2 , int par3 , int par4 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . playRecord ( par1Str , par2 , par3 , par4 ) ; } } public void spawnParticle ( String par1Str , double par2 , double par4 , double par6 , double par8 , double par10 , double par12 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . spawnParticle ( par1Str , par2 , par4 , par6 , par8 , par10 , par12 ) ; } } public boolean addWeatherEffect ( Entity par1Entity ) { weatherEffects . add ( par1Entity ) ; return true ; } public boolean spawnEntityInWorld ( Entity par1Entity ) { int i = MathHelper . floor_double ( par1Entity . posX / <NUM_LIT> ) ; int j = MathHelper . floor_double ( par1Entity . posZ / <NUM_LIT> ) ; boolean flag = false ; if ( par1Entity instanceof EntityPlayer ) { flag = true ; } if ( flag || chunkExists ( i , j ) ) { if ( par1Entity instanceof EntityPlayer ) { EntityPlayer entityplayer = ( EntityPlayer ) par1Entity ; playerEntities . add ( entityplayer ) ; updateAllPlayersSleepingFlag ( ) ; } getChunkFromChunkCoords ( i , j ) . addEntity ( par1Entity ) ; loadedEntityList . add ( par1Entity ) ; obtainEntitySkin ( par1Entity ) ; return true ; } else { return false ; } } protected void obtainEntitySkin ( Entity par1Entity ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . obtainEntitySkin ( par1Entity ) ; } } protected void releaseEntitySkin ( Entity par1Entity ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . releaseEntitySkin ( par1Entity ) ; } } public void setEntityDead ( Entity par1Entity ) { if ( par1Entity . riddenByEntity != null ) { par1Entity . riddenByEntity . mountEntity ( null ) ; } if ( par1Entity . ridingEntity != null ) { par1Entity . mountEntity ( null ) ; } par1Entity . setDead ( ) ; if ( par1Entity instanceof EntityPlayer ) { playerEntities . remove ( ( EntityPlayer ) par1Entity ) ; updateAllPlayersSleepingFlag ( ) ; } } public void removePlayer ( Entity par1Entity ) { par1Entity . setDead ( ) ; if ( par1Entity instanceof EntityPlayer ) { playerEntities . remove ( ( EntityPlayer ) par1Entity ) ; updateAllPlayersSleepingFlag ( ) ; } int i = par1Entity . chunkCoordX ; int j = par1Entity . chunkCoordZ ; if ( par1Entity . addedToChunk && chunkExists ( i , j ) ) { getChunkFromChunkCoords ( i , j ) . removeEntity ( par1Entity ) ; } loadedEntityList . remove ( par1Entity ) ; releaseEntitySkin ( par1Entity ) ; } public void addWorldAccess ( IWorldAccess par1IWorldAccess ) { worldAccesses . add ( par1IWorldAccess ) ; } public List getCollidingBoundingBoxes ( Entity par1Entity , AxisAlignedBB par2AxisAlignedBB ) { collidingBoundingBoxes . clear ( ) ; int i = MathHelper . floor_double ( par2AxisAlignedBB . minX ) ; int j = MathHelper . floor_double ( par2AxisAlignedBB . maxX + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par2AxisAlignedBB . minY ) ; int l = MathHelper . floor_double ( par2AxisAlignedBB . maxY + <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par2AxisAlignedBB . minZ ) ; int j1 = MathHelper . floor_double ( par2AxisAlignedBB . maxZ + <NUM_LIT> ) ; for ( int k1 = i ; k1 < j ; k1 ++ ) { for ( int l1 = i1 ; l1 < j1 ; l1 ++ ) { if ( ! blockExists ( k1 , <NUM_LIT> , l1 ) ) { continue ; } for ( int i2 = k - <NUM_LIT:1> ; i2 < l ; i2 ++ ) { Block block = Block . blocksList [ getBlockId ( k1 , i2 , l1 ) ] ; if ( block != null ) { block . getCollidingBoundingBoxes ( this , k1 , i2 , l1 , par2AxisAlignedBB , collidingBoundingBoxes ) ; } } } } double d = <NUM_LIT> ; List list = getEntitiesWithinAABBExcludingEntity ( par1Entity , par2AxisAlignedBB . expand ( d , d , d ) ) ; for ( int j2 = <NUM_LIT:0> ; j2 < list . size ( ) ; j2 ++ ) { AxisAlignedBB axisalignedbb = ( ( Entity ) list . get ( j2 ) ) . getBoundingBox ( ) ; if ( axisalignedbb != null && axisalignedbb . intersectsWith ( par2AxisAlignedBB ) ) { collidingBoundingBoxes . add ( axisalignedbb ) ; } axisalignedbb = par1Entity . getCollisionBox ( ( Entity ) list . get ( j2 ) ) ; if ( axisalignedbb != null && axisalignedbb . intersectsWith ( par2AxisAlignedBB ) ) { collidingBoundingBoxes . add ( axisalignedbb ) ; } } return collidingBoundingBoxes ; } public int calculateSkylightSubtracted ( float par1 ) { float f = getCelestialAngle ( par1 ) ; float f1 = <NUM_LIT> - ( MathHelper . cos ( f * ( float ) Math . PI * <NUM_LIT> ) * <NUM_LIT> + <NUM_LIT> ) ; if ( f1 < <NUM_LIT> ) { f1 = <NUM_LIT> ; } if ( f1 > <NUM_LIT> ) { f1 = <NUM_LIT> ; } f1 = <NUM_LIT> - f1 ; f1 = ( float ) ( ( double ) f1 * ( <NUM_LIT> - ( double ) ( getRainStrength ( par1 ) * <NUM_LIT> ) / <NUM_LIT> ) ) ; f1 = ( float ) ( ( double ) f1 * ( <NUM_LIT> - ( double ) ( getWeightedThunderStrength ( par1 ) * <NUM_LIT> ) / <NUM_LIT> ) ) ; f1 = <NUM_LIT> - f1 ; return ( int ) ( f1 * <NUM_LIT> ) ; } public float getCelestialAngle ( float par1 ) { return worldProvider . calculateCelestialAngle ( worldInfo . getWorldTime ( ) , par1 ) ; } public int getPrecipitationHeight ( int par1 , int par2 ) { return getChunkFromBlockCoords ( par1 , par2 ) . getPrecipitationHeight ( par1 & <NUM_LIT> , par2 & <NUM_LIT> ) ; } public int getTopSolidOrLiquidBlock ( int par1 , int par2 ) { Chunk chunk = getChunkFromBlockCoords ( par1 , par2 ) ; int i = chunk . getTopFilledSegment ( ) + <NUM_LIT:16> ; par1 &= <NUM_LIT> ; par2 &= <NUM_LIT> ; while ( i > <NUM_LIT:0> ) { int j = chunk . getBlockID ( par1 , i , par2 ) ; if ( j == <NUM_LIT:0> || ! Block . blocksList [ j ] . blockMaterial . blocksMovement ( ) || Block . blocksList [ j ] . blockMaterial == Material . leaves ) { i -- ; } else { return i + <NUM_LIT:1> ; } } return - <NUM_LIT:1> ; } public void scheduleBlockUpdate ( int par1 , int par2 , int par3 , int par4 , int par5 ) { NextTickListEntry nextticklistentry = new NextTickListEntry ( par1 , par2 , par3 , par4 ) ; byte byte0 = <NUM_LIT:8> ; if ( scheduledUpdatesAreImmediate ) { if ( checkChunksExist ( nextticklistentry . xCoord - byte0 , nextticklistentry . yCoord - byte0 , nextticklistentry . zCoord - byte0 , nextticklistentry . xCoord + byte0 , nextticklistentry . yCoord + byte0 , nextticklistentry . zCoord + byte0 ) ) { int i = getBlockId ( nextticklistentry . xCoord , nextticklistentry . yCoord , nextticklistentry . zCoord ) ; if ( i == nextticklistentry . blockID && i > <NUM_LIT:0> ) { Block . blocksList [ i ] . updateTick ( this , nextticklistentry . xCoord , nextticklistentry . yCoord , nextticklistentry . zCoord , rand ) ; } } return ; } if ( checkChunksExist ( par1 - byte0 , par2 - byte0 , par3 - byte0 , par1 + byte0 , par2 + byte0 , par3 + byte0 ) ) { if ( par4 > <NUM_LIT:0> ) { nextticklistentry . setScheduledTime ( ( long ) par5 + worldInfo . getWorldTime ( ) ) ; } if ( ! scheduledTickSet . contains ( nextticklistentry ) ) { scheduledTickSet . add ( nextticklistentry ) ; scheduledTickTreeSet . add ( nextticklistentry ) ; } } } public void scheduleBlockUpdateFromLoad ( int par1 , int par2 , int par3 , int par4 , int par5 ) { NextTickListEntry nextticklistentry = new NextTickListEntry ( par1 , par2 , par3 , par4 ) ; if ( par4 > <NUM_LIT:0> ) { nextticklistentry . setScheduledTime ( ( long ) par5 + worldInfo . getWorldTime ( ) ) ; } if ( ! scheduledTickSet . contains ( nextticklistentry ) ) { scheduledTickSet . add ( nextticklistentry ) ; scheduledTickTreeSet . add ( nextticklistentry ) ; } } public void updateEntities ( ) { Profiler . startSection ( "<STR_LIT>" ) ; Profiler . startSection ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < weatherEffects . size ( ) ; i ++ ) { Entity entity = ( Entity ) weatherEffects . get ( i ) ; entity . onUpdate ( ) ; if ( entity . isDead ) { weatherEffects . remove ( i -- ) ; } } Profiler . endStartSection ( "<STR_LIT>" ) ; loadedEntityList . removeAll ( unloadedEntityList ) ; for ( int j = <NUM_LIT:0> ; j < unloadedEntityList . size ( ) ; j ++ ) { Entity entity1 = ( Entity ) unloadedEntityList . get ( j ) ; int i1 = entity1 . chunkCoordX ; int k1 = entity1 . chunkCoordZ ; if ( entity1 . addedToChunk && chunkExists ( i1 , k1 ) ) { getChunkFromChunkCoords ( i1 , k1 ) . removeEntity ( entity1 ) ; } } for ( int k = <NUM_LIT:0> ; k < unloadedEntityList . size ( ) ; k ++ ) { releaseEntitySkin ( ( Entity ) unloadedEntityList . get ( k ) ) ; } unloadedEntityList . clear ( ) ; Profiler . endStartSection ( "<STR_LIT>" ) ; for ( int l = <NUM_LIT:0> ; l < loadedEntityList . size ( ) ; l ++ ) { Entity entity2 = ( Entity ) loadedEntityList . get ( l ) ; if ( entity2 . ridingEntity != null ) { if ( ! entity2 . ridingEntity . isDead && entity2 . ridingEntity . riddenByEntity == entity2 ) { continue ; } entity2 . ridingEntity . riddenByEntity = null ; entity2 . ridingEntity = null ; } if ( ! entity2 . isDead ) { updateEntity ( entity2 ) ; } Profiler . startSection ( "<STR_LIT>" ) ; if ( entity2 . isDead ) { int j1 = entity2 . chunkCoordX ; int l1 = entity2 . chunkCoordZ ; if ( entity2 . addedToChunk && chunkExists ( j1 , l1 ) ) { getChunkFromChunkCoords ( j1 , l1 ) . removeEntity ( entity2 ) ; } loadedEntityList . remove ( l -- ) ; releaseEntitySkin ( entity2 ) ; } Profiler . endSection ( ) ; } Profiler . endStartSection ( "<STR_LIT>" ) ; scanningTileEntities = true ; Iterator iterator = loadedTileEntityList . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } TileEntity tileentity = ( TileEntity ) iterator . next ( ) ; if ( ! tileentity . isInvalid ( ) && tileentity . worldObj != null && blockExists ( tileentity . xCoord , tileentity . yCoord , tileentity . zCoord ) ) { tileentity . updateEntity ( ) ; } if ( tileentity . isInvalid ( ) ) { iterator . remove ( ) ; if ( chunkExists ( tileentity . xCoord > > <NUM_LIT:4> , tileentity . zCoord > > <NUM_LIT:4> ) ) { Chunk chunk = getChunkFromChunkCoords ( tileentity . xCoord > > <NUM_LIT:4> , tileentity . zCoord > > <NUM_LIT:4> ) ; if ( chunk != null ) { chunk . removeChunkBlockTileEntity ( tileentity . xCoord & <NUM_LIT> , tileentity . yCoord , tileentity . zCoord & <NUM_LIT> ) ; } } } } while ( true ) ; scanningTileEntities = false ; if ( ! entityRemoval . isEmpty ( ) ) { loadedTileEntityList . removeAll ( entityRemoval ) ; entityRemoval . clear ( ) ; } Profiler . endStartSection ( "<STR_LIT>" ) ; if ( ! addedTileEntityList . isEmpty ( ) ) { Iterator iterator1 = addedTileEntityList . iterator ( ) ; do { if ( ! iterator1 . hasNext ( ) ) { break ; } TileEntity tileentity1 = ( TileEntity ) iterator1 . next ( ) ; if ( ! tileentity1 . isInvalid ( ) ) { if ( ! loadedTileEntityList . contains ( tileentity1 ) ) { loadedTileEntityList . add ( tileentity1 ) ; } if ( chunkExists ( tileentity1 . xCoord > > <NUM_LIT:4> , tileentity1 . zCoord > > <NUM_LIT:4> ) ) { Chunk chunk1 = getChunkFromChunkCoords ( tileentity1 . xCoord > > <NUM_LIT:4> , tileentity1 . zCoord > > <NUM_LIT:4> ) ; if ( chunk1 != null ) { chunk1 . setChunkBlockTileEntity ( tileentity1 . xCoord & <NUM_LIT> , tileentity1 . yCoord , tileentity1 . zCoord & <NUM_LIT> , tileentity1 ) ; } } markBlockNeedsUpdate ( tileentity1 . xCoord , tileentity1 . yCoord , tileentity1 . zCoord ) ; } } while ( true ) ; addedTileEntityList . clear ( ) ; } Profiler . endSection ( ) ; Profiler . endSection ( ) ; } public void addTileEntity ( Collection par1Collection ) { if ( scanningTileEntities ) { addedTileEntityList . addAll ( par1Collection ) ; } else { loadedTileEntityList . addAll ( par1Collection ) ; } } public void updateEntity ( Entity par1Entity ) { updateEntityWithOptionalForce ( par1Entity , true ) ; } public void updateEntityWithOptionalForce ( Entity par1Entity , boolean par2 ) { int i = MathHelper . floor_double ( par1Entity . posX ) ; int j = MathHelper . floor_double ( par1Entity . posZ ) ; byte byte0 = <NUM_LIT:32> ; if ( par2 && ! checkChunksExist ( i - byte0 , <NUM_LIT:0> , j - byte0 , i + byte0 , <NUM_LIT:0> , j + byte0 ) ) { return ; } par1Entity . lastTickPosX = par1Entity . posX ; par1Entity . lastTickPosY = par1Entity . posY ; par1Entity . lastTickPosZ = par1Entity . posZ ; par1Entity . prevRotationYaw = par1Entity . rotationYaw ; par1Entity . prevRotationPitch = par1Entity . rotationPitch ; if ( par2 && par1Entity . addedToChunk ) { if ( par1Entity . ridingEntity != null ) { par1Entity . updateRidden ( ) ; } else { par1Entity . onUpdate ( ) ; } } Profiler . startSection ( "<STR_LIT>" ) ; if ( Double . isNaN ( par1Entity . posX ) || Double . isInfinite ( par1Entity . posX ) ) { par1Entity . posX = par1Entity . lastTickPosX ; } if ( Double . isNaN ( par1Entity . posY ) || Double . isInfinite ( par1Entity . posY ) ) { par1Entity . posY = par1Entity . lastTickPosY ; } if ( Double . isNaN ( par1Entity . posZ ) || Double . isInfinite ( par1Entity . posZ ) ) { par1Entity . posZ = par1Entity . lastTickPosZ ; } if ( Double . isNaN ( par1Entity . rotationPitch ) || Double . isInfinite ( par1Entity . rotationPitch ) ) { par1Entity . rotationPitch = par1Entity . prevRotationPitch ; } if ( Double . isNaN ( par1Entity . rotationYaw ) || Double . isInfinite ( par1Entity . rotationYaw ) ) { par1Entity . rotationYaw = par1Entity . prevRotationYaw ; } int k = MathHelper . floor_double ( par1Entity . posX / <NUM_LIT> ) ; int l = MathHelper . floor_double ( par1Entity . posY / <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par1Entity . posZ / <NUM_LIT> ) ; if ( ! par1Entity . addedToChunk || par1Entity . chunkCoordX != k || par1Entity . chunkCoordY != l || par1Entity . chunkCoordZ != i1 ) { if ( par1Entity . addedToChunk && chunkExists ( par1Entity . chunkCoordX , par1Entity . chunkCoordZ ) ) { getChunkFromChunkCoords ( par1Entity . chunkCoordX , par1Entity . chunkCoordZ ) . removeEntityAtIndex ( par1Entity , par1Entity . chunkCoordY ) ; } if ( chunkExists ( k , i1 ) ) { par1Entity . addedToChunk = true ; getChunkFromChunkCoords ( k , i1 ) . addEntity ( par1Entity ) ; } else { par1Entity . addedToChunk = false ; } } Profiler . endSection ( ) ; if ( par2 && par1Entity . addedToChunk && par1Entity . riddenByEntity != null ) { if ( par1Entity . riddenByEntity . isDead || par1Entity . riddenByEntity . ridingEntity != par1Entity ) { par1Entity . riddenByEntity . ridingEntity = null ; par1Entity . riddenByEntity = null ; } else { updateEntity ( par1Entity . riddenByEntity ) ; } } } public boolean checkIfAABBIsClear ( AxisAlignedBB par1AxisAlignedBB ) { List list = getEntitiesWithinAABBExcludingEntity ( null , par1AxisAlignedBB ) ; for ( int i = <NUM_LIT:0> ; i < list . size ( ) ; i ++ ) { Entity entity = ( Entity ) list . get ( i ) ; if ( ! entity . isDead && entity . preventEntitySpawning ) { return false ; } } return true ; } public boolean isAABBEmpty ( AxisAlignedBB par1AxisAlignedBB ) { int i = MathHelper . floor_double ( par1AxisAlignedBB . minX ) ; int j = MathHelper . floor_double ( par1AxisAlignedBB . maxX + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par1AxisAlignedBB . minY ) ; int l = MathHelper . floor_double ( par1AxisAlignedBB . maxY + <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par1AxisAlignedBB . minZ ) ; int j1 = MathHelper . floor_double ( par1AxisAlignedBB . maxZ + <NUM_LIT> ) ; if ( par1AxisAlignedBB . minX < <NUM_LIT> ) { i -- ; } if ( par1AxisAlignedBB . minY < <NUM_LIT> ) { k -- ; } if ( par1AxisAlignedBB . minZ < <NUM_LIT> ) { i1 -- ; } for ( int k1 = i ; k1 < j ; k1 ++ ) { for ( int l1 = k ; l1 < l ; l1 ++ ) { for ( int i2 = i1 ; i2 < j1 ; i2 ++ ) { Block block = Block . blocksList [ getBlockId ( k1 , l1 , i2 ) ] ; if ( block != null ) { return true ; } } } } return false ; } public boolean isAnyLiquid ( AxisAlignedBB par1AxisAlignedBB ) { int i = MathHelper . floor_double ( par1AxisAlignedBB . minX ) ; int j = MathHelper . floor_double ( par1AxisAlignedBB . maxX + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par1AxisAlignedBB . minY ) ; int l = MathHelper . floor_double ( par1AxisAlignedBB . maxY + <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par1AxisAlignedBB . minZ ) ; int j1 = MathHelper . floor_double ( par1AxisAlignedBB . maxZ + <NUM_LIT> ) ; if ( par1AxisAlignedBB . minX < <NUM_LIT> ) { i -- ; } if ( par1AxisAlignedBB . minY < <NUM_LIT> ) { k -- ; } if ( par1AxisAlignedBB . minZ < <NUM_LIT> ) { i1 -- ; } for ( int k1 = i ; k1 < j ; k1 ++ ) { for ( int l1 = k ; l1 < l ; l1 ++ ) { for ( int i2 = i1 ; i2 < j1 ; i2 ++ ) { Block block = Block . blocksList [ getBlockId ( k1 , l1 , i2 ) ] ; if ( block != null && block . blockMaterial . isLiquid ( ) ) { return true ; } } } } return false ; } public boolean isBoundingBoxBurning ( AxisAlignedBB par1AxisAlignedBB ) { int i = MathHelper . floor_double ( par1AxisAlignedBB . minX ) ; int j = MathHelper . floor_double ( par1AxisAlignedBB . maxX + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par1AxisAlignedBB . minY ) ; int l = MathHelper . floor_double ( par1AxisAlignedBB . maxY + <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par1AxisAlignedBB . minZ ) ; int j1 = MathHelper . floor_double ( par1AxisAlignedBB . maxZ + <NUM_LIT> ) ; if ( checkChunksExist ( i , k , i1 , j , l , j1 ) ) { for ( int k1 = i ; k1 < j ; k1 ++ ) { for ( int l1 = k ; l1 < l ; l1 ++ ) { for ( int i2 = i1 ; i2 < j1 ; i2 ++ ) { int j2 = getBlockId ( k1 , l1 , i2 ) ; if ( j2 == Block . fire . blockID || j2 == Block . lavaMoving . blockID || j2 == Block . lavaStill . blockID ) { return true ; } } } } } return false ; } public boolean handleMaterialAcceleration ( AxisAlignedBB par1AxisAlignedBB , Material par2Material , Entity par3Entity ) { int i = MathHelper . floor_double ( par1AxisAlignedBB . minX ) ; int j = MathHelper . floor_double ( par1AxisAlignedBB . maxX + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par1AxisAlignedBB . minY ) ; int l = MathHelper . floor_double ( par1AxisAlignedBB . maxY + <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par1AxisAlignedBB . minZ ) ; int j1 = MathHelper . floor_double ( par1AxisAlignedBB . maxZ + <NUM_LIT> ) ; if ( ! checkChunksExist ( i , k , i1 , j , l , j1 ) ) { return false ; } boolean flag = false ; Vec3D vec3d = Vec3D . createVector ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; for ( int k1 = i ; k1 < j ; k1 ++ ) { for ( int l1 = k ; l1 < l ; l1 ++ ) { for ( int i2 = i1 ; i2 < j1 ; i2 ++ ) { Block block = Block . blocksList [ getBlockId ( k1 , l1 , i2 ) ] ; if ( block == null || block . blockMaterial != par2Material ) { continue ; } double d1 = ( float ) ( l1 + <NUM_LIT:1> ) - BlockFluid . getFluidHeightPercent ( getBlockMetadata ( k1 , l1 , i2 ) ) ; if ( ( double ) l >= d1 ) { flag = true ; block . velocityToAddToEntity ( this , k1 , l1 , i2 , par3Entity , vec3d ) ; } } } } if ( vec3d . lengthVector ( ) > <NUM_LIT> ) { vec3d = vec3d . normalize ( ) ; double d = <NUM_LIT> ; par3Entity . motionX += vec3d . xCoord * d ; par3Entity . motionY += vec3d . yCoord * d ; par3Entity . motionZ += vec3d . zCoord * d ; } return flag ; } public boolean isMaterialInBB ( AxisAlignedBB par1AxisAlignedBB , Material par2Material ) { int i = MathHelper . floor_double ( par1AxisAlignedBB . minX ) ; int j = MathHelper . floor_double ( par1AxisAlignedBB . maxX + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par1AxisAlignedBB . minY ) ; int l = MathHelper . floor_double ( par1AxisAlignedBB . maxY + <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par1AxisAlignedBB . minZ ) ; int j1 = MathHelper . floor_double ( par1AxisAlignedBB . maxZ + <NUM_LIT> ) ; for ( int k1 = i ; k1 < j ; k1 ++ ) { for ( int l1 = k ; l1 < l ; l1 ++ ) { for ( int i2 = i1 ; i2 < j1 ; i2 ++ ) { Block block = Block . blocksList [ getBlockId ( k1 , l1 , i2 ) ] ; if ( block != null && block . blockMaterial == par2Material ) { return true ; } } } } return false ; } public boolean isAABBInMaterial ( AxisAlignedBB par1AxisAlignedBB , Material par2Material ) { int i = MathHelper . floor_double ( par1AxisAlignedBB . minX ) ; int j = MathHelper . floor_double ( par1AxisAlignedBB . maxX + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par1AxisAlignedBB . minY ) ; int l = MathHelper . floor_double ( par1AxisAlignedBB . maxY + <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( par1AxisAlignedBB . minZ ) ; int j1 = MathHelper . floor_double ( par1AxisAlignedBB . maxZ + <NUM_LIT> ) ; for ( int k1 = i ; k1 < j ; k1 ++ ) { for ( int l1 = k ; l1 < l ; l1 ++ ) { for ( int i2 = i1 ; i2 < j1 ; i2 ++ ) { Block block = Block . blocksList [ getBlockId ( k1 , l1 , i2 ) ] ; if ( block == null || block . blockMaterial != par2Material ) { continue ; } int j2 = getBlockMetadata ( k1 , l1 , i2 ) ; double d = l1 + <NUM_LIT:1> ; if ( j2 < <NUM_LIT:8> ) { d = ( double ) ( l1 + <NUM_LIT:1> ) - ( double ) j2 / <NUM_LIT> ; } if ( d >= par1AxisAlignedBB . minY ) { return true ; } } } } return false ; } public Explosion createExplosion ( Entity par1Entity , double par2 , double par4 , double par6 , float par8 ) { return newExplosion ( par1Entity , par2 , par4 , par6 , par8 , false ) ; } public Explosion newExplosion ( Entity par1Entity , double par2 , double par4 , double par6 , float par8 , boolean par9 ) { Explosion explosion = new Explosion ( this , par1Entity , par2 , par4 , par6 , par8 ) ; explosion . isFlaming = par9 ; explosion . doExplosionA ( ) ; explosion . doExplosionB ( true ) ; return explosion ; } public float getBlockDensity ( Vec3D par1Vec3D , AxisAlignedBB par2AxisAlignedBB ) { double d = <NUM_LIT> / ( ( par2AxisAlignedBB . maxX - par2AxisAlignedBB . minX ) * <NUM_LIT> + <NUM_LIT> ) ; double d1 = <NUM_LIT> / ( ( par2AxisAlignedBB . maxY - par2AxisAlignedBB . minY ) * <NUM_LIT> + <NUM_LIT> ) ; double d2 = <NUM_LIT> / ( ( par2AxisAlignedBB . maxZ - par2AxisAlignedBB . minZ ) * <NUM_LIT> + <NUM_LIT> ) ; int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; for ( float f = <NUM_LIT> ; f <= <NUM_LIT> ; f = ( float ) ( ( double ) f + d ) ) { for ( float f1 = <NUM_LIT> ; f1 <= <NUM_LIT> ; f1 = ( float ) ( ( double ) f1 + d1 ) ) { for ( float f2 = <NUM_LIT> ; f2 <= <NUM_LIT> ; f2 = ( float ) ( ( double ) f2 + d2 ) ) { double d3 = par2AxisAlignedBB . minX + ( par2AxisAlignedBB . maxX - par2AxisAlignedBB . minX ) * ( double ) f ; double d4 = par2AxisAlignedBB . minY + ( par2AxisAlignedBB . maxY - par2AxisAlignedBB . minY ) * ( double ) f1 ; double d5 = par2AxisAlignedBB . minZ + ( par2AxisAlignedBB . maxZ - par2AxisAlignedBB . minZ ) * ( double ) f2 ; if ( rayTraceBlocks ( Vec3D . createVector ( d3 , d4 , d5 ) , par1Vec3D ) == null ) { i ++ ; } j ++ ; } } } return ( float ) i / ( float ) j ; } public boolean func_48093_a ( EntityPlayer par1EntityPlayer , int par2 , int par3 , int par4 , int par5 ) { if ( par5 == <NUM_LIT:0> ) { par3 -- ; } if ( par5 == <NUM_LIT:1> ) { par3 ++ ; } if ( par5 == <NUM_LIT:2> ) { par4 -- ; } if ( par5 == <NUM_LIT:3> ) { par4 ++ ; } if ( par5 == <NUM_LIT:4> ) { par2 -- ; } if ( par5 == <NUM_LIT:5> ) { par2 ++ ; } if ( getBlockId ( par2 , par3 , par4 ) == Block . fire . blockID ) { playAuxSFXAtEntity ( par1EntityPlayer , <NUM_LIT> , par2 , par3 , par4 , <NUM_LIT:0> ) ; setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; return true ; } else { return false ; } } public TileEntity getBlockTileEntity ( int par1 , int par2 , int par3 ) { label0 : { TileEntity tileentity ; label1 : { if ( par2 >= <NUM_LIT> ) { return null ; } Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; if ( chunk == null ) { break label0 ; } tileentity = chunk . getChunkBlockTileEntity ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; if ( tileentity != null ) { break label1 ; } Iterator iterator = addedTileEntityList . iterator ( ) ; TileEntity tileentity1 ; do { if ( ! iterator . hasNext ( ) ) { break label1 ; } tileentity1 = ( TileEntity ) iterator . next ( ) ; } while ( tileentity1 . isInvalid ( ) || tileentity1 . xCoord != par1 || tileentity1 . yCoord != par2 || tileentity1 . zCoord != par3 ) ; tileentity = tileentity1 ; } return tileentity ; } return null ; } public void setBlockTileEntity ( int par1 , int par2 , int par3 , TileEntity par4TileEntity ) { if ( par4TileEntity != null && ! par4TileEntity . isInvalid ( ) ) { if ( scanningTileEntities ) { par4TileEntity . xCoord = par1 ; par4TileEntity . yCoord = par2 ; par4TileEntity . zCoord = par3 ; addedTileEntityList . add ( par4TileEntity ) ; } else { loadedTileEntityList . add ( par4TileEntity ) ; Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; if ( chunk != null ) { chunk . setChunkBlockTileEntity ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> , par4TileEntity ) ; } } } } public void removeBlockTileEntity ( int par1 , int par2 , int par3 ) { TileEntity tileentity = getBlockTileEntity ( par1 , par2 , par3 ) ; if ( tileentity != null && scanningTileEntities ) { tileentity . invalidate ( ) ; addedTileEntityList . remove ( tileentity ) ; } else { if ( tileentity != null ) { addedTileEntityList . remove ( tileentity ) ; loadedTileEntityList . remove ( tileentity ) ; } Chunk chunk = getChunkFromChunkCoords ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; if ( chunk != null ) { chunk . removeChunkBlockTileEntity ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } } } public void markTileEntityForDespawn ( TileEntity par1TileEntity ) { entityRemoval . add ( par1TileEntity ) ; } public boolean isBlockOpaqueCube ( int par1 , int par2 , int par3 ) { Block block = Block . blocksList [ getBlockId ( par1 , par2 , par3 ) ] ; if ( block == null ) { return false ; } else { return block . isOpaqueCube ( ) ; } } public boolean isBlockNormalCube ( int par1 , int par2 , int par3 ) { return Block . isNormalCube ( getBlockId ( par1 , par2 , par3 ) ) ; } public boolean isBlockNormalCubeDefault ( int par1 , int par2 , int par3 , boolean par4 ) { if ( par1 < <NUM_LIT> || par3 < <NUM_LIT> || par1 >= <NUM_LIT> || par3 >= <NUM_LIT> ) { return par4 ; } Chunk chunk = chunkProvider . provideChunk ( par1 > > <NUM_LIT:4> , par3 > > <NUM_LIT:4> ) ; if ( chunk == null || chunk . isEmpty ( ) ) { return par4 ; } Block block = Block . blocksList [ getBlockId ( par1 , par2 , par3 ) ] ; if ( block == null ) { return false ; } else { return block . blockMaterial . isOpaque ( ) && block . renderAsNormalBlock ( ) ; } } public void calculateInitialSkylight ( ) { int i = calculateSkylightSubtracted ( <NUM_LIT> ) ; if ( i != skylightSubtracted ) { skylightSubtracted = i ; } } public void setAllowedSpawnTypes ( boolean par1 , boolean par2 ) { spawnHostileMobs = par1 ; spawnPeacefulMobs = par2 ; } public void tick ( ) { if ( getWorldInfo ( ) . isHardcoreModeEnabled ( ) && difficultySetting < <NUM_LIT:3> ) { difficultySetting = <NUM_LIT:3> ; } worldProvider . worldChunkMgr . cleanupCache ( ) ; updateWeather ( ) ; if ( isAllPlayersFullyAsleep ( ) ) { boolean flag = false ; if ( spawnHostileMobs ) { if ( difficultySetting < <NUM_LIT:1> ) ; } if ( ! flag ) { long l = worldInfo . getWorldTime ( ) + <NUM_LIT> ; worldInfo . setWorldTime ( l - l % <NUM_LIT> ) ; wakeUpAllPlayers ( ) ; } } Profiler . startSection ( "<STR_LIT>" ) ; SpawnerAnimals . performSpawning ( this , spawnHostileMobs , spawnPeacefulMobs && worldInfo . getWorldTime ( ) % <NUM_LIT> == <NUM_LIT> ) ; Profiler . endStartSection ( "<STR_LIT>" ) ; chunkProvider . unload100OldestChunks ( ) ; int i = calculateSkylightSubtracted ( <NUM_LIT> ) ; if ( i != skylightSubtracted ) { skylightSubtracted = i ; } long l1 = worldInfo . getWorldTime ( ) + <NUM_LIT:1L> ; if ( l1 % ( long ) autosavePeriod == <NUM_LIT> ) { Profiler . endStartSection ( "<STR_LIT>" ) ; saveWorld ( false , null ) ; } worldInfo . setWorldTime ( l1 ) ; Profiler . endStartSection ( "<STR_LIT>" ) ; tickUpdates ( false ) ; Profiler . endStartSection ( "<STR_LIT>" ) ; tickBlocksAndAmbiance ( ) ; Profiler . endStartSection ( "<STR_LIT>" ) ; villageCollectionObj . tick ( ) ; villageSiegeObj . tick ( ) ; Profiler . endSection ( ) ; } private void calculateInitialWeather ( ) { if ( worldInfo . isRaining ( ) ) { rainingStrength = <NUM_LIT> ; if ( worldInfo . isThundering ( ) ) { thunderingStrength = <NUM_LIT> ; } } } protected void updateWeather ( ) { if ( worldProvider . hasNoSky ) { return ; } if ( lastLightningBolt > <NUM_LIT:0> ) { lastLightningBolt -- ; } int i = worldInfo . getThunderTime ( ) ; if ( i <= <NUM_LIT:0> ) { if ( worldInfo . isThundering ( ) ) { worldInfo . setThunderTime ( rand . nextInt ( <NUM_LIT> ) + <NUM_LIT> ) ; } else { worldInfo . setThunderTime ( rand . nextInt ( <NUM_LIT> ) + <NUM_LIT> ) ; } } else { i -- ; worldInfo . setThunderTime ( i ) ; if ( i <= <NUM_LIT:0> ) { worldInfo . setThundering ( ! worldInfo . isThundering ( ) ) ; } } int j = worldInfo . getRainTime ( ) ; if ( j <= <NUM_LIT:0> ) { if ( worldInfo . isRaining ( ) ) { worldInfo . setRainTime ( rand . nextInt ( <NUM_LIT> ) + <NUM_LIT> ) ; } else { worldInfo . setRainTime ( rand . nextInt ( <NUM_LIT> ) + <NUM_LIT> ) ; } } else { j -- ; worldInfo . setRainTime ( j ) ; if ( j <= <NUM_LIT:0> ) { worldInfo . setRaining ( ! worldInfo . isRaining ( ) ) ; } } prevRainingStrength = rainingStrength ; if ( worldInfo . isRaining ( ) ) { rainingStrength += <NUM_LIT> ; } else { rainingStrength -= <NUM_LIT> ; } if ( rainingStrength < <NUM_LIT> ) { rainingStrength = <NUM_LIT> ; } if ( rainingStrength > <NUM_LIT> ) { rainingStrength = <NUM_LIT> ; } prevThunderingStrength = thunderingStrength ; if ( worldInfo . isThundering ( ) ) { thunderingStrength += <NUM_LIT> ; } else { thunderingStrength -= <NUM_LIT> ; } if ( thunderingStrength < <NUM_LIT> ) { thunderingStrength = <NUM_LIT> ; } if ( thunderingStrength > <NUM_LIT> ) { thunderingStrength = <NUM_LIT> ; } } private void clearWeather ( ) { worldInfo . setRainTime ( <NUM_LIT:0> ) ; worldInfo . setRaining ( false ) ; worldInfo . setThunderTime ( <NUM_LIT:0> ) ; worldInfo . setThundering ( false ) ; } public void commandToggleDownfall ( ) { worldInfo . setRainTime ( <NUM_LIT:1> ) ; } protected void func_48090_k ( ) { activeChunkSet . clear ( ) ; Profiler . startSection ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < playerEntities . size ( ) ; i ++ ) { EntityPlayer entityplayer = ( EntityPlayer ) playerEntities . get ( i ) ; int k = MathHelper . floor_double ( entityplayer . posX / <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( entityplayer . posZ / <NUM_LIT> ) ; byte byte0 = <NUM_LIT:7> ; for ( int l1 = - byte0 ; l1 <= byte0 ; l1 ++ ) { for ( int i2 = - byte0 ; i2 <= byte0 ; i2 ++ ) { activeChunkSet . add ( new ChunkCoordIntPair ( l1 + k , i2 + i1 ) ) ; } } } Profiler . endSection ( ) ; if ( ambientTickCountdown > <NUM_LIT:0> ) { ambientTickCountdown -- ; } Profiler . startSection ( "<STR_LIT>" ) ; if ( ! playerEntities . isEmpty ( ) ) { int j = rand . nextInt ( playerEntities . size ( ) ) ; EntityPlayer entityplayer1 = ( EntityPlayer ) playerEntities . get ( j ) ; int l = ( MathHelper . floor_double ( entityplayer1 . posX ) + rand . nextInt ( <NUM_LIT:11> ) ) - <NUM_LIT:5> ; int j1 = ( MathHelper . floor_double ( entityplayer1 . posY ) + rand . nextInt ( <NUM_LIT:11> ) ) - <NUM_LIT:5> ; int k1 = ( MathHelper . floor_double ( entityplayer1 . posZ ) + rand . nextInt ( <NUM_LIT:11> ) ) - <NUM_LIT:5> ; updateAllLightTypes ( l , j1 , k1 ) ; } Profiler . endSection ( ) ; } protected void func_48094_a ( int par1 , int par2 , Chunk par3Chunk ) { Profiler . endStartSection ( "<STR_LIT>" ) ; par3Chunk . updateSkylight ( ) ; Profiler . endStartSection ( "<STR_LIT>" ) ; if ( ambientTickCountdown == <NUM_LIT:0> ) { updateLCG = updateLCG * <NUM_LIT:3> + <NUM_LIT> ; int i = updateLCG > > <NUM_LIT:2> ; int j = i & <NUM_LIT> ; int k = i > > <NUM_LIT:8> & <NUM_LIT> ; int l = i > > <NUM_LIT:16> & <NUM_LIT> ; int i1 = par3Chunk . getBlockID ( j , l , k ) ; j += par1 ; k += par2 ; if ( i1 == <NUM_LIT:0> && getFullBlockLightValue ( j , l , k ) <= rand . nextInt ( <NUM_LIT:8> ) && getSavedLightValue ( EnumSkyBlock . Sky , j , l , k ) <= <NUM_LIT:0> ) { EntityPlayer entityplayer = getClosestPlayer ( ( double ) j + <NUM_LIT> , ( double ) l + <NUM_LIT> , ( double ) k + <NUM_LIT> , <NUM_LIT> ) ; if ( entityplayer != null && entityplayer . getDistanceSq ( ( double ) j + <NUM_LIT> , ( double ) l + <NUM_LIT> , ( double ) k + <NUM_LIT> ) > <NUM_LIT> ) { playSoundEffect ( ( double ) j + <NUM_LIT> , ( double ) l + <NUM_LIT> , ( double ) k + <NUM_LIT> , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> + rand . nextFloat ( ) * <NUM_LIT> ) ; ambientTickCountdown = rand . nextInt ( <NUM_LIT> ) + <NUM_LIT> ; } } } Profiler . endStartSection ( "<STR_LIT>" ) ; par3Chunk . enqueueRelightChecks ( ) ; } protected void tickBlocksAndAmbiance ( ) { func_48090_k ( ) ; int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; for ( Iterator iterator = activeChunkSet . iterator ( ) ; iterator . hasNext ( ) ; Profiler . endSection ( ) ) { ChunkCoordIntPair chunkcoordintpair = ( ChunkCoordIntPair ) iterator . next ( ) ; int k = chunkcoordintpair . chunkXPos * <NUM_LIT:16> ; int l = chunkcoordintpair . chunkZPos * <NUM_LIT:16> ; Profiler . startSection ( "<STR_LIT>" ) ; Chunk chunk = getChunkFromChunkCoords ( chunkcoordintpair . chunkXPos , chunkcoordintpair . chunkZPos ) ; func_48094_a ( k , l , chunk ) ; Profiler . endStartSection ( "<STR_LIT>" ) ; if ( rand . nextInt ( <NUM_LIT> ) == <NUM_LIT:0> && isRaining ( ) && isThundering ( ) ) { updateLCG = updateLCG * <NUM_LIT:3> + <NUM_LIT> ; int i1 = updateLCG > > <NUM_LIT:2> ; int k1 = k + ( i1 & <NUM_LIT> ) ; int j2 = l + ( i1 > > <NUM_LIT:8> & <NUM_LIT> ) ; int i3 = getPrecipitationHeight ( k1 , j2 ) ; if ( canLightningStrikeAt ( k1 , i3 , j2 ) ) { addWeatherEffect ( new EntityLightningBolt ( this , k1 , i3 , j2 ) ) ; lastLightningBolt = <NUM_LIT:2> ; } } Profiler . endStartSection ( "<STR_LIT>" ) ; if ( rand . nextInt ( <NUM_LIT:16> ) == <NUM_LIT:0> ) { updateLCG = updateLCG * <NUM_LIT:3> + <NUM_LIT> ; int j1 = updateLCG > > <NUM_LIT:2> ; int l1 = j1 & <NUM_LIT> ; int k2 = j1 > > <NUM_LIT:8> & <NUM_LIT> ; int j3 = getPrecipitationHeight ( l1 + k , k2 + l ) ; if ( isBlockHydratedIndirectly ( l1 + k , j3 - <NUM_LIT:1> , k2 + l ) ) { setBlockWithNotify ( l1 + k , j3 - <NUM_LIT:1> , k2 + l , Block . ice . blockID ) ; } if ( isRaining ( ) && canSnowAt ( l1 + k , j3 , k2 + l ) ) { setBlockWithNotify ( l1 + k , j3 , k2 + l , Block . snow . blockID ) ; } } Profiler . endStartSection ( "<STR_LIT>" ) ; ExtendedBlockStorage aextendedblockstorage [ ] = chunk . getBlockStorageArray ( ) ; int i2 = aextendedblockstorage . length ; for ( int l2 = <NUM_LIT:0> ; l2 < i2 ; l2 ++ ) { ExtendedBlockStorage extendedblockstorage = aextendedblockstorage [ l2 ] ; if ( extendedblockstorage == null || ! extendedblockstorage . getNeedsRandomTick ( ) ) { continue ; } for ( int k3 = <NUM_LIT:0> ; k3 < <NUM_LIT:3> ; k3 ++ ) { updateLCG = updateLCG * <NUM_LIT:3> + <NUM_LIT> ; int l3 = updateLCG > > <NUM_LIT:2> ; int i4 = l3 & <NUM_LIT> ; int j4 = l3 > > <NUM_LIT:8> & <NUM_LIT> ; int k4 = l3 > > <NUM_LIT:16> & <NUM_LIT> ; int l4 = extendedblockstorage . getExtBlockID ( i4 , k4 , j4 ) ; j ++ ; Block block = Block . blocksList [ l4 ] ; if ( block != null && block . getTickRandomly ( ) ) { i ++ ; block . updateTick ( this , i4 + k , k4 + extendedblockstorage . getYLocation ( ) , j4 + l , rand ) ; } } } } } public boolean isBlockHydratedDirectly ( int par1 , int par2 , int par3 ) { return isBlockHydrated ( par1 , par2 , par3 , false ) ; } public boolean isBlockHydratedIndirectly ( int par1 , int par2 , int par3 ) { return isBlockHydrated ( par1 , par2 , par3 , true ) ; } public boolean isBlockHydrated ( int par1 , int par2 , int par3 , boolean par4 ) { BiomeGenBase biomegenbase = getBiomeGenForCoords ( par1 , par3 ) ; float f = biomegenbase . getFloatTemperature ( ) ; if ( f > <NUM_LIT> ) { return false ; } if ( par2 >= <NUM_LIT:0> && par2 < <NUM_LIT> && getSavedLightValue ( EnumSkyBlock . Block , par1 , par2 , par3 ) < <NUM_LIT:10> ) { int i = getBlockId ( par1 , par2 , par3 ) ; if ( ( i == Block . waterStill . blockID || i == Block . waterMoving . blockID ) && getBlockMetadata ( par1 , par2 , par3 ) == <NUM_LIT:0> ) { if ( ! par4 ) { return true ; } boolean flag = true ; if ( flag && getBlockMaterial ( par1 - <NUM_LIT:1> , par2 , par3 ) != Material . water ) { flag = false ; } if ( flag && getBlockMaterial ( par1 + <NUM_LIT:1> , par2 , par3 ) != Material . water ) { flag = false ; } if ( flag && getBlockMaterial ( par1 , par2 , par3 - <NUM_LIT:1> ) != Material . water ) { flag = false ; } if ( flag && getBlockMaterial ( par1 , par2 , par3 + <NUM_LIT:1> ) != Material . water ) { flag = false ; } if ( ! flag ) { return true ; } } } return false ; } public boolean canSnowAt ( int par1 , int par2 , int par3 ) { BiomeGenBase biomegenbase = getBiomeGenForCoords ( par1 , par3 ) ; float f = biomegenbase . getFloatTemperature ( ) ; if ( f > <NUM_LIT> ) { return false ; } if ( par2 >= <NUM_LIT:0> && par2 < <NUM_LIT> && getSavedLightValue ( EnumSkyBlock . Block , par1 , par2 , par3 ) < <NUM_LIT:10> ) { int i = getBlockId ( par1 , par2 - <NUM_LIT:1> , par3 ) ; int j = getBlockId ( par1 , par2 , par3 ) ; if ( j == <NUM_LIT:0> && Block . snow . canPlaceBlockAt ( this , par1 , par2 , par3 ) && i != <NUM_LIT:0> && i != Block . ice . blockID && Block . blocksList [ i ] . blockMaterial . blocksMovement ( ) ) { return true ; } } return false ; } public void updateAllLightTypes ( int par1 , int par2 , int par3 ) { if ( ! worldProvider . hasNoSky ) { updateLightByType ( EnumSkyBlock . Sky , par1 , par2 , par3 ) ; } updateLightByType ( EnumSkyBlock . Block , par1 , par2 , par3 ) ; } private int computeSkyLightValue ( int par1 , int par2 , int par3 , int par4 , int par5 , int par6 ) { int i = <NUM_LIT:0> ; if ( canBlockSeeTheSky ( par2 , par3 , par4 ) ) { i = <NUM_LIT:15> ; } else { if ( par6 == <NUM_LIT:0> ) { par6 = <NUM_LIT:1> ; } int j = getSavedLightValue ( EnumSkyBlock . Sky , par2 - <NUM_LIT:1> , par3 , par4 ) - par6 ; int k = getSavedLightValue ( EnumSkyBlock . Sky , par2 + <NUM_LIT:1> , par3 , par4 ) - par6 ; int l = getSavedLightValue ( EnumSkyBlock . Sky , par2 , par3 - <NUM_LIT:1> , par4 ) - par6 ; int i1 = getSavedLightValue ( EnumSkyBlock . Sky , par2 , par3 + <NUM_LIT:1> , par4 ) - par6 ; int j1 = getSavedLightValue ( EnumSkyBlock . Sky , par2 , par3 , par4 - <NUM_LIT:1> ) - par6 ; int k1 = getSavedLightValue ( EnumSkyBlock . Sky , par2 , par3 , par4 + <NUM_LIT:1> ) - par6 ; if ( j > i ) { i = j ; } if ( k > i ) { i = k ; } if ( l > i ) { i = l ; } if ( i1 > i ) { i = i1 ; } if ( j1 > i ) { i = j1 ; } if ( k1 > i ) { i = k1 ; } } return i ; } private int computeBlockLightValue ( int par1 , int par2 , int par3 , int par4 , int par5 , int par6 ) { int i = Block . lightValue [ par5 ] ; int j = getSavedLightValue ( EnumSkyBlock . Block , par2 - <NUM_LIT:1> , par3 , par4 ) - par6 ; int k = getSavedLightValue ( EnumSkyBlock . Block , par2 + <NUM_LIT:1> , par3 , par4 ) - par6 ; int l = getSavedLightValue ( EnumSkyBlock . Block , par2 , par3 - <NUM_LIT:1> , par4 ) - par6 ; int i1 = getSavedLightValue ( EnumSkyBlock . Block , par2 , par3 + <NUM_LIT:1> , par4 ) - par6 ; int j1 = getSavedLightValue ( EnumSkyBlock . Block , par2 , par3 , par4 - <NUM_LIT:1> ) - par6 ; int k1 = getSavedLightValue ( EnumSkyBlock . Block , par2 , par3 , par4 + <NUM_LIT:1> ) - par6 ; if ( j > i ) { i = j ; } if ( k > i ) { i = k ; } if ( l > i ) { i = l ; } if ( i1 > i ) { i = i1 ; } if ( j1 > i ) { i = j1 ; } if ( k1 > i ) { i = k1 ; } return i ; } public void updateLightByType ( EnumSkyBlock par1EnumSkyBlock , int par2 , int par3 , int par4 ) { if ( ! doChunksNearChunkExist ( par2 , par3 , par4 , <NUM_LIT> ) ) { return ; } int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; Profiler . startSection ( "<STR_LIT>" ) ; int k = getSavedLightValue ( par1EnumSkyBlock , par2 , par3 , par4 ) ; int i1 = <NUM_LIT:0> ; int k1 = k ; int j2 = getBlockId ( par2 , par3 , par4 ) ; int i3 = func_48092_f ( par2 , par3 , par4 ) ; if ( i3 == <NUM_LIT:0> ) { i3 = <NUM_LIT:1> ; } int l3 = <NUM_LIT:0> ; if ( par1EnumSkyBlock == EnumSkyBlock . Sky ) { l3 = computeSkyLightValue ( k1 , par2 , par3 , par4 , j2 , i3 ) ; } else { l3 = computeBlockLightValue ( k1 , par2 , par3 , par4 , j2 , i3 ) ; } i1 = l3 ; if ( i1 > k ) { lightUpdateBlockList [ j ++ ] = <NUM_LIT> ; } else if ( i1 < k ) { if ( par1EnumSkyBlock == EnumSkyBlock . Block ) ; lightUpdateBlockList [ j ++ ] = <NUM_LIT> + ( k << <NUM_LIT> ) ; do { if ( i >= j ) { break ; } int l1 = lightUpdateBlockList [ i ++ ] ; int k2 = ( ( l1 & <NUM_LIT> ) - <NUM_LIT:32> ) + par2 ; int j3 = ( ( l1 > > <NUM_LIT:6> & <NUM_LIT> ) - <NUM_LIT:32> ) + par3 ; int i4 = ( ( l1 > > <NUM_LIT:12> & <NUM_LIT> ) - <NUM_LIT:32> ) + par4 ; int k4 = l1 > > <NUM_LIT> & <NUM_LIT> ; int i5 = getSavedLightValue ( par1EnumSkyBlock , k2 , j3 , i4 ) ; if ( i5 == k4 ) { setLightValue ( par1EnumSkyBlock , k2 , j3 , i4 , <NUM_LIT:0> ) ; if ( k4 > <NUM_LIT:0> ) { int l5 = k2 - par2 ; int j6 = j3 - par3 ; int l6 = i4 - par4 ; if ( l5 < <NUM_LIT:0> ) { l5 = - l5 ; } if ( j6 < <NUM_LIT:0> ) { j6 = - j6 ; } if ( l6 < <NUM_LIT:0> ) { l6 = - l6 ; } if ( l5 + j6 + l6 < <NUM_LIT> ) { int j7 = <NUM_LIT:0> ; while ( j7 < <NUM_LIT:6> ) { int k7 = ( j7 % <NUM_LIT:2> ) * <NUM_LIT:2> - <NUM_LIT:1> ; int l7 = k2 + ( ( ( j7 / <NUM_LIT:2> ) % <NUM_LIT:3> ) / <NUM_LIT:2> ) * k7 ; int i8 = j3 + ( ( ( j7 / <NUM_LIT:2> + <NUM_LIT:1> ) % <NUM_LIT:3> ) / <NUM_LIT:2> ) * k7 ; int j8 = i4 + ( ( ( j7 / <NUM_LIT:2> + <NUM_LIT:2> ) % <NUM_LIT:3> ) / <NUM_LIT:2> ) * k7 ; int j5 = getSavedLightValue ( par1EnumSkyBlock , l7 , i8 , j8 ) ; int k8 = Block . lightOpacity [ getBlockId ( l7 , i8 , j8 ) ] ; if ( k8 == <NUM_LIT:0> ) { k8 = <NUM_LIT:1> ; } if ( j5 == k4 - k8 && j < lightUpdateBlockList . length ) { lightUpdateBlockList [ j ++ ] = ( l7 - par2 ) + <NUM_LIT:32> + ( ( i8 - par3 ) + <NUM_LIT:32> << <NUM_LIT:6> ) + ( ( j8 - par4 ) + <NUM_LIT:32> << <NUM_LIT:12> ) + ( k4 - k8 << <NUM_LIT> ) ; } j7 ++ ; } } } } } while ( true ) ; i = <NUM_LIT:0> ; } Profiler . endSection ( ) ; Profiler . startSection ( "<STR_LIT>" ) ; do { if ( i >= j ) { break ; } int l = lightUpdateBlockList [ i ++ ] ; int j1 = ( ( l & <NUM_LIT> ) - <NUM_LIT:32> ) + par2 ; int i2 = ( ( l > > <NUM_LIT:6> & <NUM_LIT> ) - <NUM_LIT:32> ) + par3 ; int l2 = ( ( l > > <NUM_LIT:12> & <NUM_LIT> ) - <NUM_LIT:32> ) + par4 ; int k3 = getSavedLightValue ( par1EnumSkyBlock , j1 , i2 , l2 ) ; int j4 = getBlockId ( j1 , i2 , l2 ) ; int l4 = Block . lightOpacity [ j4 ] ; if ( l4 == <NUM_LIT:0> ) { l4 = <NUM_LIT:1> ; } int k5 = <NUM_LIT:0> ; if ( par1EnumSkyBlock == EnumSkyBlock . Sky ) { k5 = computeSkyLightValue ( k3 , j1 , i2 , l2 , j4 , l4 ) ; } else { k5 = computeBlockLightValue ( k3 , j1 , i2 , l2 , j4 , l4 ) ; } if ( k5 != k3 ) { setLightValue ( par1EnumSkyBlock , j1 , i2 , l2 , k5 ) ; if ( k5 > k3 ) { int i6 = j1 - par2 ; int k6 = i2 - par3 ; int i7 = l2 - par4 ; if ( i6 < <NUM_LIT:0> ) { i6 = - i6 ; } if ( k6 < <NUM_LIT:0> ) { k6 = - k6 ; } if ( i7 < <NUM_LIT:0> ) { i7 = - i7 ; } if ( i6 + k6 + i7 < <NUM_LIT> && j < lightUpdateBlockList . length - <NUM_LIT:6> ) { if ( getSavedLightValue ( par1EnumSkyBlock , j1 - <NUM_LIT:1> , i2 , l2 ) < k5 ) { lightUpdateBlockList [ j ++ ] = ( j1 - <NUM_LIT:1> - par2 ) + <NUM_LIT:32> + ( ( i2 - par3 ) + <NUM_LIT:32> << <NUM_LIT:6> ) + ( ( l2 - par4 ) + <NUM_LIT:32> << <NUM_LIT:12> ) ; } if ( getSavedLightValue ( par1EnumSkyBlock , j1 + <NUM_LIT:1> , i2 , l2 ) < k5 ) { lightUpdateBlockList [ j ++ ] = ( ( j1 + <NUM_LIT:1> ) - par2 ) + <NUM_LIT:32> + ( ( i2 - par3 ) + <NUM_LIT:32> << <NUM_LIT:6> ) + ( ( l2 - par4 ) + <NUM_LIT:32> << <NUM_LIT:12> ) ; } if ( getSavedLightValue ( par1EnumSkyBlock , j1 , i2 - <NUM_LIT:1> , l2 ) < k5 ) { lightUpdateBlockList [ j ++ ] = ( j1 - par2 ) + <NUM_LIT:32> + ( ( i2 - <NUM_LIT:1> - par3 ) + <NUM_LIT:32> << <NUM_LIT:6> ) + ( ( l2 - par4 ) + <NUM_LIT:32> << <NUM_LIT:12> ) ; } if ( getSavedLightValue ( par1EnumSkyBlock , j1 , i2 + <NUM_LIT:1> , l2 ) < k5 ) { lightUpdateBlockList [ j ++ ] = ( j1 - par2 ) + <NUM_LIT:32> + ( ( ( i2 + <NUM_LIT:1> ) - par3 ) + <NUM_LIT:32> << <NUM_LIT:6> ) + ( ( l2 - par4 ) + <NUM_LIT:32> << <NUM_LIT:12> ) ; } if ( getSavedLightValue ( par1EnumSkyBlock , j1 , i2 , l2 - <NUM_LIT:1> ) < k5 ) { lightUpdateBlockList [ j ++ ] = ( j1 - par2 ) + <NUM_LIT:32> + ( ( i2 - par3 ) + <NUM_LIT:32> << <NUM_LIT:6> ) + ( ( l2 - <NUM_LIT:1> - par4 ) + <NUM_LIT:32> << <NUM_LIT:12> ) ; } if ( getSavedLightValue ( par1EnumSkyBlock , j1 , i2 , l2 + <NUM_LIT:1> ) < k5 ) { lightUpdateBlockList [ j ++ ] = ( j1 - par2 ) + <NUM_LIT:32> + ( ( i2 - par3 ) + <NUM_LIT:32> << <NUM_LIT:6> ) + ( ( ( l2 + <NUM_LIT:1> ) - par4 ) + <NUM_LIT:32> << <NUM_LIT:12> ) ; } } } } } while ( true ) ; Profiler . endSection ( ) ; } public boolean tickUpdates ( boolean par1 ) { int i = scheduledTickTreeSet . size ( ) ; if ( i != scheduledTickSet . size ( ) ) { throw new IllegalStateException ( "<STR_LIT>" ) ; } if ( i > <NUM_LIT:1000> ) { i = <NUM_LIT:1000> ; } for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { NextTickListEntry nextticklistentry = ( NextTickListEntry ) scheduledTickTreeSet . first ( ) ; if ( ! par1 && nextticklistentry . scheduledTime > worldInfo . getWorldTime ( ) ) { break ; } scheduledTickTreeSet . remove ( nextticklistentry ) ; scheduledTickSet . remove ( nextticklistentry ) ; byte byte0 = <NUM_LIT:8> ; if ( ! checkChunksExist ( nextticklistentry . xCoord - byte0 , nextticklistentry . yCoord - byte0 , nextticklistentry . zCoord - byte0 , nextticklistentry . xCoord + byte0 , nextticklistentry . yCoord + byte0 , nextticklistentry . zCoord + byte0 ) ) { continue ; } int k = getBlockId ( nextticklistentry . xCoord , nextticklistentry . yCoord , nextticklistentry . zCoord ) ; if ( k == nextticklistentry . blockID && k > <NUM_LIT:0> ) { Block . blocksList [ k ] . updateTick ( this , nextticklistentry . xCoord , nextticklistentry . yCoord , nextticklistentry . zCoord , rand ) ; } } return scheduledTickTreeSet . size ( ) != <NUM_LIT:0> ; } public List getPendingBlockUpdates ( Chunk par1Chunk , boolean par2 ) { ArrayList arraylist = null ; ChunkCoordIntPair chunkcoordintpair = par1Chunk . getChunkCoordIntPair ( ) ; int i = chunkcoordintpair . chunkXPos << <NUM_LIT:4> ; int j = i + <NUM_LIT:16> ; int k = chunkcoordintpair . chunkZPos << <NUM_LIT:4> ; int l = k + <NUM_LIT:16> ; Iterator iterator = scheduledTickSet . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } NextTickListEntry nextticklistentry = ( NextTickListEntry ) iterator . next ( ) ; if ( nextticklistentry . xCoord >= i && nextticklistentry . xCoord < j && nextticklistentry . zCoord >= k && nextticklistentry . zCoord < l ) { if ( par2 ) { scheduledTickTreeSet . remove ( nextticklistentry ) ; iterator . remove ( ) ; } if ( arraylist == null ) { arraylist = new ArrayList ( ) ; } arraylist . add ( nextticklistentry ) ; } } while ( true ) ; return arraylist ; } public List getEntitiesWithinAABBExcludingEntity ( Entity par1Entity , AxisAlignedBB par2AxisAlignedBB ) { entitiesWithinAABBExcludingEntity . clear ( ) ; int i = MathHelper . floor_double ( ( par2AxisAlignedBB . minX - <NUM_LIT> ) / <NUM_LIT> ) ; int j = MathHelper . floor_double ( ( par2AxisAlignedBB . maxX + <NUM_LIT> ) / <NUM_LIT> ) ; int k = MathHelper . floor_double ( ( par2AxisAlignedBB . minZ - <NUM_LIT> ) / <NUM_LIT> ) ; int l = MathHelper . floor_double ( ( par2AxisAlignedBB . maxZ + <NUM_LIT> ) / <NUM_LIT> ) ; for ( int i1 = i ; i1 <= j ; i1 ++ ) { for ( int j1 = k ; j1 <= l ; j1 ++ ) { if ( chunkExists ( i1 , j1 ) ) { getChunkFromChunkCoords ( i1 , j1 ) . getEntitiesWithinAABBForEntity ( par1Entity , par2AxisAlignedBB , entitiesWithinAABBExcludingEntity ) ; } } } return entitiesWithinAABBExcludingEntity ; } public List getEntitiesWithinAABB ( Class par1Class , AxisAlignedBB par2AxisAlignedBB ) { int i = MathHelper . floor_double ( ( par2AxisAlignedBB . minX - <NUM_LIT> ) / <NUM_LIT> ) ; int j = MathHelper . floor_double ( ( par2AxisAlignedBB . maxX + <NUM_LIT> ) / <NUM_LIT> ) ; int k = MathHelper . floor_double ( ( par2AxisAlignedBB . minZ - <NUM_LIT> ) / <NUM_LIT> ) ; int l = MathHelper . floor_double ( ( par2AxisAlignedBB . maxZ + <NUM_LIT> ) / <NUM_LIT> ) ; ArrayList arraylist = new ArrayList ( ) ; for ( int i1 = i ; i1 <= j ; i1 ++ ) { for ( int j1 = k ; j1 <= l ; j1 ++ ) { if ( chunkExists ( i1 , j1 ) ) { getChunkFromChunkCoords ( i1 , j1 ) . getEntitiesOfTypeWithinAAAB ( par1Class , par2AxisAlignedBB , arraylist ) ; } } } return arraylist ; } public Entity findNearestEntityWithinAABB ( Class par1Class , AxisAlignedBB par2AxisAlignedBB , Entity par3Entity ) { List list = getEntitiesWithinAABB ( par1Class , par2AxisAlignedBB ) ; Entity entity = null ; double d = Double . MAX_VALUE ; Iterator iterator = list . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } Entity entity1 = ( Entity ) iterator . next ( ) ; if ( entity1 != par3Entity ) { double d1 = par3Entity . getDistanceSqToEntity ( entity1 ) ; if ( d1 <= d ) { entity = entity1 ; d = d1 ; } } } while ( true ) ; return entity ; } public void updateTileEntityChunkAndDoNothing ( int par1 , int par2 , int par3 , TileEntity par4TileEntity ) { if ( blockExists ( par1 , par2 , par3 ) ) { getChunkFromBlockCoords ( par1 , par3 ) . setChunkModified ( ) ; } for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . doNothingWithTileEntity ( par1 , par2 , par3 , par4TileEntity ) ; } } public int countEntities ( Class par1Class ) { int i = <NUM_LIT:0> ; for ( int j = <NUM_LIT:0> ; j < loadedEntityList . size ( ) ; j ++ ) { Entity entity = ( Entity ) loadedEntityList . get ( j ) ; if ( par1Class . isAssignableFrom ( entity . getClass ( ) ) ) { i ++ ; } } return i ; } public void addLoadedEntities ( List par1List ) { loadedEntityList . addAll ( par1List ) ; for ( int i = <NUM_LIT:0> ; i < par1List . size ( ) ; i ++ ) { obtainEntitySkin ( ( Entity ) par1List . get ( i ) ) ; } } public void unloadEntities ( List par1List ) { unloadedEntityList . addAll ( par1List ) ; } public boolean canBlockBePlacedAt ( int par1 , int par2 , int par3 , int par4 , boolean par5 , int par6 ) { int i = getBlockId ( par2 , par3 , par4 ) ; Block block = Block . blocksList [ i ] ; Block block1 = Block . blocksList [ par1 ] ; AxisAlignedBB axisalignedbb = block1 . getCollisionBoundingBoxFromPool ( this , par2 , par3 , par4 ) ; if ( par5 ) { axisalignedbb = null ; } if ( axisalignedbb != null && ! checkIfAABBIsClear ( axisalignedbb ) ) { return false ; } if ( block != null && ( block == Block . waterMoving || block == Block . waterStill || block == Block . lavaMoving || block == Block . lavaStill || block == Block . fire || block . blockMaterial . isGroundCover ( ) ) ) { block = null ; } return par1 > <NUM_LIT:0> && block == null && block1 . canPlaceBlockOnSide ( this , par2 , par3 , par4 , par6 ) ; } public PathEntity getPathEntityToEntity ( Entity par1Entity , Entity par2Entity , float par3 , boolean par4 , boolean par5 , boolean par6 , boolean par7 ) { Profiler . startSection ( "<STR_LIT>" ) ; int i = MathHelper . floor_double ( par1Entity . posX ) ; int j = MathHelper . floor_double ( par1Entity . posY + <NUM_LIT> ) ; int k = MathHelper . floor_double ( par1Entity . posZ ) ; int l = ( int ) ( par3 + <NUM_LIT> ) ; int i1 = i - l ; int j1 = j - l ; int k1 = k - l ; int l1 = i + l ; int i2 = j + l ; int j2 = k + l ; ChunkCache chunkcache = new ChunkCache ( this , i1 , j1 , k1 , l1 , i2 , j2 ) ; PathEntity pathentity = ( new PathFinder ( chunkcache , par4 , par5 , par6 , par7 ) ) . createEntityPathTo ( par1Entity , par2Entity , par3 ) ; Profiler . endSection ( ) ; return pathentity ; } public PathEntity getEntityPathToXYZ ( Entity par1Entity , int par2 , int par3 , int par4 , float par5 , boolean par6 , boolean par7 , boolean par8 , boolean par9 ) { Profiler . startSection ( "<STR_LIT>" ) ; int i = MathHelper . floor_double ( par1Entity . posX ) ; int j = MathHelper . floor_double ( par1Entity . posY ) ; int k = MathHelper . floor_double ( par1Entity . posZ ) ; int l = ( int ) ( par5 + <NUM_LIT> ) ; int i1 = i - l ; int j1 = j - l ; int k1 = k - l ; int l1 = i + l ; int i2 = j + l ; int j2 = k + l ; ChunkCache chunkcache = new ChunkCache ( this , i1 , j1 , k1 , l1 , i2 , j2 ) ; PathEntity pathentity = ( new PathFinder ( chunkcache , par6 , par7 , par8 , par9 ) ) . createEntityPathTo ( par1Entity , par2 , par3 , par4 , par5 ) ; Profiler . endSection ( ) ; return pathentity ; } public boolean isBlockProvidingPowerTo ( int par1 , int par2 , int par3 , int par4 ) { int i = getBlockId ( par1 , par2 , par3 ) ; if ( i == <NUM_LIT:0> ) { return false ; } else { return Block . blocksList [ i ] . isIndirectlyPoweringTo ( this , par1 , par2 , par3 , par4 ) ; } } public boolean isBlockGettingPowered ( int par1 , int par2 , int par3 ) { if ( isBlockProvidingPowerTo ( par1 , par2 - <NUM_LIT:1> , par3 , <NUM_LIT:0> ) ) { return true ; } if ( isBlockProvidingPowerTo ( par1 , par2 + <NUM_LIT:1> , par3 , <NUM_LIT:1> ) ) { return true ; } if ( isBlockProvidingPowerTo ( par1 , par2 , par3 - <NUM_LIT:1> , <NUM_LIT:2> ) ) { return true ; } if ( isBlockProvidingPowerTo ( par1 , par2 , par3 + <NUM_LIT:1> , <NUM_LIT:3> ) ) { return true ; } if ( isBlockProvidingPowerTo ( par1 - <NUM_LIT:1> , par2 , par3 , <NUM_LIT:4> ) ) { return true ; } return isBlockProvidingPowerTo ( par1 + <NUM_LIT:1> , par2 , par3 , <NUM_LIT:5> ) ; } public boolean isBlockIndirectlyProvidingPowerTo ( int par1 , int par2 , int par3 , int par4 ) { if ( isBlockNormalCube ( par1 , par2 , par3 ) ) { return isBlockGettingPowered ( par1 , par2 , par3 ) ; } int i = getBlockId ( par1 , par2 , par3 ) ; if ( i == <NUM_LIT:0> ) { return false ; } else { return Block . blocksList [ i ] . isPoweringTo ( this , par1 , par2 , par3 , par4 ) ; } } public boolean isBlockIndirectlyGettingPowered ( int par1 , int par2 , int par3 ) { if ( isBlockIndirectlyProvidingPowerTo ( par1 , par2 - <NUM_LIT:1> , par3 , <NUM_LIT:0> ) ) { return true ; } if ( isBlockIndirectlyProvidingPowerTo ( par1 , par2 + <NUM_LIT:1> , par3 , <NUM_LIT:1> ) ) { return true ; } if ( isBlockIndirectlyProvidingPowerTo ( par1 , par2 , par3 - <NUM_LIT:1> , <NUM_LIT:2> ) ) { return true ; } if ( isBlockIndirectlyProvidingPowerTo ( par1 , par2 , par3 + <NUM_LIT:1> , <NUM_LIT:3> ) ) { return true ; } if ( isBlockIndirectlyProvidingPowerTo ( par1 - <NUM_LIT:1> , par2 , par3 , <NUM_LIT:4> ) ) { return true ; } return isBlockIndirectlyProvidingPowerTo ( par1 + <NUM_LIT:1> , par2 , par3 , <NUM_LIT:5> ) ; } public EntityPlayer getClosestPlayerToEntity ( Entity par1Entity , double par2 ) { return getClosestPlayer ( par1Entity . posX , par1Entity . posY , par1Entity . posZ , par2 ) ; } public EntityPlayer getClosestPlayer ( double par1 , double par3 , double par5 , double par7 ) { double d = - <NUM_LIT> ; EntityPlayer entityplayer = null ; for ( int i = <NUM_LIT:0> ; i < playerEntities . size ( ) ; i ++ ) { EntityPlayer entityplayer1 = ( EntityPlayer ) playerEntities . get ( i ) ; double d1 = entityplayer1 . getDistanceSq ( par1 , par3 , par5 ) ; if ( ( par7 < <NUM_LIT> || d1 < par7 * par7 ) && ( d == - <NUM_LIT> || d1 < d ) ) { d = d1 ; entityplayer = entityplayer1 ; } } return entityplayer ; } public EntityPlayer func_48087_a ( double par1 , double par3 , double par5 ) { double d = - <NUM_LIT> ; EntityPlayer entityplayer = null ; for ( int i = <NUM_LIT:0> ; i < playerEntities . size ( ) ; i ++ ) { EntityPlayer entityplayer1 = ( EntityPlayer ) playerEntities . get ( i ) ; double d1 = entityplayer1 . getDistanceSq ( par1 , entityplayer1 . posY , par3 ) ; if ( ( par5 < <NUM_LIT> || d1 < par5 * par5 ) && ( d == - <NUM_LIT> || d1 < d ) ) { d = d1 ; entityplayer = entityplayer1 ; } } return entityplayer ; } public EntityPlayer getClosestVulnerablePlayerToEntity ( Entity par1Entity , double par2 ) { return getClosestVulnerablePlayer ( par1Entity . posX , par1Entity . posY , par1Entity . posZ , par2 ) ; } public EntityPlayer getClosestVulnerablePlayer ( double par1 , double par3 , double par5 , double par7 ) { double d = - <NUM_LIT> ; EntityPlayer entityplayer = null ; for ( int i = <NUM_LIT:0> ; i < playerEntities . size ( ) ; i ++ ) { EntityPlayer entityplayer1 = ( EntityPlayer ) playerEntities . get ( i ) ; if ( entityplayer1 . capabilities . disableDamage ) { continue ; } double d1 = entityplayer1 . getDistanceSq ( par1 , par3 , par5 ) ; if ( ( par7 < <NUM_LIT> || d1 < par7 * par7 ) && ( d == - <NUM_LIT> || d1 < d ) ) { d = d1 ; entityplayer = entityplayer1 ; } } return entityplayer ; } public EntityPlayer getPlayerEntityByName ( String par1Str ) { for ( int i = <NUM_LIT:0> ; i < playerEntities . size ( ) ; i ++ ) { if ( par1Str . equals ( ( ( EntityPlayer ) playerEntities . get ( i ) ) . username ) ) { return ( EntityPlayer ) playerEntities . get ( i ) ; } } return null ; } public void checkSessionLock ( ) { saveHandler . checkSessionLock ( ) ; } public void setWorldTime ( long par1 ) { worldInfo . setWorldTime ( par1 ) ; } public void advanceTime ( long par1 ) { long l = par1 - worldInfo . getWorldTime ( ) ; for ( Iterator iterator = scheduledTickSet . iterator ( ) ; iterator . hasNext ( ) ; ) { NextTickListEntry nextticklistentry = ( NextTickListEntry ) iterator . next ( ) ; nextticklistentry . scheduledTime += l ; } setWorldTime ( par1 ) ; } public long getSeed ( ) { return worldInfo . getSeed ( ) ; } public long getWorldTime ( ) { return worldInfo . getWorldTime ( ) ; } public ChunkCoordinates getSpawnPoint ( ) { return new ChunkCoordinates ( worldInfo . getSpawnX ( ) , worldInfo . getSpawnY ( ) , worldInfo . getSpawnZ ( ) ) ; } public boolean canMineBlock ( EntityPlayer par1EntityPlayer , int par2 , int par3 , int i ) { return true ; } public void setEntityState ( Entity entity , byte byte0 ) { } public IChunkProvider getChunkProvider ( ) { return chunkProvider ; } public void playNoteAt ( int par1 , int par2 , int par3 , int par4 , int par5 ) { int i = getBlockId ( par1 , par2 , par3 ) ; if ( i > <NUM_LIT:0> ) { Block . blocksList [ i ] . powerBlock ( this , par1 , par2 , par3 , par4 , par5 ) ; } } public ISaveHandler getSaveHandler ( ) { return saveHandler ; } public WorldInfo getWorldInfo ( ) { return worldInfo ; } public void updateAllPlayersSleepingFlag ( ) { allPlayersSleeping = ! playerEntities . isEmpty ( ) ; Iterator iterator = playerEntities . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } EntityPlayer entityplayer = ( EntityPlayer ) iterator . next ( ) ; if ( entityplayer . isPlayerSleeping ( ) ) { continue ; } allPlayersSleeping = false ; break ; } while ( true ) ; } protected void wakeUpAllPlayers ( ) { allPlayersSleeping = false ; Iterator iterator = playerEntities . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } EntityPlayer entityplayer = ( EntityPlayer ) iterator . next ( ) ; if ( entityplayer . isPlayerSleeping ( ) ) { entityplayer . wakeUpPlayer ( false , false , true ) ; } } while ( true ) ; clearWeather ( ) ; } public boolean isAllPlayersFullyAsleep ( ) { if ( allPlayersSleeping && ! isRemote ) { for ( Iterator iterator = playerEntities . iterator ( ) ; iterator . hasNext ( ) ; ) { EntityPlayer entityplayer = ( EntityPlayer ) iterator . next ( ) ; if ( ! entityplayer . isPlayerFullyAsleep ( ) ) { return false ; } } return true ; } else { return false ; } } public float getWeightedThunderStrength ( float par1 ) { return ( prevThunderingStrength + ( thunderingStrength - prevThunderingStrength ) * par1 ) * getRainStrength ( par1 ) ; } public float getRainStrength ( float par1 ) { return prevRainingStrength + ( rainingStrength - prevRainingStrength ) * par1 ; } public boolean isThundering ( ) { return ( double ) getWeightedThunderStrength ( <NUM_LIT> ) > <NUM_LIT> ; } public boolean isRaining ( ) { return ( double ) getRainStrength ( <NUM_LIT> ) > <NUM_LIT> ; } public boolean canLightningStrikeAt ( int par1 , int par2 , int par3 ) { if ( ! isRaining ( ) ) { return false ; } if ( ! canBlockSeeTheSky ( par1 , par2 , par3 ) ) { return false ; } if ( getPrecipitationHeight ( par1 , par3 ) > par2 ) { return false ; } BiomeGenBase biomegenbase = getBiomeGenForCoords ( par1 , par3 ) ; if ( biomegenbase . getEnableSnow ( ) ) { return false ; } else { return biomegenbase . canSpawnLightningBolt ( ) ; } } public boolean func_48089_z ( int par1 , int par2 , int par3 ) { BiomeGenBase biomegenbase = getBiomeGenForCoords ( par1 , par3 ) ; return biomegenbase . func_48441_d ( ) ; } public void setItemData ( String par1Str , WorldSavedData par2WorldSavedData ) { mapStorage . setData ( par1Str , par2WorldSavedData ) ; } public WorldSavedData loadItemData ( Class par1Class , String par2Str ) { return mapStorage . loadData ( par1Class , par2Str ) ; } public int getUniqueDataId ( String par1Str ) { return mapStorage . getUniqueDataId ( par1Str ) ; } public void playAuxSFX ( int par1 , int par2 , int par3 , int par4 , int par5 ) { playAuxSFXAtEntity ( null , par1 , par2 , par3 , par4 , par5 ) ; } public void playAuxSFXAtEntity ( EntityPlayer par1EntityPlayer , int par2 , int par3 , int par4 , int par5 , int par6 ) { for ( int i = <NUM_LIT:0> ; i < worldAccesses . size ( ) ; i ++ ) { ( ( IWorldAccess ) worldAccesses . get ( i ) ) . playAuxSFX ( par1EntityPlayer , par2 , par3 , par4 , par5 , par6 ) ; } } public int getHeight ( ) { return <NUM_LIT> ; } public Random setRandomSeed ( int par1 , int par2 , int par3 ) { long l = ( long ) par1 * <NUM_LIT> + ( long ) par2 * <NUM_LIT> + getWorldInfo ( ) . getSeed ( ) + ( long ) par3 ; rand . setSeed ( l ) ; return rand ; } public boolean updatingLighting ( ) { return false ; } public SpawnListEntry getRandomMob ( EnumCreatureType par1EnumCreatureType , int par2 , int par3 , int par4 ) { List list = getChunkProvider ( ) . getPossibleCreatures ( par1EnumCreatureType , par2 , par3 , par4 ) ; if ( list == null || list . isEmpty ( ) ) { return null ; } else { return ( SpawnListEntry ) WeightedRandom . getRandomItem ( rand , list ) ; } } public ChunkPosition findClosestStructure ( String par1Str , int par2 , int par3 , int par4 ) { return getChunkProvider ( ) . findClosestStructure ( this , par1Str , par2 , par3 , par4 ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . List ; import java . util . logging . Logger ; public class SaveHandler implements IPlayerFileData , ISaveHandler { private static final Logger logger = Logger . getLogger ( "<STR_LIT>" ) ; private final File worldDirectory ; private final File worldFile ; private final File mapDataDir ; private final long initializationTime = System . currentTimeMillis ( ) ; private final String saveDirectoryName ; public SaveHandler ( File par1File , String par2Str , boolean par3 ) { worldDirectory = new File ( par1File , par2Str ) ; worldDirectory . mkdirs ( ) ; worldFile = new File ( worldDirectory , "<STR_LIT>" ) ; mapDataDir = new File ( worldDirectory , "<STR_LIT:data>" ) ; mapDataDir . mkdirs ( ) ; saveDirectoryName = par2Str ; if ( par3 ) { worldFile . mkdirs ( ) ; } setSessionLock ( ) ; } private void setSessionLock ( ) { try { File file = new File ( worldDirectory , "<STR_LIT>" ) ; DataOutputStream dataoutputstream = new DataOutputStream ( new FileOutputStream ( file ) ) ; try { dataoutputstream . writeLong ( initializationTime ) ; } finally { dataoutputstream . close ( ) ; } } catch ( IOException ioexception ) { ioexception . printStackTrace ( ) ; throw new RuntimeException ( "<STR_LIT>" ) ; } } protected File getWorldDirectory ( ) { return worldDirectory ; } public void checkSessionLock ( ) { try { File file = new File ( worldDirectory , "<STR_LIT>" ) ; DataInputStream datainputstream = new DataInputStream ( new FileInputStream ( file ) ) ; try { if ( datainputstream . readLong ( ) != initializationTime ) { throw new MinecraftException ( "<STR_LIT>" ) ; } } finally { datainputstream . close ( ) ; } } catch ( IOException ioexception ) { throw new MinecraftException ( "<STR_LIT>" ) ; } } public IChunkLoader getChunkLoader ( WorldProvider par1WorldProvider ) { throw new RuntimeException ( "<STR_LIT>" ) ; } public WorldInfo loadWorldInfo ( ) { File file = new File ( worldDirectory , "<STR_LIT>" ) ; if ( file . exists ( ) ) { try { NBTTagCompound nbttagcompound = CompressedStreamTools . readCompressed ( new FileInputStream ( file ) ) ; NBTTagCompound nbttagcompound2 = nbttagcompound . getCompoundTag ( "<STR_LIT>" ) ; return new WorldInfo ( nbttagcompound2 ) ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } file = new File ( worldDirectory , "<STR_LIT>" ) ; if ( file . exists ( ) ) { try { NBTTagCompound nbttagcompound1 = CompressedStreamTools . readCompressed ( new FileInputStream ( file ) ) ; NBTTagCompound nbttagcompound3 = nbttagcompound1 . getCompoundTag ( "<STR_LIT>" ) ; return new WorldInfo ( nbttagcompound3 ) ; } catch ( Exception exception1 ) { exception1 . printStackTrace ( ) ; } } return null ; } public void saveWorldInfoAndPlayer ( WorldInfo par1WorldInfo , List par2List ) { NBTTagCompound nbttagcompound = par1WorldInfo . getNBTTagCompoundWithPlayers ( par2List ) ; NBTTagCompound nbttagcompound1 = new NBTTagCompound ( ) ; nbttagcompound1 . setTag ( "<STR_LIT>" , nbttagcompound ) ; try { File file = new File ( worldDirectory , "<STR_LIT>" ) ; File file1 = new File ( worldDirectory , "<STR_LIT>" ) ; File file2 = new File ( worldDirectory , "<STR_LIT>" ) ; CompressedStreamTools . writeCompressed ( nbttagcompound1 , new FileOutputStream ( file ) ) ; if ( file1 . exists ( ) ) { file1 . delete ( ) ; } file2 . renameTo ( file1 ) ; if ( file2 . exists ( ) ) { file2 . delete ( ) ; } file . renameTo ( file2 ) ; if ( file . exists ( ) ) { file . delete ( ) ; } } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } public void saveWorldInfo ( WorldInfo par1WorldInfo ) { NBTTagCompound nbttagcompound = par1WorldInfo . getNBTTagCompound ( ) ; NBTTagCompound nbttagcompound1 = new NBTTagCompound ( ) ; nbttagcompound1 . setTag ( "<STR_LIT>" , nbttagcompound ) ; try { File file = new File ( worldDirectory , "<STR_LIT>" ) ; File file1 = new File ( worldDirectory , "<STR_LIT>" ) ; File file2 = new File ( worldDirectory , "<STR_LIT>" ) ; CompressedStreamTools . writeCompressed ( nbttagcompound1 , new FileOutputStream ( file ) ) ; if ( file1 . exists ( ) ) { file1 . delete ( ) ; } file2 . renameTo ( file1 ) ; if ( file2 . exists ( ) ) { file2 . delete ( ) ; } file . renameTo ( file2 ) ; if ( file . exists ( ) ) { file . delete ( ) ; } } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } public void writePlayerData ( EntityPlayer par1EntityPlayer ) { try { NBTTagCompound nbttagcompound = new NBTTagCompound ( ) ; par1EntityPlayer . writeToNBT ( nbttagcompound ) ; File file = new File ( worldFile , "<STR_LIT>" ) ; File file1 = new File ( worldFile , ( new StringBuilder ( ) ) . append ( par1EntityPlayer . username ) . append ( "<STR_LIT>" ) . toString ( ) ) ; CompressedStreamTools . writeCompressed ( nbttagcompound , new FileOutputStream ( file ) ) ; if ( file1 . exists ( ) ) { file1 . delete ( ) ; } file . renameTo ( file1 ) ; } catch ( Exception exception ) { logger . warning ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1EntityPlayer . username ) . toString ( ) ) ; } } public void readPlayerData ( EntityPlayer par1EntityPlayer ) { NBTTagCompound nbttagcompound = getPlayerData ( par1EntityPlayer . username ) ; if ( nbttagcompound != null ) { par1EntityPlayer . readFromNBT ( nbttagcompound ) ; } } public NBTTagCompound getPlayerData ( String par1Str ) { try { File file = new File ( worldFile , ( new StringBuilder ( ) ) . append ( par1Str ) . append ( "<STR_LIT>" ) . toString ( ) ) ; if ( file . exists ( ) ) { return CompressedStreamTools . readCompressed ( new FileInputStream ( file ) ) ; } } catch ( Exception exception ) { logger . warning ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1Str ) . toString ( ) ) ; } return null ; } public IPlayerFileData getPlayerNBTManager ( ) { return this ; } public String [ ] func_52007_g ( ) { return worldFile . list ( ) ; } public void func_22093_e ( ) { } public File getMapFileFromName ( String par1Str ) { return new File ( mapDataDir , ( new StringBuilder ( ) ) . append ( par1Str ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } } </s>
|
<s> package net . minecraft . src ; class SlotBrewingStandPotion extends Slot { private EntityPlayer player ; final ContainerBrewingStand container ; public SlotBrewingStandPotion ( ContainerBrewingStand par1ContainerBrewingStand , EntityPlayer par2EntityPlayer , IInventory par3IInventory , int par4 , int par5 , int par6 ) { super ( par3IInventory , par4 , par5 , par6 ) ; container = par1ContainerBrewingStand ; player = par2EntityPlayer ; } public boolean isItemValid ( ItemStack par1ItemStack ) { return par1ItemStack != null && ( par1ItemStack . itemID == Item . potion . shiftedIndex || par1ItemStack . itemID == Item . glassBottle . shiftedIndex ) ; } public int getSlotStackLimit ( ) { return <NUM_LIT:1> ; } public void onPickupFromSlot ( ItemStack par1ItemStack ) { if ( par1ItemStack . itemID == Item . potion . shiftedIndex && par1ItemStack . getItemDamage ( ) > <NUM_LIT:0> ) { player . addStat ( AchievementList . potion , <NUM_LIT:1> ) ; } super . onPickupFromSlot ( par1ItemStack ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . HashMap ; import java . util . Map ; public class FurnaceRecipes { private static final FurnaceRecipes smeltingBase = new FurnaceRecipes ( ) ; private Map smeltingList ; public static final FurnaceRecipes smelting ( ) { return smeltingBase ; } private FurnaceRecipes ( ) { smeltingList = new HashMap ( ) ; addSmelting ( Block . oreIron . blockID , new ItemStack ( Item . ingotIron ) ) ; addSmelting ( Block . oreGold . blockID , new ItemStack ( Item . ingotGold ) ) ; addSmelting ( Block . oreDiamond . blockID , new ItemStack ( Item . diamond ) ) ; addSmelting ( Block . sand . blockID , new ItemStack ( Block . glass ) ) ; addSmelting ( Item . porkRaw . shiftedIndex , new ItemStack ( Item . porkCooked ) ) ; addSmelting ( Item . beefRaw . shiftedIndex , new ItemStack ( Item . beefCooked ) ) ; addSmelting ( Item . chickenRaw . shiftedIndex , new ItemStack ( Item . chickenCooked ) ) ; addSmelting ( Item . fishRaw . shiftedIndex , new ItemStack ( Item . fishCooked ) ) ; addSmelting ( Block . cobblestone . blockID , new ItemStack ( Block . stone ) ) ; addSmelting ( Item . clay . shiftedIndex , new ItemStack ( Item . brick ) ) ; addSmelting ( Block . cactus . blockID , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:2> ) ) ; addSmelting ( Block . wood . blockID , new ItemStack ( Item . coal , <NUM_LIT:1> , <NUM_LIT:1> ) ) ; addSmelting ( Block . oreCoal . blockID , new ItemStack ( Item . coal ) ) ; addSmelting ( Block . oreRedstone . blockID , new ItemStack ( Item . redstone ) ) ; addSmelting ( Block . oreLapis . blockID , new ItemStack ( Item . dyePowder , <NUM_LIT:1> , <NUM_LIT:4> ) ) ; } public void addSmelting ( int par1 , ItemStack par2ItemStack ) { smeltingList . put ( Integer . valueOf ( par1 ) , par2ItemStack ) ; } public ItemStack getSmeltingResult ( int par1 ) { return ( ItemStack ) smeltingList . get ( Integer . valueOf ( par1 ) ) ; } public Map getSmeltingList ( ) { return smeltingList ; } } </s>
|
<s> package net . minecraft . src ; public class EnchantmentFireAspect extends Enchantment { protected EnchantmentFireAspect ( int par1 , int par2 ) { super ( par1 , par2 , EnumEnchantmentType . weapon ) ; setName ( "<STR_LIT>" ) ; } public int getMinEnchantability ( int par1 ) { return <NUM_LIT:10> + <NUM_LIT:20> * ( par1 - <NUM_LIT:1> ) ; } public int getMaxEnchantability ( int par1 ) { return super . getMinEnchantability ( par1 ) + <NUM_LIT> ; } public int getMaxLevel ( ) { return <NUM_LIT:2> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockNetherStalk extends BlockFlower { protected BlockNetherStalk ( int par1 ) { super ( par1 , <NUM_LIT> ) ; setTickRandomly ( true ) ; float f = <NUM_LIT> ; setBlockBounds ( <NUM_LIT> - f , <NUM_LIT> , <NUM_LIT> - f , <NUM_LIT> + f , <NUM_LIT> , <NUM_LIT> + f ) ; } protected boolean canThisPlantGrowOnThisBlockID ( int par1 ) { return par1 == Block . slowSand . blockID ; } public boolean canBlockStay ( World par1World , int par2 , int par3 , int par4 ) { return canThisPlantGrowOnThisBlockID ( par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) ) ; } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( i < <NUM_LIT:3> ) { BiomeGenBase biomegenbase = par1World . getBiomeGenForCoords ( par2 , par4 ) ; if ( ( biomegenbase instanceof BiomeGenHell ) && par5Random . nextInt ( <NUM_LIT:10> ) == <NUM_LIT:0> ) { i ++ ; par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i ) ; } } super . updateTick ( par1World , par2 , par3 , par4 , par5Random ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par2 >= <NUM_LIT:3> ) { return blockIndexInTexture + <NUM_LIT:2> ; } if ( par2 > <NUM_LIT:0> ) { return blockIndexInTexture + <NUM_LIT:1> ; } else { return blockIndexInTexture ; } } public int getRenderType ( ) { return <NUM_LIT:6> ; } public void dropBlockAsItemWithChance ( World par1World , int par2 , int par3 , int par4 , int par5 , float par6 , int par7 ) { if ( par1World . isRemote ) { return ; } int i = <NUM_LIT:1> ; if ( par5 >= <NUM_LIT:3> ) { i = <NUM_LIT:2> + par1World . rand . nextInt ( <NUM_LIT:3> ) ; if ( par7 > <NUM_LIT:0> ) { i += par1World . rand . nextInt ( par7 + <NUM_LIT:1> ) ; } } for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { dropBlockAsItem_do ( par1World , par2 , par3 , par4 , new ItemStack ( Item . netherStalkSeeds ) ) ; } } public int idDropped ( int par1 , Random par2Random , int par3 ) { return <NUM_LIT:0> ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:0> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenHellLava extends WorldGenerator { private int hellLavaID ; public WorldGenHellLava ( int par1 ) { hellLavaID = par1 ; } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { if ( par1World . getBlockId ( par3 , par4 + <NUM_LIT:1> , par5 ) != Block . netherrack . blockID ) { return false ; } if ( par1World . getBlockId ( par3 , par4 , par5 ) != <NUM_LIT:0> && par1World . getBlockId ( par3 , par4 , par5 ) != Block . netherrack . blockID ) { return false ; } int i = <NUM_LIT:0> ; if ( par1World . getBlockId ( par3 - <NUM_LIT:1> , par4 , par5 ) == Block . netherrack . blockID ) { i ++ ; } if ( par1World . getBlockId ( par3 + <NUM_LIT:1> , par4 , par5 ) == Block . netherrack . blockID ) { i ++ ; } if ( par1World . getBlockId ( par3 , par4 , par5 - <NUM_LIT:1> ) == Block . netherrack . blockID ) { i ++ ; } if ( par1World . getBlockId ( par3 , par4 , par5 + <NUM_LIT:1> ) == Block . netherrack . blockID ) { i ++ ; } if ( par1World . getBlockId ( par3 , par4 - <NUM_LIT:1> , par5 ) == Block . netherrack . blockID ) { i ++ ; } int j = <NUM_LIT:0> ; if ( par1World . isAirBlock ( par3 - <NUM_LIT:1> , par4 , par5 ) ) { j ++ ; } if ( par1World . isAirBlock ( par3 + <NUM_LIT:1> , par4 , par5 ) ) { j ++ ; } if ( par1World . isAirBlock ( par3 , par4 , par5 - <NUM_LIT:1> ) ) { j ++ ; } if ( par1World . isAirBlock ( par3 , par4 , par5 + <NUM_LIT:1> ) ) { j ++ ; } if ( par1World . isAirBlock ( par3 , par4 - <NUM_LIT:1> , par5 ) ) { j ++ ; } if ( i == <NUM_LIT:4> && j == <NUM_LIT:1> ) { par1World . setBlockWithNotify ( par3 , par4 , par5 , hellLavaID ) ; par1World . scheduledUpdatesAreImmediate = true ; Block . blocksList [ hellLavaID ] . updateTick ( par1World , par3 , par4 , par5 , par2Random ) ; par1World . scheduledUpdatesAreImmediate = false ; } return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockGrass extends Block { protected BlockGrass ( int par1 ) { super ( par1 , Material . grass ) ; blockIndexInTexture = <NUM_LIT:3> ; setTickRandomly ( true ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par1 == <NUM_LIT:1> ) { return <NUM_LIT:0> ; } return par1 != <NUM_LIT:0> ? <NUM_LIT:3> : <NUM_LIT:2> ; } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { if ( par1World . isRemote ) { return ; } if ( par1World . getBlockLightValue ( par2 , par3 + <NUM_LIT:1> , par4 ) < <NUM_LIT:4> && Block . lightOpacity [ par1World . getBlockId ( par2 , par3 + <NUM_LIT:1> , par4 ) ] > <NUM_LIT:2> ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , Block . dirt . blockID ) ; } else if ( par1World . getBlockLightValue ( par2 , par3 + <NUM_LIT:1> , par4 ) >= <NUM_LIT:9> ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:4> ; i ++ ) { int j = ( par2 + par5Random . nextInt ( <NUM_LIT:3> ) ) - <NUM_LIT:1> ; int k = ( par3 + par5Random . nextInt ( <NUM_LIT:5> ) ) - <NUM_LIT:3> ; int l = ( par4 + par5Random . nextInt ( <NUM_LIT:3> ) ) - <NUM_LIT:1> ; int i1 = par1World . getBlockId ( j , k + <NUM_LIT:1> , l ) ; if ( par1World . getBlockId ( j , k , l ) == Block . dirt . blockID && par1World . getBlockLightValue ( j , k + <NUM_LIT:1> , l ) >= <NUM_LIT:4> && Block . lightOpacity [ i1 ] <= <NUM_LIT:2> ) { par1World . setBlockWithNotify ( j , k , l , Block . grass . 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 StatCollector { private static StringTranslate localizedName = StringTranslate . getInstance ( ) ; public StatCollector ( ) { } public static String translateToLocal ( String par0Str ) { return localizedName . translateKey ( par0Str ) ; } public static String translateToLocalFormatted ( String par0Str , Object par1ArrayOfObj [ ] ) { return localizedName . translateKeyFormat ( par0Str , par1ArrayOfObj ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . ArrayList ; import java . util . Iterator ; public class AnvilSaveConverter extends SaveFormatOld { public AnvilSaveConverter ( File par1File ) { super ( par1File ) ; } protected int func_48495_a ( ) { return <NUM_LIT> ; } public ISaveHandler getSaveLoader ( String par1Str , boolean par2 ) { return new AnvilSaveHandler ( savesDirectory , par1Str , par2 ) ; } public boolean isOldMapFormat ( String par1Str ) { WorldInfo worldinfo = getWorldInfo ( par1Str ) ; return worldinfo != null && worldinfo . getSaveVersion ( ) != func_48495_a ( ) ; } public boolean convertMapFormat ( String par1Str , IProgressUpdate par2IProgressUpdate ) { par2IProgressUpdate . setLoadingProgress ( <NUM_LIT:0> ) ; ArrayList arraylist = new ArrayList ( ) ; ArrayList arraylist1 = new ArrayList ( ) ; ArrayList arraylist2 = new ArrayList ( ) ; File file = new File ( savesDirectory , par1Str ) ; File file1 = new File ( file , "<STR_LIT>" ) ; File file2 = new File ( file , "<STR_LIT>" ) ; System . out . println ( "<STR_LIT>" ) ; func_48499_a ( file , arraylist ) ; if ( file1 . exists ( ) ) { func_48499_a ( file1 , arraylist1 ) ; } if ( file2 . exists ( ) ) { func_48499_a ( file2 , arraylist2 ) ; } int i = arraylist . size ( ) + arraylist1 . size ( ) + arraylist2 . size ( ) ; System . out . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( i ) . toString ( ) ) ; WorldInfo worldinfo = getWorldInfo ( par1Str ) ; Object obj = null ; if ( worldinfo . getTerrainType ( ) == WorldType . FLAT ) { obj = new WorldChunkManagerHell ( BiomeGenBase . plains , <NUM_LIT> , <NUM_LIT> ) ; } else { obj = new WorldChunkManager ( worldinfo . getSeed ( ) , worldinfo . getTerrainType ( ) ) ; } func_48497_a ( new File ( file , "<STR_LIT>" ) , arraylist , ( ( WorldChunkManager ) ( obj ) ) , <NUM_LIT:0> , i , par2IProgressUpdate ) ; func_48497_a ( new File ( file1 , "<STR_LIT>" ) , arraylist1 , new WorldChunkManagerHell ( BiomeGenBase . hell , <NUM_LIT> , <NUM_LIT> ) , arraylist . size ( ) , i , par2IProgressUpdate ) ; func_48497_a ( new File ( file2 , "<STR_LIT>" ) , arraylist2 , new WorldChunkManagerHell ( BiomeGenBase . sky , <NUM_LIT> , <NUM_LIT> ) , arraylist . size ( ) + arraylist1 . size ( ) , i , par2IProgressUpdate ) ; worldinfo . setSaveVersion ( <NUM_LIT> ) ; if ( worldinfo . getTerrainType ( ) == WorldType . DEFAULT_1_1 ) { worldinfo . setTerrainType ( WorldType . DEFAULT ) ; } func_48498_c ( par1Str ) ; ISaveHandler isavehandler = getSaveLoader ( par1Str , false ) ; isavehandler . saveWorldInfo ( worldinfo ) ; return true ; } private void func_48498_c ( String par1Str ) { File file = new File ( savesDirectory , par1Str ) ; if ( ! file . exists ( ) ) { System . out . println ( "<STR_LIT>" ) ; return ; } File file1 = new File ( file , "<STR_LIT>" ) ; if ( ! file1 . exists ( ) ) { System . out . println ( "<STR_LIT>" ) ; return ; } File file2 = new File ( file , "<STR_LIT>" ) ; if ( ! file1 . renameTo ( file2 ) ) { System . out . println ( "<STR_LIT>" ) ; } } private void func_48497_a ( File par1File , ArrayList par2ArrayList , WorldChunkManager par3WorldChunkManager , int par4 , int par5 , IProgressUpdate par6IProgressUpdate ) { int i ; for ( Iterator iterator = par2ArrayList . iterator ( ) ; iterator . hasNext ( ) ; par6IProgressUpdate . setLoadingProgress ( i ) ) { File file = ( File ) iterator . next ( ) ; func_48496_a ( par1File , file , par3WorldChunkManager , par4 , par5 , par6IProgressUpdate ) ; par4 ++ ; i = ( int ) Math . round ( ( <NUM_LIT> * ( double ) par4 ) / ( double ) par5 ) ; } } private void func_48496_a ( File par1File , File par2File , WorldChunkManager par3WorldChunkManager , int par4 , int par5 , IProgressUpdate par6IProgressUpdate ) { try { String s = par2File . getName ( ) ; RegionFile regionfile = new RegionFile ( par2File ) ; RegionFile regionfile1 = new RegionFile ( new File ( par1File , ( new StringBuilder ( ) ) . append ( s . substring ( <NUM_LIT:0> , s . length ( ) - "<STR_LIT>" . length ( ) ) ) . append ( "<STR_LIT>" ) . toString ( ) ) ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:32> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:32> ; j ++ ) { if ( ! regionfile . isChunkSaved ( i , j ) || regionfile1 . isChunkSaved ( i , j ) ) { continue ; } DataInputStream datainputstream = regionfile . getChunkDataInputStream ( i , j ) ; if ( datainputstream == null ) { System . out . println ( "<STR_LIT>" ) ; } else { NBTTagCompound nbttagcompound = CompressedStreamTools . read ( datainputstream ) ; datainputstream . close ( ) ; NBTTagCompound nbttagcompound1 = nbttagcompound . getCompoundTag ( "<STR_LIT>" ) ; AnvilConverterData anvilconverterdata = ChunkLoader . load ( nbttagcompound1 ) ; NBTTagCompound nbttagcompound2 = new NBTTagCompound ( ) ; NBTTagCompound nbttagcompound3 = new NBTTagCompound ( ) ; nbttagcompound2 . setTag ( "<STR_LIT>" , nbttagcompound3 ) ; ChunkLoader . convertToAnvilFormat ( anvilconverterdata , nbttagcompound3 , par3WorldChunkManager ) ; DataOutputStream dataoutputstream = regionfile1 . getChunkDataOutputStream ( i , j ) ; CompressedStreamTools . write ( nbttagcompound2 , dataoutputstream ) ; dataoutputstream . close ( ) ; } } int k = ( int ) Math . round ( ( <NUM_LIT> * ( double ) ( par4 * <NUM_LIT> ) ) / ( double ) ( par5 * <NUM_LIT> ) ) ; int l = ( int ) Math . round ( ( <NUM_LIT> * ( double ) ( ( i + <NUM_LIT:1> ) * <NUM_LIT:32> + par4 * <NUM_LIT> ) ) / ( double ) ( par5 * <NUM_LIT> ) ) ; if ( l > k ) { par6IProgressUpdate . setLoadingProgress ( l ) ; } } regionfile . close ( ) ; regionfile1 . close ( ) ; } catch ( IOException ioexception ) { ioexception . printStackTrace ( ) ; } } private void func_48499_a ( File par1File , ArrayList par2ArrayList ) { File file = new File ( par1File , "<STR_LIT>" ) ; File afile [ ] = file . listFiles ( new AnvilSaveConverterFileFilter ( this ) ) ; if ( afile != null ) { File afile1 [ ] = afile ; int i = afile1 . length ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { File file1 = afile1 [ j ] ; par2ArrayList . add ( file1 ) ; } } } } </s>
|
<s> package net . minecraft . src ; import java . util . HashMap ; import java . util . Map ; public class PacketCount { public static boolean allowCounting = true ; private static final Map packetCountForID = new HashMap ( ) ; private static final Map sizeCountForID = new HashMap ( ) ; private static final Object lock = new Object ( ) ; public PacketCount ( ) { } public static void countPacket ( int par0 , long par1 ) { if ( ! allowCounting ) { return ; } synchronized ( lock ) { if ( packetCountForID . containsKey ( Integer . valueOf ( par0 ) ) ) { packetCountForID . put ( Integer . valueOf ( par0 ) , Long . valueOf ( ( ( Long ) packetCountForID . get ( Integer . valueOf ( par0 ) ) ) . longValue ( ) + <NUM_LIT:1L> ) ) ; sizeCountForID . put ( Integer . valueOf ( par0 ) , Long . valueOf ( ( ( Long ) sizeCountForID . get ( Integer . valueOf ( par0 ) ) ) . longValue ( ) + par1 ) ) ; } else { packetCountForID . put ( Integer . valueOf ( par0 ) , Long . valueOf ( <NUM_LIT:1L> ) ) ; sizeCountForID . put ( Integer . valueOf ( par0 ) , Long . valueOf ( par1 ) ) ; } } } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public abstract class Container { public List inventoryItemStacks ; public List inventorySlots ; public int windowId ; private short transactionID ; protected List crafters ; private Set field_20131_b ; public Container ( ) { inventoryItemStacks = new ArrayList ( ) ; inventorySlots = new ArrayList ( ) ; windowId = <NUM_LIT:0> ; transactionID = <NUM_LIT:0> ; crafters = new ArrayList ( ) ; field_20131_b = new HashSet ( ) ; } protected void addSlot ( Slot par1Slot ) { par1Slot . slotNumber = inventorySlots . size ( ) ; inventorySlots . add ( par1Slot ) ; inventoryItemStacks . add ( null ) ; } public void onCraftGuiOpened ( ICrafting par1ICrafting ) { if ( crafters . contains ( par1ICrafting ) ) { throw new IllegalArgumentException ( "<STR_LIT>" ) ; } else { crafters . add ( par1ICrafting ) ; par1ICrafting . updateCraftingInventory ( this , func_28127_b ( ) ) ; updateCraftingResults ( ) ; return ; } } public List func_28127_b ( ) { ArrayList arraylist = new ArrayList ( ) ; for ( int i = <NUM_LIT:0> ; i < inventorySlots . size ( ) ; i ++ ) { arraylist . add ( ( ( Slot ) inventorySlots . get ( i ) ) . getStack ( ) ) ; } return arraylist ; } public void updateCraftingResults ( ) { for ( int i = <NUM_LIT:0> ; i < inventorySlots . size ( ) ; i ++ ) { ItemStack itemstack = ( ( Slot ) inventorySlots . get ( i ) ) . getStack ( ) ; ItemStack itemstack1 = ( ItemStack ) inventoryItemStacks . get ( i ) ; if ( ItemStack . areItemStacksEqual ( itemstack1 , itemstack ) ) { continue ; } itemstack1 = itemstack != null ? itemstack . copy ( ) : null ; inventoryItemStacks . set ( i , itemstack1 ) ; for ( int j = <NUM_LIT:0> ; j < crafters . size ( ) ; j ++ ) { ( ( ICrafting ) crafters . get ( j ) ) . updateCraftingInventorySlot ( this , i , itemstack1 ) ; } } } public boolean enchantItem ( EntityPlayer par1EntityPlayer , int par2 ) { return false ; } public Slot func_20127_a ( IInventory par1IInventory , int par2 ) { for ( int i = <NUM_LIT:0> ; i < inventorySlots . size ( ) ; i ++ ) { Slot slot = ( Slot ) inventorySlots . get ( i ) ; if ( slot . isHere ( par1IInventory , par2 ) ) { return slot ; } } return null ; } public Slot getSlot ( int par1 ) { return ( Slot ) inventorySlots . get ( par1 ) ; } public ItemStack transferStackInSlot ( int par1 ) { Slot slot = ( Slot ) inventorySlots . get ( par1 ) ; if ( slot != null ) { return slot . getStack ( ) ; } else { return null ; } } public ItemStack slotClick ( int par1 , int par2 , boolean par3 , EntityPlayer par4EntityPlayer ) { ItemStack itemstack = null ; if ( par2 > <NUM_LIT:1> ) { return null ; } if ( par2 == <NUM_LIT:0> || par2 == <NUM_LIT:1> ) { InventoryPlayer inventoryplayer = par4EntityPlayer . inventory ; if ( par1 == - <NUM_LIT> ) { if ( inventoryplayer . getItemStack ( ) != null && par1 == - <NUM_LIT> ) { if ( par2 == <NUM_LIT:0> ) { par4EntityPlayer . dropPlayerItem ( inventoryplayer . getItemStack ( ) ) ; inventoryplayer . setItemStack ( null ) ; } if ( par2 == <NUM_LIT:1> ) { par4EntityPlayer . dropPlayerItem ( inventoryplayer . getItemStack ( ) . splitStack ( <NUM_LIT:1> ) ) ; if ( inventoryplayer . getItemStack ( ) . stackSize == <NUM_LIT:0> ) { inventoryplayer . setItemStack ( null ) ; } } } } else if ( par3 ) { ItemStack itemstack1 = transferStackInSlot ( par1 ) ; if ( itemstack1 != null ) { int i = itemstack1 . itemID ; itemstack = itemstack1 . copy ( ) ; Slot slot1 = ( Slot ) inventorySlots . get ( par1 ) ; if ( slot1 != null && slot1 . getStack ( ) != null && slot1 . getStack ( ) . itemID == i ) { retrySlotClick ( par1 , par2 , par3 , par4EntityPlayer ) ; } } } else { if ( par1 < <NUM_LIT:0> ) { return null ; } Slot slot = ( Slot ) inventorySlots . get ( par1 ) ; if ( slot != null ) { slot . onSlotChanged ( ) ; ItemStack itemstack2 = slot . getStack ( ) ; ItemStack itemstack4 = inventoryplayer . getItemStack ( ) ; if ( itemstack2 != null ) { itemstack = itemstack2 . copy ( ) ; } if ( itemstack2 == null ) { if ( itemstack4 != null && slot . isItemValid ( itemstack4 ) ) { int j = par2 != <NUM_LIT:0> ? <NUM_LIT:1> : itemstack4 . stackSize ; if ( j > slot . getSlotStackLimit ( ) ) { j = slot . getSlotStackLimit ( ) ; } slot . putStack ( itemstack4 . splitStack ( j ) ) ; if ( itemstack4 . stackSize == <NUM_LIT:0> ) { inventoryplayer . setItemStack ( null ) ; } } } else if ( itemstack4 == null ) { int k = par2 != <NUM_LIT:0> ? ( itemstack2 . stackSize + <NUM_LIT:1> ) / <NUM_LIT:2> : itemstack2 . stackSize ; ItemStack itemstack6 = slot . decrStackSize ( k ) ; inventoryplayer . setItemStack ( itemstack6 ) ; if ( itemstack2 . stackSize == <NUM_LIT:0> ) { slot . putStack ( null ) ; } slot . onPickupFromSlot ( inventoryplayer . getItemStack ( ) ) ; } else if ( slot . isItemValid ( itemstack4 ) ) { if ( itemstack2 . itemID != itemstack4 . itemID || itemstack2 . getHasSubtypes ( ) && itemstack2 . getItemDamage ( ) != itemstack4 . getItemDamage ( ) || ! ItemStack . func_46124_a ( itemstack2 , itemstack4 ) ) { if ( itemstack4 . stackSize <= slot . getSlotStackLimit ( ) ) { ItemStack itemstack5 = itemstack2 ; slot . putStack ( itemstack4 ) ; inventoryplayer . setItemStack ( itemstack5 ) ; } } else { int l = par2 != <NUM_LIT:0> ? <NUM_LIT:1> : itemstack4 . stackSize ; if ( l > slot . getSlotStackLimit ( ) - itemstack2 . stackSize ) { l = slot . getSlotStackLimit ( ) - itemstack2 . stackSize ; } if ( l > itemstack4 . getMaxStackSize ( ) - itemstack2 . stackSize ) { l = itemstack4 . getMaxStackSize ( ) - itemstack2 . stackSize ; } itemstack4 . splitStack ( l ) ; if ( itemstack4 . stackSize == <NUM_LIT:0> ) { inventoryplayer . setItemStack ( null ) ; } itemstack2 . stackSize += l ; } } else if ( itemstack2 . itemID == itemstack4 . itemID && itemstack4 . getMaxStackSize ( ) > <NUM_LIT:1> && ( ! itemstack2 . getHasSubtypes ( ) || itemstack2 . getItemDamage ( ) == itemstack4 . getItemDamage ( ) ) && ItemStack . func_46124_a ( itemstack2 , itemstack4 ) ) { int i1 = itemstack2 . stackSize ; if ( i1 > <NUM_LIT:0> && i1 + itemstack4 . stackSize <= itemstack4 . getMaxStackSize ( ) ) { itemstack4 . stackSize += i1 ; ItemStack itemstack3 = slot . decrStackSize ( i1 ) ; if ( itemstack3 . stackSize == <NUM_LIT:0> ) { slot . putStack ( null ) ; } slot . onPickupFromSlot ( inventoryplayer . getItemStack ( ) ) ; } } } } } return itemstack ; } protected void retrySlotClick ( int par1 , int par2 , boolean par3 , EntityPlayer par4EntityPlayer ) { slotClick ( par1 , par2 , par3 , par4EntityPlayer ) ; } public void onCraftGuiClosed ( EntityPlayer par1EntityPlayer ) { InventoryPlayer inventoryplayer = par1EntityPlayer . inventory ; if ( inventoryplayer . getItemStack ( ) != null ) { par1EntityPlayer . dropPlayerItem ( inventoryplayer . getItemStack ( ) ) ; inventoryplayer . setItemStack ( null ) ; } } public void onCraftMatrixChanged ( IInventory par1IInventory ) { updateCraftingResults ( ) ; } public void putStackInSlot ( int par1 , ItemStack par2ItemStack ) { getSlot ( par1 ) . putStack ( par2ItemStack ) ; } public boolean getCanCraft ( EntityPlayer par1EntityPlayer ) { return ! field_20131_b . contains ( par1EntityPlayer ) ; } public void setCanCraft ( EntityPlayer par1EntityPlayer , boolean par2 ) { if ( par2 ) { field_20131_b . remove ( par1EntityPlayer ) ; } else { field_20131_b . add ( par1EntityPlayer ) ; } } public abstract boolean canInteractWith ( EntityPlayer entityplayer ) ; protected boolean mergeItemStack ( ItemStack par1ItemStack , int par2 , int par3 , boolean par4 ) { boolean flag = false ; int i = par2 ; if ( par4 ) { i = par3 - <NUM_LIT:1> ; } if ( par1ItemStack . isStackable ( ) ) { while ( par1ItemStack . stackSize > <NUM_LIT:0> && ( ! par4 && i < par3 || par4 && i >= par2 ) ) { Slot slot = ( Slot ) inventorySlots . get ( i ) ; ItemStack itemstack = slot . getStack ( ) ; if ( itemstack != null && itemstack . itemID == par1ItemStack . itemID && ( ! par1ItemStack . getHasSubtypes ( ) || par1ItemStack . getItemDamage ( ) == itemstack . getItemDamage ( ) ) && ItemStack . func_46124_a ( par1ItemStack , itemstack ) ) { int k = itemstack . stackSize + par1ItemStack . stackSize ; if ( k <= par1ItemStack . getMaxStackSize ( ) ) { par1ItemStack . stackSize = <NUM_LIT:0> ; itemstack . stackSize = k ; slot . onSlotChanged ( ) ; flag = true ; } else if ( itemstack . stackSize < par1ItemStack . getMaxStackSize ( ) ) { par1ItemStack . stackSize -= par1ItemStack . getMaxStackSize ( ) - itemstack . stackSize ; itemstack . stackSize = par1ItemStack . getMaxStackSize ( ) ; slot . onSlotChanged ( ) ; flag = true ; } } if ( par4 ) { i -- ; } else { i ++ ; } } } if ( par1ItemStack . stackSize > <NUM_LIT:0> ) { int j ; if ( par4 ) { j = par3 - <NUM_LIT:1> ; } else { j = par2 ; } do { if ( ( par4 || j >= par3 ) && ( ! par4 || j < par2 ) ) { break ; } Slot slot1 = ( Slot ) inventorySlots . get ( j ) ; ItemStack itemstack1 = slot1 . getStack ( ) ; if ( itemstack1 == null ) { slot1 . putStack ( par1ItemStack . copy ( ) ) ; slot1 . onSlotChanged ( ) ; par1ItemStack . stackSize = <NUM_LIT:0> ; flag = true ; break ; } if ( par4 ) { j -- ; } else { j ++ ; } } while ( true ) ; } return flag ; } } </s>
|
<s> package net . minecraft . src ; public class BiomeGenSnow extends BiomeGenBase { public BiomeGenSnow ( int par1 ) { super ( par1 ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenCactus extends WorldGenerator { public WorldGenCactus ( ) { } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:10> ; 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 ) ) { continue ; } int i1 = <NUM_LIT:1> + par2Random . nextInt ( par2Random . nextInt ( <NUM_LIT:3> ) + <NUM_LIT:1> ) ; for ( int j1 = <NUM_LIT:0> ; j1 < i1 ; j1 ++ ) { if ( Block . cactus . canBlockStay ( par1World , j , k + j1 , l ) ) { par1World . setBlock ( j , k + j1 , l , Block . cactus . blockID ) ; } } } return true ; } } </s>
|
<s> package net . minecraft . src ; import net . minecraft . server . MinecraftServer ; public class WorldManager implements IWorldAccess { private MinecraftServer mcServer ; private WorldServer world ; public WorldManager ( MinecraftServer par1MinecraftServer , WorldServer par2WorldServer ) { mcServer = par1MinecraftServer ; world = par2WorldServer ; } public void spawnParticle ( String s , double d , double d1 , double d2 , double d3 , double d4 , double d5 ) { } public void obtainEntitySkin ( Entity par1Entity ) { mcServer . getEntityTracker ( world . worldProvider . worldType ) . trackEntity ( par1Entity ) ; } public void releaseEntitySkin ( Entity par1Entity ) { mcServer . getEntityTracker ( world . worldProvider . worldType ) . untrackEntity ( par1Entity ) ; } public void playSound ( String s , double d , double d1 , double d2 , float f , float f1 ) { } public void markBlockRangeNeedsUpdate ( int i , int j , int k , int l , int i1 , int j1 ) { } public void markBlockNeedsUpdate ( int par1 , int par2 , int par3 ) { mcServer . configManager . markBlockNeedsUpdate ( par1 , par2 , par3 , world . worldProvider . worldType ) ; } public void markBlockNeedsUpdate2 ( int i , int j , int k ) { } public void playRecord ( String s , int i , int j , int k ) { } public void doNothingWithTileEntity ( int par1 , int par2 , int par3 , TileEntity par4TileEntity ) { mcServer . configManager . sentTileEntityToPlayer ( par1 , par2 , par3 , par4TileEntity ) ; } public void playAuxSFX ( EntityPlayer par1EntityPlayer , int par2 , int par3 , int par4 , int par5 , int par6 ) { mcServer . configManager . func_28171_a ( par1EntityPlayer , par3 , par4 , par5 , <NUM_LIT> , world . worldProvider . worldType , new Packet61DoorChange ( par2 , par3 , par4 , par5 , par6 ) ) ; } } </s>
|
<s> package net . minecraft . src ; public interface IWorldAccess { public abstract void markBlockNeedsUpdate ( int i , int j , int k ) ; public abstract void markBlockNeedsUpdate2 ( int i , int j , int k ) ; public abstract void markBlockRangeNeedsUpdate ( int i , int j , int k , int l , int i1 , int j1 ) ; public abstract void playSound ( String s , double d , double d1 , double d2 , float f , float f1 ) ; public abstract void spawnParticle ( String s , double d , double d1 , double d2 , double d3 , double d4 , double d5 ) ; public abstract void obtainEntitySkin ( Entity entity ) ; public abstract void releaseEntitySkin ( Entity entity ) ; public abstract void playRecord ( String s , int i , int j , int k ) ; public abstract void doNothingWithTileEntity ( int i , int j , int k , TileEntity tileentity ) ; public abstract void playAuxSFX ( EntityPlayer entityplayer , int i , int j , int k , int l , int i1 ) ; } </s>
|
<s> package net . minecraft . src ; public class EntityAIMoveTwardsRestriction extends EntityAIBase { private EntityCreature theEntity ; private double movePosX ; private double movePosY ; private double movePosZ ; private float field_48149_e ; public EntityAIMoveTwardsRestriction ( EntityCreature par1EntityCreature , float par2 ) { theEntity = par1EntityCreature ; field_48149_e = par2 ; setMutexBits ( <NUM_LIT:1> ) ; } public boolean shouldExecute ( ) { if ( theEntity . isWithinHomeDistanceCurrentPosition ( ) ) { return false ; } ChunkCoordinates chunkcoordinates = theEntity . getHomePosition ( ) ; Vec3D vec3d = RandomPositionGenerator . func_48395_a ( theEntity , <NUM_LIT:16> , <NUM_LIT:7> , Vec3D . createVector ( chunkcoordinates . posX , chunkcoordinates . posY , chunkcoordinates . posZ ) ) ; if ( vec3d == null ) { return false ; } else { movePosX = vec3d . xCoord ; movePosY = vec3d . yCoord ; movePosZ = vec3d . zCoord ; return true ; } } public boolean continueExecuting ( ) { return ! theEntity . getNavigator ( ) . noPath ( ) ; } public void startExecuting ( ) { theEntity . getNavigator ( ) . func_48658_a ( movePosX , movePosY , movePosZ , field_48149_e ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntityIronGolem extends EntityGolem { private int field_48385_b ; Village villageObj ; private int field_48386_c ; private int field_48384_g ; public EntityIronGolem ( World par1World ) { super ( par1World ) ; field_48385_b = <NUM_LIT:0> ; villageObj = null ; texture = "<STR_LIT>" ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; getNavigator ( ) . func_48656_a ( true ) ; tasks . addTask ( <NUM_LIT:1> , new EntityAIAttackOnCollide ( this , <NUM_LIT> , true ) ) ; tasks . addTask ( <NUM_LIT:2> , new EntityAIMoveTowardsTarget ( this , <NUM_LIT> , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:3> , new EntityAIMoveThroughVillage ( this , <NUM_LIT> , true ) ) ; tasks . addTask ( <NUM_LIT:4> , new EntityAIMoveTwardsRestriction ( this , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:5> , new EntityAILookAtVillager ( this ) ) ; tasks . addTask ( <NUM_LIT:6> , new EntityAIWander ( this , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:7> , new EntityAIWatchClosest ( this , net . minecraft . src . EntityPlayer . class , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:8> , new EntityAILookIdle ( this ) ) ; targetTasks . addTask ( <NUM_LIT:1> , new EntityAIDefendVillage ( this ) ) ; targetTasks . addTask ( <NUM_LIT:2> , new EntityAIHurtByTarget ( this , false ) ) ; targetTasks . addTask ( <NUM_LIT:3> , new EntityAINearestAttackableTarget ( this , net . minecraft . src . EntityMob . class , <NUM_LIT> , <NUM_LIT:0> , false , true ) ) ; } protected void entityInit ( ) { super . entityInit ( ) ; dataWatcher . addObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) <NUM_LIT:0> ) ) ; } public boolean isAIEnabled ( ) { return true ; } protected void updateAITick ( ) { if ( -- field_48385_b <= <NUM_LIT:0> ) { field_48385_b = <NUM_LIT> + rand . nextInt ( <NUM_LIT> ) ; villageObj = worldObj . villageCollectionObj . findNearestVillage ( MathHelper . floor_double ( posX ) , MathHelper . floor_double ( posY ) , MathHelper . floor_double ( posZ ) , <NUM_LIT:32> ) ; if ( villageObj == null ) { detachHome ( ) ; } else { ChunkCoordinates chunkcoordinates = villageObj . getCenter ( ) ; setHomeArea ( chunkcoordinates . posX , chunkcoordinates . posY , chunkcoordinates . posZ , villageObj . getVillageRadius ( ) ) ; } } super . updateAITick ( ) ; } public int getMaxHealth ( ) { return <NUM_LIT:100> ; } protected int decreaseAirSupply ( int par1 ) { return par1 ; } public void onLivingUpdate ( ) { super . onLivingUpdate ( ) ; if ( field_48386_c > <NUM_LIT:0> ) { field_48386_c -- ; } if ( field_48384_g > <NUM_LIT:0> ) { field_48384_g -- ; } if ( motionX * motionX + motionZ * motionZ > <NUM_LIT> && rand . nextInt ( <NUM_LIT:5> ) == <NUM_LIT:0> ) { int i = MathHelper . floor_double ( posX ) ; int j = MathHelper . floor_double ( posY - <NUM_LIT> - ( double ) yOffset ) ; int k = MathHelper . floor_double ( posZ ) ; int l = worldObj . getBlockId ( i , j , k ) ; if ( l > <NUM_LIT:0> ) { worldObj . spawnParticle ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( l ) . toString ( ) , posX + ( ( double ) rand . nextFloat ( ) - <NUM_LIT> ) * ( double ) width , boundingBox . minY + <NUM_LIT> , posZ + ( ( double ) rand . nextFloat ( ) - <NUM_LIT> ) * ( double ) width , <NUM_LIT> * ( ( double ) rand . nextFloat ( ) - <NUM_LIT> ) , <NUM_LIT> , ( ( double ) rand . nextFloat ( ) - <NUM_LIT> ) * <NUM_LIT> ) ; } } } public boolean func_48336_a ( Class par1Class ) { if ( func_48379_n_ ( ) && ( net . minecraft . src . EntityPlayer . class ) . isAssignableFrom ( par1Class ) ) { return false ; } else { return super . func_48336_a ( par1Class ) ; } } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setBoolean ( "<STR_LIT>" , func_48379_n_ ( ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; func_48381_b ( par1NBTTagCompound . getBoolean ( "<STR_LIT>" ) ) ; } public boolean attackEntityAsMob ( Entity par1Entity ) { field_48386_c = <NUM_LIT:10> ; worldObj . setEntityState ( this , ( byte ) <NUM_LIT:4> ) ; boolean flag = par1Entity . attackEntityFrom ( DamageSource . causeMobDamage ( this ) , <NUM_LIT:7> + rand . nextInt ( <NUM_LIT:15> ) ) ; if ( flag ) { par1Entity . motionY += <NUM_LIT> ; } worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; return flag ; } public Village getVillage ( ) { return villageObj ; } public void func_48383_a ( boolean par1 ) { field_48384_g = par1 ? <NUM_LIT> : <NUM_LIT:0> ; worldObj . setEntityState ( this , ( byte ) <NUM_LIT:11> ) ; } protected String getLivingSound ( ) { return "<STR_LIT:none>" ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } protected void playStepSound ( int par1 , int par2 , int par3 , int par4 ) { worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; } protected void dropFewItems ( boolean par1 , int par2 ) { int i = rand . nextInt ( <NUM_LIT:3> ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { dropItem ( Block . plantRed . blockID , <NUM_LIT:1> ) ; } int k = <NUM_LIT:3> + rand . nextInt ( <NUM_LIT:3> ) ; for ( int l = <NUM_LIT:0> ; l < k ; l ++ ) { dropItem ( Item . ingotIron . shiftedIndex , <NUM_LIT:1> ) ; } } public int func_48382_m_ ( ) { return field_48384_g ; } public boolean func_48379_n_ ( ) { return ( dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) & <NUM_LIT:1> ) != <NUM_LIT:0> ; } public void func_48381_b ( 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> ) ) ) ; } } } </s>
|
<s> package net . minecraft . src ; public interface INpc extends IAnimals { } </s>
|
<s> package net . minecraft . src ; public class WorldProviderSurface extends WorldProvider { public WorldProviderSurface ( ) { } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentStrongholdPortalRoom extends ComponentStronghold { private boolean hasSpawner ; public ComponentStrongholdPortalRoom ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { if ( par1StructureComponent != null ) { ( ( ComponentStrongholdStairs2 ) par1StructureComponent ) . portalRoom = this ; } } public static ComponentStrongholdPortalRoom findValidPlacement ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:4> , - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:11> , <NUM_LIT:8> , <NUM_LIT:16> , par5 ) ; if ( ! canStrongholdGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentStrongholdPortalRoom ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:10> , <NUM_LIT:7> , <NUM_LIT:15> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; placeDoor ( par1World , par2Random , par3StructureBoundingBox , EnumDoor . GRATES , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:0> ) ; byte byte0 = <NUM_LIT:6> ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , byte0 , <NUM_LIT:1> , <NUM_LIT:1> , byte0 , <NUM_LIT> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:9> , byte0 , <NUM_LIT:1> , <NUM_LIT:9> , byte0 , <NUM_LIT> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , byte0 , <NUM_LIT:1> , <NUM_LIT:8> , byte0 , <NUM_LIT:2> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , byte0 , <NUM_LIT> , <NUM_LIT:8> , byte0 , <NUM_LIT> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:4> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:8> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:9> , <NUM_LIT:1> , <NUM_LIT:4> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:3> , Block . lavaMoving . blockID , Block . lavaMoving . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:9> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:9> , <NUM_LIT:1> , <NUM_LIT:3> , Block . lavaMoving . blockID , Block . lavaMoving . blockID , false ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:8> , <NUM_LIT:7> , <NUM_LIT:1> , <NUM_LIT:12> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:9> , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:11> , Block . lavaMoving . blockID , Block . lavaMoving . blockID , false ) ; for ( int j = <NUM_LIT:3> ; j < <NUM_LIT> ; j += <NUM_LIT:2> ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:3> , j , <NUM_LIT:0> , <NUM_LIT:4> , j , Block . fenceIron . blockID , Block . fenceIron . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:10> , <NUM_LIT:3> , j , <NUM_LIT:10> , <NUM_LIT:4> , j , Block . fenceIron . blockID , Block . fenceIron . blockID , false ) ; } for ( int k = <NUM_LIT:2> ; k < <NUM_LIT:9> ; k += <NUM_LIT:2> ) { fillWithBlocks ( par1World , par3StructureBoundingBox , k , <NUM_LIT:3> , <NUM_LIT:15> , k , <NUM_LIT:4> , <NUM_LIT:15> , Block . fenceIron . blockID , Block . fenceIron . blockID , false ) ; } int l = getMetadataWithOffset ( Block . stairsStoneBrickSmooth . blockID , <NUM_LIT:3> ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:7> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:7> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; fillWithRandomizedBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:7> , <NUM_LIT:6> , <NUM_LIT:3> , <NUM_LIT:7> , false , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; for ( int i1 = <NUM_LIT:4> ; i1 <= <NUM_LIT:6> ; i1 ++ ) { placeBlockAtCurrentPosition ( par1World , Block . stairsStoneBrickSmooth . blockID , l , i1 , <NUM_LIT:1> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairsStoneBrickSmooth . blockID , l , i1 , <NUM_LIT:2> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairsStoneBrickSmooth . blockID , l , i1 , <NUM_LIT:3> , <NUM_LIT:6> , par3StructureBoundingBox ) ; } byte byte1 = <NUM_LIT:2> ; byte byte2 = <NUM_LIT:0> ; byte byte3 = <NUM_LIT:3> ; byte byte4 = <NUM_LIT:1> ; switch ( coordBaseMode ) { case <NUM_LIT:0> : byte1 = <NUM_LIT:0> ; byte2 = <NUM_LIT:2> ; break ; case <NUM_LIT:3> : byte1 = <NUM_LIT:3> ; byte2 = <NUM_LIT:1> ; byte3 = <NUM_LIT:0> ; byte4 = <NUM_LIT:2> ; break ; case <NUM_LIT:1> : byte1 = <NUM_LIT:1> ; byte2 = <NUM_LIT:3> ; byte3 = <NUM_LIT:0> ; byte4 = <NUM_LIT:2> ; break ; } placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte1 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte1 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte1 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:6> , <NUM_LIT:3> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte2 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:12> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte2 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:12> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte2 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:6> , <NUM_LIT:3> , <NUM_LIT:12> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte3 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:9> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte3 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:10> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte3 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:11> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte4 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:9> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte4 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:10> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . endPortalFrame . blockID , byte4 + ( par2Random . nextFloat ( ) <= <NUM_LIT> ? <NUM_LIT:0> : <NUM_LIT:4> ) , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:11> , par3StructureBoundingBox ) ; if ( ! hasSpawner ) { int i = getYWithOffset ( <NUM_LIT:3> ) ; int j1 = getXWithOffset ( <NUM_LIT:5> , <NUM_LIT:6> ) ; int k1 = getZWithOffset ( <NUM_LIT:5> , <NUM_LIT:6> ) ; if ( par3StructureBoundingBox . isVecInside ( j1 , i , k1 ) ) { hasSpawner = true ; par1World . setBlockWithNotify ( j1 , i , k1 , Block . mobSpawner . blockID ) ; TileEntityMobSpawner tileentitymobspawner = ( TileEntityMobSpawner ) par1World . getBlockTileEntity ( j1 , i , k1 ) ; if ( tileentitymobspawner != null ) { tileentitymobspawner . setMobID ( "<STR_LIT>" ) ; } } } return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntityAISwimming extends EntityAIBase { private EntityLiving theEntity ; public EntityAISwimming ( EntityLiving par1EntityLiving ) { theEntity = par1EntityLiving ; setMutexBits ( <NUM_LIT:4> ) ; par1EntityLiving . getNavigator ( ) . func_48660_e ( true ) ; } public boolean shouldExecute ( ) { return theEntity . isInWater ( ) || theEntity . handleLavaMovement ( ) ; } public void updateTask ( ) { if ( theEntity . getRNG ( ) . nextFloat ( ) < <NUM_LIT> ) { theEntity . getJumpHelper ( ) . setJumping ( ) ; } } } </s>
|
<s> package net . minecraft . src ; public class BlockEnchantmentTable extends BlockContainer { protected BlockEnchantmentTable ( int par1 ) { super ( par1 , <NUM_LIT> , Material . rock ) ; setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; setLightOpacity ( <NUM_LIT:0> ) ; } public boolean renderAsNormalBlock ( ) { return false ; } public boolean isOpaqueCube ( ) { return false ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { return getBlockTextureFromSide ( par1 ) ; } public int getBlockTextureFromSide ( int par1 ) { if ( par1 == <NUM_LIT:0> ) { return blockIndexInTexture + <NUM_LIT> ; } if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture ; } else { return blockIndexInTexture + <NUM_LIT:16> ; } } public TileEntity getBlockEntity ( ) { return new TileEntityEnchantmentTable ( ) ; } public boolean blockActivated ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { if ( par1World . isRemote ) { return true ; } else { par5EntityPlayer . displayGUIEnchantment ( par2 , par3 , par4 ) ; return true ; } } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet61DoorChange extends Packet { public int sfxID ; public int auxData ; public int posX ; public int posY ; public int posZ ; public Packet61DoorChange ( ) { } public Packet61DoorChange ( int par1 , int par2 , int par3 , int par4 , int par5 ) { sfxID = par1 ; posX = par2 ; posY = par3 ; posZ = par4 ; auxData = par5 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { sfxID = par1DataInputStream . readInt ( ) ; posX = par1DataInputStream . readInt ( ) ; posY = par1DataInputStream . readByte ( ) & <NUM_LIT> ; posZ = par1DataInputStream . readInt ( ) ; auxData = par1DataInputStream . readInt ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( sfxID ) ; par1DataOutputStream . writeInt ( posX ) ; par1DataOutputStream . writeByte ( posY & <NUM_LIT> ) ; par1DataOutputStream . writeInt ( posZ ) ; par1DataOutputStream . writeInt ( auxData ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleDoorChange ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:20> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockMobSpawner extends BlockContainer { protected BlockMobSpawner ( int par1 , int par2 ) { super ( par1 , par2 , Material . rock ) ; } public TileEntity getBlockEntity ( ) { return new TileEntityMobSpawner ( ) ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return <NUM_LIT:0> ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:0> ; } public boolean isOpaqueCube ( ) { return false ; } } </s>
|
<s> package net . minecraft . src ; public class WorldType { public static final WorldType worldTypes [ ] = new WorldType [ <NUM_LIT:16> ] ; public static final WorldType DEFAULT = ( new WorldType ( <NUM_LIT:0> , "<STR_LIT:default>" , <NUM_LIT:1> ) ) . func_48448_d ( ) ; public static final WorldType FLAT = new WorldType ( <NUM_LIT:1> , "<STR_LIT>" ) ; public static final WorldType DEFAULT_1_1 = ( new WorldType ( <NUM_LIT:8> , "<STR_LIT>" , <NUM_LIT:0> ) ) . setCanBeCreated ( false ) ; private final String worldType ; private final int generatorVersion ; private boolean canBeCreated ; private boolean field_48460_h ; private WorldType ( int par1 , String par2Str ) { this ( par1 , par2Str , <NUM_LIT:0> ) ; } private WorldType ( int par1 , String par2Str , int par3 ) { worldType = par2Str ; generatorVersion = par3 ; canBeCreated = true ; worldTypes [ par1 ] = this ; } public String func_48449_a ( ) { return worldType ; } public int getGeneratorVersion ( ) { return generatorVersion ; } public WorldType func_48451_a ( int par1 ) { if ( this == DEFAULT && par1 == <NUM_LIT:0> ) { return DEFAULT_1_1 ; } else { return this ; } } private WorldType setCanBeCreated ( boolean par1 ) { canBeCreated = par1 ; return this ; } private WorldType func_48448_d ( ) { field_48460_h = true ; return this ; } public boolean func_48453_c ( ) { return field_48460_h ; } public static WorldType parseWorldType ( String par0Str ) { for ( int i = <NUM_LIT:0> ; i < worldTypes . length ; i ++ ) { if ( worldTypes [ i ] != null && worldTypes [ i ] . worldType . equalsIgnoreCase ( par0Str ) ) { return worldTypes [ i ] ; } } return null ; } } </s>
|
<s> package net . minecraft . src ; import java . io . IOException ; import java . net . DatagramSocket ; import java . net . ServerSocket ; import java . util . * ; public abstract class RConThreadBase implements Runnable { protected boolean running ; protected IServer server ; protected Thread rconThread ; protected int field_40415_d ; protected List socketList ; protected List serverSocketList ; RConThreadBase ( IServer par1IServer ) { running = false ; field_40415_d = <NUM_LIT:5> ; socketList = new ArrayList ( ) ; serverSocketList = new ArrayList ( ) ; server = par1IServer ; if ( server . isDebuggingEnabled ( ) ) { logWarning ( "<STR_LIT>" ) ; } } public synchronized void startThread ( ) { rconThread = new Thread ( this ) ; rconThread . start ( ) ; running = true ; } public boolean isRunning ( ) { return running ; } protected void logInfo ( String par1Str ) { server . logIn ( par1Str ) ; } protected void log ( String par1Str ) { server . log ( par1Str ) ; } protected void logWarning ( String par1Str ) { server . logWarning ( par1Str ) ; } protected void logSevere ( String par1Str ) { server . logSevere ( par1Str ) ; } protected int getNumberOfPlayers ( ) { return server . playersOnline ( ) ; } protected void registerSocket ( DatagramSocket par1DatagramSocket ) { logInfo ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1DatagramSocket ) . toString ( ) ) ; socketList . add ( par1DatagramSocket ) ; } protected boolean closeSocket ( DatagramSocket par1DatagramSocket , boolean par2 ) { logInfo ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1DatagramSocket ) . toString ( ) ) ; if ( null == par1DatagramSocket ) { return false ; } boolean flag = false ; if ( ! par1DatagramSocket . isClosed ( ) ) { par1DatagramSocket . close ( ) ; flag = true ; } if ( par2 ) { socketList . remove ( par1DatagramSocket ) ; } return flag ; } protected boolean closeServerSocket ( ServerSocket par1ServerSocket ) { return closeServerSocket_do ( par1ServerSocket , true ) ; } protected boolean closeServerSocket_do ( ServerSocket par1ServerSocket , boolean par2 ) { logInfo ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1ServerSocket ) . toString ( ) ) ; if ( null == par1ServerSocket ) { return false ; } boolean flag = false ; try { if ( ! par1ServerSocket . isClosed ( ) ) { par1ServerSocket . close ( ) ; flag = true ; } } catch ( IOException ioexception ) { logWarning ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( ioexception . getMessage ( ) ) . toString ( ) ) ; } if ( par2 ) { serverSocketList . remove ( par1ServerSocket ) ; } return flag ; } protected void closeAllSockets ( ) { clos ( false ) ; } protected void clos ( boolean par1 ) { int i = <NUM_LIT:0> ; Iterator iterator = socketList . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } DatagramSocket datagramsocket = ( DatagramSocket ) iterator . next ( ) ; if ( closeSocket ( datagramsocket , false ) ) { i ++ ; } } while ( true ) ; socketList . clear ( ) ; iterator = serverSocketList . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } ServerSocket serversocket = ( ServerSocket ) iterator . next ( ) ; if ( closeServerSocket_do ( serversocket , false ) ) { i ++ ; } } while ( true ) ; serverSocketList . clear ( ) ; if ( par1 && <NUM_LIT:0> < i ) { logWarning ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( i ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class WeightedRandom { public WeightedRandom ( ) { } public static int getTotalWeight ( Collection par0Collection ) { int i = <NUM_LIT:0> ; for ( Iterator iterator = par0Collection . iterator ( ) ; iterator . hasNext ( ) ; ) { WeightedRandomChoice weightedrandomchoice = ( WeightedRandomChoice ) iterator . next ( ) ; i += weightedrandomchoice . itemWeight ; } return i ; } public static WeightedRandomChoice getRandomItem ( Random par0Random , Collection par1Collection , int par2 ) { if ( par2 <= <NUM_LIT:0> ) { throw new IllegalArgumentException ( ) ; } int i = par0Random . nextInt ( par2 ) ; for ( Iterator iterator = par1Collection . iterator ( ) ; iterator . hasNext ( ) ; ) { WeightedRandomChoice weightedrandomchoice = ( WeightedRandomChoice ) iterator . next ( ) ; i -= weightedrandomchoice . itemWeight ; if ( i < <NUM_LIT:0> ) { return weightedrandomchoice ; } } return null ; } public static WeightedRandomChoice getRandomItem ( Random par0Random , Collection par1Collection ) { return getRandomItem ( par0Random , par1Collection , getTotalWeight ( par1Collection ) ) ; } public static int getTotalWeight ( WeightedRandomChoice par0ArrayOfWeightedRandomChoice [ ] ) { int i = <NUM_LIT:0> ; WeightedRandomChoice aweightedrandomchoice [ ] = par0ArrayOfWeightedRandomChoice ; int j = aweightedrandomchoice . length ; for ( int k = <NUM_LIT:0> ; k < j ; k ++ ) { WeightedRandomChoice weightedrandomchoice = aweightedrandomchoice [ k ] ; i += weightedrandomchoice . itemWeight ; } return i ; } public static WeightedRandomChoice getRandomItem ( Random par0Random , WeightedRandomChoice par1ArrayOfWeightedRandomChoice [ ] , int par2 ) { if ( par2 <= <NUM_LIT:0> ) { throw new IllegalArgumentException ( ) ; } int i = par0Random . nextInt ( par2 ) ; WeightedRandomChoice aweightedrandomchoice [ ] = par1ArrayOfWeightedRandomChoice ; int j = aweightedrandomchoice . length ; for ( int k = <NUM_LIT:0> ; k < j ; k ++ ) { WeightedRandomChoice weightedrandomchoice = aweightedrandomchoice [ k ] ; i -= weightedrandomchoice . itemWeight ; if ( i < <NUM_LIT:0> ) { return weightedrandomchoice ; } } return null ; } public static WeightedRandomChoice getRandomItem ( Random par0Random , WeightedRandomChoice par1ArrayOfWeightedRandomChoice [ ] ) { return getRandomItem ( par0Random , par1ArrayOfWeightedRandomChoice , getTotalWeight ( par1ArrayOfWeightedRandomChoice ) ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class Explosion { public boolean isFlaming ; private Random explosionRNG ; private World worldObj ; public double explosionX ; public double explosionY ; public double explosionZ ; public Entity exploder ; public float explosionSize ; public Set destroyedBlockPositions ; public Explosion ( World par1World , Entity par2Entity , double par3 , double par5 , double par7 , float par9 ) { isFlaming = false ; explosionRNG = new Random ( ) ; destroyedBlockPositions = new HashSet ( ) ; worldObj = par1World ; exploder = par2Entity ; explosionSize = par9 ; explosionX = par3 ; explosionY = par5 ; explosionZ = par7 ; } public void doExplosionA ( ) { float f = explosionSize ; int i = <NUM_LIT:16> ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { for ( int l = <NUM_LIT:0> ; l < i ; l ++ ) { label0 : for ( int j1 = <NUM_LIT:0> ; j1 < i ; j1 ++ ) { if ( j != <NUM_LIT:0> && j != i - <NUM_LIT:1> && l != <NUM_LIT:0> && l != i - <NUM_LIT:1> && j1 != <NUM_LIT:0> && j1 != i - <NUM_LIT:1> ) { continue ; } double d = ( ( float ) j / ( ( float ) i - <NUM_LIT> ) ) * <NUM_LIT> - <NUM_LIT> ; double d1 = ( ( float ) l / ( ( float ) i - <NUM_LIT> ) ) * <NUM_LIT> - <NUM_LIT> ; double d2 = ( ( float ) j1 / ( ( float ) i - <NUM_LIT> ) ) * <NUM_LIT> - <NUM_LIT> ; double d3 = Math . sqrt ( d * d + d1 * d1 + d2 * d2 ) ; d /= d3 ; d1 /= d3 ; d2 /= d3 ; float f1 = explosionSize * ( <NUM_LIT> + worldObj . rand . nextFloat ( ) * <NUM_LIT> ) ; double d5 = explosionX ; double d7 = explosionY ; double d9 = explosionZ ; float f2 = <NUM_LIT> ; do { if ( f1 <= <NUM_LIT> ) { continue label0 ; } int l2 = MathHelper . floor_double ( d5 ) ; int i3 = MathHelper . floor_double ( d7 ) ; int j3 = MathHelper . floor_double ( d9 ) ; int k3 = worldObj . getBlockId ( l2 , i3 , j3 ) ; if ( k3 > <NUM_LIT:0> ) { f1 -= ( Block . blocksList [ k3 ] . getExplosionResistance ( exploder ) + <NUM_LIT> ) * f2 ; } if ( f1 > <NUM_LIT> ) { destroyedBlockPositions . add ( new ChunkPosition ( l2 , i3 , j3 ) ) ; } d5 += d * ( double ) f2 ; d7 += d1 * ( double ) f2 ; d9 += d2 * ( double ) f2 ; f1 -= f2 * <NUM_LIT> ; } while ( true ) ; } } } explosionSize *= <NUM_LIT> ; int k = MathHelper . floor_double ( explosionX - ( double ) explosionSize - <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( explosionX + ( double ) explosionSize + <NUM_LIT> ) ; int k1 = MathHelper . floor_double ( explosionY - ( double ) explosionSize - <NUM_LIT> ) ; int l1 = MathHelper . floor_double ( explosionY + ( double ) explosionSize + <NUM_LIT> ) ; int i2 = MathHelper . floor_double ( explosionZ - ( double ) explosionSize - <NUM_LIT> ) ; int j2 = MathHelper . floor_double ( explosionZ + ( double ) explosionSize + <NUM_LIT> ) ; List list = worldObj . getEntitiesWithinAABBExcludingEntity ( exploder , AxisAlignedBB . getBoundingBoxFromPool ( k , k1 , i2 , i1 , l1 , j2 ) ) ; Vec3D vec3d = Vec3D . createVector ( explosionX , explosionY , explosionZ ) ; for ( int k2 = <NUM_LIT:0> ; k2 < list . size ( ) ; k2 ++ ) { Entity entity = ( Entity ) list . get ( k2 ) ; double d4 = entity . getDistance ( explosionX , explosionY , explosionZ ) / ( double ) explosionSize ; if ( d4 <= <NUM_LIT> ) { double d6 = entity . posX - explosionX ; double d8 = entity . posY - explosionY ; double d10 = entity . posZ - explosionZ ; double d11 = MathHelper . sqrt_double ( d6 * d6 + d8 * d8 + d10 * d10 ) ; d6 /= d11 ; d8 /= d11 ; d10 /= d11 ; double d12 = worldObj . getBlockDensity ( vec3d , entity . boundingBox ) ; double d13 = ( <NUM_LIT> - d4 ) * d12 ; entity . attackEntityFrom ( DamageSource . explosion , ( int ) ( ( ( d13 * d13 + d13 ) / <NUM_LIT> ) * <NUM_LIT> * ( double ) explosionSize + <NUM_LIT> ) ) ; double d14 = d13 ; entity . motionX += d6 * d14 ; entity . motionY += d8 * d14 ; entity . motionZ += d10 * d14 ; } } explosionSize = f ; ArrayList arraylist = new ArrayList ( ) ; arraylist . addAll ( destroyedBlockPositions ) ; } public void doExplosionB ( boolean par1 ) { worldObj . playSoundEffect ( explosionX , explosionY , explosionZ , "<STR_LIT>" , <NUM_LIT> , ( <NUM_LIT> + ( worldObj . rand . nextFloat ( ) - worldObj . rand . nextFloat ( ) ) * <NUM_LIT> ) * <NUM_LIT> ) ; worldObj . spawnParticle ( "<STR_LIT>" , explosionX , explosionY , explosionZ , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; ArrayList arraylist = new ArrayList ( ) ; arraylist . addAll ( destroyedBlockPositions ) ; for ( int i = arraylist . size ( ) - <NUM_LIT:1> ; i >= <NUM_LIT:0> ; i -- ) { ChunkPosition chunkposition = ( ChunkPosition ) arraylist . get ( i ) ; int k = chunkposition . x ; int i1 = chunkposition . y ; int k1 = chunkposition . z ; int i2 = worldObj . getBlockId ( k , i1 , k1 ) ; if ( par1 ) { double d = ( float ) k + worldObj . rand . nextFloat ( ) ; double d1 = ( float ) i1 + worldObj . rand . nextFloat ( ) ; double d2 = ( float ) k1 + worldObj . rand . nextFloat ( ) ; double d3 = d - explosionX ; double d4 = d1 - explosionY ; double d5 = d2 - explosionZ ; double d6 = MathHelper . sqrt_double ( d3 * d3 + d4 * d4 + d5 * d5 ) ; d3 /= d6 ; d4 /= d6 ; d5 /= d6 ; double d7 = <NUM_LIT> / ( d6 / ( double ) explosionSize + <NUM_LIT> ) ; d7 *= worldObj . rand . nextFloat ( ) * worldObj . rand . nextFloat ( ) + <NUM_LIT> ; d3 *= d7 ; d4 *= d7 ; d5 *= d7 ; worldObj . spawnParticle ( "<STR_LIT>" , ( d + explosionX * <NUM_LIT> ) / <NUM_LIT> , ( d1 + explosionY * <NUM_LIT> ) / <NUM_LIT> , ( d2 + explosionZ * <NUM_LIT> ) / <NUM_LIT> , d3 , d4 , d5 ) ; worldObj . spawnParticle ( "<STR_LIT>" , d , d1 , d2 , d3 , d4 , d5 ) ; } if ( i2 > <NUM_LIT:0> ) { Block . blocksList [ i2 ] . dropBlockAsItemWithChance ( worldObj , k , i1 , k1 , worldObj . getBlockMetadata ( k , i1 , k1 ) , <NUM_LIT> , <NUM_LIT:0> ) ; worldObj . setBlockWithNotify ( k , i1 , k1 , <NUM_LIT:0> ) ; Block . blocksList [ i2 ] . onBlockDestroyedByExplosion ( worldObj , k , i1 , k1 ) ; } } if ( isFlaming ) { for ( int j = arraylist . size ( ) - <NUM_LIT:1> ; j >= <NUM_LIT:0> ; j -- ) { ChunkPosition chunkposition1 = ( ChunkPosition ) arraylist . get ( j ) ; int l = chunkposition1 . x ; int j1 = chunkposition1 . y ; int l1 = chunkposition1 . z ; int j2 = worldObj . getBlockId ( l , j1 , l1 ) ; int k2 = worldObj . getBlockId ( l , j1 - <NUM_LIT:1> , l1 ) ; if ( j2 == <NUM_LIT:0> && Block . opaqueCubeLookup [ k2 ] && explosionRNG . nextInt ( <NUM_LIT:3> ) == <NUM_LIT:0> ) { worldObj . setBlockWithNotify ( l , j1 , l1 , Block . fire . blockID ) ; } } } } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . * ; public class NBTTagList extends NBTBase { private List tagList ; private byte tagType ; public NBTTagList ( ) { super ( "<STR_LIT>" ) ; tagList = new ArrayList ( ) ; } public NBTTagList ( String par1Str ) { super ( par1Str ) ; tagList = new ArrayList ( ) ; } void write ( DataOutput par1DataOutput ) throws IOException { if ( tagList . size ( ) > <NUM_LIT:0> ) { tagType = ( ( NBTBase ) tagList . get ( <NUM_LIT:0> ) ) . getId ( ) ; } else { tagType = <NUM_LIT:1> ; } par1DataOutput . writeByte ( tagType ) ; par1DataOutput . writeInt ( tagList . size ( ) ) ; for ( int i = <NUM_LIT:0> ; i < tagList . size ( ) ; i ++ ) { ( ( NBTBase ) tagList . get ( i ) ) . write ( par1DataOutput ) ; } } void load ( DataInput par1DataInput ) throws IOException { tagType = par1DataInput . readByte ( ) ; int i = par1DataInput . readInt ( ) ; tagList = new ArrayList ( ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { NBTBase nbtbase = NBTBase . newTag ( tagType , null ) ; nbtbase . load ( par1DataInput ) ; tagList . add ( nbtbase ) ; } } public byte getId ( ) { return <NUM_LIT:9> ; } public String toString ( ) { return ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( tagList . size ( ) ) . append ( "<STR_LIT>" ) . append ( NBTBase . getTagName ( tagType ) ) . toString ( ) ; } public void appendTag ( NBTBase par1NBTBase ) { tagType = par1NBTBase . getId ( ) ; tagList . add ( par1NBTBase ) ; } public NBTBase tagAt ( int par1 ) { return ( NBTBase ) tagList . get ( par1 ) ; } public int tagCount ( ) { return tagList . size ( ) ; } public NBTBase copy ( ) { NBTTagList nbttaglist = new NBTTagList ( getName ( ) ) ; nbttaglist . tagType = tagType ; NBTBase nbtbase1 ; for ( Iterator iterator = tagList . iterator ( ) ; iterator . hasNext ( ) ; nbttaglist . tagList . add ( nbtbase1 ) ) { NBTBase nbtbase = ( NBTBase ) iterator . next ( ) ; nbtbase1 = nbtbase . copy ( ) ; } return nbttaglist ; } public boolean equals ( Object par1Obj ) { if ( super . equals ( par1Obj ) ) { NBTTagList nbttaglist = ( NBTTagList ) par1Obj ; if ( tagType == nbttaglist . tagType ) { return tagList . equals ( nbttaglist . tagList ) ; } } return false ; } public int hashCode ( ) { return super . hashCode ( ) ^ tagList . hashCode ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . List ; public class Packet40EntityMetadata extends Packet { public int entityId ; private List metadata ; public Packet40EntityMetadata ( ) { } public Packet40EntityMetadata ( int par1 , DataWatcher par2DataWatcher ) { entityId = par1 ; metadata = par2DataWatcher . getChangedObjects ( ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityId = par1DataInputStream . readInt ( ) ; metadata = DataWatcher . readWatchableObjects ( par1DataInputStream ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityId ) ; DataWatcher . writeObjectsInListToStream ( metadata , par1DataOutputStream ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleEntityMetadata ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:5> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet9Respawn extends Packet { public int respawnDimension ; public int difficulty ; public int worldHeight ; public int creativeMode ; public WorldType terrainType ; public Packet9Respawn ( ) { } public Packet9Respawn ( int par1 , byte par2 , WorldType par3WorldType , int par4 , int par5 ) { respawnDimension = par1 ; difficulty = par2 ; worldHeight = par4 ; creativeMode = par5 ; terrainType = par3WorldType ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleRespawn ( this ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { respawnDimension = par1DataInputStream . readInt ( ) ; difficulty = par1DataInputStream . readByte ( ) ; creativeMode = par1DataInputStream . readByte ( ) ; worldHeight = par1DataInputStream . readShort ( ) ; String s = readString ( par1DataInputStream , <NUM_LIT:16> ) ; terrainType = WorldType . parseWorldType ( s ) ; if ( terrainType == null ) { terrainType = WorldType . DEFAULT ; } } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( respawnDimension ) ; par1DataOutputStream . writeByte ( difficulty ) ; par1DataOutputStream . writeByte ( creativeMode ) ; par1DataOutputStream . writeShort ( worldHeight ) ; writeString ( terrainType . func_48449_a ( ) , par1DataOutputStream ) ; } public int getPacketSize ( ) { return <NUM_LIT:8> + terrainType . func_48449_a ( ) . length ( ) ; } } </s>
|
<s> package net . minecraft . src ; public enum EnumStatus { OK , NOT_POSSIBLE_HERE , NOT_POSSIBLE_NOW , TOO_FAR_AWAY , OTHER_PROBLEM , NOT_SAFE ; } </s>
|
<s> package net . minecraft . src ; import java . util . ArrayList ; import java . util . Random ; public class BlockEndPortal extends BlockContainer { public static boolean bossDefeated = false ; protected BlockEndPortal ( int par1 , Material par2Material ) { super ( par1 , <NUM_LIT:0> , par2Material ) ; setLightValue ( <NUM_LIT> ) ; } public TileEntity getBlockEntity ( ) { return new TileEntityEndPortal ( ) ; } public void setBlockBoundsBasedOnState ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { float f = <NUM_LIT> ; setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , f , <NUM_LIT> ) ; } public void getCollidingBoundingBoxes ( World world , int i , int j , int k , AxisAlignedBB axisalignedbb , ArrayList arraylist ) { } public boolean isOpaqueCube ( ) { return false ; } public boolean renderAsNormalBlock ( ) { return false ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:0> ; } public void onEntityCollidedWithBlock ( World par1World , int par2 , int par3 , int par4 , Entity par5Entity ) { if ( par5Entity . ridingEntity == null && par5Entity . riddenByEntity == null && ( par5Entity instanceof EntityPlayer ) && ! par1World . isRemote ) { ( ( EntityPlayer ) par5Entity ) . travelToTheEnd ( <NUM_LIT:1> ) ; } } public int getRenderType ( ) { return - <NUM_LIT:1> ; } public void onBlockAdded ( World par1World , int par2 , int par3 , int par4 ) { if ( bossDefeated ) { return ; } if ( par1World . worldProvider . worldType != <NUM_LIT:0> ) { par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; return ; } else { return ; } } } </s>
|
<s> package net . minecraft . src ; public class ItemTool extends Item { private Block blocksEffectiveAgainst [ ] ; protected float efficiencyOnProperMaterial ; private int damageVsEntity ; protected EnumToolMaterial toolMaterial ; protected ItemTool ( int par1 , int par2 , EnumToolMaterial par3EnumToolMaterial , Block par4ArrayOfBlock [ ] ) { super ( par1 ) ; efficiencyOnProperMaterial = <NUM_LIT> ; toolMaterial = par3EnumToolMaterial ; blocksEffectiveAgainst = par4ArrayOfBlock ; maxStackSize = <NUM_LIT:1> ; setMaxDamage ( par3EnumToolMaterial . getMaxUses ( ) ) ; efficiencyOnProperMaterial = par3EnumToolMaterial . getEfficiencyOnProperMaterial ( ) ; damageVsEntity = par2 + par3EnumToolMaterial . getDamageVsEntity ( ) ; } public float getStrVsBlock ( ItemStack par1ItemStack , Block par2Block ) { for ( int i = <NUM_LIT:0> ; i < blocksEffectiveAgainst . length ; i ++ ) { if ( blocksEffectiveAgainst [ i ] == par2Block ) { return efficiencyOnProperMaterial ; } } return <NUM_LIT> ; } public boolean hitEntity ( ItemStack par1ItemStack , EntityLiving par2EntityLiving , EntityLiving par3EntityLiving ) { par1ItemStack . damageItem ( <NUM_LIT:2> , par3EntityLiving ) ; return true ; } public boolean onBlockDestroyed ( ItemStack par1ItemStack , int par2 , int par3 , int par4 , int par5 , EntityLiving par6EntityLiving ) { par1ItemStack . damageItem ( <NUM_LIT:1> , par6EntityLiving ) ; return true ; } public int getDamageVsEntity ( Entity par1Entity ) { return damageVsEntity ; } public int getItemEnchantability ( ) { return toolMaterial . getEnchantability ( ) ; } } </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.