text
stringlengths 30
1.67M
|
|---|
<s> public final class LinearScale { private final double origin , scale ; public LinearScale ( double bound0 , double bound1 , int screenOrigin , int extent ) { origin = extent / <NUM_LIT> ; scale = extent / ( bound1 - bound0 ) ; } public int map ( double mathCoord ) { return Math . round ( origin + mathCoord * scale ) ; } public double unmap ( int screenCoord ) { return ( screenCoord - origin ) / scale ; } } </s>
|
<s> import java . awt . Color ; import java . awt . Graphics ; import expr . Expr ; import expr . Variable ; public final class FunctionOfX extends Curve { private Variable xVar ; private Expr expr ; public FunctionOfX ( GraphCanvas canvas , Color color , Variable xVar , Expr expr ) { super ( canvas , color ) ; this . xVar = xVar ; this . expr = expr ; } public void draw ( Graphics g ) { super . draw ( g ) ; xVar . setValue ( unscreenifyX ( <NUM_LIT:0> ) ) ; int prevY = screenifyY ( expr . value ( ) ) ; int xMax = canvas . getSize ( ) . width ; for ( int x = <NUM_LIT:1> ; x < xMax ; ++ x ) { xVar . setValue ( unscreenifyX ( x ) ) ; int y = screenifyY ( expr . value ( ) ) ; g . drawLine ( x - <NUM_LIT:1> , prevY , x , y ) ; prevY = y ; } } } </s>
|
<s> import java . awt . * ; import java . util . * ; public class MultilineLabel extends java . awt . Canvas { private String myText ; public MultilineLabel ( String text ) { myText = text ; } public void setText ( String text ) { myText = text ; } public void paint ( Graphics graphics ) { int h = graphics . getFontMetrics ( ) . getHeight ( ) ; StringTokenizer lines = new StringTokenizer ( myText , "<STR_LIT:n>" ) ; for ( int y = h ; lines . hasMoreTokens ( ) ; y += h ) graphics . drawString ( lines . nextToken ( ) , <NUM_LIT:0> , y ) ; } } </s>
|
<s> import java . applet . Applet ; import java . awt . BorderLayout ; import java . awt . Color ; import java . awt . FlowLayout ; import java . awt . Graphics ; import java . awt . Label ; import java . awt . Panel ; import java . awt . TextField ; import java . awt . event . ActionEvent ; import java . awt . event . ActionListener ; import expr . Expr ; import expr . Parser ; import expr . SyntaxException ; import expr . Variable ; public class BasicGraphApplet extends Applet implements ActionListener { public String getAppletInfo ( ) { return "<STR_LIT>" ; } private GraphCanvas canvas ; private TextField input ; private MultilineLabel messageDisplay ; public void init ( ) { input = new TextField ( <NUM_LIT> ) ; input . addActionListener ( this ) ; Panel inputBox = new Panel ( ) ; inputBox . setLayout ( new FlowLayout ( ) ) ; inputBox . add ( new Label ( "<STR_LIT>" , Label . RIGHT ) ) ; inputBox . add ( input ) ; canvas = new GraphCanvas ( ) ; messageDisplay = new MultilineLabel ( "<STR_LIT>" ) ; setLayout ( new BorderLayout ( ) ) ; add ( "<STR_LIT>" , inputBox ) ; add ( "<STR_LIT>" , canvas ) ; add ( "<STR_LIT>" , messageDisplay ) ; validate ( ) ; } public void actionPerformed ( ActionEvent evt ) { drawGraph ( ) ; } private void drawGraph ( ) { try { canvas . setCurve ( parseFofX ( input . getText ( ) , Color . black ) ) ; } catch ( SyntaxException e ) { messageDisplay . setText ( e . explain ( ) ) ; validate ( ) ; return ; } messageDisplay . setText ( "<STR_LIT>" ) ; canvas . repaint ( ) ; } private Curve parseFofX ( String text , Color color ) throws SyntaxException { Variable x = Variable . make ( "<STR_LIT:x>" ) ; return new FunctionOfX ( canvas , color , x , Parser . parse ( text ) ) ; } } </s>
|
<s> import java . applet . Applet ; import java . awt . BorderLayout ; import java . awt . Color ; import java . awt . FlowLayout ; import java . awt . Graphics ; import java . awt . Label ; import java . awt . Panel ; import java . awt . TextField ; import java . awt . event . ActionEvent ; import java . awt . event . ActionListener ; import expr . Expr ; import expr . Parser ; import expr . SyntaxException ; import expr . Variable ; public class GraphApplet extends Applet implements ActionListener { public String getAppletInfo ( ) { return "<STR_LIT>" ; } private GraphCanvas canvas ; private TextField input ; public void init ( ) { input = new TextField ( <NUM_LIT> ) ; input . addActionListener ( this ) ; Panel inputBox = new Panel ( ) ; inputBox . setLayout ( new FlowLayout ( ) ) ; inputBox . add ( new Label ( "<STR_LIT>" , Label . RIGHT ) ) ; inputBox . add ( input ) ; canvas = new GraphCanvas ( ) ; setLayout ( new BorderLayout ( ) ) ; add ( "<STR_LIT>" , inputBox ) ; add ( "<STR_LIT>" , canvas ) ; validate ( ) ; } public void actionPerformed ( ActionEvent evt ) { drawGraph ( ) ; } private void drawGraph ( ) { try { canvas . setCurve ( parseFofX ( input . getText ( ) , Color . black ) ) ; } catch ( SyntaxException e ) { showStatus ( e . explain ( ) ) ; return ; } showStatus ( "<STR_LIT>" ) ; canvas . repaint ( ) ; } private Curve parseFofX ( String text , Color color ) throws SyntaxException { Variable x = Variable . make ( "<STR_LIT:x>" ) ; Parser parser = new Parser ( ) ; parser . allow ( x ) ; return new FunctionOfX ( canvas , color , x , parser . parseString ( text ) ) ; } } </s>
|
<s> package expr ; public class Benchmark { public static void main ( String [ ] args ) { double parse_product = <NUM_LIT:1.0> ; double run_product = <NUM_LIT:1.0> ; for ( int i = <NUM_LIT:0> ; i < args . length ; ++ i ) { long parsetime = timeParse ( args [ i ] ) ; long runtime = timeRun ( args [ i ] ) ; System . out . println ( "<STR_LIT>" + msec ( parsetime ) + "<STR_LIT>" + msec ( runtime ) + "<STR_LIT>" + args [ i ] ) ; parse_product *= parsetime ; run_product *= runtime ; } if ( <NUM_LIT:0> < args . length ) { double run_geomean = Math . pow ( run_product , <NUM_LIT:1.0> / args . length ) ; double parse_geomean = Math . pow ( parse_product , <NUM_LIT:1.0> / args . length ) ; System . out . println ( "<STR_LIT>" + msec ( parse_geomean ) + "<STR_LIT>" + msec ( run_geomean ) + "<STR_LIT>" ) ; } } static long msec ( double nsec ) { return ( long ) Math . rint ( nsec * <NUM_LIT> ) ; } static final int nruns = <NUM_LIT> ; static long timeRun ( String expression ) { Variable x = Variable . make ( "<STR_LIT:x>" ) ; Expr expr = parse ( expression ) ; double low = <NUM_LIT:0.0> ; double high = <NUM_LIT> ; double step = ( high - low ) / nruns ; long start = System . nanoTime ( ) ; for ( double xval = low ; xval <= high ; xval += step ) { x . setValue ( xval ) ; expr . value ( ) ; } return System . nanoTime ( ) - start ; } static final int nparses = <NUM_LIT:1000> ; static long timeParse ( String expression ) { long start = System . nanoTime ( ) ; for ( int i = <NUM_LIT:0> ; i < nparses ; ++ i ) parse ( expression ) ; return System . nanoTime ( ) - start ; } static Expr parse ( String expression ) { try { return Parser . parse ( expression ) ; } catch ( SyntaxException e ) { System . err . println ( e . explain ( ) ) ; throw new Error ( e ) ; } } } </s>
|
<s> package expr ; class Token { public static final int TT_ERROR = - <NUM_LIT:1> ; public static final int TT_EOF = - <NUM_LIT:2> ; public static final int TT_NUMBER = - <NUM_LIT:3> ; public static final int TT_WORD = - <NUM_LIT:4> ; public static final int TT_LE = - <NUM_LIT:5> ; public static final int TT_NE = - <NUM_LIT:6> ; public static final int TT_GE = - <NUM_LIT:7> ; public Token ( int ttype , double nval , String input , int start , int end ) { this . ttype = ttype ; this . sval = input . substring ( start , end ) ; this . nval = nval ; this . location = start ; int count = <NUM_LIT:0> ; for ( int i = start - <NUM_LIT:1> ; <NUM_LIT:0> <= i ; -- i ) { if ( ! Character . isWhitespace ( input . charAt ( i ) ) ) break ; ++ count ; } this . leadingWhitespace = count ; count = <NUM_LIT:0> ; for ( int i = end ; i < input . length ( ) ; ++ i ) { if ( ! Character . isWhitespace ( input . charAt ( i ) ) ) break ; ++ count ; } this . trailingWhitespace = count ; } Token ( int ttype , double nval , String sval , Token token ) { this . ttype = ttype ; this . sval = sval ; this . nval = nval ; this . location = token . location ; this . leadingWhitespace = token . leadingWhitespace ; this . trailingWhitespace = token . trailingWhitespace ; } public final int ttype ; public final String sval ; public final double nval ; public final int location ; public final int leadingWhitespace , trailingWhitespace ; } </s>
|
<s> package expr ; public class SyntaxException extends Exception { public static final int INCOMPLETE = <NUM_LIT:0> ; public static final int BAD_FACTOR = <NUM_LIT:1> ; public static final int PREMATURE_EOF = <NUM_LIT:2> ; public static final int EXPECTED = <NUM_LIT:3> ; public static final int UNKNOWN_VARIABLE = <NUM_LIT:4> ; public SyntaxException ( String complaint , Parser parser , int reason , String expected ) { super ( complaint ) ; this . reason = reason ; this . parser = parser ; this . scanner = parser . tokens ; this . expected = expected ; } public String explain ( ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( "<STR_LIT>" ) ; quotify ( sb , scanner . getInput ( ) ) ; sb . append ( "<STR_LIT>" ) ; explainWhere ( sb ) ; explainWhy ( sb ) ; explainWhat ( sb ) ; return sb . toString ( ) ; } private Parser parser ; private Scanner scanner ; private int reason ; private String expected ; private String fixedInput = "<STR_LIT>" ; private void explainWhere ( StringBuffer sb ) { if ( scanner . isEmpty ( ) ) { sb . append ( "<STR_LIT>" ) ; } else if ( scanner . atStart ( ) ) { sb . append ( "<STR_LIT>" ) ; quotify ( sb , theToken ( ) ) ; if ( isLegalToken ( ) ) sb . append ( "<STR_LIT>" ) ; else sb . append ( "<STR_LIT>" ) ; } else { sb . append ( "<STR_LIT>" ) ; quotify ( sb , asFarAs ( ) ) ; sb . append ( "<STR_LIT>" ) ; if ( scanner . atEnd ( ) ) { sb . append ( "<STR_LIT>" ) ; } else { sb . append ( "<STR_LIT>" ) ; quotify ( sb , theToken ( ) ) ; if ( isLegalToken ( ) ) sb . append ( "<STR_LIT>" ) ; else sb . append ( "<STR_LIT>" ) ; } } } private void explainWhy ( StringBuffer sb ) { switch ( reason ) { case INCOMPLETE : if ( isLegalToken ( ) ) sb . append ( "<STR_LIT>" + "<STR_LIT>" ) ; break ; case BAD_FACTOR : case PREMATURE_EOF : sb . append ( "<STR_LIT>" ) ; if ( ! scanner . atStart ( ) ) sb . append ( "<STR_LIT>" ) ; sb . append ( "<STR_LIT>" ) ; break ; case EXPECTED : sb . append ( "<STR_LIT>" ) ; quotify ( sb , expected ) ; sb . append ( "<STR_LIT>" ) ; break ; case UNKNOWN_VARIABLE : sb . append ( "<STR_LIT>" ) ; break ; default : throw new Error ( "<STR_LIT>" ) ; } } private void explainWhat ( StringBuffer sb ) { fixedInput = tryToFix ( ) ; if ( null != fixedInput ) { sb . append ( "<STR_LIT>" ) ; quotify ( sb , fixedInput ) ; sb . append ( "<STR_LIT>" ) ; } } private String tryToFix ( ) { return ( parser . tryCorrections ( ) ? scanner . toString ( ) : null ) ; } private void quotify ( StringBuffer sb , String s ) { sb . append ( '<CHAR_LIT:">' ) ; sb . append ( s ) ; sb . append ( '<CHAR_LIT:">' ) ; } private String asFarAs ( ) { Token t = scanner . getCurrentToken ( ) ; int point = t . location - t . leadingWhitespace ; return scanner . getInput ( ) . substring ( <NUM_LIT:0> , point ) ; } private String theToken ( ) { return scanner . getCurrentToken ( ) . sval ; } private boolean isLegalToken ( ) { Token t = scanner . getCurrentToken ( ) ; return t . ttype != Token . TT_EOF && t . ttype != Token . TT_ERROR ; } } </s>
|
<s> package expr ; public class RegressionTest { public static void main ( String [ ] args ) { Variable . make ( "<STR_LIT>" ) . setValue ( Math . PI ) ; expect ( <NUM_LIT:9> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT:6> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT:5> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( - <NUM_LIT:3> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( <NUM_LIT:2> , "<STR_LIT>" ) ; expect ( <NUM_LIT:2> , "<STR_LIT>" ) ; expect ( <NUM_LIT:0> , "<STR_LIT>" ) ; expect ( Math . PI / <NUM_LIT:2> , "<STR_LIT>" ) ; expect ( Math . PI / <NUM_LIT:4> , "<STR_LIT>" ) ; expect ( - <NUM_LIT:3> * Math . PI / <NUM_LIT:4> , "<STR_LIT>" ) ; expect ( <NUM_LIT:4> , "<STR_LIT>" ) ; expect ( - <NUM_LIT:3> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( Math . exp ( <NUM_LIT:1> ) , "<STR_LIT>" ) ; expect ( <NUM_LIT:3> , "<STR_LIT>" ) ; expect ( - <NUM_LIT:4> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:4> , "<STR_LIT>" ) ; expect ( - <NUM_LIT:4> , "<STR_LIT>" ) ; expect ( <NUM_LIT:1> , "<STR_LIT>" ) ; expect ( <NUM_LIT:3> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT:3> , "<STR_LIT>" ) ; expect ( <NUM_LIT:2> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( - <NUM_LIT> * Math . pow ( <NUM_LIT> , <NUM_LIT> ) , "<STR_LIT>" ) ; Variable x = Variable . make ( "<STR_LIT:x>" ) ; x . setValue ( - <NUM_LIT> ) ; expect ( - <NUM_LIT> , "<STR_LIT>" ) ; { boolean caught = false ; Parser p = new Parser ( ) ; p . allow ( x ) ; try { p . parseString ( "<STR_LIT>" ) ; } catch ( SyntaxException se ) { caught = true ; } if ( ! caught ) throw new Error ( "<STR_LIT>" ) ; } x . setValue ( <NUM_LIT> ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( Math . PI , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT:x>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( - <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( - <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( - <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( - <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; expect ( <NUM_LIT> , "<STR_LIT>" ) ; System . out . println ( "<STR_LIT>" ) ; } private static void expect ( double expected , String input ) { Expr expr ; try { expr = Parser . parse ( input ) ; } catch ( SyntaxException e ) { throw new Error ( e . explain ( ) ) ; } double result = expr . value ( ) ; if ( result != expected ) { throw new Error ( "<STR_LIT>" + result + "<STR_LIT>" + expected + "<STR_LIT>" + input + "<STR_LIT:\">" ) ; } } } </s>
|
<s> package expr ; import java . util . Vector ; class Scanner { private String s ; private String operatorChars ; Vector tokens = new Vector ( ) ; int index = - <NUM_LIT:1> ; public Scanner ( String string , String operatorChars ) { this . s = string ; this . operatorChars = operatorChars ; int i = <NUM_LIT:0> ; do { i = scanToken ( i ) ; } while ( i < s . length ( ) ) ; } public String getInput ( ) { return s ; } public String toString ( ) { StringBuffer sb = new StringBuffer ( ) ; int whitespace = <NUM_LIT:0> ; for ( int i = <NUM_LIT:0> ; i < tokens . size ( ) ; ++ i ) { Token t = ( Token ) tokens . elementAt ( i ) ; int spaces = ( whitespace != <NUM_LIT:0> ? whitespace : t . leadingWhitespace ) ; if ( i == <NUM_LIT:0> ) spaces = <NUM_LIT:0> ; else if ( spaces == <NUM_LIT:0> && ! joinable ( ( Token ) tokens . elementAt ( i - <NUM_LIT:1> ) , t ) ) spaces = <NUM_LIT:1> ; for ( int j = spaces ; <NUM_LIT:0> < j ; -- j ) sb . append ( "<STR_LIT:U+0020>" ) ; sb . append ( t . sval ) ; whitespace = t . trailingWhitespace ; } return sb . toString ( ) ; } private boolean joinable ( Token s , Token t ) { return ! ( isAlphanumeric ( s ) && isAlphanumeric ( t ) ) ; } private boolean isAlphanumeric ( Token t ) { return t . ttype == Token . TT_WORD || t . ttype == Token . TT_NUMBER ; } public boolean isEmpty ( ) { return tokens . size ( ) == <NUM_LIT:0> ; } public boolean atStart ( ) { return index <= <NUM_LIT:0> ; } public boolean atEnd ( ) { return tokens . size ( ) <= index ; } public Token nextToken ( ) { ++ index ; return getCurrentToken ( ) ; } public Token getCurrentToken ( ) { if ( atEnd ( ) ) return new Token ( Token . TT_EOF , <NUM_LIT:0> , s , s . length ( ) , s . length ( ) ) ; return ( Token ) tokens . elementAt ( index ) ; } private int scanToken ( int i ) { while ( i < s . length ( ) && Character . isWhitespace ( s . charAt ( i ) ) ) ++ i ; if ( i == s . length ( ) ) { return i ; } else if ( <NUM_LIT:0> <= operatorChars . indexOf ( s . charAt ( i ) ) ) { if ( i + <NUM_LIT:1> < s . length ( ) ) { String pair = s . substring ( i , i + <NUM_LIT:2> ) ; int ttype = <NUM_LIT:0> ; if ( pair . equals ( "<STR_LIT>" ) ) ttype = Token . TT_LE ; else if ( pair . equals ( "<STR_LIT>" ) ) ttype = Token . TT_GE ; else if ( pair . equals ( "<STR_LIT>" ) ) ttype = Token . TT_NE ; if ( <NUM_LIT:0> != ttype ) { tokens . addElement ( new Token ( ttype , <NUM_LIT:0> , s , i , i + <NUM_LIT:2> ) ) ; return i + <NUM_LIT:2> ; } } tokens . addElement ( new Token ( s . charAt ( i ) , <NUM_LIT:0> , s , i , i + <NUM_LIT:1> ) ) ; return i + <NUM_LIT:1> ; } else if ( Character . isLetter ( s . charAt ( i ) ) ) { return scanSymbol ( i ) ; } else if ( Character . isDigit ( s . charAt ( i ) ) || '<CHAR_LIT:.>' == s . charAt ( i ) ) { return scanNumber ( i ) ; } else { tokens . addElement ( makeErrorToken ( i , i + <NUM_LIT:1> ) ) ; return i + <NUM_LIT:1> ; } } private int scanSymbol ( int i ) { int from = i ; while ( i < s . length ( ) && ( Character . isLetter ( s . charAt ( i ) ) || Character . isDigit ( s . charAt ( i ) ) ) ) ++ i ; tokens . addElement ( new Token ( Token . TT_WORD , <NUM_LIT:0> , s , from , i ) ) ; return i ; } private int scanNumber ( int i ) { int from = i ; for ( ; i < s . length ( ) ; ++ i ) if ( '<CHAR_LIT:.>' != s . charAt ( i ) && ! Character . isDigit ( s . charAt ( i ) ) && ! Character . isLetter ( s . charAt ( i ) ) ) break ; String text = s . substring ( from , i ) ; double nval ; try { nval = Double . valueOf ( text ) . doubleValue ( ) ; } catch ( NumberFormatException nfe ) { tokens . addElement ( makeErrorToken ( from , i ) ) ; return i ; } tokens . addElement ( new Token ( Token . TT_NUMBER , nval , s , from , i ) ) ; return i ; } private Token makeErrorToken ( int from , int i ) { return new Token ( Token . TT_ERROR , <NUM_LIT:0> , s , from , i ) ; } } </s>
|
<s> package expr ; import java . io . * ; import java . util . Hashtable ; import java . util . Vector ; public class Parser { static private final Variable pi = Variable . make ( "<STR_LIT>" ) ; static { pi . setValue ( Math . PI ) ; } static public Expr parse ( String input ) throws SyntaxException { return new Parser ( ) . parseString ( input ) ; } private Hashtable allowedVariables = null ; public void allow ( Variable optVariable ) { if ( null == allowedVariables ) { allowedVariables = new Hashtable ( ) ; allowedVariables . put ( pi , pi ) ; } if ( null != optVariable ) allowedVariables . put ( optVariable , optVariable ) ; } Scanner tokens = null ; private Token token = null ; public Expr parseString ( String input ) throws SyntaxException { tokens = new Scanner ( input , operatorChars ) ; return reparse ( ) ; } static private final String operatorChars = "<STR_LIT>" ; private Expr reparse ( ) throws SyntaxException { tokens . index = - <NUM_LIT:1> ; nextToken ( ) ; Expr expr = parseExpr ( <NUM_LIT:0> ) ; if ( token . ttype != Token . TT_EOF ) throw error ( "<STR_LIT>" , SyntaxException . INCOMPLETE , null ) ; return expr ; } private void nextToken ( ) { token = tokens . nextToken ( ) ; } private Expr parseExpr ( int precedence ) throws SyntaxException { Expr expr = parseFactor ( ) ; loop : for ( ; ; ) { int l , r , rator ; switch ( token . ttype ) { case '<CHAR_LIT>' : l = <NUM_LIT:20> ; r = <NUM_LIT> ; rator = Expr . LT ; break ; case Token . TT_LE : l = <NUM_LIT:20> ; r = <NUM_LIT> ; rator = Expr . LE ; break ; case '<CHAR_LIT:=>' : l = <NUM_LIT:20> ; r = <NUM_LIT> ; rator = Expr . EQ ; break ; case Token . TT_NE : l = <NUM_LIT:20> ; r = <NUM_LIT> ; rator = Expr . NE ; break ; case Token . TT_GE : l = <NUM_LIT:20> ; r = <NUM_LIT> ; rator = Expr . GE ; break ; case '<CHAR_LIT:>>' : l = <NUM_LIT:20> ; r = <NUM_LIT> ; rator = Expr . GT ; break ; case '<CHAR_LIT>' : l = <NUM_LIT:30> ; r = <NUM_LIT:31> ; rator = Expr . ADD ; break ; case '<CHAR_LIT:->' : l = <NUM_LIT:30> ; r = <NUM_LIT:31> ; rator = Expr . SUB ; break ; case '<CHAR_LIT:/>' : l = <NUM_LIT> ; r = <NUM_LIT> ; rator = Expr . DIV ; break ; case '<CHAR_LIT>' : l = <NUM_LIT> ; r = <NUM_LIT> ; rator = Expr . MUL ; break ; case '<CHAR_LIT>' : l = <NUM_LIT> ; r = <NUM_LIT> ; rator = Expr . POW ; break ; default : if ( token . ttype == Token . TT_WORD && token . sval . equals ( "<STR_LIT>" ) ) { l = <NUM_LIT:5> ; r = <NUM_LIT:6> ; rator = Expr . AND ; break ; } if ( token . ttype == Token . TT_WORD && token . sval . equals ( "<STR_LIT>" ) ) { l = <NUM_LIT:10> ; r = <NUM_LIT:11> ; rator = Expr . OR ; break ; } break loop ; } if ( l < precedence ) break loop ; nextToken ( ) ; expr = Expr . makeApp2 ( rator , expr , parseExpr ( r ) ) ; } return expr ; } static private final String [ ] procs1 = { "<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>" } ; static private final int [ ] rators1 = { Expr . ABS , Expr . ACOS , Expr . ASIN , Expr . ATAN , Expr . CEIL , Expr . COS , Expr . EXP , Expr . FLOOR , Expr . LOG , Expr . ROUND , Expr . SIN , Expr . SQRT , Expr . TAN } ; static private final String [ ] procs2 = { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" } ; static private final int [ ] rators2 = { Expr . ATAN2 , Expr . MAX , Expr . MIN } ; private Expr parseFactor ( ) throws SyntaxException { switch ( token . ttype ) { case Token . TT_NUMBER : { Expr lit = Expr . makeLiteral ( token . nval ) ; nextToken ( ) ; return lit ; } case Token . TT_WORD : { for ( int i = <NUM_LIT:0> ; i < procs1 . length ; ++ i ) if ( procs1 [ i ] . equals ( token . sval ) ) { nextToken ( ) ; expect ( '<CHAR_LIT:(>' ) ; Expr rand = parseExpr ( <NUM_LIT:0> ) ; expect ( '<CHAR_LIT:)>' ) ; return Expr . makeApp1 ( rators1 [ i ] , rand ) ; } for ( int i = <NUM_LIT:0> ; i < procs2 . length ; ++ i ) if ( procs2 [ i ] . equals ( token . sval ) ) { nextToken ( ) ; expect ( '<CHAR_LIT:(>' ) ; Expr rand1 = parseExpr ( <NUM_LIT:0> ) ; expect ( '<CHAR_LIT:U+002C>' ) ; Expr rand2 = parseExpr ( <NUM_LIT:0> ) ; expect ( '<CHAR_LIT:)>' ) ; return Expr . makeApp2 ( rators2 [ i ] , rand1 , rand2 ) ; } if ( token . sval . equals ( "<STR_LIT>" ) ) { nextToken ( ) ; expect ( '<CHAR_LIT:(>' ) ; Expr test = parseExpr ( <NUM_LIT:0> ) ; expect ( '<CHAR_LIT:U+002C>' ) ; Expr consequent = parseExpr ( <NUM_LIT:0> ) ; expect ( '<CHAR_LIT:U+002C>' ) ; Expr alternative = parseExpr ( <NUM_LIT:0> ) ; expect ( '<CHAR_LIT:)>' ) ; return Expr . makeIfThenElse ( test , consequent , alternative ) ; } Expr var = Variable . make ( token . sval ) ; if ( null != allowedVariables && null == allowedVariables . get ( var ) ) throw error ( "<STR_LIT>" , SyntaxException . UNKNOWN_VARIABLE , null ) ; nextToken ( ) ; return var ; } case '<CHAR_LIT:(>' : { nextToken ( ) ; Expr enclosed = parseExpr ( <NUM_LIT:0> ) ; expect ( '<CHAR_LIT:)>' ) ; return enclosed ; } case '<CHAR_LIT:->' : nextToken ( ) ; return Expr . makeApp1 ( Expr . NEG , parseExpr ( <NUM_LIT> ) ) ; case Token . TT_EOF : throw error ( "<STR_LIT>" , SyntaxException . PREMATURE_EOF , null ) ; default : throw error ( "<STR_LIT>" , SyntaxException . BAD_FACTOR , null ) ; } } private SyntaxException error ( String complaint , int reason , String expected ) { return new SyntaxException ( complaint , this , reason , expected ) ; } private void expect ( int ttype ) throws SyntaxException { if ( token . ttype != ttype ) throw error ( "<STR_LIT:'>" + ( char ) ttype + "<STR_LIT>" , SyntaxException . EXPECTED , "<STR_LIT>" + ( char ) ttype ) ; nextToken ( ) ; } boolean tryCorrections ( ) { return tryInsertions ( ) || tryDeletions ( ) || trySubstitutions ( ) ; } private boolean tryInsertions ( ) { Vector v = tokens . tokens ; for ( int i = tokens . index ; <NUM_LIT:0> <= i ; -- i ) { Token t ; if ( i < v . size ( ) ) { t = ( Token ) v . elementAt ( i ) ; } else { String s = tokens . getInput ( ) ; t = new Token ( Token . TT_EOF , <NUM_LIT:0> , s , s . length ( ) , s . length ( ) ) ; } Token [ ] candidates = possibleInsertions ( t ) ; for ( int j = <NUM_LIT:0> ; j < candidates . length ; ++ j ) { v . insertElementAt ( candidates [ j ] , i ) ; try { reparse ( ) ; return true ; } catch ( SyntaxException se ) { v . removeElementAt ( i ) ; } } } return false ; } private boolean tryDeletions ( ) { Vector v = tokens . tokens ; for ( int i = tokens . index ; <NUM_LIT:0> <= i ; -- i ) { if ( v . size ( ) <= i ) continue ; Object t = v . elementAt ( i ) ; v . remove ( i ) ; try { reparse ( ) ; return true ; } catch ( SyntaxException se ) { v . insertElementAt ( t , i ) ; } } return false ; } private boolean trySubstitutions ( ) { Vector v = tokens . tokens ; for ( int i = tokens . index ; <NUM_LIT:0> <= i ; -- i ) { if ( v . size ( ) <= i ) continue ; Token t = ( Token ) v . elementAt ( i ) ; Token [ ] candidates = possibleSubstitutions ( t ) ; for ( int j = <NUM_LIT:0> ; j < candidates . length ; ++ j ) { v . setElementAt ( candidates [ j ] , i ) ; try { reparse ( ) ; return true ; } catch ( SyntaxException se ) { } } v . setElementAt ( t , i ) ; } return false ; } private Token [ ] possibleInsertions ( Token t ) { Token [ ] ts = new Token [ operatorChars . length ( ) + <NUM_LIT:6> + procs1 . length + procs2 . length ] ; int i = <NUM_LIT:0> ; Token one = new Token ( Token . TT_NUMBER , <NUM_LIT:1> , "<STR_LIT:1>" , t ) ; ts [ i ++ ] = one ; for ( int j = <NUM_LIT:0> ; j < operatorChars . length ( ) ; ++ j ) { char c = operatorChars . charAt ( j ) ; ts [ i ++ ] = new Token ( c , <NUM_LIT:0> , Character . toString ( c ) , t ) ; } ts [ i ++ ] = new Token ( Token . TT_WORD , <NUM_LIT:0> , "<STR_LIT:x>" , t ) ; for ( int k = <NUM_LIT:0> ; k < procs1 . length ; ++ k ) ts [ i ++ ] = new Token ( Token . TT_WORD , <NUM_LIT:0> , procs1 [ k ] , t ) ; for ( int m = <NUM_LIT:0> ; m < procs2 . length ; ++ m ) ts [ i ++ ] = new Token ( Token . TT_WORD , <NUM_LIT:0> , procs2 [ m ] , t ) ; ts [ i ++ ] = new Token ( Token . TT_LE , <NUM_LIT:0> , "<STR_LIT>" , t ) ; ts [ i ++ ] = new Token ( Token . TT_NE , <NUM_LIT:0> , "<STR_LIT>" , t ) ; ts [ i ++ ] = new Token ( Token . TT_GE , <NUM_LIT:0> , "<STR_LIT>" , t ) ; ts [ i ++ ] = new Token ( Token . TT_WORD , <NUM_LIT:0> , "<STR_LIT>" , t ) ; return ts ; } private Token [ ] possibleSubstitutions ( Token t ) { return possibleInsertions ( t ) ; } } </s>
|
<s> package expr ; public abstract class Expr { public abstract double value ( ) ; public static final int ADD = <NUM_LIT:0> ; public static final int SUB = <NUM_LIT:1> ; public static final int MUL = <NUM_LIT:2> ; public static final int DIV = <NUM_LIT:3> ; public static final int POW = <NUM_LIT:4> ; public static final int ATAN2 = <NUM_LIT:5> ; public static final int MAX = <NUM_LIT:6> ; public static final int MIN = <NUM_LIT:7> ; public static final int LT = <NUM_LIT:8> ; public static final int LE = <NUM_LIT:9> ; public static final int EQ = <NUM_LIT:10> ; public static final int NE = <NUM_LIT:11> ; public static final int GE = <NUM_LIT:12> ; public static final int GT = <NUM_LIT> ; public static final int AND = <NUM_LIT> ; public static final int OR = <NUM_LIT:15> ; public static final int ABS = <NUM_LIT:100> ; public static final int ACOS = <NUM_LIT> ; public static final int ASIN = <NUM_LIT> ; public static final int ATAN = <NUM_LIT> ; public static final int CEIL = <NUM_LIT> ; public static final int COS = <NUM_LIT> ; public static final int EXP = <NUM_LIT> ; public static final int FLOOR = <NUM_LIT> ; public static final int LOG = <NUM_LIT> ; public static final int NEG = <NUM_LIT> ; public static final int ROUND = <NUM_LIT> ; public static final int SIN = <NUM_LIT> ; public static final int SQRT = <NUM_LIT> ; public static final int TAN = <NUM_LIT> ; public static Expr makeLiteral ( double v ) { return new LiteralExpr ( v ) ; } public static Expr makeApp1 ( int rator , Expr rand ) { Expr app = new UnaryExpr ( rator , rand ) ; return rand instanceof LiteralExpr ? new LiteralExpr ( app . value ( ) ) : app ; } public static Expr makeApp2 ( int rator , Expr rand0 , Expr rand1 ) { Expr app = new BinaryExpr ( rator , rand0 , rand1 ) ; return rand0 instanceof LiteralExpr && rand1 instanceof LiteralExpr ? new LiteralExpr ( app . value ( ) ) : app ; } public static Expr makeIfThenElse ( Expr test , Expr consequent , Expr alternative ) { Expr cond = new ConditionalExpr ( test , consequent , alternative ) ; if ( test instanceof LiteralExpr ) return test . value ( ) != <NUM_LIT:0> ? consequent : alternative ; else return cond ; } } class LiteralExpr extends Expr { double v ; LiteralExpr ( double v ) { this . v = v ; } public double value ( ) { return v ; } } class UnaryExpr extends Expr { int rator ; Expr rand ; UnaryExpr ( int rator , Expr rand ) { this . rator = rator ; this . rand = rand ; } public double value ( ) { double arg = rand . value ( ) ; switch ( rator ) { case ABS : return Math . abs ( arg ) ; case ACOS : return Math . acos ( arg ) ; case ASIN : return Math . asin ( arg ) ; case ATAN : return Math . atan ( arg ) ; case CEIL : return Math . ceil ( arg ) ; case COS : return Math . cos ( arg ) ; case EXP : return Math . exp ( arg ) ; case FLOOR : return Math . floor ( arg ) ; case LOG : return Math . log ( arg ) ; case NEG : return - arg ; case ROUND : return Math . rint ( arg ) ; case SIN : return Math . sin ( arg ) ; case SQRT : return Math . sqrt ( arg ) ; case TAN : return Math . tan ( arg ) ; default : throw new RuntimeException ( "<STR_LIT>" ) ; } } } class BinaryExpr extends Expr { int rator ; Expr rand0 , rand1 ; BinaryExpr ( int rator , Expr rand0 , Expr rand1 ) { this . rator = rator ; this . rand0 = rand0 ; this . rand1 = rand1 ; } public double value ( ) { double arg0 = rand0 . value ( ) ; double arg1 = rand1 . value ( ) ; switch ( rator ) { case ADD : return arg0 + arg1 ; case SUB : return arg0 - arg1 ; case MUL : return arg0 * arg1 ; case DIV : return arg0 / arg1 ; case POW : return Math . pow ( arg0 , arg1 ) ; case ATAN2 : return Math . atan2 ( arg0 , arg1 ) ; case MAX : return arg0 < arg1 ? arg1 : arg0 ; case MIN : return arg0 < arg1 ? arg0 : arg1 ; case LT : return arg0 < arg1 ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; case LE : return arg0 <= arg1 ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; case EQ : return arg0 == arg1 ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; case NE : return arg0 != arg1 ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; case GE : return arg0 >= arg1 ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; case GT : return arg0 > arg1 ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; case AND : return arg0 != <NUM_LIT:0> && arg1 != <NUM_LIT:0> ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; case OR : return arg0 != <NUM_LIT:0> || arg1 != <NUM_LIT:0> ? <NUM_LIT:1.0> : <NUM_LIT:0.0> ; default : throw new RuntimeException ( "<STR_LIT>" ) ; } } } class ConditionalExpr extends Expr { Expr test , consequent , alternative ; ConditionalExpr ( Expr test , Expr consequent , Expr alternative ) { this . test = test ; this . consequent = consequent ; this . alternative = alternative ; } public double value ( ) { return test . value ( ) != <NUM_LIT:0> ? consequent . value ( ) : alternative . value ( ) ; } } </s>
|
<s> package expr ; public class Example { public static void main ( String [ ] args ) { Expr expr ; try { expr = Parser . parse ( args [ <NUM_LIT:0> ] ) ; } catch ( SyntaxException e ) { System . err . println ( e . explain ( ) ) ; return ; } double low = Double . valueOf ( args [ <NUM_LIT:1> ] ) . doubleValue ( ) ; double high = Double . valueOf ( args [ <NUM_LIT:2> ] ) . doubleValue ( ) ; double step = Double . valueOf ( args [ <NUM_LIT:3> ] ) . doubleValue ( ) ; Variable x = Variable . make ( "<STR_LIT:x>" ) ; for ( double xval = low ; xval <= high ; xval += step ) { x . setValue ( xval ) ; System . out . println ( expr . value ( ) ) ; } } } </s>
|
<s> package expr ; import java . util . Hashtable ; public class Variable extends Expr { private static Hashtable variables = new Hashtable ( ) ; static public synchronized Variable make ( String name ) { Variable result = ( Variable ) variables . get ( name ) ; if ( result == null ) variables . put ( name , result = new Variable ( name ) ) ; return result ; } private String name ; private double val ; public Variable ( String name ) { this . name = name ; val = <NUM_LIT:0> ; } public String toString ( ) { return name ; } public double value ( ) { return val ; } public void setValue ( double value ) { val = value ; } } </s>
|
<s> package com . rusticisoftware . cloudjavasample ; import com . rusticisoftware . hostedengine . client . * ; import java . util . * ; import java . io . * ; public class SampleConfig { public static ScormEngineService GetScormEngineService ( ) throws FileNotFoundException , IOException { Properties props = new Properties ( ) ; InputStream is = SampleConfig . class . getClassLoader ( ) . getResourceAsStream ( "<STR_LIT>" ) ; props . loadFromXML ( is ) ; String appId = props . getProperty ( "<STR_LIT>" ) ; String secretKey = props . getProperty ( "<STR_LIT>" ) ; String serviceUrl = props . getProperty ( "<STR_LIT>" ) ; String origin = props . getProperty ( "<STR_LIT>" ) ; return new ScormEngineService ( serviceUrl , appId , secretKey , origin ) ; } } </s>
|
<s> package net . virifi . android . spmodemail ; import android . app . Activity ; import android . os . Bundle ; import android . view . View ; import android . view . View . OnClickListener ; import android . widget . Button ; import android . widget . LinearLayout ; import android . widget . TextView ; public class CheckWlanPasswordActivity extends Activity { @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; LinearLayout ll = new LinearLayout ( this ) ; ll . setOrientation ( LinearLayout . VERTICAL ) ; setContentView ( ll ) ; TextView textView = new TextView ( this ) ; textView . setText ( "<STR_LIT>" ) ; ll . addView ( textView ) ; Button button = new Button ( this ) ; button . setText ( "<STR_LIT:OK>" ) ; button . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { setResult ( RESULT_OK ) ; finish ( ) ; } } ) ; ll . addView ( button ) ; } } </s>
|
<s> package net . virifi . android . spmodemail ; import android . content . Context ; import android . content . SharedPreferences ; import android . content . SharedPreferences . Editor ; public class WlanPasswordManager { private static final String PREF_NAME = "<STR_LIT>" ; private static final String WLAN_PASS = "<STR_LIT>" ; public static String getWlanPassword ( Context context ) { SharedPreferences pref = context . getSharedPreferences ( PREF_NAME , Context . MODE_PRIVATE ) ; return pref . getString ( WLAN_PASS , "<STR_LIT>" ) ; } public static void saveWlanPassword ( Context context , String password ) { SharedPreferences pref = context . getSharedPreferences ( PREF_NAME , Context . MODE_PRIVATE ) ; Editor editor = pref . edit ( ) ; editor . putString ( WLAN_PASS , password ) ; editor . commit ( ) ; } } </s>
|
<s> package net . virifi . android . spmodemail ; import android . app . Activity ; import android . os . Bundle ; import android . text . InputType ; import android . view . View ; import android . view . View . OnClickListener ; import android . widget . Button ; import android . widget . EditText ; import android . widget . LinearLayout ; import android . widget . TextView ; public class SaveWlanPasswordActivity extends Activity { @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; LinearLayout ll = new LinearLayout ( this ) ; ll . setOrientation ( LinearLayout . VERTICAL ) ; setContentView ( ll ) ; TextView textView = new TextView ( this ) ; textView . setText ( "<STR_LIT>" ) ; ll . addView ( textView ) ; final EditText editText = new EditText ( this ) ; editText . setText ( WlanPasswordManager . getWlanPassword ( this ) ) ; editText . setInputType ( InputType . TYPE_CLASS_TEXT | InputType . TYPE_TEXT_VARIATION_PASSWORD ) ; ll . addView ( editText ) ; LinearLayout ll2 = new LinearLayout ( this ) ; ll2 . setOrientation ( LinearLayout . HORIZONTAL ) ; ll . addView ( ll2 ) ; Button cancelButton = new Button ( this ) ; cancelButton . setText ( "<STR_LIT>" ) ; ll2 . addView ( cancelButton ) ; Button saveButton = new Button ( this ) ; saveButton . setText ( "<STR_LIT>" ) ; ll2 . addView ( saveButton ) ; cancelButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { setResult ( RESULT_CANCELED ) ; finish ( ) ; } } ) ; saveButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { String password = editText . getText ( ) . toString ( ) ; WlanPasswordManager . saveWlanPassword ( SaveWlanPasswordActivity . this , password ) ; setResult ( RESULT_OK ) ; finish ( ) ; } } ) ; } } </s>
|
<s> package jp . co . nttdocomo . carriermail ; import android . app . Activity ; import android . os . Bundle ; public class SPModeMailDummyActivity extends Activity { @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . main ) ; } } </s>
|
<s> package jp . co . nttdocomo . carriermail ; import android . app . Service ; import android . content . Intent ; import android . os . IBinder ; public class SMSService extends Service { @ Override public IBinder onBind ( Intent intent ) { return null ; } @ Override public int onStartCommand ( Intent intent , int flags , int startId ) { super . onStartCommand ( intent , flags , startId ) ; Intent smsservice = new Intent ( "<STR_LIT>" ) ; smsservice . setClassName ( "<STR_LIT>" , "<STR_LIT>" ) ; smsservice . setType ( "<STR_LIT>" ) ; byte [ ] pdu = intent . getByteArrayExtra ( "<STR_LIT:data>" ) ; smsservice . putExtra ( "<STR_LIT:data>" , pdu ) ; startService ( smsservice ) ; stopSelf ( startId ) ; return START_STICKY ; } } </s>
|
<s> package net . virifi . android . spswitcher ; import com . android . internal . telephony . IWapPushManager ; import android . app . Activity ; import android . content . ComponentName ; import android . content . Context ; import android . content . Intent ; import android . content . ServiceConnection ; import android . os . Bundle ; import android . os . IBinder ; import android . os . RemoteException ; import android . view . View ; import android . view . View . OnClickListener ; import android . widget . Button ; import android . widget . Toast ; public class SPPushSwitcherActivity extends Activity { IWapPushManager mWapPushManager = null ; private ServiceConnection mConnection = new ServiceConnection ( ) { @ Override public void onServiceConnected ( ComponentName name , IBinder service ) { mWapPushManager = IWapPushManager . Stub . asInterface ( service ) ; } @ Override public void onServiceDisconnected ( ComponentName name ) { mWapPushManager = null ; } } ; @ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . main ) ; bindService ( new Intent ( IWapPushManager . class . getName ( ) ) , mConnection , Context . BIND_AUTO_CREATE ) ; Button spmodemailButton = ( Button ) findViewById ( R . id . spmodemail_button ) ; spmodemailButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { boolean success = false ; try { deleteBothPackage ( ) ; success = mWapPushManager . addPackage ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT:1> , false , false ) ; } catch ( RemoteException e ) { e . printStackTrace ( ) ; } if ( success ) { Toast . makeText ( getApplicationContext ( ) , "<STR_LIT>" , Toast . LENGTH_SHORT ) . show ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , "<STR_LIT>" , Toast . LENGTH_SHORT ) . show ( ) ; } } } ) ; Button communicaseButton = ( Button ) findViewById ( R . id . communicase_button ) ; communicaseButton . setOnClickListener ( new OnClickListener ( ) { @ Override public void onClick ( View v ) { boolean success = false ; try { deleteBothPackage ( ) ; success = mWapPushManager . addPackage ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , <NUM_LIT:1> , false , false ) ; } catch ( RemoteException e ) { e . printStackTrace ( ) ; } if ( success ) { Toast . makeText ( getApplicationContext ( ) , "<STR_LIT>" , Toast . LENGTH_SHORT ) . show ( ) ; } else { Toast . makeText ( getApplicationContext ( ) , "<STR_LIT>" , Toast . LENGTH_SHORT ) . show ( ) ; } } } ) ; } @ Override protected void onDestroy ( ) { super . onDestroy ( ) ; unbindService ( mConnection ) ; } private void deleteBothPackage ( ) { try { mWapPushManager . deletePackage ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ; mWapPushManager . deletePackage ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ) ; } catch ( RemoteException e ) { e . printStackTrace ( ) ; } } } </s>
|
<s> package net . minecraft . server ; import java . io . File ; import java . io . IOException ; import java . net . InetAddress ; import java . net . UnknownHostException ; import java . util . ArrayList ; import java . util . Collections ; import java . util . HashMap ; import java . util . Iterator ; import java . util . List ; import java . util . Random ; import java . util . Set ; import java . util . logging . Level ; import java . util . logging . Logger ; import net . minecraft . src . AnvilSaveConverter ; import net . minecraft . src . AnvilSaveHandler ; import net . minecraft . src . AxisAlignedBB ; import net . minecraft . src . ChunkCoordinates ; import net . minecraft . src . ChunkProviderServer ; import net . minecraft . src . ConsoleCommandHandler ; import net . minecraft . src . ConsoleLogManager ; import net . minecraft . src . ConvertProgressUpdater ; import net . minecraft . src . EntityTracker ; import net . minecraft . src . ICommandListener ; import net . minecraft . src . ISaveFormat ; import net . minecraft . src . IServer ; import net . minecraft . src . IUpdatePlayerListBox ; import net . minecraft . src . MathHelper ; import net . minecraft . src . NetworkListenThread ; import net . minecraft . src . Packet ; import net . minecraft . src . Packet4UpdateTime ; import net . minecraft . src . PropertyManager ; import net . minecraft . src . RConConsoleSource ; import net . minecraft . src . RConThreadMain ; import net . minecraft . src . RConThreadQuery ; import net . minecraft . src . ServerCommand ; import net . minecraft . src . ServerConfigurationManager ; import net . minecraft . src . ServerGUI ; import net . minecraft . src . StatList ; import net . minecraft . src . ThreadCommandReader ; import net . minecraft . src . ThreadServerApplication ; import net . minecraft . src . ThreadServerSleep ; import net . minecraft . src . Vec3D ; import net . minecraft . src . WorldInfo ; import net . minecraft . src . WorldManager ; import net . minecraft . src . WorldProvider ; import net . minecraft . src . WorldServer ; import net . minecraft . src . WorldServerMulti ; import net . minecraft . src . WorldSettings ; import net . minecraft . src . WorldType ; public class MinecraftServer implements Runnable , ICommandListener , IServer { public static Logger logger = Logger . getLogger ( "<STR_LIT>" ) ; public static HashMap field_6037_b = new HashMap ( ) ; private String hostname ; private int serverPort ; public NetworkListenThread networkServer ; public PropertyManager propertyManagerObj ; public WorldServer worldMngr [ ] ; public long field_40027_f [ ] ; public long field_40028_g [ ] [ ] ; public ServerConfigurationManager configManager ; private ConsoleCommandHandler commandHandler ; private boolean serverRunning ; public boolean serverStopped ; int deathTime ; public String currentTask ; public int percentDone ; private List playersOnline ; private List commands ; public EntityTracker entityTracker [ ] ; public boolean onlineMode ; public boolean spawnPeacefulMobs ; public boolean field_44002_p ; public boolean pvpOn ; public boolean allowFlight ; public String motd ; public int buildLimit ; private long field_48074_E ; private long field_48075_F ; private long field_48076_G ; private long field_48077_H ; public long field_48080_u [ ] ; public long field_48079_v [ ] ; public long field_48078_w [ ] ; public long field_48082_x [ ] ; private RConThreadQuery rconQueryThread ; private RConThreadMain rconMainThread ; public MinecraftServer ( ) { field_40027_f = new long [ <NUM_LIT:100> ] ; serverRunning = true ; serverStopped = false ; deathTime = <NUM_LIT:0> ; playersOnline = new ArrayList ( ) ; commands = Collections . synchronizedList ( new ArrayList ( ) ) ; entityTracker = new EntityTracker [ <NUM_LIT:3> ] ; field_48080_u = new long [ <NUM_LIT:100> ] ; field_48079_v = new long [ <NUM_LIT:100> ] ; field_48078_w = new long [ <NUM_LIT:100> ] ; field_48082_x = new long [ <NUM_LIT:100> ] ; new ThreadServerSleep ( this ) ; } private boolean startServer ( ) throws UnknownHostException { commandHandler = new ConsoleCommandHandler ( this ) ; ThreadCommandReader threadcommandreader = new ThreadCommandReader ( this ) ; threadcommandreader . setDaemon ( true ) ; threadcommandreader . start ( ) ; ConsoleLogManager . init ( ) ; logger . info ( "<STR_LIT>" ) ; if ( Runtime . getRuntime ( ) . maxMemory ( ) / <NUM_LIT> / <NUM_LIT> < <NUM_LIT> ) { logger . warning ( "<STR_LIT>" ) ; } logger . info ( "<STR_LIT>" ) ; propertyManagerObj = new PropertyManager ( new File ( "<STR_LIT>" ) ) ; hostname = propertyManagerObj . getStringProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; onlineMode = propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , true ) ; spawnPeacefulMobs = propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , true ) ; field_44002_p = propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , true ) ; pvpOn = propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , true ) ; allowFlight = propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , false ) ; motd = propertyManagerObj . getStringProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; motd . replace ( '<STR_LIT>' , '<CHAR_LIT>' ) ; InetAddress inetaddress = null ; if ( hostname . length ( ) > <NUM_LIT:0> ) { inetaddress = InetAddress . getByName ( hostname ) ; } serverPort = propertyManagerObj . getIntProperty ( "<STR_LIT>" , <NUM_LIT> ) ; logger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( hostname . length ( ) != <NUM_LIT:0> ? hostname : "<STR_LIT:*>" ) . append ( "<STR_LIT::>" ) . append ( serverPort ) . toString ( ) ) ; try { networkServer = new NetworkListenThread ( this , inetaddress , serverPort ) ; } catch ( IOException ioexception ) { logger . warning ( "<STR_LIT>" ) ; logger . log ( Level . WARNING , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( ioexception . toString ( ) ) . toString ( ) ) ; logger . warning ( "<STR_LIT>" ) ; return false ; } if ( ! onlineMode ) { logger . warning ( "<STR_LIT>" ) ; logger . warning ( "<STR_LIT>" ) ; logger . warning ( "<STR_LIT>" ) ; logger . warning ( "<STR_LIT>" ) ; } configManager = new ServerConfigurationManager ( this ) ; entityTracker [ <NUM_LIT:0> ] = new EntityTracker ( this , <NUM_LIT:0> ) ; entityTracker [ <NUM_LIT:1> ] = new EntityTracker ( this , - <NUM_LIT:1> ) ; entityTracker [ <NUM_LIT:2> ] = new EntityTracker ( this , <NUM_LIT:1> ) ; long l = System . nanoTime ( ) ; String s = propertyManagerObj . getStringProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; String s1 = propertyManagerObj . getStringProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; String s2 = propertyManagerObj . getStringProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; long l1 = ( new Random ( ) ) . nextLong ( ) ; if ( s1 . length ( ) > <NUM_LIT:0> ) { try { long l2 = Long . parseLong ( s1 ) ; if ( l2 != <NUM_LIT> ) { l1 = l2 ; } } catch ( NumberFormatException numberformatexception ) { l1 = s1 . hashCode ( ) ; } } WorldType worldtype = WorldType . parseWorldType ( s2 ) ; if ( worldtype == null ) { worldtype = WorldType . DEFAULT ; } buildLimit = propertyManagerObj . getIntProperty ( "<STR_LIT>" , <NUM_LIT> ) ; buildLimit = ( ( buildLimit + <NUM_LIT:8> ) / <NUM_LIT:16> ) * <NUM_LIT:16> ; buildLimit = MathHelper . clamp_int ( buildLimit , <NUM_LIT> , <NUM_LIT> ) ; propertyManagerObj . setProperty ( "<STR_LIT>" , Integer . valueOf ( buildLimit ) ) ; logger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s ) . append ( "<STR_LIT:\">" ) . toString ( ) ) ; initWorld ( new AnvilSaveConverter ( new File ( "<STR_LIT:.>" ) ) , s , l1 , worldtype ) ; long l3 = System . nanoTime ( ) - l ; String s3 = String . format ( "<STR_LIT>" , new Object [ ] { Double . valueOf ( ( double ) l3 / <NUM_LIT> ) } ) ; logger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s3 ) . append ( "<STR_LIT>" ) . toString ( ) ) ; if ( propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , false ) ) { logger . info ( "<STR_LIT>" ) ; rconQueryThread = new RConThreadQuery ( this ) ; rconQueryThread . startThread ( ) ; } if ( propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , false ) ) { logger . info ( "<STR_LIT>" ) ; rconMainThread = new RConThreadMain ( this ) ; rconMainThread . startThread ( ) ; } return true ; } private void initWorld ( ISaveFormat par1ISaveFormat , String par2Str , long par3 , WorldType par5WorldType ) { if ( par1ISaveFormat . isOldMapFormat ( par2Str ) ) { logger . info ( "<STR_LIT>" ) ; par1ISaveFormat . convertMapFormat ( par2Str , new ConvertProgressUpdater ( this ) ) ; } worldMngr = new WorldServer [ <NUM_LIT:3> ] ; field_40028_g = new long [ worldMngr . length ] [ <NUM_LIT:100> ] ; int i = propertyManagerObj . getIntProperty ( "<STR_LIT>" , <NUM_LIT:0> ) ; i = WorldSettings . validGameType ( i ) ; logger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( i ) . toString ( ) ) ; boolean flag = propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , true ) ; WorldSettings worldsettings = new WorldSettings ( par3 , i , flag , false , par5WorldType ) ; AnvilSaveHandler anvilsavehandler = new AnvilSaveHandler ( new File ( "<STR_LIT:.>" ) , par2Str , true ) ; for ( int j = <NUM_LIT:0> ; j < worldMngr . length ; j ++ ) { byte byte0 = <NUM_LIT:0> ; if ( j == <NUM_LIT:1> ) { byte0 = - <NUM_LIT:1> ; } if ( j == <NUM_LIT:2> ) { byte0 = <NUM_LIT:1> ; } if ( j == <NUM_LIT:0> ) { worldMngr [ j ] = new WorldServer ( this , anvilsavehandler , par2Str , byte0 , worldsettings ) ; } else { worldMngr [ j ] = new WorldServerMulti ( this , anvilsavehandler , par2Str , byte0 , worldsettings , worldMngr [ <NUM_LIT:0> ] ) ; } worldMngr [ j ] . addWorldAccess ( new WorldManager ( this , worldMngr [ j ] ) ) ; worldMngr [ j ] . difficultySetting = propertyManagerObj . getIntProperty ( "<STR_LIT>" , <NUM_LIT:1> ) ; worldMngr [ j ] . setAllowedSpawnTypes ( propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , true ) , spawnPeacefulMobs ) ; worldMngr [ j ] . getWorldInfo ( ) . setGameType ( i ) ; configManager . setPlayerManager ( worldMngr ) ; } char c = '<STR_LIT>' ; long l = System . currentTimeMillis ( ) ; for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:1> ; k ++ ) { logger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( k ) . toString ( ) ) ; WorldServer worldserver = worldMngr [ k ] ; ChunkCoordinates chunkcoordinates = worldserver . getSpawnPoint ( ) ; for ( int i1 = - c ; i1 <= c && serverRunning ; i1 += <NUM_LIT:16> ) { for ( int j1 = - c ; j1 <= c && serverRunning ; j1 += <NUM_LIT:16> ) { long l1 = System . currentTimeMillis ( ) ; if ( l1 < l ) { l = l1 ; } if ( l1 > l + <NUM_LIT> ) { int k1 = ( c * <NUM_LIT:2> + <NUM_LIT:1> ) * ( c * <NUM_LIT:2> + <NUM_LIT:1> ) ; int i2 = ( i1 + c ) * ( c * <NUM_LIT:2> + <NUM_LIT:1> ) + ( j1 + <NUM_LIT:1> ) ; outputPercentRemaining ( "<STR_LIT>" , ( i2 * <NUM_LIT:100> ) / k1 ) ; l = l1 ; } worldserver . chunkProviderServer . loadChunk ( chunkcoordinates . posX + i1 > > <NUM_LIT:4> , chunkcoordinates . posZ + j1 > > <NUM_LIT:4> ) ; while ( worldserver . updatingLighting ( ) && serverRunning ) ; } } } clearCurrentTask ( ) ; } private void outputPercentRemaining ( String par1Str , int par2 ) { currentTask = par1Str ; percentDone = par2 ; logger . info ( ( new StringBuilder ( ) ) . append ( par1Str ) . append ( "<STR_LIT::U+0020>" ) . append ( par2 ) . append ( "<STR_LIT:%>" ) . toString ( ) ) ; } private void clearCurrentTask ( ) { currentTask = null ; percentDone = <NUM_LIT:0> ; } private void saveServerWorld ( ) { logger . info ( "<STR_LIT>" ) ; for ( int i = <NUM_LIT:0> ; i < worldMngr . length ; i ++ ) { WorldServer worldserver = worldMngr [ i ] ; worldserver . saveWorld ( true , null ) ; worldserver . func_30006_w ( ) ; } } private void stopServer ( ) { logger . info ( "<STR_LIT>" ) ; if ( configManager != null ) { configManager . savePlayerStates ( ) ; } for ( int i = <NUM_LIT:0> ; i < worldMngr . length ; i ++ ) { WorldServer worldserver = worldMngr [ i ] ; if ( worldserver != null ) { saveServerWorld ( ) ; } } } public void initiateShutdown ( ) { serverRunning = false ; } public void run ( ) { try { if ( this . startServer ( ) ) { long var1 = System . currentTimeMillis ( ) ; for ( long var3 = <NUM_LIT> ; this . serverRunning ; Thread . sleep ( <NUM_LIT:1L> ) ) { long var5 = System . currentTimeMillis ( ) ; long var7 = var5 - var1 ; if ( var7 > <NUM_LIT> ) { logger . warning ( "<STR_LIT>" ) ; var7 = <NUM_LIT> ; } if ( var7 < <NUM_LIT> ) { logger . warning ( "<STR_LIT>" ) ; var7 = <NUM_LIT> ; } var3 += var7 ; var1 = var5 ; if ( this . worldMngr [ <NUM_LIT:0> ] . isAllPlayersFullyAsleep ( ) ) { this . doTick ( ) ; var3 = <NUM_LIT> ; } else { while ( var3 > <NUM_LIT> ) { var3 -= <NUM_LIT> ; this . doTick ( ) ; } } } } else { while ( this . serverRunning ) { this . commandLineParser ( ) ; try { Thread . sleep ( <NUM_LIT> ) ; } catch ( InterruptedException var57 ) { var57 . printStackTrace ( ) ; } } } } catch ( Throwable var58 ) { var58 . printStackTrace ( ) ; logger . log ( Level . SEVERE , "<STR_LIT>" , var58 ) ; while ( this . serverRunning ) { this . commandLineParser ( ) ; try { Thread . sleep ( <NUM_LIT> ) ; } catch ( InterruptedException var56 ) { var56 . printStackTrace ( ) ; } } } finally { try { this . stopServer ( ) ; this . serverStopped = true ; } catch ( Throwable var54 ) { var54 . printStackTrace ( ) ; } finally { System . exit ( <NUM_LIT:0> ) ; } } } private void doTick ( ) { long l = System . nanoTime ( ) ; ArrayList arraylist = new ArrayList ( ) ; for ( Iterator iterator = field_6037_b . keySet ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { String s = ( String ) iterator . next ( ) ; int j1 = ( ( Integer ) field_6037_b . get ( s ) ) . intValue ( ) ; if ( j1 > <NUM_LIT:0> ) { field_6037_b . put ( s , Integer . valueOf ( j1 - <NUM_LIT:1> ) ) ; } else { arraylist . add ( s ) ; } } for ( int i = <NUM_LIT:0> ; i < arraylist . size ( ) ; i ++ ) { field_6037_b . remove ( arraylist . get ( i ) ) ; } AxisAlignedBB . clearBoundingBoxPool ( ) ; Vec3D . initialize ( ) ; deathTime ++ ; for ( int j = <NUM_LIT:0> ; j < worldMngr . length ; j ++ ) { long l1 = System . nanoTime ( ) ; if ( j == <NUM_LIT:0> || propertyManagerObj . getBooleanProperty ( "<STR_LIT>" , true ) ) { WorldServer worldserver = worldMngr [ j ] ; if ( deathTime % <NUM_LIT:20> == <NUM_LIT:0> ) { configManager . sendPacketToAllPlayersInDimension ( new Packet4UpdateTime ( worldserver . getWorldTime ( ) ) , worldserver . worldProvider . worldType ) ; } worldserver . tick ( ) ; while ( worldserver . updatingLighting ( ) ) ; worldserver . updateEntities ( ) ; } field_40028_g [ j ] [ deathTime % <NUM_LIT:100> ] = System . nanoTime ( ) - l1 ; } networkServer . handleNetworkListenThread ( ) ; configManager . onTick ( ) ; for ( int k = <NUM_LIT:0> ; k < entityTracker . length ; k ++ ) { entityTracker [ k ] . updateTrackedEntities ( ) ; } for ( int i1 = <NUM_LIT:0> ; i1 < playersOnline . size ( ) ; i1 ++ ) { ( ( IUpdatePlayerListBox ) playersOnline . get ( i1 ) ) . update ( ) ; } try { commandLineParser ( ) ; } catch ( Exception exception ) { logger . log ( Level . WARNING , "<STR_LIT>" , exception ) ; } field_40027_f [ deathTime % <NUM_LIT:100> ] = System . nanoTime ( ) - l ; field_48080_u [ deathTime % <NUM_LIT:100> ] = Packet . field_48099_n - field_48074_E ; field_48074_E = Packet . field_48099_n ; field_48079_v [ deathTime % <NUM_LIT:100> ] = Packet . field_48100_o - field_48075_F ; field_48075_F = Packet . field_48100_o ; field_48078_w [ deathTime % <NUM_LIT:100> ] = Packet . field_48101_l - field_48076_G ; field_48076_G = Packet . field_48101_l ; field_48082_x [ deathTime % <NUM_LIT:100> ] = Packet . field_48102_m - field_48077_H ; field_48077_H = Packet . field_48102_m ; } public void addCommand ( String par1Str , ICommandListener par2ICommandListener ) { commands . add ( new ServerCommand ( par1Str , par2ICommandListener ) ) ; } public void commandLineParser ( ) { ServerCommand servercommand ; for ( ; commands . size ( ) > <NUM_LIT:0> ; commandHandler . handleCommand ( servercommand ) ) { servercommand = ( ServerCommand ) commands . remove ( <NUM_LIT:0> ) ; } } public void addToOnlinePlayerList ( IUpdatePlayerListBox par1IUpdatePlayerListBox ) { playersOnline . add ( par1IUpdatePlayerListBox ) ; } public static void main ( String par0ArrayOfStr [ ] ) { StatList . func_27092_a ( ) ; try { MinecraftServer minecraftserver = new MinecraftServer ( ) ; if ( ! java . awt . GraphicsEnvironment . isHeadless ( ) && ( par0ArrayOfStr . length <= <NUM_LIT:0> || ! par0ArrayOfStr [ <NUM_LIT:0> ] . equals ( "<STR_LIT>" ) ) ) { ServerGUI . initGui ( minecraftserver ) ; } ( new ThreadServerApplication ( "<STR_LIT>" , minecraftserver ) ) . start ( ) ; } catch ( Exception exception ) { logger . log ( Level . SEVERE , "<STR_LIT>" , exception ) ; } } public File getFile ( String par1Str ) { return new File ( par1Str ) ; } public void log ( String par1Str ) { logger . info ( par1Str ) ; } public void logWarning ( String par1Str ) { logger . warning ( par1Str ) ; } public String getUsername ( ) { return "<STR_LIT>" ; } public WorldServer getWorldManager ( int par1 ) { if ( par1 == - <NUM_LIT:1> ) { return worldMngr [ <NUM_LIT:1> ] ; } if ( par1 == <NUM_LIT:1> ) { return worldMngr [ <NUM_LIT:2> ] ; } else { return worldMngr [ <NUM_LIT:0> ] ; } } public EntityTracker getEntityTracker ( int par1 ) { if ( par1 == - <NUM_LIT:1> ) { return entityTracker [ <NUM_LIT:1> ] ; } if ( par1 == <NUM_LIT:1> ) { return entityTracker [ <NUM_LIT:2> ] ; } else { return entityTracker [ <NUM_LIT:0> ] ; } } public int getIntProperty ( String par1Str , int par2 ) { return propertyManagerObj . getIntProperty ( par1Str , par2 ) ; } public String getStringProperty ( String par1Str , String par2Str ) { return propertyManagerObj . getStringProperty ( par1Str , par2Str ) ; } public void setProperty ( String par1Str , Object par2Obj ) { propertyManagerObj . setProperty ( par1Str , par2Obj ) ; } public void saveProperties ( ) { propertyManagerObj . saveProperties ( ) ; } public String getSettingsFilename ( ) { File file = propertyManagerObj . getPropertiesFile ( ) ; if ( file != null ) { return file . getAbsolutePath ( ) ; } else { return "<STR_LIT>" ; } } public String getHostname ( ) { return hostname ; } public int getPort ( ) { return serverPort ; } public String getMotd ( ) { return motd ; } public String getVersionString ( ) { return "<STR_LIT>" ; } public int playersOnline ( ) { return configManager . playersOnline ( ) ; } public int getMaxPlayers ( ) { return configManager . getMaxPlayers ( ) ; } public String [ ] getPlayerNamesAsList ( ) { return configManager . getPlayerNamesAsList ( ) ; } public String getWorldName ( ) { return propertyManagerObj . getStringProperty ( "<STR_LIT>" , "<STR_LIT>" ) ; } public String getPlugin ( ) { return "<STR_LIT>" ; } public void func_40010_o ( ) { } public String handleRConCommand ( String par1Str ) { RConConsoleSource . instance . resetLog ( ) ; commandHandler . handleCommand ( new ServerCommand ( par1Str , RConConsoleSource . instance ) ) ; return RConConsoleSource . instance . getLogContents ( ) ; } public boolean isDebuggingEnabled ( ) { return false ; } public void logSevere ( String par1Str ) { logger . log ( Level . SEVERE , par1Str ) ; } public void logIn ( String par1Str ) { if ( isDebuggingEnabled ( ) ) { logger . log ( Level . INFO , par1Str ) ; } } public String [ ] getBannedIPsList ( ) { return ( String [ ] ) configManager . getBannedIPsList ( ) . toArray ( new String [ <NUM_LIT:0> ] ) ; } public String [ ] getBannedPlayersList ( ) { return ( String [ ] ) configManager . getBannedPlayersList ( ) . toArray ( new String [ <NUM_LIT:0> ] ) ; } public String func_52003_getServerModName ( ) { return "<STR_LIT>" ; } public static boolean isServerRunning ( MinecraftServer par0MinecraftServer ) { return par0MinecraftServer . serverRunning ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockButton extends Block { protected BlockButton ( int par1 , int par2 ) { super ( par1 , par2 , Material . circuits ) ; setTickRandomly ( true ) ; } public AxisAlignedBB getCollisionBoundingBoxFromPool ( World par1World , int par2 , int par3 , int i ) { return null ; } public int tickRate ( ) { return <NUM_LIT:20> ; } public boolean isOpaqueCube ( ) { return false ; } public boolean renderAsNormalBlock ( ) { return false ; } public boolean canPlaceBlockOnSide ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( par5 == <NUM_LIT:2> && par1World . isBlockNormalCube ( par2 , par3 , par4 + <NUM_LIT:1> ) ) { return true ; } if ( par5 == <NUM_LIT:3> && par1World . isBlockNormalCube ( par2 , par3 , par4 - <NUM_LIT:1> ) ) { return true ; } if ( par5 == <NUM_LIT:4> && par1World . isBlockNormalCube ( par2 + <NUM_LIT:1> , par3 , par4 ) ) { return true ; } return par5 == <NUM_LIT:5> && par1World . isBlockNormalCube ( par2 - <NUM_LIT:1> , par3 , par4 ) ; } public boolean canPlaceBlockAt ( World par1World , int par2 , int par3 , int par4 ) { if ( par1World . isBlockNormalCube ( par2 - <NUM_LIT:1> , par3 , par4 ) ) { return true ; } if ( par1World . isBlockNormalCube ( par2 + <NUM_LIT:1> , par3 , par4 ) ) { return true ; } if ( par1World . isBlockNormalCube ( par2 , par3 , par4 - <NUM_LIT:1> ) ) { return true ; } return par1World . isBlockNormalCube ( par2 , par3 , par4 + <NUM_LIT:1> ) ; } public void onBlockPlaced ( World par1World , int par2 , int par3 , int par4 , int par5 ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; int j = i & <NUM_LIT:8> ; i &= <NUM_LIT:7> ; if ( par5 == <NUM_LIT:2> && par1World . isBlockNormalCube ( par2 , par3 , par4 + <NUM_LIT:1> ) ) { i = <NUM_LIT:4> ; } else if ( par5 == <NUM_LIT:3> && par1World . isBlockNormalCube ( par2 , par3 , par4 - <NUM_LIT:1> ) ) { i = <NUM_LIT:3> ; } else if ( par5 == <NUM_LIT:4> && par1World . isBlockNormalCube ( par2 + <NUM_LIT:1> , par3 , par4 ) ) { i = <NUM_LIT:2> ; } else if ( par5 == <NUM_LIT:5> && par1World . isBlockNormalCube ( par2 - <NUM_LIT:1> , par3 , par4 ) ) { i = <NUM_LIT:1> ; } else { i = getOrientation ( par1World , par2 , par3 , par4 ) ; } par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i + j ) ; } private int getOrientation ( World par1World , int par2 , int par3 , int par4 ) { if ( par1World . isBlockNormalCube ( par2 - <NUM_LIT:1> , par3 , par4 ) ) { return <NUM_LIT:1> ; } if ( par1World . isBlockNormalCube ( par2 + <NUM_LIT:1> , par3 , par4 ) ) { return <NUM_LIT:2> ; } if ( par1World . isBlockNormalCube ( par2 , par3 , par4 - <NUM_LIT:1> ) ) { return <NUM_LIT:3> ; } return ! par1World . isBlockNormalCube ( par2 , par3 , par4 + <NUM_LIT:1> ) ? <NUM_LIT:1> : <NUM_LIT:4> ; } public void onNeighborBlockChange ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( redundantCanPlaceBlockAt ( par1World , par2 , par3 , par4 ) ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) & <NUM_LIT:7> ; boolean flag = false ; if ( ! par1World . isBlockNormalCube ( par2 - <NUM_LIT:1> , par3 , par4 ) && i == <NUM_LIT:1> ) { flag = true ; } if ( ! par1World . isBlockNormalCube ( par2 + <NUM_LIT:1> , par3 , par4 ) && i == <NUM_LIT:2> ) { flag = true ; } if ( ! par1World . isBlockNormalCube ( par2 , par3 , par4 - <NUM_LIT:1> ) && i == <NUM_LIT:3> ) { flag = true ; } if ( ! par1World . isBlockNormalCube ( par2 , par3 , par4 + <NUM_LIT:1> ) && i == <NUM_LIT:4> ) { flag = true ; } if ( flag ) { dropBlockAsItem ( par1World , par2 , par3 , par4 , par1World . getBlockMetadata ( par2 , par3 , par4 ) , <NUM_LIT:0> ) ; par1World . setBlockWithNotify ( par2 , par3 , par4 , <NUM_LIT:0> ) ; } } } private boolean redundantCanPlaceBlockAt ( World par1World , int par2 , int par3 , int par4 ) { if ( ! canPlaceBlockAt ( 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> ) ; return false ; } else { return true ; } } public void setBlockBoundsBasedOnState ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { int i = par1IBlockAccess . getBlockMetadata ( par2 , par3 , par4 ) ; int j = i & <NUM_LIT:7> ; boolean flag = ( i & <NUM_LIT:8> ) > <NUM_LIT:0> ; float f = <NUM_LIT> ; float f1 = <NUM_LIT> ; float f2 = <NUM_LIT> ; float f3 = <NUM_LIT> ; if ( flag ) { f3 = <NUM_LIT> ; } if ( j == <NUM_LIT:1> ) { setBlockBounds ( <NUM_LIT> , f , <NUM_LIT> - f2 , f3 , f1 , <NUM_LIT> + f2 ) ; } else if ( j == <NUM_LIT:2> ) { setBlockBounds ( <NUM_LIT> - f3 , f , <NUM_LIT> - f2 , <NUM_LIT> , f1 , <NUM_LIT> + f2 ) ; } else if ( j == <NUM_LIT:3> ) { setBlockBounds ( <NUM_LIT> - f2 , f , <NUM_LIT> , <NUM_LIT> + f2 , f1 , f3 ) ; } else if ( j == <NUM_LIT:4> ) { setBlockBounds ( <NUM_LIT> - f2 , f , <NUM_LIT> - f3 , <NUM_LIT> + f2 , f1 , <NUM_LIT> ) ; } } public void onBlockClicked ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { blockActivated ( par1World , par2 , par3 , par4 , par5EntityPlayer ) ; } public boolean blockActivated ( World par1World , int par2 , int par3 , int par4 , EntityPlayer par5EntityPlayer ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; int j = i & <NUM_LIT:7> ; int k = <NUM_LIT:8> - ( i & <NUM_LIT:8> ) ; if ( k == <NUM_LIT:0> ) { return true ; } par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , j + k ) ; par1World . markBlocksDirty ( par2 , par3 , par4 , par2 , par3 , par4 ) ; par1World . playSoundEffect ( ( double ) par2 + <NUM_LIT> , ( double ) par3 + <NUM_LIT> , ( double ) par4 + <NUM_LIT> , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 , blockID ) ; if ( j == <NUM_LIT:1> ) { par1World . notifyBlocksOfNeighborChange ( par2 - <NUM_LIT:1> , par3 , par4 , blockID ) ; } else if ( j == <NUM_LIT:2> ) { par1World . notifyBlocksOfNeighborChange ( par2 + <NUM_LIT:1> , par3 , par4 , blockID ) ; } else if ( j == <NUM_LIT:3> ) { par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 - <NUM_LIT:1> , blockID ) ; } else if ( j == <NUM_LIT:4> ) { par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 + <NUM_LIT:1> , blockID ) ; } else { par1World . notifyBlocksOfNeighborChange ( par2 , par3 - <NUM_LIT:1> , par4 , blockID ) ; } par1World . scheduleBlockUpdate ( par2 , par3 , par4 , blockID , tickRate ( ) ) ; return true ; } public void onBlockRemoval ( World par1World , int par2 , int par3 , int par4 ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( ( i & <NUM_LIT:8> ) > <NUM_LIT:0> ) { par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 , blockID ) ; int j = i & <NUM_LIT:7> ; if ( j == <NUM_LIT:1> ) { par1World . notifyBlocksOfNeighborChange ( par2 - <NUM_LIT:1> , par3 , par4 , blockID ) ; } else if ( j == <NUM_LIT:2> ) { par1World . notifyBlocksOfNeighborChange ( par2 + <NUM_LIT:1> , par3 , par4 , blockID ) ; } else if ( j == <NUM_LIT:3> ) { par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 - <NUM_LIT:1> , blockID ) ; } else if ( j == <NUM_LIT:4> ) { par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 + <NUM_LIT:1> , blockID ) ; } else { par1World . notifyBlocksOfNeighborChange ( par2 , par3 - <NUM_LIT:1> , par4 , blockID ) ; } } super . onBlockRemoval ( par1World , par2 , par3 , par4 ) ; } public boolean isPoweringTo ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 , int par5 ) { return ( par1IBlockAccess . getBlockMetadata ( par2 , par3 , par4 ) & <NUM_LIT:8> ) > <NUM_LIT:0> ; } public boolean isIndirectlyPoweringTo ( World par1World , int par2 , int par3 , int par4 , int par5 ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( ( i & <NUM_LIT:8> ) == <NUM_LIT:0> ) { return false ; } int j = i & <NUM_LIT:7> ; if ( j == <NUM_LIT:5> && par5 == <NUM_LIT:1> ) { return true ; } if ( j == <NUM_LIT:4> && par5 == <NUM_LIT:2> ) { return true ; } if ( j == <NUM_LIT:3> && par5 == <NUM_LIT:3> ) { return true ; } if ( j == <NUM_LIT:2> && par5 == <NUM_LIT:4> ) { return true ; } return j == <NUM_LIT:1> && par5 == <NUM_LIT:5> ; } public boolean canProvidePower ( ) { return true ; } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { if ( par1World . isRemote ) { return ; } int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( ( i & <NUM_LIT:8> ) == <NUM_LIT:0> ) { return ; } par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i & <NUM_LIT:7> ) ; par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 , blockID ) ; int j = i & <NUM_LIT:7> ; if ( j == <NUM_LIT:1> ) { par1World . notifyBlocksOfNeighborChange ( par2 - <NUM_LIT:1> , par3 , par4 , blockID ) ; } else if ( j == <NUM_LIT:2> ) { par1World . notifyBlocksOfNeighborChange ( par2 + <NUM_LIT:1> , par3 , par4 , blockID ) ; } else if ( j == <NUM_LIT:3> ) { par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 - <NUM_LIT:1> , blockID ) ; } else if ( j == <NUM_LIT:4> ) { par1World . notifyBlocksOfNeighborChange ( par2 , par3 , par4 + <NUM_LIT:1> , blockID ) ; } else { par1World . notifyBlocksOfNeighborChange ( par2 , par3 - <NUM_LIT:1> , par4 , blockID ) ; } par1World . playSoundEffect ( ( double ) par2 + <NUM_LIT> , ( double ) par3 + <NUM_LIT> , ( double ) par4 + <NUM_LIT> , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; par1World . markBlocksDirty ( par2 , par3 , par4 , par2 , par3 , par4 ) ; } public void setBlockBoundsForItemRender ( ) { float f = <NUM_LIT> ; float f1 = <NUM_LIT> ; float f2 = <NUM_LIT> ; setBlockBounds ( <NUM_LIT> - f , <NUM_LIT> - f1 , <NUM_LIT> - f2 , <NUM_LIT> + f , <NUM_LIT> + f1 , <NUM_LIT> + f2 ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentVillageHouse3 extends ComponentVillage { private int averageGroundLevel ; public ComponentVillageHouse3 ( 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 ComponentVillageHouse3 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:9> , <NUM_LIT:7> , <NUM_LIT:12> , par5 ) ; if ( ! canVillageGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentVillageHouse3 ( 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:7> ) - <NUM_LIT:1> , <NUM_LIT:0> ) ; } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:7> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:6> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:10> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:8> , <NUM_LIT:0> , <NUM_LIT:10> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:7> , <NUM_LIT:0> , <NUM_LIT:4> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:5> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:8> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:3> , <NUM_LIT:10> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:7> , <NUM_LIT:2> , <NUM_LIT:0> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:5> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:10> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:10> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:10> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:0> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:5> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:1> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:4> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:8> , <NUM_LIT:5> , <NUM_LIT:3> , Block . planks . blockID , Block . planks . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:4> , par3StructureBoundingBox ) ; int i = getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:3> ) ; int j = getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:2> ) ; for ( int k = - <NUM_LIT:1> ; k <= <NUM_LIT:2> ; k ++ ) { for ( int i1 = <NUM_LIT:0> ; i1 <= <NUM_LIT:8> ; i1 ++ ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , i , i1 , <NUM_LIT:4> + k , k , par3StructureBoundingBox ) ; if ( ( k > - <NUM_LIT:1> || i1 <= <NUM_LIT:1> ) && ( k > <NUM_LIT:0> || i1 <= <NUM_LIT:3> ) && ( k > <NUM_LIT:1> || i1 <= <NUM_LIT:4> || i1 >= <NUM_LIT:6> ) ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , j , i1 , <NUM_LIT:4> + k , <NUM_LIT:5> - k , par3StructureBoundingBox ) ; } } } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:10> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:7> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:4> , <NUM_LIT:10> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:10> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:6> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:5> , <NUM_LIT:10> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:3> , <NUM_LIT:5> , <NUM_LIT:6> , <NUM_LIT:10> , Block . planks . blockID , Block . planks . blockID , false ) ; int l = getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:0> ) ; for ( int j1 = <NUM_LIT:4> ; j1 >= <NUM_LIT:1> ; j1 -- ) { placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , j1 , <NUM_LIT:2> + j1 , <NUM_LIT:7> - j1 , par3StructureBoundingBox ) ; for ( int l1 = <NUM_LIT:8> - j1 ; l1 <= <NUM_LIT:10> ; l1 ++ ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , l , j1 , <NUM_LIT:2> + j1 , l1 , par3StructureBoundingBox ) ; } } int k1 = getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:1> ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:7> , <NUM_LIT:5> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , k1 , <NUM_LIT:6> , <NUM_LIT:6> , <NUM_LIT:4> , par3StructureBoundingBox ) ; for ( int i2 = <NUM_LIT:6> ; i2 <= <NUM_LIT:8> ; i2 ++ ) { for ( int l2 = <NUM_LIT:5> ; l2 <= <NUM_LIT:10> ; l2 ++ ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , k1 , i2 , <NUM_LIT:12> - i2 , l2 , par3StructureBoundingBox ) ; } } placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:9> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:9> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:10> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:10> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:4> , <NUM_LIT:10> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:5> , <NUM_LIT:10> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . torchWood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeDoorAtCurrentPosition ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:0> , getMetadataWithOffset ( Block . doorWood . blockID , <NUM_LIT:1> ) ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , - <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:2> , - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; if ( getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:2> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) == <NUM_LIT:0> && getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:2> , - <NUM_LIT:1> , - <NUM_LIT:1> , par3StructureBoundingBox ) != <NUM_LIT:0> ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:3> ) , <NUM_LIT:2> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) ; } for ( int j2 = <NUM_LIT:0> ; j2 < <NUM_LIT:5> ; j2 ++ ) { for ( int i3 = <NUM_LIT:0> ; i3 < <NUM_LIT:9> ; i3 ++ ) { clearCurrentPositionBlocksUpwards ( par1World , i3 , <NUM_LIT:7> , j2 , par3StructureBoundingBox ) ; fillCurrentPositionBlocksDownwards ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , i3 , - <NUM_LIT:1> , j2 , par3StructureBoundingBox ) ; } } for ( int k2 = <NUM_LIT:5> ; k2 < <NUM_LIT:11> ; k2 ++ ) { for ( int j3 = <NUM_LIT:2> ; j3 < <NUM_LIT:9> ; j3 ++ ) { clearCurrentPositionBlocksUpwards ( par1World , j3 , <NUM_LIT:7> , k2 , par3StructureBoundingBox ) ; fillCurrentPositionBlocksDownwards ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , j3 , - <NUM_LIT:1> , k2 , par3StructureBoundingBox ) ; } } spawnVillagers ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:2> ) ; return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class EnchantmentHelper { private static final Random enchantmentRand = new Random ( ) ; private static final EnchantmentModifierDamage enchantmentModifierDamage = new EnchantmentModifierDamage ( null ) ; private static final EnchantmentModifierLiving enchantmentModifierLiving = new EnchantmentModifierLiving ( null ) ; public EnchantmentHelper ( ) { } public static int getEnchantmentLevel ( int par0 , ItemStack par1ItemStack ) { if ( par1ItemStack == null ) { return <NUM_LIT:0> ; } NBTTagList nbttaglist = par1ItemStack . getEnchantmentTagList ( ) ; if ( nbttaglist == null ) { return <NUM_LIT:0> ; } for ( int i = <NUM_LIT:0> ; i < nbttaglist . tagCount ( ) ; i ++ ) { short word0 = ( ( NBTTagCompound ) nbttaglist . tagAt ( i ) ) . getShort ( "<STR_LIT:id>" ) ; short word1 = ( ( NBTTagCompound ) nbttaglist . tagAt ( i ) ) . getShort ( "<STR_LIT>" ) ; if ( word0 == par0 ) { return word1 ; } } return <NUM_LIT:0> ; } private static int getMaxEnchantmentLevel ( int par0 , ItemStack par1ArrayOfItemStack [ ] ) { int i = <NUM_LIT:0> ; ItemStack aitemstack [ ] = par1ArrayOfItemStack ; int j = aitemstack . length ; for ( int k = <NUM_LIT:0> ; k < j ; k ++ ) { ItemStack itemstack = aitemstack [ k ] ; int l = getEnchantmentLevel ( par0 , itemstack ) ; if ( l > i ) { i = l ; } } return i ; } private static void applyEnchantmentModifier ( IEnchantmentModifier par0IEnchantmentModifier , ItemStack par1ItemStack ) { if ( par1ItemStack == null ) { return ; } NBTTagList nbttaglist = par1ItemStack . getEnchantmentTagList ( ) ; if ( nbttaglist == null ) { return ; } for ( int i = <NUM_LIT:0> ; i < nbttaglist . tagCount ( ) ; i ++ ) { short word0 = ( ( NBTTagCompound ) nbttaglist . tagAt ( i ) ) . getShort ( "<STR_LIT:id>" ) ; short word1 = ( ( NBTTagCompound ) nbttaglist . tagAt ( i ) ) . getShort ( "<STR_LIT>" ) ; if ( Enchantment . enchantmentsList [ word0 ] != null ) { par0IEnchantmentModifier . calculateModifier ( Enchantment . enchantmentsList [ word0 ] , word1 ) ; } } } private static void applyEnchantmentModifierArray ( IEnchantmentModifier par0IEnchantmentModifier , ItemStack par1ArrayOfItemStack [ ] ) { ItemStack aitemstack [ ] = par1ArrayOfItemStack ; int i = aitemstack . length ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { ItemStack itemstack = aitemstack [ j ] ; applyEnchantmentModifier ( par0IEnchantmentModifier , itemstack ) ; } } public static int getEnchantmentModifierDamage ( InventoryPlayer par0InventoryPlayer , DamageSource par1DamageSource ) { enchantmentModifierDamage . damageModifier = <NUM_LIT:0> ; enchantmentModifierDamage . damageSource = par1DamageSource ; applyEnchantmentModifierArray ( enchantmentModifierDamage , par0InventoryPlayer . armorInventory ) ; if ( enchantmentModifierDamage . damageModifier > <NUM_LIT> ) { enchantmentModifierDamage . damageModifier = <NUM_LIT> ; } return ( enchantmentModifierDamage . damageModifier + <NUM_LIT:1> > > <NUM_LIT:1> ) + enchantmentRand . nextInt ( ( enchantmentModifierDamage . damageModifier > > <NUM_LIT:1> ) + <NUM_LIT:1> ) ; } public static int getEnchantmentModifierLiving ( InventoryPlayer par0InventoryPlayer , EntityLiving par1EntityLiving ) { enchantmentModifierLiving . livingModifier = <NUM_LIT:0> ; enchantmentModifierLiving . entityLiving = par1EntityLiving ; applyEnchantmentModifier ( enchantmentModifierLiving , par0InventoryPlayer . getCurrentItem ( ) ) ; if ( enchantmentModifierLiving . livingModifier > <NUM_LIT:0> ) { return <NUM_LIT:1> + enchantmentRand . nextInt ( enchantmentModifierLiving . livingModifier ) ; } else { return <NUM_LIT:0> ; } } public static int getKnockbackModifier ( InventoryPlayer par0InventoryPlayer , EntityLiving par1EntityLiving ) { return getEnchantmentLevel ( Enchantment . knockback . effectId , par0InventoryPlayer . getCurrentItem ( ) ) ; } public static int getFireAspectModifier ( InventoryPlayer par0InventoryPlayer , EntityLiving par1EntityLiving ) { return getEnchantmentLevel ( Enchantment . fireAspect . effectId , par0InventoryPlayer . getCurrentItem ( ) ) ; } public static int getRespiration ( InventoryPlayer par0InventoryPlayer ) { return getMaxEnchantmentLevel ( Enchantment . respiration . effectId , par0InventoryPlayer . armorInventory ) ; } public static int getEfficiencyModifier ( InventoryPlayer par0InventoryPlayer ) { return getEnchantmentLevel ( Enchantment . efficiency . effectId , par0InventoryPlayer . getCurrentItem ( ) ) ; } public static int getUnbreakingModifier ( InventoryPlayer par0InventoryPlayer ) { return getEnchantmentLevel ( Enchantment . unbreaking . effectId , par0InventoryPlayer . getCurrentItem ( ) ) ; } public static boolean getSilkTouchModifier ( InventoryPlayer par0InventoryPlayer ) { return getEnchantmentLevel ( Enchantment . silkTouch . effectId , par0InventoryPlayer . getCurrentItem ( ) ) > <NUM_LIT:0> ; } public static int getFortuneModifier ( InventoryPlayer par0InventoryPlayer ) { return getEnchantmentLevel ( Enchantment . fortune . effectId , par0InventoryPlayer . getCurrentItem ( ) ) ; } public static int getLootingModifier ( InventoryPlayer par0InventoryPlayer ) { return getEnchantmentLevel ( Enchantment . looting . effectId , par0InventoryPlayer . getCurrentItem ( ) ) ; } public static boolean getAquaAffinityModifier ( InventoryPlayer par0InventoryPlayer ) { return getMaxEnchantmentLevel ( Enchantment . aquaAffinity . effectId , par0InventoryPlayer . armorInventory ) > <NUM_LIT:0> ; } public static int calcItemStackEnchantability ( Random par0Random , int par1 , int par2 , ItemStack par3ItemStack ) { Item item = par3ItemStack . getItem ( ) ; int i = item . getItemEnchantability ( ) ; if ( i <= <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 > <NUM_LIT:30> ) { par2 = <NUM_LIT:30> ; } par2 = <NUM_LIT:1> + ( par2 > > <NUM_LIT:1> ) + par0Random . nextInt ( par2 + <NUM_LIT:1> ) ; int j = par0Random . nextInt ( <NUM_LIT:5> ) + par2 ; if ( par1 == <NUM_LIT:0> ) { return ( j > > <NUM_LIT:1> ) + <NUM_LIT:1> ; } if ( par1 == <NUM_LIT:1> ) { return ( j * <NUM_LIT:2> ) / <NUM_LIT:3> + <NUM_LIT:1> ; } else { return j ; } } public static void func_48622_a ( Random par0Random , ItemStack par1ItemStack , int par2 ) { List list = buildEnchantmentList ( par0Random , par1ItemStack , par2 ) ; if ( list != null ) { EnchantmentData enchantmentdata ; for ( Iterator iterator = list . iterator ( ) ; iterator . hasNext ( ) ; par1ItemStack . addEnchantment ( enchantmentdata . enchantmentobj , enchantmentdata . enchantmentLevel ) ) { enchantmentdata = ( EnchantmentData ) iterator . next ( ) ; } } } public static List buildEnchantmentList ( Random par0Random , ItemStack par1ItemStack , int par2 ) { Item item = par1ItemStack . getItem ( ) ; int i = item . getItemEnchantability ( ) ; if ( i <= <NUM_LIT:0> ) { return null ; } i = <NUM_LIT:1> + par0Random . nextInt ( ( i > > <NUM_LIT:1> ) + <NUM_LIT:1> ) + par0Random . nextInt ( ( i > > <NUM_LIT:1> ) + <NUM_LIT:1> ) ; int j = i + par2 ; float f = ( ( par0Random . nextFloat ( ) + par0Random . nextFloat ( ) ) - <NUM_LIT> ) * <NUM_LIT> ; int k = ( int ) ( ( float ) j * ( <NUM_LIT> + f ) + <NUM_LIT> ) ; ArrayList arraylist = null ; Map map = mapEnchantmentData ( k , par1ItemStack ) ; if ( map != null && ! map . isEmpty ( ) ) { EnchantmentData enchantmentdata = ( EnchantmentData ) WeightedRandom . getRandomItem ( par0Random , map . values ( ) ) ; if ( enchantmentdata != null ) { arraylist = new ArrayList ( ) ; arraylist . add ( enchantmentdata ) ; for ( int l = k > > <NUM_LIT:1> ; par0Random . nextInt ( <NUM_LIT> ) <= l ; l >>= <NUM_LIT:1> ) { Iterator iterator = map . keySet ( ) . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } Integer integer = ( Integer ) iterator . next ( ) ; boolean flag = true ; Iterator iterator1 = arraylist . iterator ( ) ; do { if ( ! iterator1 . hasNext ( ) ) { break ; } EnchantmentData enchantmentdata2 = ( EnchantmentData ) iterator1 . next ( ) ; if ( enchantmentdata2 . enchantmentobj . canApplyTogether ( Enchantment . enchantmentsList [ integer . intValue ( ) ] ) ) { continue ; } flag = false ; break ; } while ( true ) ; if ( ! flag ) { iterator . remove ( ) ; } } while ( true ) ; if ( ! map . isEmpty ( ) ) { EnchantmentData enchantmentdata1 = ( EnchantmentData ) WeightedRandom . getRandomItem ( par0Random , map . values ( ) ) ; arraylist . add ( enchantmentdata1 ) ; } } } } return arraylist ; } public static Map mapEnchantmentData ( int par0 , ItemStack par1ItemStack ) { Item item = par1ItemStack . getItem ( ) ; HashMap hashmap = null ; Enchantment aenchantment [ ] = Enchantment . enchantmentsList ; int i = aenchantment . length ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { Enchantment enchantment = aenchantment [ j ] ; if ( enchantment == null || ! enchantment . type . canEnchantItem ( item ) ) { continue ; } for ( int k = enchantment . getMinLevel ( ) ; k <= enchantment . getMaxLevel ( ) ; k ++ ) { if ( par0 < enchantment . getMinEnchantability ( k ) || par0 > enchantment . getMaxEnchantability ( k ) ) { continue ; } if ( hashmap == null ) { hashmap = new HashMap ( ) ; } hashmap . put ( Integer . valueOf ( enchantment . effectId ) , new EnchantmentData ( enchantment , k ) ) ; } } return hashmap ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenGlowStone1 extends WorldGenerator { public WorldGenGlowStone1 ( ) { } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { if ( ! par1World . isAirBlock ( par3 , par4 , par5 ) ) { return false ; } if ( par1World . getBlockId ( par3 , par4 + <NUM_LIT:1> , par5 ) != Block . netherrack . blockID ) { return false ; } par1World . setBlockWithNotify ( par3 , par4 , par5 , Block . glowStone . blockID ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { int j = ( par3 + par2Random . nextInt ( <NUM_LIT:8> ) ) - par2Random . nextInt ( <NUM_LIT:8> ) ; int k = par4 - par2Random . nextInt ( <NUM_LIT:12> ) ; int l = ( par5 + par2Random . nextInt ( <NUM_LIT:8> ) ) - par2Random . nextInt ( <NUM_LIT:8> ) ; if ( par1World . getBlockId ( j , k , l ) != <NUM_LIT:0> ) { continue ; } int i1 = <NUM_LIT:0> ; for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:6> ; j1 ++ ) { int k1 = <NUM_LIT:0> ; if ( j1 == <NUM_LIT:0> ) { k1 = par1World . getBlockId ( j - <NUM_LIT:1> , k , l ) ; } if ( j1 == <NUM_LIT:1> ) { k1 = par1World . getBlockId ( j + <NUM_LIT:1> , k , l ) ; } if ( j1 == <NUM_LIT:2> ) { k1 = par1World . getBlockId ( j , k - <NUM_LIT:1> , l ) ; } if ( j1 == <NUM_LIT:3> ) { k1 = par1World . getBlockId ( j , k + <NUM_LIT:1> , l ) ; } if ( j1 == <NUM_LIT:4> ) { k1 = par1World . getBlockId ( j , k , l - <NUM_LIT:1> ) ; } if ( j1 == <NUM_LIT:5> ) { k1 = par1World . getBlockId ( j , k , l + <NUM_LIT:1> ) ; } if ( k1 == Block . glowStone . blockID ) { i1 ++ ; } } if ( i1 == <NUM_LIT:1> ) { par1World . setBlockWithNotify ( j , k , l , Block . glowStone . blockID ) ; } } return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockStone extends Block { public BlockStone ( int par1 , int par2 ) { super ( par1 , par2 , Material . rock ) ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Block . cobblestone . blockID ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; public class BiomeGenMushroomIsland extends BiomeGenBase { public BiomeGenMushroomIsland ( int par1 ) { super ( par1 ) ; biomeDecorator . treesPerChunk = - <NUM_LIT:100> ; biomeDecorator . flowersPerChunk = - <NUM_LIT:100> ; biomeDecorator . grassPerChunk = - <NUM_LIT:100> ; biomeDecorator . mushroomsPerChunk = <NUM_LIT:1> ; biomeDecorator . bigMushroomsPerChunk = <NUM_LIT:1> ; topBlock = ( byte ) Block . mycelium . blockID ; spawnableMonsterList . clear ( ) ; spawnableCreatureList . clear ( ) ; spawnableWaterCreatureList . clear ( ) ; spawnableCreatureList . add ( new SpawnListEntry ( net . minecraft . src . EntityMooshroom . class , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:8> ) ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockPumpkin extends BlockDirectional { private boolean blockType ; protected BlockPumpkin ( int par1 , int par2 , boolean par3 ) { super ( par1 , Material . pumpkin ) ; blockIndexInTexture = par2 ; setTickRandomly ( true ) ; blockType = par3 ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture ; } if ( par1 == <NUM_LIT:0> ) { return blockIndexInTexture ; } int i = blockIndexInTexture + <NUM_LIT:1> + <NUM_LIT:16> ; if ( blockType ) { i ++ ; } if ( par2 == <NUM_LIT:2> && par1 == <NUM_LIT:2> ) { return i ; } if ( par2 == <NUM_LIT:3> && par1 == <NUM_LIT:5> ) { return i ; } if ( par2 == <NUM_LIT:0> && par1 == <NUM_LIT:3> ) { return i ; } if ( par2 == <NUM_LIT:1> && par1 == <NUM_LIT:4> ) { return i ; } else { return blockIndexInTexture + <NUM_LIT:16> ; } } public int getBlockTextureFromSide ( int par1 ) { if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture ; } if ( par1 == <NUM_LIT:0> ) { return blockIndexInTexture ; } if ( par1 == <NUM_LIT:3> ) { return blockIndexInTexture + <NUM_LIT:1> + <NUM_LIT:16> ; } else { return blockIndexInTexture + <NUM_LIT:16> ; } } public void onBlockAdded ( World par1World , int par2 , int par3 , int par4 ) { super . onBlockAdded ( par1World , par2 , par3 , par4 ) ; if ( par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) == Block . blockSnow . blockID && par1World . getBlockId ( par2 , par3 - <NUM_LIT:2> , par4 ) == Block . blockSnow . blockID ) { if ( ! par1World . isRemote ) { par1World . setBlock ( par2 , par3 , par4 , <NUM_LIT:0> ) ; par1World . setBlock ( par2 , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; par1World . setBlock ( par2 , par3 - <NUM_LIT:2> , par4 , <NUM_LIT:0> ) ; EntitySnowman entitysnowman = new EntitySnowman ( par1World ) ; entitysnowman . setLocationAndAngles ( ( double ) par2 + <NUM_LIT> , ( double ) par3 - <NUM_LIT> , ( double ) par4 + <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; par1World . spawnEntityInWorld ( entitysnowman ) ; par1World . notifyBlockChange ( par2 , par3 , par4 , <NUM_LIT:0> ) ; par1World . notifyBlockChange ( par2 , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; par1World . notifyBlockChange ( par2 , par3 - <NUM_LIT:2> , par4 , <NUM_LIT:0> ) ; } for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { par1World . spawnParticle ( "<STR_LIT>" , ( double ) par2 + par1World . rand . nextDouble ( ) , ( double ) ( par3 - <NUM_LIT:2> ) + par1World . rand . nextDouble ( ) * <NUM_LIT> , ( double ) par4 + par1World . rand . nextDouble ( ) , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } } else if ( par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) == Block . blockSteel . blockID && par1World . getBlockId ( par2 , par3 - <NUM_LIT:2> , par4 ) == Block . blockSteel . blockID ) { boolean flag = par1World . getBlockId ( par2 - <NUM_LIT:1> , par3 - <NUM_LIT:1> , par4 ) == Block . blockSteel . blockID && par1World . getBlockId ( par2 + <NUM_LIT:1> , par3 - <NUM_LIT:1> , par4 ) == Block . blockSteel . blockID ; boolean flag1 = par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 - <NUM_LIT:1> ) == Block . blockSteel . blockID && par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 + <NUM_LIT:1> ) == Block . blockSteel . blockID ; if ( flag || flag1 ) { par1World . setBlock ( par2 , par3 , par4 , <NUM_LIT:0> ) ; par1World . setBlock ( par2 , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; par1World . setBlock ( par2 , par3 - <NUM_LIT:2> , par4 , <NUM_LIT:0> ) ; if ( flag ) { par1World . setBlock ( par2 - <NUM_LIT:1> , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; par1World . setBlock ( par2 + <NUM_LIT:1> , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; } else { par1World . setBlock ( par2 , par3 - <NUM_LIT:1> , par4 - <NUM_LIT:1> , <NUM_LIT:0> ) ; par1World . setBlock ( par2 , par3 - <NUM_LIT:1> , par4 + <NUM_LIT:1> , <NUM_LIT:0> ) ; } EntityIronGolem entityirongolem = new EntityIronGolem ( par1World ) ; entityirongolem . func_48381_b ( true ) ; entityirongolem . setLocationAndAngles ( ( double ) par2 + <NUM_LIT> , ( double ) par3 - <NUM_LIT> , ( double ) par4 + <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; par1World . spawnEntityInWorld ( entityirongolem ) ; for ( int j = <NUM_LIT:0> ; j < <NUM_LIT> ; j ++ ) { par1World . spawnParticle ( "<STR_LIT>" , ( double ) par2 + par1World . rand . nextDouble ( ) , ( double ) ( par3 - <NUM_LIT:2> ) + par1World . rand . nextDouble ( ) * <NUM_LIT> , ( double ) par4 + par1World . rand . nextDouble ( ) , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } par1World . notifyBlockChange ( par2 , par3 , par4 , <NUM_LIT:0> ) ; par1World . notifyBlockChange ( par2 , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; par1World . notifyBlockChange ( par2 , par3 - <NUM_LIT:2> , par4 , <NUM_LIT:0> ) ; if ( flag ) { par1World . notifyBlockChange ( par2 - <NUM_LIT:1> , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; par1World . notifyBlockChange ( par2 + <NUM_LIT:1> , par3 - <NUM_LIT:1> , par4 , <NUM_LIT:0> ) ; } else { par1World . notifyBlockChange ( par2 , par3 - <NUM_LIT:1> , par4 - <NUM_LIT:1> , <NUM_LIT:0> ) ; par1World . notifyBlockChange ( par2 , par3 - <NUM_LIT:1> , par4 + <NUM_LIT:1> , <NUM_LIT:0> ) ; } } } } public boolean canPlaceBlockAt ( World par1World , int par2 , int par3 , int par4 ) { int i = par1World . getBlockId ( par2 , par3 , par4 ) ; return ( i == <NUM_LIT:0> || Block . blocksList [ i ] . blockMaterial . isGroundCover ( ) ) && par1World . isBlockNormalCube ( par2 , par3 - <NUM_LIT:1> , par4 ) ; } public void onBlockPlacedBy ( World par1World , int par2 , int par3 , int par4 , EntityLiving par5EntityLiving ) { int i = MathHelper . floor_double ( ( double ) ( ( par5EntityLiving . rotationYaw * <NUM_LIT> ) / <NUM_LIT> ) + <NUM_LIT> ) & <NUM_LIT:3> ; par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public abstract class EntityThrowable extends Entity { private int xTile ; private int yTile ; private int zTile ; private int inTile ; protected boolean inGround ; public int throwableShake ; protected EntityLiving thrower ; private int ticksInGround ; private int ticksInAir ; public EntityThrowable ( World par1World ) { super ( par1World ) ; xTile = - <NUM_LIT:1> ; yTile = - <NUM_LIT:1> ; zTile = - <NUM_LIT:1> ; inTile = <NUM_LIT:0> ; inGround = false ; throwableShake = <NUM_LIT:0> ; ticksInAir = <NUM_LIT:0> ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; } protected void entityInit ( ) { } public EntityThrowable ( World par1World , EntityLiving par2EntityLiving ) { super ( par1World ) ; xTile = - <NUM_LIT:1> ; yTile = - <NUM_LIT:1> ; zTile = - <NUM_LIT:1> ; inTile = <NUM_LIT:0> ; inGround = false ; throwableShake = <NUM_LIT:0> ; ticksInAir = <NUM_LIT:0> ; thrower = par2EntityLiving ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; setLocationAndAngles ( par2EntityLiving . posX , par2EntityLiving . posY + ( double ) par2EntityLiving . getEyeHeight ( ) , par2EntityLiving . posZ , par2EntityLiving . rotationYaw , par2EntityLiving . rotationPitch ) ; posX -= MathHelper . cos ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * <NUM_LIT> ; posY -= <NUM_LIT> ; posZ -= MathHelper . sin ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * <NUM_LIT> ; setPosition ( posX , posY , posZ ) ; yOffset = <NUM_LIT> ; float f = <NUM_LIT> ; motionX = - MathHelper . sin ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * MathHelper . cos ( ( rotationPitch / <NUM_LIT> ) * ( float ) Math . PI ) * f ; motionZ = MathHelper . cos ( ( rotationYaw / <NUM_LIT> ) * ( float ) Math . PI ) * MathHelper . cos ( ( rotationPitch / <NUM_LIT> ) * ( float ) Math . PI ) * f ; motionY = - MathHelper . sin ( ( ( rotationPitch + func_40040_d ( ) ) / <NUM_LIT> ) * ( float ) Math . PI ) * f ; setThrowableHeading ( motionX , motionY , motionZ , func_40044_c ( ) , <NUM_LIT> ) ; } public EntityThrowable ( World par1World , double par2 , double par4 , double par6 ) { super ( par1World ) ; xTile = - <NUM_LIT:1> ; yTile = - <NUM_LIT:1> ; zTile = - <NUM_LIT:1> ; inTile = <NUM_LIT:0> ; inGround = false ; throwableShake = <NUM_LIT:0> ; ticksInAir = <NUM_LIT:0> ; ticksInGround = <NUM_LIT:0> ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; setPosition ( par2 , par4 , par6 ) ; yOffset = <NUM_LIT> ; } protected float func_40044_c ( ) { return <NUM_LIT> ; } protected float func_40040_d ( ) { return <NUM_LIT> ; } public void setThrowableHeading ( double par1 , double par3 , double par5 , float par7 , float par8 ) { float f = MathHelper . sqrt_double ( par1 * par1 + par3 * par3 + par5 * par5 ) ; par1 /= f ; par3 /= f ; par5 /= f ; par1 += rand . nextGaussian ( ) * <NUM_LIT> * ( double ) par8 ; par3 += rand . nextGaussian ( ) * <NUM_LIT> * ( double ) par8 ; par5 += rand . nextGaussian ( ) * <NUM_LIT> * ( double ) par8 ; par1 *= par7 ; par3 *= par7 ; par5 *= par7 ; motionX = par1 ; motionY = par3 ; motionZ = par5 ; float f1 = MathHelper . sqrt_double ( par1 * par1 + par5 * par5 ) ; prevRotationYaw = rotationYaw = ( float ) ( ( Math . atan2 ( par1 , par5 ) * <NUM_LIT> ) / Math . PI ) ; prevRotationPitch = rotationPitch = ( float ) ( ( Math . atan2 ( par3 , f1 ) * <NUM_LIT> ) / Math . PI ) ; ticksInGround = <NUM_LIT:0> ; } public void onUpdate ( ) { lastTickPosX = posX ; lastTickPosY = posY ; lastTickPosZ = posZ ; super . onUpdate ( ) ; if ( throwableShake > <NUM_LIT:0> ) { throwableShake -- ; } if ( inGround ) { int i = worldObj . getBlockId ( xTile , yTile , zTile ) ; if ( i != inTile ) { inGround = false ; motionX *= rand . nextFloat ( ) * <NUM_LIT> ; motionY *= rand . nextFloat ( ) * <NUM_LIT> ; motionZ *= rand . nextFloat ( ) * <NUM_LIT> ; ticksInGround = <NUM_LIT:0> ; ticksInAir = <NUM_LIT:0> ; } else { ticksInGround ++ ; if ( ticksInGround == <NUM_LIT> ) { setDead ( ) ; } return ; } } else { ticksInAir ++ ; } Vec3D vec3d = Vec3D . createVector ( posX , posY , posZ ) ; Vec3D vec3d1 = Vec3D . createVector ( posX + motionX , posY + motionY , posZ + motionZ ) ; MovingObjectPosition movingobjectposition = worldObj . rayTraceBlocks ( vec3d , vec3d1 ) ; vec3d = Vec3D . createVector ( posX , posY , posZ ) ; vec3d1 = Vec3D . createVector ( posX + motionX , posY + motionY , posZ + motionZ ) ; if ( movingobjectposition != null ) { vec3d1 = Vec3D . createVector ( movingobjectposition . hitVec . xCoord , movingobjectposition . hitVec . yCoord , movingobjectposition . hitVec . zCoord ) ; } if ( ! worldObj . isRemote ) { Entity entity = null ; List list = worldObj . getEntitiesWithinAABBExcludingEntity ( this , boundingBox . addCoord ( motionX , motionY , motionZ ) . expand ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ) ; double d = <NUM_LIT> ; for ( int k = <NUM_LIT:0> ; k < list . size ( ) ; k ++ ) { Entity entity1 = ( Entity ) list . get ( k ) ; if ( ! entity1 . canBeCollidedWith ( ) || entity1 == thrower && ticksInAir < <NUM_LIT:5> ) { continue ; } float f4 = <NUM_LIT> ; AxisAlignedBB axisalignedbb = entity1 . boundingBox . expand ( f4 , f4 , f4 ) ; MovingObjectPosition movingobjectposition1 = axisalignedbb . calculateIntercept ( vec3d , vec3d1 ) ; if ( movingobjectposition1 == null ) { continue ; } double d1 = vec3d . distanceTo ( movingobjectposition1 . hitVec ) ; if ( d1 < d || d == <NUM_LIT> ) { entity = entity1 ; d = d1 ; } } if ( entity != null ) { movingobjectposition = new MovingObjectPosition ( entity ) ; } } if ( movingobjectposition != null ) { onImpact ( movingobjectposition ) ; } posX += motionX ; posY += motionY ; posZ += motionZ ; float f = MathHelper . sqrt_double ( motionX * motionX + motionZ * motionZ ) ; rotationYaw = ( float ) ( ( Math . atan2 ( motionX , motionZ ) * <NUM_LIT> ) / Math . PI ) ; for ( rotationPitch = ( float ) ( ( Math . atan2 ( motionY , f ) * <NUM_LIT> ) / Math . PI ) ; rotationPitch - prevRotationPitch < - <NUM_LIT> ; prevRotationPitch -= <NUM_LIT> ) { } for ( ; rotationPitch - prevRotationPitch >= <NUM_LIT> ; prevRotationPitch += <NUM_LIT> ) { } for ( ; rotationYaw - prevRotationYaw < - <NUM_LIT> ; prevRotationYaw -= <NUM_LIT> ) { } for ( ; rotationYaw - prevRotationYaw >= <NUM_LIT> ; prevRotationYaw += <NUM_LIT> ) { } rotationPitch = prevRotationPitch + ( rotationPitch - prevRotationPitch ) * <NUM_LIT> ; rotationYaw = prevRotationYaw + ( rotationYaw - prevRotationYaw ) * <NUM_LIT> ; float f1 = <NUM_LIT> ; float f2 = func_40042_e ( ) ; if ( isInWater ( ) ) { for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:4> ; j ++ ) { float f3 = <NUM_LIT> ; worldObj . spawnParticle ( "<STR_LIT>" , posX - motionX * ( double ) f3 , posY - motionY * ( double ) f3 , posZ - motionZ * ( double ) f3 , motionX , motionY , motionZ ) ; } f1 = <NUM_LIT> ; } motionX *= f1 ; motionY *= f1 ; motionZ *= f1 ; motionY -= f2 ; setPosition ( posX , posY , posZ ) ; } protected float func_40042_e ( ) { return <NUM_LIT> ; } protected abstract void onImpact ( MovingObjectPosition movingobjectposition ) ; public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) xTile ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) yTile ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) zTile ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) inTile ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) throwableShake ) ; par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) ( inGround ? <NUM_LIT:1> : <NUM_LIT:0> ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { xTile = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; yTile = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; zTile = par1NBTTagCompound . getShort ( "<STR_LIT>" ) ; inTile = par1NBTTagCompound . getByte ( "<STR_LIT>" ) & <NUM_LIT> ; throwableShake = par1NBTTagCompound . getByte ( "<STR_LIT>" ) & <NUM_LIT> ; inGround = par1NBTTagCompound . getByte ( "<STR_LIT>" ) == <NUM_LIT:1> ; } public void onCollideWithPlayer ( EntityPlayer entityplayer ) { } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentNetherBridgeCrossing2 extends ComponentNetherBridgePiece { public ComponentNetherBridgeCrossing2 ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { getNextComponentNormal ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:0> , true ) ; getNextComponentX ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:0> , <NUM_LIT:1> , true ) ; getNextComponentZ ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:0> , <NUM_LIT:1> , true ) ; } public static ComponentNetherBridgeCrossing2 createValidComponent ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:7> , <NUM_LIT:5> , par5 ) ; if ( ! isAboveGround ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentNetherBridgeCrossing2 ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:0> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:0> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:5> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:4> , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; for ( int i = <NUM_LIT:0> ; i <= <NUM_LIT:4> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j <= <NUM_LIT:4> ; j ++ ) { fillCurrentPositionBlocksDownwards ( par1World , Block . netherBrick . blockID , <NUM_LIT:0> , i , - <NUM_LIT:1> , j , par3StructureBoundingBox ) ; } } return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; public class ContainerFurnace extends Container { private TileEntityFurnace furnace ; private int lastCookTime ; private int lastBurnTime ; private int lastItemBurnTime ; public ContainerFurnace ( InventoryPlayer par1InventoryPlayer , TileEntityFurnace par2TileEntityFurnace ) { lastCookTime = <NUM_LIT:0> ; lastBurnTime = <NUM_LIT:0> ; lastItemBurnTime = <NUM_LIT:0> ; furnace = par2TileEntityFurnace ; addSlot ( new Slot ( par2TileEntityFurnace , <NUM_LIT:0> , <NUM_LIT> , <NUM_LIT> ) ) ; addSlot ( new Slot ( par2TileEntityFurnace , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT> ) ) ; addSlot ( new SlotFurnace ( par1InventoryPlayer . player , par2TileEntityFurnace , <NUM_LIT:2> , <NUM_LIT> , <NUM_LIT> ) ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:3> ; i ++ ) { for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:9> ; k ++ ) { addSlot ( new Slot ( par1InventoryPlayer , k + i * <NUM_LIT:9> + <NUM_LIT:9> , <NUM_LIT:8> + k * <NUM_LIT> , <NUM_LIT> + i * <NUM_LIT> ) ) ; } } for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:9> ; j ++ ) { addSlot ( new Slot ( par1InventoryPlayer , j , <NUM_LIT:8> + j * <NUM_LIT> , <NUM_LIT> ) ) ; } } public void onCraftGuiOpened ( ICrafting par1ICrafting ) { super . onCraftGuiOpened ( par1ICrafting ) ; par1ICrafting . updateCraftingInventoryInfo ( this , <NUM_LIT:0> , furnace . furnaceCookTime ) ; par1ICrafting . updateCraftingInventoryInfo ( this , <NUM_LIT:1> , furnace . furnaceBurnTime ) ; par1ICrafting . updateCraftingInventoryInfo ( this , <NUM_LIT:2> , furnace . currentItemBurnTime ) ; } public void updateCraftingResults ( ) { super . updateCraftingResults ( ) ; for ( int i = <NUM_LIT:0> ; i < crafters . size ( ) ; i ++ ) { ICrafting icrafting = ( ICrafting ) crafters . get ( i ) ; if ( lastCookTime != furnace . furnaceCookTime ) { icrafting . updateCraftingInventoryInfo ( this , <NUM_LIT:0> , furnace . furnaceCookTime ) ; } if ( lastBurnTime != furnace . furnaceBurnTime ) { icrafting . updateCraftingInventoryInfo ( this , <NUM_LIT:1> , furnace . furnaceBurnTime ) ; } if ( lastItemBurnTime != furnace . currentItemBurnTime ) { icrafting . updateCraftingInventoryInfo ( this , <NUM_LIT:2> , furnace . currentItemBurnTime ) ; } } lastCookTime = furnace . furnaceCookTime ; lastBurnTime = furnace . furnaceBurnTime ; lastItemBurnTime = furnace . currentItemBurnTime ; } public boolean canInteractWith ( EntityPlayer par1EntityPlayer ) { return furnace . isUseableByPlayer ( par1EntityPlayer ) ; } public ItemStack transferStackInSlot ( int par1 ) { ItemStack itemstack = null ; Slot slot = ( Slot ) inventorySlots . get ( par1 ) ; if ( slot != null && slot . getHasStack ( ) ) { ItemStack itemstack1 = slot . getStack ( ) ; itemstack = itemstack1 . copy ( ) ; if ( par1 == <NUM_LIT:2> ) { if ( ! mergeItemStack ( itemstack1 , <NUM_LIT:3> , <NUM_LIT> , true ) ) { return null ; } slot . func_48417_a ( itemstack1 , itemstack ) ; } else if ( par1 == <NUM_LIT:1> || par1 == <NUM_LIT:0> ) { if ( ! mergeItemStack ( itemstack1 , <NUM_LIT:3> , <NUM_LIT> , false ) ) { return null ; } } else if ( FurnaceRecipes . smelting ( ) . getSmeltingResult ( itemstack1 . getItem ( ) . shiftedIndex ) != null ) { if ( ! mergeItemStack ( itemstack1 , <NUM_LIT:0> , <NUM_LIT:1> , false ) ) { return null ; } } else if ( TileEntityFurnace . func_52006_b ( itemstack1 ) ) { if ( ! mergeItemStack ( itemstack1 , <NUM_LIT:1> , <NUM_LIT:2> , false ) ) { return null ; } } else if ( par1 >= <NUM_LIT:3> && par1 < <NUM_LIT:30> ) { if ( ! mergeItemStack ( itemstack1 , <NUM_LIT:30> , <NUM_LIT> , false ) ) { return null ; } } else if ( par1 >= <NUM_LIT:30> && par1 < <NUM_LIT> && ! mergeItemStack ( itemstack1 , <NUM_LIT:3> , <NUM_LIT:30> , false ) ) { return null ; } if ( itemstack1 . stackSize == <NUM_LIT:0> ) { slot . putStack ( null ) ; } else { slot . onSlotChanged ( ) ; } if ( itemstack1 . stackSize != itemstack . stackSize ) { slot . onPickupFromSlot ( itemstack1 ) ; } else { return null ; } } return itemstack ; } } </s>
|
<s> package net . minecraft . src ; import java . awt . BorderLayout ; import java . awt . Dimension ; import java . util . logging . Logger ; import javax . swing . * ; import javax . swing . border . EtchedBorder ; import javax . swing . border . TitledBorder ; import net . minecraft . server . MinecraftServer ; public class ServerGUI extends JComponent implements ICommandListener { public static Logger logger = Logger . getLogger ( "<STR_LIT>" ) ; private MinecraftServer mcServer ; public static void initGui ( MinecraftServer par0MinecraftServer ) { try { UIManager . setLookAndFeel ( UIManager . getSystemLookAndFeelClassName ( ) ) ; } catch ( Exception exception ) { } ServerGUI servergui = new ServerGUI ( par0MinecraftServer ) ; JFrame jframe = new JFrame ( "<STR_LIT>" ) ; jframe . add ( servergui ) ; jframe . pack ( ) ; jframe . setLocationRelativeTo ( null ) ; jframe . setVisible ( true ) ; jframe . addWindowListener ( new ServerWindowAdapter ( par0MinecraftServer ) ) ; } public ServerGUI ( MinecraftServer par1MinecraftServer ) { mcServer = par1MinecraftServer ; setPreferredSize ( new Dimension ( <NUM_LIT> , <NUM_LIT> ) ) ; setLayout ( new BorderLayout ( ) ) ; try { add ( getLogComponent ( ) , "<STR_LIT>" ) ; add ( getStatsComponent ( ) , "<STR_LIT>" ) ; } catch ( Exception exception ) { exception . printStackTrace ( ) ; } } private JComponent getStatsComponent ( ) { JPanel jpanel = new JPanel ( new BorderLayout ( ) ) ; jpanel . add ( new GuiStatsComponent ( mcServer ) , "<STR_LIT>" ) ; jpanel . add ( getPlayerListComponent ( ) , "<STR_LIT>" ) ; jpanel . setBorder ( new TitledBorder ( new EtchedBorder ( ) , "<STR_LIT>" ) ) ; return jpanel ; } private JComponent getPlayerListComponent ( ) { PlayerListBox playerlistbox = new PlayerListBox ( mcServer ) ; JScrollPane jscrollpane = new JScrollPane ( playerlistbox , <NUM_LIT> , <NUM_LIT:30> ) ; jscrollpane . setBorder ( new TitledBorder ( new EtchedBorder ( ) , "<STR_LIT>" ) ) ; return jscrollpane ; } private JComponent getLogComponent ( ) { JPanel jpanel = new JPanel ( new BorderLayout ( ) ) ; JTextArea jtextarea = new JTextArea ( ) ; logger . addHandler ( new GuiLogOutputHandler ( jtextarea ) ) ; JScrollPane jscrollpane = new JScrollPane ( jtextarea , <NUM_LIT> , <NUM_LIT:30> ) ; jtextarea . setEditable ( false ) ; JTextField jtextfield = new JTextField ( ) ; jtextfield . addActionListener ( new ServerGuiCommandListener ( this , jtextfield ) ) ; jtextarea . addFocusListener ( new ServerGuiFocusAdapter ( this ) ) ; jpanel . add ( jscrollpane , "<STR_LIT>" ) ; jpanel . add ( jtextfield , "<STR_LIT>" ) ; jpanel . setBorder ( new TitledBorder ( new EtchedBorder ( ) , "<STR_LIT>" ) ) ; return jpanel ; } public void log ( String par1Str ) { logger . info ( par1Str ) ; } public String getUsername ( ) { return "<STR_LIT>" ; } static MinecraftServer getMinecraftServer ( ServerGUI par0ServerGUI ) { return par0ServerGUI . mcServer ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentNetherBridgeCorridor3 extends ComponentNetherBridgePiece { public ComponentNetherBridgeCorridor3 ( int par1 , Random par2Random , StructureBoundingBox par3StructureBoundingBox , int par4 ) { super ( par1 ) ; coordBaseMode = par4 ; boundingBox = par3StructureBoundingBox ; } public void buildComponent ( StructureComponent par1StructureComponent , List par2List , Random par3Random ) { getNextComponentNormal ( ( ComponentNetherBridgeStartPiece ) par1StructureComponent , par2List , par3Random , <NUM_LIT:1> , <NUM_LIT:0> , true ) ; } public static ComponentNetherBridgeCorridor3 createValidComponent ( List par0List , Random par1Random , int par2 , int par3 , int par4 , int par5 , int par6 ) { StructureBoundingBox structureboundingbox = StructureBoundingBox . getComponentToAddBoundingBox ( par2 , par3 , par4 , - <NUM_LIT:1> , - <NUM_LIT:7> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT> , <NUM_LIT:10> , par5 ) ; if ( ! isAboveGround ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentNetherBridgeCorridor3 ( par6 , par1Random , structureboundingbox , par5 ) ; } } public boolean addComponentParts ( World par1World , Random par2Random , StructureBoundingBox par3StructureBoundingBox ) { int i = getMetadataWithOffset ( Block . stairsNetherBrick . blockID , <NUM_LIT:2> ) ; for ( int j = <NUM_LIT:0> ; j <= <NUM_LIT:9> ; j ++ ) { int k = Math . max ( <NUM_LIT:1> , <NUM_LIT:7> - j ) ; int l = Math . min ( Math . max ( k + <NUM_LIT:5> , <NUM_LIT> - j ) , <NUM_LIT> ) ; int i1 = j ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , i1 , <NUM_LIT:4> , k , i1 , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , k + <NUM_LIT:1> , i1 , <NUM_LIT:3> , l - <NUM_LIT:1> , i1 , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; if ( j <= <NUM_LIT:6> ) { placeBlockAtCurrentPosition ( par1World , Block . stairsNetherBrick . blockID , i , <NUM_LIT:1> , k + <NUM_LIT:1> , i1 , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairsNetherBrick . blockID , i , <NUM_LIT:2> , k + <NUM_LIT:1> , i1 , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairsNetherBrick . blockID , i , <NUM_LIT:3> , k + <NUM_LIT:1> , i1 , par3StructureBoundingBox ) ; } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , l , i1 , <NUM_LIT:4> , l , i1 , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , k + <NUM_LIT:1> , i1 , <NUM_LIT:0> , l - <NUM_LIT:1> , i1 , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , k + <NUM_LIT:1> , i1 , <NUM_LIT:4> , l - <NUM_LIT:1> , i1 , Block . netherBrick . blockID , Block . netherBrick . blockID , false ) ; if ( ( j & <NUM_LIT:1> ) == <NUM_LIT:0> ) { fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , k + <NUM_LIT:2> , i1 , <NUM_LIT:0> , k + <NUM_LIT:3> , i1 , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , k + <NUM_LIT:2> , i1 , <NUM_LIT:4> , k + <NUM_LIT:3> , i1 , Block . netherFence . blockID , Block . netherFence . blockID , false ) ; } for ( int j1 = <NUM_LIT:0> ; j1 <= <NUM_LIT:4> ; j1 ++ ) { fillCurrentPositionBlocksDownwards ( par1World , Block . netherBrick . blockID , <NUM_LIT:0> , j1 , - <NUM_LIT:1> , i1 , par3StructureBoundingBox ) ; } } return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockSilverfish extends Block { public BlockSilverfish ( int par1 ) { super ( par1 , <NUM_LIT:1> , Material . clay ) ; setHardness ( <NUM_LIT> ) ; } public void harvestBlock ( World par1World , EntityPlayer par2EntityPlayer , int par3 , int par4 , int par5 , int par6 ) { super . harvestBlock ( par1World , par2EntityPlayer , par3 , par4 , par5 , par6 ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par2 == <NUM_LIT:1> ) { return Block . cobblestone . blockIndexInTexture ; } if ( par2 == <NUM_LIT:2> ) { return Block . stoneBrick . blockIndexInTexture ; } else { return Block . stone . blockIndexInTexture ; } } public void onBlockDestroyedByPlayer ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( ! par1World . isRemote ) { EntitySilverfish entitysilverfish = new EntitySilverfish ( par1World ) ; entitysilverfish . setLocationAndAngles ( ( double ) par2 + <NUM_LIT> , par3 , ( double ) par4 + <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; par1World . spawnEntityInWorld ( entitysilverfish ) ; entitysilverfish . spawnExplosionParticle ( ) ; } super . onBlockDestroyedByPlayer ( par1World , par2 , par3 , par4 , par5 ) ; } public int quantityDropped ( Random par1Random ) { return <NUM_LIT:0> ; } public static boolean getPosingIdByMetadata ( int par0 ) { return par0 == Block . stone . blockID || par0 == Block . cobblestone . blockID || par0 == Block . stoneBrick . blockID ; } public static int getMetadataForBlockType ( int par0 ) { if ( par0 == Block . cobblestone . blockID ) { return <NUM_LIT:1> ; } return par0 != Block . stoneBrick . blockID ? <NUM_LIT:0> : <NUM_LIT:2> ; } protected ItemStack createStackedBlock ( int par1 ) { Block block = Block . stone ; if ( par1 == <NUM_LIT:1> ) { block = Block . cobblestone ; } if ( par1 == <NUM_LIT:2> ) { block = Block . stoneBrick ; } return new ItemStack ( block ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . * ; public class StringTranslate { private static StringTranslate instance = new StringTranslate ( ) ; private Properties translateTable ; private TreeMap languageList ; private String currentLanguage ; private boolean isUnicode ; private StringTranslate ( ) { translateTable = new Properties ( ) ; loadLanguageList ( ) ; setLanguage ( "<STR_LIT>" ) ; } public static StringTranslate getInstance ( ) { return instance ; } private void loadLanguageList ( ) { TreeMap treemap = new TreeMap ( ) ; try { BufferedReader bufferedreader = new BufferedReader ( new InputStreamReader ( ( net . minecraft . src . StringTranslate . class ) . getResourceAsStream ( "<STR_LIT>" ) , "<STR_LIT:UTF-8>" ) ) ; for ( String s = bufferedreader . readLine ( ) ; s != null ; s = bufferedreader . readLine ( ) ) { String as [ ] = s . split ( "<STR_LIT:=>" ) ; if ( as != null && as . length == <NUM_LIT:2> ) { treemap . put ( as [ <NUM_LIT:0> ] , as [ <NUM_LIT:1> ] ) ; } } } catch ( IOException ioexception ) { ioexception . printStackTrace ( ) ; return ; } languageList = treemap ; } private void loadLanguage ( Properties par1Properties , String par2Str ) throws IOException { BufferedReader bufferedreader = new BufferedReader ( new InputStreamReader ( ( net . minecraft . src . StringTranslate . class ) . getResourceAsStream ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par2Str ) . append ( "<STR_LIT>" ) . toString ( ) ) , "<STR_LIT:UTF-8>" ) ) ; for ( String s = bufferedreader . readLine ( ) ; s != null ; s = bufferedreader . readLine ( ) ) { s = s . trim ( ) ; if ( s . startsWith ( "<STR_LIT:#>" ) ) { continue ; } String as [ ] = s . split ( "<STR_LIT:=>" ) ; if ( as != null && as . length == <NUM_LIT:2> ) { par1Properties . setProperty ( as [ <NUM_LIT:0> ] , as [ <NUM_LIT:1> ] ) ; } } } public void setLanguage ( String par1Str ) { if ( ! par1Str . equals ( this . currentLanguage ) ) { Properties var2 = new Properties ( ) ; try { this . loadLanguage ( var2 , "<STR_LIT>" ) ; } catch ( IOException var8 ) { ; } this . isUnicode = false ; if ( ! "<STR_LIT>" . equals ( par1Str ) ) { try { this . loadLanguage ( var2 , par1Str ) ; Enumeration var3 = var2 . propertyNames ( ) ; while ( var3 . hasMoreElements ( ) && ! this . isUnicode ) { Object var4 = var3 . nextElement ( ) ; Object var5 = var2 . get ( var4 ) ; if ( var5 != null ) { String var6 = var5 . toString ( ) ; for ( int var7 = <NUM_LIT:0> ; var7 < var6 . length ( ) ; ++ var7 ) { if ( var6 . charAt ( var7 ) >= <NUM_LIT> ) { this . isUnicode = true ; break ; } } } } } catch ( IOException var9 ) { var9 . printStackTrace ( ) ; return ; } } this . currentLanguage = par1Str ; this . translateTable = var2 ; } } public String translateKey ( String par1Str ) { return translateTable . getProperty ( par1Str , par1Str ) ; } public String translateKeyFormat ( String par1Str , Object par2ArrayOfObj [ ] ) { String s = translateTable . getProperty ( par1Str , par1Str ) ; return String . format ( s , par2ArrayOfObj ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class ItemBucket extends Item { private int isFull ; public ItemBucket ( int par1 , int par2 ) { super ( par1 ) ; maxStackSize = <NUM_LIT:1> ; isFull = par2 ; } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { float f = <NUM_LIT> ; double d = par3EntityPlayer . prevPosX + ( par3EntityPlayer . posX - par3EntityPlayer . prevPosX ) * ( double ) f ; double d1 = ( par3EntityPlayer . prevPosY + ( par3EntityPlayer . posY - par3EntityPlayer . prevPosY ) * ( double ) f + <NUM_LIT> ) - ( double ) par3EntityPlayer . yOffset ; double d2 = par3EntityPlayer . prevPosZ + ( par3EntityPlayer . posZ - par3EntityPlayer . prevPosZ ) * ( double ) f ; boolean flag = isFull == <NUM_LIT:0> ; MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer ( par2World , par3EntityPlayer , flag ) ; if ( movingobjectposition == null ) { return par1ItemStack ; } if ( movingobjectposition . typeOfHit == EnumMovingObjectType . TILE ) { int i = movingobjectposition . blockX ; int j = movingobjectposition . blockY ; int k = movingobjectposition . blockZ ; if ( ! par2World . canMineBlock ( par3EntityPlayer , i , j , k ) ) { return par1ItemStack ; } if ( isFull == <NUM_LIT:0> ) { if ( ! par3EntityPlayer . canPlayerEdit ( i , j , k ) ) { return par1ItemStack ; } if ( par2World . getBlockMaterial ( i , j , k ) == Material . water && par2World . getBlockMetadata ( i , j , k ) == <NUM_LIT:0> ) { par2World . setBlockWithNotify ( i , j , k , <NUM_LIT:0> ) ; if ( par3EntityPlayer . capabilities . isCreativeMode ) { return par1ItemStack ; } else { return new ItemStack ( Item . bucketWater ) ; } } if ( par2World . getBlockMaterial ( i , j , k ) == Material . lava && par2World . getBlockMetadata ( i , j , k ) == <NUM_LIT:0> ) { par2World . setBlockWithNotify ( i , j , k , <NUM_LIT:0> ) ; if ( par3EntityPlayer . capabilities . isCreativeMode ) { return par1ItemStack ; } else { return new ItemStack ( Item . bucketLava ) ; } } } else { if ( isFull < <NUM_LIT:0> ) { return new ItemStack ( Item . bucketEmpty ) ; } if ( movingobjectposition . sideHit == <NUM_LIT:0> ) { j -- ; } if ( movingobjectposition . sideHit == <NUM_LIT:1> ) { j ++ ; } if ( movingobjectposition . sideHit == <NUM_LIT:2> ) { k -- ; } if ( movingobjectposition . sideHit == <NUM_LIT:3> ) { k ++ ; } if ( movingobjectposition . sideHit == <NUM_LIT:4> ) { i -- ; } if ( movingobjectposition . sideHit == <NUM_LIT:5> ) { i ++ ; } if ( ! par3EntityPlayer . canPlayerEdit ( i , j , k ) ) { return par1ItemStack ; } if ( par2World . isAirBlock ( i , j , k ) || ! par2World . getBlockMaterial ( i , j , k ) . isSolid ( ) ) { if ( par2World . worldProvider . isHellWorld && isFull == Block . waterMoving . blockID ) { par2World . playSoundEffect ( d + <NUM_LIT> , d1 + <NUM_LIT> , d2 + <NUM_LIT> , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> + ( par2World . rand . nextFloat ( ) - par2World . rand . nextFloat ( ) ) * <NUM_LIT> ) ; for ( int l = <NUM_LIT:0> ; l < <NUM_LIT:8> ; l ++ ) { par2World . spawnParticle ( "<STR_LIT>" , ( double ) i + Math . random ( ) , ( double ) j + Math . random ( ) , ( double ) k + Math . random ( ) , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } } else { par2World . setBlockAndMetadataWithNotify ( i , j , k , isFull , <NUM_LIT:0> ) ; } if ( par3EntityPlayer . capabilities . isCreativeMode ) { return par1ItemStack ; } else { return new ItemStack ( Item . bucketEmpty ) ; } } } } else if ( isFull == <NUM_LIT:0> && ( movingobjectposition . entityHit instanceof EntityCow ) ) { return new ItemStack ( Item . bucketMilk ) ; } return par1ItemStack ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class ItemSnowball extends Item { public ItemSnowball ( int par1 ) { super ( par1 ) ; maxStackSize = <NUM_LIT:16> ; } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { if ( ! par3EntityPlayer . capabilities . isCreativeMode ) { par1ItemStack . stackSize -- ; } par2World . playSoundAtEntity ( par3EntityPlayer , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> / ( itemRand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ) ; if ( ! par2World . isRemote ) { par2World . spawnEntityInWorld ( new EntitySnowball ( par2World , par3EntityPlayer ) ) ; } return par1ItemStack ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class EntityEnderman extends EntityMob { private static boolean canCarryBlocks [ ] ; public boolean isAttacking ; private int teleportDelay ; private int field_35236_h ; public EntityEnderman ( World par1World ) { super ( par1World ) ; isAttacking = false ; teleportDelay = <NUM_LIT:0> ; field_35236_h = <NUM_LIT:0> ; texture = "<STR_LIT>" ; moveSpeed = <NUM_LIT> ; attackStrength = <NUM_LIT:7> ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; stepHeight = <NUM_LIT> ; } public int getMaxHealth ( ) { return <NUM_LIT> ; } protected void entityInit ( ) { super . entityInit ( ) ; dataWatcher . addObject ( <NUM_LIT:16> , new Byte ( ( byte ) <NUM_LIT:0> ) ) ; dataWatcher . addObject ( <NUM_LIT> , new Byte ( ( byte ) <NUM_LIT:0> ) ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) getCarried ( ) ) ; par1NBTTagCompound . setShort ( "<STR_LIT>" , ( short ) getCarryingData ( ) ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; setCarried ( par1NBTTagCompound . getShort ( "<STR_LIT>" ) ) ; setCarryingData ( par1NBTTagCompound . getShort ( "<STR_LIT>" ) ) ; } protected Entity findPlayerToAttack ( ) { EntityPlayer entityplayer = worldObj . getClosestVulnerablePlayerToEntity ( this , <NUM_LIT> ) ; if ( entityplayer != null ) { if ( shouldAttackPlayer ( entityplayer ) ) { if ( field_35236_h ++ == <NUM_LIT:5> ) { field_35236_h = <NUM_LIT:0> ; return entityplayer ; } } else { field_35236_h = <NUM_LIT:0> ; } } return null ; } public float getBrightness ( float par1 ) { return super . getBrightness ( par1 ) ; } private boolean shouldAttackPlayer ( EntityPlayer par1EntityPlayer ) { ItemStack itemstack = par1EntityPlayer . inventory . armorInventory [ <NUM_LIT:3> ] ; if ( itemstack != null && itemstack . itemID == Block . pumpkin . blockID ) { return false ; } Vec3D vec3d = par1EntityPlayer . getLook ( <NUM_LIT> ) . normalize ( ) ; Vec3D vec3d1 = Vec3D . createVector ( posX - par1EntityPlayer . posX , ( boundingBox . minY + ( double ) ( height / <NUM_LIT> ) ) - ( par1EntityPlayer . posY + ( double ) par1EntityPlayer . getEyeHeight ( ) ) , posZ - par1EntityPlayer . posZ ) ; double d = vec3d1 . lengthVector ( ) ; vec3d1 = vec3d1 . normalize ( ) ; double d1 = vec3d . dotProduct ( vec3d1 ) ; if ( d1 > <NUM_LIT> - <NUM_LIT> / d ) { return par1EntityPlayer . canEntityBeSeen ( this ) ; } else { return false ; } } public void onLivingUpdate ( ) { if ( isWet ( ) ) { attackEntityFrom ( DamageSource . drown , <NUM_LIT:1> ) ; } isAttacking = entityToAttack != null ; moveSpeed = entityToAttack == null ? <NUM_LIT> : <NUM_LIT> ; if ( ! worldObj . isRemote ) { if ( getCarried ( ) == <NUM_LIT:0> ) { if ( rand . nextInt ( <NUM_LIT:20> ) == <NUM_LIT:0> ) { int i = MathHelper . floor_double ( ( posX - <NUM_LIT> ) + rand . nextDouble ( ) * <NUM_LIT> ) ; int l = MathHelper . floor_double ( posY + rand . nextDouble ( ) * <NUM_LIT> ) ; int j1 = MathHelper . floor_double ( ( posZ - <NUM_LIT> ) + rand . nextDouble ( ) * <NUM_LIT> ) ; int l1 = worldObj . getBlockId ( i , l , j1 ) ; if ( canCarryBlocks [ l1 ] ) { setCarried ( worldObj . getBlockId ( i , l , j1 ) ) ; setCarryingData ( worldObj . getBlockMetadata ( i , l , j1 ) ) ; worldObj . setBlockWithNotify ( i , l , j1 , <NUM_LIT:0> ) ; } } } else if ( rand . nextInt ( <NUM_LIT> ) == <NUM_LIT:0> ) { int j = MathHelper . floor_double ( ( posX - <NUM_LIT> ) + rand . nextDouble ( ) * <NUM_LIT> ) ; int i1 = MathHelper . floor_double ( posY + rand . nextDouble ( ) * <NUM_LIT> ) ; int k1 = MathHelper . floor_double ( ( posZ - <NUM_LIT> ) + rand . nextDouble ( ) * <NUM_LIT> ) ; int i2 = worldObj . getBlockId ( j , i1 , k1 ) ; int j2 = worldObj . getBlockId ( j , i1 - <NUM_LIT:1> , k1 ) ; if ( i2 == <NUM_LIT:0> && j2 > <NUM_LIT:0> && Block . blocksList [ j2 ] . renderAsNormalBlock ( ) ) { worldObj . setBlockAndMetadataWithNotify ( j , i1 , k1 , getCarried ( ) , getCarryingData ( ) ) ; setCarried ( <NUM_LIT:0> ) ; } } } for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:2> ; k ++ ) { worldObj . spawnParticle ( "<STR_LIT>" , posX + ( rand . nextDouble ( ) - <NUM_LIT> ) * ( double ) width , ( posY + rand . nextDouble ( ) * ( double ) height ) - <NUM_LIT> , posZ + ( rand . nextDouble ( ) - <NUM_LIT> ) * ( double ) width , ( rand . nextDouble ( ) - <NUM_LIT> ) * <NUM_LIT> , - rand . nextDouble ( ) , ( rand . nextDouble ( ) - <NUM_LIT> ) * <NUM_LIT> ) ; } if ( worldObj . isDaytime ( ) && ! worldObj . isRemote ) { float f = getBrightness ( <NUM_LIT> ) ; if ( f > <NUM_LIT> && worldObj . canBlockSeeTheSky ( MathHelper . floor_double ( posX ) , MathHelper . floor_double ( posY ) , MathHelper . floor_double ( posZ ) ) && rand . nextFloat ( ) * <NUM_LIT> < ( f - <NUM_LIT> ) * <NUM_LIT> ) { entityToAttack = null ; teleportRandomly ( ) ; } } if ( isWet ( ) ) { entityToAttack = null ; teleportRandomly ( ) ; } isJumping = false ; if ( entityToAttack != null ) { faceEntity ( entityToAttack , <NUM_LIT> , <NUM_LIT> ) ; } if ( ! worldObj . isRemote && isEntityAlive ( ) ) { if ( entityToAttack != null ) { if ( ( entityToAttack instanceof EntityPlayer ) && shouldAttackPlayer ( ( EntityPlayer ) entityToAttack ) ) { moveStrafing = moveForward = <NUM_LIT> ; moveSpeed = <NUM_LIT> ; if ( entityToAttack . getDistanceSqToEntity ( this ) < <NUM_LIT> ) { teleportRandomly ( ) ; } teleportDelay = <NUM_LIT:0> ; } else if ( entityToAttack . getDistanceSqToEntity ( this ) > <NUM_LIT> && teleportDelay ++ >= <NUM_LIT:30> && teleportToEntity ( entityToAttack ) ) { teleportDelay = <NUM_LIT:0> ; } } else { teleportDelay = <NUM_LIT:0> ; } } super . onLivingUpdate ( ) ; } protected boolean teleportRandomly ( ) { double d = posX + ( rand . nextDouble ( ) - <NUM_LIT> ) * <NUM_LIT> ; double d1 = posY + ( double ) ( rand . nextInt ( <NUM_LIT> ) - <NUM_LIT:32> ) ; double d2 = posZ + ( rand . nextDouble ( ) - <NUM_LIT> ) * <NUM_LIT> ; return teleportTo ( d , d1 , d2 ) ; } protected boolean teleportToEntity ( Entity par1Entity ) { Vec3D vec3d = Vec3D . createVector ( posX - par1Entity . posX , ( ( boundingBox . minY + ( double ) ( height / <NUM_LIT> ) ) - par1Entity . posY ) + ( double ) par1Entity . getEyeHeight ( ) , posZ - par1Entity . posZ ) ; vec3d = vec3d . normalize ( ) ; double d = <NUM_LIT> ; double d1 = ( posX + ( rand . nextDouble ( ) - <NUM_LIT> ) * <NUM_LIT> ) - vec3d . xCoord * d ; double d2 = ( posY + ( double ) ( rand . nextInt ( <NUM_LIT:16> ) - <NUM_LIT:8> ) ) - vec3d . yCoord * d ; double d3 = ( posZ + ( rand . nextDouble ( ) - <NUM_LIT> ) * <NUM_LIT> ) - vec3d . zCoord * d ; return teleportTo ( d1 , d2 , d3 ) ; } protected boolean teleportTo ( double par1 , double par3 , double par5 ) { double d = posX ; double d1 = posY ; double d2 = posZ ; posX = par1 ; posY = par3 ; posZ = par5 ; boolean flag = false ; int i = MathHelper . floor_double ( posX ) ; int j = MathHelper . floor_double ( posY ) ; int k = MathHelper . floor_double ( posZ ) ; if ( worldObj . blockExists ( i , j , k ) ) { boolean flag1 ; for ( flag1 = false ; ! flag1 && j > <NUM_LIT:0> ; ) { int i1 = worldObj . getBlockId ( i , j - <NUM_LIT:1> , k ) ; if ( i1 == <NUM_LIT:0> || ! Block . blocksList [ i1 ] . blockMaterial . blocksMovement ( ) ) { posY -- ; j -- ; } else { flag1 = true ; } } if ( flag1 ) { setPosition ( posX , posY , posZ ) ; if ( worldObj . getCollidingBoundingBoxes ( this , boundingBox ) . size ( ) == <NUM_LIT:0> && ! worldObj . isAnyLiquid ( boundingBox ) ) { flag = true ; } } } if ( ! flag ) { setPosition ( d , d1 , d2 ) ; return false ; } int l = <NUM_LIT> ; for ( int j1 = <NUM_LIT:0> ; j1 < l ; j1 ++ ) { double d3 = ( double ) j1 / ( ( double ) l - <NUM_LIT> ) ; float f = ( rand . nextFloat ( ) - <NUM_LIT> ) * <NUM_LIT> ; float f1 = ( rand . nextFloat ( ) - <NUM_LIT> ) * <NUM_LIT> ; float f2 = ( rand . nextFloat ( ) - <NUM_LIT> ) * <NUM_LIT> ; double d4 = d + ( posX - d ) * d3 + ( rand . nextDouble ( ) - <NUM_LIT> ) * ( double ) width * <NUM_LIT> ; double d5 = d1 + ( posY - d1 ) * d3 + rand . nextDouble ( ) * ( double ) height ; double d6 = d2 + ( posZ - d2 ) * d3 + ( rand . nextDouble ( ) - <NUM_LIT> ) * ( double ) width * <NUM_LIT> ; worldObj . spawnParticle ( "<STR_LIT>" , d4 , d5 , d6 , f , f1 , f2 ) ; } worldObj . playSoundEffect ( d , d1 , d2 , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; return true ; } protected String getLivingSound ( ) { return "<STR_LIT>" ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } protected int getDropItemId ( ) { return Item . enderPearl . shiftedIndex ; } protected void dropFewItems ( boolean par1 , int par2 ) { int i = getDropItemId ( ) ; if ( i > <NUM_LIT:0> ) { int j = rand . nextInt ( <NUM_LIT:2> + par2 ) ; for ( int k = <NUM_LIT:0> ; k < j ; k ++ ) { dropItem ( i , <NUM_LIT:1> ) ; } } } public void setCarried ( int par1 ) { dataWatcher . updateObject ( <NUM_LIT:16> , Byte . valueOf ( ( byte ) ( par1 & <NUM_LIT> ) ) ) ; } public int getCarried ( ) { return dataWatcher . getWatchableObjectByte ( <NUM_LIT:16> ) ; } public void setCarryingData ( int par1 ) { dataWatcher . updateObject ( <NUM_LIT> , Byte . valueOf ( ( byte ) ( par1 & <NUM_LIT> ) ) ) ; } public int getCarryingData ( ) { return dataWatcher . getWatchableObjectByte ( <NUM_LIT> ) ; } public boolean attackEntityFrom ( DamageSource par1DamageSource , int par2 ) { if ( par1DamageSource instanceof EntityDamageSourceIndirect ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { if ( teleportRandomly ( ) ) { return true ; } } return false ; } else { return super . attackEntityFrom ( par1DamageSource , par2 ) ; } } static { canCarryBlocks = new boolean [ <NUM_LIT> ] ; canCarryBlocks [ Block . grass . blockID ] = true ; canCarryBlocks [ Block . dirt . blockID ] = true ; canCarryBlocks [ Block . sand . blockID ] = true ; canCarryBlocks [ Block . gravel . blockID ] = true ; canCarryBlocks [ Block . plantYellow . blockID ] = true ; canCarryBlocks [ Block . plantRed . blockID ] = true ; canCarryBlocks [ Block . mushroomBrown . blockID ] = true ; canCarryBlocks [ Block . mushroomRed . blockID ] = true ; canCarryBlocks [ Block . tnt . blockID ] = true ; canCarryBlocks [ Block . cactus . blockID ] = true ; canCarryBlocks [ Block . blockClay . blockID ] = true ; canCarryBlocks [ Block . pumpkin . blockID ] = true ; canCarryBlocks [ Block . melon . blockID ] = true ; canCarryBlocks [ Block . mycelium . blockID ] = true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenWaterlily extends WorldGenerator { public WorldGenWaterlily ( ) { } 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 ) && Block . waterlily . canPlaceBlockAt ( par1World , j , k , l ) ) { par1World . setBlock ( j , k , l , Block . waterlily . blockID ) ; } } return true ; } } </s>
|
<s> package net . minecraft . src ; public class ItemSlab extends ItemBlock { public ItemSlab ( int par1 ) { super ( par1 ) ; setMaxDamage ( <NUM_LIT:0> ) ; setHasSubtypes ( true ) ; } public int getMetadata ( int par1 ) { return par1 ; } public String getItemNameIS ( ItemStack par1ItemStack ) { int i = par1ItemStack . getItemDamage ( ) ; if ( i < <NUM_LIT:0> || i >= BlockStep . blockStepTypes . length ) { i = <NUM_LIT:0> ; } return ( new StringBuilder ( ) ) . append ( super . getItemName ( ) ) . append ( "<STR_LIT:.>" ) . append ( BlockStep . blockStepTypes [ i ] ) . toString ( ) ; } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int par4 , int par5 , int par6 , int par7 ) { if ( par1ItemStack . stackSize == <NUM_LIT:0> ) { return false ; } if ( ! par2EntityPlayer . canPlayerEdit ( par4 , par5 , par6 ) ) { return false ; } int i = par3World . getBlockId ( par4 , par5 , par6 ) ; int j = par3World . getBlockMetadata ( par4 , par5 , par6 ) ; int k = j & <NUM_LIT:7> ; boolean flag = ( j & <NUM_LIT:8> ) != <NUM_LIT:0> ; if ( ( par7 == <NUM_LIT:1> && ! flag || par7 == <NUM_LIT:0> && flag ) && i == Block . stairSingle . blockID && k == par1ItemStack . getItemDamage ( ) ) { if ( par3World . checkIfAABBIsClear ( Block . stairDouble . getCollisionBoundingBoxFromPool ( par3World , par4 , par5 , par6 ) ) && par3World . setBlockAndMetadataWithNotify ( par4 , par5 , par6 , Block . stairDouble . blockID , k ) ) { par3World . playSoundEffect ( ( float ) par4 + <NUM_LIT> , ( float ) par5 + <NUM_LIT> , ( float ) par6 + <NUM_LIT> , Block . stairDouble . stepSound . getStepSound ( ) , ( Block . stairDouble . stepSound . getVolume ( ) + <NUM_LIT> ) / <NUM_LIT> , Block . stairDouble . stepSound . getPitch ( ) * <NUM_LIT> ) ; par1ItemStack . stackSize -- ; } return true ; } if ( func_50020_b ( par1ItemStack , par2EntityPlayer , par3World , par4 , par5 , par6 , par7 ) ) { return true ; } else { return super . onItemUse ( par1ItemStack , par2EntityPlayer , par3World , par4 , par5 , par6 , par7 ) ; } } private static boolean func_50020_b ( ItemStack par0ItemStack , EntityPlayer par1EntityPlayer , World par2World , int par3 , int par4 , int par5 , int par6 ) { if ( par6 == <NUM_LIT:0> ) { par4 -- ; } if ( par6 == <NUM_LIT:1> ) { par4 ++ ; } if ( par6 == <NUM_LIT:2> ) { par5 -- ; } if ( par6 == <NUM_LIT:3> ) { par5 ++ ; } if ( par6 == <NUM_LIT:4> ) { par3 -- ; } if ( par6 == <NUM_LIT:5> ) { par3 ++ ; } int i = par2World . getBlockId ( par3 , par4 , par5 ) ; int j = par2World . getBlockMetadata ( par3 , par4 , par5 ) ; int k = j & <NUM_LIT:7> ; if ( i == Block . stairSingle . blockID && k == par0ItemStack . getItemDamage ( ) ) { if ( par2World . checkIfAABBIsClear ( Block . stairDouble . getCollisionBoundingBoxFromPool ( par2World , par3 , par4 , par5 ) ) && par2World . setBlockAndMetadataWithNotify ( par3 , par4 , par5 , Block . stairDouble . blockID , k ) ) { par2World . playSoundEffect ( ( float ) par3 + <NUM_LIT> , ( float ) par4 + <NUM_LIT> , ( float ) par5 + <NUM_LIT> , Block . stairDouble . stepSound . getStepSound ( ) , ( Block . stairDouble . stepSound . getVolume ( ) + <NUM_LIT> ) / <NUM_LIT> , Block . stairDouble . stepSound . getPitch ( ) * <NUM_LIT> ) ; par0ItemStack . stackSize -- ; } return true ; } else { return false ; } } } </s>
|
<s> package net . minecraft . src ; public class ItemSword extends Item { private int weaponDamage ; private final EnumToolMaterial toolMaterial ; public ItemSword ( int par1 , EnumToolMaterial par2EnumToolMaterial ) { super ( par1 ) ; toolMaterial = par2EnumToolMaterial ; maxStackSize = <NUM_LIT:1> ; setMaxDamage ( par2EnumToolMaterial . getMaxUses ( ) ) ; weaponDamage = <NUM_LIT:4> + par2EnumToolMaterial . getDamageVsEntity ( ) ; } public float getStrVsBlock ( ItemStack par1ItemStack , Block par2Block ) { return par2Block . blockID != Block . web . blockID ? <NUM_LIT> : <NUM_LIT> ; } public boolean hitEntity ( ItemStack par1ItemStack , EntityLiving par2EntityLiving , EntityLiving par3EntityLiving ) { par1ItemStack . damageItem ( <NUM_LIT:1> , par3EntityLiving ) ; return true ; } public boolean onBlockDestroyed ( ItemStack par1ItemStack , int par2 , int par3 , int par4 , int par5 , EntityLiving par6EntityLiving ) { par1ItemStack . damageItem ( <NUM_LIT:2> , par6EntityLiving ) ; return true ; } public int getDamageVsEntity ( Entity par1Entity ) { return weaponDamage ; } public EnumAction getItemUseAction ( ItemStack par1ItemStack ) { return EnumAction . block ; } public int getMaxItemUseDuration ( ItemStack par1ItemStack ) { return <NUM_LIT> ; } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { par3EntityPlayer . setItemInUse ( par1ItemStack , getMaxItemUseDuration ( par1ItemStack ) ) ; return par1ItemStack ; } public boolean canHarvestBlock ( Block par1Block ) { return par1Block . blockID == Block . web . blockID ; } public int getItemEnchantability ( ) { return toolMaterial . getEnchantability ( ) ; } } </s>
|
<s> package net . minecraft . src ; public class EntityFallingSand extends Entity { public int blockID ; public int fallTime ; public EntityFallingSand ( World par1World ) { super ( par1World ) ; fallTime = <NUM_LIT:0> ; } public EntityFallingSand ( World par1World , double par2 , double par4 , double par6 , int par8 ) { super ( par1World ) ; fallTime = <NUM_LIT:0> ; blockID = par8 ; preventEntitySpawning = true ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; yOffset = height / <NUM_LIT> ; setPosition ( par2 , par4 , par6 ) ; motionX = <NUM_LIT> ; motionY = <NUM_LIT> ; motionZ = <NUM_LIT> ; prevPosX = par2 ; prevPosY = par4 ; prevPosZ = par6 ; } protected boolean canTriggerWalking ( ) { return false ; } protected void entityInit ( ) { } public boolean canBeCollidedWith ( ) { return ! isDead ; } public void onUpdate ( ) { if ( blockID == <NUM_LIT:0> ) { setDead ( ) ; return ; } prevPosX = posX ; prevPosY = posY ; prevPosZ = posZ ; fallTime ++ ; motionY -= <NUM_LIT> ; moveEntity ( motionX , motionY , motionZ ) ; motionX *= <NUM_LIT> ; motionY *= <NUM_LIT> ; motionZ *= <NUM_LIT> ; int i = MathHelper . floor_double ( posX ) ; int j = MathHelper . floor_double ( posY ) ; int k = MathHelper . floor_double ( posZ ) ; if ( fallTime == <NUM_LIT:1> && worldObj . getBlockId ( i , j , k ) == blockID ) { worldObj . setBlockWithNotify ( i , j , k , <NUM_LIT:0> ) ; } else if ( ! worldObj . isRemote && fallTime == <NUM_LIT:1> ) { setDead ( ) ; } if ( onGround ) { motionX *= <NUM_LIT> ; motionZ *= <NUM_LIT> ; motionY *= - <NUM_LIT> ; if ( worldObj . getBlockId ( i , j , k ) != Block . pistonMoving . blockID ) { setDead ( ) ; if ( ( ! worldObj . canBlockBePlacedAt ( blockID , i , j , k , true , <NUM_LIT:1> ) || BlockSand . canFallBelow ( worldObj , i , j - <NUM_LIT:1> , k ) || ! worldObj . setBlockWithNotify ( i , j , k , blockID ) ) && ! worldObj . isRemote ) { dropItem ( blockID , <NUM_LIT:1> ) ; } } } else if ( fallTime > <NUM_LIT:100> && ! worldObj . isRemote && ( j < <NUM_LIT:1> || j > <NUM_LIT> ) || fallTime > <NUM_LIT> ) { dropItem ( blockID , <NUM_LIT:1> ) ; setDead ( ) ; } } protected void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { par1NBTTagCompound . setByte ( "<STR_LIT>" , ( byte ) blockID ) ; } protected void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { blockID = par1NBTTagCompound . getByte ( "<STR_LIT>" ) & <NUM_LIT> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . lang . reflect . Constructor ; import java . util . HashMap ; import java . util . Map ; public class EntityList { private static Map stringToClassMapping = new HashMap ( ) ; private static Map classToStringMapping = new HashMap ( ) ; private static Map IDtoClassMapping = new HashMap ( ) ; private static Map classToIDMapping = new HashMap ( ) ; private static Map stringToIDMapping = new HashMap ( ) ; public static HashMap entityEggs = new HashMap ( ) ; public EntityList ( ) { } private static void addMapping ( Class par0Class , String par1Str , int par2 ) { stringToClassMapping . put ( par1Str , par0Class ) ; classToStringMapping . put ( par0Class , par1Str ) ; IDtoClassMapping . put ( Integer . valueOf ( par2 ) , par0Class ) ; classToIDMapping . put ( par0Class , Integer . valueOf ( par2 ) ) ; stringToIDMapping . put ( par1Str , Integer . valueOf ( par2 ) ) ; } private static void addMapping ( Class par0Class , String par1Str , int par2 , int par3 , int par4 ) { addMapping ( par0Class , par1Str , par2 ) ; entityEggs . put ( Integer . valueOf ( par2 ) , new EntityEggInfo ( par2 , par3 , par4 ) ) ; } public static Entity createEntityByName ( String par0Str , World par1World ) { Entity entity = null ; try { Class class1 = ( Class ) stringToClassMapping . get ( par0Str ) ; if ( class1 != null ) { entity = ( Entity ) class1 . getConstructor ( new Class [ ] { net . minecraft . src . World . class } ) . newInstance ( new Object [ ] { par1World } ) ; } } catch ( Exception exception ) { exception . printStackTrace ( ) ; } return entity ; } public static Entity createEntityFromNBT ( NBTTagCompound par0NBTTagCompound , World par1World ) { Entity entity = null ; try { Class class1 = ( Class ) stringToClassMapping . get ( par0NBTTagCompound . getString ( "<STR_LIT:id>" ) ) ; if ( class1 != null ) { entity = ( Entity ) class1 . getConstructor ( new Class [ ] { net . minecraft . src . World . class } ) . newInstance ( new Object [ ] { par1World } ) ; } } catch ( Exception exception ) { exception . printStackTrace ( ) ; } if ( entity != null ) { entity . readFromNBT ( par0NBTTagCompound ) ; } else { System . out . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par0NBTTagCompound . getString ( "<STR_LIT:id>" ) ) . toString ( ) ) ; } return entity ; } public static Entity createEntityByID ( int par0 , World par1World ) { Entity entity = null ; try { Class class1 = ( Class ) IDtoClassMapping . get ( Integer . valueOf ( par0 ) ) ; if ( class1 != null ) { entity = ( Entity ) class1 . getConstructor ( new Class [ ] { net . minecraft . src . World . class } ) . newInstance ( new Object [ ] { par1World } ) ; } } catch ( Exception exception ) { exception . printStackTrace ( ) ; } if ( entity == null ) { System . out . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par0 ) . toString ( ) ) ; } return entity ; } public static int getEntityID ( Entity par0Entity ) { return ( ( Integer ) classToIDMapping . get ( par0Entity . getClass ( ) ) ) . intValue ( ) ; } public static String getEntityString ( Entity par0Entity ) { return ( String ) classToStringMapping . get ( par0Entity . getClass ( ) ) ; } public static int getIDFromString ( String par0Str ) { Integer integer = ( Integer ) stringToIDMapping . get ( par0Str ) ; if ( integer == null ) { return <NUM_LIT> ; } else { return integer . intValue ( ) ; } } static { addMapping ( net . minecraft . src . EntityItem . class , "<STR_LIT>" , <NUM_LIT:1> ) ; addMapping ( net . minecraft . src . EntityXPOrb . class , "<STR_LIT>" , <NUM_LIT:2> ) ; addMapping ( net . minecraft . src . EntityPainting . class , "<STR_LIT>" , <NUM_LIT:9> ) ; addMapping ( net . minecraft . src . EntityArrow . class , "<STR_LIT>" , <NUM_LIT:10> ) ; addMapping ( net . minecraft . src . EntitySnowball . class , "<STR_LIT>" , <NUM_LIT:11> ) ; addMapping ( net . minecraft . src . EntityFireball . class , "<STR_LIT>" , <NUM_LIT:12> ) ; addMapping ( net . minecraft . src . EntitySmallFireball . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityEnderPearl . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityEnderEye . class , "<STR_LIT>" , <NUM_LIT:15> ) ; addMapping ( net . minecraft . src . EntityPotion . class , "<STR_LIT>" , <NUM_LIT:16> ) ; addMapping ( net . minecraft . src . EntityExpBottle . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityTNTPrimed . class , "<STR_LIT>" , <NUM_LIT:20> ) ; addMapping ( net . minecraft . src . EntityFallingSand . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityMinecart . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityBoat . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityLiving . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityMob . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityCreeper . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0> ) ; addMapping ( net . minecraft . src . EntitySkeleton . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntitySpider . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityGiantZombie . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityZombie . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntitySlime . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityGhast . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityPigZombie . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityEnderman . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:0> ) ; addMapping ( net . minecraft . src . EntityCaveSpider . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntitySilverfish . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityBlaze . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityMagmaCube . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityDragon . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityPig . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntitySheep . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityCow . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityChicken . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntitySquid . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityWolf . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityMooshroom . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntitySnowman . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityOcelot . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityIronGolem . class , "<STR_LIT>" , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityVillager . class , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; addMapping ( net . minecraft . src . EntityEnderCrystal . class , "<STR_LIT>" , <NUM_LIT> ) ; } } </s>
|
<s> package net . minecraft . src ; public class MinecraftException extends RuntimeException { public MinecraftException ( String par1Str ) { super ( par1Str ) ; } } </s>
|
<s> package net . minecraft . src ; class LongHashMapEntry { final long key ; Object value ; LongHashMapEntry nextEntry ; final int hash ; LongHashMapEntry ( int par1 , long par2 , Object par4Obj , LongHashMapEntry par5LongHashMapEntry ) { value = par4Obj ; nextEntry = par5LongHashMapEntry ; key = par2 ; hash = par1 ; } public final long getKey ( ) { return key ; } public final Object getValue ( ) { return value ; } public final boolean equals ( Object par1Obj ) { if ( ! ( par1Obj instanceof LongHashMapEntry ) ) { return false ; } LongHashMapEntry longhashmapentry = ( LongHashMapEntry ) par1Obj ; Long long1 = Long . valueOf ( getKey ( ) ) ; Long long2 = Long . valueOf ( longhashmapentry . getKey ( ) ) ; if ( long1 == long2 || long1 != null && long1 . equals ( long2 ) ) { Object obj = getValue ( ) ; Object obj1 = longhashmapentry . getValue ( ) ; if ( obj == obj1 || obj != null && obj . equals ( obj1 ) ) { return true ; } } return false ; } public final int hashCode ( ) { return LongHashMap . getHashCode ( key ) ; } public final String toString ( ) { return ( new StringBuilder ( ) ) . append ( getKey ( ) ) . append ( "<STR_LIT:=>" ) . append ( getValue ( ) ) . toString ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ChunkProviderHell implements IChunkProvider { private Random hellRNG ; private NoiseGeneratorOctaves netherNoiseGen1 ; private NoiseGeneratorOctaves netherNoiseGen2 ; private NoiseGeneratorOctaves netherNoiseGen3 ; private NoiseGeneratorOctaves slowsandGravelNoiseGen ; private NoiseGeneratorOctaves netherrackExculsivityNoiseGen ; public NoiseGeneratorOctaves netherNoiseGen6 ; public NoiseGeneratorOctaves netherNoiseGen7 ; private World worldObj ; private double field_4234_o [ ] ; public MapGenNetherBridge genNetherBridge ; private double slowsandNoise [ ] ; private double gravelNoise [ ] ; private double netherrackExclusivityNoise [ ] ; private MapGenBase netherCaveGenerator ; double noiseData1 [ ] ; double noiseData2 [ ] ; double noiseData3 [ ] ; double noiseData4 [ ] ; double noiseData5 [ ] ; public ChunkProviderHell ( World par1World , long par2 ) { genNetherBridge = new MapGenNetherBridge ( ) ; slowsandNoise = new double [ <NUM_LIT> ] ; gravelNoise = new double [ <NUM_LIT> ] ; netherrackExclusivityNoise = new double [ <NUM_LIT> ] ; netherCaveGenerator = new MapGenCavesHell ( ) ; worldObj = par1World ; hellRNG = new Random ( par2 ) ; netherNoiseGen1 = new NoiseGeneratorOctaves ( hellRNG , <NUM_LIT:16> ) ; netherNoiseGen2 = new NoiseGeneratorOctaves ( hellRNG , <NUM_LIT:16> ) ; netherNoiseGen3 = new NoiseGeneratorOctaves ( hellRNG , <NUM_LIT:8> ) ; slowsandGravelNoiseGen = new NoiseGeneratorOctaves ( hellRNG , <NUM_LIT:4> ) ; netherrackExculsivityNoiseGen = new NoiseGeneratorOctaves ( hellRNG , <NUM_LIT:4> ) ; netherNoiseGen6 = new NoiseGeneratorOctaves ( hellRNG , <NUM_LIT:10> ) ; netherNoiseGen7 = new NoiseGeneratorOctaves ( hellRNG , <NUM_LIT:16> ) ; } public void generateNetherTerrain ( int par1 , int par2 , byte par3ArrayOfByte [ ] ) { byte byte0 = <NUM_LIT:4> ; byte byte1 = <NUM_LIT:32> ; int i = byte0 + <NUM_LIT:1> ; byte byte2 = <NUM_LIT> ; int j = byte0 + <NUM_LIT:1> ; field_4234_o = func_4060_a ( field_4234_o , par1 * byte0 , <NUM_LIT:0> , par2 * byte0 , i , byte2 , j ) ; for ( int k = <NUM_LIT:0> ; k < byte0 ; k ++ ) { for ( int l = <NUM_LIT:0> ; l < byte0 ; l ++ ) { for ( int i1 = <NUM_LIT:0> ; i1 < <NUM_LIT:16> ; i1 ++ ) { double d = <NUM_LIT> ; double d1 = field_4234_o [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:0> ) ) * byte2 + ( i1 + <NUM_LIT:0> ) ] ; double d2 = field_4234_o [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:1> ) ) * byte2 + ( i1 + <NUM_LIT:0> ) ] ; double d3 = field_4234_o [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:0> ) ) * byte2 + ( i1 + <NUM_LIT:0> ) ] ; double d4 = field_4234_o [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:1> ) ) * byte2 + ( i1 + <NUM_LIT:0> ) ] ; double d5 = ( field_4234_o [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:0> ) ) * byte2 + ( i1 + <NUM_LIT:1> ) ] - d1 ) * d ; double d6 = ( field_4234_o [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:1> ) ) * byte2 + ( i1 + <NUM_LIT:1> ) ] - d2 ) * d ; double d7 = ( field_4234_o [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:0> ) ) * byte2 + ( i1 + <NUM_LIT:1> ) ] - d3 ) * d ; double d8 = ( field_4234_o [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:1> ) ) * byte2 + ( i1 + <NUM_LIT:1> ) ] - d4 ) * d ; for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:8> ; j1 ++ ) { double d9 = <NUM_LIT> ; double d10 = d1 ; double d11 = d2 ; double d12 = ( d3 - d1 ) * d9 ; double d13 = ( d4 - d2 ) * d9 ; for ( int k1 = <NUM_LIT:0> ; k1 < <NUM_LIT:4> ; k1 ++ ) { int l1 = k1 + k * <NUM_LIT:4> << <NUM_LIT:11> | <NUM_LIT:0> + l * <NUM_LIT:4> << <NUM_LIT:7> | i1 * <NUM_LIT:8> + j1 ; char c = '<STR_LIT>' ; double d14 = <NUM_LIT> ; double d15 = d10 ; double d16 = ( d11 - d10 ) * d14 ; for ( int i2 = <NUM_LIT:0> ; i2 < <NUM_LIT:4> ; i2 ++ ) { int j2 = <NUM_LIT:0> ; if ( i1 * <NUM_LIT:8> + j1 < byte1 ) { j2 = Block . lavaStill . blockID ; } if ( d15 > <NUM_LIT> ) { j2 = Block . netherrack . blockID ; } par3ArrayOfByte [ l1 ] = ( byte ) j2 ; l1 += c ; d15 += d16 ; } d10 += d12 ; d11 += d13 ; } d1 += d5 ; d2 += d6 ; d3 += d7 ; d4 += d8 ; } } } } } public void func_4061_b ( int par1 , int par2 , byte par3ArrayOfByte [ ] ) { byte byte0 = <NUM_LIT> ; double d = <NUM_LIT> ; slowsandNoise = slowsandGravelNoiseGen . generateNoiseOctaves ( slowsandNoise , par1 * <NUM_LIT:16> , par2 * <NUM_LIT:16> , <NUM_LIT:0> , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:1> , d , d , <NUM_LIT> ) ; gravelNoise = slowsandGravelNoiseGen . generateNoiseOctaves ( gravelNoise , par1 * <NUM_LIT:16> , <NUM_LIT> , par2 * <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:1> , <NUM_LIT:16> , d , <NUM_LIT> , d ) ; netherrackExclusivityNoise = netherrackExculsivityNoiseGen . generateNoiseOctaves ( netherrackExclusivityNoise , par1 * <NUM_LIT:16> , par2 * <NUM_LIT:16> , <NUM_LIT:0> , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:1> , d * <NUM_LIT> , d * <NUM_LIT> , d * <NUM_LIT> ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:16> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:16> ; j ++ ) { boolean flag = slowsandNoise [ i + j * <NUM_LIT:16> ] + hellRNG . nextDouble ( ) * <NUM_LIT> > <NUM_LIT> ; boolean flag1 = gravelNoise [ i + j * <NUM_LIT:16> ] + hellRNG . nextDouble ( ) * <NUM_LIT> > <NUM_LIT> ; int k = ( int ) ( netherrackExclusivityNoise [ i + j * <NUM_LIT:16> ] / <NUM_LIT> + <NUM_LIT> + hellRNG . nextDouble ( ) * <NUM_LIT> ) ; int l = - <NUM_LIT:1> ; byte byte1 = ( byte ) Block . netherrack . blockID ; byte byte2 = ( byte ) Block . netherrack . blockID ; for ( int i1 = <NUM_LIT> ; i1 >= <NUM_LIT:0> ; i1 -- ) { int j1 = ( j * <NUM_LIT:16> + i ) * <NUM_LIT> + i1 ; if ( i1 >= <NUM_LIT> - hellRNG . nextInt ( <NUM_LIT:5> ) ) { par3ArrayOfByte [ j1 ] = ( byte ) Block . bedrock . blockID ; continue ; } if ( i1 <= <NUM_LIT:0> + hellRNG . nextInt ( <NUM_LIT:5> ) ) { par3ArrayOfByte [ j1 ] = ( byte ) Block . bedrock . blockID ; continue ; } byte byte3 = par3ArrayOfByte [ j1 ] ; if ( byte3 == <NUM_LIT:0> ) { l = - <NUM_LIT:1> ; continue ; } if ( byte3 != Block . netherrack . blockID ) { continue ; } if ( l == - <NUM_LIT:1> ) { if ( k <= <NUM_LIT:0> ) { byte1 = <NUM_LIT:0> ; byte2 = ( byte ) Block . netherrack . blockID ; } else if ( i1 >= byte0 - <NUM_LIT:4> && i1 <= byte0 + <NUM_LIT:1> ) { byte1 = ( byte ) Block . netherrack . blockID ; byte2 = ( byte ) Block . netherrack . blockID ; if ( flag1 ) { byte1 = ( byte ) Block . gravel . blockID ; } if ( flag1 ) { byte2 = ( byte ) Block . netherrack . blockID ; } if ( flag ) { byte1 = ( byte ) Block . slowSand . blockID ; } if ( flag ) { byte2 = ( byte ) Block . slowSand . blockID ; } } if ( i1 < byte0 && byte1 == <NUM_LIT:0> ) { byte1 = ( byte ) Block . lavaStill . blockID ; } l = k ; if ( i1 >= byte0 - <NUM_LIT:1> ) { par3ArrayOfByte [ j1 ] = byte1 ; } else { par3ArrayOfByte [ j1 ] = byte2 ; } continue ; } if ( l > <NUM_LIT:0> ) { l -- ; par3ArrayOfByte [ j1 ] = byte2 ; } } } } } public Chunk loadChunk ( int par1 , int par2 ) { return provideChunk ( par1 , par2 ) ; } public Chunk provideChunk ( int par1 , int par2 ) { hellRNG . setSeed ( ( long ) par1 * <NUM_LIT> + ( long ) par2 * <NUM_LIT> ) ; byte abyte0 [ ] = new byte [ <NUM_LIT> ] ; generateNetherTerrain ( par1 , par2 , abyte0 ) ; func_4061_b ( par1 , par2 , abyte0 ) ; netherCaveGenerator . generate ( this , worldObj , par1 , par2 , abyte0 ) ; genNetherBridge . generate ( this , worldObj , par1 , par2 , abyte0 ) ; Chunk chunk = new Chunk ( worldObj , abyte0 , par1 , par2 ) ; BiomeGenBase abiomegenbase [ ] = worldObj . getWorldChunkManager ( ) . loadBlockGeneratorData ( null , par1 * <NUM_LIT:16> , par2 * <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:16> ) ; byte abyte1 [ ] = chunk . getBiomeArray ( ) ; for ( int i = <NUM_LIT:0> ; i < abyte1 . length ; i ++ ) { abyte1 [ i ] = ( byte ) abiomegenbase [ i ] . biomeID ; } chunk . resetRelightChecks ( ) ; return chunk ; } private double [ ] func_4060_a ( double par1ArrayOfDouble [ ] , int par2 , int par3 , int par4 , int par5 , int par6 , int par7 ) { if ( par1ArrayOfDouble == null ) { par1ArrayOfDouble = new double [ par5 * par6 * par7 ] ; } double d = <NUM_LIT> ; double d1 = <NUM_LIT> ; noiseData4 = netherNoiseGen6 . generateNoiseOctaves ( noiseData4 , par2 , par3 , par4 , par5 , <NUM_LIT:1> , par7 , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; noiseData5 = netherNoiseGen7 . generateNoiseOctaves ( noiseData5 , par2 , par3 , par4 , par5 , <NUM_LIT:1> , par7 , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; noiseData1 = netherNoiseGen3 . generateNoiseOctaves ( noiseData1 , par2 , par3 , par4 , par5 , par6 , par7 , d / <NUM_LIT> , d1 / <NUM_LIT> , d / <NUM_LIT> ) ; noiseData2 = netherNoiseGen1 . generateNoiseOctaves ( noiseData2 , par2 , par3 , par4 , par5 , par6 , par7 , d , d1 , d ) ; noiseData3 = netherNoiseGen2 . generateNoiseOctaves ( noiseData3 , par2 , par3 , par4 , par5 , par6 , par7 , d , d1 , d ) ; int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; double ad [ ] = new double [ par6 ] ; for ( int k = <NUM_LIT:0> ; k < par6 ; k ++ ) { ad [ k ] = Math . cos ( ( ( double ) k * Math . PI * <NUM_LIT> ) / ( double ) par6 ) * <NUM_LIT> ; double d2 = k ; if ( k > par6 / <NUM_LIT:2> ) { d2 = par6 - <NUM_LIT:1> - k ; } if ( d2 < <NUM_LIT> ) { d2 = <NUM_LIT> - d2 ; ad [ k ] -= d2 * d2 * d2 * <NUM_LIT> ; } } for ( int l = <NUM_LIT:0> ; l < par5 ; l ++ ) { for ( int i1 = <NUM_LIT:0> ; i1 < par7 ; i1 ++ ) { double d3 = ( noiseData4 [ j ] + <NUM_LIT> ) / <NUM_LIT> ; if ( d3 > <NUM_LIT> ) { d3 = <NUM_LIT> ; } double d4 = <NUM_LIT> ; double d5 = noiseData5 [ j ] / <NUM_LIT> ; if ( d5 < <NUM_LIT> ) { d5 = - d5 ; } d5 = d5 * <NUM_LIT> - <NUM_LIT> ; if ( d5 < <NUM_LIT> ) { d5 /= <NUM_LIT> ; if ( d5 < - <NUM_LIT> ) { d5 = - <NUM_LIT> ; } d5 /= <NUM_LIT> ; d5 /= <NUM_LIT> ; d3 = <NUM_LIT> ; } else { if ( d5 > <NUM_LIT> ) { d5 = <NUM_LIT> ; } d5 /= <NUM_LIT> ; } d3 += <NUM_LIT> ; d5 = ( d5 * ( double ) par6 ) / <NUM_LIT> ; j ++ ; for ( int j1 = <NUM_LIT:0> ; j1 < par6 ; j1 ++ ) { double d6 = <NUM_LIT> ; double d7 = ad [ j1 ] ; double d8 = noiseData2 [ i ] / <NUM_LIT> ; double d9 = noiseData3 [ i ] / <NUM_LIT> ; double d10 = ( noiseData1 [ i ] / <NUM_LIT> + <NUM_LIT> ) / <NUM_LIT> ; if ( d10 < <NUM_LIT> ) { d6 = d8 ; } else if ( d10 > <NUM_LIT> ) { d6 = d9 ; } else { d6 = d8 + ( d9 - d8 ) * d10 ; } d6 -= d7 ; if ( j1 > par6 - <NUM_LIT:4> ) { double d11 = ( float ) ( j1 - ( par6 - <NUM_LIT:4> ) ) / <NUM_LIT> ; d6 = d6 * ( <NUM_LIT> - d11 ) + - <NUM_LIT> * d11 ; } if ( ( double ) j1 < d4 ) { double d12 = ( d4 - ( double ) j1 ) / <NUM_LIT> ; if ( d12 < <NUM_LIT> ) { d12 = <NUM_LIT> ; } if ( d12 > <NUM_LIT> ) { d12 = <NUM_LIT> ; } d6 = d6 * ( <NUM_LIT> - d12 ) + - <NUM_LIT> * d12 ; } par1ArrayOfDouble [ i ] = d6 ; i ++ ; } } } return par1ArrayOfDouble ; } public boolean chunkExists ( int par1 , int par2 ) { return true ; } public void populate ( IChunkProvider par1IChunkProvider , int par2 , int par3 ) { BlockSand . fallInstantly = true ; int i = par2 * <NUM_LIT:16> ; int j = par3 * <NUM_LIT:16> ; genNetherBridge . generateStructuresInChunk ( worldObj , hellRNG , par2 , par3 ) ; for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:8> ; k ++ ) { int i1 = i + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int k2 = hellRNG . nextInt ( <NUM_LIT> ) + <NUM_LIT:4> ; int i4 = j + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; ( new WorldGenHellLava ( Block . lavaMoving . blockID ) ) . generate ( worldObj , hellRNG , i1 , k2 , i4 ) ; } int l = hellRNG . nextInt ( hellRNG . nextInt ( <NUM_LIT:10> ) + <NUM_LIT:1> ) + <NUM_LIT:1> ; for ( int j1 = <NUM_LIT:0> ; j1 < l ; j1 ++ ) { int l2 = i + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int j4 = hellRNG . nextInt ( <NUM_LIT> ) + <NUM_LIT:4> ; int k5 = j + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; ( new WorldGenFire ( ) ) . generate ( worldObj , hellRNG , l2 , j4 , k5 ) ; } l = hellRNG . nextInt ( hellRNG . nextInt ( <NUM_LIT:10> ) + <NUM_LIT:1> ) ; for ( int k1 = <NUM_LIT:0> ; k1 < l ; k1 ++ ) { int i3 = i + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int k4 = hellRNG . nextInt ( <NUM_LIT> ) + <NUM_LIT:4> ; int l5 = j + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; ( new WorldGenGlowStone1 ( ) ) . generate ( worldObj , hellRNG , i3 , k4 , l5 ) ; } for ( int l1 = <NUM_LIT:0> ; l1 < <NUM_LIT:10> ; l1 ++ ) { int j3 = i + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int l4 = hellRNG . nextInt ( <NUM_LIT> ) ; int i6 = j + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; ( new WorldGenGlowStone2 ( ) ) . generate ( worldObj , hellRNG , j3 , l4 , i6 ) ; } if ( hellRNG . nextInt ( <NUM_LIT:1> ) == <NUM_LIT:0> ) { int i2 = i + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int k3 = hellRNG . nextInt ( <NUM_LIT> ) ; int i5 = j + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; ( new WorldGenFlowers ( Block . mushroomBrown . blockID ) ) . generate ( worldObj , hellRNG , i2 , k3 , i5 ) ; } if ( hellRNG . nextInt ( <NUM_LIT:1> ) == <NUM_LIT:0> ) { int j2 = i + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int l3 = hellRNG . nextInt ( <NUM_LIT> ) ; int j5 = j + hellRNG . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; ( new WorldGenFlowers ( Block . mushroomRed . blockID ) ) . generate ( worldObj , hellRNG , j2 , l3 , j5 ) ; } BlockSand . fallInstantly = false ; } public boolean saveChunks ( boolean par1 , IProgressUpdate par2IProgressUpdate ) { return true ; } public boolean unload100OldestChunks ( ) { return false ; } public boolean canSave ( ) { return true ; } public List getPossibleCreatures ( EnumCreatureType par1EnumCreatureType , int par2 , int par3 , int par4 ) { if ( par1EnumCreatureType == EnumCreatureType . monster && genNetherBridge . func_40204_a ( par2 , par3 , par4 ) ) { return genNetherBridge . getSpawnList ( ) ; } BiomeGenBase biomegenbase = worldObj . getBiomeGenForCoords ( par2 , par4 ) ; if ( biomegenbase == null ) { return null ; } else { return biomegenbase . getSpawnableList ( par1EnumCreatureType ) ; } } public ChunkPosition findClosestStructure ( World par1World , String par2Str , int par3 , int i , int j ) { return null ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet26EntityExpOrb extends Packet { public int entityId ; public int posX ; public int posY ; public int posZ ; public int xpValue ; public Packet26EntityExpOrb ( ) { } public Packet26EntityExpOrb ( EntityXPOrb par1EntityXPOrb ) { entityId = par1EntityXPOrb . entityId ; posX = MathHelper . floor_double ( par1EntityXPOrb . posX * <NUM_LIT> ) ; posY = MathHelper . floor_double ( par1EntityXPOrb . posY * <NUM_LIT> ) ; posZ = MathHelper . floor_double ( par1EntityXPOrb . posZ * <NUM_LIT> ) ; xpValue = par1EntityXPOrb . getXpValue ( ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityId = par1DataInputStream . readInt ( ) ; posX = par1DataInputStream . readInt ( ) ; posY = par1DataInputStream . readInt ( ) ; posZ = par1DataInputStream . readInt ( ) ; xpValue = par1DataInputStream . readShort ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityId ) ; par1DataOutputStream . writeInt ( posX ) ; par1DataOutputStream . writeInt ( posY ) ; par1DataOutputStream . writeInt ( posZ ) ; par1DataOutputStream . writeShort ( xpValue ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleEntityExpOrb ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenReed extends WorldGenerator { public WorldGenReed ( ) { } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:20> ; i ++ ) { int j = ( par3 + par2Random . nextInt ( <NUM_LIT:4> ) ) - par2Random . nextInt ( <NUM_LIT:4> ) ; int k = par4 ; int l = ( par5 + par2Random . nextInt ( <NUM_LIT:4> ) ) - par2Random . nextInt ( <NUM_LIT:4> ) ; if ( ! par1World . isAirBlock ( j , k , l ) || par1World . getBlockMaterial ( j - <NUM_LIT:1> , k - <NUM_LIT:1> , l ) != Material . water && par1World . getBlockMaterial ( j + <NUM_LIT:1> , k - <NUM_LIT:1> , l ) != Material . water && par1World . getBlockMaterial ( j , k - <NUM_LIT:1> , l - <NUM_LIT:1> ) != Material . water && par1World . getBlockMaterial ( j , k - <NUM_LIT:1> , l + <NUM_LIT:1> ) != Material . water ) { continue ; } int i1 = <NUM_LIT:2> + par2Random . nextInt ( par2Random . nextInt ( <NUM_LIT:3> ) + <NUM_LIT:1> ) ; for ( int j1 = <NUM_LIT:0> ; j1 < i1 ; j1 ++ ) { if ( Block . reed . canBlockStay ( par1World , j , k + j1 , l ) ) { par1World . setBlock ( j , k + j1 , l , Block . reed . blockID ) ; } } } return true ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet34EntityTeleport extends Packet { public int entityId ; public int xPosition ; public int yPosition ; public int zPosition ; public byte yaw ; public byte pitch ; public Packet34EntityTeleport ( ) { } public Packet34EntityTeleport ( Entity par1Entity ) { entityId = par1Entity . entityId ; xPosition = MathHelper . floor_double ( par1Entity . posX * <NUM_LIT> ) ; yPosition = MathHelper . floor_double ( par1Entity . posY * <NUM_LIT> ) ; zPosition = MathHelper . floor_double ( par1Entity . posZ * <NUM_LIT> ) ; yaw = ( byte ) ( int ) ( ( par1Entity . rotationYaw * <NUM_LIT> ) / <NUM_LIT> ) ; pitch = ( byte ) ( int ) ( ( par1Entity . rotationPitch * <NUM_LIT> ) / <NUM_LIT> ) ; } public Packet34EntityTeleport ( int par1 , int par2 , int par3 , int par4 , byte par5 , byte par6 ) { entityId = par1 ; xPosition = par2 ; yPosition = par3 ; zPosition = par4 ; yaw = par5 ; pitch = par6 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { entityId = par1DataInputStream . readInt ( ) ; xPosition = par1DataInputStream . readInt ( ) ; yPosition = par1DataInputStream . readInt ( ) ; zPosition = par1DataInputStream . readInt ( ) ; yaw = ( byte ) par1DataInputStream . read ( ) ; pitch = ( byte ) par1DataInputStream . read ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( entityId ) ; par1DataOutputStream . writeInt ( xPosition ) ; par1DataOutputStream . writeInt ( yPosition ) ; par1DataOutputStream . writeInt ( zPosition ) ; par1DataOutputStream . write ( yaw ) ; par1DataOutputStream . write ( pitch ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleEntityTeleport ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class NBTTagShort extends NBTBase { public short data ; public NBTTagShort ( String par1Str ) { super ( par1Str ) ; } public NBTTagShort ( String par1Str , short par2 ) { super ( par1Str ) ; data = par2 ; } void write ( DataOutput par1DataOutput ) throws IOException { par1DataOutput . writeShort ( data ) ; } void load ( DataInput par1DataInput ) throws IOException { data = par1DataInput . readShort ( ) ; } public byte getId ( ) { return <NUM_LIT:2> ; } public String toString ( ) { return ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( data ) . toString ( ) ; } public NBTBase copy ( ) { return new NBTTagShort ( getName ( ) , data ) ; } public boolean equals ( Object par1Obj ) { if ( super . equals ( par1Obj ) ) { NBTTagShort nbttagshort = ( NBTTagShort ) par1Obj ; return data == nbttagshort . data ; } else { return false ; } } public int hashCode ( ) { return super . hashCode ( ) ^ data ; } } </s>
|
<s> package net . minecraft . src ; import java . awt . event . ActionEvent ; import java . awt . event . ActionListener ; class GuiStatsListener implements ActionListener { final GuiStatsComponent statsComponent ; GuiStatsListener ( GuiStatsComponent par1GuiStatsComponent ) { statsComponent = par1GuiStatsComponent ; } public void actionPerformed ( ActionEvent par1ActionEvent ) { GuiStatsComponent . update ( statsComponent ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class ThreadedFileIOBase implements Runnable { public static final ThreadedFileIOBase threadedIOInstance = new ThreadedFileIOBase ( ) ; private List threadedIOQueue ; private volatile long writeQueuedCounter ; private volatile long savedIOCounter ; private volatile boolean isThreadWaiting ; private ThreadedFileIOBase ( ) { threadedIOQueue = Collections . synchronizedList ( new ArrayList ( ) ) ; writeQueuedCounter = <NUM_LIT> ; savedIOCounter = <NUM_LIT> ; isThreadWaiting = false ; Thread thread = new Thread ( this , "<STR_LIT>" ) ; thread . setPriority ( <NUM_LIT:1> ) ; thread . start ( ) ; } public void run ( ) { do { processQueue ( ) ; } while ( true ) ; } private void processQueue ( ) { for ( int i = <NUM_LIT:0> ; i < threadedIOQueue . size ( ) ; i ++ ) { IThreadedFileIO ithreadedfileio = ( IThreadedFileIO ) threadedIOQueue . get ( i ) ; boolean flag = ithreadedfileio . writeNextIO ( ) ; if ( ! flag ) { threadedIOQueue . remove ( i -- ) ; savedIOCounter ++ ; } try { if ( ! isThreadWaiting ) { Thread . sleep ( <NUM_LIT> ) ; } else { Thread . sleep ( <NUM_LIT> ) ; } } catch ( InterruptedException interruptedexception1 ) { interruptedexception1 . printStackTrace ( ) ; } } if ( threadedIOQueue . isEmpty ( ) ) { try { Thread . sleep ( <NUM_LIT> ) ; } catch ( InterruptedException interruptedexception ) { interruptedexception . printStackTrace ( ) ; } } } public void queueIO ( IThreadedFileIO par1IThreadedFileIO ) { if ( threadedIOQueue . contains ( par1IThreadedFileIO ) ) { return ; } else { writeQueuedCounter ++ ; threadedIOQueue . add ( par1IThreadedFileIO ) ; return ; } } public void waitForFinish ( ) throws InterruptedException { isThreadWaiting = true ; while ( writeQueuedCounter != savedIOCounter ) { Thread . sleep ( <NUM_LIT> ) ; } isThreadWaiting = false ; } } </s>
|
<s> package net . minecraft . src ; public class BlockCloth extends Block { public BlockCloth ( ) { super ( <NUM_LIT> , <NUM_LIT> , Material . cloth ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par2 == <NUM_LIT:0> ) { return blockIndexInTexture ; } else { par2 = ~ ( par2 & <NUM_LIT> ) ; return <NUM_LIT> + ( ( par2 & <NUM_LIT:8> ) > > <NUM_LIT:3> ) + ( par2 & <NUM_LIT:7> ) * <NUM_LIT:16> ; } } protected int damageDropped ( int par1 ) { return par1 ; } public static int getBlockFromDye ( int par0 ) { return ~ par0 & <NUM_LIT> ; } public static int getDyeFromBlock ( int par0 ) { return ~ par0 & <NUM_LIT> ; } } </s>
|
<s> package net . minecraft . src ; public class ItemSoup extends ItemFood { public ItemSoup ( int par1 , int par2 ) { super ( par1 , par2 , false ) ; setMaxStackSize ( <NUM_LIT:1> ) ; } public ItemStack onFoodEaten ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { super . onFoodEaten ( par1ItemStack , par2World , par3EntityPlayer ) ; return new ItemStack ( Item . bowlEmpty ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . ArrayList ; import java . util . Random ; public class BlockStep extends Block { public static final String blockStepTypes [ ] = { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" } ; private boolean blockType ; public BlockStep ( int par1 , boolean par2 ) { super ( par1 , <NUM_LIT:6> , Material . rock ) ; blockType = par2 ; if ( ! par2 ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } else { opaqueCubeLookup [ par1 ] = true ; } setLightOpacity ( <NUM_LIT:255> ) ; } public void setBlockBoundsBasedOnState ( IBlockAccess par1IBlockAccess , int par2 , int par3 , int par4 ) { if ( blockType ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } else { boolean flag = ( par1IBlockAccess . getBlockMetadata ( par2 , par3 , par4 ) & <NUM_LIT:8> ) != <NUM_LIT:0> ; if ( flag ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } else { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } } } public void setBlockBoundsForItemRender ( ) { if ( blockType ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } else { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } } public void getCollidingBoundingBoxes ( World par1World , int par2 , int par3 , int par4 , AxisAlignedBB par5AxisAlignedBB , ArrayList par6ArrayList ) { setBlockBoundsBasedOnState ( par1World , par2 , par3 , par4 ) ; super . getCollidingBoundingBoxes ( par1World , par2 , par3 , par4 , par5AxisAlignedBB , par6ArrayList ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { int i = par2 & <NUM_LIT:7> ; if ( i == <NUM_LIT:0> ) { return par1 > <NUM_LIT:1> ? <NUM_LIT:5> : <NUM_LIT:6> ; } if ( i == <NUM_LIT:1> ) { if ( par1 == <NUM_LIT:0> ) { return <NUM_LIT> ; } return par1 != <NUM_LIT:1> ? <NUM_LIT> : <NUM_LIT> ; } if ( i == <NUM_LIT:2> ) { return <NUM_LIT:4> ; } if ( i == <NUM_LIT:3> ) { return <NUM_LIT:16> ; } if ( i == <NUM_LIT:4> ) { return Block . brick . blockIndexInTexture ; } if ( i == <NUM_LIT:5> ) { return Block . stoneBrick . blockIndexInTexture ; } else { return <NUM_LIT:6> ; } } public int getBlockTextureFromSide ( int par1 ) { return getBlockTextureFromSideAndMetadata ( par1 , <NUM_LIT:0> ) ; } public boolean isOpaqueCube ( ) { return blockType ; } public void onBlockPlaced ( World par1World , int par2 , int par3 , int par4 , int par5 ) { if ( par5 == <NUM_LIT:0> && ! blockType ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) & <NUM_LIT:7> ; par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i | <NUM_LIT:8> ) ; } } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Block . stairSingle . blockID ; } public int quantityDropped ( Random par1Random ) { return ! blockType ? <NUM_LIT:1> : <NUM_LIT:2> ; } protected int damageDropped ( int par1 ) { return par1 & <NUM_LIT:7> ; } public boolean renderAsNormalBlock ( ) { return blockType ; } protected ItemStack createStackedBlock ( int par1 ) { return new ItemStack ( Block . stairSingle . blockID , <NUM_LIT:1> , par1 & <NUM_LIT:7> ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ChunkProviderGenerate implements IChunkProvider { private Random rand ; private NoiseGeneratorOctaves noiseGen1 ; private NoiseGeneratorOctaves noiseGen2 ; private NoiseGeneratorOctaves noiseGen3 ; private NoiseGeneratorOctaves noiseGen4 ; public NoiseGeneratorOctaves noiseGen5 ; public NoiseGeneratorOctaves noiseGen6 ; public NoiseGeneratorOctaves mobSpawnerNoise ; private World worldObj ; private final boolean mapFeaturesEnabled ; private double noiseArray [ ] ; private double stoneNoise [ ] ; private MapGenBase caveGenerator ; private MapGenStronghold strongholdGenerator ; private MapGenVillage villageGenerator ; private MapGenMineshaft mineshaftGenerator ; private MapGenBase ravineGenerator ; private BiomeGenBase biomesForGeneration [ ] ; double noise3 [ ] ; double noise1 [ ] ; double noise2 [ ] ; double noise5 [ ] ; double noise6 [ ] ; float field_35561_l [ ] ; int field_707_i [ ] [ ] ; public ChunkProviderGenerate ( World par1World , long par2 , boolean par4 ) { stoneNoise = new double [ <NUM_LIT> ] ; caveGenerator = new MapGenCaves ( ) ; strongholdGenerator = new MapGenStronghold ( ) ; villageGenerator = new MapGenVillage ( <NUM_LIT:0> ) ; mineshaftGenerator = new MapGenMineshaft ( ) ; ravineGenerator = new MapGenRavine ( ) ; field_707_i = new int [ <NUM_LIT:32> ] [ <NUM_LIT:32> ] ; worldObj = par1World ; mapFeaturesEnabled = par4 ; rand = new Random ( par2 ) ; noiseGen1 = new NoiseGeneratorOctaves ( rand , <NUM_LIT:16> ) ; noiseGen2 = new NoiseGeneratorOctaves ( rand , <NUM_LIT:16> ) ; noiseGen3 = new NoiseGeneratorOctaves ( rand , <NUM_LIT:8> ) ; noiseGen4 = new NoiseGeneratorOctaves ( rand , <NUM_LIT:4> ) ; noiseGen5 = new NoiseGeneratorOctaves ( rand , <NUM_LIT:10> ) ; noiseGen6 = new NoiseGeneratorOctaves ( rand , <NUM_LIT:16> ) ; mobSpawnerNoise = new NoiseGeneratorOctaves ( rand , <NUM_LIT:8> ) ; } public void generateTerrain ( int par1 , int par2 , byte par3ArrayOfByte [ ] ) { byte byte0 = <NUM_LIT:4> ; byte byte1 = <NUM_LIT:16> ; byte byte2 = <NUM_LIT> ; int i = byte0 + <NUM_LIT:1> ; byte byte3 = <NUM_LIT> ; int j = byte0 + <NUM_LIT:1> ; biomesForGeneration = worldObj . getWorldChunkManager ( ) . getBiomesForGeneration ( biomesForGeneration , par1 * <NUM_LIT:4> - <NUM_LIT:2> , par2 * <NUM_LIT:4> - <NUM_LIT:2> , i + <NUM_LIT:5> , j + <NUM_LIT:5> ) ; noiseArray = initializeNoiseField ( noiseArray , par1 * byte0 , <NUM_LIT:0> , par2 * byte0 , i , byte3 , j ) ; for ( int k = <NUM_LIT:0> ; k < byte0 ; k ++ ) { for ( int l = <NUM_LIT:0> ; l < byte0 ; l ++ ) { for ( int i1 = <NUM_LIT:0> ; i1 < byte1 ; i1 ++ ) { double d = <NUM_LIT> ; double d1 = noiseArray [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:0> ) ) * byte3 + ( i1 + <NUM_LIT:0> ) ] ; double d2 = noiseArray [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:1> ) ) * byte3 + ( i1 + <NUM_LIT:0> ) ] ; double d3 = noiseArray [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:0> ) ) * byte3 + ( i1 + <NUM_LIT:0> ) ] ; double d4 = noiseArray [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:1> ) ) * byte3 + ( i1 + <NUM_LIT:0> ) ] ; double d5 = ( noiseArray [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:0> ) ) * byte3 + ( i1 + <NUM_LIT:1> ) ] - d1 ) * d ; double d6 = ( noiseArray [ ( ( k + <NUM_LIT:0> ) * j + ( l + <NUM_LIT:1> ) ) * byte3 + ( i1 + <NUM_LIT:1> ) ] - d2 ) * d ; double d7 = ( noiseArray [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:0> ) ) * byte3 + ( i1 + <NUM_LIT:1> ) ] - d3 ) * d ; double d8 = ( noiseArray [ ( ( k + <NUM_LIT:1> ) * j + ( l + <NUM_LIT:1> ) ) * byte3 + ( i1 + <NUM_LIT:1> ) ] - d4 ) * d ; for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:8> ; j1 ++ ) { double d9 = <NUM_LIT> ; double d10 = d1 ; double d11 = d2 ; double d12 = ( d3 - d1 ) * d9 ; double d13 = ( d4 - d2 ) * d9 ; for ( int k1 = <NUM_LIT:0> ; k1 < <NUM_LIT:4> ; k1 ++ ) { int l1 = k1 + k * <NUM_LIT:4> << <NUM_LIT:11> | <NUM_LIT:0> + l * <NUM_LIT:4> << <NUM_LIT:7> | i1 * <NUM_LIT:8> + j1 ; char c = '<STR_LIT>' ; l1 -= c ; double d14 = <NUM_LIT> ; double d15 = d10 ; double d16 = ( d11 - d10 ) * d14 ; d15 -= d16 ; for ( int i2 = <NUM_LIT:0> ; i2 < <NUM_LIT:4> ; i2 ++ ) { if ( ( d15 += d16 ) > <NUM_LIT> ) { par3ArrayOfByte [ l1 += c ] = ( byte ) Block . stone . blockID ; continue ; } if ( i1 * <NUM_LIT:8> + j1 < byte2 ) { par3ArrayOfByte [ l1 += c ] = ( byte ) Block . waterStill . blockID ; } else { par3ArrayOfByte [ l1 += c ] = <NUM_LIT:0> ; } } d10 += d12 ; d11 += d13 ; } d1 += d5 ; d2 += d6 ; d3 += d7 ; d4 += d8 ; } } } } } public void replaceBlocksForBiome ( int par1 , int par2 , byte par3ArrayOfByte [ ] , BiomeGenBase par4ArrayOfBiomeGenBase [ ] ) { byte byte0 = <NUM_LIT> ; double d = <NUM_LIT> ; stoneNoise = noiseGen4 . generateNoiseOctaves ( stoneNoise , par1 * <NUM_LIT:16> , par2 * <NUM_LIT:16> , <NUM_LIT:0> , <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:1> , d * <NUM_LIT> , d * <NUM_LIT> , d * <NUM_LIT> ) ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT:16> ; i ++ ) { for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:16> ; j ++ ) { BiomeGenBase biomegenbase = par4ArrayOfBiomeGenBase [ j + i * <NUM_LIT:16> ] ; float f = biomegenbase . getFloatTemperature ( ) ; int k = ( int ) ( stoneNoise [ i + j * <NUM_LIT:16> ] / <NUM_LIT> + <NUM_LIT> + rand . nextDouble ( ) * <NUM_LIT> ) ; int l = - <NUM_LIT:1> ; byte byte1 = biomegenbase . topBlock ; byte byte2 = biomegenbase . fillerBlock ; for ( int i1 = <NUM_LIT> ; i1 >= <NUM_LIT:0> ; i1 -- ) { int j1 = ( j * <NUM_LIT:16> + i ) * <NUM_LIT> + i1 ; if ( i1 <= <NUM_LIT:0> + rand . nextInt ( <NUM_LIT:5> ) ) { par3ArrayOfByte [ j1 ] = ( byte ) Block . bedrock . blockID ; continue ; } byte byte3 = par3ArrayOfByte [ j1 ] ; if ( byte3 == <NUM_LIT:0> ) { l = - <NUM_LIT:1> ; continue ; } if ( byte3 != Block . stone . blockID ) { continue ; } if ( l == - <NUM_LIT:1> ) { if ( k <= <NUM_LIT:0> ) { byte1 = <NUM_LIT:0> ; byte2 = ( byte ) Block . stone . blockID ; } else if ( i1 >= byte0 - <NUM_LIT:4> && i1 <= byte0 + <NUM_LIT:1> ) { byte1 = biomegenbase . topBlock ; byte2 = biomegenbase . fillerBlock ; } if ( i1 < byte0 && byte1 == <NUM_LIT:0> ) { if ( f < <NUM_LIT> ) { byte1 = ( byte ) Block . ice . blockID ; } else { byte1 = ( byte ) Block . waterStill . blockID ; } } l = k ; if ( i1 >= byte0 - <NUM_LIT:1> ) { par3ArrayOfByte [ j1 ] = byte1 ; } else { par3ArrayOfByte [ j1 ] = byte2 ; } continue ; } if ( l <= <NUM_LIT:0> ) { continue ; } l -- ; par3ArrayOfByte [ j1 ] = byte2 ; if ( l == <NUM_LIT:0> && byte2 == Block . sand . blockID ) { l = rand . nextInt ( <NUM_LIT:4> ) ; byte2 = ( byte ) Block . sandStone . blockID ; } } } } } public Chunk loadChunk ( int par1 , int par2 ) { return provideChunk ( par1 , par2 ) ; } public Chunk provideChunk ( int par1 , int par2 ) { rand . setSeed ( ( long ) par1 * <NUM_LIT> + ( long ) par2 * <NUM_LIT> ) ; byte abyte0 [ ] = new byte [ <NUM_LIT> ] ; generateTerrain ( par1 , par2 , abyte0 ) ; biomesForGeneration = worldObj . getWorldChunkManager ( ) . loadBlockGeneratorData ( biomesForGeneration , par1 * <NUM_LIT:16> , par2 * <NUM_LIT:16> , <NUM_LIT:16> , <NUM_LIT:16> ) ; replaceBlocksForBiome ( par1 , par2 , abyte0 , biomesForGeneration ) ; caveGenerator . generate ( this , worldObj , par1 , par2 , abyte0 ) ; ravineGenerator . generate ( this , worldObj , par1 , par2 , abyte0 ) ; if ( mapFeaturesEnabled ) { mineshaftGenerator . generate ( this , worldObj , par1 , par2 , abyte0 ) ; villageGenerator . generate ( this , worldObj , par1 , par2 , abyte0 ) ; strongholdGenerator . generate ( this , worldObj , par1 , par2 , abyte0 ) ; } Chunk chunk = new Chunk ( worldObj , abyte0 , par1 , par2 ) ; byte abyte1 [ ] = chunk . getBiomeArray ( ) ; for ( int i = <NUM_LIT:0> ; i < abyte1 . length ; i ++ ) { abyte1 [ i ] = ( byte ) biomesForGeneration [ i ] . biomeID ; } chunk . generateSkylightMap ( ) ; return chunk ; } private double [ ] initializeNoiseField ( double par1ArrayOfDouble [ ] , int par2 , int par3 , int par4 , int par5 , int par6 , int par7 ) { if ( par1ArrayOfDouble == null ) { par1ArrayOfDouble = new double [ par5 * par6 * par7 ] ; } if ( field_35561_l == null ) { field_35561_l = new float [ <NUM_LIT> ] ; for ( int i = - <NUM_LIT:2> ; i <= <NUM_LIT:2> ; i ++ ) { for ( int j = - <NUM_LIT:2> ; j <= <NUM_LIT:2> ; j ++ ) { float f = <NUM_LIT> / MathHelper . sqrt_float ( ( float ) ( i * i + j * j ) + <NUM_LIT> ) ; field_35561_l [ i + <NUM_LIT:2> + ( j + <NUM_LIT:2> ) * <NUM_LIT:5> ] = f ; } } } double d = <NUM_LIT> ; double d1 = <NUM_LIT> ; noise5 = noiseGen5 . generateNoiseOctaves ( noise5 , par2 , par4 , par5 , par7 , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; noise6 = noiseGen6 . generateNoiseOctaves ( noise6 , par2 , par4 , par5 , par7 , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; noise3 = noiseGen3 . generateNoiseOctaves ( noise3 , par2 , par3 , par4 , par5 , par6 , par7 , d / <NUM_LIT> , d1 / <NUM_LIT> , d / <NUM_LIT> ) ; noise1 = noiseGen1 . generateNoiseOctaves ( noise1 , par2 , par3 , par4 , par5 , par6 , par7 , d , d1 , d ) ; noise2 = noiseGen2 . generateNoiseOctaves ( noise2 , par2 , par3 , par4 , par5 , par6 , par7 , d , d1 , d ) ; par2 = par4 = <NUM_LIT:0> ; int k = <NUM_LIT:0> ; int l = <NUM_LIT:0> ; for ( int i1 = <NUM_LIT:0> ; i1 < par5 ; i1 ++ ) { for ( int j1 = <NUM_LIT:0> ; j1 < par7 ; j1 ++ ) { float f1 = <NUM_LIT> ; float f2 = <NUM_LIT> ; float f3 = <NUM_LIT> ; byte byte0 = <NUM_LIT:2> ; BiomeGenBase biomegenbase = biomesForGeneration [ i1 + <NUM_LIT:2> + ( j1 + <NUM_LIT:2> ) * ( par5 + <NUM_LIT:5> ) ] ; for ( int k1 = - byte0 ; k1 <= byte0 ; k1 ++ ) { for ( int l1 = - byte0 ; l1 <= byte0 ; l1 ++ ) { BiomeGenBase biomegenbase1 = biomesForGeneration [ i1 + k1 + <NUM_LIT:2> + ( j1 + l1 + <NUM_LIT:2> ) * ( par5 + <NUM_LIT:5> ) ] ; float f4 = field_35561_l [ k1 + <NUM_LIT:2> + ( l1 + <NUM_LIT:2> ) * <NUM_LIT:5> ] / ( biomegenbase1 . minHeight + <NUM_LIT> ) ; if ( biomegenbase1 . minHeight > biomegenbase . minHeight ) { f4 /= <NUM_LIT> ; } f1 += biomegenbase1 . maxHeight * f4 ; f2 += biomegenbase1 . minHeight * f4 ; f3 += f4 ; } } f1 /= f3 ; f2 /= f3 ; f1 = f1 * <NUM_LIT> + <NUM_LIT> ; f2 = ( f2 * <NUM_LIT> - <NUM_LIT> ) / <NUM_LIT> ; double d2 = noise6 [ l ] / <NUM_LIT> ; if ( d2 < <NUM_LIT> ) { d2 = - d2 * <NUM_LIT> ; } d2 = d2 * <NUM_LIT> - <NUM_LIT> ; if ( d2 < <NUM_LIT> ) { d2 /= <NUM_LIT> ; if ( d2 < - <NUM_LIT> ) { d2 = - <NUM_LIT> ; } d2 /= <NUM_LIT> ; d2 /= <NUM_LIT> ; } else { if ( d2 > <NUM_LIT> ) { d2 = <NUM_LIT> ; } d2 /= <NUM_LIT> ; } l ++ ; for ( int i2 = <NUM_LIT:0> ; i2 < par6 ; i2 ++ ) { double d3 = f2 ; double d4 = f1 ; d3 += d2 * <NUM_LIT> ; d3 = ( d3 * ( double ) par6 ) / <NUM_LIT> ; double d5 = ( double ) par6 / <NUM_LIT> + d3 * <NUM_LIT> ; double d6 = <NUM_LIT> ; double d7 = ( ( ( double ) i2 - d5 ) * <NUM_LIT> * <NUM_LIT> ) / <NUM_LIT> / d4 ; if ( d7 < <NUM_LIT> ) { d7 *= <NUM_LIT> ; } double d8 = noise1 [ k ] / <NUM_LIT> ; double d9 = noise2 [ k ] / <NUM_LIT> ; double d10 = ( noise3 [ k ] / <NUM_LIT> + <NUM_LIT> ) / <NUM_LIT> ; if ( d10 < <NUM_LIT> ) { d6 = d8 ; } else if ( d10 > <NUM_LIT> ) { d6 = d9 ; } else { d6 = d8 + ( d9 - d8 ) * d10 ; } d6 -= d7 ; if ( i2 > par6 - <NUM_LIT:4> ) { double d11 = ( float ) ( i2 - ( par6 - <NUM_LIT:4> ) ) / <NUM_LIT> ; d6 = d6 * ( <NUM_LIT> - d11 ) + - <NUM_LIT> * d11 ; } par1ArrayOfDouble [ k ] = d6 ; k ++ ; } } } return par1ArrayOfDouble ; } public boolean chunkExists ( int par1 , int par2 ) { return true ; } public void populate ( IChunkProvider par1IChunkProvider , int par2 , int par3 ) { BlockSand . fallInstantly = true ; int i = par2 * <NUM_LIT:16> ; int j = par3 * <NUM_LIT:16> ; BiomeGenBase biomegenbase = worldObj . getBiomeGenForCoords ( i + <NUM_LIT:16> , j + <NUM_LIT:16> ) ; rand . setSeed ( worldObj . getSeed ( ) ) ; long l = ( rand . nextLong ( ) / <NUM_LIT> ) * <NUM_LIT> + <NUM_LIT:1L> ; long l1 = ( rand . nextLong ( ) / <NUM_LIT> ) * <NUM_LIT> + <NUM_LIT:1L> ; rand . setSeed ( ( long ) par2 * l + ( long ) par3 * l1 ^ worldObj . getSeed ( ) ) ; boolean flag = false ; if ( mapFeaturesEnabled ) { mineshaftGenerator . generateStructuresInChunk ( worldObj , rand , par2 , par3 ) ; flag = villageGenerator . generateStructuresInChunk ( worldObj , rand , par2 , par3 ) ; strongholdGenerator . generateStructuresInChunk ( worldObj , rand , par2 , par3 ) ; } if ( ! flag && rand . nextInt ( <NUM_LIT:4> ) == <NUM_LIT:0> ) { int k = i + rand . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int i2 = rand . nextInt ( <NUM_LIT> ) ; int i3 = j + rand . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; ( new WorldGenLakes ( Block . waterStill . blockID ) ) . generate ( worldObj , rand , k , i2 , i3 ) ; } if ( ! flag && rand . nextInt ( <NUM_LIT:8> ) == <NUM_LIT:0> ) { int i1 = i + rand . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int j2 = rand . nextInt ( rand . nextInt ( <NUM_LIT> ) + <NUM_LIT:8> ) ; int j3 = j + rand . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; if ( j2 < <NUM_LIT> || rand . nextInt ( <NUM_LIT:10> ) == <NUM_LIT:0> ) { ( new WorldGenLakes ( Block . lavaStill . blockID ) ) . generate ( worldObj , rand , i1 , j2 , j3 ) ; } } for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:8> ; j1 ++ ) { int k2 = i + rand . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; int k3 = rand . nextInt ( <NUM_LIT> ) ; int i4 = j + rand . nextInt ( <NUM_LIT:16> ) + <NUM_LIT:8> ; if ( ! ( new WorldGenDungeons ( ) ) . generate ( worldObj , rand , k2 , k3 , i4 ) ) ; } biomegenbase . decorate ( worldObj , rand , i , j ) ; SpawnerAnimals . performWorldGenSpawning ( worldObj , biomegenbase , i + <NUM_LIT:8> , j + <NUM_LIT:8> , <NUM_LIT:16> , <NUM_LIT:16> , rand ) ; i += <NUM_LIT:8> ; j += <NUM_LIT:8> ; for ( int k1 = <NUM_LIT:0> ; k1 < <NUM_LIT:16> ; k1 ++ ) { for ( int l2 = <NUM_LIT:0> ; l2 < <NUM_LIT:16> ; l2 ++ ) { int l3 = worldObj . getPrecipitationHeight ( i + k1 , j + l2 ) ; if ( worldObj . isBlockHydratedDirectly ( k1 + i , l3 - <NUM_LIT:1> , l2 + j ) ) { worldObj . setBlockWithNotify ( k1 + i , l3 - <NUM_LIT:1> , l2 + j , Block . ice . blockID ) ; } if ( worldObj . canSnowAt ( k1 + i , l3 , l2 + j ) ) { worldObj . setBlockWithNotify ( k1 + i , l3 , l2 + j , Block . snow . blockID ) ; } } } BlockSand . fallInstantly = false ; } public boolean saveChunks ( boolean par1 , IProgressUpdate par2IProgressUpdate ) { return true ; } public boolean unload100OldestChunks ( ) { return false ; } public boolean canSave ( ) { return true ; } public List getPossibleCreatures ( EnumCreatureType par1EnumCreatureType , int par2 , int par3 , int par4 ) { BiomeGenBase biomegenbase = worldObj . getBiomeGenForCoords ( par2 , par4 ) ; if ( biomegenbase == null ) { return null ; } else { return biomegenbase . getSpawnableList ( par1EnumCreatureType ) ; } } public ChunkPosition findClosestStructure ( World par1World , String par2Str , int par3 , int par4 , int par5 ) { if ( "<STR_LIT>" . equals ( par2Str ) && strongholdGenerator != null ) { return strongholdGenerator . getNearestInstance ( par1World , par3 , par4 , par5 ) ; } else { return null ; } } } </s>
|
<s> package net . minecraft . src ; public class EnchantmentOxygen extends Enchantment { public EnchantmentOxygen ( int par1 , int par2 ) { super ( par1 , par2 , EnumEnchantmentType . armor_head ) ; setName ( "<STR_LIT>" ) ; } public int getMinEnchantability ( int par1 ) { return <NUM_LIT:10> * par1 ; } public int getMaxEnchantability ( int par1 ) { return getMinEnchantability ( par1 ) + <NUM_LIT:30> ; } public int getMaxLevel ( ) { return <NUM_LIT:3> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . ArrayList ; import java . util . Random ; public class BlockEndPortalFrame extends Block { public BlockEndPortalFrame ( int par1 ) { super ( par1 , <NUM_LIT> , Material . glass ) ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par1 == <NUM_LIT:1> ) { return blockIndexInTexture - <NUM_LIT:1> ; } if ( par1 == <NUM_LIT:0> ) { return blockIndexInTexture + <NUM_LIT:16> ; } else { return blockIndexInTexture ; } } public boolean isOpaqueCube ( ) { return false ; } public int getRenderType ( ) { return <NUM_LIT> ; } public void setBlockBoundsForItemRender ( ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; } public void getCollidingBoundingBoxes ( World par1World , int par2 , int par3 , int par4 , AxisAlignedBB par5AxisAlignedBB , ArrayList par6ArrayList ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; super . getCollidingBoundingBoxes ( par1World , par2 , par3 , par4 , par5AxisAlignedBB , par6ArrayList ) ; int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; if ( isEnderEyeInserted ( i ) ) { setBlockBounds ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; super . getCollidingBoundingBoxes ( par1World , par2 , par3 , par4 , par5AxisAlignedBB , par6ArrayList ) ; } setBlockBoundsForItemRender ( ) ; } public static boolean isEnderEyeInserted ( int par0 ) { return ( par0 & <NUM_LIT:4> ) != <NUM_LIT:0> ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return <NUM_LIT:0> ; } public void onBlockPlacedBy ( World par1World , int par2 , int par3 , int par4 , EntityLiving par5EntityLiving ) { int i = ( ( MathHelper . floor_double ( ( double ) ( ( par5EntityLiving . rotationYaw * <NUM_LIT> ) / <NUM_LIT> ) + <NUM_LIT> ) & <NUM_LIT:3> ) + <NUM_LIT:2> ) % <NUM_LIT:4> ; par1World . setBlockMetadataWithNotify ( par2 , par3 , par4 , i ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . HashMap ; import java . util . Map ; public class TileEntity { private static Map nameToClassMap = new HashMap ( ) ; private static Map classToNameMap = new HashMap ( ) ; public World worldObj ; public int xCoord ; public int yCoord ; public int zCoord ; protected boolean tileEntityInvalid ; public int blockMetadata ; public Block blockType ; public TileEntity ( ) { blockMetadata = - <NUM_LIT:1> ; } private static void addMapping ( Class par0Class , String par1Str ) { if ( classToNameMap . containsKey ( par1Str ) ) { throw new IllegalArgumentException ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1Str ) . toString ( ) ) ; } else { nameToClassMap . put ( par1Str , par0Class ) ; classToNameMap . put ( par0Class , par1Str ) ; return ; } } public void readFromNBT ( NBTTagCompound par1NBTTagCompound ) { xCoord = par1NBTTagCompound . getInteger ( "<STR_LIT:x>" ) ; yCoord = par1NBTTagCompound . getInteger ( "<STR_LIT:y>" ) ; zCoord = par1NBTTagCompound . getInteger ( "<STR_LIT>" ) ; } public void writeToNBT ( NBTTagCompound par1NBTTagCompound ) { String s = ( String ) classToNameMap . get ( getClass ( ) ) ; if ( s == null ) { throw new RuntimeException ( ( new StringBuilder ( ) ) . append ( getClass ( ) ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } else { par1NBTTagCompound . setString ( "<STR_LIT:id>" , s ) ; par1NBTTagCompound . setInteger ( "<STR_LIT:x>" , xCoord ) ; par1NBTTagCompound . setInteger ( "<STR_LIT:y>" , yCoord ) ; par1NBTTagCompound . setInteger ( "<STR_LIT>" , zCoord ) ; return ; } } public void updateEntity ( ) { } public static TileEntity createAndLoadEntity ( NBTTagCompound par0NBTTagCompound ) { TileEntity tileentity = null ; try { Class class1 = ( Class ) nameToClassMap . get ( par0NBTTagCompound . getString ( "<STR_LIT:id>" ) ) ; if ( class1 != null ) { tileentity = ( TileEntity ) class1 . newInstance ( ) ; } } catch ( Exception exception ) { exception . printStackTrace ( ) ; } if ( tileentity != null ) { tileentity . readFromNBT ( par0NBTTagCompound ) ; } else { System . out . println ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par0NBTTagCompound . getString ( "<STR_LIT:id>" ) ) . toString ( ) ) ; } return tileentity ; } public int getBlockMetadata ( ) { if ( blockMetadata == - <NUM_LIT:1> ) { blockMetadata = worldObj . getBlockMetadata ( xCoord , yCoord , zCoord ) ; } return blockMetadata ; } public void onInventoryChanged ( ) { if ( worldObj != null ) { blockMetadata = worldObj . getBlockMetadata ( xCoord , yCoord , zCoord ) ; worldObj . updateTileEntityChunkAndDoNothing ( xCoord , yCoord , zCoord , this ) ; } } public Packet getDescriptionPacket ( ) { return null ; } public boolean isInvalid ( ) { return tileEntityInvalid ; } public void invalidate ( ) { tileEntityInvalid = true ; } public void validate ( ) { tileEntityInvalid = false ; } public void onTileEntityPowered ( int i , int j ) { } public void updateContainingBlockInfo ( ) { blockType = null ; blockMetadata = - <NUM_LIT:1> ; } static { addMapping ( net . minecraft . src . TileEntityFurnace . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityChest . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityRecordPlayer . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityDispenser . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntitySign . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityMobSpawner . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityNote . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityPiston . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityBrewingStand . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityEnchantmentTable . class , "<STR_LIT>" ) ; addMapping ( net . minecraft . src . TileEntityEndPortal . class , "<STR_LIT>" ) ; } } </s>
|
<s> package net . minecraft . src ; public enum EnumAction { none , eat , drink , block , bow ; } </s>
|
<s> package net . minecraft . src ; public class ItemLeaves extends ItemBlock { public ItemLeaves ( int par1 ) { super ( par1 ) ; setMaxDamage ( <NUM_LIT:0> ) ; setHasSubtypes ( true ) ; } public int getMetadata ( int par1 ) { return par1 | <NUM_LIT:4> ; } } </s>
|
<s> package net . minecraft . src ; public class ItemBed extends Item { public ItemBed ( int par1 ) { super ( par1 ) ; } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int par4 , int par5 , int par6 , int par7 ) { if ( par7 != <NUM_LIT:1> ) { return false ; } par5 ++ ; BlockBed blockbed = ( BlockBed ) Block . bed ; int i = MathHelper . floor_double ( ( double ) ( ( par2EntityPlayer . rotationYaw * <NUM_LIT> ) / <NUM_LIT> ) + <NUM_LIT> ) & <NUM_LIT:3> ; byte byte0 = <NUM_LIT:0> ; byte byte1 = <NUM_LIT:0> ; if ( i == <NUM_LIT:0> ) { byte1 = <NUM_LIT:1> ; } if ( i == <NUM_LIT:1> ) { byte0 = - <NUM_LIT:1> ; } if ( i == <NUM_LIT:2> ) { byte1 = - <NUM_LIT:1> ; } if ( i == <NUM_LIT:3> ) { byte0 = <NUM_LIT:1> ; } if ( ! par2EntityPlayer . canPlayerEdit ( par4 , par5 , par6 ) || ! par2EntityPlayer . canPlayerEdit ( par4 + byte0 , par5 , par6 + byte1 ) ) { return false ; } if ( par3World . isAirBlock ( par4 , par5 , par6 ) && par3World . isAirBlock ( par4 + byte0 , par5 , par6 + byte1 ) && par3World . isBlockNormalCube ( par4 , par5 - <NUM_LIT:1> , par6 ) && par3World . isBlockNormalCube ( par4 + byte0 , par5 - <NUM_LIT:1> , par6 + byte1 ) ) { par3World . setBlockAndMetadataWithNotify ( par4 , par5 , par6 , blockbed . blockID , i ) ; if ( par3World . getBlockId ( par4 , par5 , par6 ) == blockbed . blockID ) { par3World . setBlockAndMetadataWithNotify ( par4 + byte0 , par5 , par6 + byte1 , blockbed . blockID , i + <NUM_LIT:8> ) ; } par1ItemStack . stackSize -- ; return true ; } else { return false ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntitySilverfish extends EntityMob { private int allySummonCooldown ; public EntitySilverfish ( World par1World ) { super ( par1World ) ; texture = "<STR_LIT>" ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; moveSpeed = <NUM_LIT> ; attackStrength = <NUM_LIT:1> ; } public int getMaxHealth ( ) { return <NUM_LIT:8> ; } protected boolean canTriggerWalking ( ) { return false ; } protected Entity findPlayerToAttack ( ) { double d = <NUM_LIT> ; return worldObj . getClosestVulnerablePlayerToEntity ( this , d ) ; } protected String getLivingSound ( ) { return "<STR_LIT>" ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } public boolean attackEntityFrom ( DamageSource par1DamageSource , int par2 ) { if ( allySummonCooldown <= <NUM_LIT:0> && ( par1DamageSource instanceof EntityDamageSource ) ) { allySummonCooldown = <NUM_LIT:20> ; } return super . attackEntityFrom ( par1DamageSource , par2 ) ; } protected void attackEntity ( Entity par1Entity , float par2 ) { if ( attackTime <= <NUM_LIT:0> && par2 < <NUM_LIT> && par1Entity . boundingBox . maxY > boundingBox . minY && par1Entity . boundingBox . minY < boundingBox . maxY ) { attackTime = <NUM_LIT:20> ; par1Entity . attackEntityFrom ( DamageSource . causeMobDamage ( this ) , attackStrength ) ; } } protected void playStepSound ( int par1 , int par2 , int par3 , int par4 ) { worldObj . playSoundAtEntity ( this , "<STR_LIT>" , <NUM_LIT> , <NUM_LIT> ) ; } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; } protected int getDropItemId ( ) { return <NUM_LIT:0> ; } public void onUpdate ( ) { renderYawOffset = rotationYaw ; super . onUpdate ( ) ; } protected void updateEntityActionState ( ) { super . updateEntityActionState ( ) ; if ( worldObj . isRemote ) { return ; } if ( allySummonCooldown > <NUM_LIT:0> ) { allySummonCooldown -- ; if ( allySummonCooldown == <NUM_LIT:0> ) { int i = MathHelper . floor_double ( posX ) ; int k = MathHelper . floor_double ( posY ) ; int i1 = MathHelper . floor_double ( posZ ) ; boolean flag = false ; for ( int l1 = <NUM_LIT:0> ; ! flag && l1 <= <NUM_LIT:5> && l1 >= - <NUM_LIT:5> ; l1 = l1 > <NUM_LIT:0> ? <NUM_LIT:0> - l1 : <NUM_LIT:1> - l1 ) { for ( int j2 = <NUM_LIT:0> ; ! flag && j2 <= <NUM_LIT:10> && j2 >= - <NUM_LIT:10> ; j2 = j2 > <NUM_LIT:0> ? <NUM_LIT:0> - j2 : <NUM_LIT:1> - j2 ) { for ( int k2 = <NUM_LIT:0> ; ! flag && k2 <= <NUM_LIT:10> && k2 >= - <NUM_LIT:10> ; k2 = k2 > <NUM_LIT:0> ? <NUM_LIT:0> - k2 : <NUM_LIT:1> - k2 ) { int l2 = worldObj . getBlockId ( i + j2 , k + l1 , i1 + k2 ) ; if ( l2 != Block . silverfish . blockID ) { continue ; } worldObj . playAuxSFX ( <NUM_LIT> , i + j2 , k + l1 , i1 + k2 , Block . silverfish . blockID + ( worldObj . getBlockMetadata ( i + j2 , k + l1 , i1 + k2 ) << <NUM_LIT:12> ) ) ; worldObj . setBlockWithNotify ( i + j2 , k + l1 , i1 + k2 , <NUM_LIT:0> ) ; Block . silverfish . onBlockDestroyedByPlayer ( worldObj , i + j2 , k + l1 , i1 + k2 , <NUM_LIT:0> ) ; if ( ! rand . nextBoolean ( ) ) { continue ; } flag = true ; break ; } } } } } if ( entityToAttack == null && ! hasPath ( ) ) { int j = MathHelper . floor_double ( posX ) ; int l = MathHelper . floor_double ( posY + <NUM_LIT> ) ; int j1 = MathHelper . floor_double ( posZ ) ; int k1 = rand . nextInt ( <NUM_LIT:6> ) ; int i2 = worldObj . getBlockId ( j + Facing . offsetsXForSide [ k1 ] , l + Facing . offsetsYForSide [ k1 ] , j1 + Facing . offsetsZForSide [ k1 ] ) ; if ( BlockSilverfish . getPosingIdByMetadata ( i2 ) ) { worldObj . setBlockAndMetadataWithNotify ( j + Facing . offsetsXForSide [ k1 ] , l + Facing . offsetsYForSide [ k1 ] , j1 + Facing . offsetsZForSide [ k1 ] , Block . silverfish . blockID , BlockSilverfish . getMetadataForBlockType ( i2 ) ) ; spawnExplosionParticle ( ) ; setDead ( ) ; } else { updateWanderPath ( ) ; } } else if ( entityToAttack != null && ! hasPath ( ) ) { entityToAttack = null ; } } public float getBlockPathWeight ( int par1 , int par2 , int par3 ) { if ( worldObj . getBlockId ( par1 , par2 - <NUM_LIT:1> , par3 ) == Block . stone . blockID ) { return <NUM_LIT> ; } else { return super . getBlockPathWeight ( par1 , par2 , par3 ) ; } } protected boolean isValidLightLevel ( ) { return true ; } public boolean getCanSpawnHere ( ) { if ( super . getCanSpawnHere ( ) ) { EntityPlayer entityplayer = worldObj . getClosestPlayerToEntity ( this , <NUM_LIT> ) ; return entityplayer == null ; } else { return false ; } } public EnumCreatureAttribute getCreatureAttribute ( ) { return EnumCreatureAttribute . ARTHROPOD ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntityAIWander extends EntityAIBase { private EntityCreature entity ; private double field_46102_b ; private double field_46103_c ; private double field_46101_d ; private float field_48209_e ; public EntityAIWander ( EntityCreature par1EntityCreature , float par2 ) { entity = par1EntityCreature ; field_48209_e = par2 ; setMutexBits ( <NUM_LIT:1> ) ; } public boolean shouldExecute ( ) { if ( entity . getAge ( ) >= <NUM_LIT:100> ) { return false ; } if ( entity . getRNG ( ) . nextInt ( <NUM_LIT> ) != <NUM_LIT:0> ) { return false ; } Vec3D vec3d = RandomPositionGenerator . func_48396_a ( entity , <NUM_LIT:10> , <NUM_LIT:7> ) ; if ( vec3d == null ) { return false ; } else { field_46102_b = vec3d . xCoord ; field_46103_c = vec3d . yCoord ; field_46101_d = vec3d . zCoord ; return true ; } } public boolean continueExecuting ( ) { return ! entity . getNavigator ( ) . noPath ( ) ; } public void startExecuting ( ) { entity . getNavigator ( ) . func_48658_a ( field_46102_b , field_46103_c , field_46101_d , field_48209_e ) ; } } </s>
|
<s> package net . minecraft . src ; public abstract class EntityGolem extends EntityCreature implements IAnimals { public EntityGolem ( World par1World ) { super ( par1World ) ; } protected void fall ( float f ) { } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; } protected String getLivingSound ( ) { return "<STR_LIT:none>" ; } protected String getHurtSound ( ) { return "<STR_LIT:none>" ; } protected String getDeathSound ( ) { return "<STR_LIT:none>" ; } public int getTalkInterval ( ) { return <NUM_LIT> ; } protected boolean canDespawn ( ) { return false ; } } </s>
|
<s> package net . minecraft . src ; public interface IUpdatePlayerListBox { public abstract void update ( ) ; } </s>
|
<s> package net . minecraft . src ; final class EnchantmentModifierLiving implements IEnchantmentModifier { public int livingModifier ; public EntityLiving entityLiving ; private EnchantmentModifierLiving ( ) { } public void calculateModifier ( Enchantment par1Enchantment , int par2 ) { livingModifier += par1Enchantment . calcModifierLiving ( par2 , entityLiving ) ; } EnchantmentModifierLiving ( Empty3 par1Empty3 ) { this ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class MathHelper { private static float SIN_TABLE [ ] ; public MathHelper ( ) { } public static final float sin ( float par0 ) { return SIN_TABLE [ ( int ) ( par0 * <NUM_LIT> ) & <NUM_LIT> ] ; } public static final float cos ( float par0 ) { return SIN_TABLE [ ( int ) ( par0 * <NUM_LIT> + <NUM_LIT> ) & <NUM_LIT> ] ; } public static final float sqrt_float ( float par0 ) { return ( float ) Math . sqrt ( par0 ) ; } public static final float sqrt_double ( double par0 ) { return ( float ) Math . sqrt ( par0 ) ; } public static int floor_float ( float par0 ) { int i = ( int ) par0 ; return par0 >= ( float ) i ? i : i - <NUM_LIT:1> ; } public static int floor_double ( double par0 ) { int i = ( int ) par0 ; return par0 >= ( double ) i ? i : i - <NUM_LIT:1> ; } public static long floor_double_long ( double par0 ) { long l = ( long ) par0 ; return par0 >= ( double ) l ? l : l - <NUM_LIT:1L> ; } public static float abs ( float par0 ) { return par0 < <NUM_LIT> ? - par0 : par0 ; } public static int abs ( int par0 ) { return par0 < <NUM_LIT:0> ? - par0 : par0 ; } public static int clamp_int ( int par0 , int par1 , int par2 ) { if ( par0 < par1 ) { return par1 ; } if ( par0 > par2 ) { return par2 ; } else { return par0 ; } } public static double abs_max ( double par0 , double par2 ) { if ( par0 < <NUM_LIT> ) { par0 = - par0 ; } if ( par2 < <NUM_LIT> ) { par2 = - par2 ; } return par0 <= par2 ? par2 : par0 ; } public static int getRandomIntegerInRange ( Random par0Random , int par1 , int par2 ) { if ( par1 >= par2 ) { return par1 ; } else { return par0Random . nextInt ( ( par2 - par1 ) + <NUM_LIT:1> ) + par1 ; } } static { SIN_TABLE = new float [ <NUM_LIT> ] ; for ( int i = <NUM_LIT:0> ; i < <NUM_LIT> ; i ++ ) { SIN_TABLE [ i ] = ( float ) Math . sin ( ( ( double ) i * Math . PI * <NUM_LIT> ) / <NUM_LIT> ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class EntityMagmaCube extends EntitySlime { public EntityMagmaCube ( World par1World ) { super ( par1World ) ; texture = "<STR_LIT>" ; isImmuneToFire = true ; landMovementFactor = <NUM_LIT> ; } public boolean getCanSpawnHere ( ) { return worldObj . difficultySetting > <NUM_LIT:0> && worldObj . checkIfAABBIsClear ( boundingBox ) && worldObj . getCollidingBoundingBoxes ( this , boundingBox ) . size ( ) == <NUM_LIT:0> && ! worldObj . isAnyLiquid ( boundingBox ) ; } public int getTotalArmorValue ( ) { return getSlimeSize ( ) * <NUM_LIT:3> ; } public float getBrightness ( float par1 ) { return <NUM_LIT> ; } protected String getSlimeParticle ( ) { return "<STR_LIT>" ; } protected EntitySlime createInstance ( ) { return new EntityMagmaCube ( worldObj ) ; } protected int getDropItemId ( ) { return Item . magmaCream . shiftedIndex ; } protected void dropFewItems ( boolean par1 , int par2 ) { int i = getDropItemId ( ) ; if ( i > <NUM_LIT:0> && getSlimeSize ( ) > <NUM_LIT:1> ) { int j = rand . nextInt ( <NUM_LIT:4> ) - <NUM_LIT:2> ; if ( par2 > <NUM_LIT:0> ) { j += rand . nextInt ( par2 + <NUM_LIT:1> ) ; } for ( int k = <NUM_LIT:0> ; k < j ; k ++ ) { dropItem ( i , <NUM_LIT:1> ) ; } } } public boolean isBurning ( ) { return false ; } protected int func_40115_A ( ) { return super . func_40115_A ( ) * <NUM_LIT:4> ; } protected void func_40116_B ( ) { field_40122_a = field_40122_a * <NUM_LIT> ; } protected void jump ( ) { motionY = <NUM_LIT> + ( float ) getSlimeSize ( ) * <NUM_LIT> ; isAirBorne = true ; } protected void fall ( float f ) { } protected boolean func_40119_C ( ) { return true ; } protected int func_40113_D ( ) { return super . func_40113_D ( ) + <NUM_LIT:2> ; } protected String getHurtSound ( ) { return "<STR_LIT>" ; } protected String getDeathSound ( ) { return "<STR_LIT>" ; } protected String func_40118_E ( ) { if ( getSlimeSize ( ) > <NUM_LIT:1> ) { return "<STR_LIT>" ; } else { return "<STR_LIT>" ; } } public boolean handleLavaMovement ( ) { return false ; } protected boolean func_40121_G ( ) { return true ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; public class ItemBoat extends Item { public ItemBoat ( int par1 ) { super ( par1 ) ; maxStackSize = <NUM_LIT:1> ; } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { float f = <NUM_LIT> ; float f1 = par3EntityPlayer . prevRotationPitch + ( par3EntityPlayer . rotationPitch - par3EntityPlayer . prevRotationPitch ) * f ; float f2 = par3EntityPlayer . prevRotationYaw + ( par3EntityPlayer . rotationYaw - par3EntityPlayer . prevRotationYaw ) * f ; double d = par3EntityPlayer . prevPosX + ( par3EntityPlayer . posX - par3EntityPlayer . prevPosX ) * ( double ) f ; double d1 = ( par3EntityPlayer . prevPosY + ( par3EntityPlayer . posY - par3EntityPlayer . prevPosY ) * ( double ) f + <NUM_LIT> ) - ( double ) par3EntityPlayer . yOffset ; double d2 = par3EntityPlayer . prevPosZ + ( par3EntityPlayer . posZ - par3EntityPlayer . prevPosZ ) * ( double ) f ; Vec3D vec3d = Vec3D . createVector ( d , d1 , d2 ) ; float f3 = MathHelper . cos ( - f2 * <NUM_LIT> - ( float ) Math . PI ) ; float f4 = MathHelper . sin ( - f2 * <NUM_LIT> - ( float ) Math . PI ) ; float f5 = - MathHelper . cos ( - f1 * <NUM_LIT> ) ; float f6 = MathHelper . sin ( - f1 * <NUM_LIT> ) ; float f7 = f4 * f5 ; float f8 = f6 ; float f9 = f3 * f5 ; double d3 = <NUM_LIT> ; Vec3D vec3d1 = vec3d . addVector ( ( double ) f7 * d3 , ( double ) f8 * d3 , ( double ) f9 * d3 ) ; MovingObjectPosition movingobjectposition = par2World . rayTraceBlocks_do ( vec3d , vec3d1 , true ) ; if ( movingobjectposition == null ) { return par1ItemStack ; } Vec3D vec3d2 = par3EntityPlayer . getLook ( f ) ; boolean flag = false ; float f10 = <NUM_LIT> ; List list = par2World . getEntitiesWithinAABBExcludingEntity ( par3EntityPlayer , par3EntityPlayer . boundingBox . addCoord ( vec3d2 . xCoord * d3 , vec3d2 . yCoord * d3 , vec3d2 . zCoord * d3 ) . expand ( f10 , f10 , f10 ) ) ; for ( int l = <NUM_LIT:0> ; l < list . size ( ) ; l ++ ) { Entity entity = ( Entity ) list . get ( l ) ; if ( ! entity . canBeCollidedWith ( ) ) { continue ; } float f11 = entity . getCollisionBorderSize ( ) ; AxisAlignedBB axisalignedbb = entity . boundingBox . expand ( f11 , f11 , f11 ) ; if ( axisalignedbb . isVecInside ( vec3d ) ) { flag = true ; } } if ( flag ) { return par1ItemStack ; } if ( movingobjectposition . typeOfHit == EnumMovingObjectType . TILE ) { int i = movingobjectposition . blockX ; int j = movingobjectposition . blockY ; int k = movingobjectposition . blockZ ; if ( ! par2World . isRemote ) { if ( par2World . getBlockId ( i , j , k ) == Block . snow . blockID ) { j -- ; } par2World . spawnEntityInWorld ( new EntityBoat ( par2World , ( float ) i + <NUM_LIT> , ( float ) j + <NUM_LIT> , ( float ) k + <NUM_LIT> ) ) ; } if ( ! par3EntityPlayer . capabilities . isCreativeMode ) { par1ItemStack . stackSize -- ; } } return par1ItemStack ; } } </s>
|
<s> package net . minecraft . src ; public enum EnumMobType { everything , mobs , players ; } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class WorldChunkManagerHell extends WorldChunkManager { private BiomeGenBase biomeGenerator ; private float hellTemperature ; private float rainfall ; public WorldChunkManagerHell ( BiomeGenBase par1BiomeGenBase , float par2 , float par3 ) { biomeGenerator = par1BiomeGenBase ; hellTemperature = par2 ; rainfall = par3 ; } public BiomeGenBase getBiomeGenAt ( int par1 , int par2 ) { return biomeGenerator ; } public BiomeGenBase [ ] getBiomesForGeneration ( BiomeGenBase par1ArrayOfBiomeGenBase [ ] , int par2 , int par3 , int par4 , int par5 ) { if ( par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase . length < par4 * par5 ) { par1ArrayOfBiomeGenBase = new BiomeGenBase [ par4 * par5 ] ; } Arrays . fill ( par1ArrayOfBiomeGenBase , <NUM_LIT:0> , par4 * par5 , biomeGenerator ) ; return par1ArrayOfBiomeGenBase ; } public float [ ] getTemperatures ( float par1ArrayOfFloat [ ] , int par2 , int par3 , int par4 , int par5 ) { if ( par1ArrayOfFloat == null || par1ArrayOfFloat . length < par4 * par5 ) { par1ArrayOfFloat = new float [ par4 * par5 ] ; } Arrays . fill ( par1ArrayOfFloat , <NUM_LIT:0> , par4 * par5 , hellTemperature ) ; return par1ArrayOfFloat ; } public float [ ] getRainfall ( float par1ArrayOfFloat [ ] , int par2 , int par3 , int par4 , int par5 ) { if ( par1ArrayOfFloat == null || par1ArrayOfFloat . length < par4 * par5 ) { par1ArrayOfFloat = new float [ par4 * par5 ] ; } Arrays . fill ( par1ArrayOfFloat , <NUM_LIT:0> , par4 * par5 , rainfall ) ; return par1ArrayOfFloat ; } public BiomeGenBase [ ] loadBlockGeneratorData ( BiomeGenBase par1ArrayOfBiomeGenBase [ ] , int par2 , int par3 , int par4 , int par5 ) { if ( par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase . length < par4 * par5 ) { par1ArrayOfBiomeGenBase = new BiomeGenBase [ par4 * par5 ] ; } Arrays . fill ( par1ArrayOfBiomeGenBase , <NUM_LIT:0> , par4 * par5 , biomeGenerator ) ; return par1ArrayOfBiomeGenBase ; } public BiomeGenBase [ ] getBiomeGenAt ( BiomeGenBase par1ArrayOfBiomeGenBase [ ] , int par2 , int par3 , int par4 , int par5 , boolean par6 ) { return loadBlockGeneratorData ( par1ArrayOfBiomeGenBase , par2 , par3 , par4 , par5 ) ; } public ChunkPosition findBiomePosition ( int par1 , int par2 , int par3 , List par4List , Random par5Random ) { if ( par4List . contains ( biomeGenerator ) ) { return new ChunkPosition ( ( par1 - par3 ) + par5Random . nextInt ( par3 * <NUM_LIT:2> + <NUM_LIT:1> ) , <NUM_LIT:0> , ( par2 - par3 ) + par5Random . nextInt ( par3 * <NUM_LIT:2> + <NUM_LIT:1> ) ) ; } else { return null ; } } public boolean areBiomesViable ( int par1 , int par2 , int par3 , List par4List ) { return par4List . contains ( biomeGenerator ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . File ; import java . util . List ; public interface ISaveHandler { public abstract WorldInfo loadWorldInfo ( ) ; public abstract void checkSessionLock ( ) ; public abstract IChunkLoader getChunkLoader ( WorldProvider worldprovider ) ; public abstract void saveWorldInfoAndPlayer ( WorldInfo worldinfo , List list ) ; public abstract void saveWorldInfo ( WorldInfo worldinfo ) ; public abstract IPlayerFileData getPlayerNBTManager ( ) ; public abstract void func_22093_e ( ) ; public abstract File getMapFileFromName ( String s ) ; } </s>
|
<s> package net . minecraft . src ; public class ChunkCache implements IBlockAccess { private int chunkX ; private int chunkZ ; private Chunk chunkArray [ ] [ ] ; private boolean field_48098_d ; private World worldObj ; public ChunkCache ( World par1World , int par2 , int par3 , int par4 , int par5 , int par6 , int par7 ) { worldObj = par1World ; chunkX = par2 > > <NUM_LIT:4> ; chunkZ = par4 > > <NUM_LIT:4> ; int i = par5 > > <NUM_LIT:4> ; int j = par7 > > <NUM_LIT:4> ; chunkArray = new Chunk [ ( i - chunkX ) + <NUM_LIT:1> ] [ ( j - chunkZ ) + <NUM_LIT:1> ] ; field_48098_d = true ; for ( int k = chunkX ; k <= i ; k ++ ) { for ( int l = chunkZ ; l <= j ; l ++ ) { Chunk chunk = par1World . getChunkFromChunkCoords ( k , l ) ; if ( chunk == null ) { continue ; } chunkArray [ k - chunkX ] [ l - chunkZ ] = chunk ; if ( ! chunk . getAreLevelsEmpty ( par3 , par6 ) ) { field_48098_d = false ; } } } } public int getBlockId ( int par1 , int par2 , int par3 ) { if ( par2 < <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } int i = ( par1 > > <NUM_LIT:4> ) - chunkX ; int j = ( par3 > > <NUM_LIT:4> ) - chunkZ ; if ( i < <NUM_LIT:0> || i >= chunkArray . length || j < <NUM_LIT:0> || j >= chunkArray [ i ] . length ) { return <NUM_LIT:0> ; } Chunk chunk = chunkArray [ i ] [ j ] ; if ( chunk == null ) { return <NUM_LIT:0> ; } else { return chunk . getBlockID ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } } public TileEntity getBlockTileEntity ( int par1 , int par2 , int par3 ) { int i = ( par1 > > <NUM_LIT:4> ) - chunkX ; int j = ( par3 > > <NUM_LIT:4> ) - chunkZ ; return chunkArray [ i ] [ j ] . getChunkBlockTileEntity ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } public int getBlockMetadata ( int par1 , int par2 , int par3 ) { if ( par2 < <NUM_LIT:0> ) { return <NUM_LIT:0> ; } if ( par2 >= <NUM_LIT> ) { return <NUM_LIT:0> ; } else { int i = ( par1 > > <NUM_LIT:4> ) - chunkX ; int j = ( par3 > > <NUM_LIT:4> ) - chunkZ ; return chunkArray [ i ] [ j ] . getBlockMetadata ( par1 & <NUM_LIT> , par2 , par3 & <NUM_LIT> ) ; } } 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 boolean isBlockNormalCube ( int par1 , int par2 , int par3 ) { Block block = Block . blocksList [ getBlockId ( par1 , par2 , par3 ) ] ; if ( block == null ) { return false ; } else { return block . blockMaterial . blocksMovement ( ) && block . renderAsNormalBlock ( ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentStrongholdStairsStraight extends ComponentStronghold { private final EnumDoor doorType ; public ComponentStrongholdStairsStraight ( 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 ComponentStrongholdStairsStraight 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:7> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:11> , <NUM_LIT:8> , par5 ) ; if ( ! canStrongholdGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentStrongholdStairsStraight ( 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:10> , <NUM_LIT:7> , true , par2Random , StructureStrongholdPieces . getStrongholdStones ( ) ) ; placeDoor ( par1World , par2Random , par3StructureBoundingBox , doorType , <NUM_LIT:1> , <NUM_LIT:7> , <NUM_LIT:0> ) ; placeDoor ( par1World , par2Random , par3StructureBoundingBox , EnumDoor . OPENING , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:7> ) ; int i = getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:2> ) ; for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:6> ; j ++ ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , i , <NUM_LIT:1> , <NUM_LIT:6> - j , <NUM_LIT:1> + j , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , i , <NUM_LIT:2> , <NUM_LIT:6> - j , <NUM_LIT:1> + j , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , i , <NUM_LIT:3> , <NUM_LIT:6> - j , <NUM_LIT:1> + j , par3StructureBoundingBox ) ; if ( j < <NUM_LIT:5> ) { placeBlockAtCurrentPosition ( par1World , Block . stoneBrick . blockID , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:5> - j , <NUM_LIT:1> + j , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stoneBrick . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:5> - j , <NUM_LIT:1> + j , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stoneBrick . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:5> - j , <NUM_LIT:1> + j , par3StructureBoundingBox ) ; } } return true ; } } </s>
|
<s> package net . minecraft . src ; public class EntityAITargetNonTamed extends EntityAINearestAttackableTarget { private EntityTameable field_48299_g ; public EntityAITargetNonTamed ( EntityTameable par1EntityTameable , Class par2Class , float par3 , int par4 , boolean par5 ) { super ( par1EntityTameable , par2Class , par3 , par4 , par5 ) ; field_48299_g = par1EntityTameable ; } public boolean shouldExecute ( ) { if ( field_48299_g . isTamed ( ) ) { return false ; } else { return super . shouldExecute ( ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class ItemFlintAndSteel extends Item { public ItemFlintAndSteel ( int par1 ) { super ( par1 ) ; maxStackSize = <NUM_LIT:1> ; setMaxDamage ( <NUM_LIT> ) ; } public boolean onItemUse ( ItemStack par1ItemStack , EntityPlayer par2EntityPlayer , World par3World , int par4 , int par5 , int par6 , int par7 ) { 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 ) ; } par1ItemStack . damageItem ( <NUM_LIT:1> , par2EntityPlayer ) ; return true ; } } </s>
|
<s> package net . minecraft . src ; import java . io . IOException ; public interface IChunkLoader { public abstract Chunk loadChunk ( World world , int i , int j ) throws IOException ; public abstract void saveChunk ( World world , Chunk chunk ) throws IOException ; public abstract void saveExtraChunkData ( World world , Chunk chunk ) throws IOException ; public abstract void chunkTick ( ) ; public abstract void saveExtraData ( ) ; } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class Packet1Login extends Packet { public int protocolVersion ; public String username ; public WorldType terrainType ; public int serverMode ; public int field_48112_e ; public byte difficultySetting ; public byte worldHeight ; public byte maxPlayers ; public Packet1Login ( ) { } public Packet1Login ( String par1Str , int par2 , WorldType par3WorldType , int par4 , int par5 , byte par6 , byte par7 , byte par8 ) { username = par1Str ; protocolVersion = par2 ; terrainType = par3WorldType ; field_48112_e = par5 ; difficultySetting = par6 ; serverMode = par4 ; worldHeight = par7 ; maxPlayers = par8 ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { protocolVersion = par1DataInputStream . readInt ( ) ; username = readString ( par1DataInputStream , <NUM_LIT:16> ) ; String s = readString ( par1DataInputStream , <NUM_LIT:16> ) ; terrainType = WorldType . parseWorldType ( s ) ; if ( terrainType == null ) { terrainType = WorldType . DEFAULT ; } serverMode = par1DataInputStream . readInt ( ) ; field_48112_e = par1DataInputStream . readInt ( ) ; difficultySetting = par1DataInputStream . readByte ( ) ; worldHeight = par1DataInputStream . readByte ( ) ; maxPlayers = par1DataInputStream . readByte ( ) ; } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeInt ( protocolVersion ) ; writeString ( username , par1DataOutputStream ) ; if ( terrainType == null ) { writeString ( "<STR_LIT>" , par1DataOutputStream ) ; } else { writeString ( terrainType . func_48449_a ( ) , par1DataOutputStream ) ; } par1DataOutputStream . writeInt ( serverMode ) ; par1DataOutputStream . writeInt ( field_48112_e ) ; par1DataOutputStream . writeByte ( difficultySetting ) ; par1DataOutputStream . writeByte ( worldHeight ) ; par1DataOutputStream . writeByte ( maxPlayers ) ; } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleLogin ( this ) ; } public int getPacketSize ( ) { int i = <NUM_LIT:0> ; if ( terrainType != null ) { i = terrainType . func_48449_a ( ) . length ( ) ; } return <NUM_LIT:4> + username . length ( ) + <NUM_LIT:4> + <NUM_LIT:7> + <NUM_LIT:7> + i ; } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . ArrayList ; import java . util . List ; public class AchievementList { public static int minDisplayColumn ; public static int minDisplayRow ; public static int maxDisplayColumn ; public static int maxDisplayRow ; public static List achievementList ; public static Achievement openInventory ; public static Achievement mineWood ; public static Achievement buildWorkBench ; public static Achievement buildPickaxe ; public static Achievement buildFurnace ; public static Achievement acquireIron ; public static Achievement buildHoe ; public static Achievement makeBread ; public static Achievement bakeCake ; public static Achievement buildBetterPickaxe ; public static Achievement cookFish ; public static Achievement onARail ; public static Achievement buildSword ; public static Achievement killEnemy ; public static Achievement killCow ; public static Achievement flyPig ; public static Achievement snipeSkeleton ; public static Achievement diamonds ; public static Achievement portal ; public static Achievement ghast ; public static Achievement blazeRod ; public static Achievement potion ; public static Achievement theEnd ; public static Achievement theEnd2 ; public static Achievement enchantments ; public static Achievement overkill ; public static Achievement bookcase ; public AchievementList ( ) { } public static void init ( ) { } static { achievementList = new ArrayList ( ) ; openInventory = ( new Achievement ( <NUM_LIT:0> , "<STR_LIT>" , <NUM_LIT:0> , <NUM_LIT:0> , Item . book , null ) ) . setIndependent ( ) . registerAchievement ( ) ; mineWood = ( new Achievement ( <NUM_LIT:1> , "<STR_LIT>" , <NUM_LIT:2> , <NUM_LIT:1> , Block . wood , openInventory ) ) . registerAchievement ( ) ; buildWorkBench = ( new Achievement ( <NUM_LIT:2> , "<STR_LIT>" , <NUM_LIT:4> , - <NUM_LIT:1> , Block . workbench , mineWood ) ) . registerAchievement ( ) ; buildPickaxe = ( new Achievement ( <NUM_LIT:3> , "<STR_LIT>" , <NUM_LIT:4> , <NUM_LIT:2> , Item . pickaxeWood , buildWorkBench ) ) . registerAchievement ( ) ; buildFurnace = ( new Achievement ( <NUM_LIT:4> , "<STR_LIT>" , <NUM_LIT:3> , <NUM_LIT:4> , Block . stoneOvenActive , buildPickaxe ) ) . registerAchievement ( ) ; acquireIron = ( new Achievement ( <NUM_LIT:5> , "<STR_LIT>" , <NUM_LIT:1> , <NUM_LIT:4> , Item . ingotIron , buildFurnace ) ) . registerAchievement ( ) ; buildHoe = ( new Achievement ( <NUM_LIT:6> , "<STR_LIT>" , <NUM_LIT:2> , - <NUM_LIT:3> , Item . hoeWood , buildWorkBench ) ) . registerAchievement ( ) ; makeBread = ( new Achievement ( <NUM_LIT:7> , "<STR_LIT>" , - <NUM_LIT:1> , - <NUM_LIT:3> , Item . bread , buildHoe ) ) . registerAchievement ( ) ; bakeCake = ( new Achievement ( <NUM_LIT:8> , "<STR_LIT>" , <NUM_LIT:0> , - <NUM_LIT:5> , Item . cake , buildHoe ) ) . registerAchievement ( ) ; buildBetterPickaxe = ( new Achievement ( <NUM_LIT:9> , "<STR_LIT>" , <NUM_LIT:6> , <NUM_LIT:2> , Item . pickaxeStone , buildPickaxe ) ) . registerAchievement ( ) ; cookFish = ( new Achievement ( <NUM_LIT:10> , "<STR_LIT>" , <NUM_LIT:2> , <NUM_LIT:6> , Item . fishCooked , buildFurnace ) ) . registerAchievement ( ) ; onARail = ( new Achievement ( <NUM_LIT:11> , "<STR_LIT>" , <NUM_LIT:2> , <NUM_LIT:3> , Block . rail , acquireIron ) ) . setSpecial ( ) . registerAchievement ( ) ; buildSword = ( new Achievement ( <NUM_LIT:12> , "<STR_LIT>" , <NUM_LIT:6> , - <NUM_LIT:1> , Item . swordWood , buildWorkBench ) ) . registerAchievement ( ) ; killEnemy = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , <NUM_LIT:8> , - <NUM_LIT:1> , Item . bone , buildSword ) ) . registerAchievement ( ) ; killCow = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , <NUM_LIT:7> , - <NUM_LIT:3> , Item . leather , buildSword ) ) . registerAchievement ( ) ; flyPig = ( new Achievement ( <NUM_LIT:15> , "<STR_LIT>" , <NUM_LIT:8> , - <NUM_LIT:4> , Item . saddle , killCow ) ) . setSpecial ( ) . registerAchievement ( ) ; snipeSkeleton = ( new Achievement ( <NUM_LIT:16> , "<STR_LIT>" , <NUM_LIT:7> , <NUM_LIT:0> , Item . bow , killEnemy ) ) . setSpecial ( ) . registerAchievement ( ) ; diamonds = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , - <NUM_LIT:1> , <NUM_LIT:5> , Item . diamond , acquireIron ) ) . registerAchievement ( ) ; portal = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , - <NUM_LIT:1> , <NUM_LIT:7> , Block . obsidian , diamonds ) ) . registerAchievement ( ) ; ghast = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , - <NUM_LIT:4> , <NUM_LIT:8> , Item . ghastTear , portal ) ) . setSpecial ( ) . registerAchievement ( ) ; blazeRod = ( new Achievement ( <NUM_LIT:20> , "<STR_LIT>" , <NUM_LIT:0> , <NUM_LIT:9> , Item . blazeRod , portal ) ) . registerAchievement ( ) ; potion = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , <NUM_LIT:2> , <NUM_LIT:8> , Item . potion , blazeRod ) ) . registerAchievement ( ) ; theEnd = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , <NUM_LIT:3> , <NUM_LIT:10> , Item . eyeOfEnder , blazeRod ) ) . setSpecial ( ) . registerAchievement ( ) ; theEnd2 = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , <NUM_LIT:4> , <NUM_LIT> , Block . dragonEgg , theEnd ) ) . setSpecial ( ) . registerAchievement ( ) ; enchantments = ( new Achievement ( <NUM_LIT:24> , "<STR_LIT>" , - <NUM_LIT:4> , <NUM_LIT:4> , Block . enchantmentTable , diamonds ) ) . registerAchievement ( ) ; overkill = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , - <NUM_LIT:4> , <NUM_LIT:1> , Item . swordDiamond , enchantments ) ) . setSpecial ( ) . registerAchievement ( ) ; bookcase = ( new Achievement ( <NUM_LIT> , "<STR_LIT>" , - <NUM_LIT:3> , <NUM_LIT:6> , Block . bookShelf , enchantments ) ) . registerAchievement ( ) ; System . out . println ( ( new StringBuilder ( ) ) . append ( achievementList . size ( ) ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } } </s>
|
<s> package net . minecraft . src ; public class EntityAIOwnerHurtByTarget extends EntityAITarget { EntityTameable field_48294_a ; EntityLiving field_48293_b ; public EntityAIOwnerHurtByTarget ( EntityTameable par1EntityTameable ) { super ( par1EntityTameable , <NUM_LIT> , false ) ; field_48294_a = par1EntityTameable ; setMutexBits ( <NUM_LIT:1> ) ; } public boolean shouldExecute ( ) { if ( ! field_48294_a . isTamed ( ) ) { return false ; } EntityLiving entityliving = field_48294_a . getOwner ( ) ; if ( entityliving == null ) { return false ; } else { field_48293_b = entityliving . getAITarget ( ) ; return func_48284_a ( field_48293_b , false ) ; } } public void startExecuting ( ) { taskOwner . setAttackTarget ( field_48293_b ) ; super . startExecuting ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class RandomPositionGenerator { private static Vec3D field_48397_a = Vec3D . createVectorHelper ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) ; public RandomPositionGenerator ( ) { } public static Vec3D func_48396_a ( EntityCreature par0EntityCreature , int par1 , int par2 ) { return func_48393_c ( par0EntityCreature , par1 , par2 , null ) ; } public static Vec3D func_48395_a ( EntityCreature par0EntityCreature , int par1 , int par2 , Vec3D par3Vec3D ) { field_48397_a . xCoord = par3Vec3D . xCoord - par0EntityCreature . posX ; field_48397_a . yCoord = par3Vec3D . yCoord - par0EntityCreature . posY ; field_48397_a . zCoord = par3Vec3D . zCoord - par0EntityCreature . posZ ; return func_48393_c ( par0EntityCreature , par1 , par2 , field_48397_a ) ; } public static Vec3D func_48394_b ( EntityCreature par0EntityCreature , int par1 , int par2 , Vec3D par3Vec3D ) { field_48397_a . xCoord = par0EntityCreature . posX - par3Vec3D . xCoord ; field_48397_a . yCoord = par0EntityCreature . posY - par3Vec3D . yCoord ; field_48397_a . zCoord = par0EntityCreature . posZ - par3Vec3D . zCoord ; return func_48393_c ( par0EntityCreature , par1 , par2 , field_48397_a ) ; } private static Vec3D func_48393_c ( EntityCreature par0EntityCreature , int par1 , int par2 , Vec3D par3Vec3D ) { Random random = par0EntityCreature . getRNG ( ) ; boolean flag = false ; int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; int k = <NUM_LIT:0> ; float f = - <NUM_LIT> ; boolean flag1 ; if ( par0EntityCreature . hasHome ( ) ) { double d = par0EntityCreature . getHomePosition ( ) . getEuclideanDistanceTo ( MathHelper . floor_double ( par0EntityCreature . posX ) , MathHelper . floor_double ( par0EntityCreature . posY ) , MathHelper . floor_double ( par0EntityCreature . posZ ) ) + <NUM_LIT> ; flag1 = d < ( double ) ( par0EntityCreature . getMaximumHomeDistance ( ) + ( float ) par1 ) ; } else { flag1 = false ; } for ( int l = <NUM_LIT:0> ; l < <NUM_LIT:10> ; l ++ ) { int i1 = random . nextInt ( <NUM_LIT:2> * par1 ) - par1 ; int j1 = random . nextInt ( <NUM_LIT:2> * par2 ) - par2 ; int k1 = random . nextInt ( <NUM_LIT:2> * par1 ) - par1 ; if ( par3Vec3D != null && ( double ) i1 * par3Vec3D . xCoord + ( double ) k1 * par3Vec3D . zCoord < <NUM_LIT> ) { continue ; } i1 += MathHelper . floor_double ( par0EntityCreature . posX ) ; j1 += MathHelper . floor_double ( par0EntityCreature . posY ) ; k1 += MathHelper . floor_double ( par0EntityCreature . posZ ) ; if ( flag1 && ! par0EntityCreature . isWithinHomeDistance ( i1 , j1 , k1 ) ) { continue ; } float f1 = par0EntityCreature . getBlockPathWeight ( i1 , j1 , k1 ) ; if ( f1 > f ) { f = f1 ; i = i1 ; j = j1 ; k = k1 ; flag = true ; } } if ( flag ) { return Vec3D . createVector ( i , j , k ) ; } else { return null ; } } } </s>
|
<s> package net . minecraft . src ; import java . io . PrintStream ; import java . util . * ; public class CraftingManager { private static final CraftingManager instance = new CraftingManager ( ) ; private List recipes ; public static final CraftingManager getInstance ( ) { return instance ; } private CraftingManager ( ) { recipes = new ArrayList ( ) ; ( new RecipesTools ( ) ) . addRecipes ( this ) ; ( new RecipesWeapons ( ) ) . addRecipes ( this ) ; ( new RecipesIngots ( ) ) . addRecipes ( this ) ; ( new RecipesFood ( ) ) . addRecipes ( this ) ; ( new RecipesCrafting ( ) ) . addRecipes ( this ) ; ( new RecipesArmor ( ) ) . addRecipes ( this ) ; ( new RecipesDyes ( ) ) . addRecipes ( this ) ; addRecipe ( new ItemStack ( Item . paper , <NUM_LIT:3> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Item . reed } ) ; addRecipe ( new ItemStack ( Item . book , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:#>" , "<STR_LIT:#>" , "<STR_LIT:#>" , '<CHAR_LIT>' , Item . paper } ) ; addRecipe ( new ItemStack ( Block . fence , <NUM_LIT:2> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Block . netherFence , <NUM_LIT:6> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . netherBrick } ) ; addRecipe ( new ItemStack ( Block . fenceGate , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . stick , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Block . jukebox , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks , '<CHAR_LIT>' , Item . diamond } ) ; addRecipe ( new ItemStack ( Block . music , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks , '<CHAR_LIT>' , Item . redstone } ) ; addRecipe ( new ItemStack ( Block . bookShelf , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks , '<CHAR_LIT>' , Item . book } ) ; addRecipe ( new ItemStack ( Block . blockSnow , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . snowball } ) ; addRecipe ( new ItemStack ( Block . blockClay , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . clay } ) ; addRecipe ( new ItemStack ( Block . brick , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . brick } ) ; addRecipe ( new ItemStack ( Block . glowStone , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . lightStoneDust } ) ; addRecipe ( new ItemStack ( Block . cloth , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . silk } ) ; addRecipe ( new ItemStack ( Block . tnt , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . gunpowder , '<CHAR_LIT>' , Block . sand } ) ; addRecipe ( new ItemStack ( Block . stairSingle , <NUM_LIT:6> , <NUM_LIT:3> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . cobblestone } ) ; addRecipe ( new ItemStack ( Block . stairSingle , <NUM_LIT:6> , <NUM_LIT:0> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . stone } ) ; addRecipe ( new ItemStack ( Block . stairSingle , <NUM_LIT:6> , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . sandStone } ) ; addRecipe ( new ItemStack ( Block . stairSingle , <NUM_LIT:6> , <NUM_LIT:2> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Block . stairSingle , <NUM_LIT:6> , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . brick } ) ; addRecipe ( new ItemStack ( Block . stairSingle , <NUM_LIT:6> , <NUM_LIT:5> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . stoneBrick } ) ; addRecipe ( new ItemStack ( Block . ladder , <NUM_LIT:3> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Item . doorWood , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Block . trapdoor , <NUM_LIT:2> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Item . doorSteel , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron } ) ; addRecipe ( new ItemStack ( Item . sign , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Item . cake , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT:A>' , Item . bucketMilk , '<CHAR_LIT>' , Item . sugar , '<CHAR_LIT>' , Item . wheat , '<CHAR_LIT>' , Item . egg } ) ; addRecipe ( new ItemStack ( Item . sugar , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:#>" , '<CHAR_LIT>' , Item . reed } ) ; addRecipe ( new ItemStack ( Block . planks , <NUM_LIT:4> , <NUM_LIT:0> ) , new Object [ ] { "<STR_LIT:#>" , '<CHAR_LIT>' , new ItemStack ( Block . wood , <NUM_LIT:1> , <NUM_LIT:0> ) } ) ; addRecipe ( new ItemStack ( Block . planks , <NUM_LIT:4> , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:#>" , '<CHAR_LIT>' , new ItemStack ( Block . wood , <NUM_LIT:1> , <NUM_LIT:1> ) } ) ; addRecipe ( new ItemStack ( Block . planks , <NUM_LIT:4> , <NUM_LIT:2> ) , new Object [ ] { "<STR_LIT:#>" , '<CHAR_LIT>' , new ItemStack ( Block . wood , <NUM_LIT:1> , <NUM_LIT:2> ) } ) ; addRecipe ( new ItemStack ( Block . planks , <NUM_LIT:4> , <NUM_LIT:3> ) , new Object [ ] { "<STR_LIT:#>" , '<CHAR_LIT>' , new ItemStack ( Block . wood , <NUM_LIT:1> , <NUM_LIT:3> ) } ) ; addRecipe ( new ItemStack ( Item . stick , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT:#>" , "<STR_LIT:#>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Block . torchWood , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT:X>" , "<STR_LIT:#>" , '<CHAR_LIT>' , Item . coal , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Block . torchWood , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT:X>" , "<STR_LIT:#>" , '<CHAR_LIT>' , new ItemStack ( Item . coal , <NUM_LIT:1> , <NUM_LIT:1> ) , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Item . bowlEmpty , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Item . glassBottle , <NUM_LIT:3> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . glass } ) ; addRecipe ( new ItemStack ( Block . rail , <NUM_LIT:16> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Block . railPowered , <NUM_LIT:6> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotGold , '<CHAR_LIT>' , Item . redstone , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Block . railDetector , <NUM_LIT:6> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron , '<CHAR_LIT>' , Item . redstone , '<CHAR_LIT>' , Block . pressurePlateStone } ) ; addRecipe ( new ItemStack ( Item . minecartEmpty , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron } ) ; addRecipe ( new ItemStack ( Item . cauldron , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron } ) ; addRecipe ( new ItemStack ( Item . brewingStand , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . cobblestone , '<CHAR_LIT>' , Item . blazeRod } ) ; addRecipe ( new ItemStack ( Block . pumpkinLantern , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:A>" , "<STR_LIT:B>" , '<CHAR_LIT:A>' , Block . pumpkin , '<CHAR_LIT>' , Block . torchWood } ) ; addRecipe ( new ItemStack ( Item . minecartCrate , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:A>" , "<STR_LIT:B>" , '<CHAR_LIT:A>' , Block . chest , '<CHAR_LIT>' , Item . minecartEmpty } ) ; addRecipe ( new ItemStack ( Item . minecartPowered , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:A>" , "<STR_LIT:B>" , '<CHAR_LIT:A>' , Block . stoneOvenIdle , '<CHAR_LIT>' , Item . minecartEmpty } ) ; addRecipe ( new ItemStack ( Item . boat , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Item . bucketEmpty , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron } ) ; addRecipe ( new ItemStack ( Item . flintAndSteel , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT:A>' , Item . ingotIron , '<CHAR_LIT>' , Item . flint } ) ; addRecipe ( new ItemStack ( Item . bread , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Item . wheat } ) ; addRecipe ( new ItemStack ( Block . stairCompactPlanks , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Item . fishingRod , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . stick , '<CHAR_LIT>' , Item . silk } ) ; addRecipe ( new ItemStack ( Block . stairCompactCobblestone , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . cobblestone } ) ; addRecipe ( new ItemStack ( Block . stairsBrick , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . brick } ) ; addRecipe ( new ItemStack ( Block . stairsStoneBrickSmooth , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . stoneBrick } ) ; addRecipe ( new ItemStack ( Block . stairsNetherBrick , <NUM_LIT:4> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . netherBrick } ) ; addRecipe ( new ItemStack ( Item . painting , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . stick , '<CHAR_LIT>' , Block . cloth } ) ; addRecipe ( new ItemStack ( Item . appleGold , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . goldNugget , '<CHAR_LIT>' , Item . appleRed } ) ; addRecipe ( new ItemStack ( Block . lever , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:X>" , "<STR_LIT:#>" , '<CHAR_LIT>' , Block . cobblestone , '<CHAR_LIT>' , Item . stick } ) ; addRecipe ( new ItemStack ( Block . torchRedstoneActive , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:X>" , "<STR_LIT:#>" , '<CHAR_LIT>' , Item . stick , '<CHAR_LIT>' , Item . redstone } ) ; addRecipe ( new ItemStack ( Item . redstoneRepeater , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . torchRedstoneActive , '<CHAR_LIT>' , Item . redstone , '<CHAR_LIT>' , Block . stone } ) ; addRecipe ( new ItemStack ( Item . pocketSundial , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotGold , '<CHAR_LIT>' , Item . redstone } ) ; addRecipe ( new ItemStack ( Item . compass , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . ingotIron , '<CHAR_LIT>' , Item . redstone } ) ; addRecipe ( new ItemStack ( Item . map , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . paper , '<CHAR_LIT>' , Item . compass } ) ; addRecipe ( new ItemStack ( Block . button , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:#>" , "<STR_LIT:#>" , '<CHAR_LIT>' , Block . stone } ) ; addRecipe ( new ItemStack ( Block . pressurePlateStone , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . stone } ) ; addRecipe ( new ItemStack ( Block . pressurePlatePlanks , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Block . dispenser , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . cobblestone , '<CHAR_LIT>' , Item . bow , '<CHAR_LIT>' , Item . redstone } ) ; addRecipe ( new ItemStack ( Block . pistonBase , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . cobblestone , '<CHAR_LIT>' , Item . ingotIron , '<CHAR_LIT>' , Item . redstone , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Block . pistonStickyBase , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT:S>" , "<STR_LIT>" , '<CHAR_LIT>' , Item . slimeBall , '<CHAR_LIT>' , Block . pistonBase } ) ; addRecipe ( new ItemStack ( Item . bed , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . cloth , '<CHAR_LIT>' , Block . planks } ) ; addRecipe ( new ItemStack ( Block . enchantmentTable , <NUM_LIT:1> ) , new Object [ ] { "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , '<CHAR_LIT>' , Block . obsidian , '<CHAR_LIT>' , Item . book , '<CHAR_LIT>' , Item . diamond } ) ; addShapelessRecipe ( new ItemStack ( Item . eyeOfEnder , <NUM_LIT:1> ) , new Object [ ] { Item . enderPearl , Item . blazePowder } ) ; addShapelessRecipe ( new ItemStack ( Item . fireballCharge , <NUM_LIT:3> ) , new Object [ ] { Item . gunpowder , Item . blazePowder , Item . coal } ) ; addShapelessRecipe ( new ItemStack ( Item . fireballCharge , <NUM_LIT:3> ) , new Object [ ] { Item . gunpowder , Item . blazePowder , new ItemStack ( Item . coal , <NUM_LIT:1> , <NUM_LIT:1> ) } ) ; Collections . sort ( recipes , new RecipeSorter ( this ) ) ; System . out . println ( ( new StringBuilder ( ) ) . append ( recipes . size ( ) ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } void addRecipe ( ItemStack par1ItemStack , Object par2ArrayOfObj [ ] ) { String s = "<STR_LIT>" ; int i = <NUM_LIT:0> ; int j = <NUM_LIT:0> ; int k = <NUM_LIT:0> ; if ( par2ArrayOfObj [ i ] instanceof String [ ] ) { String as [ ] = ( String [ ] ) par2ArrayOfObj [ i ++ ] ; for ( int l = <NUM_LIT:0> ; l < as . length ; l ++ ) { String s2 = as [ l ] ; k ++ ; j = s2 . length ( ) ; s = ( new StringBuilder ( ) ) . append ( s ) . append ( s2 ) . toString ( ) ; } } else { while ( par2ArrayOfObj [ i ] instanceof String ) { String s1 = ( String ) par2ArrayOfObj [ i ++ ] ; k ++ ; j = s1 . length ( ) ; s = ( new StringBuilder ( ) ) . append ( s ) . append ( s1 ) . toString ( ) ; } } HashMap hashmap = new HashMap ( ) ; for ( ; i < par2ArrayOfObj . length ; i += <NUM_LIT:2> ) { Character character = ( Character ) par2ArrayOfObj [ i ] ; ItemStack itemstack = null ; if ( par2ArrayOfObj [ i + <NUM_LIT:1> ] instanceof Item ) { itemstack = new ItemStack ( ( Item ) par2ArrayOfObj [ i + <NUM_LIT:1> ] ) ; } else if ( par2ArrayOfObj [ i + <NUM_LIT:1> ] instanceof Block ) { itemstack = new ItemStack ( ( Block ) par2ArrayOfObj [ i + <NUM_LIT:1> ] , <NUM_LIT:1> , - <NUM_LIT:1> ) ; } else if ( par2ArrayOfObj [ i + <NUM_LIT:1> ] instanceof ItemStack ) { itemstack = ( ItemStack ) par2ArrayOfObj [ i + <NUM_LIT:1> ] ; } hashmap . put ( character , itemstack ) ; } ItemStack aitemstack [ ] = new ItemStack [ j * k ] ; for ( int i1 = <NUM_LIT:0> ; i1 < j * k ; i1 ++ ) { char c = s . charAt ( i1 ) ; if ( hashmap . containsKey ( Character . valueOf ( c ) ) ) { aitemstack [ i1 ] = ( ( ItemStack ) hashmap . get ( Character . valueOf ( c ) ) ) . copy ( ) ; } else { aitemstack [ i1 ] = null ; } } recipes . add ( new ShapedRecipes ( j , k , aitemstack , par1ItemStack ) ) ; } void addShapelessRecipe ( ItemStack par1ItemStack , Object par2ArrayOfObj [ ] ) { ArrayList arraylist = new ArrayList ( ) ; Object aobj [ ] = par2ArrayOfObj ; int i = aobj . length ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { Object obj = aobj [ j ] ; if ( obj instanceof ItemStack ) { arraylist . add ( ( ( ItemStack ) obj ) . copy ( ) ) ; continue ; } if ( obj instanceof Item ) { arraylist . add ( new ItemStack ( ( Item ) obj ) ) ; continue ; } if ( obj instanceof Block ) { arraylist . add ( new ItemStack ( ( Block ) obj ) ) ; } else { throw new RuntimeException ( "<STR_LIT>" ) ; } } recipes . add ( new ShapelessRecipes ( par1ItemStack , arraylist ) ) ; } public ItemStack findMatchingRecipe ( InventoryCrafting par1InventoryCrafting ) { int i = <NUM_LIT:0> ; ItemStack itemstack = null ; ItemStack itemstack1 = null ; for ( int j = <NUM_LIT:0> ; j < par1InventoryCrafting . getSizeInventory ( ) ; j ++ ) { ItemStack itemstack2 = par1InventoryCrafting . getStackInSlot ( j ) ; if ( itemstack2 == null ) { continue ; } if ( i == <NUM_LIT:0> ) { itemstack = itemstack2 ; } if ( i == <NUM_LIT:1> ) { itemstack1 = itemstack2 ; } i ++ ; } if ( i == <NUM_LIT:2> && itemstack . itemID == itemstack1 . itemID && itemstack . stackSize == <NUM_LIT:1> && itemstack1 . stackSize == <NUM_LIT:1> && Item . itemsList [ itemstack . itemID ] . isDamageable ( ) ) { Item item = Item . itemsList [ itemstack . itemID ] ; int l = item . getMaxDamage ( ) - itemstack . getItemDamageForDisplay ( ) ; int i1 = item . getMaxDamage ( ) - itemstack1 . getItemDamageForDisplay ( ) ; int j1 = l + i1 + ( item . getMaxDamage ( ) * <NUM_LIT:10> ) / <NUM_LIT:100> ; int k1 = item . getMaxDamage ( ) - j1 ; if ( k1 < <NUM_LIT:0> ) { k1 = <NUM_LIT:0> ; } return new ItemStack ( itemstack . itemID , <NUM_LIT:1> , k1 ) ; } for ( int k = <NUM_LIT:0> ; k < recipes . size ( ) ; k ++ ) { IRecipe irecipe = ( IRecipe ) recipes . get ( k ) ; if ( irecipe . matches ( par1InventoryCrafting ) ) { return irecipe . getCraftingResult ( par1InventoryCrafting ) ; } } return null ; } public List getRecipeList ( ) { return recipes ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . * ; public class Packet60Explosion extends Packet { public double explosionX ; public double explosionY ; public double explosionZ ; public float explosionSize ; public Set destroyedBlockPositions ; public Packet60Explosion ( ) { } public Packet60Explosion ( double par1 , double par3 , double par5 , float par7 , Set par8Set ) { explosionX = par1 ; explosionY = par3 ; explosionZ = par5 ; explosionSize = par7 ; destroyedBlockPositions = new HashSet ( par8Set ) ; } public void readPacketData ( DataInputStream par1DataInputStream ) throws IOException { explosionX = par1DataInputStream . readDouble ( ) ; explosionY = par1DataInputStream . readDouble ( ) ; explosionZ = par1DataInputStream . readDouble ( ) ; explosionSize = par1DataInputStream . readFloat ( ) ; int i = par1DataInputStream . readInt ( ) ; destroyedBlockPositions = new HashSet ( ) ; int j = ( int ) explosionX ; int k = ( int ) explosionY ; int l = ( int ) explosionZ ; for ( int i1 = <NUM_LIT:0> ; i1 < i ; i1 ++ ) { int j1 = par1DataInputStream . readByte ( ) + j ; int k1 = par1DataInputStream . readByte ( ) + k ; int l1 = par1DataInputStream . readByte ( ) + l ; destroyedBlockPositions . add ( new ChunkPosition ( j1 , k1 , l1 ) ) ; } } public void writePacketData ( DataOutputStream par1DataOutputStream ) throws IOException { par1DataOutputStream . writeDouble ( explosionX ) ; par1DataOutputStream . writeDouble ( explosionY ) ; par1DataOutputStream . writeDouble ( explosionZ ) ; par1DataOutputStream . writeFloat ( explosionSize ) ; par1DataOutputStream . writeInt ( destroyedBlockPositions . size ( ) ) ; int i = ( int ) explosionX ; int j = ( int ) explosionY ; int k = ( int ) explosionZ ; int j1 ; for ( Iterator iterator = destroyedBlockPositions . iterator ( ) ; iterator . hasNext ( ) ; par1DataOutputStream . writeByte ( j1 ) ) { ChunkPosition chunkposition = ( ChunkPosition ) iterator . next ( ) ; int l = chunkposition . x - i ; int i1 = chunkposition . y - j ; j1 = chunkposition . z - k ; par1DataOutputStream . writeByte ( l ) ; par1DataOutputStream . writeByte ( i1 ) ; } } public void processPacket ( NetHandler par1NetHandler ) { par1NetHandler . handleExplosion ( this ) ; } public int getPacketSize ( ) { return <NUM_LIT:32> + destroyedBlockPositions . size ( ) * <NUM_LIT:3> ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; public class NBTTagDouble extends NBTBase { public double data ; public NBTTagDouble ( String par1Str ) { super ( par1Str ) ; } public NBTTagDouble ( String par1Str , double par2 ) { super ( par1Str ) ; data = par2 ; } void write ( DataOutput par1DataOutput ) throws IOException { par1DataOutput . writeDouble ( data ) ; } void load ( DataInput par1DataInput ) throws IOException { data = par1DataInput . readDouble ( ) ; } public byte getId ( ) { return <NUM_LIT:6> ; } public String toString ( ) { return ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( data ) . toString ( ) ; } public NBTBase copy ( ) { return new NBTTagDouble ( getName ( ) , data ) ; } public boolean equals ( Object par1Obj ) { if ( super . equals ( par1Obj ) ) { NBTTagDouble nbttagdouble = ( NBTTagDouble ) par1Obj ; return data == nbttagdouble . data ; } else { return false ; } } public int hashCode ( ) { long l = Double . doubleToLongBits ( data ) ; return super . hashCode ( ) ^ ( int ) ( l ^ l > > > <NUM_LIT:32> ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; public class ShapelessRecipes implements IRecipe { private final ItemStack recipeOutput ; private final List recipeItems ; public ShapelessRecipes ( ItemStack par1ItemStack , List par2List ) { recipeOutput = par1ItemStack ; recipeItems = par2List ; } public ItemStack getRecipeOutput ( ) { return recipeOutput ; } public boolean matches ( InventoryCrafting par1InventoryCrafting ) { ArrayList arraylist = new ArrayList ( recipeItems ) ; int i = <NUM_LIT:0> ; do { if ( i >= <NUM_LIT:3> ) { break ; } for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:3> ; j ++ ) { ItemStack itemstack = par1InventoryCrafting . getStackInRowAndColumn ( j , i ) ; if ( itemstack == null ) { continue ; } boolean flag = false ; Iterator iterator = arraylist . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } ItemStack itemstack1 = ( ItemStack ) iterator . next ( ) ; if ( itemstack . itemID != itemstack1 . itemID || itemstack1 . getItemDamage ( ) != - <NUM_LIT:1> && itemstack . getItemDamage ( ) != itemstack1 . getItemDamage ( ) ) { continue ; } flag = true ; arraylist . remove ( itemstack1 ) ; break ; } while ( true ) ; if ( ! flag ) { return false ; } } i ++ ; } while ( true ) ; return arraylist . isEmpty ( ) ; } public ItemStack getCraftingResult ( InventoryCrafting par1InventoryCrafting ) { return recipeOutput . copy ( ) ; } public int getRecipeSize ( ) { return recipeItems . size ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . io . * ; import java . util . * ; public class DataWatcher { private static final HashMap dataTypes ; private final Map watchedObjects = new HashMap ( ) ; private boolean objectChanged ; public DataWatcher ( ) { } public void addObject ( int par1 , Object par2Obj ) { Integer integer = ( Integer ) dataTypes . get ( par2Obj . getClass ( ) ) ; if ( integer == null ) { throw new IllegalArgumentException ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par2Obj . getClass ( ) ) . toString ( ) ) ; } if ( par1 > <NUM_LIT:31> ) { throw new IllegalArgumentException ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1 ) . append ( "<STR_LIT>" ) . append ( <NUM_LIT:31> ) . append ( "<STR_LIT:)>" ) . toString ( ) ) ; } if ( watchedObjects . containsKey ( Integer . valueOf ( par1 ) ) ) { throw new IllegalArgumentException ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( par1 ) . append ( "<STR_LIT:!>" ) . toString ( ) ) ; } else { WatchableObject watchableobject = new WatchableObject ( integer . intValue ( ) , par1 , par2Obj ) ; watchedObjects . put ( Integer . valueOf ( par1 ) , watchableobject ) ; return ; } } public byte getWatchableObjectByte ( int par1 ) { return ( ( Byte ) ( ( WatchableObject ) watchedObjects . get ( Integer . valueOf ( par1 ) ) ) . getObject ( ) ) . byteValue ( ) ; } public short getWatchableObjectShort ( int par1 ) { return ( ( Short ) ( ( WatchableObject ) watchedObjects . get ( Integer . valueOf ( par1 ) ) ) . getObject ( ) ) . shortValue ( ) ; } public int getWatchableObjectInt ( int par1 ) { return ( ( Integer ) ( ( WatchableObject ) watchedObjects . get ( Integer . valueOf ( par1 ) ) ) . getObject ( ) ) . intValue ( ) ; } public String getWatchableObjectString ( int par1 ) { return ( String ) ( ( WatchableObject ) watchedObjects . get ( Integer . valueOf ( par1 ) ) ) . getObject ( ) ; } public void updateObject ( int par1 , Object par2Obj ) { WatchableObject watchableobject = ( WatchableObject ) watchedObjects . get ( Integer . valueOf ( par1 ) ) ; if ( ! par2Obj . equals ( watchableobject . getObject ( ) ) ) { watchableobject . setObject ( par2Obj ) ; watchableobject . setWatching ( true ) ; objectChanged = true ; } } public boolean hasObjectChanged ( ) { return objectChanged ; } public static void writeObjectsInListToStream ( List par0List , DataOutputStream par1DataOutputStream ) throws IOException { if ( par0List != null ) { WatchableObject watchableobject ; for ( Iterator iterator = par0List . iterator ( ) ; iterator . hasNext ( ) ; writeWatchableObject ( par1DataOutputStream , watchableobject ) ) { watchableobject = ( WatchableObject ) iterator . next ( ) ; } } par1DataOutputStream . writeByte ( <NUM_LIT> ) ; } public ArrayList getChangedObjects ( ) { ArrayList arraylist = null ; if ( objectChanged ) { Iterator iterator = watchedObjects . values ( ) . iterator ( ) ; do { if ( ! iterator . hasNext ( ) ) { break ; } WatchableObject watchableobject = ( WatchableObject ) iterator . next ( ) ; if ( watchableobject . getWatching ( ) ) { watchableobject . setWatching ( false ) ; if ( arraylist == null ) { arraylist = new ArrayList ( ) ; } arraylist . add ( watchableobject ) ; } } while ( true ) ; } objectChanged = false ; return arraylist ; } public void writeWatchableObjects ( DataOutputStream par1DataOutputStream ) throws IOException { WatchableObject watchableobject ; for ( Iterator iterator = watchedObjects . values ( ) . iterator ( ) ; iterator . hasNext ( ) ; writeWatchableObject ( par1DataOutputStream , watchableobject ) ) { watchableobject = ( WatchableObject ) iterator . next ( ) ; } par1DataOutputStream . writeByte ( <NUM_LIT> ) ; } private static void writeWatchableObject ( DataOutputStream par0DataOutputStream , WatchableObject par1WatchableObject ) throws IOException { int i = ( par1WatchableObject . getObjectType ( ) << <NUM_LIT:5> | par1WatchableObject . getDataValueId ( ) & <NUM_LIT> ) & <NUM_LIT> ; par0DataOutputStream . writeByte ( i ) ; switch ( par1WatchableObject . getObjectType ( ) ) { case <NUM_LIT:0> : par0DataOutputStream . writeByte ( ( ( Byte ) par1WatchableObject . getObject ( ) ) . byteValue ( ) ) ; break ; case <NUM_LIT:1> : par0DataOutputStream . writeShort ( ( ( Short ) par1WatchableObject . getObject ( ) ) . shortValue ( ) ) ; break ; case <NUM_LIT:2> : par0DataOutputStream . writeInt ( ( ( Integer ) par1WatchableObject . getObject ( ) ) . intValue ( ) ) ; break ; case <NUM_LIT:3> : par0DataOutputStream . writeFloat ( ( ( Float ) par1WatchableObject . getObject ( ) ) . floatValue ( ) ) ; break ; case <NUM_LIT:4> : Packet . writeString ( ( String ) par1WatchableObject . getObject ( ) , par0DataOutputStream ) ; break ; case <NUM_LIT:5> : ItemStack itemstack = ( ItemStack ) par1WatchableObject . getObject ( ) ; par0DataOutputStream . writeShort ( itemstack . getItem ( ) . shiftedIndex ) ; par0DataOutputStream . writeByte ( itemstack . stackSize ) ; par0DataOutputStream . writeShort ( itemstack . getItemDamage ( ) ) ; break ; case <NUM_LIT:6> : ChunkCoordinates chunkcoordinates = ( ChunkCoordinates ) par1WatchableObject . getObject ( ) ; par0DataOutputStream . writeInt ( chunkcoordinates . posX ) ; par0DataOutputStream . writeInt ( chunkcoordinates . posY ) ; par0DataOutputStream . writeInt ( chunkcoordinates . posZ ) ; break ; } } public static List readWatchableObjects ( DataInputStream par0DataInputStream ) throws IOException { ArrayList arraylist = null ; for ( byte byte0 = par0DataInputStream . readByte ( ) ; byte0 != <NUM_LIT> ; byte0 = par0DataInputStream . readByte ( ) ) { if ( arraylist == null ) { arraylist = new ArrayList ( ) ; } int i = ( byte0 & <NUM_LIT> ) > > <NUM_LIT:5> ; int j = byte0 & <NUM_LIT> ; WatchableObject watchableobject = null ; switch ( i ) { case <NUM_LIT:0> : watchableobject = new WatchableObject ( i , j , Byte . valueOf ( par0DataInputStream . readByte ( ) ) ) ; break ; case <NUM_LIT:1> : watchableobject = new WatchableObject ( i , j , Short . valueOf ( par0DataInputStream . readShort ( ) ) ) ; break ; case <NUM_LIT:2> : watchableobject = new WatchableObject ( i , j , Integer . valueOf ( par0DataInputStream . readInt ( ) ) ) ; break ; case <NUM_LIT:3> : watchableobject = new WatchableObject ( i , j , Float . valueOf ( par0DataInputStream . readFloat ( ) ) ) ; break ; case <NUM_LIT:4> : watchableobject = new WatchableObject ( i , j , Packet . readString ( par0DataInputStream , <NUM_LIT> ) ) ; break ; case <NUM_LIT:5> : short word0 = par0DataInputStream . readShort ( ) ; byte byte1 = par0DataInputStream . readByte ( ) ; short word1 = par0DataInputStream . readShort ( ) ; watchableobject = new WatchableObject ( i , j , new ItemStack ( word0 , byte1 , word1 ) ) ; break ; case <NUM_LIT:6> : int k = par0DataInputStream . readInt ( ) ; int l = par0DataInputStream . readInt ( ) ; int i1 = par0DataInputStream . readInt ( ) ; watchableobject = new WatchableObject ( i , j , new ChunkCoordinates ( k , l , i1 ) ) ; break ; } arraylist . add ( watchableobject ) ; } return arraylist ; } static { dataTypes = new HashMap ( ) ; dataTypes . put ( java . lang . Byte . class , Integer . valueOf ( <NUM_LIT:0> ) ) ; dataTypes . put ( java . lang . Short . class , Integer . valueOf ( <NUM_LIT:1> ) ) ; dataTypes . put ( java . lang . Integer . class , Integer . valueOf ( <NUM_LIT:2> ) ) ; dataTypes . put ( java . lang . Float . class , Integer . valueOf ( <NUM_LIT:3> ) ) ; dataTypes . put ( java . lang . String . class , Integer . valueOf ( <NUM_LIT:4> ) ) ; dataTypes . put ( net . minecraft . src . ItemStack . class , Integer . valueOf ( <NUM_LIT:5> ) ) ; dataTypes . put ( net . minecraft . src . ChunkCoordinates . class , Integer . valueOf ( <NUM_LIT:6> ) ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . * ; import java . util . logging . Logger ; import net . minecraft . server . MinecraftServer ; public class ConsoleCommandHandler { private static Logger minecraftLogger = Logger . getLogger ( "<STR_LIT>" ) ; private MinecraftServer minecraftServer ; public ConsoleCommandHandler ( MinecraftServer par1MinecraftServer ) { minecraftServer = par1MinecraftServer ; } public synchronized void handleCommand ( ServerCommand par1ServerCommand ) { String s = par1ServerCommand . command ; String as [ ] = s . split ( "<STR_LIT:U+0020>" ) ; String s1 = as [ <NUM_LIT:0> ] ; String s2 = s . substring ( s1 . length ( ) ) . trim ( ) ; ICommandListener icommandlistener = par1ServerCommand . commandListener ; String s3 = icommandlistener . getUsername ( ) ; ServerConfigurationManager serverconfigurationmanager = minecraftServer . configManager ; if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) || s1 . equalsIgnoreCase ( "<STR_LIT:?>" ) ) { printHelp ( icommandlistener ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT:list>" ) ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( serverconfigurationmanager . getPlayerList ( ) ) . toString ( ) ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { sendNoticeToOps ( s3 , "<STR_LIT>" ) ; minecraftServer . initiateShutdown ( ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { sendNoticeToOps ( s3 , "<STR_LIT>" ) ; if ( serverconfigurationmanager != null ) { serverconfigurationmanager . savePlayerStates ( ) ; } for ( int i = <NUM_LIT:0> ; i < minecraftServer . worldMngr . length ; i ++ ) { WorldServer worldserver = minecraftServer . worldMngr [ i ] ; boolean flag = worldserver . levelSaving ; worldserver . levelSaving = false ; worldserver . saveWorld ( true , null ) ; worldserver . levelSaving = flag ; } sendNoticeToOps ( s3 , "<STR_LIT>" ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { sendNoticeToOps ( s3 , "<STR_LIT>" ) ; for ( int j = <NUM_LIT:0> ; j < minecraftServer . worldMngr . length ; j ++ ) { WorldServer worldserver1 = minecraftServer . worldMngr [ j ] ; worldserver1 . levelSaving = true ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { sendNoticeToOps ( s3 , "<STR_LIT>" ) ; for ( int k = <NUM_LIT:0> ; k < minecraftServer . worldMngr . length ; k ++ ) { WorldServer worldserver2 = minecraftServer . worldMngr [ k ] ; worldserver2 . levelSaving = false ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { serverconfigurationmanager . addOp ( s2 ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s2 ) . toString ( ) ) ; serverconfigurationmanager . sendChatMessageToPlayer ( s2 , "<STR_LIT>" ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { String s4 = s2 ; serverconfigurationmanager . removeOp ( s4 ) ; serverconfigurationmanager . sendChatMessageToPlayer ( s4 , "<STR_LIT>" ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s4 ) . toString ( ) ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { String s5 = s2 ; serverconfigurationmanager . banIP ( s5 ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s5 ) . toString ( ) ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { String s6 = s2 ; serverconfigurationmanager . pardonIP ( s6 ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s6 ) . toString ( ) ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { String s7 = s2 ; serverconfigurationmanager . banPlayer ( s7 ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s7 ) . toString ( ) ) ; EntityPlayerMP entityplayermp1 = serverconfigurationmanager . getPlayerEntity ( s7 ) ; if ( entityplayermp1 != null ) { entityplayermp1 . playerNetServerHandler . kickPlayer ( "<STR_LIT>" ) ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { String s8 = s2 ; serverconfigurationmanager . pardonPlayer ( s8 ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s8 ) . toString ( ) ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { String s9 = s2 ; EntityPlayerMP entityplayermp2 = null ; for ( int i1 = <NUM_LIT:0> ; i1 < serverconfigurationmanager . playerEntities . size ( ) ; i1 ++ ) { EntityPlayerMP entityplayermp7 = ( EntityPlayerMP ) serverconfigurationmanager . playerEntities . get ( i1 ) ; if ( entityplayermp7 . username . equalsIgnoreCase ( s9 ) ) { entityplayermp2 = entityplayermp7 ; } } if ( entityplayermp2 != null ) { entityplayermp2 . playerNetServerHandler . kickPlayer ( "<STR_LIT>" ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( entityplayermp2 . username ) . toString ( ) ) ; } else { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s9 ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { if ( as . length == <NUM_LIT:3> ) { EntityPlayerMP entityplayermp = serverconfigurationmanager . getPlayerEntity ( as [ <NUM_LIT:1> ] ) ; EntityPlayerMP entityplayermp3 = serverconfigurationmanager . getPlayerEntity ( as [ <NUM_LIT:2> ] ) ; if ( entityplayermp == null ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:1> ] ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } else if ( entityplayermp3 == null ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:2> ] ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } else if ( entityplayermp . dimension != entityplayermp3 . dimension ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:1> ] ) . append ( "<STR_LIT:U+0020andU+0020>" ) . append ( as [ <NUM_LIT:2> ] ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } else { entityplayermp . playerNetServerHandler . teleportTo ( entityplayermp3 . posX , entityplayermp3 . posY , entityplayermp3 . posZ , entityplayermp3 . rotationYaw , entityplayermp3 . rotationPitch ) ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:1> ] ) . append ( "<STR_LIT:U+0020toU+0020>" ) . append ( as [ <NUM_LIT:2> ] ) . append ( "<STR_LIT:.>" ) . toString ( ) ) ; } } else { icommandlistener . log ( "<STR_LIT>" ) ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { if ( as . length != <NUM_LIT:3> && as . length != <NUM_LIT:4> && as . length != <NUM_LIT:5> ) { return ; } String s10 = as [ <NUM_LIT:1> ] ; EntityPlayerMP entityplayermp4 = serverconfigurationmanager . getPlayerEntity ( s10 ) ; if ( entityplayermp4 != null ) { try { int j1 = Integer . parseInt ( as [ <NUM_LIT:2> ] ) ; if ( Item . itemsList [ j1 ] != null ) { sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( entityplayermp4 . username ) . append ( "<STR_LIT>" ) . append ( j1 ) . toString ( ) ) ; int k2 = <NUM_LIT:1> ; int l2 = <NUM_LIT:0> ; if ( as . length > <NUM_LIT:3> ) { k2 = tryParse ( as [ <NUM_LIT:3> ] , <NUM_LIT:1> ) ; } if ( as . length > <NUM_LIT:4> ) { l2 = tryParse ( as [ <NUM_LIT:4> ] , <NUM_LIT:1> ) ; } if ( k2 < <NUM_LIT:1> ) { k2 = <NUM_LIT:1> ; } if ( k2 > <NUM_LIT> ) { k2 = <NUM_LIT> ; } entityplayermp4 . dropPlayerItem ( new ItemStack ( j1 , k2 , l2 ) ) ; } else { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( j1 ) . toString ( ) ) ; } } catch ( NumberFormatException numberformatexception1 ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:2> ] ) . toString ( ) ) ; } } else { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s10 ) . toString ( ) ) ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { if ( as . length != <NUM_LIT:3> ) { return ; } String s11 = as [ <NUM_LIT:1> ] ; EntityPlayerMP entityplayermp5 = serverconfigurationmanager . getPlayerEntity ( s11 ) ; if ( entityplayermp5 != null ) { try { int k1 = Integer . parseInt ( as [ <NUM_LIT:2> ] ) ; k1 = k1 <= <NUM_LIT> ? k1 : <NUM_LIT> ; sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( k1 ) . append ( "<STR_LIT>" ) . append ( entityplayermp5 . username ) . toString ( ) ) ; entityplayermp5 . addExperience ( k1 ) ; } catch ( NumberFormatException numberformatexception2 ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:2> ] ) . toString ( ) ) ; } } else { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s11 ) . toString ( ) ) ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { if ( as . length != <NUM_LIT:3> ) { return ; } String s12 = as [ <NUM_LIT:1> ] ; EntityPlayerMP entityplayermp6 = serverconfigurationmanager . getPlayerEntity ( s12 ) ; if ( entityplayermp6 != null ) { try { int l1 = Integer . parseInt ( as [ <NUM_LIT:2> ] ) ; l1 = WorldSettings . validGameType ( l1 ) ; if ( entityplayermp6 . itemInWorldManager . getGameType ( ) != l1 ) { sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( entityplayermp6 . username ) . append ( "<STR_LIT>" ) . append ( l1 ) . toString ( ) ) ; entityplayermp6 . itemInWorldManager . toggleGameType ( l1 ) ; entityplayermp6 . playerNetServerHandler . sendPacket ( new Packet70Bed ( <NUM_LIT:3> , l1 ) ) ; } else { sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( entityplayermp6 . username ) . append ( "<STR_LIT>" ) . append ( l1 ) . toString ( ) ) ; } } catch ( NumberFormatException numberformatexception3 ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:2> ] ) . toString ( ) ) ; } } else { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s12 ) . toString ( ) ) ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { if ( as . length != <NUM_LIT:3> ) { return ; } String s13 = as [ <NUM_LIT:1> ] ; try { int l = Integer . parseInt ( as [ <NUM_LIT:2> ] ) ; if ( "<STR_LIT>" . equalsIgnoreCase ( s13 ) ) { for ( int i2 = <NUM_LIT:0> ; i2 < minecraftServer . worldMngr . length ; i2 ++ ) { WorldServer worldserver3 = minecraftServer . worldMngr [ i2 ] ; worldserver3 . advanceTime ( worldserver3 . getWorldTime ( ) + ( long ) l ) ; } sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( l ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } else if ( "<STR_LIT>" . equalsIgnoreCase ( s13 ) ) { for ( int j2 = <NUM_LIT:0> ; j2 < minecraftServer . worldMngr . length ; j2 ++ ) { WorldServer worldserver4 = minecraftServer . worldMngr [ j2 ] ; worldserver4 . advanceTime ( l ) ; } sendNoticeToOps ( s3 , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( l ) . toString ( ) ) ; } else { icommandlistener . log ( "<STR_LIT>" ) ; } } catch ( NumberFormatException numberformatexception ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:2> ] ) . toString ( ) ) ; } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) && s2 . length ( ) > <NUM_LIT:0> ) { minecraftLogger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT:[>" ) . append ( s3 ) . append ( "<STR_LIT>" ) . append ( s2 ) . toString ( ) ) ; serverconfigurationmanager . sendPacketToAllPlayers ( new Packet3Chat ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s2 ) . toString ( ) ) ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { if ( as . length >= <NUM_LIT:3> ) { s = s . substring ( s . indexOf ( "<STR_LIT:U+0020>" ) ) . trim ( ) ; s = s . substring ( s . indexOf ( "<STR_LIT:U+0020>" ) ) . trim ( ) ; minecraftLogger . info ( ( new StringBuilder ( ) ) . append ( "<STR_LIT:[>" ) . append ( s3 ) . append ( "<STR_LIT>" ) . append ( as [ <NUM_LIT:1> ] ) . append ( "<STR_LIT>" ) . append ( s ) . toString ( ) ) ; s = ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s3 ) . append ( "<STR_LIT>" ) . append ( s ) . toString ( ) ; minecraftLogger . info ( s ) ; if ( ! serverconfigurationmanager . sendPacketToPlayer ( as [ <NUM_LIT:1> ] , new Packet3Chat ( s ) ) ) { icommandlistener . log ( "<STR_LIT>" ) ; } } } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { handleWhitelist ( s3 , s , icommandlistener ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { minecraftServer . worldMngr [ <NUM_LIT:0> ] . commandToggleDownfall ( ) ; icommandlistener . log ( "<STR_LIT>" ) ; } else if ( s1 . equalsIgnoreCase ( "<STR_LIT>" ) ) { if ( as . length == <NUM_LIT:2> ) { if ( as [ <NUM_LIT:1> ] . equals ( "<STR_LIT>" ) ) { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( func_40648_a ( minecraftServer . getBannedIPsList ( ) , "<STR_LIT:U+002CU+0020>" ) ) . toString ( ) ) ; } } else { icommandlistener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( func_40648_a ( minecraftServer . getBannedPlayersList ( ) , "<STR_LIT:U+002CU+0020>" ) ) . toString ( ) ) ; } } else { minecraftLogger . info ( "<STR_LIT>" ) ; } } private void handleWhitelist ( String par1Str , String par2Str , ICommandListener par3ICommandListener ) { String as [ ] = par2Str . split ( "<STR_LIT:U+0020>" ) ; if ( as . length < <NUM_LIT:2> ) { return ; } String s = as [ <NUM_LIT:1> ] . toLowerCase ( ) ; if ( "<STR_LIT>" . equals ( s ) ) { sendNoticeToOps ( par1Str , "<STR_LIT>" ) ; minecraftServer . propertyManagerObj . setProperty ( "<STR_LIT>" , true ) ; } else if ( "<STR_LIT>" . equals ( s ) ) { sendNoticeToOps ( par1Str , "<STR_LIT>" ) ; minecraftServer . propertyManagerObj . setProperty ( "<STR_LIT>" , false ) ; } else if ( "<STR_LIT:list>" . equals ( s ) ) { Set set = minecraftServer . configManager . getWhiteListedIPs ( ) ; String s3 = "<STR_LIT>" ; for ( Iterator iterator = set . iterator ( ) ; iterator . hasNext ( ) ; ) { String s4 = ( String ) iterator . next ( ) ; s3 = ( new StringBuilder ( ) ) . append ( s3 ) . append ( s4 ) . append ( "<STR_LIT:U+0020>" ) . toString ( ) ; } par3ICommandListener . log ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s3 ) . toString ( ) ) ; } else if ( "<STR_LIT>" . equals ( s ) && as . length == <NUM_LIT:3> ) { String s1 = as [ <NUM_LIT:2> ] . toLowerCase ( ) ; minecraftServer . configManager . addToWhiteList ( s1 ) ; sendNoticeToOps ( par1Str , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s1 ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } else if ( "<STR_LIT>" . equals ( s ) && as . length == <NUM_LIT:3> ) { String s2 = as [ <NUM_LIT:2> ] . toLowerCase ( ) ; minecraftServer . configManager . removeFromWhiteList ( s2 ) ; sendNoticeToOps ( par1Str , ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s2 ) . append ( "<STR_LIT>" ) . toString ( ) ) ; } else if ( "<STR_LIT>" . equals ( s ) ) { minecraftServer . configManager . reloadWhiteList ( ) ; sendNoticeToOps ( par1Str , "<STR_LIT>" ) ; } } private void printHelp ( ICommandListener par1ICommandListener ) { par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; par1ICommandListener . log ( "<STR_LIT>" ) ; } private void sendNoticeToOps ( String par1Str , String par2Str ) { String s = ( new StringBuilder ( ) ) . append ( par1Str ) . append ( "<STR_LIT::U+0020>" ) . append ( par2Str ) . toString ( ) ; minecraftServer . configManager . sendChatMessageToAllOps ( ( new StringBuilder ( ) ) . append ( "<STR_LIT>" ) . append ( s ) . append ( "<STR_LIT:)>" ) . toString ( ) ) ; minecraftLogger . info ( s ) ; } private int tryParse ( String par1Str , int par2 ) { try { return Integer . parseInt ( par1Str ) ; } catch ( NumberFormatException numberformatexception ) { return par2 ; } } private String func_40648_a ( String par1ArrayOfStr [ ] , String par2Str ) { int i = par1ArrayOfStr . length ; if ( <NUM_LIT:0> == i ) { return "<STR_LIT>" ; } StringBuilder stringbuilder = new StringBuilder ( ) ; stringbuilder . append ( par1ArrayOfStr [ <NUM_LIT:0> ] ) ; for ( int j = <NUM_LIT:1> ; j < i ; j ++ ) { stringbuilder . append ( par2Str ) . append ( par1ArrayOfStr [ j ] ) ; } return stringbuilder . toString ( ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentVillageChurch extends ComponentVillage { private int averageGroundLevel ; public ComponentVillageChurch ( 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 ComponentVillageChurch 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:5> , <NUM_LIT:12> , <NUM_LIT:9> , par5 ) ; if ( ! canVillageGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentVillageChurch ( 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:12> ) - <NUM_LIT:1> , <NUM_LIT:0> ) ; } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:3> , <NUM_LIT:7> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:1> , <NUM_LIT:3> , <NUM_LIT:9> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:8> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:10> , <NUM_LIT:0> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:10> , <NUM_LIT:3> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:10> , <NUM_LIT:3> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:7> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:7> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:8> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:8> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:10> , <NUM_LIT:4> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:5> , <NUM_LIT:5> , <NUM_LIT:3> , <NUM_LIT:5> , <NUM_LIT:7> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:9> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:9> , <NUM_LIT:4> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:4> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:11> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:11> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:11> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:11> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:3> ) , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:3> ) , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:3> ) , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:1> ) , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:0> ) , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:7> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:6> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:7> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:6> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:7> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:8> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . torchWood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:7> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . torchWood . blockID , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . torchWood . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:4> , <NUM_LIT:6> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . torchWood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , <NUM_LIT:5> , par3StructureBoundingBox ) ; int i = getMetadataWithOffset ( Block . ladder . blockID , <NUM_LIT:4> ) ; for ( int j = <NUM_LIT:1> ; j <= <NUM_LIT:9> ; j ++ ) { placeBlockAtCurrentPosition ( par1World , Block . ladder . blockID , i , <NUM_LIT:3> , j , <NUM_LIT:3> , par3StructureBoundingBox ) ; } placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeDoorAtCurrentPosition ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:0> , getMetadataWithOffset ( Block . doorWood . blockID , <NUM_LIT:1> ) ) ; if ( getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:2> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) == <NUM_LIT:0> && getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:2> , - <NUM_LIT:1> , - <NUM_LIT:1> , par3StructureBoundingBox ) != <NUM_LIT:0> ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:3> ) , <NUM_LIT:2> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) ; } for ( int k = <NUM_LIT:0> ; k < <NUM_LIT:9> ; k ++ ) { for ( int l = <NUM_LIT:0> ; l < <NUM_LIT:5> ; l ++ ) { clearCurrentPositionBlocksUpwards ( par1World , l , <NUM_LIT:12> , k , par3StructureBoundingBox ) ; fillCurrentPositionBlocksDownwards ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , l , - <NUM_LIT:1> , k , par3StructureBoundingBox ) ; } } spawnVillagers ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:1> ) ; return true ; } protected int getVillagerType ( int par1 ) { return <NUM_LIT:2> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentVillageHall extends ComponentVillage { private int averageGroundLevel ; public ComponentVillageHall ( 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 ComponentVillageHall 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:9> , <NUM_LIT:7> , <NUM_LIT:11> , par5 ) ; if ( ! canVillageGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentVillageHall ( 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:7> ) - <NUM_LIT:1> , <NUM_LIT:0> ) ; } fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:7> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:6> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:10> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:8> , <NUM_LIT:0> , <NUM_LIT:10> , Block . dirt . blockID , Block . dirt . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:0> , <NUM_LIT:6> , par3StructureBoundingBox ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:10> , Block . fence . blockID , Block . fence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:8> , <NUM_LIT:1> , <NUM_LIT:6> , <NUM_LIT:8> , <NUM_LIT:1> , <NUM_LIT:10> , Block . fence . blockID , Block . fence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:3> , <NUM_LIT:1> , <NUM_LIT:10> , <NUM_LIT:7> , <NUM_LIT:1> , <NUM_LIT:10> , Block . fence . blockID , Block . fence . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:7> , <NUM_LIT:0> , <NUM_LIT:4> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:5> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:8> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:3> , <NUM_LIT:5> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:7> , <NUM_LIT:1> , <NUM_LIT:0> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:7> , <NUM_LIT:1> , <NUM_LIT:5> , Block . cobblestone . blockID , Block . cobblestone . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:0> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:0> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:5> , <NUM_LIT:7> , <NUM_LIT:3> , <NUM_LIT:5> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:1> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:4> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:4> , Block . planks . blockID , Block . planks . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:8> , <NUM_LIT:5> , <NUM_LIT:3> , Block . planks . blockID , Block . planks . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:4> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:4> , <NUM_LIT:3> , par3StructureBoundingBox ) ; int i = getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:3> ) ; int j = getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:2> ) ; for ( int k = - <NUM_LIT:1> ; k <= <NUM_LIT:2> ; k ++ ) { for ( int i1 = <NUM_LIT:0> ; i1 <= <NUM_LIT:8> ; i1 ++ ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , i , i1 , <NUM_LIT:4> + k , k , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , j , i1 , <NUM_LIT:4> + k , <NUM_LIT:5> - k , par3StructureBoundingBox ) ; } } placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . wood . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:8> , <NUM_LIT:2> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:3> , <NUM_LIT:2> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:5> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . thinGlass . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . fence . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . pressurePlatePlanks . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:3> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . planks . blockID , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:3> ) , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairCompactPlanks . blockID , getMetadataWithOffset ( Block . stairCompactPlanks . blockID , <NUM_LIT:1> ) , <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:3> , par3StructureBoundingBox ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:5> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:7> , <NUM_LIT:0> , <NUM_LIT:3> , Block . stairDouble . blockID , Block . stairDouble . blockID , false ) ; placeBlockAtCurrentPosition ( par1World , Block . stairDouble . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . stairDouble . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:2> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:2> , <NUM_LIT:0> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . torchWood . blockID , <NUM_LIT:0> , <NUM_LIT:2> , <NUM_LIT:3> , <NUM_LIT:1> , par3StructureBoundingBox ) ; placeDoorAtCurrentPosition ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT:2> , <NUM_LIT:1> , <NUM_LIT:0> , getMetadataWithOffset ( Block . doorWood . blockID , <NUM_LIT:1> ) ) ; if ( getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:2> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) == <NUM_LIT:0> && getBlockIdAtCurrentPosition ( par1World , <NUM_LIT:2> , - <NUM_LIT:1> , - <NUM_LIT:1> , par3StructureBoundingBox ) != <NUM_LIT:0> ) { placeBlockAtCurrentPosition ( par1World , Block . stairCompactCobblestone . blockID , getMetadataWithOffset ( Block . stairCompactCobblestone . blockID , <NUM_LIT:3> ) , <NUM_LIT:2> , <NUM_LIT:0> , - <NUM_LIT:1> , par3StructureBoundingBox ) ; } placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:2> , <NUM_LIT:5> , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . torchWood . blockID , <NUM_LIT:0> , <NUM_LIT:6> , <NUM_LIT:3> , <NUM_LIT:4> , par3StructureBoundingBox ) ; placeDoorAtCurrentPosition ( par1World , par3StructureBoundingBox , par2Random , <NUM_LIT:6> , <NUM_LIT:1> , <NUM_LIT:5> , getMetadataWithOffset ( Block . doorWood . blockID , <NUM_LIT:1> ) ) ; for ( int l = <NUM_LIT:0> ; l < <NUM_LIT:5> ; l ++ ) { for ( int j1 = <NUM_LIT:0> ; j1 < <NUM_LIT:9> ; j1 ++ ) { clearCurrentPositionBlocksUpwards ( par1World , j1 , <NUM_LIT:7> , l , par3StructureBoundingBox ) ; fillCurrentPositionBlocksDownwards ( par1World , Block . cobblestone . blockID , <NUM_LIT:0> , j1 , - <NUM_LIT:1> , l , par3StructureBoundingBox ) ; } } spawnVillagers ( par1World , par3StructureBoundingBox , <NUM_LIT:4> , <NUM_LIT:1> , <NUM_LIT:2> , <NUM_LIT:2> ) ; return true ; } protected int getVillagerType ( int par1 ) { return par1 != <NUM_LIT:0> ? <NUM_LIT:0> : <NUM_LIT:4> ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class EntitySnowman extends EntityGolem { public EntitySnowman ( World par1World ) { super ( par1World ) ; texture = "<STR_LIT>" ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; getNavigator ( ) . func_48656_a ( true ) ; tasks . addTask ( <NUM_LIT:1> , new EntityAIArrowAttack ( this , <NUM_LIT> , <NUM_LIT:2> , <NUM_LIT:20> ) ) ; tasks . addTask ( <NUM_LIT:2> , new EntityAIWander ( this , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:3> , new EntityAIWatchClosest ( this , net . minecraft . src . EntityPlayer . class , <NUM_LIT> ) ) ; tasks . addTask ( <NUM_LIT:4> , new EntityAILookIdle ( this ) ) ; targetTasks . addTask ( <NUM_LIT:1> , new EntityAINearestAttackableTarget ( this , net . minecraft . src . EntityMob . class , <NUM_LIT> , <NUM_LIT:0> , true ) ) ; } public boolean isAIEnabled ( ) { return true ; } public int getMaxHealth ( ) { return <NUM_LIT:4> ; } public void onLivingUpdate ( ) { super . onLivingUpdate ( ) ; if ( isWet ( ) ) { attackEntityFrom ( DamageSource . drown , <NUM_LIT:1> ) ; } int i = MathHelper . floor_double ( posX ) ; int k = MathHelper . floor_double ( posZ ) ; if ( worldObj . getBiomeGenForCoords ( i , k ) . getFloatTemperature ( ) > <NUM_LIT> ) { attackEntityFrom ( DamageSource . onFire , <NUM_LIT:1> ) ; } for ( int j = <NUM_LIT:0> ; j < <NUM_LIT:4> ; j ++ ) { int l = MathHelper . floor_double ( posX + ( double ) ( ( float ) ( ( j % <NUM_LIT:2> ) * <NUM_LIT:2> - <NUM_LIT:1> ) * <NUM_LIT> ) ) ; int i1 = MathHelper . floor_double ( posY ) ; int j1 = MathHelper . floor_double ( posZ + ( double ) ( ( float ) ( ( ( j / <NUM_LIT:2> ) % <NUM_LIT:2> ) * <NUM_LIT:2> - <NUM_LIT:1> ) * <NUM_LIT> ) ) ; if ( worldObj . getBlockId ( l , i1 , j1 ) == <NUM_LIT:0> && worldObj . getBiomeGenForCoords ( l , j1 ) . getFloatTemperature ( ) < <NUM_LIT> && Block . snow . canPlaceBlockAt ( worldObj , l , i1 , j1 ) ) { worldObj . setBlockWithNotify ( l , i1 , j1 , Block . snow . blockID ) ; } } } public void writeEntityToNBT ( NBTTagCompound par1NBTTagCompound ) { super . writeEntityToNBT ( par1NBTTagCompound ) ; } public void readEntityFromNBT ( NBTTagCompound par1NBTTagCompound ) { super . readEntityFromNBT ( par1NBTTagCompound ) ; } protected int getDropItemId ( ) { return Item . snowball . shiftedIndex ; } protected void dropFewItems ( boolean par1 , int par2 ) { int i = rand . nextInt ( <NUM_LIT:16> ) ; for ( int j = <NUM_LIT:0> ; j < i ; j ++ ) { dropItem ( Item . snowball . shiftedIndex , <NUM_LIT:1> ) ; } } } </s>
|
<s> package net . minecraft . src ; import java . io . ByteArrayOutputStream ; class RegionFileChunkBuffer extends ByteArrayOutputStream { private int chunkX ; private int chunkZ ; final RegionFile regionFile ; public RegionFileChunkBuffer ( RegionFile par1RegionFile , int par2 , int par3 ) { super ( <NUM_LIT> ) ; regionFile = par1RegionFile ; chunkX = par2 ; chunkZ = par3 ; } public void close ( ) { regionFile . write ( chunkX , chunkZ , buf , count ) ; } } </s>
|
<s> package net . minecraft . src ; public class EntityCaveSpider extends EntitySpider { public EntityCaveSpider ( World par1World ) { super ( par1World ) ; texture = "<STR_LIT>" ; setSize ( <NUM_LIT> , <NUM_LIT> ) ; } public int getMaxHealth ( ) { return <NUM_LIT:12> ; } public boolean attackEntityAsMob ( Entity par1Entity ) { if ( super . attackEntityAsMob ( par1Entity ) ) { if ( par1Entity instanceof EntityLiving ) { byte byte0 = <NUM_LIT:0> ; if ( worldObj . difficultySetting > <NUM_LIT:1> ) { if ( worldObj . difficultySetting == <NUM_LIT:2> ) { byte0 = <NUM_LIT:7> ; } else if ( worldObj . difficultySetting == <NUM_LIT:3> ) { byte0 = <NUM_LIT:15> ; } } if ( byte0 > <NUM_LIT:0> ) { ( ( EntityLiving ) par1Entity ) . addPotionEffect ( new PotionEffect ( Potion . poison . id , byte0 * <NUM_LIT:20> , <NUM_LIT:0> ) ) ; } } return true ; } else { return false ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockMushroom extends BlockFlower { protected BlockMushroom ( int par1 , int par2 ) { super ( par1 , par2 ) ; float f = <NUM_LIT> ; setBlockBounds ( <NUM_LIT> - f , <NUM_LIT> , <NUM_LIT> - f , <NUM_LIT> + f , f * <NUM_LIT> , <NUM_LIT> + f ) ; setTickRandomly ( true ) ; } public void updateTick ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { if ( par5Random . nextInt ( <NUM_LIT> ) == <NUM_LIT:0> ) { byte byte0 = <NUM_LIT:4> ; int i = <NUM_LIT:5> ; for ( int j = par2 - byte0 ; j <= par2 + byte0 ; j ++ ) { for ( int l = par4 - byte0 ; l <= par4 + byte0 ; l ++ ) { for ( int j1 = par3 - <NUM_LIT:1> ; j1 <= par3 + <NUM_LIT:1> ; j1 ++ ) { if ( par1World . getBlockId ( j , j1 , l ) == blockID && -- i <= <NUM_LIT:0> ) { return ; } } } } int k = ( par2 + par5Random . nextInt ( <NUM_LIT:3> ) ) - <NUM_LIT:1> ; int i1 = ( par3 + par5Random . nextInt ( <NUM_LIT:2> ) ) - par5Random . nextInt ( <NUM_LIT:2> ) ; int k1 = ( par4 + par5Random . nextInt ( <NUM_LIT:3> ) ) - <NUM_LIT:1> ; for ( int l1 = <NUM_LIT:0> ; l1 < <NUM_LIT:4> ; l1 ++ ) { if ( par1World . isAirBlock ( k , i1 , k1 ) && canBlockStay ( par1World , k , i1 , k1 ) ) { par2 = k ; par3 = i1 ; par4 = k1 ; } k = ( par2 + par5Random . nextInt ( <NUM_LIT:3> ) ) - <NUM_LIT:1> ; i1 = ( par3 + par5Random . nextInt ( <NUM_LIT:2> ) ) - par5Random . nextInt ( <NUM_LIT:2> ) ; k1 = ( par4 + par5Random . nextInt ( <NUM_LIT:3> ) ) - <NUM_LIT:1> ; } if ( par1World . isAirBlock ( k , i1 , k1 ) && canBlockStay ( par1World , k , i1 , k1 ) ) { par1World . setBlockWithNotify ( k , i1 , k1 , blockID ) ; } } } public boolean canPlaceBlockAt ( World par1World , int par2 , int par3 , int par4 ) { return super . canPlaceBlockAt ( par1World , par2 , par3 , par4 ) && canBlockStay ( par1World , par2 , par3 , par4 ) ; } protected boolean canThisPlantGrowOnThisBlockID ( int par1 ) { return Block . opaqueCubeLookup [ par1 ] ; } public boolean canBlockStay ( World par1World , int par2 , int par3 , int par4 ) { if ( par3 < <NUM_LIT:0> || par3 >= <NUM_LIT> ) { return false ; } else { int i = par1World . getBlockId ( par2 , par3 - <NUM_LIT:1> , par4 ) ; return i == Block . mycelium . blockID || par1World . getFullBlockLightValue ( par2 , par3 , par4 ) < <NUM_LIT> && canThisPlantGrowOnThisBlockID ( i ) ; } } public boolean fertilizeMushroom ( World par1World , int par2 , int par3 , int par4 , Random par5Random ) { int i = par1World . getBlockMetadata ( par2 , par3 , par4 ) ; par1World . setBlock ( par2 , par3 , par4 , <NUM_LIT:0> ) ; WorldGenBigMushroom worldgenbigmushroom = null ; if ( blockID == Block . mushroomBrown . blockID ) { worldgenbigmushroom = new WorldGenBigMushroom ( <NUM_LIT:0> ) ; } else if ( blockID == Block . mushroomRed . blockID ) { worldgenbigmushroom = new WorldGenBigMushroom ( <NUM_LIT:1> ) ; } if ( worldgenbigmushroom == null || ! worldgenbigmushroom . generate ( par1World , par5Random , par2 , par3 , par4 ) ) { par1World . setBlockAndMetadata ( par2 , par3 , par4 , blockID , i ) ; return false ; } else { return true ; } } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class BlockMushroomCap extends Block { private int mushroomType ; public BlockMushroomCap ( int par1 , Material par2Material , int par3 , int par4 ) { super ( par1 , par3 , par2Material ) ; mushroomType = par4 ; } public int getBlockTextureFromSideAndMetadata ( int par1 , int par2 ) { if ( par2 == <NUM_LIT:10> && par1 > <NUM_LIT:1> ) { return blockIndexInTexture - <NUM_LIT:1> ; } if ( par2 >= <NUM_LIT:1> && par2 <= <NUM_LIT:9> && par1 == <NUM_LIT:1> ) { return blockIndexInTexture - <NUM_LIT:16> - mushroomType ; } if ( par2 >= <NUM_LIT:1> && par2 <= <NUM_LIT:3> && par1 == <NUM_LIT:2> ) { return blockIndexInTexture - <NUM_LIT:16> - mushroomType ; } if ( par2 >= <NUM_LIT:7> && par2 <= <NUM_LIT:9> && par1 == <NUM_LIT:3> ) { return blockIndexInTexture - <NUM_LIT:16> - mushroomType ; } if ( ( par2 == <NUM_LIT:1> || par2 == <NUM_LIT:4> || par2 == <NUM_LIT:7> ) && par1 == <NUM_LIT:4> ) { return blockIndexInTexture - <NUM_LIT:16> - mushroomType ; } if ( ( par2 == <NUM_LIT:3> || par2 == <NUM_LIT:6> || par2 == <NUM_LIT:9> ) && par1 == <NUM_LIT:5> ) { return blockIndexInTexture - <NUM_LIT:16> - mushroomType ; } if ( par2 == <NUM_LIT> ) { return blockIndexInTexture - <NUM_LIT:16> - mushroomType ; } if ( par2 == <NUM_LIT:15> ) { return blockIndexInTexture - <NUM_LIT:1> ; } else { return blockIndexInTexture ; } } public int quantityDropped ( Random par1Random ) { int i = par1Random . nextInt ( <NUM_LIT:10> ) - <NUM_LIT:7> ; if ( i < <NUM_LIT:0> ) { i = <NUM_LIT:0> ; } return i ; } public int idDropped ( int par1 , Random par2Random , int par3 ) { return Block . mushroomBrown . blockID + mushroomType ; } } </s>
|
<s> package net . minecraft . src ; import java . util . List ; import java . util . Random ; public class ComponentVillageField extends ComponentVillage { private int averageGroundLevel ; public ComponentVillageField ( 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 ComponentVillageField 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> , <NUM_LIT:4> , <NUM_LIT:9> , par5 ) ; if ( ! canVillageGoDeeper ( structureboundingbox ) || StructureComponent . findIntersecting ( par0List , structureboundingbox ) != null ) { return null ; } else { return new ComponentVillageField ( 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:12> , <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:7> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:8> , <NUM_LIT:0> , <NUM_LIT:7> , Block . tilledField . blockID , Block . tilledField . blockID , false ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:10> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:11> , <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:12> , <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:12> , <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:11> , <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:11> , <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 ) ; fillWithBlocks ( par1World , par3StructureBoundingBox , <NUM_LIT:9> , <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:9> , <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 ) ; placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:7> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:8> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:10> , <NUM_LIT:1> , i , par3StructureBoundingBox ) ; placeBlockAtCurrentPosition ( par1World , Block . crops . blockID , MathHelper . getRandomIntegerInRange ( par2Random , <NUM_LIT:2> , <NUM_LIT:7> ) , <NUM_LIT:11> , <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> ; 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 abstract class EntityWeatherEffect extends Entity { public EntityWeatherEffect ( World par1World ) { super ( par1World ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class ItemFood extends Item { public final int field_35427_a = <NUM_LIT:32> ; private final int healAmount ; private final float saturationModifier ; private final boolean isWolfsFavoriteMeat ; private boolean alwaysEdible ; private int potionId ; private int potionDuration ; private int potionAmplifier ; private float potionEffectProbability ; public ItemFood ( int par1 , int par2 , float par3 , boolean par4 ) { super ( par1 ) ; healAmount = par2 ; isWolfsFavoriteMeat = par4 ; saturationModifier = par3 ; } public ItemFood ( int par1 , int par2 , boolean par3 ) { this ( par1 , par2 , <NUM_LIT> , par3 ) ; } public ItemStack onFoodEaten ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { par1ItemStack . stackSize -- ; par3EntityPlayer . getFoodStats ( ) . addStats ( this ) ; par2World . playSoundAtEntity ( par3EntityPlayer , "<STR_LIT>" , <NUM_LIT> , par2World . rand . nextFloat ( ) * <NUM_LIT> + <NUM_LIT> ) ; if ( ! par2World . isRemote && potionId > <NUM_LIT:0> && par2World . rand . nextFloat ( ) < potionEffectProbability ) { par3EntityPlayer . addPotionEffect ( new PotionEffect ( potionId , potionDuration * <NUM_LIT:20> , potionAmplifier ) ) ; } return par1ItemStack ; } public int getMaxItemUseDuration ( ItemStack par1ItemStack ) { return <NUM_LIT:32> ; } public EnumAction getItemUseAction ( ItemStack par1ItemStack ) { return EnumAction . eat ; } public ItemStack onItemRightClick ( ItemStack par1ItemStack , World par2World , EntityPlayer par3EntityPlayer ) { if ( par3EntityPlayer . canEat ( alwaysEdible ) ) { par3EntityPlayer . setItemInUse ( par1ItemStack , getMaxItemUseDuration ( par1ItemStack ) ) ; } return par1ItemStack ; } public int getHealAmount ( ) { return healAmount ; } public float getSaturationModifier ( ) { return saturationModifier ; } public boolean isWolfsFavoriteMeat ( ) { return isWolfsFavoriteMeat ; } public ItemFood setPotionEffect ( int par1 , int par2 , int par3 , float par4 ) { potionId = par1 ; potionDuration = par2 ; potionAmplifier = par3 ; potionEffectProbability = par4 ; return this ; } public ItemFood setAlwaysEdible ( ) { alwaysEdible = true ; return this ; } public Item setItemName ( String par1Str ) { return super . setItemName ( par1Str ) ; } } </s>
|
<s> package net . minecraft . src ; import java . util . Random ; public class WorldGenTrees extends WorldGenerator { private final int field_48402_a ; private final boolean field_48400_b ; private final int field_48401_c ; private final int field_48399_d ; public WorldGenTrees ( boolean par1 ) { this ( par1 , <NUM_LIT:4> , <NUM_LIT:0> , <NUM_LIT:0> , false ) ; } public WorldGenTrees ( boolean par1 , int par2 , int par3 , int par4 , boolean par5 ) { super ( par1 ) ; field_48402_a = par2 ; field_48401_c = par3 ; field_48399_d = par4 ; field_48400_b = par5 ; } public boolean generate ( World par1World , Random par2Random , int par3 , int par4 , int par5 ) { int i = par2Random . nextInt ( <NUM_LIT:3> ) + field_48402_a ; boolean flag = true ; if ( par4 < <NUM_LIT:1> || par4 + i + <NUM_LIT:1> > <NUM_LIT> ) { return false ; } for ( int j = par4 ; j <= par4 + <NUM_LIT:1> + i ; j ++ ) { byte byte0 = <NUM_LIT:1> ; if ( j == par4 ) { byte0 = <NUM_LIT:0> ; } if ( j >= ( par4 + <NUM_LIT:1> + i ) - <NUM_LIT:2> ) { byte0 = <NUM_LIT:2> ; } for ( int l = par3 - byte0 ; l <= par3 + byte0 && flag ; l ++ ) { for ( int j1 = par5 - byte0 ; j1 <= par5 + byte0 && flag ; j1 ++ ) { if ( j >= <NUM_LIT:0> && j < <NUM_LIT> ) { int j2 = par1World . getBlockId ( l , j , j1 ) ; if ( j2 != <NUM_LIT:0> && j2 != Block . leaves . blockID && j2 != Block . grass . blockID && j2 != Block . dirt . blockID && j2 != Block . wood . blockID ) { flag = false ; } } else { flag = false ; } } } } if ( ! flag ) { return false ; } int k = par1World . getBlockId ( par3 , par4 - <NUM_LIT:1> , par5 ) ; if ( k != Block . grass . blockID && k != Block . dirt . blockID || par4 >= <NUM_LIT> - i - <NUM_LIT:1> ) { return false ; } func_50023_a ( par1World , par3 , par4 - <NUM_LIT:1> , par5 , Block . dirt . blockID ) ; byte byte1 = <NUM_LIT:3> ; int i1 = <NUM_LIT:0> ; for ( int k1 = ( par4 - byte1 ) + i ; k1 <= par4 + i ; k1 ++ ) { int k2 = k1 - ( par4 + i ) ; int j3 = ( i1 + <NUM_LIT:1> ) - k2 / <NUM_LIT:2> ; for ( int l3 = par3 - j3 ; l3 <= par3 + j3 ; l3 ++ ) { int j4 = l3 - par3 ; for ( int l4 = par5 - j3 ; l4 <= par5 + j3 ; l4 ++ ) { int i5 = l4 - par5 ; if ( ( Math . abs ( j4 ) != j3 || Math . abs ( i5 ) != j3 || par2Random . nextInt ( <NUM_LIT:2> ) != <NUM_LIT:0> && k2 != <NUM_LIT:0> ) && ! Block . opaqueCubeLookup [ par1World . getBlockId ( l3 , k1 , l4 ) ] ) { setBlockAndMetadata ( par1World , l3 , k1 , l4 , Block . leaves . blockID , field_48399_d ) ; } } } } for ( int l1 = <NUM_LIT:0> ; l1 < i ; l1 ++ ) { int l2 = par1World . getBlockId ( par3 , par4 + l1 , par5 ) ; if ( l2 != <NUM_LIT:0> && l2 != Block . leaves . blockID ) { continue ; } setBlockAndMetadata ( par1World , par3 , par4 + l1 , par5 , Block . wood . blockID , field_48401_c ) ; if ( ! field_48400_b || l1 <= <NUM_LIT:0> ) { continue ; } if ( par2Random . nextInt ( <NUM_LIT:3> ) > <NUM_LIT:0> && par1World . isAirBlock ( par3 - <NUM_LIT:1> , par4 + l1 , par5 ) ) { setBlockAndMetadata ( par1World , par3 - <NUM_LIT:1> , par4 + l1 , par5 , Block . vine . blockID , <NUM_LIT:8> ) ; } if ( par2Random . nextInt ( <NUM_LIT:3> ) > <NUM_LIT:0> && par1World . isAirBlock ( par3 + <NUM_LIT:1> , par4 + l1 , par5 ) ) { setBlockAndMetadata ( par1World , par3 + <NUM_LIT:1> , par4 + l1 , par5 , Block . vine . blockID , <NUM_LIT:2> ) ; } if ( par2Random . nextInt ( <NUM_LIT:3> ) > <NUM_LIT:0> && par1World . isAirBlock ( par3 , par4 + l1 , par5 - <NUM_LIT:1> ) ) { setBlockAndMetadata ( par1World , par3 , par4 + l1 , par5 - <NUM_LIT:1> , Block . vine . blockID , <NUM_LIT:1> ) ; } if ( par2Random . nextInt ( <NUM_LIT:3> ) > <NUM_LIT:0> && par1World . isAirBlock ( par3 , par4 + l1 , par5 + <NUM_LIT:1> ) ) { setBlockAndMetadata ( par1World , par3 , par4 + l1 , par5 + <NUM_LIT:1> , Block . vine . blockID , <NUM_LIT:4> ) ; } } if ( field_48400_b ) { for ( int i2 = ( par4 - <NUM_LIT:3> ) + i ; i2 <= par4 + i ; i2 ++ ) { int i3 = i2 - ( par4 + i ) ; int k3 = <NUM_LIT:2> - i3 / <NUM_LIT:2> ; for ( int i4 = par3 - k3 ; i4 <= par3 + k3 ; i4 ++ ) { for ( int k4 = par5 - k3 ; k4 <= par5 + k3 ; k4 ++ ) { if ( par1World . getBlockId ( i4 , i2 , k4 ) != Block . leaves . blockID ) { continue ; } if ( par2Random . nextInt ( <NUM_LIT:4> ) == <NUM_LIT:0> && par1World . getBlockId ( i4 - <NUM_LIT:1> , i2 , k4 ) == <NUM_LIT:0> ) { func_48398_a ( par1World , i4 - <NUM_LIT:1> , i2 , k4 , <NUM_LIT:8> ) ; } if ( par2Random . nextInt ( <NUM_LIT:4> ) == <NUM_LIT:0> && par1World . getBlockId ( i4 + <NUM_LIT:1> , i2 , k4 ) == <NUM_LIT:0> ) { func_48398_a ( par1World , i4 + <NUM_LIT:1> , i2 , k4 , <NUM_LIT:2> ) ; } if ( par2Random . nextInt ( <NUM_LIT:4> ) == <NUM_LIT:0> && par1World . getBlockId ( i4 , i2 , k4 - <NUM_LIT:1> ) == <NUM_LIT:0> ) { func_48398_a ( par1World , i4 , i2 , k4 - <NUM_LIT:1> , <NUM_LIT:1> ) ; } if ( par2Random . nextInt ( <NUM_LIT:4> ) == <NUM_LIT:0> && par1World . getBlockId ( i4 , i2 , k4 + <NUM_LIT:1> ) == <NUM_LIT:0> ) { func_48398_a ( par1World , i4 , i2 , k4 + <NUM_LIT:1> , <NUM_LIT:4> ) ; } } } } } return true ; } private void func_48398_a ( World par1World , int par2 , int par3 , int par4 , int par5 ) { setBlockAndMetadata ( par1World , par2 , par3 , par4 , Block . vine . blockID , par5 ) ; for ( int i = <NUM_LIT:4> ; par1World . getBlockId ( par2 , -- par3 , par4 ) == <NUM_LIT:0> && i > <NUM_LIT:0> ; i -- ) { setBlockAndMetadata ( par1World , par2 , par3 , par4 , Block . vine . blockID , par5 ) ; } } } </s>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.