Delete server source

This commit is contained in:
PeytonPlayz595 2024-10-14 22:41:43 -04:00
parent 1d73282fde
commit f2b069b007
310 changed files with 0 additions and 27656 deletions
minecraft_server
.classpath.projectAlpha.jarServer.launch
jars
src/net
PeytonPlayz585
PeytonPlayzt585/entity
minecraft
server
src

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="Minecraft Server/libraries/natives"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar" sourcepath="libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5-sources.jar"/>
<classpathentry kind="lib" path="libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar" sourcepath="libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0-sources.jar"/>
<classpathentry kind="lib" path="libraries/org/lwjgl/lwjgl/lwjgl/2.9.4/lwjgl-2.9.4.jar" sourcepath="libraries/org/lwjgl/lwjgl/lwjgl/2.9.4/lwjgl-2.9.4-sources.jar"/>
<classpathentry kind="lib" path="libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.4/lwjgl_util-2.9.4.jar" sourcepath="libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.4/lwjgl_util-2.9.4-sources.jar"/>
<classpathentry kind="lib" path="libraries/org/mcphackers/launchwrapper/1.0/launchwrapper-1.0.jar" sourcepath="libraries/org/mcphackers/launchwrapper/1.0/launchwrapper-1.0-sources.jar"/>
<classpathentry kind="lib" path="libraries/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar" sourcepath="libraries/org/ow2/asm/asm-tree/9.2/asm-tree-9.2-sources.jar"/>
<classpathentry kind="lib" path="libraries/org/ow2/asm/asm/9.2/asm-9.2.jar" sourcepath="libraries/org/ow2/asm/asm/9.2/asm-9.2-sources.jar"/>
<classpathentry kind="lib" path="libraries/org/json/json/20230311/json-20230311.jar" sourcepath="libraries/org/json/json/20230311/json-20230311-sources.jar"/>
<classpathentry kind="lib" path="libraries/com/paulscode/codecjorbis/20230120/codecjorbis-20230120.jar" sourcepath="libraries/com/paulscode/codecjorbis/20230120/codecjorbis-20230120-sources.jar"/>
<classpathentry kind="lib" path="libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar" sourcepath="libraries/com/paulscode/codecwav/20101023/codecwav-20101023-sources.jar"/>
<classpathentry kind="lib" path="libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar" sourcepath="libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar-sources"/>
<classpathentry kind="lib" path="libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar" sourcepath="libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824-sources.jar"/>
<classpathentry kind="lib" path="libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar" sourcepath="libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107-sources.jar"/>
<classpathentry kind="lib" path="libraries/org/mcphackers/rdi/rdi/1.0/rdi-1.0.jar" sourcepath="libraries/org/mcphackers/rdi/rdi/1.0/rdi-1.0-sources.jar"/>
<classpathentry kind="lib" path="jars/deobfuscated.jar" sourcepath="jars/deobfuscated-source.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="output"/>
</classpath>

View File

@ -1,53 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Minecraft Server</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<linkedResources>
<link>
<name>libraries</name>
<type>2</type>
<locationURI>$%7BPARENT-1-PROJECT_LOC%7D/libraries</locationURI>
</link>
</linkedResources>
<filteredResources>
<filter>
<id>-1002749744921918690</id>
<name></name>
<type>9</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-src</arguments>
</matcher>
</filter>
<filter>
<id>-1002749744921918689</id>
<name></name>
<type>9</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-jars</arguments>
</matcher>
</filter>
<filter>
<id>-1002749744921918688</id>
<name></name>
<type>9</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-false-source</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

Binary file not shown.

View File

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/Minecraft Server"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_ATTR_USE_ARGFILE" value="false"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_SHOW_CODEDETAILS_IN_EXCEPTION_MESSAGES" value="true"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="net.minecraft.server.MinecraftServer"/>
<stringAttribute key="org.eclipse.jdt.launching.MODULE_NAME" value="Minecraft Server"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Minecraft Server"/>
</launchConfiguration>

View File

@ -1,37 +0,0 @@
package net.PeytonPlayz585;
public class Location {
private double x,y,z;
public Location(int x, int y, int z) {
this.x = x;
this.y = y;
this.z = z;
}
public Location(double x, double y, double z) {
this.x = x;
this.y = y;
this.z = z;
}
public Location(float x, float y, float z) {
this.x = x;
this.y = y;
this.z = z;
}
public double getX() {
return this.x;
}
public double getY() {
return this.y;
}
public double getZ() {
return this.z;
}
}

View File

@ -1,69 +0,0 @@
package net.PeytonPlayz585;
import java.util.logging.Logger;
import net.minecraft.server.MinecraftServer;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.EntityPlayerMP;
public class Server {
public static String getName() {
return "Vanilla Server";
}
public static String getVersion() {
return "Alpha v1.2.6";
}
public static EntityPlayer[] getOnlinePlayers() {
return (EntityPlayer[])MinecraftServer.configManager.playerEntities.toArray(new EntityPlayerMP[MinecraftServer.configManager.playerEntities.size()]);
}
public static int getMaxPlayers() {
return MinecraftServer.configManager.maxPlayers;
}
public static int getPort() {
return MinecraftServer.port == 0 ? 25565 : MinecraftServer.port;
}
public static String getIP() {
if(MinecraftServer.serverIP == null) {
return "localhost";
}
return MinecraftServer.serverIP;
}
public static String getLevelName() {
if(MinecraftServer.levelName == null) {
return "world";
}
return MinecraftServer.levelName;
}
public static void broadcastMessage(String message) {
MinecraftServer.configManager.sendChatMessageToAllPlayers("\u00a77(" + message + ")");
}
public static EntityPlayer getPlayerByName(String name) {
for(int var1 = 0; var1 < MinecraftServer.configManager.playerEntities.size(); ++var1) {
EntityPlayerMP player = (EntityPlayerMP)MinecraftServer.configManager.playerEntities.get(var1);
if(player.username.equalsIgnoreCase(name)) {
return player;
}
}
return null;
}
public static void savePlayers() {
if(MinecraftServer.configManager != null) {
MinecraftServer.configManager.savePlayerStates();
}
}
public static Logger getLogger() {
return MinecraftServer.logger;
}
}

View File

@ -1,5 +0,0 @@
package net.PeytonPlayz585;
public enum TreeType {
TREE, BIG_TREE;
}

View File

@ -1,123 +0,0 @@
package net.PeytonPlayz585;
import java.util.ArrayList;
import java.util.List;
import net.PeytonPlayzt585.entity.CreatureType;
import net.minecraft.server.MinecraftServer;
import net.minecraft.src.Block;
import net.minecraft.src.Chunk;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityLiving;
import net.minecraft.src.EntityPlayer;
import net.minecraft.src.IProgressUpdate;
import net.minecraft.src.WorldProvider;
public class World {
public static Block getBlockAt(Location location) {
return Block.blocksList[MinecraftServer.worldMngr.getBlockId((int)location.getX(), (int)location.getY(), (int)location.getZ())];
}
public static Chunk getChunkFromBlockCoords(Location location) {
return MinecraftServer.worldMngr.getChunkFromBlockCoords((int)location.getX(), (int)location.getZ());
}
public static Chunk getChunkFromChunkCoords(Location location) {
return MinecraftServer.worldMngr.getChunkFromChunkCoords((int)location.getX(), (int)location.getZ());
}
public static boolean isChunkLoaded(Location location) {
Chunk chunk = getChunkFromChunkCoords(location);
if(chunk == null) {
chunk = getChunkFromBlockCoords(location);
if(chunk == null) {
return false;
}
}
return chunk.func_347_a();
}
public static boolean loadChunk(Location location, boolean var1) {
Chunk chunk = MinecraftServer.worldMngr.A.loadChunk((int)location.getX(), (int)location.getZ());
if(chunk == null) {
return false;
}
return true;
}
public static void spawnCreature(CreatureType type, Location location) {
Entity entity = type.nameToEntity(type.name());
entity.func_107_c(location.getX(), location.getY(), location.getZ(), MinecraftServer.worldMngr.rand.nextFloat() * 360.0F, 0.0F);
MinecraftServer.worldMngr.entityJoinedWorld(entity);
}
public static List<Entity> getEntities() {
List<Entity> list = new ArrayList<Entity>();
for(int i = 0; i > MinecraftServer.worldMngr.field_815_a.size(); i++) {
Entity entity = (Entity)MinecraftServer.worldMngr.field_815_a.get(i);
if(entity != null) {
list.add(entity);
}
}
return list;
}
public static List<EntityLiving> getLivingEntities() {
List<EntityLiving> list = new ArrayList<EntityLiving>();
for(int i = 0; i > MinecraftServer.worldMngr.field_815_a.size(); i++) {
Entity entity = (Entity)MinecraftServer.worldMngr.field_815_a.get(i);
if(entity != null) {
if(entity instanceof EntityLiving) {
list.add((EntityLiving)entity);
}
}
}
return list;
}
public static Location getSpawnLocation() {
int x = MinecraftServer.worldMngr.spawnX;
int y = MinecraftServer.worldMngr.spawnY;
int z = MinecraftServer.worldMngr.spawnZ;
return new Location(x, y, z);
}
public static void setSpawnLocation(Location location) {
MinecraftServer.worldMngr.spawnX = (int) location.getX();
MinecraftServer.worldMngr.spawnY = (int) location.getY();
MinecraftServer.worldMngr.spawnZ = (int) location.getZ();
}
public static long getWorldTime() {
return MinecraftServer.worldMngr.worldTime;
}
public static void setWorldTime(long time) {
MinecraftServer.worldMngr.worldTime = time;
}
public static void saveWorld() {
MinecraftServer.logger.info("Saving World!");
if(MinecraftServer.configManager != null) {
MinecraftServer.configManager.savePlayerStates();
}
MinecraftServer.worldMngr.func_485_a(true, (IProgressUpdate)null);
}
public static Environment getEnvironment() {
if(WorldProvider.dimension == 0) {
return Environment.NORMAL;
} else {
return Environment.NETHER;
}
}
public enum Environment {
NORMAL, NETHER;
}
}

View File

@ -1,11 +0,0 @@
package net.PeytonPlayz585.events.chunk;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ChunkLoadEvent {
}

View File

@ -1,12 +0,0 @@
package net.PeytonPlayz585.events.chunk;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface ChunkUnloadEvent {
}

View File

@ -1,87 +0,0 @@
package net.PeytonPlayzt585.entity;
import java.lang.reflect.InvocationTargetException;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.server.MinecraftServer;
import net.minecraft.src.Entity;
import net.minecraft.src.EntityChicken;
import net.minecraft.src.EntityCow;
import net.minecraft.src.EntityCreeper;
import net.minecraft.src.EntityGhast;
import net.minecraft.src.EntityPig;
import net.minecraft.src.EntitySheep;
import net.minecraft.src.EntitySkeleton;
import net.minecraft.src.EntitySlime;
import net.minecraft.src.EntitySpider;
import net.minecraft.src.EntityZombie;
import net.minecraft.src.World;
public enum CreatureType {
CHICKEN("Chicken"),
COW("Cow"),
CREEPER("Creeper"),
GHAST("Ghast"),
PIG("Pig"),
SHEEP("Sheep"),
SKELETON("Skeleton"),
SLIME("Slime"),
SPIDER("Spider"),
ZOMBIE("Zombie");
private String name;
private static final Map<String, CreatureType> mapping;
static {
mapping = new HashMap<String, CreatureType>();
for (CreatureType type : EnumSet.<CreatureType>allOf(CreatureType.class))
mapping.put(type.name, type);
}
CreatureType(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
public Entity nameToEntity(String name) {
try {
if(name.equals("Chicken")) {
return EntityChicken.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Cow")) {
return EntityCow.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Creeper")) {
return EntityCreeper.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Ghast")) {
return EntityGhast.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Pig")) {
return EntityPig.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Sheep")) {
return EntitySheep.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Skeleton")) {
return EntitySkeleton.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Slime")) {
return EntitySlime.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Spider")) {
return EntitySpider.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
} else if(name.equals("Zombie")) {
return EntityZombie.class.getConstructor(new Class[]{World.class}).newInstance(new Object[]{MinecraftServer.worldMngr});
}
} catch(InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException e) {
System.err.println("Error mapping entity name to class!");
return null;
}
System.err.println("Entity (" + name + ") not found!");
return null;
}
public static CreatureType fromName(String name) {
return mapping.get(name);
}
}

View File

@ -1,521 +0,0 @@
package net.minecraft.server;
import java.awt.GraphicsEnvironment;
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.logging.Level;
import java.util.logging.Logger;
import net.minecraft.src.AxisAlignedBB;
import net.minecraft.src.ConsoleLogManager;
import net.minecraft.src.EntityPlayerMP;
import net.minecraft.src.EntityTracker;
import net.minecraft.src.ICommandListener;
import net.minecraft.src.IProgressUpdate;
import net.minecraft.src.IUpdatePlayerListBox;
import net.minecraft.src.Item;
import net.minecraft.src.ItemStack;
import net.minecraft.src.NetworkListenThread;
import net.minecraft.src.Packet3Chat;
import net.minecraft.src.Packet4UpdateTime;
import net.minecraft.src.PropertyManager;
import net.minecraft.src.ServerCommand;
import net.minecraft.src.ServerConfigurationManager;
import net.minecraft.src.ServerGUI;
import net.minecraft.src.ThreadCommandReader;
import net.minecraft.src.ThreadServerApplication;
import net.minecraft.src.ThreadSleepForever;
import net.minecraft.src.Vec3D;
import net.minecraft.src.WorldManager;
import net.minecraft.src.WorldServer;
public class MinecraftServer implements ICommandListener, Runnable {
public static Logger logger = Logger.getLogger("Minecraft");
public static HashMap field_6037_b = new HashMap();
public NetworkListenThread field_6036_c;
public PropertyManager propertyManagerObj;
public static WorldServer worldMngr;
public static ServerConfigurationManager configManager;
private boolean field_6025_n = true;
public boolean field_6032_g = false;
int field_9014_h = 0;
public String field_9013_i;
public int field_9012_j;
private List field_9010_p = new ArrayList();
private List commands = Collections.synchronizedList(new ArrayList());
public EntityTracker field_6028_k;
public boolean onlineMode;
public boolean noAnimals;
public boolean field_9011_n;
public static int port = 0;
public static String levelName = null;
public static String serverIP = null;
public MinecraftServer() {
new ThreadSleepForever(this);
}
private boolean func_6008_d() throws UnknownHostException {
ThreadCommandReader var1 = new ThreadCommandReader(this);
var1.setDaemon(true);
var1.start();
ConsoleLogManager.init();
logger.info("Starting minecraft server version 0.2.8");
if(Runtime.getRuntime().maxMemory() / 1024L / 1024L < 512L) {
logger.warning("**** NOT ENOUGH RAM!");
logger.warning("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
logger.info("Loading properties");
this.propertyManagerObj = new PropertyManager(new File("server.properties"));
String var2 = this.propertyManagerObj.getStringProperty("server-ip", "");
this.onlineMode = this.propertyManagerObj.getBooleanProperty("online-mode", true);
this.noAnimals = this.propertyManagerObj.getBooleanProperty("spawn-animals", true);
this.field_9011_n = this.propertyManagerObj.getBooleanProperty("pvp", true);
InetAddress var3 = null;
if(var2.length() > 0) {
var3 = InetAddress.getByName(var2);
serverIP = var3.toString();
}
int var4 = this.propertyManagerObj.getIntProperty("server-port", 25565);
port = var4;
logger.info("Starting Minecraft server on " + (var2.length() == 0 ? "*" : var2) + ":" + var4);
try {
this.field_6036_c = new NetworkListenThread(this, var3, var4);
} catch (IOException var6) {
logger.warning("**** FAILED TO BIND TO PORT!");
logger.log(Level.WARNING, "The exception was: " + var6.toString());
logger.warning("Perhaps a server is already running on that port?");
return false;
}
if(!this.onlineMode) {
logger.warning("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
logger.warning("The server will make no attempt to authenticate usernames. Beware.");
logger.warning("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
logger.warning("To change this, set \"online-mode\" to \"true\" in the server.settings file.");
}
this.configManager = new ServerConfigurationManager(this);
this.field_6028_k = new EntityTracker(this);
String var5 = this.propertyManagerObj.getStringProperty("level-name", "world");
levelName = var5;
logger.info("Preparing level \"" + var5 + "\"");
this.func_6017_c(var5);
logger.info("Done! For help, type \"help\" or \"?\"");
return true;
}
private void func_6017_c(String var1) {
logger.info("Preparing start region");
this.worldMngr = new WorldServer(this, new File("."), var1, this.propertyManagerObj.getBooleanProperty("hellworld", false) ? -1 : 0);
this.worldMngr.func_4072_a(new WorldManager(this));
this.worldMngr.monstersEnabled = this.propertyManagerObj.getBooleanProperty("spawn-monsters", true) ? 1 : 0;
this.configManager.setPlayerManager(this.worldMngr);
byte var2 = 20;
for(int var3 = -var2; var3 <= var2; ++var3) {
this.func_6019_a("Preparing spawn area", (var3 + var2) * 100 / (var2 + var2 + 1));
for(int var4 = -var2; var4 <= var2; ++var4) {
if(!this.field_6025_n) {
return;
}
this.worldMngr.A.loadChunk((this.worldMngr.spawnX >> 4) + var3, (this.worldMngr.spawnZ >> 4) + var4);
}
}
this.func_6011_e();
}
private void func_6019_a(String var1, int var2) {
this.field_9013_i = var1;
this.field_9012_j = var2;
System.out.println(var1 + ": " + var2 + "%");
}
private void func_6011_e() {
this.field_9013_i = null;
this.field_9012_j = 0;
}
private void saveServerWorld() {
logger.info("Saving chunks");
this.worldMngr.func_485_a(true, (IProgressUpdate)null);
}
private void func_6013_g() {
logger.info("Stopping server");
if(this.configManager != null) {
this.configManager.savePlayerStates();
}
if(this.worldMngr != null) {
this.saveServerWorld();
}
}
public void func_6016_a() {
this.field_6025_n = false;
}
public void run() {
try {
if(this.func_6008_d()) {
long var1 = System.currentTimeMillis();
long var3 = 0L;
while(this.field_6025_n) {
long var5 = System.currentTimeMillis();
long var7 = var5 - var1;
if(var7 > 2000L) {
logger.warning("Can\'t keep up! Did the system time change, or is the server overloaded?");
var7 = 2000L;
}
if(var7 < 0L) {
logger.warning("Time ran backwards! Did the system time change?");
var7 = 0L;
}
var3 += var7;
var1 = var5;
while(var3 > 50L) {
var3 -= 50L;
this.func_6018_h();
}
Thread.sleep(1L);
}
} else {
while(this.field_6025_n) {
this.commandLineParser();
try {
Thread.sleep(10L);
} catch (InterruptedException var15) {
var15.printStackTrace();
}
}
}
} catch (Exception var16) {
var16.printStackTrace();
logger.log(Level.SEVERE, "Unexpected exception", var16);
while(this.field_6025_n) {
this.commandLineParser();
try {
Thread.sleep(10L);
} catch (InterruptedException var14) {
var14.printStackTrace();
}
}
} finally {
this.func_6013_g();
this.field_6032_g = true;
System.exit(0);
}
}
private void func_6018_h() {
ArrayList var1 = new ArrayList();
Iterator var2 = field_6037_b.keySet().iterator();
while(var2.hasNext()) {
String var3 = (String)var2.next();
int var4 = ((Integer)field_6037_b.get(var3)).intValue();
if(var4 > 0) {
field_6037_b.put(var3, Integer.valueOf(var4 - 1));
} else {
var1.add(var3);
}
}
int var6;
for(var6 = 0; var6 < var1.size(); ++var6) {
field_6037_b.remove(var1.get(var6));
}
AxisAlignedBB.clearBoundingBoxPool();
Vec3D.initialize();
++this.field_9014_h;
if(this.field_9014_h % 20 == 0) {
this.configManager.sendPacketToAllPlayers(new Packet4UpdateTime(this.worldMngr.worldTime));
}
this.worldMngr.tick();
while(this.worldMngr.func_6156_d()) {
}
this.worldMngr.func_459_b();
this.field_6036_c.func_715_a();
this.configManager.func_637_b();
this.field_6028_k.func_607_a();
for(var6 = 0; var6 < this.field_9010_p.size(); ++var6) {
((IUpdatePlayerListBox)this.field_9010_p.get(var6)).update();
}
try {
this.commandLineParser();
} catch (Exception var5) {
logger.log(Level.WARNING, "Unexpected exception while parsing console command", var5);
}
}
public void addCommand(String var1, ICommandListener var2) {
this.commands.add(new ServerCommand(var1, var2));
}
public void commandLineParser() {
while(this.commands.size() > 0) {
ServerCommand var1 = (ServerCommand)this.commands.remove(0);
String var2 = var1.command;
ICommandListener var3 = var1.commandListener;
String var4 = var3.getUsername();
if(!var2.toLowerCase().startsWith("help") && !var2.toLowerCase().startsWith("?")) {
if(var2.toLowerCase().startsWith("list")) {
var3.log("Connected players: " + this.configManager.getPlayerList());
} else if(var2.toLowerCase().startsWith("stop")) {
this.func_6014_a(var4, "Stopping the server..");
this.field_6025_n = false;
} else if(var2.toLowerCase().startsWith("save-all")) {
this.func_6014_a(var4, "Forcing save..");
this.worldMngr.func_485_a(true, (IProgressUpdate)null);
this.func_6014_a(var4, "Save complete.");
} else if(var2.toLowerCase().startsWith("save-off")) {
this.func_6014_a(var4, "Disabling level saving..");
this.worldMngr.field_816_A = true;
} else if(var2.toLowerCase().startsWith("save-on")) {
this.func_6014_a(var4, "Enabling level saving..");
this.worldMngr.field_816_A = false;
} else if(var2.toLowerCase().startsWith("spawn-protection")) {
boolean b = this.configManager.isOp(var4) || var4.equals("CONSOLE");
if(!b) {
return;
}
String var11 = var2.substring(var2.indexOf(" ")).trim();
if(var11.equals("enable")) {
this.worldMngr.spawnProtection = true;
} else if(var11.equals("disable")) {
this.worldMngr.spawnProtection = false;
} else {
return;
}
} else {
String var11;
if(var2.toLowerCase().startsWith("op ")) {
var11 = var2.substring(var2.indexOf(" ")).trim();
this.configManager.opPlayer(var11);
this.func_6014_a(var4, "Opping " + var11);
this.configManager.sendChatMessageToPlayer(var11, "\u00a7eYou are now op!");
} else if(var2.toLowerCase().startsWith("deop ")) {
var11 = var2.substring(var2.indexOf(" ")).trim();
this.configManager.deopPlayer(var11);
this.configManager.sendChatMessageToPlayer(var11, "\u00a7eYou are no longer op!");
this.func_6014_a(var4, "De-opping " + var11);
} else if(var2.toLowerCase().startsWith("ban-ip ")) {
var11 = var2.substring(var2.indexOf(" ")).trim();
this.configManager.banIP(var11);
this.func_6014_a(var4, "Banning ip " + var11);
} else if(var2.toLowerCase().startsWith("pardon-ip ")) {
var11 = var2.substring(var2.indexOf(" ")).trim();
this.configManager.unbanIP(var11);
this.func_6014_a(var4, "Pardoning ip " + var11);
} else {
EntityPlayerMP var12;
if(var2.toLowerCase().startsWith("ban ")) {
var11 = var2.substring(var2.indexOf(" ")).trim();
this.configManager.banPlayer(var11);
this.func_6014_a(var4, "Banning " + var11);
var12 = this.configManager.getPlayerEntity(var11);
if(var12 != null) {
var12.field_421_a.func_43_c("Banned by admin");
}
} else if(var2.toLowerCase().startsWith("pardon ")) {
var11 = var2.substring(var2.indexOf(" ")).trim();
this.configManager.unbanPlayer(var11);
this.func_6014_a(var4, "Pardoning " + var11);
} else if(var2.toLowerCase().startsWith("kick ")) {
var11 = var2.substring(var2.indexOf(" ")).trim();
var12 = null;
for(int var13 = 0; var13 < this.configManager.playerEntities.size(); ++var13) {
EntityPlayerMP var14 = (EntityPlayerMP)this.configManager.playerEntities.get(var13);
if(var14.username.equalsIgnoreCase(var11)) {
var12 = var14;
}
}
if(var12 != null) {
var12.field_421_a.func_43_c("Kicked by admin");
this.func_6014_a(var4, "Kicking " + var12.username);
} else {
var3.log("Can\'t find user " + var11 + ". No kick.");
}
} else {
String[] var5;
EntityPlayerMP var7;
if(var2.toLowerCase().startsWith("tp ")) {
var5 = var2.split(" ");
if(var5.length == 3) {
var12 = this.configManager.getPlayerEntity(var5[1]);
var7 = this.configManager.getPlayerEntity(var5[2]);
if(var12 == null) {
var3.log("Can\'t find user " + var5[1] + ". No tp.");
} else if(var7 == null) {
var3.log("Can\'t find user " + var5[2] + ". No tp.");
} else {
var12.field_421_a.func_41_a(var7.posX, var7.posY, var7.posZ, var7.rotationYaw, var7.rotationPitch);
this.func_6014_a(var4, "Teleporting " + var5[1] + " to " + var5[2] + ".");
}
} else {
var3.log("Syntax error, please provice a source and a target.");
}
} else if(var2.toLowerCase().startsWith("give ")) {
var5 = var2.split(" ");
if(var5.length != 3 && var5.length != 4) {
return;
}
String var6 = var5[1];
var7 = this.configManager.getPlayerEntity(var6);
if(var7 != null) {
try {
int var8 = Integer.parseInt(var5[2]);
if(Item.itemsList[var8] != null) {
this.func_6014_a(var4, "Giving " + var7.username + " some " + var8);
int var9 = 1;
if(var5.length > 3) {
var9 = this.func_6020_b(var5[3], 1);
}
if(var9 < 1) {
var9 = 1;
}
if(var9 > 64) {
var9 = 64;
}
var7.func_161_a(new ItemStack(var8, var9));
} else {
var3.log("There\'s no item with id " + var8);
}
} catch (NumberFormatException var10) {
var3.log("There\'s no item with id " + var5[2]);
}
} else {
var3.log("Can\'t find user " + var6);
}
} else if(var2.toLowerCase().startsWith("say ")) {
var2 = var2.substring(var2.indexOf(" ")).trim();
logger.info("[" + var4 + "] " + var2);
this.configManager.sendPacketToAllPlayers(new Packet3Chat("\u00a7d[Server] " + var2));
} else if(var2.toLowerCase().startsWith("tell ")) {
var5 = var2.split(" ");
if(var5.length >= 3) {
var2 = var2.substring(var2.indexOf(" ")).trim();
var2 = var2.substring(var2.indexOf(" ")).trim();
logger.info("[" + var4 + "->" + var5[1] + "] " + var2);
var2 = "\u00a77" + var4 + " whispers " + var2;
logger.info(var2);
if(!this.configManager.sendPacketToPlayer(var5[1], new Packet3Chat(var2))) {
var3.log("There\'s no player by that name online.");
}
}
} else {
logger.info("Unknown console command. Type \"help\" for help.");
}
}
}
}
} else {
var3.log("To run the server without a gui, start it like this:");
var3.log(" java -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui");
var3.log("Console commands:");
var3.log(" help or ? shows this message");
var3.log(" kick <player> removes a player from the server");
var3.log(" ban <player> bans a player from the server");
var3.log(" pardon <player> pardons a banned player so that they can connect again");
var3.log(" ban-ip <ip> bans an IP address from the server");
var3.log(" pardon-ip <ip> pardons a banned IP address so that they can connect again");
var3.log(" op <player> turns a player into an op");
var3.log(" deop <player> removes op status from a player");
var3.log(" tp <player1> <player2> moves one player to the same location as another player");
var3.log(" give <player> <id> [num] gives a player a resource");
var3.log(" tell <player> <message> sends a private message to a player");
var3.log(" stop gracefully stops the server");
var3.log(" save-all forces a server-wide level save");
var3.log(" save-off disables terrain saving (useful for backup scripts)");
var3.log(" save-on re-enables terrain saving");
var3.log(" list lists all currently connected players");
var3.log(" say <message> broadcasts a message to all players");
}
}
}
private void func_6014_a(String var1, String var2) {
String var3 = var1 + ": " + var2;
this.configManager.sendChatMessageToAllPlayers("\u00a77(" + var3 + ")");
logger.info(var3);
}
private int func_6020_b(String var1, int var2) {
try {
return Integer.parseInt(var1);
} catch (NumberFormatException var4) {
return var2;
}
}
public void func_6022_a(IUpdatePlayerListBox var1) {
this.field_9010_p.add(var1);
}
public static void main(String[] var0) {
try {
MinecraftServer var1 = new MinecraftServer();
if(!GraphicsEnvironment.isHeadless() && (var0.length <= 0 || !var0[0].equals("nogui"))) {
ServerGUI.initGui(var1);
}
(new ThreadServerApplication("Server thread", var1)).start();
} catch (Exception var2) {
logger.log(Level.SEVERE, "Failed to start the minecraft server", var2);
}
}
public File getFile(String var1) {
return new File(var1);
}
public void log(String var1) {
logger.info(var1);
}
public String getUsername() {
return "CONSOLE";
}
public static boolean func_6015_a(MinecraftServer var0) {
return var0.field_6025_n;
}
}

View File

@ -1,340 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
import java.util.List;
public class AxisAlignedBB {
private static List boundingBoxes = new ArrayList();
private static int numBoundingBoxesInUse = 0;
public double minX;
public double minY;
public double minZ;
public double maxX;
public double maxY;
public double maxZ;
public static AxisAlignedBB getBoundingBox(double var0, double var2, double var4, double var6, double var8, double var10) {
return new AxisAlignedBB(var0, var2, var4, var6, var8, var10);
}
public static void clearBoundingBoxPool() {
numBoundingBoxesInUse = 0;
}
public static AxisAlignedBB getBoundingBoxFromPool(double var0, double var2, double var4, double var6, double var8, double var10) {
if(numBoundingBoxesInUse >= boundingBoxes.size()) {
boundingBoxes.add(getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D));
}
return ((AxisAlignedBB)boundingBoxes.get(numBoundingBoxesInUse++)).setBounds(var0, var2, var4, var6, var8, var10);
}
private AxisAlignedBB(double var1, double var3, double var5, double var7, double var9, double var11) {
this.minX = var1;
this.minY = var3;
this.minZ = var5;
this.maxX = var7;
this.maxY = var9;
this.maxZ = var11;
}
public AxisAlignedBB setBounds(double var1, double var3, double var5, double var7, double var9, double var11) {
this.minX = var1;
this.minY = var3;
this.minZ = var5;
this.maxX = var7;
this.maxY = var9;
this.maxZ = var11;
return this;
}
public AxisAlignedBB addCoord(double var1, double var3, double var5) {
double var7 = this.minX;
double var9 = this.minY;
double var11 = this.minZ;
double var13 = this.maxX;
double var15 = this.maxY;
double var17 = this.maxZ;
if(var1 < 0.0D) {
var7 += var1;
}
if(var1 > 0.0D) {
var13 += var1;
}
if(var3 < 0.0D) {
var9 += var3;
}
if(var3 > 0.0D) {
var15 += var3;
}
if(var5 < 0.0D) {
var11 += var5;
}
if(var5 > 0.0D) {
var17 += var5;
}
return getBoundingBoxFromPool(var7, var9, var11, var13, var15, var17);
}
public AxisAlignedBB expands(double var1, double var3, double var5) {
double var7 = this.minX - var1;
double var9 = this.minY - var3;
double var11 = this.minZ - var5;
double var13 = this.maxX + var1;
double var15 = this.maxY + var3;
double var17 = this.maxZ + var5;
return getBoundingBoxFromPool(var7, var9, var11, var13, var15, var17);
}
public AxisAlignedBB getOffsetBoundingBox(double var1, double var3, double var5) {
return getBoundingBoxFromPool(this.minX + var1, this.minY + var3, this.minZ + var5, this.maxX + var1, this.maxY + var3, this.maxZ + var5);
}
public double func_710_a(AxisAlignedBB var1, double var2) {
if(var1.maxY > this.minY && var1.minY < this.maxY) {
if(var1.maxZ > this.minZ && var1.minZ < this.maxZ) {
double var4;
if(var2 > 0.0D && var1.maxX <= this.minX) {
var4 = this.minX - var1.maxX;
if(var4 < var2) {
var2 = var4;
}
}
if(var2 < 0.0D && var1.minX >= this.maxX) {
var4 = this.maxX - var1.minX;
if(var4 > var2) {
var2 = var4;
}
}
return var2;
} else {
return var2;
}
} else {
return var2;
}
}
public double func_701_b(AxisAlignedBB var1, double var2) {
if(var1.maxX > this.minX && var1.minX < this.maxX) {
if(var1.maxZ > this.minZ && var1.minZ < this.maxZ) {
double var4;
if(var2 > 0.0D && var1.maxY <= this.minY) {
var4 = this.minY - var1.maxY;
if(var4 < var2) {
var2 = var4;
}
}
if(var2 < 0.0D && var1.minY >= this.maxY) {
var4 = this.maxY - var1.minY;
if(var4 > var2) {
var2 = var4;
}
}
return var2;
} else {
return var2;
}
} else {
return var2;
}
}
public double func_709_c(AxisAlignedBB var1, double var2) {
if(var1.maxX > this.minX && var1.minX < this.maxX) {
if(var1.maxY > this.minY && var1.minY < this.maxY) {
double var4;
if(var2 > 0.0D && var1.maxZ <= this.minZ) {
var4 = this.minZ - var1.maxZ;
if(var4 < var2) {
var2 = var4;
}
}
if(var2 < 0.0D && var1.minZ >= this.maxZ) {
var4 = this.maxZ - var1.minZ;
if(var4 > var2) {
var2 = var4;
}
}
return var2;
} else {
return var2;
}
} else {
return var2;
}
}
public boolean intersectsWith(AxisAlignedBB var1) {
return var1.maxX > this.minX && var1.minX < this.maxX ? (var1.maxY > this.minY && var1.minY < this.maxY ? var1.maxZ > this.minZ && var1.minZ < this.maxZ : false) : false;
}
public AxisAlignedBB offset(double var1, double var3, double var5) {
this.minX += var1;
this.minY += var3;
this.minZ += var5;
this.maxX += var1;
this.maxY += var3;
this.maxZ += var5;
return this;
}
public AxisAlignedBB func_694_e(double var1, double var3, double var5) {
double var7 = this.minX;
double var9 = this.minY;
double var11 = this.minZ;
double var13 = this.maxX;
double var15 = this.maxY;
double var17 = this.maxZ;
if(var1 < 0.0D) {
var7 -= var1;
}
if(var1 > 0.0D) {
var13 -= var1;
}
if(var3 < 0.0D) {
var9 -= var3;
}
if(var3 > 0.0D) {
var15 -= var3;
}
if(var5 < 0.0D) {
var11 -= var5;
}
if(var5 > 0.0D) {
var17 -= var5;
}
return getBoundingBoxFromPool(var7, var9, var11, var13, var15, var17);
}
public AxisAlignedBB copy() {
return getBoundingBoxFromPool(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
}
public MovingObjectPosition func_706_a(Vec3D var1, Vec3D var2) {
Vec3D var3 = var1.getIntermediateWithXValue(var2, this.minX);
Vec3D var4 = var1.getIntermediateWithXValue(var2, this.maxX);
Vec3D var5 = var1.getIntermediateWithYValue(var2, this.minY);
Vec3D var6 = var1.getIntermediateWithYValue(var2, this.maxY);
Vec3D var7 = var1.getIntermediateWithZValue(var2, this.minZ);
Vec3D var8 = var1.getIntermediateWithZValue(var2, this.maxZ);
if(!this.isVecInYZ(var3)) {
var3 = null;
}
if(!this.isVecInYZ(var4)) {
var4 = null;
}
if(!this.isVecInXZ(var5)) {
var5 = null;
}
if(!this.isVecInXZ(var6)) {
var6 = null;
}
if(!this.isVecInXY(var7)) {
var7 = null;
}
if(!this.isVecInXY(var8)) {
var8 = null;
}
Vec3D var9 = null;
if(var3 != null && (var9 == null || var1.squareDistanceTo(var3) < var1.squareDistanceTo(var9))) {
var9 = var3;
}
if(var4 != null && (var9 == null || var1.squareDistanceTo(var4) < var1.squareDistanceTo(var9))) {
var9 = var4;
}
if(var5 != null && (var9 == null || var1.squareDistanceTo(var5) < var1.squareDistanceTo(var9))) {
var9 = var5;
}
if(var6 != null && (var9 == null || var1.squareDistanceTo(var6) < var1.squareDistanceTo(var9))) {
var9 = var6;
}
if(var7 != null && (var9 == null || var1.squareDistanceTo(var7) < var1.squareDistanceTo(var9))) {
var9 = var7;
}
if(var8 != null && (var9 == null || var1.squareDistanceTo(var8) < var1.squareDistanceTo(var9))) {
var9 = var8;
}
if(var9 == null) {
return null;
} else {
byte var10 = -1;
if(var9 == var3) {
var10 = 4;
}
if(var9 == var4) {
var10 = 5;
}
if(var9 == var5) {
var10 = 0;
}
if(var9 == var6) {
var10 = 1;
}
if(var9 == var7) {
var10 = 2;
}
if(var9 == var8) {
var10 = 3;
}
return new MovingObjectPosition(0, 0, 0, var10, var9);
}
}
private boolean isVecInYZ(Vec3D var1) {
return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
}
private boolean isVecInXZ(Vec3D var1) {
return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
}
private boolean isVecInXY(Vec3D var1) {
return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.yCoord >= this.minY && var1.yCoord <= this.maxY;
}
public void setBB(AxisAlignedBB var1) {
this.minX = var1.minX;
this.minY = var1.minY;
this.minZ = var1.minZ;
this.maxX = var1.maxX;
this.maxY = var1.maxY;
this.maxZ = var1.maxZ;
}
}

View File

@ -1,458 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Random;
public class Block {
public static final StepSound soundPowderFootstep = new StepSound("stone", 1.0F, 1.0F);
public static final StepSound soundWoodFootstep = new StepSound("wood", 1.0F, 1.0F);
public static final StepSound soundGravelFootstep = new StepSound("gravel", 1.0F, 1.0F);
public static final StepSound soundGrassFootstep = new StepSound("grass", 1.0F, 1.0F);
public static final StepSound soundStoneFootstep = new StepSound("stone", 1.0F, 1.0F);
public static final StepSound soundMetalFootstep = new StepSound("stone", 1.0F, 1.5F);
public static final StepSound soundGlassFootstep = new StepSoundStone("stone", 1.0F, 1.0F);
public static final StepSound soundClothFootstep = new StepSound("cloth", 1.0F, 1.0F);
public static final StepSound soundSandFootstep = new StepSoundSand("sand", 1.0F, 1.0F);
public static final Block[] blocksList = new Block[256];
public static final boolean[] tickOnLoad = new boolean[256];
public static final boolean[] field_540_p = new boolean[256];
public static final boolean[] isBlockContainer = new boolean[256];
public static final int[] lightOpacity = new int[256];
public static final boolean[] field_537_s = new boolean[256];
public static final int[] lightValue = new int[256];
public static final Block stone = (new BlockStone(1, 1)).setHardness(1.5F).setResistance(10.0F).setStepSound(soundStoneFootstep);
public static final BlockGrass grass = (BlockGrass)(new BlockGrass(2)).setHardness(0.6F).setStepSound(soundGrassFootstep);
public static final Block dirt = (new BlockDirt(3, 2)).setHardness(0.5F).setStepSound(soundGravelFootstep);
public static final Block cobblestone = (new Block(4, 16, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
public static final Block planks = (new Block(5, 4, Material.wood)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundWoodFootstep);
public static final Block sapling = (new BlockSapling(6, 15)).setHardness(0.0F).setStepSound(soundGrassFootstep);
public static final Block bedrock = (new Block(7, 17, Material.rock)).setHardness(-1.0F).setResistance(6000000.0F).setStepSound(soundStoneFootstep);
public static final Block waterStill = (new BlockFlowing(8, Material.water)).setHardness(100.0F).setLightOpacity(3);
public static final Block waterMoving = (new BlockStationary(9, Material.water)).setHardness(100.0F).setLightOpacity(3);
public static final Block lavaStill = (new BlockFlowing(10, Material.lava)).setHardness(0.0F).setLightValue(1.0F).setLightOpacity(255);
public static final Block lavaMoving = (new BlockStationary(11, Material.lava)).setHardness(100.0F).setLightValue(1.0F).setLightOpacity(255);
public static final Block sand = (new BlockSand(12, 18)).setHardness(0.5F).setStepSound(soundSandFootstep);
public static final Block gravel = (new BlockGravel(13, 19)).setHardness(0.6F).setStepSound(soundGravelFootstep);
public static final Block oreGold = (new BlockOre(14, 32)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
public static final Block oreIron = (new BlockOre(15, 33)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
public static final Block oreCoal = (new BlockOre(16, 34)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
//Had to lower the hardness of wood due to a bug
public static final Block wood = (new BlockLog(17)).setHardness(1.5F).setStepSound(soundWoodFootstep);
public static final BlockLeaves leaves = (BlockLeaves)(new BlockLeaves(18, 52)).setHardness(0.2F).setLightOpacity(1).setStepSound(soundGrassFootstep);
public static final Block sponge = (new BlockSponge(19)).setHardness(0.6F).setStepSound(soundGrassFootstep);
public static final Block glass = (new BlockGlass(20, 49, Material.field_4216_o, false)).setHardness(0.3F).setStepSound(soundGlassFootstep);
public static final Block field_9042_N = null;
public static final Block field_9041_O = null;
public static final Block field_9040_P = null;
public static final Block field_9039_Q = null;
public static final Block field_9038_R = null;
public static final Block field_9037_S = null;
public static final Block field_9036_T = null;
public static final Block field_9034_U = null;
public static final Block field_9033_V = null;
public static final Block field_9032_W = null;
public static final Block field_9031_X = null;
public static final Block field_9030_Y = null;
public static final Block field_9029_Z = null;
public static final Block field_9049_aa = null;
public static final Block cloth = (new Block(35, 64, Material.field_4217_k)).setHardness(0.8F).setStepSound(soundClothFootstep);
public static final Block field_9048_ac = null;
public static final BlockFlower plantYellow = (BlockFlower)(new BlockFlower(37, 13)).setHardness(0.0F).setStepSound(soundGrassFootstep);
public static final BlockFlower plantRed = (BlockFlower)(new BlockFlower(38, 12)).setHardness(0.0F).setStepSound(soundGrassFootstep);
public static final BlockFlower mushroomBrown = (BlockFlower)(new BlockMushroom(39, 29)).setHardness(0.0F).setStepSound(soundGrassFootstep).setLightValue(2.0F / 16.0F);
public static final BlockFlower mushroomRed = (BlockFlower)(new BlockMushroom(40, 28)).setHardness(0.0F).setStepSound(soundGrassFootstep);
public static final Block blockGold = (new BlockOreBlock(41, 39)).setHardness(3.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
public static final Block blockSteel = (new BlockOreBlock(42, 38)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
public static final Block stairDouble = (new BlockStep(43, true)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
public static final Block stairSingle = (new BlockStep(44, false)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
public static final Block brick = (new Block(45, 7, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
public static final Block tnt = (new BlockTNT(46, 8)).setHardness(0.0F).setStepSound(soundGrassFootstep);
public static final Block bookShelf = (new BlockBookshelf(47, 35)).setHardness(1.5F).setStepSound(soundWoodFootstep);
public static final Block cobblestoneMossy = (new Block(48, 36, Material.rock)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
public static final Block obsidian = (new BlockObsidian(49, 37)).setHardness(10.0F).setResistance(2000.0F).setStepSound(soundStoneFootstep);
public static final Block torchWood = (new BlockTorch(50, 80)).setHardness(0.0F).setLightValue(15.0F / 16.0F).setStepSound(soundWoodFootstep);
public static final BlockFire fire = (BlockFire)((BlockFire)(new BlockFire(51, 31)).setHardness(0.0F).setLightValue(1.0F).setStepSound(soundWoodFootstep));
public static final Block mobSpawner = (new BlockMobSpawner(52, 65)).setHardness(5.0F).setStepSound(soundMetalFootstep);
public static final Block stairCompactPlanks = new BlockStairs(53, planks);
public static final Block crate = (new BlockChest(54)).setHardness(2.5F).setStepSound(soundWoodFootstep);
public static final Block redstoneWire = (new BlockRedstoneWire(55, 84)).setHardness(0.0F).setStepSound(soundPowderFootstep);
public static final Block oreDiamond = (new BlockOre(56, 50)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
public static final Block blockDiamond = (new BlockOreBlock(57, 40)).setHardness(5.0F).setResistance(10.0F).setStepSound(soundMetalFootstep);
public static final Block workbench = (new BlockWorkbench(58)).setHardness(2.5F).setStepSound(soundWoodFootstep);
public static final Block crops = (new BlockCrops(59, 88)).setHardness(0.0F).setStepSound(soundGrassFootstep);
public static final Block tilledField = (new BlockSoil(60)).setHardness(0.6F).setStepSound(soundGravelFootstep);
public static final Block stoneOvenIdle = (new BlockFurnace(61, false)).setHardness(3.5F).setStepSound(soundStoneFootstep);
public static final Block stoneOvenActive = (new BlockFurnace(62, true)).setHardness(3.5F).setStepSound(soundStoneFootstep).setLightValue(14.0F / 16.0F);
public static final Block signPost = (new BlockSign(63, TileEntitySign.class, true)).setHardness(1.0F).setStepSound(soundWoodFootstep);
public static final Block doorWood = (new BlockDoor(64, Material.wood)).setHardness(3.0F).setStepSound(soundWoodFootstep);
public static final Block ladder = (new BlockLadder(65, 83)).setHardness(0.4F).setStepSound(soundWoodFootstep);
public static final Block minecartTrack = (new BlockMinecartTrack(66, 128)).setHardness(0.7F).setStepSound(soundMetalFootstep);
public static final Block stairCompactCobblestone = new BlockStairs(67, cobblestone);
public static final Block signWall = (new BlockSign(68, TileEntitySign.class, false)).setHardness(1.0F).setStepSound(soundWoodFootstep);
public static final Block lever = (new BlockLever(69, 96)).setHardness(0.5F).setStepSound(soundWoodFootstep);
public static final Block pressurePlateStone = (new BlockPressurePlate(70, stone.blockIndexInTexture, EnumMobType.mobs)).setHardness(0.5F).setStepSound(soundStoneFootstep);
public static final Block doorSteel = (new BlockDoor(71, Material.iron)).setHardness(5.0F).setStepSound(soundMetalFootstep);
public static final Block pressurePlatePlanks = (new BlockPressurePlate(72, planks.blockIndexInTexture, EnumMobType.everything)).setHardness(0.5F).setStepSound(soundWoodFootstep);
public static final Block oreRedstone = (new BlockRedstoneOre(73, 51, false)).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
public static final Block oreRedstoneGlowing = (new BlockRedstoneOre(74, 51, true)).setLightValue(10.0F / 16.0F).setHardness(3.0F).setResistance(5.0F).setStepSound(soundStoneFootstep);
public static final Block torchRedstoneIdle = (new BlockRedstoneTorch(75, 115, false)).setHardness(0.0F).setStepSound(soundWoodFootstep);
public static final Block torchRedstoneActive = (new BlockRedstoneTorch(76, 99, true)).setHardness(0.0F).setLightValue(0.5F).setStepSound(soundWoodFootstep);
public static final Block button = (new BlockButton(77, stone.blockIndexInTexture)).setHardness(0.5F).setStepSound(soundStoneFootstep);
public static final Block snow = (new BlockSnow(78, 66)).setHardness(0.1F).setStepSound(soundClothFootstep);
public static final Block ice = (new BlockIce(79, 67)).setHardness(0.5F).setLightOpacity(3).setStepSound(soundGlassFootstep);
public static final Block blockSnow = (new BlockSnowBlock(80, 66)).setHardness(0.2F).setStepSound(soundClothFootstep);
public static final Block cactus = (new BlockCactus(81, 70)).setHardness(0.4F).setStepSound(soundClothFootstep);
public static final Block blockClay = (new BlockClay(82, 72)).setHardness(0.6F).setStepSound(soundGravelFootstep);
public static final Block reed = (new BlockReed(83, 73)).setHardness(0.0F).setStepSound(soundGrassFootstep);
public static final Block jukebox = (new BlockJukeBox(84, 74)).setHardness(2.0F).setResistance(10.0F).setStepSound(soundStoneFootstep);
public static final Block field_9050_aZ = (new BlockFence(85, 4)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundWoodFootstep);
public static final Block pumpkin = (new BlockPumpkin(86, 102, false)).setHardness(1.0F).setStepSound(soundWoodFootstep);
public static final Block bloodStone = (new BlockBloodStone(87, 103)).setHardness(0.4F).setStepSound(soundStoneFootstep);
public static final Block slowSand = (new BlockSlowSand(88, 104)).setHardness(0.5F).setStepSound(soundSandFootstep);
public static final Block lightStone = (new BlockLightStone(89, 105, Material.field_4216_o)).setHardness(0.3F).setStepSound(soundGlassFootstep).setLightValue(1.0F);
public static final BlockPortal portal = (BlockPortal)((BlockPortal)(new BlockPortal(90, 14)).setHardness(-1.0F).setStepSound(soundGlassFootstep).setLightValue(12.0F / 16.0F));
public static final Block field_9035_bf = (new BlockPumpkin(91, 102, true)).setHardness(1.0F).setStepSound(soundWoodFootstep).setLightValue(1.0F);
public int blockIndexInTexture;
public final int blockID;
protected float blockHardness;
protected float blockResistance;
public double minX;
public double minY;
public double minZ;
public double maxX;
public double maxY;
public double maxZ;
public StepSound stepSound;
public float field_554_bm;
public final Material blockMaterial;
public float slipperiness;
protected Block(int var1, Material var2) {
this.stepSound = soundPowderFootstep;
this.field_554_bm = 1.0F;
this.slipperiness = 0.6F;
if(blocksList[var1] != null) {
throw new IllegalArgumentException("Slot " + var1 + " is already occupied by " + blocksList[var1] + " when adding " + this);
} else {
this.blockMaterial = var2;
blocksList[var1] = this;
this.blockID = var1;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
field_540_p[var1] = this.allowsAttachment();
lightOpacity[var1] = this.allowsAttachment() ? 255 : 0;
field_537_s[var1] = this.unusedMethod();
isBlockContainer[var1] = false;
}
}
protected Block(int var1, int var2, Material var3) {
this(var1, var3);
this.blockIndexInTexture = var2;
}
protected Block setStepSound(StepSound var1) {
this.stepSound = var1;
return this;
}
protected Block setLightOpacity(int var1) {
lightOpacity[this.blockID] = var1;
return this;
}
protected Block setLightValue(float var1) {
lightValue[this.blockID] = (int)(15.0F * var1);
return this;
}
protected Block setResistance(float var1) {
this.blockResistance = var1 * 3.0F;
return this;
}
private boolean unusedMethod() {
return false;
}
protected Block setHardness(float var1) {
this.blockHardness = var1;
if(this.blockResistance < var1 * 5.0F) {
this.blockResistance = var1 * 5.0F;
}
return this;
}
protected void setTickOnLoad(boolean var1) {
tickOnLoad[this.blockID] = var1;
}
public void setBlockBounds(float var1, float var2, float var3, float var4, float var5, float var6) {
this.minX = (double)var1;
this.minY = (double)var2;
this.minZ = (double)var3;
this.maxX = (double)var4;
this.maxY = (double)var5;
this.maxZ = (double)var6;
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return var5 == 0 && this.minY > 0.0D ? true : (var5 == 1 && this.maxY < 1.0D ? true : (var5 == 2 && this.minZ > 0.0D ? true : (var5 == 3 && this.maxZ < 1.0D ? true : (var5 == 4 && this.minX > 0.0D ? true : (var5 == 5 && this.maxX < 1.0D ? true : !var1.doesBlockAllowAttachment(var2, var3, var4))))));
}
public int getBlockTextureFromSide(int var1) {
return this.blockIndexInTexture;
}
public void getCollidingBoundingBoxes(World var1, int var2, int var3, int var4, AxisAlignedBB var5, ArrayList var6) {
AxisAlignedBB var7 = this.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
if(var7 != null && var5.intersectsWith(var7)) {
var6.add(var7);
}
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return AxisAlignedBB.getBoundingBoxFromPool((double)var2 + this.minX, (double)var3 + this.minY, (double)var4 + this.minZ, (double)var2 + this.maxX, (double)var3 + this.maxY, (double)var4 + this.maxZ);
}
public boolean allowsAttachment() {
return true;
}
public boolean canCollideCheck(int var1, boolean var2) {
return this.isCollidable();
}
public boolean isCollidable() {
return true;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
}
public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
}
public int tickRate() {
return 10;
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
}
public int quantityDropped(Random var1) {
return 1;
}
public int idDropped(int var1, Random var2) {
return this.blockID;
}
public float func_254_a(EntityPlayer var1) {
return this.blockHardness < 0.0F ? 0.0F : (!var1.func_167_b(this) ? 1.0F / this.blockHardness / 100.0F : var1.getCurrentPlayerStrVsBlock(this) / this.blockHardness / 30.0F);
}
public void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5) {
this.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, 1.0F);
}
public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
if(!var1.multiplayerWorld) {
int var7 = this.quantityDropped(var1.rand);
for(int var8 = 0; var8 < var7; ++var8) {
if(var1.rand.nextFloat() <= var6) {
int var9 = this.idDropped(var5, var1.rand);
if(var9 > 0) {
float var10 = 0.7F;
double var11 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
double var13 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
double var15 = (double)(var1.rand.nextFloat() * var10) + (double)(1.0F - var10) * 0.5D;
EntityItem var17 = new EntityItem(var1, (double)var2 + var11, (double)var3 + var13, (double)var4 + var15, new ItemStack(var9));
var17.field_433_ad = 10;
var1.entityJoinedWorld(var17);
}
}
}
}
}
public float func_226_a(Entity var1) {
return this.blockResistance / 5.0F;
}
public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
var5 = var5.addVector((double)(-var2), (double)(-var3), (double)(-var4));
var6 = var6.addVector((double)(-var2), (double)(-var3), (double)(-var4));
Vec3D var7 = var5.getIntermediateWithXValue(var6, this.minX);
Vec3D var8 = var5.getIntermediateWithXValue(var6, this.maxX);
Vec3D var9 = var5.getIntermediateWithYValue(var6, this.minY);
Vec3D var10 = var5.getIntermediateWithYValue(var6, this.maxY);
Vec3D var11 = var5.getIntermediateWithZValue(var6, this.minZ);
Vec3D var12 = var5.getIntermediateWithZValue(var6, this.maxZ);
if(!this.isVecInsideYZBounds(var7)) {
var7 = null;
}
if(!this.isVecInsideYZBounds(var8)) {
var8 = null;
}
if(!this.isVecInsideXZBounds(var9)) {
var9 = null;
}
if(!this.isVecInsideXZBounds(var10)) {
var10 = null;
}
if(!this.isVecInsideXYBounds(var11)) {
var11 = null;
}
if(!this.isVecInsideXYBounds(var12)) {
var12 = null;
}
Vec3D var13 = null;
if(var7 != null && (var13 == null || var5.distanceTo(var7) < var5.distanceTo(var13))) {
var13 = var7;
}
if(var8 != null && (var13 == null || var5.distanceTo(var8) < var5.distanceTo(var13))) {
var13 = var8;
}
if(var9 != null && (var13 == null || var5.distanceTo(var9) < var5.distanceTo(var13))) {
var13 = var9;
}
if(var10 != null && (var13 == null || var5.distanceTo(var10) < var5.distanceTo(var13))) {
var13 = var10;
}
if(var11 != null && (var13 == null || var5.distanceTo(var11) < var5.distanceTo(var13))) {
var13 = var11;
}
if(var12 != null && (var13 == null || var5.distanceTo(var12) < var5.distanceTo(var13))) {
var13 = var12;
}
if(var13 == null) {
return null;
} else {
byte var14 = -1;
if(var13 == var7) {
var14 = 4;
}
if(var13 == var8) {
var14 = 5;
}
if(var13 == var9) {
var14 = 0;
}
if(var13 == var10) {
var14 = 1;
}
if(var13 == var11) {
var14 = 2;
}
if(var13 == var12) {
var14 = 3;
}
return new MovingObjectPosition(var2, var3, var4, var14, var13.addVector((double)var2, (double)var3, (double)var4));
}
}
private boolean isVecInsideYZBounds(Vec3D var1) {
return var1 == null ? false : var1.yCoord >= this.minY && var1.yCoord <= this.maxY && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
}
private boolean isVecInsideXZBounds(Vec3D var1) {
return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.zCoord >= this.minZ && var1.zCoord <= this.maxZ;
}
private boolean isVecInsideXYBounds(Vec3D var1) {
return var1 == null ? false : var1.xCoord >= this.minX && var1.xCoord <= this.maxX && var1.yCoord >= this.minY && var1.yCoord <= this.maxY;
}
public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockId(var2, var3, var4);
return var5 == 0 || blocksList[var5].blockMaterial.getIsLiquid();
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
return false;
}
public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
}
public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
}
public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
}
public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3D var6) {
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
}
public boolean isPoweringTo(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return false;
}
public boolean canProvidePower() {
return false;
}
public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) {
}
public boolean isIndirectlyPoweringTo(World var1, int var2, int var3, int var4, int var5) {
return false;
}
public void func_12007_g(World var1, int var2, int var3, int var4, int var5) {
this.dropBlockAsItem(var1, var2, var3, var4, var5);
}
public boolean canBlockStay(World var1, int var2, int var3, int var4) {
return true;
}
public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLiving var5) {
}
static {
for(int var0 = 0; var0 < 256; ++var0) {
if(blocksList[var0] != null) {
Item.itemsList[var0] = new ItemBlock(var0 - 256);
}
}
}
}

View File

@ -1,7 +0,0 @@
package net.minecraft.src;
public class BlockBloodStone extends Block {
public BlockBloodStone(int var1, int var2) {
super(var1, var2, Material.rock);
}
}

View File

@ -1,17 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockBookshelf extends Block {
public BlockBookshelf(int var1, int var2) {
super(var1, var2, Material.wood);
}
public int getBlockTextureFromSide(int var1) {
return var1 <= 1 ? 4 : this.blockIndexInTexture;
}
public int quantityDropped(Random var1) {
return 0;
}
}

View File

@ -1,19 +0,0 @@
package net.minecraft.src;
public class BlockBreakable extends Block {
private boolean field_6084_a;
protected BlockBreakable(int var1, int var2, Material var3, boolean var4) {
super(var1, var2, var3);
this.field_6084_a = var4;
}
public boolean allowsAttachment() {
return false;
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockId(var2, var3, var4);
return !this.field_6084_a && var6 == this.blockID ? false : super.isSideInsideCoordinate(var1, var2, var3, var4, var5);
}
}

View File

@ -1,225 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockButton extends Block {
protected BlockButton(int var1, int var2) {
super(var1, var2, Material.circuits);
this.setTickOnLoad(true);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public int tickRate() {
return 20;
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2 - 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2 + 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2, var3, var4 - 1) ? true : var1.doesBlockAllowAttachment(var2, var3, var4 + 1)));
}
public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
int var7 = var6 & 8;
var6 &= 7;
if(var5 == 2 && var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var6 = 4;
}
if(var5 == 3 && var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var6 = 3;
}
if(var5 == 4 && var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var6 = 2;
}
if(var5 == 5 && var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var6 = 1;
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 + var7);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 1);
} else if(var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 2);
} else if(var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 3);
} else if(var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 4);
}
this.func_322_g(var1, var2, var3, var4);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(this.func_322_g(var1, var2, var3, var4)) {
int var6 = var1.getBlockMetadata(var2, var3, var4) & 7;
boolean var7 = false;
if(!var1.doesBlockAllowAttachment(var2 - 1, var3, var4) && var6 == 1) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2 + 1, var3, var4) && var6 == 2) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3, var4 - 1) && var6 == 3) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3, var4 + 1) && var6 == 4) {
var7 = true;
}
if(var7) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
}
private boolean func_322_g(World var1, int var2, int var3, int var4) {
if(!this.canPlaceBlockAt(var1, var2, var3, var4)) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
return false;
} else {
return true;
}
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
int var6 = var5 & 7;
boolean var7 = (var5 & 8) > 0;
float var8 = 6.0F / 16.0F;
float var9 = 10.0F / 16.0F;
float var10 = 3.0F / 16.0F;
float var11 = 2.0F / 16.0F;
if(var7) {
var11 = 1.0F / 16.0F;
}
if(var6 == 1) {
this.setBlockBounds(0.0F, var8, 0.5F - var10, var11, var9, 0.5F + var10);
} else if(var6 == 2) {
this.setBlockBounds(1.0F - var11, var8, 0.5F - var10, 1.0F, var9, 0.5F + var10);
} else if(var6 == 3) {
this.setBlockBounds(0.5F - var10, var8, 0.0F, 0.5F + var10, var9, var11);
} else if(var6 == 4) {
this.setBlockBounds(0.5F - var10, var8, 1.0F - var11, 0.5F + var10, var9, 1.0F);
}
}
public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
this.blockActivated(var1, var2, var3, var4, var5);
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
if(var1.multiplayerWorld) {
return true;
} else {
int var6 = var1.getBlockMetadata(var2, var3, var4);
int var7 = var6 & 7;
int var8 = 8 - (var6 & 8);
if(var8 == 0) {
return true;
} else {
var1.setBlockMetadataWithNotify(var2, var3, var4, var7 + var8);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F);
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
if(var7 == 1) {
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
} else if(var7 == 2) {
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
} else if(var7 == 3) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
} else if(var7 == 4) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
} else {
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
}
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
return true;
}
}
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
if((var5 & 8) > 0) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
int var6 = var5 & 7;
if(var6 == 1) {
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
} else if(var6 == 2) {
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
} else if(var6 == 3) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
} else if(var6 == 4) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
} else {
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
}
}
super.onBlockRemoval(var1, var2, var3, var4);
}
public boolean isPoweringTo(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return (var1.getBlockMetadata(var2, var3, var4) & 8) > 0;
}
public boolean isIndirectlyPoweringTo(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if((var6 & 8) == 0) {
return false;
} else {
int var7 = var6 & 7;
return var7 == 5 && var5 == 1 ? true : (var7 == 4 && var5 == 2 ? true : (var7 == 3 && var5 == 3 ? true : (var7 == 2 && var5 == 4 ? true : var7 == 1 && var5 == 5)));
}
}
public boolean canProvidePower() {
return true;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(!var1.multiplayerWorld) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if((var6 & 8) != 0) {
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 & 7);
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
int var7 = var6 & 7;
if(var7 == 1) {
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
} else if(var7 == 2) {
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
} else if(var7 == 3) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
} else if(var7 == 4) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
} else {
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
}
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
}
}
}
}

View File

@ -1,73 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockCactus extends Block {
protected BlockCactus(int var1, int var2) {
super(var1, var2, Material.field_4214_u);
this.setTickOnLoad(true);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(var1.getBlockId(var2, var3 + 1, var4) == 0) {
int var6;
for(var6 = 1; var1.getBlockId(var2, var3 - var6, var4) == this.blockID; ++var6) {
}
if(var6 < 3) {
int var7 = var1.getBlockMetadata(var2, var3, var4);
if(var7 == 15) {
var1.setBlockWithNotify(var2, var3 + 1, var4, this.blockID);
var1.setBlockMetadataWithNotify(var2, var3, var4, 0);
} else {
var1.setBlockMetadataWithNotify(var2, var3, var4, var7 + 1);
}
}
}
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
float var5 = 1.0F / 16.0F;
return AxisAlignedBB.getBoundingBoxFromPool((double)((float)var2 + var5), (double)var3, (double)((float)var4 + var5), (double)((float)(var2 + 1) - var5), (double)((float)(var3 + 1) - var5), (double)((float)(var4 + 1) - var5));
}
public int getBlockTextureFromSide(int var1) {
return var1 == 1 ? this.blockIndexInTexture - 1 : (var1 == 0 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture);
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return !super.canPlaceBlockAt(var1, var2, var3, var4) ? false : this.canBlockStay(var1, var2, var3, var4);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(!this.canBlockStay(var1, var2, var3, var4)) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
public boolean canBlockStay(World var1, int var2, int var3, int var4) {
if(var1.getBlockMaterial(var2 - 1, var3, var4).func_216_a()) {
return false;
} else if(var1.getBlockMaterial(var2 + 1, var3, var4).func_216_a()) {
return false;
} else if(var1.getBlockMaterial(var2, var3, var4 - 1).func_216_a()) {
return false;
} else if(var1.getBlockMaterial(var2, var3, var4 + 1).func_216_a()) {
return false;
} else {
int var5 = var1.getBlockId(var2, var3 - 1, var4);
return var5 == Block.cactus.blockID || var5 == Block.sand.blockID;
}
}
public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) {
var5.attackEntity((Entity)null, 1);
}
}

View File

@ -1,109 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockChest extends BlockContainer {
private Random field_656_a = new Random();
protected BlockChest(int var1) {
super(var1, Material.wood);
this.blockIndexInTexture = 26;
}
public int getBlockTextureFromSide(int var1) {
return var1 == 1 ? this.blockIndexInTexture - 1 : (var1 == 0 ? this.blockIndexInTexture - 1 : (var1 == 3 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture));
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
int var5 = 0;
if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) {
++var5;
}
if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) {
++var5;
}
if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) {
++var5;
}
if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) {
++var5;
}
return var5 > 1 ? false : (this.isThereANeighborChest(var1, var2 - 1, var3, var4) ? false : (this.isThereANeighborChest(var1, var2 + 1, var3, var4) ? false : (this.isThereANeighborChest(var1, var2, var3, var4 - 1) ? false : !this.isThereANeighborChest(var1, var2, var3, var4 + 1))));
}
private boolean isThereANeighborChest(World var1, int var2, int var3, int var4) {
return var1.getBlockId(var2, var3, var4) != this.blockID ? false : (var1.getBlockId(var2 - 1, var3, var4) == this.blockID ? true : (var1.getBlockId(var2 + 1, var3, var4) == this.blockID ? true : (var1.getBlockId(var2, var3, var4 - 1) == this.blockID ? true : var1.getBlockId(var2, var3, var4 + 1) == this.blockID)));
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
TileEntityChest var5 = (TileEntityChest)var1.getBlock(var2, var3, var4);
for(int var6 = 0; var6 < var5.func_83_a(); ++var6) {
ItemStack var7 = var5.getStackInSlot(var6);
if(var7 != null) {
float var8 = this.field_656_a.nextFloat() * 0.8F + 0.1F;
float var9 = this.field_656_a.nextFloat() * 0.8F + 0.1F;
float var10 = this.field_656_a.nextFloat() * 0.8F + 0.1F;
while(var7.stackSize > 0) {
int var11 = this.field_656_a.nextInt(21) + 10;
if(var11 > var7.stackSize) {
var11 = var7.stackSize;
}
var7.stackSize -= var11;
EntityItem var12 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(var7.itemID, var11, var7.itemDamage));
float var13 = 0.05F;
var12.motionX = (double)((float)this.field_656_a.nextGaussian() * var13);
var12.motionY = (double)((float)this.field_656_a.nextGaussian() * var13 + 0.2F);
var12.motionZ = (double)((float)this.field_656_a.nextGaussian() * var13);
var1.entityJoinedWorld(var12);
}
}
}
super.onBlockRemoval(var1, var2, var3, var4);
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
Object var6 = (TileEntityChest)var1.getBlock(var2, var3, var4);
if(var1.doesBlockAllowAttachment(var2, var3 + 1, var4)) {
return true;
} else if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID && var1.doesBlockAllowAttachment(var2 - 1, var3 + 1, var4)) {
return true;
} else if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID && var1.doesBlockAllowAttachment(var2 + 1, var3 + 1, var4)) {
return true;
} else if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID && var1.doesBlockAllowAttachment(var2, var3 + 1, var4 - 1)) {
return true;
} else if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID && var1.doesBlockAllowAttachment(var2, var3 + 1, var4 + 1)) {
return true;
} else {
if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID) {
var6 = new InventoryLargeChest("Large chest", (TileEntityChest)var1.getBlock(var2 - 1, var3, var4), (IInventory)var6);
}
if(var1.getBlockId(var2 + 1, var3, var4) == this.blockID) {
var6 = new InventoryLargeChest("Large chest", (IInventory)var6, (TileEntityChest)var1.getBlock(var2 + 1, var3, var4));
}
if(var1.getBlockId(var2, var3, var4 - 1) == this.blockID) {
var6 = new InventoryLargeChest("Large chest", (TileEntityChest)var1.getBlock(var2, var3, var4 - 1), (IInventory)var6);
}
if(var1.getBlockId(var2, var3, var4 + 1) == this.blockID) {
var6 = new InventoryLargeChest("Large chest", (IInventory)var6, (TileEntityChest)var1.getBlock(var2, var3, var4 + 1));
}
var5.func_166_a((IInventory)var6);
return true;
}
}
protected TileEntity func_294_a_() {
return new TileEntityChest();
}
}

View File

@ -1,17 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockClay extends Block {
public BlockClay(int var1, int var2) {
super(var1, var2, Material.clay);
}
public int idDropped(int var1, Random var2) {
return Item.clay.swiftedIndex;
}
public int quantityDropped(Random var1) {
return 4;
}
}

View File

@ -1,24 +0,0 @@
package net.minecraft.src;
public abstract class BlockContainer extends Block {
protected BlockContainer(int var1, Material var2) {
super(var1, var2);
isBlockContainer[var1] = true;
}
protected BlockContainer(int var1, int var2, Material var3) {
super(var1, var2, var3);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
super.onBlockAdded(var1, var2, var3, var4);
var1.func_473_a(var2, var3, var4, this.func_294_a_());
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
super.onBlockRemoval(var1, var2, var3, var4);
var1.func_513_l(var2, var3, var4);
}
protected abstract TileEntity func_294_a_();
}

View File

@ -1,98 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockCrops extends BlockFlower {
protected BlockCrops(int var1, int var2) {
super(var1, var2);
this.blockIndexInTexture = var2;
this.setTickOnLoad(true);
float var3 = 0.5F;
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 0.25F, 0.5F + var3);
}
protected boolean canThisPlantGrowOnThisBlockID(int var1) {
return var1 == Block.tilledField.blockID;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
super.updateTick(var1, var2, var3, var4, var5);
if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if(var6 < 7) {
float var7 = this.getGrowthRate(var1, var2, var3, var4);
if(var5.nextInt((int)(100.0F / var7)) == 0) {
++var6;
var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
}
}
}
}
private float getGrowthRate(World var1, int var2, int var3, int var4) {
float var5 = 1.0F;
int var6 = var1.getBlockId(var2, var3, var4 - 1);
int var7 = var1.getBlockId(var2, var3, var4 + 1);
int var8 = var1.getBlockId(var2 - 1, var3, var4);
int var9 = var1.getBlockId(var2 + 1, var3, var4);
int var10 = var1.getBlockId(var2 - 1, var3, var4 - 1);
int var11 = var1.getBlockId(var2 + 1, var3, var4 - 1);
int var12 = var1.getBlockId(var2 + 1, var3, var4 + 1);
int var13 = var1.getBlockId(var2 - 1, var3, var4 + 1);
boolean var14 = var8 == this.blockID || var9 == this.blockID;
boolean var15 = var6 == this.blockID || var7 == this.blockID;
boolean var16 = var10 == this.blockID || var11 == this.blockID || var12 == this.blockID || var13 == this.blockID;
for(int var17 = var2 - 1; var17 <= var2 + 1; ++var17) {
for(int var18 = var4 - 1; var18 <= var4 + 1; ++var18) {
int var19 = var1.getBlockId(var17, var3 - 1, var18);
float var20 = 0.0F;
if(var19 == Block.tilledField.blockID) {
var20 = 1.0F;
if(var1.getBlockMetadata(var17, var3 - 1, var18) > 0) {
var20 = 3.0F;
}
}
if(var17 != var2 || var18 != var4) {
var20 /= 4.0F;
}
var5 += var20;
}
}
if(var16 || var14 && var15) {
var5 /= 2.0F;
}
return var5;
}
public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
super.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5);
if(!var1.multiplayerWorld) {
for(int var6 = 0; var6 < 3; ++var6) {
if(var1.rand.nextInt(15) <= var5) {
float var7 = 0.7F;
float var8 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
float var9 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
float var10 = var1.rand.nextFloat() * var7 + (1.0F - var7) * 0.5F;
EntityItem var11 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(Item.seeds));
var11.field_433_ad = 10;
var1.entityJoinedWorld(var11);
}
}
}
}
public int idDropped(int var1, Random var2) {
return var1 == 7 ? Item.wheat.swiftedIndex : -1;
}
public int quantityDropped(Random var1) {
return 1;
}
}

View File

@ -1,7 +0,0 @@
package net.minecraft.src;
public class BlockDirt extends Block {
protected BlockDirt(int var1, int var2) {
super(var1, var2, Material.ground);
}
}

View File

@ -1,162 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockDoor extends Block {
protected BlockDoor(int var1, Material var2) {
super(var1, var2);
this.blockIndexInTexture = 97;
if(var2 == Material.iron) {
++this.blockIndexInTexture;
}
float var3 = 0.5F;
float var4 = 1.0F;
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var4, 0.5F + var3);
}
public boolean allowsAttachment() {
return false;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
this.func_273_b(this.func_271_d(var1.getBlockMetadata(var2, var3, var4)));
}
public void func_273_b(int var1) {
float var2 = 3.0F / 16.0F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
if(var1 == 0) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var2);
}
if(var1 == 1) {
this.setBlockBounds(1.0F - var2, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
if(var1 == 2) {
this.setBlockBounds(0.0F, 0.0F, 1.0F - var2, 1.0F, 1.0F, 1.0F);
}
if(var1 == 3) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, var2, 1.0F, 1.0F);
}
}
public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
this.blockActivated(var1, var2, var3, var4, var5);
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
if(this.blockMaterial == Material.iron) {
return true;
} else {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if((var6 & 8) != 0) {
if(var1.getBlockId(var2, var3 - 1, var4) == this.blockID) {
this.blockActivated(var1, var2, var3 - 1, var4, var5);
}
return true;
} else {
if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) {
var1.setBlockMetadataWithNotify(var2, var3 + 1, var4, (var6 ^ 4) + 8);
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 ^ 4);
var1.func_519_b(var2, var3 - 1, var4, var2, var3, var4);
if(Math.random() < 0.5D) {
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
} else {
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
}
return true;
}
}
}
public void func_272_a(World var1, int var2, int var3, int var4, boolean var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if((var6 & 8) != 0) {
if(var1.getBlockId(var2, var3 - 1, var4) == this.blockID) {
this.func_272_a(var1, var2, var3 - 1, var4, var5);
}
} else {
boolean var7 = (var1.getBlockMetadata(var2, var3, var4) & 4) > 0;
if(var7 != var5) {
if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) {
var1.setBlockMetadataWithNotify(var2, var3 + 1, var4, (var6 ^ 4) + 8);
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 ^ 4);
var1.func_519_b(var2, var3 - 1, var4, var2, var3, var4);
if(Math.random() < 0.5D) {
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_open", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
} else {
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.door_close", 1.0F, var1.rand.nextFloat() * 0.1F + 0.9F);
}
}
}
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if((var6 & 8) != 0) {
if(var1.getBlockId(var2, var3 - 1, var4) != this.blockID) {
var1.setBlockWithNotify(var2, var3, var4, 0);
}
if(var5 > 0 && Block.blocksList[var5].canProvidePower()) {
this.onNeighborBlockChange(var1, var2, var3 - 1, var4, var5);
}
} else {
boolean var7 = false;
if(var1.getBlockId(var2, var3 + 1, var4) != this.blockID) {
var1.setBlockWithNotify(var2, var3, var4, 0);
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var1.setBlockWithNotify(var2, var3, var4, 0);
var7 = true;
if(var1.getBlockId(var2, var3 + 1, var4) == this.blockID) {
var1.setBlockWithNotify(var2, var3 + 1, var4, 0);
}
}
if(var7) {
this.dropBlockAsItem(var1, var2, var3, var4, var6);
} else if(var5 > 0 && Block.blocksList[var5].canProvidePower()) {
boolean var8 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4) || var1.isBlockIndirectlyGettingPowered(var2, var3 + 1, var4);
this.func_272_a(var1, var2, var3, var4, var8);
}
}
}
public int idDropped(int var1, Random var2) {
return (var1 & 8) != 0 ? 0 : (this.blockMaterial == Material.iron ? Item.doorSteel.swiftedIndex : Item.doorWood.swiftedIndex);
}
public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
}
public int func_271_d(int var1) {
return (var1 & 4) == 0 ? var1 - 1 & 3 : var1 & 3;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var3 >= 127 ? false : var1.doesBlockAllowAttachment(var2, var3 - 1, var4) && super.canPlaceBlockAt(var1, var2, var3, var4) && super.canPlaceBlockAt(var1, var2, var3 + 1, var4);
}
}

View File

@ -1,21 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
public class BlockFence extends Block {
public BlockFence(int var1, int var2) {
super(var1, var2, Material.wood);
}
public void getCollidingBoundingBoxes(World var1, int var2, int var3, int var4, AxisAlignedBB var5, ArrayList var6) {
var6.add(AxisAlignedBB.getBoundingBoxFromPool((double)var2, (double)var3, (double)var4, (double)(var2 + 1), (double)var3 + 1.5D, (double)(var4 + 1)));
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.getBlockId(var2, var3 - 1, var4) == this.blockID ? false : (!var1.getBlockMaterial(var2, var3 - 1, var4).func_216_a() ? false : super.canPlaceBlockAt(var1, var2, var3, var4));
}
public boolean allowsAttachment() {
return false;
}
}

View File

@ -1,155 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockFire extends Block {
private int[] chanceToEncourageFire = new int[256];
private int[] abilityToCatchFire = new int[256];
protected BlockFire(int var1, int var2) {
super(var1, var2, Material.fire);
this.setBurnRate(Block.planks.blockID, 5, 20);
this.setBurnRate(Block.wood.blockID, 5, 5);
this.setBurnRate(Block.leaves.blockID, 30, 60);
this.setBurnRate(Block.bookShelf.blockID, 30, 20);
this.setBurnRate(Block.tnt.blockID, 15, 100);
this.setBurnRate(Block.cloth.blockID, 30, 60);
this.setTickOnLoad(true);
}
private void setBurnRate(int var1, int var2, int var3) {
this.chanceToEncourageFire[var1] = var2;
this.abilityToCatchFire[var1] = var3;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
public int quantityDropped(Random var1) {
return 0;
}
public int tickRate() {
return 10;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
boolean var6 = var1.getBlockId(var2, var3 - 1, var4) == Block.bloodStone.blockID;
int var7 = var1.getBlockMetadata(var2, var3, var4);
if(var7 < 15) {
var1.setBlockMetadataWithNotify(var2, var3, var4, var7 + 1);
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
}
if(!var6 && !this.func_268_g(var1, var2, var3, var4)) {
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4) || var7 > 3) {
var1.setBlockWithNotify(var2, var3, var4, 0);
}
} else if(!var6 && !this.canBlockCatchFire(var1, var2, var3 - 1, var4) && var7 == 15 && var5.nextInt(4) == 0) {
var1.setBlockWithNotify(var2, var3, var4, 0);
} else {
if(var7 % 2 == 0 && var7 > 2) {
this.tryToCatchBlockOnFire(var1, var2 + 1, var3, var4, 300, var5);
this.tryToCatchBlockOnFire(var1, var2 - 1, var3, var4, 300, var5);
this.tryToCatchBlockOnFire(var1, var2, var3 - 1, var4, 250, var5);
this.tryToCatchBlockOnFire(var1, var2, var3 + 1, var4, 250, var5);
this.tryToCatchBlockOnFire(var1, var2, var3, var4 - 1, 300, var5);
this.tryToCatchBlockOnFire(var1, var2, var3, var4 + 1, 300, var5);
for(int var8 = var2 - 1; var8 <= var2 + 1; ++var8) {
for(int var9 = var4 - 1; var9 <= var4 + 1; ++var9) {
for(int var10 = var3 - 1; var10 <= var3 + 4; ++var10) {
if(var8 != var2 || var10 != var3 || var9 != var4) {
int var11 = 100;
if(var10 > var3 + 1) {
var11 += (var10 - (var3 + 1)) * 100;
}
int var12 = this.getChanceOfNeighborsEncouragingFire(var1, var8, var10, var9);
if(var12 > 0 && var5.nextInt(var11) <= var12) {
var1.setBlockWithNotify(var8, var10, var9, this.blockID);
}
}
}
}
}
}
}
}
private void tryToCatchBlockOnFire(World var1, int var2, int var3, int var4, int var5, Random var6) {
int var7 = this.abilityToCatchFire[var1.getBlockId(var2, var3, var4)];
if(var6.nextInt(var5) < var7) {
boolean var8 = var1.getBlockId(var2, var3, var4) == Block.tnt.blockID;
if(var6.nextInt(2) == 0) {
var1.setBlockWithNotify(var2, var3, var4, this.blockID);
} else {
var1.setBlockWithNotify(var2, var3, var4, 0);
}
if(var8) {
Block.tnt.onBlockDestroyedByPlayer(var1, var2, var3, var4, 0);
}
}
}
private boolean func_268_g(World var1, int var2, int var3, int var4) {
return this.canBlockCatchFire(var1, var2 + 1, var3, var4) ? true : (this.canBlockCatchFire(var1, var2 - 1, var3, var4) ? true : (this.canBlockCatchFire(var1, var2, var3 - 1, var4) ? true : (this.canBlockCatchFire(var1, var2, var3 + 1, var4) ? true : (this.canBlockCatchFire(var1, var2, var3, var4 - 1) ? true : this.canBlockCatchFire(var1, var2, var3, var4 + 1)))));
}
private int getChanceOfNeighborsEncouragingFire(World var1, int var2, int var3, int var4) {
byte var5 = 0;
if(var1.getBlockId(var2, var3, var4) != 0) {
return 0;
} else {
int var6 = this.getChanceToEncourageFire(var1, var2 + 1, var3, var4, var5);
var6 = this.getChanceToEncourageFire(var1, var2 - 1, var3, var4, var6);
var6 = this.getChanceToEncourageFire(var1, var2, var3 - 1, var4, var6);
var6 = this.getChanceToEncourageFire(var1, var2, var3 + 1, var4, var6);
var6 = this.getChanceToEncourageFire(var1, var2, var3, var4 - 1, var6);
var6 = this.getChanceToEncourageFire(var1, var2, var3, var4 + 1, var6);
return var6;
}
}
public boolean isCollidable() {
return false;
}
public boolean canBlockCatchFire(IBlockAccess var1, int var2, int var3, int var4) {
return this.chanceToEncourageFire[var1.getBlockId(var2, var3, var4)] > 0;
}
public int getChanceToEncourageFire(World var1, int var2, int var3, int var4, int var5) {
int var6 = this.chanceToEncourageFire[var1.getBlockId(var2, var3, var4)];
return var6 > var5 ? var6 : var5;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2, var3 - 1, var4) || this.func_268_g(var1, var2, var3, var4);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4) && !this.func_268_g(var1, var2, var3, var4)) {
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(var1.getBlockId(var2, var3 - 1, var4) != Block.obsidian.blockID || !Block.portal.tryToCreatePortal(var1, var2, var3, var4)) {
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4) && !this.func_268_g(var1, var2, var3, var4)) {
var1.setBlockWithNotify(var2, var3, var4, 0);
} else {
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
}
}
}
}

View File

@ -1,50 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockFlower extends Block {
protected BlockFlower(int var1, int var2) {
super(var1, Material.plants);
this.blockIndexInTexture = var2;
this.setTickOnLoad(true);
float var3 = 0.2F;
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 3.0F, 0.5F + var3);
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4));
}
protected boolean canThisPlantGrowOnThisBlockID(int var1) {
return var1 == Block.grass.blockID || var1 == Block.dirt.blockID || var1 == Block.tilledField.blockID;
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
super.onNeighborBlockChange(var1, var2, var3, var4, var5);
this.func_276_g(var1, var2, var3, var4);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
this.func_276_g(var1, var2, var3, var4);
}
protected final void func_276_g(World var1, int var2, int var3, int var4) {
if(!this.canBlockStay(var1, var2, var3, var4)) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
public boolean canBlockStay(World var1, int var2, int var3, int var4) {
return (var1.getBlockLightValue(var2, var3, var4) >= 8 || var1.canBlockSeeTheSky(var2, var3, var4)) && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4));
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
}

View File

@ -1,263 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockFlowing extends BlockFluids {
int field_659_a = 0;
boolean[] field_658_b = new boolean[4];
int[] field_660_c = new int[4];
protected BlockFlowing(int var1, Material var2) {
super(var1, var2);
}
private void func_15003_i(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
var1.func_470_a(var2, var3, var4, this.blockID + 1, var5);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
var1.func_521_f(var2, var3, var4);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
int var6 = this.func_301_g(var1, var2, var3, var4);
byte var7 = 1;
if(this.blockMaterial == Material.lava && !var1.field_4272_q.field_6166_d) {
var7 = 2;
}
boolean var8 = true;
int var10;
if(var6 > 0) {
byte var9 = -100;
this.field_659_a = 0;
int var12 = this.func_307_e(var1, var2 - 1, var3, var4, var9);
var12 = this.func_307_e(var1, var2 + 1, var3, var4, var12);
var12 = this.func_307_e(var1, var2, var3, var4 - 1, var12);
var12 = this.func_307_e(var1, var2, var3, var4 + 1, var12);
var10 = var12 + var7;
if(var10 >= 8 || var12 < 0) {
var10 = -1;
}
if(this.func_301_g(var1, var2, var3 + 1, var4) >= 0) {
int var11 = this.func_301_g(var1, var2, var3 + 1, var4);
if(var11 >= 8) {
var10 = var11;
} else {
var10 = var11 + 8;
}
}
if(this.field_659_a >= 2 && this.blockMaterial == Material.water) {
if(var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var10 = 0;
} else if(var1.getBlockMaterial(var2, var3 - 1, var4) == this.blockMaterial && var1.getBlockMetadata(var2, var3, var4) == 0) {
var10 = 0;
}
}
if(this.blockMaterial == Material.lava && var6 < 8 && var10 < 8 && var10 > var6 && var5.nextInt(4) != 0) {
var10 = var6;
var8 = false;
}
if(var10 != var6) {
var6 = var10;
if(var10 < 0) {
var1.setBlockWithNotify(var2, var3, var4, 0);
} else {
var1.setBlockMetadataWithNotify(var2, var3, var4, var10);
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
}
} else if(var8) {
this.func_15003_i(var1, var2, var3, var4);
}
} else {
this.func_15003_i(var1, var2, var3, var4);
}
if(this.func_312_l(var1, var2, var3 - 1, var4)) {
if(var6 >= 8) {
var1.func_507_b(var2, var3 - 1, var4, this.blockID, var6);
} else {
var1.func_507_b(var2, var3 - 1, var4, this.blockID, var6 + 8);
}
} else if(var6 >= 0 && (var6 == 0 || this.func_309_k(var1, var2, var3 - 1, var4))) {
boolean[] var13 = this.func_4035_j(var1, var2, var3, var4);
var10 = var6 + var7;
if(var6 >= 8) {
var10 = 1;
}
if(var10 >= 8) {
return;
}
if(var13[0]) {
this.func_311_f(var1, var2 - 1, var3, var4, var10);
}
if(var13[1]) {
this.func_311_f(var1, var2 + 1, var3, var4, var10);
}
if(var13[2]) {
this.func_311_f(var1, var2, var3, var4 - 1, var10);
}
if(var13[3]) {
this.func_311_f(var1, var2, var3, var4 + 1, var10);
}
}
}
private void func_311_f(World var1, int var2, int var3, int var4, int var5) {
if(this.func_312_l(var1, var2, var3, var4)) {
int var6 = var1.getBlockId(var2, var3, var4);
if(var6 > 0) {
if(this.blockMaterial == Material.lava) {
this.func_300_h(var1, var2, var3, var4);
} else {
Block.blocksList[var6].dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
}
}
var1.func_507_b(var2, var3, var4, this.blockID, var5);
}
}
private int func_4034_a(World var1, int var2, int var3, int var4, int var5, int var6) {
int var7 = 1000;
for(int var8 = 0; var8 < 4; ++var8) {
if((var8 != 0 || var6 != 1) && (var8 != 1 || var6 != 0) && (var8 != 2 || var6 != 3) && (var8 != 3 || var6 != 2)) {
int var9 = var2;
int var11 = var4;
if(var8 == 0) {
var9 = var2 - 1;
}
if(var8 == 1) {
++var9;
}
if(var8 == 2) {
var11 = var4 - 1;
}
if(var8 == 3) {
++var11;
}
if(!this.func_309_k(var1, var9, var3, var11) && (var1.getBlockMaterial(var9, var3, var11) != this.blockMaterial || var1.getBlockMetadata(var9, var3, var11) != 0)) {
if(!this.func_309_k(var1, var9, var3 - 1, var11)) {
return var5;
}
if(var5 < 4) {
int var12 = this.func_4034_a(var1, var9, var3, var11, var5 + 1, var8);
if(var12 < var7) {
var7 = var12;
}
}
}
}
}
return var7;
}
private boolean[] func_4035_j(World var1, int var2, int var3, int var4) {
int var5;
int var6;
for(var5 = 0; var5 < 4; ++var5) {
this.field_660_c[var5] = 1000;
var6 = var2;
int var8 = var4;
if(var5 == 0) {
var6 = var2 - 1;
}
if(var5 == 1) {
++var6;
}
if(var5 == 2) {
var8 = var4 - 1;
}
if(var5 == 3) {
++var8;
}
if(!this.func_309_k(var1, var6, var3, var8) && (var1.getBlockMaterial(var6, var3, var8) != this.blockMaterial || var1.getBlockMetadata(var6, var3, var8) != 0)) {
if(!this.func_309_k(var1, var6, var3 - 1, var8)) {
this.field_660_c[var5] = 0;
} else {
this.field_660_c[var5] = this.func_4034_a(var1, var6, var3, var8, 1, var5);
}
}
}
var5 = this.field_660_c[0];
for(var6 = 1; var6 < 4; ++var6) {
if(this.field_660_c[var6] < var5) {
var5 = this.field_660_c[var6];
}
}
for(var6 = 0; var6 < 4; ++var6) {
this.field_658_b[var6] = this.field_660_c[var6] == var5;
}
return this.field_658_b;
}
private boolean func_309_k(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockId(var2, var3, var4);
if(var5 != Block.doorWood.blockID && var5 != Block.doorSteel.blockID && var5 != Block.signPost.blockID && var5 != Block.ladder.blockID && var5 != Block.reed.blockID) {
if(var5 == 0) {
return false;
} else {
Material var6 = Block.blocksList[var5].blockMaterial;
return var6.func_216_a();
}
} else {
return true;
}
}
protected int func_307_e(World var1, int var2, int var3, int var4, int var5) {
int var6 = this.func_301_g(var1, var2, var3, var4);
if(var6 < 0) {
return var5;
} else {
if(var6 == 0) {
++this.field_659_a;
}
if(var6 >= 8) {
var6 = 0;
}
return var5 >= 0 && var6 >= var5 ? var5 : var6;
}
}
private boolean func_312_l(World var1, int var2, int var3, int var4) {
Material var5 = var1.getBlockMaterial(var2, var3, var4);
return var5 == this.blockMaterial ? false : (var5 == Material.lava ? false : !this.func_309_k(var1, var2, var3, var4));
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
super.onBlockAdded(var1, var2, var3, var4);
if(var1.getBlockId(var2, var3, var4) == this.blockID) {
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
}
}
}

View File

@ -1,221 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public abstract class BlockFluids extends Block {
protected BlockFluids(int var1, Material var2) {
super(var1, (var2 == Material.lava ? 14 : 12) * 16 + 13, var2);
float var3 = 0.0F;
float var4 = 0.0F;
this.setBlockBounds(0.0F + var4, 0.0F + var3, 0.0F + var4, 1.0F + var4, 1.0F + var3, 1.0F + var4);
this.setTickOnLoad(true);
}
public static float setFluidHeight(int var0) {
if(var0 >= 8) {
var0 = 0;
}
float var1 = (float)(var0 + 1) / 9.0F;
return var1;
}
public int getBlockTextureFromSide(int var1) {
return var1 != 0 && var1 != 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture;
}
protected int func_301_g(World var1, int var2, int var3, int var4) {
return var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial ? -1 : var1.getBlockMetadata(var2, var3, var4);
}
protected int func_303_b(IBlockAccess var1, int var2, int var3, int var4) {
if(var1.getBlockMaterial(var2, var3, var4) != this.blockMaterial) {
return -1;
} else {
int var5 = var1.getBlockMetadata(var2, var3, var4);
if(var5 >= 8) {
var5 = 0;
}
return var5;
}
}
public boolean allowsAttachment() {
return false;
}
public boolean canCollideCheck(int var1, boolean var2) {
return var2 && var1 == 0;
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
Material var6 = var1.getBlockMaterial(var2, var3, var4);
return var6 == this.blockMaterial ? false : (var6 == Material.ice ? false : (var5 == 1 ? true : super.isSideInsideCoordinate(var1, var2, var3, var4, var5)));
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public int idDropped(int var1, Random var2) {
return 0;
}
public int quantityDropped(Random var1) {
return 0;
}
private Vec3D func_298_c(IBlockAccess var1, int var2, int var3, int var4) {
Vec3D var5 = Vec3D.createVector(0.0D, 0.0D, 0.0D);
int var6 = this.func_303_b(var1, var2, var3, var4);
for(int var7 = 0; var7 < 4; ++var7) {
int var8 = var2;
int var10 = var4;
if(var7 == 0) {
var8 = var2 - 1;
}
if(var7 == 1) {
var10 = var4 - 1;
}
if(var7 == 2) {
++var8;
}
if(var7 == 3) {
++var10;
}
int var11 = this.func_303_b(var1, var8, var3, var10);
int var12;
if(var11 < 0) {
if(!var1.getBlockMaterial(var8, var3, var10).func_218_c()) {
var11 = this.func_303_b(var1, var8, var3 - 1, var10);
if(var11 >= 0) {
var12 = var11 - (var6 - 8);
var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12));
}
}
} else if(var11 >= 0) {
var12 = var11 - var6;
var5 = var5.addVector((double)((var8 - var2) * var12), (double)((var3 - var3) * var12), (double)((var10 - var4) * var12));
}
}
if(var1.getBlockMetadata(var2, var3, var4) >= 8) {
boolean var13 = false;
if(var13 || this.isSideInsideCoordinate(var1, var2, var3, var4 - 1, 2)) {
var13 = true;
}
if(var13 || this.isSideInsideCoordinate(var1, var2, var3, var4 + 1, 3)) {
var13 = true;
}
if(var13 || this.isSideInsideCoordinate(var1, var2 - 1, var3, var4, 4)) {
var13 = true;
}
if(var13 || this.isSideInsideCoordinate(var1, var2 + 1, var3, var4, 5)) {
var13 = true;
}
if(var13 || this.isSideInsideCoordinate(var1, var2, var3 + 1, var4 - 1, 2)) {
var13 = true;
}
if(var13 || this.isSideInsideCoordinate(var1, var2, var3 + 1, var4 + 1, 3)) {
var13 = true;
}
if(var13 || this.isSideInsideCoordinate(var1, var2 - 1, var3 + 1, var4, 4)) {
var13 = true;
}
if(var13 || this.isSideInsideCoordinate(var1, var2 + 1, var3 + 1, var4, 5)) {
var13 = true;
}
if(var13) {
var5 = var5.normalize().addVector(0.0D, -6.0D, 0.0D);
}
}
var5 = var5.normalize();
return var5;
}
public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3D var6) {
Vec3D var7 = this.func_298_c(var1, var2, var3, var4);
var6.xCoord += var7.xCoord;
var6.yCoord += var7.yCoord;
var6.zCoord += var7.zCoord;
}
public int tickRate() {
return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? 30 : 0);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
super.updateTick(var1, var2, var3, var4, var5);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
this.func_302_i(var1, var2, var3, var4);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
this.func_302_i(var1, var2, var3, var4);
}
private void func_302_i(World var1, int var2, int var3, int var4) {
if(var1.getBlockId(var2, var3, var4) == this.blockID) {
if(this.blockMaterial == Material.lava) {
boolean var5 = false;
if(var5 || var1.getBlockMaterial(var2, var3, var4 - 1) == Material.water) {
var5 = true;
}
if(var5 || var1.getBlockMaterial(var2, var3, var4 + 1) == Material.water) {
var5 = true;
}
if(var5 || var1.getBlockMaterial(var2 - 1, var3, var4) == Material.water) {
var5 = true;
}
if(var5 || var1.getBlockMaterial(var2 + 1, var3, var4) == Material.water) {
var5 = true;
}
if(var5 || var1.getBlockMaterial(var2, var3 + 1, var4) == Material.water) {
var5 = true;
}
if(var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if(var6 == 0) {
var1.setBlockWithNotify(var2, var3, var4, Block.obsidian.blockID);
} else if(var6 <= 4) {
var1.setBlockWithNotify(var2, var3, var4, Block.cobblestone.blockID);
}
this.func_300_h(var1, var2, var3, var4);
}
}
}
}
protected void func_300_h(World var1, int var2, int var3, int var4) {
var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.rand.nextFloat() - var1.rand.nextFloat()) * 0.8F);
for(int var5 = 0; var5 < 8; ++var5) {
var1.spawnParticle("largesmoke", (double)var2 + Math.random(), (double)var3 + 1.2D, (double)var4 + Math.random(), 0.0D, 0.0D, 0.0D);
}
}
}

View File

@ -1,125 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockFurnace extends BlockContainer {
private final boolean field_655_a;
private Random field_656_a = new Random();
protected BlockFurnace(int var1, boolean var2) {
super(var1, Material.rock);
this.field_655_a = var2;
this.blockIndexInTexture = 45;
}
public int idDropped(int var1, Random var2) {
return Block.stoneOvenIdle.blockID;
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
super.onBlockAdded(var1, var2, var3, var4);
this.func_296_g(var1, var2, var3, var4);
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
TileEntityFurnace var5 = (TileEntityFurnace)var1.getBlock(var2, var3, var4);
for(int var6 = 0; var6 < var5.func_83_a(); ++var6) {
ItemStack var7 = var5.getStackInSlot(var6);
if(var7 != null) {
float var8 = this.field_656_a.nextFloat() * 0.8F + 0.1F;
float var9 = this.field_656_a.nextFloat() * 0.8F + 0.1F;
float var10 = this.field_656_a.nextFloat() * 0.8F + 0.1F;
while(var7.stackSize > 0) {
int var11 = this.field_656_a.nextInt(21) + 10;
if(var11 > var7.stackSize) {
var11 = var7.stackSize;
}
var7.stackSize -= var11;
EntityItem var12 = new EntityItem(var1, (double)((float)var2 + var8), (double)((float)var3 + var9), (double)((float)var4 + var10), new ItemStack(var7.itemID, var11, var7.itemDamage));
float var13 = 0.05F;
var12.motionX = (double)((float)this.field_656_a.nextGaussian() * var13);
var12.motionY = (double)((float)this.field_656_a.nextGaussian() * var13 + 0.2F);
var12.motionZ = (double)((float)this.field_656_a.nextGaussian() * var13);
var1.entityJoinedWorld(var12);
}
}
}
super.onBlockRemoval(var1, var2, var3, var4);
}
private void func_296_g(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockId(var2, var3, var4 - 1);
int var6 = var1.getBlockId(var2, var3, var4 + 1);
int var7 = var1.getBlockId(var2 - 1, var3, var4);
int var8 = var1.getBlockId(var2 + 1, var3, var4);
byte var9 = 3;
if(Block.field_540_p[var5] && !Block.field_540_p[var6]) {
var9 = 3;
}
if(Block.field_540_p[var6] && !Block.field_540_p[var5]) {
var9 = 2;
}
if(Block.field_540_p[var7] && !Block.field_540_p[var8]) {
var9 = 5;
}
if(Block.field_540_p[var8] && !Block.field_540_p[var7]) {
var9 = 4;
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var9);
}
public int getBlockTextureFromSide(int var1) {
return var1 == 1 ? Block.stone.blockID : (var1 == 0 ? Block.stone.blockID : (var1 == 3 ? this.blockIndexInTexture - 1 : this.blockIndexInTexture));
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
TileEntityFurnace var6 = (TileEntityFurnace)var1.getBlock(var2, var3, var4);
var5.func_170_a(var6);
return true;
}
public static void func_295_a(boolean var0, World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
TileEntity var6 = var1.getBlock(var2, var3, var4);
if(var0) {
var1.setBlockWithNotify(var2, var3, var4, Block.stoneOvenActive.blockID);
} else {
var1.setBlockWithNotify(var2, var3, var4, Block.stoneOvenIdle.blockID);
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var5);
var1.func_473_a(var2, var3, var4, var6);
}
protected TileEntity func_294_a_() {
return new TileEntityFurnace();
}
public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLiving var5) {
int var6 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if(var6 == 0) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 2);
}
if(var6 == 1) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 5);
}
if(var6 == 2) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 3);
}
if(var6 == 3) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 4);
}
}
}

View File

@ -1,13 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockGlass extends BlockBreakable {
public BlockGlass(int var1, int var2, Material var3, boolean var4) {
super(var1, var2, var3, var4);
}
public int quantityDropped(Random var1) {
return 0;
}
}

View File

@ -1,33 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockGrass extends Block {
protected BlockGrass(int var1) {
super(var1, Material.ground);
this.blockIndexInTexture = 3;
this.setTickOnLoad(true);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(var1.getBlockLightValue(var2, var3 + 1, var4) < 4 && var1.getBlockMaterial(var2, var3 + 1, var4).getCanBlockGrass()) {
if(var5.nextInt(4) != 0) {
return;
}
var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
} else if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9) {
int var6 = var2 + var5.nextInt(3) - 1;
int var7 = var3 + var5.nextInt(5) - 3;
int var8 = var4 + var5.nextInt(3) - 1;
if(var1.getBlockId(var6, var7, var8) == Block.dirt.blockID && var1.getBlockLightValue(var6, var7 + 1, var8) >= 4 && !var1.getBlockMaterial(var6, var7 + 1, var8).getCanBlockGrass()) {
var1.setBlockWithNotify(var6, var7, var8, Block.grass.blockID);
}
}
}
public int idDropped(int var1, Random var2) {
return Block.dirt.idDropped(0, var2);
}
}

View File

@ -1,13 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockGravel extends BlockSand {
public BlockGravel(int var1, int var2) {
super(var1, var2);
}
public int idDropped(int var1, Random var2) {
return var2.nextInt(10) == 0 ? Item.flint.swiftedIndex : this.blockID;
}
}

View File

@ -1,35 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockIce extends BlockBreakable {
public BlockIce(int var1, int var2) {
super(var1, var2, Material.ice, false);
this.slipperiness = 0.98F;
this.setTickOnLoad(true);
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return super.isSideInsideCoordinate(var1, var2, var3, var4, 1 - var5);
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
Material var5 = var1.getBlockMaterial(var2, var3 - 1, var4);
if(var5.func_218_c() || var5.getIsLiquid()) {
var1.setBlockWithNotify(var2, var3, var4, Block.waterStill.blockID);
}
}
public int quantityDropped(Random var1) {
return 0;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11 - Block.lightOpacity[this.blockID]) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, Block.waterMoving.blockID);
}
}
}

View File

@ -1,44 +0,0 @@
package net.minecraft.src;
public class BlockJukeBox extends Block {
protected BlockJukeBox(int var1, int var2) {
super(var1, var2, Material.wood);
}
public int getBlockTextureFromSide(int var1) {
return this.blockIndexInTexture + (var1 == 1 ? 1 : 0);
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if(var6 > 0) {
this.ejectRecord(var1, var2, var3, var4, var6);
return true;
} else {
return false;
}
}
public void ejectRecord(World var1, int var2, int var3, int var4, int var5) {
var1.playRecord((String)null, var2, var3, var4);
var1.setBlockMetadataWithNotify(var2, var3, var4, 0);
int var6 = Item.record13.swiftedIndex + var5 - 1;
float var7 = 0.7F;
double var8 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
double var10 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D;
double var12 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
EntityItem var14 = new EntityItem(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, new ItemStack(var6));
var14.field_433_ad = 10;
var1.entityJoinedWorld(var14);
}
public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
if(!var1.multiplayerWorld) {
if(var5 > 0) {
this.ejectRecord(var1, var2, var3, var4, var5);
}
super.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6);
}
}
}

View File

@ -1,91 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockLadder extends Block {
protected BlockLadder(int var1, int var2) {
super(var1, var2, Material.circuits);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
float var6 = 2.0F / 16.0F;
if(var5 == 2) {
this.setBlockBounds(0.0F, 0.0F, 1.0F - var6, 1.0F, 1.0F, 1.0F);
}
if(var5 == 3) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, var6);
}
if(var5 == 4) {
this.setBlockBounds(1.0F - var6, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
if(var5 == 5) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, var6, 1.0F, 1.0F);
}
return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2 - 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2 + 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2, var3, var4 - 1) ? true : var1.doesBlockAllowAttachment(var2, var3, var4 + 1)));
}
public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if((var6 == 0 || var5 == 2) && var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var6 = 2;
}
if((var6 == 0 || var5 == 3) && var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var6 = 3;
}
if((var6 == 0 || var5 == 4) && var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var6 = 4;
}
if((var6 == 0 || var5 == 5) && var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var6 = 5;
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
boolean var7 = false;
if(var6 == 2 && var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var7 = true;
}
if(var6 == 3 && var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var7 = true;
}
if(var6 == 4 && var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var7 = true;
}
if(var6 == 5 && var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var7 = true;
}
if(!var7) {
this.dropBlockAsItem(var1, var2, var3, var4, var6);
var1.setBlockWithNotify(var2, var3, var4, 0);
}
super.onNeighborBlockChange(var1, var2, var3, var4, var5);
}
public int quantityDropped(Random var1) {
return 1;
}
}

View File

@ -1,136 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockLeaves extends BlockLeavesBase {
private int baseIndexInPNG;
int field_464_c[];
protected BlockLeaves(int var1, int var2) {
super(var1, var2, Material.field_4218_h, false);
this.baseIndexInPNG = var2;
setTickOnLoad(true);
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
int l = 1;
int i1 = l + 1;
if (var1.checkChunksExist(var2 - i1, var3 - i1, var4 - i1, var2 + i1, var3 + i1, var4 + i1)) {
for (int j1 = -l; j1 <= l; j1++) {
for (int k1 = -l; k1 <= l; k1++) {
for (int l1 = -l; l1 <= l; l1++) {
int i2 = var1.getBlockId(var2 + j1, var3 + k1, var4 + l1);
if (i2 == Block.leaves.blockID) {
int j2 = var1.getBlockMetadata(var2 + j1, var3 + k1, var4 + l1);
var1.setBlockMetadata(var2 + j1, var3 + k1, var4 + l1, j2 | 4);
}
}
}
}
}
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
int l = var1.getBlockMetadata(var2, var3, var4);
if ((l & 4) != 0) {
byte byte0 = 4;
int i1 = byte0 + 1;
byte byte1 = 32;
int j1 = byte1 * byte1;
int k1 = byte1 / 2;
if (field_464_c == null) {
field_464_c = new int[byte1 * byte1 * byte1];
}
if (var1.checkChunksExist(var2 - i1, var3 - i1, var4 - i1, var2 + i1, var3 + i1, var4 + i1)) {
for (int l1 = -byte0; l1 <= byte0; l1++) {
for (int k2 = -byte0; k2 <= byte0; k2++) {
for (int i3 = -byte0; i3 <= byte0; i3++) {
int k3 = var1.getBlockId(var2 + l1, var3 + k2, var4 + i3);
if (k3 == Block.wood.blockID) {
field_464_c[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = 0;
continue;
}
if (k3 == Block.leaves.blockID) {
field_464_c[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -2;
} else {
field_464_c[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -1;
}
}
}
}
for (int i2 = 1; i2 <= 4; i2++) {
for (int l2 = -byte0; l2 <= byte0; l2++) {
for (int j3 = -byte0; j3 <= byte0; j3++) {
for (int l3 = -byte0; l3 <= byte0; l3++) {
if (field_464_c[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] != i2 - 1) {
continue;
}
if (field_464_c[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2) {
field_464_c[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2;
}
if (field_464_c[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2) {
field_464_c[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2;
}
if (field_464_c[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] == -2) {
field_464_c[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] = i2;
}
if (field_464_c[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] == -2) {
field_464_c[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] = i2;
}
if (field_464_c[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] == -2) {
field_464_c[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] = i2;
}
if (field_464_c[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] == -2) {
field_464_c[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] = i2;
}
}
}
}
}
}
int j2 = field_464_c[k1 * j1 + k1 * byte1 + k1];
if (j2 >= 0) {
var1.setBlockMetadataWithNotify(var2, var3, var4, l & -5);
} else {
func_6360_i(var1, var2, var3, var4);
}
}
}
private void func_6360_i(World var1, int var2, int var3, int var4) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
public int quantityDropped(Random var1) {
return var1.nextInt(20) == 0 ? 1 : 0;
}
public int idDropped(int var1, Random var2) {
return Block.sapling.blockID;
}
public boolean isOpaqueCube() {
return !this.graphicsLevel;
}
public void setGraphicsLevel(boolean var1) {
this.graphicsLevel = var1;
this.blockIndexInTexture = this.baseIndexInPNG + (var1 ? 0 : 1);
}
public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
super.onEntityWalking(var1, var2, var3, var4, var5);
}
}

View File

@ -1,19 +0,0 @@
package net.minecraft.src;
public class BlockLeavesBase extends Block {
protected boolean graphicsLevel;
protected BlockLeavesBase(int var1, int var2, Material var3, boolean var4) {
super(var1, var2, var3);
this.graphicsLevel = var4;
}
public boolean allowsAttachment() {
return false;
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockId(var2, var3, var4);
return !this.graphicsLevel && var6 == this.blockID ? false : super.isSideInsideCoordinate(var1, var2, var3, var4, var5);
}
}

View File

@ -1,192 +0,0 @@
package net.minecraft.src;
public class BlockLever extends Block {
protected BlockLever(int var1, int var2) {
super(var1, var2, Material.circuits);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2 - 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2 + 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2, var3, var4 - 1) ? true : (var1.doesBlockAllowAttachment(var2, var3, var4 + 1) ? true : var1.doesBlockAllowAttachment(var2, var3 - 1, var4))));
}
public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
int var7 = var6 & 8;
var6 &= 7;
if(var5 == 1 && var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var6 = 5 + var1.rand.nextInt(2);
}
if(var5 == 2 && var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var6 = 4;
}
if(var5 == 3 && var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var6 = 3;
}
if(var5 == 4 && var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var6 = 2;
}
if(var5 == 5 && var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var6 = 1;
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 + var7);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 1);
} else if(var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 2);
} else if(var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 3);
} else if(var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 4);
} else if(var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 5 + var1.rand.nextInt(2));
}
this.func_274_g(var1, var2, var3, var4);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(this.func_274_g(var1, var2, var3, var4)) {
int var6 = var1.getBlockMetadata(var2, var3, var4) & 7;
boolean var7 = false;
if(!var1.doesBlockAllowAttachment(var2 - 1, var3, var4) && var6 == 1) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2 + 1, var3, var4) && var6 == 2) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3, var4 - 1) && var6 == 3) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3, var4 + 1) && var6 == 4) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4) && var6 == 5) {
var7 = true;
}
if(var7) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
}
private boolean func_274_g(World var1, int var2, int var3, int var4) {
if(!this.canPlaceBlockAt(var1, var2, var3, var4)) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
return false;
} else {
return true;
}
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4) & 7;
float var6 = 3.0F / 16.0F;
if(var5 == 1) {
this.setBlockBounds(0.0F, 0.2F, 0.5F - var6, var6 * 2.0F, 0.8F, 0.5F + var6);
} else if(var5 == 2) {
this.setBlockBounds(1.0F - var6 * 2.0F, 0.2F, 0.5F - var6, 1.0F, 0.8F, 0.5F + var6);
} else if(var5 == 3) {
this.setBlockBounds(0.5F - var6, 0.2F, 0.0F, 0.5F + var6, 0.8F, var6 * 2.0F);
} else if(var5 == 4) {
this.setBlockBounds(0.5F - var6, 0.2F, 1.0F - var6 * 2.0F, 0.5F + var6, 0.8F, 1.0F);
} else {
var6 = 0.25F;
this.setBlockBounds(0.5F - var6, 0.0F, 0.5F - var6, 0.5F + var6, 0.6F, 0.5F + var6);
}
}
public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
this.blockActivated(var1, var2, var3, var4, var5);
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
if(var1.multiplayerWorld) {
return true;
} else {
int var6 = var1.getBlockMetadata(var2, var3, var4);
int var7 = var6 & 7;
int var8 = 8 - (var6 & 8);
var1.setBlockMetadataWithNotify(var2, var3, var4, var7 + var8);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.5D, (double)var4 + 0.5D, "random.click", 0.3F, var8 > 0 ? 0.6F : 0.5F);
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
if(var7 == 1) {
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
} else if(var7 == 2) {
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
} else if(var7 == 3) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
} else if(var7 == 4) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
} else {
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
}
return true;
}
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
if((var5 & 8) > 0) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
int var6 = var5 & 7;
if(var6 == 1) {
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
} else if(var6 == 2) {
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
} else if(var6 == 3) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
} else if(var6 == 4) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
} else {
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
}
}
super.onBlockRemoval(var1, var2, var3, var4);
}
public boolean isPoweringTo(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return (var1.getBlockMetadata(var2, var3, var4) & 8) > 0;
}
public boolean isIndirectlyPoweringTo(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if((var6 & 8) == 0) {
return false;
} else {
int var7 = var6 & 7;
return var7 == 5 && var5 == 1 ? true : (var7 == 4 && var5 == 2 ? true : (var7 == 3 && var5 == 3 ? true : (var7 == 2 && var5 == 4 ? true : var7 == 1 && var5 == 5)));
}
}
public boolean canProvidePower() {
return true;
}
}

View File

@ -1,13 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockLightStone extends Block {
public BlockLightStone(int var1, int var2, Material var3) {
super(var1, var2, var3);
}
public int idDropped(int var1, Random var2) {
return Item.lightStoneDust.swiftedIndex;
}
}

View File

@ -1,22 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockLog extends Block {
protected BlockLog(int var1) {
super(var1, Material.wood);
this.blockIndexInTexture = 20;
}
public int quantityDropped(Random var1) {
return 1;
}
public int idDropped(int var1, Random var2) {
return Block.wood.blockID;
}
public int getBlockTextureFromSide(int var1) {
return var1 == 1 ? 21 : (var1 == 0 ? 21 : 20);
}
}

View File

@ -1,89 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockMinecartTrack extends Block {
protected BlockMinecartTrack(int var1, int var2) {
super(var1, var2, Material.circuits);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
this.setBlockBoundsBasedOnState(var1, var2, var3, var4);
return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
if(var5 >= 2 && var5 <= 5) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 10.0F / 16.0F, 1.0F);
} else {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F);
}
}
public int quantityDropped(Random var1) {
return 1;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2, var3 - 1, var4);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(!var1.multiplayerWorld) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 15);
this.func_4038_g(var1, var2, var3, var4);
}
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(!var1.multiplayerWorld) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
boolean var7 = false;
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var7 = true;
}
if(var6 == 2 && !var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var7 = true;
}
if(var6 == 3 && !var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var7 = true;
}
if(var6 == 4 && !var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var7 = true;
}
if(var6 == 5 && !var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var7 = true;
}
if(var7) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
} else if(var5 > 0 && Block.blocksList[var5].canProvidePower() && MinecartTrackLogic.func_600_a(new MinecartTrackLogic(this, var1, var2, var3, var4)) == 3) {
this.func_4038_g(var1, var2, var3, var4);
}
}
}
private void func_4038_g(World var1, int var2, int var3, int var4) {
if(!var1.multiplayerWorld) {
(new MinecartTrackLogic(this, var1, var2, var3, var4)).func_596_a(var1.isBlockIndirectlyGettingPowered(var2, var3, var4));
}
}
}

View File

@ -1,25 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockMobSpawner extends BlockContainer {
protected BlockMobSpawner(int var1, int var2) {
super(var1, var2, Material.rock);
}
protected TileEntity func_294_a_() {
return new TileEntityMobSpawner();
}
public int idDropped(int var1, Random var2) {
return 0;
}
public int quantityDropped(Random var1) {
return 0;
}
public boolean allowsAttachment() {
return false;
}
}

View File

@ -1,17 +0,0 @@
package net.minecraft.src;
public class BlockMushroom extends BlockFlower {
protected BlockMushroom(int var1, int var2) {
super(var1, var2);
float var3 = 0.2F;
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3);
}
protected boolean canThisPlantGrowOnThisBlockID(int var1) {
return Block.field_540_p[var1];
}
public boolean canBlockStay(World var1, int var2, int var3, int var4) {
return var1.getBlockLightValue(var2, var3, var4) <= 13 && this.canThisPlantGrowOnThisBlockID(var1.getBlockId(var2, var3 - 1, var4));
}
}

View File

@ -1,17 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockObsidian extends BlockStone {
public BlockObsidian(int var1, int var2) {
super(var1, var2);
}
public int quantityDropped(Random var1) {
return 1;
}
public int idDropped(int var1, Random var2) {
return Block.obsidian.blockID;
}
}

View File

@ -1,17 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockOre extends Block {
public BlockOre(int var1, int var2) {
super(var1, var2, Material.rock);
}
public int idDropped(int var1, Random var2) {
return this.blockID == Block.oreCoal.blockID ? Item.coal.swiftedIndex : (this.blockID == Block.oreDiamond.blockID ? Item.diamond.swiftedIndex : this.blockID);
}
public int quantityDropped(Random var1) {
return 1;
}
}

View File

@ -1,12 +0,0 @@
package net.minecraft.src;
public class BlockOreBlock extends Block {
public BlockOreBlock(int var1, int var2) {
super(var1, Material.iron);
this.blockIndexInTexture = var2;
}
public int getBlockTextureFromSide(int var1) {
return this.blockIndexInTexture - 16;
}
}

View File

@ -1,130 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockPortal extends BlockBreakable {
public BlockPortal(int var1, int var2) {
super(var1, var2, Material.field_4212_x, false);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
float var5;
float var6;
if(var1.getBlockId(var2 - 1, var3, var4) != this.blockID && var1.getBlockId(var2 + 1, var3, var4) != this.blockID) {
var5 = 2.0F / 16.0F;
var6 = 0.5F;
this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6);
} else {
var5 = 0.5F;
var6 = 2.0F / 16.0F;
this.setBlockBounds(0.5F - var5, 0.0F, 0.5F - var6, 0.5F + var5, 1.0F, 0.5F + var6);
}
}
public boolean allowsAttachment() {
return false;
}
public boolean tryToCreatePortal(World var1, int var2, int var3, int var4) {
byte var5 = 0;
byte var6 = 0;
if(var1.getBlockId(var2 - 1, var3, var4) == Block.obsidian.blockID || var1.getBlockId(var2 + 1, var3, var4) == Block.obsidian.blockID) {
var5 = 1;
}
if(var1.getBlockId(var2, var3, var4 - 1) == Block.obsidian.blockID || var1.getBlockId(var2, var3, var4 + 1) == Block.obsidian.blockID) {
var6 = 1;
}
System.out.println(var5 + ", " + var6);
if(var5 == var6) {
return false;
} else {
if(var1.getBlockId(var2 - var5, var3, var4 - var6) == 0) {
var2 -= var5;
var4 -= var6;
}
int var7;
int var8;
for(var7 = -1; var7 <= 2; ++var7) {
for(var8 = -1; var8 <= 3; ++var8) {
boolean var9 = var7 == -1 || var7 == 2 || var8 == -1 || var8 == 3;
if(var7 != -1 && var7 != 2 || var8 != -1 && var8 != 3) {
int var10 = var1.getBlockId(var2 + var5 * var7, var3 + var8, var4 + var6 * var7);
if(var9) {
if(var10 != Block.obsidian.blockID) {
return false;
}
} else if(var10 != 0 && var10 != Block.fire.blockID) {
return false;
}
}
}
}
var1.field_808_h = true;
for(var7 = 0; var7 < 2; ++var7) {
for(var8 = 0; var8 < 3; ++var8) {
var1.setBlockWithNotify(var2 + var5 * var7, var3 + var8, var4 + var6 * var7, Block.portal.blockID);
}
}
var1.field_808_h = false;
return true;
}
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
byte var6 = 0;
byte var7 = 1;
if(var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID) {
var6 = 1;
var7 = 0;
}
int var8;
for(var8 = var3; var1.getBlockId(var2, var8 - 1, var4) == this.blockID; --var8) {
}
if(var1.getBlockId(var2, var8 - 1, var4) != Block.obsidian.blockID) {
var1.setBlockWithNotify(var2, var3, var4, 0);
} else {
int var9;
for(var9 = 1; var9 < 4 && var1.getBlockId(var2, var8 + var9, var4) == this.blockID; ++var9) {
}
if(var9 == 3 && var1.getBlockId(var2, var8 + var9, var4) == Block.obsidian.blockID) {
boolean var10 = var1.getBlockId(var2 - 1, var3, var4) == this.blockID || var1.getBlockId(var2 + 1, var3, var4) == this.blockID;
boolean var11 = var1.getBlockId(var2, var3, var4 - 1) == this.blockID || var1.getBlockId(var2, var3, var4 + 1) == this.blockID;
if(var10 && var11) {
var1.setBlockWithNotify(var2, var3, var4, 0);
} else if((var1.getBlockId(var2 + var6, var3, var4 + var7) != Block.obsidian.blockID || var1.getBlockId(var2 - var6, var3, var4 - var7) != this.blockID) && (var1.getBlockId(var2 - var6, var3, var4 - var7) != Block.obsidian.blockID || var1.getBlockId(var2 + var6, var3, var4 + var7) != this.blockID)) {
var1.setBlockWithNotify(var2, var3, var4, 0);
}
} else {
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return true;
}
public int quantityDropped(Random var1) {
return 0;
}
public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) {
if(!var1.multiplayerWorld) {
var5.func_4042_C();
}
}
}

View File

@ -1,140 +0,0 @@
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public class BlockPressurePlate extends Block {
private EnumMobType triggerMobType;
protected BlockPressurePlate(int var1, int var2, EnumMobType var3) {
super(var1, var2, Material.rock);
this.triggerMobType = var3;
this.setTickOnLoad(true);
float var4 = 1.0F / 16.0F;
this.setBlockBounds(var4, 0.0F, var4, 1.0F - var4, 0.03125F, 1.0F - var4);
}
public int tickRate() {
return 20;
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2, var3 - 1, var4);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
boolean var6 = false;
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var6 = true;
}
if(var6) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(!var1.multiplayerWorld) {
if(var1.getBlockMetadata(var2, var3, var4) != 0) {
this.func_318_g(var1, var2, var3, var4);
}
}
}
public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) {
if(!var1.multiplayerWorld) {
if(var1.getBlockMetadata(var2, var3, var4) != 1) {
this.func_318_g(var1, var2, var3, var4);
}
}
}
private void func_318_g(World var1, int var2, int var3, int var4) {
boolean var5 = var1.getBlockMetadata(var2, var3, var4) == 1;
boolean var6 = false;
float var7 = 2.0F / 16.0F;
List var8 = null;
if(this.triggerMobType == EnumMobType.everything) {
var8 = var1.getEntitiesWithinAABBExcludingEntity((Entity)null, AxisAlignedBB.getBoundingBoxFromPool((double)((float)var2 + var7), (double)var3, (double)((float)var4 + var7), (double)((float)(var2 + 1) - var7), (double)var3 + 0.25D, (double)((float)(var4 + 1) - var7)));
}
if(this.triggerMobType == EnumMobType.mobs) {
var8 = var1.getEntitiesWithinAABB(EntityLiving.class, AxisAlignedBB.getBoundingBoxFromPool((double)((float)var2 + var7), (double)var3, (double)((float)var4 + var7), (double)((float)(var2 + 1) - var7), (double)var3 + 0.25D, (double)((float)(var4 + 1) - var7)));
}
if(this.triggerMobType == EnumMobType.players) {
var8 = var1.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBoxFromPool((double)((float)var2 + var7), (double)var3, (double)((float)var4 + var7), (double)((float)(var2 + 1) - var7), (double)var3 + 0.25D, (double)((float)(var4 + 1) - var7)));
}
if(var8.size() > 0) {
var6 = true;
}
if(var6 && !var5) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 1);
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.3F, 0.6F);
}
if(!var6 && var5) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 0);
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
var1.playSoundEffect((double)var2 + 0.5D, (double)var3 + 0.1D, (double)var4 + 0.5D, "random.click", 0.3F, 0.5F);
}
if(var6) {
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
}
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
if(var5 > 0) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
}
super.onBlockRemoval(var1, var2, var3, var4);
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
boolean var5 = var1.getBlockMetadata(var2, var3, var4) == 1;
float var6 = 1.0F / 16.0F;
if(var5) {
this.setBlockBounds(var6, 0.0F, var6, 1.0F - var6, 0.03125F, 1.0F - var6);
} else {
this.setBlockBounds(var6, 0.0F, var6, 1.0F - var6, 1.0F / 16.0F, 1.0F - var6);
}
}
public boolean isPoweringTo(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return var1.getBlockMetadata(var2, var3, var4) > 0;
}
public boolean isIndirectlyPoweringTo(World var1, int var2, int var3, int var4, int var5) {
return var1.getBlockMetadata(var2, var3, var4) == 0 ? false : var5 == 1;
}
public boolean canProvidePower() {
return true;
}
}

View File

@ -1,30 +0,0 @@
package net.minecraft.src;
public class BlockPumpkin extends Block {
private boolean field_4086_a;
protected BlockPumpkin(int var1, int var2, boolean var3) {
super(var1, Material.field_4213_w);
this.blockIndexInTexture = var2;
this.setTickOnLoad(true);
this.field_4086_a = var3;
}
public int getBlockTextureFromSide(int var1) {
return var1 == 1 ? this.blockIndexInTexture : (var1 == 0 ? this.blockIndexInTexture : (var1 == 3 ? this.blockIndexInTexture + 1 + 16 : this.blockIndexInTexture + 16));
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
super.onBlockAdded(var1, var2, var3, var4);
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockId(var2, var3, var4);
return (var5 == 0 || Block.blocksList[var5].blockMaterial.getIsLiquid()) && var1.doesBlockAllowAttachment(var2, var3 - 1, var4);
}
public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLiving var5) {
int var6 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
}
}

View File

@ -1,97 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockRedstoneOre extends Block {
private boolean field_665_a;
public BlockRedstoneOre(int var1, int var2, boolean var3) {
super(var1, var2, Material.rock);
if(var3) {
this.setTickOnLoad(true);
}
this.field_665_a = var3;
}
public int tickRate() {
return 30;
}
public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
this.func_321_g(var1, var2, var3, var4);
super.onBlockClicked(var1, var2, var3, var4, var5);
}
public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
this.func_321_g(var1, var2, var3, var4);
super.onEntityWalking(var1, var2, var3, var4, var5);
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
this.func_321_g(var1, var2, var3, var4);
return super.blockActivated(var1, var2, var3, var4, var5);
}
private void func_321_g(World var1, int var2, int var3, int var4) {
this.func_320_h(var1, var2, var3, var4);
if(this.blockID == Block.oreRedstone.blockID) {
var1.setBlockWithNotify(var2, var3, var4, Block.oreRedstoneGlowing.blockID);
}
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(this.blockID == Block.oreRedstoneGlowing.blockID) {
var1.setBlockWithNotify(var2, var3, var4, Block.oreRedstone.blockID);
}
}
public int idDropped(int var1, Random var2) {
return Item.redstone.swiftedIndex;
}
public int quantityDropped(Random var1) {
return 4 + var1.nextInt(2);
}
private void func_320_h(World var1, int var2, int var3, int var4) {
Random var5 = var1.rand;
double var6 = 1.0D / 16.0D;
for(int var8 = 0; var8 < 6; ++var8) {
double var9 = (double)((float)var2 + var5.nextFloat());
double var11 = (double)((float)var3 + var5.nextFloat());
double var13 = (double)((float)var4 + var5.nextFloat());
if(var8 == 0 && !var1.doesBlockAllowAttachment(var2, var3 + 1, var4)) {
var11 = (double)(var3 + 1) + var6;
}
if(var8 == 1 && !var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var11 = (double)(var3 + 0) - var6;
}
if(var8 == 2 && !var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var13 = (double)(var4 + 1) + var6;
}
if(var8 == 3 && !var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var13 = (double)(var4 + 0) - var6;
}
if(var8 == 4 && !var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var9 = (double)(var2 + 1) + var6;
}
if(var8 == 5 && !var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var9 = (double)(var2 + 0) - var6;
}
if(var9 < (double)var2 || var9 > (double)(var2 + 1) || var11 < 0.0D || var11 > (double)(var3 + 1) || var13 < (double)var4 || var13 > (double)(var4 + 1)) {
var1.spawnParticle("reddust", var9, var11, var13, 0.0D, 0.0D, 0.0D);
}
}
}
}

View File

@ -1,126 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class BlockRedstoneTorch extends BlockTorch {
private boolean torchActive = false;
private static List torchUpdates = new ArrayList();
private boolean func_280_a(World var1, int var2, int var3, int var4, boolean var5) {
if(var5) {
torchUpdates.add(new RedstoneUpdateInfo(var2, var3, var4, var1.worldTime));
}
int var6 = 0;
for(int var7 = 0; var7 < torchUpdates.size(); ++var7) {
RedstoneUpdateInfo var8 = (RedstoneUpdateInfo)torchUpdates.get(var7);
if(var8.field_775_a == var2 && var8.field_774_b == var3 && var8.field_777_c == var4) {
++var6;
if(var6 >= 8) {
return true;
}
}
}
return false;
}
protected BlockRedstoneTorch(int var1, int var2, boolean var3) {
super(var1, var2);
this.torchActive = var3;
this.setTickOnLoad(true);
}
public int tickRate() {
return 2;
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(var1.getBlockMetadata(var2, var3, var4) == 0) {
super.onBlockAdded(var1, var2, var3, var4);
}
if(this.torchActive) {
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
}
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
if(this.torchActive) {
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
}
}
public boolean isPoweringTo(IBlockAccess var1, int var2, int var3, int var4, int var5) {
if(!this.torchActive) {
return false;
} else {
int var6 = var1.getBlockMetadata(var2, var3, var4);
return var6 == 5 && var5 == 1 ? false : (var6 == 3 && var5 == 3 ? false : (var6 == 4 && var5 == 2 ? false : (var6 == 1 && var5 == 5 ? false : var6 != 2 || var5 != 4)));
}
}
private boolean func_15001_g(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
return var5 == 5 && var1.isBlockIndirectlyProvidingPowerTo(var2, var3 - 1, var4, 0) ? true : (var5 == 3 && var1.isBlockIndirectlyProvidingPowerTo(var2, var3, var4 - 1, 2) ? true : (var5 == 4 && var1.isBlockIndirectlyProvidingPowerTo(var2, var3, var4 + 1, 3) ? true : (var5 == 1 && var1.isBlockIndirectlyProvidingPowerTo(var2 - 1, var3, var4, 4) ? true : var5 == 2 && var1.isBlockIndirectlyProvidingPowerTo(var2 + 1, var3, var4, 5))));
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
boolean var6 = this.func_15001_g(var1, var2, var3, var4);
while(torchUpdates.size() > 0 && var1.worldTime - ((RedstoneUpdateInfo)torchUpdates.get(0)).field_776_d > 100L) {
torchUpdates.remove(0);
}
if(this.torchActive) {
if(var6) {
var1.func_507_b(var2, var3, var4, Block.torchRedstoneIdle.blockID, var1.getBlockMetadata(var2, var3, var4));
if(this.func_280_a(var1, var2, var3, var4, true)) {
var1.playSoundEffect((double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F), "random.fizz", 0.5F, 2.6F + (var1.rand.nextFloat() - var1.rand.nextFloat()) * 0.8F);
for(int var7 = 0; var7 < 5; ++var7) {
double var8 = (double)var2 + var5.nextDouble() * 0.6D + 0.2D;
double var10 = (double)var3 + var5.nextDouble() * 0.6D + 0.2D;
double var12 = (double)var4 + var5.nextDouble() * 0.6D + 0.2D;
var1.spawnParticle("smoke", var8, var10, var12, 0.0D, 0.0D, 0.0D);
}
}
}
} else if(!var6 && !this.func_280_a(var1, var2, var3, var4, false)) {
var1.func_507_b(var2, var3, var4, Block.torchRedstoneActive.blockID, var1.getBlockMetadata(var2, var3, var4));
}
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
super.onNeighborBlockChange(var1, var2, var3, var4, var5);
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
}
public boolean isIndirectlyPoweringTo(World var1, int var2, int var3, int var4, int var5) {
return var5 == 0 ? this.isPoweringTo(var1, var2, var3, var4, var5) : false;
}
public int idDropped(int var1, Random var2) {
return Block.torchRedstoneActive.blockID;
}
public boolean canProvidePower() {
return true;
}
}

View File

@ -1,286 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockRedstoneWire extends Block {
private boolean field_652_a = true;
public BlockRedstoneWire(int var1, int var2) {
super(var1, var2, Material.circuits);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F / 16.0F, 1.0F);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2, var3 - 1, var4);
}
private void func_292_g(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
int var6 = 0;
this.field_652_a = false;
boolean var7 = var1.isBlockIndirectlyGettingPowered(var2, var3, var4);
this.field_652_a = true;
int var8;
int var9;
int var10;
if(var7) {
var6 = 15;
} else {
for(var8 = 0; var8 < 4; ++var8) {
var9 = var2;
var10 = var4;
if(var8 == 0) {
var9 = var2 - 1;
}
if(var8 == 1) {
++var9;
}
if(var8 == 2) {
var10 = var4 - 1;
}
if(var8 == 3) {
++var10;
}
var6 = this.func_290_f(var1, var9, var3, var10, var6);
if(var1.doesBlockAllowAttachment(var9, var3, var10) && !var1.doesBlockAllowAttachment(var2, var3 + 1, var4)) {
var6 = this.func_290_f(var1, var9, var3 + 1, var10, var6);
} else if(!var1.doesBlockAllowAttachment(var9, var3, var10)) {
var6 = this.func_290_f(var1, var9, var3 - 1, var10, var6);
}
}
if(var6 > 0) {
--var6;
} else {
var6 = 0;
}
}
if(var5 != var6) {
var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
if(var6 > 0) {
--var6;
}
for(var8 = 0; var8 < 4; ++var8) {
var9 = var2;
var10 = var4;
int var11 = var3 - 1;
if(var8 == 0) {
var9 = var2 - 1;
}
if(var8 == 1) {
++var9;
}
if(var8 == 2) {
var10 = var4 - 1;
}
if(var8 == 3) {
++var10;
}
if(var1.doesBlockAllowAttachment(var9, var3, var10)) {
var11 += 2;
}
int var12 = this.func_290_f(var1, var9, var3, var10, -1);
if(var12 >= 0 && var12 != var6) {
this.func_292_g(var1, var9, var3, var10);
}
var12 = this.func_290_f(var1, var9, var11, var10, -1);
if(var12 >= 0 && var12 != var6) {
this.func_292_g(var1, var9, var11, var10);
}
}
if(var5 == 0 || var6 == 0) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID);
}
}
}
private void func_291_h(World var1, int var2, int var3, int var4) {
if(var1.getBlockId(var2, var3, var4) == this.blockID) {
var1.notifyBlocksOfNeighborChange(var2, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 - 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2 + 1, var3, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 - 1, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3, var4 + 1, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID);
}
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
super.onBlockAdded(var1, var2, var3, var4);
if(!var1.multiplayerWorld) {
this.func_292_g(var1, var2, var3, var4);
var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
this.func_291_h(var1, var2 - 1, var3, var4);
this.func_291_h(var1, var2 + 1, var3, var4);
this.func_291_h(var1, var2, var3, var4 - 1);
this.func_291_h(var1, var2, var3, var4 + 1);
if(var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
this.func_291_h(var1, var2 - 1, var3 + 1, var4);
} else {
this.func_291_h(var1, var2 - 1, var3 - 1, var4);
}
if(var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
this.func_291_h(var1, var2 + 1, var3 + 1, var4);
} else {
this.func_291_h(var1, var2 + 1, var3 - 1, var4);
}
if(var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
this.func_291_h(var1, var2, var3 + 1, var4 - 1);
} else {
this.func_291_h(var1, var2, var3 - 1, var4 - 1);
}
if(var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
this.func_291_h(var1, var2, var3 + 1, var4 + 1);
} else {
this.func_291_h(var1, var2, var3 - 1, var4 + 1);
}
}
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
super.onBlockRemoval(var1, var2, var3, var4);
if(!var1.multiplayerWorld) {
var1.notifyBlocksOfNeighborChange(var2, var3 + 1, var4, this.blockID);
var1.notifyBlocksOfNeighborChange(var2, var3 - 1, var4, this.blockID);
this.func_292_g(var1, var2, var3, var4);
this.func_291_h(var1, var2 - 1, var3, var4);
this.func_291_h(var1, var2 + 1, var3, var4);
this.func_291_h(var1, var2, var3, var4 - 1);
this.func_291_h(var1, var2, var3, var4 + 1);
if(var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
this.func_291_h(var1, var2 - 1, var3 + 1, var4);
} else {
this.func_291_h(var1, var2 - 1, var3 - 1, var4);
}
if(var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
this.func_291_h(var1, var2 + 1, var3 + 1, var4);
} else {
this.func_291_h(var1, var2 + 1, var3 - 1, var4);
}
if(var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
this.func_291_h(var1, var2, var3 + 1, var4 - 1);
} else {
this.func_291_h(var1, var2, var3 - 1, var4 - 1);
}
if(var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
this.func_291_h(var1, var2, var3 + 1, var4 + 1);
} else {
this.func_291_h(var1, var2, var3 - 1, var4 + 1);
}
}
}
private int func_290_f(World var1, int var2, int var3, int var4, int var5) {
if(var1.getBlockId(var2, var3, var4) != this.blockID) {
return var5;
} else {
int var6 = var1.getBlockMetadata(var2, var3, var4);
return var6 > var5 ? var6 : var5;
}
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(!var1.multiplayerWorld) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
boolean var7 = this.canPlaceBlockAt(var1, var2, var3, var4);
if(!var7) {
this.dropBlockAsItem(var1, var2, var3, var4, var6);
var1.setBlockWithNotify(var2, var3, var4, 0);
} else {
this.func_292_g(var1, var2, var3, var4);
}
super.onNeighborBlockChange(var1, var2, var3, var4, var5);
}
}
public int idDropped(int var1, Random var2) {
return Item.redstone.swiftedIndex;
}
public boolean isIndirectlyPoweringTo(World var1, int var2, int var3, int var4, int var5) {
return !this.field_652_a ? false : this.isPoweringTo(var1, var2, var3, var4, var5);
}
public boolean isPoweringTo(IBlockAccess var1, int var2, int var3, int var4, int var5) {
if(!this.field_652_a) {
return false;
} else if(var1.getBlockMetadata(var2, var3, var4) == 0) {
return false;
} else if(var5 == 1) {
return true;
} else {
boolean var6 = func_293_b(var1, var2 - 1, var3, var4) || !var1.doesBlockAllowAttachment(var2 - 1, var3, var4) && func_293_b(var1, var2 - 1, var3 - 1, var4);
boolean var7 = func_293_b(var1, var2 + 1, var3, var4) || !var1.doesBlockAllowAttachment(var2 + 1, var3, var4) && func_293_b(var1, var2 + 1, var3 - 1, var4);
boolean var8 = func_293_b(var1, var2, var3, var4 - 1) || !var1.doesBlockAllowAttachment(var2, var3, var4 - 1) && func_293_b(var1, var2, var3 - 1, var4 - 1);
boolean var9 = func_293_b(var1, var2, var3, var4 + 1) || !var1.doesBlockAllowAttachment(var2, var3, var4 + 1) && func_293_b(var1, var2, var3 - 1, var4 + 1);
if(!var1.doesBlockAllowAttachment(var2, var3 + 1, var4)) {
if(var1.doesBlockAllowAttachment(var2 - 1, var3, var4) && func_293_b(var1, var2 - 1, var3 + 1, var4)) {
var6 = true;
}
if(var1.doesBlockAllowAttachment(var2 + 1, var3, var4) && func_293_b(var1, var2 + 1, var3 + 1, var4)) {
var7 = true;
}
if(var1.doesBlockAllowAttachment(var2, var3, var4 - 1) && func_293_b(var1, var2, var3 + 1, var4 - 1)) {
var8 = true;
}
if(var1.doesBlockAllowAttachment(var2, var3, var4 + 1) && func_293_b(var1, var2, var3 + 1, var4 + 1)) {
var9 = true;
}
}
return !var8 && !var7 && !var6 && !var9 && var5 >= 2 && var5 <= 5 ? true : (var5 == 2 && var8 && !var6 && !var7 ? true : (var5 == 3 && var9 && !var6 && !var7 ? true : (var5 == 4 && var6 && !var8 && !var9 ? true : var5 == 5 && var7 && !var8 && !var9)));
}
}
public boolean canProvidePower() {
return this.field_652_a;
}
public static boolean func_293_b(IBlockAccess var0, int var1, int var2, int var3) {
int var4 = var0.getBlockId(var1, var2, var3);
return var4 == Block.redstoneWire.blockID ? true : (var4 == 0 ? false : Block.blocksList[var4].canProvidePower());
}
}

View File

@ -1,65 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockReed extends Block {
protected BlockReed(int var1, int var2) {
super(var1, Material.plants);
this.blockIndexInTexture = var2;
float var3 = 6.0F / 16.0F;
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, 1.0F, 0.5F + var3);
this.setTickOnLoad(true);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(var1.getBlockId(var2, var3 + 1, var4) == 0) {
int var6;
for(var6 = 1; var1.getBlockId(var2, var3 - var6, var4) == this.blockID; ++var6) {
}
if(var6 < 3) {
int var7 = var1.getBlockMetadata(var2, var3, var4);
if(var7 == 15) {
var1.setBlockWithNotify(var2, var3 + 1, var4, this.blockID);
var1.setBlockMetadataWithNotify(var2, var3, var4, 0);
} else {
var1.setBlockMetadataWithNotify(var2, var3, var4, var7 + 1);
}
}
}
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockId(var2, var3 - 1, var4);
return var5 == this.blockID ? true : (var5 != Block.grass.blockID && var5 != Block.dirt.blockID ? false : (var1.getBlockMaterial(var2 - 1, var3 - 1, var4) == Material.water ? true : (var1.getBlockMaterial(var2 + 1, var3 - 1, var4) == Material.water ? true : (var1.getBlockMaterial(var2, var3 - 1, var4 - 1) == Material.water ? true : var1.getBlockMaterial(var2, var3 - 1, var4 + 1) == Material.water))));
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
this.func_4037_g(var1, var2, var3, var4);
}
protected final void func_4037_g(World var1, int var2, int var3, int var4) {
if(!this.canBlockStay(var1, var2, var3, var4)) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
public boolean canBlockStay(World var1, int var2, int var3, int var4) {
return this.canPlaceBlockAt(var1, var2, var3, var4);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public int idDropped(int var1, Random var2) {
return Item.reed.swiftedIndex;
}
public boolean allowsAttachment() {
return false;
}
}

View File

@ -1,53 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockSand extends Block {
public static boolean fallInstantly = false;
public BlockSand(int var1, int var2) {
super(var1, var2, Material.sand);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
this.tryToFall(var1, var2, var3, var4);
}
private void tryToFall(World var1, int var2, int var3, int var4) {
if(canFallBelow(var1, var2, var3 - 1, var4) && var3 >= 0) {
EntityFallingSand var8 = new EntityFallingSand(var1, (float)var2 + 0.5F, (float)var3 + 0.5F, (float)var4 + 0.5F, this.blockID);
if(fallInstantly) {
while(!var8.field_304_B) {
var8.onUpdate();
}
} else {
var1.entityJoinedWorld(var8);
}
}
}
public int tickRate() {
return 3;
}
public static boolean canFallBelow(World var0, int var1, int var2, int var3) {
int var4 = var0.getBlockId(var1, var2, var3);
if(var4 == 0) {
return true;
} else if(var4 == Block.fire.blockID) {
return true;
} else {
Material var5 = Block.blocksList[var4].blockMaterial;
return var5 == Material.water ? true : var5 == Material.lava;
}
}
}

View File

@ -1,32 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockSapling extends BlockFlower {
protected BlockSapling(int var1, int var2) {
super(var1, var2);
float var3 = 0.4F;
this.setBlockBounds(0.5F - var3, 0.0F, 0.5F - var3, 0.5F + var3, var3 * 2.0F, 0.5F + var3);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
super.updateTick(var1, var2, var3, var4, var5);
if(var1.getBlockLightValue(var2, var3 + 1, var4) >= 9 && var5.nextInt(5) == 0) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if(var6 < 15) {
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 + 1);
} else {
var1.setBlock(var2, var3, var4, 0);
Object var7 = new WorldGenTrees();
if(var5.nextInt(10) == 0) {
var7 = new WorldGenBigTree();
}
if(!((WorldGenerator)var7).generate(var1, var5, var2, var3, var4)) {
var1.setBlock(var2, var3, var4, this.blockID);
}
}
}
}
}

View File

@ -1,100 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockSign extends BlockContainer {
private Class field_654_a;
private boolean field_653_b;
protected BlockSign(int var1, Class var2, boolean var3) {
super(var1, Material.wood);
this.field_653_b = var3;
this.blockIndexInTexture = 4;
this.field_654_a = var2;
float var4 = 0.25F;
float var5 = 1.0F;
this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
if(!this.field_653_b) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
float var6 = 9.0F / 32.0F;
float var7 = 25.0F / 32.0F;
float var8 = 0.0F;
float var9 = 1.0F;
float var10 = 2.0F / 16.0F;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
if(var5 == 2) {
this.setBlockBounds(var8, var6, 1.0F - var10, var9, var7, 1.0F);
}
if(var5 == 3) {
this.setBlockBounds(var8, var6, 0.0F, var9, var7, var10);
}
if(var5 == 4) {
this.setBlockBounds(1.0F - var10, var6, var8, 1.0F, var7, var9);
}
if(var5 == 5) {
this.setBlockBounds(0.0F, var6, var8, var10, var7, var9);
}
}
}
public boolean allowsAttachment() {
return false;
}
protected TileEntity func_294_a_() {
try {
return (TileEntity)this.field_654_a.newInstance();
} catch (Exception var2) {
throw new RuntimeException(var2);
}
}
public int idDropped(int var1, Random var2) {
return Item.sign.swiftedIndex;
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
boolean var6 = false;
if(this.field_653_b) {
if(!var1.getBlockMaterial(var2, var3 - 1, var4).func_216_a()) {
var6 = true;
}
} else {
int var7 = var1.getBlockMetadata(var2, var3, var4);
var6 = true;
if(var7 == 2 && var1.getBlockMaterial(var2, var3, var4 + 1).func_216_a()) {
var6 = false;
}
if(var7 == 3 && var1.getBlockMaterial(var2, var3, var4 - 1).func_216_a()) {
var6 = false;
}
if(var7 == 4 && var1.getBlockMaterial(var2 + 1, var3, var4).func_216_a()) {
var6 = false;
}
if(var7 == 5 && var1.getBlockMaterial(var2 - 1, var3, var4).func_216_a()) {
var6 = false;
}
}
if(var6) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
super.onNeighborBlockChange(var1, var2, var3, var4, var5);
}
}

View File

@ -1,17 +0,0 @@
package net.minecraft.src;
public class BlockSlowSand extends Block {
public BlockSlowSand(int var1, int var2) {
super(var1, var2, Material.sand);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
float var5 = 2.0F / 16.0F;
return AxisAlignedBB.getBoundingBoxFromPool((double)var2, (double)var3, (double)var4, (double)(var2 + 1), (double)((float)(var3 + 1) - var5), (double)(var4 + 1));
}
public void onEntityCollidedWithBlock(World var1, int var2, int var3, int var4, Entity var5) {
var5.motionX *= 0.4D;
var5.motionZ *= 0.4D;
}
}

View File

@ -1,71 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockSnow extends Block {
protected BlockSnow(int var1, int var2) {
super(var1, var2, Material.snow);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F / 16.0F, 1.0F);
this.setTickOnLoad(true);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockId(var2, var3 - 1, var4);
return var5 != 0 && Block.blocksList[var5].allowsAttachment() ? var1.getBlockMaterial(var2, var3 - 1, var4).func_218_c() : false;
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
this.func_275_g(var1, var2, var3, var4);
}
private boolean func_275_g(World var1, int var2, int var3, int var4) {
if(!this.canPlaceBlockAt(var1, var2, var3, var4)) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
return false;
} else {
return true;
}
}
public void func_12007_g(World var1, int var2, int var3, int var4, int var5) {
int var6 = Item.snowball.swiftedIndex;
float var7 = 0.7F;
double var8 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
double var10 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
double var12 = (double)(var1.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
EntityItem var14 = new EntityItem(var1, (double)var2 + var8, (double)var3 + var10, (double)var4 + var12, new ItemStack(var6));
var14.field_433_ad = 10;
var1.entityJoinedWorld(var14);
var1.setBlockWithNotify(var2, var3, var4, 0);
}
public int idDropped(int var1, Random var2) {
return Item.snowball.swiftedIndex;
}
public int quantityDropped(Random var1) {
return 0;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
Material var6 = var1.getBlockMaterial(var2, var3, var4);
return var5 == 1 ? true : (var6 == this.blockMaterial ? false : super.isSideInsideCoordinate(var1, var2, var3, var4, var5));
}
}

View File

@ -1,26 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockSnowBlock extends Block {
protected BlockSnowBlock(int var1, int var2) {
super(var1, var2, Material.builtSnow);
this.setTickOnLoad(true);
}
public int idDropped(int var1, Random var2) {
return Item.snowball.swiftedIndex;
}
public int quantityDropped(Random var1) {
return 4;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(var1.getSavedLightValue(EnumSkyBlock.Block, var2, var3, var4) > 11) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
}

View File

@ -1,85 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockSoil extends Block {
protected BlockSoil(int var1) {
super(var1, Material.ground);
this.blockIndexInTexture = 87;
this.setTickOnLoad(true);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 15.0F / 16.0F, 1.0F);
this.setLightOpacity(255);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return AxisAlignedBB.getBoundingBoxFromPool((double)(var2 + 0), (double)(var3 + 0), (double)(var4 + 0), (double)(var2 + 1), (double)(var3 + 1), (double)(var4 + 1));
}
public boolean allowsAttachment() {
return false;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(var5.nextInt(5) == 0) {
if(this.func_283_h(var1, var2, var3, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 7);
} else {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if(var6 > 0) {
var1.setBlockMetadataWithNotify(var2, var3, var4, var6 - 1);
} else if(!this.func_282_g(var1, var2, var3, var4)) {
var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
}
}
}
}
public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
if(var1.rand.nextInt(4) == 0) {
var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
}
}
private boolean func_282_g(World var1, int var2, int var3, int var4) {
byte var5 = 0;
for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
for(int var7 = var4 - var5; var7 <= var4 + var5; ++var7) {
if(var1.getBlockId(var6, var3 + 1, var7) == Block.crops.blockID) {
return true;
}
}
}
return false;
}
private boolean func_283_h(World var1, int var2, int var3, int var4) {
for(int var5 = var2 - 4; var5 <= var2 + 4; ++var5) {
for(int var6 = var3; var6 <= var3 + 1; ++var6) {
for(int var7 = var4 - 4; var7 <= var4 + 4; ++var7) {
if(var1.getBlockMaterial(var5, var6, var7) == Material.water) {
return true;
}
}
}
}
return false;
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
super.onNeighborBlockChange(var1, var2, var3, var4, var5);
Material var6 = var1.getBlockMaterial(var2, var3 + 1, var4);
if(var6.func_216_a()) {
var1.setBlockWithNotify(var2, var3, var4, Block.dirt.blockID);
}
}
public int idDropped(int var1, Random var2) {
return Block.dirt.idDropped(0, var2);
}
}

View File

@ -1,35 +0,0 @@
package net.minecraft.src;
public class BlockSponge extends Block {
protected BlockSponge(int var1) {
super(var1, Material.sponge);
this.blockIndexInTexture = 48;
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
byte var5 = 2;
for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
for(int var7 = var3 - var5; var7 <= var3 + var5; ++var7) {
for(int var8 = var4 - var5; var8 <= var4 + var5; ++var8) {
if(var1.getBlockMaterial(var6, var7, var8) == Material.water) {
}
}
}
}
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
byte var5 = 2;
for(int var6 = var2 - var5; var6 <= var2 + var5; ++var6) {
for(int var7 = var3 - var5; var7 <= var3 + var5; ++var7) {
for(int var8 = var4 - var5; var8 <= var4 + var5; ++var8) {
var1.notifyBlocksOfNeighborChange(var6, var7, var8, var1.getBlockId(var6, var7, var8));
}
}
}
}
}

View File

@ -1,156 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
import java.util.Random;
public class BlockStairs extends Block {
private Block field_651_a;
protected BlockStairs(int var1, Block var2) {
super(var1, var2.blockIndexInTexture, var2.blockMaterial);
this.field_651_a = var2;
this.setHardness(var2.blockHardness);
this.setResistance(var2.blockResistance / 3.0F);
this.setStepSound(var2.stepSound);
}
public void setBlockBoundsBasedOnState(IBlockAccess var1, int var2, int var3, int var4) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return super.getCollisionBoundingBoxFromPool(var1, var2, var3, var4);
}
public boolean allowsAttachment() {
return false;
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
return super.isSideInsideCoordinate(var1, var2, var3, var4, var5);
}
public void getCollidingBoundingBoxes(World var1, int var2, int var3, int var4, AxisAlignedBB var5, ArrayList var6) {
int var7 = var1.getBlockMetadata(var2, var3, var4);
if(var7 == 0) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
this.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
} else if(var7 == 1) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 0.5F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
this.setBlockBounds(0.5F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
} else if(var7 == 2) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 0.5F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 1.0F, 1.0F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
} else if(var7 == 3) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 0.5F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
this.setBlockBounds(0.0F, 0.0F, 0.5F, 1.0F, 0.5F, 1.0F);
super.getCollidingBoundingBoxes(var1, var2, var3, var4, var5, var6);
}
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
}
public void onBlockClicked(World var1, int var2, int var3, int var4, EntityPlayer var5) {
this.field_651_a.onBlockClicked(var1, var2, var3, var4, var5);
}
public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
this.field_651_a.onBlockDestroyedByPlayer(var1, var2, var3, var4, var5);
}
public float func_226_a(Entity var1) {
return this.field_651_a.func_226_a(var1);
}
public int idDropped(int var1, Random var2) {
return this.field_651_a.idDropped(var1, var2);
}
public int quantityDropped(Random var1) {
return this.field_651_a.quantityDropped(var1);
}
public int getBlockTextureFromSide(int var1) {
return this.field_651_a.getBlockTextureFromSide(var1);
}
public int tickRate() {
return this.field_651_a.tickRate();
}
public void velocityToAddToEntity(World var1, int var2, int var3, int var4, Entity var5, Vec3D var6) {
this.field_651_a.velocityToAddToEntity(var1, var2, var3, var4, var5, var6);
}
public boolean isCollidable() {
return this.field_651_a.isCollidable();
}
public boolean canCollideCheck(int var1, boolean var2) {
return this.field_651_a.canCollideCheck(var1, var2);
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return this.field_651_a.canPlaceBlockAt(var1, var2, var3, var4);
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
this.onNeighborBlockChange(var1, var2, var3, var4, 0);
this.field_651_a.onBlockAdded(var1, var2, var3, var4);
}
public void onBlockRemoval(World var1, int var2, int var3, int var4) {
this.field_651_a.onBlockRemoval(var1, var2, var3, var4);
}
public void dropBlockAsItemWithChance(World var1, int var2, int var3, int var4, int var5, float var6) {
this.field_651_a.dropBlockAsItemWithChance(var1, var2, var3, var4, var5, var6);
}
public void dropBlockAsItem(World var1, int var2, int var3, int var4, int var5) {
this.field_651_a.dropBlockAsItem(var1, var2, var3, var4, var5);
}
public void onEntityWalking(World var1, int var2, int var3, int var4, Entity var5) {
this.field_651_a.onEntityWalking(var1, var2, var3, var4, var5);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
this.field_651_a.updateTick(var1, var2, var3, var4, var5);
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
return this.field_651_a.blockActivated(var1, var2, var3, var4, var5);
}
public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
this.field_651_a.onBlockDestroyedByExplosion(var1, var2, var3, var4);
}
public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLiving var5) {
int var6 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
if(var6 == 0) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 2);
}
if(var6 == 1) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 1);
}
if(var6 == 2) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 3);
}
if(var6 == 3) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 0);
}
}
}

View File

@ -1,57 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockStationary extends BlockFluids {
protected BlockStationary(int var1, Material var2) {
super(var1, var2);
this.setTickOnLoad(false);
if(var2 == Material.lava) {
this.setTickOnLoad(true);
}
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
super.onNeighborBlockChange(var1, var2, var3, var4, var5);
if(var1.getBlockId(var2, var3, var4) == this.blockID) {
this.func_15002_i(var1, var2, var3, var4);
}
}
private void func_15002_i(World var1, int var2, int var3, int var4) {
int var5 = var1.getBlockMetadata(var2, var3, var4);
var1.field_808_h = true;
var1.func_470_a(var2, var3, var4, this.blockID - 1, var5);
var1.func_519_b(var2, var3, var4, var2, var3, var4);
var1.scheduleBlockUpdate(var2, var3, var4, this.blockID - 1);
var1.field_808_h = false;
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
if(this.blockMaterial == Material.lava) {
int var6 = var5.nextInt(3);
for(int var7 = 0; var7 < var6; ++var7) {
var2 += var5.nextInt(3) - 1;
++var3;
var4 += var5.nextInt(3) - 1;
int var8 = var1.getBlockId(var2, var3, var4);
if(var8 == 0) {
if(this.func_4033_j(var1, var2 - 1, var3, var4) || this.func_4033_j(var1, var2 + 1, var3, var4) || this.func_4033_j(var1, var2, var3, var4 - 1) || this.func_4033_j(var1, var2, var3, var4 + 1) || this.func_4033_j(var1, var2, var3 - 1, var4) || this.func_4033_j(var1, var2, var3 + 1, var4)) {
var1.setBlockWithNotify(var2, var3, var4, Block.fire.blockID);
return;
}
} else if(Block.blocksList[var8].blockMaterial.func_218_c()) {
return;
}
}
}
}
private boolean func_4033_j(World var1, int var2, int var3, int var4) {
return var1.getBlockMaterial(var2, var3, var4).getBurning();
}
}

View File

@ -1,55 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockStep extends Block {
private boolean field_666_a;
public BlockStep(int var1, boolean var2) {
super(var1, 6, Material.rock);
this.field_666_a = var2;
if(!var2) {
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
this.setLightOpacity(255);
}
public int getBlockTextureFromSide(int var1) {
return var1 <= 1 ? 6 : 5;
}
public boolean allowsAttachment() {
return this.field_666_a;
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(this == Block.stairSingle) {
}
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(this != Block.stairSingle) {
super.onBlockAdded(var1, var2, var3, var4);
}
int var5 = var1.getBlockId(var2, var3 - 1, var4);
if(var5 == stairSingle.blockID) {
var1.setBlockWithNotify(var2, var3, var4, 0);
var1.setBlockWithNotify(var2, var3 - 1, var4, Block.stairDouble.blockID);
}
}
public int idDropped(int var1, Random var2) {
return Block.stairSingle.blockID;
}
public boolean isSideInsideCoordinate(IBlockAccess var1, int var2, int var3, int var4, int var5) {
if(this != Block.stairSingle) {
super.isSideInsideCoordinate(var1, var2, var3, var4, var5);
}
return var5 == 1 ? true : (!super.isSideInsideCoordinate(var1, var2, var3, var4, var5) ? false : (var5 == 0 ? true : var1.getBlockId(var2, var3, var4) != this.blockID));
}
}

View File

@ -1,13 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockStone extends Block {
public BlockStone(int var1, int var2) {
super(var1, var2, Material.rock);
}
public int idDropped(int var1, Random var2) {
return Block.cobblestone.blockID;
}
}

View File

@ -1,39 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockTNT extends Block {
public BlockTNT(int var1, int var2) {
super(var1, var2, Material.tnt);
}
public int getBlockTextureFromSide(int var1) {
return var1 == 0 ? this.blockIndexInTexture + 2 : (var1 == 1 ? this.blockIndexInTexture + 1 : this.blockIndexInTexture);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(var5 > 0 && Block.blocksList[var5].canProvidePower() && var1.isBlockIndirectlyGettingPowered(var2, var3, var4)) {
this.onBlockDestroyedByPlayer(var1, var2, var3, var4, 0);
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
public int quantityDropped(Random var1) {
return 0;
}
public void onBlockDestroyedByExplosion(World var1, int var2, int var3, int var4) {
EntityTNTPrimed var5 = new EntityTNTPrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F));
var5.fuse = var1.rand.nextInt(var5.fuse / 4) + var5.fuse / 8;
var1.entityJoinedWorld(var5);
}
public void onBlockDestroyedByPlayer(World var1, int var2, int var3, int var4, int var5) {
if(!var1.multiplayerWorld) {
EntityTNTPrimed var6 = new EntityTNTPrimed(var1, (double)((float)var2 + 0.5F), (double)((float)var3 + 0.5F), (double)((float)var4 + 0.5F));
var1.entityJoinedWorld(var6);
var1.playSoundAtEntity(var6, "random.fuse", 1.0F, 1.0F);
}
}
}

View File

@ -1,132 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class BlockTorch extends Block {
protected BlockTorch(int var1, int var2) {
super(var1, var2, Material.circuits);
this.setTickOnLoad(true);
}
public AxisAlignedBB getCollisionBoundingBoxFromPool(World var1, int var2, int var3, int var4) {
return null;
}
public boolean allowsAttachment() {
return false;
}
public boolean canPlaceBlockAt(World var1, int var2, int var3, int var4) {
return var1.doesBlockAllowAttachment(var2 - 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2 + 1, var3, var4) ? true : (var1.doesBlockAllowAttachment(var2, var3, var4 - 1) ? true : (var1.doesBlockAllowAttachment(var2, var3, var4 + 1) ? true : var1.doesBlockAllowAttachment(var2, var3 - 1, var4))));
}
public void onBlockPlaced(World var1, int var2, int var3, int var4, int var5) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
if(var5 == 1 && var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var6 = 5;
}
if(var5 == 2 && var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var6 = 4;
}
if(var5 == 3 && var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var6 = 3;
}
if(var5 == 4 && var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var6 = 2;
}
if(var5 == 5 && var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var6 = 1;
}
var1.setBlockMetadataWithNotify(var2, var3, var4, var6);
}
public void updateTick(World var1, int var2, int var3, int var4, Random var5) {
super.updateTick(var1, var2, var3, var4, var5);
if(var1.getBlockMetadata(var2, var3, var4) == 0) {
this.onBlockAdded(var1, var2, var3, var4);
}
}
public void onBlockAdded(World var1, int var2, int var3, int var4) {
if(var1.doesBlockAllowAttachment(var2 - 1, var3, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 1);
} else if(var1.doesBlockAllowAttachment(var2 + 1, var3, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 2);
} else if(var1.doesBlockAllowAttachment(var2, var3, var4 - 1)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 3);
} else if(var1.doesBlockAllowAttachment(var2, var3, var4 + 1)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 4);
} else if(var1.doesBlockAllowAttachment(var2, var3 - 1, var4)) {
var1.setBlockMetadataWithNotify(var2, var3, var4, 5);
}
this.func_279_g(var1, var2, var3, var4);
}
public void onNeighborBlockChange(World var1, int var2, int var3, int var4, int var5) {
if(this.func_279_g(var1, var2, var3, var4)) {
int var6 = var1.getBlockMetadata(var2, var3, var4);
boolean var7 = false;
if(!var1.doesBlockAllowAttachment(var2 - 1, var3, var4) && var6 == 1) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2 + 1, var3, var4) && var6 == 2) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3, var4 - 1) && var6 == 3) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3, var4 + 1) && var6 == 4) {
var7 = true;
}
if(!var1.doesBlockAllowAttachment(var2, var3 - 1, var4) && var6 == 5) {
var7 = true;
}
if(var7) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
}
}
}
private boolean func_279_g(World var1, int var2, int var3, int var4) {
if(!this.canPlaceBlockAt(var1, var2, var3, var4)) {
this.dropBlockAsItem(var1, var2, var3, var4, var1.getBlockMetadata(var2, var3, var4));
var1.setBlockWithNotify(var2, var3, var4, 0);
return false;
} else {
return true;
}
}
public MovingObjectPosition collisionRayTrace(World var1, int var2, int var3, int var4, Vec3D var5, Vec3D var6) {
int var7 = var1.getBlockMetadata(var2, var3, var4) & 7;
float var8 = 0.15F;
if(var7 == 1) {
this.setBlockBounds(0.0F, 0.2F, 0.5F - var8, var8 * 2.0F, 0.8F, 0.5F + var8);
} else if(var7 == 2) {
this.setBlockBounds(1.0F - var8 * 2.0F, 0.2F, 0.5F - var8, 1.0F, 0.8F, 0.5F + var8);
} else if(var7 == 3) {
this.setBlockBounds(0.5F - var8, 0.2F, 0.0F, 0.5F + var8, 0.8F, var8 * 2.0F);
} else if(var7 == 4) {
this.setBlockBounds(0.5F - var8, 0.2F, 1.0F - var8 * 2.0F, 0.5F + var8, 0.8F, 1.0F);
} else {
var8 = 0.1F;
this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, 0.6F, 0.5F + var8);
}
return super.collisionRayTrace(var1, var2, var3, var4, var5, var6);
}
}

View File

@ -1,17 +0,0 @@
package net.minecraft.src;
public class BlockWorkbench extends Block {
protected BlockWorkbench(int var1) {
super(var1, Material.wood);
this.blockIndexInTexture = 59;
}
public int getBlockTextureFromSide(int var1) {
return var1 == 1 ? this.blockIndexInTexture - 16 : (var1 == 0 ? Block.planks.getBlockTextureFromSide(0) : (var1 != 2 && var1 != 4 ? this.blockIndexInTexture : this.blockIndexInTexture + 1));
}
public boolean blockActivated(World var1, int var2, int var3, int var4, EntityPlayer var5) {
var5.func_174_A();
return true;
}
}

View File

@ -1,575 +0,0 @@
package net.minecraft.src;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class Chunk {
public static boolean field_694_a;
public byte[] blocks;
public boolean field_692_c;
public World worldObj;
public NibbleArray data;
public NibbleArray skylightMap;
public NibbleArray blocklightMap;
public byte[] heightMap;
public int field_686_i;
public final int xPosition;
public final int zPosition;
public Map field_683_l;
public List[] entities;
public boolean isTerrainPopulated;
public boolean isModified;
public boolean field_679_p;
public boolean field_678_q;
public boolean field_677_r;
public long field_676_s;
public Chunk(World var1, int var2, int var3) {
this.field_683_l = new HashMap();
this.entities = new List[8];
this.isTerrainPopulated = false;
this.isModified = false;
this.field_678_q = false;
this.field_677_r = false;
this.field_676_s = 0L;
this.worldObj = var1;
this.xPosition = var2;
this.zPosition = var3;
this.heightMap = new byte[256];
for(int var4 = 0; var4 < this.entities.length; ++var4) {
this.entities[var4] = new ArrayList();
}
}
public Chunk(World var1, byte[] var2, int var3, int var4) {
this(var1, var3, var4);
this.blocks = var2;
this.data = new NibbleArray(var2.length);
this.skylightMap = new NibbleArray(var2.length);
this.blocklightMap = new NibbleArray(var2.length);
}
public boolean func_351_a(int var1, int var2) {
return var1 == this.xPosition && var2 == this.zPosition;
}
public int getHeightValue(int var1, int var2) {
return this.heightMap[var2 << 4 | var1] & 255;
}
public void func_348_a() {
}
public void func_353_b() {
int var1 = 127;
int var2;
int var3;
for(var2 = 0; var2 < 16; ++var2) {
for(var3 = 0; var3 < 16; ++var3) {
this.heightMap[var3 << 4 | var2] = -128;
this.func_339_g(var2, 127, var3);
if((this.heightMap[var3 << 4 | var2] & 255) < var1) {
var1 = this.heightMap[var3 << 4 | var2] & 255;
}
}
}
this.field_686_i = var1;
for(var2 = 0; var2 < 16; ++var2) {
for(var3 = 0; var3 < 16; ++var3) {
this.func_333_c(var2, var3);
}
}
this.isModified = true;
}
public void func_4053_c() {
byte var1 = 32;
for(int var2 = 0; var2 < 16; ++var2) {
for(int var3 = 0; var3 < 16; ++var3) {
int var4 = var2 << 11 | var3 << 7;
int var5;
int var6;
for(var5 = 0; var5 < 128; ++var5) {
var6 = Block.lightValue[this.blocks[var4 + var5]];
if(var6 > 0) {
this.blocklightMap.setNibble(var2, var5, var3, var6);
}
}
var5 = 15;
for(var6 = var1 - 2; var6 < 128 && var5 > 0; this.blocklightMap.setNibble(var2, var6, var3, var5)) {
++var6;
byte var7 = this.blocks[var4 + var6];
int var8 = Block.lightOpacity[var7];
int var9 = Block.lightValue[var7];
if(var8 == 0) {
var8 = 1;
}
var5 -= var8;
if(var9 > var5) {
var5 = var9;
}
if(var5 < 0) {
var5 = 0;
}
}
}
}
this.worldObj.func_483_a(EnumSkyBlock.Block, this.xPosition * 16, var1 - 1, this.zPosition * 16, this.xPosition * 16 + 16, var1 + 1, this.zPosition * 16 + 16);
this.isModified = true;
}
private void func_333_c(int var1, int var2) {
int var3 = this.getHeightValue(var1, var2);
int var4 = this.xPosition * 16 + var1;
int var5 = this.zPosition * 16 + var2;
this.func_355_f(var4 - 1, var5, var3);
this.func_355_f(var4 + 1, var5, var3);
this.func_355_f(var4, var5 - 1, var3);
this.func_355_f(var4, var5 + 1, var3);
}
private void func_355_f(int var1, int var2, int var3) {
int var4 = this.worldObj.getHeightValue(var1, var2);
if(var4 > var3) {
this.worldObj.func_483_a(EnumSkyBlock.Sky, var1, var3, var2, var1, var4, var2);
} else if(var4 < var3) {
this.worldObj.func_483_a(EnumSkyBlock.Sky, var1, var4, var2, var1, var3, var2);
}
this.isModified = true;
}
private void func_339_g(int var1, int var2, int var3) {
int var4 = this.heightMap[var3 << 4 | var1] & 255;
int var5 = var4;
if(var2 > var4) {
var5 = var2;
}
for(int var6 = var1 << 11 | var3 << 7; var5 > 0 && Block.lightOpacity[this.blocks[var6 + var5 - 1]] == 0; --var5) {
}
if(var5 != var4) {
this.worldObj.func_498_f(var1, var3, var5, var4);
this.heightMap[var3 << 4 | var1] = (byte)var5;
int var7;
int var8;
int var9;
if(var5 < this.field_686_i) {
this.field_686_i = var5;
} else {
var7 = 127;
for(var8 = 0; var8 < 16; ++var8) {
for(var9 = 0; var9 < 16; ++var9) {
if((this.heightMap[var9 << 4 | var8] & 255) < var7) {
var7 = this.heightMap[var9 << 4 | var8] & 255;
}
}
}
this.field_686_i = var7;
}
var7 = this.xPosition * 16 + var1;
var8 = this.zPosition * 16 + var3;
if(var5 < var4) {
for(var9 = var5; var9 < var4; ++var9) {
this.skylightMap.setNibble(var1, var9, var3, 15);
}
} else {
this.worldObj.func_483_a(EnumSkyBlock.Sky, var7, var4, var8, var7, var5, var8);
for(var9 = var4; var9 < var5; ++var9) {
this.skylightMap.setNibble(var1, var9, var3, 0);
}
}
var9 = 15;
int var10;
for(var10 = var5; var5 > 0 && var9 > 0; this.skylightMap.setNibble(var1, var5, var3, var9)) {
--var5;
int var11 = Block.lightOpacity[this.getBlockID(var1, var5, var3)];
if(var11 == 0) {
var11 = 1;
}
var9 -= var11;
if(var9 < 0) {
var9 = 0;
}
}
while(var5 > 0 && Block.lightOpacity[this.getBlockID(var1, var5 - 1, var3)] == 0) {
--var5;
}
if(var5 != var10) {
this.worldObj.func_483_a(EnumSkyBlock.Sky, var7 - 1, var5, var8 - 1, var7 + 1, var10, var8 + 1);
}
this.isModified = true;
}
}
public int getBlockID(int var1, int var2, int var3) {
return this.blocks[var1 << 11 | var3 << 7 | var2];
}
public boolean setBlockIDWithMetadata(int var1, int var2, int var3, int var4, int var5) {
byte var6 = (byte)var4;
int var7 = this.heightMap[var3 << 4 | var1] & 255;
int var8 = this.blocks[var1 << 11 | var3 << 7 | var2] & 255;
if(var8 == var4 && this.data.getNibble(var1, var2, var3) == var5) {
return false;
} else {
int var9 = this.xPosition * 16 + var1;
int var10 = this.zPosition * 16 + var3;
this.blocks[var1 << 11 | var3 << 7 | var2] = var6;
if(var8 != 0 && !this.worldObj.multiplayerWorld) {
Block.blocksList[var8].onBlockRemoval(this.worldObj, var9, var2, var10);
}
this.data.setNibble(var1, var2, var3, var5);
if(!this.worldObj.field_4272_q.field_4306_c) {
if(Block.lightOpacity[var6] != 0) {
if(var2 >= var7) {
this.func_339_g(var1, var2 + 1, var3);
}
} else if(var2 == var7 - 1) {
this.func_339_g(var1, var2, var3);
}
this.worldObj.func_483_a(EnumSkyBlock.Sky, var9, var2, var10, var9, var2, var10);
}
this.worldObj.func_483_a(EnumSkyBlock.Block, var9, var2, var10, var9, var2, var10);
this.func_333_c(var1, var3);
if(var4 != 0) {
Block.blocksList[var4].onBlockAdded(this.worldObj, var9, var2, var10);
}
this.data.setNibble(var1, var2, var3, var5);
this.isModified = true;
return true;
}
}
public boolean setBlockID(int var1, int var2, int var3, int var4) {
byte var5 = (byte)var4;
int var6 = this.heightMap[var3 << 4 | var1] & 255;
int var7 = this.blocks[var1 << 11 | var3 << 7 | var2] & 255;
if(var7 == var4) {
return false;
} else {
int var8 = this.xPosition * 16 + var1;
int var9 = this.zPosition * 16 + var3;
this.blocks[var1 << 11 | var3 << 7 | var2] = var5;
if(var7 != 0) {
Block.blocksList[var7].onBlockRemoval(this.worldObj, var8, var2, var9);
}
this.data.setNibble(var1, var2, var3, 0);
if(Block.lightOpacity[var5] != 0) {
if(var2 >= var6) {
this.func_339_g(var1, var2 + 1, var3);
}
} else if(var2 == var6 - 1) {
this.func_339_g(var1, var2, var3);
}
this.worldObj.func_483_a(EnumSkyBlock.Sky, var8, var2, var9, var8, var2, var9);
this.worldObj.func_483_a(EnumSkyBlock.Block, var8, var2, var9, var8, var2, var9);
this.func_333_c(var1, var3);
if(var4 != 0 && !this.worldObj.multiplayerWorld) {
Block.blocksList[var4].onBlockAdded(this.worldObj, var8, var2, var9);
}
this.isModified = true;
return true;
}
}
public int getBlockMetadata(int var1, int var2, int var3) {
return this.data.getNibble(var1, var2, var3);
}
public void setBlockMetadata(int var1, int var2, int var3, int var4) {
this.isModified = true;
this.data.setNibble(var1, var2, var3, var4);
}
public int getSavedLightValue(EnumSkyBlock var1, int var2, int var3, int var4) {
return var1 == EnumSkyBlock.Sky ? this.skylightMap.getNibble(var2, var3, var4) : (var1 == EnumSkyBlock.Block ? this.blocklightMap.getNibble(var2, var3, var4) : 0);
}
public void setLightValue(EnumSkyBlock var1, int var2, int var3, int var4, int var5) {
this.isModified = true;
if(var1 == EnumSkyBlock.Sky) {
this.skylightMap.setNibble(var2, var3, var4, var5);
} else {
if(var1 != EnumSkyBlock.Block) {
return;
}
this.blocklightMap.setNibble(var2, var3, var4, var5);
}
}
public int getBlockLightValue(int var1, int var2, int var3, int var4) {
int var5 = this.skylightMap.getNibble(var1, var2, var3);
if(var5 > 0) {
field_694_a = true;
}
var5 -= var4;
int var6 = this.blocklightMap.getNibble(var1, var2, var3);
if(var6 > var5) {
var5 = var6;
}
return var5;
}
public void addEntity(Entity var1) {
if(!this.field_678_q) {
this.field_677_r = true;
int var2 = MathHelper.floor_double(var1.posX / 16.0D);
int var3 = MathHelper.floor_double(var1.posZ / 16.0D);
if(var2 != this.xPosition || var3 != this.zPosition) {
System.out.println("Wrong location! " + var1);
Thread.dumpStack();
}
int var4 = MathHelper.floor_double(var1.posY / 16.0D);
if(var4 < 0) {
var4 = 0;
}
if(var4 >= this.entities.length) {
var4 = this.entities.length - 1;
}
var1.field_276_Z = true;
var1.field_307_aa = this.xPosition;
var1.field_305_ab = var4;
var1.field_303_ac = this.zPosition;
this.entities[var4].add(var1);
}
}
public void func_350_b(Entity var1) {
this.func_332_a(var1, var1.field_305_ab);
}
public void func_332_a(Entity var1, int var2) {
if(var2 < 0) {
var2 = 0;
}
if(var2 >= this.entities.length) {
var2 = this.entities.length - 1;
}
this.entities[var2].remove(var1);
}
public boolean canBlockSeeTheSky(int var1, int var2, int var3) {
return var2 >= (this.heightMap[var3 << 4 | var1] & 255);
}
public TileEntity func_338_d(int var1, int var2, int var3) {
ChunkPosition var4 = new ChunkPosition(var1, var2, var3);
TileEntity var5 = (TileEntity)this.field_683_l.get(var4);
if(var5 == null) {
int var6 = this.getBlockID(var1, var2, var3);
if(!Block.isBlockContainer[var6]) {
return null;
}
BlockContainer var7 = (BlockContainer)Block.blocksList[var6];
var7.onBlockAdded(this.worldObj, this.xPosition * 16 + var1, var2, this.zPosition * 16 + var3);
var5 = (TileEntity)this.field_683_l.get(var4);
}
return var5;
}
public void func_349_a(TileEntity var1) {
int var2 = var1.xCoord - this.xPosition * 16;
int var3 = var1.yCoord;
int var4 = var1.zCoord - this.zPosition * 16;
this.func_352_a(var2, var3, var4, var1);
}
public void func_352_a(int var1, int var2, int var3, TileEntity var4) {
ChunkPosition var5 = new ChunkPosition(var1, var2, var3);
var4.worldObj = this.worldObj;
var4.xCoord = this.xPosition * 16 + var1;
var4.yCoord = var2;
var4.zCoord = this.zPosition * 16 + var3;
if(this.getBlockID(var1, var2, var3) != 0 && Block.blocksList[this.getBlockID(var1, var2, var3)] instanceof BlockContainer) {
if(this.field_692_c) {
if(this.field_683_l.get(var5) != null) {
this.worldObj.field_814_b.remove(this.field_683_l.get(var5));
}
this.worldObj.field_814_b.add(var4);
}
this.field_683_l.put(var5, var4);
} else {
System.out.println("Attempted to place a tile entity where there was no entity tile!");
}
}
public void func_359_e(int var1, int var2, int var3) {
ChunkPosition var4 = new ChunkPosition(var1, var2, var3);
if(this.field_692_c) {
this.worldObj.field_814_b.remove(this.field_683_l.remove(var4));
}
}
public void func_358_c() {
this.field_692_c = true;
this.worldObj.field_814_b.addAll(this.field_683_l.values());
for(int var1 = 0; var1 < this.entities.length; ++var1) {
this.worldObj.func_464_a(this.entities[var1]);
}
}
public void func_331_d() {
this.field_692_c = false;
this.worldObj.field_814_b.removeAll(this.field_683_l.values());
for(int var1 = 0; var1 < this.entities.length; ++var1) {
this.worldObj.func_461_b(this.entities[var1]);
}
}
public void func_336_e() {
this.isModified = true;
}
public void getEntitiesWithinAABBForEntity(Entity var1, AxisAlignedBB var2, List var3) {
int var4 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D);
int var5 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D);
if(var4 < 0) {
var4 = 0;
}
if(var5 >= this.entities.length) {
var5 = this.entities.length - 1;
}
for(int var6 = var4; var6 <= var5; ++var6) {
List var7 = this.entities[var6];
for(int var8 = 0; var8 < var7.size(); ++var8) {
Entity var9 = (Entity)var7.get(var8);
if(var9 != var1 && var9.boundingBox.intersectsWith(var2)) {
var3.add(var9);
}
}
}
}
public void getEntitiesOfTypeWithinAAAB(Class var1, AxisAlignedBB var2, List var3) {
int var4 = MathHelper.floor_double((var2.minY - 2.0D) / 16.0D);
int var5 = MathHelper.floor_double((var2.maxY + 2.0D) / 16.0D);
if(var4 < 0) {
var4 = 0;
}
if(var5 >= this.entities.length) {
var5 = this.entities.length - 1;
}
for(int var6 = var4; var6 <= var5; ++var6) {
List var7 = this.entities[var6];
for(int var8 = 0; var8 < var7.size(); ++var8) {
Entity var9 = (Entity)var7.get(var8);
if(var1.isAssignableFrom(var9.getClass()) && var9.boundingBox.intersectsWith(var2)) {
var3.add(var9);
}
}
}
}
public boolean func_347_a() {
return this.field_679_p ? false : (this.field_677_r && this.worldObj.worldTime != this.field_676_s ? true : this.isModified);
}
public int func_340_a(byte[] var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8) {
int var9;
int var10;
int var11;
int var12;
for(var9 = var2; var9 < var5; ++var9) {
for(var10 = var4; var10 < var7; ++var10) {
var11 = var9 << 11 | var10 << 7 | var3;
var12 = var6 - var3;
System.arraycopy(this.blocks, var11, var1, var8, var12);
var8 += var12;
}
}
for(var9 = var2; var9 < var5; ++var9) {
for(var10 = var4; var10 < var7; ++var10) {
var11 = (var9 << 11 | var10 << 7 | var3) >> 1;
var12 = (var6 - var3) / 2;
System.arraycopy(this.data.data, var11, var1, var8, var12);
var8 += var12;
}
}
for(var9 = var2; var9 < var5; ++var9) {
for(var10 = var4; var10 < var7; ++var10) {
var11 = (var9 << 11 | var10 << 7 | var3) >> 1;
var12 = (var6 - var3) / 2;
System.arraycopy(this.blocklightMap.data, var11, var1, var8, var12);
var8 += var12;
}
}
for(var9 = var2; var9 < var5; ++var9) {
for(var10 = var4; var10 < var7; ++var10) {
var11 = (var9 << 11 | var10 << 7 | var3) >> 1;
var12 = (var6 - var3) / 2;
System.arraycopy(this.skylightMap.data, var11, var1, var8, var12);
var8 += var12;
}
}
return var8;
}
public Random func_334_a(long var1) {
return new Random(this.worldObj.randomSeed + (long)(this.xPosition * this.xPosition * 4987142) + (long)(this.xPosition * 5947611) + (long)(this.zPosition * this.zPosition) * 4392871L + (long)(this.zPosition * 389711) ^ var1);
}
}

View File

@ -1,58 +0,0 @@
package net.minecraft.src;
public class ChunkCache implements IBlockAccess {
private int field_823_a;
private int field_822_b;
private Chunk[][] field_825_c;
private World worldObj;
public ChunkCache(World var1, int var2, int var3, int var4, int var5, int var6, int var7) {
this.worldObj = var1;
this.field_823_a = var2 >> 4;
this.field_822_b = var4 >> 4;
int var8 = var5 >> 4;
int var9 = var7 >> 4;
this.field_825_c = new Chunk[var8 - this.field_823_a + 1][var9 - this.field_822_b + 1];
for(int var10 = this.field_823_a; var10 <= var8; ++var10) {
for(int var11 = this.field_822_b; var11 <= var9; ++var11) {
this.field_825_c[var10 - this.field_823_a][var11 - this.field_822_b] = var1.getChunkFromChunkCoords(var10, var11);
}
}
}
public int getBlockId(int var1, int var2, int var3) {
if(var2 < 0) {
return 0;
} else if(var2 >= 128) {
return 0;
} else {
int var4 = (var1 >> 4) - this.field_823_a;
int var5 = (var3 >> 4) - this.field_822_b;
return this.field_825_c[var4][var5].getBlockID(var1 & 15, var2, var3 & 15);
}
}
public int getBlockMetadata(int var1, int var2, int var3) {
if(var2 < 0) {
return 0;
} else if(var2 >= 128) {
return 0;
} else {
int var4 = (var1 >> 4) - this.field_823_a;
int var5 = (var3 >> 4) - this.field_822_b;
return this.field_825_c[var4][var5].getBlockMetadata(var1 & 15, var2, var3 & 15);
}
}
public Material getBlockMaterial(int var1, int var2, int var3) {
int var4 = this.getBlockId(var1, var2, var3);
return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial;
}
public boolean doesBlockAllowAttachment(int var1, int var2, int var3) {
Block var4 = Block.blocksList[this.getBlockId(var1, var2, var3)];
return var4 == null ? false : var4.allowsAttachment();
}
}

View File

@ -1,28 +0,0 @@
package net.minecraft.src;
public class ChunkCoordIntPair {
public int field_152_a;
public int field_151_b;
public ChunkCoordIntPair(int var1, int var2) {
this.field_152_a = var1;
this.field_151_b = var2;
}
public int hashCode() {
return this.field_152_a << 8 | this.field_151_b;
}
public boolean equals(Object var1) {
ChunkCoordIntPair var2 = (ChunkCoordIntPair)var1;
return var2.field_152_a == this.field_152_a && var2.field_151_b == this.field_151_b;
}
public double func_73_a(Entity var1) {
double var2 = (double)(this.field_152_a * 16 + 8);
double var4 = (double)(this.field_151_b * 16 + 8);
double var6 = var2 - var1.posX;
double var8 = var4 - var1.posZ;
return var6 * var6 + var8 * var8;
}
}

View File

@ -1,24 +0,0 @@
package net.minecraft.src;
final class ChunkCoordinates {
public final int field_529_a;
public final int field_528_b;
public ChunkCoordinates(int var1, int var2) {
this.field_529_a = var1;
this.field_528_b = var2;
}
public boolean equals(Object var1) {
if(!(var1 instanceof ChunkCoordinates)) {
return false;
} else {
ChunkCoordinates var2 = (ChunkCoordinates)var1;
return this.field_529_a == var2.field_529_a && this.field_528_b == var2.field_528_b;
}
}
public int hashCode() {
return this.field_529_a << 16 ^ this.field_528_b;
}
}

View File

@ -1,207 +0,0 @@
package net.minecraft.src;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Iterator;
public class ChunkLoader implements IChunkLoader {
private File field_945_a;
private boolean field_944_b;
public ChunkLoader(File var1, boolean var2) {
this.field_945_a = var1;
this.field_944_b = var2;
}
private File func_665_a(int var1, int var2) {
String var3 = "c." + Integer.toString(var1, 36) + "." + Integer.toString(var2, 36) + ".dat";
String var4 = Integer.toString(var1 & 63, 36);
String var5 = Integer.toString(var2 & 63, 36);
File var6 = new File(this.field_945_a, var4);
if(!var6.exists()) {
if(!this.field_944_b) {
return null;
}
var6.mkdir();
}
var6 = new File(var6, var5);
if(!var6.exists()) {
if(!this.field_944_b) {
return null;
}
var6.mkdir();
}
var6 = new File(var6, var3);
return !var6.exists() && !this.field_944_b ? null : var6;
}
public Chunk func_659_a(World var1, int var2, int var3) throws IOException {
File var4 = this.func_665_a(var2, var3);
if(var4 != null && var4.exists()) {
try {
FileInputStream var5 = new FileInputStream(var4);
NBTTagCompound var6 = CompressedStreamTools.func_770_a(var5);
if(!var6.hasKey("Level")) {
System.out.println("Chunk file at " + var2 + "," + var3 + " is missing level data, skipping");
return null;
}
if(!var6.getCompoundTag("Level").hasKey("Blocks")) {
System.out.println("Chunk file at " + var2 + "," + var3 + " is missing block data, skipping");
return null;
}
Chunk var7 = func_664_a(var1, var6.getCompoundTag("Level"));
if(!var7.func_351_a(var2, var3)) {
System.out.println("Chunk file at " + var2 + "," + var3 + " is in the wrong location; relocating. (Expected " + var2 + ", " + var3 + ", got " + var7.xPosition + ", " + var7.zPosition + ")");
var6.setInteger("xPos", var2);
var6.setInteger("zPos", var3);
var7 = func_664_a(var1, var6.getCompoundTag("Level"));
}
return var7;
} catch (Exception var8) {
var8.printStackTrace();
}
}
return null;
}
public void func_662_a(World var1, Chunk var2) throws IOException {
var1.func_476_g();
File var3 = this.func_665_a(var2.xPosition, var2.zPosition);
if(var3.exists()) {
var1.sizeOnDisk -= var3.length();
}
try {
File var4 = new File(this.field_945_a, "tmp_chunk.dat");
FileOutputStream var5 = new FileOutputStream(var4);
NBTTagCompound var6 = new NBTTagCompound();
NBTTagCompound var7 = new NBTTagCompound();
var6.setTag("Level", var7);
this.func_663_a(var2, var1, var7);
CompressedStreamTools.func_769_a(var6, var5);
var5.close();
if(var3.exists()) {
var3.delete();
}
var4.renameTo(var3);
var1.sizeOnDisk += var3.length();
} catch (Exception var8) {
var8.printStackTrace();
}
}
public void func_663_a(Chunk var1, World var2, NBTTagCompound var3) {
var2.func_476_g();
var3.setInteger("xPos", var1.xPosition);
var3.setInteger("zPos", var1.zPosition);
var3.setLong("LastUpdate", var2.worldTime);
var3.setByteArray("Blocks", var1.blocks);
var3.setByteArray("Data", var1.data.data);
var3.setByteArray("SkyLight", var1.skylightMap.data);
var3.setByteArray("BlockLight", var1.blocklightMap.data);
var3.setByteArray("HeightMap", var1.heightMap);
var3.setBoolean("TerrainPopulated", var1.isTerrainPopulated);
var1.field_677_r = false;
NBTTagList var4 = new NBTTagList();
Iterator var6;
NBTTagCompound var8;
for(int var5 = 0; var5 < var1.entities.length; ++var5) {
var6 = var1.entities[var5].iterator();
while(var6.hasNext()) {
Entity var7 = (Entity)var6.next();
var1.field_677_r = true;
var8 = new NBTTagCompound();
if(var7.func_95_c(var8)) {
var4.setTag(var8);
}
}
}
var3.setTag("Entities", var4);
NBTTagList var9 = new NBTTagList();
var6 = var1.field_683_l.values().iterator();
while(var6.hasNext()) {
TileEntity var10 = (TileEntity)var6.next();
var8 = new NBTTagCompound();
var10.writeToNBT(var8);
var9.setTag(var8);
}
var3.setTag("TileEntities", var9);
}
public static Chunk func_664_a(World var0, NBTTagCompound var1) {
int var2 = var1.getInteger("xPos");
int var3 = var1.getInteger("zPos");
Chunk var4 = new Chunk(var0, var2, var3);
var4.blocks = var1.getByteArray("Blocks");
var4.data = new NibbleArray(var1.getByteArray("Data"));
var4.skylightMap = new NibbleArray(var1.getByteArray("SkyLight"));
var4.blocklightMap = new NibbleArray(var1.getByteArray("BlockLight"));
var4.heightMap = var1.getByteArray("HeightMap");
var4.isTerrainPopulated = var1.getBoolean("TerrainPopulated");
if(!var4.data.isValid()) {
var4.data = new NibbleArray(var4.blocks.length);
}
if(var4.heightMap == null || !var4.skylightMap.isValid()) {
var4.heightMap = new byte[256];
var4.skylightMap = new NibbleArray(var4.blocks.length);
var4.func_353_b();
}
if(!var4.blocklightMap.isValid()) {
var4.blocklightMap = new NibbleArray(var4.blocks.length);
var4.func_348_a();
}
NBTTagList var5 = var1.getTagList("Entities");
if(var5 != null) {
for(int var6 = 0; var6 < var5.tagCount(); ++var6) {
NBTTagCompound var7 = (NBTTagCompound)var5.tagAt(var6);
Entity var8 = EntityList.func_566_a(var7, var0);
var4.field_677_r = true;
if(var8 != null) {
var4.addEntity(var8);
}
}
}
NBTTagList var10 = var1.getTagList("TileEntities");
if(var10 != null) {
for(int var11 = 0; var11 < var10.tagCount(); ++var11) {
NBTTagCompound var12 = (NBTTagCompound)var10.tagAt(var11);
TileEntity var9 = TileEntity.createAndLoadEntity(var12);
if(var9 != null) {
var4.func_349_a(var9);
}
}
}
return var4;
}
public void func_661_a() {
}
public void func_660_b() {
}
public void func_4104_b(World var1, Chunk var2) throws IOException {
}
}

View File

@ -1,26 +0,0 @@
package net.minecraft.src;
public class ChunkPosition {
public final int field_846_a;
public final int field_845_b;
public final int field_847_c;
public ChunkPosition(int var1, int var2, int var3) {
this.field_846_a = var1;
this.field_845_b = var2;
this.field_847_c = var3;
}
public boolean equals(Object var1) {
if(!(var1 instanceof ChunkPosition)) {
return false;
} else {
ChunkPosition var2 = (ChunkPosition)var1;
return var2.field_846_a == this.field_846_a && var2.field_845_b == this.field_845_b && var2.field_847_c == this.field_847_c;
}
}
public int hashCode() {
return this.field_846_a * 8976890 + this.field_845_b * 981131 + this.field_847_c;
}
}

View File

@ -1,546 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class ChunkProviderGenerate implements IChunkProvider {
private Random rand;
private NoiseGeneratorOctaves field_705_k;
private NoiseGeneratorOctaves field_704_l;
private NoiseGeneratorOctaves field_703_m;
private NoiseGeneratorOctaves field_702_n;
private NoiseGeneratorOctaves field_701_o;
public NoiseGeneratorOctaves field_715_a;
public NoiseGeneratorOctaves field_714_b;
public NoiseGeneratorOctaves field_713_c;
private World worldObj;
private double[] field_4224_q;
private double[] field_698_r = new double[256];
private double[] field_697_s = new double[256];
private double[] field_696_t = new double[256];
private MapGenBase field_695_u = new MapGenCaves();
private MobSpawnerBase[] biomesForGeneration;
double[] field_4229_d;
double[] field_4228_e;
double[] field_4227_f;
double[] field_4226_g;
double[] field_4225_h;
int[][] field_707_i = new int[32][32];
private double[] field_4222_w;
public ChunkProviderGenerate(World var1, long var2) {
this.worldObj = var1;
this.rand = new Random(var2);
this.field_705_k = new NoiseGeneratorOctaves(this.rand, 16);
this.field_704_l = new NoiseGeneratorOctaves(this.rand, 16);
this.field_703_m = new NoiseGeneratorOctaves(this.rand, 8);
this.field_702_n = new NoiseGeneratorOctaves(this.rand, 4);
this.field_701_o = new NoiseGeneratorOctaves(this.rand, 4);
this.field_715_a = new NoiseGeneratorOctaves(this.rand, 10);
this.field_714_b = new NoiseGeneratorOctaves(this.rand, 16);
this.field_713_c = new NoiseGeneratorOctaves(this.rand, 8);
}
public void generateTerrain(int var1, int var2, byte[] var3, MobSpawnerBase[] var4, double[] var5) {
byte var6 = 4;
byte var7 = 64;
int var8 = var6 + 1;
byte var9 = 17;
int var10 = var6 + 1;
this.field_4224_q = this.func_4058_a(this.field_4224_q, var1 * var6, 0, var2 * var6, var8, var9, var10);
for(int var11 = 0; var11 < var6; ++var11) {
for(int var12 = 0; var12 < var6; ++var12) {
for(int var13 = 0; var13 < 16; ++var13) {
double var14 = 0.125D;
double var16 = this.field_4224_q[((var11 + 0) * var10 + var12 + 0) * var9 + var13 + 0];
double var18 = this.field_4224_q[((var11 + 0) * var10 + var12 + 1) * var9 + var13 + 0];
double var20 = this.field_4224_q[((var11 + 1) * var10 + var12 + 0) * var9 + var13 + 0];
double var22 = this.field_4224_q[((var11 + 1) * var10 + var12 + 1) * var9 + var13 + 0];
double var24 = (this.field_4224_q[((var11 + 0) * var10 + var12 + 0) * var9 + var13 + 1] - var16) * var14;
double var26 = (this.field_4224_q[((var11 + 0) * var10 + var12 + 1) * var9 + var13 + 1] - var18) * var14;
double var28 = (this.field_4224_q[((var11 + 1) * var10 + var12 + 0) * var9 + var13 + 1] - var20) * var14;
double var30 = (this.field_4224_q[((var11 + 1) * var10 + var12 + 1) * var9 + var13 + 1] - var22) * var14;
for(int var32 = 0; var32 < 8; ++var32) {
double var33 = 0.25D;
double var35 = var16;
double var37 = var18;
double var39 = (var20 - var16) * var33;
double var41 = (var22 - var18) * var33;
for(int var43 = 0; var43 < 4; ++var43) {
int var44 = var43 + var11 * 4 << 11 | 0 + var12 * 4 << 7 | var13 * 8 + var32;
short var45 = 128;
double var46 = 0.25D;
double var48 = var35;
double var50 = (var37 - var35) * var46;
for(int var52 = 0; var52 < 4; ++var52) {
double var53 = var5[(var11 * 4 + var43) * 16 + var12 * 4 + var52];
int var55 = 0;
if(var13 * 8 + var32 < var7) {
if(var53 < 0.5D && var13 * 8 + var32 >= var7 - 1) {
var55 = Block.ice.blockID;
} else {
var55 = Block.waterMoving.blockID;
}
}
if(var48 > 0.0D) {
var55 = Block.stone.blockID;
}
var3[var44] = (byte)var55;
var44 += var45;
var48 += var50;
}
var35 += var39;
var37 += var41;
}
var16 += var24;
var18 += var26;
var20 += var28;
var22 += var30;
}
}
}
}
}
public void replaceBlocksForBiome(int var1, int var2, byte[] var3, MobSpawnerBase[] var4) {
byte var5 = 64;
double var6 = 1.0D / 32.0D;
this.field_698_r = this.field_702_n.func_648_a(this.field_698_r, (double)(var1 * 16), (double)(var2 * 16), 0.0D, 16, 16, 1, var6, var6, 1.0D);
this.field_697_s = this.field_702_n.func_648_a(this.field_697_s, (double)(var2 * 16), 109.0134D, (double)(var1 * 16), 16, 1, 16, var6, 1.0D, var6);
this.field_696_t = this.field_701_o.func_648_a(this.field_696_t, (double)(var1 * 16), (double)(var2 * 16), 0.0D, 16, 16, 1, var6 * 2.0D, var6 * 2.0D, var6 * 2.0D);
for(int var8 = 0; var8 < 16; ++var8) {
for(int var9 = 0; var9 < 16; ++var9) {
MobSpawnerBase var10 = var4[var8 * 16 + var9];
boolean var11 = this.field_698_r[var8 + var9 * 16] + this.rand.nextDouble() * 0.2D > 0.0D;
boolean var12 = this.field_697_s[var8 + var9 * 16] + this.rand.nextDouble() * 0.2D > 3.0D;
int var13 = (int)(this.field_696_t[var8 + var9 * 16] / 3.0D + 3.0D + this.rand.nextDouble() * 0.25D);
int var14 = -1;
byte var15 = var10.topBlock;
byte var16 = var10.fillerBlock;
for(int var17 = 127; var17 >= 0; --var17) {
int var18 = (var8 * 16 + var9) * 128 + var17;
if(var17 <= 0 + this.rand.nextInt(5)) {
var3[var18] = (byte)Block.bedrock.blockID;
} else {
byte var19 = var3[var18];
if(var19 == 0) {
var14 = -1;
} else if(var19 == Block.stone.blockID) {
if(var14 == -1) {
if(var13 <= 0) {
var15 = 0;
var16 = (byte)Block.stone.blockID;
} else if(var17 >= var5 - 4 && var17 <= var5 + 1) {
var15 = var10.topBlock;
var16 = var10.fillerBlock;
if(var12) {
var15 = 0;
}
if(var12) {
var16 = (byte)Block.gravel.blockID;
}
if(var11) {
var15 = (byte)Block.sand.blockID;
}
if(var11) {
var16 = (byte)Block.sand.blockID;
}
}
if(var17 < var5 && var15 == 0) {
var15 = (byte)Block.waterMoving.blockID;
}
var14 = var13;
if(var17 >= var5 - 1) {
var3[var18] = var15;
} else {
var3[var18] = var16;
}
} else if(var14 > 0) {
--var14;
var3[var18] = var16;
}
}
}
}
}
}
}
public Chunk func_363_b(int var1, int var2) {
this.rand.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L);
byte[] var3 = new byte[-Short.MIN_VALUE];
Chunk var4 = new Chunk(this.worldObj, var3, var1, var2);
this.biomesForGeneration = this.worldObj.func_4077_a().loadBlockGeneratorData(this.biomesForGeneration, var1 * 16, var2 * 16, 16, 16);
double[] var5 = this.worldObj.func_4077_a().temperature;
this.generateTerrain(var1, var2, var3, this.biomesForGeneration, var5);
this.replaceBlocksForBiome(var1, var2, var3, this.biomesForGeneration);
this.field_695_u.func_667_a(this, this.worldObj, var1, var2, var3);
var4.func_353_b();
return var4;
}
private double[] func_4058_a(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) {
if(var1 == null) {
var1 = new double[var5 * var6 * var7];
}
double var8 = 684.412D;
double var10 = 684.412D;
double[] var12 = this.worldObj.func_4077_a().temperature;
double[] var13 = this.worldObj.func_4077_a().humidity;
this.field_4226_g = this.field_715_a.func_4103_a(this.field_4226_g, var2, var4, var5, var7, 1.121D, 1.121D, 0.5D);
this.field_4225_h = this.field_714_b.func_4103_a(this.field_4225_h, var2, var4, var5, var7, 200.0D, 200.0D, 0.5D);
this.field_4229_d = this.field_703_m.func_648_a(this.field_4229_d, (double)var2, (double)var3, (double)var4, var5, var6, var7, var8 / 80.0D, var10 / 160.0D, var8 / 80.0D);
this.field_4228_e = this.field_705_k.func_648_a(this.field_4228_e, (double)var2, (double)var3, (double)var4, var5, var6, var7, var8, var10, var8);
this.field_4227_f = this.field_704_l.func_648_a(this.field_4227_f, (double)var2, (double)var3, (double)var4, var5, var6, var7, var8, var10, var8);
int var14 = 0;
int var15 = 0;
int var16 = 16 / var5;
for(int var17 = 0; var17 < var5; ++var17) {
int var18 = var17 * var16 + var16 / 2;
for(int var19 = 0; var19 < var7; ++var19) {
int var20 = var19 * var16 + var16 / 2;
double var21 = var12[var18 * 16 + var20];
double var23 = var13[var18 * 16 + var20] * var21;
double var25 = 1.0D - var23;
var25 *= var25;
var25 *= var25;
var25 = 1.0D - var25;
double var27 = (this.field_4226_g[var15] + 256.0D) / 512.0D;
var27 *= var25;
if(var27 > 1.0D) {
var27 = 1.0D;
}
double var29 = this.field_4225_h[var15] / 8000.0D;
if(var29 < 0.0D) {
var29 = -var29 * 0.3D;
}
var29 = var29 * 3.0D - 2.0D;
if(var29 < 0.0D) {
var29 /= 2.0D;
if(var29 < -1.0D) {
var29 = -1.0D;
}
var29 /= 1.4D;
var29 /= 2.0D;
var27 = 0.0D;
} else {
if(var29 > 1.0D) {
var29 = 1.0D;
}
var29 /= 8.0D;
}
if(var27 < 0.0D) {
var27 = 0.0D;
}
var27 += 0.5D;
var29 = var29 * (double)var6 / 16.0D;
double var31 = (double)var6 / 2.0D + var29 * 4.0D;
++var15;
for(int var33 = 0; var33 < var6; ++var33) {
double var34 = 0.0D;
double var36 = ((double)var33 - var31) * 12.0D / var27;
if(var36 < 0.0D) {
var36 *= 4.0D;
}
double var38 = this.field_4228_e[var14] / 512.0D;
double var40 = this.field_4227_f[var14] / 512.0D;
double var42 = (this.field_4229_d[var14] / 10.0D + 1.0D) / 2.0D;
if(var42 < 0.0D) {
var34 = var38;
} else if(var42 > 1.0D) {
var34 = var40;
} else {
var34 = var38 + (var40 - var38) * var42;
}
var34 -= var36;
if(var33 > var6 - 4) {
double var44 = (double)((float)(var33 - (var6 - 4)) / 3.0F);
var34 = var34 * (1.0D - var44) + -10.0D * var44;
}
var1[var14] = var34;
++var14;
}
}
}
return var1;
}
public boolean chunkExists(int var1, int var2) {
return true;
}
public void populate(IChunkProvider var1, int var2, int var3) {
BlockSand.fallInstantly = true;
int var4 = var2 * 16;
int var5 = var3 * 16;
MobSpawnerBase var6 = this.worldObj.func_4077_a().func_4067_a(var4 + 16, var5 + 16);
this.rand.setSeed(this.worldObj.randomSeed);
long var7 = this.rand.nextLong() / 2L * 2L + 1L;
long var9 = this.rand.nextLong() / 2L * 2L + 1L;
this.rand.setSeed((long)var2 * var7 + (long)var3 * var9 ^ this.worldObj.randomSeed);
double var11 = 0.25D;
int var13;
int var14;
int var15;
if(this.rand.nextInt(4) == 0) {
var13 = var4 + this.rand.nextInt(16) + 8;
var14 = this.rand.nextInt(128);
var15 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenLakes(Block.waterMoving.blockID)).generate(this.worldObj, this.rand, var13, var14, var15);
}
if(this.rand.nextInt(8) == 0) {
var13 = var4 + this.rand.nextInt(16) + 8;
var14 = this.rand.nextInt(this.rand.nextInt(120) + 8);
var15 = var5 + this.rand.nextInt(16) + 8;
if(var14 < 64 || this.rand.nextInt(10) == 0) {
(new WorldGenLakes(Block.lavaMoving.blockID)).generate(this.worldObj, this.rand, var13, var14, var15);
}
}
int var16;
for(var13 = 0; var13 < 8; ++var13) {
var14 = var4 + this.rand.nextInt(16) + 8;
var15 = this.rand.nextInt(128);
var16 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenDungeons()).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 10; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(128);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenClay(32)).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 20; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(128);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenMinable(Block.dirt.blockID, 32)).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 10; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(128);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenMinable(Block.gravel.blockID, 32)).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 20; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(128);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenMinable(Block.oreCoal.blockID, 16)).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 20; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(64);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenMinable(Block.oreIron.blockID, 8)).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 2; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(32);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenMinable(Block.oreGold.blockID, 8)).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 8; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(16);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenMinable(Block.oreRedstone.blockID, 7)).generate(this.worldObj, this.rand, var14, var15, var16);
}
for(var13 = 0; var13 < 1; ++var13) {
var14 = var4 + this.rand.nextInt(16);
var15 = this.rand.nextInt(16);
var16 = var5 + this.rand.nextInt(16);
(new WorldGenMinable(Block.oreDiamond.blockID, 7)).generate(this.worldObj, this.rand, var14, var15, var16);
}
var11 = 0.5D;
var13 = (int)((this.field_713_c.func_647_a((double)var4 * var11, (double)var5 * var11) / 8.0D + this.rand.nextDouble() * 4.0D + 4.0D) / 3.0D);
var14 = 0;
if(this.rand.nextInt(10) == 0) {
++var14;
}
if(var6 == MobSpawnerBase.forest) {
var14 += var13 + 5;
}
if(var6 == MobSpawnerBase.rainforest) {
var14 += var13 + 5;
}
if(var6 == MobSpawnerBase.seasonalForest) {
var14 += var13 + 2;
}
if(var6 == MobSpawnerBase.taiga) {
var14 += var13 + 5;
}
if(var6 == MobSpawnerBase.desert) {
var14 -= 20;
}
if(var6 == MobSpawnerBase.tundra) {
var14 -= 20;
}
if(var6 == MobSpawnerBase.plains) {
var14 -= 20;
}
Object var24 = new WorldGenTrees();
if(this.rand.nextInt(10) == 0) {
var24 = new WorldGenBigTree();
}
if(var6 == MobSpawnerBase.rainforest && this.rand.nextInt(3) == 0) {
var24 = new WorldGenBigTree();
}
int var17;
int var18;
for(var16 = 0; var16 < var14; ++var16) {
var17 = var4 + this.rand.nextInt(16) + 8;
var18 = var5 + this.rand.nextInt(16) + 8;
((WorldGenerator)var24).func_420_a(1.0D, 1.0D, 1.0D);
((WorldGenerator)var24).generate(this.worldObj, this.rand, var17, this.worldObj.getHeightValue(var17, var18), var18);
}
int var19;
for(var16 = 0; var16 < 2; ++var16) {
var17 = var4 + this.rand.nextInt(16) + 8;
var18 = this.rand.nextInt(128);
var19 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenFlowers(Block.plantYellow.blockID)).generate(this.worldObj, this.rand, var17, var18, var19);
}
if(this.rand.nextInt(2) == 0) {
var16 = var4 + this.rand.nextInt(16) + 8;
var17 = this.rand.nextInt(128);
var18 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenFlowers(Block.plantRed.blockID)).generate(this.worldObj, this.rand, var16, var17, var18);
}
if(this.rand.nextInt(4) == 0) {
var16 = var4 + this.rand.nextInt(16) + 8;
var17 = this.rand.nextInt(128);
var18 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.worldObj, this.rand, var16, var17, var18);
}
if(this.rand.nextInt(8) == 0) {
var16 = var4 + this.rand.nextInt(16) + 8;
var17 = this.rand.nextInt(128);
var18 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.worldObj, this.rand, var16, var17, var18);
}
for(var16 = 0; var16 < 10; ++var16) {
var17 = var4 + this.rand.nextInt(16) + 8;
var18 = this.rand.nextInt(128);
var19 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenReed()).generate(this.worldObj, this.rand, var17, var18, var19);
}
if(this.rand.nextInt(32) == 0) {
var16 = var4 + this.rand.nextInt(16) + 8;
var17 = this.rand.nextInt(128);
var18 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenPumpkin()).generate(this.worldObj, this.rand, var16, var17, var18);
}
var16 = 0;
if(var6 == MobSpawnerBase.desert) {
var16 += 10;
}
int var20;
for(var17 = 0; var17 < var16; ++var17) {
var18 = var4 + this.rand.nextInt(16) + 8;
var19 = this.rand.nextInt(128);
var20 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenCactus()).generate(this.worldObj, this.rand, var18, var19, var20);
}
for(var17 = 0; var17 < 50; ++var17) {
var18 = var4 + this.rand.nextInt(16) + 8;
var19 = this.rand.nextInt(this.rand.nextInt(120) + 8);
var20 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenLiquids(Block.waterStill.blockID)).generate(this.worldObj, this.rand, var18, var19, var20);
}
for(var17 = 0; var17 < 20; ++var17) {
var18 = var4 + this.rand.nextInt(16) + 8;
var19 = this.rand.nextInt(this.rand.nextInt(this.rand.nextInt(112) + 8) + 8);
var20 = var5 + this.rand.nextInt(16) + 8;
(new WorldGenLiquids(Block.lavaStill.blockID)).generate(this.worldObj, this.rand, var18, var19, var20);
}
this.field_4222_w = this.worldObj.func_4077_a().getTemperatures(this.field_4222_w, var4 + 8, var5 + 8, 16, 16);
for(var17 = var4 + 8; var17 < var4 + 8 + 16; ++var17) {
for(var18 = var5 + 8; var18 < var5 + 8 + 16; ++var18) {
var19 = var17 - (var4 + 8);
var20 = var18 - (var5 + 8);
int var21 = this.worldObj.func_4075_e(var17, var18);
double var22 = this.field_4222_w[var19 * 16 + var20] - (double)(var21 - 64) / 64.0D * 0.3D;
if(var22 < 0.5D && var21 > 0 && var21 < 128 && this.worldObj.getBlockId(var17, var21, var18) == 0 && this.worldObj.getBlockMaterial(var17, var21 - 1, var18).func_218_c() && this.worldObj.getBlockMaterial(var17, var21 - 1, var18) != Material.ice) {
this.worldObj.setBlockWithNotify(var17, var21, var18, Block.snow.blockID);
}
}
}
BlockSand.fallInstantly = false;
}
public boolean saveWorld(boolean var1, IProgressUpdate var2) {
return true;
}
public boolean func_361_a() {
return false;
}
public boolean func_364_b() {
return true;
}
}

View File

@ -1,370 +0,0 @@
package net.minecraft.src;
import java.util.Random;
public class ChunkProviderHell implements IChunkProvider {
private Random field_4241_h;
private NoiseGeneratorOctaves field_4240_i;
private NoiseGeneratorOctaves field_4239_j;
private NoiseGeneratorOctaves field_4238_k;
private NoiseGeneratorOctaves field_4237_l;
private NoiseGeneratorOctaves field_4236_m;
public NoiseGeneratorOctaves field_4248_a;
public NoiseGeneratorOctaves field_4247_b;
private World field_4235_n;
private double[] field_4234_o;
private double[] field_4233_p = new double[256];
private double[] field_4232_q = new double[256];
private double[] field_4231_r = new double[256];
private MapGenBase field_4230_s = new MapGenCavesHell();
double[] field_4246_c;
double[] field_4245_d;
double[] field_4244_e;
double[] field_4243_f;
double[] field_4242_g;
public ChunkProviderHell(World var1, long var2) {
this.field_4235_n = var1;
this.field_4241_h = new Random(var2);
this.field_4240_i = new NoiseGeneratorOctaves(this.field_4241_h, 16);
this.field_4239_j = new NoiseGeneratorOctaves(this.field_4241_h, 16);
this.field_4238_k = new NoiseGeneratorOctaves(this.field_4241_h, 8);
this.field_4237_l = new NoiseGeneratorOctaves(this.field_4241_h, 4);
this.field_4236_m = new NoiseGeneratorOctaves(this.field_4241_h, 4);
this.field_4248_a = new NoiseGeneratorOctaves(this.field_4241_h, 10);
this.field_4247_b = new NoiseGeneratorOctaves(this.field_4241_h, 16);
}
public void func_4062_a(int var1, int var2, byte[] var3) {
byte var4 = 4;
byte var5 = 32;
int var6 = var4 + 1;
byte var7 = 17;
int var8 = var4 + 1;
this.field_4234_o = this.func_4060_a(this.field_4234_o, var1 * var4, 0, var2 * var4, var6, var7, var8);
for(int var9 = 0; var9 < var4; ++var9) {
for(int var10 = 0; var10 < var4; ++var10) {
for(int var11 = 0; var11 < 16; ++var11) {
double var12 = 0.125D;
double var14 = this.field_4234_o[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 0];
double var16 = this.field_4234_o[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 0];
double var18 = this.field_4234_o[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 0];
double var20 = this.field_4234_o[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 0];
double var22 = (this.field_4234_o[((var9 + 0) * var8 + var10 + 0) * var7 + var11 + 1] - var14) * var12;
double var24 = (this.field_4234_o[((var9 + 0) * var8 + var10 + 1) * var7 + var11 + 1] - var16) * var12;
double var26 = (this.field_4234_o[((var9 + 1) * var8 + var10 + 0) * var7 + var11 + 1] - var18) * var12;
double var28 = (this.field_4234_o[((var9 + 1) * var8 + var10 + 1) * var7 + var11 + 1] - var20) * var12;
for(int var30 = 0; var30 < 8; ++var30) {
double var31 = 0.25D;
double var33 = var14;
double var35 = var16;
double var37 = (var18 - var14) * var31;
double var39 = (var20 - var16) * var31;
for(int var41 = 0; var41 < 4; ++var41) {
int var42 = var41 + var9 * 4 << 11 | 0 + var10 * 4 << 7 | var11 * 8 + var30;
short var43 = 128;
double var44 = 0.25D;
double var46 = var33;
double var48 = (var35 - var33) * var44;
for(int var50 = 0; var50 < 4; ++var50) {
int var51 = 0;
if(var11 * 8 + var30 < var5) {
var51 = Block.lavaMoving.blockID;
}
if(var46 > 0.0D) {
var51 = Block.bloodStone.blockID;
}
var3[var42] = (byte)var51;
var42 += var43;
var46 += var48;
}
var33 += var37;
var35 += var39;
}
var14 += var22;
var16 += var24;
var18 += var26;
var20 += var28;
}
}
}
}
}
public void func_4061_b(int var1, int var2, byte[] var3) {
byte var4 = 64;
double var5 = 1.0D / 32.0D;
this.field_4233_p = this.field_4237_l.func_648_a(this.field_4233_p, (double)(var1 * 16), (double)(var2 * 16), 0.0D, 16, 16, 1, var5, var5, 1.0D);
this.field_4232_q = this.field_4237_l.func_648_a(this.field_4232_q, (double)(var2 * 16), 109.0134D, (double)(var1 * 16), 16, 1, 16, var5, 1.0D, var5);
this.field_4231_r = this.field_4236_m.func_648_a(this.field_4231_r, (double)(var1 * 16), (double)(var2 * 16), 0.0D, 16, 16, 1, var5 * 2.0D, var5 * 2.0D, var5 * 2.0D);
for(int var7 = 0; var7 < 16; ++var7) {
for(int var8 = 0; var8 < 16; ++var8) {
boolean var9 = this.field_4233_p[var7 + var8 * 16] + this.field_4241_h.nextDouble() * 0.2D > 0.0D;
boolean var10 = this.field_4232_q[var7 + var8 * 16] + this.field_4241_h.nextDouble() * 0.2D > 0.0D;
int var11 = (int)(this.field_4231_r[var7 + var8 * 16] / 3.0D + 3.0D + this.field_4241_h.nextDouble() * 0.25D);
int var12 = -1;
byte var13 = (byte)Block.bloodStone.blockID;
byte var14 = (byte)Block.bloodStone.blockID;
for(int var15 = 127; var15 >= 0; --var15) {
int var16 = (var7 * 16 + var8) * 128 + var15;
if(var15 >= 127 - this.field_4241_h.nextInt(5)) {
var3[var16] = (byte)Block.bedrock.blockID;
} else if(var15 <= 0 + this.field_4241_h.nextInt(5)) {
var3[var16] = (byte)Block.bedrock.blockID;
} else {
byte var17 = var3[var16];
if(var17 == 0) {
var12 = -1;
} else if(var17 == Block.bloodStone.blockID) {
if(var12 == -1) {
if(var11 <= 0) {
var13 = 0;
var14 = (byte)Block.bloodStone.blockID;
} else if(var15 >= var4 - 4 && var15 <= var4 + 1) {
var13 = (byte)Block.bloodStone.blockID;
var14 = (byte)Block.bloodStone.blockID;
if(var10) {
var13 = (byte)Block.gravel.blockID;
}
if(var10) {
var14 = (byte)Block.bloodStone.blockID;
}
if(var9) {
var13 = (byte)Block.slowSand.blockID;
}
if(var9) {
var14 = (byte)Block.slowSand.blockID;
}
}
if(var15 < var4 && var13 == 0) {
var13 = (byte)Block.lavaMoving.blockID;
}
var12 = var11;
if(var15 >= var4 - 1) {
var3[var16] = var13;
} else {
var3[var16] = var14;
}
} else if(var12 > 0) {
--var12;
var3[var16] = var14;
}
}
}
}
}
}
}
public Chunk func_363_b(int var1, int var2) {
this.field_4241_h.setSeed((long)var1 * 341873128712L + (long)var2 * 132897987541L);
byte[] var3 = new byte[-Short.MIN_VALUE];
this.func_4062_a(var1, var2, var3);
this.func_4061_b(var1, var2, var3);
this.field_4230_s.func_667_a(this, this.field_4235_n, var1, var2, var3);
Chunk var4 = new Chunk(this.field_4235_n, var3, var1, var2);
var4.func_353_b();
var4.func_4053_c();
return var4;
}
private double[] func_4060_a(double[] var1, int var2, int var3, int var4, int var5, int var6, int var7) {
if(var1 == null) {
var1 = new double[var5 * var6 * var7];
}
double var8 = 684.412D;
double var10 = 2053.236D;
this.field_4243_f = this.field_4248_a.func_648_a(this.field_4243_f, (double)var2, (double)var3, (double)var4, var5, 1, var7, 1.0D, 0.0D, 1.0D);
this.field_4242_g = this.field_4247_b.func_648_a(this.field_4242_g, (double)var2, (double)var3, (double)var4, var5, 1, var7, 100.0D, 0.0D, 100.0D);
this.field_4246_c = this.field_4238_k.func_648_a(this.field_4246_c, (double)var2, (double)var3, (double)var4, var5, var6, var7, var8 / 80.0D, var10 / 60.0D, var8 / 80.0D);
this.field_4245_d = this.field_4240_i.func_648_a(this.field_4245_d, (double)var2, (double)var3, (double)var4, var5, var6, var7, var8, var10, var8);
this.field_4244_e = this.field_4239_j.func_648_a(this.field_4244_e, (double)var2, (double)var3, (double)var4, var5, var6, var7, var8, var10, var8);
int var12 = 0;
int var13 = 0;
double[] var14 = new double[var6];
int var15;
for(var15 = 0; var15 < var6; ++var15) {
var14[var15] = Math.cos((double)var15 * Math.PI * 6.0D / (double)var6) * 2.0D;
double var16 = (double)var15;
if(var15 > var6 / 2) {
var16 = (double)(var6 - 1 - var15);
}
if(var16 < 4.0D) {
var16 = 4.0D - var16;
var14[var15] -= var16 * var16 * var16 * 10.0D;
}
}
for(var15 = 0; var15 < var5; ++var15) {
for(int var36 = 0; var36 < var7; ++var36) {
double var17 = (this.field_4243_f[var13] + 256.0D) / 512.0D;
if(var17 > 1.0D) {
var17 = 1.0D;
}
double var19 = 0.0D;
double var21 = this.field_4242_g[var13] / 8000.0D;
if(var21 < 0.0D) {
var21 = -var21;
}
var21 = var21 * 3.0D - 3.0D;
if(var21 < 0.0D) {
var21 /= 2.0D;
if(var21 < -1.0D) {
var21 = -1.0D;
}
var21 /= 1.4D;
var21 /= 2.0D;
var17 = 0.0D;
} else {
if(var21 > 1.0D) {
var21 = 1.0D;
}
var21 /= 6.0D;
}
var17 += 0.5D;
var21 = var21 * (double)var6 / 16.0D;
++var13;
for(int var23 = 0; var23 < var6; ++var23) {
double var24 = 0.0D;
double var26 = var14[var23];
double var28 = this.field_4245_d[var12] / 512.0D;
double var30 = this.field_4244_e[var12] / 512.0D;
double var32 = (this.field_4246_c[var12] / 10.0D + 1.0D) / 2.0D;
if(var32 < 0.0D) {
var24 = var28;
} else if(var32 > 1.0D) {
var24 = var30;
} else {
var24 = var28 + (var30 - var28) * var32;
}
var24 -= var26;
double var34;
if(var23 > var6 - 4) {
var34 = (double)((float)(var23 - (var6 - 4)) / 3.0F);
var24 = var24 * (1.0D - var34) + -10.0D * var34;
}
if((double)var23 < var19) {
var34 = (var19 - (double)var23) / 4.0D;
if(var34 < 0.0D) {
var34 = 0.0D;
}
if(var34 > 1.0D) {
var34 = 1.0D;
}
var24 = var24 * (1.0D - var34) + -10.0D * var34;
}
var1[var12] = var24;
++var12;
}
}
}
return var1;
}
public boolean chunkExists(int var1, int var2) {
return true;
}
public void populate(IChunkProvider var1, int var2, int var3) {
BlockSand.fallInstantly = true;
int var4 = var2 * 16;
int var5 = var3 * 16;
int var6;
int var7;
int var8;
int var9;
for(var6 = 0; var6 < 8; ++var6) {
var7 = var4 + this.field_4241_h.nextInt(16) + 8;
var8 = this.field_4241_h.nextInt(120) + 4;
var9 = var5 + this.field_4241_h.nextInt(16) + 8;
(new WorldGenHellLava(Block.lavaStill.blockID)).generate(this.field_4235_n, this.field_4241_h, var7, var8, var9);
}
var6 = this.field_4241_h.nextInt(this.field_4241_h.nextInt(10) + 1) + 1;
int var10;
for(var7 = 0; var7 < var6; ++var7) {
var8 = var4 + this.field_4241_h.nextInt(16) + 8;
var9 = this.field_4241_h.nextInt(120) + 4;
var10 = var5 + this.field_4241_h.nextInt(16) + 8;
(new WorldGenFire()).generate(this.field_4235_n, this.field_4241_h, var8, var9, var10);
}
var6 = this.field_4241_h.nextInt(this.field_4241_h.nextInt(10) + 1);
for(var7 = 0; var7 < var6; ++var7) {
var8 = var4 + this.field_4241_h.nextInt(16) + 8;
var9 = this.field_4241_h.nextInt(120) + 4;
var10 = var5 + this.field_4241_h.nextInt(16) + 8;
(new WorldGenLightStone1()).generate(this.field_4235_n, this.field_4241_h, var8, var9, var10);
}
for(var7 = 0; var7 < 10; ++var7) {
var8 = var4 + this.field_4241_h.nextInt(16) + 8;
var9 = this.field_4241_h.nextInt(128);
var10 = var5 + this.field_4241_h.nextInt(16) + 8;
(new WorldGenLightStone2()).generate(this.field_4235_n, this.field_4241_h, var8, var9, var10);
}
if(this.field_4241_h.nextInt(1) == 0) {
var7 = var4 + this.field_4241_h.nextInt(16) + 8;
var8 = this.field_4241_h.nextInt(128);
var9 = var5 + this.field_4241_h.nextInt(16) + 8;
(new WorldGenFlowers(Block.mushroomBrown.blockID)).generate(this.field_4235_n, this.field_4241_h, var7, var8, var9);
}
if(this.field_4241_h.nextInt(1) == 0) {
var7 = var4 + this.field_4241_h.nextInt(16) + 8;
var8 = this.field_4241_h.nextInt(128);
var9 = var5 + this.field_4241_h.nextInt(16) + 8;
(new WorldGenFlowers(Block.mushroomRed.blockID)).generate(this.field_4235_n, this.field_4241_h, var7, var8, var9);
}
BlockSand.fallInstantly = false;
}
public boolean saveWorld(boolean var1, IProgressUpdate var2) {
return true;
}
public boolean func_361_a() {
return false;
}
public boolean func_364_b() {
return true;
}
}

View File

@ -1,201 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
public class ChunkProviderLoadOrGenerate implements IChunkProvider {
private Chunk field_723_c;
private IChunkProvider field_722_d;
private IChunkLoader field_721_e;
private Chunk[] chunks = new Chunk[1024];
private World worldObj;
int field_717_a = -999999999;
int field_716_b = -999999999;
private Chunk field_718_h;
public ChunkProviderLoadOrGenerate(World var1, IChunkLoader var2, IChunkProvider var3) {
this.field_723_c = new Chunk(var1, new byte[-Short.MIN_VALUE], 0, 0);
this.field_723_c.field_678_q = true;
this.field_723_c.field_679_p = true;
this.worldObj = var1;
this.field_721_e = var2;
this.field_722_d = var3;
}
public boolean chunkExists(int var1, int var2) {
if(var1 == this.field_717_a && var2 == this.field_716_b && this.field_718_h != null) {
return true;
} else {
int var3 = var1 & 31;
int var4 = var2 & 31;
int var5 = var3 + var4 * 32;
return this.chunks[var5] != null && (this.chunks[var5] == this.field_723_c || this.chunks[var5].func_351_a(var1, var2));
}
}
public Chunk func_363_b(int var1, int var2) {
if(var1 == this.field_717_a && var2 == this.field_716_b && this.field_718_h != null) {
return this.field_718_h;
} else {
int var3 = var1 & 31;
int var4 = var2 & 31;
int var5 = var3 + var4 * 32;
if(!this.chunkExists(var1, var2)) {
if(this.chunks[var5] != null) {
this.chunks[var5].func_331_d();
this.func_370_b(this.chunks[var5]);
this.func_371_a(this.chunks[var5]);
}
Chunk var6 = this.func_4059_c(var1, var2);
if(var6 == null) {
if(this.field_722_d == null) {
var6 = this.field_723_c;
} else {
var6 = this.field_722_d.func_363_b(var1, var2);
}
}
this.chunks[var5] = var6;
var6.func_4053_c();
if(this.chunks[var5] != null) {
this.chunks[var5].func_358_c();
}
if(!this.chunks[var5].isTerrainPopulated && this.chunkExists(var1 + 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 + 1, var2)) {
this.populate(this, var1, var2);
}
if(this.chunkExists(var1 - 1, var2) && !this.func_363_b(var1 - 1, var2).isTerrainPopulated && this.chunkExists(var1 - 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 - 1, var2)) {
this.populate(this, var1 - 1, var2);
}
if(this.chunkExists(var1, var2 - 1) && !this.func_363_b(var1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 + 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 + 1, var2)) {
this.populate(this, var1, var2 - 1);
}
if(this.chunkExists(var1 - 1, var2 - 1) && !this.func_363_b(var1 - 1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 - 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 - 1, var2)) {
this.populate(this, var1 - 1, var2 - 1);
}
}
this.field_717_a = var1;
this.field_716_b = var2;
this.field_718_h = this.chunks[var5];
return this.chunks[var5];
}
}
private Chunk func_4059_c(int var1, int var2) {
if(this.field_721_e == null) {
return null;
} else {
try {
Chunk var3 = this.field_721_e.func_659_a(this.worldObj, var1, var2);
if(var3 != null) {
var3.field_676_s = this.worldObj.worldTime;
}
return var3;
} catch (Exception var4) {
var4.printStackTrace();
return null;
}
}
}
private void func_371_a(Chunk var1) {
if(this.field_721_e != null) {
try {
this.field_721_e.func_4104_b(this.worldObj, var1);
} catch (Exception var3) {
var3.printStackTrace();
}
}
}
private void func_370_b(Chunk var1) {
if(this.field_721_e != null) {
try {
var1.field_676_s = this.worldObj.worldTime;
this.field_721_e.func_662_a(this.worldObj, var1);
} catch (IOException var3) {
var3.printStackTrace();
}
}
}
public void populate(IChunkProvider var1, int var2, int var3) {
Chunk var4 = this.func_363_b(var2, var3);
if(!var4.isTerrainPopulated) {
var4.isTerrainPopulated = true;
if(this.field_722_d != null) {
this.field_722_d.populate(var1, var2, var3);
var4.func_336_e();
}
}
}
public boolean saveWorld(boolean var1, IProgressUpdate var2) {
int var3 = 0;
int var4 = 0;
int var5;
if(var2 != null) {
for(var5 = 0; var5 < this.chunks.length; ++var5) {
if(this.chunks[var5] != null && this.chunks[var5].func_347_a()) {
++var4;
}
}
}
var5 = 0;
for(int var6 = 0; var6 < this.chunks.length; ++var6) {
if(this.chunks[var6] != null) {
if(var1 && !this.chunks[var6].field_679_p) {
this.func_371_a(this.chunks[var6]);
}
if(this.chunks[var6].func_347_a()) {
this.func_370_b(this.chunks[var6]);
this.chunks[var6].isModified = false;
++var3;
if(var3 == 2 && !var1) {
return false;
}
if(var2 != null) {
++var5;
if(var5 % 10 == 0) {
var2.func_437_a(var5 * 100 / var4);
}
}
}
}
}
if(var1) {
if(this.field_721_e == null) {
return true;
}
this.field_721_e.func_660_b();
}
return true;
}
public boolean func_361_a() {
if(this.field_721_e != null) {
this.field_721_e.func_661_a();
}
return this.field_722_d.func_361_a();
}
public boolean func_364_b() {
return true;
}
}

View File

@ -1,200 +0,0 @@
package net.minecraft.src;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class ChunkProviderServer implements IChunkProvider {
private Set field_725_a = new HashSet();
private Chunk field_724_b;
private IChunkProvider field_730_c;
private IChunkLoader field_729_d;
private Map field_728_e = new HashMap();
private List field_727_f = new ArrayList();
private WorldServer field_726_g;
public ChunkProviderServer(WorldServer var1, IChunkLoader var2, IChunkProvider var3) {
this.field_724_b = new Chunk(var1, new byte[-Short.MIN_VALUE], 0, 0);
this.field_724_b.field_678_q = true;
this.field_724_b.field_679_p = true;
this.field_726_g = var1;
this.field_729_d = var2;
this.field_730_c = var3;
}
public boolean chunkExists(int var1, int var2) {
ChunkCoordinates var3 = new ChunkCoordinates(var1, var2);
return this.field_728_e.containsKey(var3);
}
public void func_374_c(int var1, int var2) {
int var3 = var1 * 16 + 8 - this.field_726_g.spawnX;
int var4 = var2 * 16 + 8 - this.field_726_g.spawnZ;
short var5 = 128;
if(var3 < -var5 || var3 > var5 || var4 < -var5 || var4 > var5) {
this.field_725_a.add(new ChunkCoordinates(var1, var2));
}
}
public Chunk loadChunk(int var1, int var2) {
ChunkCoordinates var3 = new ChunkCoordinates(var1, var2);
this.field_725_a.remove(new ChunkCoordinates(var1, var2));
Chunk var4 = (Chunk)this.field_728_e.get(var3);
if(var4 == null) {
var4 = this.func_4063_e(var1, var2);
if(var4 == null) {
if(this.field_730_c == null) {
var4 = this.field_724_b;
} else {
var4 = this.field_730_c.func_363_b(var1, var2);
}
}
this.field_728_e.put(var3, var4);
this.field_727_f.add(var4);
var4.func_4053_c();
if(var4 != null) {
var4.func_358_c();
}
if(!var4.isTerrainPopulated && this.chunkExists(var1 + 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 + 1, var2)) {
this.populate(this, var1, var2);
}
if(this.chunkExists(var1 - 1, var2) && !this.func_363_b(var1 - 1, var2).isTerrainPopulated && this.chunkExists(var1 - 1, var2 + 1) && this.chunkExists(var1, var2 + 1) && this.chunkExists(var1 - 1, var2)) {
this.populate(this, var1 - 1, var2);
}
if(this.chunkExists(var1, var2 - 1) && !this.func_363_b(var1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 + 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 + 1, var2)) {
this.populate(this, var1, var2 - 1);
}
if(this.chunkExists(var1 - 1, var2 - 1) && !this.func_363_b(var1 - 1, var2 - 1).isTerrainPopulated && this.chunkExists(var1 - 1, var2 - 1) && this.chunkExists(var1, var2 - 1) && this.chunkExists(var1 - 1, var2)) {
this.populate(this, var1 - 1, var2 - 1);
}
}
return var4;
}
public Chunk func_363_b(int var1, int var2) {
ChunkCoordinates var3 = new ChunkCoordinates(var1, var2);
Chunk var4 = (Chunk)this.field_728_e.get(var3);
return var4 == null ? (this.field_726_g.field_9209_x ? this.loadChunk(var1, var2) : this.field_724_b) : var4;
}
private Chunk func_4063_e(int var1, int var2) {
if(this.field_729_d == null) {
return null;
} else {
try {
Chunk var3 = this.field_729_d.func_659_a(this.field_726_g, var1, var2);
if(var3 != null) {
var3.field_676_s = this.field_726_g.worldTime;
}
return var3;
} catch (Exception var4) {
var4.printStackTrace();
return null;
}
}
}
private void func_375_a(Chunk var1) {
if(this.field_729_d != null) {
try {
this.field_729_d.func_4104_b(this.field_726_g, var1);
} catch (Exception var3) {
var3.printStackTrace();
}
}
}
private void func_373_b(Chunk var1) {
if(this.field_729_d != null) {
try {
var1.field_676_s = this.field_726_g.worldTime;
this.field_729_d.func_662_a(this.field_726_g, var1);
} catch (IOException var3) {
var3.printStackTrace();
}
}
}
public void populate(IChunkProvider var1, int var2, int var3) {
Chunk var4 = this.func_363_b(var2, var3);
if(!var4.isTerrainPopulated) {
var4.isTerrainPopulated = true;
if(this.field_730_c != null) {
this.field_730_c.populate(var1, var2, var3);
var4.func_336_e();
}
}
}
public boolean saveWorld(boolean var1, IProgressUpdate var2) {
int var3 = 0;
for(int var4 = 0; var4 < this.field_727_f.size(); ++var4) {
Chunk var5 = (Chunk)this.field_727_f.get(var4);
if(var1 && !var5.field_679_p) {
this.func_375_a(var5);
}
if(var5.func_347_a()) {
this.func_373_b(var5);
var5.isModified = false;
++var3;
if(var3 == 32 && !var1) {
return false;
}
}
}
if(var1) {
if(this.field_729_d == null) {
return true;
}
this.field_729_d.func_660_b();
}
return true;
}
public boolean func_361_a() {
if(!this.field_726_g.field_816_A) {
for(int var1 = 0; var1 < 100; ++var1) {
if(!this.field_725_a.isEmpty()) {
ChunkCoordinates var2 = (ChunkCoordinates)this.field_725_a.iterator().next();
Chunk var3 = this.func_363_b(var2.field_529_a, var2.field_528_b);
var3.func_331_d();
this.func_373_b(var3);
this.func_375_a(var3);
this.field_725_a.remove(var2);
this.field_728_e.remove(var2);
this.field_727_f.remove(var3);
}
}
if(this.field_729_d != null) {
this.field_729_d.func_661_a();
}
}
return this.field_730_c.func_361_a();
}
public boolean func_364_b() {
return !this.field_726_g.field_816_A;
}
}

View File

@ -1,78 +0,0 @@
package net.minecraft.src;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInput;
import java.io.DataInputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public class CompressedStreamTools {
public static NBTTagCompound func_770_a(InputStream var0) throws IOException {
DataInputStream var1 = new DataInputStream(new GZIPInputStream(var0));
NBTTagCompound var2;
try {
var2 = func_774_a(var1);
} finally {
var1.close();
}
return var2;
}
public static void func_769_a(NBTTagCompound var0, OutputStream var1) throws IOException {
DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1));
try {
func_771_a(var0, var2);
} finally {
var2.close();
}
}
public static NBTTagCompound func_773_a(byte[] var0) throws IOException {
DataInputStream var1 = new DataInputStream(new GZIPInputStream(new ByteArrayInputStream(var0)));
NBTTagCompound var2;
try {
var2 = func_774_a(var1);
} finally {
var1.close();
}
return var2;
}
public static byte[] func_772_a(NBTTagCompound var0) throws IOException {
ByteArrayOutputStream var1 = new ByteArrayOutputStream();
DataOutputStream var2 = new DataOutputStream(new GZIPOutputStream(var1));
try {
func_771_a(var0, var2);
} finally {
var2.close();
}
return var1.toByteArray();
}
public static NBTTagCompound func_774_a(DataInput var0) throws IOException {
NBTBase var1 = NBTBase.readTag(var0);
if(var1 instanceof NBTTagCompound) {
return (NBTTagCompound)var1;
} else {
throw new IOException("Root tag must be a named compound tag");
}
}
public static void func_771_a(NBTTagCompound var0, DataOutput var1) throws IOException {
NBTBase.writeTag(var0, var1);
}
}

View File

@ -1,44 +0,0 @@
package net.minecraft.src;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.logging.Formatter;
import java.util.logging.Level;
import java.util.logging.LogRecord;
final class ConsoleLogFormatter extends Formatter {
private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
public String format(LogRecord var1) {
StringBuilder var2 = new StringBuilder();
var2.append(this.dateFormat.format(Long.valueOf(var1.getMillis())));
Level var3 = var1.getLevel();
if(var3 == Level.FINEST) {
var2.append(" [FINEST] ");
} else if(var3 == Level.FINER) {
var2.append(" [FINER] ");
} else if(var3 == Level.FINE) {
var2.append(" [FINE] ");
} else if(var3 == Level.INFO) {
var2.append(" [INFO] ");
} else if(var3 == Level.WARNING) {
var2.append(" [WARNING] ");
} else if(var3 == Level.SEVERE) {
var2.append(" [SEVERE] ");
} else if(var3 == Level.SEVERE) {
var2.append(" [" + var3.getLocalizedName() + "] ");
}
var2.append(var1.getMessage());
var2.append('\n');
Throwable var4 = var1.getThrown();
if(var4 != null) {
StringWriter var5 = new StringWriter();
var4.printStackTrace(new PrintWriter(var5));
var2.append(var5.toString());
}
return var2.toString();
}
}

View File

@ -1,27 +0,0 @@
package net.minecraft.src;
import java.util.logging.ConsoleHandler;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ConsoleLogManager {
public static Logger logger = Logger.getLogger("Minecraft");
public static void init() {
ConsoleLogFormatter var0 = new ConsoleLogFormatter();
logger.setUseParentHandlers(false);
ConsoleHandler var1 = new ConsoleHandler();
var1.setFormatter(var0);
logger.addHandler(var1);
try {
FileHandler var2 = new FileHandler("server.log", true);
var2.setFormatter(var0);
logger.addHandler(var2);
} catch (Exception var3) {
logger.log(Level.WARNING, "Failed to log to server.log", var3);
}
}
}

View File

@ -1,816 +0,0 @@
package net.minecraft.src;
import java.util.List;
import java.util.Random;
public abstract class Entity {
private static int field_384_a = 0;
public int field_331_c = field_384_a++;
public double field_9094_h = 1.0D;
public boolean field_329_e = false;
public Entity field_328_f;
public Entity field_327_g;
public World worldObj;
public double prevPosX;
public double prevPosY;
public double prevPosZ;
public double posX;
public double posY;
public double posZ;
public double motionX;
public double motionY;
public double motionZ;
public float rotationYaw;
public float rotationPitch;
public float prevRotationYaw;
public float prevRotationPitch;
public final AxisAlignedBB boundingBox = AxisAlignedBB.getBoundingBox(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
public boolean onGround = false;
public boolean field_9084_B;
public boolean field_9082_C;
public boolean field_9080_D = false;
public boolean field_9078_E = false;
public boolean field_9077_F = true;
public boolean field_304_B = false;
public float yOffset = 0.0F;
public float width = 0.6F;
public float height = 1.8F;
public float field_9075_K = 0.0F;
public float field_9074_L = 0.0F;
protected boolean entityWalks = true;
protected float fallDistance = 0.0F;
private int field_6151_b = 1;
public double field_9071_O;
public double field_9070_P;
public double field_9069_Q;
public float field_9068_R = 0.0F;
public float field_9067_S = 0.0F;
public boolean field_9066_T = false;
public float field_286_P = 0.0F;
public boolean field_9065_V = false;
protected Random field_9064_W = new Random();
public int field_9063_X = 0;
public int field_9062_Y = 1;
public int field_9061_Z = 0;
protected int field_9087_aa = 300;
protected boolean field_9085_ab = false;
public int field_9083_ac = 0;
public int air = 300;
private boolean field_4131_c = true;
protected boolean field_9079_ae = false;
private double field_4130_d;
private double field_4128_e;
public boolean field_276_Z = false;
public int field_307_aa;
public int field_305_ab;
public int field_303_ac;
public Entity(World var1) {
this.worldObj = var1;
this.setPosition(0.0D, 0.0D, 0.0D);
}
public boolean equals(Object var1) {
return var1 instanceof Entity ? ((Entity)var1).field_331_c == this.field_331_c : false;
}
public int hashCode() {
return this.field_331_c;
}
public void setEntityDead() {
this.field_304_B = true;
}
protected void setSize(float var1, float var2) {
this.width = var1;
this.height = var2;
}
protected void setRotation(float var1, float var2) {
this.rotationYaw = var1;
this.rotationPitch = var2;
}
public void setPosition(double var1, double var3, double var5) {
this.posX = var1;
this.posY = var3;
this.posZ = var5;
float var7 = this.width / 2.0F;
float var8 = this.height;
this.boundingBox.setBounds(var1 - (double)var7, var3 - (double)this.yOffset + (double)this.field_9068_R, var5 - (double)var7, var1 + (double)var7, var3 - (double)this.yOffset + (double)this.field_9068_R + (double)var8, var5 + (double)var7);
}
public void onUpdate() {
this.func_84_k();
}
public void func_84_k() {
if(this.field_327_g != null && this.field_327_g.field_304_B) {
this.field_327_g = null;
}
++this.field_9063_X;
this.field_9075_K = this.field_9074_L;
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.prevRotationPitch = this.rotationPitch;
this.prevRotationYaw = this.rotationYaw;
if(this.handleWaterMovement()) {
if(!this.field_9085_ab && !this.field_4131_c) {
float var1 = MathHelper.sqrt_double(this.motionX * this.motionX * (double)0.2F + this.motionY * this.motionY + this.motionZ * this.motionZ * (double)0.2F) * 0.2F;
if(var1 > 1.0F) {
var1 = 1.0F;
}
this.worldObj.playSoundAtEntity(this, "random.splash", var1, 1.0F + (this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.4F);
float var2 = (float)MathHelper.floor_double(this.boundingBox.minY);
int var3;
float var4;
float var5;
for(var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) {
var4 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
var5 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
this.worldObj.spawnParticle("bubble", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY - (double)(this.field_9064_W.nextFloat() * 0.2F), this.motionZ);
}
for(var3 = 0; (float)var3 < 1.0F + this.width * 20.0F; ++var3) {
var4 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
var5 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
this.worldObj.spawnParticle("splash", this.posX + (double)var4, (double)(var2 + 1.0F), this.posZ + (double)var5, this.motionX, this.motionY, this.motionZ);
}
}
this.fallDistance = 0.0F;
this.field_9085_ab = true;
this.field_9061_Z = 0;
} else {
this.field_9085_ab = false;
}
if(this.worldObj.multiplayerWorld) {
this.field_9061_Z = 0;
} else if(this.field_9061_Z > 0) {
if(this.field_9079_ae) {
this.field_9061_Z -= 4;
if(this.field_9061_Z < 0) {
this.field_9061_Z = 0;
}
} else {
if(this.field_9061_Z % 20 == 0) {
this.attackEntity((Entity)null, 1);
}
--this.field_9061_Z;
}
}
if(this.func_112_q()) {
this.func_4040_n();
}
if(this.posY < -64.0D) {
this.func_4043_o();
}
this.field_4131_c = false;
}
protected void func_4040_n() {
if(!this.field_9079_ae) {
this.attackEntity((Entity)null, 4);
this.field_9061_Z = 600;
}
}
protected void func_4043_o() {
this.setEntityDead();
}
public boolean func_133_b(double var1, double var3, double var5) {
AxisAlignedBB var7 = this.boundingBox.getOffsetBoundingBox(var1, var3, var5);
List var8 = this.worldObj.getCollidingBoundingBoxes(this, var7);
return var8.size() > 0 ? false : !this.worldObj.getIsAnyLiquid(var7);
}
public void moveEntity(double var1, double var3, double var5) {
if(this.field_9066_T) {
this.boundingBox.offset(var1, var3, var5);
this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D;
this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.field_9068_R;
this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D;
} else {
double var7 = this.posX;
double var9 = this.posZ;
double var11 = var1;
double var13 = var3;
double var15 = var5;
AxisAlignedBB var17 = this.boundingBox.copy();
boolean var18 = this.onGround && this.func_9059_p();
if(var18) {
double var19;
for(var19 = 0.05D; var1 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(var1, -1.0D, 0.0D)).size() == 0; var11 = var1) {
if(var1 < var19 && var1 >= -var19) {
var1 = 0.0D;
} else if(var1 > 0.0D) {
var1 -= var19;
} else {
var1 += var19;
}
}
for(; var5 != 0.0D && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.getOffsetBoundingBox(0.0D, -1.0D, var5)).size() == 0; var15 = var5) {
if(var5 < var19 && var5 >= -var19) {
var5 = 0.0D;
} else if(var5 > 0.0D) {
var5 -= var19;
} else {
var5 += var19;
}
}
}
List var35 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var1, var3, var5));
for(int var20 = 0; var20 < var35.size(); ++var20) {
var3 = ((AxisAlignedBB)var35.get(var20)).func_701_b(this.boundingBox, var3);
}
this.boundingBox.offset(0.0D, var3, 0.0D);
if(!this.field_9077_F && var13 != var3) {
var5 = 0.0D;
var3 = var5;
var1 = var5;
}
boolean var36 = this.onGround || var13 != var3 && var13 < 0.0D;
int var21;
for(var21 = 0; var21 < var35.size(); ++var21) {
var1 = ((AxisAlignedBB)var35.get(var21)).func_710_a(this.boundingBox, var1);
}
this.boundingBox.offset(var1, 0.0D, 0.0D);
if(!this.field_9077_F && var11 != var1) {
var5 = 0.0D;
var3 = var5;
var1 = var5;
}
for(var21 = 0; var21 < var35.size(); ++var21) {
var5 = ((AxisAlignedBB)var35.get(var21)).func_709_c(this.boundingBox, var5);
}
this.boundingBox.offset(0.0D, 0.0D, var5);
if(!this.field_9077_F && var15 != var5) {
var5 = 0.0D;
var3 = var5;
var1 = var5;
}
double var23;
int var28;
double var37;
if(this.field_9067_S > 0.0F && var36 && this.field_9068_R < 0.05F && (var11 != var1 || var15 != var5)) {
var37 = var1;
var23 = var3;
double var25 = var5;
var1 = var11;
var3 = (double)this.field_9067_S;
var5 = var15;
AxisAlignedBB var27 = this.boundingBox.copy();
this.boundingBox.setBB(var17);
var35 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(var11, var3, var15));
for(var28 = 0; var28 < var35.size(); ++var28) {
var3 = ((AxisAlignedBB)var35.get(var28)).func_701_b(this.boundingBox, var3);
}
this.boundingBox.offset(0.0D, var3, 0.0D);
if(!this.field_9077_F && var13 != var3) {
var5 = 0.0D;
var3 = var5;
var1 = var5;
}
for(var28 = 0; var28 < var35.size(); ++var28) {
var1 = ((AxisAlignedBB)var35.get(var28)).func_710_a(this.boundingBox, var1);
}
this.boundingBox.offset(var1, 0.0D, 0.0D);
if(!this.field_9077_F && var11 != var1) {
var5 = 0.0D;
var3 = var5;
var1 = var5;
}
for(var28 = 0; var28 < var35.size(); ++var28) {
var5 = ((AxisAlignedBB)var35.get(var28)).func_709_c(this.boundingBox, var5);
}
this.boundingBox.offset(0.0D, 0.0D, var5);
if(!this.field_9077_F && var15 != var5) {
var5 = 0.0D;
var3 = var5;
var1 = var5;
}
if(var37 * var37 + var25 * var25 >= var1 * var1 + var5 * var5) {
var1 = var37;
var3 = var23;
var5 = var25;
this.boundingBox.setBB(var27);
} else {
this.field_9068_R = (float)((double)this.field_9068_R + 0.5D);
}
}
this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D;
this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.field_9068_R;
this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D;
this.field_9084_B = var11 != var1 || var15 != var5;
this.field_9082_C = var13 != var3;
this.onGround = var13 != var3 && var13 < 0.0D;
this.field_9080_D = this.field_9084_B || this.field_9082_C;
this.interact(var3, this.onGround);
if(var11 != var1) {
this.motionX = 0.0D;
}
if(var13 != var3) {
this.motionY = 0.0D;
}
if(var15 != var5) {
this.motionZ = 0.0D;
}
var37 = this.posX - var7;
var23 = this.posZ - var9;
int var26;
int var38;
int var40;
if(this.entityWalks && !var18) {
this.field_9074_L = (float)((double)this.field_9074_L + (double)MathHelper.sqrt_double(var37 * var37 + var23 * var23) * 0.6D);
var38 = MathHelper.floor_double(this.posX);
var26 = MathHelper.floor_double(this.posY - (double)0.2F - (double)this.yOffset);
var40 = MathHelper.floor_double(this.posZ);
var28 = this.worldObj.getBlockId(var38, var26, var40);
if(this.field_9074_L > (float)this.field_6151_b && var28 > 0) {
++this.field_6151_b;
StepSound var29 = Block.blocksList[var28].stepSound;
if(this.worldObj.getBlockId(var38, var26 + 1, var40) == Block.snow.blockID) {
var29 = Block.snow.stepSound;
this.worldObj.playSoundAtEntity(this, var29.func_737_c(), var29.func_738_a() * 0.15F, var29.func_739_b());
} else if(!Block.blocksList[var28].blockMaterial.getIsLiquid()) {
this.worldObj.playSoundAtEntity(this, var29.func_737_c(), var29.func_738_a() * 0.15F, var29.func_739_b());
}
Block.blocksList[var28].onEntityWalking(this.worldObj, var38, var26, var40, this);
}
}
var38 = MathHelper.floor_double(this.boundingBox.minX);
var26 = MathHelper.floor_double(this.boundingBox.minY);
var40 = MathHelper.floor_double(this.boundingBox.minZ);
var28 = MathHelper.floor_double(this.boundingBox.maxX);
int var41 = MathHelper.floor_double(this.boundingBox.maxY);
int var30 = MathHelper.floor_double(this.boundingBox.maxZ);
for(int var31 = var38; var31 <= var28; ++var31) {
for(int var32 = var26; var32 <= var41; ++var32) {
for(int var33 = var40; var33 <= var30; ++var33) {
int var34 = this.worldObj.getBlockId(var31, var32, var33);
if(var34 > 0) {
Block.blocksList[var34].onEntityCollidedWithBlock(this.worldObj, var31, var32, var33, this);
}
}
}
}
this.field_9068_R *= 0.4F;
boolean var39 = this.handleWaterMovement();
if(this.worldObj.func_523_c(this.boundingBox)) {
this.func_125_b(1);
if(!var39) {
++this.field_9061_Z;
if(this.field_9061_Z == 0) {
this.field_9061_Z = 300;
}
}
} else if(this.field_9061_Z <= 0) {
this.field_9061_Z = -this.field_9062_Y;
}
if(var39 && this.field_9061_Z > 0) {
this.worldObj.playSoundAtEntity(this, "random.fizz", 0.7F, 1.6F + (this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.4F);
this.field_9061_Z = -this.field_9062_Y;
}
}
}
protected void interact(double var1, boolean var3) {
if(var3) {
if(this.fallDistance > 0.0F) {
this.fall(this.fallDistance);
this.fallDistance = 0.0F;
}
} else if(var1 < 0.0D) {
this.fallDistance = (float)((double)this.fallDistance - var1);
}
}
public boolean func_9059_p() {
return false;
}
public AxisAlignedBB func_93_n() {
return null;
}
protected void func_125_b(int var1) {
if(!this.field_9079_ae) {
this.attackEntity((Entity)null, var1);
}
}
protected void fall(float var1) {
}
public boolean handleWaterMovement() {
return this.worldObj.func_490_a(this.boundingBox.expands(0.0D, (double)-0.4F, 0.0D), Material.water, this);
}
public boolean isInsideOfMaterial(Material var1) {
double var2 = this.posY + (double)this.func_104_p();
int var4 = MathHelper.floor_double(this.posX);
int var5 = MathHelper.floor_float((float)MathHelper.floor_double(var2));
int var6 = MathHelper.floor_double(this.posZ);
int var7 = this.worldObj.getBlockId(var4, var5, var6);
if(var7 != 0 && Block.blocksList[var7].blockMaterial == var1) {
float var8 = BlockFluids.setFluidHeight(this.worldObj.getBlockMetadata(var4, var5, var6)) - 1.0F / 9.0F;
float var9 = (float)(var5 + 1) - var8;
return var2 < (double)var9;
} else {
return false;
}
}
public float func_104_p() {
return 0.0F;
}
public boolean func_112_q() {
return this.worldObj.isMaterialInBB(this.boundingBox.expands(0.0D, (double)-0.4F, 0.0D), Material.lava);
}
public void func_90_a(float var1, float var2, float var3) {
float var4 = MathHelper.sqrt_float(var1 * var1 + var2 * var2);
if(var4 >= 0.01F) {
if(var4 < 1.0F) {
var4 = 1.0F;
}
var4 = var3 / var4;
var1 *= var4;
var2 *= var4;
float var5 = MathHelper.sin(this.rotationYaw * (float)Math.PI / 180.0F);
float var6 = MathHelper.cos(this.rotationYaw * (float)Math.PI / 180.0F);
this.motionX += (double)(var1 * var6 - var2 * var5);
this.motionZ += (double)(var2 * var6 + var1 * var5);
}
}
public float getEntityBrightness(float var1) {
int var2 = MathHelper.floor_double(this.posX);
double var3 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
int var5 = MathHelper.floor_double(this.posY - (double)this.yOffset + var3);
int var6 = MathHelper.floor_double(this.posZ);
return this.worldObj.getLightBrightness(var2, var5, var6);
}
public void setPositionAndRotation(double var1, double var3, double var5, float var7, float var8) {
this.prevPosX = this.posX = var1;
this.prevPosY = this.posY = var3;
this.prevPosZ = this.posZ = var5;
this.prevRotationYaw = this.rotationYaw = var7;
this.prevRotationPitch = this.rotationPitch = var8;
this.field_9068_R = 0.0F;
double var9 = (double)(this.prevRotationYaw - var7);
if(var9 < -180.0D) {
this.prevRotationYaw += 360.0F;
}
if(var9 >= 180.0D) {
this.prevRotationYaw -= 360.0F;
}
this.setPosition(this.posX, this.posY, this.posZ);
this.setRotation(var7, var8);
}
public void func_107_c(double var1, double var3, double var5, float var7, float var8) {
this.prevPosX = this.posX = var1;
this.prevPosY = this.posY = var3 + (double)this.yOffset;
this.prevPosZ = this.posZ = var5;
this.rotationYaw = var7;
this.rotationPitch = var8;
this.setPosition(this.posX, this.posY, this.posZ);
}
public float getDistanceToEntity(Entity var1) {
float var2 = (float)(this.posX - var1.posX);
float var3 = (float)(this.posY - var1.posY);
float var4 = (float)(this.posZ - var1.posZ);
return MathHelper.sqrt_float(var2 * var2 + var3 * var3 + var4 * var4);
}
public double getDistanceSq(double var1, double var3, double var5) {
double var7 = this.posX - var1;
double var9 = this.posY - var3;
double var11 = this.posZ - var5;
return var7 * var7 + var9 * var9 + var11 * var11;
}
public double getDistance(double var1, double var3, double var5) {
double var7 = this.posX - var1;
double var9 = this.posY - var3;
double var11 = this.posZ - var5;
return (double)MathHelper.sqrt_double(var7 * var7 + var9 * var9 + var11 * var11);
}
public double getDistanceSqToEntity(Entity var1) {
double var2 = this.posX - var1.posX;
double var4 = this.posY - var1.posY;
double var6 = this.posZ - var1.posZ;
return var2 * var2 + var4 * var4 + var6 * var6;
}
public void onCollideWithPlayer(EntityPlayer var1) {
}
public void applyEntityCollision(Entity var1) {
if(var1.field_328_f != this && var1.field_327_g != this) {
double var2 = var1.posX - this.posX;
double var4 = var1.posZ - this.posZ;
double var6 = MathHelper.abs_max(var2, var4);
if(var6 >= (double)0.01F) {
var6 = (double)MathHelper.sqrt_double(var6);
var2 /= var6;
var4 /= var6;
double var8 = 1.0D / var6;
if(var8 > 1.0D) {
var8 = 1.0D;
}
var2 *= var8;
var4 *= var8;
var2 *= (double)0.05F;
var4 *= (double)0.05F;
var2 *= (double)(1.0F - this.field_286_P);
var4 *= (double)(1.0F - this.field_286_P);
this.addVelocity(-var2, 0.0D, -var4);
var1.addVelocity(var2, 0.0D, var4);
}
}
}
public void addVelocity(double var1, double var3, double var5) {
this.motionX += var1;
this.motionY += var3;
this.motionZ += var5;
}
protected void func_9060_u() {
this.field_9078_E = true;
}
public boolean attackEntity(Entity var1, int var2) {
this.func_9060_u();
return false;
}
public boolean func_129_c_() {
return false;
}
public boolean func_124_r() {
return false;
}
public void func_96_b(Entity var1, int var2) {
}
public boolean func_95_c(NBTTagCompound var1) {
String var2 = this.func_109_s();
if(!this.field_304_B && var2 != null) {
var1.setString("id", var2);
this.writeToNBT(var1);
return true;
} else {
return false;
}
}
public void writeToNBT(NBTTagCompound var1) {
var1.setTag("Pos", this.func_132_a(new double[]{this.posX, this.posY, this.posZ}));
var1.setTag("Motion", this.func_132_a(new double[]{this.motionX, this.motionY, this.motionZ}));
var1.setTag("Rotation", this.func_85_a(new float[]{this.rotationYaw, this.rotationPitch}));
var1.setFloat("FallDistance", this.fallDistance);
var1.setShort("Fire", (short)this.field_9061_Z);
var1.setShort("Air", (short)this.air);
var1.setBoolean("OnGround", this.onGround);
this.writeEntityToNBT(var1);
}
public void readFromNBT(NBTTagCompound var1) {
NBTTagList var2 = var1.getTagList("Pos");
NBTTagList var3 = var1.getTagList("Motion");
NBTTagList var4 = var1.getTagList("Rotation");
this.setPosition(0.0D, 0.0D, 0.0D);
this.motionX = ((NBTTagDouble)var3.tagAt(0)).doubleValue;
this.motionY = ((NBTTagDouble)var3.tagAt(1)).doubleValue;
this.motionZ = ((NBTTagDouble)var3.tagAt(2)).doubleValue;
this.prevPosX = this.field_9071_O = this.posX = ((NBTTagDouble)var2.tagAt(0)).doubleValue;
this.prevPosY = this.field_9070_P = this.posY = ((NBTTagDouble)var2.tagAt(1)).doubleValue;
this.prevPosZ = this.field_9069_Q = this.posZ = ((NBTTagDouble)var2.tagAt(2)).doubleValue;
this.prevRotationYaw = this.rotationYaw = ((NBTTagFloat)var4.tagAt(0)).floatValue;
this.prevRotationPitch = this.rotationPitch = ((NBTTagFloat)var4.tagAt(1)).floatValue;
this.fallDistance = var1.getFloat("FallDistance");
this.field_9061_Z = var1.getShort("Fire");
this.air = var1.getShort("Air");
this.onGround = var1.getBoolean("OnGround");
this.setPosition(this.posX, this.posY, this.posZ);
this.readEntityFromNBT(var1);
}
protected final String func_109_s() {
return EntityList.func_564_b(this);
}
protected abstract void readEntityFromNBT(NBTTagCompound var1);
protected abstract void writeEntityToNBT(NBTTagCompound var1);
protected NBTTagList func_132_a(double... var1) {
NBTTagList var2 = new NBTTagList();
double[] var3 = var1;
int var4 = var1.length;
for(int var5 = 0; var5 < var4; ++var5) {
double var6 = var3[var5];
var2.setTag(new NBTTagDouble(var6));
}
return var2;
}
protected NBTTagList func_85_a(float... var1) {
NBTTagList var2 = new NBTTagList();
float[] var3 = var1;
int var4 = var1.length;
for(int var5 = 0; var5 < var4; ++var5) {
float var6 = var3[var5];
var2.setTag(new NBTTagFloat(var6));
}
return var2;
}
public EntityItem dropItem(int var1, int var2) {
return this.dropItemWithOffset(var1, var2, 0.0F);
}
public EntityItem dropItemWithOffset(int var1, int var2, float var3) {
EntityItem var4 = new EntityItem(this.worldObj, this.posX, this.posY + (double)var3, this.posZ, new ItemStack(var1, var2));
var4.field_433_ad = 10;
this.worldObj.entityJoinedWorld(var4);
return var4;
}
public boolean func_120_t() {
return !this.field_304_B;
}
public boolean func_91_u() {
int var1 = MathHelper.floor_double(this.posX);
int var2 = MathHelper.floor_double(this.posY + (double)this.func_104_p());
int var3 = MathHelper.floor_double(this.posZ);
return this.worldObj.doesBlockAllowAttachment(var1, var2, var3);
}
public boolean func_6092_a(EntityPlayer var1) {
return false;
}
public AxisAlignedBB func_89_d(Entity var1) {
return null;
}
public void func_115_v() {
if(this.field_327_g.field_304_B) {
this.field_327_g = null;
} else {
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
this.onUpdate();
this.field_327_g.func_127_w();
this.field_4128_e += (double)(this.field_327_g.rotationYaw - this.field_327_g.prevRotationYaw);
for(this.field_4130_d += (double)(this.field_327_g.rotationPitch - this.field_327_g.prevRotationPitch); this.field_4128_e >= 180.0D; this.field_4128_e -= 360.0D) {
}
while(this.field_4128_e < -180.0D) {
this.field_4128_e += 360.0D;
}
while(this.field_4130_d >= 180.0D) {
this.field_4130_d -= 360.0D;
}
while(this.field_4130_d < -180.0D) {
this.field_4130_d += 360.0D;
}
double var1 = this.field_4128_e * 0.5D;
double var3 = this.field_4130_d * 0.5D;
float var5 = 10.0F;
if(var1 > (double)var5) {
var1 = (double)var5;
}
if(var1 < (double)(-var5)) {
var1 = (double)(-var5);
}
if(var3 > (double)var5) {
var3 = (double)var5;
}
if(var3 < (double)(-var5)) {
var3 = (double)(-var5);
}
this.field_4128_e -= var1;
this.field_4130_d -= var3;
this.rotationYaw = (float)((double)this.rotationYaw + var1);
this.rotationPitch = (float)((double)this.rotationPitch + var3);
}
}
public void func_127_w() {
this.field_328_f.setPosition(this.posX, this.posY + this.func_130_h() + this.field_328_f.func_117_x(), this.posZ);
}
public double func_117_x() {
return (double)this.yOffset;
}
public double func_130_h() {
return (double)this.height * 0.75D;
}
public void func_6094_e(Entity var1) {
this.field_4130_d = 0.0D;
this.field_4128_e = 0.0D;
if(var1 == null) {
if(this.field_327_g != null) {
this.func_107_c(this.field_327_g.posX, this.field_327_g.boundingBox.minY + (double)this.field_327_g.height, this.field_327_g.posZ, this.rotationYaw, this.rotationPitch);
this.field_327_g.field_328_f = null;
}
this.field_327_g = null;
} else if(this.field_327_g == var1) {
this.field_327_g.field_328_f = null;
this.field_327_g = null;
this.func_107_c(var1.posX, var1.boundingBox.minY + (double)var1.height, var1.posZ, this.rotationYaw, this.rotationPitch);
} else {
if(this.field_327_g != null) {
this.field_327_g.field_328_f = null;
}
if(var1.field_328_f != null) {
var1.field_328_f.field_327_g = null;
}
this.field_327_g = var1;
var1.field_328_f = this;
}
}
public Vec3D func_4039_B() {
return null;
}
public void func_4042_C() {
}
}

View File

@ -1,30 +0,0 @@
package net.minecraft.src;
public abstract class EntityAnimals extends EntityCreature implements IAnimals {
public EntityAnimals(World var1) {
super(var1);
}
protected float func_159_a(int var1, int var2, int var3) {
return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID ? 10.0F : this.worldObj.getLightBrightness(var1, var2, var3) - 0.5F;
}
public void writeEntityToNBT(NBTTagCompound var1) {
super.writeEntityToNBT(var1);
}
public void readEntityFromNBT(NBTTagCompound var1) {
super.readEntityFromNBT(var1);
}
public boolean getCanSpawnHere() {
int var1 = MathHelper.floor_double(this.posX);
int var2 = MathHelper.floor_double(this.boundingBox.minY);
int var3 = MathHelper.floor_double(this.posZ);
return this.worldObj.getBlockId(var1, var2 - 1, var3) == Block.grass.blockID && this.worldObj.getBlockLightValue(var1, var2, var3) > 8 && super.getCanSpawnHere();
}
public int func_146_b() {
return 120;
}
}

View File

@ -1,225 +0,0 @@
package net.minecraft.src;
import java.util.List;
public class EntityArrow extends Entity {
private int field_9183_c = -1;
private int field_9182_d = -1;
private int field_9180_e = -1;
private int field_9179_f = 0;
private boolean field_9181_aj = false;
public int field_9184_a = 0;
public EntityLiving field_439_ah;
private int field_438_ai;
private int field_437_aj = 0;
public EntityArrow(World var1) {
super(var1);
this.setSize(0.5F, 0.5F);
}
public EntityArrow(World var1, EntityLiving var2) {
super(var1);
this.field_439_ah = var2;
this.setSize(0.5F, 0.5F);
this.func_107_c(var2.posX, var2.posY + (double)var2.func_104_p(), var2.posZ, var2.rotationYaw, var2.rotationPitch);
this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
this.posY -= (double)0.1F;
this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI));
this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI));
this.func_177_a(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
}
public void func_177_a(double var1, double var3, double var5, float var7, float var8) {
float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5);
var1 /= (double)var9;
var3 /= (double)var9;
var5 /= (double)var9;
var1 += this.field_9064_W.nextGaussian() * (double)0.0075F * (double)var8;
var3 += this.field_9064_W.nextGaussian() * (double)0.0075F * (double)var8;
var5 += this.field_9064_W.nextGaussian() * (double)0.0075F * (double)var8;
var1 *= (double)var7;
var3 *= (double)var7;
var5 *= (double)var7;
this.motionX = var1;
this.motionY = var3;
this.motionZ = var5;
float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI));
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI));
this.field_438_ai = 0;
}
public void onUpdate() {
super.onUpdate();
if(this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F) {
float var1 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI));
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var1) * 180.0D / (double)((float)Math.PI));
}
if(this.field_9184_a > 0) {
--this.field_9184_a;
}
if(this.field_9181_aj) {
int var15 = this.worldObj.getBlockId(this.field_9183_c, this.field_9182_d, this.field_9180_e);
if(var15 == this.field_9179_f) {
++this.field_438_ai;
if(this.field_438_ai == 1200) {
this.setEntityDead();
}
return;
}
this.field_9181_aj = false;
this.motionX *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.motionY *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.motionZ *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.field_438_ai = 0;
this.field_437_aj = 0;
} else {
++this.field_437_aj;
}
Vec3D var16 = Vec3D.createVector(this.posX, this.posY, this.posZ);
Vec3D var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition var3 = this.worldObj.func_486_a(var16, var2);
var16 = Vec3D.createVector(this.posX, this.posY, this.posZ);
var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if(var3 != null) {
var2 = Vec3D.createVector(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord);
}
Entity var4 = null;
List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expands(1.0D, 1.0D, 1.0D));
double var6 = 0.0D;
float var10;
for(int var8 = 0; var8 < var5.size(); ++var8) {
Entity var9 = (Entity)var5.get(var8);
if(var9.func_129_c_() && (var9 != this.field_439_ah || this.field_437_aj >= 5)) {
var10 = 0.3F;
AxisAlignedBB var11 = var9.boundingBox.expands((double)var10, (double)var10, (double)var10);
MovingObjectPosition var12 = var11.func_706_a(var16, var2);
if(var12 != null) {
double var13 = var16.distanceTo(var12.hitVec);
if(var13 < var6 || var6 == 0.0D) {
var4 = var9;
var6 = var13;
}
}
}
}
if(var4 != null) {
var3 = new MovingObjectPosition(var4);
}
float var17;
if(var3 != null) {
if(var3.entityHit != null) {
if(var3.entityHit.attackEntity(this.field_439_ah, 4)) {
this.worldObj.playSoundAtEntity(this, "random.drr", 1.0F, 1.2F / (this.field_9064_W.nextFloat() * 0.2F + 0.9F));
this.setEntityDead();
} else {
this.motionX *= (double)-0.1F;
this.motionY *= (double)-0.1F;
this.motionZ *= (double)-0.1F;
this.rotationYaw += 180.0F;
this.prevRotationYaw += 180.0F;
this.field_437_aj = 0;
}
} else {
this.field_9183_c = var3.blockX;
this.field_9182_d = var3.blockY;
this.field_9180_e = var3.blockZ;
this.field_9179_f = this.worldObj.getBlockId(this.field_9183_c, this.field_9182_d, this.field_9180_e);
this.motionX = (double)((float)(var3.hitVec.xCoord - this.posX));
this.motionY = (double)((float)(var3.hitVec.yCoord - this.posY));
this.motionZ = (double)((float)(var3.hitVec.zCoord - this.posZ));
var17 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
this.posX -= this.motionX / (double)var17 * (double)0.05F;
this.posY -= this.motionY / (double)var17 * (double)0.05F;
this.posZ -= this.motionZ / (double)var17 * (double)0.05F;
this.worldObj.playSoundAtEntity(this, "random.drr", 1.0F, 1.2F / (this.field_9064_W.nextFloat() * 0.2F + 0.9F));
this.field_9181_aj = true;
this.field_9184_a = 7;
}
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
var17 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI));
for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var17) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
}
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
}
while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) {
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float var18 = 0.99F;
var10 = 0.03F;
if(this.handleWaterMovement()) {
for(int var19 = 0; var19 < 4; ++var19) {
float var20 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var20, this.posY - this.motionY * (double)var20, this.posZ - this.motionZ * (double)var20, this.motionX, this.motionY, this.motionZ);
}
var18 = 0.8F;
}
this.motionX *= (double)var18;
this.motionY *= (double)var18;
this.motionZ *= (double)var18;
this.motionY -= (double)var10;
this.setPosition(this.posX, this.posY, this.posZ);
}
public void writeEntityToNBT(NBTTagCompound var1) {
var1.setShort("xTile", (short)this.field_9183_c);
var1.setShort("yTile", (short)this.field_9182_d);
var1.setShort("zTile", (short)this.field_9180_e);
var1.setByte("inTile", (byte)this.field_9179_f);
var1.setByte("shake", (byte)this.field_9184_a);
var1.setByte("inGround", (byte)(this.field_9181_aj ? 1 : 0));
}
public void readEntityFromNBT(NBTTagCompound var1) {
this.field_9183_c = var1.getShort("xTile");
this.field_9182_d = var1.getShort("yTile");
this.field_9180_e = var1.getShort("zTile");
this.field_9179_f = var1.getByte("inTile") & 255;
this.field_9184_a = var1.getByte("shake") & 255;
this.field_9181_aj = var1.getByte("inGround") == 1;
}
public void onCollideWithPlayer(EntityPlayer var1) {
if(!this.worldObj.multiplayerWorld) {
if(this.field_9181_aj && this.field_439_ah == var1 && this.field_9184_a <= 0 && var1.inventory.addItemStackToInventory(new ItemStack(Item.arrow.swiftedIndex, 1))) {
this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.7F + 1.0F) * 2.0F);
var1.func_163_c(this, 1);
this.setEntityDead();
}
}
}
}

View File

@ -1,288 +0,0 @@
package net.minecraft.src;
import java.util.List;
public class EntityBoat extends Entity {
public int field_9178_a;
public int field_9177_b;
public int field_436_ad;
private int field_9176_d;
private double field_9174_e;
private double field_9172_f;
private double field_9175_aj;
private double field_9173_ak;
private double field_9171_al;
public EntityBoat(World var1) {
super(var1);
this.field_9178_a = 0;
this.field_9177_b = 0;
this.field_436_ad = 1;
this.field_329_e = true;
this.setSize(1.5F, 0.6F);
this.yOffset = this.height / 2.0F;
this.entityWalks = false;
}
public AxisAlignedBB func_89_d(Entity var1) {
return var1.boundingBox;
}
public AxisAlignedBB func_93_n() {
return this.boundingBox;
}
public boolean func_124_r() {
return true;
}
public EntityBoat(World var1, double var2, double var4, double var6) {
this(var1);
this.setPosition(var2, var4 + (double)this.yOffset, var6);
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
this.prevPosX = var2;
this.prevPosY = var4;
this.prevPosZ = var6;
}
public double func_130_h() {
return (double)this.height * 0.0D - (double)0.3F;
}
public boolean attackEntity(Entity var1, int var2) {
if(!this.worldObj.multiplayerWorld && !this.field_304_B) {
this.field_436_ad = -this.field_436_ad;
this.field_9177_b = 10;
this.field_9178_a += var2 * 10;
this.func_9060_u();
if(this.field_9178_a > 40) {
int var3;
for(var3 = 0; var3 < 3; ++var3) {
this.dropItemWithOffset(Block.planks.blockID, 1, 0.0F);
}
for(var3 = 0; var3 < 2; ++var3) {
this.dropItemWithOffset(Item.stick.swiftedIndex, 1, 0.0F);
}
this.setEntityDead();
}
return true;
} else {
return true;
}
}
public boolean func_129_c_() {
return !this.field_304_B;
}
public void onUpdate() {
super.onUpdate();
if(this.field_9177_b > 0) {
--this.field_9177_b;
}
if(this.field_9178_a > 0) {
--this.field_9178_a;
}
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
byte var1 = 5;
double var2 = 0.0D;
for(int var4 = 0; var4 < var1; ++var4) {
double var5 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 0) / (double)var1 - 0.125D;
double var7 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var4 + 1) / (double)var1 - 0.125D;
AxisAlignedBB var9 = AxisAlignedBB.getBoundingBoxFromPool(this.boundingBox.minX, var5, this.boundingBox.minZ, this.boundingBox.maxX, var7, this.boundingBox.maxZ);
if(this.worldObj.func_524_b(var9, Material.water)) {
var2 += 1.0D / (double)var1;
}
}
double var6;
double var8;
double var10;
double var23;
if(this.worldObj.multiplayerWorld) {
if(this.field_9176_d > 0) {
var23 = this.posX + (this.field_9174_e - this.posX) / (double)this.field_9176_d;
var6 = this.posY + (this.field_9172_f - this.posY) / (double)this.field_9176_d;
var8 = this.posZ + (this.field_9175_aj - this.posZ) / (double)this.field_9176_d;
for(var10 = this.field_9173_ak - (double)this.rotationYaw; var10 < -180.0D; var10 += 360.0D) {
}
while(var10 >= 180.0D) {
var10 -= 360.0D;
}
this.rotationYaw = (float)((double)this.rotationYaw + var10 / (double)this.field_9176_d);
this.rotationPitch = (float)((double)this.rotationPitch + (this.field_9171_al - (double)this.rotationPitch) / (double)this.field_9176_d);
--this.field_9176_d;
this.setPosition(var23, var6, var8);
this.setRotation(this.rotationYaw, this.rotationPitch);
} else {
var23 = this.posX + this.motionX;
var6 = this.posY + this.motionY;
var8 = this.posZ + this.motionZ;
this.setPosition(var23, var6, var8);
if(this.onGround) {
this.motionX *= 0.5D;
this.motionY *= 0.5D;
this.motionZ *= 0.5D;
}
this.motionX *= (double)0.99F;
this.motionY *= (double)0.95F;
this.motionZ *= (double)0.99F;
}
} else {
var23 = var2 * 2.0D - 1.0D;
this.motionY += (double)0.04F * var23;
if(this.field_328_f != null) {
this.motionX += this.field_328_f.motionX * 0.2D;
this.motionZ += this.field_328_f.motionZ * 0.2D;
}
var6 = 0.4D;
if(this.motionX < -var6) {
this.motionX = -var6;
}
if(this.motionX > var6) {
this.motionX = var6;
}
if(this.motionZ < -var6) {
this.motionZ = -var6;
}
if(this.motionZ > var6) {
this.motionZ = var6;
}
if(this.onGround) {
this.motionX *= 0.5D;
this.motionY *= 0.5D;
this.motionZ *= 0.5D;
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
var8 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
double var12;
if(var8 > 0.15D) {
var10 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D);
var12 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D);
for(int var14 = 0; (double)var14 < 1.0D + var8 * 60.0D; ++var14) {
double var15 = (double)(this.field_9064_W.nextFloat() * 2.0F - 1.0F);
double var17 = (double)(this.field_9064_W.nextInt(2) * 2 - 1) * 0.7D;
double var19;
double var21;
if(this.field_9064_W.nextBoolean()) {
var19 = this.posX - var10 * var15 * 0.8D + var12 * var17;
var21 = this.posZ - var12 * var15 * 0.8D - var10 * var17;
this.worldObj.spawnParticle("splash", var19, this.posY - 0.125D, var21, this.motionX, this.motionY, this.motionZ);
} else {
var19 = this.posX + var10 + var12 * var15 * 0.7D;
var21 = this.posZ + var12 - var10 * var15 * 0.7D;
this.worldObj.spawnParticle("splash", var19, this.posY - 0.125D, var21, this.motionX, this.motionY, this.motionZ);
}
}
}
if(this.field_9084_B && var8 > 0.15D) {
if(!this.worldObj.multiplayerWorld) {
this.setEntityDead();
int var24;
for(var24 = 0; var24 < 3; ++var24) {
this.dropItemWithOffset(Block.planks.blockID, 1, 0.0F);
}
for(var24 = 0; var24 < 2; ++var24) {
this.dropItemWithOffset(Item.stick.swiftedIndex, 1, 0.0F);
}
}
} else {
this.motionX *= (double)0.99F;
this.motionY *= (double)0.95F;
this.motionZ *= (double)0.99F;
}
this.rotationPitch = 0.0F;
var10 = (double)this.rotationYaw;
var12 = this.prevPosX - this.posX;
double var25 = this.prevPosZ - this.posZ;
if(var12 * var12 + var25 * var25 > 0.001D) {
var10 = (double)((float)(Math.atan2(var25, var12) * 180.0D / Math.PI));
}
double var16;
for(var16 = var10 - (double)this.rotationYaw; var16 >= 180.0D; var16 -= 360.0D) {
}
while(var16 < -180.0D) {
var16 += 360.0D;
}
if(var16 > 20.0D) {
var16 = 20.0D;
}
if(var16 < -20.0D) {
var16 = -20.0D;
}
this.rotationYaw = (float)((double)this.rotationYaw + var16);
this.setRotation(this.rotationYaw, this.rotationPitch);
List var18 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.expands((double)0.2F, 0.0D, (double)0.2F));
if(var18 != null && var18.size() > 0) {
for(int var26 = 0; var26 < var18.size(); ++var26) {
Entity var20 = (Entity)var18.get(var26);
if(var20 != this.field_328_f && var20.func_124_r() && var20 instanceof EntityBoat) {
var20.applyEntityCollision(this);
}
}
}
if(this.field_328_f != null && this.field_328_f.field_304_B) {
this.field_328_f = null;
}
}
}
public void func_127_w() {
if(this.field_328_f != null) {
double var1 = Math.cos((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D;
double var3 = Math.sin((double)this.rotationYaw * Math.PI / 180.0D) * 0.4D;
this.field_328_f.setPosition(this.posX + var1, this.posY + this.func_130_h() + this.field_328_f.func_117_x(), this.posZ + var3);
}
}
protected void writeEntityToNBT(NBTTagCompound var1) {
}
protected void readEntityFromNBT(NBTTagCompound var1) {
}
public boolean func_6092_a(EntityPlayer var1) {
if(this.field_328_f != null && this.field_328_f instanceof EntityPlayer && this.field_328_f != var1) {
return true;
} else {
if(!this.worldObj.multiplayerWorld) {
var1.func_6094_e(this);
}
return true;
}
}
}

View File

@ -1,77 +0,0 @@
package net.minecraft.src;
public class EntityChicken extends EntityAnimals {
public boolean field_392_a = false;
public float field_391_b = 0.0F;
public float field_395_ad = 0.0F;
public float field_394_ae;
public float field_393_af;
public float field_390_ai = 1.0F;
public int field_396_aj;
public EntityChicken(World var1) {
super(var1);
this.field_9119_aG = "/mob/chicken.png";
this.setSize(0.3F, 0.4F);
this.field_9109_aQ = 4;
this.field_396_aj = this.field_9064_W.nextInt(6000) + 6000;
}
public void onLivingUpdate() {
super.onLivingUpdate();
this.field_393_af = this.field_391_b;
this.field_394_ae = this.field_395_ad;
this.field_395_ad = (float)((double)this.field_395_ad + (double)(this.onGround ? -1 : 4) * 0.3D);
if(this.field_395_ad < 0.0F) {
this.field_395_ad = 0.0F;
}
if(this.field_395_ad > 1.0F) {
this.field_395_ad = 1.0F;
}
if(!this.onGround && this.field_390_ai < 1.0F) {
this.field_390_ai = 1.0F;
}
this.field_390_ai = (float)((double)this.field_390_ai * 0.9D);
if(!this.onGround && this.motionY < 0.0D) {
this.motionY *= 0.6D;
}
this.field_391_b += this.field_390_ai * 2.0F;
if(!this.worldObj.multiplayerWorld && --this.field_396_aj <= 0) {
this.worldObj.playSoundAtEntity(this, "mob.chickenplop", 1.0F, (this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.2F + 1.0F);
this.dropItem(Item.egg.swiftedIndex, 1);
this.field_396_aj = this.field_9064_W.nextInt(6000) + 6000;
}
}
protected void fall(float var1) {
}
public void writeEntityToNBT(NBTTagCompound var1) {
super.writeEntityToNBT(var1);
}
public void readEntityFromNBT(NBTTagCompound var1) {
super.readEntityFromNBT(var1);
}
protected String getLivingSound() {
return "mob.chicken";
}
protected String getHurtSound() {
return "mob.chickenhurt";
}
protected String getDeathSound() {
return "mob.chickenhurt";
}
protected int getDropItemId() {
return Item.feather.swiftedIndex;
}
}

View File

@ -1,49 +0,0 @@
package net.minecraft.src;
public class EntityCow extends EntityAnimals {
public boolean unusedBoolean = false;
public EntityCow(World var1) {
super(var1);
this.field_9119_aG = "/mob/cow.png";
this.setSize(0.9F, 1.3F);
}
public void writeEntityToNBT(NBTTagCompound var1) {
super.writeEntityToNBT(var1);
}
public void readEntityFromNBT(NBTTagCompound var1) {
super.readEntityFromNBT(var1);
}
protected String getLivingSound() {
return "mob.cow";
}
protected String getHurtSound() {
return "mob.cowhurt";
}
protected String getDeathSound() {
return "mob.cowhurt";
}
protected float getSoundVolume() {
return 0.4F;
}
protected int getDropItemId() {
return Item.leather.swiftedIndex;
}
public boolean func_6092_a(EntityPlayer var1) {
ItemStack var2 = var1.inventory.getCurrentItem();
if(var2 != null && var2.itemID == Item.bucketEmpty.swiftedIndex) {
var1.inventory.setInventorySlotContents(var1.inventory.currentItem, new ItemStack(Item.bucketMilk));
return true;
} else {
return false;
}
}
}

View File

@ -1,151 +0,0 @@
package net.minecraft.src;
public class EntityCreature extends EntityLiving {
private PathEntity field_388_a;
protected Entity field_389_ag;
protected boolean field_387_ah = false;
public EntityCreature(World var1) {
super(var1);
}
protected void func_152_d_() {
this.field_387_ah = false;
float var1 = 16.0F;
if(this.field_389_ag == null) {
this.field_389_ag = this.func_158_i();
if(this.field_389_ag != null) {
this.field_388_a = this.worldObj.func_482_a(this, this.field_389_ag, var1);
}
} else if(!this.field_389_ag.func_120_t()) {
this.field_389_ag = null;
} else {
float var2 = this.field_389_ag.getDistanceToEntity(this);
if(this.func_145_g(this.field_389_ag)) {
this.func_157_a(this.field_389_ag, var2);
}
}
if(this.field_387_ah || this.field_389_ag == null || this.field_388_a != null && this.field_9064_W.nextInt(20) != 0) {
if(this.field_388_a == null && this.field_9064_W.nextInt(80) == 0 || this.field_9064_W.nextInt(80) == 0) {
boolean var21 = false;
int var3 = -1;
int var4 = -1;
int var5 = -1;
float var6 = -99999.0F;
for(int var7 = 0; var7 < 10; ++var7) {
int var8 = MathHelper.floor_double(this.posX + (double)this.field_9064_W.nextInt(13) - 6.0D);
int var9 = MathHelper.floor_double(this.posY + (double)this.field_9064_W.nextInt(7) - 3.0D);
int var10 = MathHelper.floor_double(this.posZ + (double)this.field_9064_W.nextInt(13) - 6.0D);
float var11 = this.func_159_a(var8, var9, var10);
if(var11 > var6) {
var6 = var11;
var3 = var8;
var4 = var9;
var5 = var10;
var21 = true;
}
}
if(var21) {
this.field_388_a = this.worldObj.func_501_a(this, var3, var4, var5, 10.0F);
}
}
} else {
this.field_388_a = this.worldObj.func_482_a(this, this.field_389_ag, var1);
}
int var22 = MathHelper.floor_double(this.boundingBox.minY);
boolean var23 = this.handleWaterMovement();
boolean var24 = this.func_112_q();
this.rotationPitch = 0.0F;
if(this.field_388_a != null && this.field_9064_W.nextInt(100) != 0) {
Vec3D var25 = this.field_388_a.getPosition(this);
double var26 = (double)(this.width * 2.0F);
while(var25 != null && var25.squareDistanceTo(this.posX, var25.yCoord, this.posZ) < var26 * var26) {
this.field_388_a.incrementPathIndex();
if(this.field_388_a.isFinished()) {
var25 = null;
this.field_388_a = null;
} else {
var25 = this.field_388_a.getPosition(this);
}
}
this.field_9128_br = false;
if(var25 != null) {
double var27 = var25.xCoord - this.posX;
double var28 = var25.zCoord - this.posZ;
double var12 = var25.yCoord - (double)var22;
float var14 = (float)(Math.atan2(var28, var27) * 180.0D / (double)((float)Math.PI)) - 90.0F;
float var15 = var14 - this.rotationYaw;
for(this.field_9130_bp = this.field_9126_bt; var15 < -180.0F; var15 += 360.0F) {
}
while(var15 >= 180.0F) {
var15 -= 360.0F;
}
if(var15 > 30.0F) {
var15 = 30.0F;
}
if(var15 < -30.0F) {
var15 = -30.0F;
}
this.rotationYaw += var15;
if(this.field_387_ah && this.field_389_ag != null) {
double var16 = this.field_389_ag.posX - this.posX;
double var18 = this.field_389_ag.posZ - this.posZ;
float var20 = this.rotationYaw;
this.rotationYaw = (float)(Math.atan2(var18, var16) * 180.0D / (double)((float)Math.PI)) - 90.0F;
var15 = (var20 - this.rotationYaw + 90.0F) * (float)Math.PI / 180.0F;
this.field_9131_bo = -MathHelper.sin(var15) * this.field_9130_bp * 1.0F;
this.field_9130_bp = MathHelper.cos(var15) * this.field_9130_bp * 1.0F;
}
if(var12 > 0.0D) {
this.field_9128_br = true;
}
}
if(this.field_389_ag != null) {
this.func_147_b(this.field_389_ag, 30.0F);
}
if(this.field_9084_B) {
this.field_9128_br = true;
}
if(this.field_9064_W.nextFloat() < 0.8F && (var23 || var24)) {
this.field_9128_br = true;
}
} else {
super.func_152_d_();
this.field_388_a = null;
}
}
protected void func_157_a(Entity var1, float var2) {
}
protected float func_159_a(int var1, int var2, int var3) {
return 0.0F;
}
protected Entity func_158_i() {
return null;
}
public boolean getCanSpawnHere() {
int var1 = MathHelper.floor_double(this.posX);
int var2 = MathHelper.floor_double(this.boundingBox.minY);
int var3 = MathHelper.floor_double(this.posZ);
return super.getCanSpawnHere() && this.func_159_a(var1, var2, var3) >= 0.0F;
}
}

View File

@ -1,106 +0,0 @@
package net.minecraft.src;
public class EntityCreeper extends EntityMobs {
int field_406_a;
int field_405_b;
int field_408_ad = 30;
int field_407_ae = -1;
int field_12011_e = -1;
public EntityCreeper(World var1) {
super(var1);
this.field_9119_aG = "/mob/creeper.png";
}
public void writeEntityToNBT(NBTTagCompound var1) {
super.writeEntityToNBT(var1);
}
public void readEntityFromNBT(NBTTagCompound var1) {
super.readEntityFromNBT(var1);
}
public void onUpdate() {
this.field_405_b = this.field_406_a;
if(this.worldObj.multiplayerWorld) {
this.field_406_a += this.field_407_ae;
if(this.field_406_a < 0) {
this.field_406_a = 0;
}
if(this.field_406_a >= this.field_408_ad) {
this.field_406_a = this.field_408_ad;
}
}
super.onUpdate();
}
protected void func_152_d_() {
if(this.field_12011_e != this.field_407_ae) {
this.field_12011_e = this.field_407_ae;
if(this.field_407_ae > 0) {
this.worldObj.func_9206_a(this, (byte)4);
} else {
this.worldObj.func_9206_a(this, (byte)5);
}
}
this.field_405_b = this.field_406_a;
if(this.worldObj.multiplayerWorld) {
super.func_152_d_();
} else {
if(this.field_406_a > 0 && this.field_407_ae < 0) {
--this.field_406_a;
}
if(this.field_407_ae >= 0) {
this.field_407_ae = 2;
}
super.func_152_d_();
if(this.field_407_ae != 1) {
this.field_407_ae = -1;
}
}
}
protected String getHurtSound() {
return "mob.creeper";
}
protected String getDeathSound() {
return "mob.creeperdeath";
}
public void onDeath(Entity var1) {
super.onDeath(var1);
if(var1 instanceof EntitySkeleton) {
this.dropItem(Item.record13.swiftedIndex + this.field_9064_W.nextInt(2), 1);
}
}
protected void func_157_a(Entity var1, float var2) {
if(this.field_407_ae <= 0 && var2 < 3.0F || this.field_407_ae > 0 && var2 < 7.0F) {
if(this.field_406_a == 0) {
this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 0.5F);
}
this.field_407_ae = 1;
++this.field_406_a;
if(this.field_406_a == this.field_408_ad) {
this.worldObj.func_12013_a(this, this.posX, this.posY, this.posZ, 3.0F);
this.setEntityDead();
}
this.field_387_ah = true;
}
}
protected int getDropItemId() {
return Item.gunpowder.swiftedIndex;
}
}

View File

@ -1,74 +0,0 @@
package net.minecraft.src;
public class EntityFallingSand extends Entity {
public int field_427_a;
public int field_426_b = 0;
public EntityFallingSand(World var1) {
super(var1);
}
public EntityFallingSand(World var1, float var2, float var3, float var4, int var5) {
super(var1);
this.field_427_a = var5;
this.field_329_e = true;
this.setSize(0.98F, 0.98F);
this.yOffset = this.height / 2.0F;
this.setPosition((double)var2, (double)var3, (double)var4);
this.motionX = 0.0D;
this.motionY = 0.0D;
this.motionZ = 0.0D;
this.entityWalks = false;
this.prevPosX = (double)var2;
this.prevPosY = (double)var3;
this.prevPosZ = (double)var4;
}
public boolean func_129_c_() {
return !this.field_304_B;
}
public void onUpdate() {
if(this.field_427_a == 0) {
this.setEntityDead();
} else {
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
++this.field_426_b;
this.motionY -= (double)0.04F;
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= (double)0.98F;
this.motionY *= (double)0.98F;
this.motionZ *= (double)0.98F;
int var1 = MathHelper.floor_double(this.posX);
int var2 = MathHelper.floor_double(this.posY);
int var3 = MathHelper.floor_double(this.posZ);
if(this.worldObj.getBlockId(var1, var2, var3) == this.field_427_a) {
this.worldObj.setBlockWithNotify(var1, var2, var3, 0);
}
if(this.onGround) {
this.motionX *= (double)0.7F;
this.motionZ *= (double)0.7F;
this.motionY *= -0.5D;
this.setEntityDead();
if(!this.worldObj.func_516_a(this.field_427_a, var1, var2, var3, true) || !this.worldObj.setBlockWithNotify(var1, var2, var3, this.field_427_a)) {
this.dropItem(this.field_427_a, 1);
}
} else if(this.field_426_b > 100) {
this.dropItem(this.field_427_a, 1);
this.setEntityDead();
}
}
}
protected void writeEntityToNBT(NBTTagCompound var1) {
var1.setByte("Tile", (byte)this.field_427_a);
}
protected void readEntityFromNBT(NBTTagCompound var1) {
this.field_427_a = var1.getByte("Tile") & 255;
}
}

View File

@ -1,193 +0,0 @@
package net.minecraft.src;
import java.util.List;
public class EntityFireball extends Entity {
private int field_9195_e = -1;
private int field_9193_f = -1;
private int field_9197_aj = -1;
private int field_9194_ak = 0;
private boolean field_9192_al = false;
public int field_9200_a = 0;
private EntityLiving field_9191_am;
private int field_9190_an;
private int field_9189_ao = 0;
public double field_9199_b;
public double field_9198_c;
public double field_9196_d;
public EntityFireball(World var1) {
super(var1);
this.setSize(1.0F, 1.0F);
}
public EntityFireball(World var1, EntityLiving var2, double var3, double var5, double var7) {
super(var1);
this.field_9191_am = var2;
this.setSize(1.0F, 1.0F);
this.func_107_c(var2.posX, var2.posY, var2.posZ, var2.rotationYaw, var2.rotationPitch);
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
this.motionX = this.motionY = this.motionZ = 0.0D;
var3 += this.field_9064_W.nextGaussian() * 0.4D;
var5 += this.field_9064_W.nextGaussian() * 0.4D;
var7 += this.field_9064_W.nextGaussian() * 0.4D;
double var9 = (double)MathHelper.sqrt_double(var3 * var3 + var5 * var5 + var7 * var7);
this.field_9199_b = var3 / var9 * 0.1D;
this.field_9198_c = var5 / var9 * 0.1D;
this.field_9196_d = var7 / var9 * 0.1D;
}
public void onUpdate() {
super.onUpdate();
this.field_9061_Z = 10;
if(this.field_9200_a > 0) {
--this.field_9200_a;
}
if(this.field_9192_al) {
int var1 = this.worldObj.getBlockId(this.field_9195_e, this.field_9193_f, this.field_9197_aj);
if(var1 == this.field_9194_ak) {
++this.field_9190_an;
if(this.field_9190_an == 1200) {
this.setEntityDead();
}
return;
}
this.field_9192_al = false;
this.motionX *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.motionY *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.motionZ *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.field_9190_an = 0;
this.field_9189_ao = 0;
} else {
++this.field_9189_ao;
}
Vec3D var15 = Vec3D.createVector(this.posX, this.posY, this.posZ);
Vec3D var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition var3 = this.worldObj.func_486_a(var15, var2);
var15 = Vec3D.createVector(this.posX, this.posY, this.posZ);
var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if(var3 != null) {
var2 = Vec3D.createVector(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord);
}
Entity var4 = null;
List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expands(1.0D, 1.0D, 1.0D));
double var6 = 0.0D;
for(int var8 = 0; var8 < var5.size(); ++var8) {
Entity var9 = (Entity)var5.get(var8);
if(var9.func_129_c_() && (var9 != this.field_9191_am || this.field_9189_ao >= 25)) {
float var10 = 0.3F;
AxisAlignedBB var11 = var9.boundingBox.expands((double)var10, (double)var10, (double)var10);
MovingObjectPosition var12 = var11.func_706_a(var15, var2);
if(var12 != null) {
double var13 = var15.distanceTo(var12.hitVec);
if(var13 < var6 || var6 == 0.0D) {
var4 = var9;
var6 = var13;
}
}
}
}
if(var4 != null) {
var3 = new MovingObjectPosition(var4);
}
if(var3 != null) {
if(var3.entityHit != null && var3.entityHit.attackEntity(this.field_9191_am, 0)) {
}
this.worldObj.func_12015_a((Entity)null, this.posX, this.posY, this.posZ, 1.0F, true);
this.setEntityDead();
}
this.posX += this.motionX;
this.posY += this.motionY;
this.posZ += this.motionZ;
float var16 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI));
for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var16) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
}
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
}
while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) {
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float var17 = 0.95F;
if(this.handleWaterMovement()) {
for(int var18 = 0; var18 < 4; ++var18) {
float var19 = 0.25F;
this.worldObj.spawnParticle("bubble", this.posX - this.motionX * (double)var19, this.posY - this.motionY * (double)var19, this.posZ - this.motionZ * (double)var19, this.motionX, this.motionY, this.motionZ);
}
var17 = 0.8F;
}
this.motionX += this.field_9199_b;
this.motionY += this.field_9198_c;
this.motionZ += this.field_9196_d;
this.motionX *= (double)var17;
this.motionY *= (double)var17;
this.motionZ *= (double)var17;
this.worldObj.spawnParticle("smoke", this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D);
this.setPosition(this.posX, this.posY, this.posZ);
}
public void writeEntityToNBT(NBTTagCompound var1) {
var1.setShort("xTile", (short)this.field_9195_e);
var1.setShort("yTile", (short)this.field_9193_f);
var1.setShort("zTile", (short)this.field_9197_aj);
var1.setByte("inTile", (byte)this.field_9194_ak);
var1.setByte("shake", (byte)this.field_9200_a);
var1.setByte("inGround", (byte)(this.field_9192_al ? 1 : 0));
}
public void readEntityFromNBT(NBTTagCompound var1) {
this.field_9195_e = var1.getShort("xTile");
this.field_9193_f = var1.getShort("yTile");
this.field_9197_aj = var1.getShort("zTile");
this.field_9194_ak = var1.getByte("inTile") & 255;
this.field_9200_a = var1.getByte("shake") & 255;
this.field_9192_al = var1.getByte("inGround") == 1;
}
public boolean func_129_c_() {
return true;
}
public boolean attackEntity(Entity var1, int var2) {
this.func_9060_u();
if(var1 != null) {
Vec3D var3 = var1.func_4039_B();
if(var3 != null) {
this.motionX = var3.xCoord;
this.motionY = var3.yCoord;
this.motionZ = var3.zCoord;
this.field_9199_b = this.motionX * 0.1D;
this.field_9198_c = this.motionY * 0.1D;
this.field_9196_d = this.motionZ * 0.1D;
}
return true;
} else {
return false;
}
}
}

View File

@ -1,313 +0,0 @@
package net.minecraft.src;
import java.util.List;
public class EntityFish extends Entity {
private int d = -1;
private int e = -1;
private int field_4126_f = -1;
private int field_4132_ai = 0;
private boolean field_4129_aj = false;
public int field_4134_a = 0;
public EntityPlayer b;
private int field_6150_ak;
private int field_4125_al = 0;
private int field_4124_am = 0;
public Entity c = null;
private int field_6149_an;
private double field_6148_ao;
private double field_6147_ap;
private double field_6146_aq;
private double field_6145_ar;
private double field_6144_as;
public EntityFish(World var1) {
super(var1);
this.setSize(0.25F, 0.25F);
}
public EntityFish(World var1, EntityPlayer var2) {
super(var1);
this.b = var2;
this.b.field_6124_at = this;
this.setSize(0.25F, 0.25F);
this.func_107_c(var2.posX, var2.posY + 1.62D - (double)var2.yOffset, var2.posZ, var2.rotationYaw, var2.rotationPitch);
this.posX -= (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
this.posY -= (double)0.1F;
this.posZ -= (double)(MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * 0.16F);
this.setPosition(this.posX, this.posY, this.posZ);
this.yOffset = 0.0F;
float var3 = 0.4F;
this.motionX = (double)(-MathHelper.sin(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var3);
this.motionZ = (double)(MathHelper.cos(this.rotationYaw / 180.0F * (float)Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float)Math.PI) * var3);
this.motionY = (double)(-MathHelper.sin(this.rotationPitch / 180.0F * (float)Math.PI) * var3);
this.func_6142_a(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
}
public void func_6142_a(double var1, double var3, double var5, float var7, float var8) {
float var9 = MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5);
var1 /= (double)var9;
var3 /= (double)var9;
var5 /= (double)var9;
var1 += this.field_9064_W.nextGaussian() * (double)0.0075F * (double)var8;
var3 += this.field_9064_W.nextGaussian() * (double)0.0075F * (double)var8;
var5 += this.field_9064_W.nextGaussian() * (double)0.0075F * (double)var8;
var1 *= (double)var7;
var3 *= (double)var7;
var5 *= (double)var7;
this.motionX = var1;
this.motionY = var3;
this.motionZ = var5;
float var10 = MathHelper.sqrt_double(var1 * var1 + var5 * var5);
this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(var1, var5) * 180.0D / (double)((float)Math.PI));
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(var3, (double)var10) * 180.0D / (double)((float)Math.PI));
this.field_6150_ak = 0;
}
public void onUpdate() {
super.onUpdate();
if(this.field_6149_an > 0) {
double var21 = this.posX + (this.field_6148_ao - this.posX) / (double)this.field_6149_an;
double var22 = this.posY + (this.field_6147_ap - this.posY) / (double)this.field_6149_an;
double var23 = this.posZ + (this.field_6146_aq - this.posZ) / (double)this.field_6149_an;
double var7;
for(var7 = this.field_6145_ar - (double)this.rotationYaw; var7 < -180.0D; var7 += 360.0D) {
}
while(var7 >= 180.0D) {
var7 -= 360.0D;
}
this.rotationYaw = (float)((double)this.rotationYaw + var7 / (double)this.field_6149_an);
this.rotationPitch = (float)((double)this.rotationPitch + (this.field_6144_as - (double)this.rotationPitch) / (double)this.field_6149_an);
--this.field_6149_an;
this.setPosition(var21, var22, var23);
this.setRotation(this.rotationYaw, this.rotationPitch);
} else {
if(!this.worldObj.multiplayerWorld) {
ItemStack var1 = this.b.func_172_B();
if(this.b.field_304_B || !this.b.func_120_t() || var1 == null || var1.getItem() != Item.fishingRod || this.getDistanceSqToEntity(this.b) > 1024.0D) {
this.setEntityDead();
this.b.field_6124_at = null;
return;
}
if(this.c != null) {
if(!this.c.field_304_B) {
this.posX = this.c.posX;
this.posY = this.c.boundingBox.minY + (double)this.c.height * 0.8D;
this.posZ = this.c.posZ;
return;
}
this.c = null;
}
}
if(this.field_4134_a > 0) {
--this.field_4134_a;
}
if(this.field_4129_aj) {
int var19 = this.worldObj.getBlockId(this.d, this.e, this.field_4126_f);
if(var19 == this.field_4132_ai) {
++this.field_6150_ak;
if(this.field_6150_ak == 1200) {
this.setEntityDead();
}
return;
}
this.field_4129_aj = false;
this.motionX *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.motionY *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.motionZ *= (double)(this.field_9064_W.nextFloat() * 0.2F);
this.field_6150_ak = 0;
this.field_4125_al = 0;
} else {
++this.field_4125_al;
}
Vec3D var20 = Vec3D.createVector(this.posX, this.posY, this.posZ);
Vec3D var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
MovingObjectPosition var3 = this.worldObj.func_486_a(var20, var2);
var20 = Vec3D.createVector(this.posX, this.posY, this.posZ);
var2 = Vec3D.createVector(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
if(var3 != null) {
var2 = Vec3D.createVector(var3.hitVec.xCoord, var3.hitVec.yCoord, var3.hitVec.zCoord);
}
Entity var4 = null;
List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expands(1.0D, 1.0D, 1.0D));
double var6 = 0.0D;
double var13;
for(int var8 = 0; var8 < var5.size(); ++var8) {
Entity var9 = (Entity)var5.get(var8);
if(var9.func_129_c_() && (var9 != this.b || this.field_4125_al >= 5)) {
float var10 = 0.3F;
AxisAlignedBB var11 = var9.boundingBox.expands((double)var10, (double)var10, (double)var10);
MovingObjectPosition var12 = var11.func_706_a(var20, var2);
if(var12 != null) {
var13 = var20.distanceTo(var12.hitVec);
if(var13 < var6 || var6 == 0.0D) {
var4 = var9;
var6 = var13;
}
}
}
}
if(var4 != null) {
var3 = new MovingObjectPosition(var4);
}
if(var3 != null) {
if(var3.entityHit != null) {
if(var3.entityHit.attackEntity(this.b, 0)) {
this.c = var3.entityHit;
}
} else {
this.field_4129_aj = true;
}
}
if(!this.field_4129_aj) {
this.moveEntity(this.motionX, this.motionY, this.motionZ);
float var24 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / (double)((float)Math.PI));
for(this.rotationPitch = (float)(Math.atan2(this.motionY, (double)var24) * 180.0D / (double)((float)Math.PI)); this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
}
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
this.prevRotationPitch += 360.0F;
}
while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
this.prevRotationYaw -= 360.0F;
}
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) {
this.prevRotationYaw += 360.0F;
}
this.rotationPitch = this.prevRotationPitch + (this.rotationPitch - this.prevRotationPitch) * 0.2F;
this.rotationYaw = this.prevRotationYaw + (this.rotationYaw - this.prevRotationYaw) * 0.2F;
float var25 = 0.92F;
if(this.onGround || this.field_9084_B) {
var25 = 0.5F;
}
byte var26 = 5;
double var27 = 0.0D;
for(int var28 = 0; var28 < var26; ++var28) {
double var14 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var28 + 0) / (double)var26 - 0.125D + 0.125D;
double var16 = this.boundingBox.minY + (this.boundingBox.maxY - this.boundingBox.minY) * (double)(var28 + 1) / (double)var26 - 0.125D + 0.125D;
AxisAlignedBB var18 = AxisAlignedBB.getBoundingBoxFromPool(this.boundingBox.minX, var14, this.boundingBox.minZ, this.boundingBox.maxX, var16, this.boundingBox.maxZ);
if(this.worldObj.func_524_b(var18, Material.water)) {
var27 += 1.0D / (double)var26;
}
}
if(var27 > 0.0D) {
if(this.field_4124_am > 0) {
--this.field_4124_am;
} else if(this.field_9064_W.nextInt(500) == 0) {
this.field_4124_am = this.field_9064_W.nextInt(30) + 10;
this.motionY -= (double)0.2F;
this.worldObj.playSoundAtEntity(this, "random.splash", 0.25F, 1.0F + (this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.4F);
float var29 = (float)MathHelper.floor_double(this.boundingBox.minY);
float var15;
int var30;
float var31;
for(var30 = 0; (float)var30 < 1.0F + this.width * 20.0F; ++var30) {
var15 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
var31 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
this.worldObj.spawnParticle("bubble", this.posX + (double)var15, (double)(var29 + 1.0F), this.posZ + (double)var31, this.motionX, this.motionY - (double)(this.field_9064_W.nextFloat() * 0.2F), this.motionZ);
}
for(var30 = 0; (float)var30 < 1.0F + this.width * 20.0F; ++var30) {
var15 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
var31 = (this.field_9064_W.nextFloat() * 2.0F - 1.0F) * this.width;
this.worldObj.spawnParticle("splash", this.posX + (double)var15, (double)(var29 + 1.0F), this.posZ + (double)var31, this.motionX, this.motionY, this.motionZ);
}
}
}
if(this.field_4124_am > 0) {
this.motionY -= (double)(this.field_9064_W.nextFloat() * this.field_9064_W.nextFloat() * this.field_9064_W.nextFloat()) * 0.2D;
}
var13 = var27 * 2.0D - 1.0D;
this.motionY += (double)0.04F * var13;
if(var27 > 0.0D) {
var25 = (float)((double)var25 * 0.9D);
this.motionY *= 0.8D;
}
this.motionX *= (double)var25;
this.motionY *= (double)var25;
this.motionZ *= (double)var25;
this.setPosition(this.posX, this.posY, this.posZ);
}
}
}
public void writeEntityToNBT(NBTTagCompound var1) {
var1.setShort("xTile", (short)this.d);
var1.setShort("yTile", (short)this.e);
var1.setShort("zTile", (short)this.field_4126_f);
var1.setByte("inTile", (byte)this.field_4132_ai);
var1.setByte("shake", (byte)this.field_4134_a);
var1.setByte("inGround", (byte)(this.field_4129_aj ? 1 : 0));
}
public void readEntityFromNBT(NBTTagCompound var1) {
this.d = var1.getShort("xTile");
this.e = var1.getShort("yTile");
this.field_4126_f = var1.getShort("zTile");
this.field_4132_ai = var1.getByte("inTile") & 255;
this.field_4134_a = var1.getByte("shake") & 255;
this.field_4129_aj = var1.getByte("inGround") == 1;
}
public int func_6143_c() {
byte var1 = 0;
if(this.c != null) {
double var2 = this.b.posX - this.posX;
double var4 = this.b.posY - this.posY;
double var6 = this.b.posZ - this.posZ;
double var8 = (double)MathHelper.sqrt_double(var2 * var2 + var4 * var4 + var6 * var6);
double var10 = 0.1D;
this.c.motionX += var2 * var10;
this.c.motionY += var4 * var10 + (double)MathHelper.sqrt_double(var8) * 0.08D;
this.c.motionZ += var6 * var10;
var1 = 3;
} else if(this.field_4124_am > 0) {
EntityItem var13 = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, new ItemStack(Item.fishRaw.swiftedIndex));
double var3 = this.b.posX - this.posX;
double var5 = this.b.posY - this.posY;
double var7 = this.b.posZ - this.posZ;
double var9 = (double)MathHelper.sqrt_double(var3 * var3 + var5 * var5 + var7 * var7);
double var11 = 0.1D;
var13.motionX = var3 * var11;
var13.motionY = var5 * var11 + (double)MathHelper.sqrt_double(var9) * 0.08D;
var13.motionZ = var7 * var11;
this.worldObj.entityJoinedWorld(var13);
var1 = 1;
}
if(this.field_4129_aj) {
var1 = 2;
}
this.setEntityDead();
this.b.field_6124_at = null;
return var1;
}
}

View File

@ -1,66 +0,0 @@
package net.minecraft.src;
public class EntityFlying extends EntityLiving {
public EntityFlying(World var1) {
super(var1);
}
protected void fall(float var1) {
}
public void func_148_c(float var1, float var2) {
if(this.handleWaterMovement()) {
this.func_90_a(var1, var2, 0.02F);
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= (double)0.8F;
this.motionY *= (double)0.8F;
this.motionZ *= (double)0.8F;
} else if(this.func_112_q()) {
this.func_90_a(var1, var2, 0.02F);
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= 0.5D;
this.motionY *= 0.5D;
this.motionZ *= 0.5D;
} else {
float var3 = 0.91F;
if(this.onGround) {
var3 = 546.0F * 0.1F * 0.1F * 0.1F;
int var4 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ));
if(var4 > 0) {
var3 = Block.blocksList[var4].slipperiness * 0.91F;
}
}
float var8 = 0.16277136F / (var3 * var3 * var3);
this.func_90_a(var1, var2, this.onGround ? 0.1F * var8 : 0.02F);
var3 = 0.91F;
if(this.onGround) {
var3 = 546.0F * 0.1F * 0.1F * 0.1F;
int var5 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ));
if(var5 > 0) {
var3 = Block.blocksList[var5].slipperiness * 0.91F;
}
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.motionX *= (double)var3;
this.motionY *= (double)var3;
this.motionZ *= (double)var3;
}
this.field_9142_bc = this.field_9141_bd;
double var10 = this.posX - this.prevPosX;
double var9 = this.posZ - this.prevPosZ;
float var7 = MathHelper.sqrt_double(var10 * var10 + var9 * var9) * 4.0F;
if(var7 > 1.0F) {
var7 = 1.0F;
}
this.field_9141_bd += (var7 - this.field_9141_bd) * 0.4F;
this.field_386_ba += this.field_9141_bd;
}
public boolean func_144_E() {
return false;
}
}

View File

@ -1,139 +0,0 @@
package net.minecraft.src;
public class EntityGhast extends EntityFlying implements IMobs {
public int field_4099_a = 0;
public double field_4098_b;
public double field_4104_c;
public double field_4102_d;
private Entity field_4097_ai = null;
private int field_4103_aj = 0;
public int field_4101_e = 0;
public int field_4100_f = 0;
public EntityGhast(World var1) {
super(var1);
this.field_9119_aG = "/mob/ghast.png";
this.setSize(4.0F, 4.0F);
this.field_9079_ae = true;
}
protected void func_152_d_() {
if(this.worldObj.monstersEnabled == 0) {
this.setEntityDead();
}
this.field_4101_e = this.field_4100_f;
double var1 = this.field_4098_b - this.posX;
double var3 = this.field_4104_c - this.posY;
double var5 = this.field_4102_d - this.posZ;
double var7 = (double)MathHelper.sqrt_double(var1 * var1 + var3 * var3 + var5 * var5);
if(var7 < 1.0D || var7 > 60.0D) {
this.field_4098_b = this.posX + (double)((this.field_9064_W.nextFloat() * 2.0F - 1.0F) * 16.0F);
this.field_4104_c = this.posY + (double)((this.field_9064_W.nextFloat() * 2.0F - 1.0F) * 16.0F);
this.field_4102_d = this.posZ + (double)((this.field_9064_W.nextFloat() * 2.0F - 1.0F) * 16.0F);
}
if(this.field_4099_a-- <= 0) {
this.field_4099_a += this.field_9064_W.nextInt(5) + 2;
if(this.func_4046_a(this.field_4098_b, this.field_4104_c, this.field_4102_d, var7)) {
this.motionX += var1 / var7 * 0.1D;
this.motionY += var3 / var7 * 0.1D;
this.motionZ += var5 / var7 * 0.1D;
} else {
this.field_4098_b = this.posX;
this.field_4104_c = this.posY;
this.field_4102_d = this.posZ;
}
}
if(this.field_4097_ai != null && this.field_4097_ai.field_304_B) {
this.field_4097_ai = null;
}
if(this.field_4097_ai == null || this.field_4103_aj-- <= 0) {
this.field_4097_ai = this.worldObj.getClosestPlayerToEntity(this, 100.0D);
if(this.field_4097_ai != null) {
this.field_4103_aj = 20;
}
}
double var9 = 64.0D;
if(this.field_4097_ai != null && this.field_4097_ai.getDistanceSqToEntity(this) < var9 * var9) {
double var11 = this.field_4097_ai.posX - this.posX;
double var13 = this.field_4097_ai.boundingBox.minY + (double)(this.field_4097_ai.height / 2.0F) - (this.posY + (double)(this.height / 2.0F));
double var15 = this.field_4097_ai.posZ - this.posZ;
this.field_9095_az = this.rotationYaw = -((float)Math.atan2(var11, var15)) * 180.0F / (float)Math.PI;
if(this.func_145_g(this.field_4097_ai)) {
if(this.field_4100_f == 10) {
this.worldObj.playSoundAtEntity(this, "mob.ghast.charge", this.getSoundVolume(), (this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.2F + 1.0F);
}
++this.field_4100_f;
if(this.field_4100_f == 20) {
this.worldObj.playSoundAtEntity(this, "mob.ghast.fireball", this.getSoundVolume(), (this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.2F + 1.0F);
EntityFireball var17 = new EntityFireball(this.worldObj, this, var11, var13, var15);
double var18 = 4.0D;
Vec3D var20 = this.func_141_d(1.0F);
var17.posX = this.posX + var20.xCoord * var18;
var17.posY = this.posY + (double)(this.height / 2.0F) + 0.5D;
var17.posZ = this.posZ + var20.zCoord * var18;
this.worldObj.entityJoinedWorld(var17);
this.field_4100_f = -40;
}
} else if(this.field_4100_f > 0) {
--this.field_4100_f;
}
} else {
this.field_9095_az = this.rotationYaw = -((float)Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float)Math.PI;
if(this.field_4100_f > 0) {
--this.field_4100_f;
}
}
this.field_9119_aG = this.field_4100_f > 10 ? "/mob/ghast_fire.png" : "/mob/ghast.png";
}
private boolean func_4046_a(double var1, double var3, double var5, double var7) {
double var9 = (this.field_4098_b - this.posX) / var7;
double var11 = (this.field_4104_c - this.posY) / var7;
double var13 = (this.field_4102_d - this.posZ) / var7;
AxisAlignedBB var15 = this.boundingBox.copy();
for(int var16 = 1; (double)var16 < var7; ++var16) {
var15.offset(var9, var11, var13);
if(this.worldObj.getCollidingBoundingBoxes(this, var15).size() > 0) {
return false;
}
}
return true;
}
protected String getLivingSound() {
return "mob.ghast.moan";
}
protected String getHurtSound() {
return "mob.ghast.scream";
}
protected String getDeathSound() {
return "mob.ghast.death";
}
protected int getDropItemId() {
return Item.gunpowder.swiftedIndex;
}
protected float getSoundVolume() {
return 10.0F;
}
public boolean getCanSpawnHere() {
return this.field_9064_W.nextInt(20) == 0 && super.getCanSpawnHere() && this.worldObj.monstersEnabled > 0;
}
public int func_4045_i() {
return 1;
}
}

View File

@ -1,191 +0,0 @@
package net.minecraft.src;
public class EntityItem extends Entity {
public ItemStack item;
private int field_9170_e;
public int field_9169_b = 0;
public int field_433_ad;
private int health = 5;
public float field_432_ae = (float)(Math.random() * Math.PI * 2.0D);
public EntityItem(World var1, double var2, double var4, double var6, ItemStack var8) {
super(var1);
this.setSize(0.25F, 0.25F);
this.yOffset = this.height / 2.0F;
this.setPosition(var2, var4, var6);
this.item = var8;
this.rotationYaw = (float)(Math.random() * 360.0D);
this.motionX = (double)((float)(Math.random() * (double)0.2F - (double)0.1F));
this.motionY = (double)0.2F;
this.motionZ = (double)((float)(Math.random() * (double)0.2F - (double)0.1F));
this.entityWalks = false;
}
public EntityItem(World var1) {
super(var1);
this.setSize(0.25F, 0.25F);
this.yOffset = this.height / 2.0F;
}
public void onUpdate() {
super.onUpdate();
if(this.field_433_ad > 0) {
--this.field_433_ad;
}
this.prevPosX = this.posX;
this.prevPosY = this.posY;
this.prevPosZ = this.posZ;
this.motionY -= (double)0.04F;
if(this.worldObj.getBlockMaterial(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)) == Material.lava) {
this.motionY = (double)0.2F;
this.motionX = (double)((this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.2F);
this.motionZ = (double)((this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.2F);
this.worldObj.playSoundAtEntity(this, "random.fizz", 0.4F, 2.0F + this.field_9064_W.nextFloat() * 0.4F);
}
this.func_176_g(this.posX, this.posY, this.posZ);
this.handleWaterMovement();
this.moveEntity(this.motionX, this.motionY, this.motionZ);
float var1 = 0.98F;
if(this.onGround) {
var1 = 0.1F * 0.1F * 58.8F;
int var2 = this.worldObj.getBlockId(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.boundingBox.minY) - 1, MathHelper.floor_double(this.posZ));
if(var2 > 0) {
var1 = Block.blocksList[var2].slipperiness * 0.98F;
}
}
this.motionX *= (double)var1;
this.motionY *= (double)0.98F;
this.motionZ *= (double)var1;
if(this.onGround) {
this.motionY *= -0.5D;
}
++this.field_9170_e;
++this.field_9169_b;
if(this.field_9169_b >= 6000) {
this.setEntityDead();
}
}
public boolean handleWaterMovement() {
return this.worldObj.func_490_a(this.boundingBox, Material.water, this);
}
private boolean func_176_g(double var1, double var3, double var5) {
int var7 = MathHelper.floor_double(var1);
int var8 = MathHelper.floor_double(var3);
int var9 = MathHelper.floor_double(var5);
double var10 = var1 - (double)var7;
double var12 = var3 - (double)var8;
double var14 = var5 - (double)var9;
if(Block.field_540_p[this.worldObj.getBlockId(var7, var8, var9)]) {
boolean var16 = !Block.field_540_p[this.worldObj.getBlockId(var7 - 1, var8, var9)];
boolean var17 = !Block.field_540_p[this.worldObj.getBlockId(var7 + 1, var8, var9)];
boolean var18 = !Block.field_540_p[this.worldObj.getBlockId(var7, var8 - 1, var9)];
boolean var19 = !Block.field_540_p[this.worldObj.getBlockId(var7, var8 + 1, var9)];
boolean var20 = !Block.field_540_p[this.worldObj.getBlockId(var7, var8, var9 - 1)];
boolean var21 = !Block.field_540_p[this.worldObj.getBlockId(var7, var8, var9 + 1)];
byte var22 = -1;
double var23 = 9999.0D;
if(var16 && var10 < var23) {
var23 = var10;
var22 = 0;
}
if(var17 && 1.0D - var10 < var23) {
var23 = 1.0D - var10;
var22 = 1;
}
if(var18 && var12 < var23) {
var23 = var12;
var22 = 2;
}
if(var19 && 1.0D - var12 < var23) {
var23 = 1.0D - var12;
var22 = 3;
}
if(var20 && var14 < var23) {
var23 = var14;
var22 = 4;
}
if(var21 && 1.0D - var14 < var23) {
var23 = 1.0D - var14;
var22 = 5;
}
float var25 = this.field_9064_W.nextFloat() * 0.2F + 0.1F;
if(var22 == 0) {
this.motionX = (double)(-var25);
}
if(var22 == 1) {
this.motionX = (double)var25;
}
if(var22 == 2) {
this.motionY = (double)(-var25);
}
if(var22 == 3) {
this.motionY = (double)var25;
}
if(var22 == 4) {
this.motionZ = (double)(-var25);
}
if(var22 == 5) {
this.motionZ = (double)var25;
}
}
return false;
}
protected void func_125_b(int var1) {
this.attackEntity((Entity)null, var1);
}
public boolean attackEntity(Entity var1, int var2) {
this.func_9060_u();
this.health -= var2;
if(this.health <= 0) {
this.setEntityDead();
}
return false;
}
public void writeEntityToNBT(NBTTagCompound var1) {
var1.setShort("Health", (short)((byte)this.health));
var1.setShort("Age", (short)this.field_9169_b);
var1.setCompoundTag("Item", this.item.writeToNBT(new NBTTagCompound()));
}
public void readEntityFromNBT(NBTTagCompound var1) {
this.health = var1.getShort("Health") & 255;
this.field_9169_b = var1.getShort("Age");
NBTTagCompound var2 = var1.getCompoundTag("Item");
this.item = new ItemStack(var2);
}
public void onCollideWithPlayer(EntityPlayer var1) {
if(!this.worldObj.multiplayerWorld) {
int var2 = this.item.stackSize;
if(this.field_433_ad == 0 && var1.inventory.addItemStackToInventory(this.item)) {
this.worldObj.playSoundAtEntity(this, "random.pop", 0.2F, ((this.field_9064_W.nextFloat() - this.field_9064_W.nextFloat()) * 0.7F + 1.0F) * 2.0F);
var1.func_163_c(this, var2);
this.setEntityDead();
}
}
}
}

View File

@ -1,87 +0,0 @@
package net.minecraft.src;
import java.util.HashMap;
import java.util.Map;
public class EntityList {
private static Map field_849_a = new HashMap();
private static Map field_848_b = new HashMap();
private static Map field_851_c = new HashMap();
private static Map field_850_d = new HashMap();
private static void func_563_a(Class var0, String var1, int var2) {
field_849_a.put(var1, var0);
field_848_b.put(var0, var1);
field_851_c.put(Integer.valueOf(var2), var0);
field_850_d.put(var0, Integer.valueOf(var2));
}
public static Entity func_567_a(String var0, World var1) {
Entity var2 = null;
try {
Class var3 = (Class)field_849_a.get(var0);
if(var3 != null) {
var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
}
} catch (Exception var4) {
var4.printStackTrace();
}
return var2;
}
public static Entity func_566_a(NBTTagCompound var0, World var1) {
Entity var2 = null;
try {
Class var3 = (Class)field_849_a.get(var0.getString("id"));
if(var3 != null) {
var2 = (Entity)var3.getConstructor(new Class[]{World.class}).newInstance(new Object[]{var1});
}
} catch (Exception var4) {
var4.printStackTrace();
}
if(var2 != null) {
var2.readFromNBT(var0);
} else {
System.out.println("Skipping Entity with id " + var0.getString("id"));
}
return var2;
}
public static int func_565_a(Entity var0) {
return ((Integer)field_850_d.get(var0.getClass())).intValue();
}
public static String func_564_b(Entity var0) {
return (String)field_848_b.get(var0.getClass());
}
static {
func_563_a(EntityArrow.class, "Arrow", 10);
func_563_a(EntitySnowball.class, "Snowball", 11);
func_563_a(EntityItem.class, "Item", 1);
func_563_a(EntityPainting.class, "Painting", 9);
func_563_a(EntityLiving.class, "Mob", 48);
func_563_a(EntityMobs.class, "Monster", 49);
func_563_a(EntityCreeper.class, "Creeper", 50);
func_563_a(EntitySkeleton.class, "Skeleton", 51);
func_563_a(EntitySpider.class, "Spider", 52);
func_563_a(EntityZombieSimple.class, "Giant", 53);
func_563_a(EntityZombie.class, "Zombie", 54);
func_563_a(EntitySlime.class, "Slime", 55);
func_563_a(EntityGhast.class, "Ghast", 56);
func_563_a(EntityPigZombie.class, "PigZombie", 57);
func_563_a(EntityPig.class, "Pig", 90);
func_563_a(EntitySheep.class, "Sheep", 91);
func_563_a(EntityCow.class, "Cow", 92);
func_563_a(EntityChicken.class, "Chicken", 93);
func_563_a(EntityTNTPrimed.class, "PrimedTnt", 20);
func_563_a(EntityFallingSand.class, "FallingSand", 21);
func_563_a(EntityMinecart.class, "Minecart", 40);
func_563_a(EntityBoat.class, "Boat", 41);
}
}

Some files were not shown because too many files have changed in this diff Show More