36427 lines
1.2 MiB
36427 lines
1.2 MiB
*** AABBPool.java Sat Feb 5 04:19:38 2022
|
|
--- AABBPool.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 83,101 ****
|
|
}
|
|
|
|
this.nextPoolIndex = 0;
|
|
}
|
|
|
|
- /**
|
|
- * Clears the AABBPool
|
|
- */
|
|
- public void clearPool()
|
|
- {
|
|
- this.nextPoolIndex = 0;
|
|
- this.listAABB.clear();
|
|
- }
|
|
-
|
|
public int getlistAABBsize()
|
|
{
|
|
return this.listAABB.size();
|
|
}
|
|
|
|
--- 83,92 ----
|
|
*** Achievement.java Sat Feb 5 04:19:38 2022
|
|
--- Achievement.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 21,36 ****
|
|
* Holds the description of the achievement, ready to be formatted and/or displayed.
|
|
*/
|
|
private final String achievementDescription;
|
|
|
|
/**
|
|
- * Holds a string formatter for the achievement, some of then needs extra dynamic info - like the key used to open
|
|
- * the inventory.
|
|
- */
|
|
- private IStatStringFormat statStringFormatter;
|
|
-
|
|
- /**
|
|
* Holds the ItemStack that will be used to draw the achievement into the GUI.
|
|
*/
|
|
public final ItemStack theItemStack;
|
|
|
|
/**
|
|
--- 21,30 ----
|
|
***************
|
|
*** 106,149 ****
|
|
public Achievement registerAchievement()
|
|
{
|
|
super.registerStat();
|
|
AchievementList.achievementList.add(this);
|
|
return this;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot).
|
|
- */
|
|
- public boolean isAchievement()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the fully description of the achievement - ready to be displayed on screen.
|
|
- */
|
|
- public String getDescription()
|
|
- {
|
|
- return this.statStringFormatter != null ? this.statStringFormatter.formatString(StatCollector.translateToLocal(this.achievementDescription)) : StatCollector.translateToLocal(this.achievementDescription);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Defines a string formatter for the achievement.
|
|
- */
|
|
- public Achievement setStatStringFormatter(IStatStringFormat par1IStatStringFormat)
|
|
- {
|
|
- this.statStringFormatter = par1IStatStringFormat;
|
|
- return this;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Special achievements have a 'spiked' (on normal texture pack) frame, special achievements are the hardest ones to
|
|
- * achieve.
|
|
- */
|
|
- public boolean getSpecial()
|
|
- {
|
|
- return this.isSpecial;
|
|
}
|
|
|
|
/**
|
|
* Register the stat into StatList.
|
|
*/
|
|
--- 100,109 ----
|
|
*** AchievementList.java Sat Feb 5 04:19:38 2022
|
|
--- AchievementList.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 15,25 ****
|
|
public static int maxDisplayColumn;
|
|
|
|
/** Is the biggest row used to display a achievement on the GUI. */
|
|
public static int maxDisplayRow;
|
|
|
|
! /** Holds a list of all registered achievements. */
|
|
public static List achievementList = new ArrayList();
|
|
|
|
/** Is the 'open inventory' achievement. */
|
|
public static Achievement openInventory = (new Achievement(0, "openInventory", 0, 0, Item.book, (Achievement)null)).setIndependent().registerAchievement();
|
|
|
|
--- 15,25 ----
|
|
public static int maxDisplayColumn;
|
|
|
|
/** Is the biggest row used to display a achievement on the GUI. */
|
|
public static int maxDisplayRow;
|
|
|
|
! /** The list holding all achievements */
|
|
public static List achievementList = new ArrayList();
|
|
|
|
/** Is the 'open inventory' achievement. */
|
|
public static Achievement openInventory = (new Achievement(0, "openInventory", 0, 0, Item.book, (Achievement)null)).setIndependent().registerAchievement();
|
|
|
|
*** AnimalChest.java Sat Feb 5 04:19:38 2022
|
|
--- AnimalChest.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 4,14 ****
|
|
{
|
|
public AnimalChest(String par1Str, int par2)
|
|
{
|
|
super(par1Str, false, par2);
|
|
}
|
|
-
|
|
- public AnimalChest(String par1Str, boolean par2, int par3)
|
|
- {
|
|
- super(par1Str, par2, par3);
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** AnvilSaveConverter.java Sat Feb 5 04:19:38 2022
|
|
--- AnvilSaveConverter.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 6,67 ****
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.Collections;
|
|
import java.util.Iterator;
|
|
- import java.util.List;
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
public class AnvilSaveConverter extends SaveFormatOld
|
|
{
|
|
public AnvilSaveConverter(File par1File)
|
|
{
|
|
super(par1File);
|
|
}
|
|
|
|
- public List getSaveList() throws AnvilConverterException
|
|
- {
|
|
- if (this.savesDirectory != null && this.savesDirectory.exists() && this.savesDirectory.isDirectory())
|
|
- {
|
|
- ArrayList var1 = new ArrayList();
|
|
- File[] var2 = this.savesDirectory.listFiles();
|
|
- File[] var3 = var2;
|
|
- int var4 = var2.length;
|
|
-
|
|
- for (int var5 = 0; var5 < var4; ++var5)
|
|
- {
|
|
- File var6 = var3[var5];
|
|
-
|
|
- if (var6.isDirectory())
|
|
- {
|
|
- String var7 = var6.getName();
|
|
- WorldInfo var8 = this.getWorldInfo(var7);
|
|
-
|
|
- if (var8 != null && (var8.getSaveVersion() == 19132 || var8.getSaveVersion() == 19133))
|
|
- {
|
|
- boolean var9 = var8.getSaveVersion() != this.getSaveVersion();
|
|
- String var10 = var8.getWorldName();
|
|
-
|
|
- if (var10 == null || MathHelper.stringNullOrLengthZero(var10))
|
|
- {
|
|
- var10 = var7;
|
|
- }
|
|
-
|
|
- long var11 = 0L;
|
|
- var1.add(new SaveFormatComparator(var7, var10, var8.getLastTimePlayed(), var11, var8.getGameType(), var9, var8.isHardcoreModeEnabled(), var8.areCommandsAllowed()));
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- return var1;
|
|
- }
|
|
- else
|
|
- {
|
|
- throw new AnvilConverterException("Unable to read or access folder where game worlds are saved!");
|
|
- }
|
|
- }
|
|
-
|
|
protected int getSaveVersion()
|
|
{
|
|
return 19133;
|
|
}
|
|
|
|
--- 6,24 ----
|
|
***************
|
|
*** 77,96 ****
|
|
{
|
|
return new AnvilSaveHandler(this.savesDirectory, par1Str, par2);
|
|
}
|
|
|
|
/**
|
|
! * Checks if the save directory uses the old map format
|
|
*/
|
|
public boolean isOldMapFormat(String par1Str)
|
|
{
|
|
WorldInfo var2 = this.getWorldInfo(par1Str);
|
|
return var2 != null && var2.getSaveVersion() != this.getSaveVersion();
|
|
}
|
|
|
|
/**
|
|
! * Converts the specified map to the new map format. Args: worldName, loadingScreen
|
|
*/
|
|
public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate)
|
|
{
|
|
par2IProgressUpdate.setLoadingProgress(0);
|
|
ArrayList var3 = new ArrayList();
|
|
--- 34,53 ----
|
|
{
|
|
return new AnvilSaveHandler(this.savesDirectory, par1Str, par2);
|
|
}
|
|
|
|
/**
|
|
! * gets if the map is old chunk saving (true) or McRegion (false)
|
|
*/
|
|
public boolean isOldMapFormat(String par1Str)
|
|
{
|
|
WorldInfo var2 = this.getWorldInfo(par1Str);
|
|
return var2 != null && var2.getSaveVersion() != this.getSaveVersion();
|
|
}
|
|
|
|
/**
|
|
! * converts the map to mcRegion
|
|
*/
|
|
public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate)
|
|
{
|
|
par2IProgressUpdate.setLoadingProgress(0);
|
|
ArrayList var3 = new ArrayList();
|
|
*** AnvilSaveHandler.java Sat Feb 5 04:19:38 2022
|
|
--- AnvilSaveHandler.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 8,18 ****
|
|
{
|
|
super(par1File, par2Str, par3);
|
|
}
|
|
|
|
/**
|
|
! * Returns the chunk loader with the provided world provider
|
|
*/
|
|
public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
|
|
{
|
|
File var2 = this.getWorldDirectory();
|
|
File var3;
|
|
--- 8,18 ----
|
|
{
|
|
super(par1File, par2Str, par3);
|
|
}
|
|
|
|
/**
|
|
! * initializes and returns the chunk loader for the specified world provider
|
|
*/
|
|
public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
|
|
{
|
|
File var2 = this.getWorldDirectory();
|
|
File var3;
|
|
*** AttributeInstance.java Sat Feb 5 04:19:38 2022
|
|
--- AttributeInstance.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 20,28 ****
|
|
|
|
void applyModifier(AttributeModifier var1);
|
|
|
|
void removeModifier(AttributeModifier var1);
|
|
|
|
- void func_142049_d();
|
|
-
|
|
double getAttributeValue();
|
|
}
|
|
--- 20,26 ----
|
|
*** BiomeCache.java Sat Feb 5 04:19:38 2022
|
|
--- BiomeCache.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 40,50 ****
|
|
var5 = new BiomeCacheBlock(this, par1, par2);
|
|
this.cacheMap.add(var3, var5);
|
|
this.cache.add(var5);
|
|
}
|
|
|
|
! var5.lastAccessTime = MinecraftServer.getSystemTimeMillis();
|
|
return var5;
|
|
}
|
|
|
|
/**
|
|
* Returns the BiomeGenBase related to the x, z position from the cache.
|
|
--- 40,50 ----
|
|
var5 = new BiomeCacheBlock(this, par1, par2);
|
|
this.cacheMap.add(var3, var5);
|
|
this.cache.add(var5);
|
|
}
|
|
|
|
! var5.lastAccessTime = MinecraftServer.getCurrentTimeMillis();
|
|
return var5;
|
|
}
|
|
|
|
/**
|
|
* Returns the BiomeGenBase related to the x, z position from the cache.
|
|
***************
|
|
*** 57,67 ****
|
|
/**
|
|
* Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds.
|
|
*/
|
|
public void cleanupCache()
|
|
{
|
|
! long var1 = MinecraftServer.getSystemTimeMillis();
|
|
long var3 = var1 - this.lastCleanupTime;
|
|
|
|
if (var3 > 7500L || var3 < 0L)
|
|
{
|
|
this.lastCleanupTime = var1;
|
|
--- 57,67 ----
|
|
/**
|
|
* Removes BiomeCacheBlocks from this cache that haven't been accessed in at least 30 seconds.
|
|
*/
|
|
public void cleanupCache()
|
|
{
|
|
! long var1 = MinecraftServer.getCurrentTimeMillis();
|
|
long var3 = var1 - this.lastCleanupTime;
|
|
|
|
if (var3 > 7500L || var3 < 0L)
|
|
{
|
|
this.lastCleanupTime = var1;
|
|
*** BiomeGenBase.java Sat Feb 5 04:19:38 2022
|
|
--- BiomeGenBase.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,8 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.awt.Color;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public abstract class BiomeGenBase
|
|
--- 1,7 ----
|
|
***************
|
|
*** 235,264 ****
|
|
this.color = par1;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
- * takes temperature, returns color
|
|
- */
|
|
- public int getSkyColorByTemp(float par1)
|
|
- {
|
|
- par1 /= 3.0F;
|
|
-
|
|
- if (par1 < -1.0F)
|
|
- {
|
|
- par1 = -1.0F;
|
|
- }
|
|
-
|
|
- if (par1 > 1.0F)
|
|
- {
|
|
- par1 = 1.0F;
|
|
- }
|
|
-
|
|
- return Color.getHSBColor(0.62222224F - par1 * 0.05F, 0.5F + par1 * 0.1F, 1.0F).getRGB();
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the correspondent list of the EnumCreatureType informed.
|
|
*/
|
|
public List getSpawnableList(EnumCreatureType par1EnumCreatureType)
|
|
{
|
|
return par1EnumCreatureType == EnumCreatureType.monster ? this.spawnableMonsterList : (par1EnumCreatureType == EnumCreatureType.creature ? this.spawnableCreatureList : (par1EnumCreatureType == EnumCreatureType.waterCreature ? this.spawnableWaterCreatureList : (par1EnumCreatureType == EnumCreatureType.ambient ? this.spawnableCaveCreatureList : null)));
|
|
--- 234,243 ----
|
|
***************
|
|
*** 311,355 ****
|
|
{
|
|
return (int)(this.temperature * 65536.0F);
|
|
}
|
|
|
|
/**
|
|
- * Gets a floating point representation of this biome's rainfall
|
|
- */
|
|
- public final float getFloatRainfall()
|
|
- {
|
|
- return this.rainfall;
|
|
- }
|
|
-
|
|
- /**
|
|
* Gets a floating point representation of this biome's temperature
|
|
*/
|
|
public final float getFloatTemperature()
|
|
{
|
|
return this.temperature;
|
|
}
|
|
|
|
public void decorate(World par1World, Random par2Random, int par3, int par4)
|
|
{
|
|
this.theBiomeDecorator.decorate(par1World, par2Random, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Provides the basic grass color based on the biome temperature and rainfall
|
|
- */
|
|
- public int getBiomeGrassColor()
|
|
- {
|
|
- double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
|
|
- double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
|
|
- return ColorizerGrass.getGrassColor(var1, var3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Provides the basic foliage color based on the biome temperature and rainfall
|
|
- */
|
|
- public int getBiomeFoliageColor()
|
|
- {
|
|
- double var1 = (double)MathHelper.clamp_float(this.getFloatTemperature(), 0.0F, 1.0F);
|
|
- double var3 = (double)MathHelper.clamp_float(this.getFloatRainfall(), 0.0F, 1.0F);
|
|
- return ColorizerFoliage.getFoliageColor(var1, var3);
|
|
}
|
|
}
|
|
--- 290,306 ----
|
|
*** BiomeGenEnd.java Sat Feb 5 04:19:38 2022
|
|
--- BiomeGenEnd.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 12,25 ****
|
|
this.spawnableMonsterList.add(new SpawnListEntry(EntityEnderman.class, 10, 4, 4));
|
|
this.topBlock = (byte)Block.dirt.blockID;
|
|
this.fillerBlock = (byte)Block.dirt.blockID;
|
|
this.theBiomeDecorator = new BiomeEndDecorator(this);
|
|
}
|
|
-
|
|
- /**
|
|
- * takes temperature, returns color
|
|
- */
|
|
- public int getSkyColorByTemp(float par1)
|
|
- {
|
|
- return 0;
|
|
- }
|
|
}
|
|
--- 12,17 ----
|
|
*** BiomeGenSwamp.java Sat Feb 5 04:19:38 2022
|
|
--- BiomeGenSwamp.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 23,48 ****
|
|
*/
|
|
public WorldGenerator getRandomWorldGenForTrees(Random par1Random)
|
|
{
|
|
return this.worldGeneratorSwamp;
|
|
}
|
|
-
|
|
- /**
|
|
- * Provides the basic grass color based on the biome temperature and rainfall
|
|
- */
|
|
- public int getBiomeGrassColor()
|
|
- {
|
|
- double var1 = (double)this.getFloatTemperature();
|
|
- double var3 = (double)this.getFloatRainfall();
|
|
- return ((ColorizerGrass.getGrassColor(var1, var3) & 16711422) + 5115470) / 2;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Provides the basic foliage color based on the biome temperature and rainfall
|
|
- */
|
|
- public int getBiomeFoliageColor()
|
|
- {
|
|
- double var1 = (double)this.getFloatTemperature();
|
|
- double var3 = (double)this.getFloatRainfall();
|
|
- return ((ColorizerFoliage.getFoliageColor(var1, var3) & 16711422) + 5115470) / 2;
|
|
- }
|
|
}
|
|
--- 23,28 ----
|
|
*** Block.java Sat Feb 5 04:19:38 2022
|
|
--- Block.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 174,185 ****
|
|
public static final Block enchantmentTable = (new BlockEnchantmentTable(116)).setHardness(5.0F).setResistance(2000.0F).setUnlocalizedName("enchantmentTable").setTextureName("enchanting_table");
|
|
public static final Block brewingStand = (new BlockBrewingStand(117)).setHardness(0.5F).setLightValue(0.125F).setUnlocalizedName("brewingStand").setTextureName("brewing_stand");
|
|
public static final BlockCauldron cauldron = (BlockCauldron)(new BlockCauldron(118)).setHardness(2.0F).setUnlocalizedName("cauldron").setTextureName("cauldron");
|
|
public static final Block endPortal = (new BlockEndPortal(119, Material.portal)).setHardness(-1.0F).setResistance(6000000.0F);
|
|
public static final Block endPortalFrame = (new BlockEndPortalFrame(120)).setStepSound(soundGlassFootstep).setLightValue(0.125F).setHardness(-1.0F).setUnlocalizedName("endPortalFrame").setResistance(6000000.0F).setCreativeTab(CreativeTabs.tabDecorations).setTextureName("endframe");
|
|
-
|
|
- /** The rock found in The End. */
|
|
public static final Block whiteStone = (new Block(121, Material.rock)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundStoneFootstep).setUnlocalizedName("whiteStone").setCreativeTab(CreativeTabs.tabBlock).setTextureName("end_stone");
|
|
public static final Block dragonEgg = (new BlockDragonEgg(122)).setHardness(3.0F).setResistance(15.0F).setStepSound(soundStoneFootstep).setLightValue(0.125F).setUnlocalizedName("dragonEgg").setTextureName("dragon_egg");
|
|
public static final Block redstoneLampIdle = (new BlockRedstoneLight(123, false)).setHardness(0.3F).setStepSound(soundGlassFootstep).setUnlocalizedName("redstoneLight").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("redstone_lamp_off");
|
|
public static final Block redstoneLampActive = (new BlockRedstoneLight(124, true)).setHardness(0.3F).setStepSound(soundGlassFootstep).setUnlocalizedName("redstoneLight").setTextureName("redstone_lamp_on");
|
|
public static final BlockHalfSlab woodDoubleSlab = (BlockHalfSlab)(new BlockWoodSlab(125, true)).setHardness(2.0F).setResistance(5.0F).setStepSound(soundWoodFootstep).setUnlocalizedName("woodSlab");
|
|
--- 174,183 ----
|
|
***************
|
|
*** 280,290 ****
|
|
*/
|
|
public float slipperiness;
|
|
|
|
/** The unlocalized name of this block. */
|
|
private String unlocalizedName;
|
|
- protected Icon blockIcon;
|
|
|
|
protected Block(int par1, Material par2Material)
|
|
{
|
|
this.stepSound = soundPowderFootstep;
|
|
this.blockParticleGravity = 1.0F;
|
|
--- 278,287 ----
|
|
***************
|
|
*** 443,518 ****
|
|
this.maxY = (double)par5;
|
|
this.maxZ = (double)par6;
|
|
}
|
|
|
|
/**
|
|
- * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z
|
|
- */
|
|
- public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return par1IBlockAccess.getBrightness(par2, par3, par4, lightValue[par1IBlockAccess.getBlockId(par2, par3, par4)]);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids
|
|
- */
|
|
- public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, lightValue[par1IBlockAccess.getBlockId(par2, par3, par4)]);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return par5 == 0 && this.minY > 0.0D ? true : (par5 == 1 && this.maxY < 1.0D ? true : (par5 == 2 && this.minZ > 0.0D ? true : (par5 == 3 && this.maxZ < 1.0D ? true : (par5 == 4 && this.minX > 0.0D ? true : (par5 == 5 && this.maxX < 1.0D ? true : !par1IBlockAccess.isBlockOpaqueCube(par2, par3, par4))))));
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns Returns true if the given side of this block type should be rendered (if it's solid or not), if the
|
|
* adjacent block is at the given coordinates. Args: blockAccess, x, y, z, side
|
|
*/
|
|
public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
{
|
|
return par1IBlockAccess.getBlockMaterial(par2, par3, par4).isSolid();
|
|
}
|
|
|
|
/**
|
|
- * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
|
- */
|
|
- public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return this.getIcon(par5, par1IBlockAccess.getBlockMetadata(par2, par3, par4));
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return this.blockIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the block texture based on the side being looked at. Args: side
|
|
- */
|
|
- public final Icon getBlockTextureFromSide(int par1)
|
|
- {
|
|
- return this.getIcon(par1, 0);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ);
|
|
- }
|
|
-
|
|
- /**
|
|
* Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the
|
|
* mask.) Parameters: World, X, Y, Z, mask, list, colliding entity
|
|
*/
|
|
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
|
{
|
|
--- 440,458 ----
|
|
***************
|
|
*** 541,552 ****
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param
|
|
! * par2 whether the player right-clicked while holding a boat
|
|
*/
|
|
public boolean canCollideCheck(int par1, boolean par2)
|
|
{
|
|
return this.isCollidable();
|
|
}
|
|
--- 481,491 ----
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
|
|
*/
|
|
public boolean canCollideCheck(int par1, boolean par2)
|
|
{
|
|
return this.isCollidable();
|
|
}
|
|
***************
|
|
*** 563,577 ****
|
|
* Ticks the block if it's been scheduled
|
|
*/
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) {}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {}
|
|
-
|
|
- /**
|
|
* Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
|
|
*/
|
|
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5) {}
|
|
|
|
/**
|
|
--- 502,511 ----
|
|
***************
|
|
*** 854,871 ****
|
|
/**
|
|
* Called upon the block being destroyed by an explosion
|
|
*/
|
|
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4, Explosion par5Explosion) {}
|
|
|
|
- /**
|
|
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
- */
|
|
- public int getRenderBlockPass()
|
|
- {
|
|
- return 0;
|
|
- }
|
|
-
|
|
public boolean canPlaceBlockOnSide(World par1World, int par2, int par3, int par4, int par5, ItemStack par6ItemStack)
|
|
{
|
|
return this.canPlaceBlockOnSide(par1World, par2, par3, par4, par5);
|
|
}
|
|
|
|
--- 788,797 ----
|
|
***************
|
|
*** 923,933 ****
|
|
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {}
|
|
|
|
/**
|
|
* returns the block bounderies minX value
|
|
*/
|
|
! public final double getBlockBoundsMinX()
|
|
{
|
|
return this.minX;
|
|
}
|
|
|
|
/**
|
|
--- 849,859 ----
|
|
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) {}
|
|
|
|
/**
|
|
* returns the block bounderies minX value
|
|
*/
|
|
! public final double getMinX()
|
|
{
|
|
return this.minX;
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 968,999 ****
|
|
public final double getBlockBoundsMaxZ()
|
|
{
|
|
return this.maxZ;
|
|
}
|
|
|
|
- public int getBlockColor()
|
|
- {
|
|
- return 16777215;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the color this block should be rendered. Used by leaves.
|
|
- */
|
|
- public int getRenderColor(int par1)
|
|
- {
|
|
- return 16777215;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return 16777215;
|
|
- }
|
|
-
|
|
/**
|
|
* Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube
|
|
* returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X,
|
|
* Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
|
|
*/
|
|
--- 894,903 ----
|
|
***************
|
|
*** 1160,1214 ****
|
|
{
|
|
return this.blockMaterial.getMaterialMobility();
|
|
}
|
|
|
|
/**
|
|
- * Returns the default ambient occlusion value based on block opacity
|
|
- */
|
|
- public float getAmbientOcclusionLightValue(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return par1IBlockAccess.isBlockNormalCube(par2, par3, par4) ? 0.2F : 1.0F;
|
|
- }
|
|
-
|
|
- /**
|
|
* Block's chance to react to an entity falling on it.
|
|
*/
|
|
public void onFallenUpon(World par1World, int par2, int par3, int par4, Entity par5Entity, float par6) {}
|
|
|
|
/**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return this.blockID;
|
|
- }
|
|
-
|
|
- /**
|
|
* Get the block's damage value (for use with pick block).
|
|
*/
|
|
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return this.damageDropped(par1World.getBlockMetadata(par2, par3, par4));
|
|
}
|
|
|
|
/**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the CreativeTab to display the given block on.
|
|
- */
|
|
- public CreativeTabs getCreativeTabToDisplayOn()
|
|
- {
|
|
- return this.displayOnCreativeTab;
|
|
- }
|
|
-
|
|
- /**
|
|
* Sets the CreativeTab to display this block on.
|
|
*/
|
|
public Block setCreativeTab(CreativeTabs par1CreativeTabs)
|
|
{
|
|
this.displayOnCreativeTab = par1CreativeTabs;
|
|
--- 1064,1086 ----
|
|
***************
|
|
*** 1229,1246 ****
|
|
/**
|
|
* currently only used by BlockCauldron to incrament meta-data during rain
|
|
*/
|
|
public void fillWithRain(World par1World, int par2, int par3, int par4) {}
|
|
|
|
- /**
|
|
- * Returns true only if block is flowerPot
|
|
- */
|
|
- public boolean isFlowerPot()
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
public boolean func_82506_l()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
--- 1101,1110 ----
|
|
***************
|
|
*** 1289,1320 ****
|
|
|
|
protected Block setTextureName(String par1Str)
|
|
{
|
|
this.textureName = par1Str;
|
|
return this;
|
|
- }
|
|
-
|
|
- protected String getTextureName()
|
|
- {
|
|
- return this.textureName == null ? "MISSING_ICON_TILE_" + this.blockID + "_" + this.unlocalizedName : this.textureName;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName());
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers.
|
|
- */
|
|
- public String getItemIconName()
|
|
- {
|
|
- return null;
|
|
}
|
|
|
|
static
|
|
{
|
|
Item.itemsList[cloth.blockID] = (new ItemCloth(cloth.blockID - 256)).setUnlocalizedName("cloth");
|
|
--- 1153,1162 ----
|
|
*** BlockAnvil.java Sat Feb 5 04:19:38 2022
|
|
--- BlockAnvil.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,16 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockAnvil extends BlockSand
|
|
{
|
|
/** List of types/statues the Anvil can be in. */
|
|
public static final String[] statuses = new String[] {"intact", "slightlyDamaged", "veryDamaged"};
|
|
private static final String[] anvilIconNames = new String[] {"anvil_top_damaged_0", "anvil_top_damaged_1", "anvil_top_damaged_2"};
|
|
- public int field_82521_b;
|
|
- private Icon[] iconArray;
|
|
|
|
protected BlockAnvil(int par1)
|
|
{
|
|
super(par1, Material.anvil);
|
|
this.setLightOpacity(0);
|
|
--- 1,12 ----
|
|
***************
|
|
*** 33,73 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (this.field_82521_b == 3 && par1 == 1)
|
|
- {
|
|
- int var3 = (par2 >> 2) % this.iconArray.length;
|
|
- return this.iconArray[var3];
|
|
- }
|
|
- else
|
|
- {
|
|
- return this.blockIcon;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("anvil_base");
|
|
- this.iconArray = new Icon[anvilIconNames.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(anvilIconNames[var2]);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
|
--- 29,38 ----
|
|
***************
|
|
*** 75,100 ****
|
|
++var7;
|
|
var7 %= 4;
|
|
|
|
if (var7 == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8 << 2, 2);
|
|
}
|
|
|
|
if (var7 == 1)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8 << 2, 2);
|
|
}
|
|
|
|
if (var7 == 2)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8 << 2, 2);
|
|
}
|
|
|
|
if (var7 == 3)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8 << 2, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
--- 40,65 ----
|
|
++var7;
|
|
var7 %= 4;
|
|
|
|
if (var7 == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 2 | var8 << 2, 2);
|
|
}
|
|
|
|
if (var7 == 1)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 3 | var8 << 2, 2);
|
|
}
|
|
|
|
if (var7 == 2)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 0 | var8 << 2, 2);
|
|
}
|
|
|
|
if (var7 == 3)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 1 | var8 << 2, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
***************
|
|
*** 144,163 ****
|
|
this.setBlockBounds(0.0F, 0.0F, 0.125F, 1.0F, 1.0F, 0.875F);
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- par3List.add(new ItemStack(par1, 1, 2));
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when the falling block entity for this block is created
|
|
*/
|
|
protected void onStartFalling(EntityFallingSand par1EntityFallingSand)
|
|
{
|
|
par1EntityFallingSand.setIsAnvil(true);
|
|
--- 109,118 ----
|
|
***************
|
|
*** 167,182 ****
|
|
* Called when the falling block entity for this block hits the ground and turns back into a block
|
|
*/
|
|
public void onFinishFalling(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
par1World.playAuxSFX(1022, par2, par3, par4, 0);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return true;
|
|
}
|
|
}
|
|
--- 122,128 ----
|
|
*** BlockBasePressurePlate.java Sat Feb 5 04:19:38 2022
|
|
--- BlockBasePressurePlate.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 146,156 ****
|
|
boolean var7 = par5 > 0;
|
|
boolean var8 = var6 > 0;
|
|
|
|
if (par5 != var6)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, this.getMetaFromWeight(var6), 2);
|
|
this.func_94354_b_(par1World, par2, par3, par4);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
|
|
if (!var8 && var7)
|
|
--- 146,156 ----
|
|
boolean var7 = par5 > 0;
|
|
boolean var8 = var6 > 0;
|
|
|
|
if (par5 != var6)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, this.getMetaFromWeight(var6), 2);
|
|
this.func_94354_b_(par1World, par2, par3, par4);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
|
|
if (!var8 && var7)
|
|
***************
|
|
*** 255,269 ****
|
|
|
|
/**
|
|
* Argument is weight (0-15). Return the metadata to be set because of it.
|
|
*/
|
|
protected abstract int getMetaFromWeight(int var1);
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.pressurePlateIconName);
|
|
- }
|
|
}
|
|
--- 255,260 ----
|
|
*** BlockBaseRailLogic.java Sat Feb 5 04:19:38 2022
|
|
--- BlockBaseRailLogic.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 9,27 ****
|
|
private int railX;
|
|
private int railY;
|
|
private int railZ;
|
|
private final boolean isStraightRail;
|
|
|
|
! /** The chunk position the rail is at. */
|
|
! private List railChunkPosition;
|
|
|
|
final BlockRailBase theRail;
|
|
|
|
public BlockBaseRailLogic(BlockRailBase par1BlockRailBase, World par2World, int par3, int par4, int par5)
|
|
{
|
|
this.theRail = par1BlockRailBase;
|
|
! this.railChunkPosition = new ArrayList();
|
|
this.logicWorld = par2World;
|
|
this.railX = par3;
|
|
this.railY = par4;
|
|
this.railZ = par5;
|
|
int var6 = par2World.getBlockId(par3, par4, par5);
|
|
--- 9,27 ----
|
|
private int railX;
|
|
private int railY;
|
|
private int railZ;
|
|
private final boolean isStraightRail;
|
|
|
|
! /** The positions of connected rails */
|
|
! private List connectedTracks;
|
|
|
|
final BlockRailBase theRail;
|
|
|
|
public BlockBaseRailLogic(BlockRailBase par1BlockRailBase, World par2World, int par3, int par4, int par5)
|
|
{
|
|
this.theRail = par1BlockRailBase;
|
|
! this.connectedTracks = new ArrayList();
|
|
this.logicWorld = par2World;
|
|
this.railX = par3;
|
|
this.railY = par4;
|
|
this.railZ = par5;
|
|
int var6 = par2World.getBlockId(par3, par4, par5);
|
|
***************
|
|
*** 40,116 ****
|
|
this.setBasicRail(var7);
|
|
}
|
|
|
|
private void setBasicRail(int par1)
|
|
{
|
|
! this.railChunkPosition.clear();
|
|
|
|
if (par1 == 0)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 1)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
}
|
|
else if (par1 == 2)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ));
|
|
}
|
|
else if (par1 == 3)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
}
|
|
else if (par1 == 4)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 5)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1));
|
|
}
|
|
else if (par1 == 6)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 7)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 8)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
}
|
|
else if (par1 == 9)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
! this.railChunkPosition.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
}
|
|
}
|
|
|
|
private void refreshConnectedTracks()
|
|
{
|
|
! for (int var1 = 0; var1 < this.railChunkPosition.size(); ++var1)
|
|
{
|
|
! BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var1));
|
|
|
|
if (var2 != null && var2.isRailChunkPositionCorrect(this))
|
|
{
|
|
! this.railChunkPosition.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ));
|
|
}
|
|
else
|
|
{
|
|
! this.railChunkPosition.remove(var1--);
|
|
}
|
|
}
|
|
}
|
|
|
|
private boolean isMinecartTrack(int par1, int par2, int par3)
|
|
--- 40,116 ----
|
|
this.setBasicRail(var7);
|
|
}
|
|
|
|
private void setBasicRail(int par1)
|
|
{
|
|
! this.connectedTracks.clear();
|
|
|
|
if (par1 == 0)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 1)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
}
|
|
else if (par1 == 2)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY + 1, this.railZ));
|
|
}
|
|
else if (par1 == 3)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY + 1, this.railZ));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
}
|
|
else if (par1 == 4)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ - 1));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 5)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY + 1, this.railZ + 1));
|
|
}
|
|
else if (par1 == 6)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 7)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ + 1));
|
|
}
|
|
else if (par1 == 8)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX - 1, this.railY, this.railZ));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
}
|
|
else if (par1 == 9)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX + 1, this.railY, this.railZ));
|
|
! this.connectedTracks.add(new ChunkPosition(this.railX, this.railY, this.railZ - 1));
|
|
}
|
|
}
|
|
|
|
private void refreshConnectedTracks()
|
|
{
|
|
! for (int var1 = 0; var1 < this.connectedTracks.size(); ++var1)
|
|
{
|
|
! BlockBaseRailLogic var2 = this.getRailLogic((ChunkPosition)this.connectedTracks.get(var1));
|
|
|
|
if (var2 != null && var2.isRailChunkPositionCorrect(this))
|
|
{
|
|
! this.connectedTracks.set(var1, new ChunkPosition(var2.railX, var2.railY, var2.railZ));
|
|
}
|
|
else
|
|
{
|
|
! this.connectedTracks.remove(var1--);
|
|
}
|
|
}
|
|
}
|
|
|
|
private boolean isMinecartTrack(int par1, int par2, int par3)
|
|
***************
|
|
*** 126,138 ****
|
|
/**
|
|
* Checks if the rail is at the chunk position it is expected to be.
|
|
*/
|
|
private boolean isRailChunkPositionCorrect(BlockBaseRailLogic par1BlockBaseRailLogic)
|
|
{
|
|
! for (int var2 = 0; var2 < this.railChunkPosition.size(); ++var2)
|
|
{
|
|
! ChunkPosition var3 = (ChunkPosition)this.railChunkPosition.get(var2);
|
|
|
|
if (var3.x == par1BlockBaseRailLogic.railX && var3.z == par1BlockBaseRailLogic.railZ)
|
|
{
|
|
return true;
|
|
}
|
|
--- 126,138 ----
|
|
/**
|
|
* Checks if the rail is at the chunk position it is expected to be.
|
|
*/
|
|
private boolean isRailChunkPositionCorrect(BlockBaseRailLogic par1BlockBaseRailLogic)
|
|
{
|
|
! for (int var2 = 0; var2 < this.connectedTracks.size(); ++var2)
|
|
{
|
|
! ChunkPosition var3 = (ChunkPosition)this.connectedTracks.get(var2);
|
|
|
|
if (var3.x == par1BlockBaseRailLogic.railX && var3.z == par1BlockBaseRailLogic.railZ)
|
|
{
|
|
return true;
|
|
}
|
|
***************
|
|
*** 141,153 ****
|
|
return false;
|
|
}
|
|
|
|
private boolean isPartOfTrack(int par1, int par2, int par3)
|
|
{
|
|
! for (int var4 = 0; var4 < this.railChunkPosition.size(); ++var4)
|
|
{
|
|
! ChunkPosition var5 = (ChunkPosition)this.railChunkPosition.get(var4);
|
|
|
|
if (var5.x == par1 && var5.z == par3)
|
|
{
|
|
return true;
|
|
}
|
|
--- 141,153 ----
|
|
return false;
|
|
}
|
|
|
|
private boolean isPartOfTrack(int par1, int par2, int par3)
|
|
{
|
|
! for (int var4 = 0; var4 < this.connectedTracks.size(); ++var4)
|
|
{
|
|
! ChunkPosition var5 = (ChunkPosition)this.connectedTracks.get(var4);
|
|
|
|
if (var5.x == par1 && var5.z == par3)
|
|
{
|
|
return true;
|
|
}
|
|
***************
|
|
*** 183,198 ****
|
|
return var1;
|
|
}
|
|
|
|
private boolean canConnectTo(BlockBaseRailLogic par1BlockBaseRailLogic)
|
|
{
|
|
! return this.isRailChunkPositionCorrect(par1BlockBaseRailLogic) ? true : (this.railChunkPosition.size() == 2 ? false : (this.railChunkPosition.isEmpty() ? true : true));
|
|
}
|
|
|
|
private void connectToNeighbor(BlockBaseRailLogic par1BlockBaseRailLogic)
|
|
{
|
|
! this.railChunkPosition.add(new ChunkPosition(par1BlockBaseRailLogic.railX, par1BlockBaseRailLogic.railY, par1BlockBaseRailLogic.railZ));
|
|
boolean var2 = this.isPartOfTrack(this.railX, this.railY, this.railZ - 1);
|
|
boolean var3 = this.isPartOfTrack(this.railX, this.railY, this.railZ + 1);
|
|
boolean var4 = this.isPartOfTrack(this.railX - 1, this.railY, this.railZ);
|
|
boolean var5 = this.isPartOfTrack(this.railX + 1, this.railY, this.railZ);
|
|
byte var6 = -1;
|
|
--- 183,198 ----
|
|
return var1;
|
|
}
|
|
|
|
private boolean canConnectTo(BlockBaseRailLogic par1BlockBaseRailLogic)
|
|
{
|
|
! return this.isRailChunkPositionCorrect(par1BlockBaseRailLogic) ? true : (this.connectedTracks.size() == 2 ? false : (this.connectedTracks.isEmpty() ? true : true));
|
|
}
|
|
|
|
private void connectToNeighbor(BlockBaseRailLogic par1BlockBaseRailLogic)
|
|
{
|
|
! this.connectedTracks.add(new ChunkPosition(par1BlockBaseRailLogic.railX, par1BlockBaseRailLogic.railY, par1BlockBaseRailLogic.railZ));
|
|
boolean var2 = this.isPartOfTrack(this.railX, this.railY, this.railZ - 1);
|
|
boolean var3 = this.isPartOfTrack(this.railX, this.railY, this.railZ + 1);
|
|
boolean var4 = this.isPartOfTrack(this.railX - 1, this.railY, this.railZ);
|
|
boolean var5 = this.isPartOfTrack(this.railX + 1, this.railY, this.railZ);
|
|
byte var6 = -1;
|
|
***************
|
|
*** 266,276 ****
|
|
if (this.isStraightRail)
|
|
{
|
|
var7 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var6;
|
|
}
|
|
|
|
! this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var7, 3);
|
|
}
|
|
|
|
private boolean canConnectFrom(int par1, int par2, int par3)
|
|
{
|
|
BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(par1, par2, par3));
|
|
--- 266,276 ----
|
|
if (this.isStraightRail)
|
|
{
|
|
var7 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var6;
|
|
}
|
|
|
|
! this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var7, 3);
|
|
}
|
|
|
|
private boolean canConnectFrom(int par1, int par2, int par3)
|
|
{
|
|
BlockBaseRailLogic var4 = this.getRailLogic(new ChunkPosition(par1, par2, par3));
|
|
***************
|
|
*** 427,441 ****
|
|
var8 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var7;
|
|
}
|
|
|
|
if (par2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8)
|
|
{
|
|
! this.logicWorld.setBlockMetadataWithNotify(this.railX, this.railY, this.railZ, var8, 3);
|
|
|
|
! for (int var9 = 0; var9 < this.railChunkPosition.size(); ++var9)
|
|
{
|
|
! BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.railChunkPosition.get(var9));
|
|
|
|
if (var10 != null)
|
|
{
|
|
var10.refreshConnectedTracks();
|
|
|
|
--- 427,441 ----
|
|
var8 = this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) & 8 | var7;
|
|
}
|
|
|
|
if (par2 || this.logicWorld.getBlockMetadata(this.railX, this.railY, this.railZ) != var8)
|
|
{
|
|
! this.logicWorld.setBlockMetadata(this.railX, this.railY, this.railZ, var8, 3);
|
|
|
|
! for (int var9 = 0; var9 < this.connectedTracks.size(); ++var9)
|
|
{
|
|
! BlockBaseRailLogic var10 = this.getRailLogic((ChunkPosition)this.connectedTracks.get(var9));
|
|
|
|
if (var10 != null)
|
|
{
|
|
var10.refreshConnectedTracks();
|
|
|
|
*** BlockBeacon.java Sat Feb 5 04:19:38 2022
|
|
--- BlockBeacon.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 63,81 ****
|
|
{
|
|
return 34;
|
|
}
|
|
|
|
/**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
super.onBlockPlacedBy(par1World, par2, par3, par4, par5EntityLivingBase, par6ItemStack);
|
|
--- 63,72 ----
|
|
*** BlockBed.java Sat Feb 5 04:19:38 2022
|
|
--- BlockBed.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 5,17 ****
|
|
|
|
public class BlockBed extends BlockDirectional
|
|
{
|
|
/** Maps the foot-of-bed block to the head-of-bed block. */
|
|
public static final int[][] footBlockToHeadBlockMap = new int[][] {{0, 1}, { -1, 0}, {0, -1}, {1, 0}};
|
|
- private Icon[] field_94472_b;
|
|
- private Icon[] bedSideIcons;
|
|
- private Icon[] bedTopIcons;
|
|
|
|
public BlockBed(int par1)
|
|
{
|
|
super(par1, Material.cloth);
|
|
this.setBounds();
|
|
--- 5,14 ----
|
|
***************
|
|
*** 119,157 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par1 == 0)
|
|
- {
|
|
- return Block.planks.getBlockTextureFromSide(par1);
|
|
- }
|
|
- else
|
|
- {
|
|
- int var3 = getDirection(par2);
|
|
- int var4 = Direction.bedDirection[var3][par1];
|
|
- int var5 = isBlockHeadOfBed(par2) ? 1 : 0;
|
|
- return (var5 != 1 || var4 != 2) && (var5 != 0 || var4 != 3) ? (var4 != 5 && var4 != 4 ? this.bedTopIcons[var5] : this.bedSideIcons[var5]) : this.field_94472_b[var5];
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.bedTopIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_top"), par1IconRegister.registerIcon(this.getTextureName() + "_head_top")};
|
|
- this.field_94472_b = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_end"), par1IconRegister.registerIcon(this.getTextureName() + "_head_end")};
|
|
- this.bedSideIcons = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_feet_side"), par1IconRegister.registerIcon(this.getTextureName() + "_head_side")};
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 14;
|
|
--- 116,125 ----
|
|
***************
|
|
*** 255,265 ****
|
|
else
|
|
{
|
|
var5 &= -5;
|
|
}
|
|
|
|
! par0World.setBlockMetadataWithNotify(par1, par2, par3, var5, 4);
|
|
}
|
|
|
|
/**
|
|
* Gets the nearest empty chunk coordinates for the player to wake up from a bed into.
|
|
*/
|
|
--- 223,233 ----
|
|
else
|
|
{
|
|
var5 &= -5;
|
|
}
|
|
|
|
! par0World.setBlockMetadata(par1, par2, par3, var5, 4);
|
|
}
|
|
|
|
/**
|
|
* Gets the nearest empty chunk coordinates for the player to wake up from a bed into.
|
|
*/
|
|
***************
|
|
*** 311,328 ****
|
|
* and stop pistons
|
|
*/
|
|
public int getMobilityFlag()
|
|
{
|
|
return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.bed.itemID;
|
|
}
|
|
|
|
/**
|
|
* Called when the block is attempted to be harvested
|
|
*/
|
|
--- 279,288 ----
|
|
*** BlockBookshelf.java Sat Feb 5 04:19:38 2022
|
|
--- BlockBookshelf.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 9,26 ****
|
|
super(par1, Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 != 1 && par1 != 0 ? super.getIcon(par1, par2) : Block.planks.getBlockTextureFromSide(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the quantity of items to drop on block destruction.
|
|
*/
|
|
public int quantityDropped(Random par1Random)
|
|
{
|
|
return 3;
|
|
--- 9,18 ----
|
|
*** BlockBreakable.java Sat Feb 5 04:19:38 2022
|
|
--- BlockBreakable.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 18,42 ****
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- int var6 = par1IBlockAccess.getBlockId(par2, par3, par4);
|
|
- return !this.localFlag && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.breakableBlockIcon);
|
|
- }
|
|
}
|
|
--- 18,23 ----
|
|
*** BlockBrewingStand.java Sat Feb 5 04:19:38 2022
|
|
--- BlockBrewingStand.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 4,14 ****
|
|
import java.util.Random;
|
|
|
|
public class BlockBrewingStand extends BlockContainer
|
|
{
|
|
private Random rand = new Random();
|
|
- private Icon theIcon;
|
|
|
|
public BlockBrewingStand(int par1)
|
|
{
|
|
super(par1, Material.iron);
|
|
}
|
|
--- 4,13 ----
|
|
***************
|
|
*** 98,118 ****
|
|
((TileEntityBrewingStand)par1World.getBlockTileEntity(par2, par3, par4)).func_94131_a(par6ItemStack.getDisplayName());
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- double var6 = (double)((float)par2 + 0.4F + par5Random.nextFloat() * 0.2F);
|
|
- double var8 = (double)((float)par3 + 0.7F + par5Random.nextFloat() * 0.3F);
|
|
- double var10 = (double)((float)par4 + 0.4F + par5Random.nextFloat() * 0.2F);
|
|
- par1World.spawnParticle("smoke", var6, var8, var10, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
|
* metadata
|
|
*/
|
|
public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
|
|
--- 97,106 ----
|
|
***************
|
|
*** 164,181 ****
|
|
{
|
|
return Item.brewingStand.itemID;
|
|
}
|
|
|
|
/**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.brewingStand.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
* If this returns true, then comparators facing away from this block will use the value from
|
|
* getComparatorInputOverride instead of the actual redstone signal strength.
|
|
*/
|
|
public boolean hasComparatorInputOverride()
|
|
{
|
|
--- 152,161 ----
|
|
***************
|
|
*** 187,208 ****
|
|
* strength when this block inputs to a comparator.
|
|
*/
|
|
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_base");
|
|
- }
|
|
-
|
|
- public Icon getBrewingStandIcon()
|
|
- {
|
|
- return this.theIcon;
|
|
}
|
|
}
|
|
--- 167,173 ----
|
|
*** BlockButton.java Sat Feb 5 04:19:38 2022
|
|
--- BlockButton.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 222,232 ****
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F);
|
|
this.func_82536_d(par1World, par2, par3, par4, var11);
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
return true;
|
|
--- 222,232 ----
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11 + var12, 3);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F);
|
|
this.func_82536_d(par1World, par2, par3, par4, var11);
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
return true;
|
|
***************
|
|
*** 301,311 ****
|
|
{
|
|
this.func_82535_o(par1World, par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & 7, 3);
|
|
int var7 = var6 & 7;
|
|
this.func_82536_d(par1World, par2, par3, par4, var7);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
--- 301,311 ----
|
|
{
|
|
this.func_82535_o(par1World, par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 & 7, 3);
|
|
int var7 = var6 & 7;
|
|
this.func_82536_d(par1World, par2, par3, par4, var7);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
***************
|
|
*** 350,368 ****
|
|
List var9 = par1World.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ));
|
|
boolean var8 = !var9.isEmpty();
|
|
|
|
if (var8 && !var7)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 3);
|
|
this.func_82536_d(par1World, par2, par3, par4, var6);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F);
|
|
}
|
|
|
|
if (!var8 && var7)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3);
|
|
this.func_82536_d(par1World, par2, par3, par4, var6);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F);
|
|
}
|
|
|
|
--- 350,368 ----
|
|
List var9 = par1World.getEntitiesWithinAABB(EntityArrow.class, AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ));
|
|
boolean var8 = !var9.isEmpty();
|
|
|
|
if (var8 && !var7)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 | 8, 3);
|
|
this.func_82536_d(par1World, par2, par3, par4, var6);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.6F);
|
|
}
|
|
|
|
if (!var8 && var7)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6, 3);
|
|
this.func_82536_d(par1World, par2, par3, par4, var6);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, 0.5F);
|
|
}
|
|
|
|
***************
|
|
*** 395,406 ****
|
|
else
|
|
{
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
}
|
|
}
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 395,400 ----
|
|
*** BlockButtonStone.java Sat Feb 5 04:19:38 2022
|
|
--- BlockButtonStone.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
protected BlockButtonStone(int par1)
|
|
{
|
|
super(par1, false);
|
|
}
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return Block.stone.getBlockTextureFromSide(1);
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** BlockButtonWood.java Sat Feb 5 04:19:38 2022
|
|
--- BlockButtonWood.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
protected BlockButtonWood(int par1)
|
|
{
|
|
super(par1, true);
|
|
}
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return Block.planks.getBlockTextureFromSide(1);
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** BlockCactus.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCactus.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,14 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockCactus extends Block
|
|
{
|
|
- private Icon cactusTopIcon;
|
|
- private Icon cactusBottomIcon;
|
|
-
|
|
protected BlockCactus(int par1)
|
|
{
|
|
super(par1, Material.cactus);
|
|
this.setTickRandomly(true);
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
--- 2,11 ----
|
|
***************
|
|
*** 33,48 ****
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 == 15)
|
|
{
|
|
par1World.setBlock(par2, par3 + 1, par4, this.blockID);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4);
|
|
this.onNeighborBlockChange(par1World, par2, par3 + 1, par4, this.blockID);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 30,45 ----
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 == 15)
|
|
{
|
|
par1World.setBlock(par2, par3 + 1, par4, this.blockID);
|
|
! par1World.setBlockMetadata(par2, par3, par4, 0, 4);
|
|
this.onNeighborBlockChange(par1World, par2, par3 + 1, par4, this.blockID);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 + 1, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 55,81 ****
|
|
float var5 = 0.0625F;
|
|
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)((float)(par3 + 1) - var5), (double)((float)(par4 + 1) - var5));
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- float var5 = 0.0625F;
|
|
- return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var5), (double)par3, (double)((float)par4 + var5), (double)((float)(par2 + 1) - var5), (double)(par3 + 1), (double)((float)(par4 + 1) - var5));
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.cactusTopIcon : (par1 == 0 ? this.cactusBottomIcon : this.blockIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
|
*/
|
|
public boolean renderAsNormalBlock()
|
|
{
|
|
return false;
|
|
--- 52,61 ----
|
|
***************
|
|
*** 150,167 ****
|
|
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
|
|
*/
|
|
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
{
|
|
par5Entity.attackEntityFrom(DamageSource.cactus, 1.0F);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.cactusTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.cactusBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");
|
|
}
|
|
}
|
|
--- 130,136 ----
|
|
*** BlockCake.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCake.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,15 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockCake extends Block
|
|
{
|
|
- private Icon cakeTopIcon;
|
|
- private Icon cakeBottomIcon;
|
|
- private Icon field_94382_c;
|
|
-
|
|
protected BlockCake(int par1)
|
|
{
|
|
super(par1, Material.cake);
|
|
this.setTickRandomly(true);
|
|
}
|
|
--- 2,11 ----
|
|
***************
|
|
*** 48,89 ****
|
|
float var8 = 0.5F;
|
|
return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8 - var6), (double)((float)(par4 + 1) - var6));
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
|
- float var6 = 0.0625F;
|
|
- float var7 = (float)(1 + var5 * 2) / 16.0F;
|
|
- float var8 = 0.5F;
|
|
- return AxisAlignedBB.getAABBPool().getAABB((double)((float)par2 + var7), (double)par3, (double)((float)par4 + var6), (double)((float)(par2 + 1) - var6), (double)((float)par3 + var8), (double)((float)(par4 + 1) - var6));
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.cakeTopIcon : (par1 == 0 ? this.cakeBottomIcon : (par2 > 0 && par1 == 4 ? this.field_94382_c : this.blockIcon));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.field_94382_c = par1IconRegister.registerIcon(this.getTextureName() + "_inner");
|
|
- this.cakeTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.cakeBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");
|
|
- }
|
|
-
|
|
- /**
|
|
* If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
|
|
*/
|
|
public boolean renderAsNormalBlock()
|
|
{
|
|
return false;
|
|
--- 44,53 ----
|
|
***************
|
|
*** 129,139 ****
|
|
{
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 93,103 ----
|
|
{
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 176,190 ****
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.cake.itemID;
|
|
}
|
|
}
|
|
--- 140,146 ----
|
|
*** BlockCarpet.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCarpet.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,9 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockCarpet extends Block
|
|
{
|
|
protected BlockCarpet(int par1)
|
|
{
|
|
super(par1, Material.materialCarpet);
|
|
--- 1,7 ----
|
|
***************
|
|
*** 12,29 ****
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
this.func_111047_d(0);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return Block.cloth.getIcon(par1, par2);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
* cleared to be reused)
|
|
*/
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
{
|
|
--- 10,19 ----
|
|
***************
|
|
*** 110,147 ****
|
|
{
|
|
return !par1World.isAirBlock(par2, par3 - 1, par4);
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
|
- }
|
|
-
|
|
- /**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int par1)
|
|
{
|
|
return par1;
|
|
}
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- for (int var4 = 0; var4 < 16; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 100,111 ----
|
|
*** BlockCarrot.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCarrot.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,37 ****
|
|
package net.minecraft.src;
|
|
|
|
public class BlockCarrot extends BlockCrops
|
|
{
|
|
- private Icon[] iconArray;
|
|
-
|
|
public BlockCarrot(int par1)
|
|
{
|
|
super(par1);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par2 < 7)
|
|
- {
|
|
- if (par2 == 6)
|
|
- {
|
|
- par2 = 5;
|
|
- }
|
|
-
|
|
- return this.iconArray[par2 >> 1];
|
|
- }
|
|
- else
|
|
- {
|
|
- return this.iconArray[3];
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Generate a seed ItemStack for this crop.
|
|
*/
|
|
protected int getSeedItem()
|
|
{
|
|
return Item.carrot.itemID;
|
|
--- 1,15 ----
|
|
***************
|
|
*** 41,61 ****
|
|
* Generate a crop produce ItemStack for this crop.
|
|
*/
|
|
protected int getCropItem()
|
|
{
|
|
return Item.carrot.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[4];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2);
|
|
- }
|
|
}
|
|
}
|
|
--- 19,25 ----
|
|
*** BlockCauldron.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCauldron.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 3,47 ****
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockCauldron extends Block
|
|
{
|
|
- private Icon field_94378_a;
|
|
- private Icon cauldronTopIcon;
|
|
- private Icon cauldronBottomIcon;
|
|
-
|
|
public BlockCauldron(int par1)
|
|
{
|
|
super(par1, Material.iron);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.cauldronTopIcon : (par1 == 0 ? this.cauldronBottomIcon : this.blockIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_94378_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inner");
|
|
- this.cauldronTopIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.cauldronBottomIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom");
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- }
|
|
-
|
|
- public static Icon getCauldronIcon(String par0Str)
|
|
- {
|
|
- return par0Str.equals("inner") ? Block.cauldron.field_94378_a : (par0Str.equals("bottom") ? Block.cauldron.cauldronBottomIcon : null);
|
|
- }
|
|
-
|
|
- /**
|
|
* Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the
|
|
* mask.) Parameters: World, X, Y, Z, mask, list, colliding entity
|
|
*/
|
|
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
|
{
|
|
--- 3,18 ----
|
|
***************
|
|
*** 121,131 ****
|
|
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
|
{
|
|
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
--- 92,102 ----
|
|
if (!par5EntityPlayer.capabilities.isCreativeMode)
|
|
{
|
|
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty));
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, 3, 2);
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
***************
|
|
*** 151,169 ****
|
|
if (var10.stackSize <= 0)
|
|
{
|
|
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null);
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2);
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
}
|
|
}
|
|
else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH)
|
|
{
|
|
ItemArmor var14 = (ItemArmor)var10.getItem();
|
|
var14.removeColor(var10);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var12 - 1, 2);
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
return true;
|
|
}
|
|
|
|
return true;
|
|
--- 122,140 ----
|
|
if (var10.stackSize <= 0)
|
|
{
|
|
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null);
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var12 - 1, 2);
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
}
|
|
}
|
|
else if (var12 > 0 && var10.getItem() instanceof ItemArmor && ((ItemArmor)var10.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH)
|
|
{
|
|
ItemArmor var14 = (ItemArmor)var10.getItem();
|
|
var14.removeColor(var10);
|
|
! par1World.setBlockMetadata(par2, par3, par4, var12 - 1, 2);
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
return true;
|
|
}
|
|
|
|
return true;
|
|
***************
|
|
*** 181,207 ****
|
|
{
|
|
int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var5 < 3)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5 + 1, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
- {
|
|
- return Item.cauldron.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return Item.cauldron.itemID;
|
|
}
|
|
|
|
/**
|
|
--- 152,170 ----
|
|
{
|
|
int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var5 < 3)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var5 + 1, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Item.cauldron.itemID;
|
|
}
|
|
|
|
/**
|
|
*** BlockChest.java Sat Feb 5 04:19:38 2022
|
|
--- BlockChest.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 135,174 ****
|
|
var11 = 4;
|
|
}
|
|
|
|
if (var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3);
|
|
}
|
|
else
|
|
{
|
|
if ((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5))
|
|
{
|
|
if (var7 == this.blockID)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4 - 1, var11, 3);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4 + 1, var11, 3);
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3);
|
|
}
|
|
|
|
if ((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3))
|
|
{
|
|
if (var9 == this.blockID)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2 - 1, par3, par4, var11, 3);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2 + 1, par3, par4, var11, 3);
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 3);
|
|
}
|
|
}
|
|
|
|
if (par6ItemStack.hasDisplayName())
|
|
{
|
|
--- 135,174 ----
|
|
var11 = 4;
|
|
}
|
|
|
|
if (var7 != this.blockID && var8 != this.blockID && var9 != this.blockID && var10 != this.blockID)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11, 3);
|
|
}
|
|
else
|
|
{
|
|
if ((var7 == this.blockID || var8 == this.blockID) && (var11 == 4 || var11 == 5))
|
|
{
|
|
if (var7 == this.blockID)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4 - 1, var11, 3);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4 + 1, var11, 3);
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11, 3);
|
|
}
|
|
|
|
if ((var9 == this.blockID || var10 == this.blockID) && (var11 == 2 || var11 == 3))
|
|
{
|
|
if (var9 == this.blockID)
|
|
{
|
|
! par1World.setBlockMetadata(par2 - 1, par3, par4, var11, 3);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2 + 1, par3, par4, var11, 3);
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11, 3);
|
|
}
|
|
}
|
|
|
|
if (par6ItemStack.hasDisplayName())
|
|
{
|
|
***************
|
|
*** 282,292 ****
|
|
{
|
|
var13 = 4;
|
|
}
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var13, 3);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
|
--- 282,292 ----
|
|
{
|
|
var13 = 4;
|
|
}
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var13, 3);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
|
***************
|
|
*** 558,573 ****
|
|
* strength when this block inputs to a comparator.
|
|
*/
|
|
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
return Container.calcRedstoneFromInventory(this.getInventory(par1World, par2, par3, par4));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("planks_oak");
|
|
}
|
|
}
|
|
--- 558,564 ----
|
|
*** BlockCocoa.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCocoa.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,38 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockCocoa extends BlockDirectional
|
|
{
|
|
- private Icon[] iconArray;
|
|
-
|
|
public BlockCocoa(int par1)
|
|
{
|
|
super(par1, Material.plants);
|
|
this.setTickRandomly(true);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return this.iconArray[2];
|
|
- }
|
|
-
|
|
- public Icon getCocoaIcon(int par1)
|
|
- {
|
|
- if (par1 < 0 || par1 >= this.iconArray.length)
|
|
- {
|
|
- par1 = this.iconArray.length - 1;
|
|
- }
|
|
-
|
|
- return this.iconArray[par1];
|
|
- }
|
|
-
|
|
- /**
|
|
* Ticks the block if it's been scheduled
|
|
*/
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
if (!this.canBlockStay(par1World, par2, par3, par4))
|
|
--- 2,18 ----
|
|
***************
|
|
*** 46,56 ****
|
|
int var7 = func_72219_c(var6);
|
|
|
|
if (var7 < 2)
|
|
{
|
|
++var7;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 << 2 | getDirection(var6), 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 26,36 ----
|
|
int var7 = func_72219_c(var6);
|
|
|
|
if (var7 < 2)
|
|
{
|
|
++var7;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 << 2 | getDirection(var6), 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 99,117 ****
|
|
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
- return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
|
*/
|
|
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
{
|
|
int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
|
--- 79,88 ----
|
|
***************
|
|
*** 144,154 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
|
|
*/
|
|
--- 115,125 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 0) % 4;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
|
|
*/
|
|
***************
|
|
*** 198,231 ****
|
|
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.dyePowder, 1, 3));
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.dyePowder.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
* Get the block's damage value (for use with pick block).
|
|
*/
|
|
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return 3;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[3];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2);
|
|
- }
|
|
}
|
|
}
|
|
--- 169,180 ----
|
|
*** BlockColored.java Sat Feb 5 04:19:38 2022
|
|
--- BlockColored.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,28 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockColored extends Block
|
|
{
|
|
- private Icon[] iconArray;
|
|
-
|
|
public BlockColored(int par1, Material par2Material)
|
|
{
|
|
super(par1, par2Material);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return this.iconArray[par2 % this.iconArray.length];
|
|
- }
|
|
-
|
|
- /**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int par1)
|
|
{
|
|
return par1;
|
|
--- 1,16 ----
|
|
***************
|
|
*** 40,71 ****
|
|
* Takes a block damage value and returns the dye damage value to match
|
|
*/
|
|
public static int getDyeFromBlock(int par0)
|
|
{
|
|
return ~par0 & 15;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- for (int var4 = 0; var4 < 16; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[16];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + ItemDye.dyeItemNames[getDyeFromBlock(var2)]);
|
|
- }
|
|
}
|
|
}
|
|
--- 28,34 ----
|
|
*** BlockCommandBlock.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCommandBlock.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 29,44 ****
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
boolean var8 = (var7 & 1) != 0;
|
|
|
|
if (var6 && !var8)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 1, 4);
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
}
|
|
else if (!var6 && var8)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -2, 4);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 29,44 ----
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
boolean var8 = (var7 & 1) != 0;
|
|
|
|
if (var6 && !var8)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 | 1, 4);
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
}
|
|
else if (!var6 && var8)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 & -2, 4);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 49,59 ****
|
|
TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
|
|
|
|
if (var6 != null && var6 instanceof TileEntityCommandBlock)
|
|
{
|
|
TileEntityCommandBlock var7 = (TileEntityCommandBlock)var6;
|
|
! var7.func_96102_a(var7.executeCommandOnPowered(par1World));
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 49,59 ----
|
|
TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
|
|
|
|
if (var6 != null && var6 instanceof TileEntityCommandBlock)
|
|
{
|
|
TileEntityCommandBlock var7 = (TileEntityCommandBlock)var6;
|
|
! var7.setSignalStrength(var7.executeCommandOnPowered(par1World));
|
|
par1World.func_96440_m(par2, par3, par4, this.blockID);
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 93,103 ****
|
|
* strength when this block inputs to a comparator.
|
|
*/
|
|
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
|
|
! return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).func_96103_d() : 0;
|
|
}
|
|
|
|
/**
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
--- 93,103 ----
|
|
* strength when this block inputs to a comparator.
|
|
*/
|
|
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
|
|
! return var6 != null && var6 instanceof TileEntityCommandBlock ? ((TileEntityCommandBlock)var6).getSignalStrength() : 0;
|
|
}
|
|
|
|
/**
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
*** BlockComparator.java Sat Feb 5 04:19:38 2022
|
|
--- BlockComparator.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 16,33 ****
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Item.comparator.itemID;
|
|
}
|
|
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.comparator.itemID;
|
|
- }
|
|
-
|
|
protected int func_94481_j_(int par1)
|
|
{
|
|
return 2;
|
|
}
|
|
|
|
--- 16,25 ----
|
|
***************
|
|
*** 47,65 ****
|
|
public int getRenderType()
|
|
{
|
|
return 37;
|
|
}
|
|
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- boolean var3 = this.isRepeaterPowered || (par2 & 8) != 0;
|
|
- return par1 == 0 ? (var3 ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? (var3 ? Block.redstoneComparatorActive.blockIcon : this.blockIcon) : Block.stoneDoubleSlab.getBlockTextureFromSide(1));
|
|
- }
|
|
-
|
|
protected boolean func_96470_c(int par1)
|
|
{
|
|
return this.isRepeaterPowered || (par1 & 8) != 0;
|
|
}
|
|
|
|
--- 39,48 ----
|
|
***************
|
|
*** 147,157 ****
|
|
boolean var11 = this.isRepeaterPowered | (var10 & 8) != 0;
|
|
boolean var12 = !this.func_94490_c(var10);
|
|
int var13 = var12 ? 4 : 0;
|
|
var13 |= var11 ? 8 : 0;
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var13 | var10 & 3, 2);
|
|
this.func_96476_c(par1World, par2, par3, par4, par1World.rand);
|
|
return true;
|
|
}
|
|
|
|
protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5)
|
|
--- 130,140 ----
|
|
boolean var11 = this.isRepeaterPowered | (var10 & 8) != 0;
|
|
boolean var12 = !this.func_94490_c(var10);
|
|
int var13 = var12 ? 4 : 0;
|
|
var13 |= var11 ? 8 : 0;
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 ? 0.55F : 0.5F);
|
|
! par1World.setBlockMetadata(par2, par3, par4, var13 | var10 & 3, 2);
|
|
this.func_96476_c(par1World, par2, par3, par4, par1World.rand);
|
|
return true;
|
|
}
|
|
|
|
protected void func_94479_f(World par1World, int par2, int par3, int par4, int par5)
|
|
***************
|
|
*** 188,202 ****
|
|
boolean var9 = this.isGettingInput(par1World, par2, par3, par4, var6);
|
|
boolean var10 = this.isRepeaterPowered || (var6 & 8) != 0;
|
|
|
|
if (var10 && !var9)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 2);
|
|
}
|
|
else if (!var10 && var9)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 2);
|
|
}
|
|
|
|
this.func_94483_i_(par1World, par2, par3, par4);
|
|
}
|
|
}
|
|
--- 171,185 ----
|
|
boolean var9 = this.isGettingInput(par1World, par2, par3, par4, var6);
|
|
boolean var10 = this.isRepeaterPowered || (var6 & 8) != 0;
|
|
|
|
if (var10 && !var9)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 & -9, 2);
|
|
}
|
|
else if (!var10 && var9)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 | 8, 2);
|
|
}
|
|
|
|
this.func_94483_i_(par1World, par2, par3, par4);
|
|
}
|
|
}
|
|
*** BlockCrops.java Sat Feb 5 04:19:38 2022
|
|
--- BlockCrops.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,13 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockCrops extends BlockFlower
|
|
{
|
|
- private Icon[] iconArray;
|
|
-
|
|
protected BlockCrops(int par1)
|
|
{
|
|
super(par1);
|
|
this.setTickRandomly(true);
|
|
float var2 = 0.5F;
|
|
--- 2,11 ----
|
|
***************
|
|
*** 43,53 ****
|
|
float var7 = this.getGrowthRate(par1World, par2, par3, par4);
|
|
|
|
if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0)
|
|
{
|
|
++var6;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 41,51 ----
|
|
float var7 = this.getGrowthRate(par1World, par2, par3, par4);
|
|
|
|
if (par5Random.nextInt((int)(25.0F / var7) + 1) == 0)
|
|
{
|
|
++var6;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6, 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 61,71 ****
|
|
if (var5 > 7)
|
|
{
|
|
var5 = 7;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2);
|
|
}
|
|
|
|
/**
|
|
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
|
|
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
|
|
--- 59,69 ----
|
|
if (var5 > 7)
|
|
{
|
|
var5 = 7;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var5, 2);
|
|
}
|
|
|
|
/**
|
|
* Gets the growth rate for the crop. Setup to encourage rows by halving growth rate if there is diagonals, crops on
|
|
* different sides that aren't opposing, and by adding growth for every crop next to this one (and for crop below
|
|
***************
|
|
*** 119,141 ****
|
|
|
|
return var5;
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par2 < 0 || par2 > 7)
|
|
- {
|
|
- par2 = 7;
|
|
- }
|
|
-
|
|
- return this.iconArray[par2];
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 6;
|
|
--- 117,126 ----
|
|
***************
|
|
*** 193,221 ****
|
|
* Returns the quantity of items to drop on block destruction.
|
|
*/
|
|
public int quantityDropped(Random par1Random)
|
|
{
|
|
return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return this.getSeedItem();
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[8];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2);
|
|
- }
|
|
}
|
|
}
|
|
--- 178,184 ----
|
|
*** BlockDaylightDetector.java Sat Feb 5 04:19:38 2022
|
|
--- BlockDaylightDetector.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 76,86 ****
|
|
var6 = 15;
|
|
}
|
|
|
|
if (var5 != var6)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 3);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 76,86 ----
|
|
var6 = 15;
|
|
}
|
|
|
|
if (var5 != var6)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6, 3);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 112,136 ****
|
|
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
|
*/
|
|
public TileEntity createNewTileEntity(World par1World)
|
|
{
|
|
return new TileEntityDaylightDetector();
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.iconArray[0] : this.iconArray[1];
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
}
|
|
}
|
|
--- 112,118 ----
|
|
*** BlockDetectorRail.java Sat Feb 5 04:19:38 2022
|
|
--- BlockDetectorRail.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 3,14 ****
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockDetectorRail extends BlockRailBase
|
|
{
|
|
- private Icon[] iconArray;
|
|
-
|
|
public BlockDetectorRail(int par1)
|
|
{
|
|
super(par1, true);
|
|
this.setTickRandomly(true);
|
|
}
|
|
--- 3,12 ----
|
|
***************
|
|
*** 95,113 ****
|
|
var7 = true;
|
|
}
|
|
|
|
if (var7 && !var6)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 3);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
|
|
if (!var7 && var6)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 & 7, 3);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
|
|
--- 93,111 ----
|
|
var7 = true;
|
|
}
|
|
|
|
if (var7 && !var6)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, par5 | 8, 3);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
|
|
if (!var7 && var6)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, par5 & 7, 3);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3 - 1, par4, this.blockID);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
|
|
***************
|
|
*** 153,178 ****
|
|
return Container.calcRedstoneFromInventory((IInventory)var7.get(0));
|
|
}
|
|
}
|
|
|
|
return 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[2];
|
|
- this.iconArray[0] = par1IconRegister.registerIcon(this.getTextureName());
|
|
- this.iconArray[1] = par1IconRegister.registerIcon(this.getTextureName() + "_powered");
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return (par2 & 8) != 0 ? this.iconArray[1] : this.iconArray[0];
|
|
}
|
|
}
|
|
--- 151,157 ----
|
|
*** BlockDispenser.java Sat Feb 5 04:19:38 2022
|
|
--- BlockDispenser.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 5,17 ****
|
|
public class BlockDispenser extends BlockContainer
|
|
{
|
|
/** Registry for all dispense behaviors. */
|
|
public static final IRegistry dispenseBehaviorRegistry = new RegistryDefaulted(new BehaviorDefaultDispenseItem());
|
|
protected Random random = new Random();
|
|
- protected Icon furnaceTopIcon;
|
|
- protected Icon furnaceFrontIcon;
|
|
- protected Icon field_96473_e;
|
|
|
|
protected BlockDispenser(int par1)
|
|
{
|
|
super(par1, Material.rock);
|
|
this.setCreativeTab(CreativeTabs.tabRedstone);
|
|
--- 5,14 ----
|
|
***************
|
|
*** 66,101 ****
|
|
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7])
|
|
{
|
|
var9 = 4;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- int var3 = par2 & 7;
|
|
- return par1 == var3 ? (var3 != 1 && var3 != 0 ? this.furnaceFrontIcon : this.field_96473_e) : (var3 != 1 && var3 != 0 ? (par1 != 1 && par1 != 0 ? this.blockIcon : this.furnaceTopIcon) : this.furnaceTopIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("furnace_side");
|
|
- this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top");
|
|
- this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal");
|
|
- this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical");
|
|
- }
|
|
-
|
|
- /**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
{
|
|
if (par1World.isRemote)
|
|
--- 63,77 ----
|
|
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7])
|
|
{
|
|
var9 = 4;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var9, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
{
|
|
if (par1World.isRemote)
|
|
***************
|
|
*** 161,175 ****
|
|
boolean var8 = (var7 & 8) != 0;
|
|
|
|
if (var6 && !var8)
|
|
{
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 | 8, 4);
|
|
}
|
|
else if (!var6 && var8)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 & -9, 4);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ticks the block if it's been scheduled
|
|
--- 137,151 ----
|
|
boolean var8 = (var7 & 8) != 0;
|
|
|
|
if (var6 && !var8)
|
|
{
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 | 8, 4);
|
|
}
|
|
else if (!var6 && var8)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 & -9, 4);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ticks the block if it's been scheduled
|
|
***************
|
|
*** 194,204 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
|
|
if (par6ItemStack.hasDisplayName())
|
|
{
|
|
((TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName());
|
|
}
|
|
--- 170,180 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = BlockPistonBase.determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
|
|
if (par6ItemStack.hasDisplayName())
|
|
{
|
|
((TileEntityDispenser)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName());
|
|
}
|
|
*** BlockDoor.java Sat Feb 5 04:19:38 2022
|
|
--- BlockDoor.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,110 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockDoor extends Block
|
|
{
|
|
- private Icon[] field_111044_a;
|
|
- private Icon[] field_111043_b;
|
|
-
|
|
protected BlockDoor(int par1, Material par2Material)
|
|
{
|
|
super(par1, par2Material);
|
|
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);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return this.field_111043_b[0];
|
|
- }
|
|
-
|
|
- /**
|
|
- * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
|
- */
|
|
- public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- if (par5 != 1 && par5 != 0)
|
|
- {
|
|
- int var6 = this.getFullMetadata(par1IBlockAccess, par2, par3, par4);
|
|
- int var7 = var6 & 3;
|
|
- boolean var8 = (var6 & 4) != 0;
|
|
- boolean var9 = false;
|
|
- boolean var10 = (var6 & 8) != 0;
|
|
-
|
|
- if (var8)
|
|
- {
|
|
- if (var7 == 0 && par5 == 2)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- else if (var7 == 1 && par5 == 5)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- else if (var7 == 2 && par5 == 3)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- else if (var7 == 3 && par5 == 4)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- if (var7 == 0 && par5 == 5)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- else if (var7 == 1 && par5 == 3)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- else if (var7 == 2 && par5 == 4)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- else if (var7 == 3 && par5 == 2)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
-
|
|
- if ((var6 & 16) != 0)
|
|
- {
|
|
- var9 = !var9;
|
|
- }
|
|
- }
|
|
-
|
|
- return var10 ? this.field_111044_a[var9 ? 1 : 0] : this.field_111043_b[var9 ? 1 : 0];
|
|
- }
|
|
- else
|
|
- {
|
|
- return this.field_111043_b[0];
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_111044_a = new Icon[2];
|
|
- this.field_111043_b = new Icon[2];
|
|
- this.field_111044_a[0] = par1IconRegister.registerIcon(this.getTextureName() + "_upper");
|
|
- this.field_111043_b[0] = par1IconRegister.registerIcon(this.getTextureName() + "_lower");
|
|
- this.field_111044_a[1] = new IconFlipped(this.field_111044_a[0], true, false);
|
|
- this.field_111043_b[1] = new IconFlipped(this.field_111043_b[0], true, false);
|
|
- }
|
|
-
|
|
- /**
|
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
--- 2,20 ----
|
|
***************
|
|
*** 132,150 ****
|
|
{
|
|
return 7;
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
- return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
* cleared to be reused)
|
|
*/
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
{
|
|
--- 42,51 ----
|
|
***************
|
|
*** 275,290 ****
|
|
int var11 = var10 & 7;
|
|
var11 ^= 4;
|
|
|
|
if ((var10 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var11, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
}
|
|
|
|
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
return true;
|
|
--- 176,191 ----
|
|
int var11 = var10 & 7;
|
|
var11 ^= 4;
|
|
|
|
if ((var10 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3 - 1, par4, var11, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
}
|
|
|
|
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
return true;
|
|
***************
|
|
*** 304,319 ****
|
|
int var8 = var6 & 7;
|
|
var8 ^= 4;
|
|
|
|
if ((var6 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var8, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var8, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
}
|
|
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
--- 205,220 ----
|
|
int var8 = var6 & 7;
|
|
var8 ^= 4;
|
|
|
|
if ((var6 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var8, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3, par4, par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3 - 1, par4, var8, 2);
|
|
par1World.markBlockRangeForRenderUpdate(par2, par3 - 1, par4, par2, par3, par4);
|
|
}
|
|
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
***************
|
|
*** 435,452 ****
|
|
var8 = par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4);
|
|
}
|
|
|
|
boolean var9 = (var8 & 1) != 0;
|
|
return var7 & 7 | (var6 ? 8 : 0) | (var9 ? 16 : 0);
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return this.blockMaterial == Material.iron ? Item.doorIron.itemID : Item.doorWood.itemID;
|
|
}
|
|
|
|
/**
|
|
* Called when the block is attempted to be harvested
|
|
*/
|
|
--- 336,345 ----
|
|
*** BlockDragonEgg.java Sat Feb 5 04:19:38 2022
|
|
--- BlockDragonEgg.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 150,178 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 27;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return 0;
|
|
}
|
|
}
|
|
--- 150,161 ----
|
|
*** BlockDropper.java Sat Feb 5 04:19:38 2022
|
|
--- BlockDropper.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 8,29 ****
|
|
{
|
|
super(par1);
|
|
}
|
|
|
|
/**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("furnace_side");
|
|
- this.furnaceTopIcon = par1IconRegister.registerIcon("furnace_top");
|
|
- this.furnaceFrontIcon = par1IconRegister.registerIcon(this.getTextureName() + "_front_horizontal");
|
|
- this.field_96473_e = par1IconRegister.registerIcon(this.getTextureName() + "_front_vertical");
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the behavior for the given ItemStack.
|
|
*/
|
|
protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack par1ItemStack)
|
|
{
|
|
return this.dropperDefaultBehaviour;
|
|
--- 8,17 ----
|
|
*** BlockEnchantmentTable.java Sat Feb 5 04:19:38 2022
|
|
--- BlockEnchantmentTable.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,14 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.Random;
|
|
-
|
|
public class BlockEnchantmentTable extends BlockContainer
|
|
{
|
|
- private Icon field_94461_a;
|
|
- private Icon field_94460_b;
|
|
-
|
|
protected BlockEnchantmentTable(int par1)
|
|
{
|
|
super(par1, Material.rock);
|
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.75F, 1.0F);
|
|
this.setLightOpacity(0);
|
|
--- 1,9 ----
|
|
***************
|
|
*** 22,83 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- super.randomDisplayTick(par1World, par2, par3, par4, par5Random);
|
|
-
|
|
- for (int var6 = par2 - 2; var6 <= par2 + 2; ++var6)
|
|
- {
|
|
- for (int var7 = par4 - 2; var7 <= par4 + 2; ++var7)
|
|
- {
|
|
- if (var6 > par2 - 2 && var6 < par2 + 2 && var7 == par4 - 1)
|
|
- {
|
|
- var7 = par4 + 2;
|
|
- }
|
|
-
|
|
- if (par5Random.nextInt(16) == 0)
|
|
- {
|
|
- for (int var8 = par3; var8 <= par3 + 1; ++var8)
|
|
- {
|
|
- if (par1World.getBlockId(var6, var8, var7) == Block.bookShelf.blockID)
|
|
- {
|
|
- if (!par1World.isAirBlock((var6 - par2) / 2 + par2, var8, (var7 - par4) / 2 + par4))
|
|
- {
|
|
- break;
|
|
- }
|
|
-
|
|
- par1World.spawnParticle("enchantmenttable", (double)par2 + 0.5D, (double)par3 + 2.0D, (double)par4 + 0.5D, (double)((float)(var6 - par2) + par5Random.nextFloat()) - 0.5D, (double)((float)(var8 - par3) - par5Random.nextFloat() - 1.0F), (double)((float)(var7 - par4) + par5Random.nextFloat()) - 0.5D);
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 0 ? this.field_94460_b : (par1 == 1 ? this.field_94461_a : this.blockIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
|
*/
|
|
public TileEntity createNewTileEntity(World par1World)
|
|
{
|
|
return new TileEntityEnchantmentTable();
|
|
--- 17,35 ----
|
|
***************
|
|
*** 109,126 ****
|
|
|
|
if (par6ItemStack.hasDisplayName())
|
|
{
|
|
((TileEntityEnchantmentTable)par1World.getBlockTileEntity(par2, par3, par4)).func_94134_a(par6ItemStack.getDisplayName());
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_" + "side");
|
|
- this.field_94461_a = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top");
|
|
- this.field_94460_b = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom");
|
|
}
|
|
}
|
|
--- 61,67 ----
|
|
*** BlockEnderChest.java Sat Feb 5 04:19:38 2022
|
|
--- BlockEnderChest.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 86,96 ****
|
|
if (var8 == 3)
|
|
{
|
|
var7 = 4;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
--- 86,96 ----
|
|
if (var8 == 3)
|
|
{
|
|
var7 = 4;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
***************
|
|
*** 126,167 ****
|
|
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
|
*/
|
|
public TileEntity createNewTileEntity(World par1World)
|
|
{
|
|
return new TileEntityEnderChest();
|
|
- }
|
|
-
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- for (int var6 = 0; var6 < 3; ++var6)
|
|
- {
|
|
- double var10000 = (double)((float)par2 + par5Random.nextFloat());
|
|
- double var9 = (double)((float)par3 + par5Random.nextFloat());
|
|
- var10000 = (double)((float)par4 + par5Random.nextFloat());
|
|
- double var13 = 0.0D;
|
|
- double var15 = 0.0D;
|
|
- double var17 = 0.0D;
|
|
- int var19 = par5Random.nextInt(2) * 2 - 1;
|
|
- int var20 = par5Random.nextInt(2) * 2 - 1;
|
|
- var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D;
|
|
- var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D;
|
|
- var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.125D;
|
|
- double var11 = (double)par4 + 0.5D + 0.25D * (double)var20;
|
|
- var17 = (double)(par5Random.nextFloat() * 1.0F * (float)var20);
|
|
- double var7 = (double)par2 + 0.5D + 0.25D * (double)var19;
|
|
- var13 = (double)(par5Random.nextFloat() * 1.0F * (float)var19);
|
|
- par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("obsidian");
|
|
}
|
|
}
|
|
--- 126,132 ----
|
|
*** BlockEndPortal.java Sat Feb 5 04:19:38 2022
|
|
--- BlockEndPortal.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 32,50 ****
|
|
float var5 = 0.0625F;
|
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, var5, 1.0F);
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return par5 != 0 ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
|
- }
|
|
-
|
|
- /**
|
|
* Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the
|
|
* mask.) Parameters: World, X, Y, Z, mask, list, colliding entity
|
|
*/
|
|
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) {}
|
|
|
|
--- 32,41 ----
|
|
***************
|
|
*** 83,106 ****
|
|
par5Entity.travelToDimension(1);
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- double var6 = (double)((float)par2 + par5Random.nextFloat());
|
|
- double var8 = (double)((float)par3 + 0.8F);
|
|
- double var10 = (double)((float)par4 + par5Random.nextFloat());
|
|
- double var12 = 0.0D;
|
|
- double var14 = 0.0D;
|
|
- double var16 = 0.0D;
|
|
- par1World.spawnParticle("smoke", var6, var8, var10, var12, var14, var16);
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return -1;
|
|
--- 74,83 ----
|
|
***************
|
|
*** 116,139 ****
|
|
if (par1World.provider.dimensionId != 0)
|
|
{
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("portal");
|
|
}
|
|
}
|
|
--- 93,99 ----
|
|
*** BlockEndPortalFrame.java Sat Feb 5 04:19:38 2022
|
|
--- BlockEndPortalFrame.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 3,45 ****
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockEndPortalFrame extends Block
|
|
{
|
|
- private Icon field_94400_a;
|
|
- private Icon field_94399_b;
|
|
-
|
|
public BlockEndPortalFrame(int par1)
|
|
{
|
|
super(par1, Material.rock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.field_94400_a : (par1 == 0 ? Block.whiteStone.getBlockTextureFromSide(par1) : this.blockIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.field_94400_a = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.field_94399_b = par1IconRegister.registerIcon(this.getTextureName() + "_eye");
|
|
- }
|
|
-
|
|
- public Icon func_94398_p()
|
|
- {
|
|
- return this.field_94399_b;
|
|
- }
|
|
-
|
|
- /**
|
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
--- 3,18 ----
|
|
***************
|
|
*** 101,111 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* If this returns true, then comparators facing away from this block will use the value from
|
|
* getComparatorInputOverride instead of the actual redstone signal strength.
|
|
--- 74,84 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* If this returns true, then comparators facing away from this block will use the value from
|
|
* getComparatorInputOverride instead of the actual redstone signal strength.
|
|
*** BlockFarmland.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFarmland.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,14 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockFarmland extends Block
|
|
{
|
|
- private Icon field_94441_a;
|
|
- private Icon field_94440_b;
|
|
-
|
|
protected BlockFarmland(int par1)
|
|
{
|
|
super(par1, Material.ground);
|
|
this.setTickRandomly(true);
|
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.9375F, 1.0F);
|
|
--- 2,11 ----
|
|
***************
|
|
*** 40,77 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? (par2 > 0 ? this.field_94441_a : this.field_94440_b) : Block.dirt.getBlockTextureFromSide(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Ticks the block if it's been scheduled
|
|
*/
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
if (!this.isWaterNearby(par1World, par2, par3, par4) && !par1World.canLightningStrikeAt(par2, par3 + 1, par4))
|
|
{
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var6 > 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 - 1, 2);
|
|
}
|
|
else if (!this.isCropsNearby(par1World, par2, par3, par4))
|
|
{
|
|
par1World.setBlock(par2, par3, par4, Block.dirt.blockID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 7, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Block's chance to react to an entity falling on it.
|
|
--- 37,66 ----
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
* Ticks the block if it's been scheduled
|
|
*/
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
if (!this.isWaterNearby(par1World, par2, par3, par4) && !par1World.canLightningStrikeAt(par2, par3 + 1, par4))
|
|
{
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var6 > 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 - 1, 2);
|
|
}
|
|
else if (!this.isCropsNearby(par1World, par2, par3, par4))
|
|
{
|
|
par1World.setBlock(par2, par3, par4, Block.dirt.blockID);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 7, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Block's chance to react to an entity falling on it.
|
|
***************
|
|
*** 153,177 ****
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Block.dirt.idDropped(0, par2Random, par3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Block.dirt.blockID;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_94441_a = par1IconRegister.registerIcon(this.getTextureName() + "_wet");
|
|
- this.field_94440_b = par1IconRegister.registerIcon(this.getTextureName() + "_dry");
|
|
}
|
|
}
|
|
--- 142,148 ----
|
|
*** BlockFence.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFence.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 165,192 ****
|
|
{
|
|
return par0 == Block.fence.blockID || par0 == Block.netherFence.blockID;
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.field_94464_a);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
{
|
|
return par1World.isRemote ? true : ItemLeash.func_135066_a(par5EntityPlayer, par1World, par2, par3, par4);
|
|
--- 165,174 ----
|
|
*** BlockFenceGate.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFenceGate.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 7,24 ****
|
|
super(par1, Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabRedstone);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return Block.planks.getBlockTextureFromSide(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
|
*/
|
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return !par1World.getBlockMaterial(par2, par3 - 1, par4).isSolid() ? false : super.canPlaceBlockAt(par1World, par2, par3, par4);
|
|
--- 7,16 ----
|
|
***************
|
|
*** 85,95 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = (MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
--- 77,87 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = (MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
***************
|
|
*** 97,107 ****
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (isFenceGateOpen(var10))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 & -5, 2);
|
|
}
|
|
else
|
|
{
|
|
int var11 = (MathHelper.floor_double((double)(par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4;
|
|
int var12 = getDirection(var10);
|
|
--- 89,99 ----
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (isFenceGateOpen(var10))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var10 & -5, 2);
|
|
}
|
|
else
|
|
{
|
|
int var11 = (MathHelper.floor_double((double)(par5EntityPlayer.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) % 4;
|
|
int var12 = getDirection(var10);
|
|
***************
|
|
*** 109,119 ****
|
|
if (var12 == (var11 + 2) % 4)
|
|
{
|
|
var10 = var11;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 | 4, 2);
|
|
}
|
|
|
|
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
return true;
|
|
}
|
|
--- 101,111 ----
|
|
if (var12 == (var11 + 2) % 4)
|
|
{
|
|
var10 = var11;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var10 | 4, 2);
|
|
}
|
|
|
|
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
return true;
|
|
}
|
|
***************
|
|
*** 131,146 ****
|
|
|
|
if (var7 || par5 > 0 && Block.blocksList[par5].canProvidePower())
|
|
{
|
|
if (var7 && !isFenceGateOpen(var6))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 4, 2);
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
else if (!var7 && isFenceGateOpen(var6))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -5, 2);
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--- 123,138 ----
|
|
|
|
if (var7 || par5 > 0 && Block.blocksList[par5].canProvidePower())
|
|
{
|
|
if (var7 && !isFenceGateOpen(var6))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 | 4, 2);
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
else if (!var7 && isFenceGateOpen(var6))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 & -5, 2);
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
***************
|
|
*** 150,170 ****
|
|
*/
|
|
public static boolean isFenceGateOpen(int par0)
|
|
{
|
|
return (par0 & 4) != 0;
|
|
}
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 142,147 ----
|
|
*** BlockFire.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFire.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 10,20 ****
|
|
/**
|
|
* This is an array indexed by block ID the larger the number in the array the more likely a block type will catch
|
|
* fires
|
|
*/
|
|
private int[] abilityToCatchFire = new int[256];
|
|
- private Icon[] iconArray;
|
|
|
|
protected BlockFire(int par1)
|
|
{
|
|
super(par1, Material.fire);
|
|
this.setTickRandomly(true);
|
|
--- 10,19 ----
|
|
***************
|
|
*** 133,143 ****
|
|
{
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 < 15)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + par5Random.nextInt(3) / 2, 4);
|
|
}
|
|
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10));
|
|
|
|
if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4))
|
|
--- 132,142 ----
|
|
{
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 < 15)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 + par5Random.nextInt(3) / 2, 4);
|
|
}
|
|
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par5Random.nextInt(10));
|
|
|
|
if (!var6 && !this.canNeighborBurn(par1World, par2, par3, par4))
|
|
***************
|
|
*** 343,455 ****
|
|
else
|
|
{
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World) + par1World.rand.nextInt(10));
|
|
}
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- if (par5Random.nextInt(24) == 0)
|
|
- {
|
|
- par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "fire.fire", 1.0F + par5Random.nextFloat(), par5Random.nextFloat() * 0.7F + 0.3F, false);
|
|
- }
|
|
-
|
|
- int var6;
|
|
- float var7;
|
|
- float var8;
|
|
- float var9;
|
|
-
|
|
- if (!par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !Block.fire.canBlockCatchFire(par1World, par2, par3 - 1, par4))
|
|
- {
|
|
- if (Block.fire.canBlockCatchFire(par1World, par2 - 1, par3, par4))
|
|
- {
|
|
- for (var6 = 0; var6 < 2; ++var6)
|
|
- {
|
|
- var7 = (float)par2 + par5Random.nextFloat() * 0.1F;
|
|
- var8 = (float)par3 + par5Random.nextFloat();
|
|
- var9 = (float)par4 + par5Random.nextFloat();
|
|
- par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
-
|
|
- if (Block.fire.canBlockCatchFire(par1World, par2 + 1, par3, par4))
|
|
- {
|
|
- for (var6 = 0; var6 < 2; ++var6)
|
|
- {
|
|
- var7 = (float)(par2 + 1) - par5Random.nextFloat() * 0.1F;
|
|
- var8 = (float)par3 + par5Random.nextFloat();
|
|
- var9 = (float)par4 + par5Random.nextFloat();
|
|
- par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
-
|
|
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 - 1))
|
|
- {
|
|
- for (var6 = 0; var6 < 2; ++var6)
|
|
- {
|
|
- var7 = (float)par2 + par5Random.nextFloat();
|
|
- var8 = (float)par3 + par5Random.nextFloat();
|
|
- var9 = (float)par4 + par5Random.nextFloat() * 0.1F;
|
|
- par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
-
|
|
- if (Block.fire.canBlockCatchFire(par1World, par2, par3, par4 + 1))
|
|
- {
|
|
- for (var6 = 0; var6 < 2; ++var6)
|
|
- {
|
|
- var7 = (float)par2 + par5Random.nextFloat();
|
|
- var8 = (float)par3 + par5Random.nextFloat();
|
|
- var9 = (float)(par4 + 1) - par5Random.nextFloat() * 0.1F;
|
|
- par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
-
|
|
- if (Block.fire.canBlockCatchFire(par1World, par2, par3 + 1, par4))
|
|
- {
|
|
- for (var6 = 0; var6 < 2; ++var6)
|
|
- {
|
|
- var7 = (float)par2 + par5Random.nextFloat();
|
|
- var8 = (float)(par3 + 1) - par5Random.nextFloat() * 0.1F;
|
|
- var9 = (float)par4 + par5Random.nextFloat();
|
|
- par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- for (var6 = 0; var6 < 3; ++var6)
|
|
- {
|
|
- var7 = (float)par2 + par5Random.nextFloat();
|
|
- var8 = (float)par3 + par5Random.nextFloat() * 0.5F + 0.5F;
|
|
- var9 = (float)par4 + par5Random.nextFloat();
|
|
- par1World.spawnParticle("largesmoke", (double)var7, (double)var8, (double)var9, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[] {par1IconRegister.registerIcon(this.getTextureName() + "_layer_0"), par1IconRegister.registerIcon(this.getTextureName() + "_layer_1")};
|
|
- }
|
|
-
|
|
- public Icon getFireIcon(int par1)
|
|
- {
|
|
- return this.iconArray[par1];
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return this.iconArray[0];
|
|
}
|
|
}
|
|
--- 342,348 ----
|
|
*** BlockFlowerPot.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFlowerPot.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 64,74 ****
|
|
{
|
|
int var11 = getMetaForPlant(var10);
|
|
|
|
if (var11 > 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2);
|
|
|
|
if (!par5EntityPlayer.capabilities.isCreativeMode && --var10.stackSize <= 0)
|
|
{
|
|
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null);
|
|
}
|
|
--- 64,74 ----
|
|
{
|
|
int var11 = getMetaForPlant(var10);
|
|
|
|
if (var11 > 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11, 2);
|
|
|
|
if (!par5EntityPlayer.capabilities.isCreativeMode && --var10.stackSize <= 0)
|
|
{
|
|
par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null);
|
|
}
|
|
***************
|
|
*** 81,113 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4));
|
|
- return var5 == null ? Item.flowerPot.itemID : var5.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
* Get the block's damage value (for use with pick block).
|
|
*/
|
|
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
{
|
|
ItemStack var5 = getPlantForMeta(par1World.getBlockMetadata(par2, par3, par4));
|
|
return var5 == null ? Item.flowerPot.itemID : var5.getItemDamage();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true only if block is flowerPot
|
|
- */
|
|
- public boolean isFlowerPot()
|
|
- {
|
|
- return true;
|
|
}
|
|
|
|
/**
|
|
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
|
*/
|
|
--- 81,96 ----
|
|
*** BlockFlowing.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFlowing.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 119,129 ****
|
|
{
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11, 2);
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, var9);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
}
|
|
}
|
|
}
|
|
--- 119,129 ----
|
|
{
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11, 2);
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, var9);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
}
|
|
}
|
|
}
|
|
*** BlockFluid.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFluid.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,13 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public abstract class BlockFluid extends Block
|
|
{
|
|
- private Icon[] theIcon;
|
|
-
|
|
protected BlockFluid(int par1, Material par2Material)
|
|
{
|
|
super(par1, par2Material);
|
|
float var3 = 0.0F;
|
|
float var4 = 0.0F;
|
|
--- 2,11 ----
|
|
***************
|
|
*** 18,63 ****
|
|
public boolean getBlocksMovement(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
{
|
|
return this.blockMaterial != Material.lava;
|
|
}
|
|
|
|
- public int getBlockColor()
|
|
- {
|
|
- return 16777215;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- if (this.blockMaterial != Material.water)
|
|
- {
|
|
- return 16777215;
|
|
- }
|
|
- else
|
|
- {
|
|
- int var5 = 0;
|
|
- int var6 = 0;
|
|
- int var7 = 0;
|
|
-
|
|
- for (int var8 = -1; var8 <= 1; ++var8)
|
|
- {
|
|
- for (int var9 = -1; var9 <= 1; ++var9)
|
|
- {
|
|
- int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).waterColorMultiplier;
|
|
- var5 += (var10 & 16711680) >> 16;
|
|
- var6 += (var10 & 65280) >> 8;
|
|
- var7 += var10 & 255;
|
|
- }
|
|
- }
|
|
-
|
|
- return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255;
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the percentage of the fluid block that is air, based on the given flow decay of the fluid.
|
|
*/
|
|
public static float getFluidHeightPercent(int par0)
|
|
{
|
|
--- 16,25 ----
|
|
***************
|
|
*** 68,85 ****
|
|
|
|
return (float)(par0 + 1) / 9.0F;
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 != 0 && par1 != 1 ? this.theIcon[1] : this.theIcon[0];
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the amount of fluid decay at the coordinates, or -1 if the block at the coordinates is not the same
|
|
* material as the fluid.
|
|
*/
|
|
protected int getFlowDecay(World par1World, int par2, int par3, int par4)
|
|
{
|
|
--- 30,39 ----
|
|
***************
|
|
*** 125,136 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
! * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param
|
|
! * par2 whether the player right-clicked while holding a boat
|
|
*/
|
|
public boolean canCollideCheck(int par1, boolean par2)
|
|
{
|
|
return par2 && par1 == 0;
|
|
}
|
|
--- 79,89 ----
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
! * Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
|
|
*/
|
|
public boolean canCollideCheck(int par1, boolean par2)
|
|
{
|
|
return par2 && par1 == 0;
|
|
}
|
|
***************
|
|
*** 144,163 ****
|
|
Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4);
|
|
return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.isBlockSolid(par1IBlockAccess, par2, par3, par4, par5)));
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3, par4);
|
|
- return var6 == this.blockMaterial ? false : (par5 == 1 ? true : (var6 == Material.ice ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5)));
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
* cleared to be reused)
|
|
*/
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
{
|
|
--- 97,106 ----
|
|
***************
|
|
*** 316,525 ****
|
|
{
|
|
return this.blockMaterial == Material.water ? 5 : (this.blockMaterial == Material.lava ? (par1World.provider.hasNoSky ? 10 : 30) : 0);
|
|
}
|
|
|
|
/**
|
|
- * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids
|
|
- */
|
|
- public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3, par4, 0);
|
|
- int var6 = par1IBlockAccess.getLightBrightnessForSkyBlocks(par2, par3 + 1, par4, 0);
|
|
- int var7 = var5 & 255;
|
|
- int var8 = var6 & 255;
|
|
- int var9 = var5 >> 16 & 255;
|
|
- int var10 = var6 >> 16 & 255;
|
|
- return (var7 > var8 ? var7 : var8) | (var9 > var10 ? var9 : var10) << 16;
|
|
- }
|
|
-
|
|
- /**
|
|
- * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z
|
|
- */
|
|
- public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- float var5 = par1IBlockAccess.getLightBrightness(par2, par3, par4);
|
|
- float var6 = par1IBlockAccess.getLightBrightness(par2, par3 + 1, par4);
|
|
- return var5 > var6 ? var5 : var6;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
- */
|
|
- public int getRenderBlockPass()
|
|
- {
|
|
- return this.blockMaterial == Material.water ? 1 : 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- int var6;
|
|
-
|
|
- if (this.blockMaterial == Material.water)
|
|
- {
|
|
- if (par5Random.nextInt(10) == 0)
|
|
- {
|
|
- var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
-
|
|
- if (var6 <= 0 || var6 >= 8)
|
|
- {
|
|
- par1World.spawnParticle("suspended", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + par5Random.nextFloat()), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
-
|
|
- for (var6 = 0; var6 < 0; ++var6)
|
|
- {
|
|
- int var7 = par5Random.nextInt(4);
|
|
- int var8 = par2;
|
|
- int var9 = par4;
|
|
-
|
|
- if (var7 == 0)
|
|
- {
|
|
- var8 = par2 - 1;
|
|
- }
|
|
-
|
|
- if (var7 == 1)
|
|
- {
|
|
- ++var8;
|
|
- }
|
|
-
|
|
- if (var7 == 2)
|
|
- {
|
|
- var9 = par4 - 1;
|
|
- }
|
|
-
|
|
- if (var7 == 3)
|
|
- {
|
|
- ++var9;
|
|
- }
|
|
-
|
|
- if (par1World.getBlockMaterial(var8, par3, var9) == Material.air && (par1World.getBlockMaterial(var8, par3 - 1, var9).blocksMovement() || par1World.getBlockMaterial(var8, par3 - 1, var9).isLiquid()))
|
|
- {
|
|
- float var10 = 0.0625F;
|
|
- double var11 = (double)((float)par2 + par5Random.nextFloat());
|
|
- double var13 = (double)((float)par3 + par5Random.nextFloat());
|
|
- double var15 = (double)((float)par4 + par5Random.nextFloat());
|
|
-
|
|
- if (var7 == 0)
|
|
- {
|
|
- var11 = (double)((float)par2 - var10);
|
|
- }
|
|
-
|
|
- if (var7 == 1)
|
|
- {
|
|
- var11 = (double)((float)(par2 + 1) + var10);
|
|
- }
|
|
-
|
|
- if (var7 == 2)
|
|
- {
|
|
- var15 = (double)((float)par4 - var10);
|
|
- }
|
|
-
|
|
- if (var7 == 3)
|
|
- {
|
|
- var15 = (double)((float)(par4 + 1) + var10);
|
|
- }
|
|
-
|
|
- double var17 = 0.0D;
|
|
- double var19 = 0.0D;
|
|
-
|
|
- if (var7 == 0)
|
|
- {
|
|
- var17 = (double)(-var10);
|
|
- }
|
|
-
|
|
- if (var7 == 1)
|
|
- {
|
|
- var17 = (double)var10;
|
|
- }
|
|
-
|
|
- if (var7 == 2)
|
|
- {
|
|
- var19 = (double)(-var10);
|
|
- }
|
|
-
|
|
- if (var7 == 3)
|
|
- {
|
|
- var19 = (double)var10;
|
|
- }
|
|
-
|
|
- par1World.spawnParticle("splash", var11, var13, var15, var17, 0.0D, var19);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- if (this.blockMaterial == Material.water && par5Random.nextInt(64) == 0)
|
|
- {
|
|
- var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
-
|
|
- if (var6 > 0 && var6 < 8)
|
|
- {
|
|
- par1World.playSound((double)((float)par2 + 0.5F), (double)((float)par3 + 0.5F), (double)((float)par4 + 0.5F), "liquid.water", par5Random.nextFloat() * 0.25F + 0.75F, par5Random.nextFloat() * 1.0F + 0.5F, false);
|
|
- }
|
|
- }
|
|
-
|
|
- double var21;
|
|
- double var22;
|
|
- double var23;
|
|
-
|
|
- if (this.blockMaterial == Material.lava && par1World.getBlockMaterial(par2, par3 + 1, par4) == Material.air && !par1World.isBlockOpaqueCube(par2, par3 + 1, par4))
|
|
- {
|
|
- if (par5Random.nextInt(100) == 0)
|
|
- {
|
|
- var21 = (double)((float)par2 + par5Random.nextFloat());
|
|
- var22 = (double)par3 + this.maxY;
|
|
- var23 = (double)((float)par4 + par5Random.nextFloat());
|
|
- par1World.spawnParticle("lava", var21, var22, var23, 0.0D, 0.0D, 0.0D);
|
|
- par1World.playSound(var21, var22, var23, "liquid.lavapop", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false);
|
|
- }
|
|
-
|
|
- if (par5Random.nextInt(200) == 0)
|
|
- {
|
|
- par1World.playSound((double)par2, (double)par3, (double)par4, "liquid.lava", 0.2F + par5Random.nextFloat() * 0.2F, 0.9F + par5Random.nextFloat() * 0.15F, false);
|
|
- }
|
|
- }
|
|
-
|
|
- if (par5Random.nextInt(10) == 0 && par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && !par1World.getBlockMaterial(par2, par3 - 2, par4).blocksMovement())
|
|
- {
|
|
- var21 = (double)((float)par2 + par5Random.nextFloat());
|
|
- var22 = (double)par3 - 1.05D;
|
|
- var23 = (double)((float)par4 + par5Random.nextFloat());
|
|
-
|
|
- if (this.blockMaterial == Material.water)
|
|
- {
|
|
- par1World.spawnParticle("dripWater", var21, var22, var23, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else
|
|
- {
|
|
- par1World.spawnParticle("dripLava", var21, var22, var23, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * the sin and cos of this number determine the surface gradient of the flowing block.
|
|
- */
|
|
- public static double getFlowDirection(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, Material par4Material)
|
|
- {
|
|
- Vec3 var5 = null;
|
|
-
|
|
- if (par4Material == Material.water)
|
|
- {
|
|
- var5 = Block.waterMoving.getFlowVector(par0IBlockAccess, par1, par2, par3);
|
|
- }
|
|
-
|
|
- if (par4Material == Material.lava)
|
|
- {
|
|
- var5 = Block.lavaMoving.getFlowVector(par0IBlockAccess, par1, par2, par3);
|
|
- }
|
|
-
|
|
- return var5.xCoord == 0.0D && var5.zCoord == 0.0D ? -1000.0D : Math.atan2(var5.zCoord, var5.xCoord) - (Math.PI / 2D);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
*/
|
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
{
|
|
this.checkForHarden(par1World, par2, par3, par4);
|
|
--- 259,268 ----
|
|
***************
|
|
*** 598,625 ****
|
|
|
|
for (int var5 = 0; var5 < 8; ++var5)
|
|
{
|
|
par1World.spawnParticle("largesmoke", (double)par2 + Math.random(), (double)par3 + 1.2D, (double)par4 + Math.random(), 0.0D, 0.0D, 0.0D);
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- if (this.blockMaterial == Material.lava)
|
|
- {
|
|
- this.theIcon = new Icon[] {par1IconRegister.registerIcon("lava_still"), par1IconRegister.registerIcon("lava_flow")};
|
|
- }
|
|
- else
|
|
- {
|
|
- this.theIcon = new Icon[] {par1IconRegister.registerIcon("water_still"), par1IconRegister.registerIcon("water_flow")};
|
|
- }
|
|
- }
|
|
-
|
|
- public static Icon getFluidIcon(String par0Str)
|
|
- {
|
|
- return par0Str == "water_still" ? Block.waterMoving.theIcon[0] : (par0Str == "water_flow" ? Block.waterMoving.theIcon[1] : (par0Str == "lava_still" ? Block.lavaMoving.theIcon[0] : (par0Str == "lava_flow" ? Block.lavaMoving.theIcon[1] : null)));
|
|
}
|
|
}
|
|
--- 341,347 ----
|
|
*** BlockFurnace.java Sat Feb 5 04:19:38 2022
|
|
--- BlockFurnace.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 15,26 ****
|
|
/**
|
|
* This flag is used to prevent the furnace inventory to be dropped upon block removal, is used internally when the
|
|
* furnace block changes from idle to active and vice-versa.
|
|
*/
|
|
private static boolean keepFurnaceInventory;
|
|
- private Icon furnaceIconTop;
|
|
- private Icon furnaceIconFront;
|
|
|
|
protected BlockFurnace(int par1, boolean par2)
|
|
{
|
|
super(par1, Material.rock);
|
|
this.isActive = par2;
|
|
--- 15,24 ----
|
|
***************
|
|
*** 74,140 ****
|
|
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7])
|
|
{
|
|
var9 = 4;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var9, 2);
|
|
! }
|
|
! }
|
|
!
|
|
! /**
|
|
! * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
! */
|
|
! public Icon getIcon(int par1, int par2)
|
|
! {
|
|
! return par1 == 1 ? this.furnaceIconTop : (par1 == 0 ? this.furnaceIconTop : (par1 != par2 ? this.blockIcon : this.furnaceIconFront));
|
|
! }
|
|
!
|
|
! /**
|
|
! * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
! * is the only chance you get to register icons.
|
|
! */
|
|
! public void registerIcons(IconRegister par1IconRegister)
|
|
! {
|
|
! this.blockIcon = par1IconRegister.registerIcon("furnace_side");
|
|
! this.furnaceIconFront = par1IconRegister.registerIcon(this.isActive ? "furnace_front_on" : "furnace_front_off");
|
|
! this.furnaceIconTop = par1IconRegister.registerIcon("furnace_top");
|
|
! }
|
|
!
|
|
! /**
|
|
! * A randomly called display update to be able to add particles or other items for display
|
|
! */
|
|
! public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
! {
|
|
! if (this.isActive)
|
|
! {
|
|
! int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
! float var7 = (float)par2 + 0.5F;
|
|
! float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;
|
|
! float var9 = (float)par4 + 0.5F;
|
|
! float var10 = 0.52F;
|
|
! float var11 = par5Random.nextFloat() * 0.6F - 0.3F;
|
|
!
|
|
! if (var6 == 4)
|
|
! {
|
|
! par1World.spawnParticle("smoke", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
|
|
! par1World.spawnParticle("flame", (double)(var7 - var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
|
|
! }
|
|
! else if (var6 == 5)
|
|
! {
|
|
! par1World.spawnParticle("smoke", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
|
|
! par1World.spawnParticle("flame", (double)(var7 + var10), (double)var8, (double)(var9 + var11), 0.0D, 0.0D, 0.0D);
|
|
! }
|
|
! else if (var6 == 2)
|
|
! {
|
|
! par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
|
|
! par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 - var10), 0.0D, 0.0D, 0.0D);
|
|
! }
|
|
! else if (var6 == 3)
|
|
! {
|
|
! par1World.spawnParticle("smoke", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
|
|
! par1World.spawnParticle("flame", (double)(var7 + var11), (double)var8, (double)(var9 + var10), 0.0D, 0.0D, 0.0D);
|
|
! }
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
--- 72,82 ----
|
|
if (Block.opaqueCubeLookup[var8] && !Block.opaqueCubeLookup[var7])
|
|
{
|
|
var9 = 4;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var9, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
***************
|
|
*** 175,185 ****
|
|
{
|
|
par1World.setBlock(par2, par3, par4, Block.furnaceIdle.blockID);
|
|
}
|
|
|
|
keepFurnaceInventory = false;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2);
|
|
|
|
if (var6 != null)
|
|
{
|
|
var6.validate();
|
|
par1World.setBlockTileEntity(par2, par3, par4, var6);
|
|
--- 117,127 ----
|
|
{
|
|
par1World.setBlock(par2, par3, par4, Block.furnaceIdle.blockID);
|
|
}
|
|
|
|
keepFurnaceInventory = false;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var5, 2);
|
|
|
|
if (var6 != null)
|
|
{
|
|
var6.validate();
|
|
par1World.setBlockTileEntity(par2, par3, par4, var6);
|
|
***************
|
|
*** 201,226 ****
|
|
{
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
|
|
|
if (var7 == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);
|
|
}
|
|
|
|
if (var7 == 1)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2);
|
|
}
|
|
|
|
if (var7 == 2)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
|
|
}
|
|
|
|
if (var7 == 3)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2);
|
|
}
|
|
|
|
if (par6ItemStack.hasDisplayName())
|
|
{
|
|
((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName());
|
|
--- 143,168 ----
|
|
{
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
|
|
|
if (var7 == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 2, 2);
|
|
}
|
|
|
|
if (var7 == 1)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 5, 2);
|
|
}
|
|
|
|
if (var7 == 2)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 3, 2);
|
|
}
|
|
|
|
if (var7 == 3)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 4, 2);
|
|
}
|
|
|
|
if (par6ItemStack.hasDisplayName())
|
|
{
|
|
((TileEntityFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName());
|
|
***************
|
|
*** 297,311 ****
|
|
* strength when this block inputs to a comparator.
|
|
*/
|
|
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4));
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Block.furnaceIdle.blockID;
|
|
}
|
|
}
|
|
--- 239,245 ----
|
|
*** BlockGlass.java Sat Feb 5 04:19:38 2022
|
|
--- BlockGlass.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 17,34 ****
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
- */
|
|
- public int getRenderBlockPass()
|
|
- {
|
|
- return 0;
|
|
- }
|
|
-
|
|
- /**
|
|
* Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two
|
|
* adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
--- 17,26 ----
|
|
*** BlockGrass.java Sat Feb 5 04:19:38 2022
|
|
--- BlockGrass.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,102 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockGrass extends Block
|
|
{
|
|
- private Icon iconGrassTop;
|
|
- private Icon iconSnowSide;
|
|
- private Icon iconGrassSideOverlay;
|
|
-
|
|
protected BlockGrass(int par1)
|
|
{
|
|
super(par1, Material.grass);
|
|
this.setTickRandomly(true);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.iconGrassTop : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
|
- */
|
|
- public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- if (par5 == 1)
|
|
- {
|
|
- return this.iconGrassTop;
|
|
- }
|
|
- else if (par5 == 0)
|
|
- {
|
|
- return Block.dirt.getBlockTextureFromSide(par5);
|
|
- }
|
|
- else
|
|
- {
|
|
- Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4);
|
|
- return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.iconSnowSide;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.iconGrassTop = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.iconSnowSide = par1IconRegister.registerIcon(this.getTextureName() + "_side_snowed");
|
|
- this.iconGrassSideOverlay = par1IconRegister.registerIcon(this.getTextureName() + "_side_overlay");
|
|
- }
|
|
-
|
|
- public int getBlockColor()
|
|
- {
|
|
- double var1 = 0.5D;
|
|
- double var3 = 1.0D;
|
|
- return ColorizerGrass.getGrassColor(var1, var3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the color this block should be rendered. Used by leaves.
|
|
- */
|
|
- public int getRenderColor(int par1)
|
|
- {
|
|
- return this.getBlockColor();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = 0;
|
|
- int var6 = 0;
|
|
- int var7 = 0;
|
|
-
|
|
- for (int var8 = -1; var8 <= 1; ++var8)
|
|
- {
|
|
- for (int var9 = -1; var9 <= 1; ++var9)
|
|
- {
|
|
- int var10 = par1IBlockAccess.getBiomeGenForCoords(par2 + var9, par4 + var8).getBiomeGrassColor();
|
|
- var5 += (var10 & 16711680) >> 16;
|
|
- var6 += (var10 & 65280) >> 8;
|
|
- var7 += var10 & 255;
|
|
- }
|
|
- }
|
|
-
|
|
- return (var5 / 9 & 255) << 16 | (var6 / 9 & 255) << 8 | var7 / 9 & 255;
|
|
- }
|
|
-
|
|
- /**
|
|
* Ticks the block if it's been scheduled
|
|
*/
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
if (!par1World.isRemote)
|
|
--- 2,19 ----
|
|
***************
|
|
*** 127,138 ****
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Block.dirt.idDropped(0, par2Random, par3);
|
|
- }
|
|
-
|
|
- public static Icon getIconSideOverlay()
|
|
- {
|
|
- return Block.grass.iconGrassSideOverlay;
|
|
}
|
|
}
|
|
--- 44,50 ----
|
|
*** BlockHalfSlab.java Sat Feb 5 04:19:38 2022
|
|
--- BlockHalfSlab.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 113,169 ****
|
|
{
|
|
return this.isDoubleSlab;
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- if (this.isDoubleSlab)
|
|
- {
|
|
- return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
|
- }
|
|
- else if (par5 != 1 && par5 != 0 && !super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5))
|
|
- {
|
|
- return false;
|
|
- }
|
|
- else
|
|
- {
|
|
- int var6 = par2 + Facing.offsetsXForSide[Facing.oppositeSide[par5]];
|
|
- int var7 = par3 + Facing.offsetsYForSide[Facing.oppositeSide[par5]];
|
|
- int var8 = par4 + Facing.offsetsZForSide[Facing.oppositeSide[par5]];
|
|
- boolean var9 = (par1IBlockAccess.getBlockMetadata(var6, var7, var8) & 8) != 0;
|
|
- return var9 ? (par5 == 0 ? true : (par5 == 1 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) == 0)) : (par5 == 1 ? true : (par5 == 0 && super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) ? true : !isBlockSingleSlab(par1IBlockAccess.getBlockId(par2, par3, par4)) || (par1IBlockAccess.getBlockMetadata(par2, par3, par4) & 8) != 0));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Takes a block ID, returns true if it's the same as the ID for a stone or wooden single slab.
|
|
- */
|
|
- private static boolean isBlockSingleSlab(int par0)
|
|
- {
|
|
- return par0 == Block.stoneSingleSlab.blockID || par0 == Block.woodSingleSlab.blockID;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the slab block name with step type.
|
|
*/
|
|
public abstract String getFullSlabName(int var1);
|
|
|
|
/**
|
|
* Get the block's damage value (for use with pick block).
|
|
*/
|
|
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return super.getDamageValue(par1World, par2, par3, par4) & 7;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return isBlockSingleSlab(this.blockID) ? this.blockID : (this.blockID == Block.stoneDoubleSlab.blockID ? Block.stoneSingleSlab.blockID : (this.blockID == Block.woodDoubleSlab.blockID ? Block.woodSingleSlab.blockID : Block.stoneSingleSlab.blockID));
|
|
}
|
|
}
|
|
--- 113,129 ----
|
|
*** BlockHay.java Sat Feb 5 04:19:38 2022
|
|
--- BlockHay.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 13,36 ****
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 31;
|
|
}
|
|
-
|
|
- /**
|
|
- * The icon for the side of the block.
|
|
- */
|
|
- protected Icon getSideIcon(int par1)
|
|
- {
|
|
- return this.blockIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_111051_a = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- }
|
|
}
|
|
--- 13,18 ----
|
|
*** BlockHopper.java Sat Feb 5 04:19:38 2022
|
|
--- BlockHopper.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 4,16 ****
|
|
import java.util.Random;
|
|
|
|
public class BlockHopper extends BlockContainer
|
|
{
|
|
private final Random field_94457_a = new Random();
|
|
- private Icon hopperIcon;
|
|
- private Icon hopperTopIcon;
|
|
- private Icon hopperInsideIcon;
|
|
|
|
public BlockHopper(int par1)
|
|
{
|
|
super(par1, Material.iron);
|
|
this.setCreativeTab(CreativeTabs.tabRedstone);
|
|
--- 4,13 ----
|
|
***************
|
|
*** 132,142 ****
|
|
boolean var7 = !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
|
|
boolean var8 = getIsBlockNotPoweredFromMetadata(var5);
|
|
|
|
if (var7 != var8)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | (var7 ? 0 : 8), 4);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
--- 129,139 ----
|
|
boolean var7 = !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4);
|
|
boolean var8 = getIsBlockNotPoweredFromMetadata(var5);
|
|
|
|
if (var7 != var8)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 | (var7 ? 0 : 8), 4);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
***************
|
|
*** 214,240 ****
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.hopperTopIcon : this.hopperIcon;
|
|
- }
|
|
-
|
|
public static int getDirectionFromMetadata(int par0)
|
|
{
|
|
return par0 & 7;
|
|
}
|
|
|
|
--- 211,220 ----
|
|
***************
|
|
*** 257,290 ****
|
|
* strength when this block inputs to a comparator.
|
|
*/
|
|
public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
return Container.calcRedstoneFromInventory(getHopperTile(par1World, par2, par3, par4));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.hopperIcon = par1IconRegister.registerIcon("hopper_outside");
|
|
- this.hopperTopIcon = par1IconRegister.registerIcon("hopper_top");
|
|
- this.hopperInsideIcon = par1IconRegister.registerIcon("hopper_inside");
|
|
- }
|
|
-
|
|
- public static Icon getHopperIcon(String par0Str)
|
|
- {
|
|
- return par0Str.equals("hopper_outside") ? Block.hopperBlock.hopperIcon : (par0Str.equals("hopper_inside") ? Block.hopperBlock.hopperInsideIcon : null);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers.
|
|
- */
|
|
- public String getItemIconName()
|
|
- {
|
|
- return "hopper";
|
|
}
|
|
|
|
public static TileEntityHopper getHopperTile(IBlockAccess par0IBlockAccess, int par1, int par2, int par3)
|
|
{
|
|
return (TileEntityHopper)par0IBlockAccess.getBlockTileEntity(par1, par2, par3);
|
|
--- 237,246 ----
|
|
*** BlockIce.java Sat Feb 5 04:19:38 2022
|
|
--- BlockIce.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 11,37 ****
|
|
this.setTickRandomly(true);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
- */
|
|
- public int getRenderBlockPass()
|
|
- {
|
|
- return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, 1 - par5);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the
|
|
* block and l is the block's subtype/damage.
|
|
*/
|
|
public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
|
|
{
|
|
--- 11,20 ----
|
|
*** BlockJukeBox.java Sat Feb 5 04:19:38 2022
|
|
--- BlockJukeBox.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,26 ****
|
|
package net.minecraft.src;
|
|
|
|
public class BlockJukeBox extends BlockContainer
|
|
{
|
|
- private Icon theIcon;
|
|
-
|
|
protected BlockJukeBox(int par1)
|
|
{
|
|
super(par1, Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.theIcon : this.blockIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
{
|
|
if (par1World.getBlockMetadata(par2, par3, par4) == 0)
|
|
--- 1,16 ----
|
|
***************
|
|
*** 44,54 ****
|
|
TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4);
|
|
|
|
if (var6 != null)
|
|
{
|
|
var6.func_96098_a(par5ItemStack.copy());
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 34,44 ----
|
|
TileEntityRecordPlayer var6 = (TileEntityRecordPlayer)par1World.getBlockTileEntity(par2, par3, par4);
|
|
|
|
if (var6 != null)
|
|
{
|
|
var6.func_96098_a(par5ItemStack.copy());
|
|
! par1World.setBlockMetadata(par2, par3, par4, 1, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 67,77 ****
|
|
if (var6 != null)
|
|
{
|
|
par1World.playAuxSFX(1005, par2, par3, par4, 0);
|
|
par1World.playRecord((String)null, par2, par3, par4);
|
|
var5.func_96098_a((ItemStack)null);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 2);
|
|
float var7 = 0.7F;
|
|
double var8 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
|
double var10 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D;
|
|
double var12 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
|
ItemStack var14 = var6.copy();
|
|
--- 57,67 ----
|
|
if (var6 != null)
|
|
{
|
|
par1World.playAuxSFX(1005, par2, par3, par4, 0);
|
|
par1World.playRecord((String)null, par2, par3, par4);
|
|
var5.func_96098_a((ItemStack)null);
|
|
! par1World.setBlockMetadata(par2, par3, par4, 0, 2);
|
|
float var7 = 0.7F;
|
|
double var8 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
|
double var10 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.2D + 0.6D;
|
|
double var12 = (double)(par1World.rand.nextFloat() * var7) + (double)(1.0F - var7) * 0.5D;
|
|
ItemStack var14 = var6.copy();
|
|
***************
|
|
*** 109,128 ****
|
|
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
|
*/
|
|
public TileEntity createNewTileEntity(World par1World)
|
|
{
|
|
return new TileEntityRecordPlayer();
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
}
|
|
|
|
/**
|
|
* If this returns true, then comparators facing away from this block will use the value from
|
|
* getComparatorInputOverride instead of the actual redstone signal strength.
|
|
--- 99,108 ----
|
|
*** BlockLadder.java Sat Feb 5 04:19:38 2022
|
|
--- BlockLadder.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 19,37 ****
|
|
this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
return super.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
- return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
|
*/
|
|
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
{
|
|
this.updateLadderBounds(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
|
|
--- 19,28 ----
|
|
*** BlockLeaves.java Sat Feb 5 04:19:38 2022
|
|
--- BlockLeaves.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,79 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockLeaves extends BlockLeavesBase
|
|
{
|
|
public static final String[] LEAF_TYPES = new String[] {"oak", "spruce", "birch", "jungle"};
|
|
public static final String[][] field_94396_b = new String[][] {{"leaves_oak", "leaves_spruce", "leaves_birch", "leaves_jungle"}, {"leaves_oak_opaque", "leaves_spruce_opaque", "leaves_birch_opaque", "leaves_jungle_opaque"}};
|
|
-
|
|
- /** 1 for fast graphic. 0 for fancy graphics. used in iconArray. */
|
|
- private int iconType;
|
|
private Icon[][] iconArray = new Icon[2][];
|
|
int[] adjacentTreeBlocks;
|
|
|
|
protected BlockLeaves(int par1)
|
|
{
|
|
super(par1, Material.leaves, false);
|
|
this.setTickRandomly(true);
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
}
|
|
|
|
- public int getBlockColor()
|
|
- {
|
|
- double var1 = 0.5D;
|
|
- double var3 = 1.0D;
|
|
- return ColorizerFoliage.getFoliageColor(var1, var3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the color this block should be rendered. Used by leaves.
|
|
- */
|
|
- public int getRenderColor(int par1)
|
|
- {
|
|
- return (par1 & 3) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((par1 & 3) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic());
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
|
-
|
|
- if ((var5 & 3) == 1)
|
|
- {
|
|
- return ColorizerFoliage.getFoliageColorPine();
|
|
- }
|
|
- else if ((var5 & 3) == 2)
|
|
- {
|
|
- return ColorizerFoliage.getFoliageColorBirch();
|
|
- }
|
|
- else
|
|
- {
|
|
- int var6 = 0;
|
|
- int var7 = 0;
|
|
- int var8 = 0;
|
|
-
|
|
- for (int var9 = -1; var9 <= 1; ++var9)
|
|
- {
|
|
- for (int var10 = -1; var10 <= 1; ++var10)
|
|
- {
|
|
- int var11 = par1IBlockAccess.getBiomeGenForCoords(par2 + var10, par4 + var9).getBiomeFoliageColor();
|
|
- var6 += (var11 & 16711680) >> 16;
|
|
- var7 += (var11 & 65280) >> 8;
|
|
- var8 += var11 & 255;
|
|
- }
|
|
- }
|
|
-
|
|
- return (var6 / 9 & 255) << 16 | (var7 / 9 & 255) << 8 | var8 / 9 & 255;
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
|
* metadata
|
|
*/
|
|
--- 1,23 ----
|
|
***************
|
|
*** 93,103 ****
|
|
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
|
|
|
if (var12 == Block.leaves.blockID)
|
|
{
|
|
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
|
! par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--- 37,47 ----
|
|
int var12 = par1World.getBlockId(par2 + var9, par3 + var10, par4 + var11);
|
|
|
|
if (var12 == Block.leaves.blockID)
|
|
{
|
|
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
|
! par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
***************
|
|
*** 205,238 ****
|
|
|
|
var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11];
|
|
|
|
if (var12 >= 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 & -9, 4);
|
|
}
|
|
else
|
|
{
|
|
this.removeLeaves(par1World, par2, par3, par4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- if (par1World.canLightningStrikeAt(par2, par3 + 1, par4) && !par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) && par5Random.nextInt(15) == 1)
|
|
- {
|
|
- double var6 = (double)((float)par2 + par5Random.nextFloat());
|
|
- double var8 = (double)par3 - 0.05D;
|
|
- double var10 = (double)((float)par4 + par5Random.nextFloat());
|
|
- par1World.spawnParticle("dripWater", var6, var8, var10, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
-
|
|
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
|
{
|
|
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
--- 149,168 ----
|
|
|
|
var12 = this.adjacentTreeBlocks[var11 * var10 + var11 * var9 + var11];
|
|
|
|
if (var12 >= 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 & -9, 4);
|
|
}
|
|
else
|
|
{
|
|
this.removeLeaves(par1World, par2, par3, par4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
private void removeLeaves(World par1World, int par2, int par3, int par4)
|
|
{
|
|
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
***************
|
|
*** 335,392 ****
|
|
{
|
|
return !this.graphicsLevel;
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return (par2 & 3) == 1 ? this.iconArray[this.iconType][1] : ((par2 & 3) == 3 ? this.iconArray[this.iconType][3] : ((par2 & 3) == 2 ? this.iconArray[this.iconType][2] : this.iconArray[this.iconType][0]));
|
|
- }
|
|
-
|
|
- /**
|
|
- * Pass true to draw this block using fancy graphics, or false for fast graphics.
|
|
- */
|
|
- public void setGraphicsLevel(boolean par1)
|
|
- {
|
|
- this.graphicsLevel = par1;
|
|
- this.iconType = par1 ? 0 : 1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- par3List.add(new ItemStack(par1, 1, 2));
|
|
- par3List.add(new ItemStack(par1, 1, 3));
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage
|
|
* and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
|
|
*/
|
|
protected ItemStack createStackedBlock(int par1)
|
|
{
|
|
return new ItemStack(this.blockID, 1, par1 & 3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- for (int var2 = 0; var2 < field_94396_b.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = new Icon[field_94396_b[var2].length];
|
|
-
|
|
- for (int var3 = 0; var3 < field_94396_b[var2].length; ++var3)
|
|
- {
|
|
- this.iconArray[var2][var3] = par1IconRegister.registerIcon(field_94396_b[var2][var3]);
|
|
- }
|
|
- }
|
|
}
|
|
}
|
|
--- 265,277 ----
|
|
*** BlockLeavesBase.java Sat Feb 5 04:19:38 2022
|
|
--- BlockLeavesBase.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 20,35 ****
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- int var6 = par1IBlockAccess.getBlockId(par2, par3, par4);
|
|
- return !this.graphicsLevel && var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
|
- }
|
|
}
|
|
--- 20,25 ----
|
|
*** BlockLever.java Sat Feb 5 04:19:38 2022
|
|
--- BlockLever.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 111,136 ****
|
|
|
|
if (var8 == invertMetadata(1))
|
|
{
|
|
if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 5 | var9, 2);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 6 | var9, 2);
|
|
}
|
|
}
|
|
else if (var8 == invertMetadata(0))
|
|
{
|
|
if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 7 | var9, 2);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var9, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 111,136 ----
|
|
|
|
if (var8 == invertMetadata(1))
|
|
{
|
|
if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 5 | var9, 2);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 6 | var9, 2);
|
|
}
|
|
}
|
|
else if (var8 == invertMetadata(0))
|
|
{
|
|
if ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 1) == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 7 | var9, 2);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 0 | var9, 2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 291,301 ****
|
|
else
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
int var11 = var10 & 7;
|
|
int var12 = 8 - (var10 & 8);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 + var12, 3);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
|
|
if (var11 == 1)
|
|
{
|
|
--- 291,301 ----
|
|
else
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
int var11 = var10 & 7;
|
|
int var12 = 8 - (var10 & 8);
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11 + var12, 3);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "random.click", 0.3F, var12 > 0 ? 0.6F : 0.5F);
|
|
par1World.notifyBlocksOfNeighborChange(par2, par3, par4, this.blockID);
|
|
|
|
if (var11 == 1)
|
|
{
|
|
*** BlockLilyPad.java Sat Feb 5 04:19:38 2022
|
|
--- BlockLilyPad.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 40,71 ****
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return AxisAlignedBB.getAABBPool().getAABB((double)par2 + this.minX, (double)par3 + this.minY, (double)par4 + this.minZ, (double)par2 + this.maxX, (double)par3 + this.maxY, (double)par4 + this.maxZ);
|
|
}
|
|
|
|
- public int getBlockColor()
|
|
- {
|
|
- return 2129968;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the color this block should be rendered. Used by leaves.
|
|
- */
|
|
- public int getRenderColor(int par1)
|
|
- {
|
|
- return 2129968;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return 2129968;
|
|
- }
|
|
-
|
|
/**
|
|
* Gets passed in the blockID of the block below and supposed to return true if its allowed to grow on the type of
|
|
* blockID passed in. Args: blockID
|
|
*/
|
|
protected boolean canThisPlantGrowOnThisBlockID(int par1)
|
|
--- 40,49 ----
|
|
*** BlockLockedChest.java Sat Feb 5 04:19:38 2022
|
|
--- BlockLockedChest.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 22,33 ****
|
|
*/
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 22,27 ----
|
|
*** BlockLog.java Sat Feb 5 04:19:38 2022
|
|
--- BlockLog.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,16 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockLog extends BlockRotatedPillar
|
|
{
|
|
/** The type of tree this log came from. */
|
|
public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"};
|
|
- private Icon[] field_111052_c;
|
|
- private Icon[] tree_top;
|
|
|
|
protected BlockLog(int par1)
|
|
{
|
|
super(par1, Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
--- 1,13 ----
|
|
***************
|
|
*** 56,120 ****
|
|
{
|
|
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
|
|
|
if ((var13 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * The icon for the side of the block.
|
|
- */
|
|
- protected Icon getSideIcon(int par1)
|
|
- {
|
|
- return this.field_111052_c[par1];
|
|
- }
|
|
-
|
|
- /**
|
|
- * The icon for the tops and bottoms of the block.
|
|
- */
|
|
- protected Icon getEndIcon(int par1)
|
|
- {
|
|
- return this.tree_top[par1];
|
|
- }
|
|
-
|
|
- /**
|
|
* returns a number between 0 and 3
|
|
*/
|
|
public static int limitToValidMetadata(int par0)
|
|
{
|
|
return par0 & 3;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- par3List.add(new ItemStack(par1, 1, 2));
|
|
- par3List.add(new ItemStack(par1, 1, 3));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_111052_c = new Icon[woodType.length];
|
|
- this.tree_top = new Icon[woodType.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.field_111052_c.length; ++var2)
|
|
- {
|
|
- this.field_111052_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]);
|
|
- this.tree_top[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2] + "_top");
|
|
- }
|
|
}
|
|
}
|
|
--- 53,74 ----
|
|
{
|
|
int var13 = par1World.getBlockMetadata(par2 + var9, par3 + var10, par4 + var11);
|
|
|
|
if ((var13 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2 + var9, par3 + var10, par4 + var11, var13 | 8, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* returns a number between 0 and 3
|
|
*/
|
|
public static int limitToValidMetadata(int par0)
|
|
{
|
|
return par0 & 3;
|
|
}
|
|
}
|
|
*** BlockMelon.java Sat Feb 5 04:19:38 2022
|
|
--- BlockMelon.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,28 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockMelon extends Block
|
|
{
|
|
- private Icon theIcon;
|
|
-
|
|
protected BlockMelon(int par1)
|
|
{
|
|
super(par1, Material.pumpkin);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 != 1 && par1 != 0 ? this.blockIcon : this.theIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Item.melon.itemID;
|
|
--- 2,18 ----
|
|
***************
|
|
*** 47,63 ****
|
|
{
|
|
var3 = 9;
|
|
}
|
|
|
|
return var3;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
}
|
|
}
|
|
--- 37,43 ----
|
|
*** BlockMobSpawner.java Sat Feb 5 04:19:38 2022
|
|
--- BlockMobSpawner.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 49,62 ****
|
|
*/
|
|
public boolean isOpaqueCube()
|
|
{
|
|
return false;
|
|
}
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return 0;
|
|
- }
|
|
}
|
|
--- 49,54 ----
|
|
*** BlockMushroomCap.java Sat Feb 5 04:19:38 2022
|
|
--- BlockMushroomCap.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 6,34 ****
|
|
{
|
|
private static final String[] field_94429_a = new String[] {"skin_brown", "skin_red"};
|
|
|
|
/** The mushroom type. 0 for brown, 1 for red. */
|
|
private final int mushroomType;
|
|
- private Icon[] iconArray;
|
|
- private Icon field_94426_cO;
|
|
- private Icon field_94427_cP;
|
|
|
|
public BlockMushroomCap(int par1, Material par2Material, int par3)
|
|
{
|
|
super(par1, par2Material);
|
|
this.mushroomType = par3;
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par2 == 10 && par1 > 1 ? this.field_94426_cO : (par2 >= 1 && par2 <= 9 && par1 == 1 ? this.iconArray[this.mushroomType] : (par2 >= 1 && par2 <= 3 && par1 == 2 ? this.iconArray[this.mushroomType] : (par2 >= 7 && par2 <= 9 && par1 == 3 ? this.iconArray[this.mushroomType] : ((par2 == 1 || par2 == 4 || par2 == 7) && par1 == 4 ? this.iconArray[this.mushroomType] : ((par2 == 3 || par2 == 6 || par2 == 9) && par1 == 5 ? this.iconArray[this.mushroomType] : (par2 == 14 ? this.iconArray[this.mushroomType] : (par2 == 15 ? this.field_94426_cO : this.field_94427_cP)))))));
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the quantity of items to drop on block destruction.
|
|
*/
|
|
public int quantityDropped(Random par1Random)
|
|
{
|
|
int var2 = par1Random.nextInt(10) - 7;
|
|
--- 6,23 ----
|
|
***************
|
|
*** 45,76 ****
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Block.mushroomBrown.blockID + this.mushroomType;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Block.mushroomBrown.blockID + this.mushroomType;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[field_94429_a.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94429_a[var2]);
|
|
- }
|
|
-
|
|
- this.field_94427_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "inside");
|
|
- this.field_94426_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "skin_stem");
|
|
}
|
|
}
|
|
--- 34,40 ----
|
|
*** BlockMycelium.java Sat Feb 5 04:19:38 2022
|
|
--- BlockMycelium.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,61 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockMycelium extends Block
|
|
{
|
|
- private Icon field_94422_a;
|
|
- private Icon field_94421_b;
|
|
-
|
|
protected BlockMycelium(int par1)
|
|
{
|
|
super(par1, Material.grass);
|
|
this.setTickRandomly(true);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.field_94422_a : (par1 == 0 ? Block.dirt.getBlockTextureFromSide(par1) : this.blockIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
|
|
- */
|
|
- public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- if (par5 == 1)
|
|
- {
|
|
- return this.field_94422_a;
|
|
- }
|
|
- else if (par5 == 0)
|
|
- {
|
|
- return Block.dirt.getBlockTextureFromSide(par5);
|
|
- }
|
|
- else
|
|
- {
|
|
- Material var6 = par1IBlockAccess.getBlockMaterial(par2, par3 + 1, par4);
|
|
- return var6 != Material.snow && var6 != Material.craftedSnow ? this.blockIcon : this.field_94421_b;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.field_94422_a = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.field_94421_b = par1IconRegister.registerIcon("grass_side_snowed");
|
|
- }
|
|
-
|
|
- /**
|
|
* Ticks the block if it's been scheduled
|
|
*/
|
|
public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
if (!par1World.isRemote)
|
|
--- 2,19 ----
|
|
***************
|
|
*** 77,99 ****
|
|
{
|
|
par1World.setBlock(var7, var8, var9, this.blockID);
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- super.randomDisplayTick(par1World, par2, par3, par4, par5Random);
|
|
-
|
|
- if (par5Random.nextInt(10) == 0)
|
|
- {
|
|
- par1World.spawnParticle("townaura", (double)((float)par2 + par5Random.nextFloat()), (double)((float)par3 + 1.1F), (double)((float)par4 + par5Random.nextFloat()), 0.0D, 0.0D, 0.0D);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Returns the ID of the items to drop on destruction.
|
|
--- 35,44 ----
|
|
*** BlockNetherStalk.java Sat Feb 5 04:19:38 2022
|
|
--- BlockNetherStalk.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,13 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockNetherStalk extends BlockFlower
|
|
{
|
|
- private Icon[] iconArray;
|
|
-
|
|
protected BlockNetherStalk(int par1)
|
|
{
|
|
super(par1);
|
|
this.setTickRandomly(true);
|
|
float var2 = 0.5F;
|
|
--- 2,11 ----
|
|
***************
|
|
*** 40,64 ****
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var6 < 3 && par5Random.nextInt(10) == 0)
|
|
{
|
|
++var6;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2);
|
|
}
|
|
|
|
super.updateTick(par1World, par2, par3, par4, par5Random);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par2 >= 3 ? this.iconArray[2] : (par2 > 0 ? this.iconArray[1] : this.iconArray[0]);
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 6;
|
|
--- 38,54 ----
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var6 < 3 && par5Random.nextInt(10) == 0)
|
|
{
|
|
++var6;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6, 2);
|
|
}
|
|
|
|
super.updateTick(par1World, par2, par3, par4, par5Random);
|
|
}
|
|
|
|
/**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 6;
|
|
***************
|
|
*** 102,130 ****
|
|
* Returns the quantity of items to drop on block destruction.
|
|
*/
|
|
public int quantityDropped(Random par1Random)
|
|
{
|
|
return 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.netherStalkSeeds.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[3];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2);
|
|
- }
|
|
}
|
|
}
|
|
--- 92,98 ----
|
|
*** BlockPane.java Sat Feb 5 04:19:38 2022
|
|
--- BlockPane.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 14,24 ****
|
|
* If this field is true, the pane block drops itself when destroyed (like the iron fences), otherwise, it's just
|
|
* destroyed (like glass panes)
|
|
*/
|
|
private final boolean canDropItself;
|
|
private final String field_94402_c;
|
|
- private Icon theIcon;
|
|
|
|
protected BlockPane(int par1, String par2Str, String par3Str, Material par4Material, boolean par5)
|
|
{
|
|
super(par1, par4Material);
|
|
this.sideTextureIndex = par3Str;
|
|
--- 14,23 ----
|
|
***************
|
|
*** 59,78 ****
|
|
{
|
|
return 18;
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- int var6 = par1IBlockAccess.getBlockId(par2, par3, par4);
|
|
- return var6 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
|
- }
|
|
-
|
|
- /**
|
|
* Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the
|
|
* mask.) Parameters: World, X, Y, Z, mask, list, colliding entity
|
|
*/
|
|
public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
|
|
{
|
|
--- 58,67 ----
|
|
***************
|
|
*** 178,195 ****
|
|
|
|
this.setBlockBounds(var5, 0.0F, var7, var6, 1.0F, var8);
|
|
}
|
|
|
|
/**
|
|
- * Returns the texture index of the thin side of the pane.
|
|
- */
|
|
- public Icon getSideTextureIndex()
|
|
- {
|
|
- return this.theIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
* Gets passed in the blockID of the block adjacent and supposed to return true if its allowed to connect to the
|
|
* type of blockID passed in. Args: blockID
|
|
*/
|
|
public final boolean canThisPaneConnectToThisBlockID(int par1)
|
|
{
|
|
--- 167,176 ----
|
|
***************
|
|
*** 209,225 ****
|
|
* and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
|
|
*/
|
|
protected ItemStack createStackedBlock(int par1)
|
|
{
|
|
return new ItemStack(this.blockID, 1, par1);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.field_94402_c);
|
|
- this.theIcon = par1IconRegister.registerIcon(this.sideTextureIndex);
|
|
}
|
|
}
|
|
--- 190,196 ----
|
|
*** BlockPistonBase.java Sat Feb 5 04:19:38 2022
|
|
--- BlockPistonBase.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 5,74 ****
|
|
public class BlockPistonBase extends Block
|
|
{
|
|
/** This pistons is the sticky one? */
|
|
private final boolean isSticky;
|
|
|
|
- /** Only visible when piston is extended */
|
|
- private Icon innerTopIcon;
|
|
-
|
|
- /** Bottom side texture */
|
|
- private Icon bottomIcon;
|
|
-
|
|
- /** Top icon of piston depends on (either sticky or normal) */
|
|
- private Icon topIcon;
|
|
-
|
|
public BlockPistonBase(int par1, boolean par2)
|
|
{
|
|
super(par1, Material.piston);
|
|
this.isSticky = par2;
|
|
this.setStepSound(soundStoneFootstep);
|
|
this.setHardness(0.5F);
|
|
this.setCreativeTab(CreativeTabs.tabRedstone);
|
|
}
|
|
|
|
/**
|
|
- * Return the either 106 or 107 as the texture index depending on the isSticky flag. This will actually never get
|
|
- * called by TileEntityRendererPiston.renderPiston() because TileEntityPiston.shouldRenderHead() will always return
|
|
- * false.
|
|
- */
|
|
- public Icon getPistonExtensionTexture()
|
|
- {
|
|
- return this.topIcon;
|
|
- }
|
|
-
|
|
- public void func_96479_b(float par1, float par2, float par3, float par4, float par5, float par6)
|
|
- {
|
|
- this.setBlockBounds(par1, par2, par3, par4, par5, par6);
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- int var3 = getOrientation(par2);
|
|
- return var3 > 5 ? this.topIcon : (par1 == var3 ? (!isExtended(par2) && this.minX <= 0.0D && this.minY <= 0.0D && this.minZ <= 0.0D && this.maxX >= 1.0D && this.maxY >= 1.0D && this.maxZ >= 1.0D ? this.topIcon : this.innerTopIcon) : (par1 == Facing.oppositeSide[var3] ? this.bottomIcon : this.blockIcon));
|
|
- }
|
|
-
|
|
- public static Icon getPistonBaseIcon(String par0Str)
|
|
- {
|
|
- return par0Str == "piston_side" ? Block.pistonBase.blockIcon : (par0Str == "piston_top_normal" ? Block.pistonBase.topIcon : (par0Str == "piston_top_sticky" ? Block.pistonStickyBase.topIcon : (par0Str == "piston_inner" ? Block.pistonBase.innerTopIcon : null)));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("piston_side");
|
|
- this.topIcon = par1IconRegister.registerIcon(this.isSticky ? "piston_top_sticky" : "piston_top_normal");
|
|
- this.innerTopIcon = par1IconRegister.registerIcon("piston_inner");
|
|
- this.bottomIcon = par1IconRegister.registerIcon("piston_bottom");
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 16;
|
|
--- 5,24 ----
|
|
***************
|
|
*** 95,105 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
|
|
if (!par1World.isRemote)
|
|
{
|
|
this.updatePistonState(par1World, par2, par3, par4);
|
|
}
|
|
--- 45,55 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = determineOrientation(par1World, par2, par3, par4, par5EntityLivingBase);
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
|
|
if (!par1World.isRemote)
|
|
{
|
|
this.updatePistonState(par1World, par2, par3, par4);
|
|
}
|
|
***************
|
|
*** 147,157 ****
|
|
par1World.addBlockEvent(par2, par3, par4, this.blockID, 0, var6);
|
|
}
|
|
}
|
|
else if (!var7 && isExtended(var5))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2);
|
|
par1World.addBlockEvent(par2, par3, par4, this.blockID, 1, var6);
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 97,107 ----
|
|
par1World.addBlockEvent(par2, par3, par4, this.blockID, 0, var6);
|
|
}
|
|
}
|
|
else if (!var7 && isExtended(var5))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6, 2);
|
|
par1World.addBlockEvent(par2, par3, par4, this.blockID, 1, var6);
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 173,183 ****
|
|
{
|
|
boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, par6);
|
|
|
|
if (var7 && par5 == 1)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2);
|
|
return false;
|
|
}
|
|
|
|
if (!var7 && par5 == 0)
|
|
{
|
|
--- 123,133 ----
|
|
{
|
|
boolean var7 = this.isIndirectlyPowered(par1World, par2, par3, par4, par6);
|
|
|
|
if (var7 && par5 == 1)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, par6 | 8, 2);
|
|
return false;
|
|
}
|
|
|
|
if (!var7 && par5 == 0)
|
|
{
|
|
***************
|
|
*** 190,200 ****
|
|
if (!this.tryExtend(par1World, par2, par3, par4, par6))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 2);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.out", 0.5F, par1World.rand.nextFloat() * 0.25F + 0.6F);
|
|
}
|
|
else if (par5 == 1)
|
|
{
|
|
TileEntity var16 = par1World.getBlockTileEntity(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]);
|
|
--- 140,150 ----
|
|
if (!this.tryExtend(par1World, par2, par3, par4, par6))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, par6 | 8, 2);
|
|
par1World.playSoundEffect((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "tile.piston.out", 0.5F, par1World.rand.nextFloat() * 0.25F + 0.6F);
|
|
}
|
|
else if (par5 == 1)
|
|
{
|
|
TileEntity var16 = par1World.getBlockTileEntity(par2 + Facing.offsetsXForSide[par6], par3 + Facing.offsetsYForSide[par6], par4 + Facing.offsetsZForSide[par6]);
|
|
*** BlockPistonExtension.java Sat Feb 5 04:19:38 2022
|
|
--- BlockPistonExtension.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 3,32 ****
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockPistonExtension extends Block
|
|
{
|
|
- /** The texture for the 'head' of the piston. Sticky or normal. */
|
|
- private Icon headTexture;
|
|
-
|
|
public BlockPistonExtension(int par1)
|
|
{
|
|
super(par1, Material.piston);
|
|
this.setStepSound(soundStoneFootstep);
|
|
this.setHardness(0.5F);
|
|
}
|
|
|
|
- public void setHeadTexture(Icon par1Icon)
|
|
- {
|
|
- this.headTexture = par1Icon;
|
|
- }
|
|
-
|
|
- public void clearHeadTexture()
|
|
- {
|
|
- this.headTexture = null;
|
|
- }
|
|
-
|
|
/**
|
|
* Called when the block is attempted to be harvested
|
|
*/
|
|
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
|
|
{
|
|
--- 3,19 ----
|
|
***************
|
|
*** 69,93 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- int var3 = getDirectionMeta(par2);
|
|
- return par1 == var3 ? (this.headTexture != null ? this.headTexture : ((par2 & 8) != 0 ? BlockPistonBase.getPistonBaseIcon("piston_top_sticky") : BlockPistonBase.getPistonBaseIcon("piston_top_normal"))) : (var3 < 6 && par1 == Facing.oppositeSide[var3] ? BlockPistonBase.getPistonBaseIcon("piston_top_normal") : BlockPistonBase.getPistonBaseIcon("piston_side"));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 17;
|
|
--- 56,65 ----
|
|
***************
|
|
*** 249,264 ****
|
|
}
|
|
|
|
public static int getDirectionMeta(int par0)
|
|
{
|
|
return par0 & 7;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = par1World.getBlockMetadata(par2, par3, par4);
|
|
- return (var5 & 8) != 0 ? Block.pistonStickyBase.blockID : Block.pistonBase.blockID;
|
|
}
|
|
}
|
|
--- 221,227 ----
|
|
*** BlockPistonMoving.java Sat Feb 5 04:19:38 2022
|
|
--- BlockPistonMoving.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 191,201 ****
|
|
{
|
|
var7 = 1.0F - var7;
|
|
}
|
|
|
|
int var8 = var5.getPistonOrientation();
|
|
! this.minX = var6.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7);
|
|
this.minY = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7);
|
|
this.minZ = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7);
|
|
this.maxX = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7);
|
|
this.maxY = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7);
|
|
this.maxZ = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7);
|
|
--- 191,201 ----
|
|
{
|
|
var7 = 1.0F - var7;
|
|
}
|
|
|
|
int var8 = var5.getPistonOrientation();
|
|
! this.minX = var6.getMinX() - (double)((float)Facing.offsetsXForSide[var8] * var7);
|
|
this.minY = var6.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[var8] * var7);
|
|
this.minZ = var6.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[var8] * var7);
|
|
this.maxX = var6.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[var8] * var7);
|
|
this.maxY = var6.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[var8] * var7);
|
|
this.maxZ = var6.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[var8] * var7);
|
|
***************
|
|
*** 255,278 ****
|
|
*/
|
|
private TileEntityPiston getTileEntityAtLocation(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
{
|
|
TileEntity var5 = par1IBlockAccess.getBlockTileEntity(par2, par3, par4);
|
|
return var5 instanceof TileEntityPiston ? (TileEntityPiston)var5 : null;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("piston_top_normal");
|
|
}
|
|
}
|
|
--- 255,261 ----
|
|
*** BlockPortal.java Sat Feb 5 04:19:38 2022
|
|
--- BlockPortal.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 214,312 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- if (par1IBlockAccess.getBlockId(par2, par3, par4) == this.blockID)
|
|
- {
|
|
- return false;
|
|
- }
|
|
- else
|
|
- {
|
|
- boolean var6 = par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 - 2, par3, par4) != this.blockID;
|
|
- boolean var7 = par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.blockID && par1IBlockAccess.getBlockId(par2 + 2, par3, par4) != this.blockID;
|
|
- boolean var8 = par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 - 2) != this.blockID;
|
|
- boolean var9 = par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.blockID && par1IBlockAccess.getBlockId(par2, par3, par4 + 2) != this.blockID;
|
|
- boolean var10 = var6 || var7;
|
|
- boolean var11 = var8 || var9;
|
|
- return var10 && par5 == 4 ? true : (var10 && par5 == 5 ? true : (var11 && par5 == 2 ? true : var11 && par5 == 3));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the quantity of items to drop on block destruction.
|
|
*/
|
|
public int quantityDropped(Random par1Random)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
- */
|
|
- public int getRenderBlockPass()
|
|
- {
|
|
- return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
* Triggered whenever an entity collides with this block (enters into the block). Args: world, x, y, z, entity
|
|
*/
|
|
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity par5Entity)
|
|
{
|
|
if (par5Entity.ridingEntity == null && par5Entity.riddenByEntity == null)
|
|
{
|
|
par5Entity.setInPortal();
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- if (par5Random.nextInt(100) == 0)
|
|
- {
|
|
- par1World.playSound((double)par2 + 0.5D, (double)par3 + 0.5D, (double)par4 + 0.5D, "portal.portal", 0.5F, par5Random.nextFloat() * 0.4F + 0.8F, false);
|
|
- }
|
|
-
|
|
- for (int var6 = 0; var6 < 4; ++var6)
|
|
- {
|
|
- double var7 = (double)((float)par2 + par5Random.nextFloat());
|
|
- double var9 = (double)((float)par3 + par5Random.nextFloat());
|
|
- double var11 = (double)((float)par4 + par5Random.nextFloat());
|
|
- double var13 = 0.0D;
|
|
- double var15 = 0.0D;
|
|
- double var17 = 0.0D;
|
|
- int var19 = par5Random.nextInt(2) * 2 - 1;
|
|
- var13 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D;
|
|
- var15 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D;
|
|
- var17 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D;
|
|
-
|
|
- if (par1World.getBlockId(par2 - 1, par3, par4) != this.blockID && par1World.getBlockId(par2 + 1, par3, par4) != this.blockID)
|
|
- {
|
|
- var7 = (double)par2 + 0.5D + 0.25D * (double)var19;
|
|
- var13 = (double)(par5Random.nextFloat() * 2.0F * (float)var19);
|
|
- }
|
|
- else
|
|
- {
|
|
- var11 = (double)par4 + 0.5D + 0.25D * (double)var19;
|
|
- var17 = (double)(par5Random.nextFloat() * 2.0F * (float)var19);
|
|
- }
|
|
-
|
|
- par1World.spawnParticle("portal", var7, var9, var11, var13, var15, var17);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return 0;
|
|
}
|
|
}
|
|
--- 214,236 ----
|
|
*** BlockPotato.java Sat Feb 5 04:19:38 2022
|
|
--- BlockPotato.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,37 ****
|
|
package net.minecraft.src;
|
|
|
|
public class BlockPotato extends BlockCrops
|
|
{
|
|
- private Icon[] iconArray;
|
|
-
|
|
public BlockPotato(int par1)
|
|
{
|
|
super(par1);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par2 < 7)
|
|
- {
|
|
- if (par2 == 6)
|
|
- {
|
|
- par2 = 5;
|
|
- }
|
|
-
|
|
- return this.iconArray[par2 >> 1];
|
|
- }
|
|
- else
|
|
- {
|
|
- return this.iconArray[3];
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Generate a seed ItemStack for this crop.
|
|
*/
|
|
protected int getSeedItem()
|
|
{
|
|
return Item.potato.itemID;
|
|
--- 1,15 ----
|
|
***************
|
|
*** 56,77 ****
|
|
{
|
|
if (par5 >= 7 && par1World.rand.nextInt(50) == 0)
|
|
{
|
|
this.dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Item.poisonousPotato));
|
|
}
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[4];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_stage_" + var2);
|
|
}
|
|
}
|
|
}
|
|
--- 34,41 ----
|
|
*** BlockPumpkin.java Sat Feb 5 04:19:38 2022
|
|
--- BlockPumpkin.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 2,31 ****
|
|
|
|
public class BlockPumpkin extends BlockDirectional
|
|
{
|
|
/** Boolean used to seperate different states of blocks */
|
|
private boolean blockType;
|
|
- private Icon field_94474_b;
|
|
- private Icon field_94475_c;
|
|
|
|
protected BlockPumpkin(int par1, boolean par2)
|
|
{
|
|
super(par1, Material.pumpkin);
|
|
this.setTickRandomly(true);
|
|
this.blockType = par2;
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.field_94474_b : (par1 == 0 ? this.field_94474_b : (par2 == 2 && par1 == 2 ? this.field_94475_c : (par2 == 3 && par1 == 5 ? this.field_94475_c : (par2 == 0 && par1 == 3 ? this.field_94475_c : (par2 == 1 && par1 == 4 ? this.field_94475_c : this.blockIcon)))));
|
|
- }
|
|
-
|
|
- /**
|
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
*/
|
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
{
|
|
super.onBlockAdded(par1World, par2, par3, par4);
|
|
--- 2,21 ----
|
|
***************
|
|
*** 113,131 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
! }
|
|
!
|
|
! /**
|
|
! * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
! * is the only chance you get to register icons.
|
|
! */
|
|
! public void registerIcons(IconRegister par1IconRegister)
|
|
! {
|
|
! this.field_94475_c = par1IconRegister.registerIcon(this.getTextureName() + "_face_" + (this.blockType ? "on" : "off"));
|
|
! this.field_94474_b = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
! this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
}
|
|
}
|
|
--- 103,110 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
}
|
|
}
|
|
*** BlockQuartz.java Sat Feb 5 04:19:38 2022
|
|
--- BlockQuartz.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,60 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockQuartz extends Block
|
|
{
|
|
public static final String[] quartzBlockTypes = new String[] {"default", "chiseled", "lines"};
|
|
private static final String[] quartzBlockTextureTypes = new String[] {"side", "chiseled", "lines", null, null};
|
|
- private Icon[] quartzblockIcons;
|
|
- private Icon quartzblock_chiseled_top;
|
|
- private Icon quartzblock_lines_top;
|
|
- private Icon quartzblock_top;
|
|
- private Icon quartzblock_bottom;
|
|
|
|
public BlockQuartz(int par1)
|
|
{
|
|
super(par1, Material.rock);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par2 != 2 && par2 != 3 && par2 != 4)
|
|
- {
|
|
- if (par1 != 1 && (par1 != 0 || par2 != 1))
|
|
- {
|
|
- if (par1 == 0)
|
|
- {
|
|
- return this.quartzblock_bottom;
|
|
- }
|
|
- else
|
|
- {
|
|
- if (par2 < 0 || par2 >= this.quartzblockIcons.length)
|
|
- {
|
|
- par2 = 0;
|
|
- }
|
|
-
|
|
- return this.quartzblockIcons[par2];
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- return par2 == 1 ? this.quartzblock_chiseled_top : this.quartzblock_top;
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- return par2 == 2 && (par1 == 1 || par1 == 0) ? this.quartzblock_lines_top : (par2 == 3 && (par1 == 5 || par1 == 4) ? this.quartzblock_lines_top : (par2 == 4 && (par1 == 2 || par1 == 3) ? this.quartzblock_lines_top : this.quartzblockIcons[par2]));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
|
|
*/
|
|
public int onBlockPlaced(World par1World, int par2, int par3, int par4, int par5, float par6, float par7, float par8, int par9)
|
|
{
|
|
if (par9 == 2)
|
|
--- 1,19 ----
|
|
***************
|
|
*** 101,143 ****
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 39;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- par3List.add(new ItemStack(par1, 1, 2));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.quartzblockIcons = new Icon[quartzBlockTextureTypes.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.quartzblockIcons.length; ++var2)
|
|
- {
|
|
- if (quartzBlockTextureTypes[var2] == null)
|
|
- {
|
|
- this.quartzblockIcons[var2] = this.quartzblockIcons[var2 - 1];
|
|
- }
|
|
- else
|
|
- {
|
|
- this.quartzblockIcons[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + quartzBlockTextureTypes[var2]);
|
|
- }
|
|
- }
|
|
-
|
|
- this.quartzblock_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top");
|
|
- this.quartzblock_chiseled_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "chiseled_top");
|
|
- this.quartzblock_lines_top = par1IconRegister.registerIcon(this.getTextureName() + "_" + "lines_top");
|
|
- this.quartzblock_bottom = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom");
|
|
}
|
|
}
|
|
--- 60,66 ----
|
|
*** BlockRail.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRail.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,32 ****
|
|
package net.minecraft.src;
|
|
|
|
public class BlockRail extends BlockRailBase
|
|
{
|
|
- private Icon theIcon;
|
|
-
|
|
protected BlockRail(int par1)
|
|
{
|
|
super(par1, false);
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par2 >= 6 ? this.theIcon : this.blockIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_turned");
|
|
}
|
|
|
|
protected void func_94358_a(World par1World, int par2, int par3, int par4, int par5, int par6, int par7)
|
|
{
|
|
if (par7 > 0 && Block.blocksList[par7].canProvidePower() && (new BlockBaseRailLogic(this, par1World, par2, par3, par4)).getNumberOfAdjacentTracks() == 3)
|
|
--- 1,12 ----
|
|
*** BlockRailPowered.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRailPowered.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,34 ****
|
|
package net.minecraft.src;
|
|
|
|
public class BlockRailPowered extends BlockRailBase
|
|
{
|
|
- protected Icon theIcon;
|
|
-
|
|
protected BlockRailPowered(int par1)
|
|
{
|
|
super(par1, true);
|
|
}
|
|
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return (par2 & 8) == 0 ? this.blockIcon : this.theIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_powered");
|
|
- }
|
|
-
|
|
protected boolean func_94360_a(World par1World, int par2, int par3, int par4, int par5, boolean par6, int par7)
|
|
{
|
|
if (par7 >= 8)
|
|
{
|
|
return false;
|
|
--- 1,14 ----
|
|
***************
|
|
*** 167,182 ****
|
|
var8 = var8 || this.func_94360_a(par1World, par2, par3, par4, par5, true, 0) || this.func_94360_a(par1World, par2, par3, par4, par5, false, 0);
|
|
boolean var9 = false;
|
|
|
|
if (var8 && (par5 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6 | 8, 3);
|
|
var9 = true;
|
|
}
|
|
else if (!var8 && (par5 & 8) != 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3);
|
|
var9 = true;
|
|
}
|
|
|
|
if (var9)
|
|
{
|
|
--- 147,162 ----
|
|
var8 = var8 || this.func_94360_a(par1World, par2, par3, par4, par5, true, 0) || this.func_94360_a(par1World, par2, par3, par4, par5, false, 0);
|
|
boolean var9 = false;
|
|
|
|
if (var8 && (par5 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, par6 | 8, 3);
|
|
var9 = true;
|
|
}
|
|
else if (!var8 && (par5 & 8) != 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, par6, 3);
|
|
var9 = true;
|
|
}
|
|
|
|
if (var9)
|
|
{
|
|
*** BlockRedstoneLight.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRedstoneLight.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 71,84 ****
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Block.redstoneLampIdle.blockID;
|
|
}
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Block.redstoneLampIdle.blockID;
|
|
- }
|
|
}
|
|
--- 71,76 ----
|
|
*** BlockRedstoneLogic.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRedstoneLogic.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 64,90 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 0 ? (this.isRepeaterPowered ? Block.torchRedstoneActive.getBlockTextureFromSide(par1) : Block.torchRedstoneIdle.getBlockTextureFromSide(par1)) : (par1 == 1 ? this.blockIcon : Block.stoneDoubleSlab.getBlockTextureFromSide(1));
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return par5 != 0 && par5 != 1;
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 36;
|
|
--- 64,73 ----
|
|
***************
|
|
*** 232,242 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 3);
|
|
boolean var8 = this.isGettingInput(par1World, par2, par3, par4, var7);
|
|
|
|
if (var8)
|
|
{
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 1);
|
|
--- 215,225 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = ((MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3) + 2) % 4;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 3);
|
|
boolean var8 = this.isGettingInput(par1World, par2, par3, par4, var7);
|
|
|
|
if (var8)
|
|
{
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, 1);
|
|
*** BlockRedstoneOre.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRedstoneOre.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 114,134 ****
|
|
this.dropXpOnBlockBreak(par1World, par2, par3, par4, var8);
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- if (this.glowing)
|
|
- {
|
|
- this.sparkle(par1World, par2, par3, par4);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* The redstone ore sparkles.
|
|
*/
|
|
private void sparkle(World par1World, int par2, int par3, int par4)
|
|
{
|
|
Random var5 = par1World.rand;
|
|
--- 114,123 ----
|
|
*** BlockRedstoneRepeater.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRedstoneRepeater.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 21,31 ****
|
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
int var11 = (var10 & 12) >> 2;
|
|
var11 = var11 + 1 << 2 & 12;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var11 | var10 & 3, 3);
|
|
return true;
|
|
}
|
|
|
|
protected int func_94481_j_(int par1)
|
|
{
|
|
--- 21,31 ----
|
|
public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
int var11 = (var10 & 12) >> 2;
|
|
var11 = var11 + 1 << 2 & 12;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var11 | var10 & 3, 3);
|
|
return true;
|
|
}
|
|
|
|
protected int func_94481_j_(int par1)
|
|
{
|
|
***************
|
|
*** 49,66 ****
|
|
{
|
|
return Item.redstoneRepeater.itemID;
|
|
}
|
|
|
|
/**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.redstoneRepeater.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 15;
|
|
--- 49,58 ----
|
|
***************
|
|
*** 72,143 ****
|
|
}
|
|
|
|
protected boolean func_94477_d(int par1)
|
|
{
|
|
return isRedstoneRepeaterBlockID(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- if (this.isRepeaterPowered)
|
|
- {
|
|
- int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
- int var7 = getDirection(var6);
|
|
- double var8 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D;
|
|
- double var10 = (double)((float)par3 + 0.4F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D;
|
|
- double var12 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D;
|
|
- double var14 = 0.0D;
|
|
- double var16 = 0.0D;
|
|
-
|
|
- if (par5Random.nextInt(2) == 0)
|
|
- {
|
|
- switch (var7)
|
|
- {
|
|
- case 0:
|
|
- var16 = -0.3125D;
|
|
- break;
|
|
-
|
|
- case 1:
|
|
- var14 = 0.3125D;
|
|
- break;
|
|
-
|
|
- case 2:
|
|
- var16 = 0.3125D;
|
|
- break;
|
|
-
|
|
- case 3:
|
|
- var14 = -0.3125D;
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- int var18 = (var6 & 12) >> 2;
|
|
-
|
|
- switch (var7)
|
|
- {
|
|
- case 0:
|
|
- var16 = repeaterTorchOffset[var18];
|
|
- break;
|
|
-
|
|
- case 1:
|
|
- var14 = -repeaterTorchOffset[var18];
|
|
- break;
|
|
-
|
|
- case 2:
|
|
- var16 = -repeaterTorchOffset[var18];
|
|
- break;
|
|
-
|
|
- case 3:
|
|
- var14 = repeaterTorchOffset[var18];
|
|
- }
|
|
- }
|
|
-
|
|
- par1World.spawnParticle("reddust", var8 + var14, var10, var12 + var16, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
}
|
|
|
|
/**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
* different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old
|
|
--- 64,73 ----
|
|
*** BlockRedstoneTorch.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRedstoneTorch.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 210,264 ****
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- if (this.torchActive)
|
|
- {
|
|
- int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
- double var7 = (double)((float)par2 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D;
|
|
- double var9 = (double)((float)par3 + 0.7F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D;
|
|
- double var11 = (double)((float)par4 + 0.5F) + (double)(par5Random.nextFloat() - 0.5F) * 0.2D;
|
|
- double var13 = 0.2199999988079071D;
|
|
- double var15 = 0.27000001072883606D;
|
|
-
|
|
- if (var6 == 1)
|
|
- {
|
|
- par1World.spawnParticle("reddust", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else if (var6 == 2)
|
|
- {
|
|
- par1World.spawnParticle("reddust", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else if (var6 == 3)
|
|
- {
|
|
- par1World.spawnParticle("reddust", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else if (var6 == 4)
|
|
- {
|
|
- par1World.spawnParticle("reddust", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else
|
|
- {
|
|
- par1World.spawnParticle("reddust", var7, var9, var11, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Block.torchRedstoneActive.blockID;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns true if the given block ID is equivalent to this one. Example: redstoneTorchOn matches itself and
|
|
* redstoneTorchOff, and vice versa. Most blocks only match themselves.
|
|
*/
|
|
public boolean isAssociatedBlockID(int par1)
|
|
{
|
|
--- 210,219 ----
|
|
*** BlockRedstoneWire.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRedstoneWire.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 11,24 ****
|
|
* When false, power transmission methods do not look at other redstone wires. Used internally during
|
|
* updateCurrentStrength.
|
|
*/
|
|
private boolean wiresProvidePower = true;
|
|
private Set blocksNeedingUpdate = new HashSet();
|
|
- private Icon field_94413_c;
|
|
- private Icon field_94410_cO;
|
|
- private Icon field_94411_cP;
|
|
- private Icon field_94412_cQ;
|
|
|
|
public BlockRedstoneWire(int par1)
|
|
{
|
|
super(par1, Material.circuits);
|
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
|
|
--- 11,20 ----
|
|
***************
|
|
*** 57,75 ****
|
|
{
|
|
return 5;
|
|
}
|
|
|
|
/**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return 8388608;
|
|
- }
|
|
-
|
|
- /**
|
|
* Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
|
|
*/
|
|
public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) || par1World.getBlockId(par2, par3 - 1, par4) == Block.glowStone.blockID;
|
|
--- 53,62 ----
|
|
***************
|
|
*** 169,179 ****
|
|
var15 = var10;
|
|
}
|
|
|
|
if (var8 != var15)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var15, 2);
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2 - 1, par3, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2 + 1, par3, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 - 1, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 + 1, par4));
|
|
--- 156,166 ----
|
|
var15 = var10;
|
|
}
|
|
|
|
if (var8 != var15)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var15, 2);
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2 - 1, par3, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2 + 1, par3, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 - 1, par4));
|
|
this.blocksNeedingUpdate.add(new ChunkPosition(par2, par3 + 1, par4));
|
|
***************
|
|
*** 439,485 ****
|
|
{
|
|
return this.wiresProvidePower;
|
|
}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
-
|
|
- if (var6 > 0)
|
|
- {
|
|
- double var7 = (double)par2 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D;
|
|
- double var9 = (double)((float)par3 + 0.0625F);
|
|
- double var11 = (double)par4 + 0.5D + ((double)par5Random.nextFloat() - 0.5D) * 0.2D;
|
|
- float var13 = (float)var6 / 15.0F;
|
|
- float var14 = var13 * 0.6F + 0.4F;
|
|
-
|
|
- if (var6 == 0)
|
|
- {
|
|
- var14 = 0.0F;
|
|
- }
|
|
-
|
|
- float var15 = var13 * var13 * 0.7F - 0.5F;
|
|
- float var16 = var13 * var13 * 0.6F - 0.7F;
|
|
-
|
|
- if (var15 < 0.0F)
|
|
- {
|
|
- var15 = 0.0F;
|
|
- }
|
|
-
|
|
- if (var16 < 0.0F)
|
|
- {
|
|
- var16 = 0.0F;
|
|
- }
|
|
-
|
|
- par1World.spawnParticle("reddust", var7, var9, var11, (double)var14, (double)var15, (double)var16);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns true if redstone wire can connect to the specified block. Params: World, X, Y, Z, side (not a normal
|
|
* notch-side, this can be 0, 1, 2, 3 or -1)
|
|
*/
|
|
public static boolean isPowerProviderOrWire(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4)
|
|
{
|
|
--- 426,435 ----
|
|
***************
|
|
*** 526,558 ****
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.redstone.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_94413_c = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross");
|
|
- this.field_94410_cO = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line");
|
|
- this.field_94411_cP = par1IconRegister.registerIcon(this.getTextureName() + "_" + "cross_overlay");
|
|
- this.field_94412_cQ = par1IconRegister.registerIcon(this.getTextureName() + "_" + "line_overlay");
|
|
- this.blockIcon = this.field_94413_c;
|
|
- }
|
|
-
|
|
- public static Icon getRedstoneWireIcon(String par0Str)
|
|
- {
|
|
- return par0Str.equals("cross") ? Block.redstoneWire.field_94413_c : (par0Str.equals("line") ? Block.redstoneWire.field_94410_cO : (par0Str.equals("cross_overlay") ? Block.redstoneWire.field_94411_cP : (par0Str.equals("line_overlay") ? Block.redstoneWire.field_94412_cQ : null)));
|
|
}
|
|
}
|
|
--- 476,482 ----
|
|
*** BlockReed.java Sat Feb 5 04:19:38 2022
|
|
--- BlockReed.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 31,45 ****
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 == 15)
|
|
{
|
|
par1World.setBlock(par2, par3 + 1, par4, this.blockID);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0, 4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7 + 1, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 31,45 ----
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 == 15)
|
|
{
|
|
par1World.setBlock(par2, par3 + 1, par4, this.blockID);
|
|
! par1World.setBlockMetadata(par2, par3, par4, 0, 4);
|
|
}
|
|
else
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7 + 1, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 119,133 ****
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.reed.itemID;
|
|
}
|
|
}
|
|
--- 119,125 ----
|
|
*** BlockRotatedPillar.java Sat Feb 5 04:19:38 2022
|
|
--- BlockRotatedPillar.java Sat Feb 5 04:19:54 2022
|
|
***************
|
|
*** 1,11 ****
|
|
package net.minecraft.src;
|
|
|
|
public abstract class BlockRotatedPillar extends Block
|
|
{
|
|
- protected Icon field_111051_a;
|
|
-
|
|
protected BlockRotatedPillar(int par1, Material par2Material)
|
|
{
|
|
super(par1, par2Material);
|
|
}
|
|
|
|
--- 1,9 ----
|
|
***************
|
|
*** 41,73 ****
|
|
case 5:
|
|
var11 = 4;
|
|
}
|
|
|
|
return var10 | var11;
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- int var3 = par2 & 12;
|
|
- int var4 = par2 & 3;
|
|
- return var3 == 0 && (par1 == 1 || par1 == 0) ? this.getEndIcon(var4) : (var3 == 4 && (par1 == 5 || par1 == 4) ? this.getEndIcon(var4) : (var3 == 8 && (par1 == 2 || par1 == 3) ? this.getEndIcon(var4) : this.getSideIcon(var4)));
|
|
- }
|
|
-
|
|
- /**
|
|
- * The icon for the side of the block.
|
|
- */
|
|
- protected abstract Icon getSideIcon(int var1);
|
|
-
|
|
- /**
|
|
- * The icon for the tops and bottoms of the block.
|
|
- */
|
|
- protected Icon getEndIcon(int par1)
|
|
- {
|
|
- return this.field_111051_a;
|
|
}
|
|
|
|
/**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
--- 39,48 ----
|
|
*** BlockSandStone.java Sat Feb 5 04:19:38 2022
|
|
--- BlockSandStone.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,80 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockSandStone extends Block
|
|
{
|
|
public static final String[] SAND_STONE_TYPES = new String[] {"default", "chiseled", "smooth"};
|
|
private static final String[] field_94405_b = new String[] {"normal", "carved", "smooth"};
|
|
- private Icon[] field_94406_c;
|
|
- private Icon field_94403_cO;
|
|
- private Icon field_94404_cP;
|
|
|
|
public BlockSandStone(int par1)
|
|
{
|
|
super(par1, Material.rock);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par1 != 1 && (par1 != 0 || par2 != 1 && par2 != 2))
|
|
- {
|
|
- if (par1 == 0)
|
|
- {
|
|
- return this.field_94404_cP;
|
|
- }
|
|
- else
|
|
- {
|
|
- if (par2 < 0 || par2 >= this.field_94406_c.length)
|
|
- {
|
|
- par2 = 0;
|
|
- }
|
|
-
|
|
- return this.field_94406_c[par2];
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- return this.field_94403_cO;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int par1)
|
|
{
|
|
return par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- par3List.add(new ItemStack(par1, 1, 2));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_94406_c = new Icon[field_94405_b.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.field_94406_c.length; ++var2)
|
|
- {
|
|
- this.field_94406_c[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + field_94405_b[var2]);
|
|
- }
|
|
-
|
|
- this.field_94403_cO = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.field_94404_cP = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");
|
|
}
|
|
}
|
|
--- 1,21 ----
|
|
*** BlockSapling.java Sat Feb 5 04:19:38 2022
|
|
--- BlockSapling.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,14 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockSapling extends BlockFlower
|
|
{
|
|
public static final String[] WOOD_TYPES = new String[] {"oak", "spruce", "birch", "jungle"};
|
|
- private Icon[] saplingIcon;
|
|
|
|
protected BlockSapling(int par1)
|
|
{
|
|
super(par1);
|
|
float var2 = 0.4F;
|
|
--- 1,12 ----
|
|
***************
|
|
*** 30,55 ****
|
|
this.markOrGrowMarked(par1World, par2, par3, par4, par5Random);
|
|
}
|
|
}
|
|
}
|
|
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- par2 &= 3;
|
|
- return this.saplingIcon[par2];
|
|
- }
|
|
-
|
|
public void markOrGrowMarked(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if ((var6 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 | 8, 4);
|
|
}
|
|
else
|
|
{
|
|
this.growTree(par1World, par2, par3, par4, par5Random);
|
|
}
|
|
--- 28,44 ----
|
|
this.markOrGrowMarked(par1World, par2, par3, par4, par5Random);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void markOrGrowMarked(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
{
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if ((var6 & 8) == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 | 8, 4);
|
|
}
|
|
else
|
|
{
|
|
this.growTree(par1World, par2, par3, par4, par5Random);
|
|
}
|
|
***************
|
|
*** 151,182 ****
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int par1)
|
|
{
|
|
return par1 & 3;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- par3List.add(new ItemStack(par1, 1, 2));
|
|
- par3List.add(new ItemStack(par1, 1, 3));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.saplingIcon = new Icon[WOOD_TYPES.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.saplingIcon.length; ++var2)
|
|
- {
|
|
- this.saplingIcon[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + WOOD_TYPES[var2]);
|
|
- }
|
|
}
|
|
}
|
|
--- 140,146 ----
|
|
*** BlockSign.java Sat Feb 5 04:19:38 2022
|
|
--- BlockSign.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 18,53 ****
|
|
float var5 = 1.0F;
|
|
this.setBlockBounds(0.5F - var4, 0.0F, 0.5F - var4, 0.5F + var4, var5, 0.5F + var4);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return Block.planks.getBlockTextureFromSide(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
* cleared to be reused)
|
|
*/
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
- return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
* Updates the blocks bounds based on its current state. Args: world, x, y, z
|
|
*/
|
|
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
{
|
|
if (!this.isFreestanding)
|
|
--- 18,36 ----
|
|
***************
|
|
*** 182,201 ****
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
|
|
super.onNeighborBlockChange(par1World, par2, par3, par4, par5);
|
|
}
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.sign.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 165,170 ----
|
|
*** BlockSilverfish.java Sat Feb 5 04:19:38 2022
|
|
--- BlockSilverfish.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,8 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockSilverfish extends Block
|
|
{
|
|
/** Block names that can be a silverfish stone. */
|
|
--- 1,7 ----
|
|
***************
|
|
*** 14,37 ****
|
|
this.setHardness(0.0F);
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par2 == 1 ? Block.cobblestone.getBlockTextureFromSide(par1) : (par2 == 2 ? Block.stoneBrick.getBlockTextureFromSide(par1) : Block.stone.getBlockTextureFromSide(par1));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
-
|
|
- /**
|
|
* Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
|
|
*/
|
|
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
if (!par1World.isRemote)
|
|
--- 13,22 ----
|
|
***************
|
|
*** 95,112 ****
|
|
* Get the block's damage value (for use with pick block).
|
|
*/
|
|
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return par1World.getBlockMetadata(par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- for (int var4 = 0; var4 < 3; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
}
|
|
}
|
|
--- 80,86 ----
|
|
*** BlockSkull.java Sat Feb 5 04:19:38 2022
|
|
--- BlockSkull.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 80,90 ****
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
|
*/
|
|
--- 80,90 ----
|
|
* Called when the block is placed in the world.
|
|
*/
|
|
public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
|
|
{
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
}
|
|
|
|
/**
|
|
* Returns a new instance of a block's tile entity class. Called on placing the block.
|
|
*/
|
|
***************
|
|
*** 92,109 ****
|
|
{
|
|
return new TileEntitySkull();
|
|
}
|
|
|
|
/**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.skull.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
* Get the block's damage value (for use with pick block).
|
|
*/
|
|
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
{
|
|
TileEntity var5 = par1World.getBlockTileEntity(par2, par3, par4);
|
|
--- 92,101 ----
|
|
***************
|
|
*** 129,139 ****
|
|
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
|
|
{
|
|
if (par6EntityPlayer.capabilities.isCreativeMode)
|
|
{
|
|
par5 |= 8;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5, 4);
|
|
}
|
|
|
|
super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
|
|
}
|
|
|
|
--- 121,131 ----
|
|
public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer)
|
|
{
|
|
if (par6EntityPlayer.capabilities.isCreativeMode)
|
|
{
|
|
par5 |= 8;
|
|
! par1World.setBlockMetadata(par2, par3, par4, par5, 4);
|
|
}
|
|
|
|
super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer);
|
|
}
|
|
|
|
***************
|
|
*** 186,198 ****
|
|
|
|
for (var7 = -2; var7 <= 0; ++var7)
|
|
{
|
|
if (par1World.getBlockId(par2, par3 - 1, par4 + var7) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 2, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 2) == var6 && this.func_82528_d(par1World, par2, par3, par4 + var7, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 1, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 2, 1))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7, 8, 2);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 1, 8, 2);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4 + var7 + 2, 8, 2);
|
|
par1World.setBlock(par2, par3, par4 + var7, 0, 0, 2);
|
|
par1World.setBlock(par2, par3, par4 + var7 + 1, 0, 0, 2);
|
|
par1World.setBlock(par2, par3, par4 + var7 + 2, 0, 0, 2);
|
|
par1World.setBlock(par2, par3 - 1, par4 + var7, 0, 0, 2);
|
|
par1World.setBlock(par2, par3 - 1, par4 + var7 + 1, 0, 0, 2);
|
|
--- 178,190 ----
|
|
|
|
for (var7 = -2; var7 <= 0; ++var7)
|
|
{
|
|
if (par1World.getBlockId(par2, par3 - 1, par4 + var7) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 2, par4 + var7 + 1) == var6 && par1World.getBlockId(par2, par3 - 1, par4 + var7 + 2) == var6 && this.func_82528_d(par1World, par2, par3, par4 + var7, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 1, 1) && this.func_82528_d(par1World, par2, par3, par4 + var7 + 2, 1))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4 + var7, 8, 2);
|
|
! par1World.setBlockMetadata(par2, par3, par4 + var7 + 1, 8, 2);
|
|
! par1World.setBlockMetadata(par2, par3, par4 + var7 + 2, 8, 2);
|
|
par1World.setBlock(par2, par3, par4 + var7, 0, 0, 2);
|
|
par1World.setBlock(par2, par3, par4 + var7 + 1, 0, 0, 2);
|
|
par1World.setBlock(par2, par3, par4 + var7 + 2, 0, 0, 2);
|
|
par1World.setBlock(par2, par3 - 1, par4 + var7, 0, 0, 2);
|
|
par1World.setBlock(par2, par3 - 1, par4 + var7 + 1, 0, 0, 2);
|
|
***************
|
|
*** 226,238 ****
|
|
|
|
for (var7 = -2; var7 <= 0; ++var7)
|
|
{
|
|
if (par1World.getBlockId(par2 + var7, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 2, par4) == var6 && par1World.getBlockId(par2 + var7 + 2, par3 - 1, par4) == var6 && this.func_82528_d(par1World, par2 + var7, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 1, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 2, par3, par4, 1))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2 + var7, par3, par4, 8, 2);
|
|
! par1World.setBlockMetadataWithNotify(par2 + var7 + 1, par3, par4, 8, 2);
|
|
! par1World.setBlockMetadataWithNotify(par2 + var7 + 2, par3, par4, 8, 2);
|
|
par1World.setBlock(par2 + var7, par3, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7 + 1, par3, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7 + 2, par3, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7, par3 - 1, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7 + 1, par3 - 1, par4, 0, 0, 2);
|
|
--- 218,230 ----
|
|
|
|
for (var7 = -2; var7 <= 0; ++var7)
|
|
{
|
|
if (par1World.getBlockId(par2 + var7, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 1, par4) == var6 && par1World.getBlockId(par2 + var7 + 1, par3 - 2, par4) == var6 && par1World.getBlockId(par2 + var7 + 2, par3 - 1, par4) == var6 && this.func_82528_d(par1World, par2 + var7, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 1, par3, par4, 1) && this.func_82528_d(par1World, par2 + var7 + 2, par3, par4, 1))
|
|
{
|
|
! par1World.setBlockMetadata(par2 + var7, par3, par4, 8, 2);
|
|
! par1World.setBlockMetadata(par2 + var7 + 1, par3, par4, 8, 2);
|
|
! par1World.setBlockMetadata(par2 + var7 + 2, par3, par4, 8, 2);
|
|
par1World.setBlock(par2 + var7, par3, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7 + 1, par3, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7 + 2, par3, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7, par3 - 1, par4, 0, 0, 2);
|
|
par1World.setBlock(par2 + var7 + 1, par3 - 1, par4, 0, 0, 2);
|
|
***************
|
|
*** 274,302 ****
|
|
else
|
|
{
|
|
TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
|
|
return var6 != null && var6 instanceof TileEntitySkull ? ((TileEntitySkull)var6).getSkullType() == par5 : false;
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return Block.slowSand.getBlockTextureFromSide(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the icon name of the ItemBlock corresponding to this block. Used by hoppers.
|
|
- */
|
|
- public String getItemIconName()
|
|
- {
|
|
- return this.getTextureName() + "_" + ItemSkull.field_94587_a[0];
|
|
}
|
|
}
|
|
--- 266,272 ----
|
|
*** BlockSnow.java Sat Feb 5 04:19:38 2022
|
|
--- BlockSnow.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 12,30 ****
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
this.setBlockBoundsForSnowDepth(0);
|
|
}
|
|
|
|
/**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("snow");
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
* cleared to be reused)
|
|
*/
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
{
|
|
--- 12,21 ----
|
|
***************
|
|
*** 148,163 ****
|
|
if (par1World.getSavedLightValue(EnumSkyBlock.Block, par2, par3, par4) > 11)
|
|
{
|
|
this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0);
|
|
par1World.setBlockToAir(par2, par3, par4);
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return par5 == 1 ? true : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
|
}
|
|
}
|
|
--- 139,145 ----
|
|
*** BlockStairs.java Sat Feb 5 04:19:38 2022
|
|
--- BlockStairs.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 355,372 ****
|
|
|
|
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
|
}
|
|
|
|
/**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- this.modelBlock.randomDisplayTick(par1World, par2, par3, par4, par5Random);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
|
|
*/
|
|
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
|
|
{
|
|
this.modelBlock.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer);
|
|
--- 355,364 ----
|
|
***************
|
|
*** 379,444 ****
|
|
{
|
|
this.modelBlock.onBlockDestroyedByPlayer(par1World, par2, par3, par4, par5);
|
|
}
|
|
|
|
/**
|
|
- * Goes straight to getLightBrightnessForSkyBlocks for Blocks, does some fancy computing for Fluids
|
|
- */
|
|
- public int getMixedBrightnessForBlock(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return this.modelBlock.getMixedBrightnessForBlock(par1IBlockAccess, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
- * How bright to render this block based on the light its receiving. Args: iBlockAccess, x, y, z
|
|
- */
|
|
- public float getBlockBrightness(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return this.modelBlock.getBlockBrightness(par1IBlockAccess, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns how much this block can resist explosions from the passed in entity.
|
|
*/
|
|
public float getExplosionResistance(Entity par1Entity)
|
|
{
|
|
return this.modelBlock.getExplosionResistance(par1Entity);
|
|
}
|
|
|
|
/**
|
|
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
- */
|
|
- public int getRenderBlockPass()
|
|
- {
|
|
- return this.modelBlock.getRenderBlockPass();
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return this.modelBlock.getIcon(par1, this.modelBlockMetadata);
|
|
- }
|
|
-
|
|
- /**
|
|
* How many world ticks before ticking
|
|
*/
|
|
public int tickRate(World par1World)
|
|
{
|
|
return this.modelBlock.tickRate(par1World);
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return this.modelBlock.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
* Can add to the passed in vector for a movement vector to be applied to the entity. Args: x, y, z, entity, vec3d
|
|
*/
|
|
public void velocityToAddToEntity(World par1World, int par2, int par3, int par4, Entity par5Entity, Vec3 par6Vec3)
|
|
{
|
|
this.modelBlock.velocityToAddToEntity(par1World, par2, par3, par4, par5Entity, par6Vec3);
|
|
--- 371,396 ----
|
|
***************
|
|
*** 451,462 ****
|
|
{
|
|
return this.modelBlock.isCollidable();
|
|
}
|
|
|
|
/**
|
|
! * Returns whether this block is collideable based on the arguments passed in \n@param par1 block metaData \n@param
|
|
! * par2 whether the player right-clicked while holding a boat
|
|
*/
|
|
public boolean canCollideCheck(int par1, boolean par2)
|
|
{
|
|
return this.modelBlock.canCollideCheck(par1, par2);
|
|
}
|
|
--- 403,413 ----
|
|
{
|
|
return this.modelBlock.isCollidable();
|
|
}
|
|
|
|
/**
|
|
! * Returns whether this block is collideable based on the arguments passed in Args: blockMetaData, unknownFlag
|
|
*/
|
|
public boolean canCollideCheck(int par1, boolean par2)
|
|
{
|
|
return this.modelBlock.canCollideCheck(par1, par2);
|
|
}
|
|
***************
|
|
*** 528,553 ****
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
|
int var8 = par1World.getBlockMetadata(par2, par3, par4) & 4;
|
|
|
|
if (var7 == 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2 | var8, 2);
|
|
}
|
|
|
|
if (var7 == 1)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1 | var8, 2);
|
|
}
|
|
|
|
if (var7 == 2)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3 | var8, 2);
|
|
}
|
|
|
|
if (var7 == 3)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 0 | var8, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
|
|
--- 479,504 ----
|
|
int var7 = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
|
int var8 = par1World.getBlockMetadata(par2, par3, par4) & 4;
|
|
|
|
if (var7 == 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 2 | var8, 2);
|
|
}
|
|
|
|
if (var7 == 1)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 1 | var8, 2);
|
|
}
|
|
|
|
if (var7 == 2)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 3 | var8, 2);
|
|
}
|
|
|
|
if (var7 == 3)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 0 | var8, 2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Called when a block is placed using its ItemBlock. Args: World, X, Y, Z, side, hitX, hitY, hitZ, block metadata
|
|
***************
|
|
*** 622,633 ****
|
|
}
|
|
}
|
|
|
|
return var22;
|
|
}
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 573,578 ----
|
|
*** BlockStem.java Sat Feb 5 04:19:38 2022
|
|
--- BlockStem.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,14 ****
|
|
|
|
public class BlockStem extends BlockFlower
|
|
{
|
|
/** Defines if it is a Melon or a Pumpkin that the stem is producing. */
|
|
private final Block fruitType;
|
|
- private Icon theIcon;
|
|
|
|
protected BlockStem(int par1, Block par2Block)
|
|
{
|
|
super(par1);
|
|
this.fruitType = par2Block;
|
|
--- 4,13 ----
|
|
***************
|
|
*** 43,53 ****
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 < 7)
|
|
{
|
|
++var7;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var7, 2);
|
|
}
|
|
else
|
|
{
|
|
if (par1World.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID)
|
|
{
|
|
--- 42,52 ----
|
|
int var7 = par1World.getBlockMetadata(par2, par3, par4);
|
|
|
|
if (var7 < 7)
|
|
{
|
|
++var7;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var7, 2);
|
|
}
|
|
else
|
|
{
|
|
if (par1World.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID)
|
|
{
|
|
***************
|
|
*** 111,121 ****
|
|
if (var5 > 7)
|
|
{
|
|
var5 = 7;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2);
|
|
}
|
|
|
|
private float getGrowthModifier(World par1World, int par2, int par3, int par4)
|
|
{
|
|
float var5 = 1.0F;
|
|
--- 110,120 ----
|
|
if (var5 > 7)
|
|
{
|
|
var5 = 7;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(par2, par3, par4, var5, 2);
|
|
}
|
|
|
|
private float getGrowthModifier(World par1World, int par2, int par3, int par4)
|
|
{
|
|
float var5 = 1.0F;
|
|
***************
|
|
*** 164,193 ****
|
|
|
|
return var5;
|
|
}
|
|
|
|
/**
|
|
- * Returns the color this block should be rendered. Used by leaves.
|
|
- */
|
|
- public int getRenderColor(int par1)
|
|
- {
|
|
- int var2 = par1 * 32;
|
|
- int var3 = 255 - par1 * 8;
|
|
- int var4 = par1 * 4;
|
|
- return var2 << 16 | var3 << 8 | var4;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return this.getRenderColor(par1IBlockAccess.getBlockMetadata(par2, par3, par4));
|
|
- }
|
|
-
|
|
- /**
|
|
* Sets the block's bounds for rendering it as an item
|
|
*/
|
|
public void setBlockBoundsForItemRender()
|
|
{
|
|
float var1 = 0.125F;
|
|
--- 163,172 ----
|
|
***************
|
|
*** 211,230 ****
|
|
{
|
|
return 19;
|
|
}
|
|
|
|
/**
|
|
- * Returns the current state of the stem. Returns -1 if the stem is not fully grown, or a value between 0 and 3
|
|
- * based on the direction the stem is facing.
|
|
- */
|
|
- public int getState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
|
- return var5 < 7 ? -1 : (par1IBlockAccess.getBlockId(par2 - 1, par3, par4) == this.fruitType.blockID ? 0 : (par1IBlockAccess.getBlockId(par2 + 1, par3, par4) == this.fruitType.blockID ? 1 : (par1IBlockAccess.getBlockId(par2, par3, par4 - 1) == this.fruitType.blockID ? 2 : (par1IBlockAccess.getBlockId(par2, par3, par4 + 1) == this.fruitType.blockID ? 3 : -1))));
|
|
- }
|
|
-
|
|
- /**
|
|
* Drops the block items with a specified chance of dropping the specified items
|
|
*/
|
|
public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
|
|
{
|
|
super.dropBlockAsItemWithChance(par1World, par2, par3, par4, par5, par6, par7);
|
|
--- 190,199 ----
|
|
***************
|
|
*** 265,294 ****
|
|
* Returns the quantity of items to drop on block destruction.
|
|
*/
|
|
public int quantityDropped(Random par1Random)
|
|
{
|
|
return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return this.fruitType == Block.pumpkin ? Item.pumpkinSeeds.itemID : (this.fruitType == Block.melon ? Item.melonSeeds.itemID : 0);
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_disconnected");
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getTextureName() + "_connected");
|
|
- }
|
|
-
|
|
- public Icon getStemIcon()
|
|
- {
|
|
- return this.theIcon;
|
|
}
|
|
}
|
|
--- 234,240 ----
|
|
*** BlockStep.java Sat Feb 5 04:19:38 2022
|
|
--- BlockStep.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,48 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockStep extends BlockHalfSlab
|
|
{
|
|
/** The list of the types of step blocks. */
|
|
public static final String[] blockStepTypes = new String[] {"stone", "sand", "wood", "cobble", "brick", "smoothStoneBrick", "netherBrick", "quartz"};
|
|
- private Icon theIcon;
|
|
|
|
public BlockStep(int par1, boolean par2)
|
|
{
|
|
super(par1, par2, Material.rock);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- int var3 = par2 & 7;
|
|
-
|
|
- if (this.isDoubleSlab && (par2 & 8) != 0)
|
|
- {
|
|
- par1 = 1;
|
|
- }
|
|
-
|
|
- return var3 == 0 ? (par1 != 1 && par1 != 0 ? this.theIcon : this.blockIcon) : (var3 == 1 ? Block.sandStone.getBlockTextureFromSide(par1) : (var3 == 2 ? Block.planks.getBlockTextureFromSide(par1) : (var3 == 3 ? Block.cobblestone.getBlockTextureFromSide(par1) : (var3 == 4 ? Block.brick.getBlockTextureFromSide(par1) : (var3 == 5 ? Block.stoneBrick.getIcon(par1, 0) : (var3 == 6 ? Block.netherBrick.getBlockTextureFromSide(1) : (var3 == 7 ? Block.blockNetherQuartz.getBlockTextureFromSide(par1) : this.blockIcon)))))));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon("stone_slab_top");
|
|
- this.theIcon = par1IconRegister.registerIcon("stone_slab_side");
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Block.stoneSingleSlab.blockID;
|
|
--- 1,21 ----
|
|
***************
|
|
*** 66,89 ****
|
|
{
|
|
par1 = 0;
|
|
}
|
|
|
|
return super.getUnlocalizedName() + "." + blockStepTypes[par1];
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- if (par1 != Block.stoneDoubleSlab.blockID)
|
|
- {
|
|
- for (int var4 = 0; var4 <= 7; ++var4)
|
|
- {
|
|
- if (var4 != 2)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
- }
|
|
}
|
|
}
|
|
--- 39,45 ----
|
|
*** BlockStoneBrick.java Sat Feb 5 04:19:38 2022
|
|
--- BlockStoneBrick.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,69 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockStoneBrick extends Block
|
|
{
|
|
public static final String[] STONE_BRICK_TYPES = new String[] {"default", "mossy", "cracked", "chiseled"};
|
|
public static final String[] field_94407_b = new String[] {null, "mossy", "cracked", "carved"};
|
|
- private Icon[] field_94408_c;
|
|
|
|
public BlockStoneBrick(int par1)
|
|
{
|
|
super(par1, Material.rock);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par2 < 0 || par2 >= field_94407_b.length)
|
|
- {
|
|
- par2 = 0;
|
|
- }
|
|
-
|
|
- return this.field_94408_c[par2];
|
|
- }
|
|
-
|
|
- /**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int par1)
|
|
{
|
|
return par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- for (int var4 = 0; var4 < 4; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_94408_c = new Icon[field_94407_b.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.field_94408_c.length; ++var2)
|
|
- {
|
|
- String var3 = this.getTextureName();
|
|
-
|
|
- if (field_94407_b[var2] != null)
|
|
- {
|
|
- var3 = var3 + "_" + field_94407_b[var2];
|
|
- }
|
|
-
|
|
- this.field_94408_c[var2] = par1IconRegister.registerIcon(var3);
|
|
- }
|
|
}
|
|
}
|
|
--- 1,21 ----
|
|
*** BlockTallGrass.java Sat Feb 5 04:19:38 2022
|
|
--- BlockTallGrass.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,61 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockTallGrass extends BlockFlower
|
|
{
|
|
private static final String[] grassTypes = new String[] {"deadbush", "tallgrass", "fern"};
|
|
- private Icon[] iconArray;
|
|
|
|
protected BlockTallGrass(int par1)
|
|
{
|
|
super(par1, Material.vine);
|
|
float var2 = 0.4F;
|
|
this.setBlockBounds(0.5F - var2, 0.0F, 0.5F - var2, 0.5F + var2, 0.8F, 0.5F + var2);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par2 >= this.iconArray.length)
|
|
- {
|
|
- par2 = 0;
|
|
- }
|
|
-
|
|
- return this.iconArray[par2];
|
|
- }
|
|
-
|
|
- public int getBlockColor()
|
|
- {
|
|
- double var1 = 0.5D;
|
|
- double var3 = 1.0D;
|
|
- return ColorizerGrass.getGrassColor(var1, var3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the color this block should be rendered. Used by leaves.
|
|
- */
|
|
- public int getRenderColor(int par1)
|
|
- {
|
|
- return par1 == 0 ? 16777215 : ColorizerFoliage.getFoliageColorBasic();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = par1IBlockAccess.getBlockMetadata(par2, par3, par4);
|
|
- return var5 == 0 ? 16777215 : par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeGrassColor();
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return par2Random.nextInt(8) == 0 ? Item.seeds.itemID : -1;
|
|
--- 1,21 ----
|
|
***************
|
|
*** 90,121 ****
|
|
* Get the block's damage value (for use with pick block).
|
|
*/
|
|
public int getDamageValue(World par1World, int par2, int par3, int par4)
|
|
{
|
|
return par1World.getBlockMetadata(par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- for (int var4 = 1; var4 < 3; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[grassTypes.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(grassTypes[var2]);
|
|
- }
|
|
}
|
|
}
|
|
--- 50,56 ----
|
|
*** BlockTNT.java Sat Feb 5 04:19:38 2022
|
|
--- BlockTNT.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 2,29 ****
|
|
|
|
import java.util.Random;
|
|
|
|
public class BlockTNT extends Block
|
|
{
|
|
- private Icon field_94393_a;
|
|
- private Icon field_94392_b;
|
|
-
|
|
public BlockTNT(int par1)
|
|
{
|
|
super(par1, Material.tnt);
|
|
this.setCreativeTab(CreativeTabs.tabRedstone);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 0 ? this.field_94392_b : (par1 == 1 ? this.field_94393_a : this.blockIcon);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
*/
|
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
{
|
|
super.onBlockAdded(par1World, par2, par3, par4);
|
|
--- 2,18 ----
|
|
***************
|
|
*** 132,149 ****
|
|
* Return whether this block can drop from an explosion.
|
|
*/
|
|
public boolean canDropFromExplosion(Explosion par1Explosion)
|
|
{
|
|
return false;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.field_94393_a = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.field_94392_b = par1IconRegister.registerIcon(this.getTextureName() + "_bottom");
|
|
}
|
|
}
|
|
--- 121,127 ----
|
|
*** BlockTorch.java Sat Feb 5 04:19:38 2022
|
|
--- BlockTorch.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 124,150 ****
|
|
{
|
|
if (par1World.getBlockMetadata(par2, par3, par4) == 0)
|
|
{
|
|
if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, 2);
|
|
}
|
|
else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);
|
|
}
|
|
else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
|
|
}
|
|
else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2);
|
|
}
|
|
else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2);
|
|
}
|
|
}
|
|
|
|
this.dropTorchIfCantStay(par1World, par2, par3, par4);
|
|
}
|
|
--- 124,150 ----
|
|
{
|
|
if (par1World.getBlockMetadata(par2, par3, par4) == 0)
|
|
{
|
|
if (par1World.isBlockNormalCubeDefault(par2 - 1, par3, par4, true))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 1, 2);
|
|
}
|
|
else if (par1World.isBlockNormalCubeDefault(par2 + 1, par3, par4, true))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 2, 2);
|
|
}
|
|
else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 - 1, true))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 3, 2);
|
|
}
|
|
else if (par1World.isBlockNormalCubeDefault(par2, par3, par4 + 1, true))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 4, 2);
|
|
}
|
|
else if (this.canPlaceTorchOn(par1World, par2, par3 - 1, par4))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, 5, 2);
|
|
}
|
|
}
|
|
|
|
this.dropTorchIfCantStay(par1World, par2, par3, par4);
|
|
}
|
|
***************
|
|
*** 259,304 ****
|
|
var8 = 0.1F;
|
|
this.setBlockBounds(0.5F - var8, 0.0F, 0.5F - var8, 0.5F + var8, 0.6F, 0.5F + var8);
|
|
}
|
|
|
|
return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * A randomly called display update to be able to add particles or other items for display
|
|
- */
|
|
- public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
|
|
- {
|
|
- int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
- double var7 = (double)((float)par2 + 0.5F);
|
|
- double var9 = (double)((float)par3 + 0.7F);
|
|
- double var11 = (double)((float)par4 + 0.5F);
|
|
- double var13 = 0.2199999988079071D;
|
|
- double var15 = 0.27000001072883606D;
|
|
-
|
|
- if (var6 == 1)
|
|
- {
|
|
- par1World.spawnParticle("smoke", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
|
|
- par1World.spawnParticle("flame", var7 - var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else if (var6 == 2)
|
|
- {
|
|
- par1World.spawnParticle("smoke", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
|
|
- par1World.spawnParticle("flame", var7 + var15, var9 + var13, var11, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else if (var6 == 3)
|
|
- {
|
|
- par1World.spawnParticle("smoke", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D);
|
|
- par1World.spawnParticle("flame", var7, var9 + var13, var11 - var15, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else if (var6 == 4)
|
|
- {
|
|
- par1World.spawnParticle("smoke", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D);
|
|
- par1World.spawnParticle("flame", var7, var9 + var13, var11 + var15, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- else
|
|
- {
|
|
- par1World.spawnParticle("smoke", var7, var9, var11, 0.0D, 0.0D, 0.0D);
|
|
- par1World.spawnParticle("flame", var7, var9, var11, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
}
|
|
}
|
|
--- 259,265 ----
|
|
*** BlockTrapDoor.java Sat Feb 5 04:19:38 2022
|
|
--- BlockTrapDoor.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 40,58 ****
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
- * Returns the bounding box of the wired rectangular prism to render.
|
|
- */
|
|
- public AxisAlignedBB getSelectedBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- this.setBlockBoundsBasedOnState(par1World, par2, par3, par4);
|
|
- return super.getSelectedBoundingBoxFromPool(par1World, par2, par3, par4);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
|
|
* cleared to be reused)
|
|
*/
|
|
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
|
|
{
|
|
--- 40,49 ----
|
|
***************
|
|
*** 129,139 ****
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var10 ^ 4, 2);
|
|
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
--- 120,130 ----
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
int var10 = par1World.getBlockMetadata(par2, par3, par4);
|
|
! par1World.setBlockMetadata(par2, par3, par4, var10 ^ 4, 2);
|
|
par1World.playAuxSFXAtEntity(par5EntityPlayer, 1003, par2, par3, par4, 0);
|
|
return true;
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 142,152 ****
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
boolean var7 = (var6 & 4) > 0;
|
|
|
|
if (var7 != par5)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6 ^ 4, 2);
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 133,143 ----
|
|
int var6 = par1World.getBlockMetadata(par2, par3, par4);
|
|
boolean var7 = (var6 & 4) > 0;
|
|
|
|
if (var7 != par5)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6 ^ 4, 2);
|
|
par1World.playAuxSFXAtEntity((EntityPlayer)null, 1003, par2, par3, par4, 0);
|
|
}
|
|
}
|
|
|
|
/**
|
|
*** BlockTripWire.java Sat Feb 5 04:19:38 2022
|
|
--- BlockTripWire.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 46,63 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * Returns which pass should this block be rendered on. 0 for solids and 1 for alpha
|
|
- */
|
|
- public int getRenderBlockPass()
|
|
- {
|
|
- return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 30;
|
|
--- 46,55 ----
|
|
***************
|
|
*** 70,87 ****
|
|
{
|
|
return Item.silk.itemID;
|
|
}
|
|
|
|
/**
|
|
- * only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
|
|
- */
|
|
- public int idPicked(World par1World, int par2, int par3, int par4)
|
|
- {
|
|
- return Item.silk.itemID;
|
|
- }
|
|
-
|
|
- /**
|
|
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
|
* their own) Args: x, y, z, neighbor blockID
|
|
*/
|
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
|
{
|
|
--- 62,71 ----
|
|
***************
|
|
*** 123,133 ****
|
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
*/
|
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
{
|
|
int var5 = par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? 0 : 2;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3);
|
|
this.func_72149_e(par1World, par2, par3, par4, var5);
|
|
}
|
|
|
|
/**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
--- 107,117 ----
|
|
* Called whenever the block is added into the world. Args: world, x, y, z
|
|
*/
|
|
public void onBlockAdded(World par1World, int par2, int par3, int par4)
|
|
{
|
|
int var5 = par1World.doesBlockHaveSolidTopSurface(par2, par3 - 1, par4) ? 0 : 2;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var5, 3);
|
|
this.func_72149_e(par1World, par2, par3, par4, var5);
|
|
}
|
|
|
|
/**
|
|
* Called on server worlds only when the block has been replaced by a different block ID, or the same block with a
|
|
***************
|
|
*** 146,156 ****
|
|
{
|
|
if (!par1World.isRemote)
|
|
{
|
|
if (par6EntityPlayer.getCurrentEquippedItem() != null && par6EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par5 | 8, 4);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void func_72149_e(World par1World, int par2, int par3, int par4, int par5)
|
|
--- 130,140 ----
|
|
{
|
|
if (!par1World.isRemote)
|
|
{
|
|
if (par6EntityPlayer.getCurrentEquippedItem() != null && par6EntityPlayer.getCurrentEquippedItem().itemID == Item.shears.itemID)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, par5 | 8, 4);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void func_72149_e(World par1World, int par2, int par3, int par4, int par5)
|
|
***************
|
|
*** 252,292 ****
|
|
var5 &= -2;
|
|
}
|
|
|
|
if (var7 != var6)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 3);
|
|
this.func_72149_e(par1World, par2, par3, par4, var5);
|
|
}
|
|
|
|
if (var7)
|
|
{
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
- }
|
|
- }
|
|
-
|
|
- public static boolean func_72148_a(IBlockAccess par0IBlockAccess, int par1, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- int var6 = par1 + Direction.offsetX[par5];
|
|
- int var8 = par3 + Direction.offsetZ[par5];
|
|
- int var9 = par0IBlockAccess.getBlockId(var6, par2, var8);
|
|
- boolean var10 = (par4 & 2) == 2;
|
|
- int var11;
|
|
-
|
|
- if (var9 == Block.tripWireSource.blockID)
|
|
- {
|
|
- var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8);
|
|
- int var13 = var11 & 3;
|
|
- return var13 == Direction.rotateOpposite[par5];
|
|
- }
|
|
- else if (var9 == Block.tripWire.blockID)
|
|
- {
|
|
- var11 = par0IBlockAccess.getBlockMetadata(var6, par2, var8);
|
|
- boolean var12 = (var11 & 2) == 2;
|
|
- return var10 == var12;
|
|
- }
|
|
- else
|
|
- {
|
|
- return false;
|
|
}
|
|
}
|
|
}
|
|
--- 236,250 ----
|
|
var5 &= -2;
|
|
}
|
|
|
|
if (var7 != var6)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var5, 3);
|
|
this.func_72149_e(par1World, par2, par3, par4, var5);
|
|
}
|
|
|
|
if (var7)
|
|
{
|
|
par1World.scheduleBlockUpdate(par2, par3, par4, this.blockID, this.tickRate(par1World));
|
|
}
|
|
}
|
|
}
|
|
*** BlockTripWireSource.java Sat Feb 5 04:19:38 2022
|
|
--- BlockTripWireSource.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 217,236 ****
|
|
if (var18 > 0)
|
|
{
|
|
var21 = par2 + var16 * var18;
|
|
var22 = par4 + var17 * var18;
|
|
var23 = Direction.rotateOpposite[var10];
|
|
! par1World.setBlockMetadataWithNotify(var21, par3, var22, var23 | var20, 3);
|
|
this.notifyNeighborOfChange(par1World, var21, par3, var22, var23);
|
|
this.playSoundEffect(par1World, var21, par3, var22, var13, var14, var11, var12);
|
|
}
|
|
|
|
this.playSoundEffect(par1World, par2, par3, par4, var13, var14, var11, var12);
|
|
|
|
if (par5 > 0)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, par6, 3);
|
|
|
|
if (par7)
|
|
{
|
|
this.notifyNeighborOfChange(par1World, par2, par3, par4, var10);
|
|
}
|
|
--- 217,236 ----
|
|
if (var18 > 0)
|
|
{
|
|
var21 = par2 + var16 * var18;
|
|
var22 = par4 + var17 * var18;
|
|
var23 = Direction.rotateOpposite[var10];
|
|
! par1World.setBlockMetadata(var21, par3, var22, var23 | var20, 3);
|
|
this.notifyNeighborOfChange(par1World, var21, par3, var22, var23);
|
|
this.playSoundEffect(par1World, var21, par3, var22, var13, var14, var11, var12);
|
|
}
|
|
|
|
this.playSoundEffect(par1World, par2, par3, par4, var13, var14, var11, var12);
|
|
|
|
if (par5 > 0)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, par6, 3);
|
|
|
|
if (par7)
|
|
{
|
|
this.notifyNeighborOfChange(par1World, par2, par3, par4, var10);
|
|
}
|
|
***************
|
|
*** 253,263 ****
|
|
else
|
|
{
|
|
var24 &= -5;
|
|
}
|
|
|
|
! par1World.setBlockMetadataWithNotify(var22, par3, var23, var24, 3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 253,263 ----
|
|
else
|
|
{
|
|
var24 &= -5;
|
|
}
|
|
|
|
! par1World.setBlockMetadata(var22, par3, var23, var24, 3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
*** BlockVine.java Sat Feb 5 04:19:38 2022
|
|
--- BlockVine.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 195,233 ****
|
|
}
|
|
else
|
|
{
|
|
if (var6 != var5)
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var6, 2);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
- public int getBlockColor()
|
|
- {
|
|
- return ColorizerFoliage.getFoliageColorBasic();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the color this block should be rendered. Used by leaves.
|
|
- */
|
|
- public int getRenderColor(int par1)
|
|
- {
|
|
- return ColorizerFoliage.getFoliageColorBasic();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called
|
|
- * when first determining what to render.
|
|
- */
|
|
- public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
|
|
- {
|
|
- return par1IBlockAccess.getBiomeGenForCoords(par2, par4).getBiomeFoliageColor();
|
|
- }
|
|
-
|
|
/**
|
|
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
|
* their own) Args: x, y, z, neighbor blockID
|
|
*/
|
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
|
--- 195,211 ----
|
|
}
|
|
else
|
|
{
|
|
if (var6 != var5)
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var6, 2);
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
|
|
* their own) Args: x, y, z, neighbor blockID
|
|
*/
|
|
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
|
|
***************
|
|
*** 320,330 ****
|
|
|
|
if (var12 != 0 && Block.blocksList[var12] != null)
|
|
{
|
|
if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock())
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var9 | 1 << var11, 2);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
var13 = var11 + 1 & 3;
|
|
--- 298,308 ----
|
|
|
|
if (var12 != 0 && Block.blocksList[var12] != null)
|
|
{
|
|
if (Block.blocksList[var12].blockMaterial.isOpaque() && Block.blocksList[var12].renderAsNormalBlock())
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3, par4, var9 | 1 << var11, 2);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
var13 = var11 + 1 & 3;
|
|
***************
|
|
*** 370,380 ****
|
|
var13 = par1World.rand.nextInt(16) & var9;
|
|
var14 = par1World.getBlockMetadata(par2, par3 - 1, par4);
|
|
|
|
if (var14 != (var14 | var13))
|
|
{
|
|
! par1World.setBlockMetadataWithNotify(par2, par3 - 1, par4, var14 | var13, 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--- 348,358 ----
|
|
var13 = par1World.rand.nextInt(16) & var9;
|
|
var14 = par1World.getBlockMetadata(par2, par3 - 1, par4);
|
|
|
|
if (var14 != (var14 | var13))
|
|
{
|
|
! par1World.setBlockMetadata(par2, par3 - 1, par4, var14 | var13, 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
*** BlockWall.java Sat Feb 5 04:19:38 2022
|
|
--- BlockWall.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,9 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockWall extends Block
|
|
{
|
|
/** The types of the wall. */
|
|
public static final String[] types = new String[] {"normal", "mossy"};
|
|
|
|
--- 1,7 ----
|
|
***************
|
|
*** 15,32 ****
|
|
this.setStepSound(par2Block.stepSound);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par2 == 1 ? Block.cobblestoneMossy.getBlockTextureFromSide(par1) : Block.cobblestone.getBlockTextureFromSide(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* The type of render function that is called for this block
|
|
*/
|
|
public int getRenderType()
|
|
{
|
|
return 32;
|
|
--- 13,22 ----
|
|
***************
|
|
*** 133,168 ****
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- }
|
|
-
|
|
- /**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int par1)
|
|
{
|
|
return par1;
|
|
}
|
|
-
|
|
- /**
|
|
- * Returns true if the given side of this block type should be rendered, if the adjacent block is at the given
|
|
- * coordinates. Args: blockAccess, x, y, z, side
|
|
- */
|
|
- public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- return par5 == 0 ? super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5) : true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 123,134 ----
|
|
*** BlockWood.java Sat Feb 5 04:19:39 2022
|
|
--- BlockWood.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,62 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class BlockWood extends Block
|
|
{
|
|
/** The type of tree this block came from. */
|
|
public static final String[] woodType = new String[] {"oak", "spruce", "birch", "jungle"};
|
|
- private Icon[] iconArray;
|
|
|
|
public BlockWood(int par1)
|
|
{
|
|
super(par1, Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- if (par2 < 0 || par2 >= this.iconArray.length)
|
|
- {
|
|
- par2 = 0;
|
|
- }
|
|
-
|
|
- return this.iconArray[par2];
|
|
- }
|
|
-
|
|
- /**
|
|
* Determines the damage on the item the block drops. Used in cloth and wood.
|
|
*/
|
|
public int damageDropped(int par1)
|
|
{
|
|
return par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- par3List.add(new ItemStack(par1, 1, 2));
|
|
- par3List.add(new ItemStack(par1, 1, 3));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.iconArray = new Icon[woodType.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getTextureName() + "_" + woodType[var2]);
|
|
- }
|
|
}
|
|
}
|
|
--- 1,21 ----
|
|
*** BlockWoodSlab.java Sat Feb 5 04:19:39 2022
|
|
--- BlockWoodSlab.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,8 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class BlockWoodSlab extends BlockHalfSlab
|
|
{
|
|
/** The type of tree this slab came from. */
|
|
--- 1,7 ----
|
|
***************
|
|
*** 13,30 ****
|
|
super(par1, par2, Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabBlock);
|
|
}
|
|
|
|
/**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return Block.planks.getIcon(par1, par2 & 7);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the ID of the items to drop on destruction.
|
|
*/
|
|
public int idDropped(int par1, Random par2Random, int par3)
|
|
{
|
|
return Block.woodSingleSlab.blockID;
|
|
--- 12,21 ----
|
|
***************
|
|
*** 49,74 ****
|
|
par1 = 0;
|
|
}
|
|
|
|
return super.getUnlocalizedName() + "." + woodType[par1];
|
|
}
|
|
-
|
|
- /**
|
|
- * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
|
|
- */
|
|
- public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- if (par1 != Block.woodDoubleSlab.blockID)
|
|
- {
|
|
- for (int var4 = 0; var4 < 4; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 40,45 ----
|
|
*** BlockWorkbench.java Sat Feb 5 04:19:39 2022
|
|
--- BlockWorkbench.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 1,35 ****
|
|
package net.minecraft.src;
|
|
|
|
public class BlockWorkbench extends Block
|
|
{
|
|
- private Icon workbenchIconTop;
|
|
- private Icon workbenchIconFront;
|
|
-
|
|
protected BlockWorkbench(int par1)
|
|
{
|
|
super(par1, Material.wood);
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
- }
|
|
-
|
|
- /**
|
|
- * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
|
|
- */
|
|
- public Icon getIcon(int par1, int par2)
|
|
- {
|
|
- return par1 == 1 ? this.workbenchIconTop : (par1 == 0 ? Block.planks.getBlockTextureFromSide(par1) : (par1 != 2 && par1 != 4 ? this.blockIcon : this.workbenchIconFront));
|
|
- }
|
|
-
|
|
- /**
|
|
- * When this method is called, your block should register all the icons it needs with the given IconRegister. This
|
|
- * is the only chance you get to register icons.
|
|
- */
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.blockIcon = par1IconRegister.registerIcon(this.getTextureName() + "_side");
|
|
- this.workbenchIconTop = par1IconRegister.registerIcon(this.getTextureName() + "_top");
|
|
- this.workbenchIconFront = par1IconRegister.registerIcon(this.getTextureName() + "_front");
|
|
}
|
|
|
|
/**
|
|
* Called upon block activation (right click on the block.)
|
|
*/
|
|
--- 1,13 ----
|
|
*** ChatMessageComponent.java Sat Feb 5 04:19:39 2022
|
|
--- ChatMessageComponent.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 32,42 ****
|
|
this.field_111091_i = par1ChatMessageComponent.field_111091_i == null ? null : Lists.newArrayList(par1ChatMessageComponent.field_111091_i);
|
|
}
|
|
|
|
public ChatMessageComponent setColor(EnumChatFormatting par1EnumChatFormatting)
|
|
{
|
|
! if (par1EnumChatFormatting != null && !par1EnumChatFormatting.isColor())
|
|
{
|
|
throw new IllegalArgumentException("Argument is not a valid color!");
|
|
}
|
|
else
|
|
{
|
|
--- 32,42 ----
|
|
this.field_111091_i = par1ChatMessageComponent.field_111091_i == null ? null : Lists.newArrayList(par1ChatMessageComponent.field_111091_i);
|
|
}
|
|
|
|
public ChatMessageComponent setColor(EnumChatFormatting par1EnumChatFormatting)
|
|
{
|
|
! if (par1EnumChatFormatting != null && !par1EnumChatFormatting.Checks())
|
|
{
|
|
throw new IllegalArgumentException("Argument is not a valid color!");
|
|
}
|
|
else
|
|
{
|
|
***************
|
|
*** 327,351 ****
|
|
}
|
|
|
|
if (par5)
|
|
{
|
|
par0StringBuilder.append(EnumChatFormatting.OBFUSCATED);
|
|
- }
|
|
- }
|
|
-
|
|
- public static ChatMessageComponent createFromJson(String par0Str)
|
|
- {
|
|
- try
|
|
- {
|
|
- return (ChatMessageComponent)field_111089_a.fromJson(par0Str, ChatMessageComponent.class);
|
|
- }
|
|
- catch (Throwable var4)
|
|
- {
|
|
- CrashReport var2 = CrashReport.makeCrashReport(var4, "Deserializing Message");
|
|
- CrashReportCategory var3 = var2.makeCategory("Serialized Message");
|
|
- var3.addCrashSection("JSON string", par0Str);
|
|
- throw new ReportedException(var2);
|
|
}
|
|
}
|
|
|
|
public static ChatMessageComponent createFromText(String par0Str)
|
|
{
|
|
--- 327,336 ----
|
|
*** Chunk.java Sat Feb 5 04:19:39 2022
|
|
--- Chunk.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 180,229 ****
|
|
{
|
|
return this.storageArrays;
|
|
}
|
|
|
|
/**
|
|
- * Generates the height map for a chunk from scratch
|
|
- */
|
|
- public void generateHeightMap()
|
|
- {
|
|
- int var1 = this.getTopFilledSegment();
|
|
-
|
|
- for (int var2 = 0; var2 < 16; ++var2)
|
|
- {
|
|
- int var3 = 0;
|
|
-
|
|
- while (var3 < 16)
|
|
- {
|
|
- this.precipitationHeightMap[var2 + (var3 << 4)] = -999;
|
|
- int var4 = var1 + 16 - 1;
|
|
-
|
|
- while (true)
|
|
- {
|
|
- if (var4 > 0)
|
|
- {
|
|
- int var5 = this.getBlockID(var2, var4 - 1, var3);
|
|
-
|
|
- if (Block.lightOpacity[var5] == 0)
|
|
- {
|
|
- --var4;
|
|
- continue;
|
|
- }
|
|
-
|
|
- this.heightMap[var3 << 4 | var2] = var4;
|
|
- }
|
|
-
|
|
- ++var3;
|
|
- break;
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- this.isModified = true;
|
|
- }
|
|
-
|
|
- /**
|
|
* Generates the initial skylight map for the chunk upon generation or load.
|
|
*/
|
|
public void generateSkylightMap()
|
|
{
|
|
int var1 = this.getTopFilledSegment();
|
|
--- 180,189 ----
|
|
***************
|
|
*** 543,553 ****
|
|
return var4 != null ? var4.getExtBlockMetadata(par1, par2 & 15, par3) : 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata
|
|
*/
|
|
public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
int var6 = par3 << 4 | par1;
|
|
|
|
--- 503,514 ----
|
|
return var4 != null ? var4.getExtBlockMetadata(par1, par2 & 15, par3) : 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata. Return true if the
|
|
! * id or meta was changed.
|
|
*/
|
|
public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
int var6 = par3 << 4 | par1;
|
|
|
|
***************
|
|
*** 1227,1350 ****
|
|
{
|
|
this.storageArrays = par1ArrayOfExtendedBlockStorage;
|
|
}
|
|
|
|
/**
|
|
- * Initialise this chunk with new binary data
|
|
- */
|
|
- public void fillChunk(byte[] par1ArrayOfByte, int par2, int par3, boolean par4)
|
|
- {
|
|
- int var5 = 0;
|
|
- boolean var6 = !this.worldObj.provider.hasNoSky;
|
|
- int var7;
|
|
-
|
|
- for (var7 = 0; var7 < this.storageArrays.length; ++var7)
|
|
- {
|
|
- if ((par2 & 1 << var7) != 0)
|
|
- {
|
|
- if (this.storageArrays[var7] == null)
|
|
- {
|
|
- this.storageArrays[var7] = new ExtendedBlockStorage(var7 << 4, var6);
|
|
- }
|
|
-
|
|
- byte[] var8 = this.storageArrays[var7].getBlockLSBArray();
|
|
- System.arraycopy(par1ArrayOfByte, var5, var8, 0, var8.length);
|
|
- var5 += var8.length;
|
|
- }
|
|
- else if (par4 && this.storageArrays[var7] != null)
|
|
- {
|
|
- this.storageArrays[var7] = null;
|
|
- }
|
|
- }
|
|
-
|
|
- NibbleArray var9;
|
|
-
|
|
- for (var7 = 0; var7 < this.storageArrays.length; ++var7)
|
|
- {
|
|
- if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null)
|
|
- {
|
|
- var9 = this.storageArrays[var7].getMetadataArray();
|
|
- System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length);
|
|
- var5 += var9.data.length;
|
|
- }
|
|
- }
|
|
-
|
|
- for (var7 = 0; var7 < this.storageArrays.length; ++var7)
|
|
- {
|
|
- if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null)
|
|
- {
|
|
- var9 = this.storageArrays[var7].getBlocklightArray();
|
|
- System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length);
|
|
- var5 += var9.data.length;
|
|
- }
|
|
- }
|
|
-
|
|
- if (var6)
|
|
- {
|
|
- for (var7 = 0; var7 < this.storageArrays.length; ++var7)
|
|
- {
|
|
- if ((par2 & 1 << var7) != 0 && this.storageArrays[var7] != null)
|
|
- {
|
|
- var9 = this.storageArrays[var7].getSkylightArray();
|
|
- System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length);
|
|
- var5 += var9.data.length;
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- for (var7 = 0; var7 < this.storageArrays.length; ++var7)
|
|
- {
|
|
- if ((par3 & 1 << var7) != 0)
|
|
- {
|
|
- if (this.storageArrays[var7] == null)
|
|
- {
|
|
- var5 += 2048;
|
|
- }
|
|
- else
|
|
- {
|
|
- var9 = this.storageArrays[var7].getBlockMSBArray();
|
|
-
|
|
- if (var9 == null)
|
|
- {
|
|
- var9 = this.storageArrays[var7].createBlockMSBArray();
|
|
- }
|
|
-
|
|
- System.arraycopy(par1ArrayOfByte, var5, var9.data, 0, var9.data.length);
|
|
- var5 += var9.data.length;
|
|
- }
|
|
- }
|
|
- else if (par4 && this.storageArrays[var7] != null && this.storageArrays[var7].getBlockMSBArray() != null)
|
|
- {
|
|
- this.storageArrays[var7].clearMSBArray();
|
|
- }
|
|
- }
|
|
-
|
|
- if (par4)
|
|
- {
|
|
- System.arraycopy(par1ArrayOfByte, var5, this.blockBiomeArray, 0, this.blockBiomeArray.length);
|
|
- int var10000 = var5 + this.blockBiomeArray.length;
|
|
- }
|
|
-
|
|
- for (var7 = 0; var7 < this.storageArrays.length; ++var7)
|
|
- {
|
|
- if (this.storageArrays[var7] != null && (par2 & 1 << var7) != 0)
|
|
- {
|
|
- this.storageArrays[var7].removeInvalidBlocks();
|
|
- }
|
|
- }
|
|
-
|
|
- this.generateHeightMap();
|
|
- Iterator var11 = this.chunkTileEntityMap.values().iterator();
|
|
-
|
|
- while (var11.hasNext())
|
|
- {
|
|
- TileEntity var10 = (TileEntity)var11.next();
|
|
- var10.updateContainingBlockInfo();
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* This method retrieves the biome at a set of coordinates
|
|
*/
|
|
public BiomeGenBase getBiomeGenForWorldCoords(int par1, int par2, WorldChunkManager par3WorldChunkManager)
|
|
{
|
|
int var4 = this.blockBiomeArray[par2 << 4 | par1] & 255;
|
|
--- 1188,1197 ----
|
|
***************
|
|
*** 1383,1396 ****
|
|
{
|
|
this.queuedLightChecks = 0;
|
|
}
|
|
|
|
/**
|
|
! * Called once-per-chunk-per-tick, and advances the round-robin relight check index per-storage-block by up to 8
|
|
! * blocks at a time. In a worst-case scenario, can potentially take up to 1.6 seconds, calculated via
|
|
! * (4096/(8*16))/20, to re-check all blocks in a chunk, which could explain both lagging light updates in certain
|
|
! * cases as well as Nether relight
|
|
*/
|
|
public void enqueueRelightChecks()
|
|
{
|
|
for (int var1 = 0; var1 < 8; ++var1)
|
|
{
|
|
--- 1230,1242 ----
|
|
{
|
|
this.queuedLightChecks = 0;
|
|
}
|
|
|
|
/**
|
|
! * Called once-per-chunk-per-tick, and advances the round-robin relight check index by up to 8 blocks at a time. In
|
|
! * a worst-case scenario, can potentially take up to 25.6 seconds, calculated via (4096/8)/20, to re-check all
|
|
! * blocks in a chunk, which may explain lagging light updates on initial world generation.
|
|
*/
|
|
public void enqueueRelightChecks()
|
|
{
|
|
for (int var1 = 0; var1 < 8; ++var1)
|
|
{
|
|
*** ChunkCache.java Sat Feb 5 04:19:39 2022
|
|
--- ChunkCache.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,15 ****
|
|
{
|
|
private int chunkX;
|
|
private int chunkZ;
|
|
private Chunk[][] chunkArray;
|
|
|
|
! /** True if the chunk cache is empty. */
|
|
! private boolean isEmpty;
|
|
|
|
/** Reference to the World object. */
|
|
private World worldObj;
|
|
|
|
public ChunkCache(World par1World, int par2, int par3, int par4, int par5, int par6, int par7, int par8)
|
|
--- 4,15 ----
|
|
{
|
|
private int chunkX;
|
|
private int chunkZ;
|
|
private Chunk[][] chunkArray;
|
|
|
|
! /** set by !chunk.getAreLevelsEmpty */
|
|
! private boolean hasExtendedLevels;
|
|
|
|
/** Reference to the World object. */
|
|
private World worldObj;
|
|
|
|
public ChunkCache(World par1World, int par2, int par3, int par4, int par5, int par6, int par7, int par8)
|
|
***************
|
|
*** 18,28 ****
|
|
this.chunkX = par2 - par8 >> 4;
|
|
this.chunkZ = par4 - par8 >> 4;
|
|
int var9 = par5 + par8 >> 4;
|
|
int var10 = par7 + par8 >> 4;
|
|
this.chunkArray = new Chunk[var9 - this.chunkX + 1][var10 - this.chunkZ + 1];
|
|
! this.isEmpty = true;
|
|
int var11;
|
|
int var12;
|
|
Chunk var13;
|
|
|
|
for (var11 = this.chunkX; var11 <= var9; ++var11)
|
|
--- 18,28 ----
|
|
this.chunkX = par2 - par8 >> 4;
|
|
this.chunkZ = par4 - par8 >> 4;
|
|
int var9 = par5 + par8 >> 4;
|
|
int var10 = par7 + par8 >> 4;
|
|
this.chunkArray = new Chunk[var9 - this.chunkX + 1][var10 - this.chunkZ + 1];
|
|
! this.hasExtendedLevels = true;
|
|
int var11;
|
|
int var12;
|
|
Chunk var13;
|
|
|
|
for (var11 = this.chunkX; var11 <= var9; ++var11)
|
|
***************
|
|
*** 44,68 ****
|
|
{
|
|
var13 = this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ];
|
|
|
|
if (var13 != null && !var13.getAreLevelsEmpty(par3, par6))
|
|
{
|
|
! this.isEmpty = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * set by !chunk.getAreLevelsEmpty
|
|
- */
|
|
- public boolean extendedLevelsInChunkCache()
|
|
- {
|
|
- return this.isEmpty;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the block ID at coords x,y,z
|
|
*/
|
|
public int getBlockId(int par1, int par2, int par3)
|
|
{
|
|
if (par2 < 0)
|
|
--- 44,60 ----
|
|
{
|
|
var13 = this.chunkArray[var11 - this.chunkX][var12 - this.chunkZ];
|
|
|
|
if (var13 != null && !var13.getAreLevelsEmpty(par3, par6))
|
|
{
|
|
! this.hasExtendedLevels = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Returns the block ID at coords x,y,z
|
|
*/
|
|
public int getBlockId(int par1, int par2, int par3)
|
|
{
|
|
if (par2 < 0)
|
|
***************
|
|
*** 98,226 ****
|
|
int var4 = (par1 >> 4) - this.chunkX;
|
|
int var5 = (par3 >> 4) - this.chunkZ;
|
|
return this.chunkArray[var4][var5].getChunkBlockTileEntity(par1 & 15, par2, par3 & 15);
|
|
}
|
|
|
|
- public float getBrightness(int par1, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = this.getLightValue(par1, par2, par3);
|
|
-
|
|
- if (var5 < par4)
|
|
- {
|
|
- var5 = par4;
|
|
- }
|
|
-
|
|
- return this.worldObj.provider.lightBrightnessTable[var5];
|
|
- }
|
|
-
|
|
- /**
|
|
- * Any Light rendered on a 1.8 Block goes through here
|
|
- */
|
|
- public int getLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, par1, par2, par3);
|
|
- int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, par1, par2, par3);
|
|
-
|
|
- if (var6 < par4)
|
|
- {
|
|
- var6 = par4;
|
|
- }
|
|
-
|
|
- return var5 << 20 | var6 << 4;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light
|
|
- * values aren't linear for brightness). Args: x, y, z
|
|
- */
|
|
- public float getLightBrightness(int par1, int par2, int par3)
|
|
- {
|
|
- return this.worldObj.provider.lightBrightnessTable[this.getLightValue(par1, par2, par3)];
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the light value of the specified block coords. Args: x, y, z
|
|
- */
|
|
- public int getLightValue(int par1, int par2, int par3)
|
|
- {
|
|
- return this.getLightValueExt(par1, par2, par3, true);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Get light value with flag
|
|
- */
|
|
- public int getLightValueExt(int par1, int par2, int par3, boolean par4)
|
|
- {
|
|
- if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 <= 30000000)
|
|
- {
|
|
- int var5;
|
|
- int var6;
|
|
-
|
|
- if (par4)
|
|
- {
|
|
- var5 = this.getBlockId(par1, par2, par3);
|
|
-
|
|
- if (var5 == Block.stoneSingleSlab.blockID || var5 == Block.woodSingleSlab.blockID || var5 == Block.tilledField.blockID || var5 == Block.stairsWoodOak.blockID || var5 == Block.stairsCobblestone.blockID)
|
|
- {
|
|
- var6 = this.getLightValueExt(par1, par2 + 1, par3, false);
|
|
- int var7 = this.getLightValueExt(par1 + 1, par2, par3, false);
|
|
- int var8 = this.getLightValueExt(par1 - 1, par2, par3, false);
|
|
- int var9 = this.getLightValueExt(par1, par2, par3 + 1, false);
|
|
- int var10 = this.getLightValueExt(par1, par2, par3 - 1, false);
|
|
-
|
|
- if (var7 > var6)
|
|
- {
|
|
- var6 = var7;
|
|
- }
|
|
-
|
|
- if (var8 > var6)
|
|
- {
|
|
- var6 = var8;
|
|
- }
|
|
-
|
|
- if (var9 > var6)
|
|
- {
|
|
- var6 = var9;
|
|
- }
|
|
-
|
|
- if (var10 > var6)
|
|
- {
|
|
- var6 = var10;
|
|
- }
|
|
-
|
|
- return var6;
|
|
- }
|
|
- }
|
|
-
|
|
- if (par2 < 0)
|
|
- {
|
|
- return 0;
|
|
- }
|
|
- else if (par2 >= 256)
|
|
- {
|
|
- var5 = 15 - this.worldObj.skylightSubtracted;
|
|
-
|
|
- if (var5 < 0)
|
|
- {
|
|
- var5 = 0;
|
|
- }
|
|
-
|
|
- return var5;
|
|
- }
|
|
- else
|
|
- {
|
|
- var5 = (par1 >> 4) - this.chunkX;
|
|
- var6 = (par3 >> 4) - this.chunkZ;
|
|
- return this.chunkArray[var5][var6].getBlockLightValue(par1 & 15, par2, par3 & 15, this.worldObj.skylightSubtracted);
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- return 15;
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the block metadata at coords x,y,z
|
|
*/
|
|
public int getBlockMetadata(int par1, int par2, int par3)
|
|
{
|
|
--- 90,99 ----
|
|
***************
|
|
*** 248,412 ****
|
|
int var4 = this.getBlockId(par1, par2, par3);
|
|
return var4 == 0 ? Material.air : Block.blocksList[var4].blockMaterial;
|
|
}
|
|
|
|
/**
|
|
- * Gets the biome for a given set of x/z coordinates
|
|
- */
|
|
- public BiomeGenBase getBiomeGenForCoords(int par1, int par2)
|
|
- {
|
|
- return this.worldObj.getBiomeGenForCoords(par1, par2);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z
|
|
*/
|
|
- public boolean isBlockOpaqueCube(int par1, int par2, int par3)
|
|
- {
|
|
- Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)];
|
|
- return var4 == null ? false : var4.isOpaqueCube();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Indicate if a material is a normal solid opaque cube.
|
|
- */
|
|
public boolean isBlockNormalCube(int par1, int par2, int par3)
|
|
{
|
|
Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)];
|
|
return var4 == null ? false : var4.blockMaterial.blocksMovement() && var4.renderAsNormalBlock();
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the block at the given coordinate has a solid (buildable) top surface.
|
|
- */
|
|
- public boolean doesBlockHaveSolidTopSurface(int par1, int par2, int par3)
|
|
- {
|
|
- Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)];
|
|
- return this.worldObj.isBlockTopFacingSurfaceSolid(var4, this.getBlockMetadata(par1, par2, par3));
|
|
- }
|
|
-
|
|
- /**
|
|
* Return the Vec3Pool object for this world.
|
|
*/
|
|
public Vec3Pool getWorldVec3Pool()
|
|
{
|
|
return this.worldObj.getWorldVec3Pool();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the block at the specified coordinates is empty
|
|
- */
|
|
- public boolean isAirBlock(int par1, int par2, int par3)
|
|
- {
|
|
- Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)];
|
|
- return var4 == null;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME.
|
|
- * Brightness for SkyBlock.Block is yellowish and independent.
|
|
- */
|
|
- public int getSkyBlockTypeBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
|
|
- {
|
|
- if (par3 < 0)
|
|
- {
|
|
- par3 = 0;
|
|
- }
|
|
-
|
|
- if (par3 >= 256)
|
|
- {
|
|
- par3 = 255;
|
|
- }
|
|
-
|
|
- if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000)
|
|
- {
|
|
- if (par1EnumSkyBlock == EnumSkyBlock.Sky && this.worldObj.provider.hasNoSky)
|
|
- {
|
|
- return 0;
|
|
- }
|
|
- else
|
|
- {
|
|
- int var5;
|
|
- int var6;
|
|
-
|
|
- if (Block.useNeighborBrightness[this.getBlockId(par2, par3, par4)])
|
|
- {
|
|
- var5 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3 + 1, par4);
|
|
- var6 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 + 1, par3, par4);
|
|
- int var7 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2 - 1, par3, par4);
|
|
- int var8 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 + 1);
|
|
- int var9 = this.getSpecialBlockBrightness(par1EnumSkyBlock, par2, par3, par4 - 1);
|
|
-
|
|
- if (var6 > var5)
|
|
- {
|
|
- var5 = var6;
|
|
- }
|
|
-
|
|
- if (var7 > var5)
|
|
- {
|
|
- var5 = var7;
|
|
- }
|
|
-
|
|
- if (var8 > var5)
|
|
- {
|
|
- var5 = var8;
|
|
- }
|
|
-
|
|
- if (var9 > var5)
|
|
- {
|
|
- var5 = var9;
|
|
- }
|
|
-
|
|
- return var5;
|
|
- }
|
|
- else
|
|
- {
|
|
- var5 = (par2 >> 4) - this.chunkX;
|
|
- var6 = (par4 >> 4) - this.chunkZ;
|
|
- return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15);
|
|
- }
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- return par1EnumSkyBlock.defaultLightValue;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * is only used on stairs and tilled fields
|
|
- */
|
|
- public int getSpecialBlockBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
|
|
- {
|
|
- if (par3 < 0)
|
|
- {
|
|
- par3 = 0;
|
|
- }
|
|
-
|
|
- if (par3 >= 256)
|
|
- {
|
|
- par3 = 255;
|
|
- }
|
|
-
|
|
- if (par3 >= 0 && par3 < 256 && par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 <= 30000000)
|
|
- {
|
|
- int var5 = (par2 >> 4) - this.chunkX;
|
|
- int var6 = (par4 >> 4) - this.chunkZ;
|
|
- return this.chunkArray[var5][var6].getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15);
|
|
- }
|
|
- else
|
|
- {
|
|
- return par1EnumSkyBlock.defaultLightValue;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns current world height.
|
|
- */
|
|
- public int getHeight()
|
|
- {
|
|
- return 256;
|
|
}
|
|
|
|
/**
|
|
* Is this block powering in the specified direction Args: x, y, z, direction
|
|
*/
|
|
--- 121,144 ----
|
|
*** ChunkProviderServer.java Sat Feb 5 04:19:39 2022
|
|
--- ChunkProviderServer.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 7,70 ****
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
|
|
public class ChunkProviderServer implements IChunkProvider
|
|
{
|
|
/**
|
|
! * used by unload100OldestChunks to iterate the loadedChunkHashMap for unload (underlying assumption, first in,
|
|
! * first out)
|
|
*/
|
|
! private Set chunksToUnload = new HashSet();
|
|
! private Chunk defaultEmptyChunk;
|
|
! private IChunkProvider currentChunkProvider;
|
|
! private IChunkLoader currentChunkLoader;
|
|
|
|
/**
|
|
! * if this is false, the defaultEmptyChunk will be returned by the provider
|
|
*/
|
|
! public boolean loadChunkOnProvideRequest = true;
|
|
! private LongHashMap loadedChunkHashMap = new LongHashMap();
|
|
private List loadedChunks = new ArrayList();
|
|
private WorldServer worldObj;
|
|
|
|
public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider)
|
|
{
|
|
! this.defaultEmptyChunk = new EmptyChunk(par1WorldServer, 0, 0);
|
|
this.worldObj = par1WorldServer;
|
|
! this.currentChunkLoader = par2IChunkLoader;
|
|
! this.currentChunkProvider = par3IChunkProvider;
|
|
}
|
|
|
|
/**
|
|
* Checks to see if a chunk exists at x, y
|
|
*/
|
|
public boolean chunkExists(int par1, int par2)
|
|
{
|
|
! return this.loadedChunkHashMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(par1, par2));
|
|
}
|
|
|
|
! /**
|
|
! * marks chunk for unload by "unload100OldestChunks" if there is no spawn point, or if the center of the chunk is
|
|
! * outside 200 blocks (x or z) of the spawn
|
|
! */
|
|
! public void unloadChunksIfNotNearSpawn(int par1, int par2)
|
|
{
|
|
if (this.worldObj.provider.canRespawnHere())
|
|
{
|
|
ChunkCoordinates var3 = this.worldObj.getSpawnPoint();
|
|
int var4 = par1 * 16 + 8 - var3.posX;
|
|
int var5 = par2 * 16 + 8 - var3.posZ;
|
|
short var6 = 128;
|
|
|
|
if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6)
|
|
{
|
|
! this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2)));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.chunksToUnload.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2)));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* marks all chunks for unload, ignoring those near the spawn
|
|
--- 7,71 ----
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
|
|
public class ChunkProviderServer implements IChunkProvider
|
|
{
|
|
+ private Set droppedChunksSet = new HashSet();
|
|
+
|
|
+ /** a dummy chunk, returned in place of an actual chunk. */
|
|
+ private Chunk dummyChunk;
|
|
+
|
|
/**
|
|
! * chunk generator object. Calls to load nonexistent chunks are forwarded to this object.
|
|
*/
|
|
! private IChunkProvider serverChunkGenerator;
|
|
! private IChunkLoader chunkLoader;
|
|
|
|
/**
|
|
! * if set, this flag forces a request to load a chunk to load the chunk rather than defaulting to the dummy if
|
|
! * possible
|
|
*/
|
|
! public boolean chunkLoadOverride = true;
|
|
!
|
|
! /** map of chunk Id's to Chunk instances */
|
|
! private LongHashMap id2ChunkMap = new LongHashMap();
|
|
private List loadedChunks = new ArrayList();
|
|
private WorldServer worldObj;
|
|
|
|
public ChunkProviderServer(WorldServer par1WorldServer, IChunkLoader par2IChunkLoader, IChunkProvider par3IChunkProvider)
|
|
{
|
|
! this.dummyChunk = new EmptyChunk(par1WorldServer, 0, 0);
|
|
this.worldObj = par1WorldServer;
|
|
! this.chunkLoader = par2IChunkLoader;
|
|
! this.serverChunkGenerator = par3IChunkProvider;
|
|
}
|
|
|
|
/**
|
|
* Checks to see if a chunk exists at x, y
|
|
*/
|
|
public boolean chunkExists(int par1, int par2)
|
|
{
|
|
! return this.id2ChunkMap.containsItem(ChunkCoordIntPair.chunkXZ2Int(par1, par2));
|
|
}
|
|
|
|
! public void dropChunk(int par1, int par2)
|
|
{
|
|
if (this.worldObj.provider.canRespawnHere())
|
|
{
|
|
ChunkCoordinates var3 = this.worldObj.getSpawnPoint();
|
|
int var4 = par1 * 16 + 8 - var3.posX;
|
|
int var5 = par2 * 16 + 8 - var3.posZ;
|
|
short var6 = 128;
|
|
|
|
if (var4 < -var6 || var4 > var6 || var5 < -var6 || var5 > var6)
|
|
{
|
|
! this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2)));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.droppedChunksSet.add(Long.valueOf(ChunkCoordIntPair.chunkXZ2Int(par1, par2)));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* marks all chunks for unload, ignoring those near the spawn
|
|
***************
|
|
*** 74,125 ****
|
|
Iterator var1 = this.loadedChunks.iterator();
|
|
|
|
while (var1.hasNext())
|
|
{
|
|
Chunk var2 = (Chunk)var1.next();
|
|
! this.unloadChunksIfNotNearSpawn(var2.xPosition, var2.zPosition);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* loads or generates the chunk at the chunk location specified
|
|
*/
|
|
public Chunk loadChunk(int par1, int par2)
|
|
{
|
|
long var3 = ChunkCoordIntPair.chunkXZ2Int(par1, par2);
|
|
! this.chunksToUnload.remove(Long.valueOf(var3));
|
|
! Chunk var5 = (Chunk)this.loadedChunkHashMap.getValueByKey(var3);
|
|
|
|
if (var5 == null)
|
|
{
|
|
! var5 = this.safeLoadChunk(par1, par2);
|
|
|
|
if (var5 == null)
|
|
{
|
|
! if (this.currentChunkProvider == null)
|
|
{
|
|
! var5 = this.defaultEmptyChunk;
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
! var5 = this.currentChunkProvider.provideChunk(par1, par2);
|
|
}
|
|
catch (Throwable var9)
|
|
{
|
|
CrashReport var7 = CrashReport.makeCrashReport(var9, "Exception generating new chunk");
|
|
CrashReportCategory var8 = var7.makeCategory("Chunk to be generated");
|
|
var8.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(par1), Integer.valueOf(par2)}));
|
|
var8.addCrashSection("Position hash", Long.valueOf(var3));
|
|
! var8.addCrashSection("Generator", this.currentChunkProvider.makeString());
|
|
throw new ReportedException(var7);
|
|
}
|
|
}
|
|
}
|
|
|
|
! this.loadedChunkHashMap.add(var3, var5);
|
|
this.loadedChunks.add(var5);
|
|
|
|
if (var5 != null)
|
|
{
|
|
var5.onChunkLoad();
|
|
--- 75,126 ----
|
|
Iterator var1 = this.loadedChunks.iterator();
|
|
|
|
while (var1.hasNext())
|
|
{
|
|
Chunk var2 = (Chunk)var1.next();
|
|
! this.dropChunk(var2.xPosition, var2.zPosition);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* loads or generates the chunk at the chunk location specified
|
|
*/
|
|
public Chunk loadChunk(int par1, int par2)
|
|
{
|
|
long var3 = ChunkCoordIntPair.chunkXZ2Int(par1, par2);
|
|
! this.droppedChunksSet.remove(Long.valueOf(var3));
|
|
! Chunk var5 = (Chunk)this.id2ChunkMap.getValueByKey(var3);
|
|
|
|
if (var5 == null)
|
|
{
|
|
! var5 = this.loadChunkFromFile(par1, par2);
|
|
|
|
if (var5 == null)
|
|
{
|
|
! if (this.serverChunkGenerator == null)
|
|
{
|
|
! var5 = this.dummyChunk;
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
! var5 = this.serverChunkGenerator.provideChunk(par1, par2);
|
|
}
|
|
catch (Throwable var9)
|
|
{
|
|
CrashReport var7 = CrashReport.makeCrashReport(var9, "Exception generating new chunk");
|
|
CrashReportCategory var8 = var7.makeCategory("Chunk to be generated");
|
|
var8.addCrashSection("Location", String.format("%d,%d", new Object[] {Integer.valueOf(par1), Integer.valueOf(par2)}));
|
|
var8.addCrashSection("Position hash", Long.valueOf(var3));
|
|
! var8.addCrashSection("Generator", this.serverChunkGenerator.makeString());
|
|
throw new ReportedException(var7);
|
|
}
|
|
}
|
|
}
|
|
|
|
! this.id2ChunkMap.add(var3, var5);
|
|
this.loadedChunks.add(var5);
|
|
|
|
if (var5 != null)
|
|
{
|
|
var5.onChunkLoad();
|
|
***************
|
|
*** 135,170 ****
|
|
* Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
|
|
* specified chunk from the map seed and chunk seed
|
|
*/
|
|
public Chunk provideChunk(int par1, int par2)
|
|
{
|
|
! Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2));
|
|
! return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.loadChunkOnProvideRequest ? this.defaultEmptyChunk : this.loadChunk(par1, par2)) : var3;
|
|
}
|
|
|
|
! /**
|
|
! * used by loadChunk, but catches any exceptions if the load fails.
|
|
! */
|
|
! private Chunk safeLoadChunk(int par1, int par2)
|
|
{
|
|
! if (this.currentChunkLoader == null)
|
|
{
|
|
return null;
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
! Chunk var3 = this.currentChunkLoader.loadChunk(this.worldObj, par1, par2);
|
|
|
|
if (var3 != null)
|
|
{
|
|
var3.lastSaveTime = this.worldObj.getTotalWorldTime();
|
|
|
|
! if (this.currentChunkProvider != null)
|
|
{
|
|
! this.currentChunkProvider.recreateStructures(par1, par2);
|
|
}
|
|
}
|
|
|
|
return var3;
|
|
}
|
|
--- 136,168 ----
|
|
* Will return back a chunk, if it doesn't exist and its not a MP client it will generates all the blocks for the
|
|
* specified chunk from the map seed and chunk seed
|
|
*/
|
|
public Chunk provideChunk(int par1, int par2)
|
|
{
|
|
! Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(ChunkCoordIntPair.chunkXZ2Int(par1, par2));
|
|
! return var3 == null ? (!this.worldObj.findingSpawnPoint && !this.chunkLoadOverride ? this.dummyChunk : this.loadChunk(par1, par2)) : var3;
|
|
}
|
|
|
|
! private Chunk loadChunkFromFile(int par1, int par2)
|
|
{
|
|
! if (this.chunkLoader == null)
|
|
{
|
|
return null;
|
|
}
|
|
else
|
|
{
|
|
try
|
|
{
|
|
! Chunk var3 = this.chunkLoader.loadChunk(this.worldObj, par1, par2);
|
|
|
|
if (var3 != null)
|
|
{
|
|
var3.lastSaveTime = this.worldObj.getTotalWorldTime();
|
|
|
|
! if (this.serverChunkGenerator != null)
|
|
{
|
|
! this.serverChunkGenerator.recreateStructures(par1, par2);
|
|
}
|
|
}
|
|
|
|
return var3;
|
|
}
|
|
***************
|
|
*** 174,212 ****
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * used by saveChunks, but catches any exceptions if the save fails.
|
|
! */
|
|
! private void safeSaveExtraChunkData(Chunk par1Chunk)
|
|
{
|
|
! if (this.currentChunkLoader != null)
|
|
{
|
|
try
|
|
{
|
|
! this.currentChunkLoader.saveExtraChunkData(this.worldObj, par1Chunk);
|
|
}
|
|
catch (Exception var3)
|
|
{
|
|
var3.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * used by saveChunks, but catches any exceptions if the save fails.
|
|
! */
|
|
! private void safeSaveChunk(Chunk par1Chunk)
|
|
{
|
|
! if (this.currentChunkLoader != null)
|
|
{
|
|
try
|
|
{
|
|
par1Chunk.lastSaveTime = this.worldObj.getTotalWorldTime();
|
|
! this.currentChunkLoader.saveChunk(this.worldObj, par1Chunk);
|
|
}
|
|
catch (IOException var3)
|
|
{
|
|
var3.printStackTrace();
|
|
}
|
|
--- 172,204 ----
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
|
|
! private void saveChunkExtraData(Chunk par1Chunk)
|
|
{
|
|
! if (this.chunkLoader != null)
|
|
{
|
|
try
|
|
{
|
|
! this.chunkLoader.saveExtraChunkData(this.worldObj, par1Chunk);
|
|
}
|
|
catch (Exception var3)
|
|
{
|
|
var3.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
! private void saveChunkData(Chunk par1Chunk)
|
|
{
|
|
! if (this.chunkLoader != null)
|
|
{
|
|
try
|
|
{
|
|
par1Chunk.lastSaveTime = this.worldObj.getTotalWorldTime();
|
|
! this.chunkLoader.saveChunk(this.worldObj, par1Chunk);
|
|
}
|
|
catch (IOException var3)
|
|
{
|
|
var3.printStackTrace();
|
|
}
|
|
***************
|
|
*** 226,238 ****
|
|
|
|
if (!var4.isTerrainPopulated)
|
|
{
|
|
var4.isTerrainPopulated = true;
|
|
|
|
! if (this.currentChunkProvider != null)
|
|
{
|
|
! this.currentChunkProvider.populate(par1IChunkProvider, par2, par3);
|
|
var4.setChunkModified();
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 218,230 ----
|
|
|
|
if (!var4.isTerrainPopulated)
|
|
{
|
|
var4.isTerrainPopulated = true;
|
|
|
|
! if (this.serverChunkGenerator != null)
|
|
{
|
|
! this.serverChunkGenerator.populate(par1IChunkProvider, par2, par3);
|
|
var4.setChunkModified();
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 248,263 ****
|
|
{
|
|
Chunk var5 = (Chunk)this.loadedChunks.get(var4);
|
|
|
|
if (par1)
|
|
{
|
|
! this.safeSaveExtraChunkData(var5);
|
|
}
|
|
|
|
if (var5.needsSaving(par1))
|
|
{
|
|
! this.safeSaveChunk(var5);
|
|
var5.isModified = false;
|
|
++var3;
|
|
|
|
if (var3 == 24 && !par1)
|
|
{
|
|
--- 240,255 ----
|
|
{
|
|
Chunk var5 = (Chunk)this.loadedChunks.get(var4);
|
|
|
|
if (par1)
|
|
{
|
|
! this.saveChunkExtraData(var5);
|
|
}
|
|
|
|
if (var5.needsSaving(par1))
|
|
{
|
|
! this.saveChunkData(var5);
|
|
var5.isModified = false;
|
|
++var3;
|
|
|
|
if (var3 == 24 && !par1)
|
|
{
|
|
***************
|
|
*** 273,353 ****
|
|
* Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently
|
|
* unimplemented.
|
|
*/
|
|
public void saveExtraData()
|
|
{
|
|
! if (this.currentChunkLoader != null)
|
|
{
|
|
! this.currentChunkLoader.saveExtraData();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk.
|
|
*/
|
|
public boolean unloadQueuedChunks()
|
|
{
|
|
! if (!this.worldObj.canNotSave)
|
|
{
|
|
for (int var1 = 0; var1 < 100; ++var1)
|
|
{
|
|
! if (!this.chunksToUnload.isEmpty())
|
|
{
|
|
! Long var2 = (Long)this.chunksToUnload.iterator().next();
|
|
! Chunk var3 = (Chunk)this.loadedChunkHashMap.getValueByKey(var2.longValue());
|
|
var3.onChunkUnload();
|
|
! this.safeSaveChunk(var3);
|
|
! this.safeSaveExtraChunkData(var3);
|
|
! this.chunksToUnload.remove(var2);
|
|
! this.loadedChunkHashMap.remove(var2.longValue());
|
|
this.loadedChunks.remove(var3);
|
|
}
|
|
}
|
|
|
|
! if (this.currentChunkLoader != null)
|
|
{
|
|
! this.currentChunkLoader.chunkTick();
|
|
}
|
|
}
|
|
|
|
! return this.currentChunkProvider.unloadQueuedChunks();
|
|
}
|
|
|
|
/**
|
|
* Returns if the IChunkProvider supports saving.
|
|
*/
|
|
public boolean canSave()
|
|
{
|
|
! return !this.worldObj.canNotSave;
|
|
}
|
|
|
|
/**
|
|
* Converts the instance data to a readable string.
|
|
*/
|
|
public String makeString()
|
|
{
|
|
! return "ServerChunkCache: " + this.loadedChunkHashMap.getNumHashElements() + " Drop: " + this.chunksToUnload.size();
|
|
}
|
|
|
|
/**
|
|
* Returns a list of creatures of the specified type that can spawn at the given location.
|
|
*/
|
|
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
|
|
{
|
|
! return this.currentChunkProvider.getPossibleCreatures(par1EnumCreatureType, par2, par3, par4);
|
|
}
|
|
|
|
/**
|
|
* Returns the location of the closest structure of the specified type. If not found returns null.
|
|
*/
|
|
public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5)
|
|
{
|
|
! return this.currentChunkProvider.findClosestStructure(par1World, par2Str, par3, par4, par5);
|
|
}
|
|
|
|
public int getLoadedChunkCount()
|
|
{
|
|
! return this.loadedChunkHashMap.getNumHashElements();
|
|
}
|
|
|
|
public void recreateStructures(int par1, int par2) {}
|
|
}
|
|
--- 265,345 ----
|
|
* Save extra data not associated with any Chunk. Not saved during autosave, only during world unload. Currently
|
|
* unimplemented.
|
|
*/
|
|
public void saveExtraData()
|
|
{
|
|
! if (this.chunkLoader != null)
|
|
{
|
|
! this.chunkLoader.saveExtraData();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Unloads chunks that are marked to be unloaded. This is not guaranteed to unload every such chunk.
|
|
*/
|
|
public boolean unloadQueuedChunks()
|
|
{
|
|
! if (!this.worldObj.levelSaving)
|
|
{
|
|
for (int var1 = 0; var1 < 100; ++var1)
|
|
{
|
|
! if (!this.droppedChunksSet.isEmpty())
|
|
{
|
|
! Long var2 = (Long)this.droppedChunksSet.iterator().next();
|
|
! Chunk var3 = (Chunk)this.id2ChunkMap.getValueByKey(var2.longValue());
|
|
var3.onChunkUnload();
|
|
! this.saveChunkData(var3);
|
|
! this.saveChunkExtraData(var3);
|
|
! this.droppedChunksSet.remove(var2);
|
|
! this.id2ChunkMap.remove(var2.longValue());
|
|
this.loadedChunks.remove(var3);
|
|
}
|
|
}
|
|
|
|
! if (this.chunkLoader != null)
|
|
{
|
|
! this.chunkLoader.chunkTick();
|
|
}
|
|
}
|
|
|
|
! return this.serverChunkGenerator.unloadQueuedChunks();
|
|
}
|
|
|
|
/**
|
|
* Returns if the IChunkProvider supports saving.
|
|
*/
|
|
public boolean canSave()
|
|
{
|
|
! return !this.worldObj.levelSaving;
|
|
}
|
|
|
|
/**
|
|
* Converts the instance data to a readable string.
|
|
*/
|
|
public String makeString()
|
|
{
|
|
! return "ServerChunkCache: " + this.id2ChunkMap.getNumHashElements() + " Drop: " + this.droppedChunksSet.size();
|
|
}
|
|
|
|
/**
|
|
* Returns a list of creatures of the specified type that can spawn at the given location.
|
|
*/
|
|
public List getPossibleCreatures(EnumCreatureType par1EnumCreatureType, int par2, int par3, int par4)
|
|
{
|
|
! return this.serverChunkGenerator.getPossibleCreatures(par1EnumCreatureType, par2, par3, par4);
|
|
}
|
|
|
|
/**
|
|
* Returns the location of the closest structure of the specified type. If not found returns null.
|
|
*/
|
|
public ChunkPosition findClosestStructure(World par1World, String par2Str, int par3, int par4, int par5)
|
|
{
|
|
! return this.serverChunkGenerator.findClosestStructure(par1World, par2Str, par3, par4, par5);
|
|
}
|
|
|
|
public int getLoadedChunkCount()
|
|
{
|
|
! return this.id2ChunkMap.getNumHashElements();
|
|
}
|
|
|
|
public void recreateStructures(int par1, int par2) {}
|
|
}
|
|
*** CommandBase.java Sat Feb 5 04:19:39 2022
|
|
--- CommandBase.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 173,183 ****
|
|
{
|
|
return var2;
|
|
}
|
|
else
|
|
{
|
|
! var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par1Str);
|
|
|
|
if (var2 == null)
|
|
{
|
|
throw new PlayerNotFoundException();
|
|
}
|
|
--- 173,183 ----
|
|
{
|
|
return var2;
|
|
}
|
|
else
|
|
{
|
|
! var2 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par1Str);
|
|
|
|
if (var2 == null)
|
|
{
|
|
throw new PlayerNotFoundException();
|
|
}
|
|
*** CommandDebug.java Sat Feb 5 04:19:39 2022
|
|
--- CommandDebug.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 39,49 ****
|
|
{
|
|
if (par2ArrayOfStr[0].equals("start"))
|
|
{
|
|
notifyAdmins(par1ICommandSender, "commands.debug.start", new Object[0]);
|
|
MinecraftServer.getServer().enableProfiling();
|
|
! this.startTime = MinecraftServer.getSystemTimeMillis();
|
|
this.startTicks = MinecraftServer.getServer().getTickCounter();
|
|
return;
|
|
}
|
|
|
|
if (par2ArrayOfStr[0].equals("stop"))
|
|
--- 39,49 ----
|
|
{
|
|
if (par2ArrayOfStr[0].equals("start"))
|
|
{
|
|
notifyAdmins(par1ICommandSender, "commands.debug.start", new Object[0]);
|
|
MinecraftServer.getServer().enableProfiling();
|
|
! this.startTime = MinecraftServer.getCurrentTimeMillis();
|
|
this.startTicks = MinecraftServer.getServer().getTickCounter();
|
|
return;
|
|
}
|
|
|
|
if (par2ArrayOfStr[0].equals("stop"))
|
|
***************
|
|
*** 51,61 ****
|
|
if (!MinecraftServer.getServer().theProfiler.profilingEnabled)
|
|
{
|
|
throw new CommandException("commands.debug.notStarted", new Object[0]);
|
|
}
|
|
|
|
! long var3 = MinecraftServer.getSystemTimeMillis();
|
|
int var5 = MinecraftServer.getServer().getTickCounter();
|
|
long var6 = var3 - this.startTime;
|
|
int var8 = var5 - this.startTicks;
|
|
this.saveProfilerResults(var6, var8);
|
|
MinecraftServer.getServer().theProfiler.profilingEnabled = false;
|
|
--- 51,61 ----
|
|
if (!MinecraftServer.getServer().theProfiler.profilingEnabled)
|
|
{
|
|
throw new CommandException("commands.debug.notStarted", new Object[0]);
|
|
}
|
|
|
|
! long var3 = MinecraftServer.getCurrentTimeMillis();
|
|
int var5 = MinecraftServer.getServer().getTickCounter();
|
|
long var6 = var3 - this.startTime;
|
|
int var8 = var5 - this.startTicks;
|
|
this.saveProfilerResults(var6, var8);
|
|
MinecraftServer.getServer().theProfiler.profilingEnabled = false;
|
|
*** CommandPlaySound.java Sat Feb 5 04:19:39 2022
|
|
--- CommandPlaySound.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 30,42 ****
|
|
{
|
|
byte var3 = 0;
|
|
int var36 = var3 + 1;
|
|
String var4 = par2ArrayOfStr[var3];
|
|
EntityPlayerMP var5 = getPlayer(par1ICommandSender, par2ArrayOfStr[var36++]);
|
|
! double var6 = (double)var5.getPlayerCoordinates().posX;
|
|
! double var8 = (double)var5.getPlayerCoordinates().posY;
|
|
! double var10 = (double)var5.getPlayerCoordinates().posZ;
|
|
double var12 = 1.0D;
|
|
double var14 = 1.0D;
|
|
double var16 = 0.0D;
|
|
|
|
if (par2ArrayOfStr.length > var36)
|
|
--- 30,42 ----
|
|
{
|
|
byte var3 = 0;
|
|
int var36 = var3 + 1;
|
|
String var4 = par2ArrayOfStr[var3];
|
|
EntityPlayerMP var5 = getPlayer(par1ICommandSender, par2ArrayOfStr[var36++]);
|
|
! double var6 = (double)var5.getCommandSenderPosition().posX;
|
|
! double var8 = (double)var5.getCommandSenderPosition().posY;
|
|
! double var10 = (double)var5.getCommandSenderPosition().posZ;
|
|
double var12 = 1.0D;
|
|
double var14 = 1.0D;
|
|
double var16 = 0.0D;
|
|
|
|
if (par2ArrayOfStr.length > var36)
|
|
***************
|
|
*** 92,106 ****
|
|
var30 += var22 / var28 * 2.0D;
|
|
var32 += var24 / var28 * 2.0D;
|
|
var34 += var26 / var28 * 2.0D;
|
|
}
|
|
|
|
! var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14));
|
|
}
|
|
else
|
|
{
|
|
! var5.playerNetServerHandler.sendPacketToPlayer(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14));
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.playsound.success", new Object[] {var4, var5.getEntityName()});
|
|
}
|
|
}
|
|
--- 92,106 ----
|
|
var30 += var22 / var28 * 2.0D;
|
|
var32 += var24 / var28 * 2.0D;
|
|
var34 += var26 / var28 * 2.0D;
|
|
}
|
|
|
|
! var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var30, var32, var34, (float)var16, (float)var14));
|
|
}
|
|
else
|
|
{
|
|
! var5.playerNetServerHandler.sendPacket(new Packet62LevelSound(var4, var6, var8, var10, (float)var12, (float)var14));
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.playsound.success", new Object[] {var4, var5.getEntityName()});
|
|
}
|
|
}
|
|
*** CommandServerBan.java Sat Feb 5 04:19:39 2022
|
|
--- CommandServerBan.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 33,43 ****
|
|
|
|
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
|
|
{
|
|
if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 0)
|
|
{
|
|
! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]);
|
|
BanEntry var4 = new BanEntry(par2ArrayOfStr[0]);
|
|
var4.setBannedBy(par1ICommandSender.getCommandSenderName());
|
|
|
|
if (par2ArrayOfStr.length >= 2)
|
|
{
|
|
--- 33,43 ----
|
|
|
|
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
|
|
{
|
|
if (par2ArrayOfStr.length >= 1 && par2ArrayOfStr[0].length() > 0)
|
|
{
|
|
! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par2ArrayOfStr[0]);
|
|
BanEntry var4 = new BanEntry(par2ArrayOfStr[0]);
|
|
var4.setBannedBy(par1ICommandSender.getCommandSenderName());
|
|
|
|
if (par2ArrayOfStr.length >= 2)
|
|
{
|
|
***************
|
|
*** 46,56 ****
|
|
|
|
MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().put(var4);
|
|
|
|
if (var3 != null)
|
|
{
|
|
! var3.playerNetServerHandler.kickPlayerFromServer("You are banned from this server.");
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.ban.success", new Object[] {par2ArrayOfStr[0]});
|
|
}
|
|
else
|
|
--- 46,56 ----
|
|
|
|
MinecraftServer.getServer().getConfigurationManager().getBannedPlayers().put(var4);
|
|
|
|
if (var3 != null)
|
|
{
|
|
! var3.playerNetServerHandler.kickPlayer("You are banned from this server.");
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.ban.success", new Object[] {par2ArrayOfStr[0]});
|
|
}
|
|
else
|
|
*** CommandServerBanIp.java Sat Feb 5 04:19:39 2022
|
|
--- CommandServerBanIp.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 52,62 ****
|
|
{
|
|
this.banIP(par1ICommandSender, par2ArrayOfStr[0], var4);
|
|
}
|
|
else
|
|
{
|
|
! EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]);
|
|
|
|
if (var5 == null)
|
|
{
|
|
throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]);
|
|
}
|
|
--- 52,62 ----
|
|
{
|
|
this.banIP(par1ICommandSender, par2ArrayOfStr[0], var4);
|
|
}
|
|
else
|
|
{
|
|
! EntityPlayerMP var5 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par2ArrayOfStr[0]);
|
|
|
|
if (var5 == null)
|
|
{
|
|
throw new PlayerNotFoundException("commands.banip.invalid", new Object[0]);
|
|
}
|
|
***************
|
|
*** 98,108 ****
|
|
EntityPlayerMP var9;
|
|
|
|
for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName())
|
|
{
|
|
var9 = (EntityPlayerMP)var8.next();
|
|
! var9.playerNetServerHandler.kickPlayerFromServer("You have been IP banned.");
|
|
}
|
|
|
|
if (var5.isEmpty())
|
|
{
|
|
notifyAdmins(par1ICommandSender, "commands.banip.success", new Object[] {par2Str});
|
|
--- 98,108 ----
|
|
EntityPlayerMP var9;
|
|
|
|
for (Iterator var8 = var5.iterator(); var8.hasNext(); var6[var7++] = var9.getEntityName())
|
|
{
|
|
var9 = (EntityPlayerMP)var8.next();
|
|
! var9.playerNetServerHandler.kickPlayer("You have been IP banned.");
|
|
}
|
|
|
|
if (var5.isEmpty())
|
|
{
|
|
notifyAdmins(par1ICommandSender, "commands.banip.success", new Object[] {par2Str});
|
|
*** CommandServerKick.java Sat Feb 5 04:19:39 2022
|
|
--- CommandServerKick.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 25,35 ****
|
|
|
|
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
|
|
{
|
|
if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 1)
|
|
{
|
|
! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(par2ArrayOfStr[0]);
|
|
String var4 = "Kicked by an operator.";
|
|
boolean var5 = false;
|
|
|
|
if (var3 == null)
|
|
{
|
|
--- 25,35 ----
|
|
|
|
public void processCommand(ICommandSender par1ICommandSender, String[] par2ArrayOfStr)
|
|
{
|
|
if (par2ArrayOfStr.length > 0 && par2ArrayOfStr[0].length() > 1)
|
|
{
|
|
! EntityPlayerMP var3 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(par2ArrayOfStr[0]);
|
|
String var4 = "Kicked by an operator.";
|
|
boolean var5 = false;
|
|
|
|
if (var3 == null)
|
|
{
|
|
***************
|
|
*** 41,51 ****
|
|
{
|
|
var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1);
|
|
var5 = true;
|
|
}
|
|
|
|
! var3.playerNetServerHandler.kickPlayerFromServer(var4);
|
|
|
|
if (var5)
|
|
{
|
|
notifyAdmins(par1ICommandSender, "commands.kick.success.reason", new Object[] {var3.getEntityName(), var4});
|
|
}
|
|
--- 41,51 ----
|
|
{
|
|
var4 = func_82360_a(par1ICommandSender, par2ArrayOfStr, 1);
|
|
var5 = true;
|
|
}
|
|
|
|
! var3.playerNetServerHandler.kickPlayer(var4);
|
|
|
|
if (var5)
|
|
{
|
|
notifyAdmins(par1ICommandSender, "commands.kick.success.reason", new Object[] {var3.getEntityName(), var4});
|
|
}
|
|
*** CommandServerSaveAll.java Sat Feb 5 04:19:39 2022
|
|
--- CommandServerSaveAll.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 41,54 ****
|
|
for (var4 = 0; var4 < var3.worldServers.length; ++var4)
|
|
{
|
|
if (var3.worldServers[var4] != null)
|
|
{
|
|
var5 = var3.worldServers[var4];
|
|
! var6 = var5.canNotSave;
|
|
! var5.canNotSave = false;
|
|
var5.saveAllChunks(true, (IProgressUpdate)null);
|
|
! var5.canNotSave = var6;
|
|
}
|
|
}
|
|
|
|
if (par2ArrayOfStr.length > 0 && "flush".equals(par2ArrayOfStr[0]))
|
|
{
|
|
--- 41,54 ----
|
|
for (var4 = 0; var4 < var3.worldServers.length; ++var4)
|
|
{
|
|
if (var3.worldServers[var4] != null)
|
|
{
|
|
var5 = var3.worldServers[var4];
|
|
! var6 = var5.levelSaving;
|
|
! var5.levelSaving = false;
|
|
var5.saveAllChunks(true, (IProgressUpdate)null);
|
|
! var5.levelSaving = var6;
|
|
}
|
|
}
|
|
|
|
if (par2ArrayOfStr.length > 0 && "flush".equals(par2ArrayOfStr[0]))
|
|
{
|
|
***************
|
|
*** 57,70 ****
|
|
for (var4 = 0; var4 < var3.worldServers.length; ++var4)
|
|
{
|
|
if (var3.worldServers[var4] != null)
|
|
{
|
|
var5 = var3.worldServers[var4];
|
|
! var6 = var5.canNotSave;
|
|
! var5.canNotSave = false;
|
|
var5.saveChunkData();
|
|
! var5.canNotSave = var6;
|
|
}
|
|
}
|
|
|
|
par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd"));
|
|
}
|
|
--- 57,70 ----
|
|
for (var4 = 0; var4 < var3.worldServers.length; ++var4)
|
|
{
|
|
if (var3.worldServers[var4] != null)
|
|
{
|
|
var5 = var3.worldServers[var4];
|
|
! var6 = var5.levelSaving;
|
|
! var5.levelSaving = false;
|
|
var5.saveChunkData();
|
|
! var5.levelSaving = var6;
|
|
}
|
|
}
|
|
|
|
par1ICommandSender.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("commands.save.flushEnd"));
|
|
}
|
|
*** CommandServerSaveOff.java Sat Feb 5 04:19:39 2022
|
|
--- CommandServerSaveOff.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 31,43 ****
|
|
{
|
|
if (var3.worldServers[var5] != null)
|
|
{
|
|
WorldServer var6 = var3.worldServers[var5];
|
|
|
|
! if (!var6.canNotSave)
|
|
{
|
|
! var6.canNotSave = true;
|
|
var4 = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 31,43 ----
|
|
{
|
|
if (var3.worldServers[var5] != null)
|
|
{
|
|
WorldServer var6 = var3.worldServers[var5];
|
|
|
|
! if (!var6.levelSaving)
|
|
{
|
|
! var6.levelSaving = true;
|
|
var4 = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
*** CommandServerSaveOn.java Sat Feb 5 04:19:39 2022
|
|
--- CommandServerSaveOn.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 31,43 ****
|
|
{
|
|
if (var3.worldServers[var5] != null)
|
|
{
|
|
WorldServer var6 = var3.worldServers[var5];
|
|
|
|
! if (var6.canNotSave)
|
|
{
|
|
! var6.canNotSave = false;
|
|
var4 = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 31,43 ----
|
|
{
|
|
if (var3.worldServers[var5] != null)
|
|
{
|
|
WorldServer var6 = var3.worldServers[var5];
|
|
|
|
! if (var6.levelSaving)
|
|
{
|
|
! var6.levelSaving = false;
|
|
var4 = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
*** CommandSetSpawnpoint.java Sat Feb 5 04:19:39 2022
|
|
--- CommandSetSpawnpoint.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 46,56 ****
|
|
if (par2ArrayOfStr.length > 1)
|
|
{
|
|
throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]);
|
|
}
|
|
|
|
! ChunkCoordinates var10 = var3.getPlayerCoordinates();
|
|
var3.setSpawnChunk(var10, true);
|
|
notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)});
|
|
}
|
|
}
|
|
|
|
--- 46,56 ----
|
|
if (par2ArrayOfStr.length > 1)
|
|
{
|
|
throw new WrongUsageException("commands.spawnpoint.usage", new Object[0]);
|
|
}
|
|
|
|
! ChunkCoordinates var10 = var3.getCommandSenderPosition();
|
|
var3.setSpawnChunk(var10, true);
|
|
notifyAdmins(par1ICommandSender, "commands.spawnpoint.success", new Object[] {var3.getEntityName(), Integer.valueOf(var10.posX), Integer.valueOf(var10.posY), Integer.valueOf(var10.posZ)});
|
|
}
|
|
}
|
|
|
|
*** CommandSpreadPlayers.java Sat Feb 5 04:19:39 2022
|
|
--- CommandSpreadPlayers.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 66,76 ****
|
|
|
|
Collections.addAll(var13, var17);
|
|
}
|
|
else
|
|
{
|
|
! EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerForUsername(var14);
|
|
|
|
if (var15 == null)
|
|
{
|
|
throw new PlayerNotFoundException();
|
|
}
|
|
--- 66,76 ----
|
|
|
|
Collections.addAll(var13, var17);
|
|
}
|
|
else
|
|
{
|
|
! EntityPlayerMP var15 = MinecraftServer.getServer().getConfigurationManager().getPlayerEntity(var14);
|
|
|
|
if (var15 == null)
|
|
{
|
|
throw new PlayerNotFoundException();
|
|
}
|
|
*** CommandToggleDownfall.java Sat Feb 5 04:19:39 2022
|
|
--- CommandToggleDownfall.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 31,39 ****
|
|
/**
|
|
* Toggle rain and enable thundering.
|
|
*/
|
|
protected void toggleDownfall()
|
|
{
|
|
! MinecraftServer.getServer().worldServers[0].toggleRain();
|
|
MinecraftServer.getServer().worldServers[0].getWorldInfo().setThundering(true);
|
|
}
|
|
}
|
|
--- 31,39 ----
|
|
/**
|
|
* Toggle rain and enable thundering.
|
|
*/
|
|
protected void toggleDownfall()
|
|
{
|
|
! MinecraftServer.getServer().worldServers[0].commandToggleDownfall();
|
|
MinecraftServer.getServer().worldServers[0].getWorldInfo().setThundering(true);
|
|
}
|
|
}
|
|
*** CompressedStreamTools.java Sat Feb 5 04:19:39 2022
|
|
--- CompressedStreamTools.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 5,17 ****
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.DataInput;
|
|
import java.io.DataInputStream;
|
|
import java.io.DataOutput;
|
|
import java.io.DataOutputStream;
|
|
- import java.io.File;
|
|
- import java.io.FileInputStream;
|
|
- import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.OutputStream;
|
|
import java.util.zip.GZIPInputStream;
|
|
import java.util.zip.GZIPOutputStream;
|
|
--- 5,14 ----
|
|
***************
|
|
*** 85,158 ****
|
|
{
|
|
var2.close();
|
|
}
|
|
|
|
return var1.toByteArray();
|
|
- }
|
|
-
|
|
- public static void safeWrite(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException
|
|
- {
|
|
- File var2 = new File(par1File.getAbsolutePath() + "_tmp");
|
|
-
|
|
- if (var2.exists())
|
|
- {
|
|
- var2.delete();
|
|
- }
|
|
-
|
|
- write(par0NBTTagCompound, var2);
|
|
-
|
|
- if (par1File.exists())
|
|
- {
|
|
- par1File.delete();
|
|
- }
|
|
-
|
|
- if (par1File.exists())
|
|
- {
|
|
- throw new IOException("Failed to delete " + par1File);
|
|
- }
|
|
- else
|
|
- {
|
|
- var2.renameTo(par1File);
|
|
- }
|
|
- }
|
|
-
|
|
- public static void write(NBTTagCompound par0NBTTagCompound, File par1File) throws IOException
|
|
- {
|
|
- DataOutputStream var2 = new DataOutputStream(new FileOutputStream(par1File));
|
|
-
|
|
- try
|
|
- {
|
|
- write(par0NBTTagCompound, var2);
|
|
- }
|
|
- finally
|
|
- {
|
|
- var2.close();
|
|
- }
|
|
- }
|
|
-
|
|
- public static NBTTagCompound read(File par0File) throws IOException
|
|
- {
|
|
- if (!par0File.exists())
|
|
- {
|
|
- return null;
|
|
- }
|
|
- else
|
|
- {
|
|
- DataInputStream var1 = new DataInputStream(new FileInputStream(par0File));
|
|
- NBTTagCompound var2;
|
|
-
|
|
- try
|
|
- {
|
|
- var2 = read(var1);
|
|
- }
|
|
- finally
|
|
- {
|
|
- var1.close();
|
|
- }
|
|
-
|
|
- return var2;
|
|
- }
|
|
}
|
|
|
|
/**
|
|
* Reads from a CompressedStream.
|
|
*/
|
|
--- 82,91 ----
|
|
*** Container.java Sat Feb 5 04:19:39 2022
|
|
--- Container.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 12,22 ****
|
|
public List inventoryItemStacks = new ArrayList();
|
|
|
|
/** the list of all slots in the inventory */
|
|
public List inventorySlots = new ArrayList();
|
|
public int windowId;
|
|
- private short transactionID;
|
|
private int field_94535_f = -1;
|
|
private int field_94536_g;
|
|
private final Set field_94537_h = new HashSet();
|
|
|
|
/**
|
|
--- 12,21 ----
|
|
***************
|
|
*** 24,66 ****
|
|
*/
|
|
protected List crafters = new ArrayList();
|
|
private Set playerList = new HashSet();
|
|
|
|
/**
|
|
! * the slot is assumed empty
|
|
*/
|
|
protected Slot addSlotToContainer(Slot par1Slot)
|
|
{
|
|
par1Slot.slotNumber = this.inventorySlots.size();
|
|
this.inventorySlots.add(par1Slot);
|
|
this.inventoryItemStacks.add((Object)null);
|
|
return par1Slot;
|
|
}
|
|
|
|
! public void addCraftingToCrafters(ICrafting par1ICrafting)
|
|
{
|
|
if (this.crafters.contains(par1ICrafting))
|
|
{
|
|
throw new IllegalArgumentException("Listener already listening");
|
|
}
|
|
else
|
|
{
|
|
this.crafters.add(par1ICrafting);
|
|
! par1ICrafting.sendContainerAndContentsToPlayer(this, this.getInventory());
|
|
this.detectAndSendChanges();
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Remove this crafting listener from the listener list.
|
|
- */
|
|
- public void removeCraftingFromCrafters(ICrafting par1ICrafting)
|
|
- {
|
|
- this.crafters.remove(par1ICrafting);
|
|
- }
|
|
-
|
|
- /**
|
|
* returns a list if itemStacks, for each slot.
|
|
*/
|
|
public List getInventory()
|
|
{
|
|
ArrayList var1 = new ArrayList();
|
|
--- 23,57 ----
|
|
*/
|
|
protected List crafters = new ArrayList();
|
|
private Set playerList = new HashSet();
|
|
|
|
/**
|
|
! * Adds an item slot to this container
|
|
*/
|
|
protected Slot addSlotToContainer(Slot par1Slot)
|
|
{
|
|
par1Slot.slotNumber = this.inventorySlots.size();
|
|
this.inventorySlots.add(par1Slot);
|
|
this.inventoryItemStacks.add((Object)null);
|
|
return par1Slot;
|
|
}
|
|
|
|
! public void onCraftGuiOpened(ICrafting par1ICrafting)
|
|
{
|
|
if (this.crafters.contains(par1ICrafting))
|
|
{
|
|
throw new IllegalArgumentException("Listener already listening");
|
|
}
|
|
else
|
|
{
|
|
this.crafters.add(par1ICrafting);
|
|
! par1ICrafting.updateCraftingInventory(this, this.getInventory());
|
|
this.detectAndSendChanges();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* returns a list if itemStacks, for each slot.
|
|
*/
|
|
public List getInventory()
|
|
{
|
|
ArrayList var1 = new ArrayList();
|
|
***************
|
|
*** 108,118 ****
|
|
{
|
|
for (int var3 = 0; var3 < this.inventorySlots.size(); ++var3)
|
|
{
|
|
Slot var4 = (Slot)this.inventorySlots.get(var3);
|
|
|
|
! if (var4.isSlotInInventory(par1IInventory, par2))
|
|
{
|
|
return var4;
|
|
}
|
|
}
|
|
|
|
--- 99,109 ----
|
|
{
|
|
for (int var3 = 0; var3 < this.inventorySlots.size(); ++var3)
|
|
{
|
|
Slot var4 = (Slot)this.inventorySlots.get(var3);
|
|
|
|
! if (var4.isHere(par1IInventory, par2))
|
|
{
|
|
return var4;
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 123,133 ****
|
|
{
|
|
return (Slot)this.inventorySlots.get(par1);
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
Slot var3 = (Slot)this.inventorySlots.get(par2);
|
|
return var3 != null ? var3.getStack() : null;
|
|
--- 114,124 ----
|
|
{
|
|
return (Slot)this.inventorySlots.get(par1);
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
Slot var3 = (Slot)this.inventorySlots.get(par2);
|
|
return var3 != null ? var3.getStack() : null;
|
|
***************
|
|
*** 540,582 ****
|
|
{
|
|
this.getSlot(par1).putStack(par2ItemStack);
|
|
}
|
|
|
|
/**
|
|
! * places itemstacks in first x slots, x being aitemstack.lenght
|
|
*/
|
|
! public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack)
|
|
! {
|
|
! for (int var2 = 0; var2 < par1ArrayOfItemStack.length; ++var2)
|
|
! {
|
|
! this.getSlot(var2).putStack(par1ArrayOfItemStack[var2]);
|
|
! }
|
|
! }
|
|
!
|
|
! public void updateProgressBar(int par1, int par2) {}
|
|
!
|
|
! /**
|
|
! * Gets a unique transaction ID. Parameter is unused.
|
|
! */
|
|
! public short getNextTransactionID(InventoryPlayer par1InventoryPlayer)
|
|
! {
|
|
! ++this.transactionID;
|
|
! return this.transactionID;
|
|
! }
|
|
!
|
|
! /**
|
|
! * NotUsing because adding a player twice is an error
|
|
! */
|
|
! public boolean isPlayerNotUsingContainer(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return !this.playerList.contains(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * adds or removes the player from the container based on par2
|
|
*/
|
|
! public void setPlayerIsPresent(EntityPlayer par1EntityPlayer, boolean par2)
|
|
{
|
|
if (par2)
|
|
{
|
|
this.playerList.remove(par1EntityPlayer);
|
|
}
|
|
--- 531,551 ----
|
|
{
|
|
this.getSlot(par1).putStack(par2ItemStack);
|
|
}
|
|
|
|
/**
|
|
! * gets whether or not the player can craft in this inventory or not
|
|
*/
|
|
! public boolean getCanCraft(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return !this.playerList.contains(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * sets whether the player can craft in this inventory or not
|
|
*/
|
|
! public void setCanCraft(EntityPlayer par1EntityPlayer, boolean par2)
|
|
{
|
|
if (par2)
|
|
{
|
|
this.playerList.remove(par1EntityPlayer);
|
|
}
|
|
***************
|
|
*** 687,701 ****
|
|
}
|
|
|
|
public static int func_94532_c(int par0)
|
|
{
|
|
return par0 & 3;
|
|
- }
|
|
-
|
|
- public static int func_94534_d(int par0, int par1)
|
|
- {
|
|
- return par0 & 3 | (par1 & 3) << 2;
|
|
}
|
|
|
|
public static boolean func_94528_d(int par0)
|
|
{
|
|
return par0 == 0 || par0 == 1;
|
|
--- 656,665 ----
|
|
*** ContainerBeacon.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerBeacon.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 36,71 ****
|
|
this.field_82865_g = par2TileEntityBeacon.getLevels();
|
|
this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect();
|
|
this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect();
|
|
}
|
|
|
|
! public void addCraftingToCrafters(ICrafting par1ICrafting)
|
|
{
|
|
! super.addCraftingToCrafters(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.field_82865_g);
|
|
par1ICrafting.sendProgressBarUpdate(this, 1, this.field_82867_h);
|
|
par1ICrafting.sendProgressBarUpdate(this, 2, this.field_82868_i);
|
|
}
|
|
|
|
- public void updateProgressBar(int par1, int par2)
|
|
- {
|
|
- if (par1 == 0)
|
|
- {
|
|
- this.theBeacon.setLevels(par2);
|
|
- }
|
|
-
|
|
- if (par1 == 1)
|
|
- {
|
|
- this.theBeacon.setPrimaryEffect(par2);
|
|
- }
|
|
-
|
|
- if (par1 == 2)
|
|
- {
|
|
- this.theBeacon.setSecondaryEffect(par2);
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the Tile Entity behind this beacon inventory / container
|
|
*/
|
|
public TileEntityBeacon getBeacon()
|
|
{
|
|
--- 36,53 ----
|
|
this.field_82865_g = par2TileEntityBeacon.getLevels();
|
|
this.field_82867_h = par2TileEntityBeacon.getPrimaryEffect();
|
|
this.field_82868_i = par2TileEntityBeacon.getSecondaryEffect();
|
|
}
|
|
|
|
! public void onCraftGuiOpened(ICrafting par1ICrafting)
|
|
{
|
|
! super.onCraftGuiOpened(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.field_82865_g);
|
|
par1ICrafting.sendProgressBarUpdate(this, 1, this.field_82867_h);
|
|
par1ICrafting.sendProgressBarUpdate(this, 2, this.field_82868_i);
|
|
}
|
|
|
|
/**
|
|
* Returns the Tile Entity behind this beacon inventory / container
|
|
*/
|
|
public TileEntityBeacon getBeacon()
|
|
{
|
|
***************
|
|
*** 76,86 ****
|
|
{
|
|
return this.theBeacon.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 58,68 ----
|
|
{
|
|
return this.theBeacon.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerBrewingStand.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerBrewingStand.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 29,41 ****
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
|
}
|
|
}
|
|
|
|
! public void addCraftingToCrafters(ICrafting par1ICrafting)
|
|
{
|
|
! super.addCraftingToCrafters(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime());
|
|
}
|
|
|
|
/**
|
|
* Looks for changes made in the container, sends them to every listener.
|
|
--- 29,41 ----
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
|
}
|
|
}
|
|
|
|
! public void onCraftGuiOpened(ICrafting par1ICrafting)
|
|
{
|
|
! super.onCraftGuiOpened(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getBrewTime());
|
|
}
|
|
|
|
/**
|
|
* Looks for changes made in the container, sends them to every listener.
|
|
***************
|
|
*** 55,79 ****
|
|
}
|
|
|
|
this.brewTime = this.tileBrewingStand.getBrewTime();
|
|
}
|
|
|
|
- public void updateProgressBar(int par1, int par2)
|
|
- {
|
|
- if (par1 == 0)
|
|
- {
|
|
- this.tileBrewingStand.setBrewTime(par2);
|
|
- }
|
|
- }
|
|
-
|
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 55,71 ----
|
|
}
|
|
|
|
this.brewTime = this.tileBrewingStand.getBrewTime();
|
|
}
|
|
|
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return this.tileBrewingStand.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerChest.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerChest.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 40,50 ****
|
|
{
|
|
return this.lowerChestInventory.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 40,50 ----
|
|
{
|
|
return this.lowerChestInventory.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerDispenser.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerDispenser.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 36,46 ****
|
|
{
|
|
return this.tileEntityDispenser.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 36,46 ----
|
|
{
|
|
return this.tileEntityDispenser.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerEnchantment.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerEnchantment.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 42,54 ****
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142));
|
|
}
|
|
}
|
|
|
|
! public void addCraftingToCrafters(ICrafting par1ICrafting)
|
|
{
|
|
! super.addCraftingToCrafters(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]);
|
|
par1ICrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]);
|
|
par1ICrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]);
|
|
}
|
|
|
|
--- 42,54 ----
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 8 + var6 * 18, 142));
|
|
}
|
|
}
|
|
|
|
! public void onCraftGuiOpened(ICrafting par1ICrafting)
|
|
{
|
|
! super.onCraftGuiOpened(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]);
|
|
par1ICrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]);
|
|
par1ICrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]);
|
|
}
|
|
|
|
***************
|
|
*** 66,87 ****
|
|
var2.sendProgressBarUpdate(this, 1, this.enchantLevels[1]);
|
|
var2.sendProgressBarUpdate(this, 2, this.enchantLevels[2]);
|
|
}
|
|
}
|
|
|
|
- public void updateProgressBar(int par1, int par2)
|
|
- {
|
|
- if (par1 >= 0 && par1 <= 2)
|
|
- {
|
|
- this.enchantLevels[par1] = par2;
|
|
- }
|
|
- else
|
|
- {
|
|
- super.updateProgressBar(par1, par2);
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Callback for when the crafting matrix is changed.
|
|
*/
|
|
public void onCraftMatrixChanged(IInventory par1IInventory)
|
|
{
|
|
--- 66,75 ----
|
|
***************
|
|
*** 235,245 ****
|
|
{
|
|
return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 223,233 ----
|
|
{
|
|
return this.worldPointer.getBlockId(this.posX, this.posY, this.posZ) != Block.enchantmentTable.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerFurnace.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerFurnace.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 27,39 ****
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
|
}
|
|
}
|
|
|
|
! public void addCraftingToCrafters(ICrafting par1ICrafting)
|
|
{
|
|
! super.addCraftingToCrafters(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime);
|
|
par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime);
|
|
par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime);
|
|
}
|
|
|
|
--- 27,39 ----
|
|
{
|
|
this.addSlotToContainer(new Slot(par1InventoryPlayer, var3, 8 + var3 * 18, 142));
|
|
}
|
|
}
|
|
|
|
! public void onCraftGuiOpened(ICrafting par1ICrafting)
|
|
{
|
|
! super.onCraftGuiOpened(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.furnace.furnaceCookTime);
|
|
par1ICrafting.sendProgressBarUpdate(this, 1, this.furnace.furnaceBurnTime);
|
|
par1ICrafting.sendProgressBarUpdate(this, 2, this.furnace.currentItemBurnTime);
|
|
}
|
|
|
|
***************
|
|
*** 67,101 ****
|
|
this.lastCookTime = this.furnace.furnaceCookTime;
|
|
this.lastBurnTime = this.furnace.furnaceBurnTime;
|
|
this.lastItemBurnTime = this.furnace.currentItemBurnTime;
|
|
}
|
|
|
|
- public void updateProgressBar(int par1, int par2)
|
|
- {
|
|
- if (par1 == 0)
|
|
- {
|
|
- this.furnace.furnaceCookTime = par2;
|
|
- }
|
|
-
|
|
- if (par1 == 1)
|
|
- {
|
|
- this.furnace.furnaceBurnTime = par2;
|
|
- }
|
|
-
|
|
- if (par1 == 2)
|
|
- {
|
|
- this.furnace.currentItemBurnTime = par2;
|
|
- }
|
|
- }
|
|
-
|
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return this.furnace.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 67,83 ----
|
|
this.lastCookTime = this.furnace.furnaceCookTime;
|
|
this.lastBurnTime = this.furnace.furnaceBurnTime;
|
|
this.lastItemBurnTime = this.furnace.currentItemBurnTime;
|
|
}
|
|
|
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return this.furnace.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerHopper.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerHopper.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 34,44 ****
|
|
{
|
|
return this.field_94538_a.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 34,44 ----
|
|
{
|
|
return this.field_94538_a.isUseableByPlayer(par1EntityPlayer);
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerHorseInventory.java Sat Feb 5 04:19:39 2022
|
|
--- ContainerHorseInventory.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 46,56 ****
|
|
{
|
|
return this.field_111243_a.isUseableByPlayer(par1EntityPlayer) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(par1EntityPlayer) < 8.0F;
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 46,56 ----
|
|
{
|
|
return this.field_111243_a.isUseableByPlayer(par1EntityPlayer) && this.theHorse.isEntityAlive() && this.theHorse.getDistanceToEntity(par1EntityPlayer) < 8.0F;
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerHorseInventorySlotArmor.java Sat Feb 5 04:19:40 2022
|
|
--- ContainerHorseInventorySlotArmor.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 18,28 ****
|
|
*/
|
|
public boolean isItemValid(ItemStack par1ItemStack)
|
|
{
|
|
return super.isItemValid(par1ItemStack) && this.theHorse.func_110259_cr() && EntityHorse.func_110211_v(par1ItemStack.itemID);
|
|
}
|
|
-
|
|
- public boolean func_111238_b()
|
|
- {
|
|
- return this.theHorse.func_110259_cr();
|
|
- }
|
|
}
|
|
--- 18,23 ----
|
|
*** ContainerMerchant.java Sat Feb 5 04:19:40 2022
|
|
--- ContainerMerchant.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 36,48 ****
|
|
public InventoryMerchant getMerchantInventory()
|
|
{
|
|
return this.merchantInventory;
|
|
}
|
|
|
|
! public void addCraftingToCrafters(ICrafting par1ICrafting)
|
|
{
|
|
! super.addCraftingToCrafters(par1ICrafting);
|
|
}
|
|
|
|
/**
|
|
* Looks for changes made in the container, sends them to every listener.
|
|
*/
|
|
--- 36,48 ----
|
|
public InventoryMerchant getMerchantInventory()
|
|
{
|
|
return this.merchantInventory;
|
|
}
|
|
|
|
! public void onCraftGuiOpened(ICrafting par1ICrafting)
|
|
{
|
|
! super.onCraftGuiOpened(par1ICrafting);
|
|
}
|
|
|
|
/**
|
|
* Looks for changes made in the container, sends them to every listener.
|
|
*/
|
|
***************
|
|
*** 63,81 ****
|
|
public void setCurrentRecipeIndex(int par1)
|
|
{
|
|
this.merchantInventory.setCurrentRecipeIndex(par1);
|
|
}
|
|
|
|
- public void updateProgressBar(int par1, int par2) {}
|
|
-
|
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return this.theMerchant.getCustomer() == par1EntityPlayer;
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 63,79 ----
|
|
public void setCurrentRecipeIndex(int par1)
|
|
{
|
|
this.merchantInventory.setCurrentRecipeIndex(par1);
|
|
}
|
|
|
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return this.theMerchant.getCustomer() == par1EntityPlayer;
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerPlayer.java Sat Feb 5 04:19:40 2022
|
|
--- ContainerPlayer.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 79,89 ****
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 79,89 ----
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerRepair.java Sat Feb 5 04:19:40 2022
|
|
--- ContainerRepair.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 355,378 ****
|
|
this.outputSlot.setInventorySlotContents(0, var5);
|
|
this.detectAndSendChanges();
|
|
}
|
|
}
|
|
|
|
! public void addCraftingToCrafters(ICrafting par1ICrafting)
|
|
{
|
|
! super.addCraftingToCrafters(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.maximumCost);
|
|
}
|
|
|
|
- public void updateProgressBar(int par1, int par2)
|
|
- {
|
|
- if (par1 == 0)
|
|
- {
|
|
- this.maximumCost = par2;
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Called when the container is closed.
|
|
*/
|
|
public void onContainerClosed(EntityPlayer par1EntityPlayer)
|
|
{
|
|
--- 355,370 ----
|
|
this.outputSlot.setInventorySlotContents(0, var5);
|
|
this.detectAndSendChanges();
|
|
}
|
|
}
|
|
|
|
! public void onCraftGuiOpened(ICrafting par1ICrafting)
|
|
{
|
|
! super.onCraftGuiOpened(par1ICrafting);
|
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.maximumCost);
|
|
}
|
|
|
|
/**
|
|
* Called when the container is closed.
|
|
*/
|
|
public void onContainerClosed(EntityPlayer par1EntityPlayer)
|
|
{
|
|
***************
|
|
*** 396,406 ****
|
|
{
|
|
return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D;
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 388,398 ----
|
|
{
|
|
return this.theWorld.getBlockId(this.field_82861_i, this.field_82858_j, this.field_82859_k) != Block.anvil.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.field_82861_i + 0.5D, (double)this.field_82858_j + 0.5D, (double)this.field_82859_k + 0.5D) <= 64.0D;
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ContainerRepairINNER2.java Sat Feb 5 04:19:40 2022
|
|
--- ContainerRepairINNER2.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 80,90 ****
|
|
this.field_135071_a.setBlockToAir(this.field_135069_b, this.field_135070_c, this.field_135067_d);
|
|
this.field_135071_a.playAuxSFX(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0);
|
|
}
|
|
else
|
|
{
|
|
! this.field_135071_a.setBlockMetadataWithNotify(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2);
|
|
this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0);
|
|
}
|
|
}
|
|
else if (!this.field_135071_a.isRemote)
|
|
{
|
|
--- 80,90 ----
|
|
this.field_135071_a.setBlockToAir(this.field_135069_b, this.field_135070_c, this.field_135067_d);
|
|
this.field_135071_a.playAuxSFX(1020, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0);
|
|
}
|
|
else
|
|
{
|
|
! this.field_135071_a.setBlockMetadata(this.field_135069_b, this.field_135070_c, this.field_135067_d, var4 | var5 << 2, 2);
|
|
this.field_135071_a.playAuxSFX(1021, this.field_135069_b, this.field_135070_c, this.field_135067_d, 0);
|
|
}
|
|
}
|
|
else if (!this.field_135071_a.isRemote)
|
|
{
|
|
*** ContainerWorkbench.java Sat Feb 5 04:19:40 2022
|
|
--- ContainerWorkbench.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 77,87 ****
|
|
{
|
|
return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
|
|
}
|
|
|
|
/**
|
|
! * Called when a player shift-clicks on a slot. You must override this or you will crash when someone does that.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
--- 77,87 ----
|
|
{
|
|
return this.worldObj.getBlockId(this.posX, this.posY, this.posZ) != Block.workbench.blockID ? false : par1EntityPlayer.getDistanceSq((double)this.posX + 0.5D, (double)this.posY + 0.5D, (double)this.posZ + 0.5D) <= 64.0D;
|
|
}
|
|
|
|
/**
|
|
! * Take a stack from the specified inventory slot.
|
|
*/
|
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
|
{
|
|
ItemStack var3 = null;
|
|
Slot var4 = (Slot)this.inventorySlots.get(par2);
|
|
*** ConvertingProgressUpdate.java Sat Feb 5 04:19:40 2022
|
|
--- ConvertingProgressUpdate.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 10,39 ****
|
|
final MinecraftServer mcServer;
|
|
|
|
public ConvertingProgressUpdate(MinecraftServer par1MinecraftServer)
|
|
{
|
|
this.mcServer = par1MinecraftServer;
|
|
! this.field_96245_b = MinecraftServer.getSystemTimeMillis();
|
|
}
|
|
|
|
/**
|
|
! * "Saving level", or the loading,or downloading equivelent
|
|
*/
|
|
! public void displayProgressMessage(String par1Str) {}
|
|
|
|
/**
|
|
* Updates the progress bar on the loading screen to the specified amount. Args: loadProgress
|
|
*/
|
|
public void setLoadingProgress(int par1)
|
|
{
|
|
! if (MinecraftServer.getSystemTimeMillis() - this.field_96245_b >= 1000L)
|
|
{
|
|
! this.field_96245_b = MinecraftServer.getSystemTimeMillis();
|
|
this.mcServer.getLogAgent().logInfo("Converting... " + par1 + "%");
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * This is called with "Working..." by resetProgressAndMessage
|
|
*/
|
|
! public void resetProgresAndWorkingMessage(String par1Str) {}
|
|
}
|
|
--- 10,39 ----
|
|
final MinecraftServer mcServer;
|
|
|
|
public ConvertingProgressUpdate(MinecraftServer par1MinecraftServer)
|
|
{
|
|
this.mcServer = par1MinecraftServer;
|
|
! this.field_96245_b = MinecraftServer.getCurrentTimeMillis();
|
|
}
|
|
|
|
/**
|
|
! * Shows the 'Saving level' string.
|
|
*/
|
|
! public void displaySavingString(String par1Str) {}
|
|
|
|
/**
|
|
* Updates the progress bar on the loading screen to the specified amount. Args: loadProgress
|
|
*/
|
|
public void setLoadingProgress(int par1)
|
|
{
|
|
! if (MinecraftServer.getCurrentTimeMillis() - this.field_96245_b >= 1000L)
|
|
{
|
|
! this.field_96245_b = MinecraftServer.getCurrentTimeMillis();
|
|
this.mcServer.getLogAgent().logInfo("Converting... " + par1 + "%");
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Displays a string on the loading screen supposed to indicate what is being done currently.
|
|
*/
|
|
! public void displayLoadingString(String par1Str) {}
|
|
}
|
|
*** CraftingManager.java Sat Feb 5 04:19:40 2022
|
|
--- CraftingManager.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 89,99 ****
|
|
this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron});
|
|
this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod});
|
|
this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood});
|
|
this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty});
|
|
this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty});
|
|
! this.addRecipe(new ItemStack(Item.minecartTnt, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty});
|
|
this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty});
|
|
this.addRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks});
|
|
this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron});
|
|
this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick});
|
|
this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint});
|
|
--- 89,99 ----
|
|
this.addRecipe(new ItemStack(Item.cauldron, 1), new Object[] {"# #", "# #", "###", '#', Item.ingotIron});
|
|
this.addRecipe(new ItemStack(Item.brewingStand, 1), new Object[] {" B ", "###", '#', Block.cobblestone, 'B', Item.blazeRod});
|
|
this.addRecipe(new ItemStack(Block.pumpkinLantern, 1), new Object[] {"A", "B", 'A', Block.pumpkin, 'B', Block.torchWood});
|
|
this.addRecipe(new ItemStack(Item.minecartCrate, 1), new Object[] {"A", "B", 'A', Block.chest, 'B', Item.minecartEmpty});
|
|
this.addRecipe(new ItemStack(Item.minecartPowered, 1), new Object[] {"A", "B", 'A', Block.furnaceIdle, 'B', Item.minecartEmpty});
|
|
! this.addRecipe(new ItemStack(Item.tntMinecart, 1), new Object[] {"A", "B", 'A', Block.tnt, 'B', Item.minecartEmpty});
|
|
this.addRecipe(new ItemStack(Item.minecartHopper, 1), new Object[] {"A", "B", 'A', Block.hopperBlock, 'B', Item.minecartEmpty});
|
|
this.addRecipe(new ItemStack(Item.boat, 1), new Object[] {"# #", "###", '#', Block.planks});
|
|
this.addRecipe(new ItemStack(Item.bucketEmpty, 1), new Object[] {"# #", " # ", '#', Item.ingotIron});
|
|
this.addRecipe(new ItemStack(Item.flowerPot, 1), new Object[] {"# #", " # ", '#', Item.brick});
|
|
this.addRecipe(new ItemStack(Item.flintAndSteel, 1), new Object[] {"A ", " B", 'A', Item.ingotIron, 'B', Item.flint});
|
|
*** CrashReport.java Sat Feb 5 04:19:40 2022
|
|
--- CrashReport.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 169,186 ****
|
|
this.getSectionsInStringBuilder(var1);
|
|
return var1.toString();
|
|
}
|
|
|
|
/**
|
|
- * Gets the file this crash report is saved into.
|
|
- */
|
|
- public File getFile()
|
|
- {
|
|
- return this.crashReportFile;
|
|
- }
|
|
-
|
|
- /**
|
|
* Saves the complete crash report to the given File.
|
|
*/
|
|
public boolean saveToFile(File par1File, ILogAgent par2ILogAgent)
|
|
{
|
|
if (this.crashReportFile != null)
|
|
--- 169,178 ----
|
|
*** CrashReportCategory.java Sat Feb 5 04:19:40 2022
|
|
--- CrashReportCategory.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 16,30 ****
|
|
{
|
|
this.theCrashReport = par1CrashReport;
|
|
this.field_85076_b = par2Str;
|
|
}
|
|
|
|
- public static String func_85074_a(double par0, double par2, double par4)
|
|
- {
|
|
- return String.format("%.2f,%.2f,%.2f - %s", new Object[] {Double.valueOf(par0), Double.valueOf(par2), Double.valueOf(par4), getLocationInfo(MathHelper.floor_double(par0), MathHelper.floor_double(par2), MathHelper.floor_double(par4))});
|
|
- }
|
|
-
|
|
/**
|
|
* Returns a string with world information on location.Args:x,y,z
|
|
*/
|
|
public static String getLocationInfo(int par0, int par1, int par2)
|
|
{
|
|
--- 16,25 ----
|
|
*** CreativeTabBlock.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabBlock.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabBlock(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Block.plantRed.blockID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabBrewing.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabBrewing.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabBrewing(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.potion.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabCombat.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabCombat.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabCombat(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Block.brick.blockID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabDeco.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabDeco.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabDeco(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.redstone.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabFood.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabFood.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabFood(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.axeIron.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabInventory.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabInventory.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabInventory(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Block.chest.blockID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabMaterial.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabMaterial.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabMaterial(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.stick.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabMisc.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabMisc.java Sat Feb 5 04:19:55 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabMisc(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.compass.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabRedstone.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabRedstone.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabRedstone(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Block.railPowered.blockID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabs.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabs.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 1,9 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class CreativeTabs
|
|
{
|
|
public static final CreativeTabs[] creativeTabArray = new CreativeTabs[12];
|
|
public static final CreativeTabs tabBlock = new CreativeTabCombat(0, "buildingBlocks");
|
|
public static final CreativeTabs tabDecorations = new CreativeTabBlock(1, "decorations");
|
|
--- 1,7 ----
|
|
***************
|
|
*** 19,29 ****
|
|
public static final CreativeTabs tabInventory = (new CreativeTabInventory(11, "inventory")).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle();
|
|
private final int tabIndex;
|
|
private final String tabLabel;
|
|
|
|
/** Texture to use. */
|
|
! private String backgroundImageName = "items.png";
|
|
private boolean hasScrollbar = true;
|
|
|
|
/** Whether to draw the title in the foreground of the creative GUI */
|
|
private boolean drawTitle = true;
|
|
private EnumEnchantmentType[] field_111230_s;
|
|
--- 17,27 ----
|
|
public static final CreativeTabs tabInventory = (new CreativeTabInventory(11, "inventory")).setBackgroundImageName("inventory.png").setNoScrollbar().setNoTitle();
|
|
private final int tabIndex;
|
|
private final String tabLabel;
|
|
|
|
/** Texture to use. */
|
|
! private String theTexture = "items.png";
|
|
private boolean hasScrollbar = true;
|
|
|
|
/** Whether to draw the title in the foreground of the creative GUI */
|
|
private boolean drawTitle = true;
|
|
private EnumEnchantmentType[] field_111230_s;
|
|
***************
|
|
*** 33,209 ****
|
|
this.tabIndex = par1;
|
|
this.tabLabel = par2Str;
|
|
creativeTabArray[par1] = this;
|
|
}
|
|
|
|
- public int getTabIndex()
|
|
- {
|
|
- return this.tabIndex;
|
|
- }
|
|
-
|
|
- public String getTabLabel()
|
|
- {
|
|
- return this.tabLabel;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the translated Label.
|
|
- */
|
|
- public String getTranslatedTabLabel()
|
|
- {
|
|
- return "itemGroup." + this.getTabLabel();
|
|
- }
|
|
-
|
|
- public Item getTabIconItem()
|
|
- {
|
|
- return Item.itemsList[this.getTabIconItemIndex()];
|
|
- }
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return 1;
|
|
- }
|
|
-
|
|
- public String getBackgroundImageName()
|
|
- {
|
|
- return this.backgroundImageName;
|
|
- }
|
|
-
|
|
public CreativeTabs setBackgroundImageName(String par1Str)
|
|
{
|
|
! this.backgroundImageName = par1Str;
|
|
return this;
|
|
}
|
|
|
|
- public boolean drawInForegroundOfTab()
|
|
- {
|
|
- return this.drawTitle;
|
|
- }
|
|
-
|
|
public CreativeTabs setNoTitle()
|
|
{
|
|
this.drawTitle = false;
|
|
return this;
|
|
}
|
|
|
|
- public boolean shouldHidePlayerInventory()
|
|
- {
|
|
- return this.hasScrollbar;
|
|
- }
|
|
-
|
|
public CreativeTabs setNoScrollbar()
|
|
{
|
|
this.hasScrollbar = false;
|
|
return this;
|
|
}
|
|
|
|
- /**
|
|
- * returns index % 6
|
|
- */
|
|
- public int getTabColumn()
|
|
- {
|
|
- return this.tabIndex % 6;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns tabIndex < 6
|
|
- */
|
|
- public boolean isTabInFirstRow()
|
|
- {
|
|
- return this.tabIndex < 6;
|
|
- }
|
|
-
|
|
- public EnumEnchantmentType[] func_111225_m()
|
|
- {
|
|
- return this.field_111230_s;
|
|
- }
|
|
-
|
|
public CreativeTabs func_111229_a(EnumEnchantmentType ... par1ArrayOfEnumEnchantmentType)
|
|
{
|
|
this.field_111230_s = par1ArrayOfEnumEnchantmentType;
|
|
return this;
|
|
- }
|
|
-
|
|
- public boolean func_111226_a(EnumEnchantmentType par1EnumEnchantmentType)
|
|
- {
|
|
- if (this.field_111230_s == null)
|
|
- {
|
|
- return false;
|
|
- }
|
|
- else
|
|
- {
|
|
- EnumEnchantmentType[] var2 = this.field_111230_s;
|
|
- int var3 = var2.length;
|
|
-
|
|
- for (int var4 = 0; var4 < var3; ++var4)
|
|
- {
|
|
- EnumEnchantmentType var5 = var2[var4];
|
|
-
|
|
- if (var5 == par1EnumEnchantmentType)
|
|
- {
|
|
- return true;
|
|
- }
|
|
- }
|
|
-
|
|
- return false;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * only shows items which have tabToDisplayOn == this
|
|
- */
|
|
- public void displayAllReleventItems(List par1List)
|
|
- {
|
|
- Item[] var2 = Item.itemsList;
|
|
- int var3 = var2.length;
|
|
-
|
|
- for (int var4 = 0; var4 < var3; ++var4)
|
|
- {
|
|
- Item var5 = var2[var4];
|
|
-
|
|
- if (var5 != null && var5.getCreativeTab() == this)
|
|
- {
|
|
- var5.getSubItems(var5.itemID, this, par1List);
|
|
- }
|
|
- }
|
|
-
|
|
- if (this.func_111225_m() != null)
|
|
- {
|
|
- this.addEnchantmentBooksToList(par1List, this.func_111225_m());
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Adds the enchantment books from the supplied EnumEnchantmentType to the given list.
|
|
- */
|
|
- public void addEnchantmentBooksToList(List par1List, EnumEnchantmentType ... par2ArrayOfEnumEnchantmentType)
|
|
- {
|
|
- Enchantment[] var3 = Enchantment.enchantmentsList;
|
|
- int var4 = var3.length;
|
|
-
|
|
- for (int var5 = 0; var5 < var4; ++var5)
|
|
- {
|
|
- Enchantment var6 = var3[var5];
|
|
-
|
|
- if (var6 != null && var6.type != null)
|
|
- {
|
|
- boolean var7 = false;
|
|
-
|
|
- for (int var8 = 0; var8 < par2ArrayOfEnumEnchantmentType.length && !var7; ++var8)
|
|
- {
|
|
- if (var6.type == par2ArrayOfEnumEnchantmentType[var8])
|
|
- {
|
|
- var7 = true;
|
|
- }
|
|
- }
|
|
-
|
|
- if (var7)
|
|
- {
|
|
- par1List.add(Item.enchantedBook.getEnchantedItemStack(new EnchantmentData(var6, var6.getMaxLevel())));
|
|
- }
|
|
- }
|
|
- }
|
|
}
|
|
}
|
|
--- 31,59 ----
|
|
this.tabIndex = par1;
|
|
this.tabLabel = par2Str;
|
|
creativeTabArray[par1] = this;
|
|
}
|
|
|
|
public CreativeTabs setBackgroundImageName(String par1Str)
|
|
{
|
|
! this.theTexture = par1Str;
|
|
return this;
|
|
}
|
|
|
|
public CreativeTabs setNoTitle()
|
|
{
|
|
this.drawTitle = false;
|
|
return this;
|
|
}
|
|
|
|
public CreativeTabs setNoScrollbar()
|
|
{
|
|
this.hasScrollbar = false;
|
|
return this;
|
|
}
|
|
|
|
public CreativeTabs func_111229_a(EnumEnchantmentType ... par1ArrayOfEnumEnchantmentType)
|
|
{
|
|
this.field_111230_s = par1ArrayOfEnumEnchantmentType;
|
|
return this;
|
|
}
|
|
}
|
|
*** CreativeTabSearch.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabSearch.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabSearch(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.appleRed.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabTools.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabTools.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabTools(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.swordGold.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CreativeTabTransport.java Sat Feb 5 04:19:40 2022
|
|
--- CreativeTabTransport.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
CreativeTabTransport(int par1, String par2Str)
|
|
{
|
|
super(par1, par2Str);
|
|
}
|
|
-
|
|
- /**
|
|
- * the itemID for the item to be displayed on the tab
|
|
- */
|
|
- public int getTabIconItemIndex()
|
|
- {
|
|
- return Item.bucketLava.itemID;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** CryptManager.java Sat Feb 5 04:19:40 2022
|
|
--- CryptManager.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 10,32 ****
|
|
import java.security.KeyPairGenerator;
|
|
import java.security.MessageDigest;
|
|
import java.security.NoSuchAlgorithmException;
|
|
import java.security.PrivateKey;
|
|
import java.security.PublicKey;
|
|
- import java.security.SecureRandom;
|
|
import java.security.Security;
|
|
import java.security.spec.InvalidKeySpecException;
|
|
import java.security.spec.X509EncodedKeySpec;
|
|
import javax.crypto.BadPaddingException;
|
|
import javax.crypto.Cipher;
|
|
import javax.crypto.IllegalBlockSizeException;
|
|
import javax.crypto.NoSuchPaddingException;
|
|
import javax.crypto.SecretKey;
|
|
import javax.crypto.spec.SecretKeySpec;
|
|
import org.bouncycastle.crypto.BufferedBlockCipher;
|
|
- import org.bouncycastle.crypto.CipherKeyGenerator;
|
|
- import org.bouncycastle.crypto.KeyGenerationParameters;
|
|
import org.bouncycastle.crypto.engines.AESFastEngine;
|
|
import org.bouncycastle.crypto.io.CipherInputStream;
|
|
import org.bouncycastle.crypto.io.CipherOutputStream;
|
|
import org.bouncycastle.crypto.modes.CFBBlockCipher;
|
|
import org.bouncycastle.crypto.params.KeyParameter;
|
|
--- 10,29 ----
|
|
***************
|
|
*** 34,53 ****
|
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
|
|
|
public class CryptManager
|
|
{
|
|
/**
|
|
! * Generate a new shared secret AES key from a secure random source
|
|
*/
|
|
! public static SecretKey createNewSharedKey()
|
|
! {
|
|
! CipherKeyGenerator var0 = new CipherKeyGenerator();
|
|
! var0.init(new KeyGenerationParameters(new SecureRandom(), 128));
|
|
! return new SecretKeySpec(var0.generateKey(), "AES");
|
|
! }
|
|
!
|
|
! public static KeyPair createNewKeyPair()
|
|
{
|
|
try
|
|
{
|
|
KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA");
|
|
var0.initialize(1024);
|
|
--- 31,43 ----
|
|
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
|
|
|
public class CryptManager
|
|
{
|
|
/**
|
|
! * Generates RSA KeyPair
|
|
*/
|
|
! public static KeyPair generateKeyPair()
|
|
{
|
|
try
|
|
{
|
|
KeyPairGenerator var0 = KeyPairGenerator.getInstance("RSA");
|
|
var0.initialize(1024);
|
|
***************
|
|
*** 131,148 ****
|
|
* Decrypt shared secret AES key using RSA private key
|
|
*/
|
|
public static SecretKey decryptSharedKey(PrivateKey par0PrivateKey, byte[] par1ArrayOfByte)
|
|
{
|
|
return new SecretKeySpec(decryptData(par0PrivateKey, par1ArrayOfByte), "AES");
|
|
- }
|
|
-
|
|
- /**
|
|
- * Encrypt byte[] data with RSA public key
|
|
- */
|
|
- public static byte[] encryptData(Key par0Key, byte[] par1ArrayOfByte)
|
|
- {
|
|
- return cipherOperation(1, par0Key, par1ArrayOfByte);
|
|
}
|
|
|
|
/**
|
|
* Decrypt byte[] data with RSA private key
|
|
*/
|
|
--- 121,130 ----
|
|
*** DamageSource.java Sat Feb 5 04:19:40 2022
|
|
--- DamageSource.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 30,39 ****
|
|
--- 30,41 ----
|
|
|
|
/**
|
|
* Whether this damage source will have its damage amount scaled based on the current difficulty.
|
|
*/
|
|
private boolean difficultyScaled;
|
|
+
|
|
+ /** Whether the damage is magic based. */
|
|
private boolean magicDamage;
|
|
private boolean explosion;
|
|
public String damageType;
|
|
|
|
public static DamageSource causeMobDamage(EntityLivingBase par0EntityLivingBase)
|
|
*** DataWatcher.java Sat Feb 5 04:19:40 2022
|
|
--- DataWatcher.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 149,159 ****
|
|
{
|
|
WatchableObject.setWatchableObjectWatched(this.getWatchedObject(par1), true);
|
|
this.objectChanged = true;
|
|
}
|
|
|
|
! public boolean hasChanges()
|
|
{
|
|
return this.objectChanged;
|
|
}
|
|
|
|
/**
|
|
--- 149,162 ----
|
|
{
|
|
WatchableObject.setWatchableObjectWatched(this.getWatchedObject(par1), true);
|
|
this.objectChanged = true;
|
|
}
|
|
|
|
! /**
|
|
! * true if one or more object was changed
|
|
! */
|
|
! public boolean hasObjectChanged()
|
|
{
|
|
return this.objectChanged;
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 333,362 ****
|
|
|
|
var1.add(var5);
|
|
}
|
|
|
|
return var1;
|
|
- }
|
|
-
|
|
- public void updateWatchedObjectsFromList(List par1List)
|
|
- {
|
|
- this.lock.writeLock().lock();
|
|
- Iterator var2 = par1List.iterator();
|
|
-
|
|
- while (var2.hasNext())
|
|
- {
|
|
- WatchableObject var3 = (WatchableObject)var2.next();
|
|
- WatchableObject var4 = (WatchableObject)this.watchedObjects.get(Integer.valueOf(var3.getDataValueId()));
|
|
-
|
|
- if (var4 != null)
|
|
- {
|
|
- var4.setObject(var3.getObject());
|
|
- }
|
|
- }
|
|
-
|
|
- this.lock.writeLock().unlock();
|
|
- this.objectChanged = true;
|
|
}
|
|
|
|
public boolean getIsBlank()
|
|
{
|
|
return this.isBlank;
|
|
--- 336,345 ----
|
|
*** DedicatedServer.java Sat Feb 5 04:19:40 2022
|
|
--- DedicatedServer.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 51,69 ****
|
|
this.setHostname("127.0.0.1");
|
|
}
|
|
else
|
|
{
|
|
this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true));
|
|
! this.setHostname(this.settings.getProperty("server-ip", ""));
|
|
}
|
|
|
|
this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true));
|
|
this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true));
|
|
this.setAllowPvp(this.settings.getBooleanProperty("pvp", true));
|
|
this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false));
|
|
! this.setTexturePack(this.settings.getProperty("texture-pack", ""));
|
|
! this.setMOTD(this.settings.getProperty("motd", "A Minecraft Server"));
|
|
this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false));
|
|
this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0));
|
|
|
|
if (this.settings.getIntProperty("difficulty", 1) < 0)
|
|
{
|
|
--- 51,69 ----
|
|
this.setHostname("127.0.0.1");
|
|
}
|
|
else
|
|
{
|
|
this.setOnlineMode(this.settings.getBooleanProperty("online-mode", true));
|
|
! this.setHostname(this.settings.getStringProperty("server-ip", ""));
|
|
}
|
|
|
|
this.setCanSpawnAnimals(this.settings.getBooleanProperty("spawn-animals", true));
|
|
this.setCanSpawnNPCs(this.settings.getBooleanProperty("spawn-npcs", true));
|
|
this.setAllowPvp(this.settings.getBooleanProperty("pvp", true));
|
|
this.setAllowFlight(this.settings.getBooleanProperty("allow-flight", false));
|
|
! this.setTexturePack(this.settings.getStringProperty("texture-pack", ""));
|
|
! this.setMOTD(this.settings.getStringProperty("motd", "A Minecraft Server"));
|
|
this.setForceGamemode(this.settings.getBooleanProperty("force-gamemode", false));
|
|
this.func_143006_e(this.settings.getIntProperty("player-idle-timeout", 0));
|
|
|
|
if (this.settings.getIntProperty("difficulty", 1) < 0)
|
|
{
|
|
***************
|
|
*** 89,99 ****
|
|
{
|
|
this.setServerPort(this.settings.getIntProperty("server-port", 25565));
|
|
}
|
|
|
|
this.getLogAgent().logInfo("Generating keypair");
|
|
! this.setKeyPair(CryptManager.createNewKeyPair());
|
|
this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort());
|
|
|
|
try
|
|
{
|
|
this.networkThread = new DedicatedServerListenThread(this, var3, this.getServerPort());
|
|
--- 89,99 ----
|
|
{
|
|
this.setServerPort(this.settings.getIntProperty("server-port", 25565));
|
|
}
|
|
|
|
this.getLogAgent().logInfo("Generating keypair");
|
|
! this.setKeyPair(CryptManager.generateKeyPair());
|
|
this.getLogAgent().logInfo("Starting Minecraft server on " + (this.getServerHostname().length() == 0 ? "*" : this.getServerHostname()) + ":" + this.getServerPort());
|
|
|
|
try
|
|
{
|
|
this.networkThread = new DedicatedServerListenThread(this, var3, this.getServerPort());
|
|
***************
|
|
*** 117,132 ****
|
|
this.setConfigurationManager(new DedicatedPlayerList(this));
|
|
long var4 = System.nanoTime();
|
|
|
|
if (this.getFolderName() == null)
|
|
{
|
|
! this.setFolderName(this.settings.getProperty("level-name", "world"));
|
|
}
|
|
|
|
! String var6 = this.settings.getProperty("level-seed", "");
|
|
! String var7 = this.settings.getProperty("level-type", "DEFAULT");
|
|
! String var8 = this.settings.getProperty("generator-settings", "");
|
|
long var9 = (new Random()).nextLong();
|
|
|
|
if (var6.length() > 0)
|
|
{
|
|
try
|
|
--- 117,132 ----
|
|
this.setConfigurationManager(new DedicatedPlayerList(this));
|
|
long var4 = System.nanoTime();
|
|
|
|
if (this.getFolderName() == null)
|
|
{
|
|
! this.setFolderName(this.settings.getStringProperty("level-name", "world"));
|
|
}
|
|
|
|
! String var6 = this.settings.getStringProperty("level-seed", "");
|
|
! String var7 = this.settings.getStringProperty("level-type", "DEFAULT");
|
|
! String var8 = this.settings.getStringProperty("generator-settings", "");
|
|
long var9 = (new Random()).nextLong();
|
|
|
|
if (var6.length() > 0)
|
|
{
|
|
try
|
|
***************
|
|
*** 314,324 ****
|
|
/**
|
|
* Gets a string property. If it does not exist, set it to the specified value.
|
|
*/
|
|
public String getStringProperty(String par1Str, String par2Str)
|
|
{
|
|
! return this.settings.getProperty(par1Str, par2Str);
|
|
}
|
|
|
|
/**
|
|
* Gets a boolean property. If it does not exist, set it to the specified value.
|
|
*/
|
|
--- 314,324 ----
|
|
/**
|
|
* Gets a string property. If it does not exist, set it to the specified value.
|
|
*/
|
|
public String getStringProperty(String par1Str, String par2Str)
|
|
{
|
|
! return this.settings.getStringProperty(par1Str, par2Str);
|
|
}
|
|
|
|
/**
|
|
* Gets a boolean property. If it does not exist, set it to the specified value.
|
|
*/
|
|
***************
|
|
*** 348,357 ****
|
|
--- 348,363 ----
|
|
*/
|
|
public String getSettingsFilename()
|
|
{
|
|
File var1 = this.settings.getPropertiesFile();
|
|
return var1 != null ? var1.getAbsolutePath() : "No settings file";
|
|
+ }
|
|
+
|
|
+ public void func_120011_ar()
|
|
+ {
|
|
+ MinecraftServerGui.func_120016_a(this);
|
|
+ this.guiIsEnabled = true;
|
|
}
|
|
|
|
public boolean getGuiEnabled()
|
|
{
|
|
return this.guiIsEnabled;
|
|
*** DedicatedServerListenThread.java Sat Feb 5 04:19:40 2022
|
|
--- DedicatedServerListenThread.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 22,37 ****
|
|
this.theServerListenThread.func_71768_b();
|
|
this.theServerListenThread.interrupt();
|
|
}
|
|
|
|
/**
|
|
! * processes packets and pending connections
|
|
*/
|
|
! public void networkTick()
|
|
{
|
|
this.theServerListenThread.processPendingConnections();
|
|
! super.networkTick();
|
|
}
|
|
|
|
public DedicatedServer getDedicatedServer()
|
|
{
|
|
return (DedicatedServer)super.getServer();
|
|
--- 22,37 ----
|
|
this.theServerListenThread.func_71768_b();
|
|
this.theServerListenThread.interrupt();
|
|
}
|
|
|
|
/**
|
|
! * Handles all incoming connections and packets
|
|
*/
|
|
! public void handleNetworkListenThread()
|
|
{
|
|
this.theServerListenThread.processPendingConnections();
|
|
! super.handleNetworkListenThread();
|
|
}
|
|
|
|
public DedicatedServer getDedicatedServer()
|
|
{
|
|
return (DedicatedServer)super.getServer();
|
|
*** DemoWorldManager.java Sat Feb 5 04:19:40 2022
|
|
--- DemoWorldManager.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 20,30 ****
|
|
long var3 = var1 / 24000L + 1L;
|
|
|
|
if (!this.field_73105_c && this.field_73102_f > 20)
|
|
{
|
|
this.field_73105_c = true;
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 0));
|
|
}
|
|
|
|
this.demoTimeExpired = var1 > 120500L;
|
|
|
|
if (this.demoTimeExpired)
|
|
--- 20,30 ----
|
|
long var3 = var1 / 24000L + 1L;
|
|
|
|
if (!this.field_73105_c && this.field_73102_f > 20)
|
|
{
|
|
this.field_73105_c = true;
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 0));
|
|
}
|
|
|
|
this.demoTimeExpired = var1 > 120500L;
|
|
|
|
if (this.demoTimeExpired)
|
|
***************
|
|
*** 41,59 ****
|
|
}
|
|
else if (var3 == 1L)
|
|
{
|
|
if (var1 == 100L)
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 101));
|
|
}
|
|
else if (var1 == 175L)
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 102));
|
|
}
|
|
else if (var1 == 250L)
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(5, 103));
|
|
}
|
|
}
|
|
else if (var3 == 5L && var1 % 24000L == 22000L)
|
|
{
|
|
this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning"));
|
|
--- 41,59 ----
|
|
}
|
|
else if (var3 == 1L)
|
|
{
|
|
if (var1 == 100L)
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 101));
|
|
}
|
|
else if (var1 == 175L)
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 102));
|
|
}
|
|
else if (var1 == 250L)
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(5, 103));
|
|
}
|
|
}
|
|
else if (var3 == 5L && var1 % 24000L == 22000L)
|
|
{
|
|
this.thisPlayerMP.sendChatToPlayer(ChatMessageComponent.createFromTranslationKey("demo.day.warning"));
|
|
***************
|
|
*** 86,100 ****
|
|
{
|
|
super.onBlockClicked(par1, par2, par3, par4);
|
|
}
|
|
}
|
|
|
|
! public void uncheckedTryHarvestBlock(int par1, int par2, int par3)
|
|
{
|
|
if (!this.demoTimeExpired)
|
|
{
|
|
! super.uncheckedTryHarvestBlock(par1, par2, par3);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Attempts to harvest a block at the given coordinate
|
|
--- 86,100 ----
|
|
{
|
|
super.onBlockClicked(par1, par2, par3, par4);
|
|
}
|
|
}
|
|
|
|
! public void blockRemoving(int par1, int par2, int par3)
|
|
{
|
|
if (!this.demoTimeExpired)
|
|
{
|
|
! super.blockRemoving(par1, par2, par3);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Attempts to harvest a block at the given coordinate
|
|
*** DerivedWorldInfo.java Sat Feb 5 04:19:40 2022
|
|
--- DerivedWorldInfo.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 69,98 ****
|
|
public long getWorldTime()
|
|
{
|
|
return this.theWorldInfo.getWorldTime();
|
|
}
|
|
|
|
- public long getSizeOnDisk()
|
|
- {
|
|
- return this.theWorldInfo.getSizeOnDisk();
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the player's NBTTagCompound to be loaded
|
|
*/
|
|
public NBTTagCompound getPlayerNBTTagCompound()
|
|
{
|
|
return this.theWorldInfo.getPlayerNBTTagCompound();
|
|
}
|
|
|
|
! /**
|
|
! * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer
|
|
! * WorldProvider.dimensionID accessed from World.provider.dimensionID
|
|
! */
|
|
! public int getVanillaDimension()
|
|
{
|
|
! return this.theWorldInfo.getVanillaDimension();
|
|
}
|
|
|
|
/**
|
|
* Get current world name
|
|
*/
|
|
--- 69,89 ----
|
|
public long getWorldTime()
|
|
{
|
|
return this.theWorldInfo.getWorldTime();
|
|
}
|
|
|
|
/**
|
|
* Returns the player's NBTTagCompound to be loaded
|
|
*/
|
|
public NBTTagCompound getPlayerNBTTagCompound()
|
|
{
|
|
return this.theWorldInfo.getPlayerNBTTagCompound();
|
|
}
|
|
|
|
! public int getDimension()
|
|
{
|
|
! return this.theWorldInfo.getDimension();
|
|
}
|
|
|
|
/**
|
|
* Get current world name
|
|
*/
|
|
***************
|
|
*** 108,125 ****
|
|
{
|
|
return this.theWorldInfo.getSaveVersion();
|
|
}
|
|
|
|
/**
|
|
- * Return the last time the player was in this world.
|
|
- */
|
|
- public long getLastTimePlayed()
|
|
- {
|
|
- return this.theWorldInfo.getLastTimePlayed();
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns true if it is thundering, false otherwise.
|
|
*/
|
|
public boolean isThundering()
|
|
{
|
|
return this.theWorldInfo.isThundering();
|
|
--- 99,108 ----
|
|
***************
|
|
*** 154,178 ****
|
|
*/
|
|
public EnumGameType getGameType()
|
|
{
|
|
return this.theWorldInfo.getGameType();
|
|
}
|
|
-
|
|
- /**
|
|
- * Set the x spawn position to the passed in value
|
|
- */
|
|
- public void setSpawnX(int par1) {}
|
|
-
|
|
- /**
|
|
- * Sets the y spawn position
|
|
- */
|
|
- public void setSpawnY(int par1) {}
|
|
-
|
|
- /**
|
|
- * Set the z spawn position to the passed in value
|
|
- */
|
|
- public void setSpawnZ(int par1) {}
|
|
|
|
public void incrementTotalWorldTime(long par1) {}
|
|
|
|
/**
|
|
* Set current world time
|
|
--- 137,146 ----
|
|
*** Direction.java Sat Feb 5 04:19:40 2022
|
|
--- Direction.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 12,24 ****
|
|
/** Maps a Facing value (3D) to a Direction value (2D). */
|
|
public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3};
|
|
|
|
/** Maps a direction to that opposite of it. */
|
|
public static final int[] rotateOpposite = new int[] {2, 3, 0, 1};
|
|
!
|
|
! /** Maps a direction to that to the right of it. */
|
|
! public static final int[] rotateRight = new int[] {1, 2, 3, 0};
|
|
|
|
/** Maps a direction to that to the left of it. */
|
|
public static final int[] rotateLeft = new int[] {3, 0, 1, 2};
|
|
public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}};
|
|
|
|
--- 12,22 ----
|
|
/** Maps a Facing value (3D) to a Direction value (2D). */
|
|
public static final int[] facingToDirection = new int[] { -1, -1, 2, 0, 1, 3};
|
|
|
|
/** Maps a direction to that opposite of it. */
|
|
public static final int[] rotateOpposite = new int[] {2, 3, 0, 1};
|
|
! public static final int[] enderEyeMetaToDirection = new int[] {1, 2, 3, 0};
|
|
|
|
/** Maps a direction to that to the left of it. */
|
|
public static final int[] rotateLeft = new int[] {3, 0, 1, 2};
|
|
public static final int[][] bedDirection = new int[][] {{1, 0, 3, 2, 5, 4}, {1, 0, 5, 4, 2, 3}, {1, 0, 2, 3, 4, 5}, {1, 0, 4, 5, 3, 2}};
|
|
|
|
*** EmptyChunk.java Sat Feb 5 04:19:40 2022
|
|
--- EmptyChunk.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 25,39 ****
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
- * Generates the height map for a chunk from scratch
|
|
- */
|
|
- public void generateHeightMap() {}
|
|
-
|
|
- /**
|
|
* Generates the initial skylight map for the chunk upon generation or load.
|
|
*/
|
|
public void generateSkylightMap() {}
|
|
|
|
/**
|
|
--- 25,34 ----
|
|
***************
|
|
*** 48,58 ****
|
|
{
|
|
return 255;
|
|
}
|
|
|
|
/**
|
|
! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata
|
|
*/
|
|
public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
return true;
|
|
}
|
|
--- 43,54 ----
|
|
{
|
|
return 255;
|
|
}
|
|
|
|
/**
|
|
! * Sets a blockID of a position within a chunk with metadata. Args: x, y, z, blockID, metadata. Return true if the
|
|
! * id or meta was changed.
|
|
*/
|
|
public boolean setBlockIDWithMetadata(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
return true;
|
|
}
|
|
*** EnchantmentHelper.java Sat Feb 5 04:19:40 2022
|
|
--- EnchantmentHelper.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 228,238 ****
|
|
/**
|
|
* Returns the 'Water Breathing' modifier of enchantments on player equipped armors.
|
|
*/
|
|
public static int getRespiration(EntityLivingBase par0EntityLivingBase)
|
|
{
|
|
! return getMaxEnchantmentLevel(Enchantment.respiration.effectId, par0EntityLivingBase.getLastActiveItems());
|
|
}
|
|
|
|
/**
|
|
* Return the extra efficiency of tools based on enchantments on equipped player item.
|
|
*/
|
|
--- 228,238 ----
|
|
/**
|
|
* Returns the 'Water Breathing' modifier of enchantments on player equipped armors.
|
|
*/
|
|
public static int getRespiration(EntityLivingBase par0EntityLivingBase)
|
|
{
|
|
! return getMaxEnchantmentLevel(Enchantment.respiration.effectId, par0EntityLivingBase.getInventory());
|
|
}
|
|
|
|
/**
|
|
* Return the extra efficiency of tools based on enchantments on equipped player item.
|
|
*/
|
|
***************
|
|
*** 268,288 ****
|
|
/**
|
|
* Returns the aqua affinity status of enchantments on current equipped item of player.
|
|
*/
|
|
public static boolean getAquaAffinityModifier(EntityLivingBase par0EntityLivingBase)
|
|
{
|
|
! return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, par0EntityLivingBase.getLastActiveItems()) > 0;
|
|
}
|
|
|
|
public static int func_92098_i(EntityLivingBase par0EntityLivingBase)
|
|
{
|
|
! return getMaxEnchantmentLevel(Enchantment.thorns.effectId, par0EntityLivingBase.getLastActiveItems());
|
|
}
|
|
|
|
public static ItemStack func_92099_a(Enchantment par0Enchantment, EntityLivingBase par1EntityLivingBase)
|
|
{
|
|
! ItemStack[] var2 = par1EntityLivingBase.getLastActiveItems();
|
|
int var3 = var2.length;
|
|
|
|
for (int var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
ItemStack var5 = var2[var4];
|
|
--- 268,288 ----
|
|
/**
|
|
* Returns the aqua affinity status of enchantments on current equipped item of player.
|
|
*/
|
|
public static boolean getAquaAffinityModifier(EntityLivingBase par0EntityLivingBase)
|
|
{
|
|
! return getMaxEnchantmentLevel(Enchantment.aquaAffinity.effectId, par0EntityLivingBase.getInventory()) > 0;
|
|
}
|
|
|
|
public static int func_92098_i(EntityLivingBase par0EntityLivingBase)
|
|
{
|
|
! return getMaxEnchantmentLevel(Enchantment.thorns.effectId, par0EntityLivingBase.getInventory());
|
|
}
|
|
|
|
public static ItemStack func_92099_a(Enchantment par0Enchantment, EntityLivingBase par1EntityLivingBase)
|
|
{
|
|
! ItemStack[] var2 = par1EntityLivingBase.getInventory();
|
|
int var3 = var2.length;
|
|
|
|
for (int var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
ItemStack var5 = var2[var4];
|
|
*** EnchantmentModifierLiving.java Sat Feb 5 04:19:40 2022
|
|
--- EnchantmentModifierLiving.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 4,17 ****
|
|
{
|
|
/**
|
|
* Used to calculate the (magic) extra damage based on enchantments of current equipped player item.
|
|
*/
|
|
public float livingModifier;
|
|
-
|
|
- /**
|
|
- * Used as parameter to calculate the (magic) extra damage based on enchantments of current equipped player item.
|
|
- */
|
|
public EntityLivingBase entityLiving;
|
|
|
|
private EnchantmentModifierLiving() {}
|
|
|
|
/**
|
|
--- 4,13 ----
|
|
*** EnchantmentProtection.java Sat Feb 5 04:19:40 2022
|
|
--- EnchantmentProtection.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 105,115 ****
|
|
/**
|
|
* Gets the amount of ticks an entity should be set fire, adjusted for fire protection.
|
|
*/
|
|
public static int getFireTimeForEntity(Entity par0Entity, int par1)
|
|
{
|
|
! int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, par0Entity.getLastActiveItems());
|
|
|
|
if (var2 > 0)
|
|
{
|
|
par1 -= MathHelper.floor_float((float)par1 * (float)var2 * 0.15F);
|
|
}
|
|
--- 105,115 ----
|
|
/**
|
|
* Gets the amount of ticks an entity should be set fire, adjusted for fire protection.
|
|
*/
|
|
public static int getFireTimeForEntity(Entity par0Entity, int par1)
|
|
{
|
|
! int var2 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.fireProtection.effectId, par0Entity.getInventory());
|
|
|
|
if (var2 > 0)
|
|
{
|
|
par1 -= MathHelper.floor_float((float)par1 * (float)var2 * 0.15F);
|
|
}
|
|
***************
|
|
*** 117,127 ****
|
|
return par1;
|
|
}
|
|
|
|
public static double func_92092_a(Entity par0Entity, double par1)
|
|
{
|
|
! int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, par0Entity.getLastActiveItems());
|
|
|
|
if (var3 > 0)
|
|
{
|
|
par1 -= (double)MathHelper.floor_double(par1 * (double)((float)var3 * 0.15F));
|
|
}
|
|
--- 117,127 ----
|
|
return par1;
|
|
}
|
|
|
|
public static double func_92092_a(Entity par0Entity, double par1)
|
|
{
|
|
! int var3 = EnchantmentHelper.getMaxEnchantmentLevel(Enchantment.blastProtection.effectId, par0Entity.getInventory());
|
|
|
|
if (var3 > 0)
|
|
{
|
|
par1 -= (double)MathHelper.floor_double(par1 * (double)((float)var3 * 0.15F));
|
|
}
|
|
*** Entity.java Sat Feb 5 04:19:40 2022
|
|
--- Entity.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 77,87 ****
|
|
public boolean velocityChanged;
|
|
protected boolean isInWeb;
|
|
public boolean field_70135_K;
|
|
|
|
/**
|
|
! * Gets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term)
|
|
*/
|
|
public boolean isDead;
|
|
public float yOffset;
|
|
|
|
/** How wide this entity is considered to be */
|
|
--- 77,87 ----
|
|
public boolean velocityChanged;
|
|
protected boolean isInWeb;
|
|
public boolean field_70135_K;
|
|
|
|
/**
|
|
! * gets set by setEntityDead, so this must be the flag whether an Entity is dead (inactive may be better term)
|
|
*/
|
|
public boolean isDead;
|
|
public float yOffset;
|
|
|
|
/** How wide this entity is considered to be */
|
|
***************
|
|
*** 163,175 ****
|
|
/** Has this entity been added to the chunk its within */
|
|
public boolean addedToChunk;
|
|
public int chunkCoordX;
|
|
public int chunkCoordY;
|
|
public int chunkCoordZ;
|
|
- public int serverPosX;
|
|
- public int serverPosY;
|
|
- public int serverPosZ;
|
|
|
|
/**
|
|
* Render entity even if it is outside the camera frustum. Only true in EntityFish for now. Used in RenderGlobal:
|
|
* render if ignoreFrustumCheck or in frustum.
|
|
*/
|
|
--- 163,172 ----
|
|
***************
|
|
*** 232,266 ****
|
|
{
|
|
return this.entityId;
|
|
}
|
|
|
|
/**
|
|
- * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned
|
|
- * (only actually used on players though its also on Entity)
|
|
- */
|
|
- protected void preparePlayerToSpawn()
|
|
- {
|
|
- if (this.worldObj != null)
|
|
- {
|
|
- while (this.posY > 0.0D)
|
|
- {
|
|
- this.setPosition(this.posX, this.posY, this.posZ);
|
|
-
|
|
- if (this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty())
|
|
- {
|
|
- break;
|
|
- }
|
|
-
|
|
- ++this.posY;
|
|
- }
|
|
-
|
|
- this.motionX = this.motionY = this.motionZ = 0.0D;
|
|
- this.rotationPitch = 0.0F;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Will get destroyed next tick.
|
|
*/
|
|
public void setDead()
|
|
{
|
|
this.isDead = true;
|
|
--- 229,238 ----
|
|
***************
|
|
*** 315,325 ****
|
|
this.myEntitySize = EnumEntitySize.SIZE_6;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Sets the rotation of the entity
|
|
*/
|
|
protected void setRotation(float par1, float par2)
|
|
{
|
|
this.rotationYaw = par1 % 360.0F;
|
|
this.rotationPitch = par2 % 360.0F;
|
|
--- 287,297 ----
|
|
this.myEntitySize = EnumEntitySize.SIZE_6;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Sets the rotation of the entity. Args: yaw, pitch (both in degrees)
|
|
*/
|
|
protected void setRotation(float par1, float par2)
|
|
{
|
|
this.rotationYaw = par1 % 360.0F;
|
|
this.rotationPitch = par2 % 360.0F;
|
|
***************
|
|
*** 337,371 ****
|
|
float var8 = this.height;
|
|
this.boundingBox.setBounds(par1 - (double)var7, par3 - (double)this.yOffset + (double)this.ySize, par5 - (double)var7, par1 + (double)var7, par3 - (double)this.yOffset + (double)this.ySize + (double)var8, par5 + (double)var7);
|
|
}
|
|
|
|
/**
|
|
- * Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both
|
|
- * arguments in degrees.
|
|
- */
|
|
- public void setAngles(float par1, float par2)
|
|
- {
|
|
- float var3 = this.rotationPitch;
|
|
- float var4 = this.rotationYaw;
|
|
- this.rotationYaw = (float)((double)this.rotationYaw + (double)par1 * 0.15D);
|
|
- this.rotationPitch = (float)((double)this.rotationPitch - (double)par2 * 0.15D);
|
|
-
|
|
- if (this.rotationPitch < -90.0F)
|
|
- {
|
|
- this.rotationPitch = -90.0F;
|
|
- }
|
|
-
|
|
- if (this.rotationPitch > 90.0F)
|
|
- {
|
|
- this.rotationPitch = 90.0F;
|
|
- }
|
|
-
|
|
- this.prevRotationPitch += this.rotationPitch - var3;
|
|
- this.prevRotationYaw += this.rotationYaw - var4;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
this.onEntityUpdate();
|
|
--- 309,318 ----
|
|
***************
|
|
*** 1178,1204 ****
|
|
this.motionX += (double)(par1 * var6 - par2 * var5);
|
|
this.motionZ += (double)(par2 * var6 + par1 * var5);
|
|
}
|
|
}
|
|
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- int var2 = MathHelper.floor_double(this.posX);
|
|
- int var3 = MathHelper.floor_double(this.posZ);
|
|
-
|
|
- if (this.worldObj.blockExists(var2, 0, var3))
|
|
- {
|
|
- double var4 = (this.boundingBox.maxY - this.boundingBox.minY) * 0.66D;
|
|
- int var6 = MathHelper.floor_double(this.posY - (double)this.yOffset + var4);
|
|
- return this.worldObj.getLightBrightnessForSkyBlocks(var2, var6, var3, 0);
|
|
- }
|
|
- else
|
|
- {
|
|
- return 0;
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Gets how bright this entity is.
|
|
*/
|
|
public float getBrightness(float par1)
|
|
{
|
|
--- 1125,1134 ----
|
|
***************
|
|
*** 1405,1437 ****
|
|
* entity, scoreToAdd
|
|
*/
|
|
public void addToPlayerScore(Entity par1Entity, int par2) {}
|
|
|
|
/**
|
|
- * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D
|
|
- */
|
|
- public boolean isInRangeToRenderVec3D(Vec3 par1Vec3)
|
|
- {
|
|
- double var2 = this.posX - par1Vec3.xCoord;
|
|
- double var4 = this.posY - par1Vec3.yCoord;
|
|
- double var6 = this.posZ - par1Vec3.zCoord;
|
|
- double var8 = var2 * var2 + var4 * var4 + var6 * var6;
|
|
- return this.isInRangeToRenderDist(var8);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- double var3 = this.boundingBox.getAverageEdgeLength();
|
|
- var3 *= 64.0D * this.renderDistanceWeight;
|
|
- return par1 < var3 * var3;
|
|
- }
|
|
-
|
|
- /**
|
|
* Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their
|
|
* riders.
|
|
*/
|
|
public boolean writeMountToNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
--- 1335,1344 ----
|
|
***************
|
|
*** 1634,1648 ****
|
|
}
|
|
|
|
return var2;
|
|
}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return this.height / 2.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* Drops an item stack at the entity's position. Args: itemID, count
|
|
*/
|
|
public EntityItem dropItem(int par1, int par2)
|
|
{
|
|
--- 1541,1550 ----
|
|
***************
|
|
*** 1846,1884 ****
|
|
this.ridingEntity = par1Entity;
|
|
par1Entity.riddenByEntity = this;
|
|
}
|
|
}
|
|
|
|
- /**
|
|
- * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
|
- * posY, posZ, yaw, pitch
|
|
- */
|
|
- public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
|
- {
|
|
- this.setPosition(par1, par3, par5);
|
|
- this.setRotation(par7, par8);
|
|
- List var10 = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.contract(0.03125D, 0.0D, 0.03125D));
|
|
-
|
|
- if (!var10.isEmpty())
|
|
- {
|
|
- double var11 = 0.0D;
|
|
-
|
|
- for (int var13 = 0; var13 < var10.size(); ++var13)
|
|
- {
|
|
- AxisAlignedBB var14 = (AxisAlignedBB)var10.get(var13);
|
|
-
|
|
- if (var14.maxY > var11)
|
|
- {
|
|
- var11 = var14.maxY;
|
|
- }
|
|
- }
|
|
-
|
|
- par3 += var11 - this.boundingBox.minY;
|
|
- this.setPosition(par1, par3, par5);
|
|
- }
|
|
- }
|
|
-
|
|
public float getCollisionBorderSize()
|
|
{
|
|
return 0.1F;
|
|
}
|
|
|
|
--- 1748,1757 ----
|
|
***************
|
|
*** 1920,1946 ****
|
|
{
|
|
return 900;
|
|
}
|
|
|
|
/**
|
|
! * Sets the velocity to the args. Args: x, y, z
|
|
*/
|
|
! public void setVelocity(double par1, double par3, double par5)
|
|
! {
|
|
! this.motionX = par1;
|
|
! this.motionY = par3;
|
|
! this.motionZ = par5;
|
|
! }
|
|
!
|
|
! public void handleHealthUpdate(byte par1) {}
|
|
!
|
|
! /**
|
|
! * Setups the entity to do the hurt animation. Only used by packets in multiplayer.
|
|
! */
|
|
! public void performHurtAnimation() {}
|
|
!
|
|
! public ItemStack[] getLastActiveItems()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
--- 1793,1805 ----
|
|
{
|
|
return 900;
|
|
}
|
|
|
|
/**
|
|
! * returns the inventory of this entity (only used in EntityPlayerMP it seems)
|
|
*/
|
|
! public ItemStack[] getInventory()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 2000,2029 ****
|
|
public boolean isInvisible()
|
|
{
|
|
return this.getFlag(5);
|
|
}
|
|
|
|
- /**
|
|
- * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic
|
|
- * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible
|
|
- * will render the entity semitransparent.
|
|
- */
|
|
- public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer)
|
|
- {
|
|
- return this.isInvisible();
|
|
- }
|
|
-
|
|
public void setInvisible(boolean par1)
|
|
{
|
|
this.setFlag(5, par1);
|
|
}
|
|
|
|
- public boolean isEating()
|
|
- {
|
|
- return this.getFlag(4);
|
|
- }
|
|
-
|
|
public void setEating(boolean par1)
|
|
{
|
|
this.setFlag(4, par1);
|
|
}
|
|
|
|
--- 1859,1873 ----
|
|
***************
|
|
*** 2220,2234 ****
|
|
{
|
|
return 0.0F;
|
|
}
|
|
|
|
/**
|
|
- * Sets the head's yaw rotation of the entity.
|
|
- */
|
|
- public void setRotationYawHead(float par1) {}
|
|
-
|
|
- /**
|
|
* If returns false, the item will not inflict any damage against entities.
|
|
*/
|
|
public boolean canAttackWithItem()
|
|
{
|
|
return true;
|
|
--- 2064,2073 ----
|
|
***************
|
|
*** 2367,2384 ****
|
|
par1CrashReportCategory.addCrashSection("Entity ID", Integer.valueOf(this.entityId));
|
|
par1CrashReportCategory.addCrashSectionCallable("Entity Name", new CallableEntityName(this));
|
|
par1CrashReportCategory.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ)}));
|
|
par1CrashReportCategory.addCrashSection("Entity\'s Block location", CrashReportCategory.getLocationInfo(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)));
|
|
par1CrashReportCategory.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] {Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ)}));
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return whether this entity should be rendered as on fire.
|
|
- */
|
|
- public boolean canRenderOnFire()
|
|
- {
|
|
- return this.isBurning();
|
|
}
|
|
|
|
public UUID getUniqueID()
|
|
{
|
|
return this.entityUniqueID;
|
|
--- 2206,2215 ----
|
|
*** EntityAIAttackOnCollide.java Sat Feb 5 04:19:40 2022
|
|
--- EntityAIAttackOnCollide.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 7,17 ****
|
|
|
|
/**
|
|
* An amount of decrementing ticks that allows the entity to attack once the tick reaches 0.
|
|
*/
|
|
int attackTick;
|
|
! double field_75440_e;
|
|
|
|
/**
|
|
* When true, the mob will continue chasing its target, even if it can't find a path to them right now.
|
|
*/
|
|
boolean longMemory;
|
|
--- 7,19 ----
|
|
|
|
/**
|
|
* An amount of decrementing ticks that allows the entity to attack once the tick reaches 0.
|
|
*/
|
|
int attackTick;
|
|
!
|
|
! /** The speed with which the mob will approach the target */
|
|
! double speedTowardsTarget;
|
|
|
|
/**
|
|
* When true, the mob will continue chasing its target, even if it can't find a path to them right now.
|
|
*/
|
|
boolean longMemory;
|
|
***************
|
|
*** 29,39 ****
|
|
|
|
public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, double par2, boolean par4)
|
|
{
|
|
this.attacker = par1EntityCreature;
|
|
this.worldObj = par1EntityCreature.worldObj;
|
|
! this.field_75440_e = par2;
|
|
this.longMemory = par4;
|
|
this.setMutexBits(3);
|
|
}
|
|
|
|
/**
|
|
--- 31,41 ----
|
|
|
|
public EntityAIAttackOnCollide(EntityCreature par1EntityCreature, double par2, boolean par4)
|
|
{
|
|
this.attacker = par1EntityCreature;
|
|
this.worldObj = par1EntityCreature.worldObj;
|
|
! this.speedTowardsTarget = par2;
|
|
this.longMemory = par4;
|
|
this.setMutexBits(3);
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 74,84 ****
|
|
/**
|
|
* Execute a one shot task or start executing a continuous task
|
|
*/
|
|
public void startExecuting()
|
|
{
|
|
! this.attacker.getNavigator().setPath(this.entityPathEntity, this.field_75440_e);
|
|
this.field_75445_i = 0;
|
|
}
|
|
|
|
/**
|
|
* Resets the task
|
|
--- 76,86 ----
|
|
/**
|
|
* Execute a one shot task or start executing a continuous task
|
|
*/
|
|
public void startExecuting()
|
|
{
|
|
! this.attacker.getNavigator().setPath(this.entityPathEntity, this.speedTowardsTarget);
|
|
this.field_75445_i = 0;
|
|
}
|
|
|
|
/**
|
|
* Resets the task
|
|
***************
|
|
*** 97,107 ****
|
|
this.attacker.getLookHelper().setLookPositionWithEntity(var1, 30.0F, 30.0F);
|
|
|
|
if ((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0)
|
|
{
|
|
this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7);
|
|
! this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.field_75440_e);
|
|
}
|
|
|
|
this.attackTick = Math.max(this.attackTick - 1, 0);
|
|
double var2 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + var1.width);
|
|
|
|
--- 99,109 ----
|
|
this.attacker.getLookHelper().setLookPositionWithEntity(var1, 30.0F, 30.0F);
|
|
|
|
if ((this.longMemory || this.attacker.getEntitySenses().canSee(var1)) && --this.field_75445_i <= 0)
|
|
{
|
|
this.field_75445_i = 4 + this.attacker.getRNG().nextInt(7);
|
|
! this.attacker.getNavigator().tryMoveToEntityLiving(var1, this.speedTowardsTarget);
|
|
}
|
|
|
|
this.attackTick = Math.max(this.attackTick - 1, 0);
|
|
double var2 = (double)(this.attacker.width * 2.0F * this.attacker.width * 2.0F + var1.width);
|
|
|
|
*** EntityAIBase.java Sat Feb 5 04:19:40 2022
|
|
--- EntityAIBase.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 20,32 ****
|
|
{
|
|
return this.shouldExecute();
|
|
}
|
|
|
|
/**
|
|
! * Determine if this AI Task is interruptible by a higher (= lower value) priority task.
|
|
*/
|
|
! public boolean isInterruptible()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
--- 20,32 ----
|
|
{
|
|
return this.shouldExecute();
|
|
}
|
|
|
|
/**
|
|
! * Returns whether the task requires multiple updates or not
|
|
*/
|
|
! public boolean isContinuous()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
*** EntityAITasks.java Sat Feb 5 04:19:40 2022
|
|
--- EntityAITasks.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 157,167 ****
|
|
{
|
|
this.theProfiler.endSection();
|
|
return false;
|
|
}
|
|
}
|
|
! else if (this.executingTaskEntries.contains(var3) && !var3.action.isInterruptible())
|
|
{
|
|
this.theProfiler.endSection();
|
|
return false;
|
|
}
|
|
}
|
|
--- 157,167 ----
|
|
{
|
|
this.theProfiler.endSection();
|
|
return false;
|
|
}
|
|
}
|
|
! else if (this.executingTaskEntries.contains(var3) && !var3.action.isContinuous())
|
|
{
|
|
this.theProfiler.endSection();
|
|
return false;
|
|
}
|
|
}
|
|
*** EntityAnimal.java Sat Feb 5 04:19:40 2022
|
|
--- EntityAnimal.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 381,404 ****
|
|
*/
|
|
public boolean canMateWith(EntityAnimal par1EntityAnimal)
|
|
{
|
|
return par1EntityAnimal == this ? false : (par1EntityAnimal.getClass() != this.getClass() ? false : this.isInLove() && par1EntityAnimal.isInLove());
|
|
}
|
|
-
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 18)
|
|
- {
|
|
- for (int var2 = 0; var2 < 7; ++var2)
|
|
- {
|
|
- double var3 = this.rand.nextGaussian() * 0.02D;
|
|
- double var5 = this.rand.nextGaussian() * 0.02D;
|
|
- double var7 = this.rand.nextGaussian() * 0.02D;
|
|
- this.worldObj.spawnParticle("heart", this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7);
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
}
|
|
--- 381,386 ----
|
|
*** EntityArrow.java Sat Feb 5 04:19:40 2022
|
|
--- EntityArrow.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 124,164 ****
|
|
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI);
|
|
this.ticksInGround = 0;
|
|
}
|
|
|
|
/**
|
|
- * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
|
- * posY, posZ, yaw, pitch
|
|
- */
|
|
- public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
|
- {
|
|
- this.setPosition(par1, par3, par5);
|
|
- this.setRotation(par7, par8);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Sets the velocity to the args. Args: x, y, z
|
|
- */
|
|
- public void setVelocity(double par1, double par3, double par5)
|
|
- {
|
|
- this.motionX = par1;
|
|
- this.motionY = par3;
|
|
- this.motionZ = par5;
|
|
-
|
|
- if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
|
- {
|
|
- float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
|
|
- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
|
|
- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI);
|
|
- this.prevRotationPitch = this.rotationPitch;
|
|
- this.prevRotationYaw = this.rotationYaw;
|
|
- this.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
|
- this.ticksInGround = 0;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
super.onUpdate();
|
|
--- 124,133 ----
|
|
***************
|
|
*** 215,225 ****
|
|
else
|
|
{
|
|
++this.ticksInAir;
|
|
Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var4 = this.worldObj.rayTraceBlocks_do_do(var17, var3, false, true);
|
|
var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var4 != null)
|
|
{
|
|
--- 184,194 ----
|
|
else
|
|
{
|
|
++this.ticksInAir;
|
|
Vec3 var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var4 = this.worldObj.rayTraceBlocks(var17, var3, false, true);
|
|
var17 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var3 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var4 != null)
|
|
{
|
|
***************
|
|
*** 327,337 ****
|
|
EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.rand);
|
|
}
|
|
|
|
if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
|
|
{
|
|
! ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(6, 0));
|
|
}
|
|
}
|
|
|
|
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
|
|
|
|
--- 296,306 ----
|
|
EnchantmentThorns.func_92096_a(this.shootingEntity, var25, this.rand);
|
|
}
|
|
|
|
if (this.shootingEntity != null && var4.entityHit != this.shootingEntity && var4.entityHit instanceof EntityPlayer && this.shootingEntity instanceof EntityPlayerMP)
|
|
{
|
|
! ((EntityPlayerMP)this.shootingEntity).playerNetServerHandler.sendPacket(new Packet70GameEvent(6, 0));
|
|
}
|
|
}
|
|
|
|
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
|
|
|
|
***************
|
|
*** 507,521 ****
|
|
* prevent them from trampling crops
|
|
*/
|
|
protected boolean canTriggerWalking()
|
|
{
|
|
return false;
|
|
- }
|
|
-
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
}
|
|
|
|
public void setDamage(double par1)
|
|
{
|
|
this.damage = par1;
|
|
--- 476,485 ----
|
|
*** EntityBat.java Sat Feb 5 04:19:40 2022
|
|
--- EntityBat.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 2,16 ****
|
|
|
|
import java.util.Calendar;
|
|
|
|
public class EntityBat extends EntityAmbientCreature
|
|
{
|
|
! /**
|
|
! * randomly selected ChunkCoordinates in a 7x6x7 box around the bat (y offset -2 to 4) towards which it will fly.
|
|
! * upon getting close a new target will be selected
|
|
! */
|
|
! private ChunkCoordinates currentFlightTarget;
|
|
|
|
public EntityBat(World par1World)
|
|
{
|
|
super(par1World);
|
|
this.setSize(0.5F, 0.9F);
|
|
--- 2,13 ----
|
|
|
|
import java.util.Calendar;
|
|
|
|
public class EntityBat extends EntityAmbientCreature
|
|
{
|
|
! /** Coordinates of where the bat spawned. */
|
|
! private ChunkCoordinates spawnPosition;
|
|
|
|
public EntityBat(World par1World)
|
|
{
|
|
super(par1World);
|
|
this.setSize(0.5F, 0.9F);
|
|
***************
|
|
*** 151,173 ****
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! if (this.currentFlightTarget != null && (!this.worldObj.isAirBlock(this.currentFlightTarget.posX, this.currentFlightTarget.posY, this.currentFlightTarget.posZ) || this.currentFlightTarget.posY < 1))
|
|
{
|
|
! this.currentFlightTarget = null;
|
|
}
|
|
|
|
! if (this.currentFlightTarget == null || this.rand.nextInt(30) == 0 || this.currentFlightTarget.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F)
|
|
{
|
|
! this.currentFlightTarget = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7));
|
|
}
|
|
|
|
! double var1 = (double)this.currentFlightTarget.posX + 0.5D - this.posX;
|
|
! double var3 = (double)this.currentFlightTarget.posY + 0.1D - this.posY;
|
|
! double var5 = (double)this.currentFlightTarget.posZ + 0.5D - this.posZ;
|
|
this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D;
|
|
this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D;
|
|
this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D;
|
|
float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F;
|
|
float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw);
|
|
--- 148,170 ----
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! if (this.spawnPosition != null && (!this.worldObj.isAirBlock(this.spawnPosition.posX, this.spawnPosition.posY, this.spawnPosition.posZ) || this.spawnPosition.posY < 1))
|
|
{
|
|
! this.spawnPosition = null;
|
|
}
|
|
|
|
! if (this.spawnPosition == null || this.rand.nextInt(30) == 0 || this.spawnPosition.getDistanceSquared((int)this.posX, (int)this.posY, (int)this.posZ) < 4.0F)
|
|
{
|
|
! this.spawnPosition = new ChunkCoordinates((int)this.posX + this.rand.nextInt(7) - this.rand.nextInt(7), (int)this.posY + this.rand.nextInt(6) - 2, (int)this.posZ + this.rand.nextInt(7) - this.rand.nextInt(7));
|
|
}
|
|
|
|
! double var1 = (double)this.spawnPosition.posX + 0.5D - this.posX;
|
|
! double var3 = (double)this.spawnPosition.posY + 0.1D - this.posY;
|
|
! double var5 = (double)this.spawnPosition.posZ + 0.5D - this.posZ;
|
|
this.motionX += (Math.signum(var1) * 0.5D - this.motionX) * 0.10000000149011612D;
|
|
this.motionY += (Math.signum(var3) * 0.699999988079071D - this.motionY) * 0.10000000149011612D;
|
|
this.motionZ += (Math.signum(var5) * 0.5D - this.motionZ) * 0.10000000149011612D;
|
|
float var7 = (float)(Math.atan2(this.motionZ, this.motionX) * 180.0D / Math.PI) - 90.0F;
|
|
float var8 = MathHelper.wrapAngleTo180_float(var7 - this.rotationYaw);
|
|
*** EntityBlaze.java Sat Feb 5 04:19:40 2022
|
|
--- EntityBlaze.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 50,64 ****
|
|
protected String getDeathSound()
|
|
{
|
|
return "mob.blaze.death";
|
|
}
|
|
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- return 15728880;
|
|
- }
|
|
-
|
|
/**
|
|
* Gets how bright this entity is.
|
|
*/
|
|
public float getBrightness(float par1)
|
|
{
|
|
--- 50,59 ----
|
|
***************
|
|
*** 185,196 ****
|
|
{
|
|
return this.func_70845_n();
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
if (par1)
|
|
{
|
|
--- 180,190 ----
|
|
{
|
|
return this.func_70845_n();
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
if (par1)
|
|
{
|
|
*** EntityBoat.java Sat Feb 5 04:19:40 2022
|
|
--- EntityBoat.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 10,22 ****
|
|
private double boatX;
|
|
private double boatY;
|
|
private double boatZ;
|
|
private double boatYaw;
|
|
private double boatPitch;
|
|
- private double velocityX;
|
|
- private double velocityY;
|
|
- private double velocityZ;
|
|
|
|
public EntityBoat(World par1World)
|
|
{
|
|
super(par1World);
|
|
this.field_70279_a = true;
|
|
--- 10,19 ----
|
|
***************
|
|
*** 126,198 ****
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Setups the entity to do the hurt animation. Only used by packets in multiplayer.
|
|
- */
|
|
- public void performHurtAnimation()
|
|
- {
|
|
- this.setForwardDirection(-this.getForwardDirection());
|
|
- this.setTimeSinceHit(10);
|
|
- this.setDamageTaken(this.getDamageTaken() * 11.0F);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns true if other Entities should be prevented from moving through this Entity.
|
|
*/
|
|
public boolean canBeCollidedWith()
|
|
{
|
|
return !this.isDead;
|
|
}
|
|
|
|
/**
|
|
- * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
|
- * posY, posZ, yaw, pitch
|
|
- */
|
|
- public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
|
- {
|
|
- if (this.field_70279_a)
|
|
- {
|
|
- this.boatPosRotationIncrements = par9 + 5;
|
|
- }
|
|
- else
|
|
- {
|
|
- double var10 = par1 - this.posX;
|
|
- double var12 = par3 - this.posY;
|
|
- double var14 = par5 - this.posZ;
|
|
- double var16 = var10 * var10 + var12 * var12 + var14 * var14;
|
|
-
|
|
- if (var16 <= 1.0D)
|
|
- {
|
|
- return;
|
|
- }
|
|
-
|
|
- this.boatPosRotationIncrements = 3;
|
|
- }
|
|
-
|
|
- this.boatX = par1;
|
|
- this.boatY = par3;
|
|
- this.boatZ = par5;
|
|
- this.boatYaw = (double)par7;
|
|
- this.boatPitch = (double)par8;
|
|
- this.motionX = this.velocityX;
|
|
- this.motionY = this.velocityY;
|
|
- this.motionZ = this.velocityZ;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Sets the velocity to the args. Args: x, y, z
|
|
- */
|
|
- public void setVelocity(double par1, double par3, double par5)
|
|
- {
|
|
- this.velocityX = this.motionX = par1;
|
|
- this.velocityY = this.motionY = par3;
|
|
- this.velocityZ = this.motionZ = par5;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
super.onUpdate();
|
|
--- 123,140 ----
|
|
***************
|
|
*** 475,489 ****
|
|
/**
|
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
|
*/
|
|
protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* First layer of player interaction
|
|
*/
|
|
public boolean interactFirst(EntityPlayer par1EntityPlayer)
|
|
{
|
|
--- 417,426 ----
|
|
***************
|
|
*** 546,557 ****
|
|
* Gets the forward direction of the entity.
|
|
*/
|
|
public int getForwardDirection()
|
|
{
|
|
return this.dataWatcher.getWatchableObjectInt(18);
|
|
- }
|
|
-
|
|
- public void func_70270_d(boolean par1)
|
|
- {
|
|
- this.field_70279_a = par1;
|
|
}
|
|
}
|
|
--- 483,489 ----
|
|
*** EntityChicken.java Sat Feb 5 04:19:40 2022
|
|
--- EntityChicken.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 128,139 ****
|
|
{
|
|
return Item.feather.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
|
|
|
|
--- 128,138 ----
|
|
{
|
|
return Item.feather.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
|
|
|
|
*** EntityCow.java Sat Feb 5 04:19:40 2022
|
|
--- EntityCow.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 79,90 ****
|
|
{
|
|
return Item.leather.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
|
|
int var4;
|
|
--- 79,89 ----
|
|
{
|
|
return Item.leather.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
|
|
int var4;
|
|
*** EntityCreature.java Sat Feb 5 04:19:40 2022
|
|
--- EntityCreature.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 245,271 ****
|
|
int var3 = MathHelper.floor_double(this.posZ);
|
|
return super.getCanSpawnHere() && this.getBlockPathWeight(var1, var2, var3) >= 0.0F;
|
|
}
|
|
|
|
/**
|
|
! * Returns true if entity has a path to follow
|
|
*/
|
|
public boolean hasPath()
|
|
{
|
|
return this.pathToEntity != null;
|
|
}
|
|
|
|
/**
|
|
! * sets the Entities walk path in EntityCreature
|
|
*/
|
|
public void setPathToEntity(PathEntity par1PathEntity)
|
|
{
|
|
this.pathToEntity = par1PathEntity;
|
|
}
|
|
|
|
/**
|
|
! * Returns current entities target
|
|
*/
|
|
public Entity getEntityToAttack()
|
|
{
|
|
return this.entityToAttack;
|
|
}
|
|
--- 245,271 ----
|
|
int var3 = MathHelper.floor_double(this.posZ);
|
|
return super.getCanSpawnHere() && this.getBlockPathWeight(var1, var2, var3) >= 0.0F;
|
|
}
|
|
|
|
/**
|
|
! * if the entity got a PathEntity it returns true, else false
|
|
*/
|
|
public boolean hasPath()
|
|
{
|
|
return this.pathToEntity != null;
|
|
}
|
|
|
|
/**
|
|
! * sets the pathToEntity
|
|
*/
|
|
public void setPathToEntity(PathEntity par1PathEntity)
|
|
{
|
|
this.pathToEntity = par1PathEntity;
|
|
}
|
|
|
|
/**
|
|
! * returns the target Entity
|
|
*/
|
|
public Entity getEntityToAttack()
|
|
{
|
|
return this.entityToAttack;
|
|
}
|
|
*** EntityCreeper.java Sat Feb 5 04:19:40 2022
|
|
--- EntityCreeper.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 198,215 ****
|
|
{
|
|
return this.dataWatcher.getWatchableObjectByte(17) == 1;
|
|
}
|
|
|
|
/**
|
|
- * Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited.
|
|
- */
|
|
- public float getCreeperFlashIntensity(float par1)
|
|
- {
|
|
- return ((float)this.lastActiveTime + (float)(this.timeSinceIgnited - this.lastActiveTime) * par1) / (float)(this.fuseTime - 2);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the item ID for the item the mob drops on death.
|
|
*/
|
|
protected int getDropItemId()
|
|
{
|
|
return Item.gunpowder.itemID;
|
|
--- 198,207 ----
|
|
*** EntityDragon.java Sat Feb 5 04:19:40 2022
|
|
--- EntityDragon.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 1,11 ****
|
|
package net.minecraft.src;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
! public class EntityDragon extends EntityLiving implements IBossDisplayData, IEntityMultiPart, IMob
|
|
{
|
|
public double targetX;
|
|
public double targetY;
|
|
public double targetZ;
|
|
|
|
--- 1,11 ----
|
|
package net.minecraft.src;
|
|
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
! public class EntityDragon extends EntityLiving implements IEntityMultiPart, IMob
|
|
{
|
|
public double targetX;
|
|
public double targetY;
|
|
public double targetZ;
|
|
|
|
*** EntityEnderCrystal.java Sat Feb 5 04:19:40 2022
|
|
--- EntityEnderCrystal.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 14,29 ****
|
|
this.yOffset = this.height / 2.0F;
|
|
this.health = 5;
|
|
this.innerRotation = this.rand.nextInt(100000);
|
|
}
|
|
|
|
- public EntityEnderCrystal(World par1World, double par2, double par4, double par6)
|
|
- {
|
|
- this(par1World);
|
|
- this.setPosition(par2, par4, par6);
|
|
- }
|
|
-
|
|
/**
|
|
* returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to
|
|
* prevent them from trampling crops
|
|
*/
|
|
protected boolean canTriggerWalking()
|
|
--- 14,23 ----
|
|
***************
|
|
*** 63,77 ****
|
|
|
|
/**
|
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
|
*/
|
|
protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {}
|
|
-
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
|
|
/**
|
|
* Returns true if other Entities should be prevented from moving through this Entity.
|
|
*/
|
|
public boolean canBeCollidedWith()
|
|
--- 57,66 ----
|
|
*** EntityEnderEye.java Sat Feb 5 04:19:40 2022
|
|
--- EntityEnderEye.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 19,39 ****
|
|
this.setSize(0.25F, 0.25F);
|
|
}
|
|
|
|
protected void entityInit() {}
|
|
|
|
- /**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D;
|
|
- var3 *= 64.0D;
|
|
- return par1 < var3 * var3;
|
|
- }
|
|
-
|
|
public EntityEnderEye(World par1World, double par2, double par4, double par6)
|
|
{
|
|
super(par1World);
|
|
this.despawnTimer = 0;
|
|
this.setSize(0.25F, 0.25F);
|
|
--- 19,28 ----
|
|
***************
|
|
*** 67,93 ****
|
|
this.despawnTimer = 0;
|
|
this.shatterOrDrop = this.rand.nextInt(5) > 0;
|
|
}
|
|
|
|
/**
|
|
- * Sets the velocity to the args. Args: x, y, z
|
|
- */
|
|
- public void setVelocity(double par1, double par3, double par5)
|
|
- {
|
|
- this.motionX = par1;
|
|
- this.motionY = par3;
|
|
- this.motionZ = par5;
|
|
-
|
|
- if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
|
- {
|
|
- float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
|
|
- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
|
|
- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
this.lastTickPosX = this.posX;
|
|
--- 56,65 ----
|
|
***************
|
|
*** 193,218 ****
|
|
/**
|
|
* (abstract) Protected helper method to read subclass entity data from NBT.
|
|
*/
|
|
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) {}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* Gets how bright this entity is.
|
|
*/
|
|
public float getBrightness(float par1)
|
|
{
|
|
return 1.0F;
|
|
- }
|
|
-
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- return 15728880;
|
|
}
|
|
|
|
/**
|
|
* If returns false, the item will not inflict any damage against entities.
|
|
*/
|
|
--- 165,180 ----
|
|
*** EntityEnderman.java Sat Feb 5 04:19:40 2022
|
|
--- EntityEnderman.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 380,391 ****
|
|
{
|
|
return Item.enderPearl.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.getDropItemId();
|
|
|
|
--- 380,390 ----
|
|
{
|
|
return Item.enderPearl.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.getDropItemId();
|
|
|
|
*** EntityEnderPearl.java Sat Feb 5 04:19:40 2022
|
|
--- EntityEnderPearl.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 10,24 ****
|
|
public EntityEnderPearl(World par1World, EntityLivingBase par2EntityLivingBase)
|
|
{
|
|
super(par1World, par2EntityLivingBase);
|
|
}
|
|
|
|
- public EntityEnderPearl(World par1World, double par2, double par4, double par6)
|
|
- {
|
|
- super(par1World, par2, par4, par6);
|
|
- }
|
|
-
|
|
/**
|
|
* Called when this EntityThrowable hits a block or entity.
|
|
*/
|
|
protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
|
|
{
|
|
--- 10,19 ----
|
|
*** EntityFallingSand.java Sat Feb 5 04:19:40 2022
|
|
--- EntityFallingSand.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 274,304 ****
|
|
{
|
|
this.blockID = Block.sand.blockID;
|
|
}
|
|
}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
- public World getWorld()
|
|
- {
|
|
- return this.worldObj;
|
|
- }
|
|
-
|
|
public void setIsAnvil(boolean par1)
|
|
{
|
|
this.isAnvil = par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return whether this entity should be rendered as on fire.
|
|
- */
|
|
- public boolean canRenderOnFire()
|
|
- {
|
|
- return false;
|
|
}
|
|
|
|
public void addEntityCrashInfo(CrashReportCategory par1CrashReportCategory)
|
|
{
|
|
super.addEntityCrashInfo(par1CrashReportCategory);
|
|
--- 274,286 ----
|
|
*** EntityFireball.java Sat Feb 5 04:19:40 2022
|
|
--- EntityFireball.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 22,42 ****
|
|
this.setSize(1.0F, 1.0F);
|
|
}
|
|
|
|
protected void entityInit() {}
|
|
|
|
- /**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D;
|
|
- var3 *= 64.0D;
|
|
- return par1 < var3 * var3;
|
|
- }
|
|
-
|
|
public EntityFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
|
|
{
|
|
super(par1World);
|
|
this.setSize(1.0F, 1.0F);
|
|
this.setLocationAndAngles(par2, par4, par6, this.rotationYaw, this.rotationPitch);
|
|
--- 22,31 ----
|
|
***************
|
|
*** 107,117 ****
|
|
++this.ticksInAir;
|
|
}
|
|
|
|
Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var3 = this.worldObj.clip(var15, var2);
|
|
var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var3 != null)
|
|
{
|
|
--- 96,106 ----
|
|
++this.ticksInAir;
|
|
}
|
|
|
|
Vec3 var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var15, var2);
|
|
var15 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var3 != null)
|
|
{
|
|
***************
|
|
*** 309,331 ****
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* Gets how bright this entity is.
|
|
*/
|
|
public float getBrightness(float par1)
|
|
{
|
|
return 1.0F;
|
|
- }
|
|
-
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- return 15728880;
|
|
}
|
|
}
|
|
--- 298,310 ----
|
|
*** EntityFireworkRocket.java Sat Feb 5 04:19:40 2022
|
|
--- EntityFireworkRocket.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 19,37 ****
|
|
protected void entityInit()
|
|
{
|
|
this.dataWatcher.addObjectByDataType(8, 5);
|
|
}
|
|
|
|
- /**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- return par1 < 4096.0D;
|
|
- }
|
|
-
|
|
public EntityFireworkRocket(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
|
|
{
|
|
super(par1World);
|
|
this.fireworkAge = 0;
|
|
this.setSize(0.25F, 0.25F);
|
|
--- 19,28 ----
|
|
***************
|
|
*** 56,82 ****
|
|
this.motionY = 0.05D;
|
|
this.lifetime = 10 * var9 + this.rand.nextInt(6) + this.rand.nextInt(7);
|
|
}
|
|
|
|
/**
|
|
- * Sets the velocity to the args. Args: x, y, z
|
|
- */
|
|
- public void setVelocity(double par1, double par3, double par5)
|
|
- {
|
|
- this.motionX = par1;
|
|
- this.motionY = par3;
|
|
- this.motionZ = par5;
|
|
-
|
|
- if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
|
- {
|
|
- float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
|
|
- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
|
|
- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
this.lastTickPosX = this.posX;
|
|
--- 47,56 ----
|
|
***************
|
|
*** 130,157 ****
|
|
this.worldObj.setEntityState(this, (byte)17);
|
|
this.setDead();
|
|
}
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 17 && this.worldObj.isRemote)
|
|
- {
|
|
- ItemStack var2 = this.dataWatcher.getWatchableObjectItemStack(8);
|
|
- NBTTagCompound var3 = null;
|
|
-
|
|
- if (var2 != null && var2.hasTagCompound())
|
|
- {
|
|
- var3 = var2.getTagCompound().getCompoundTag("Fireworks");
|
|
- }
|
|
-
|
|
- this.worldObj.func_92088_a(this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ, var3);
|
|
- }
|
|
-
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
-
|
|
/**
|
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
|
*/
|
|
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
--- 104,113 ----
|
|
***************
|
|
*** 185,210 ****
|
|
this.dataWatcher.updateObject(8, var3);
|
|
}
|
|
}
|
|
}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* Gets how bright this entity is.
|
|
*/
|
|
public float getBrightness(float par1)
|
|
{
|
|
return super.getBrightness(par1);
|
|
- }
|
|
-
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- return super.getBrightnessForRender(par1);
|
|
}
|
|
|
|
/**
|
|
* If returns false, the item will not inflict any damage against entities.
|
|
*/
|
|
--- 141,156 ----
|
|
*** EntityFishHook.java Sat Feb 5 04:19:40 2022
|
|
--- EntityFishHook.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 3,69 ****
|
|
import java.util.List;
|
|
|
|
public class EntityFishHook extends Entity
|
|
{
|
|
/** The tile this entity is on, X position */
|
|
! private int xTile;
|
|
|
|
/** The tile this entity is on, Y position */
|
|
! private int yTile;
|
|
|
|
/** The tile this entity is on, Z position */
|
|
! private int zTile;
|
|
private int inTile;
|
|
private boolean inGround;
|
|
public int shake;
|
|
public EntityPlayer angler;
|
|
private int ticksInGround;
|
|
private int ticksInAir;
|
|
|
|
/** the number of ticks remaining until this fish can no longer be caught */
|
|
private int ticksCatchable;
|
|
|
|
! /**
|
|
! * The entity that the fishing rod is connected to, if any. When you right click on the fishing rod and the hook
|
|
! * falls on to an entity, this it that entity.
|
|
! */
|
|
public Entity bobber;
|
|
private int fishPosRotationIncrements;
|
|
private double fishX;
|
|
private double fishY;
|
|
private double fishZ;
|
|
private double fishYaw;
|
|
private double fishPitch;
|
|
- private double velocityX;
|
|
- private double velocityY;
|
|
- private double velocityZ;
|
|
|
|
public EntityFishHook(World par1World)
|
|
{
|
|
super(par1World);
|
|
- this.xTile = -1;
|
|
- this.yTile = -1;
|
|
- this.zTile = -1;
|
|
this.setSize(0.25F, 0.25F);
|
|
this.ignoreFrustumCheck = true;
|
|
}
|
|
|
|
- public EntityFishHook(World par1World, double par2, double par4, double par6, EntityPlayer par8EntityPlayer)
|
|
- {
|
|
- this(par1World);
|
|
- this.setPosition(par2, par4, par6);
|
|
- this.ignoreFrustumCheck = true;
|
|
- this.angler = par8EntityPlayer;
|
|
- par8EntityPlayer.fishEntity = this;
|
|
- }
|
|
-
|
|
public EntityFishHook(World par1World, EntityPlayer par2EntityPlayer)
|
|
{
|
|
super(par1World);
|
|
- this.xTile = -1;
|
|
- this.yTile = -1;
|
|
- this.zTile = -1;
|
|
this.ignoreFrustumCheck = true;
|
|
this.angler = par2EntityPlayer;
|
|
this.angler.fishEntity = this;
|
|
this.setSize(0.25F, 0.25F);
|
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + 1.62D - (double)par2EntityPlayer.yOffset, par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
|
--- 3,48 ----
|
|
import java.util.List;
|
|
|
|
public class EntityFishHook extends Entity
|
|
{
|
|
/** The tile this entity is on, X position */
|
|
! private int xTile = -1;
|
|
|
|
/** The tile this entity is on, Y position */
|
|
! private int yTile = -1;
|
|
|
|
/** The tile this entity is on, Z position */
|
|
! private int zTile = -1;
|
|
private int inTile;
|
|
private boolean inGround;
|
|
public int shake;
|
|
public EntityPlayer angler;
|
|
private int ticksInGround;
|
|
private int ticksInAir;
|
|
|
|
/** the number of ticks remaining until this fish can no longer be caught */
|
|
private int ticksCatchable;
|
|
|
|
! /** the bobber that the fish hit */
|
|
public Entity bobber;
|
|
private int fishPosRotationIncrements;
|
|
private double fishX;
|
|
private double fishY;
|
|
private double fishZ;
|
|
private double fishYaw;
|
|
private double fishPitch;
|
|
|
|
public EntityFishHook(World par1World)
|
|
{
|
|
super(par1World);
|
|
this.setSize(0.25F, 0.25F);
|
|
this.ignoreFrustumCheck = true;
|
|
}
|
|
|
|
public EntityFishHook(World par1World, EntityPlayer par2EntityPlayer)
|
|
{
|
|
super(par1World);
|
|
this.ignoreFrustumCheck = true;
|
|
this.angler = par2EntityPlayer;
|
|
this.angler.fishEntity = this;
|
|
this.setSize(0.25F, 0.25F);
|
|
this.setLocationAndAngles(par2EntityPlayer.posX, par2EntityPlayer.posY + 1.62D - (double)par2EntityPlayer.yOffset, par2EntityPlayer.posZ, par2EntityPlayer.rotationYaw, par2EntityPlayer.rotationPitch);
|
|
***************
|
|
*** 79,99 ****
|
|
this.calculateVelocity(this.motionX, this.motionY, this.motionZ, 1.5F, 1.0F);
|
|
}
|
|
|
|
protected void entityInit() {}
|
|
|
|
- /**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D;
|
|
- var3 *= 64.0D;
|
|
- return par1 < var3 * var3;
|
|
- }
|
|
-
|
|
public void calculateVelocity(double par1, double par3, double par5, float par7, float par8)
|
|
{
|
|
float var9 = MathHelper.sqrt_double(par1 * par1 + par3 * par3 + par5 * par5);
|
|
par1 /= (double)var9;
|
|
par3 /= (double)var9;
|
|
--- 58,67 ----
|
|
***************
|
|
*** 112,148 ****
|
|
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI);
|
|
this.ticksInGround = 0;
|
|
}
|
|
|
|
/**
|
|
- * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
|
- * posY, posZ, yaw, pitch
|
|
- */
|
|
- public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
|
- {
|
|
- this.fishX = par1;
|
|
- this.fishY = par3;
|
|
- this.fishZ = par5;
|
|
- this.fishYaw = (double)par7;
|
|
- this.fishPitch = (double)par8;
|
|
- this.fishPosRotationIncrements = par9;
|
|
- this.motionX = this.velocityX;
|
|
- this.motionY = this.velocityY;
|
|
- this.motionZ = this.velocityZ;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Sets the velocity to the args. Args: x, y, z
|
|
- */
|
|
- public void setVelocity(double par1, double par3, double par5)
|
|
- {
|
|
- this.velocityX = this.motionX = par1;
|
|
- this.velocityY = this.motionY = par3;
|
|
- this.velocityZ = this.motionZ = par5;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
super.onUpdate();
|
|
--- 80,89 ----
|
|
***************
|
|
*** 219,229 ****
|
|
++this.ticksInAir;
|
|
}
|
|
|
|
Vec3 var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var3 = this.worldObj.clip(var20, var2);
|
|
var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var3 != null)
|
|
{
|
|
--- 160,170 ----
|
|
++this.ticksInAir;
|
|
}
|
|
|
|
Vec3 var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var20, var2);
|
|
var20 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var3 != null)
|
|
{
|
|
***************
|
|
*** 414,428 ****
|
|
this.yTile = par1NBTTagCompound.getShort("yTile");
|
|
this.zTile = par1NBTTagCompound.getShort("zTile");
|
|
this.inTile = par1NBTTagCompound.getByte("inTile") & 255;
|
|
this.shake = par1NBTTagCompound.getByte("shake") & 255;
|
|
this.inGround = par1NBTTagCompound.getByte("inGround") == 1;
|
|
- }
|
|
-
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
}
|
|
|
|
public int catchFish()
|
|
{
|
|
if (this.worldObj.isRemote)
|
|
--- 355,364 ----
|
|
*** EntityGhast.java Sat Feb 5 04:19:40 2022
|
|
--- EntityGhast.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 22,36 ****
|
|
this.setSize(4.0F, 4.0F);
|
|
this.isImmuneToFire = true;
|
|
this.experienceValue = 5;
|
|
}
|
|
|
|
- public boolean func_110182_bF()
|
|
- {
|
|
- return this.dataWatcher.getWatchableObjectByte(16) != 0;
|
|
- }
|
|
-
|
|
/**
|
|
* Called when the entity is attacked.
|
|
*/
|
|
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
|
|
{
|
|
--- 22,31 ----
|
|
***************
|
|
*** 230,241 ****
|
|
{
|
|
return Item.gunpowder.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + par2);
|
|
int var4;
|
|
--- 225,235 ----
|
|
{
|
|
return Item.gunpowder.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(2) + this.rand.nextInt(1 + par2);
|
|
int var4;
|
|
*** EntityHorse.java Sat Feb 5 04:19:40 2022
|
|
--- EntityHorse.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 630,699 ****
|
|
public int getTalkInterval()
|
|
{
|
|
return 400;
|
|
}
|
|
|
|
- public boolean func_110239_cn()
|
|
- {
|
|
- return this.getHorseType() == 0 || this.func_110241_cb() > 0;
|
|
- }
|
|
-
|
|
private void func_110230_cF()
|
|
{
|
|
this.field_110286_bQ = null;
|
|
}
|
|
|
|
- private void setHorseTexturePaths()
|
|
- {
|
|
- this.field_110286_bQ = "horse/";
|
|
- this.field_110280_bR[0] = null;
|
|
- this.field_110280_bR[1] = null;
|
|
- this.field_110280_bR[2] = null;
|
|
- int var1 = this.getHorseType();
|
|
- int var2 = this.getHorseVariant();
|
|
- int var3;
|
|
-
|
|
- if (var1 == 0)
|
|
- {
|
|
- var3 = var2 & 255;
|
|
- int var4 = (var2 & 65280) >> 8;
|
|
- this.field_110280_bR[0] = horseTextures[var3];
|
|
- this.field_110286_bQ = this.field_110286_bQ + field_110269_bA[var3];
|
|
- this.field_110280_bR[1] = horseMarkingTextures[var4];
|
|
- this.field_110286_bQ = this.field_110286_bQ + field_110292_bC[var4];
|
|
- }
|
|
- else
|
|
- {
|
|
- this.field_110280_bR[0] = "";
|
|
- this.field_110286_bQ = this.field_110286_bQ + "_" + var1 + "_";
|
|
- }
|
|
-
|
|
- var3 = this.func_110241_cb();
|
|
- this.field_110280_bR[2] = horseArmorTextures[var3];
|
|
- this.field_110286_bQ = this.field_110286_bQ + field_110273_bx[var3];
|
|
- }
|
|
-
|
|
- public String getHorseTexture()
|
|
- {
|
|
- if (this.field_110286_bQ == null)
|
|
- {
|
|
- this.setHorseTexturePaths();
|
|
- }
|
|
-
|
|
- return this.field_110286_bQ;
|
|
- }
|
|
-
|
|
- public String[] getVariantTexturePaths()
|
|
- {
|
|
- if (this.field_110286_bQ == null)
|
|
- {
|
|
- this.setHorseTexturePaths();
|
|
- }
|
|
-
|
|
- return this.field_110280_bR;
|
|
- }
|
|
-
|
|
public void openGUI(EntityPlayer par1EntityPlayer)
|
|
{
|
|
if (!this.worldObj.isRemote && (this.riddenByEntity == null || this.riddenByEntity == par1EntityPlayer) && this.isTame())
|
|
{
|
|
this.horseChest.func_110133_a(this.getEntityName());
|
|
--- 630,644 ----
|
|
***************
|
|
*** 1019,1029 ****
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
super.onUpdate();
|
|
|
|
! if (this.worldObj.isRemote && this.dataWatcher.hasChanges())
|
|
{
|
|
this.dataWatcher.func_111144_e();
|
|
this.func_110230_cF();
|
|
}
|
|
|
|
--- 964,974 ----
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
super.onUpdate();
|
|
|
|
! if (this.worldObj.isRemote && this.dataWatcher.hasObjectChanged())
|
|
{
|
|
this.dataWatcher.func_111144_e();
|
|
this.func_110230_cF();
|
|
}
|
|
|
|
***************
|
|
*** 1569,1593 ****
|
|
|
|
this.setHealth(this.getMaxHealth());
|
|
return (EntityLivingData)par1EntityLivingData1;
|
|
}
|
|
|
|
- public float getGrassEatingAmount(float par1)
|
|
- {
|
|
- return this.prevHeadLean + (this.headLean - this.prevHeadLean) * par1;
|
|
- }
|
|
-
|
|
- public float getRearingAmount(float par1)
|
|
- {
|
|
- return this.prevRearingAmount + (this.rearingAmount - this.prevRearingAmount) * par1;
|
|
- }
|
|
-
|
|
- public float func_110201_q(float par1)
|
|
- {
|
|
- return this.prevMouthOpenness + (this.mouthOpenness - this.prevMouthOpenness) * par1;
|
|
- }
|
|
-
|
|
/**
|
|
* Returns true if the newer Entity AI code should be run
|
|
*/
|
|
protected boolean isAIEnabled()
|
|
{
|
|
--- 1514,1523 ----
|
|
***************
|
|
*** 1614,1655 ****
|
|
}
|
|
else
|
|
{
|
|
this.jumpPower = 0.4F + 0.4F * (float)par1 / 90.0F;
|
|
}
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * "Spawns particles for the horse entity. par1 tells whether to spawn hearts. If it is false, it spawns smoke."
|
|
- */
|
|
- protected void spawnHorseParticles(boolean par1)
|
|
- {
|
|
- String var2 = par1 ? "heart" : "smoke";
|
|
-
|
|
- for (int var3 = 0; var3 < 7; ++var3)
|
|
- {
|
|
- double var4 = this.rand.nextGaussian() * 0.02D;
|
|
- double var6 = this.rand.nextGaussian() * 0.02D;
|
|
- double var8 = this.rand.nextGaussian() * 0.02D;
|
|
- this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8);
|
|
- }
|
|
- }
|
|
-
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 7)
|
|
- {
|
|
- this.spawnHorseParticles(true);
|
|
- }
|
|
- else if (par1 == 6)
|
|
- {
|
|
- this.spawnHorseParticles(false);
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
}
|
|
}
|
|
|
|
public void updateRiderPosition()
|
|
{
|
|
--- 1544,1553 ----
|
|
*** EntityIronGolem.java Sat Feb 5 04:19:40 2022
|
|
--- EntityIronGolem.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 160,196 ****
|
|
|
|
this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
|
|
return var2;
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 4)
|
|
- {
|
|
- this.attackTimer = 10;
|
|
- this.playSound("mob.irongolem.throw", 1.0F, 1.0F);
|
|
- }
|
|
- else if (par1 == 11)
|
|
- {
|
|
- this.holdRoseTick = 400;
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
public Village getVillage()
|
|
{
|
|
return this.villageObj;
|
|
}
|
|
|
|
- public int getAttackTimer()
|
|
- {
|
|
- return this.attackTimer;
|
|
- }
|
|
-
|
|
public void setHoldingRose(boolean par1)
|
|
{
|
|
this.holdRoseTick = par1 ? 400 : 0;
|
|
this.worldObj.setEntityState(this, (byte)11);
|
|
}
|
|
--- 160,174 ----
|
|
***************
|
|
*** 226,237 ****
|
|
{
|
|
this.playSound("mob.irongolem.walk", 1.0F, 1.0F);
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3);
|
|
int var4;
|
|
--- 204,214 ----
|
|
{
|
|
this.playSound("mob.irongolem.walk", 1.0F, 1.0F);
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3);
|
|
int var4;
|
|
*** EntityItemFrame.java Sat Feb 5 04:19:40 2022
|
|
--- EntityItemFrame.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 31,51 ****
|
|
{
|
|
return 9;
|
|
}
|
|
|
|
/**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- double var3 = 16.0D;
|
|
- var3 *= 64.0D * this.renderDistanceWeight;
|
|
- return par1 < var3 * var3;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when this entity is broken. Entity parameter may be null.
|
|
*/
|
|
public void onBroken(Entity par1Entity)
|
|
{
|
|
ItemStack var2 = this.getDisplayedItem();
|
|
--- 31,40 ----
|
|
*** EntityLargeFireball.java Sat Feb 5 04:19:40 2022
|
|
--- EntityLargeFireball.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 7,21 ****
|
|
public EntityLargeFireball(World par1World)
|
|
{
|
|
super(par1World);
|
|
}
|
|
|
|
- public EntityLargeFireball(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
|
|
- {
|
|
- super(par1World, par2, par4, par6, par8, par10, par12);
|
|
- }
|
|
-
|
|
public EntityLargeFireball(World par1World, EntityLivingBase par2EntityLivingBase, double par3, double par5, double par7)
|
|
{
|
|
super(par1World, par2EntityLivingBase, par3, par5, par7);
|
|
}
|
|
|
|
--- 7,16 ----
|
|
*** EntityLeashKnot.java Sat Feb 5 04:19:40 2022
|
|
--- EntityLeashKnot.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 32,50 ****
|
|
{
|
|
return 9;
|
|
}
|
|
|
|
/**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- return par1 < 1024.0D;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called when this entity is broken. Entity parameter may be null.
|
|
*/
|
|
public void onBroken(Entity par1Entity) {}
|
|
|
|
/**
|
|
--- 32,41 ----
|
|
*** EntityLightningBolt.java Sat Feb 5 04:19:41 2022
|
|
--- EntityLightningBolt.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 122,135 ****
|
|
|
|
/**
|
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
|
*/
|
|
protected void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) {}
|
|
-
|
|
- /**
|
|
- * Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D
|
|
- */
|
|
- public boolean isInRangeToRenderVec3D(Vec3 par1Vec3)
|
|
- {
|
|
- return this.lightningState >= 0;
|
|
- }
|
|
}
|
|
--- 122,127 ----
|
|
*** EntityLiving.java Sat Feb 5 04:19:41 2022
|
|
--- EntityLiving.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 180,190 ****
|
|
protected int getExperiencePoints(EntityPlayer par1EntityPlayer)
|
|
{
|
|
if (this.experienceValue > 0)
|
|
{
|
|
int var2 = this.experienceValue;
|
|
! ItemStack[] var3 = this.getLastActiveItems();
|
|
|
|
for (int var4 = 0; var4 < var3.length; ++var4)
|
|
{
|
|
if (var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F)
|
|
{
|
|
--- 180,190 ----
|
|
protected int getExperiencePoints(EntityPlayer par1EntityPlayer)
|
|
{
|
|
if (this.experienceValue > 0)
|
|
{
|
|
int var2 = this.experienceValue;
|
|
! ItemStack[] var3 = this.getInventory();
|
|
|
|
for (int var4 = 0; var4 < var3.length; ++var4)
|
|
{
|
|
if (var3[var4] != null && this.equipmentDropChances[var4] <= 1.0F)
|
|
{
|
|
***************
|
|
*** 256,267 ****
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.getDropItemId();
|
|
|
|
--- 256,266 ----
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.getDropItemId();
|
|
|
|
***************
|
|
*** 422,432 ****
|
|
int var5 = getArmorPosition(var4);
|
|
|
|
if (var5 > -1)
|
|
{
|
|
boolean var6 = true;
|
|
! ItemStack var7 = this.getCurrentItemOrArmor(var5);
|
|
|
|
if (var7 != null)
|
|
{
|
|
if (var5 == 0)
|
|
{
|
|
--- 421,431 ----
|
|
int var5 = getArmorPosition(var4);
|
|
|
|
if (var5 > -1)
|
|
{
|
|
boolean var6 = true;
|
|
! ItemStack var7 = this.getEquipmentInSlot(var5);
|
|
|
|
if (var7 != null)
|
|
{
|
|
if (var5 == 0)
|
|
{
|
|
***************
|
|
*** 697,714 ****
|
|
{
|
|
return this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
|
|
}
|
|
|
|
/**
|
|
- * Returns render size modifier
|
|
- */
|
|
- public float getRenderSizeModifier()
|
|
- {
|
|
- return 1.0F;
|
|
- }
|
|
-
|
|
- /**
|
|
* Will return how many at most can spawn in a chunk at once.
|
|
*/
|
|
public int getMaxSpawnedInChunk()
|
|
{
|
|
return 4;
|
|
--- 696,705 ----
|
|
***************
|
|
*** 744,756 ****
|
|
{
|
|
return this.equipment[0];
|
|
}
|
|
|
|
/**
|
|
! * 0 = item, 1-n is armor
|
|
*/
|
|
! public ItemStack getCurrentItemOrArmor(int par1)
|
|
{
|
|
return this.equipment[par1];
|
|
}
|
|
|
|
public ItemStack func_130225_q(int par1)
|
|
--- 735,747 ----
|
|
{
|
|
return this.equipment[0];
|
|
}
|
|
|
|
/**
|
|
! * 0: Tool in Hand; 1-4: Armor
|
|
*/
|
|
! public ItemStack getEquipmentInSlot(int par1)
|
|
{
|
|
return this.equipment[par1];
|
|
}
|
|
|
|
public ItemStack func_130225_q(int par1)
|
|
***************
|
|
*** 764,786 ****
|
|
public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack)
|
|
{
|
|
this.equipment[par1] = par2ItemStack;
|
|
}
|
|
|
|
! public ItemStack[] getLastActiveItems()
|
|
{
|
|
return this.equipment;
|
|
}
|
|
|
|
/**
|
|
* Drop the equipment for this entity.
|
|
*/
|
|
protected void dropEquipment(boolean par1, int par2)
|
|
{
|
|
! for (int var3 = 0; var3 < this.getLastActiveItems().length; ++var3)
|
|
{
|
|
! ItemStack var4 = this.getCurrentItemOrArmor(var3);
|
|
boolean var5 = this.equipmentDropChances[var3] > 1.0F;
|
|
|
|
if (var4 != null && (par1 || var5) && this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3])
|
|
{
|
|
if (!var5 && var4.isItemStackDamageable())
|
|
--- 755,780 ----
|
|
public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack)
|
|
{
|
|
this.equipment[par1] = par2ItemStack;
|
|
}
|
|
|
|
! /**
|
|
! * returns the inventory of this entity (only used in EntityPlayerMP it seems)
|
|
! */
|
|
! public ItemStack[] getInventory()
|
|
{
|
|
return this.equipment;
|
|
}
|
|
|
|
/**
|
|
* Drop the equipment for this entity.
|
|
*/
|
|
protected void dropEquipment(boolean par1, int par2)
|
|
{
|
|
! for (int var3 = 0; var3 < this.getInventory().length; ++var3)
|
|
{
|
|
! ItemStack var4 = this.getEquipmentInSlot(var3);
|
|
boolean var5 = this.equipmentDropChances[var3] > 1.0F;
|
|
|
|
if (var4 != null && (par1 || var5) && this.rand.nextFloat() - (float)par2 * 0.01F < this.equipmentDropChances[var3])
|
|
{
|
|
if (!var5 && var4.isItemStackDamageable())
|
|
***************
|
|
*** 1057,1071 ****
|
|
public boolean getAlwaysRenderNameTag()
|
|
{
|
|
return this.dataWatcher.getWatchableObjectByte(11) == 1;
|
|
}
|
|
|
|
- public boolean getAlwaysRenderNameTagForRender()
|
|
- {
|
|
- return this.getAlwaysRenderNameTag();
|
|
- }
|
|
-
|
|
public void setEquipmentDropChance(int par1, float par2)
|
|
{
|
|
this.equipmentDropChances[par1] = par2;
|
|
}
|
|
|
|
--- 1051,1060 ----
|
|
***************
|
|
*** 1158,1168 ****
|
|
this.dropItem(Item.leash.itemID, 1);
|
|
}
|
|
|
|
if (!this.worldObj.isRemote && par1 && this.worldObj instanceof WorldServer)
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, (Entity)null));
|
|
}
|
|
}
|
|
}
|
|
|
|
public boolean allowLeashing()
|
|
--- 1147,1157 ----
|
|
this.dropItem(Item.leash.itemID, 1);
|
|
}
|
|
|
|
if (!this.worldObj.isRemote && par1 && this.worldObj instanceof WorldServer)
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, (Entity)null));
|
|
}
|
|
}
|
|
}
|
|
|
|
public boolean allowLeashing()
|
|
***************
|
|
*** 1189,1199 ****
|
|
this.isLeashed = true;
|
|
this.leashedToEntity = par1Entity;
|
|
|
|
if (!this.worldObj.isRemote && par2 && this.worldObj instanceof WorldServer)
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet39AttachEntity(1, this, this.leashedToEntity));
|
|
}
|
|
}
|
|
|
|
private void recreateLeash()
|
|
{
|
|
--- 1178,1188 ----
|
|
this.isLeashed = true;
|
|
this.leashedToEntity = par1Entity;
|
|
|
|
if (!this.worldObj.isRemote && par2 && this.worldObj instanceof WorldServer)
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet39AttachEntity(1, this, this.leashedToEntity));
|
|
}
|
|
}
|
|
|
|
private void recreateLeash()
|
|
{
|
|
*** EntityLivingBase.java Sat Feb 5 04:19:41 2022
|
|
--- EntityLivingBase.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 81,91 ****
|
|
/**
|
|
* This gets set on entity death, but never used. Looks like a duplicate of isDead
|
|
*/
|
|
protected boolean dead;
|
|
|
|
! /** Holds the living entity age, used to control the despawn. */
|
|
protected int entityAge;
|
|
protected float field_70768_au;
|
|
protected float field_110154_aX;
|
|
protected float field_70764_aw;
|
|
protected float field_70763_ax;
|
|
--- 81,91 ----
|
|
/**
|
|
* This gets set on entity death, but never used. Looks like a duplicate of isDead
|
|
*/
|
|
protected boolean dead;
|
|
|
|
! /** The age of this EntityLiving (used to determine when it dies) */
|
|
protected int entityAge;
|
|
protected float field_70768_au;
|
|
protected float field_110154_aX;
|
|
protected float field_70764_aw;
|
|
protected float field_70763_ax;
|
|
***************
|
|
*** 452,462 ****
|
|
par1NBTTagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth())));
|
|
par1NBTTagCompound.setShort("HurtTime", (short)this.hurtTime);
|
|
par1NBTTagCompound.setShort("DeathTime", (short)this.deathTime);
|
|
par1NBTTagCompound.setShort("AttackTime", (short)this.attackTime);
|
|
par1NBTTagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount());
|
|
! ItemStack[] var2 = this.getLastActiveItems();
|
|
int var3 = var2.length;
|
|
int var4;
|
|
ItemStack var5;
|
|
|
|
for (var4 = 0; var4 < var3; ++var4)
|
|
--- 452,462 ----
|
|
par1NBTTagCompound.setShort("Health", (short)((int)Math.ceil((double)this.getHealth())));
|
|
par1NBTTagCompound.setShort("HurtTime", (short)this.hurtTime);
|
|
par1NBTTagCompound.setShort("DeathTime", (short)this.deathTime);
|
|
par1NBTTagCompound.setShort("AttackTime", (short)this.attackTime);
|
|
par1NBTTagCompound.setFloat("AbsorptionAmount", this.getAbsorptionAmount());
|
|
! ItemStack[] var2 = this.getInventory();
|
|
int var3 = var2.length;
|
|
int var4;
|
|
ItemStack var5;
|
|
|
|
for (var4 = 0; var4 < var3; ++var4)
|
|
***************
|
|
*** 468,478 ****
|
|
this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers());
|
|
}
|
|
}
|
|
|
|
par1NBTTagCompound.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap()));
|
|
! var2 = this.getLastActiveItems();
|
|
var3 = var2.length;
|
|
|
|
for (var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
var5 = var2[var4];
|
|
--- 468,478 ----
|
|
this.attributeMap.removeAttributeModifiers(var5.getAttributeModifiers());
|
|
}
|
|
}
|
|
|
|
par1NBTTagCompound.setTag("Attributes", SharedMonsterAttributes.func_111257_a(this.getAttributeMap()));
|
|
! var2 = this.getInventory();
|
|
var3 = var2.length;
|
|
|
|
for (var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
var5 = var2[var4];
|
|
***************
|
|
*** 709,726 ****
|
|
{
|
|
return this.getCreatureAttribute() == EnumCreatureAttribute.UNDEAD;
|
|
}
|
|
|
|
/**
|
|
- * Remove the speified potion effect from this entity.
|
|
- */
|
|
- public void removePotionEffectClient(int par1)
|
|
- {
|
|
- this.activePotionsMap.remove(Integer.valueOf(par1));
|
|
- }
|
|
-
|
|
- /**
|
|
* Remove the specified potion effect from this entity.
|
|
*/
|
|
public void removePotionEffect(int par1)
|
|
{
|
|
PotionEffect var2 = (PotionEffect)this.activePotionsMap.remove(Integer.valueOf(par1));
|
|
--- 709,718 ----
|
|
***************
|
|
*** 810,822 ****
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
! if ((par1DamageSource == DamageSource.anvil || par1DamageSource == DamageSource.fallingBlock) && this.getCurrentItemOrArmor(4) != null)
|
|
{
|
|
! this.getCurrentItemOrArmor(4).damageItem((int)(par2 * 4.0F + this.rand.nextFloat() * par2 * 2.0F), this);
|
|
par2 *= 0.75F;
|
|
}
|
|
|
|
this.limbSwingAmount = 1.5F;
|
|
boolean var3 = true;
|
|
--- 802,814 ----
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
! if ((par1DamageSource == DamageSource.anvil || par1DamageSource == DamageSource.fallingBlock) && this.getEquipmentInSlot(4) != null)
|
|
{
|
|
! this.getEquipmentInSlot(4).damageItem((int)(par2 * 4.0F + this.rand.nextFloat() * par2 * 2.0F), this);
|
|
par2 *= 0.75F;
|
|
}
|
|
|
|
this.limbSwingAmount = 1.5F;
|
|
boolean var3 = true;
|
|
***************
|
|
*** 1030,1041 ****
|
|
}
|
|
|
|
protected void dropRareDrop(int par1) {}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2) {}
|
|
|
|
/**
|
|
* returns true if this entity is by a ladder, false otherwise
|
|
--- 1022,1032 ----
|
|
}
|
|
|
|
protected void dropRareDrop(int par1) {}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2) {}
|
|
|
|
/**
|
|
* returns true if this entity is by a ladder, false otherwise
|
|
***************
|
|
*** 1088,1112 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Setups the entity to do the hurt animation. Only used by packets in multiplayer.
|
|
- */
|
|
- public void performHurtAnimation()
|
|
- {
|
|
- this.hurtTime = this.maxHurtTime = 10;
|
|
- this.attackedAtYaw = 0.0F;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
|
|
*/
|
|
public int getTotalArmorValue()
|
|
{
|
|
int var1 = 0;
|
|
! ItemStack[] var2 = this.getLastActiveItems();
|
|
int var3 = var2.length;
|
|
|
|
for (int var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
ItemStack var5 = var2[var4];
|
|
--- 1079,1094 ----
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
|
|
*/
|
|
public int getTotalArmorValue()
|
|
{
|
|
int var1 = 0;
|
|
! ItemStack[] var2 = this.getInventory();
|
|
int var3 = var2.length;
|
|
|
|
for (int var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
ItemStack var5 = var2[var4];
|
|
***************
|
|
*** 1165,1175 ****
|
|
{
|
|
return 0.0F;
|
|
}
|
|
else
|
|
{
|
|
! var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getLastActiveItems(), par1DamageSource);
|
|
|
|
if (var3 > 20)
|
|
{
|
|
var3 = 20;
|
|
}
|
|
--- 1147,1157 ----
|
|
{
|
|
return 0.0F;
|
|
}
|
|
else
|
|
{
|
|
! var3 = EnchantmentHelper.getEnchantmentModifierDamage(this.getInventory(), par1DamageSource);
|
|
|
|
if (var3 > 20)
|
|
{
|
|
var3 = 20;
|
|
}
|
|
***************
|
|
*** 1259,1296 ****
|
|
this.swingProgressInt = -1;
|
|
this.isSwingInProgress = true;
|
|
|
|
if (this.worldObj instanceof WorldServer)
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet18Animation(this, 1));
|
|
}
|
|
}
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 2)
|
|
- {
|
|
- this.limbSwingAmount = 1.5F;
|
|
- this.hurtResistantTime = this.maxHurtResistantTime;
|
|
- this.hurtTime = this.maxHurtTime = 10;
|
|
- this.attackedAtYaw = 0.0F;
|
|
- this.playSound(this.getHurtSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
|
- this.attackEntityFrom(DamageSource.generic, 0.0F);
|
|
- }
|
|
- else if (par1 == 3)
|
|
- {
|
|
- this.playSound(this.getDeathSound(), this.getSoundVolume(), (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F);
|
|
- this.setHealth(0.0F);
|
|
- this.onDeath(DamageSource.generic);
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* sets the dead flag. Used when you fall off the bottom of the world.
|
|
*/
|
|
protected void kill()
|
|
{
|
|
--- 1241,1255 ----
|
|
this.swingProgressInt = -1;
|
|
this.isSwingInProgress = true;
|
|
|
|
if (this.worldObj instanceof WorldServer)
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet18Animation(this, 1));
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* sets the dead flag. Used when you fall off the bottom of the world.
|
|
*/
|
|
protected void kill()
|
|
{
|
|
***************
|
|
*** 1349,1361 ****
|
|
* Returns the item that this EntityLiving is holding, if any.
|
|
*/
|
|
public abstract ItemStack getHeldItem();
|
|
|
|
/**
|
|
! * 0 = item, 1-n is armor
|
|
*/
|
|
! public abstract ItemStack getCurrentItemOrArmor(int var1);
|
|
|
|
/**
|
|
* Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot
|
|
*/
|
|
public abstract void setCurrentItemOrArmor(int var1, ItemStack var2);
|
|
--- 1308,1320 ----
|
|
* Returns the item that this EntityLiving is holding, if any.
|
|
*/
|
|
public abstract ItemStack getHeldItem();
|
|
|
|
/**
|
|
! * 0: Tool in Hand; 1-4: Armor
|
|
*/
|
|
! public abstract ItemStack getEquipmentInSlot(int var1);
|
|
|
|
/**
|
|
* Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot
|
|
*/
|
|
public abstract void setCurrentItemOrArmor(int var1, ItemStack var2);
|
|
***************
|
|
*** 1377,1387 ****
|
|
{
|
|
var2.applyModifier(sprintingSpeedBoostModifier);
|
|
}
|
|
}
|
|
|
|
! public abstract ItemStack[] getLastActiveItems();
|
|
|
|
/**
|
|
* Returns the volume for the sounds this mob makes.
|
|
*/
|
|
protected float getSoundVolume()
|
|
--- 1336,1349 ----
|
|
{
|
|
var2.applyModifier(sprintingSpeedBoostModifier);
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * returns the inventory of this entity (only used in EntityPlayerMP it seems)
|
|
! */
|
|
! public abstract ItemStack[] getInventory();
|
|
|
|
/**
|
|
* Returns the volume for the sounds this mob makes.
|
|
*/
|
|
protected float getSoundVolume()
|
|
***************
|
|
*** 1404,1414 ****
|
|
{
|
|
return this.getHealth() <= 0.0F;
|
|
}
|
|
|
|
/**
|
|
! * Move the entity to the coordinates informed, but keep yaw/pitch values.
|
|
*/
|
|
public void setPositionAndUpdate(double par1, double par3, double par5)
|
|
{
|
|
this.setLocationAndAngles(par1, par3, par5, this.rotationYaw, this.rotationPitch);
|
|
}
|
|
--- 1366,1376 ----
|
|
{
|
|
return this.getHealth() <= 0.0F;
|
|
}
|
|
|
|
/**
|
|
! * Sets the position of the entity and updates the 'last' variables
|
|
*/
|
|
public void setPositionAndUpdate(double par1, double par3, double par5)
|
|
{
|
|
this.setLocationAndAngles(par1, par3, par5, this.rotationYaw, this.rotationPitch);
|
|
}
|
|
***************
|
|
*** 1452,1474 ****
|
|
}
|
|
|
|
this.setPositionAndUpdate(var3, var5, var7);
|
|
}
|
|
|
|
- public boolean getAlwaysRenderNameTagForRender()
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the Icon Index of the item currently held
|
|
- */
|
|
- public Icon getItemIcon(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- return par1ItemStack.getIconIndex();
|
|
- }
|
|
-
|
|
/**
|
|
* Causes this entity to do an upwards motion (jumping).
|
|
*/
|
|
protected void jump()
|
|
{
|
|
--- 1414,1423 ----
|
|
***************
|
|
*** 1713,1727 ****
|
|
}
|
|
|
|
for (int var2 = 0; var2 < 5; ++var2)
|
|
{
|
|
ItemStack var3 = this.previousEquipment[var2];
|
|
! ItemStack var4 = this.getCurrentItemOrArmor(var2);
|
|
|
|
if (!ItemStack.areItemStacksEqual(var4, var3))
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, new Packet5PlayerInventory(this.entityId, var2, var4));
|
|
|
|
if (var3 != null)
|
|
{
|
|
this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers());
|
|
}
|
|
--- 1662,1676 ----
|
|
}
|
|
|
|
for (int var2 = 0; var2 < 5; ++var2)
|
|
{
|
|
ItemStack var3 = this.previousEquipment[var2];
|
|
! ItemStack var4 = this.getEquipmentInSlot(var2);
|
|
|
|
if (!ItemStack.areItemStacksEqual(var4, var3))
|
|
{
|
|
! ((WorldServer)this.worldObj).getEntityTracker().sendPacketToTrackedPlayers(this, new Packet5PlayerInventory(this.entityId, var2, var4));
|
|
|
|
if (var3 != null)
|
|
{
|
|
this.attributeMap.removeAttributeModifiers(var3.getAttributeModifiers());
|
|
}
|
|
***************
|
|
*** 1990,2014 ****
|
|
this.field_110154_aX = 0.0F;
|
|
this.fallDistance = 0.0F;
|
|
}
|
|
|
|
/**
|
|
- * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
|
- * posY, posZ, yaw, pitch
|
|
- */
|
|
- public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
|
- {
|
|
- this.yOffset = 0.0F;
|
|
- this.newPosX = par1;
|
|
- this.newPosY = par3;
|
|
- this.newPosZ = par5;
|
|
- this.newRotationYaw = (double)par7;
|
|
- this.newRotationPitch = (double)par8;
|
|
- this.newPosRotationIncrements = par9;
|
|
- }
|
|
-
|
|
- /**
|
|
* main AI tick function, replaces updateEntityActionState
|
|
*/
|
|
protected void updateAITick() {}
|
|
|
|
protected void updateEntityActionState()
|
|
--- 1939,1948 ----
|
|
***************
|
|
*** 2030,2060 ****
|
|
{
|
|
EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker();
|
|
|
|
if (par1Entity instanceof EntityItem)
|
|
{
|
|
! var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
|
|
}
|
|
|
|
if (par1Entity instanceof EntityArrow)
|
|
{
|
|
! var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
|
|
}
|
|
|
|
if (par1Entity instanceof EntityXPOrb)
|
|
{
|
|
! var3.sendPacketToAllPlayersTrackingEntity(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* returns true if the entity provided in the argument can be seen. (Raytrace)
|
|
*/
|
|
public boolean canEntityBeSeen(Entity par1Entity)
|
|
{
|
|
! return this.worldObj.clip(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY + (double)par1Entity.getEyeHeight(), par1Entity.posZ)) == null;
|
|
}
|
|
|
|
/**
|
|
* returns a (normalized) vector of where this entity is looking
|
|
*/
|
|
--- 1964,1994 ----
|
|
{
|
|
EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker();
|
|
|
|
if (par1Entity instanceof EntityItem)
|
|
{
|
|
! var3.sendPacketToTrackedPlayers(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
|
|
}
|
|
|
|
if (par1Entity instanceof EntityArrow)
|
|
{
|
|
! var3.sendPacketToTrackedPlayers(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
|
|
}
|
|
|
|
if (par1Entity instanceof EntityXPOrb)
|
|
{
|
|
! var3.sendPacketToTrackedPlayers(par1Entity, new Packet22Collect(par1Entity.entityId, this.entityId));
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* returns true if the entity provided in the argument can be seen. (Raytrace)
|
|
*/
|
|
public boolean canEntityBeSeen(Entity par1Entity)
|
|
{
|
|
! return this.worldObj.rayTraceBlocks(this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ), this.worldObj.getWorldVec3Pool().getVecFromPool(par1Entity.posX, par1Entity.posY + (double)par1Entity.getEyeHeight(), par1Entity.posZ)) == null;
|
|
}
|
|
|
|
/**
|
|
* returns a (normalized) vector of where this entity is looking
|
|
*/
|
|
***************
|
|
*** 2092,2145 ****
|
|
return this.worldObj.getWorldVec3Pool().getVecFromPool((double)(var5 * var6), (double)var7, (double)(var4 * var6));
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime
|
|
- */
|
|
- public float getSwingProgress(float par1)
|
|
- {
|
|
- float var2 = this.swingProgress - this.prevSwingProgress;
|
|
-
|
|
- if (var2 < 0.0F)
|
|
- {
|
|
- ++var2;
|
|
- }
|
|
-
|
|
- return this.prevSwingProgress + var2 * par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * interpolated position vector
|
|
- */
|
|
- public Vec3 getPosition(float par1)
|
|
- {
|
|
- if (par1 == 1.0F)
|
|
- {
|
|
- return this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
- }
|
|
- else
|
|
- {
|
|
- double var2 = this.prevPosX + (this.posX - this.prevPosX) * (double)par1;
|
|
- double var4 = this.prevPosY + (this.posY - this.prevPosY) * (double)par1;
|
|
- double var6 = this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par1;
|
|
- return this.worldObj.getWorldVec3Pool().getVecFromPool(var2, var4, var6);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Performs a ray trace for the distance specified and using the partial tick time. Args: distance, partialTickTime
|
|
- */
|
|
- public MovingObjectPosition rayTrace(double par1, float par3)
|
|
- {
|
|
- Vec3 var4 = this.getPosition(par3);
|
|
- Vec3 var5 = this.getLook(par3);
|
|
- Vec3 var6 = var4.addVector(var5.xCoord * par1, var5.yCoord * par1, var5.zCoord * par1);
|
|
- return this.worldObj.clip(var4, var6);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns whether the entity is in a local (client) world
|
|
*/
|
|
public boolean isClientWorld()
|
|
{
|
|
return !this.worldObj.isRemote;
|
|
--- 2026,2035 ----
|
|
***************
|
|
*** 2175,2192 ****
|
|
}
|
|
|
|
public float getRotationYawHead()
|
|
{
|
|
return this.rotationYawHead;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Sets the head's yaw rotation of the entity.
|
|
- */
|
|
- public void setRotationYawHead(float par1)
|
|
- {
|
|
- this.rotationYawHead = par1;
|
|
}
|
|
|
|
public float getAbsorptionAmount()
|
|
{
|
|
return this.field_110151_bq;
|
|
--- 2065,2074 ----
|
|
*** EntityMagmaCube.java Sat Feb 5 04:19:41 2022
|
|
--- EntityMagmaCube.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 28,42 ****
|
|
public int getTotalArmorValue()
|
|
{
|
|
return this.getSlimeSize() * 3;
|
|
}
|
|
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- return 15728880;
|
|
- }
|
|
-
|
|
/**
|
|
* Gets how bright this entity is.
|
|
*/
|
|
public float getBrightness(float par1)
|
|
{
|
|
--- 28,37 ----
|
|
***************
|
|
*** 63,74 ****
|
|
{
|
|
return Item.magmaCream.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.getDropItemId();
|
|
|
|
--- 58,68 ----
|
|
{
|
|
return Item.magmaCream.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.getDropItemId();
|
|
|
|
*** EntityMinecart.java Sat Feb 5 04:19:41 2022
|
|
--- EntityMinecart.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 17,29 ****
|
|
private double minecartX;
|
|
private double minecartY;
|
|
private double minecartZ;
|
|
private double minecartYaw;
|
|
private double minecartPitch;
|
|
- private double velocityX;
|
|
- private double velocityY;
|
|
- private double velocityZ;
|
|
|
|
public EntityMinecart(World par1World)
|
|
{
|
|
super(par1World);
|
|
this.preventEntitySpawning = true;
|
|
--- 17,26 ----
|
|
***************
|
|
*** 183,202 ****
|
|
|
|
this.entityDropItem(var2, 0.0F);
|
|
}
|
|
|
|
/**
|
|
- * Setups the entity to do the hurt animation. Only used by packets in multiplayer.
|
|
- */
|
|
- public void performHurtAnimation()
|
|
- {
|
|
- this.setRollingDirection(-this.getRollingDirection());
|
|
- this.setRollingAmplitude(10);
|
|
- this.setDamage(this.getDamage() + this.getDamage() * 10.0F);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns true if other Entities should be prevented from moving through this Entity.
|
|
*/
|
|
public boolean canBeCollidedWith()
|
|
{
|
|
return !this.isDead;
|
|
--- 180,189 ----
|
|
***************
|
|
*** 398,408 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Called every tick the minecart is on an activator rail.
|
|
*/
|
|
public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) {}
|
|
|
|
protected void func_94088_b(double par1)
|
|
{
|
|
--- 385,395 ----
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power
|
|
*/
|
|
public void onActivatorRailPass(int par1, int par2, int par3, boolean par4) {}
|
|
|
|
protected void func_94088_b(double par1)
|
|
{
|
|
***************
|
|
*** 696,760 ****
|
|
this.motionY *= 0.0D;
|
|
this.motionZ *= 0.9599999785423279D;
|
|
}
|
|
}
|
|
|
|
- public Vec3 func_70495_a(double par1, double par3, double par5, double par7)
|
|
- {
|
|
- int var9 = MathHelper.floor_double(par1);
|
|
- int var10 = MathHelper.floor_double(par3);
|
|
- int var11 = MathHelper.floor_double(par5);
|
|
-
|
|
- if (BlockRailBase.isRailBlockAt(this.worldObj, var9, var10 - 1, var11))
|
|
- {
|
|
- --var10;
|
|
- }
|
|
-
|
|
- int var12 = this.worldObj.getBlockId(var9, var10, var11);
|
|
-
|
|
- if (!BlockRailBase.isRailBlock(var12))
|
|
- {
|
|
- return null;
|
|
- }
|
|
- else
|
|
- {
|
|
- int var13 = this.worldObj.getBlockMetadata(var9, var10, var11);
|
|
-
|
|
- if (((BlockRailBase)Block.blocksList[var12]).isPowered())
|
|
- {
|
|
- var13 &= 7;
|
|
- }
|
|
-
|
|
- par3 = (double)var10;
|
|
-
|
|
- if (var13 >= 2 && var13 <= 5)
|
|
- {
|
|
- par3 = (double)(var10 + 1);
|
|
- }
|
|
-
|
|
- int[][] var14 = matrix[var13];
|
|
- double var15 = (double)(var14[1][0] - var14[0][0]);
|
|
- double var17 = (double)(var14[1][2] - var14[0][2]);
|
|
- double var19 = Math.sqrt(var15 * var15 + var17 * var17);
|
|
- var15 /= var19;
|
|
- var17 /= var19;
|
|
- par1 += var15 * par7;
|
|
- par5 += var17 * par7;
|
|
-
|
|
- if (var14[0][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[0][0] && MathHelper.floor_double(par5) - var11 == var14[0][2])
|
|
- {
|
|
- par3 += (double)var14[0][1];
|
|
- }
|
|
- else if (var14[1][1] != 0 && MathHelper.floor_double(par1) - var9 == var14[1][0] && MathHelper.floor_double(par5) - var11 == var14[1][2])
|
|
- {
|
|
- par3 += (double)var14[1][1];
|
|
- }
|
|
-
|
|
- return this.func_70489_a(par1, par3, par5);
|
|
- }
|
|
- }
|
|
-
|
|
public Vec3 func_70489_a(double par1, double par3, double par5)
|
|
{
|
|
int var7 = MathHelper.floor_double(par1);
|
|
int var8 = MathHelper.floor_double(par3);
|
|
int var9 = MathHelper.floor_double(par5);
|
|
--- 683,692 ----
|
|
***************
|
|
*** 867,881 ****
|
|
{
|
|
par1NBTTagCompound.setString("CustomName", this.entityName);
|
|
}
|
|
}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* Applies a velocity to each of the entities pushing them away from each other. Args: entity
|
|
*/
|
|
public void applyEntityCollision(Entity par1Entity)
|
|
{
|
|
--- 799,808 ----
|
|
***************
|
|
*** 963,999 ****
|
|
par1Entity.addVelocity(var2 / 4.0D, 0.0D, var4 / 4.0D);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX,
|
|
- * posY, posZ, yaw, pitch
|
|
- */
|
|
- public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
|
|
- {
|
|
- this.minecartX = par1;
|
|
- this.minecartY = par3;
|
|
- this.minecartZ = par5;
|
|
- this.minecartYaw = (double)par7;
|
|
- this.minecartPitch = (double)par8;
|
|
- this.turnProgress = par9 + 2;
|
|
- this.motionX = this.velocityX;
|
|
- this.motionY = this.velocityY;
|
|
- this.motionZ = this.velocityZ;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Sets the velocity to the args. Args: x, y, z
|
|
- */
|
|
- public void setVelocity(double par1, double par3, double par5)
|
|
- {
|
|
- this.velocityX = this.motionX = par1;
|
|
- this.velocityY = this.motionY = par3;
|
|
- this.velocityZ = this.motionZ = par5;
|
|
}
|
|
|
|
/**
|
|
* Sets the current amount of damage the minecart has taken. Decreases over time. The cart breaks when this is over
|
|
* 40.
|
|
--- 890,899 ----
|
|
*** EntityMinecartHopper.java Sat Feb 5 04:19:41 2022
|
|
--- EntityMinecartHopper.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 53,63 ****
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Called every tick the minecart is on an activator rail.
|
|
*/
|
|
public void onActivatorRailPass(int par1, int par2, int par3, boolean par4)
|
|
{
|
|
boolean var5 = !par4;
|
|
|
|
--- 53,63 ----
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power
|
|
*/
|
|
public void onActivatorRailPass(int par1, int par2, int par3, boolean par4)
|
|
{
|
|
boolean var5 = !par4;
|
|
|
|
***************
|
|
*** 149,159 ****
|
|
{
|
|
List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);
|
|
|
|
if (var1.size() > 0)
|
|
{
|
|
! TileEntityHopper.insertStackFromEntity(this, (EntityItem)var1.get(0));
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
--- 149,159 ----
|
|
{
|
|
List var1 = this.worldObj.selectEntitiesWithinAABB(EntityItem.class, this.boundingBox.expand(0.25D, 0.0D, 0.25D), IEntitySelector.selectAnything);
|
|
|
|
if (var1.size() > 0)
|
|
{
|
|
! TileEntityHopper.func_96114_a(this, (EntityItem)var1.get(0));
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
*** EntityMinecartMobSpawner.java Sat Feb 5 04:19:41 2022
|
|
--- EntityMinecartMobSpawner.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 41,64 ****
|
|
{
|
|
super.writeEntityToNBT(par1NBTTagCompound);
|
|
this.mobSpawnerLogic.writeToNBT(par1NBTTagCompound);
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- this.mobSpawnerLogic.setDelayToMin(par1);
|
|
- }
|
|
-
|
|
/**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
super.onUpdate();
|
|
this.mobSpawnerLogic.updateSpawner();
|
|
- }
|
|
-
|
|
- public MobSpawnerBaseLogic func_98039_d()
|
|
- {
|
|
- return this.mobSpawnerLogic;
|
|
}
|
|
}
|
|
--- 41,54 ----
|
|
*** EntityMinecartTNT.java Sat Feb 5 04:19:41 2022
|
|
--- EntityMinecartTNT.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 100,131 ****
|
|
|
|
super.fall(par1);
|
|
}
|
|
|
|
/**
|
|
! * Called every tick the minecart is on an activator rail.
|
|
*/
|
|
public void onActivatorRailPass(int par1, int par2, int par3, boolean par4)
|
|
{
|
|
if (par4 && this.minecartTNTFuse < 0)
|
|
{
|
|
this.ignite();
|
|
}
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 10)
|
|
- {
|
|
- this.ignite();
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Ignites this TNT cart.
|
|
*/
|
|
public void ignite()
|
|
{
|
|
--- 100,119 ----
|
|
|
|
super.fall(par1);
|
|
}
|
|
|
|
/**
|
|
! * Called every tick the minecart is on an activator rail. Args: x, y, z, is the rail receiving power
|
|
*/
|
|
public void onActivatorRailPass(int par1, int par2, int par3, boolean par4)
|
|
{
|
|
if (par4 && this.minecartTNTFuse < 0)
|
|
{
|
|
this.ignite();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ignites this TNT cart.
|
|
*/
|
|
public void ignite()
|
|
{
|
|
***************
|
|
*** 134,148 ****
|
|
if (!this.worldObj.isRemote)
|
|
{
|
|
this.worldObj.setEntityState(this, (byte)10);
|
|
this.worldObj.playSoundAtEntity(this, "random.fuse", 1.0F, 1.0F);
|
|
}
|
|
- }
|
|
-
|
|
- public int func_94104_d()
|
|
- {
|
|
- return this.minecartTNTFuse;
|
|
}
|
|
|
|
/**
|
|
* Returns true if the TNT minecart is ignited.
|
|
*/
|
|
--- 122,131 ----
|
|
*** EntityOcelot.java Sat Feb 5 04:19:41 2022
|
|
--- EntityOcelot.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 170,181 ****
|
|
return super.attackEntityFrom(par1DamageSource, par2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2) {}
|
|
|
|
/**
|
|
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
|
|
--- 170,180 ----
|
|
return super.attackEntityFrom(par1DamageSource, par2);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2) {}
|
|
|
|
/**
|
|
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
|
|
*** EntityPainting.java Sat Feb 5 04:19:41 2022
|
|
--- EntityPainting.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 36,65 ****
|
|
}
|
|
|
|
this.setDirection(par5);
|
|
}
|
|
|
|
- public EntityPainting(World par1World, int par2, int par3, int par4, int par5, String par6Str)
|
|
- {
|
|
- this(par1World, par2, par3, par4, par5);
|
|
- EnumArt[] var7 = EnumArt.values();
|
|
- int var8 = var7.length;
|
|
-
|
|
- for (int var9 = 0; var9 < var8; ++var9)
|
|
- {
|
|
- EnumArt var10 = var7[var9];
|
|
-
|
|
- if (var10.title.equals(par6Str))
|
|
- {
|
|
- this.art = var10;
|
|
- break;
|
|
- }
|
|
- }
|
|
-
|
|
- this.setDirection(par5);
|
|
- }
|
|
-
|
|
/**
|
|
* (abstract) Protected helper method to write subclass entity data to NBT.
|
|
*/
|
|
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
--- 36,45 ----
|
|
*** EntityPig.java Sat Feb 5 04:19:41 2022
|
|
--- EntityPig.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 135,146 ****
|
|
{
|
|
return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2);
|
|
|
|
--- 135,145 ----
|
|
{
|
|
return this.isBurning() ? Item.porkCooked.itemID : Item.porkRaw.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + 1 + this.rand.nextInt(1 + par2);
|
|
|
|
*** EntityPigZombie.java Sat Feb 5 04:19:41 2022
|
|
--- EntityPigZombie.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 166,177 ****
|
|
{
|
|
return "mob.zombiepig.zpigdeath";
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(2 + par2);
|
|
int var4;
|
|
--- 166,176 ----
|
|
{
|
|
return "mob.zombiepig.zpigdeath";
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(2 + par2);
|
|
int var4;
|
|
*** EntityPlayer.java Sat Feb 5 04:19:41 2022
|
|
--- EntityPlayer.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 16,26 ****
|
|
public Container inventoryContainer;
|
|
|
|
/** The Container the player has open. */
|
|
public Container openContainer;
|
|
|
|
! /** The player's food stats. (See class FoodStats) */
|
|
protected FoodStats foodStats = new FoodStats();
|
|
|
|
/**
|
|
* Used to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as
|
|
* defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly.
|
|
--- 16,26 ----
|
|
public Container inventoryContainer;
|
|
|
|
/** The Container the player has open. */
|
|
public Container openContainer;
|
|
|
|
! /** The food object of the player, the general hunger logic. */
|
|
protected FoodStats foodStats = new FoodStats();
|
|
|
|
/**
|
|
* Used to tell if the player pressed jump twice. If this is at 0 and it's pressed (And they are allowed to fly, as
|
|
* defined in the player's movementInput) it sets this to 7. If it's pressed and it's greater than 0 enable fly.
|
|
***************
|
|
*** 42,63 ****
|
|
public double field_71085_bR;
|
|
|
|
/** Boolean value indicating weather a player is sleeping or not */
|
|
protected boolean sleeping;
|
|
|
|
! /**
|
|
! * The chunk coordinates of the bed the player is in (null if player isn't in a bed).
|
|
! */
|
|
public ChunkCoordinates playerLocation;
|
|
private int sleepTimer;
|
|
public float field_71079_bU;
|
|
- public float field_71082_cx;
|
|
public float field_71089_bV;
|
|
|
|
! /**
|
|
! * Holds the last coordinate to spawn based on last bed that the player sleep.
|
|
! */
|
|
private ChunkCoordinates spawnChunk;
|
|
|
|
/**
|
|
* Whether this player's spawn point is forced, preventing execution of bed checks.
|
|
*/
|
|
--- 42,58 ----
|
|
public double field_71085_bR;
|
|
|
|
/** Boolean value indicating weather a player is sleeping or not */
|
|
protected boolean sleeping;
|
|
|
|
! /** the current location of the player */
|
|
public ChunkCoordinates playerLocation;
|
|
private int sleepTimer;
|
|
public float field_71079_bU;
|
|
public float field_71089_bV;
|
|
|
|
! /** holds the spawn chunk of the player */
|
|
private ChunkCoordinates spawnChunk;
|
|
|
|
/**
|
|
* Whether this player's spawn point is forced, preventing execution of bed checks.
|
|
*/
|
|
***************
|
|
*** 127,167 ****
|
|
this.dataWatcher.addObject(17, Float.valueOf(0.0F));
|
|
this.dataWatcher.addObject(18, Integer.valueOf(0));
|
|
}
|
|
|
|
/**
|
|
- * returns the ItemStack containing the itemInUse
|
|
- */
|
|
- public ItemStack getItemInUse()
|
|
- {
|
|
- return this.itemInUse;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the item in use count
|
|
- */
|
|
- public int getItemInUseCount()
|
|
- {
|
|
- return this.itemInUseCount;
|
|
- }
|
|
-
|
|
- /**
|
|
* Checks if the entity is currently using an item (e.g., bow, food, sword) by holding down the useItemButton
|
|
*/
|
|
public boolean isUsingItem()
|
|
{
|
|
return this.itemInUse != null;
|
|
}
|
|
|
|
- /**
|
|
- * gets the duration for how long the current itemInUse has been in use
|
|
- */
|
|
- public int getItemInUseDuration()
|
|
- {
|
|
- return this.isUsingItem() ? this.itemInUse.getMaxItemUseDuration() - this.itemInUseCount : 0;
|
|
- }
|
|
-
|
|
public void stopUsingItem()
|
|
{
|
|
if (this.itemInUse != null)
|
|
{
|
|
this.itemInUse.onPlayerStoppedUsing(this.worldObj, this, this.itemInUseCount);
|
|
--- 122,138 ----
|
|
***************
|
|
*** 388,419 ****
|
|
|
|
this.clearItemInUse();
|
|
}
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 9)
|
|
- {
|
|
- this.onItemUseFinish();
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Dead and sleeping entities cannot move
|
|
*/
|
|
protected boolean isMovementBlocked()
|
|
{
|
|
return this.getHealth() <= 0.0F || this.isPlayerSleeping();
|
|
}
|
|
|
|
/**
|
|
! * sets current screen to null (used on escape buttons of GUIs)
|
|
*/
|
|
protected void closeScreen()
|
|
{
|
|
this.openContainer = this.inventoryContainer;
|
|
}
|
|
--- 359,378 ----
|
|
|
|
this.clearItemInUse();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Dead and sleeping entities cannot move
|
|
*/
|
|
protected boolean isMovementBlocked()
|
|
{
|
|
return this.getHealth() <= 0.0F || this.isPlayerSleeping();
|
|
}
|
|
|
|
/**
|
|
! * set current crafting inventory back to the 2x2 square
|
|
*/
|
|
protected void closeScreen()
|
|
{
|
|
this.openContainer = this.inventoryContainer;
|
|
}
|
|
***************
|
|
*** 472,494 ****
|
|
this.renderYawOffset = ((EntityPig)this.ridingEntity).renderYawOffset;
|
|
}
|
|
}
|
|
}
|
|
|
|
- /**
|
|
- * Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned
|
|
- * (only actually used on players though its also on Entity)
|
|
- */
|
|
- public void preparePlayerToSpawn()
|
|
- {
|
|
- this.yOffset = 1.62F;
|
|
- this.setSize(0.6F, 1.8F);
|
|
- super.preparePlayerToSpawn();
|
|
- this.setHealth(this.getMaxHealth());
|
|
- this.deathTime = 0;
|
|
- }
|
|
-
|
|
protected void updateEntityActionState()
|
|
{
|
|
super.updateEntityActionState();
|
|
this.updateArmSwingProgress();
|
|
}
|
|
--- 431,440 ----
|
|
***************
|
|
*** 1267,1278 ****
|
|
*/
|
|
public void onCriticalHit(Entity par1Entity) {}
|
|
|
|
public void onEnchantmentCritical(Entity par1Entity) {}
|
|
|
|
- public void respawnPlayer() {}
|
|
-
|
|
/**
|
|
* Will get destroyed next tick.
|
|
*/
|
|
public void setDead()
|
|
{
|
|
--- 1213,1222 ----
|
|
***************
|
|
*** 1292,1302 ****
|
|
{
|
|
return !this.sleeping && super.isEntityInsideOpaqueBlock();
|
|
}
|
|
|
|
/**
|
|
! * Attempts to have the player sleep in a bed at the specified location.
|
|
*/
|
|
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
|
|
{
|
|
if (!this.worldObj.isRemote)
|
|
{
|
|
--- 1236,1246 ----
|
|
{
|
|
return !this.sleeping && super.isEntityInsideOpaqueBlock();
|
|
}
|
|
|
|
/**
|
|
! * puts player to sleep on specified bed if possible
|
|
*/
|
|
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
|
|
{
|
|
if (!this.worldObj.isRemote)
|
|
{
|
|
***************
|
|
*** 1487,1525 ****
|
|
return par2 && var6 && var7 ? par1ChunkCoordinates : null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Returns the orientation of the bed in degrees.
|
|
- */
|
|
- public float getBedOrientationInDegrees()
|
|
- {
|
|
- if (this.playerLocation != null)
|
|
- {
|
|
- int var1 = this.worldObj.getBlockMetadata(this.playerLocation.posX, this.playerLocation.posY, this.playerLocation.posZ);
|
|
- int var2 = BlockBed.getDirection(var1);
|
|
-
|
|
- switch (var2)
|
|
- {
|
|
- case 0:
|
|
- return 90.0F;
|
|
-
|
|
- case 1:
|
|
- return 0.0F;
|
|
-
|
|
- case 2:
|
|
- return 270.0F;
|
|
-
|
|
- case 3:
|
|
- return 180.0F;
|
|
- }
|
|
- }
|
|
-
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns whether player is sleeping or not
|
|
*/
|
|
public boolean isPlayerSleeping()
|
|
{
|
|
return this.sleeping;
|
|
--- 1431,1440 ----
|
|
***************
|
|
*** 1531,1550 ****
|
|
public boolean isPlayerFullyAsleep()
|
|
{
|
|
return this.sleeping && this.sleepTimer >= 100;
|
|
}
|
|
|
|
- public int getSleepTimer()
|
|
- {
|
|
- return this.sleepTimer;
|
|
- }
|
|
-
|
|
- protected boolean getHideCape(int par1)
|
|
- {
|
|
- return (this.dataWatcher.getWatchableObjectByte(16) & 1 << par1) != 0;
|
|
- }
|
|
-
|
|
protected void setHideCape(int par1, boolean par2)
|
|
{
|
|
byte var3 = this.dataWatcher.getWatchableObjectByte(16);
|
|
|
|
if (par2)
|
|
--- 1446,1455 ----
|
|
***************
|
|
*** 1795,1853 ****
|
|
{
|
|
super.setInWeb();
|
|
}
|
|
}
|
|
|
|
- /**
|
|
- * Gets the Icon Index of the item currently held
|
|
- */
|
|
- public Icon getItemIcon(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- Icon var3 = super.getItemIcon(par1ItemStack, par2);
|
|
-
|
|
- if (par1ItemStack.itemID == Item.fishingRod.itemID && this.fishEntity != null)
|
|
- {
|
|
- var3 = Item.fishingRod.func_94597_g();
|
|
- }
|
|
- else
|
|
- {
|
|
- if (par1ItemStack.getItem().requiresMultipleRenderPasses())
|
|
- {
|
|
- return par1ItemStack.getItem().getIconFromDamageForRenderPass(par1ItemStack.getItemDamage(), par2);
|
|
- }
|
|
-
|
|
- if (this.itemInUse != null && par1ItemStack.itemID == Item.bow.itemID)
|
|
- {
|
|
- int var4 = par1ItemStack.getMaxItemUseDuration() - this.itemInUseCount;
|
|
-
|
|
- if (var4 >= 18)
|
|
- {
|
|
- return Item.bow.getItemIconForUseDuration(2);
|
|
- }
|
|
-
|
|
- if (var4 > 13)
|
|
- {
|
|
- return Item.bow.getItemIconForUseDuration(1);
|
|
- }
|
|
-
|
|
- if (var4 > 0)
|
|
- {
|
|
- return Item.bow.getItemIconForUseDuration(0);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- return var3;
|
|
- }
|
|
-
|
|
public ItemStack getCurrentArmor(int par1)
|
|
{
|
|
return this.inventory.armorItemInSlot(par1);
|
|
}
|
|
|
|
/**
|
|
! * This method increases the player's current amount of experience.
|
|
*/
|
|
public void addExperience(int par1)
|
|
{
|
|
this.addScore(par1);
|
|
int var2 = Integer.MAX_VALUE - this.experienceTotal;
|
|
--- 1700,1716 ----
|
|
{
|
|
super.setInWeb();
|
|
}
|
|
}
|
|
|
|
public ItemStack getCurrentArmor(int par1)
|
|
{
|
|
return this.inventory.armorItemInSlot(par1);
|
|
}
|
|
|
|
/**
|
|
! * Add experience points to player.
|
|
*/
|
|
public void addExperience(int par1)
|
|
{
|
|
this.addScore(par1);
|
|
int var2 = Integer.MAX_VALUE - this.experienceTotal;
|
|
***************
|
|
*** 2021,2035 ****
|
|
public String getEntityName()
|
|
{
|
|
return this.username;
|
|
}
|
|
|
|
- public boolean getAlwaysRenderNameTagForRender()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
/**
|
|
* Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest
|
|
* Inventory.
|
|
*/
|
|
public void clonePlayer(EntityPlayer par1EntityPlayer, boolean par2)
|
|
--- 1884,1893 ----
|
|
***************
|
|
*** 2096,2108 ****
|
|
{
|
|
return this.theInventoryEnderChest;
|
|
}
|
|
|
|
/**
|
|
! * 0 = item, 1-n is armor
|
|
*/
|
|
! public ItemStack getCurrentItemOrArmor(int par1)
|
|
{
|
|
return par1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[par1 - 1];
|
|
}
|
|
|
|
/**
|
|
--- 1954,1966 ----
|
|
{
|
|
return this.theInventoryEnderChest;
|
|
}
|
|
|
|
/**
|
|
! * 0: Tool in Hand; 1-4: Armor
|
|
*/
|
|
! public ItemStack getEquipmentInSlot(int par1)
|
|
{
|
|
return par1 == 0 ? this.inventory.getCurrentItem() : this.inventory.armorInventory[par1 - 1];
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 2120,2154 ****
|
|
{
|
|
this.inventory.armorInventory[par1] = par2ItemStack;
|
|
}
|
|
|
|
/**
|
|
! * Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic
|
|
! * player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible
|
|
! * will render the entity semitransparent.
|
|
*/
|
|
! public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer)
|
|
! {
|
|
! if (!this.isInvisible())
|
|
! {
|
|
! return false;
|
|
! }
|
|
! else
|
|
! {
|
|
! Team var2 = this.getTeam();
|
|
! return var2 == null || par1EntityPlayer == null || par1EntityPlayer.getTeam() != var2 || !var2.func_98297_h();
|
|
! }
|
|
! }
|
|
!
|
|
! public ItemStack[] getLastActiveItems()
|
|
{
|
|
return this.inventory.armorInventory;
|
|
- }
|
|
-
|
|
- public boolean getHideCape()
|
|
- {
|
|
- return this.getHideCape(1);
|
|
}
|
|
|
|
public boolean isPushedByWater()
|
|
{
|
|
return !this.capabilities.isFlying;
|
|
--- 1978,1992 ----
|
|
{
|
|
this.inventory.armorInventory[par1] = par2ItemStack;
|
|
}
|
|
|
|
/**
|
|
! * returns the inventory of this entity (only used in EntityPlayerMP it seems)
|
|
*/
|
|
! public ItemStack[] getInventory()
|
|
{
|
|
return this.inventory.armorInventory;
|
|
}
|
|
|
|
public boolean isPushedByWater()
|
|
{
|
|
return !this.capabilities.isFlying;
|
|
*** EntityPlayerMP.java Sat Feb 5 04:19:41 2022
|
|
--- EntityPlayerMP.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 37,47 ****
|
|
|
|
/** entities added to this list will be packet29'd to the player */
|
|
public final List destroyedItemsNetCache = new LinkedList();
|
|
private float field_130068_bO = Float.MIN_VALUE;
|
|
|
|
! /** set to getHealth */
|
|
private float lastHealth = -1.0E8F;
|
|
|
|
/** set to foodStats.GetFoodLevel */
|
|
private int lastFoodLevel = -99999999;
|
|
|
|
--- 37,47 ----
|
|
|
|
/** entities added to this list will be packet29'd to the player */
|
|
public final List destroyedItemsNetCache = new LinkedList();
|
|
private float field_130068_bO = Float.MIN_VALUE;
|
|
|
|
! /** amount of health the client was last set to */
|
|
private float lastHealth = -1.0E8F;
|
|
|
|
/** set to foodStats.GetFoodLevel */
|
|
private int lastFoodLevel = -99999999;
|
|
|
|
***************
|
|
*** 49,60 ****
|
|
private boolean wasHungry = true;
|
|
|
|
/** Amount of experience the client was last set to */
|
|
private int lastExperience = -99999999;
|
|
|
|
! /** de-increments onUpdate, attackEntityFrom is ignored if this >0 */
|
|
! private int initialInvulnerability = 60;
|
|
|
|
/** must be between 3>x>15 (strictly between) */
|
|
private int renderDistance;
|
|
private int chatVisibility;
|
|
private boolean chatColours = true;
|
|
--- 49,60 ----
|
|
private boolean wasHungry = true;
|
|
|
|
/** Amount of experience the client was last set to */
|
|
private int lastExperience = -99999999;
|
|
|
|
! /** how many ticks of invulnerability(spawn protection) this player has */
|
|
! private int ticksOfInvuln = 60;
|
|
|
|
/** must be between 3>x>15 (strictly between) */
|
|
private int renderDistance;
|
|
private int chatVisibility;
|
|
private boolean chatColours = true;
|
|
***************
|
|
*** 64,77 ****
|
|
* The currently in use window ID. Incremented every time a window is opened.
|
|
*/
|
|
private int currentWindowId;
|
|
|
|
/**
|
|
! * poor mans concurency flag, lets hope the jvm doesn't re-order the setting of this flag wrt the inventory change
|
|
! * on the next line
|
|
*/
|
|
! public boolean playerInventoryBeingManipulated;
|
|
public int ping;
|
|
|
|
/**
|
|
* Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory
|
|
* and XP
|
|
--- 64,77 ----
|
|
* The currently in use window ID. Incremented every time a window is opened.
|
|
*/
|
|
private int currentWindowId;
|
|
|
|
/**
|
|
! * set to true when player is moving quantity of items from one inventory to another(crafting) but item in either
|
|
! * slot is not changed
|
|
*/
|
|
! public boolean isChangingQuantityOnly;
|
|
public int ping;
|
|
|
|
/**
|
|
* Set when a player beats the ender dragon, used to respawn the player at the spawn point while retaining inventory
|
|
* and XP
|
|
***************
|
|
*** 146,156 ****
|
|
this.lastExperience = -1;
|
|
}
|
|
|
|
public void addSelfToInternalCraftingInventory()
|
|
{
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* sets the players height back to normal after doing things like sleeping and dieing
|
|
*/
|
|
--- 146,156 ----
|
|
this.lastExperience = -1;
|
|
}
|
|
|
|
public void addSelfToInternalCraftingInventory()
|
|
{
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* sets the players height back to normal after doing things like sleeping and dieing
|
|
*/
|
|
***************
|
|
*** 168,178 ****
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
this.theItemInWorldManager.updateBlockRemoving();
|
|
! --this.initialInvulnerability;
|
|
this.openContainer.detectAndSendChanges();
|
|
|
|
if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this))
|
|
{
|
|
this.closeScreen();
|
|
--- 168,178 ----
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
this.theItemInWorldManager.updateBlockRemoving();
|
|
! --this.ticksOfInvuln;
|
|
this.openContainer.detectAndSendChanges();
|
|
|
|
if (!this.worldObj.isRemote && !this.openContainer.canInteractWith(this))
|
|
{
|
|
this.closeScreen();
|
|
***************
|
|
*** 190,200 ****
|
|
{
|
|
var2[var4++] = ((Integer)var3.next()).intValue();
|
|
var3.remove();
|
|
}
|
|
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet29DestroyEntity(var2));
|
|
}
|
|
|
|
if (!this.loadedChunks.isEmpty())
|
|
{
|
|
ArrayList var6 = new ArrayList();
|
|
--- 190,200 ----
|
|
{
|
|
var2[var4++] = ((Integer)var3.next()).intValue();
|
|
var3.remove();
|
|
}
|
|
|
|
! this.playerNetServerHandler.sendPacket(new Packet29DestroyEntity(var2));
|
|
}
|
|
|
|
if (!this.loadedChunks.isEmpty())
|
|
{
|
|
ArrayList var6 = new ArrayList();
|
|
***************
|
|
*** 207,229 ****
|
|
var7.remove();
|
|
|
|
if (var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4))
|
|
{
|
|
var6.add(this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos));
|
|
! var8.addAll(((WorldServer)this.worldObj).getAllTileEntityInBox(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16));
|
|
}
|
|
}
|
|
|
|
if (!var6.isEmpty())
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet56MapChunks(var6));
|
|
Iterator var10 = var8.iterator();
|
|
|
|
while (var10.hasNext())
|
|
{
|
|
TileEntity var5 = (TileEntity)var10.next();
|
|
! this.sendTileEntityToPlayer(var5);
|
|
}
|
|
|
|
var10 = var6.iterator();
|
|
|
|
while (var10.hasNext())
|
|
--- 207,229 ----
|
|
var7.remove();
|
|
|
|
if (var9 != null && this.worldObj.blockExists(var9.chunkXPos << 4, 0, var9.chunkZPos << 4))
|
|
{
|
|
var6.add(this.worldObj.getChunkFromChunkCoords(var9.chunkXPos, var9.chunkZPos));
|
|
! var8.addAll(((WorldServer)this.worldObj).getTileEntityList(var9.chunkXPos * 16, 0, var9.chunkZPos * 16, var9.chunkXPos * 16 + 16, 256, var9.chunkZPos * 16 + 16));
|
|
}
|
|
}
|
|
|
|
if (!var6.isEmpty())
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet56MapChunks(var6));
|
|
Iterator var10 = var8.iterator();
|
|
|
|
while (var10.hasNext())
|
|
{
|
|
TileEntity var5 = (TileEntity)var10.next();
|
|
! this.getTileEntityInfo(var5);
|
|
}
|
|
|
|
var10 = var6.iterator();
|
|
|
|
while (var10.hasNext())
|
|
***************
|
|
*** 232,244 ****
|
|
this.getServerForPlayer().getEntityTracker().func_85172_a(this, var11);
|
|
}
|
|
}
|
|
}
|
|
|
|
! if (this.field_143005_bX > 0L && this.mcServer.func_143007_ar() > 0 && MinecraftServer.getSystemTimeMillis() - this.field_143005_bX > (long)(this.mcServer.func_143007_ar() * 1000 * 60))
|
|
{
|
|
! this.playerNetServerHandler.kickPlayerFromServer("You have been idle for too long!");
|
|
}
|
|
}
|
|
|
|
public void onUpdateEntity()
|
|
{
|
|
--- 232,244 ----
|
|
this.getServerForPlayer().getEntityTracker().func_85172_a(this, var11);
|
|
}
|
|
}
|
|
}
|
|
|
|
! if (this.field_143005_bX > 0L && this.mcServer.func_143007_ar() > 0 && MinecraftServer.getCurrentTimeMillis() - this.field_143005_bX > (long)(this.mcServer.func_143007_ar() * 1000 * 60))
|
|
{
|
|
! this.playerNetServerHandler.kickPlayer("You have been idle for too long!");
|
|
}
|
|
}
|
|
|
|
public void onUpdateEntity()
|
|
{
|
|
***************
|
|
*** 248,271 ****
|
|
|
|
for (int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1)
|
|
{
|
|
ItemStack var6 = this.inventory.getStackInSlot(var1);
|
|
|
|
! if (var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.packetSize() <= 5)
|
|
{
|
|
! Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).createMapDataPacket(var6, this.worldObj, this);
|
|
|
|
if (var8 != null)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(var8);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel()));
|
|
this.lastHealth = this.getHealth();
|
|
this.lastFoodLevel = this.foodStats.getFoodLevel();
|
|
this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F;
|
|
}
|
|
|
|
--- 248,271 ----
|
|
|
|
for (int var1 = 0; var1 < this.inventory.getSizeInventory(); ++var1)
|
|
{
|
|
ItemStack var6 = this.inventory.getStackInSlot(var1);
|
|
|
|
! if (var6 != null && Item.itemsList[var6.itemID].isMap() && this.playerNetServerHandler.getNumChunkDataPackets() <= 5)
|
|
{
|
|
! Packet var8 = ((ItemMapBase)Item.itemsList[var6.itemID]).getUpdatePacket(var6, this.worldObj, this);
|
|
|
|
if (var8 != null)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(var8);
|
|
}
|
|
}
|
|
}
|
|
|
|
if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel()));
|
|
this.lastHealth = this.getHealth();
|
|
this.lastFoodLevel = this.foodStats.getFoodLevel();
|
|
this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F;
|
|
}
|
|
|
|
***************
|
|
*** 283,293 ****
|
|
}
|
|
|
|
if (this.experienceTotal != this.lastExperience)
|
|
{
|
|
this.lastExperience = this.experienceTotal;
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel));
|
|
}
|
|
}
|
|
catch (Throwable var4)
|
|
{
|
|
CrashReport var2 = CrashReport.makeCrashReport(var4, "Ticking player");
|
|
--- 283,293 ----
|
|
}
|
|
|
|
if (this.experienceTotal != this.lastExperience)
|
|
{
|
|
this.lastExperience = this.experienceTotal;
|
|
! this.playerNetServerHandler.sendPacket(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel));
|
|
}
|
|
}
|
|
catch (Throwable var4)
|
|
{
|
|
CrashReport var2 = CrashReport.makeCrashReport(var4, "Ticking player");
|
|
***************
|
|
*** 340,350 ****
|
|
}
|
|
else
|
|
{
|
|
boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(par1DamageSource.damageType);
|
|
|
|
! if (!var3 && this.initialInvulnerability > 0 && par1DamageSource != DamageSource.outOfWorld)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
--- 340,350 ----
|
|
}
|
|
else
|
|
{
|
|
boolean var3 = this.mcServer.isDedicatedServer() && this.mcServer.isPVPEnabled() && "fall".equals(par1DamageSource.damageType);
|
|
|
|
! if (!var3 && this.ticksOfInvuln > 0 && par1DamageSource != DamageSource.outOfWorld)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
***************
|
|
*** 386,396 ****
|
|
if (this.dimension == 1 && par1 == 1)
|
|
{
|
|
this.triggerAchievement(AchievementList.theEnd2);
|
|
this.worldObj.removeEntity(this);
|
|
this.playerConqueredTheEnd = true;
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(4, 0));
|
|
}
|
|
else
|
|
{
|
|
if (this.dimension == 0 && par1 == 1)
|
|
{
|
|
--- 386,396 ----
|
|
if (this.dimension == 1 && par1 == 1)
|
|
{
|
|
this.triggerAchievement(AchievementList.theEnd2);
|
|
this.worldObj.removeEntity(this);
|
|
this.playerConqueredTheEnd = true;
|
|
! this.playerNetServerHandler.sendPacket(new Packet70GameEvent(4, 0));
|
|
}
|
|
else
|
|
{
|
|
if (this.dimension == 0 && par1 == 1)
|
|
{
|
|
***************
|
|
*** 415,435 ****
|
|
this.lastFoodLevel = -1;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * called from onUpdate for all tileEntity in specific chunks
|
|
*/
|
|
! private void sendTileEntityToPlayer(TileEntity par1TileEntity)
|
|
{
|
|
if (par1TileEntity != null)
|
|
{
|
|
Packet var2 = par1TileEntity.getDescriptionPacket();
|
|
|
|
if (var2 != null)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(var2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 415,435 ----
|
|
this.lastFoodLevel = -1;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * gets description packets from all TileEntity's that override func_20070
|
|
*/
|
|
! private void getTileEntityInfo(TileEntity par1TileEntity)
|
|
{
|
|
if (par1TileEntity != null)
|
|
{
|
|
Packet var2 = par1TileEntity.getDescriptionPacket();
|
|
|
|
if (var2 != null)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(var2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 440,461 ****
|
|
super.onItemPickup(par1Entity, par2);
|
|
this.openContainer.detectAndSendChanges();
|
|
}
|
|
|
|
/**
|
|
! * Attempts to have the player sleep in a bed at the specified location.
|
|
*/
|
|
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
|
|
{
|
|
EnumStatus var4 = super.sleepInBedAt(par1, par2, par3);
|
|
|
|
if (var4 == EnumStatus.OK)
|
|
{
|
|
Packet17Sleep var5 = new Packet17Sleep(this, 0, par1, par2, par3);
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToAllPlayersTrackingEntity(this, var5);
|
|
this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(var5);
|
|
}
|
|
|
|
return var4;
|
|
}
|
|
|
|
--- 440,461 ----
|
|
super.onItemPickup(par1Entity, par2);
|
|
this.openContainer.detectAndSendChanges();
|
|
}
|
|
|
|
/**
|
|
! * puts player to sleep on specified bed if possible
|
|
*/
|
|
public EnumStatus sleepInBedAt(int par1, int par2, int par3)
|
|
{
|
|
EnumStatus var4 = super.sleepInBedAt(par1, par2, par3);
|
|
|
|
if (var4 == EnumStatus.OK)
|
|
{
|
|
Packet17Sleep var5 = new Packet17Sleep(this, 0, par1, par2, par3);
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayers(this, var5);
|
|
this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
|
! this.playerNetServerHandler.sendPacket(var5);
|
|
}
|
|
|
|
return var4;
|
|
}
|
|
|
|
***************
|
|
*** 464,474 ****
|
|
*/
|
|
public void wakeUpPlayer(boolean par1, boolean par2, boolean par3)
|
|
{
|
|
if (this.isPlayerSleeping())
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 3));
|
|
}
|
|
|
|
super.wakeUpPlayer(par1, par2, par3);
|
|
|
|
if (this.playerNetServerHandler != null)
|
|
--- 464,474 ----
|
|
*/
|
|
public void wakeUpPlayer(boolean par1, boolean par2, boolean par3)
|
|
{
|
|
if (this.isPlayerSleeping())
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 3));
|
|
}
|
|
|
|
super.wakeUpPlayer(par1, par2, par3);
|
|
|
|
if (this.playerNetServerHandler != null)
|
|
***************
|
|
*** 481,504 ****
|
|
* Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
|
|
*/
|
|
public void mountEntity(Entity par1Entity)
|
|
{
|
|
super.mountEntity(par1Entity);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this, this.ridingEntity));
|
|
this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
|
}
|
|
|
|
/**
|
|
* Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance
|
|
* and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround
|
|
*/
|
|
protected void updateFallState(double par1, boolean par3) {}
|
|
|
|
/**
|
|
! * likeUpdateFallState, but called from updateFlyingState, rather than moveEntity
|
|
*/
|
|
! public void updateFlyingState(double par1, boolean par3)
|
|
{
|
|
super.updateFallState(par1, par3);
|
|
}
|
|
|
|
/**
|
|
--- 481,504 ----
|
|
* Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
|
|
*/
|
|
public void mountEntity(Entity par1Entity)
|
|
{
|
|
super.mountEntity(par1Entity);
|
|
! this.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this, this.ridingEntity));
|
|
this.playerNetServerHandler.setPlayerLocation(this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch);
|
|
}
|
|
|
|
/**
|
|
* Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance
|
|
* and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround
|
|
*/
|
|
protected void updateFallState(double par1, boolean par3) {}
|
|
|
|
/**
|
|
! * process player falling based on movement packet
|
|
*/
|
|
! public void handleFalling(double par1, boolean par3)
|
|
{
|
|
super.updateFallState(par1, par3);
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 507,556 ****
|
|
public void displayGUIEditSign(TileEntity par1TileEntity)
|
|
{
|
|
if (par1TileEntity instanceof TileEntitySign)
|
|
{
|
|
((TileEntitySign)par1TileEntity).func_142010_a(this);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet133TileEditorOpen(0, par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord));
|
|
}
|
|
}
|
|
|
|
! private void incrementWindowID()
|
|
{
|
|
this.currentWindowId = this.currentWindowId % 100 + 1;
|
|
}
|
|
|
|
/**
|
|
* Displays the crafting GUI for a workbench.
|
|
*/
|
|
public void displayGUIWorkbench(int par1, int par2, int par3)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true));
|
|
this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, par1, par2, par3);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 4, par4Str == null ? "" : par4Str, 9, par4Str != null));
|
|
this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, par1, par2, par3);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with an anvil.
|
|
*/
|
|
public void displayGUIAnvil(int par1, int par2, int par3)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true));
|
|
this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with a chest inventory. Args: chestInventory
|
|
*/
|
|
--- 507,559 ----
|
|
public void displayGUIEditSign(TileEntity par1TileEntity)
|
|
{
|
|
if (par1TileEntity instanceof TileEntitySign)
|
|
{
|
|
((TileEntitySign)par1TileEntity).func_142010_a(this);
|
|
! this.playerNetServerHandler.sendPacket(new Packet133TileEditorOpen(0, par1TileEntity.xCoord, par1TileEntity.yCoord, par1TileEntity.zCoord));
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * get the next window id to use
|
|
! */
|
|
! private void getNextWindowId()
|
|
{
|
|
this.currentWindowId = this.currentWindowId % 100 + 1;
|
|
}
|
|
|
|
/**
|
|
* Displays the crafting GUI for a workbench.
|
|
*/
|
|
public void displayGUIWorkbench(int par1, int par2, int par3)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 1, "Crafting", 9, true));
|
|
this.openContainer = new ContainerWorkbench(this.inventory, this.worldObj, par1, par2, par3);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
public void displayGUIEnchantment(int par1, int par2, int par3, String par4Str)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 4, par4Str == null ? "" : par4Str, 9, par4Str != null));
|
|
this.openContainer = new ContainerEnchantment(this.inventory, this.worldObj, par1, par2, par3);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with an anvil.
|
|
*/
|
|
public void displayGUIAnvil(int par1, int par2, int par3)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 8, "Repairing", 9, true));
|
|
this.openContainer = new ContainerRepair(this.inventory, this.worldObj, par1, par2, par3, this);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with a chest inventory. Args: chestInventory
|
|
*/
|
|
***************
|
|
*** 559,660 ****
|
|
if (this.openContainer != this.inventoryContainer)
|
|
{
|
|
this.closeScreen();
|
|
}
|
|
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 0, par1IInventory.getInvName(), par1IInventory.getSizeInventory(), par1IInventory.isInvNameLocalized()));
|
|
this.openContainer = new ContainerChest(this.inventory, par1IInventory);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
public void displayGUIHopper(TileEntityHopper par1TileEntityHopper)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1TileEntityHopper.getInvName(), par1TileEntityHopper.getSizeInventory(), par1TileEntityHopper.isInvNameLocalized()));
|
|
this.openContainer = new ContainerHopper(this.inventory, par1TileEntityHopper);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized()));
|
|
this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace
|
|
*/
|
|
public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory(), par1TileEntityFurnace.isInvNameLocalized()));
|
|
this.openContainer = new ContainerFurnace(this.inventory, par1TileEntityFurnace);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser
|
|
*/
|
|
public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, par1TileEntityDispenser instanceof TileEntityDropper ? 10 : 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory(), par1TileEntityDispenser.isInvNameLocalized()));
|
|
this.openContainer = new ContainerDispenser(this.inventory, par1TileEntityDispenser);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with a brewing stand.
|
|
*/
|
|
public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 5, par1TileEntityBrewingStand.getInvName(), par1TileEntityBrewingStand.getSizeInventory(), par1TileEntityBrewingStand.isInvNameLocalized()));
|
|
this.openContainer = new ContainerBrewingStand(this.inventory, par1TileEntityBrewingStand);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with a beacon.
|
|
*/
|
|
public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon)
|
|
{
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 7, par1TileEntityBeacon.getInvName(), par1TileEntityBeacon.getSizeInventory(), par1TileEntityBeacon.isInvNameLocalized()));
|
|
this.openContainer = new ContainerBeacon(this.inventory, par1TileEntityBeacon);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str)
|
|
{
|
|
! this.incrementWindowID();
|
|
this.openContainer = new ContainerMerchant(this.inventory, par1IMerchant, this.worldObj);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 6, par2Str == null ? "" : par2Str, var3.getSizeInventory(), par2Str != null));
|
|
MerchantRecipeList var4 = par1IMerchant.getRecipes(this);
|
|
|
|
if (var4 != null)
|
|
{
|
|
try
|
|
{
|
|
ByteArrayOutputStream var5 = new ByteArrayOutputStream();
|
|
DataOutputStream var6 = new DataOutputStream(var5);
|
|
var6.writeInt(this.currentWindowId);
|
|
var4.writeRecipiesToStream(var6);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TrList", var5.toByteArray()));
|
|
}
|
|
catch (IOException var7)
|
|
{
|
|
var7.printStackTrace();
|
|
}
|
|
--- 562,663 ----
|
|
if (this.openContainer != this.inventoryContainer)
|
|
{
|
|
this.closeScreen();
|
|
}
|
|
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 0, par1IInventory.getInvName(), par1IInventory.getSizeInventory(), par1IInventory.isInvNameLocalized()));
|
|
this.openContainer = new ContainerChest(this.inventory, par1IInventory);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
public void displayGUIHopper(TileEntityHopper par1TileEntityHopper)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, par1TileEntityHopper.getInvName(), par1TileEntityHopper.getSizeInventory(), par1TileEntityHopper.isInvNameLocalized()));
|
|
this.openContainer = new ContainerHopper(this.inventory, par1TileEntityHopper);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
public void displayGUIHopperMinecart(EntityMinecartHopper par1EntityMinecartHopper)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 9, par1EntityMinecartHopper.getInvName(), par1EntityMinecartHopper.getSizeInventory(), par1EntityMinecartHopper.isInvNameLocalized()));
|
|
this.openContainer = new ContainerHopper(this.inventory, par1EntityMinecartHopper);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the furnace GUI for the passed in furnace entity. Args: tileEntityFurnace
|
|
*/
|
|
public void displayGUIFurnace(TileEntityFurnace par1TileEntityFurnace)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 2, par1TileEntityFurnace.getInvName(), par1TileEntityFurnace.getSizeInventory(), par1TileEntityFurnace.isInvNameLocalized()));
|
|
this.openContainer = new ContainerFurnace(this.inventory, par1TileEntityFurnace);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the dipsenser GUI for the passed in dispenser entity. Args: TileEntityDispenser
|
|
*/
|
|
public void displayGUIDispenser(TileEntityDispenser par1TileEntityDispenser)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, par1TileEntityDispenser instanceof TileEntityDropper ? 10 : 3, par1TileEntityDispenser.getInvName(), par1TileEntityDispenser.getSizeInventory(), par1TileEntityDispenser.isInvNameLocalized()));
|
|
this.openContainer = new ContainerDispenser(this.inventory, par1TileEntityDispenser);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with a brewing stand.
|
|
*/
|
|
public void displayGUIBrewingStand(TileEntityBrewingStand par1TileEntityBrewingStand)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 5, par1TileEntityBrewingStand.getInvName(), par1TileEntityBrewingStand.getSizeInventory(), par1TileEntityBrewingStand.isInvNameLocalized()));
|
|
this.openContainer = new ContainerBrewingStand(this.inventory, par1TileEntityBrewingStand);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* Displays the GUI for interacting with a beacon.
|
|
*/
|
|
public void displayGUIBeacon(TileEntityBeacon par1TileEntityBeacon)
|
|
{
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 7, par1TileEntityBeacon.getInvName(), par1TileEntityBeacon.getSizeInventory(), par1TileEntityBeacon.isInvNameLocalized()));
|
|
this.openContainer = new ContainerBeacon(this.inventory, par1TileEntityBeacon);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
public void displayGUIMerchant(IMerchant par1IMerchant, String par2Str)
|
|
{
|
|
! this.getNextWindowId();
|
|
this.openContainer = new ContainerMerchant(this.inventory, par1IMerchant, this.worldObj);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
InventoryMerchant var3 = ((ContainerMerchant)this.openContainer).getMerchantInventory();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 6, par2Str == null ? "" : par2Str, var3.getSizeInventory(), par2Str != null));
|
|
MerchantRecipeList var4 = par1IMerchant.getRecipes(this);
|
|
|
|
if (var4 != null)
|
|
{
|
|
try
|
|
{
|
|
ByteArrayOutputStream var5 = new ByteArrayOutputStream();
|
|
DataOutputStream var6 = new DataOutputStream(var5);
|
|
var6.writeInt(this.currentWindowId);
|
|
var4.writeRecipiesToStream(var6);
|
|
! this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TrList", var5.toByteArray()));
|
|
}
|
|
catch (IOException var7)
|
|
{
|
|
var7.printStackTrace();
|
|
}
|
|
***************
|
|
*** 666,735 ****
|
|
if (this.openContainer != this.inventoryContainer)
|
|
{
|
|
this.closeScreen();
|
|
}
|
|
|
|
! this.incrementWindowID();
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet100OpenWindow(this.currentWindowId, 11, par2IInventory.getInvName(), par2IInventory.getSizeInventory(), par2IInventory.isInvNameLocalized(), par1EntityHorse.entityId));
|
|
this.openContainer = new ContainerHorseInventory(this.inventory, par2IInventory, par1EntityHorse);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.addCraftingToCrafters(this);
|
|
}
|
|
|
|
/**
|
|
* Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual
|
|
* contents of that slot. Args: Container, slot number, slot contents
|
|
*/
|
|
public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack)
|
|
{
|
|
if (!(par1Container.getSlot(par2) instanceof SlotCrafting))
|
|
{
|
|
! if (!this.playerInventoryBeingManipulated)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void sendContainerToPlayer(Container par1Container)
|
|
{
|
|
! this.sendContainerAndContentsToPlayer(par1Container, par1Container.getInventory());
|
|
}
|
|
|
|
! public void sendContainerAndContentsToPlayer(Container par1Container, List par2List)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet104WindowItems(par1Container.windowId, par2List));
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
|
|
}
|
|
|
|
/**
|
|
* Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress,
|
|
* and enchanting level. Normally the first int identifies which variable to update, and the second contains the new
|
|
* value. Both are truncated to shorts in non-local SMP.
|
|
*/
|
|
public void sendProgressBarUpdate(Container par1Container, int par2, int par3)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet105UpdateProgressbar(par1Container.windowId, par2, par3));
|
|
}
|
|
|
|
/**
|
|
! * sets current screen to null (used on escape buttons of GUIs)
|
|
*/
|
|
public void closeScreen()
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet101CloseWindow(this.openContainer.windowId));
|
|
this.closeContainer();
|
|
}
|
|
|
|
/**
|
|
* updates item held by mouse
|
|
*/
|
|
public void updateHeldItem()
|
|
{
|
|
! if (!this.playerInventoryBeingManipulated)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Closes the container the player currently has open.
|
|
--- 669,741 ----
|
|
if (this.openContainer != this.inventoryContainer)
|
|
{
|
|
this.closeScreen();
|
|
}
|
|
|
|
! this.getNextWindowId();
|
|
! this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, 11, par2IInventory.getInvName(), par2IInventory.getSizeInventory(), par2IInventory.isInvNameLocalized(), par1EntityHorse.entityId));
|
|
this.openContainer = new ContainerHorseInventory(this.inventory, par2IInventory, par1EntityHorse);
|
|
this.openContainer.windowId = this.currentWindowId;
|
|
! this.openContainer.onCraftGuiOpened(this);
|
|
}
|
|
|
|
/**
|
|
* Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual
|
|
* contents of that slot. Args: Container, slot number, slot contents
|
|
*/
|
|
public void sendSlotContents(Container par1Container, int par2, ItemStack par3ItemStack)
|
|
{
|
|
if (!(par1Container.getSlot(par2) instanceof SlotCrafting))
|
|
{
|
|
! if (!this.isChangingQuantityOnly)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet103SetSlot(par1Container.windowId, par2, par3ItemStack));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void sendContainerToPlayer(Container par1Container)
|
|
{
|
|
! this.updateCraftingInventory(par1Container, par1Container.getInventory());
|
|
}
|
|
|
|
! /**
|
|
! * update the crafting window inventory with the items in the list
|
|
! */
|
|
! public void updateCraftingInventory(Container par1Container, List par2List)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet104WindowItems(par1Container.windowId, par2List));
|
|
! this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
|
|
}
|
|
|
|
/**
|
|
* Sends two ints to the client-side Container. Used for furnace burning time, smelting progress, brewing progress,
|
|
* and enchanting level. Normally the first int identifies which variable to update, and the second contains the new
|
|
* value. Both are truncated to shorts in non-local SMP.
|
|
*/
|
|
public void sendProgressBarUpdate(Container par1Container, int par2, int par3)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet105UpdateProgressbar(par1Container.windowId, par2, par3));
|
|
}
|
|
|
|
/**
|
|
! * set current crafting inventory back to the 2x2 square
|
|
*/
|
|
public void closeScreen()
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet101CloseWindow(this.openContainer.windowId));
|
|
this.closeContainer();
|
|
}
|
|
|
|
/**
|
|
* updates item held by mouse
|
|
*/
|
|
public void updateHeldItem()
|
|
{
|
|
! if (!this.isChangingQuantityOnly)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet103SetSlot(-1, -1, this.inventory.getItemStack()));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Closes the container the player currently has open.
|
|
***************
|
|
*** 766,776 ****
|
|
{
|
|
if (par1StatBase != null)
|
|
{
|
|
if (!par1StatBase.isIndependent)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet200Statistic(par1StatBase.statId, par2));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void mountEntityAndWakeUp()
|
|
--- 772,782 ----
|
|
{
|
|
if (par1StatBase != null)
|
|
{
|
|
if (!par1StatBase.isIndependent)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet200Statistic(par1StatBase.statId, par2));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void mountEntityAndWakeUp()
|
|
***************
|
|
*** 798,816 ****
|
|
/**
|
|
* Add a chat message to the player
|
|
*/
|
|
public void addChatMessage(String par1Str)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(par1Str)));
|
|
}
|
|
|
|
/**
|
|
* Used for when item use count runs out, ie: eating completed
|
|
*/
|
|
protected void onItemUseFinish()
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet38EntityStatus(this.entityId, (byte)9));
|
|
super.onItemUseFinish();
|
|
}
|
|
|
|
/**
|
|
* sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration
|
|
--- 804,822 ----
|
|
/**
|
|
* Add a chat message to the player
|
|
*/
|
|
public void addChatMessage(String par1Str)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey(par1Str)));
|
|
}
|
|
|
|
/**
|
|
* Used for when item use count runs out, ie: eating completed
|
|
*/
|
|
protected void onItemUseFinish()
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet38EntityStatus(this.entityId, (byte)9));
|
|
super.onItemUseFinish();
|
|
}
|
|
|
|
/**
|
|
* sets the itemInUse when the use item button is clicked. Args: itemstack, int maxItemUseDuration
|
|
***************
|
|
*** 819,829 ****
|
|
{
|
|
super.setItemInUse(par1ItemStack, par2);
|
|
|
|
if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat)
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(this, 5));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest
|
|
--- 825,835 ----
|
|
{
|
|
super.setItemInUse(par1ItemStack, par2);
|
|
|
|
if (par1ItemStack != null && par1ItemStack.getItem() != null && par1ItemStack.getItem().getItemUseAction(par1ItemStack) == EnumAction.eat)
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(this, 5));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Copies the values from the given player into this player if boolean par2 is true. Always clones Ender Chest
|
|
***************
|
|
*** 839,865 ****
|
|
}
|
|
|
|
protected void onNewPotionEffect(PotionEffect par1PotionEffect)
|
|
{
|
|
super.onNewPotionEffect(par1PotionEffect);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect));
|
|
}
|
|
|
|
protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2)
|
|
{
|
|
super.onChangedPotionEffect(par1PotionEffect, par2);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.entityId, par1PotionEffect));
|
|
}
|
|
|
|
protected void onFinishedPotionEffect(PotionEffect par1PotionEffect)
|
|
{
|
|
super.onFinishedPotionEffect(par1PotionEffect);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet42RemoveEntityEffect(this.entityId, par1PotionEffect));
|
|
}
|
|
|
|
/**
|
|
! * Move the entity to the coordinates informed, but keep yaw/pitch values.
|
|
*/
|
|
public void setPositionAndUpdate(double par1, double par3, double par5)
|
|
{
|
|
this.playerNetServerHandler.setPlayerLocation(par1, par3, par5, this.rotationYaw, this.rotationPitch);
|
|
}
|
|
--- 845,871 ----
|
|
}
|
|
|
|
protected void onNewPotionEffect(PotionEffect par1PotionEffect)
|
|
{
|
|
super.onNewPotionEffect(par1PotionEffect);
|
|
! this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, par1PotionEffect));
|
|
}
|
|
|
|
protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2)
|
|
{
|
|
super.onChangedPotionEffect(par1PotionEffect, par2);
|
|
! this.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.entityId, par1PotionEffect));
|
|
}
|
|
|
|
protected void onFinishedPotionEffect(PotionEffect par1PotionEffect)
|
|
{
|
|
super.onFinishedPotionEffect(par1PotionEffect);
|
|
! this.playerNetServerHandler.sendPacket(new Packet42RemoveEntityEffect(this.entityId, par1PotionEffect));
|
|
}
|
|
|
|
/**
|
|
! * Sets the position of the entity and updates the 'last' variables
|
|
*/
|
|
public void setPositionAndUpdate(double par1, double par3, double par5)
|
|
{
|
|
this.playerNetServerHandler.setPlayerLocation(par1, par3, par5, this.rotationYaw, this.rotationPitch);
|
|
}
|
|
***************
|
|
*** 867,892 ****
|
|
/**
|
|
* Called when the player performs a critical hit on the Entity. Args: entity that was hit critically
|
|
*/
|
|
public void onCriticalHit(Entity par1Entity)
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 6));
|
|
}
|
|
|
|
public void onEnchantmentCritical(Entity par1Entity)
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToAllAssociatedPlayers(this, new Packet18Animation(par1Entity, 7));
|
|
}
|
|
|
|
/**
|
|
* Sends the player's abilities to the server (if there is one).
|
|
*/
|
|
public void sendPlayerAbilities()
|
|
{
|
|
if (this.playerNetServerHandler != null)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet202PlayerAbilities(this.capabilities));
|
|
}
|
|
}
|
|
|
|
public WorldServer getServerForPlayer()
|
|
{
|
|
--- 873,898 ----
|
|
/**
|
|
* Called when the player performs a critical hit on the Entity. Args: entity that was hit critically
|
|
*/
|
|
public void onCriticalHit(Entity par1Entity)
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(par1Entity, 6));
|
|
}
|
|
|
|
public void onEnchantmentCritical(Entity par1Entity)
|
|
{
|
|
! this.getServerForPlayer().getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(this, new Packet18Animation(par1Entity, 7));
|
|
}
|
|
|
|
/**
|
|
* Sends the player's abilities to the server (if there is one).
|
|
*/
|
|
public void sendPlayerAbilities()
|
|
{
|
|
if (this.playerNetServerHandler != null)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet202PlayerAbilities(this.capabilities));
|
|
}
|
|
}
|
|
|
|
public WorldServer getServerForPlayer()
|
|
{
|
|
***************
|
|
*** 897,912 ****
|
|
* Sets the player's game mode and sends it to them.
|
|
*/
|
|
public void setGameType(EnumGameType par1EnumGameType)
|
|
{
|
|
this.theItemInWorldManager.setGameType(par1EnumGameType);
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(3, par1EnumGameType.getID()));
|
|
}
|
|
|
|
public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent)
|
|
{
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(par1ChatMessageComponent));
|
|
}
|
|
|
|
/**
|
|
* Returns true if the command sender is allowed to use the given command.
|
|
*/
|
|
--- 903,918 ----
|
|
* Sets the player's game mode and sends it to them.
|
|
*/
|
|
public void setGameType(EnumGameType par1EnumGameType)
|
|
{
|
|
this.theItemInWorldManager.setGameType(par1EnumGameType);
|
|
! this.playerNetServerHandler.sendPacket(new Packet70GameEvent(3, par1EnumGameType.getID()));
|
|
}
|
|
|
|
public void sendChatToPlayer(ChatMessageComponent par1ChatMessageComponent)
|
|
{
|
|
! this.playerNetServerHandler.sendPacket(new Packet3Chat(par1ChatMessageComponent));
|
|
}
|
|
|
|
/**
|
|
* Returns true if the command sender is allowed to use the given command.
|
|
*/
|
|
***************
|
|
*** 918,928 ****
|
|
/**
|
|
* Gets the player's IP address. Used in /banip.
|
|
*/
|
|
public String getPlayerIP()
|
|
{
|
|
! String var1 = this.playerNetServerHandler.netManager.getSocketAddress().toString();
|
|
var1 = var1.substring(var1.indexOf("/") + 1);
|
|
var1 = var1.substring(0, var1.indexOf(":"));
|
|
return var1;
|
|
}
|
|
|
|
--- 924,934 ----
|
|
/**
|
|
* Gets the player's IP address. Used in /banip.
|
|
*/
|
|
public String getPlayerIP()
|
|
{
|
|
! String var1 = this.playerNetServerHandler.netManager.getRemoteAddress().toString();
|
|
var1 = var1.substring(var1.indexOf("/") + 1);
|
|
var1 = var1.substring(0, var1.indexOf(":"));
|
|
return var1;
|
|
}
|
|
|
|
***************
|
|
*** 956,976 ****
|
|
* on recieving this message the client (if permission is given) will download the requested textures
|
|
*/
|
|
public void requestTexturePackLoad(String par1Str, int par2)
|
|
{
|
|
String var3 = par1Str + "\u0000" + par2;
|
|
! this.playerNetServerHandler.sendPacketToPlayer(new Packet250CustomPayload("MC|TPack", var3.getBytes()));
|
|
}
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! public ChunkCoordinates getPlayerCoordinates()
|
|
{
|
|
return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ));
|
|
}
|
|
|
|
public void func_143004_u()
|
|
{
|
|
! this.field_143005_bX = MinecraftServer.getSystemTimeMillis();
|
|
}
|
|
}
|
|
--- 962,982 ----
|
|
* on recieving this message the client (if permission is given) will download the requested textures
|
|
*/
|
|
public void requestTexturePackLoad(String par1Str, int par2)
|
|
{
|
|
String var3 = par1Str + "\u0000" + par2;
|
|
! this.playerNetServerHandler.sendPacket(new Packet250CustomPayload("MC|TPack", var3.getBytes()));
|
|
}
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! public ChunkCoordinates getCommandSenderPosition()
|
|
{
|
|
return new ChunkCoordinates(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY + 0.5D), MathHelper.floor_double(this.posZ));
|
|
}
|
|
|
|
public void func_143004_u()
|
|
{
|
|
! this.field_143005_bX = MinecraftServer.getCurrentTimeMillis();
|
|
}
|
|
}
|
|
*** EntityPotion.java Sat Feb 5 04:19:41 2022
|
|
--- EntityPotion.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 24,38 ****
|
|
{
|
|
super(par1World, par2EntityLivingBase);
|
|
this.potionDamage = par3ItemStack;
|
|
}
|
|
|
|
- public EntityPotion(World par1World, double par2, double par4, double par6, int par8)
|
|
- {
|
|
- this(par1World, par2, par4, par6, new ItemStack(Item.potion, 1, par8));
|
|
- }
|
|
-
|
|
public EntityPotion(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack)
|
|
{
|
|
super(par1World, par2, par4, par6);
|
|
this.potionDamage = par8ItemStack;
|
|
}
|
|
--- 24,33 ----
|
|
*** EntitySelectorArmoredMob.java Sat Feb 5 04:19:41 2022
|
|
--- EntitySelectorArmoredMob.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 23,31 ****
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
EntityLivingBase var2 = (EntityLivingBase)par1Entity;
|
|
! return var2.getCurrentItemOrArmor(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer);
|
|
}
|
|
}
|
|
}
|
|
--- 23,31 ----
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
EntityLivingBase var2 = (EntityLivingBase)par1Entity;
|
|
! return var2.getEquipmentInSlot(EntityLiving.getArmorPosition(this.field_96567_c)) != null ? false : (var2 instanceof EntityLiving ? ((EntityLiving)var2).canPickUpLoot() : var2 instanceof EntityPlayer);
|
|
}
|
|
}
|
|
}
|
|
*** EntitySheep.java Sat Feb 5 04:19:41 2022
|
|
--- EntitySheep.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 78,89 ****
|
|
super.entityInit();
|
|
this.dataWatcher.addObject(16, new Byte((byte)0));
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
if (!this.getSheared())
|
|
{
|
|
--- 78,88 ----
|
|
super.entityInit();
|
|
this.dataWatcher.addObject(16, new Byte((byte)0));
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
if (!this.getSheared())
|
|
{
|
|
***************
|
|
*** 95,134 ****
|
|
* Returns the item ID for the item the mob drops on death.
|
|
*/
|
|
protected int getDropItemId()
|
|
{
|
|
return Block.cloth.blockID;
|
|
- }
|
|
-
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 10)
|
|
- {
|
|
- this.sheepTimer = 40;
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
- public float func_70894_j(float par1)
|
|
- {
|
|
- return this.sheepTimer <= 0 ? 0.0F : (this.sheepTimer >= 4 && this.sheepTimer <= 36 ? 1.0F : (this.sheepTimer < 4 ? ((float)this.sheepTimer - par1) / 4.0F : -((float)(this.sheepTimer - 40) - par1) / 4.0F));
|
|
- }
|
|
-
|
|
- public float func_70890_k(float par1)
|
|
- {
|
|
- if (this.sheepTimer > 4 && this.sheepTimer <= 36)
|
|
- {
|
|
- float var2 = ((float)(this.sheepTimer - 4) - par1) / 32.0F;
|
|
- return ((float)Math.PI / 5F) + ((float)Math.PI * 7F / 100F) * MathHelper.sin(var2 * 28.7F);
|
|
- }
|
|
- else
|
|
- {
|
|
- return this.sheepTimer > 0 ? ((float)Math.PI / 5F) : this.rotationPitch / (180F / (float)Math.PI);
|
|
- }
|
|
}
|
|
|
|
/**
|
|
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
|
|
*/
|
|
--- 94,103 ----
|
|
*** EntitySkeleton.java Sat Feb 5 04:19:41 2022
|
|
--- EntitySkeleton.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 113,123 ****
|
|
float var1 = this.getBrightness(1.0F);
|
|
|
|
if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
|
|
{
|
|
boolean var2 = true;
|
|
! ItemStack var3 = this.getCurrentItemOrArmor(4);
|
|
|
|
if (var3 != null)
|
|
{
|
|
if (var3.isItemStackDamageable())
|
|
{
|
|
--- 113,123 ----
|
|
float var1 = this.getBrightness(1.0F);
|
|
|
|
if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
|
|
{
|
|
boolean var2 = true;
|
|
! ItemStack var3 = this.getEquipmentInSlot(4);
|
|
|
|
if (var3 != null)
|
|
{
|
|
if (var3.isItemStackDamageable())
|
|
{
|
|
***************
|
|
*** 189,200 ****
|
|
{
|
|
return Item.arrow.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3;
|
|
int var4;
|
|
--- 189,199 ----
|
|
{
|
|
return Item.arrow.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3;
|
|
int var4;
|
|
***************
|
|
*** 261,271 ****
|
|
this.enchantEquipment();
|
|
}
|
|
|
|
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ));
|
|
|
|
! if (this.getCurrentItemOrArmor(4) == null)
|
|
{
|
|
Calendar var2 = this.worldObj.getCurrentDate();
|
|
|
|
if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F)
|
|
{
|
|
--- 260,270 ----
|
|
this.enchantEquipment();
|
|
}
|
|
|
|
this.setCanPickUpLoot(this.rand.nextFloat() < 0.55F * this.worldObj.getLocationTensionFactor(this.posX, this.posY, this.posZ));
|
|
|
|
! if (this.getEquipmentInSlot(4) == null)
|
|
{
|
|
Calendar var2 = this.worldObj.getCurrentDate();
|
|
|
|
if (var2.get(2) + 1 == 10 && var2.get(5) == 31 && this.rand.nextFloat() < 0.25F)
|
|
{
|
|
*** EntitySlime.java Sat Feb 5 04:19:41 2022
|
|
--- EntitySlime.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 4,14 ****
|
|
{
|
|
public float squishAmount;
|
|
public float squishFactor;
|
|
public float prevSquishFactor;
|
|
|
|
! /** the time between each jump of the slime */
|
|
private int slimeJumpDelay;
|
|
|
|
public EntitySlime(World par1World)
|
|
{
|
|
super(par1World);
|
|
--- 4,14 ----
|
|
{
|
|
public float squishAmount;
|
|
public float squishFactor;
|
|
public float prevSquishFactor;
|
|
|
|
! /** ticks until this slime jumps again */
|
|
private int slimeJumpDelay;
|
|
|
|
public EntitySlime(World par1World)
|
|
{
|
|
super(par1World);
|
|
*** EntitySnowman.java Sat Feb 5 04:19:41 2022
|
|
--- EntitySnowman.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 70,81 ****
|
|
{
|
|
return Item.snowball.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(16);
|
|
|
|
--- 70,80 ----
|
|
{
|
|
return Item.snowball.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(16);
|
|
|
|
*** EntitySpider.java Sat Feb 5 04:19:41 2022
|
|
--- EntitySpider.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 124,135 ****
|
|
{
|
|
return Item.silk.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
super.dropFewItems(par1, par2);
|
|
|
|
--- 124,134 ----
|
|
{
|
|
return Item.silk.itemID;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
super.dropFewItems(par1, par2);
|
|
|
|
*** EntitySquid.java Sat Feb 5 04:19:41 2022
|
|
--- EntitySquid.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 10,27 ****
|
|
/**
|
|
* appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate.
|
|
*/
|
|
public float squidRotation;
|
|
|
|
! /** previous squidRotation in radians. */
|
|
public float prevSquidRotation;
|
|
|
|
/** angle of the tentacles in radians */
|
|
public float tentacleAngle;
|
|
|
|
/** the last calculated angle of the tentacles in radians */
|
|
! public float prevTentacleAngle;
|
|
private float randomMotionSpeed;
|
|
|
|
/** change in squidRotation in radians. */
|
|
private float rotationVelocity;
|
|
private float field_70871_bB;
|
|
--- 10,27 ----
|
|
/**
|
|
* appears to be rotation in radians; we already have pitch & yaw, so this completes the triumvirate.
|
|
*/
|
|
public float squidRotation;
|
|
|
|
! /** previous squidRotation in radians */
|
|
public float prevSquidRotation;
|
|
|
|
/** angle of the tentacles in radians */
|
|
public float tentacleAngle;
|
|
|
|
/** the last calculated angle of the tentacles in radians */
|
|
! public float lastTentacleAngle;
|
|
private float randomMotionSpeed;
|
|
|
|
/** change in squidRotation in radians. */
|
|
private float rotationVelocity;
|
|
private float field_70871_bB;
|
|
***************
|
|
*** 90,101 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3 + par2) + 1;
|
|
|
|
--- 90,100 ----
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3 + par2) + 1;
|
|
|
|
***************
|
|
*** 122,132 ****
|
|
{
|
|
super.onLivingUpdate();
|
|
this.prevSquidPitch = this.squidPitch;
|
|
this.prevSquidYaw = this.squidYaw;
|
|
this.prevSquidRotation = this.squidRotation;
|
|
! this.prevTentacleAngle = this.tentacleAngle;
|
|
this.squidRotation += this.rotationVelocity;
|
|
|
|
if (this.squidRotation > ((float)Math.PI * 2F))
|
|
{
|
|
this.squidRotation -= ((float)Math.PI * 2F);
|
|
--- 121,131 ----
|
|
{
|
|
super.onLivingUpdate();
|
|
this.prevSquidPitch = this.squidPitch;
|
|
this.prevSquidYaw = this.squidYaw;
|
|
this.prevSquidRotation = this.squidRotation;
|
|
! this.lastTentacleAngle = this.tentacleAngle;
|
|
this.squidRotation += this.rotationVelocity;
|
|
|
|
if (this.squidRotation > ((float)Math.PI * 2F))
|
|
{
|
|
this.squidRotation -= ((float)Math.PI * 2F);
|
|
*** EntityTameable.java Sat Feb 5 04:19:41 2022
|
|
--- EntityTameable.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 72,97 ****
|
|
double var8 = this.rand.nextGaussian() * 0.02D;
|
|
this.worldObj.spawnParticle(var2, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var4, var6, var8);
|
|
}
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 7)
|
|
- {
|
|
- this.playTameEffect(true);
|
|
- }
|
|
- else if (par1 == 6)
|
|
- {
|
|
- this.playTameEffect(false);
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
public boolean isTamed()
|
|
{
|
|
return (this.dataWatcher.getWatchableObjectByte(16) & 4) != 0;
|
|
}
|
|
|
|
--- 72,81 ----
|
|
*** EntityThrowable.java Sat Feb 5 04:19:41 2022
|
|
--- EntityThrowable.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 9,21 ****
|
|
private int zTile = -1;
|
|
private int inTile;
|
|
protected boolean inGround;
|
|
public int throwableShake;
|
|
|
|
! /**
|
|
! * Is the entity that throws this 'thing' (snowball, ender pearl, eye of ender or potion)
|
|
! */
|
|
private EntityLivingBase thrower;
|
|
private String throwerName;
|
|
private int ticksInGround;
|
|
private int ticksInAir;
|
|
|
|
--- 9,19 ----
|
|
private int zTile = -1;
|
|
private int inTile;
|
|
protected boolean inGround;
|
|
public int throwableShake;
|
|
|
|
! /** The entity that threw this throwable item. */
|
|
private EntityLivingBase thrower;
|
|
private String throwerName;
|
|
private int ticksInGround;
|
|
private int ticksInAir;
|
|
|
|
***************
|
|
*** 25,45 ****
|
|
this.setSize(0.25F, 0.25F);
|
|
}
|
|
|
|
protected void entityInit() {}
|
|
|
|
- /**
|
|
- * Checks if the entity is in range to render by using the past in distance and comparing it to its average edge
|
|
- * length * 64 * renderDistanceWeight Args: distance
|
|
- */
|
|
- public boolean isInRangeToRenderDist(double par1)
|
|
- {
|
|
- double var3 = this.boundingBox.getAverageEdgeLength() * 4.0D;
|
|
- var3 *= 64.0D;
|
|
- return par1 < var3 * var3;
|
|
- }
|
|
-
|
|
public EntityThrowable(World par1World, EntityLivingBase par2EntityLivingBase)
|
|
{
|
|
super(par1World);
|
|
this.thrower = par2EntityLivingBase;
|
|
this.setSize(0.25F, 0.25F);
|
|
--- 23,32 ----
|
|
***************
|
|
*** 98,124 ****
|
|
this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var10) * 180.0D / Math.PI);
|
|
this.ticksInGround = 0;
|
|
}
|
|
|
|
/**
|
|
- * Sets the velocity to the args. Args: x, y, z
|
|
- */
|
|
- public void setVelocity(double par1, double par3, double par5)
|
|
- {
|
|
- this.motionX = par1;
|
|
- this.motionY = par3;
|
|
- this.motionZ = par5;
|
|
-
|
|
- if (this.prevRotationPitch == 0.0F && this.prevRotationYaw == 0.0F)
|
|
- {
|
|
- float var7 = MathHelper.sqrt_double(par1 * par1 + par5 * par5);
|
|
- this.prevRotationYaw = this.rotationYaw = (float)(Math.atan2(par1, par5) * 180.0D / Math.PI);
|
|
- this.prevRotationPitch = this.rotationPitch = (float)(Math.atan2(par3, (double)var7) * 180.0D / Math.PI);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
this.lastTickPosX = this.posX;
|
|
--- 85,94 ----
|
|
***************
|
|
*** 159,169 ****
|
|
++this.ticksInAir;
|
|
}
|
|
|
|
Vec3 var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var3 = this.worldObj.clip(var16, var2);
|
|
var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var3 != null)
|
|
{
|
|
--- 129,139 ----
|
|
++this.ticksInAir;
|
|
}
|
|
|
|
Vec3 var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
Vec3 var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
! MovingObjectPosition var3 = this.worldObj.rayTraceBlocks(var16, var2);
|
|
var16 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX, this.posY, this.posZ);
|
|
var2 = this.worldObj.getWorldVec3Pool().getVecFromPool(this.posX + this.motionX, this.posY + this.motionY, this.posZ + this.motionZ);
|
|
|
|
if (var3 != null)
|
|
{
|
|
***************
|
|
*** 315,329 ****
|
|
|
|
if (this.throwerName != null && this.throwerName.length() == 0)
|
|
{
|
|
this.throwerName = null;
|
|
}
|
|
- }
|
|
-
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
}
|
|
|
|
public EntityLivingBase getThrower()
|
|
{
|
|
if (this.thrower == null && this.throwerName != null && this.throwerName.length() > 0)
|
|
--- 285,294 ----
|
|
*** EntityTNTPrimed.java Sat Feb 5 04:19:41 2022
|
|
--- EntityTNTPrimed.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 104,118 ****
|
|
protected void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
this.fuse = par1NBTTagCompound.getByte("Fuse");
|
|
}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* returns null or the entityliving it was placed or ignited by
|
|
*/
|
|
public EntityLivingBase getTntPlacedBy()
|
|
{
|
|
--- 104,113 ----
|
|
*** EntityTracker.java Sat Feb 5 04:19:41 2022
|
|
--- EntityTracker.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 11,182 ****
|
|
|
|
/**
|
|
* List of tracked entities, used for iteration operations on tracked entities.
|
|
*/
|
|
private Set trackedEntities = new HashSet();
|
|
! private IntHashMap trackedEntityIDs = new IntHashMap();
|
|
! private int entityViewDistance;
|
|
|
|
public EntityTracker(WorldServer par1WorldServer)
|
|
{
|
|
this.theWorld = par1WorldServer;
|
|
! this.entityViewDistance = par1WorldServer.getMinecraftServer().getConfigurationManager().getEntityViewDistance();
|
|
}
|
|
|
|
! /**
|
|
! * if entity is a player sends all tracked events to the player, otherwise, adds with a visibility and update arate
|
|
! * based on the class type
|
|
! */
|
|
! public void addEntityToTracker(Entity par1Entity)
|
|
{
|
|
if (par1Entity instanceof EntityPlayerMP)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 512, 2);
|
|
EntityPlayerMP var2 = (EntityPlayerMP)par1Entity;
|
|
Iterator var3 = this.trackedEntities.iterator();
|
|
|
|
while (var3.hasNext())
|
|
{
|
|
EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next();
|
|
|
|
! if (var4.myEntity != var2)
|
|
{
|
|
! var4.tryStartWachingThis(var2);
|
|
}
|
|
}
|
|
}
|
|
else if (par1Entity instanceof EntityFishHook)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 5, true);
|
|
}
|
|
else if (par1Entity instanceof EntityArrow)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 20, false);
|
|
}
|
|
else if (par1Entity instanceof EntitySmallFireball)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, false);
|
|
}
|
|
else if (par1Entity instanceof EntityFireball)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, false);
|
|
}
|
|
else if (par1Entity instanceof EntitySnowball)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEnderPearl)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEnderEye)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 4, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEgg)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityPotion)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityExpBottle)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityFireworkRocket)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityItem)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 20, true);
|
|
}
|
|
else if (par1Entity instanceof EntityMinecart)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 80, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityBoat)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 80, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntitySquid)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 64, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityWither)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 80, 3, false);
|
|
}
|
|
else if (par1Entity instanceof EntityBat)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 80, 3, false);
|
|
}
|
|
else if (par1Entity instanceof IAnimals)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 80, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityDragon)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 160, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityTNTPrimed)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 160, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityFallingSand)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 160, 20, true);
|
|
}
|
|
else if (par1Entity instanceof EntityHanging)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 160, Integer.MAX_VALUE, false);
|
|
}
|
|
else if (par1Entity instanceof EntityXPOrb)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 160, 20, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEnderCrystal)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, 256, Integer.MAX_VALUE, false);
|
|
}
|
|
}
|
|
|
|
! public void addEntityToTracker(Entity par1Entity, int par2, int par3)
|
|
{
|
|
! this.addEntityToTracker(par1Entity, par2, par3, false);
|
|
}
|
|
|
|
! public void addEntityToTracker(Entity par1Entity, int par2, int par3, boolean par4)
|
|
{
|
|
! if (par2 > this.entityViewDistance)
|
|
{
|
|
! par2 = this.entityViewDistance;
|
|
}
|
|
|
|
try
|
|
{
|
|
! if (this.trackedEntityIDs.containsItem(par1Entity.entityId))
|
|
{
|
|
throw new IllegalStateException("Entity is already tracked!");
|
|
}
|
|
|
|
EntityTrackerEntry var5 = new EntityTrackerEntry(par1Entity, par2, par3, par4);
|
|
this.trackedEntities.add(var5);
|
|
! this.trackedEntityIDs.addKey(par1Entity.entityId, var5);
|
|
! var5.sendEventsToPlayers(this.theWorld.playerEntities);
|
|
}
|
|
catch (Throwable var11)
|
|
{
|
|
CrashReport var6 = CrashReport.makeCrashReport(var11, "Adding entity to track");
|
|
CrashReportCategory var7 = var6.makeCategory("Entity To Track");
|
|
var7.addCrashSection("Tracking range", par2 + " blocks");
|
|
var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, par3));
|
|
par1Entity.addEntityCrashInfo(var7);
|
|
CrashReportCategory var8 = var6.makeCategory("Entity That Is Already Tracked");
|
|
! ((EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId)).myEntity.addEntityCrashInfo(var8);
|
|
|
|
try
|
|
{
|
|
throw new ReportedException(var6);
|
|
}
|
|
--- 11,180 ----
|
|
|
|
/**
|
|
* List of tracked entities, used for iteration operations on tracked entities.
|
|
*/
|
|
private Set trackedEntities = new HashSet();
|
|
!
|
|
! /** Used for identity lookup of tracked entities. */
|
|
! private IntHashMap trackedEntityHashTable = new IntHashMap();
|
|
! private int maxTrackingDistanceThreshold;
|
|
|
|
public EntityTracker(WorldServer par1WorldServer)
|
|
{
|
|
this.theWorld = par1WorldServer;
|
|
! this.maxTrackingDistanceThreshold = par1WorldServer.getMinecraftServer().getConfigurationManager().getEntityViewDistance();
|
|
}
|
|
|
|
! public void trackEntity(Entity par1Entity)
|
|
{
|
|
if (par1Entity instanceof EntityPlayerMP)
|
|
{
|
|
! this.trackEntity(par1Entity, 512, 2);
|
|
EntityPlayerMP var2 = (EntityPlayerMP)par1Entity;
|
|
Iterator var3 = this.trackedEntities.iterator();
|
|
|
|
while (var3.hasNext())
|
|
{
|
|
EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next();
|
|
|
|
! if (var4.trackedEntity != var2)
|
|
{
|
|
! var4.updatePlayerEntity(var2);
|
|
}
|
|
}
|
|
}
|
|
else if (par1Entity instanceof EntityFishHook)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 5, true);
|
|
}
|
|
else if (par1Entity instanceof EntityArrow)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 20, false);
|
|
}
|
|
else if (par1Entity instanceof EntitySmallFireball)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, false);
|
|
}
|
|
else if (par1Entity instanceof EntityFireball)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, false);
|
|
}
|
|
else if (par1Entity instanceof EntitySnowball)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEnderPearl)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEnderEye)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 4, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEgg)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityPotion)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityExpBottle)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityFireworkRocket)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityItem)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 20, true);
|
|
}
|
|
else if (par1Entity instanceof EntityMinecart)
|
|
{
|
|
! this.trackEntity(par1Entity, 80, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityBoat)
|
|
{
|
|
! this.trackEntity(par1Entity, 80, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntitySquid)
|
|
{
|
|
! this.trackEntity(par1Entity, 64, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityWither)
|
|
{
|
|
! this.trackEntity(par1Entity, 80, 3, false);
|
|
}
|
|
else if (par1Entity instanceof EntityBat)
|
|
{
|
|
! this.trackEntity(par1Entity, 80, 3, false);
|
|
}
|
|
else if (par1Entity instanceof IAnimals)
|
|
{
|
|
! this.trackEntity(par1Entity, 80, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityDragon)
|
|
{
|
|
! this.trackEntity(par1Entity, 160, 3, true);
|
|
}
|
|
else if (par1Entity instanceof EntityTNTPrimed)
|
|
{
|
|
! this.trackEntity(par1Entity, 160, 10, true);
|
|
}
|
|
else if (par1Entity instanceof EntityFallingSand)
|
|
{
|
|
! this.trackEntity(par1Entity, 160, 20, true);
|
|
}
|
|
else if (par1Entity instanceof EntityHanging)
|
|
{
|
|
! this.trackEntity(par1Entity, 160, Integer.MAX_VALUE, false);
|
|
}
|
|
else if (par1Entity instanceof EntityXPOrb)
|
|
{
|
|
! this.trackEntity(par1Entity, 160, 20, true);
|
|
}
|
|
else if (par1Entity instanceof EntityEnderCrystal)
|
|
{
|
|
! this.trackEntity(par1Entity, 256, Integer.MAX_VALUE, false);
|
|
}
|
|
}
|
|
|
|
! public void trackEntity(Entity par1Entity, int par2, int par3)
|
|
{
|
|
! this.trackEntity(par1Entity, par2, par3, false);
|
|
}
|
|
|
|
! public void trackEntity(Entity par1Entity, int par2, int par3, boolean par4)
|
|
{
|
|
! if (par2 > this.maxTrackingDistanceThreshold)
|
|
{
|
|
! par2 = this.maxTrackingDistanceThreshold;
|
|
}
|
|
|
|
try
|
|
{
|
|
! if (this.trackedEntityHashTable.containsItem(par1Entity.entityId))
|
|
{
|
|
throw new IllegalStateException("Entity is already tracked!");
|
|
}
|
|
|
|
EntityTrackerEntry var5 = new EntityTrackerEntry(par1Entity, par2, par3, par4);
|
|
this.trackedEntities.add(var5);
|
|
! this.trackedEntityHashTable.addKey(par1Entity.entityId, var5);
|
|
! var5.updatePlayerEntities(this.theWorld.playerEntities);
|
|
}
|
|
catch (Throwable var11)
|
|
{
|
|
CrashReport var6 = CrashReport.makeCrashReport(var11, "Adding entity to track");
|
|
CrashReportCategory var7 = var6.makeCategory("Entity To Track");
|
|
var7.addCrashSection("Tracking range", par2 + " blocks");
|
|
var7.addCrashSectionCallable("Update interval", new CallableEntityTracker(this, par3));
|
|
par1Entity.addEntityCrashInfo(var7);
|
|
CrashReportCategory var8 = var6.makeCategory("Entity That Is Already Tracked");
|
|
! ((EntityTrackerEntry)this.trackedEntityHashTable.lookup(par1Entity.entityId)).trackedEntity.addEntityCrashInfo(var8);
|
|
|
|
try
|
|
{
|
|
throw new ReportedException(var6);
|
|
}
|
|
***************
|
|
*** 186,215 ****
|
|
var10.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void removeEntityFromAllTrackingPlayers(Entity par1Entity)
|
|
{
|
|
if (par1Entity instanceof EntityPlayerMP)
|
|
{
|
|
EntityPlayerMP var2 = (EntityPlayerMP)par1Entity;
|
|
Iterator var3 = this.trackedEntities.iterator();
|
|
|
|
while (var3.hasNext())
|
|
{
|
|
EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next();
|
|
! var4.removeFromWatchingList(var2);
|
|
}
|
|
}
|
|
|
|
! EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityIDs.removeObject(par1Entity.entityId);
|
|
|
|
if (var5 != null)
|
|
{
|
|
this.trackedEntities.remove(var5);
|
|
! var5.informAllAssociatedPlayersOfItemDestruction();
|
|
}
|
|
}
|
|
|
|
public void updateTrackedEntities()
|
|
{
|
|
--- 184,213 ----
|
|
var10.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void untrackEntity(Entity par1Entity)
|
|
{
|
|
if (par1Entity instanceof EntityPlayerMP)
|
|
{
|
|
EntityPlayerMP var2 = (EntityPlayerMP)par1Entity;
|
|
Iterator var3 = this.trackedEntities.iterator();
|
|
|
|
while (var3.hasNext())
|
|
{
|
|
EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next();
|
|
! var4.removeFromTrackedPlayers(var2);
|
|
}
|
|
}
|
|
|
|
! EntityTrackerEntry var5 = (EntityTrackerEntry)this.trackedEntityHashTable.removeObject(par1Entity.entityId);
|
|
|
|
if (var5 != null)
|
|
{
|
|
this.trackedEntities.remove(var5);
|
|
! var5.sendDestroyEntityPacketToTrackedPlayers();
|
|
}
|
|
}
|
|
|
|
public void updateTrackedEntities()
|
|
{
|
|
***************
|
|
*** 217,231 ****
|
|
Iterator var2 = this.trackedEntities.iterator();
|
|
|
|
while (var2.hasNext())
|
|
{
|
|
EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next();
|
|
! var3.sendLocationToAllClients(this.theWorld.playerEntities);
|
|
|
|
! if (var3.playerEntitiesUpdated && var3.myEntity instanceof EntityPlayerMP)
|
|
{
|
|
! var1.add((EntityPlayerMP)var3.myEntity);
|
|
}
|
|
}
|
|
|
|
for (int var6 = 0; var6 < var1.size(); ++var6)
|
|
{
|
|
--- 215,229 ----
|
|
Iterator var2 = this.trackedEntities.iterator();
|
|
|
|
while (var2.hasNext())
|
|
{
|
|
EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next();
|
|
! var3.updatePlayerList(this.theWorld.playerEntities);
|
|
|
|
! if (var3.playerEntitiesUpdated && var3.trackedEntity instanceof EntityPlayerMP)
|
|
{
|
|
! var1.add((EntityPlayerMP)var3.trackedEntity);
|
|
}
|
|
}
|
|
|
|
for (int var6 = 0; var6 < var1.size(); ++var6)
|
|
{
|
|
***************
|
|
*** 234,285 ****
|
|
|
|
while (var4.hasNext())
|
|
{
|
|
EntityTrackerEntry var5 = (EntityTrackerEntry)var4.next();
|
|
|
|
! if (var5.myEntity != var7)
|
|
{
|
|
! var5.tryStartWachingThis(var7);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * does not send the packet to the entity if the entity is a player
|
|
! */
|
|
! public void sendPacketToAllPlayersTrackingEntity(Entity par1Entity, Packet par2Packet)
|
|
{
|
|
! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId);
|
|
|
|
if (var3 != null)
|
|
{
|
|
! var3.sendPacketToAllTrackingPlayers(par2Packet);
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * sends to the entity if the entity is a player
|
|
! */
|
|
! public void sendPacketToAllAssociatedPlayers(Entity par1Entity, Packet par2Packet)
|
|
{
|
|
! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityIDs.lookup(par1Entity.entityId);
|
|
|
|
if (var3 != null)
|
|
{
|
|
! var3.sendPacketToAllAssociatedPlayers(par2Packet);
|
|
}
|
|
}
|
|
|
|
public void removePlayerFromTrackers(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
Iterator var2 = this.trackedEntities.iterator();
|
|
|
|
while (var2.hasNext())
|
|
{
|
|
EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next();
|
|
! var3.removePlayerFromTracker(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
|
|
public void func_85172_a(EntityPlayerMP par1EntityPlayerMP, Chunk par2Chunk)
|
|
{
|
|
--- 232,277 ----
|
|
|
|
while (var4.hasNext())
|
|
{
|
|
EntityTrackerEntry var5 = (EntityTrackerEntry)var4.next();
|
|
|
|
! if (var5.trackedEntity != var7)
|
|
{
|
|
! var5.updatePlayerEntity(var7);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void sendPacketToTrackedPlayers(Entity par1Entity, Packet par2Packet)
|
|
{
|
|
! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(par1Entity.entityId);
|
|
|
|
if (var3 != null)
|
|
{
|
|
! var3.sendPacketToTrackedPlayers(par2Packet);
|
|
}
|
|
}
|
|
|
|
! public void sendPacketToTrackedPlayersAndTrackedEntity(Entity par1Entity, Packet par2Packet)
|
|
{
|
|
! EntityTrackerEntry var3 = (EntityTrackerEntry)this.trackedEntityHashTable.lookup(par1Entity.entityId);
|
|
|
|
if (var3 != null)
|
|
{
|
|
! var3.sendPacketToTrackedPlayersAndTrackedEntity(par2Packet);
|
|
}
|
|
}
|
|
|
|
public void removePlayerFromTrackers(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
Iterator var2 = this.trackedEntities.iterator();
|
|
|
|
while (var2.hasNext())
|
|
{
|
|
EntityTrackerEntry var3 = (EntityTrackerEntry)var2.next();
|
|
! var3.removeTrackedPlayerSymmetric(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
|
|
public void func_85172_a(EntityPlayerMP par1EntityPlayerMP, Chunk par2Chunk)
|
|
{
|
|
***************
|
|
*** 287,298 ****
|
|
|
|
while (var3.hasNext())
|
|
{
|
|
EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next();
|
|
|
|
! if (var4.myEntity != par1EntityPlayerMP && var4.myEntity.chunkCoordX == par2Chunk.xPosition && var4.myEntity.chunkCoordZ == par2Chunk.zPosition)
|
|
{
|
|
! var4.tryStartWachingThis(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--- 279,290 ----
|
|
|
|
while (var3.hasNext())
|
|
{
|
|
EntityTrackerEntry var4 = (EntityTrackerEntry)var3.next();
|
|
|
|
! if (var4.trackedEntity != par1EntityPlayerMP && var4.trackedEntity.chunkCoordX == par2Chunk.xPosition && var4.trackedEntity.chunkCoordZ == par2Chunk.zPosition)
|
|
{
|
|
! var4.updatePlayerEntity(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
*** EntityTrackerEntry.java Sat Feb 5 04:19:41 2022
|
|
--- EntityTrackerEntry.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 6,36 ****
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
|
|
public class EntityTrackerEntry
|
|
{
|
|
! public Entity myEntity;
|
|
! public int blocksDistanceThreshold;
|
|
|
|
/** check for sync when ticks % updateFrequency==0 */
|
|
public int updateFrequency;
|
|
! public int lastScaledXPosition;
|
|
! public int lastScaledYPosition;
|
|
! public int lastScaledZPosition;
|
|
! public int lastYaw;
|
|
! public int lastPitch;
|
|
public int lastHeadMotion;
|
|
! public double motionX;
|
|
! public double motionY;
|
|
public double motionZ;
|
|
! public int ticks;
|
|
! private double posX;
|
|
! private double posY;
|
|
! private double posZ;
|
|
!
|
|
! /** set to true on first sendLocationToClients */
|
|
! private boolean isDataInitialized;
|
|
private boolean sendVelocityUpdates;
|
|
|
|
/**
|
|
* every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position
|
|
* remains fully synced.
|
|
--- 6,45 ----
|
|
import java.util.List;
|
|
import java.util.Set;
|
|
|
|
public class EntityTrackerEntry
|
|
{
|
|
! /** The entity that this EntityTrackerEntry tracks. */
|
|
! public Entity trackedEntity;
|
|
! public int trackingDistanceThreshold;
|
|
|
|
/** check for sync when ticks % updateFrequency==0 */
|
|
public int updateFrequency;
|
|
!
|
|
! /** The encoded entity X position. */
|
|
! public int encodedPosX;
|
|
!
|
|
! /** The encoded entity Y position. */
|
|
! public int encodedPosY;
|
|
!
|
|
! /** The encoded entity Z position. */
|
|
! public int encodedPosZ;
|
|
!
|
|
! /** The encoded entity yaw rotation. */
|
|
! public int encodedRotationYaw;
|
|
!
|
|
! /** The encoded entity pitch rotation. */
|
|
! public int encodedRotationPitch;
|
|
public int lastHeadMotion;
|
|
! public double lastTrackedEntityMotionX;
|
|
! public double lastTrackedEntityMotionY;
|
|
public double motionZ;
|
|
! public int updateCounter;
|
|
! private double lastTrackedEntityPosX;
|
|
! private double lastTrackedEntityPosY;
|
|
! private double lastTrackedEntityPosZ;
|
|
! private boolean firstUpdateDone;
|
|
private boolean sendVelocityUpdates;
|
|
|
|
/**
|
|
* every 400 ticks a full teleport packet is sent, rather than just a "move me +x" command, so that position
|
|
* remains fully synced.
|
|
***************
|
|
*** 45,585 ****
|
|
*/
|
|
public Set trackingPlayers = new HashSet();
|
|
|
|
public EntityTrackerEntry(Entity par1Entity, int par2, int par3, boolean par4)
|
|
{
|
|
! this.myEntity = par1Entity;
|
|
! this.blocksDistanceThreshold = par2;
|
|
this.updateFrequency = par3;
|
|
this.sendVelocityUpdates = par4;
|
|
! this.lastScaledXPosition = MathHelper.floor_double(par1Entity.posX * 32.0D);
|
|
! this.lastScaledYPosition = MathHelper.floor_double(par1Entity.posY * 32.0D);
|
|
! this.lastScaledZPosition = MathHelper.floor_double(par1Entity.posZ * 32.0D);
|
|
! this.lastYaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F);
|
|
! this.lastPitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F);
|
|
this.lastHeadMotion = MathHelper.floor_float(par1Entity.getRotationYawHead() * 256.0F / 360.0F);
|
|
}
|
|
|
|
public boolean equals(Object par1Obj)
|
|
{
|
|
! return par1Obj instanceof EntityTrackerEntry ? ((EntityTrackerEntry)par1Obj).myEntity.entityId == this.myEntity.entityId : false;
|
|
}
|
|
|
|
public int hashCode()
|
|
{
|
|
! return this.myEntity.entityId;
|
|
}
|
|
|
|
! /**
|
|
! * also sends velocity, rotation, and riding info.
|
|
! */
|
|
! public void sendLocationToAllClients(List par1List)
|
|
{
|
|
this.playerEntitiesUpdated = false;
|
|
|
|
! if (!this.isDataInitialized || this.myEntity.getDistanceSq(this.posX, this.posY, this.posZ) > 16.0D)
|
|
{
|
|
! this.posX = this.myEntity.posX;
|
|
! this.posY = this.myEntity.posY;
|
|
! this.posZ = this.myEntity.posZ;
|
|
! this.isDataInitialized = true;
|
|
this.playerEntitiesUpdated = true;
|
|
! this.sendEventsToPlayers(par1List);
|
|
}
|
|
|
|
! if (this.field_85178_v != this.myEntity.ridingEntity || this.myEntity.ridingEntity != null && this.ticks % 60 == 0)
|
|
{
|
|
! this.field_85178_v = this.myEntity.ridingEntity;
|
|
! this.sendPacketToAllTrackingPlayers(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity));
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityItemFrame && this.ticks % 10 == 0)
|
|
{
|
|
! EntityItemFrame var23 = (EntityItemFrame)this.myEntity;
|
|
ItemStack var24 = var23.getDisplayedItem();
|
|
|
|
if (var24 != null && var24.getItem() instanceof ItemMap)
|
|
{
|
|
! MapData var26 = Item.map.getMapData(var24, this.myEntity.worldObj);
|
|
Iterator var27 = par1List.iterator();
|
|
|
|
while (var27.hasNext())
|
|
{
|
|
EntityPlayer var28 = (EntityPlayer)var27.next();
|
|
EntityPlayerMP var29 = (EntityPlayerMP)var28;
|
|
var26.updateVisiblePlayers(var29, var24);
|
|
|
|
! if (var29.playerNetServerHandler.packetSize() <= 5)
|
|
{
|
|
! Packet var30 = Item.map.createMapDataPacket(var24, this.myEntity.worldObj, var29);
|
|
|
|
if (var30 != null)
|
|
{
|
|
! var29.playerNetServerHandler.sendPacketToPlayer(var30);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
this.func_111190_b();
|
|
}
|
|
! else if (this.ticks % this.updateFrequency == 0 || this.myEntity.isAirBorne || this.myEntity.getDataWatcher().hasChanges())
|
|
{
|
|
int var2;
|
|
int var3;
|
|
|
|
! if (this.myEntity.ridingEntity == null)
|
|
{
|
|
++this.ticksSinceLastForcedTeleport;
|
|
! var2 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX);
|
|
! var3 = MathHelper.floor_double(this.myEntity.posY * 32.0D);
|
|
! int var4 = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ);
|
|
! int var5 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F);
|
|
! int var6 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F);
|
|
! int var7 = var2 - this.lastScaledXPosition;
|
|
! int var8 = var3 - this.lastScaledYPosition;
|
|
! int var9 = var4 - this.lastScaledZPosition;
|
|
Object var10 = null;
|
|
! boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.ticks % 60 == 0;
|
|
! boolean var12 = Math.abs(var5 - this.lastYaw) >= 4 || Math.abs(var6 - this.lastPitch) >= 4;
|
|
|
|
! if (this.ticks > 0 || this.myEntity instanceof EntityArrow)
|
|
{
|
|
if (var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity)
|
|
{
|
|
if (var11 && var12)
|
|
{
|
|
! var10 = new Packet33RelEntityMoveLook(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6);
|
|
}
|
|
else if (var11)
|
|
{
|
|
! var10 = new Packet31RelEntityMove(this.myEntity.entityId, (byte)var7, (byte)var8, (byte)var9);
|
|
}
|
|
else if (var12)
|
|
{
|
|
! var10 = new Packet32EntityLook(this.myEntity.entityId, (byte)var5, (byte)var6);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.ticksSinceLastForcedTeleport = 0;
|
|
! var10 = new Packet34EntityTeleport(this.myEntity.entityId, var2, var3, var4, (byte)var5, (byte)var6);
|
|
}
|
|
}
|
|
|
|
if (this.sendVelocityUpdates)
|
|
{
|
|
! double var13 = this.myEntity.motionX - this.motionX;
|
|
! double var15 = this.myEntity.motionY - this.motionY;
|
|
! double var17 = this.myEntity.motionZ - this.motionZ;
|
|
double var19 = 0.02D;
|
|
double var21 = var13 * var13 + var15 * var15 + var17 * var17;
|
|
|
|
! if (var21 > var19 * var19 || var21 > 0.0D && this.myEntity.motionX == 0.0D && this.myEntity.motionY == 0.0D && this.myEntity.motionZ == 0.0D)
|
|
{
|
|
! this.motionX = this.myEntity.motionX;
|
|
! this.motionY = this.myEntity.motionY;
|
|
! this.motionZ = this.myEntity.motionZ;
|
|
! this.sendPacketToAllTrackingPlayers(new Packet28EntityVelocity(this.myEntity.entityId, this.motionX, this.motionY, this.motionZ));
|
|
}
|
|
}
|
|
|
|
if (var10 != null)
|
|
{
|
|
! this.sendPacketToAllTrackingPlayers((Packet)var10);
|
|
}
|
|
|
|
this.func_111190_b();
|
|
|
|
if (var11)
|
|
{
|
|
! this.lastScaledXPosition = var2;
|
|
! this.lastScaledYPosition = var3;
|
|
! this.lastScaledZPosition = var4;
|
|
}
|
|
|
|
if (var12)
|
|
{
|
|
! this.lastYaw = var5;
|
|
! this.lastPitch = var6;
|
|
}
|
|
|
|
this.ridingEntity = false;
|
|
}
|
|
else
|
|
{
|
|
! var2 = MathHelper.floor_float(this.myEntity.rotationYaw * 256.0F / 360.0F);
|
|
! var3 = MathHelper.floor_float(this.myEntity.rotationPitch * 256.0F / 360.0F);
|
|
! boolean var25 = Math.abs(var2 - this.lastYaw) >= 4 || Math.abs(var3 - this.lastPitch) >= 4;
|
|
|
|
if (var25)
|
|
{
|
|
! this.sendPacketToAllTrackingPlayers(new Packet32EntityLook(this.myEntity.entityId, (byte)var2, (byte)var3));
|
|
! this.lastYaw = var2;
|
|
! this.lastPitch = var3;
|
|
}
|
|
|
|
! this.lastScaledXPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posX);
|
|
! this.lastScaledYPosition = MathHelper.floor_double(this.myEntity.posY * 32.0D);
|
|
! this.lastScaledZPosition = this.myEntity.myEntitySize.multiplyBy32AndRound(this.myEntity.posZ);
|
|
this.func_111190_b();
|
|
this.ridingEntity = true;
|
|
}
|
|
|
|
! var2 = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F);
|
|
|
|
if (Math.abs(var2 - this.lastHeadMotion) >= 4)
|
|
{
|
|
! this.sendPacketToAllTrackingPlayers(new Packet35EntityHeadRotation(this.myEntity.entityId, (byte)var2));
|
|
this.lastHeadMotion = var2;
|
|
}
|
|
|
|
! this.myEntity.isAirBorne = false;
|
|
}
|
|
|
|
! ++this.ticks;
|
|
|
|
! if (this.myEntity.velocityChanged)
|
|
{
|
|
! this.sendPacketToAllAssociatedPlayers(new Packet28EntityVelocity(this.myEntity));
|
|
! this.myEntity.velocityChanged = false;
|
|
}
|
|
}
|
|
|
|
private void func_111190_b()
|
|
{
|
|
! DataWatcher var1 = this.myEntity.getDataWatcher();
|
|
|
|
! if (var1.hasChanges())
|
|
{
|
|
! this.sendPacketToAllAssociatedPlayers(new Packet40EntityMetadata(this.myEntity.entityId, var1, false));
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityLivingBase)
|
|
{
|
|
! ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap();
|
|
Set var3 = var2.func_111161_b();
|
|
|
|
if (!var3.isEmpty())
|
|
{
|
|
! this.sendPacketToAllAssociatedPlayers(new Packet44UpdateAttributes(this.myEntity.entityId, var3));
|
|
}
|
|
|
|
var3.clear();
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * if this is a player, then it is not informed
|
|
! */
|
|
! public void sendPacketToAllTrackingPlayers(Packet par1Packet)
|
|
{
|
|
Iterator var2 = this.trackingPlayers.iterator();
|
|
|
|
while (var2.hasNext())
|
|
{
|
|
EntityPlayerMP var3 = (EntityPlayerMP)var2.next();
|
|
! var3.playerNetServerHandler.sendPacketToPlayer(par1Packet);
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * if this is a player, then it recieves the message also
|
|
! */
|
|
! public void sendPacketToAllAssociatedPlayers(Packet par1Packet)
|
|
{
|
|
! this.sendPacketToAllTrackingPlayers(par1Packet);
|
|
|
|
! if (this.myEntity instanceof EntityPlayerMP)
|
|
{
|
|
! ((EntityPlayerMP)this.myEntity).playerNetServerHandler.sendPacketToPlayer(par1Packet);
|
|
}
|
|
}
|
|
|
|
! public void informAllAssociatedPlayersOfItemDestruction()
|
|
{
|
|
Iterator var1 = this.trackingPlayers.iterator();
|
|
|
|
while (var1.hasNext())
|
|
{
|
|
EntityPlayerMP var2 = (EntityPlayerMP)var1.next();
|
|
! var2.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId));
|
|
}
|
|
}
|
|
|
|
! public void removeFromWatchingList(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
if (this.trackingPlayers.contains(par1EntityPlayerMP))
|
|
{
|
|
! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId));
|
|
this.trackingPlayers.remove(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * if the player is more than the distance threshold (typically 64) then the player is removed instead
|
|
! */
|
|
! public void tryStartWachingThis(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! if (par1EntityPlayerMP != this.myEntity)
|
|
{
|
|
! double var2 = par1EntityPlayerMP.posX - (double)(this.lastScaledXPosition / 32);
|
|
! double var4 = par1EntityPlayerMP.posZ - (double)(this.lastScaledZPosition / 32);
|
|
|
|
! if (var2 >= (double)(-this.blocksDistanceThreshold) && var2 <= (double)this.blocksDistanceThreshold && var4 >= (double)(-this.blocksDistanceThreshold) && var4 <= (double)this.blocksDistanceThreshold)
|
|
{
|
|
! if (!this.trackingPlayers.contains(par1EntityPlayerMP) && (this.isPlayerWatchingThisChunk(par1EntityPlayerMP) || this.myEntity.forceSpawn))
|
|
{
|
|
this.trackingPlayers.add(par1EntityPlayerMP);
|
|
! Packet var6 = this.getPacketForThisEntity();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(var6);
|
|
|
|
! if (!this.myEntity.getDataWatcher().getIsBlank())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet40EntityMetadata(this.myEntity.entityId, this.myEntity.getDataWatcher(), true));
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityLivingBase)
|
|
{
|
|
! ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.myEntity).getAttributeMap();
|
|
Collection var8 = var7.func_111160_c();
|
|
|
|
if (!var8.isEmpty())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet44UpdateAttributes(this.myEntity.entityId, var8));
|
|
}
|
|
}
|
|
|
|
! this.motionX = this.myEntity.motionX;
|
|
! this.motionY = this.myEntity.motionY;
|
|
! this.motionZ = this.myEntity.motionZ;
|
|
|
|
if (this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn))
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet28EntityVelocity(this.myEntity.entityId, this.myEntity.motionX, this.myEntity.motionY, this.myEntity.motionZ));
|
|
}
|
|
|
|
! if (this.myEntity.ridingEntity != null)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(0, this.myEntity, this.myEntity.ridingEntity));
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityLiving && ((EntityLiving)this.myEntity).getLeashedToEntity() != null)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet39AttachEntity(1, this.myEntity, ((EntityLiving)this.myEntity).getLeashedToEntity()));
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityLivingBase)
|
|
{
|
|
for (int var10 = 0; var10 < 5; ++var10)
|
|
{
|
|
! ItemStack var12 = ((EntityLivingBase)this.myEntity).getCurrentItemOrArmor(var10);
|
|
|
|
if (var12 != null)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet5PlayerInventory(this.myEntity.entityId, var10, var12));
|
|
}
|
|
}
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityPlayer)
|
|
{
|
|
! EntityPlayer var11 = (EntityPlayer)this.myEntity;
|
|
|
|
if (var11.isPlayerSleeping())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet17Sleep(this.myEntity, 0, MathHelper.floor_double(this.myEntity.posX), MathHelper.floor_double(this.myEntity.posY), MathHelper.floor_double(this.myEntity.posZ)));
|
|
}
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityLivingBase)
|
|
{
|
|
! EntityLivingBase var13 = (EntityLivingBase)this.myEntity;
|
|
Iterator var14 = var13.getActivePotionEffects().iterator();
|
|
|
|
while (var14.hasNext())
|
|
{
|
|
PotionEffect var9 = (PotionEffect)var14.next();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(this.myEntity.entityId, var9));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (this.trackingPlayers.contains(par1EntityPlayerMP))
|
|
{
|
|
this.trackingPlayers.remove(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId));
|
|
}
|
|
}
|
|
}
|
|
|
|
private boolean isPlayerWatchingThisChunk(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! return par1EntityPlayerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(par1EntityPlayerMP, this.myEntity.chunkCoordX, this.myEntity.chunkCoordZ);
|
|
}
|
|
|
|
! public void sendEventsToPlayers(List par1List)
|
|
{
|
|
for (int var2 = 0; var2 < par1List.size(); ++var2)
|
|
{
|
|
! this.tryStartWachingThis((EntityPlayerMP)par1List.get(var2));
|
|
}
|
|
}
|
|
|
|
! private Packet getPacketForThisEntity()
|
|
{
|
|
! if (this.myEntity.isDead)
|
|
{
|
|
! this.myEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity");
|
|
}
|
|
|
|
! if (this.myEntity instanceof EntityItem)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 2, 1);
|
|
}
|
|
! else if (this.myEntity instanceof EntityPlayerMP)
|
|
{
|
|
! return new Packet20NamedEntitySpawn((EntityPlayer)this.myEntity);
|
|
}
|
|
! else if (this.myEntity instanceof EntityMinecart)
|
|
{
|
|
! EntityMinecart var9 = (EntityMinecart)this.myEntity;
|
|
! return new Packet23VehicleSpawn(this.myEntity, 10, var9.getMinecartType());
|
|
}
|
|
! else if (this.myEntity instanceof EntityBoat)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 1);
|
|
}
|
|
! else if (!(this.myEntity instanceof IAnimals) && !(this.myEntity instanceof EntityDragon))
|
|
{
|
|
! if (this.myEntity instanceof EntityFishHook)
|
|
{
|
|
! EntityPlayer var8 = ((EntityFishHook)this.myEntity).angler;
|
|
! return new Packet23VehicleSpawn(this.myEntity, 90, var8 != null ? var8.entityId : this.myEntity.entityId);
|
|
}
|
|
! else if (this.myEntity instanceof EntityArrow)
|
|
{
|
|
! Entity var7 = ((EntityArrow)this.myEntity).shootingEntity;
|
|
! return new Packet23VehicleSpawn(this.myEntity, 60, var7 != null ? var7.entityId : this.myEntity.entityId);
|
|
}
|
|
! else if (this.myEntity instanceof EntitySnowball)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 61);
|
|
}
|
|
! else if (this.myEntity instanceof EntityPotion)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 73, ((EntityPotion)this.myEntity).getPotionDamage());
|
|
}
|
|
! else if (this.myEntity instanceof EntityExpBottle)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 75);
|
|
}
|
|
! else if (this.myEntity instanceof EntityEnderPearl)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 65);
|
|
}
|
|
! else if (this.myEntity instanceof EntityEnderEye)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 72);
|
|
}
|
|
! else if (this.myEntity instanceof EntityFireworkRocket)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 76);
|
|
}
|
|
else
|
|
{
|
|
Packet23VehicleSpawn var2;
|
|
|
|
! if (this.myEntity instanceof EntityFireball)
|
|
{
|
|
! EntityFireball var6 = (EntityFireball)this.myEntity;
|
|
var2 = null;
|
|
byte var3 = 63;
|
|
|
|
! if (this.myEntity instanceof EntitySmallFireball)
|
|
{
|
|
var3 = 64;
|
|
}
|
|
! else if (this.myEntity instanceof EntityWitherSkull)
|
|
{
|
|
var3 = 66;
|
|
}
|
|
|
|
if (var6.shootingEntity != null)
|
|
{
|
|
! var2 = new Packet23VehicleSpawn(this.myEntity, var3, ((EntityFireball)this.myEntity).shootingEntity.entityId);
|
|
}
|
|
else
|
|
{
|
|
! var2 = new Packet23VehicleSpawn(this.myEntity, var3, 0);
|
|
}
|
|
|
|
var2.speedX = (int)(var6.accelerationX * 8000.0D);
|
|
var2.speedY = (int)(var6.accelerationY * 8000.0D);
|
|
var2.speedZ = (int)(var6.accelerationZ * 8000.0D);
|
|
return var2;
|
|
}
|
|
! else if (this.myEntity instanceof EntityEgg)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 62);
|
|
}
|
|
! else if (this.myEntity instanceof EntityTNTPrimed)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 50);
|
|
}
|
|
! else if (this.myEntity instanceof EntityEnderCrystal)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.myEntity, 51);
|
|
}
|
|
! else if (this.myEntity instanceof EntityFallingSand)
|
|
{
|
|
! EntityFallingSand var5 = (EntityFallingSand)this.myEntity;
|
|
! return new Packet23VehicleSpawn(this.myEntity, 70, var5.blockID | var5.metadata << 16);
|
|
}
|
|
! else if (this.myEntity instanceof EntityPainting)
|
|
{
|
|
! return new Packet25EntityPainting((EntityPainting)this.myEntity);
|
|
}
|
|
! else if (this.myEntity instanceof EntityItemFrame)
|
|
{
|
|
! EntityItemFrame var4 = (EntityItemFrame)this.myEntity;
|
|
! var2 = new Packet23VehicleSpawn(this.myEntity, 71, var4.hangingDirection);
|
|
var2.xPosition = MathHelper.floor_float((float)(var4.xPosition * 32));
|
|
var2.yPosition = MathHelper.floor_float((float)(var4.yPosition * 32));
|
|
var2.zPosition = MathHelper.floor_float((float)(var4.zPosition * 32));
|
|
return var2;
|
|
}
|
|
! else if (this.myEntity instanceof EntityLeashKnot)
|
|
{
|
|
! EntityLeashKnot var1 = (EntityLeashKnot)this.myEntity;
|
|
! var2 = new Packet23VehicleSpawn(this.myEntity, 77);
|
|
var2.xPosition = MathHelper.floor_float((float)(var1.xPosition * 32));
|
|
var2.yPosition = MathHelper.floor_float((float)(var1.yPosition * 32));
|
|
var2.zPosition = MathHelper.floor_float((float)(var1.zPosition * 32));
|
|
return var2;
|
|
}
|
|
! else if (this.myEntity instanceof EntityXPOrb)
|
|
{
|
|
! return new Packet26EntityExpOrb((EntityXPOrb)this.myEntity);
|
|
}
|
|
else
|
|
{
|
|
! throw new IllegalArgumentException("Don\'t know how to add " + this.myEntity.getClass() + "!");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.lastHeadMotion = MathHelper.floor_float(this.myEntity.getRotationYawHead() * 256.0F / 360.0F);
|
|
! return new Packet24MobSpawn((EntityLivingBase)this.myEntity);
|
|
}
|
|
}
|
|
|
|
! public void removePlayerFromTracker(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
if (this.trackingPlayers.contains(par1EntityPlayerMP))
|
|
{
|
|
this.trackingPlayers.remove(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.myEntity.entityId));
|
|
}
|
|
}
|
|
}
|
|
--- 54,585 ----
|
|
*/
|
|
public Set trackingPlayers = new HashSet();
|
|
|
|
public EntityTrackerEntry(Entity par1Entity, int par2, int par3, boolean par4)
|
|
{
|
|
! this.trackedEntity = par1Entity;
|
|
! this.trackingDistanceThreshold = par2;
|
|
this.updateFrequency = par3;
|
|
this.sendVelocityUpdates = par4;
|
|
! this.encodedPosX = MathHelper.floor_double(par1Entity.posX * 32.0D);
|
|
! this.encodedPosY = MathHelper.floor_double(par1Entity.posY * 32.0D);
|
|
! this.encodedPosZ = MathHelper.floor_double(par1Entity.posZ * 32.0D);
|
|
! this.encodedRotationYaw = MathHelper.floor_float(par1Entity.rotationYaw * 256.0F / 360.0F);
|
|
! this.encodedRotationPitch = MathHelper.floor_float(par1Entity.rotationPitch * 256.0F / 360.0F);
|
|
this.lastHeadMotion = MathHelper.floor_float(par1Entity.getRotationYawHead() * 256.0F / 360.0F);
|
|
}
|
|
|
|
public boolean equals(Object par1Obj)
|
|
{
|
|
! return par1Obj instanceof EntityTrackerEntry ? ((EntityTrackerEntry)par1Obj).trackedEntity.entityId == this.trackedEntity.entityId : false;
|
|
}
|
|
|
|
public int hashCode()
|
|
{
|
|
! return this.trackedEntity.entityId;
|
|
}
|
|
|
|
! public void updatePlayerList(List par1List)
|
|
{
|
|
this.playerEntitiesUpdated = false;
|
|
|
|
! if (!this.firstUpdateDone || this.trackedEntity.getDistanceSq(this.lastTrackedEntityPosX, this.lastTrackedEntityPosY, this.lastTrackedEntityPosZ) > 16.0D)
|
|
{
|
|
! this.lastTrackedEntityPosX = this.trackedEntity.posX;
|
|
! this.lastTrackedEntityPosY = this.trackedEntity.posY;
|
|
! this.lastTrackedEntityPosZ = this.trackedEntity.posZ;
|
|
! this.firstUpdateDone = true;
|
|
this.playerEntitiesUpdated = true;
|
|
! this.updatePlayerEntities(par1List);
|
|
}
|
|
|
|
! if (this.field_85178_v != this.trackedEntity.ridingEntity || this.trackedEntity.ridingEntity != null && this.updateCounter % 60 == 0)
|
|
{
|
|
! this.field_85178_v = this.trackedEntity.ridingEntity;
|
|
! this.sendPacketToTrackedPlayers(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity));
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityItemFrame && this.updateCounter % 10 == 0)
|
|
{
|
|
! EntityItemFrame var23 = (EntityItemFrame)this.trackedEntity;
|
|
ItemStack var24 = var23.getDisplayedItem();
|
|
|
|
if (var24 != null && var24.getItem() instanceof ItemMap)
|
|
{
|
|
! MapData var26 = Item.map.getMapData(var24, this.trackedEntity.worldObj);
|
|
Iterator var27 = par1List.iterator();
|
|
|
|
while (var27.hasNext())
|
|
{
|
|
EntityPlayer var28 = (EntityPlayer)var27.next();
|
|
EntityPlayerMP var29 = (EntityPlayerMP)var28;
|
|
var26.updateVisiblePlayers(var29, var24);
|
|
|
|
! if (var29.playerNetServerHandler.getNumChunkDataPackets() <= 5)
|
|
{
|
|
! Packet var30 = Item.map.getUpdatePacket(var24, this.trackedEntity.worldObj, var29);
|
|
|
|
if (var30 != null)
|
|
{
|
|
! var29.playerNetServerHandler.sendPacket(var30);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
this.func_111190_b();
|
|
}
|
|
! else if (this.updateCounter % this.updateFrequency == 0 || this.trackedEntity.isAirBorne || this.trackedEntity.getDataWatcher().hasObjectChanged())
|
|
{
|
|
int var2;
|
|
int var3;
|
|
|
|
! if (this.trackedEntity.ridingEntity == null)
|
|
{
|
|
++this.ticksSinceLastForcedTeleport;
|
|
! var2 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX);
|
|
! var3 = MathHelper.floor_double(this.trackedEntity.posY * 32.0D);
|
|
! int var4 = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ);
|
|
! int var5 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F);
|
|
! int var6 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F);
|
|
! int var7 = var2 - this.encodedPosX;
|
|
! int var8 = var3 - this.encodedPosY;
|
|
! int var9 = var4 - this.encodedPosZ;
|
|
Object var10 = null;
|
|
! boolean var11 = Math.abs(var7) >= 4 || Math.abs(var8) >= 4 || Math.abs(var9) >= 4 || this.updateCounter % 60 == 0;
|
|
! boolean var12 = Math.abs(var5 - this.encodedRotationYaw) >= 4 || Math.abs(var6 - this.encodedRotationPitch) >= 4;
|
|
|
|
! if (this.updateCounter > 0 || this.trackedEntity instanceof EntityArrow)
|
|
{
|
|
if (var7 >= -128 && var7 < 128 && var8 >= -128 && var8 < 128 && var9 >= -128 && var9 < 128 && this.ticksSinceLastForcedTeleport <= 400 && !this.ridingEntity)
|
|
{
|
|
if (var11 && var12)
|
|
{
|
|
! var10 = new Packet33RelEntityMoveLook(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9, (byte)var5, (byte)var6);
|
|
}
|
|
else if (var11)
|
|
{
|
|
! var10 = new Packet31RelEntityMove(this.trackedEntity.entityId, (byte)var7, (byte)var8, (byte)var9);
|
|
}
|
|
else if (var12)
|
|
{
|
|
! var10 = new Packet32EntityLook(this.trackedEntity.entityId, (byte)var5, (byte)var6);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.ticksSinceLastForcedTeleport = 0;
|
|
! var10 = new Packet34EntityTeleport(this.trackedEntity.entityId, var2, var3, var4, (byte)var5, (byte)var6);
|
|
}
|
|
}
|
|
|
|
if (this.sendVelocityUpdates)
|
|
{
|
|
! double var13 = this.trackedEntity.motionX - this.lastTrackedEntityMotionX;
|
|
! double var15 = this.trackedEntity.motionY - this.lastTrackedEntityMotionY;
|
|
! double var17 = this.trackedEntity.motionZ - this.motionZ;
|
|
double var19 = 0.02D;
|
|
double var21 = var13 * var13 + var15 * var15 + var17 * var17;
|
|
|
|
! if (var21 > var19 * var19 || var21 > 0.0D && this.trackedEntity.motionX == 0.0D && this.trackedEntity.motionY == 0.0D && this.trackedEntity.motionZ == 0.0D)
|
|
{
|
|
! this.lastTrackedEntityMotionX = this.trackedEntity.motionX;
|
|
! this.lastTrackedEntityMotionY = this.trackedEntity.motionY;
|
|
! this.motionZ = this.trackedEntity.motionZ;
|
|
! this.sendPacketToTrackedPlayers(new Packet28EntityVelocity(this.trackedEntity.entityId, this.lastTrackedEntityMotionX, this.lastTrackedEntityMotionY, this.motionZ));
|
|
}
|
|
}
|
|
|
|
if (var10 != null)
|
|
{
|
|
! this.sendPacketToTrackedPlayers((Packet)var10);
|
|
}
|
|
|
|
this.func_111190_b();
|
|
|
|
if (var11)
|
|
{
|
|
! this.encodedPosX = var2;
|
|
! this.encodedPosY = var3;
|
|
! this.encodedPosZ = var4;
|
|
}
|
|
|
|
if (var12)
|
|
{
|
|
! this.encodedRotationYaw = var5;
|
|
! this.encodedRotationPitch = var6;
|
|
}
|
|
|
|
this.ridingEntity = false;
|
|
}
|
|
else
|
|
{
|
|
! var2 = MathHelper.floor_float(this.trackedEntity.rotationYaw * 256.0F / 360.0F);
|
|
! var3 = MathHelper.floor_float(this.trackedEntity.rotationPitch * 256.0F / 360.0F);
|
|
! boolean var25 = Math.abs(var2 - this.encodedRotationYaw) >= 4 || Math.abs(var3 - this.encodedRotationPitch) >= 4;
|
|
|
|
if (var25)
|
|
{
|
|
! this.sendPacketToTrackedPlayers(new Packet32EntityLook(this.trackedEntity.entityId, (byte)var2, (byte)var3));
|
|
! this.encodedRotationYaw = var2;
|
|
! this.encodedRotationPitch = var3;
|
|
}
|
|
|
|
! this.encodedPosX = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posX);
|
|
! this.encodedPosY = MathHelper.floor_double(this.trackedEntity.posY * 32.0D);
|
|
! this.encodedPosZ = this.trackedEntity.myEntitySize.multiplyBy32AndRound(this.trackedEntity.posZ);
|
|
this.func_111190_b();
|
|
this.ridingEntity = true;
|
|
}
|
|
|
|
! var2 = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F);
|
|
|
|
if (Math.abs(var2 - this.lastHeadMotion) >= 4)
|
|
{
|
|
! this.sendPacketToTrackedPlayers(new Packet35EntityHeadRotation(this.trackedEntity.entityId, (byte)var2));
|
|
this.lastHeadMotion = var2;
|
|
}
|
|
|
|
! this.trackedEntity.isAirBorne = false;
|
|
}
|
|
|
|
! ++this.updateCounter;
|
|
|
|
! if (this.trackedEntity.velocityChanged)
|
|
{
|
|
! this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet28EntityVelocity(this.trackedEntity));
|
|
! this.trackedEntity.velocityChanged = false;
|
|
}
|
|
}
|
|
|
|
private void func_111190_b()
|
|
{
|
|
! DataWatcher var1 = this.trackedEntity.getDataWatcher();
|
|
|
|
! if (var1.hasObjectChanged())
|
|
{
|
|
! this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet40EntityMetadata(this.trackedEntity.entityId, var1, false));
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityLivingBase)
|
|
{
|
|
! ServersideAttributeMap var2 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap();
|
|
Set var3 = var2.func_111161_b();
|
|
|
|
if (!var3.isEmpty())
|
|
{
|
|
! this.sendPacketToTrackedPlayersAndTrackedEntity(new Packet44UpdateAttributes(this.trackedEntity.entityId, var3));
|
|
}
|
|
|
|
var3.clear();
|
|
}
|
|
}
|
|
|
|
! public void sendPacketToTrackedPlayers(Packet par1Packet)
|
|
{
|
|
Iterator var2 = this.trackingPlayers.iterator();
|
|
|
|
while (var2.hasNext())
|
|
{
|
|
EntityPlayerMP var3 = (EntityPlayerMP)var2.next();
|
|
! var3.playerNetServerHandler.sendPacket(par1Packet);
|
|
}
|
|
}
|
|
|
|
! public void sendPacketToTrackedPlayersAndTrackedEntity(Packet par1Packet)
|
|
{
|
|
! this.sendPacketToTrackedPlayers(par1Packet);
|
|
|
|
! if (this.trackedEntity instanceof EntityPlayerMP)
|
|
{
|
|
! ((EntityPlayerMP)this.trackedEntity).playerNetServerHandler.sendPacket(par1Packet);
|
|
}
|
|
}
|
|
|
|
! public void sendDestroyEntityPacketToTrackedPlayers()
|
|
{
|
|
Iterator var1 = this.trackingPlayers.iterator();
|
|
|
|
while (var1.hasNext())
|
|
{
|
|
EntityPlayerMP var2 = (EntityPlayerMP)var1.next();
|
|
! var2.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId));
|
|
}
|
|
}
|
|
|
|
! public void removeFromTrackedPlayers(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
if (this.trackingPlayers.contains(par1EntityPlayerMP))
|
|
{
|
|
! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId));
|
|
this.trackingPlayers.remove(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
|
|
! public void updatePlayerEntity(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! if (par1EntityPlayerMP != this.trackedEntity)
|
|
{
|
|
! double var2 = par1EntityPlayerMP.posX - (double)(this.encodedPosX / 32);
|
|
! double var4 = par1EntityPlayerMP.posZ - (double)(this.encodedPosZ / 32);
|
|
|
|
! if (var2 >= (double)(-this.trackingDistanceThreshold) && var2 <= (double)this.trackingDistanceThreshold && var4 >= (double)(-this.trackingDistanceThreshold) && var4 <= (double)this.trackingDistanceThreshold)
|
|
{
|
|
! if (!this.trackingPlayers.contains(par1EntityPlayerMP) && (this.isPlayerWatchingThisChunk(par1EntityPlayerMP) || this.trackedEntity.forceSpawn))
|
|
{
|
|
this.trackingPlayers.add(par1EntityPlayerMP);
|
|
! Packet var6 = this.getSpawnPacket();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(var6);
|
|
|
|
! if (!this.trackedEntity.getDataWatcher().getIsBlank())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet40EntityMetadata(this.trackedEntity.entityId, this.trackedEntity.getDataWatcher(), true));
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityLivingBase)
|
|
{
|
|
! ServersideAttributeMap var7 = (ServersideAttributeMap)((EntityLivingBase)this.trackedEntity).getAttributeMap();
|
|
Collection var8 = var7.func_111160_c();
|
|
|
|
if (!var8.isEmpty())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet44UpdateAttributes(this.trackedEntity.entityId, var8));
|
|
}
|
|
}
|
|
|
|
! this.lastTrackedEntityMotionX = this.trackedEntity.motionX;
|
|
! this.lastTrackedEntityMotionY = this.trackedEntity.motionY;
|
|
! this.motionZ = this.trackedEntity.motionZ;
|
|
|
|
if (this.sendVelocityUpdates && !(var6 instanceof Packet24MobSpawn))
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet28EntityVelocity(this.trackedEntity.entityId, this.trackedEntity.motionX, this.trackedEntity.motionY, this.trackedEntity.motionZ));
|
|
}
|
|
|
|
! if (this.trackedEntity.ridingEntity != null)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet39AttachEntity(0, this.trackedEntity, this.trackedEntity.ridingEntity));
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityLiving && ((EntityLiving)this.trackedEntity).getLeashedToEntity() != null)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet39AttachEntity(1, this.trackedEntity, ((EntityLiving)this.trackedEntity).getLeashedToEntity()));
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityLivingBase)
|
|
{
|
|
for (int var10 = 0; var10 < 5; ++var10)
|
|
{
|
|
! ItemStack var12 = ((EntityLivingBase)this.trackedEntity).getEquipmentInSlot(var10);
|
|
|
|
if (var12 != null)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet5PlayerInventory(this.trackedEntity.entityId, var10, var12));
|
|
}
|
|
}
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityPlayer)
|
|
{
|
|
! EntityPlayer var11 = (EntityPlayer)this.trackedEntity;
|
|
|
|
if (var11.isPlayerSleeping())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet17Sleep(this.trackedEntity, 0, MathHelper.floor_double(this.trackedEntity.posX), MathHelper.floor_double(this.trackedEntity.posY), MathHelper.floor_double(this.trackedEntity.posZ)));
|
|
}
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityLivingBase)
|
|
{
|
|
! EntityLivingBase var13 = (EntityLivingBase)this.trackedEntity;
|
|
Iterator var14 = var13.getActivePotionEffects().iterator();
|
|
|
|
while (var14.hasNext())
|
|
{
|
|
PotionEffect var9 = (PotionEffect)var14.next();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet41EntityEffect(this.trackedEntity.entityId, var9));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (this.trackingPlayers.contains(par1EntityPlayerMP))
|
|
{
|
|
this.trackingPlayers.remove(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId));
|
|
}
|
|
}
|
|
}
|
|
|
|
private boolean isPlayerWatchingThisChunk(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! return par1EntityPlayerMP.getServerForPlayer().getPlayerManager().isPlayerWatchingChunk(par1EntityPlayerMP, this.trackedEntity.chunkCoordX, this.trackedEntity.chunkCoordZ);
|
|
}
|
|
|
|
! public void updatePlayerEntities(List par1List)
|
|
{
|
|
for (int var2 = 0; var2 < par1List.size(); ++var2)
|
|
{
|
|
! this.updatePlayerEntity((EntityPlayerMP)par1List.get(var2));
|
|
}
|
|
}
|
|
|
|
! private Packet getSpawnPacket()
|
|
{
|
|
! if (this.trackedEntity.isDead)
|
|
{
|
|
! this.trackedEntity.worldObj.getWorldLogAgent().logWarning("Fetching addPacket for removed entity");
|
|
}
|
|
|
|
! if (this.trackedEntity instanceof EntityItem)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 2, 1);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityPlayerMP)
|
|
{
|
|
! return new Packet20NamedEntitySpawn((EntityPlayer)this.trackedEntity);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityMinecart)
|
|
{
|
|
! EntityMinecart var9 = (EntityMinecart)this.trackedEntity;
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 10, var9.getMinecartType());
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityBoat)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 1);
|
|
}
|
|
! else if (!(this.trackedEntity instanceof IAnimals) && !(this.trackedEntity instanceof EntityDragon))
|
|
{
|
|
! if (this.trackedEntity instanceof EntityFishHook)
|
|
{
|
|
! EntityPlayer var8 = ((EntityFishHook)this.trackedEntity).angler;
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 90, var8 != null ? var8.entityId : this.trackedEntity.entityId);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityArrow)
|
|
{
|
|
! Entity var7 = ((EntityArrow)this.trackedEntity).shootingEntity;
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 60, var7 != null ? var7.entityId : this.trackedEntity.entityId);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntitySnowball)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 61);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityPotion)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 73, ((EntityPotion)this.trackedEntity).getPotionDamage());
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityExpBottle)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 75);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityEnderPearl)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 65);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityEnderEye)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 72);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityFireworkRocket)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 76);
|
|
}
|
|
else
|
|
{
|
|
Packet23VehicleSpawn var2;
|
|
|
|
! if (this.trackedEntity instanceof EntityFireball)
|
|
{
|
|
! EntityFireball var6 = (EntityFireball)this.trackedEntity;
|
|
var2 = null;
|
|
byte var3 = 63;
|
|
|
|
! if (this.trackedEntity instanceof EntitySmallFireball)
|
|
{
|
|
var3 = 64;
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityWitherSkull)
|
|
{
|
|
var3 = 66;
|
|
}
|
|
|
|
if (var6.shootingEntity != null)
|
|
{
|
|
! var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, ((EntityFireball)this.trackedEntity).shootingEntity.entityId);
|
|
}
|
|
else
|
|
{
|
|
! var2 = new Packet23VehicleSpawn(this.trackedEntity, var3, 0);
|
|
}
|
|
|
|
var2.speedX = (int)(var6.accelerationX * 8000.0D);
|
|
var2.speedY = (int)(var6.accelerationY * 8000.0D);
|
|
var2.speedZ = (int)(var6.accelerationZ * 8000.0D);
|
|
return var2;
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityEgg)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 62);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityTNTPrimed)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 50);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityEnderCrystal)
|
|
{
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 51);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityFallingSand)
|
|
{
|
|
! EntityFallingSand var5 = (EntityFallingSand)this.trackedEntity;
|
|
! return new Packet23VehicleSpawn(this.trackedEntity, 70, var5.blockID | var5.metadata << 16);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityPainting)
|
|
{
|
|
! return new Packet25EntityPainting((EntityPainting)this.trackedEntity);
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityItemFrame)
|
|
{
|
|
! EntityItemFrame var4 = (EntityItemFrame)this.trackedEntity;
|
|
! var2 = new Packet23VehicleSpawn(this.trackedEntity, 71, var4.hangingDirection);
|
|
var2.xPosition = MathHelper.floor_float((float)(var4.xPosition * 32));
|
|
var2.yPosition = MathHelper.floor_float((float)(var4.yPosition * 32));
|
|
var2.zPosition = MathHelper.floor_float((float)(var4.zPosition * 32));
|
|
return var2;
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityLeashKnot)
|
|
{
|
|
! EntityLeashKnot var1 = (EntityLeashKnot)this.trackedEntity;
|
|
! var2 = new Packet23VehicleSpawn(this.trackedEntity, 77);
|
|
var2.xPosition = MathHelper.floor_float((float)(var1.xPosition * 32));
|
|
var2.yPosition = MathHelper.floor_float((float)(var1.yPosition * 32));
|
|
var2.zPosition = MathHelper.floor_float((float)(var1.zPosition * 32));
|
|
return var2;
|
|
}
|
|
! else if (this.trackedEntity instanceof EntityXPOrb)
|
|
{
|
|
! return new Packet26EntityExpOrb((EntityXPOrb)this.trackedEntity);
|
|
}
|
|
else
|
|
{
|
|
! throw new IllegalArgumentException("Don\'t know how to add " + this.trackedEntity.getClass() + "!");
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.lastHeadMotion = MathHelper.floor_float(this.trackedEntity.getRotationYawHead() * 256.0F / 360.0F);
|
|
! return new Packet24MobSpawn((EntityLivingBase)this.trackedEntity);
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * Remove a tracked player from our list and tell the tracked player to destroy us from their world.
|
|
! */
|
|
! public void removeTrackedPlayerSymmetric(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
if (this.trackingPlayers.contains(par1EntityPlayerMP))
|
|
{
|
|
this.trackingPlayers.remove(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.destroyedItemsNetCache.add(Integer.valueOf(this.trackedEntity.entityId));
|
|
}
|
|
}
|
|
}
|
|
*** EntityVillager.java Sat Feb 5 04:19:41 2022
|
|
--- EntityVillager.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 27,46 ****
|
|
/** Last player to trade with this villager, used for aggressivity. */
|
|
private String lastBuyingPlayer;
|
|
private boolean field_82190_bM;
|
|
private float field_82191_bN;
|
|
|
|
! /**
|
|
! * a villagers recipe list is intialized off this list ; the 2 params are min/max amount they will trade for 1
|
|
! * emerald
|
|
! */
|
|
! private static final Map villagerStockList = new HashMap();
|
|
|
|
! /**
|
|
! * Selling list of Blacksmith items. negative numbers mean 1 emerald for n items, positive numbers are n emeralds
|
|
! * for 1 item
|
|
! */
|
|
private static final Map blacksmithSellingList = new HashMap();
|
|
|
|
public EntityVillager(World par1World)
|
|
{
|
|
this(par1World, 0);
|
|
--- 27,40 ----
|
|
/** Last player to trade with this villager, used for aggressivity. */
|
|
private String lastBuyingPlayer;
|
|
private boolean field_82190_bM;
|
|
private float field_82191_bN;
|
|
|
|
! /** Selling list of Villagers items. */
|
|
! private static final Map villagersSellingList = new HashMap();
|
|
|
|
! /** Selling list of Blacksmith items. */
|
|
private static final Map blacksmithSellingList = new HashMap();
|
|
|
|
public EntityVillager(World par1World)
|
|
{
|
|
this(par1World, 0);
|
|
***************
|
|
*** 562,573 ****
|
|
{
|
|
this.buyingList.addToListWithCheck((MerchantRecipe)var2.get(var9));
|
|
}
|
|
}
|
|
|
|
- public void setRecipes(MerchantRecipeList par1MerchantRecipeList) {}
|
|
-
|
|
/**
|
|
* each recipie takes a random stack from villagerStockList and offers it for 1 emerald
|
|
*/
|
|
private static void addMerchantItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3)
|
|
{
|
|
--- 556,565 ----
|
|
***************
|
|
*** 585,595 ****
|
|
/**
|
|
* default to 1, and villagerStockList contains a min/max amount for each index
|
|
*/
|
|
private static int getRandomCountForItem(int par0, Random par1Random)
|
|
{
|
|
! Tuple var2 = (Tuple)villagerStockList.get(Integer.valueOf(par0));
|
|
return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue()));
|
|
}
|
|
|
|
private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3)
|
|
{
|
|
--- 577,587 ----
|
|
/**
|
|
* default to 1, and villagerStockList contains a min/max amount for each index
|
|
*/
|
|
private static int getRandomCountForItem(int par0, Random par1Random)
|
|
{
|
|
! Tuple var2 = (Tuple)villagersSellingList.get(Integer.valueOf(par0));
|
|
return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue()));
|
|
}
|
|
|
|
private static void addBlacksmithItem(MerchantRecipeList par0MerchantRecipeList, int par1, Random par2Random, float par3)
|
|
{
|
|
***************
|
|
*** 618,661 ****
|
|
{
|
|
Tuple var2 = (Tuple)blacksmithSellingList.get(Integer.valueOf(par0));
|
|
return var2 == null ? 1 : (((Integer)var2.getFirst()).intValue() >= ((Integer)var2.getSecond()).intValue() ? ((Integer)var2.getFirst()).intValue() : ((Integer)var2.getFirst()).intValue() + par1Random.nextInt(((Integer)var2.getSecond()).intValue() - ((Integer)var2.getFirst()).intValue()));
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 12)
|
|
- {
|
|
- this.generateRandomParticles("heart");
|
|
- }
|
|
- else if (par1 == 13)
|
|
- {
|
|
- this.generateRandomParticles("angryVillager");
|
|
- }
|
|
- else if (par1 == 14)
|
|
- {
|
|
- this.generateRandomParticles("happyVillager");
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * par1 is the particleName
|
|
- */
|
|
- private void generateRandomParticles(String par1Str)
|
|
- {
|
|
- for (int var2 = 0; var2 < 5; ++var2)
|
|
- {
|
|
- double var3 = this.rand.nextGaussian() * 0.02D;
|
|
- double var5 = this.rand.nextGaussian() * 0.02D;
|
|
- double var7 = this.rand.nextGaussian() * 0.02D;
|
|
- this.worldObj.spawnParticle(par1Str, this.posX + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.nextFloat() * this.height), this.posZ + (double)(this.rand.nextFloat() * this.width * 2.0F) - (double)this.width, var3, var5, var7);
|
|
- }
|
|
- }
|
|
-
|
|
public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
|
|
{
|
|
par1EntityLivingData = super.onSpawnWithEgg(par1EntityLivingData);
|
|
this.setProfession(this.worldObj.rand.nextInt(5));
|
|
return par1EntityLivingData;
|
|
--- 610,619 ----
|
|
***************
|
|
*** 683,711 ****
|
|
return this.func_90012_b(par1EntityAgeable);
|
|
}
|
|
|
|
static
|
|
{
|
|
! villagerStockList.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24)));
|
|
! villagerStockList.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10)));
|
|
! villagerStockList.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10)));
|
|
! villagerStockList.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6)));
|
|
! villagerStockList.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36)));
|
|
! villagerStockList.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13)));
|
|
! villagerStockList.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1)));
|
|
! villagerStockList.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4)));
|
|
! villagerStockList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3)));
|
|
! villagerStockList.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18)));
|
|
! villagerStockList.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18)));
|
|
! villagerStockList.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18)));
|
|
! villagerStockList.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13)));
|
|
! villagerStockList.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48)));
|
|
! villagerStockList.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38)));
|
|
! villagerStockList.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38)));
|
|
! villagerStockList.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22)));
|
|
! villagerStockList.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22)));
|
|
! villagerStockList.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8)));
|
|
--- 641,669 ----
|
|
return this.func_90012_b(par1EntityAgeable);
|
|
}
|
|
|
|
static
|
|
{
|
|
! villagersSellingList.put(Integer.valueOf(Item.coal.itemID), new Tuple(Integer.valueOf(16), Integer.valueOf(24)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.ingotIron.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.ingotGold.itemID), new Tuple(Integer.valueOf(8), Integer.valueOf(10)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.diamond.itemID), new Tuple(Integer.valueOf(4), Integer.valueOf(6)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.paper.itemID), new Tuple(Integer.valueOf(24), Integer.valueOf(36)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.book.itemID), new Tuple(Integer.valueOf(11), Integer.valueOf(13)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.writtenBook.itemID), new Tuple(Integer.valueOf(1), Integer.valueOf(1)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.enderPearl.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.eyeOfEnder.itemID), new Tuple(Integer.valueOf(2), Integer.valueOf(3)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.porkRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.beefRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.chickenRaw.itemID), new Tuple(Integer.valueOf(14), Integer.valueOf(18)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.fishCooked.itemID), new Tuple(Integer.valueOf(9), Integer.valueOf(13)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.seeds.itemID), new Tuple(Integer.valueOf(34), Integer.valueOf(48)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.melonSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.pumpkinSeeds.itemID), new Tuple(Integer.valueOf(30), Integer.valueOf(38)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.wheat.itemID), new Tuple(Integer.valueOf(18), Integer.valueOf(22)));
|
|
! villagersSellingList.put(Integer.valueOf(Block.cloth.blockID), new Tuple(Integer.valueOf(14), Integer.valueOf(22)));
|
|
! villagersSellingList.put(Integer.valueOf(Item.rottenFlesh.itemID), new Tuple(Integer.valueOf(36), Integer.valueOf(64)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.flintAndSteel.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.shears.itemID), new Tuple(Integer.valueOf(3), Integer.valueOf(4)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.swordIron.itemID), new Tuple(Integer.valueOf(7), Integer.valueOf(11)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.swordDiamond.itemID), new Tuple(Integer.valueOf(12), Integer.valueOf(14)));
|
|
blacksmithSellingList.put(Integer.valueOf(Item.axeIron.itemID), new Tuple(Integer.valueOf(6), Integer.valueOf(8)));
|
|
*** EntityWitch.java Sat Feb 5 04:19:41 2022
|
|
--- EntityWitch.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 165,189 ****
|
|
}
|
|
|
|
super.onLivingUpdate();
|
|
}
|
|
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 15)
|
|
- {
|
|
- for (int var2 = 0; var2 < this.rand.nextInt(35) + 10; ++var2)
|
|
- {
|
|
- this.worldObj.spawnParticle("witchMagic", this.posX + this.rand.nextGaussian() * 0.12999999523162842D, this.boundingBox.maxY + 0.5D + this.rand.nextGaussian() * 0.12999999523162842D, this.posZ + this.rand.nextGaussian() * 0.12999999523162842D, 0.0D, 0.0D, 0.0D);
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Reduces damage, depending on potions
|
|
*/
|
|
protected float applyPotionDamageCalculations(DamageSource par1DamageSource, float par2)
|
|
{
|
|
--- 165,174 ----
|
|
***************
|
|
*** 201,212 ****
|
|
|
|
return par2;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + 1;
|
|
|
|
--- 186,196 ----
|
|
|
|
return par2;
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
int var3 = this.rand.nextInt(3) + 1;
|
|
|
|
*** EntityWither.java Sat Feb 5 04:19:41 2022
|
|
--- EntityWither.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 1,10 ****
|
|
package net.minecraft.src;
|
|
|
|
import java.util.List;
|
|
|
|
! public class EntityWither extends EntityMob implements IBossDisplayData, IRangedAttackMob
|
|
{
|
|
private float[] field_82220_d = new float[2];
|
|
private float[] field_82221_e = new float[2];
|
|
private float[] field_82217_f = new float[2];
|
|
private float[] field_82218_g = new float[2];
|
|
--- 1,10 ----
|
|
package net.minecraft.src;
|
|
|
|
import java.util.List;
|
|
|
|
! public class EntityWither extends EntityMob implements IRangedAttackMob
|
|
{
|
|
private float[] field_82220_d = new float[2];
|
|
private float[] field_82221_e = new float[2];
|
|
private float[] field_82217_f = new float[2];
|
|
private float[] field_82218_g = new float[2];
|
|
***************
|
|
*** 57,71 ****
|
|
{
|
|
super.readEntityFromNBT(par1NBTTagCompound);
|
|
this.func_82215_s(par1NBTTagCompound.getInteger("Invul"));
|
|
}
|
|
|
|
- public float getShadowSize()
|
|
- {
|
|
- return this.height / 8.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the sound this mob makes while it's alive.
|
|
*/
|
|
protected String getLivingSound()
|
|
{
|
|
--- 57,66 ----
|
|
***************
|
|
*** 506,517 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
|
|
! * par2 - Level of Looting used to kill this mob.
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
this.dropItem(Item.netherStar.itemID, 1);
|
|
}
|
|
--- 501,511 ----
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Drop 0-2 items of this living's type
|
|
*/
|
|
protected void dropFewItems(boolean par1, int par2)
|
|
{
|
|
this.dropItem(Item.netherStar.itemID, 1);
|
|
}
|
|
***************
|
|
*** 522,536 ****
|
|
protected void despawnEntity()
|
|
{
|
|
this.entityAge = 0;
|
|
}
|
|
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- return 15728880;
|
|
- }
|
|
-
|
|
/**
|
|
* Returns true if other Entities should be prevented from moving through this Entity.
|
|
*/
|
|
public boolean canBeCollidedWith()
|
|
{
|
|
--- 516,525 ----
|
|
***************
|
|
*** 559,578 ****
|
|
{
|
|
super.applyEntityAttributes();
|
|
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setAttribute(300.0D);
|
|
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setAttribute(0.6000000238418579D);
|
|
this.getEntityAttribute(SharedMonsterAttributes.followRange).setAttribute(40.0D);
|
|
- }
|
|
-
|
|
- public float func_82207_a(int par1)
|
|
- {
|
|
- return this.field_82221_e[par1];
|
|
- }
|
|
-
|
|
- public float func_82210_r(int par1)
|
|
- {
|
|
- return this.field_82220_d[par1];
|
|
}
|
|
|
|
public int func_82212_n()
|
|
{
|
|
return this.dataWatcher.getWatchableObjectInt(20);
|
|
--- 548,557 ----
|
|
*** EntityWitherSkull.java Sat Feb 5 04:19:41 2022
|
|
--- EntityWitherSkull.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 20,35 ****
|
|
protected float getMotionFactor()
|
|
{
|
|
return this.isInvulnerable() ? 0.73F : super.getMotionFactor();
|
|
}
|
|
|
|
- public EntityWitherSkull(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
|
|
- {
|
|
- super(par1World, par2, par4, par6, par8, par10, par12);
|
|
- this.setSize(0.3125F, 0.3125F);
|
|
- }
|
|
-
|
|
/**
|
|
* Returns true if the entity is on fire. Used by render to add the fire effect on rendering.
|
|
*/
|
|
public boolean isBurning()
|
|
{
|
|
--- 20,29 ----
|
|
*** EntityWolf.java Sat Feb 5 04:19:41 2022
|
|
--- EntityWolf.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 242,285 ****
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
- public boolean getWolfShaking()
|
|
- {
|
|
- return this.isShaking;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Used when calculating the amount of shading to apply while the wolf is shaking.
|
|
- */
|
|
- public float getShadingWhileShaking(float par1)
|
|
- {
|
|
- return 0.75F + (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1) / 2.0F * 0.25F;
|
|
- }
|
|
-
|
|
- public float getShakeAngle(float par1, float par2)
|
|
- {
|
|
- float var3 = (this.prevTimeWolfIsShaking + (this.timeWolfIsShaking - this.prevTimeWolfIsShaking) * par1 + par2) / 1.8F;
|
|
-
|
|
- if (var3 < 0.0F)
|
|
- {
|
|
- var3 = 0.0F;
|
|
- }
|
|
- else if (var3 > 1.0F)
|
|
- {
|
|
- var3 = 1.0F;
|
|
- }
|
|
-
|
|
- return MathHelper.sin(var3 * (float)Math.PI) * MathHelper.sin(var3 * (float)Math.PI * 11.0F) * 0.15F * (float)Math.PI;
|
|
- }
|
|
-
|
|
- public float getInterestedAngle(float par1)
|
|
- {
|
|
- return (this.field_70924_f + (this.field_70926_e - this.field_70924_f) * par1) * 0.15F * (float)Math.PI;
|
|
- }
|
|
-
|
|
public float getEyeHeight()
|
|
{
|
|
return this.height * 0.8F;
|
|
}
|
|
|
|
--- 242,251 ----
|
|
***************
|
|
*** 428,456 ****
|
|
|
|
return true;
|
|
}
|
|
|
|
return super.interact(par1EntityPlayer);
|
|
- }
|
|
-
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 8)
|
|
- {
|
|
- this.field_70928_h = true;
|
|
- this.timeWolfIsShaking = 0.0F;
|
|
- this.prevTimeWolfIsShaking = 0.0F;
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
- }
|
|
-
|
|
- public float getTailRotation()
|
|
- {
|
|
- return this.isAngry() ? 1.5393804F : (this.isTamed() ? (0.55F - (20.0F - this.dataWatcher.getWatchableObjectFloat(18)) * 0.02F) * (float)Math.PI : ((float)Math.PI / 5F));
|
|
}
|
|
|
|
/**
|
|
* Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on
|
|
* the animal type)
|
|
--- 394,403 ----
|
|
*** EntityXPOrb.java Sat Feb 5 04:19:41 2022
|
|
--- EntityXPOrb.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 52,88 ****
|
|
this.yOffset = this.height / 2.0F;
|
|
}
|
|
|
|
protected void entityInit() {}
|
|
|
|
- public int getBrightnessForRender(float par1)
|
|
- {
|
|
- float var2 = 0.5F;
|
|
-
|
|
- if (var2 < 0.0F)
|
|
- {
|
|
- var2 = 0.0F;
|
|
- }
|
|
-
|
|
- if (var2 > 1.0F)
|
|
- {
|
|
- var2 = 1.0F;
|
|
- }
|
|
-
|
|
- int var3 = super.getBrightnessForRender(par1);
|
|
- int var4 = var3 & 255;
|
|
- int var5 = var3 >> 16 & 255;
|
|
- var4 += (int)(var2 * 15.0F * 16.0F);
|
|
-
|
|
- if (var4 > 240)
|
|
- {
|
|
- var4 = 240;
|
|
- }
|
|
-
|
|
- return var4 | var5 << 16;
|
|
- }
|
|
-
|
|
/**
|
|
* Called to update the entity's position/logic.
|
|
*/
|
|
public void onUpdate()
|
|
{
|
|
--- 52,61 ----
|
|
***************
|
|
*** 253,272 ****
|
|
{
|
|
return this.xpValue;
|
|
}
|
|
|
|
/**
|
|
! * Returns a number from 1 to 10 based on how much XP this orb is worth. This is used by RenderXPOrb to determine
|
|
! * what texture to use.
|
|
! */
|
|
! public int getTextureByXP()
|
|
! {
|
|
! return this.xpValue >= 2477 ? 10 : (this.xpValue >= 1237 ? 9 : (this.xpValue >= 617 ? 8 : (this.xpValue >= 307 ? 7 : (this.xpValue >= 149 ? 6 : (this.xpValue >= 73 ? 5 : (this.xpValue >= 37 ? 4 : (this.xpValue >= 17 ? 3 : (this.xpValue >= 7 ? 2 : (this.xpValue >= 3 ? 1 : 0)))))))));
|
|
! }
|
|
!
|
|
! /**
|
|
! * Get xp split rate (Is called until the xp drop code in EntityLiving.onEntityUpdate is complete)
|
|
*/
|
|
public static int getXPSplit(int par0)
|
|
{
|
|
return par0 >= 2477 ? 2477 : (par0 >= 1237 ? 1237 : (par0 >= 617 ? 617 : (par0 >= 307 ? 307 : (par0 >= 149 ? 149 : (par0 >= 73 ? 73 : (par0 >= 37 ? 37 : (par0 >= 17 ? 17 : (par0 >= 7 ? 7 : (par0 >= 3 ? 3 : 1)))))))));
|
|
}
|
|
--- 226,236 ----
|
|
{
|
|
return this.xpValue;
|
|
}
|
|
|
|
/**
|
|
! * Get a fragment of the maximum experience points value for the supplied value of experience points value.
|
|
*/
|
|
public static int getXPSplit(int par0)
|
|
{
|
|
return par0 >= 2477 ? 2477 : (par0 >= 1237 ? 1237 : (par0 >= 617 ? 617 : (par0 >= 307 ? 307 : (par0 >= 149 ? 149 : (par0 >= 73 ? 73 : (par0 >= 37 ? 37 : (par0 >= 17 ? 17 : (par0 >= 7 ? 7 : (par0 >= 3 ? 3 : 1)))))))));
|
|
}
|
|
*** EntityZombie.java Sat Feb 5 04:19:41 2022
|
|
--- EntityZombie.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 126,136 ****
|
|
float var1 = this.getBrightness(1.0F);
|
|
|
|
if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
|
|
{
|
|
boolean var2 = true;
|
|
! ItemStack var3 = this.getCurrentItemOrArmor(4);
|
|
|
|
if (var3 != null)
|
|
{
|
|
if (var3.isItemStackDamageable())
|
|
{
|
|
--- 126,136 ----
|
|
float var1 = this.getBrightness(1.0F);
|
|
|
|
if (var1 > 0.5F && this.rand.nextFloat() * 30.0F < (var1 - 0.4F) * 2.0F && this.worldObj.canBlockSeeTheSky(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))
|
|
{
|
|
boolean var2 = true;
|
|
! ItemStack var3 = this.getEquipmentInSlot(4);
|
|
|
|
if (var3 != null)
|
|
{
|
|
if (var3.isItemStackDamageable())
|
|
{
|
|
***************
|
|
*** 431,441 ****
|
|
}
|
|
|
|
this.addRandomArmor();
|
|
this.enchantEquipment();
|
|
|
|
! if (this.getCurrentItemOrArmor(4) == null)
|
|
{
|
|
Calendar var5 = this.worldObj.getCurrentDate();
|
|
|
|
if (var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.rand.nextFloat() < 0.25F)
|
|
{
|
|
--- 431,441 ----
|
|
}
|
|
|
|
this.addRandomArmor();
|
|
this.enchantEquipment();
|
|
|
|
! if (this.getEquipmentInSlot(4) == null)
|
|
{
|
|
Calendar var5 = this.worldObj.getCurrentDate();
|
|
|
|
if (var5.get(2) + 1 == 10 && var5.get(5) == 31 && this.rand.nextFloat() < 0.25F)
|
|
{
|
|
***************
|
|
*** 497,518 ****
|
|
this.conversionTime = par1;
|
|
this.getDataWatcher().updateObject(14, Byte.valueOf((byte)1));
|
|
this.removePotionEffect(Potion.weakness.id);
|
|
this.addPotionEffect(new PotionEffect(Potion.damageBoost.id, par1, Math.min(this.worldObj.difficultySetting - 1, 0)));
|
|
this.worldObj.setEntityState(this, (byte)16);
|
|
- }
|
|
-
|
|
- public void handleHealthUpdate(byte par1)
|
|
- {
|
|
- if (par1 == 16)
|
|
- {
|
|
- this.worldObj.playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, "mob.zombie.remedy", 1.0F + this.rand.nextFloat(), this.rand.nextFloat() * 0.7F + 0.3F, false);
|
|
- }
|
|
- else
|
|
- {
|
|
- super.handleHealthUpdate(par1);
|
|
- }
|
|
}
|
|
|
|
/**
|
|
* Determines if an entity can be despawned, used on idle far away entities
|
|
*/
|
|
--- 497,506 ----
|
|
*** EnumChatFormatting.java Sat Feb 5 04:19:41 2022
|
|
--- EnumChatFormatting.java Sat Feb 5 04:19:56 2022
|
|
***************
|
|
*** 58,70 ****
|
|
{
|
|
return this.field_96303_A;
|
|
}
|
|
|
|
/**
|
|
! * Checks if typo is a color.
|
|
*/
|
|
! public boolean isColor()
|
|
{
|
|
return !this.field_96303_A && this != RESET;
|
|
}
|
|
|
|
public String func_96297_d()
|
|
--- 58,70 ----
|
|
{
|
|
return this.field_96303_A;
|
|
}
|
|
|
|
/**
|
|
! * if typo is a color.
|
|
*/
|
|
! public boolean Checks()
|
|
{
|
|
return !this.field_96303_A && this != RESET;
|
|
}
|
|
|
|
public String func_96297_d()
|
|
***************
|
|
*** 75,89 ****
|
|
public String toString()
|
|
{
|
|
return this.field_96304_B;
|
|
}
|
|
|
|
- public static String func_110646_a(String par0Str)
|
|
- {
|
|
- return par0Str == null ? null : field_96330_y.matcher(par0Str).replaceAll("");
|
|
- }
|
|
-
|
|
public static EnumChatFormatting func_96300_b(String par0Str)
|
|
{
|
|
return par0Str == null ? null : (EnumChatFormatting)field_96331_x.get(par0Str.toLowerCase());
|
|
}
|
|
|
|
--- 75,84 ----
|
|
***************
|
|
*** 95,105 ****
|
|
|
|
for (int var5 = 0; var5 < var4; ++var5)
|
|
{
|
|
EnumChatFormatting var6 = var3[var5];
|
|
|
|
! if ((!var6.isColor() || par0) && (!var6.func_96301_b() || par1))
|
|
{
|
|
var2.add(var6.func_96297_d());
|
|
}
|
|
}
|
|
|
|
--- 90,100 ----
|
|
|
|
for (int var5 = 0; var5 < var4; ++var5)
|
|
{
|
|
EnumChatFormatting var6 = var3[var5];
|
|
|
|
! if ((!var6.Checks() || par0) && (!var6.func_96301_b() || par1))
|
|
{
|
|
var2.add(var6.func_96297_d());
|
|
}
|
|
}
|
|
|
|
*** EnumGameType.java Sat Feb 5 04:19:41 2022
|
|
--- EnumGameType.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 68,85 ****
|
|
{
|
|
return this == CREATIVE;
|
|
}
|
|
|
|
/**
|
|
- * Returns true if this is the SURVIVAL or ADVENTURE game type
|
|
- */
|
|
- public boolean isSurvivalOrAdventure()
|
|
- {
|
|
- return this == SURVIVAL || this == ADVENTURE;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the game type with the specified ID, or SURVIVAL if none found. Args: id
|
|
*/
|
|
public static EnumGameType getByID(int par0)
|
|
{
|
|
EnumGameType[] var1 = values();
|
|
--- 68,77 ----
|
|
***************
|
|
*** 88,118 ****
|
|
for (int var3 = 0; var3 < var2; ++var3)
|
|
{
|
|
EnumGameType var4 = var1[var3];
|
|
|
|
if (var4.id == par0)
|
|
- {
|
|
- return var4;
|
|
- }
|
|
- }
|
|
-
|
|
- return SURVIVAL;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the game type with the specified name, or SURVIVAL if none found. This is case sensitive. Args: name
|
|
- */
|
|
- public static EnumGameType getByName(String par0Str)
|
|
- {
|
|
- EnumGameType[] var1 = values();
|
|
- int var2 = var1.length;
|
|
-
|
|
- for (int var3 = 0; var3 < var2; ++var3)
|
|
- {
|
|
- EnumGameType var4 = var1[var3];
|
|
-
|
|
- if (var4.name.equals(par0Str))
|
|
{
|
|
return var4;
|
|
}
|
|
}
|
|
|
|
--- 80,89 ----
|
|
*** EnumToolMaterial.java Sat Feb 5 04:19:41 2022
|
|
--- EnumToolMaterial.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 53,63 ****
|
|
{
|
|
return this.efficiencyOnProperMaterial;
|
|
}
|
|
|
|
/**
|
|
! * Damage versus entities.
|
|
*/
|
|
public float getDamageVsEntity()
|
|
{
|
|
return this.damageVsEntity;
|
|
}
|
|
--- 53,63 ----
|
|
{
|
|
return this.efficiencyOnProperMaterial;
|
|
}
|
|
|
|
/**
|
|
! * Returns the damage against a given entity.
|
|
*/
|
|
public float getDamageVsEntity()
|
|
{
|
|
return this.damageVsEntity;
|
|
}
|
|
*** ExtendedBlockStorage.java Sat Feb 5 04:19:41 2022
|
|
--- ExtendedBlockStorage.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 235,249 ****
|
|
public byte[] getBlockLSBArray()
|
|
{
|
|
return this.blockLSBArray;
|
|
}
|
|
|
|
- public void clearMSBArray()
|
|
- {
|
|
- this.blockMSBArray = null;
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the block ID MSB (bits 11..8) array for this storage array's Chunk.
|
|
*/
|
|
public NibbleArray getBlockMSBArray()
|
|
{
|
|
--- 235,244 ----
|
|
***************
|
|
*** 307,323 ****
|
|
* Sets the NibbleArray instance used for Sky-light values in this particular storage block.
|
|
*/
|
|
public void setSkylightArray(NibbleArray par1NibbleArray)
|
|
{
|
|
this.skylightArray = par1NibbleArray;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Called by a Chunk to initialize the MSB array if getBlockMSBArray returns null. Returns the newly-created
|
|
- * NibbleArray instance.
|
|
- */
|
|
- public NibbleArray createBlockMSBArray()
|
|
- {
|
|
- this.blockMSBArray = new NibbleArray(this.blockLSBArray.length, 4);
|
|
- return this.blockMSBArray;
|
|
}
|
|
}
|
|
--- 302,308 ----
|
|
*** FoodStats.java Sat Feb 5 04:19:41 2022
|
|
--- FoodStats.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 84,94 ****
|
|
this.foodTimer = 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Reads food stats from an NBT object.
|
|
*/
|
|
public void readNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
if (par1NBTTagCompound.hasKey("foodLevel"))
|
|
{
|
|
--- 84,94 ----
|
|
this.foodTimer = 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Reads the food data for the player.
|
|
*/
|
|
public void readNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
if (par1NBTTagCompound.hasKey("foodLevel"))
|
|
{
|
|
***************
|
|
*** 98,108 ****
|
|
this.foodExhaustionLevel = par1NBTTagCompound.getFloat("foodExhaustionLevel");
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Writes food stats to an NBT object.
|
|
*/
|
|
public void writeNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
par1NBTTagCompound.setInteger("foodLevel", this.foodLevel);
|
|
par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer);
|
|
--- 98,108 ----
|
|
this.foodExhaustionLevel = par1NBTTagCompound.getFloat("foodExhaustionLevel");
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Writes the food data for the player.
|
|
*/
|
|
public void writeNBT(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
par1NBTTagCompound.setInteger("foodLevel", this.foodLevel);
|
|
par1NBTTagCompound.setInteger("foodTickTimer", this.foodTimer);
|
|
***************
|
|
*** 116,132 ****
|
|
public int getFoodLevel()
|
|
{
|
|
return this.foodLevel;
|
|
}
|
|
|
|
- public int getPrevFoodLevel()
|
|
- {
|
|
- return this.prevFoodLevel;
|
|
- }
|
|
-
|
|
/**
|
|
! * If foodLevel is not max.
|
|
*/
|
|
public boolean needFood()
|
|
{
|
|
return this.foodLevel < 20;
|
|
}
|
|
--- 116,127 ----
|
|
public int getFoodLevel()
|
|
{
|
|
return this.foodLevel;
|
|
}
|
|
|
|
/**
|
|
! * Get whether the player must eat food.
|
|
*/
|
|
public boolean needFood()
|
|
{
|
|
return this.foodLevel < 20;
|
|
}
|
|
***************
|
|
*** 143,159 ****
|
|
* Get the player's food saturation level.
|
|
*/
|
|
public float getSaturationLevel()
|
|
{
|
|
return this.foodSaturationLevel;
|
|
- }
|
|
-
|
|
- public void setFoodLevel(int par1)
|
|
- {
|
|
- this.foodLevel = par1;
|
|
- }
|
|
-
|
|
- public void setFoodSaturationLevel(float par1)
|
|
- {
|
|
- this.foodSaturationLevel = par1;
|
|
}
|
|
}
|
|
--- 138,144 ----
|
|
*** HttpUtil.java Sat Feb 5 04:19:42 2022
|
|
--- HttpUtil.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,15 ****
|
|
package net.minecraft.src;
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.DataOutputStream;
|
|
- import java.io.IOException;
|
|
import java.io.InputStreamReader;
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.net.HttpURLConnection;
|
|
import java.net.Proxy;
|
|
- import java.net.ServerSocket;
|
|
import java.net.URL;
|
|
import java.net.URLEncoder;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
import java.util.Map.Entry;
|
|
--- 1,13 ----
|
|
***************
|
|
*** 124,159 ****
|
|
}
|
|
}
|
|
|
|
return "";
|
|
}
|
|
- }
|
|
-
|
|
- public static int func_76181_a() throws IOException
|
|
- {
|
|
- ServerSocket var0 = null;
|
|
- boolean var1 = true;
|
|
- int var10;
|
|
-
|
|
- try
|
|
- {
|
|
- var0 = new ServerSocket(0);
|
|
- var10 = var0.getLocalPort();
|
|
- }
|
|
- finally
|
|
- {
|
|
- try
|
|
- {
|
|
- if (var0 != null)
|
|
- {
|
|
- var0.close();
|
|
- }
|
|
- }
|
|
- catch (IOException var8)
|
|
- {
|
|
- ;
|
|
- }
|
|
- }
|
|
-
|
|
- return var10;
|
|
}
|
|
}
|
|
--- 122,128 ----
|
|
*** IBlockAccess.java Sat Feb 5 04:19:42 2022
|
|
--- IBlockAccess.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 11,33 ****
|
|
* Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists
|
|
*/
|
|
TileEntity getBlockTileEntity(int var1, int var2, int var3);
|
|
|
|
/**
|
|
- * Any Light rendered on a 1.8 Block goes through here
|
|
- */
|
|
- int getLightBrightnessForSkyBlocks(int var1, int var2, int var3, int var4);
|
|
-
|
|
- float getBrightness(int var1, int var2, int var3, int var4);
|
|
-
|
|
- /**
|
|
- * Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light
|
|
- * values aren't linear for brightness). Args: x, y, z
|
|
- */
|
|
- float getLightBrightness(int var1, int var2, int var3);
|
|
-
|
|
- /**
|
|
* Returns the block metadata at coords x,y,z
|
|
*/
|
|
int getBlockMetadata(int var1, int var2, int var3);
|
|
|
|
/**
|
|
--- 11,20 ----
|
|
***************
|
|
*** 36,76 ****
|
|
Material getBlockMaterial(int var1, int var2, int var3);
|
|
|
|
/**
|
|
* Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z
|
|
*/
|
|
- boolean isBlockOpaqueCube(int var1, int var2, int var3);
|
|
-
|
|
- /**
|
|
- * Indicate if a material is a normal solid opaque cube.
|
|
- */
|
|
boolean isBlockNormalCube(int var1, int var2, int var3);
|
|
-
|
|
- /**
|
|
- * Returns true if the block at the specified coordinates is empty
|
|
- */
|
|
- boolean isAirBlock(int var1, int var2, int var3);
|
|
-
|
|
- /**
|
|
- * Gets the biome for a given set of x/z coordinates
|
|
- */
|
|
- BiomeGenBase getBiomeGenForCoords(int var1, int var2);
|
|
-
|
|
- /**
|
|
- * Returns current world height.
|
|
- */
|
|
- int getHeight();
|
|
-
|
|
- /**
|
|
- * set by !chunk.getAreLevelsEmpty
|
|
- */
|
|
- boolean extendedLevelsInChunkCache();
|
|
-
|
|
- /**
|
|
- * Returns true if the block at the given coordinate has a solid (buildable) top surface.
|
|
- */
|
|
- boolean doesBlockHaveSolidTopSurface(int var1, int var2, int var3);
|
|
|
|
/**
|
|
* Return the Vec3Pool object for this world.
|
|
*/
|
|
Vec3Pool getWorldVec3Pool();
|
|
--- 23,33 ----
|
|
*** ICommandSender.java Sat Feb 5 04:19:42 2022
|
|
--- ICommandSender.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 15,23 ****
|
|
boolean canCommandSenderUseCommand(int var1, String var2);
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! ChunkCoordinates getPlayerCoordinates();
|
|
|
|
World getEntityWorld();
|
|
}
|
|
--- 15,23 ----
|
|
boolean canCommandSenderUseCommand(int var1, String var2);
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! ChunkCoordinates getCommandSenderPosition();
|
|
|
|
World getEntityWorld();
|
|
}
|
|
*** Icon.java Sat Feb 5 04:19:42 2022
|
|
--- Icon.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,46 ****
|
|
package net.minecraft.src;
|
|
|
|
public interface Icon
|
|
{
|
|
- /**
|
|
- * Returns the width of the icon, in pixels.
|
|
- */
|
|
- int getIconWidth();
|
|
-
|
|
- /**
|
|
- * Returns the height of the icon, in pixels.
|
|
- */
|
|
- int getIconHeight();
|
|
-
|
|
- /**
|
|
- * Returns the minimum U coordinate to use when rendering with this icon.
|
|
- */
|
|
- float getMinU();
|
|
-
|
|
- /**
|
|
- * Returns the maximum U coordinate to use when rendering with this icon.
|
|
- */
|
|
- float getMaxU();
|
|
-
|
|
- /**
|
|
- * Gets a U coordinate on the icon. 0 returns uMin and 16 returns uMax. Other arguments return in-between values.
|
|
- */
|
|
- float getInterpolatedU(double var1);
|
|
-
|
|
- /**
|
|
- * Returns the minimum V coordinate to use when rendering with this icon.
|
|
- */
|
|
- float getMinV();
|
|
-
|
|
- /**
|
|
- * Returns the maximum V coordinate to use when rendering with this icon.
|
|
- */
|
|
- float getMaxV();
|
|
-
|
|
- /**
|
|
- * Gets a V coordinate on the icon. 0 returns vMin and 16 returns vMax. Other arguments return in-between values.
|
|
- */
|
|
- float getInterpolatedV(double var1);
|
|
-
|
|
- String getIconName();
|
|
}
|
|
--- 1,5 ----
|
|
*** ICrafting.java Sat Feb 5 04:19:42 2022
|
|
--- ICrafting.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 2,12 ****
|
|
|
|
import java.util.List;
|
|
|
|
public interface ICrafting
|
|
{
|
|
! void sendContainerAndContentsToPlayer(Container var1, List var2);
|
|
|
|
/**
|
|
* Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual
|
|
* contents of that slot. Args: Container, slot number, slot contents
|
|
*/
|
|
--- 2,15 ----
|
|
|
|
import java.util.List;
|
|
|
|
public interface ICrafting
|
|
{
|
|
! /**
|
|
! * update the crafting window inventory with the items in the list
|
|
! */
|
|
! void updateCraftingInventory(Container var1, List var2);
|
|
|
|
/**
|
|
* Sends the contents of an inventory slot to the client-side Container. This doesn't have to match the actual
|
|
* contents of that slot. Args: Container, slot number, slot contents
|
|
*/
|
|
*** ILogAgent.java Sat Feb 5 04:19:42 2022
|
|
--- ILogAgent.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,18 ****
|
|
package net.minecraft.src;
|
|
|
|
public interface ILogAgent
|
|
{
|
|
void logInfo(String var1);
|
|
|
|
void logWarning(String var1);
|
|
|
|
void logWarningFormatted(String var1, Object ... var2);
|
|
|
|
void logWarningException(String var1, Throwable var2);
|
|
|
|
void logSevere(String var1);
|
|
|
|
void logSevereException(String var1, Throwable var2);
|
|
-
|
|
- void logFine(String var1);
|
|
}
|
|
--- 1,26 ----
|
|
package net.minecraft.src;
|
|
|
|
+ import java.util.logging.Logger;
|
|
+
|
|
public interface ILogAgent
|
|
{
|
|
+ Logger func_120013_a();
|
|
+
|
|
+ /**
|
|
+ * Logs plain text message.
|
|
+ */
|
|
void logInfo(String var1);
|
|
|
|
+ /**
|
|
+ * Logs text as warning.
|
|
+ */
|
|
void logWarning(String var1);
|
|
|
|
void logWarningFormatted(String var1, Object ... var2);
|
|
|
|
void logWarningException(String var1, Throwable var2);
|
|
|
|
void logSevere(String var1);
|
|
|
|
void logSevereException(String var1, Throwable var2);
|
|
}
|
|
*** IMerchant.java Sat Feb 5 04:19:42 2022
|
|
--- IMerchant.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 6,16 ****
|
|
|
|
EntityPlayer getCustomer();
|
|
|
|
MerchantRecipeList getRecipes(EntityPlayer var1);
|
|
|
|
- void setRecipes(MerchantRecipeList var1);
|
|
-
|
|
void useRecipe(MerchantRecipe var1);
|
|
|
|
void func_110297_a_(ItemStack var1);
|
|
}
|
|
--- 6,14 ----
|
|
*** INetworkManager.java Sat Feb 5 04:19:42 2022
|
|
--- INetworkManager.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 23,49 ****
|
|
* Checks timeouts and processes all pending read packets.
|
|
*/
|
|
void processReadPackets();
|
|
|
|
/**
|
|
! * Return the InetSocketAddress of the remote endpoint
|
|
*/
|
|
! SocketAddress getSocketAddress();
|
|
|
|
/**
|
|
* Shuts down the server. (Only actually used on the server)
|
|
*/
|
|
void serverShutdown();
|
|
|
|
/**
|
|
! * returns 0 for memoryConnections
|
|
*/
|
|
! int packetSize();
|
|
|
|
/**
|
|
* Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to
|
|
* stop reading and writing threads.
|
|
*/
|
|
void networkShutdown(String var1, Object ... var2);
|
|
-
|
|
- void closeConnections();
|
|
}
|
|
--- 23,47 ----
|
|
* Checks timeouts and processes all pending read packets.
|
|
*/
|
|
void processReadPackets();
|
|
|
|
/**
|
|
! * Returns the socket address of the remote side. Server-only.
|
|
*/
|
|
! SocketAddress getRemoteAddress();
|
|
|
|
/**
|
|
* Shuts down the server. (Only actually used on the server)
|
|
*/
|
|
void serverShutdown();
|
|
|
|
/**
|
|
! * Returns the number of chunk data packets waiting to be sent.
|
|
*/
|
|
! int getNumChunkDataPackets();
|
|
|
|
/**
|
|
* Shuts down the network with the specified reason. Closes all streams and sockets, spawns NetworkMasterThread to
|
|
* stop reading and writing threads.
|
|
*/
|
|
void networkShutdown(String var1, Object ... var2);
|
|
}
|
|
*** IntHashMap.java Sat Feb 5 04:19:42 2022
|
|
--- IntHashMap.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 57,75 ****
|
|
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
! * Return true if an object is associated with the given key
|
|
*/
|
|
public boolean containsItem(int par1)
|
|
{
|
|
return this.lookupEntry(par1) != null;
|
|
}
|
|
|
|
/**
|
|
! * Returns the key/object mapping for a given key as a MCHashEntry
|
|
*/
|
|
final IntHashMapEntry lookupEntry(int par1)
|
|
{
|
|
int var2 = computeHash(par1);
|
|
|
|
--- 57,75 ----
|
|
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
! * Returns true if this hash table contains the specified item.
|
|
*/
|
|
public boolean containsItem(int par1)
|
|
{
|
|
return this.lookupEntry(par1) != null;
|
|
}
|
|
|
|
/**
|
|
! * Returns the internal entry for a key
|
|
*/
|
|
final IntHashMapEntry lookupEntry(int par1)
|
|
{
|
|
int var2 = computeHash(par1);
|
|
|
|
*** InventoryPlayer.java Sat Feb 5 04:19:42 2022
|
|
--- InventoryPlayer.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 11,23 ****
|
|
public ItemStack[] armorInventory = new ItemStack[4];
|
|
|
|
/** The index of the currently held item (0-8). */
|
|
public int currentItem;
|
|
|
|
- /** The current ItemStack. */
|
|
- private ItemStack currentItemStack;
|
|
-
|
|
/** The player whose inventory this is. */
|
|
public EntityPlayer player;
|
|
private ItemStack itemStack;
|
|
|
|
/**
|
|
--- 11,20 ----
|
|
***************
|
|
*** 61,83 ****
|
|
}
|
|
|
|
return -1;
|
|
}
|
|
|
|
- private int getInventorySlotContainItemAndDamage(int par1, int par2)
|
|
- {
|
|
- for (int var3 = 0; var3 < this.mainInventory.length; ++var3)
|
|
- {
|
|
- if (this.mainInventory[var3] != null && this.mainInventory[var3].itemID == par1 && this.mainInventory[var3].getItemDamage() == par2)
|
|
- {
|
|
- return var3;
|
|
- }
|
|
- }
|
|
-
|
|
- return -1;
|
|
- }
|
|
-
|
|
/**
|
|
* stores an itemstack in the users inventory
|
|
*/
|
|
private int storeItemStack(ItemStack par1ItemStack)
|
|
{
|
|
--- 58,67 ----
|
|
***************
|
|
*** 107,180 ****
|
|
|
|
return -1;
|
|
}
|
|
|
|
/**
|
|
- * Sets a specific itemID as the current item being held (only if it exists on the hotbar)
|
|
- */
|
|
- public void setCurrentItem(int par1, int par2, boolean par3, boolean par4)
|
|
- {
|
|
- boolean var5 = true;
|
|
- this.currentItemStack = this.getCurrentItem();
|
|
- int var7;
|
|
-
|
|
- if (par3)
|
|
- {
|
|
- var7 = this.getInventorySlotContainItemAndDamage(par1, par2);
|
|
- }
|
|
- else
|
|
- {
|
|
- var7 = this.getInventorySlotContainItem(par1);
|
|
- }
|
|
-
|
|
- if (var7 >= 0 && var7 < 9)
|
|
- {
|
|
- this.currentItem = var7;
|
|
- }
|
|
- else
|
|
- {
|
|
- if (par4 && par1 > 0)
|
|
- {
|
|
- int var6 = this.getFirstEmptyStack();
|
|
-
|
|
- if (var6 >= 0 && var6 < 9)
|
|
- {
|
|
- this.currentItem = var6;
|
|
- }
|
|
-
|
|
- this.func_70439_a(Item.itemsList[par1], par2);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Switch the current item to the next one or the previous one
|
|
- */
|
|
- public void changeCurrentItem(int par1)
|
|
- {
|
|
- if (par1 > 0)
|
|
- {
|
|
- par1 = 1;
|
|
- }
|
|
-
|
|
- if (par1 < 0)
|
|
- {
|
|
- par1 = -1;
|
|
- }
|
|
-
|
|
- for (this.currentItem -= par1; this.currentItem < 0; this.currentItem += 9)
|
|
- {
|
|
- ;
|
|
- }
|
|
-
|
|
- while (this.currentItem >= 9)
|
|
- {
|
|
- this.currentItem -= 9;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Clear this player's inventory, using the specified ID and metadata as filters or -1 for no filter.
|
|
*/
|
|
public int clearInventory(int par1, int par2)
|
|
{
|
|
int var3 = 0;
|
|
--- 91,100 ----
|
|
***************
|
|
*** 218,251 ****
|
|
var3 += this.itemStack.stackSize;
|
|
this.setItemStack((ItemStack)null);
|
|
}
|
|
|
|
return var3;
|
|
- }
|
|
-
|
|
- public void func_70439_a(Item par1Item, int par2)
|
|
- {
|
|
- if (par1Item != null)
|
|
- {
|
|
- if (this.currentItemStack != null && this.currentItemStack.isItemEnchantable() && this.getInventorySlotContainItemAndDamage(this.currentItemStack.itemID, this.currentItemStack.getItemDamageForDisplay()) == this.currentItem)
|
|
- {
|
|
- return;
|
|
- }
|
|
-
|
|
- int var3 = this.getInventorySlotContainItemAndDamage(par1Item.itemID, par2);
|
|
-
|
|
- if (var3 >= 0)
|
|
- {
|
|
- int var4 = this.mainInventory[var3].stackSize;
|
|
- this.mainInventory[var3] = this.mainInventory[this.currentItem];
|
|
- this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], var4, par2);
|
|
- }
|
|
- else
|
|
- {
|
|
- this.mainInventory[this.currentItem] = new ItemStack(Item.itemsList[par1Item.itemID], 1, par2);
|
|
- }
|
|
- }
|
|
}
|
|
|
|
/**
|
|
* This function stores as many items of an ItemStack as possible in a matching slot and returns the quantity of
|
|
* left over items.
|
|
--- 138,147 ----
|
|
*** IProgressUpdate.java Sat Feb 5 04:19:42 2022
|
|
--- IProgressUpdate.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,18 ****
|
|
package net.minecraft.src;
|
|
|
|
public interface IProgressUpdate
|
|
{
|
|
/**
|
|
! * "Saving level", or the loading,or downloading equivelent
|
|
*/
|
|
! void displayProgressMessage(String var1);
|
|
|
|
/**
|
|
! * This is called with "Working..." by resetProgressAndMessage
|
|
*/
|
|
! void resetProgresAndWorkingMessage(String var1);
|
|
|
|
/**
|
|
* Updates the progress bar on the loading screen to the specified amount. Args: loadProgress
|
|
*/
|
|
void setLoadingProgress(int var1);
|
|
--- 1,18 ----
|
|
package net.minecraft.src;
|
|
|
|
public interface IProgressUpdate
|
|
{
|
|
/**
|
|
! * Shows the 'Saving level' string.
|
|
*/
|
|
! void displaySavingString(String var1);
|
|
|
|
/**
|
|
! * Displays a string on the loading screen supposed to indicate what is being done currently.
|
|
*/
|
|
! void displayLoadingString(String var1);
|
|
|
|
/**
|
|
* Updates the progress bar on the loading screen to the specified amount. Args: loadProgress
|
|
*/
|
|
void setLoadingProgress(int var1);
|
|
*** ISaveFormat.java Sat Feb 5 04:19:42 2022
|
|
--- ISaveFormat.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,48 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public interface ISaveFormat
|
|
{
|
|
/**
|
|
* Returns back a loader for the specified save directory
|
|
*/
|
|
ISaveHandler getSaveLoader(String var1, boolean var2);
|
|
|
|
- List getSaveList() throws AnvilConverterException;
|
|
-
|
|
void flushCache();
|
|
|
|
/**
|
|
- * gets the world info
|
|
- */
|
|
- WorldInfo getWorldInfo(String var1);
|
|
-
|
|
- /**
|
|
* @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting
|
|
* the associated directory recursively.
|
|
*/
|
|
boolean deleteWorldDirectory(String var1);
|
|
|
|
/**
|
|
! * @args: Takes two arguments - first the name of the directory containing the world and second the new name for
|
|
! * that world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory
|
|
! * containing the world data.
|
|
! */
|
|
! void renameWorld(String var1, String var2);
|
|
!
|
|
! /**
|
|
! * Checks if the save directory uses the old map format
|
|
*/
|
|
boolean isOldMapFormat(String var1);
|
|
|
|
/**
|
|
! * Converts the specified map to the new map format. Args: worldName, loadingScreen
|
|
*/
|
|
boolean convertMapFormat(String var1, IProgressUpdate var2);
|
|
-
|
|
- /**
|
|
- * Return whether the given world can be loaded.
|
|
- */
|
|
- boolean canLoadWorld(String var1);
|
|
}
|
|
--- 1,27 ----
|
|
package net.minecraft.src;
|
|
|
|
public interface ISaveFormat
|
|
{
|
|
/**
|
|
* Returns back a loader for the specified save directory
|
|
*/
|
|
ISaveHandler getSaveLoader(String var1, boolean var2);
|
|
|
|
void flushCache();
|
|
|
|
/**
|
|
* @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting
|
|
* the associated directory recursively.
|
|
*/
|
|
boolean deleteWorldDirectory(String var1);
|
|
|
|
/**
|
|
! * gets if the map is old chunk saving (true) or McRegion (false)
|
|
*/
|
|
boolean isOldMapFormat(String var1);
|
|
|
|
/**
|
|
! * converts the map to mcRegion
|
|
*/
|
|
boolean convertMapFormat(String var1, IProgressUpdate var2);
|
|
}
|
|
*** ISaveHandler.java Sat Feb 5 04:19:42 2022
|
|
--- ISaveHandler.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 13,40 ****
|
|
* Checks the session lock to prevent save collisions
|
|
*/
|
|
void checkSessionLock() throws MinecraftException;
|
|
|
|
/**
|
|
! * Returns the chunk loader with the provided world provider
|
|
*/
|
|
IChunkLoader getChunkLoader(WorldProvider var1);
|
|
|
|
/**
|
|
* Saves the given World Info with the given NBTTagCompound as the Player.
|
|
*/
|
|
void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2);
|
|
|
|
/**
|
|
! * Saves the passed in world info.
|
|
*/
|
|
void saveWorldInfo(WorldInfo var1);
|
|
|
|
! /**
|
|
! * returns null if no saveHandler is relevent (eg. SMP)
|
|
! */
|
|
! IPlayerFileData getSaveHandler();
|
|
|
|
/**
|
|
* Called to flush all changes to disk, waiting for them to complete.
|
|
*/
|
|
void flush();
|
|
--- 13,37 ----
|
|
* Checks the session lock to prevent save collisions
|
|
*/
|
|
void checkSessionLock() throws MinecraftException;
|
|
|
|
/**
|
|
! * initializes and returns the chunk loader for the specified world provider
|
|
*/
|
|
IChunkLoader getChunkLoader(WorldProvider var1);
|
|
|
|
/**
|
|
* Saves the given World Info with the given NBTTagCompound as the Player.
|
|
*/
|
|
void saveWorldInfoWithPlayer(WorldInfo var1, NBTTagCompound var2);
|
|
|
|
/**
|
|
! * used to update level.dat from old format to MCRegion format
|
|
*/
|
|
void saveWorldInfo(WorldInfo var1);
|
|
|
|
! IPlayerFileData getPlayerNBTManager();
|
|
|
|
/**
|
|
* Called to flush all changes to disk, waiting for them to complete.
|
|
*/
|
|
void flush();
|
|
*** IServer.java Sat Feb 5 04:19:42 2022
|
|
--- IServer.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 38,48 ****
|
|
int getPort();
|
|
|
|
/**
|
|
* Returns the server message of the day
|
|
*/
|
|
! String getServerMOTD();
|
|
|
|
/**
|
|
* Returns the server's Minecraft version as string.
|
|
*/
|
|
String getMinecraftVersion();
|
|
--- 38,48 ----
|
|
int getPort();
|
|
|
|
/**
|
|
* Returns the server message of the day
|
|
*/
|
|
! String getMotd();
|
|
|
|
/**
|
|
* Returns the server's Minecraft version as string.
|
|
*/
|
|
String getMinecraftVersion();
|
|
***************
|
|
*** 67,77 ****
|
|
/**
|
|
* Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0".
|
|
*/
|
|
String getPlugins();
|
|
|
|
! String executeCommand(String var1);
|
|
|
|
/**
|
|
* Returns true if debugging is enabled, false otherwise.
|
|
*/
|
|
boolean isDebuggingEnabled();
|
|
--- 67,80 ----
|
|
/**
|
|
* Used by RCon's Query in the form of "MajorServerMod 1.2.3: MyPlugin 1.3; AnotherPlugin 2.1; AndSoForth 1.0".
|
|
*/
|
|
String getPlugins();
|
|
|
|
! /**
|
|
! * Handle a command received by an RCon instance
|
|
! */
|
|
! String handleRConCommand(String var1);
|
|
|
|
/**
|
|
* Returns true if debugging is enabled, false otherwise.
|
|
*/
|
|
boolean isDebuggingEnabled();
|
|
*** ISidedInventory.java Sat Feb 5 04:19:42 2022
|
|
--- ISidedInventory.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,14 ****
|
|
package net.minecraft.src;
|
|
|
|
public interface ISidedInventory extends IInventory
|
|
{
|
|
/**
|
|
! * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this
|
|
! * block.
|
|
*/
|
|
! int[] getAccessibleSlotsFromSide(int var1);
|
|
|
|
/**
|
|
* Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item,
|
|
* side
|
|
*/
|
|
--- 1,13 ----
|
|
package net.minecraft.src;
|
|
|
|
public interface ISidedInventory extends IInventory
|
|
{
|
|
/**
|
|
! * param side
|
|
*/
|
|
! int[] getSlotsForFace(int var1);
|
|
|
|
/**
|
|
* Returns true if automation can insert the given item in the given slot from the given side. Args: Slot, item,
|
|
* side
|
|
*/
|
|
*** IStatType.java Sat Feb 5 04:19:42 2022
|
|
--- IStatType.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,9 ****
|
|
package net.minecraft.src;
|
|
|
|
public interface IStatType
|
|
{
|
|
- /**
|
|
- * Formats a given stat for human consumption.
|
|
- */
|
|
- String format(int var1);
|
|
}
|
|
--- 1,5 ----
|
|
*** Item.java Sat Feb 5 04:19:42 2022
|
|
--- Item.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,10 ****
|
|
package net.minecraft.src;
|
|
|
|
import com.google.common.collect.HashMultimap;
|
|
import com.google.common.collect.Multimap;
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
import java.util.UUID;
|
|
|
|
public class Item
|
|
{
|
|
--- 1,9 ----
|
|
***************
|
|
*** 177,187 ****
|
|
public static Item fireworkCharge = (new ItemFireworkCharge(146)).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc).setTextureName("fireworks_charge");
|
|
public static ItemEnchantedBook enchantedBook = (ItemEnchantedBook)(new ItemEnchantedBook(147)).setMaxStackSize(1).setUnlocalizedName("enchantedBook").setTextureName("book_enchanted");
|
|
public static Item comparator = (new ItemReed(148, Block.redstoneComparatorIdle)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator");
|
|
public static Item netherrackBrick = (new Item(149)).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick");
|
|
public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz");
|
|
! public static Item minecartTnt = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt");
|
|
public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper");
|
|
public static Item horseArmorIron = (new Item(161)).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor");
|
|
public static Item horseArmorGold = (new Item(162)).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor");
|
|
public static Item horseArmorDiamond = (new Item(163)).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("diamond_horse_armor");
|
|
public static Item leash = (new ItemLeash(164)).setUnlocalizedName("leash").setTextureName("lead");
|
|
--- 176,186 ----
|
|
public static Item fireworkCharge = (new ItemFireworkCharge(146)).setUnlocalizedName("fireworksCharge").setCreativeTab(CreativeTabs.tabMisc).setTextureName("fireworks_charge");
|
|
public static ItemEnchantedBook enchantedBook = (ItemEnchantedBook)(new ItemEnchantedBook(147)).setMaxStackSize(1).setUnlocalizedName("enchantedBook").setTextureName("book_enchanted");
|
|
public static Item comparator = (new ItemReed(148, Block.redstoneComparatorIdle)).setUnlocalizedName("comparator").setCreativeTab(CreativeTabs.tabRedstone).setTextureName("comparator");
|
|
public static Item netherrackBrick = (new Item(149)).setUnlocalizedName("netherbrick").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("netherbrick");
|
|
public static Item netherQuartz = (new Item(150)).setUnlocalizedName("netherquartz").setCreativeTab(CreativeTabs.tabMaterials).setTextureName("quartz");
|
|
! public static Item tntMinecart = (new ItemMinecart(151, 3)).setUnlocalizedName("minecartTnt").setTextureName("minecart_tnt");
|
|
public static Item minecartHopper = (new ItemMinecart(152, 5)).setUnlocalizedName("minecartHopper").setTextureName("minecart_hopper");
|
|
public static Item horseArmorIron = (new Item(161)).setUnlocalizedName("horsearmormetal").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("iron_horse_armor");
|
|
public static Item horseArmorGold = (new Item(162)).setUnlocalizedName("horsearmorgold").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("gold_horse_armor");
|
|
public static Item horseArmorDiamond = (new Item(163)).setUnlocalizedName("horsearmordiamond").setMaxStackSize(1).setCreativeTab(CreativeTabs.tabMisc).setTextureName("diamond_horse_armor");
|
|
public static Item leash = (new ItemLeash(164)).setUnlocalizedName("leash").setTextureName("lead");
|
|
***************
|
|
*** 214,231 ****
|
|
/**
|
|
* Some items (like dyes) have multiple subtypes on same item, this is field define this behavior
|
|
*/
|
|
protected boolean hasSubtypes;
|
|
private Item containerItem;
|
|
private String potionEffect;
|
|
|
|
/** The unlocalized name of this item. */
|
|
private String unlocalizedName;
|
|
|
|
- /** Icon index in the icons table. */
|
|
- protected Icon itemIcon;
|
|
-
|
|
/** The string associated with this Item's Icon. */
|
|
protected String iconString;
|
|
|
|
protected Item(int par1)
|
|
{
|
|
--- 213,231 ----
|
|
/**
|
|
* Some items (like dyes) have multiple subtypes on same item, this is field define this behavior
|
|
*/
|
|
protected boolean hasSubtypes;
|
|
private Item containerItem;
|
|
+
|
|
+ /**
|
|
+ * The string representing this item's effect on a potion when used as an ingredient.
|
|
+ */
|
|
private String potionEffect;
|
|
|
|
/** The unlocalized name of this item. */
|
|
private String unlocalizedName;
|
|
|
|
/** The string associated with this Item's Icon. */
|
|
protected String iconString;
|
|
|
|
protected Item(int par1)
|
|
{
|
|
***************
|
|
*** 244,277 ****
|
|
this.maxStackSize = par1;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
- * Returns 0 for /terrain.png, 1 for /gui/items.png
|
|
- */
|
|
- public int getSpriteNumber()
|
|
- {
|
|
- return 1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return this.itemIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the icon index of the stack given as argument.
|
|
- */
|
|
- public final Icon getIconIndex(ItemStack par1ItemStack)
|
|
- {
|
|
- return this.getIconFromDamage(par1ItemStack.getItemDamage());
|
|
- }
|
|
-
|
|
- /**
|
|
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
|
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
|
*/
|
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
{
|
|
--- 244,253 ----
|
|
***************
|
|
*** 387,413 ****
|
|
this.bFull3D = true;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
- * Returns True is the item is renderer in full 3D when hold.
|
|
- */
|
|
- public boolean isFull3D()
|
|
- {
|
|
- return this.bFull3D;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
|
|
- * hands.
|
|
- */
|
|
- public boolean shouldRotateAroundWhenRendering()
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
- /**
|
|
* Sets the unlocalized name of this item to the string passed as the parameter, prefixed by "item."
|
|
*/
|
|
public Item setUnlocalizedName(String par1Str)
|
|
{
|
|
this.unlocalizedName = par1Str;
|
|
--- 363,372 ----
|
|
***************
|
|
*** 485,499 ****
|
|
public String getItemStackDisplayName(ItemStack par1ItemStack)
|
|
{
|
|
return StatCollector.translateToLocal(this.getUnlocalizedName(par1ItemStack) + ".name");
|
|
}
|
|
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- return 16777215;
|
|
- }
|
|
-
|
|
/**
|
|
* Called each tick as long the item is on a player inventory. Uses by maps to check if is on a player hand and
|
|
* update it's contents.
|
|
*/
|
|
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {}
|
|
--- 444,453 ----
|
|
***************
|
|
*** 555,587 ****
|
|
public boolean isPotionIngredient()
|
|
{
|
|
return this.potionEffect != null;
|
|
}
|
|
|
|
- /**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {}
|
|
-
|
|
public String getItemDisplayName(ItemStack par1ItemStack)
|
|
{
|
|
return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(par1ItemStack) + ".name")).trim();
|
|
}
|
|
|
|
- public boolean hasEffect(ItemStack par1ItemStack)
|
|
- {
|
|
- return par1ItemStack.isItemEnchanted();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return an item rarity from EnumRarity
|
|
- */
|
|
- public EnumRarity getRarity(ItemStack par1ItemStack)
|
|
- {
|
|
- return par1ItemStack.isItemEnchanted() ? EnumRarity.rare : EnumRarity.common;
|
|
- }
|
|
-
|
|
/**
|
|
* Checks isDamagable and if it cannot be stacked
|
|
*/
|
|
public boolean isItemTool(ItemStack par1ItemStack)
|
|
{
|
|
--- 509,523 ----
|
|
***************
|
|
*** 603,652 ****
|
|
float var17 = MathHelper.sin(-var5 * 0.017453292F);
|
|
float var18 = var15 * var16;
|
|
float var20 = var14 * var16;
|
|
double var21 = 5.0D;
|
|
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
|
! return par1World.rayTraceBlocks_do_do(var13, var23, par3, !par3);
|
|
}
|
|
|
|
/**
|
|
* Return the enchantability factor of the item, most of the time is based on material.
|
|
*/
|
|
public int getItemEnchantability()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
- public boolean requiresMultipleRenderPasses()
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value and the given render pass
|
|
- */
|
|
- public Icon getIconFromDamageForRenderPass(int par1, int par2)
|
|
- {
|
|
- return this.getIconFromDamage(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- }
|
|
-
|
|
- /**
|
|
- * gets the CreativeTab this item is displayed on
|
|
- */
|
|
- public CreativeTabs getCreativeTab()
|
|
- {
|
|
- return this.tabToDisplayOn;
|
|
- }
|
|
-
|
|
/**
|
|
* returns this;
|
|
*/
|
|
public Item setCreativeTab(CreativeTabs par1CreativeTabs)
|
|
{
|
|
--- 539,559 ----
|
|
float var17 = MathHelper.sin(-var5 * 0.017453292F);
|
|
float var18 = var15 * var16;
|
|
float var20 = var14 * var16;
|
|
double var21 = 5.0D;
|
|
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
|
! return par1World.rayTraceBlocks(var13, var23, par3, !par3);
|
|
}
|
|
|
|
/**
|
|
* Return the enchantability factor of the item, most of the time is based on material.
|
|
*/
|
|
public int getItemEnchantability()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
* returns this;
|
|
*/
|
|
public Item setCreativeTab(CreativeTabs par1CreativeTabs)
|
|
{
|
|
***************
|
|
*** 669,683 ****
|
|
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.itemIcon = par1IconRegister.registerIcon(this.getIconString());
|
|
- }
|
|
-
|
|
/**
|
|
* Gets a map of item attribute modifiers, used by ItemSword to increase hit damage.
|
|
*/
|
|
public Multimap getItemAttributeModifiers()
|
|
{
|
|
--- 576,585 ----
|
|
***************
|
|
*** 686,703 ****
|
|
|
|
protected Item setTextureName(String par1Str)
|
|
{
|
|
this.iconString = par1Str;
|
|
return this;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the string associated with this Item's Icon.
|
|
- */
|
|
- protected String getIconString()
|
|
- {
|
|
- return this.iconString == null ? "MISSING_ICON_ITEM_" + this.itemID + "_" + this.unlocalizedName : this.iconString;
|
|
}
|
|
|
|
static
|
|
{
|
|
StatList.initStats();
|
|
--- 588,597 ----
|
|
*** ItemAppleGold.java Sat Feb 5 04:19:42 2022
|
|
--- ItemAppleGold.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,30 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemAppleGold extends ItemFood
|
|
{
|
|
public ItemAppleGold(int par1, int par2, float par3, boolean par4)
|
|
{
|
|
super(par1, par2, par3, par4);
|
|
this.setHasSubtypes(true);
|
|
}
|
|
|
|
- public boolean hasEffect(ItemStack par1ItemStack)
|
|
- {
|
|
- return par1ItemStack.getItemDamage() > 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return an item rarity from EnumRarity
|
|
- */
|
|
- public EnumRarity getRarity(ItemStack par1ItemStack)
|
|
- {
|
|
- return par1ItemStack.getItemDamage() == 0 ? EnumRarity.rare : EnumRarity.epic;
|
|
- }
|
|
-
|
|
protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
if (!par2World.isRemote)
|
|
{
|
|
par3EntityPlayer.addPotionEffect(new PotionEffect(Potion.field_76444_x.id, 2400, 0));
|
|
--- 1,15 ----
|
|
***************
|
|
*** 41,56 ****
|
|
}
|
|
else
|
|
{
|
|
super.onFoodEaten(par1ItemStack, par2World, par3EntityPlayer);
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
}
|
|
}
|
|
--- 26,32 ----
|
|
*** ItemArmor.java Sat Feb 5 04:19:42 2022
|
|
--- ItemArmor.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 22,33 ****
|
|
*/
|
|
public final int renderIndex;
|
|
|
|
/** The EnumArmorMaterial used for this ItemArmor */
|
|
private final EnumArmorMaterial material;
|
|
- private Icon field_94605_cw;
|
|
- private Icon field_94604_cx;
|
|
|
|
public ItemArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4)
|
|
{
|
|
super(par1);
|
|
this.material = par2EnumArmorMaterial;
|
|
--- 22,31 ----
|
|
***************
|
|
*** 38,71 ****
|
|
this.maxStackSize = 1;
|
|
this.setCreativeTab(CreativeTabs.tabCombat);
|
|
BlockDispenser.dispenseBehaviorRegistry.putObject(this, field_96605_cw);
|
|
}
|
|
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- if (par2 > 0)
|
|
- {
|
|
- return 16777215;
|
|
- }
|
|
- else
|
|
- {
|
|
- int var3 = this.getColor(par1ItemStack);
|
|
-
|
|
- if (var3 < 0)
|
|
- {
|
|
- var3 = 16777215;
|
|
- }
|
|
-
|
|
- return var3;
|
|
- }
|
|
- }
|
|
-
|
|
- public boolean requiresMultipleRenderPasses()
|
|
- {
|
|
- return this.material == EnumArmorMaterial.CLOTH;
|
|
- }
|
|
-
|
|
/**
|
|
* Return the enchantability factor of the item, most of the time is based on material.
|
|
*/
|
|
public int getItemEnchantability()
|
|
{
|
|
--- 36,45 ----
|
|
***************
|
|
*** 112,129 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value and the given render pass
|
|
- */
|
|
- public Icon getIconFromDamageForRenderPass(int par1, int par2)
|
|
- {
|
|
- return par2 == 1 ? this.field_94605_cw : super.getIconFromDamageForRenderPass(par1, par2);
|
|
- }
|
|
-
|
|
- /**
|
|
* Remove the color from the specified armor ItemStack.
|
|
*/
|
|
public void removeColor(ItemStack par1ItemStack)
|
|
{
|
|
if (this.material == EnumArmorMaterial.CLOTH)
|
|
--- 86,95 ----
|
|
***************
|
|
*** 175,196 ****
|
|
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
|
|
{
|
|
return this.material.getArmorCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
|
|
}
|
|
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
-
|
|
- if (this.material == EnumArmorMaterial.CLOTH)
|
|
- {
|
|
- this.field_94605_cw = par1IconRegister.registerIcon(field_94606_cu[this.armorType]);
|
|
- }
|
|
-
|
|
- this.field_94604_cx = par1IconRegister.registerIcon(field_94603_a[this.armorType]);
|
|
- }
|
|
-
|
|
/**
|
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
|
*/
|
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
--- 141,150 ----
|
|
***************
|
|
*** 202,232 ****
|
|
par3EntityPlayer.setCurrentItemOrArmor(var4, par1ItemStack.copy());
|
|
par1ItemStack.stackSize = 0;
|
|
}
|
|
|
|
return par1ItemStack;
|
|
- }
|
|
-
|
|
- public static Icon func_94602_b(int par0)
|
|
- {
|
|
- switch (par0)
|
|
- {
|
|
- case 0:
|
|
- return Item.helmetDiamond.field_94604_cx;
|
|
-
|
|
- case 1:
|
|
- return Item.plateDiamond.field_94604_cx;
|
|
-
|
|
- case 2:
|
|
- return Item.legsDiamond.field_94604_cx;
|
|
-
|
|
- case 3:
|
|
- return Item.bootsDiamond.field_94604_cx;
|
|
-
|
|
- default:
|
|
- return null;
|
|
- }
|
|
}
|
|
|
|
/**
|
|
* Returns the 'max damage' factor array for the armor, each piece of armor have a durability factor (that gets
|
|
* multiplied by armor material factor)
|
|
--- 156,165 ----
|
|
*** ItemBlock.java Sat Feb 5 04:19:42 2022
|
|
--- ItemBlock.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,14 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemBlock extends Item
|
|
{
|
|
/** The block ID of the Block associated with this ItemBlock */
|
|
private int blockID;
|
|
- private Icon field_94588_b;
|
|
|
|
public ItemBlock(int par1)
|
|
{
|
|
super(par1);
|
|
this.blockID = par1 + 256;
|
|
--- 1,11 ----
|
|
***************
|
|
*** 21,46 ****
|
|
{
|
|
return this.blockID;
|
|
}
|
|
|
|
/**
|
|
- * Returns 0 for /terrain.png, 1 for /gui/items.png
|
|
- */
|
|
- public int getSpriteNumber()
|
|
- {
|
|
- return Block.blocksList[this.blockID].getItemIconName() != null ? 1 : 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return this.field_94588_b != null ? this.field_94588_b : Block.blocksList[this.blockID].getBlockTextureFromSide(1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
|
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
|
*/
|
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
{
|
|
--- 18,27 ----
|
|
***************
|
|
*** 120,176 ****
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Returns true if the given ItemBlock can be placed on the given side of the given block position.
|
|
- */
|
|
- public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack)
|
|
- {
|
|
- int var8 = par1World.getBlockId(par2, par3, par4);
|
|
-
|
|
- if (var8 == Block.snow.blockID)
|
|
- {
|
|
- par5 = 1;
|
|
- }
|
|
- else if (var8 != Block.vine.blockID && var8 != Block.tallGrass.blockID && var8 != Block.deadBush.blockID)
|
|
- {
|
|
- if (par5 == 0)
|
|
- {
|
|
- --par3;
|
|
- }
|
|
-
|
|
- if (par5 == 1)
|
|
- {
|
|
- ++par3;
|
|
- }
|
|
-
|
|
- if (par5 == 2)
|
|
- {
|
|
- --par4;
|
|
- }
|
|
-
|
|
- if (par5 == 3)
|
|
- {
|
|
- ++par4;
|
|
- }
|
|
-
|
|
- if (par5 == 4)
|
|
- {
|
|
- --par2;
|
|
- }
|
|
-
|
|
- if (par5 == 5)
|
|
- {
|
|
- ++par2;
|
|
- }
|
|
- }
|
|
-
|
|
- return par1World.canPlaceEntityOnSide(this.getBlockID(), par2, par3, par4, false, par5, (Entity)null, par7ItemStack);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
|
|
* different names based on their damage or NBT.
|
|
*/
|
|
public String getUnlocalizedName(ItemStack par1ItemStack)
|
|
{
|
|
--- 101,110 ----
|
|
***************
|
|
*** 181,213 ****
|
|
* Returns the unlocalized name of this item.
|
|
*/
|
|
public String getUnlocalizedName()
|
|
{
|
|
return Block.blocksList[this.blockID].getUnlocalizedName();
|
|
- }
|
|
-
|
|
- /**
|
|
- * gets the CreativeTab this item is displayed on
|
|
- */
|
|
- public CreativeTabs getCreativeTab()
|
|
- {
|
|
- return Block.blocksList[this.blockID].getCreativeTabToDisplayOn();
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- Block.blocksList[this.blockID].getSubBlocks(par1, par2CreativeTabs, par3List);
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- String var2 = Block.blocksList[this.blockID].getItemIconName();
|
|
-
|
|
- if (var2 != null)
|
|
- {
|
|
- this.field_94588_b = par1IconRegister.registerIcon(var2);
|
|
- }
|
|
}
|
|
}
|
|
--- 115,121 ----
|
|
*** ItemBlockWithMetadata.java Sat Feb 5 04:19:42 2022
|
|
--- ItemBlockWithMetadata.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 11,28 ****
|
|
this.setMaxDamage(0);
|
|
this.setHasSubtypes(true);
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return this.theBlock.getIcon(2, par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the metadata of the block which this Item (ItemBlock) can place
|
|
*/
|
|
public int getMetadata(int par1)
|
|
{
|
|
return par1;
|
|
--- 11,20 ----
|
|
*** ItemBoat.java Sat Feb 5 04:19:42 2022
|
|
--- ItemBoat.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 29,39 ****
|
|
float var17 = MathHelper.sin(-var5 * 0.017453292F);
|
|
float var18 = var15 * var16;
|
|
float var20 = var14 * var16;
|
|
double var21 = 5.0D;
|
|
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
|
! MovingObjectPosition var24 = par2World.clip(var13, var23, true);
|
|
|
|
if (var24 == null)
|
|
{
|
|
return par1ItemStack;
|
|
}
|
|
--- 29,39 ----
|
|
float var17 = MathHelper.sin(-var5 * 0.017453292F);
|
|
float var18 = var15 * var16;
|
|
float var20 = var14 * var16;
|
|
double var21 = 5.0D;
|
|
Vec3 var23 = var13.addVector((double)var18 * var21, (double)var17 * var21, (double)var20 * var21);
|
|
! MovingObjectPosition var24 = par2World.rayTraceBlocks(var13, var23, true);
|
|
|
|
if (var24 == null)
|
|
{
|
|
return par1ItemStack;
|
|
}
|
|
*** ItemBow.java Sat Feb 5 04:19:42 2022
|
|
--- ItemBow.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,11 ****
|
|
package net.minecraft.src;
|
|
|
|
public class ItemBow extends Item
|
|
{
|
|
public static final String[] bowPullIconNameArray = new String[] {"pulling_0", "pulling_1", "pulling_2"};
|
|
- private Icon[] iconArray;
|
|
|
|
public ItemBow(int par1)
|
|
{
|
|
super(par1);
|
|
this.maxStackSize = 1;
|
|
--- 1,10 ----
|
|
***************
|
|
*** 119,144 ****
|
|
* Return the enchantability factor of the item, most of the time is based on material.
|
|
*/
|
|
public int getItemEnchantability()
|
|
{
|
|
return 1;
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_standby");
|
|
- this.iconArray = new Icon[bowPullIconNameArray.length];
|
|
-
|
|
- for (int var2 = 0; var2 < this.iconArray.length; ++var2)
|
|
- {
|
|
- this.iconArray[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + bowPullIconNameArray[var2]);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * used to cycle through icons based on their used duration, i.e. for the bow
|
|
- */
|
|
- public Icon getItemIconForUseDuration(int par1)
|
|
- {
|
|
- return this.iconArray[par1];
|
|
}
|
|
}
|
|
--- 118,124 ----
|
|
*** ItemCarrotOnAStick.java Sat Feb 5 04:19:42 2022
|
|
--- ItemCarrotOnAStick.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 9,35 ****
|
|
this.setMaxStackSize(1);
|
|
this.setMaxDamage(25);
|
|
}
|
|
|
|
/**
|
|
- * Returns True is the item is renderer in full 3D when hold.
|
|
- */
|
|
- public boolean isFull3D()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
|
|
- * hands.
|
|
- */
|
|
- public boolean shouldRotateAroundWhenRendering()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
|
*/
|
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
if (par3EntityPlayer.isRiding() && par3EntityPlayer.ridingEntity instanceof EntityPig)
|
|
--- 9,18 ----
|
|
*** ItemCloth.java Sat Feb 5 04:19:42 2022
|
|
--- ItemCloth.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 8,25 ****
|
|
this.setMaxDamage(0);
|
|
this.setHasSubtypes(true);
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return Block.cloth.getIcon(2, BlockColored.getBlockFromDye(par1));
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the metadata of the block which this Item (ItemBlock) can place
|
|
*/
|
|
public int getMetadata(int par1)
|
|
{
|
|
return par1;
|
|
--- 8,17 ----
|
|
*** ItemCoal.java Sat Feb 5 04:19:42 2022
|
|
--- ItemCoal.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,13 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemCoal extends Item
|
|
{
|
|
- private Icon field_111220_a;
|
|
-
|
|
public ItemCoal(int par1)
|
|
{
|
|
super(par1);
|
|
this.setHasSubtypes(true);
|
|
this.setMaxDamage(0);
|
|
--- 1,9 ----
|
|
***************
|
|
*** 19,48 ****
|
|
* different names based on their damage or NBT.
|
|
*/
|
|
public String getUnlocalizedName(ItemStack par1ItemStack)
|
|
{
|
|
return par1ItemStack.getItemDamage() == 1 ? "item.charcoal" : "item.coal";
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, 0));
|
|
- par3List.add(new ItemStack(par1, 1, 1));
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return par1 == 1 ? this.field_111220_a : super.getIconFromDamage(par1);
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
- this.field_111220_a = par1IconRegister.registerIcon("charcoal");
|
|
}
|
|
}
|
|
--- 15,21 ----
|
|
*** ItemColored.java Sat Feb 5 04:19:42 2022
|
|
--- ItemColored.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 15,37 ****
|
|
this.setMaxDamage(0);
|
|
this.setHasSubtypes(true);
|
|
}
|
|
}
|
|
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- return this.blockRef.getRenderColor(par1ItemStack.getItemDamage());
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return this.blockRef.getIcon(0, par1);
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the metadata of the block which this Item (ItemBlock) can place
|
|
*/
|
|
public int getMetadata(int par1)
|
|
{
|
|
--- 15,24 ----
|
|
*** ItemDye.java Sat Feb 5 04:19:42 2022
|
|
--- ItemDye.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,35 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemDye extends Item
|
|
{
|
|
/** List of dye color names */
|
|
public static final String[] dyeColorNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "lightBlue", "magenta", "orange", "white"};
|
|
public static final String[] dyeItemNames = new String[] {"black", "red", "green", "brown", "blue", "purple", "cyan", "silver", "gray", "pink", "lime", "yellow", "light_blue", "magenta", "orange", "white"};
|
|
public static final int[] dyeColors = new int[] {1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320};
|
|
- private Icon[] dyeIcons;
|
|
|
|
public ItemDye(int par1)
|
|
{
|
|
super(par1);
|
|
this.setHasSubtypes(true);
|
|
this.setMaxDamage(0);
|
|
this.setCreativeTab(CreativeTabs.tabMaterials);
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- int var2 = MathHelper.clamp_int(par1, 0, 15);
|
|
- return this.dyeIcons[var2];
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
|
|
* different names based on their damage or NBT.
|
|
*/
|
|
public String getUnlocalizedName(ItemStack par1ItemStack)
|
|
{
|
|
--- 1,23 ----
|
|
***************
|
|
*** 175,185 ****
|
|
else
|
|
{
|
|
if (!par1World.isRemote)
|
|
{
|
|
++var8;
|
|
! par1World.setBlockMetadataWithNotify(par2, par3, par4, var8 << 2 | var7, 2);
|
|
--par0ItemStack.stackSize;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
--- 163,173 ----
|
|
else
|
|
{
|
|
if (!par1World.isRemote)
|
|
{
|
|
++var8;
|
|
! par1World.setBlockMetadata(par2, par3, par4, var8 << 2 | var7, 2);
|
|
--par0ItemStack.stackSize;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
***************
|
|
*** 270,304 ****
|
|
|
|
return true;
|
|
}
|
|
}
|
|
|
|
- public static void func_96603_a(World par0World, int par1, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = par0World.getBlockId(par1, par2, par3);
|
|
-
|
|
- if (par4 == 0)
|
|
- {
|
|
- par4 = 15;
|
|
- }
|
|
-
|
|
- Block var6 = var5 > 0 && var5 < Block.blocksList.length ? Block.blocksList[var5] : null;
|
|
-
|
|
- if (var6 != null)
|
|
- {
|
|
- var6.setBlockBoundsBasedOnState(par0World, par1, par2, par3);
|
|
-
|
|
- for (int var7 = 0; var7 < par4; ++var7)
|
|
- {
|
|
- double var8 = itemRand.nextGaussian() * 0.02D;
|
|
- double var10 = itemRand.nextGaussian() * 0.02D;
|
|
- double var12 = itemRand.nextGaussian() * 0.02D;
|
|
- par0World.spawnParticle("happyVillager", (double)((float)par1 + itemRand.nextFloat()), (double)par2 + (double)itemRand.nextFloat() * var6.getBlockBoundsMaxY(), (double)((float)par3 + itemRand.nextFloat()), var8, var10, var12);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Returns true if the item can be used on the given entity, e.g. shears on sheep.
|
|
*/
|
|
public boolean itemInteractionForEntity(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase)
|
|
{
|
|
--- 258,267 ----
|
|
***************
|
|
*** 316,344 ****
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- for (int var4 = 0; var4 < 16; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.dyeIcons = new Icon[dyeItemNames.length];
|
|
-
|
|
- for (int var2 = 0; var2 < dyeItemNames.length; ++var2)
|
|
- {
|
|
- this.dyeIcons[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + dyeItemNames[var2]);
|
|
}
|
|
}
|
|
}
|
|
--- 279,286 ----
|
|
*** ItemEditableBook.java Sat Feb 5 04:19:42 2022
|
|
--- ItemEditableBook.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,9 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemEditableBook extends Item
|
|
{
|
|
public ItemEditableBook(int par1)
|
|
{
|
|
super(par1);
|
|
--- 1,7 ----
|
|
***************
|
|
*** 42,68 ****
|
|
|
|
return super.getItemDisplayName(par1ItemStack);
|
|
}
|
|
|
|
/**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
- {
|
|
- if (par1ItemStack.hasTagCompound())
|
|
- {
|
|
- NBTTagCompound var5 = par1ItemStack.getTagCompound();
|
|
- NBTTagString var6 = (NBTTagString)var5.getTag("author");
|
|
-
|
|
- if (var6 != null)
|
|
- {
|
|
- par3List.add(EnumChatFormatting.GRAY + String.format(StatCollector.translateToLocalFormatted("book.byAuthor", new Object[] {var6.data}), new Object[0]));
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
|
*/
|
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
par3EntityPlayer.displayGUIBook(par1ItemStack);
|
|
--- 40,49 ----
|
|
***************
|
|
*** 71,84 ****
|
|
|
|
/**
|
|
* If this function returns true (or the item is damageable), the ItemStack's NBT tag will be sent to the client.
|
|
*/
|
|
public boolean getShareTag()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- public boolean hasEffect(ItemStack par1ItemStack)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
--- 52,60 ----
|
|
*** ItemEnchantedBook.java Sat Feb 5 04:19:42 2022
|
|
--- ItemEnchantedBook.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,67 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class ItemEnchantedBook extends Item
|
|
{
|
|
public ItemEnchantedBook(int par1)
|
|
{
|
|
super(par1);
|
|
}
|
|
|
|
- public boolean hasEffect(ItemStack par1ItemStack)
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
/**
|
|
* Checks isDamagable and if it cannot be stacked
|
|
*/
|
|
public boolean isItemTool(ItemStack par1ItemStack)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
- /**
|
|
- * Return an item rarity from EnumRarity
|
|
- */
|
|
- public EnumRarity getRarity(ItemStack par1ItemStack)
|
|
- {
|
|
- return this.func_92110_g(par1ItemStack).tagCount() > 0 ? EnumRarity.uncommon : super.getRarity(par1ItemStack);
|
|
- }
|
|
-
|
|
public NBTTagList func_92110_g(ItemStack par1ItemStack)
|
|
{
|
|
return par1ItemStack.stackTagCompound != null && par1ItemStack.stackTagCompound.hasKey("StoredEnchantments") ? (NBTTagList)par1ItemStack.stackTagCompound.getTag("StoredEnchantments") : new NBTTagList();
|
|
}
|
|
|
|
/**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
- {
|
|
- super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
|
- NBTTagList var5 = this.func_92110_g(par1ItemStack);
|
|
-
|
|
- if (var5 != null)
|
|
- {
|
|
- for (int var6 = 0; var6 < var5.tagCount(); ++var6)
|
|
- {
|
|
- short var7 = ((NBTTagCompound)var5.tagAt(var6)).getShort("id");
|
|
- short var8 = ((NBTTagCompound)var5.tagAt(var6)).getShort("lvl");
|
|
-
|
|
- if (Enchantment.enchantmentsList[var7] != null)
|
|
- {
|
|
- par3List.add(Enchantment.enchantmentsList[var7].getTranslatedName(var8));
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Adds an stored enchantment to an enchanted book ItemStack
|
|
*/
|
|
public void addEnchantment(ItemStack par1ItemStack, EnchantmentData par2EnchantmentData)
|
|
{
|
|
NBTTagList var3 = this.func_92110_g(par1ItemStack);
|
|
--- 1,30 ----
|
|
***************
|
|
*** 105,122 ****
|
|
public ItemStack getEnchantedItemStack(EnchantmentData par1EnchantmentData)
|
|
{
|
|
ItemStack var2 = new ItemStack(this);
|
|
this.addEnchantment(var2, par1EnchantmentData);
|
|
return var2;
|
|
- }
|
|
-
|
|
- public void func_92113_a(Enchantment par1Enchantment, List par2List)
|
|
- {
|
|
- for (int var3 = par1Enchantment.getMinLevel(); var3 <= par1Enchantment.getMaxLevel(); ++var3)
|
|
- {
|
|
- par2List.add(this.getEnchantedItemStack(new EnchantmentData(par1Enchantment, var3)));
|
|
- }
|
|
}
|
|
|
|
public WeightedRandomChestContent func_92114_b(Random par1Random)
|
|
{
|
|
return this.func_92112_a(par1Random, 1, 1, 1);
|
|
--- 68,77 ----
|
|
*** ItemEnderEye.java Sat Feb 5 04:19:42 2022
|
|
--- ItemEnderEye.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 23,33 ****
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
! par3World.setBlockMetadataWithNotify(par4, par5, par6, var12 + 4, 2);
|
|
par3World.func_96440_m(par4, par5, par6, Block.endPortalFrame.blockID);
|
|
--par1ItemStack.stackSize;
|
|
int var13;
|
|
|
|
for (var13 = 0; var13 < 16; ++var13)
|
|
--- 23,33 ----
|
|
{
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
! par3World.setBlockMetadata(par4, par5, par6, var12 + 4, 2);
|
|
par3World.func_96440_m(par4, par5, par6, Block.endPortalFrame.blockID);
|
|
--par1ItemStack.stackSize;
|
|
int var13;
|
|
|
|
for (var13 = 0; var13 < 16; ++var13)
|
|
***************
|
|
*** 44,54 ****
|
|
var13 = var12 & 3;
|
|
int var26 = 0;
|
|
int var15 = 0;
|
|
boolean var27 = false;
|
|
boolean var17 = true;
|
|
! int var28 = Direction.rotateRight[var13];
|
|
int var19;
|
|
int var21;
|
|
int var23;
|
|
int var29;
|
|
int var30;
|
|
--- 44,54 ----
|
|
var13 = var12 & 3;
|
|
int var26 = 0;
|
|
int var15 = 0;
|
|
boolean var27 = false;
|
|
boolean var17 = true;
|
|
! int var28 = Direction.enderEyeMetaToDirection[var13];
|
|
int var19;
|
|
int var21;
|
|
int var23;
|
|
int var29;
|
|
int var30;
|
|
*** ItemExpBottle.java Sat Feb 5 04:19:42 2022
|
|
--- ItemExpBottle.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 6,20 ****
|
|
{
|
|
super(par1);
|
|
this.setCreativeTab(CreativeTabs.tabMisc);
|
|
}
|
|
|
|
- public boolean hasEffect(ItemStack par1ItemStack)
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
/**
|
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
|
*/
|
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
--- 6,15 ----
|
|
*** ItemFirework.java Sat Feb 5 04:19:42 2022
|
|
--- ItemFirework.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,10 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.ArrayList;
|
|
- import java.util.List;
|
|
-
|
|
public class ItemFirework extends Item
|
|
{
|
|
public ItemFirework(int par1)
|
|
{
|
|
super(par1);
|
|
--- 1,7 ----
|
|
***************
|
|
*** 29,77 ****
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
- {
|
|
- if (par1ItemStack.hasTagCompound())
|
|
- {
|
|
- NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Fireworks");
|
|
-
|
|
- if (var5 != null)
|
|
- {
|
|
- if (var5.hasKey("Flight"))
|
|
- {
|
|
- par3List.add(StatCollector.translateToLocal("item.fireworks.flight") + " " + var5.getByte("Flight"));
|
|
- }
|
|
-
|
|
- NBTTagList var6 = var5.getTagList("Explosions");
|
|
-
|
|
- if (var6 != null && var6.tagCount() > 0)
|
|
- {
|
|
- for (int var7 = 0; var7 < var6.tagCount(); ++var7)
|
|
- {
|
|
- NBTTagCompound var8 = (NBTTagCompound)var6.tagAt(var7);
|
|
- ArrayList var9 = new ArrayList();
|
|
- ItemFireworkCharge.func_92107_a(var8, var9);
|
|
-
|
|
- if (var9.size() > 0)
|
|
- {
|
|
- for (int var10 = 1; var10 < var9.size(); ++var10)
|
|
- {
|
|
- var9.set(var10, " " + (String)var9.get(var10));
|
|
- }
|
|
-
|
|
- par3List.addAll(var9);
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
}
|
|
}
|
|
}
|
|
--- 26,33 ----
|
|
*** ItemFireworkCharge.java Sat Feb 5 04:19:42 2022
|
|
--- ItemFireworkCharge.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,221 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemFireworkCharge extends Item
|
|
{
|
|
- private Icon theIcon;
|
|
-
|
|
public ItemFireworkCharge(int par1)
|
|
{
|
|
super(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value and the given render pass
|
|
- */
|
|
- public Icon getIconFromDamageForRenderPass(int par1, int par2)
|
|
- {
|
|
- return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2);
|
|
- }
|
|
-
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- if (par2 != 1)
|
|
- {
|
|
- return super.getColorFromItemStack(par1ItemStack, par2);
|
|
- }
|
|
- else
|
|
- {
|
|
- NBTBase var3 = func_92108_a(par1ItemStack, "Colors");
|
|
-
|
|
- if (var3 == null)
|
|
- {
|
|
- return 9079434;
|
|
- }
|
|
- else
|
|
- {
|
|
- NBTTagIntArray var4 = (NBTTagIntArray)var3;
|
|
-
|
|
- if (var4.intArray.length == 1)
|
|
- {
|
|
- return var4.intArray[0];
|
|
- }
|
|
- else
|
|
- {
|
|
- int var5 = 0;
|
|
- int var6 = 0;
|
|
- int var7 = 0;
|
|
- int[] var8 = var4.intArray;
|
|
- int var9 = var8.length;
|
|
-
|
|
- for (int var10 = 0; var10 < var9; ++var10)
|
|
- {
|
|
- int var11 = var8[var10];
|
|
- var5 += (var11 & 16711680) >> 16;
|
|
- var6 += (var11 & 65280) >> 8;
|
|
- var7 += (var11 & 255) >> 0;
|
|
- }
|
|
-
|
|
- var5 /= var4.intArray.length;
|
|
- var6 /= var4.intArray.length;
|
|
- var7 /= var4.intArray.length;
|
|
- return var5 << 16 | var6 << 8 | var7;
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- public boolean requiresMultipleRenderPasses()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- public static NBTBase func_92108_a(ItemStack par0ItemStack, String par1Str)
|
|
- {
|
|
- if (par0ItemStack.hasTagCompound())
|
|
- {
|
|
- NBTTagCompound var2 = par0ItemStack.getTagCompound().getCompoundTag("Explosion");
|
|
-
|
|
- if (var2 != null)
|
|
- {
|
|
- return var2.getTag(par1Str);
|
|
- }
|
|
- }
|
|
-
|
|
- return null;
|
|
- }
|
|
-
|
|
- /**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
- {
|
|
- if (par1ItemStack.hasTagCompound())
|
|
- {
|
|
- NBTTagCompound var5 = par1ItemStack.getTagCompound().getCompoundTag("Explosion");
|
|
-
|
|
- if (var5 != null)
|
|
- {
|
|
- func_92107_a(var5, par3List);
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- public static void func_92107_a(NBTTagCompound par0NBTTagCompound, List par1List)
|
|
- {
|
|
- byte var2 = par0NBTTagCompound.getByte("Type");
|
|
-
|
|
- if (var2 >= 0 && var2 <= 4)
|
|
- {
|
|
- par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type." + var2).trim());
|
|
- }
|
|
- else
|
|
- {
|
|
- par1List.add(StatCollector.translateToLocal("item.fireworksCharge.type").trim());
|
|
- }
|
|
-
|
|
- int[] var3 = par0NBTTagCompound.getIntArray("Colors");
|
|
- int var8;
|
|
- int var9;
|
|
-
|
|
- if (var3.length > 0)
|
|
- {
|
|
- boolean var4 = true;
|
|
- String var5 = "";
|
|
- int[] var6 = var3;
|
|
- int var7 = var3.length;
|
|
-
|
|
- for (var8 = 0; var8 < var7; ++var8)
|
|
- {
|
|
- var9 = var6[var8];
|
|
-
|
|
- if (!var4)
|
|
- {
|
|
- var5 = var5 + ", ";
|
|
- }
|
|
-
|
|
- var4 = false;
|
|
- boolean var10 = false;
|
|
-
|
|
- for (int var11 = 0; var11 < 16; ++var11)
|
|
- {
|
|
- if (var9 == ItemDye.dyeColors[var11])
|
|
- {
|
|
- var10 = true;
|
|
- var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var11]);
|
|
- break;
|
|
- }
|
|
- }
|
|
-
|
|
- if (!var10)
|
|
- {
|
|
- var5 = var5 + StatCollector.translateToLocal("item.fireworksCharge.customColor");
|
|
- }
|
|
- }
|
|
-
|
|
- par1List.add(var5);
|
|
- }
|
|
-
|
|
- int[] var13 = par0NBTTagCompound.getIntArray("FadeColors");
|
|
- boolean var15;
|
|
-
|
|
- if (var13.length > 0)
|
|
- {
|
|
- var15 = true;
|
|
- String var14 = StatCollector.translateToLocal("item.fireworksCharge.fadeTo") + " ";
|
|
- int[] var16 = var13;
|
|
- var8 = var13.length;
|
|
-
|
|
- for (var9 = 0; var9 < var8; ++var9)
|
|
- {
|
|
- int var18 = var16[var9];
|
|
-
|
|
- if (!var15)
|
|
- {
|
|
- var14 = var14 + ", ";
|
|
- }
|
|
-
|
|
- var15 = false;
|
|
- boolean var19 = false;
|
|
-
|
|
- for (int var12 = 0; var12 < 16; ++var12)
|
|
- {
|
|
- if (var18 == ItemDye.dyeColors[var12])
|
|
- {
|
|
- var19 = true;
|
|
- var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge." + ItemDye.dyeColorNames[var12]);
|
|
- break;
|
|
- }
|
|
- }
|
|
-
|
|
- if (!var19)
|
|
- {
|
|
- var14 = var14 + StatCollector.translateToLocal("item.fireworksCharge.customColor");
|
|
- }
|
|
- }
|
|
-
|
|
- par1List.add(var14);
|
|
- }
|
|
-
|
|
- var15 = par0NBTTagCompound.getBoolean("Trail");
|
|
-
|
|
- if (var15)
|
|
- {
|
|
- par1List.add(StatCollector.translateToLocal("item.fireworksCharge.trail"));
|
|
- }
|
|
-
|
|
- boolean var17 = par0NBTTagCompound.getBoolean("Flicker");
|
|
-
|
|
- if (var17)
|
|
- {
|
|
- par1List.add(StatCollector.translateToLocal("item.fireworksCharge.flicker"));
|
|
- }
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay");
|
|
}
|
|
}
|
|
--- 1,9 ----
|
|
*** ItemFishingRod.java Sat Feb 5 04:19:42 2022
|
|
--- ItemFishingRod.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,37 ****
|
|
package net.minecraft.src;
|
|
|
|
public class ItemFishingRod extends Item
|
|
{
|
|
- private Icon theIcon;
|
|
-
|
|
public ItemFishingRod(int par1)
|
|
{
|
|
super(par1);
|
|
this.setMaxDamage(64);
|
|
this.setMaxStackSize(1);
|
|
this.setCreativeTab(CreativeTabs.tabTools);
|
|
}
|
|
|
|
/**
|
|
- * Returns True is the item is renderer in full 3D when hold.
|
|
- */
|
|
- public boolean isFull3D()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if this item should be rotated by 180 degrees around the Y axis when being held in an entities
|
|
- * hands.
|
|
- */
|
|
- public boolean shouldRotateAroundWhenRendering()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
|
*/
|
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
if (par3EntityPlayer.fishEntity != null)
|
|
--- 1,18 ----
|
|
***************
|
|
*** 51,68 ****
|
|
|
|
par3EntityPlayer.swingItem();
|
|
}
|
|
|
|
return par1ItemStack;
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.itemIcon = par1IconRegister.registerIcon(this.getIconString() + "_uncast");
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_cast");
|
|
- }
|
|
-
|
|
- public Icon func_94597_g()
|
|
- {
|
|
- return this.theIcon;
|
|
}
|
|
}
|
|
--- 32,38 ----
|
|
*** ItemGlassBottle.java Sat Feb 5 04:19:42 2022
|
|
--- ItemGlassBottle.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 7,24 ****
|
|
super(par1);
|
|
this.setCreativeTab(CreativeTabs.tabBrewing);
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return Item.potion.getIconFromDamage(0);
|
|
- }
|
|
-
|
|
- /**
|
|
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
|
|
*/
|
|
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
MovingObjectPosition var4 = this.getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, true);
|
|
--- 7,16 ----
|
|
***************
|
|
*** 62,69 ****
|
|
}
|
|
|
|
return par1ItemStack;
|
|
}
|
|
}
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister) {}
|
|
}
|
|
--- 54,59 ----
|
|
*** ItemHoe.java Sat Feb 5 04:19:42 2022
|
|
--- ItemHoe.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 50,67 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Returns True is the item is renderer in full 3D when hold.
|
|
- */
|
|
- public boolean isFull3D()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the name of the material this tool is made from as it is declared in EnumToolMaterial (meaning diamond
|
|
* would return "EMERALD")
|
|
*/
|
|
public String getMaterialName()
|
|
{
|
|
--- 50,59 ----
|
|
*** ItemInWorldManager.java Sat Feb 5 04:19:42 2022
|
|
--- ItemInWorldManager.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 10,22 ****
|
|
private EnumGameType gameType;
|
|
|
|
/** True if the player is destroying a block */
|
|
private boolean isDestroyingBlock;
|
|
private int initialDamage;
|
|
! private int partiallyDestroyedBlockX;
|
|
! private int partiallyDestroyedBlockY;
|
|
! private int partiallyDestroyedBlockZ;
|
|
private int curblockDamage;
|
|
|
|
/**
|
|
* Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The
|
|
* block will not be destroyed while this is false.
|
|
--- 10,22 ----
|
|
private EnumGameType gameType;
|
|
|
|
/** True if the player is destroying a block */
|
|
private boolean isDestroyingBlock;
|
|
private int initialDamage;
|
|
! private int curBlockX;
|
|
! private int curBlockY;
|
|
! private int curBlockZ;
|
|
private int curblockDamage;
|
|
|
|
/**
|
|
* Set to true when the "finished destroying block" packet is received but the block wasn't fully damaged yet. The
|
|
* block will not be destroyed while this is false.
|
|
***************
|
|
*** 103,130 ****
|
|
}
|
|
}
|
|
}
|
|
else if (this.isDestroyingBlock)
|
|
{
|
|
! var1 = this.theWorld.getBlockId(this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ);
|
|
Block var6 = Block.blocksList[var1];
|
|
|
|
if (var6 == null)
|
|
{
|
|
! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1);
|
|
this.durabilityRemainingOnBlock = -1;
|
|
this.isDestroyingBlock = false;
|
|
}
|
|
else
|
|
{
|
|
int var7 = this.curblockDamage - this.initialDamage;
|
|
! var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ) * (float)(var7 + 1);
|
|
var5 = (int)(var4 * 10.0F);
|
|
|
|
if (var5 != this.durabilityRemainingOnBlock)
|
|
{
|
|
! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, var5);
|
|
this.durabilityRemainingOnBlock = var5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--- 103,130 ----
|
|
}
|
|
}
|
|
}
|
|
else if (this.isDestroyingBlock)
|
|
{
|
|
! var1 = this.theWorld.getBlockId(this.curBlockX, this.curBlockY, this.curBlockZ);
|
|
Block var6 = Block.blocksList[var1];
|
|
|
|
if (var6 == null)
|
|
{
|
|
! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1);
|
|
this.durabilityRemainingOnBlock = -1;
|
|
this.isDestroyingBlock = false;
|
|
}
|
|
else
|
|
{
|
|
int var7 = this.curblockDamage - this.initialDamage;
|
|
! var4 = var6.getPlayerRelativeBlockHardness(this.thisPlayerMP, this.thisPlayerMP.worldObj, this.curBlockX, this.curBlockY, this.curBlockZ) * (float)(var7 + 1);
|
|
var5 = (int)(var4 * 10.0F);
|
|
|
|
if (var5 != this.durabilityRemainingOnBlock)
|
|
{
|
|
! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, var5);
|
|
this.durabilityRemainingOnBlock = var5;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
***************
|
|
*** 162,185 ****
|
|
this.tryHarvestBlock(par1, par2, par3);
|
|
}
|
|
else
|
|
{
|
|
this.isDestroyingBlock = true;
|
|
! this.partiallyDestroyedBlockX = par1;
|
|
! this.partiallyDestroyedBlockY = par2;
|
|
! this.partiallyDestroyedBlockZ = par3;
|
|
int var7 = (int)(var5 * 10.0F);
|
|
this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, var7);
|
|
this.durabilityRemainingOnBlock = var7;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void uncheckedTryHarvestBlock(int par1, int par2, int par3)
|
|
{
|
|
! if (par1 == this.partiallyDestroyedBlockX && par2 == this.partiallyDestroyedBlockY && par3 == this.partiallyDestroyedBlockZ)
|
|
{
|
|
int var4 = this.curblockDamage - this.initialDamage;
|
|
int var5 = this.theWorld.getBlockId(par1, par2, par3);
|
|
|
|
if (var5 != 0)
|
|
--- 162,185 ----
|
|
this.tryHarvestBlock(par1, par2, par3);
|
|
}
|
|
else
|
|
{
|
|
this.isDestroyingBlock = true;
|
|
! this.curBlockX = par1;
|
|
! this.curBlockY = par2;
|
|
! this.curBlockZ = par3;
|
|
int var7 = (int)(var5 * 10.0F);
|
|
this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, par1, par2, par3, var7);
|
|
this.durabilityRemainingOnBlock = var7;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void blockRemoving(int par1, int par2, int par3)
|
|
{
|
|
! if (par1 == this.curBlockX && par2 == this.curBlockY && par3 == this.curBlockZ)
|
|
{
|
|
int var4 = this.curblockDamage - this.initialDamage;
|
|
int var5 = this.theWorld.getBlockId(par1, par2, par3);
|
|
|
|
if (var5 != 0)
|
|
***************
|
|
*** 210,220 ****
|
|
* note: this ignores the pars passed in and continues to destroy the onClickedBlock
|
|
*/
|
|
public void cancelDestroyingBlock(int par1, int par2, int par3)
|
|
{
|
|
this.isDestroyingBlock = false;
|
|
! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.partiallyDestroyedBlockX, this.partiallyDestroyedBlockY, this.partiallyDestroyedBlockZ, -1);
|
|
}
|
|
|
|
/**
|
|
* Removes a block and triggers the appropriate events
|
|
*/
|
|
--- 210,220 ----
|
|
* note: this ignores the pars passed in and continues to destroy the onClickedBlock
|
|
*/
|
|
public void cancelDestroyingBlock(int par1, int par2, int par3)
|
|
{
|
|
this.isDestroyingBlock = false;
|
|
! this.theWorld.destroyBlockInWorldPartially(this.thisPlayerMP.entityId, this.curBlockX, this.curBlockY, this.curBlockZ, -1);
|
|
}
|
|
|
|
/**
|
|
* Removes a block and triggers the appropriate events
|
|
*/
|
|
***************
|
|
*** 258,268 ****
|
|
this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, var4 + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12));
|
|
boolean var6 = this.removeBlock(par1, par2, par3);
|
|
|
|
if (this.isCreative())
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(par1, par2, par3, this.theWorld));
|
|
}
|
|
else
|
|
{
|
|
ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem();
|
|
boolean var8 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[var4]);
|
|
--- 258,268 ----
|
|
this.theWorld.playAuxSFXAtEntity(this.thisPlayerMP, 2001, par1, par2, par3, var4 + (this.theWorld.getBlockMetadata(par1, par2, par3) << 12));
|
|
boolean var6 = this.removeBlock(par1, par2, par3);
|
|
|
|
if (this.isCreative())
|
|
{
|
|
! this.thisPlayerMP.playerNetServerHandler.sendPacket(new Packet53BlockChange(par1, par2, par3, this.theWorld));
|
|
}
|
|
else
|
|
{
|
|
ItemStack var7 = this.thisPlayerMP.getCurrentEquippedItem();
|
|
boolean var8 = this.thisPlayerMP.canHarvestBlock(Block.blocksList[var4]);
|
|
*** ItemLeaves.java Sat Feb 5 04:19:42 2022
|
|
--- ItemLeaves.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 16,39 ****
|
|
{
|
|
return par1 | 4;
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return Block.leaves.getIcon(0, par1);
|
|
- }
|
|
-
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- int var3 = par1ItemStack.getItemDamage();
|
|
- return (var3 & 1) == 1 ? ColorizerFoliage.getFoliageColorPine() : ((var3 & 2) == 2 ? ColorizerFoliage.getFoliageColorBirch() : ColorizerFoliage.getFoliageColorBasic());
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have
|
|
* different names based on their damage or NBT.
|
|
*/
|
|
public String getUnlocalizedName(ItemStack par1ItemStack)
|
|
{
|
|
--- 16,25 ----
|
|
*** ItemLilyPad.java Sat Feb 5 04:19:42 2022
|
|
--- ItemLilyPad.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 48,58 ****
|
|
}
|
|
|
|
return par1ItemStack;
|
|
}
|
|
}
|
|
-
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- return Block.waterlily.getRenderColor(par1ItemStack.getItemDamage());
|
|
- }
|
|
}
|
|
--- 48,53 ----
|
|
*** ItemMap.java Sat Feb 5 04:19:42 2022
|
|
--- ItemMap.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,31 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemMap extends ItemMapBase
|
|
{
|
|
protected ItemMap(int par1)
|
|
{
|
|
super(par1);
|
|
this.setHasSubtypes(true);
|
|
}
|
|
|
|
- public static MapData getMPMapData(short par0, World par1World)
|
|
- {
|
|
- String var2 = "map_" + par0;
|
|
- MapData var3 = (MapData)par1World.loadItemData(MapData.class, var2);
|
|
-
|
|
- if (var3 == null)
|
|
- {
|
|
- var3 = new MapData(var2);
|
|
- par1World.setItemData(var2, var3);
|
|
- }
|
|
-
|
|
- return var3;
|
|
- }
|
|
-
|
|
public MapData getMapData(ItemStack par1ItemStack, World par2World)
|
|
{
|
|
String var3 = "map_" + par1ItemStack.getItemDamage();
|
|
MapData var4 = (MapData)par2World.loadItemData(MapData.class, var3);
|
|
|
|
--- 1,15 ----
|
|
***************
|
|
*** 283,296 ****
|
|
this.updateMapData(par2World, par3Entity, var6);
|
|
}
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * returns null if no update is to be sent
|
|
! */
|
|
! public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
byte[] var4 = this.getMapData(par1ItemStack, par2World).getUpdatePacketData(par1ItemStack, par2World, par3EntityPlayer);
|
|
return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)par1ItemStack.getItemDamage(), var4);
|
|
}
|
|
|
|
--- 267,277 ----
|
|
this.updateMapData(par2World, par3Entity, var6);
|
|
}
|
|
}
|
|
}
|
|
|
|
! public Packet getUpdatePacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
byte[] var4 = this.getMapData(par1ItemStack, par2World).getUpdatePacketData(par1ItemStack, par2World, par3EntityPlayer);
|
|
return var4 == null ? null : new Packet131MapData((short)Item.map.itemID, (short)par1ItemStack.getItemDamage(), var4);
|
|
}
|
|
|
|
***************
|
|
*** 314,342 ****
|
|
var5.xCenter = var4.xCenter;
|
|
var5.zCenter = var4.zCenter;
|
|
var5.dimension = var4.dimension;
|
|
var5.markDirty();
|
|
par2World.setItemData("map_" + par1ItemStack.getItemDamage(), var5);
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
- {
|
|
- MapData var5 = this.getMapData(par1ItemStack, par2EntityPlayer.worldObj);
|
|
-
|
|
- if (par4)
|
|
- {
|
|
- if (var5 == null)
|
|
- {
|
|
- par3List.add("Unknown map");
|
|
- }
|
|
- else
|
|
- {
|
|
- par3List.add("Scaling at 1:" + (1 << var5.scale));
|
|
- par3List.add("(Level " + var5.scale + "/" + 4 + ")");
|
|
- }
|
|
}
|
|
}
|
|
}
|
|
--- 295,302 ----
|
|
*** ItemMapBase.java Sat Feb 5 04:19:42 2022
|
|
--- ItemMapBase.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 13,25 ****
|
|
public boolean isMap()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
! /**
|
|
! * returns null if no update is to be sent
|
|
! */
|
|
! public Packet createMapDataPacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
--- 13,22 ----
|
|
public boolean isMap()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
! public Packet getUpdatePacket(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
*** ItemMonsterPlacer.java Sat Feb 5 04:19:42 2022
|
|
--- ItemMonsterPlacer.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,14 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.Iterator;
|
|
- import java.util.List;
|
|
-
|
|
public class ItemMonsterPlacer extends Item
|
|
{
|
|
- private Icon theIcon;
|
|
-
|
|
public ItemMonsterPlacer(int par1)
|
|
{
|
|
super(par1);
|
|
this.setHasSubtypes(true);
|
|
this.setCreativeTab(CreativeTabs.tabMisc);
|
|
--- 1,9 ----
|
|
***************
|
|
*** 25,53 ****
|
|
}
|
|
|
|
return var2;
|
|
}
|
|
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- EntityEggInfo var3 = (EntityEggInfo)EntityList.entityEggs.get(Integer.valueOf(par1ItemStack.getItemDamage()));
|
|
- return var3 != null ? (par2 == 0 ? var3.primaryColor : var3.secondaryColor) : 16777215;
|
|
- }
|
|
-
|
|
- public boolean requiresMultipleRenderPasses()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value and the given render pass
|
|
- */
|
|
- public Icon getIconFromDamageForRenderPass(int par1, int par2)
|
|
- {
|
|
- return par2 > 0 ? this.theIcon : super.getIconFromDamageForRenderPass(par1, par2);
|
|
- }
|
|
-
|
|
/**
|
|
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
|
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
|
*/
|
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
--- 20,29 ----
|
|
***************
|
|
*** 177,203 ****
|
|
}
|
|
}
|
|
|
|
return var8;
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- Iterator var4 = EntityList.entityEggs.values().iterator();
|
|
-
|
|
- while (var4.hasNext())
|
|
- {
|
|
- EntityEggInfo var5 = (EntityEggInfo)var4.next();
|
|
- par3List.add(new ItemStack(par1, 1, var5.spawnedID));
|
|
- }
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- super.registerIcons(par1IconRegister);
|
|
- this.theIcon = par1IconRegister.registerIcon(this.getIconString() + "_overlay");
|
|
}
|
|
}
|
|
--- 153,159 ----
|
|
*** ItemMultiTextureTile.java Sat Feb 5 04:19:42 2022
|
|
--- ItemMultiTextureTile.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 13,30 ****
|
|
this.setMaxDamage(0);
|
|
this.setHasSubtypes(true);
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return this.theBlock.getIcon(2, par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the metadata of the block which this Item (ItemBlock) can place
|
|
*/
|
|
public int getMetadata(int par1)
|
|
{
|
|
return par1;
|
|
--- 13,22 ----
|
|
*** ItemPotion.java Sat Feb 5 04:19:42 2022
|
|
--- ItemPotion.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,24 ****
|
|
package net.minecraft.src;
|
|
|
|
- import com.google.common.collect.HashMultimap;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
- import java.util.Map.Entry;
|
|
|
|
public class ItemPotion extends Item
|
|
{
|
|
! /** maps potion damage values to lists of effect names */
|
|
private HashMap effectCache = new HashMap();
|
|
private static final Map field_77835_b = new LinkedHashMap();
|
|
- private Icon field_94591_c;
|
|
- private Icon field_94590_d;
|
|
- private Icon field_94592_ct;
|
|
|
|
public ItemPotion(int par1)
|
|
{
|
|
super(par1);
|
|
this.setMaxStackSize(1);
|
|
--- 1,22 ----
|
|
package net.minecraft.src;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class ItemPotion extends Item
|
|
{
|
|
! /**
|
|
! * Contains a map from integers to the list of potion effects that potions with that damage value confer (to prevent
|
|
! * recalculating it).
|
|
! */
|
|
private HashMap effectCache = new HashMap();
|
|
private static final Map field_77835_b = new LinkedHashMap();
|
|
|
|
public ItemPotion(int par1)
|
|
{
|
|
super(par1);
|
|
this.setMaxStackSize(1);
|
|
***************
|
|
*** 163,238 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return isSplash(par1) ? this.field_94591_c : this.field_94590_d;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value and the given render pass
|
|
- */
|
|
- public Icon getIconFromDamageForRenderPass(int par1, int par2)
|
|
- {
|
|
- return par2 == 0 ? this.field_94592_ct : super.getIconFromDamageForRenderPass(par1, par2);
|
|
- }
|
|
-
|
|
- /**
|
|
* returns wether or not a potion is a throwable splash potion based on damage value
|
|
*/
|
|
public static boolean isSplash(int par0)
|
|
{
|
|
return (par0 & 16384) != 0;
|
|
}
|
|
|
|
- public int getColorFromDamage(int par1)
|
|
- {
|
|
- return PotionHelper.func_77915_a(par1, false);
|
|
- }
|
|
-
|
|
- public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
|
|
- {
|
|
- return par2 > 0 ? 16777215 : this.getColorFromDamage(par1ItemStack.getItemDamage());
|
|
- }
|
|
-
|
|
- public boolean requiresMultipleRenderPasses()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- public boolean isEffectInstant(int par1)
|
|
- {
|
|
- List var2 = this.getEffects(par1);
|
|
-
|
|
- if (var2 != null && !var2.isEmpty())
|
|
- {
|
|
- Iterator var3 = var2.iterator();
|
|
- PotionEffect var4;
|
|
-
|
|
- do
|
|
- {
|
|
- if (!var3.hasNext())
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
- var4 = (PotionEffect)var3.next();
|
|
- }
|
|
- while (!Potion.potionTypes[var4.getPotionID()].isInstant());
|
|
-
|
|
- return true;
|
|
- }
|
|
- else
|
|
- {
|
|
- return false;
|
|
- }
|
|
- }
|
|
-
|
|
public String getItemDisplayName(ItemStack par1ItemStack)
|
|
{
|
|
if (par1ItemStack.getItemDamage() == 0)
|
|
{
|
|
return StatCollector.translateToLocal("item.emptyPotion.name").trim();
|
|
--- 161,177 ----
|
|
***************
|
|
*** 259,441 ****
|
|
{
|
|
var4 = PotionHelper.func_77905_c(par1ItemStack.getItemDamage());
|
|
return StatCollector.translateToLocal(var4).trim() + " " + super.getItemDisplayName(par1ItemStack);
|
|
}
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
- {
|
|
- if (par1ItemStack.getItemDamage() != 0)
|
|
- {
|
|
- List var5 = Item.potion.getEffects(par1ItemStack);
|
|
- HashMultimap var6 = HashMultimap.create();
|
|
- Iterator var16;
|
|
-
|
|
- if (var5 != null && !var5.isEmpty())
|
|
- {
|
|
- var16 = var5.iterator();
|
|
-
|
|
- while (var16.hasNext())
|
|
- {
|
|
- PotionEffect var8 = (PotionEffect)var16.next();
|
|
- String var9 = StatCollector.translateToLocal(var8.getEffectName()).trim();
|
|
- Potion var10 = Potion.potionTypes[var8.getPotionID()];
|
|
- Map var11 = var10.func_111186_k();
|
|
-
|
|
- if (var11 != null && var11.size() > 0)
|
|
- {
|
|
- Iterator var12 = var11.entrySet().iterator();
|
|
-
|
|
- while (var12.hasNext())
|
|
- {
|
|
- Entry var13 = (Entry)var12.next();
|
|
- AttributeModifier var14 = (AttributeModifier)var13.getValue();
|
|
- AttributeModifier var15 = new AttributeModifier(var14.getName(), var10.func_111183_a(var8.getAmplifier(), var14), var14.getOperation());
|
|
- var6.put(((Attribute)var13.getKey()).getAttributeUnlocalizedName(), var15);
|
|
- }
|
|
- }
|
|
-
|
|
- if (var8.getAmplifier() > 0)
|
|
- {
|
|
- var9 = var9 + " " + StatCollector.translateToLocal("potion.potency." + var8.getAmplifier()).trim();
|
|
- }
|
|
-
|
|
- if (var8.getDuration() > 20)
|
|
- {
|
|
- var9 = var9 + " (" + Potion.getDurationString(var8) + ")";
|
|
- }
|
|
-
|
|
- if (var10.isBadEffect())
|
|
- {
|
|
- par3List.add(EnumChatFormatting.RED + var9);
|
|
- }
|
|
- else
|
|
- {
|
|
- par3List.add(EnumChatFormatting.GRAY + var9);
|
|
- }
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- String var7 = StatCollector.translateToLocal("potion.empty").trim();
|
|
- par3List.add(EnumChatFormatting.GRAY + var7);
|
|
- }
|
|
-
|
|
- if (!var6.isEmpty())
|
|
- {
|
|
- par3List.add("");
|
|
- par3List.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("potion.effects.whenDrank"));
|
|
- var16 = var6.entries().iterator();
|
|
-
|
|
- while (var16.hasNext())
|
|
- {
|
|
- Entry var17 = (Entry)var16.next();
|
|
- AttributeModifier var19 = (AttributeModifier)var17.getValue();
|
|
- double var18 = var19.getAmount();
|
|
- double var20;
|
|
-
|
|
- if (var19.getOperation() != 1 && var19.getOperation() != 2)
|
|
- {
|
|
- var20 = var19.getAmount();
|
|
- }
|
|
- else
|
|
- {
|
|
- var20 = var19.getAmount() * 100.0D;
|
|
- }
|
|
-
|
|
- if (var18 > 0.0D)
|
|
- {
|
|
- par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())}));
|
|
- }
|
|
- else if (var18 < 0.0D)
|
|
- {
|
|
- var20 *= -1.0D;
|
|
- par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var19.getOperation(), new Object[] {ItemStack.field_111284_a.format(var20), StatCollector.translateToLocal("attribute.name." + (String)var17.getKey())}));
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- public boolean hasEffect(ItemStack par1ItemStack)
|
|
- {
|
|
- List var2 = this.getEffects(par1ItemStack);
|
|
- return var2 != null && !var2.isEmpty();
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- super.getSubItems(par1, par2CreativeTabs, par3List);
|
|
- int var5;
|
|
-
|
|
- if (field_77835_b.isEmpty())
|
|
- {
|
|
- for (int var4 = 0; var4 <= 15; ++var4)
|
|
- {
|
|
- for (var5 = 0; var5 <= 1; ++var5)
|
|
- {
|
|
- int var6;
|
|
-
|
|
- if (var5 == 0)
|
|
- {
|
|
- var6 = var4 | 8192;
|
|
- }
|
|
- else
|
|
- {
|
|
- var6 = var4 | 16384;
|
|
- }
|
|
-
|
|
- for (int var7 = 0; var7 <= 2; ++var7)
|
|
- {
|
|
- int var8 = var6;
|
|
-
|
|
- if (var7 != 0)
|
|
- {
|
|
- if (var7 == 1)
|
|
- {
|
|
- var8 = var6 | 32;
|
|
- }
|
|
- else if (var7 == 2)
|
|
- {
|
|
- var8 = var6 | 64;
|
|
- }
|
|
- }
|
|
-
|
|
- List var9 = PotionHelper.getPotionEffects(var8, false);
|
|
-
|
|
- if (var9 != null && !var9.isEmpty())
|
|
- {
|
|
- field_77835_b.put(var9, Integer.valueOf(var8));
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- Iterator var10 = field_77835_b.values().iterator();
|
|
-
|
|
- while (var10.hasNext())
|
|
- {
|
|
- var5 = ((Integer)var10.next()).intValue();
|
|
- par3List.add(new ItemStack(par1, 1, var5));
|
|
- }
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_94590_d = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_drinkable");
|
|
- this.field_94591_c = par1IconRegister.registerIcon(this.getIconString() + "_" + "bottle_splash");
|
|
- this.field_94592_ct = par1IconRegister.registerIcon(this.getIconString() + "_" + "overlay");
|
|
- }
|
|
-
|
|
- public static Icon func_94589_d(String par0Str)
|
|
- {
|
|
- return par0Str.equals("bottle_drinkable") ? Item.potion.field_94590_d : (par0Str.equals("bottle_splash") ? Item.potion.field_94591_c : (par0Str.equals("overlay") ? Item.potion.field_94592_ct : null));
|
|
}
|
|
}
|
|
--- 198,204 ----
|
|
*** ItemRecord.java Sat Feb 5 04:19:42 2022
|
|
--- ItemRecord.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,9 ****
|
|
package net.minecraft.src;
|
|
|
|
import java.util.HashMap;
|
|
- import java.util.List;
|
|
import java.util.Map;
|
|
|
|
public class ItemRecord extends Item
|
|
{
|
|
/** List of all record items and their names. */
|
|
--- 1,8 ----
|
|
***************
|
|
*** 20,37 ****
|
|
this.setCreativeTab(CreativeTabs.tabMisc);
|
|
records.put(par2Str, this);
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return this.itemIcon;
|
|
- }
|
|
-
|
|
- /**
|
|
* Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
|
|
* True if something happen and false if it don't. This is for ITEMS, not BLOCKS
|
|
*/
|
|
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
|
|
{
|
|
--- 19,28 ----
|
|
***************
|
|
*** 51,89 ****
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
- }
|
|
-
|
|
- /**
|
|
- * allows items to add custom lines of information to the mouseover description
|
|
- */
|
|
- public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4)
|
|
- {
|
|
- par3List.add(this.getRecordTitle());
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return the title for this record.
|
|
- */
|
|
- public String getRecordTitle()
|
|
- {
|
|
- return "C418 - " + this.recordName;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return an item rarity from EnumRarity
|
|
- */
|
|
- public EnumRarity getRarity(ItemStack par1ItemStack)
|
|
- {
|
|
- return EnumRarity.rare;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return the record item corresponding to the given name.
|
|
- */
|
|
- public static ItemRecord getRecord(String par0Str)
|
|
- {
|
|
- return (ItemRecord)records.get(par0Str);
|
|
}
|
|
}
|
|
--- 42,48 ----
|
|
*** ItemSimpleFoiled.java Sat Feb 5 04:19:42 2022
|
|
--- ItemSimpleFoiled.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 4,14 ****
|
|
{
|
|
public ItemSimpleFoiled(int par1)
|
|
{
|
|
super(par1);
|
|
}
|
|
-
|
|
- public boolean hasEffect(ItemStack par1ItemStack)
|
|
- {
|
|
- return true;
|
|
- }
|
|
}
|
|
--- 4,9 ----
|
|
*** ItemSkull.java Sat Feb 5 04:19:42 2022
|
|
--- ItemSkull.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,14 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.util.List;
|
|
-
|
|
public class ItemSkull extends Item
|
|
{
|
|
private static final String[] skullTypes = new String[] {"skeleton", "wither", "zombie", "char", "creeper"};
|
|
public static final String[] field_94587_a = new String[] {"skeleton", "wither", "zombie", "steve", "creeper"};
|
|
- private Icon[] field_94586_c;
|
|
|
|
public ItemSkull(int par1)
|
|
{
|
|
super(par1);
|
|
this.setCreativeTab(CreativeTabs.tabDecorations);
|
|
--- 1,11 ----
|
|
***************
|
|
*** 96,129 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
|
- */
|
|
- public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List)
|
|
- {
|
|
- for (int var4 = 0; var4 < skullTypes.length; ++var4)
|
|
- {
|
|
- par3List.add(new ItemStack(par1, 1, var4));
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- if (par1 < 0 || par1 >= skullTypes.length)
|
|
- {
|
|
- par1 = 0;
|
|
- }
|
|
-
|
|
- return this.field_94586_c[par1];
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the metadata of the block which this Item (ItemBlock) can place
|
|
*/
|
|
public int getMetadata(int par1)
|
|
{
|
|
return par1;
|
|
--- 93,102 ----
|
|
***************
|
|
*** 146,162 ****
|
|
}
|
|
|
|
public String getItemDisplayName(ItemStack par1ItemStack)
|
|
{
|
|
return par1ItemStack.getItemDamage() == 3 && par1ItemStack.hasTagCompound() && par1ItemStack.getTagCompound().hasKey("SkullOwner") ? StatCollector.translateToLocalFormatted("item.skull.player.name", new Object[] {par1ItemStack.getTagCompound().getString("SkullOwner")}): super.getItemDisplayName(par1ItemStack);
|
|
- }
|
|
-
|
|
- public void registerIcons(IconRegister par1IconRegister)
|
|
- {
|
|
- this.field_94586_c = new Icon[field_94587_a.length];
|
|
-
|
|
- for (int var2 = 0; var2 < field_94587_a.length; ++var2)
|
|
- {
|
|
- this.field_94586_c[var2] = par1IconRegister.registerIcon(this.getIconString() + "_" + field_94587_a[var2]);
|
|
- }
|
|
}
|
|
}
|
|
--- 119,125 ----
|
|
*** ItemSlab.java Sat Feb 5 04:19:42 2022
|
|
--- ItemSlab.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 19,36 ****
|
|
this.setMaxDamage(0);
|
|
this.setHasSubtypes(true);
|
|
}
|
|
|
|
/**
|
|
- * Gets an icon index based on an item's damage value
|
|
- */
|
|
- public Icon getIconFromDamage(int par1)
|
|
- {
|
|
- return Block.blocksList[this.itemID].getIcon(2, par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the metadata of the block which this Item (ItemBlock) can place
|
|
*/
|
|
public int getMetadata(int par1)
|
|
{
|
|
return par1;
|
|
--- 19,28 ----
|
|
***************
|
|
*** 82,148 ****
|
|
}
|
|
else
|
|
{
|
|
return this.func_77888_a(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7) ? true : super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
|
}
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given ItemBlock can be placed on the given side of the given block position.
|
|
- */
|
|
- public boolean canPlaceItemBlockOnSide(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer, ItemStack par7ItemStack)
|
|
- {
|
|
- int var8 = par2;
|
|
- int var9 = par3;
|
|
- int var10 = par4;
|
|
- int var11 = par1World.getBlockId(par2, par3, par4);
|
|
- int var12 = par1World.getBlockMetadata(par2, par3, par4);
|
|
- int var13 = var12 & 7;
|
|
- boolean var14 = (var12 & 8) != 0;
|
|
-
|
|
- if ((par5 == 1 && !var14 || par5 == 0 && var14) && var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage())
|
|
- {
|
|
- return true;
|
|
- }
|
|
- else
|
|
- {
|
|
- if (par5 == 0)
|
|
- {
|
|
- --par3;
|
|
- }
|
|
-
|
|
- if (par5 == 1)
|
|
- {
|
|
- ++par3;
|
|
- }
|
|
-
|
|
- if (par5 == 2)
|
|
- {
|
|
- --par4;
|
|
- }
|
|
-
|
|
- if (par5 == 3)
|
|
- {
|
|
- ++par4;
|
|
- }
|
|
-
|
|
- if (par5 == 4)
|
|
- {
|
|
- --par2;
|
|
- }
|
|
-
|
|
- if (par5 == 5)
|
|
- {
|
|
- ++par2;
|
|
- }
|
|
-
|
|
- var11 = par1World.getBlockId(par2, par3, par4);
|
|
- var12 = par1World.getBlockMetadata(par2, par3, par4);
|
|
- var13 = var12 & 7;
|
|
- var14 = (var12 & 8) != 0;
|
|
- return var11 == this.theHalfSlab.blockID && var13 == par7ItemStack.getItemDamage() ? true : super.canPlaceItemBlockOnSide(par1World, var8, var9, var10, par5, par6EntityPlayer, par7ItemStack);
|
|
}
|
|
}
|
|
|
|
private boolean func_77888_a(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7)
|
|
{
|
|
--- 74,83 ----
|
|
*** ItemSnow.java Sat Feb 5 04:19:42 2022
|
|
--- ItemSnow.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 29,39 ****
|
|
{
|
|
Block var12 = Block.blocksList[this.getBlockID()];
|
|
int var13 = par3World.getBlockMetadata(par4, par5, par6);
|
|
int var14 = var13 & 7;
|
|
|
|
! if (var14 <= 6 && par3World.checkNoEntityCollision(var12.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlockMetadataWithNotify(par4, par5, par6, var14 + 1 | var13 & -8, 2))
|
|
{
|
|
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
|
|
--par1ItemStack.stackSize;
|
|
return true;
|
|
}
|
|
--- 29,39 ----
|
|
{
|
|
Block var12 = Block.blocksList[this.getBlockID()];
|
|
int var13 = par3World.getBlockMetadata(par4, par5, par6);
|
|
int var14 = var13 & 7;
|
|
|
|
! if (var14 <= 6 && par3World.checkNoEntityCollision(var12.getCollisionBoundingBoxFromPool(par3World, par4, par5, par6)) && par3World.setBlockMetadata(par4, par5, par6, var14 + 1 | var13 & -8, 2))
|
|
{
|
|
par3World.playSoundEffect((double)((float)par4 + 0.5F), (double)((float)par5 + 0.5F), (double)((float)par6 + 0.5F), var12.stepSound.getPlaceSound(), (var12.stepSound.getVolume() + 1.0F) / 2.0F, var12.stepSound.getPitch() * 0.8F);
|
|
--par1ItemStack.stackSize;
|
|
return true;
|
|
}
|
|
*** ItemStack.java Sat Feb 5 04:19:42 2022
|
|
--- ItemStack.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,15 ****
|
|
package net.minecraft.src;
|
|
|
|
import com.google.common.collect.HashMultimap;
|
|
import com.google.common.collect.Multimap;
|
|
import java.text.DecimalFormat;
|
|
- import java.util.ArrayList;
|
|
- import java.util.Iterator;
|
|
- import java.util.List;
|
|
import java.util.Random;
|
|
- import java.util.Map.Entry;
|
|
|
|
public final class ItemStack
|
|
{
|
|
public static final DecimalFormat field_111284_a = new DecimalFormat("#.###");
|
|
|
|
--- 1,11 ----
|
|
***************
|
|
*** 108,130 ****
|
|
public Item getItem()
|
|
{
|
|
return Item.itemsList[this.itemID];
|
|
}
|
|
|
|
- /**
|
|
- * Returns the icon index of the current stack.
|
|
- */
|
|
- public Icon getIconIndex()
|
|
- {
|
|
- return this.getItem().getIconIndex(this);
|
|
- }
|
|
-
|
|
- public int getItemSpriteNumber()
|
|
- {
|
|
- return this.getItem().getSpriteNumber();
|
|
- }
|
|
-
|
|
public boolean tryPlaceItemIntoWorld(EntityPlayer par1EntityPlayer, World par2World, int par3, int par4, int par5, int par6, float par7, float par8, float par9)
|
|
{
|
|
boolean var10 = this.getItem().onItemUse(this, par1EntityPlayer, par2World, par3, par4, par5, par6, par7, par8, par9);
|
|
|
|
if (var10)
|
|
--- 104,113 ----
|
|
***************
|
|
*** 574,726 ****
|
|
* Returns true if the itemstack has a display name
|
|
*/
|
|
public boolean hasDisplayName()
|
|
{
|
|
return this.stackTagCompound == null ? false : (!this.stackTagCompound.hasKey("display") ? false : this.stackTagCompound.getCompoundTag("display").hasKey("Name"));
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return a list of strings containing information about the item
|
|
- */
|
|
- public List getTooltip(EntityPlayer par1EntityPlayer, boolean par2)
|
|
- {
|
|
- ArrayList var3 = new ArrayList();
|
|
- Item var4 = Item.itemsList[this.itemID];
|
|
- String var5 = this.getDisplayName();
|
|
-
|
|
- if (this.hasDisplayName())
|
|
- {
|
|
- var5 = EnumChatFormatting.ITALIC + var5 + EnumChatFormatting.RESET;
|
|
- }
|
|
-
|
|
- if (par2)
|
|
- {
|
|
- String var6 = "";
|
|
-
|
|
- if (var5.length() > 0)
|
|
- {
|
|
- var5 = var5 + " (";
|
|
- var6 = ")";
|
|
- }
|
|
-
|
|
- if (this.getHasSubtypes())
|
|
- {
|
|
- var5 = var5 + String.format("#%04d/%d%s", new Object[] {Integer.valueOf(this.itemID), Integer.valueOf(this.itemDamage), var6});
|
|
- }
|
|
- else
|
|
- {
|
|
- var5 = var5 + String.format("#%04d%s", new Object[] {Integer.valueOf(this.itemID), var6});
|
|
- }
|
|
- }
|
|
- else if (!this.hasDisplayName() && this.itemID == Item.map.itemID)
|
|
- {
|
|
- var5 = var5 + " #" + this.itemDamage;
|
|
- }
|
|
-
|
|
- var3.add(var5);
|
|
- var4.addInformation(this, par1EntityPlayer, var3, par2);
|
|
-
|
|
- if (this.hasTagCompound())
|
|
- {
|
|
- NBTTagList var14 = this.getEnchantmentTagList();
|
|
-
|
|
- if (var14 != null)
|
|
- {
|
|
- for (int var7 = 0; var7 < var14.tagCount(); ++var7)
|
|
- {
|
|
- short var8 = ((NBTTagCompound)var14.tagAt(var7)).getShort("id");
|
|
- short var9 = ((NBTTagCompound)var14.tagAt(var7)).getShort("lvl");
|
|
-
|
|
- if (Enchantment.enchantmentsList[var8] != null)
|
|
- {
|
|
- var3.add(Enchantment.enchantmentsList[var8].getTranslatedName(var9));
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- if (this.stackTagCompound.hasKey("display"))
|
|
- {
|
|
- NBTTagCompound var16 = this.stackTagCompound.getCompoundTag("display");
|
|
-
|
|
- if (var16.hasKey("color"))
|
|
- {
|
|
- if (par2)
|
|
- {
|
|
- var3.add("Color: #" + Integer.toHexString(var16.getInteger("color")).toUpperCase());
|
|
- }
|
|
- else
|
|
- {
|
|
- var3.add(EnumChatFormatting.ITALIC + StatCollector.translateToLocal("item.dyed"));
|
|
- }
|
|
- }
|
|
-
|
|
- if (var16.hasKey("Lore"))
|
|
- {
|
|
- NBTTagList var18 = var16.getTagList("Lore");
|
|
-
|
|
- if (var18.tagCount() > 0)
|
|
- {
|
|
- for (int var20 = 0; var20 < var18.tagCount(); ++var20)
|
|
- {
|
|
- var3.add(EnumChatFormatting.DARK_PURPLE + "" + EnumChatFormatting.ITALIC + ((NBTTagString)var18.tagAt(var20)).data);
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- Multimap var15 = this.getAttributeModifiers();
|
|
-
|
|
- if (!var15.isEmpty())
|
|
- {
|
|
- var3.add("");
|
|
- Iterator var17 = var15.entries().iterator();
|
|
-
|
|
- while (var17.hasNext())
|
|
- {
|
|
- Entry var19 = (Entry)var17.next();
|
|
- AttributeModifier var21 = (AttributeModifier)var19.getValue();
|
|
- double var10 = var21.getAmount();
|
|
- double var12;
|
|
-
|
|
- if (var21.getOperation() != 1 && var21.getOperation() != 2)
|
|
- {
|
|
- var12 = var21.getAmount();
|
|
- }
|
|
- else
|
|
- {
|
|
- var12 = var21.getAmount() * 100.0D;
|
|
- }
|
|
-
|
|
- if (var10 > 0.0D)
|
|
- {
|
|
- var3.add(EnumChatFormatting.BLUE + StatCollector.translateToLocalFormatted("attribute.modifier.plus." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())}));
|
|
- }
|
|
- else if (var10 < 0.0D)
|
|
- {
|
|
- var12 *= -1.0D;
|
|
- var3.add(EnumChatFormatting.RED + StatCollector.translateToLocalFormatted("attribute.modifier.take." + var21.getOperation(), new Object[] {field_111284_a.format(var12), StatCollector.translateToLocal("attribute.name." + (String)var19.getKey())}));
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- if (par2 && this.isItemDamaged())
|
|
- {
|
|
- var3.add("Durability: " + (this.getMaxDamage() - this.getItemDamageForDisplay()) + " / " + this.getMaxDamage());
|
|
- }
|
|
-
|
|
- return var3;
|
|
- }
|
|
-
|
|
- public boolean hasEffect()
|
|
- {
|
|
- return this.getItem().hasEffect(this);
|
|
- }
|
|
-
|
|
- public EnumRarity getRarity()
|
|
- {
|
|
- return this.getItem().getRarity(this);
|
|
}
|
|
|
|
/**
|
|
* True if it is a tool and has no enchantments to begin with
|
|
*/
|
|
--- 557,566 ----
|
|
*** ItemSword.java Sat Feb 5 04:19:42 2022
|
|
--- ItemSword.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 58,75 ****
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
- * Returns True is the item is renderer in full 3D when hold.
|
|
- */
|
|
- public boolean isFull3D()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
* returns the action that specifies what animation to play when the items is being used
|
|
*/
|
|
public EnumAction getItemUseAction(ItemStack par1ItemStack)
|
|
{
|
|
return EnumAction.block;
|
|
--- 58,67 ----
|
|
*** ItemTool.java Sat Feb 5 04:19:42 2022
|
|
--- ItemTool.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 62,79 ****
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
- * Returns True is the item is renderer in full 3D when hold.
|
|
- */
|
|
- public boolean isFull3D()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
* Return the enchantability factor of the item, most of the time is based on material.
|
|
*/
|
|
public int getItemEnchantability()
|
|
{
|
|
return this.toolMaterial.getEnchantability();
|
|
--- 62,71 ----
|
|
*** LogAgent.java Sat Feb 5 04:19:42 2022
|
|
--- LogAgent.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 52,66 ****
|
|
--- 52,77 ----
|
|
{
|
|
this.serverLogger.log(Level.WARNING, "Failed to log " + this.loggerName + " to " + this.logFile, var5);
|
|
}
|
|
}
|
|
|
|
+ public Logger func_120013_a()
|
|
+ {
|
|
+ return this.serverLogger;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Logs plain text message.
|
|
+ */
|
|
public void logInfo(String par1Str)
|
|
{
|
|
this.serverLogger.log(Level.INFO, par1Str);
|
|
}
|
|
|
|
+ /**
|
|
+ * Logs text as warning.
|
|
+ */
|
|
public void logWarning(String par1Str)
|
|
{
|
|
this.serverLogger.log(Level.WARNING, par1Str);
|
|
}
|
|
|
|
***************
|
|
*** 80,94 ****
|
|
}
|
|
|
|
public void logSevereException(String par1Str, Throwable par2Throwable)
|
|
{
|
|
this.serverLogger.log(Level.SEVERE, par1Str, par2Throwable);
|
|
- }
|
|
-
|
|
- public void logFine(String par1Str)
|
|
- {
|
|
- this.serverLogger.log(Level.FINE, par1Str);
|
|
}
|
|
|
|
static String func_98237_a(LogAgent par0LogAgent)
|
|
{
|
|
return par0LogAgent.loggerPrefix;
|
|
--- 91,100 ----
|
|
*** MapData.java Sat Feb 5 04:19:42 2022
|
|
--- MapData.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 228,275 ****
|
|
var5.field_76210_c[par1] = par3;
|
|
}
|
|
}
|
|
}
|
|
|
|
- /**
|
|
- * Updates the client's map with information from other players in MP
|
|
- */
|
|
- public void updateMPMapData(byte[] par1ArrayOfByte)
|
|
- {
|
|
- int var2;
|
|
-
|
|
- if (par1ArrayOfByte[0] == 0)
|
|
- {
|
|
- var2 = par1ArrayOfByte[1] & 255;
|
|
- int var3 = par1ArrayOfByte[2] & 255;
|
|
-
|
|
- for (int var4 = 0; var4 < par1ArrayOfByte.length - 3; ++var4)
|
|
- {
|
|
- this.colors[(var4 + var3) * 128 + var2] = par1ArrayOfByte[var4 + 3];
|
|
- }
|
|
-
|
|
- this.markDirty();
|
|
- }
|
|
- else if (par1ArrayOfByte[0] == 1)
|
|
- {
|
|
- this.playersVisibleOnMap.clear();
|
|
-
|
|
- for (var2 = 0; var2 < (par1ArrayOfByte.length - 1) / 3; ++var2)
|
|
- {
|
|
- byte var7 = (byte)(par1ArrayOfByte[var2 * 3 + 1] >> 4);
|
|
- byte var8 = par1ArrayOfByte[var2 * 3 + 2];
|
|
- byte var5 = par1ArrayOfByte[var2 * 3 + 3];
|
|
- byte var6 = (byte)(par1ArrayOfByte[var2 * 3 + 1] & 15);
|
|
- this.playersVisibleOnMap.put("icon-" + var2, new MapCoord(this, var7, var8, var5, var6));
|
|
- }
|
|
- }
|
|
- else if (par1ArrayOfByte[0] == 2)
|
|
- {
|
|
- this.scale = par1ArrayOfByte[1];
|
|
- }
|
|
- }
|
|
-
|
|
public MapInfo func_82568_a(EntityPlayer par1EntityPlayer)
|
|
{
|
|
MapInfo var2 = (MapInfo)this.playersHashMap.get(par1EntityPlayer);
|
|
|
|
if (var2 == null)
|
|
--- 228,237 ----
|
|
*** MathHelper.java Sat Feb 5 04:19:43 2022
|
|
--- MathHelper.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 43,60 ****
|
|
int var1 = (int)par0;
|
|
return par0 < (float)var1 ? var1 - 1 : var1;
|
|
}
|
|
|
|
/**
|
|
- * returns par0 cast as an int, and no greater than Integer.MAX_VALUE-1024
|
|
- */
|
|
- public static int truncateDoubleToInt(double par0)
|
|
- {
|
|
- return (int)(par0 + 1024.0D) - 1024;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the greatest integer less than or equal to the double argument
|
|
*/
|
|
public static int floor_double(double par0)
|
|
{
|
|
int var2 = (int)par0;
|
|
--- 43,52 ----
|
|
***************
|
|
*** 127,152 ****
|
|
{
|
|
par2 = -par2;
|
|
}
|
|
|
|
return par0 > par2 ? par0 : par2;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Buckets an integer with specifed bucket sizes. Args: i, bucketSize
|
|
- */
|
|
- public static int bucketInt(int par0, int par1)
|
|
- {
|
|
- return par0 < 0 ? -((-par0 - 1) / par1) - 1 : par0 / par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Tests if a string is null or of length zero
|
|
- */
|
|
- public static boolean stringNullOrLengthZero(String par0Str)
|
|
- {
|
|
- return par0Str == null || par0Str.length() == 0;
|
|
}
|
|
|
|
public static int getRandomIntegerInRange(Random par0Random, int par1, int par2)
|
|
{
|
|
return par1 >= par2 ? par1 : par0Random.nextInt(par2 - par1 + 1) + par1;
|
|
--- 119,128 ----
|
|
*** MemoryConnection.java Sat Feb 5 04:19:43 2022
|
|
--- MemoryConnection.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,31 ****
|
|
package net.minecraft.src;
|
|
|
|
import java.net.InetSocketAddress;
|
|
import java.net.SocketAddress;
|
|
- import java.util.ArrayList;
|
|
- import java.util.Collections;
|
|
import java.util.List;
|
|
|
|
public class MemoryConnection implements INetworkManager
|
|
{
|
|
private static final SocketAddress mySocketAddress = new InetSocketAddress("127.0.0.1", 0);
|
|
! private final List readPacketCache = Collections.synchronizedList(new ArrayList());
|
|
private final ILogAgent field_98214_c;
|
|
private MemoryConnection pairedConnection;
|
|
private NetHandler myNetHandler;
|
|
|
|
/** set to true by {server,network}Shutdown */
|
|
private boolean shuttingDown;
|
|
! private String shutdownReason = "";
|
|
private Object[] field_74439_g;
|
|
- private boolean gamePaused;
|
|
|
|
! public MemoryConnection(ILogAgent par1ILogAgent, NetHandler par2NetHandler)
|
|
{
|
|
! this.myNetHandler = par2NetHandler;
|
|
! this.field_98214_c = par1ILogAgent;
|
|
}
|
|
|
|
/**
|
|
* Sets the NetHandler for this NetworkManager. Server-only.
|
|
*/
|
|
--- 1,28 ----
|
|
package net.minecraft.src;
|
|
|
|
import java.net.InetSocketAddress;
|
|
import java.net.SocketAddress;
|
|
import java.util.List;
|
|
|
|
public class MemoryConnection implements INetworkManager
|
|
{
|
|
private static final SocketAddress mySocketAddress = new InetSocketAddress("127.0.0.1", 0);
|
|
! private final List readPacketCache = java.util.Collections.synchronizedList(new java.util.ArrayList());
|
|
private final ILogAgent field_98214_c;
|
|
private MemoryConnection pairedConnection;
|
|
private NetHandler myNetHandler;
|
|
|
|
/** set to true by {server,network}Shutdown */
|
|
private boolean shuttingDown;
|
|
! private String shutdownReason;
|
|
private Object[] field_74439_g;
|
|
|
|
! public MemoryConnection(ILogAgent p_i1392_1_, NetHandler p_i1392_2_)
|
|
{
|
|
! this.myNetHandler = p_i1392_2_;
|
|
! this.field_98214_c = p_i1392_1_;
|
|
}
|
|
|
|
/**
|
|
* Sets the NetHandler for this NetworkManager. Server-only.
|
|
*/
|
|
***************
|
|
*** 43,63 ****
|
|
{
|
|
this.pairedConnection.processOrCachePacket(par1Packet);
|
|
}
|
|
}
|
|
|
|
- public void closeConnections()
|
|
- {
|
|
- this.pairedConnection = null;
|
|
- this.myNetHandler = null;
|
|
- }
|
|
-
|
|
- public boolean isConnectionActive()
|
|
- {
|
|
- return !this.shuttingDown && this.pairedConnection != null;
|
|
- }
|
|
-
|
|
/**
|
|
* Wakes reader and writer threads
|
|
*/
|
|
public void wakeThreads() {}
|
|
|
|
--- 40,49 ----
|
|
***************
|
|
*** 84,96 ****
|
|
this.myNetHandler.handleErrorMessage(this.shutdownReason, this.field_74439_g);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Return the InetSocketAddress of the remote endpoint
|
|
*/
|
|
! public SocketAddress getSocketAddress()
|
|
{
|
|
return mySocketAddress;
|
|
}
|
|
|
|
/**
|
|
--- 70,82 ----
|
|
this.myNetHandler.handleErrorMessage(this.shutdownReason, this.field_74439_g);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Returns the socket address of the remote side. Server-only.
|
|
*/
|
|
! public SocketAddress getRemoteAddress()
|
|
{
|
|
return mySocketAddress;
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 111,146 ****
|
|
this.shutdownReason = par1Str;
|
|
this.field_74439_g = par2ArrayOfObj;
|
|
}
|
|
|
|
/**
|
|
! * returns 0 for memoryConnections
|
|
*/
|
|
! public int packetSize()
|
|
{
|
|
return 0;
|
|
- }
|
|
-
|
|
- public void pairWith(MemoryConnection par1MemoryConnection)
|
|
- {
|
|
- this.pairedConnection = par1MemoryConnection;
|
|
- par1MemoryConnection.pairedConnection = this;
|
|
- }
|
|
-
|
|
- public boolean isGamePaused()
|
|
- {
|
|
- return this.gamePaused;
|
|
- }
|
|
-
|
|
- public void setGamePaused(boolean par1)
|
|
- {
|
|
- this.gamePaused = par1;
|
|
- }
|
|
-
|
|
- public MemoryConnection getPairedConnection()
|
|
- {
|
|
- return this.pairedConnection;
|
|
}
|
|
|
|
/**
|
|
* acts immiditally if isWritePacket, otherwise adds it to the readCache to be processed next tick
|
|
*/
|
|
--- 97,111 ----
|
|
this.shutdownReason = par1Str;
|
|
this.field_74439_g = par2ArrayOfObj;
|
|
}
|
|
|
|
/**
|
|
! * Returns the number of chunk data packets waiting to be sent.
|
|
*/
|
|
! public int getNumChunkDataPackets()
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
* acts immiditally if isWritePacket, otherwise adds it to the readCache to be processed next tick
|
|
*/
|
|
*** MerchantRecipe.java Sat Feb 5 04:19:43 2022
|
|
--- MerchantRecipe.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 103,117 ****
|
|
public boolean func_82784_g()
|
|
{
|
|
return this.toolUses >= this.maxTradeUses;
|
|
}
|
|
|
|
- public void func_82785_h()
|
|
- {
|
|
- this.toolUses = this.maxTradeUses;
|
|
- }
|
|
-
|
|
public void readFromTags(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
NBTTagCompound var2 = par1NBTTagCompound.getCompoundTag("buy");
|
|
this.itemToBuy = ItemStack.loadItemStackFromNBT(var2);
|
|
NBTTagCompound var3 = par1NBTTagCompound.getCompoundTag("sell");
|
|
--- 103,112 ----
|
|
*** MerchantRecipeList.java Sat Feb 5 04:19:43 2022
|
|
--- MerchantRecipeList.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,8 ****
|
|
package net.minecraft.src;
|
|
|
|
- import java.io.DataInputStream;
|
|
import java.io.DataOutputStream;
|
|
import java.io.IOException;
|
|
import java.util.ArrayList;
|
|
|
|
public class MerchantRecipeList extends ArrayList
|
|
--- 1,7 ----
|
|
***************
|
|
*** 80,119 ****
|
|
Packet.writeItemStack(var4, par1DataOutputStream);
|
|
}
|
|
|
|
par1DataOutputStream.writeBoolean(var3.func_82784_g());
|
|
}
|
|
- }
|
|
-
|
|
- public static MerchantRecipeList readRecipiesFromStream(DataInputStream par0DataInputStream) throws IOException
|
|
- {
|
|
- MerchantRecipeList var1 = new MerchantRecipeList();
|
|
- int var2 = par0DataInputStream.readByte() & 255;
|
|
-
|
|
- for (int var3 = 0; var3 < var2; ++var3)
|
|
- {
|
|
- ItemStack var4 = Packet.readItemStack(par0DataInputStream);
|
|
- ItemStack var5 = Packet.readItemStack(par0DataInputStream);
|
|
- ItemStack var6 = null;
|
|
-
|
|
- if (par0DataInputStream.readBoolean())
|
|
- {
|
|
- var6 = Packet.readItemStack(par0DataInputStream);
|
|
- }
|
|
-
|
|
- boolean var7 = par0DataInputStream.readBoolean();
|
|
- MerchantRecipe var8 = new MerchantRecipe(var4, var6, var5);
|
|
-
|
|
- if (var7)
|
|
- {
|
|
- var8.func_82785_h();
|
|
- }
|
|
-
|
|
- var1.add(var8);
|
|
- }
|
|
-
|
|
- return var1;
|
|
}
|
|
|
|
public void readRecipiesFromTags(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
NBTTagList var2 = par1NBTTagCompound.getTagList("Recipes");
|
|
--- 79,88 ----
|
|
*** MessageComponentSerializer.java Sat Feb 5 04:19:43 2022
|
|
--- MessageComponentSerializer.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 30,40 ****
|
|
|
|
if (var8 != null && var8.isJsonPrimitive())
|
|
{
|
|
EnumChatFormatting var13 = EnumChatFormatting.func_96300_b(var8.getAsString());
|
|
|
|
! if (var13 == null || !var13.isColor())
|
|
{
|
|
throw new JsonParseException("Given color (" + var8.getAsString() + ") is not a valid selection");
|
|
}
|
|
|
|
var4.setColor(var13);
|
|
--- 30,40 ----
|
|
|
|
if (var8 != null && var8.isJsonPrimitive())
|
|
{
|
|
EnumChatFormatting var13 = EnumChatFormatting.func_96300_b(var8.getAsString());
|
|
|
|
! if (var13 == null || !var13.Checks())
|
|
{
|
|
throw new JsonParseException("Given color (" + var8.getAsString() + ") is not a valid selection");
|
|
}
|
|
|
|
var4.setColor(var13);
|
|
*** MobSpawnerBaseLogic.java Sat Feb 5 04:19:43 2022
|
|
--- MobSpawnerBaseLogic.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 15,26 ****
|
|
private WeightedRandomMinecart randomMinecart;
|
|
public double field_98287_c;
|
|
public double field_98284_d;
|
|
private int minSpawnDelay = 200;
|
|
private int maxSpawnDelay = 800;
|
|
-
|
|
- /** A counter for spawn tries. */
|
|
private int spawnCount = 4;
|
|
private Entity field_98291_j;
|
|
private int maxNearbyEntities = 6;
|
|
|
|
/** The distance from which a player activates the spawner. */
|
|
--- 15,24 ----
|
|
***************
|
|
*** 315,336 ****
|
|
var2.appendTag(this.getRandomMinecart().func_98220_a());
|
|
}
|
|
|
|
par1NBTTagCompound.setTag("SpawnPotentials", var2);
|
|
}
|
|
- }
|
|
-
|
|
- public Entity func_98281_h()
|
|
- {
|
|
- if (this.field_98291_j == null)
|
|
- {
|
|
- Entity var1 = EntityList.createEntityByName(this.getEntityNameToSpawn(), (World)null);
|
|
- var1 = this.func_98265_a(var1);
|
|
- this.field_98291_j = var1;
|
|
- }
|
|
-
|
|
- return this.field_98291_j;
|
|
}
|
|
|
|
/**
|
|
* Sets the delay to minDelay if parameter given is 1, else return false.
|
|
*/
|
|
--- 313,322 ----
|
|
*** ModifiableAttributeInstance.java Sat Feb 5 04:19:43 2022
|
|
--- ModifiableAttributeInstance.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 1,9 ****
|
|
package net.minecraft.src;
|
|
|
|
import com.google.common.collect.Maps;
|
|
- import java.util.ArrayList;
|
|
import java.util.Collection;
|
|
import java.util.HashSet;
|
|
import java.util.Iterator;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
--- 1,8 ----
|
|
***************
|
|
*** 125,151 ****
|
|
}
|
|
}
|
|
|
|
this.field_111135_e.remove(par1AttributeModifier.getID());
|
|
this.func_111131_f();
|
|
- }
|
|
-
|
|
- public void func_142049_d()
|
|
- {
|
|
- Collection var1 = this.func_111122_c();
|
|
-
|
|
- if (var1 != null)
|
|
- {
|
|
- ArrayList var4 = new ArrayList(var1);
|
|
- Iterator var2 = var4.iterator();
|
|
-
|
|
- while (var2.hasNext())
|
|
- {
|
|
- AttributeModifier var3 = (AttributeModifier)var2.next();
|
|
- this.removeModifier(var3);
|
|
- }
|
|
- }
|
|
}
|
|
|
|
public double getAttributeValue()
|
|
{
|
|
if (this.field_111133_g)
|
|
--- 124,133 ----
|
|
*** NBTTagList.java Sat Feb 5 04:19:43 2022
|
|
--- NBTTagList.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 96,113 ****
|
|
this.tagType = par1NBTBase.getId();
|
|
this.tagList.add(par1NBTBase);
|
|
}
|
|
|
|
/**
|
|
- * Removes a tag at the given index.
|
|
- */
|
|
- public NBTBase removeTag(int par1)
|
|
- {
|
|
- return (NBTBase)this.tagList.remove(par1);
|
|
- }
|
|
-
|
|
- /**
|
|
* Retrieves the tag at the specified index from the list.
|
|
*/
|
|
public NBTBase tagAt(int par1)
|
|
{
|
|
return (NBTBase)this.tagList.get(par1);
|
|
--- 96,105 ----
|
|
*** NetHandler.java Sat Feb 5 04:19:43 2022
|
|
--- NetHandler.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 11,22 ****
|
|
* Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data)
|
|
*/
|
|
public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) {}
|
|
|
|
/**
|
|
! * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does
|
|
! * nothing.
|
|
*/
|
|
public void unexpectedPacket(Packet par1Packet) {}
|
|
|
|
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) {}
|
|
|
|
--- 11,22 ----
|
|
* Handle Packet51MapChunk (full chunk update of blocks, metadata, light levels, and optionally biome data)
|
|
*/
|
|
public void handleMapChunk(Packet51MapChunk par1Packet51MapChunk) {}
|
|
|
|
/**
|
|
! * Default handler called for packets that don't have their own handlers in NetServerHandler; kicks player from the
|
|
! * server.
|
|
*/
|
|
public void unexpectedPacket(Packet par1Packet) {}
|
|
|
|
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj) {}
|
|
|
|
***************
|
|
*** 256,266 ****
|
|
{
|
|
this.unexpectedPacket(par1Packet54PlayNoteBlock);
|
|
}
|
|
|
|
/**
|
|
! * Increment player statistics
|
|
*/
|
|
public void handleStatistic(Packet200Statistic par1Packet200Statistic)
|
|
{
|
|
this.unexpectedPacket(par1Packet200Statistic);
|
|
}
|
|
--- 256,266 ----
|
|
{
|
|
this.unexpectedPacket(par1Packet54PlayNoteBlock);
|
|
}
|
|
|
|
/**
|
|
! * runs registerPacket on the given Packet200Statistic
|
|
*/
|
|
public void handleStatistic(Packet200Statistic par1Packet200Statistic)
|
|
{
|
|
this.unexpectedPacket(par1Packet200Statistic);
|
|
}
|
|
*** NetLoginHandler.java Sat Feb 5 04:19:43 2022
|
|
--- NetLoginHandler.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 22,33 ****
|
|
private byte[] verifyToken;
|
|
|
|
/** Reference to the MinecraftServer object. */
|
|
private final MinecraftServer mcServer;
|
|
public final TcpConnection myTCPConnection;
|
|
! public boolean connectionComplete;
|
|
! private int connectionTimer;
|
|
private String clientUsername;
|
|
private volatile boolean field_72544_i;
|
|
|
|
/** server ID that is randomly generated by this login handler. */
|
|
private String loginServerId = "";
|
|
--- 22,40 ----
|
|
private byte[] verifyToken;
|
|
|
|
/** Reference to the MinecraftServer object. */
|
|
private final MinecraftServer mcServer;
|
|
public final TcpConnection myTCPConnection;
|
|
!
|
|
! /**
|
|
! * Returns if the login handler is finished and can be removed. It is set to true on either error or successful
|
|
! * login.
|
|
! */
|
|
! public boolean finishedProcessing;
|
|
!
|
|
! /** While waiting to login, if this field ++'s to 600 it will kick you. */
|
|
! private int loginTimer;
|
|
private String clientUsername;
|
|
private volatile boolean field_72544_i;
|
|
|
|
/** server ID that is randomly generated by this login handler. */
|
|
private String loginServerId = "";
|
|
***************
|
|
*** 52,79 ****
|
|
if (this.field_72544_i)
|
|
{
|
|
this.initializePlayerConnection();
|
|
}
|
|
|
|
! if (this.connectionTimer++ == 600)
|
|
{
|
|
! this.raiseErrorAndDisconnect("Took too long to log in");
|
|
}
|
|
else
|
|
{
|
|
this.myTCPConnection.processReadPackets();
|
|
}
|
|
}
|
|
|
|
! public void raiseErrorAndDisconnect(String par1Str)
|
|
{
|
|
try
|
|
{
|
|
this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str);
|
|
this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str));
|
|
this.myTCPConnection.serverShutdown();
|
|
! this.connectionComplete = true;
|
|
}
|
|
catch (Exception var3)
|
|
{
|
|
var3.printStackTrace();
|
|
}
|
|
--- 59,89 ----
|
|
if (this.field_72544_i)
|
|
{
|
|
this.initializePlayerConnection();
|
|
}
|
|
|
|
! if (this.loginTimer++ == 600)
|
|
{
|
|
! this.kickUser("Took too long to log in");
|
|
}
|
|
else
|
|
{
|
|
this.myTCPConnection.processReadPackets();
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * Disconnects the user with the given reason.
|
|
! */
|
|
! public void kickUser(String par1Str)
|
|
{
|
|
try
|
|
{
|
|
this.mcServer.getLogAgent().logInfo("Disconnecting " + this.getUsernameAndAddress() + ": " + par1Str);
|
|
this.myTCPConnection.addToSendQueue(new Packet255KickDisconnect(par1Str));
|
|
this.myTCPConnection.serverShutdown();
|
|
! this.finishedProcessing = true;
|
|
}
|
|
catch (Exception var3)
|
|
{
|
|
var3.printStackTrace();
|
|
}
|
|
***************
|
|
*** 81,113 ****
|
|
|
|
public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol)
|
|
{
|
|
if (this.clientUsername != null)
|
|
{
|
|
! this.raiseErrorAndDisconnect("Quit repeating yourself!");
|
|
}
|
|
else
|
|
{
|
|
this.clientUsername = par1Packet2ClientProtocol.getUsername();
|
|
|
|
if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername)))
|
|
{
|
|
! this.raiseErrorAndDisconnect("Invalid username!");
|
|
}
|
|
else
|
|
{
|
|
PublicKey var2 = this.mcServer.getKeyPair().getPublic();
|
|
|
|
if (par1Packet2ClientProtocol.getProtocolVersion() != 78)
|
|
{
|
|
if (par1Packet2ClientProtocol.getProtocolVersion() > 78)
|
|
{
|
|
! this.raiseErrorAndDisconnect("Outdated server!");
|
|
}
|
|
else
|
|
{
|
|
! this.raiseErrorAndDisconnect("Outdated client!");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-";
|
|
--- 91,123 ----
|
|
|
|
public void handleClientProtocol(Packet2ClientProtocol par1Packet2ClientProtocol)
|
|
{
|
|
if (this.clientUsername != null)
|
|
{
|
|
! this.kickUser("Quit repeating yourself!");
|
|
}
|
|
else
|
|
{
|
|
this.clientUsername = par1Packet2ClientProtocol.getUsername();
|
|
|
|
if (!this.clientUsername.equals(StringUtils.stripControlCodes(this.clientUsername)))
|
|
{
|
|
! this.kickUser("Invalid username!");
|
|
}
|
|
else
|
|
{
|
|
PublicKey var2 = this.mcServer.getKeyPair().getPublic();
|
|
|
|
if (par1Packet2ClientProtocol.getProtocolVersion() != 78)
|
|
{
|
|
if (par1Packet2ClientProtocol.getProtocolVersion() > 78)
|
|
{
|
|
! this.kickUser("Outdated server!");
|
|
}
|
|
else
|
|
{
|
|
! this.kickUser("Outdated client!");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.loginServerId = this.mcServer.isServerInOnlineMode() ? Long.toString(rand.nextLong(), 16) : "-";
|
|
***************
|
|
*** 124,134 ****
|
|
PrivateKey var2 = this.mcServer.getKeyPair().getPrivate();
|
|
this.sharedKey = par1Packet252SharedKey.getSharedKey(var2);
|
|
|
|
if (!Arrays.equals(this.verifyToken, par1Packet252SharedKey.getVerifyToken(var2)))
|
|
{
|
|
! this.raiseErrorAndDisconnect("Invalid client reply");
|
|
}
|
|
|
|
this.myTCPConnection.addToSendQueue(new Packet252SharedKey());
|
|
}
|
|
|
|
--- 134,144 ----
|
|
PrivateKey var2 = this.mcServer.getKeyPair().getPrivate();
|
|
this.sharedKey = par1Packet252SharedKey.getSharedKey(var2);
|
|
|
|
if (!Arrays.equals(this.verifyToken, par1Packet252SharedKey.getVerifyToken(var2)))
|
|
{
|
|
! this.kickUser("Invalid client reply");
|
|
}
|
|
|
|
this.myTCPConnection.addToSendQueue(new Packet252SharedKey());
|
|
}
|
|
|
|
***************
|
|
*** 136,146 ****
|
|
{
|
|
if (par1Packet205ClientCommand.forceRespawn == 0)
|
|
{
|
|
if (this.field_92079_k)
|
|
{
|
|
! this.raiseErrorAndDisconnect("Duplicate login");
|
|
return;
|
|
}
|
|
|
|
this.field_92079_k = true;
|
|
|
|
--- 146,156 ----
|
|
{
|
|
if (par1Packet205ClientCommand.forceRespawn == 0)
|
|
{
|
|
if (this.field_92079_k)
|
|
{
|
|
! this.kickUser("Duplicate login");
|
|
return;
|
|
}
|
|
|
|
this.field_92079_k = true;
|
|
|
|
***************
|
|
*** 160,174 ****
|
|
/**
|
|
* on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd
|
|
*/
|
|
public void initializePlayerConnection()
|
|
{
|
|
! String var1 = this.mcServer.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getSocketAddress(), this.clientUsername);
|
|
|
|
if (var1 != null)
|
|
{
|
|
! this.raiseErrorAndDisconnect(var1);
|
|
}
|
|
else
|
|
{
|
|
EntityPlayerMP var2 = this.mcServer.getConfigurationManager().createPlayerForUser(this.clientUsername);
|
|
|
|
--- 170,184 ----
|
|
/**
|
|
* on success the specified username is connected to the minecraftInstance, otherwise they are packet255'd
|
|
*/
|
|
public void initializePlayerConnection()
|
|
{
|
|
! String var1 = this.mcServer.getConfigurationManager().allowUserToConnect(this.myTCPConnection.getRemoteAddress(), this.clientUsername);
|
|
|
|
if (var1 != null)
|
|
{
|
|
! this.kickUser(var1);
|
|
}
|
|
else
|
|
{
|
|
EntityPlayerMP var2 = this.mcServer.getConfigurationManager().createPlayerForUser(this.clientUsername);
|
|
|
|
***************
|
|
*** 176,192 ****
|
|
{
|
|
this.mcServer.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2);
|
|
}
|
|
}
|
|
|
|
! this.connectionComplete = true;
|
|
}
|
|
|
|
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)
|
|
{
|
|
this.mcServer.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection");
|
|
! this.connectionComplete = true;
|
|
}
|
|
|
|
/**
|
|
* Handle a server ping packet.
|
|
*/
|
|
--- 186,202 ----
|
|
{
|
|
this.mcServer.getConfigurationManager().initializeConnectionToPlayer(this.myTCPConnection, var2);
|
|
}
|
|
}
|
|
|
|
! this.finishedProcessing = true;
|
|
}
|
|
|
|
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)
|
|
{
|
|
this.mcServer.getLogAgent().logInfo(this.getUsernameAndAddress() + " lost connection");
|
|
! this.finishedProcessing = true;
|
|
}
|
|
|
|
/**
|
|
* Handle a server ping packet.
|
|
*/
|
|
***************
|
|
*** 234,263 ****
|
|
if (var8 != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread)
|
|
{
|
|
((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(var8);
|
|
}
|
|
|
|
! this.connectionComplete = true;
|
|
}
|
|
catch (Exception var7)
|
|
{
|
|
var7.printStackTrace();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does
|
|
! * nothing.
|
|
*/
|
|
public void unexpectedPacket(Packet par1Packet)
|
|
{
|
|
! this.raiseErrorAndDisconnect("Protocol error");
|
|
}
|
|
|
|
public String getUsernameAndAddress()
|
|
{
|
|
! return this.clientUsername != null ? this.clientUsername + " [" + this.myTCPConnection.getSocketAddress().toString() + "]" : this.myTCPConnection.getSocketAddress().toString();
|
|
}
|
|
|
|
/**
|
|
* determine if it is a server handler
|
|
*/
|
|
--- 244,273 ----
|
|
if (var8 != null && this.mcServer.getNetworkThread() instanceof DedicatedServerListenThread)
|
|
{
|
|
((DedicatedServerListenThread)this.mcServer.getNetworkThread()).func_71761_a(var8);
|
|
}
|
|
|
|
! this.finishedProcessing = true;
|
|
}
|
|
catch (Exception var7)
|
|
{
|
|
var7.printStackTrace();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Default handler called for packets that don't have their own handlers in NetServerHandler; kicks player from the
|
|
! * server.
|
|
*/
|
|
public void unexpectedPacket(Packet par1Packet)
|
|
{
|
|
! this.kickUser("Protocol error");
|
|
}
|
|
|
|
public String getUsernameAndAddress()
|
|
{
|
|
! return this.clientUsername != null ? this.clientUsername + " [" + this.myTCPConnection.getRemoteAddress().toString() + "]" : this.myTCPConnection.getRemoteAddress().toString();
|
|
}
|
|
|
|
/**
|
|
* determine if it is a server handler
|
|
*/
|
|
***************
|
|
*** 266,276 ****
|
|
return true;
|
|
}
|
|
|
|
public boolean isConnectionClosed()
|
|
{
|
|
! return this.connectionComplete;
|
|
}
|
|
|
|
/**
|
|
* Returns the server Id randomly generated by this login handler.
|
|
*/
|
|
--- 276,286 ----
|
|
return true;
|
|
}
|
|
|
|
public boolean isConnectionClosed()
|
|
{
|
|
! return this.finishedProcessing;
|
|
}
|
|
|
|
/**
|
|
* Returns the server Id randomly generated by this login handler.
|
|
*/
|
|
*** NetServerHandler.java Sat Feb 5 04:19:43 2022
|
|
--- NetServerHandler.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 23,40 ****
|
|
public EntityPlayerMP playerEntity;
|
|
|
|
/** incremented each tick */
|
|
private int currentTicks;
|
|
|
|
! /**
|
|
! * player is kicked if they float for over 80 ticks without flying enabled
|
|
! */
|
|
! private int ticksForFloatKick;
|
|
private boolean field_72584_h;
|
|
private int keepAliveRandomID;
|
|
private long keepAliveTimeSent;
|
|
! private static Random randomGenerator = new Random();
|
|
private long ticksOfLastKeepAlive;
|
|
private int chatSpamThresholdCount;
|
|
private int creativeItemCreationSpamThresholdTally;
|
|
|
|
/** The last known x position for this connection. */
|
|
--- 23,40 ----
|
|
public EntityPlayerMP playerEntity;
|
|
|
|
/** incremented each tick */
|
|
private int currentTicks;
|
|
|
|
! /** holds the amount of tick the player is floating */
|
|
! private int playerInAirTime;
|
|
private boolean field_72584_h;
|
|
private int keepAliveRandomID;
|
|
private long keepAliveTimeSent;
|
|
!
|
|
! /** The Java Random object. */
|
|
! private static Random rndmObj = new Random();
|
|
private long ticksOfLastKeepAlive;
|
|
private int chatSpamThresholdCount;
|
|
private int creativeItemCreationSpamThresholdTally;
|
|
|
|
/** The last known x position for this connection. */
|
|
***************
|
|
*** 58,70 ****
|
|
this.playerEntity = par3EntityPlayerMP;
|
|
par3EntityPlayerMP.playerNetServerHandler = this;
|
|
}
|
|
|
|
/**
|
|
! * run once each game tick
|
|
*/
|
|
! public void networkTick()
|
|
{
|
|
this.field_72584_h = false;
|
|
++this.currentTicks;
|
|
this.mcServer.theProfiler.startSection("packetflow");
|
|
this.netManager.processReadPackets();
|
|
--- 58,70 ----
|
|
this.playerEntity = par3EntityPlayerMP;
|
|
par3EntityPlayerMP.playerNetServerHandler = this;
|
|
}
|
|
|
|
/**
|
|
! * handle all the packets for the connection
|
|
*/
|
|
! public void handlePackets()
|
|
{
|
|
this.field_72584_h = false;
|
|
++this.currentTicks;
|
|
this.mcServer.theProfiler.startSection("packetflow");
|
|
this.netManager.processReadPackets();
|
|
***************
|
|
*** 72,83 ****
|
|
|
|
if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L)
|
|
{
|
|
this.ticksOfLastKeepAlive = (long)this.currentTicks;
|
|
this.keepAliveTimeSent = System.nanoTime() / 1000000L;
|
|
! this.keepAliveRandomID = randomGenerator.nextInt();
|
|
! this.sendPacketToPlayer(new Packet0KeepAlive(this.keepAliveRandomID));
|
|
}
|
|
|
|
if (this.chatSpamThresholdCount > 0)
|
|
{
|
|
--this.chatSpamThresholdCount;
|
|
--- 72,83 ----
|
|
|
|
if ((long)this.currentTicks - this.ticksOfLastKeepAlive > 20L)
|
|
{
|
|
this.ticksOfLastKeepAlive = (long)this.currentTicks;
|
|
this.keepAliveTimeSent = System.nanoTime() / 1000000L;
|
|
! this.keepAliveRandomID = rndmObj.nextInt();
|
|
! this.sendPacket(new Packet0KeepAlive(this.keepAliveRandomID));
|
|
}
|
|
|
|
if (this.chatSpamThresholdCount > 0)
|
|
{
|
|
--this.chatSpamThresholdCount;
|
|
***************
|
|
*** 90,105 ****
|
|
|
|
this.mcServer.theProfiler.endStartSection("playerTick");
|
|
this.mcServer.theProfiler.endSection();
|
|
}
|
|
|
|
! public void kickPlayerFromServer(String par1Str)
|
|
{
|
|
if (!this.connectionClosed)
|
|
{
|
|
this.playerEntity.mountEntityAndWakeUp();
|
|
! this.sendPacketToPlayer(new Packet255KickDisconnect(par1Str));
|
|
this.netManager.serverShutdown();
|
|
this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
|
|
this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity);
|
|
this.connectionClosed = true;
|
|
}
|
|
--- 90,108 ----
|
|
|
|
this.mcServer.theProfiler.endStartSection("playerTick");
|
|
this.mcServer.theProfiler.endSection();
|
|
}
|
|
|
|
! /**
|
|
! * Kick the offending player and give a reason why
|
|
! */
|
|
! public void kickPlayer(String par1Str)
|
|
{
|
|
if (!this.connectionClosed)
|
|
{
|
|
this.playerEntity.mountEntityAndWakeUp();
|
|
! this.sendPacket(new Packet255KickDisconnect(par1Str));
|
|
this.netManager.serverShutdown();
|
|
this.mcServer.getConfigurationManager().sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.left", new Object[] {this.playerEntity.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
|
|
this.mcServer.getConfigurationManager().playerLoggedOut(this.playerEntity);
|
|
this.connectionClosed = true;
|
|
}
|
|
***************
|
|
*** 205,222 ****
|
|
var9 = par1Packet10Flying.zPosition;
|
|
var13 = par1Packet10Flying.stance - par1Packet10Flying.yPosition;
|
|
|
|
if (!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D))
|
|
{
|
|
! this.kickPlayerFromServer("Illegal stance");
|
|
this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13);
|
|
return;
|
|
}
|
|
|
|
if (Math.abs(par1Packet10Flying.xPosition) > 3.2E7D || Math.abs(par1Packet10Flying.zPosition) > 3.2E7D)
|
|
{
|
|
! this.kickPlayerFromServer("Illegal position");
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (par1Packet10Flying.rotating)
|
|
--- 208,225 ----
|
|
var9 = par1Packet10Flying.zPosition;
|
|
var13 = par1Packet10Flying.stance - par1Packet10Flying.yPosition;
|
|
|
|
if (!this.playerEntity.isPlayerSleeping() && (var13 > 1.65D || var13 < 0.1D))
|
|
{
|
|
! this.kickPlayer("Illegal stance");
|
|
this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " had an illegal stance: " + var13);
|
|
return;
|
|
}
|
|
|
|
if (Math.abs(par1Packet10Flying.xPosition) > 3.2E7D || Math.abs(par1Packet10Flying.zPosition) > 3.2E7D)
|
|
{
|
|
! this.kickPlayer("Illegal position");
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (par1Packet10Flying.rotating)
|
|
***************
|
|
*** 292,319 ****
|
|
|
|
if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33))
|
|
{
|
|
if (var29 >= -0.03125D)
|
|
{
|
|
! ++this.ticksForFloatKick;
|
|
|
|
! if (this.ticksForFloatKick > 80)
|
|
{
|
|
this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!");
|
|
! this.kickPlayerFromServer("Flying is not enabled on this server");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.ticksForFloatKick = 0;
|
|
}
|
|
|
|
this.playerEntity.onGround = par1Packet10Flying.onGround;
|
|
this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
|
|
! this.playerEntity.updateFlyingState(this.playerEntity.posY - var3, par1Packet10Flying.onGround);
|
|
}
|
|
else if (this.currentTicks % 20 == 0)
|
|
{
|
|
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch);
|
|
}
|
|
--- 295,322 ----
|
|
|
|
if (!this.mcServer.isFlightAllowed() && !this.playerEntity.theItemInWorldManager.isCreative() && !var2.checkBlockCollision(var33))
|
|
{
|
|
if (var29 >= -0.03125D)
|
|
{
|
|
! ++this.playerInAirTime;
|
|
|
|
! if (this.playerInAirTime > 80)
|
|
{
|
|
this.mcServer.getLogAgent().logWarning(this.playerEntity.getCommandSenderName() + " was kicked for floating too long!");
|
|
! this.kickPlayer("Flying is not enabled on this server");
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.playerInAirTime = 0;
|
|
}
|
|
|
|
this.playerEntity.onGround = par1Packet10Flying.onGround;
|
|
this.mcServer.getConfigurationManager().serverUpdateMountedMovingPlayer(this.playerEntity);
|
|
! this.playerEntity.handleFalling(this.playerEntity.posY - var3, par1Packet10Flying.onGround);
|
|
}
|
|
else if (this.currentTicks % 20 == 0)
|
|
{
|
|
this.setPlayerLocation(this.lastPosX, this.lastPosY, this.lastPosZ, this.playerEntity.rotationYaw, this.playerEntity.rotationPitch);
|
|
}
|
|
***************
|
|
*** 328,338 ****
|
|
this.hasMoved = false;
|
|
this.lastPosX = par1;
|
|
this.lastPosY = par3;
|
|
this.lastPosZ = par5;
|
|
this.playerEntity.setPositionAndRotation(par1, par3, par5, par7, par8);
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet13PlayerLookMove(par1, par3 + 1.6200000047683716D, par3, par5, par7, par8, false));
|
|
}
|
|
|
|
public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig)
|
|
{
|
|
WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension);
|
|
--- 331,341 ----
|
|
this.hasMoved = false;
|
|
this.lastPosX = par1;
|
|
this.lastPosY = par3;
|
|
this.lastPosZ = par5;
|
|
this.playerEntity.setPositionAndRotation(par1, par3, par5, par7, par8);
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet13PlayerLookMove(par1, par3 + 1.6200000047683716D, par3, par5, par7, par8, false));
|
|
}
|
|
|
|
public void handleBlockDig(Packet14BlockDig par1Packet14BlockDig)
|
|
{
|
|
WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension);
|
|
***************
|
|
*** 397,425 ****
|
|
{
|
|
this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, par1Packet14BlockDig.face);
|
|
}
|
|
else
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2));
|
|
}
|
|
}
|
|
else if (par1Packet14BlockDig.status == 2)
|
|
{
|
|
! this.playerEntity.theItemInWorldManager.uncheckedTryHarvestBlock(var4, var5, var6);
|
|
|
|
if (var2.getBlockId(var4, var5, var6) != 0)
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2));
|
|
}
|
|
}
|
|
else if (par1Packet14BlockDig.status == 1)
|
|
{
|
|
this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(var4, var5, var6);
|
|
|
|
if (var2.getBlockId(var4, var5, var6) != 0)
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var4, var5, var6, var2));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 400,428 ----
|
|
{
|
|
this.playerEntity.theItemInWorldManager.onBlockClicked(var4, var5, var6, par1Packet14BlockDig.face);
|
|
}
|
|
else
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2));
|
|
}
|
|
}
|
|
else if (par1Packet14BlockDig.status == 2)
|
|
{
|
|
! this.playerEntity.theItemInWorldManager.blockRemoving(var4, var5, var6);
|
|
|
|
if (var2.getBlockId(var4, var5, var6) != 0)
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2));
|
|
}
|
|
}
|
|
else if (par1Packet14BlockDig.status == 1)
|
|
{
|
|
this.playerEntity.theItemInWorldManager.cancelDestroyingBlock(var4, var5, var6);
|
|
|
|
if (var2.getBlockId(var4, var5, var6) != 0)
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var4, var5, var6, var2));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 443,453 ****
|
|
|
|
this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3);
|
|
}
|
|
else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit()))
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[] {Integer.valueOf(this.mcServer.getBuildLimit())}).setColor(EnumChatFormatting.RED)));
|
|
var4 = true;
|
|
}
|
|
else
|
|
{
|
|
if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.mcServer.isBlockProtected(var2, var5, var6, var7, this.playerEntity))
|
|
--- 446,456 ----
|
|
|
|
this.playerEntity.theItemInWorldManager.tryUseItem(this.playerEntity, var2, var3);
|
|
}
|
|
else if (par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit() - 1 && (par1Packet15Place.getDirection() == 1 || par1Packet15Place.getYPosition() >= this.mcServer.getBuildLimit()))
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationWithSubstitutions("build.tooHigh", new Object[] {Integer.valueOf(this.mcServer.getBuildLimit())}).setColor(EnumChatFormatting.RED)));
|
|
var4 = true;
|
|
}
|
|
else
|
|
{
|
|
if (this.hasMoved && this.playerEntity.getDistanceSq((double)var5 + 0.5D, (double)var6 + 0.5D, (double)var7 + 0.5D) < 64.0D && !this.mcServer.isBlockProtected(var2, var5, var6, var7, this.playerEntity))
|
|
***************
|
|
*** 458,468 ****
|
|
var4 = true;
|
|
}
|
|
|
|
if (var4)
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2));
|
|
|
|
if (var8 == 0)
|
|
{
|
|
--var6;
|
|
}
|
|
--- 461,471 ----
|
|
var4 = true;
|
|
}
|
|
|
|
if (var4)
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2));
|
|
|
|
if (var8 == 0)
|
|
{
|
|
--var6;
|
|
}
|
|
***************
|
|
*** 490,500 ****
|
|
if (var8 == 5)
|
|
{
|
|
++var5;
|
|
}
|
|
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet53BlockChange(var5, var6, var7, var2));
|
|
}
|
|
|
|
var3 = this.playerEntity.inventory.getCurrentItem();
|
|
|
|
if (var3 != null && var3.stackSize == 0)
|
|
--- 493,503 ----
|
|
if (var8 == 5)
|
|
{
|
|
++var5;
|
|
}
|
|
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet53BlockChange(var5, var6, var7, var2));
|
|
}
|
|
|
|
var3 = this.playerEntity.inventory.getCurrentItem();
|
|
|
|
if (var3 != null && var3.stackSize == 0)
|
|
***************
|
|
*** 503,521 ****
|
|
var3 = null;
|
|
}
|
|
|
|
if (var3 == null || var3.getMaxItemUseDuration() == 0)
|
|
{
|
|
! this.playerEntity.playerInventoryBeingManipulated = true;
|
|
this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]);
|
|
Slot var9 = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem);
|
|
this.playerEntity.openContainer.detectAndSendChanges();
|
|
! this.playerEntity.playerInventoryBeingManipulated = false;
|
|
|
|
if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), par1Packet15Place.getItemStack()))
|
|
{
|
|
! this.sendPacketToPlayer(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem()));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)
|
|
--- 506,524 ----
|
|
var3 = null;
|
|
}
|
|
|
|
if (var3 == null || var3.getMaxItemUseDuration() == 0)
|
|
{
|
|
! this.playerEntity.isChangingQuantityOnly = true;
|
|
this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem] = ItemStack.copyItemStack(this.playerEntity.inventory.mainInventory[this.playerEntity.inventory.currentItem]);
|
|
Slot var9 = this.playerEntity.openContainer.getSlotFromInventory(this.playerEntity.inventory, this.playerEntity.inventory.currentItem);
|
|
this.playerEntity.openContainer.detectAndSendChanges();
|
|
! this.playerEntity.isChangingQuantityOnly = false;
|
|
|
|
if (!ItemStack.areItemStacksEqual(this.playerEntity.inventory.getCurrentItem(), par1Packet15Place.getItemStack()))
|
|
{
|
|
! this.sendPacket(new Packet103SetSlot(this.playerEntity.openContainer.windowId, var9.slotNumber, this.playerEntity.inventory.getCurrentItem()));
|
|
}
|
|
}
|
|
}
|
|
|
|
public void handleErrorMessage(String par1Str, Object[] par2ArrayOfObj)
|
|
***************
|
|
*** 531,553 ****
|
|
this.mcServer.initiateShutdown();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Default handler called for packets that don't have their own handlers in NetClientHandler; currentlly does
|
|
! * nothing.
|
|
*/
|
|
public void unexpectedPacket(Packet par1Packet)
|
|
{
|
|
this.mcServer.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + par1Packet.getClass());
|
|
! this.kickPlayerFromServer("Protocol error, unexpected packet");
|
|
}
|
|
|
|
/**
|
|
! * addToSendQueue. if it is a chat packet, check before sending it
|
|
*/
|
|
! public void sendPacketToPlayer(Packet par1Packet)
|
|
{
|
|
if (par1Packet instanceof Packet3Chat)
|
|
{
|
|
Packet3Chat var2 = (Packet3Chat)par1Packet;
|
|
int var3 = this.playerEntity.getChatVisibility();
|
|
--- 534,556 ----
|
|
this.mcServer.initiateShutdown();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Default handler called for packets that don't have their own handlers in NetServerHandler; kicks player from the
|
|
! * server.
|
|
*/
|
|
public void unexpectedPacket(Packet par1Packet)
|
|
{
|
|
this.mcServer.getLogAgent().logWarning(this.getClass() + " wasn\'t prepared to deal with a " + par1Packet.getClass());
|
|
! this.kickPlayer("Protocol error, unexpected packet");
|
|
}
|
|
|
|
/**
|
|
! * Adds the packet to the underlying network manager's send queue.
|
|
*/
|
|
! public void sendPacket(Packet par1Packet)
|
|
{
|
|
if (par1Packet instanceof Packet3Chat)
|
|
{
|
|
Packet3Chat var2 = (Packet3Chat)par1Packet;
|
|
int var3 = this.playerEntity.getChatVisibility();
|
|
***************
|
|
*** 592,621 ****
|
|
|
|
public void handleChat(Packet3Chat par1Packet3Chat)
|
|
{
|
|
if (this.playerEntity.getChatVisibility() == 2)
|
|
{
|
|
! this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED)));
|
|
}
|
|
else
|
|
{
|
|
this.playerEntity.func_143004_u();
|
|
String var2 = par1Packet3Chat.message;
|
|
|
|
if (var2.length() > 100)
|
|
{
|
|
! this.kickPlayerFromServer("Chat message too long");
|
|
}
|
|
else
|
|
{
|
|
var2 = org.apache.commons.lang3.StringUtils.normalizeSpace(var2);
|
|
|
|
for (int var3 = 0; var3 < var2.length(); ++var3)
|
|
{
|
|
if (!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3)))
|
|
{
|
|
! this.kickPlayerFromServer("Illegal characters in chat");
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (var2.startsWith("/"))
|
|
--- 595,624 ----
|
|
|
|
public void handleChat(Packet3Chat par1Packet3Chat)
|
|
{
|
|
if (this.playerEntity.getChatVisibility() == 2)
|
|
{
|
|
! this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED)));
|
|
}
|
|
else
|
|
{
|
|
this.playerEntity.func_143004_u();
|
|
String var2 = par1Packet3Chat.message;
|
|
|
|
if (var2.length() > 100)
|
|
{
|
|
! this.kickPlayer("Chat message too long");
|
|
}
|
|
else
|
|
{
|
|
var2 = org.apache.commons.lang3.StringUtils.normalizeSpace(var2);
|
|
|
|
for (int var3 = 0; var3 < var2.length(); ++var3)
|
|
{
|
|
if (!ChatAllowedCharacters.isAllowedCharacter(var2.charAt(var3)))
|
|
{
|
|
! this.kickPlayer("Illegal characters in chat");
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (var2.startsWith("/"))
|
|
***************
|
|
*** 624,634 ****
|
|
}
|
|
else
|
|
{
|
|
if (this.playerEntity.getChatVisibility() == 1)
|
|
{
|
|
! this.sendPacketToPlayer(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED)));
|
|
return;
|
|
}
|
|
|
|
ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), var2});
|
|
this.mcServer.getConfigurationManager().func_110459_a(var4, false);
|
|
--- 627,637 ----
|
|
}
|
|
else
|
|
{
|
|
if (this.playerEntity.getChatVisibility() == 1)
|
|
{
|
|
! this.sendPacket(new Packet3Chat(ChatMessageComponent.createFromTranslationKey("chat.cannotSend").setColor(EnumChatFormatting.RED)));
|
|
return;
|
|
}
|
|
|
|
ChatMessageComponent var4 = ChatMessageComponent.createFromTranslationWithSubstitutions("chat.type.text", new Object[] {this.playerEntity.getTranslatedEntityName(), var2});
|
|
this.mcServer.getConfigurationManager().func_110459_a(var4, false);
|
|
***************
|
|
*** 636,646 ****
|
|
|
|
this.chatSpamThresholdCount += 20;
|
|
|
|
if (this.chatSpamThresholdCount > 200 && !this.mcServer.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName()))
|
|
{
|
|
! this.kickPlayerFromServer("disconnect.spam");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 639,649 ----
|
|
|
|
this.chatSpamThresholdCount += 20;
|
|
|
|
if (this.chatSpamThresholdCount > 200 && !this.mcServer.getConfigurationManager().isPlayerOpped(this.playerEntity.getCommandSenderName()))
|
|
{
|
|
! this.kickPlayer("disconnect.spam");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 707,721 ****
|
|
{
|
|
this.netManager.networkShutdown("disconnect.quitting", new Object[0]);
|
|
}
|
|
|
|
/**
|
|
! * returns 0 for memoryMapped connections
|
|
*/
|
|
! public int packetSize()
|
|
{
|
|
! return this.netManager.packetSize();
|
|
}
|
|
|
|
public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity)
|
|
{
|
|
WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension);
|
|
--- 710,724 ----
|
|
{
|
|
this.netManager.networkShutdown("disconnect.quitting", new Object[0]);
|
|
}
|
|
|
|
/**
|
|
! * return the number of chuckDataPackets from the netManager
|
|
*/
|
|
! public int getNumChunkDataPackets()
|
|
{
|
|
! return this.netManager.getNumChunkDataPackets();
|
|
}
|
|
|
|
public void handleUseEntity(Packet7UseEntity par1Packet7UseEntity)
|
|
{
|
|
WorldServer var2 = this.mcServer.worldServerForDimension(this.playerEntity.dimension);
|
|
***************
|
|
*** 740,750 ****
|
|
}
|
|
else if (par1Packet7UseEntity.isLeftClick == 1)
|
|
{
|
|
if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity)
|
|
{
|
|
! this.kickPlayerFromServer("Attempting to attack an invalid entity");
|
|
this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity");
|
|
return;
|
|
}
|
|
|
|
this.playerEntity.attackTargetEntityWithCurrentItem(var3);
|
|
--- 743,753 ----
|
|
}
|
|
else if (par1Packet7UseEntity.isLeftClick == 1)
|
|
{
|
|
if (var3 instanceof EntityItem || var3 instanceof EntityXPOrb || var3 instanceof EntityArrow || var3 == this.playerEntity)
|
|
{
|
|
! this.kickPlayer("Attempting to attack an invalid entity");
|
|
this.mcServer.logWarning("Player " + this.playerEntity.getCommandSenderName() + " tried to attack an invalid entity");
|
|
return;
|
|
}
|
|
|
|
this.playerEntity.attackTargetEntityWithCurrentItem(var3);
|
|
***************
|
|
*** 759,793 ****
|
|
|
|
if (par1Packet205ClientCommand.forceRespawn == 1)
|
|
{
|
|
if (this.playerEntity.playerConqueredTheEnd)
|
|
{
|
|
! this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, true);
|
|
}
|
|
else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled())
|
|
{
|
|
if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner()))
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
|
|
this.mcServer.deleteWorldAndStopServer();
|
|
}
|
|
else
|
|
{
|
|
BanEntry var2 = new BanEntry(this.playerEntity.getCommandSenderName());
|
|
var2.setBanReason("Death in Hardcore");
|
|
this.mcServer.getConfigurationManager().getBannedPlayers().put(var2);
|
|
! this.playerEntity.playerNetServerHandler.kickPlayerFromServer("You have died. Game over, man, it\'s game over!");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.playerEntity.getHealth() > 0.0F)
|
|
{
|
|
return;
|
|
}
|
|
|
|
! this.playerEntity = this.mcServer.getConfigurationManager().respawnPlayer(this.playerEntity, 0, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 762,796 ----
|
|
|
|
if (par1Packet205ClientCommand.forceRespawn == 1)
|
|
{
|
|
if (this.playerEntity.playerConqueredTheEnd)
|
|
{
|
|
! this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, true);
|
|
}
|
|
else if (this.playerEntity.getServerForPlayer().getWorldInfo().isHardcoreModeEnabled())
|
|
{
|
|
if (this.mcServer.isSinglePlayer() && this.playerEntity.getCommandSenderName().equals(this.mcServer.getServerOwner()))
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!");
|
|
this.mcServer.deleteWorldAndStopServer();
|
|
}
|
|
else
|
|
{
|
|
BanEntry var2 = new BanEntry(this.playerEntity.getCommandSenderName());
|
|
var2.setBanReason("Death in Hardcore");
|
|
this.mcServer.getConfigurationManager().getBannedPlayers().put(var2);
|
|
! this.playerEntity.playerNetServerHandler.kickPlayer("You have died. Game over, man, it\'s game over!");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if (this.playerEntity.getHealth() > 0.0F)
|
|
{
|
|
return;
|
|
}
|
|
|
|
! this.playerEntity = this.mcServer.getConfigurationManager().recreatePlayerEntity(this.playerEntity, 0, false);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 812,855 ****
|
|
|
|
public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick)
|
|
{
|
|
this.playerEntity.func_143004_u();
|
|
|
|
! if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
|
|
{
|
|
ItemStack var2 = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity);
|
|
|
|
if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, var2))
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true));
|
|
! this.playerEntity.playerInventoryBeingManipulated = true;
|
|
this.playerEntity.openContainer.detectAndSendChanges();
|
|
this.playerEntity.updateHeldItem();
|
|
! this.playerEntity.playerInventoryBeingManipulated = false;
|
|
}
|
|
else
|
|
{
|
|
this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action));
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, false));
|
|
! this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, false);
|
|
ArrayList var3 = new ArrayList();
|
|
|
|
for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4)
|
|
{
|
|
var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack());
|
|
}
|
|
|
|
! this.playerEntity.sendContainerAndContentsToPlayer(this.playerEntity.openContainer, var3);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem)
|
|
{
|
|
this.playerEntity.func_143004_u();
|
|
|
|
! if (this.playerEntity.openContainer.windowId == par1Packet108EnchantItem.windowId && this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
|
|
{
|
|
this.playerEntity.openContainer.enchantItem(this.playerEntity, par1Packet108EnchantItem.enchantment);
|
|
this.playerEntity.openContainer.detectAndSendChanges();
|
|
}
|
|
}
|
|
--- 815,858 ----
|
|
|
|
public void handleWindowClick(Packet102WindowClick par1Packet102WindowClick)
|
|
{
|
|
this.playerEntity.func_143004_u();
|
|
|
|
! if (this.playerEntity.openContainer.windowId == par1Packet102WindowClick.window_Id && this.playerEntity.openContainer.getCanCraft(this.playerEntity))
|
|
{
|
|
ItemStack var2 = this.playerEntity.openContainer.slotClick(par1Packet102WindowClick.inventorySlot, par1Packet102WindowClick.mouseClick, par1Packet102WindowClick.holdingShift, this.playerEntity);
|
|
|
|
if (ItemStack.areItemStacksEqual(par1Packet102WindowClick.itemStack, var2))
|
|
{
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, true));
|
|
! this.playerEntity.isChangingQuantityOnly = true;
|
|
this.playerEntity.openContainer.detectAndSendChanges();
|
|
this.playerEntity.updateHeldItem();
|
|
! this.playerEntity.isChangingQuantityOnly = false;
|
|
}
|
|
else
|
|
{
|
|
this.field_72586_s.addKey(this.playerEntity.openContainer.windowId, Short.valueOf(par1Packet102WindowClick.action));
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet106Transaction(par1Packet102WindowClick.window_Id, par1Packet102WindowClick.action, false));
|
|
! this.playerEntity.openContainer.setCanCraft(this.playerEntity, false);
|
|
ArrayList var3 = new ArrayList();
|
|
|
|
for (int var4 = 0; var4 < this.playerEntity.openContainer.inventorySlots.size(); ++var4)
|
|
{
|
|
var3.add(((Slot)this.playerEntity.openContainer.inventorySlots.get(var4)).getStack());
|
|
}
|
|
|
|
! this.playerEntity.updateCraftingInventory(this.playerEntity.openContainer, var3);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void handleEnchantItem(Packet108EnchantItem par1Packet108EnchantItem)
|
|
{
|
|
this.playerEntity.func_143004_u();
|
|
|
|
! if (this.playerEntity.openContainer.windowId == par1Packet108EnchantItem.windowId && this.playerEntity.openContainer.getCanCraft(this.playerEntity))
|
|
{
|
|
this.playerEntity.openContainer.enchantItem(this.playerEntity, par1Packet108EnchantItem.enchantment);
|
|
this.playerEntity.openContainer.detectAndSendChanges();
|
|
}
|
|
}
|
|
***************
|
|
*** 876,886 ****
|
|
else
|
|
{
|
|
this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, var3);
|
|
}
|
|
|
|
! this.playerEntity.inventoryContainer.setPlayerIsPresent(this.playerEntity, true);
|
|
}
|
|
else if (var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200)
|
|
{
|
|
this.creativeItemCreationSpamThresholdTally += 20;
|
|
EntityItem var7 = this.playerEntity.dropPlayerItem(var3);
|
|
--- 879,889 ----
|
|
else
|
|
{
|
|
this.playerEntity.inventoryContainer.putStackInSlot(par1Packet107CreativeSetSlot.slot, var3);
|
|
}
|
|
|
|
! this.playerEntity.inventoryContainer.setCanCraft(this.playerEntity, true);
|
|
}
|
|
else if (var2 && var5 && var6 && this.creativeItemCreationSpamThresholdTally < 200)
|
|
{
|
|
this.creativeItemCreationSpamThresholdTally += 20;
|
|
EntityItem var7 = this.playerEntity.dropPlayerItem(var3);
|
|
***************
|
|
*** 895,907 ****
|
|
|
|
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
|
|
{
|
|
Short var2 = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId);
|
|
|
|
! if (var2 != null && par1Packet106Transaction.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.isPlayerNotUsingContainer(this.playerEntity))
|
|
{
|
|
! this.playerEntity.openContainer.setPlayerIsPresent(this.playerEntity, true);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Updates Client side signs
|
|
--- 898,910 ----
|
|
|
|
public void handleTransaction(Packet106Transaction par1Packet106Transaction)
|
|
{
|
|
Short var2 = (Short)this.field_72586_s.lookup(this.playerEntity.openContainer.windowId);
|
|
|
|
! if (var2 != null && par1Packet106Transaction.shortWindowId == var2.shortValue() && this.playerEntity.openContainer.windowId == par1Packet106Transaction.windowId && !this.playerEntity.openContainer.getCanCraft(this.playerEntity))
|
|
{
|
|
! this.playerEntity.openContainer.setCanCraft(this.playerEntity, true);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Updates Client side signs
|
|
***************
|
|
*** 1008,1018 ****
|
|
{
|
|
var2.append("\u0000");
|
|
}
|
|
}
|
|
|
|
! this.playerEntity.playerNetServerHandler.sendPacketToPlayer(new Packet203AutoComplete(var2.toString()));
|
|
}
|
|
|
|
public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo)
|
|
{
|
|
this.playerEntity.updateClientInfo(par1Packet204ClientInfo);
|
|
--- 1011,1021 ----
|
|
{
|
|
var2.append("\u0000");
|
|
}
|
|
}
|
|
|
|
! this.playerEntity.playerNetServerHandler.sendPacket(new Packet203AutoComplete(var2.toString()));
|
|
}
|
|
|
|
public void handleClientInfo(Packet204ClientInfo par1Packet204ClientInfo)
|
|
{
|
|
this.playerEntity.updateClientInfo(par1Packet204ClientInfo);
|
|
*** NetworkListenThread.java Sat Feb 5 04:19:43 2022
|
|
--- NetworkListenThread.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 33,53 ****
|
|
{
|
|
this.isListening = false;
|
|
}
|
|
|
|
/**
|
|
! * processes packets and pending connections
|
|
*/
|
|
! public void networkTick()
|
|
{
|
|
for (int var1 = 0; var1 < this.connections.size(); ++var1)
|
|
{
|
|
NetServerHandler var2 = (NetServerHandler)this.connections.get(var1);
|
|
|
|
try
|
|
{
|
|
! var2.networkTick();
|
|
}
|
|
catch (Exception var6)
|
|
{
|
|
if (var2.netManager instanceof MemoryConnection)
|
|
{
|
|
--- 33,53 ----
|
|
{
|
|
this.isListening = false;
|
|
}
|
|
|
|
/**
|
|
! * Handles all incoming connections and packets
|
|
*/
|
|
! public void handleNetworkListenThread()
|
|
{
|
|
for (int var1 = 0; var1 < this.connections.size(); ++var1)
|
|
{
|
|
NetServerHandler var2 = (NetServerHandler)this.connections.get(var1);
|
|
|
|
try
|
|
{
|
|
! var2.handlePackets();
|
|
}
|
|
catch (Exception var6)
|
|
{
|
|
if (var2.netManager instanceof MemoryConnection)
|
|
{
|
|
***************
|
|
*** 56,66 ****
|
|
var5.addCrashSectionCallable("Connection", new CallableConnectionName(this, var2));
|
|
throw new ReportedException(var4);
|
|
}
|
|
|
|
this.mcServer.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6);
|
|
! var2.kickPlayerFromServer("Internal server error");
|
|
}
|
|
|
|
if (var2.connectionClosed)
|
|
{
|
|
this.connections.remove(var1--);
|
|
--- 56,66 ----
|
|
var5.addCrashSectionCallable("Connection", new CallableConnectionName(this, var2));
|
|
throw new ReportedException(var4);
|
|
}
|
|
|
|
this.mcServer.getLogAgent().logWarningException("Failed to handle packet for " + var2.playerEntity.getEntityName() + "/" + var2.playerEntity.getPlayerIP() + ": " + var6, var6);
|
|
! var2.kickPlayer("Internal server error");
|
|
}
|
|
|
|
if (var2.connectionClosed)
|
|
{
|
|
this.connections.remove(var1--);
|
|
*** Packet.java Sat Feb 5 04:19:43 2022
|
|
--- Packet.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 25,35 ****
|
|
/** List of the server's packet IDs. */
|
|
private static Set serverPacketIdList = new HashSet();
|
|
protected ILogAgent field_98193_m;
|
|
|
|
/** the system time in milliseconds when this packet was created. */
|
|
! public final long creationTimeMillis = MinecraftServer.getSystemTimeMillis();
|
|
public static long receivedID;
|
|
public static long receivedSize;
|
|
|
|
/** Assumed to be sequential by the profiler. */
|
|
public static long sentID;
|
|
--- 25,35 ----
|
|
/** List of the server's packet IDs. */
|
|
private static Set serverPacketIdList = new HashSet();
|
|
protected ILogAgent field_98193_m;
|
|
|
|
/** the system time in milliseconds when this packet was created. */
|
|
! public final long creationTimeMillis = MinecraftServer.getCurrentTimeMillis();
|
|
public static long receivedID;
|
|
public static long receivedSize;
|
|
|
|
/** Assumed to be sequential by the profiler. */
|
|
public static long sentID;
|
|
*** Packet102WindowClick.java Sat Feb 5 04:19:43 2022
|
|
--- Packet102WindowClick.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 20,41 ****
|
|
|
|
/** Item stack for inventory */
|
|
public ItemStack itemStack;
|
|
public int holdingShift;
|
|
|
|
- public Packet102WindowClick() {}
|
|
-
|
|
- public Packet102WindowClick(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, short par6)
|
|
- {
|
|
- this.window_Id = par1;
|
|
- this.inventorySlot = par2;
|
|
- this.mouseClick = par3;
|
|
- this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null;
|
|
- this.action = par6;
|
|
- this.holdingShift = par4;
|
|
- }
|
|
-
|
|
/**
|
|
* Passes this Packet on to the NetHandler for processing.
|
|
*/
|
|
public void processPacket(NetHandler par1NetHandler)
|
|
{
|
|
--- 20,29 ----
|
|
*** Packet107CreativeSetSlot.java Sat Feb 5 04:19:43 2022
|
|
--- Packet107CreativeSetSlot.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 7,24 ****
|
|
public class Packet107CreativeSetSlot extends Packet
|
|
{
|
|
public int slot;
|
|
public ItemStack itemStack;
|
|
|
|
- public Packet107CreativeSetSlot() {}
|
|
-
|
|
- public Packet107CreativeSetSlot(int par1, ItemStack par2ItemStack)
|
|
- {
|
|
- this.slot = par1;
|
|
- this.itemStack = par2ItemStack != null ? par2ItemStack.copy() : null;
|
|
- }
|
|
-
|
|
/**
|
|
* Passes this Packet on to the NetHandler for processing.
|
|
*/
|
|
public void processPacket(NetHandler par1NetHandler)
|
|
{
|
|
--- 7,16 ----
|
|
*** Packet108EnchantItem.java Sat Feb 5 04:19:43 2022
|
|
--- Packet108EnchantItem.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 11,28 ****
|
|
/**
|
|
* The position of the enchantment on the enchantment table window, starting with 0 as the topmost one.
|
|
*/
|
|
public int enchantment;
|
|
|
|
- public Packet108EnchantItem() {}
|
|
-
|
|
- public Packet108EnchantItem(int par1, int par2)
|
|
- {
|
|
- this.windowId = par1;
|
|
- this.enchantment = par2;
|
|
- }
|
|
-
|
|
/**
|
|
* Passes this Packet on to the NetHandler for processing.
|
|
*/
|
|
public void processPacket(NetHandler par1NetHandler)
|
|
{
|
|
--- 11,20 ----
|
|
*** Packet10Flying.java Sat Feb 5 04:19:43 2022
|
|
--- Packet10Flying.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 31,47 ****
|
|
public boolean moving;
|
|
|
|
/** Boolean set to true if the player is rotating. */
|
|
public boolean rotating;
|
|
|
|
- public Packet10Flying() {}
|
|
-
|
|
- public Packet10Flying(boolean par1)
|
|
- {
|
|
- this.onGround = par1;
|
|
- }
|
|
-
|
|
/**
|
|
* Passes this Packet on to the NetHandler for processing.
|
|
*/
|
|
public void processPacket(NetHandler par1NetHandler)
|
|
{
|
|
--- 31,40 ----
|
|
*** Packet11PlayerPosition.java Sat Feb 5 04:19:43 2022
|
|
--- Packet11PlayerPosition.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 9,28 ****
|
|
public Packet11PlayerPosition()
|
|
{
|
|
this.moving = true;
|
|
}
|
|
|
|
- public Packet11PlayerPosition(double par1, double par3, double par5, double par7, boolean par9)
|
|
- {
|
|
- this.xPosition = par1;
|
|
- this.yPosition = par3;
|
|
- this.stance = par5;
|
|
- this.zPosition = par7;
|
|
- this.onGround = par9;
|
|
- this.moving = true;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 9,18 ----
|
|
*** Packet12PlayerLook.java Sat Feb 5 04:19:43 2022
|
|
--- Packet12PlayerLook.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 9,26 ****
|
|
public Packet12PlayerLook()
|
|
{
|
|
this.rotating = true;
|
|
}
|
|
|
|
- public Packet12PlayerLook(float par1, float par2, boolean par3)
|
|
- {
|
|
- this.yaw = par1;
|
|
- this.pitch = par2;
|
|
- this.onGround = par3;
|
|
- this.rotating = true;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 9,18 ----
|
|
*** Packet14BlockDig.java Sat Feb 5 04:19:43 2022
|
|
--- Packet14BlockDig.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 19,39 ****
|
|
public int face;
|
|
|
|
/** Status of the digging (started, ongoing, broken). */
|
|
public int status;
|
|
|
|
- public Packet14BlockDig() {}
|
|
-
|
|
- public Packet14BlockDig(int par1, int par2, int par3, int par4, int par5)
|
|
- {
|
|
- this.status = par1;
|
|
- this.xPosition = par2;
|
|
- this.yPosition = par3;
|
|
- this.zPosition = par4;
|
|
- this.face = par5;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 19,28 ----
|
|
*** Packet15Place.java Sat Feb 5 04:19:43 2022
|
|
--- Packet15Place.java Sat Feb 5 04:19:57 2022
|
|
***************
|
|
*** 21,44 ****
|
|
private float yOffset;
|
|
|
|
/** The offset from zPosition where the actual click took place */
|
|
private float zOffset;
|
|
|
|
- public Packet15Place() {}
|
|
-
|
|
- public Packet15Place(int par1, int par2, int par3, int par4, ItemStack par5ItemStack, float par6, float par7, float par8)
|
|
- {
|
|
- this.xPosition = par1;
|
|
- this.yPosition = par2;
|
|
- this.zPosition = par3;
|
|
- this.direction = par4;
|
|
- this.itemStack = par5ItemStack != null ? par5ItemStack.copy() : null;
|
|
- this.xOffset = par6;
|
|
- this.yOffset = par7;
|
|
- this.zOffset = par8;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 21,30 ----
|
|
*** Packet19EntityAction.java Sat Feb 5 04:19:43 2022
|
|
--- Packet19EntityAction.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 14,37 ****
|
|
* horse GUI
|
|
*/
|
|
public int action;
|
|
public int auxData;
|
|
|
|
- public Packet19EntityAction() {}
|
|
-
|
|
- public Packet19EntityAction(Entity par1Entity, int par2)
|
|
- {
|
|
- this(par1Entity, par2, 0);
|
|
- }
|
|
-
|
|
- public Packet19EntityAction(Entity par1Entity, int par2, int par3)
|
|
- {
|
|
- this.entityId = par1Entity.entityId;
|
|
- this.action = par2;
|
|
- this.auxData = par3;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 14,23 ----
|
|
*** Packet202PlayerAbilities.java Sat Feb 5 04:19:43 2022
|
|
--- Packet202PlayerAbilities.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 140,165 ****
|
|
public void setCreativeMode(boolean par1)
|
|
{
|
|
this.isCreativeMode = par1;
|
|
}
|
|
|
|
- public float getFlySpeed()
|
|
- {
|
|
- return this.flySpeed;
|
|
- }
|
|
-
|
|
/**
|
|
* Sets the flying speed.
|
|
*/
|
|
public void setFlySpeed(float par1)
|
|
{
|
|
this.flySpeed = par1;
|
|
- }
|
|
-
|
|
- public float getWalkSpeed()
|
|
- {
|
|
- return this.walkSpeed;
|
|
}
|
|
|
|
/**
|
|
* Sets the walking speed.
|
|
*/
|
|
--- 140,155 ----
|
|
*** Packet204ClientInfo.java Sat Feb 5 04:19:43 2022
|
|
--- Packet204ClientInfo.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 11,32 ****
|
|
private int chatVisisble;
|
|
private boolean chatColours;
|
|
private int gameDifficulty;
|
|
private boolean showCape;
|
|
|
|
- public Packet204ClientInfo() {}
|
|
-
|
|
- public Packet204ClientInfo(String par1Str, int par2, int par3, boolean par4, int par5, boolean par6)
|
|
- {
|
|
- this.language = par1Str;
|
|
- this.renderDistance = par2;
|
|
- this.chatVisisble = par3;
|
|
- this.chatColours = par4;
|
|
- this.gameDifficulty = par5;
|
|
- this.showCape = par6;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 11,20 ----
|
|
*** Packet205ClientCommand.java Sat Feb 5 04:19:43 2022
|
|
--- Packet205ClientCommand.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 9,25 ****
|
|
/**
|
|
* 0 sent to a netLoginHandler starts the server, 1 sent to NetServerHandler forces a respawn
|
|
*/
|
|
public int forceRespawn;
|
|
|
|
- public Packet205ClientCommand() {}
|
|
-
|
|
- public Packet205ClientCommand(int par1)
|
|
- {
|
|
- this.forceRespawn = par1;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 9,18 ----
|
|
*** Packet20NamedEntitySpawn.java Sat Feb 5 04:19:43 2022
|
|
--- Packet20NamedEntitySpawn.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 94,109 ****
|
|
*/
|
|
public int getPacketSize()
|
|
{
|
|
return 28;
|
|
}
|
|
-
|
|
- public List getWatchedMetadata()
|
|
- {
|
|
- if (this.metadataWatchableObjects == null)
|
|
- {
|
|
- this.metadataWatchableObjects = this.metadata.getAllWatched();
|
|
- }
|
|
-
|
|
- return this.metadataWatchableObjects;
|
|
- }
|
|
}
|
|
--- 94,99 ----
|
|
*** Packet24MobSpawn.java Sat Feb 5 04:19:43 2022
|
|
--- Packet24MobSpawn.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 142,157 ****
|
|
*/
|
|
public int getPacketSize()
|
|
{
|
|
return 26;
|
|
}
|
|
-
|
|
- public List getMetadata()
|
|
- {
|
|
- if (this.metadata == null)
|
|
- {
|
|
- this.metadata = this.metaData.getAllWatched();
|
|
- }
|
|
-
|
|
- return this.metadata;
|
|
- }
|
|
}
|
|
--- 142,147 ----
|
|
*** Packet252SharedKey.java Sat Feb 5 04:19:43 2022
|
|
--- Packet252SharedKey.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 2,12 ****
|
|
|
|
import java.io.DataInput;
|
|
import java.io.DataOutput;
|
|
import java.io.IOException;
|
|
import java.security.PrivateKey;
|
|
- import java.security.PublicKey;
|
|
import javax.crypto.SecretKey;
|
|
|
|
public class Packet252SharedKey extends Packet
|
|
{
|
|
private byte[] sharedSecret = new byte[0];
|
|
--- 2,11 ----
|
|
***************
|
|
*** 15,33 ****
|
|
/**
|
|
* Secret AES key decrypted from sharedSecret via the server's private RSA key
|
|
*/
|
|
private SecretKey sharedKey;
|
|
|
|
- public Packet252SharedKey() {}
|
|
-
|
|
- public Packet252SharedKey(SecretKey par1SecretKey, PublicKey par2PublicKey, byte[] par3ArrayOfByte)
|
|
- {
|
|
- this.sharedKey = par1SecretKey;
|
|
- this.sharedSecret = CryptManager.encryptData(par2PublicKey, par1SecretKey.getEncoded());
|
|
- this.verifyToken = CryptManager.encryptData(par2PublicKey, par3ArrayOfByte);
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 14,23 ----
|
|
***************
|
|
*** 75,85 ****
|
|
{
|
|
return this.getSharedKey((PrivateKey)null);
|
|
}
|
|
|
|
/**
|
|
! * Return verifyToken
|
|
*/
|
|
public byte[] getVerifyToken(PrivateKey par1PrivateKey)
|
|
{
|
|
return par1PrivateKey == null ? this.verifyToken : CryptManager.decryptData(par1PrivateKey, this.verifyToken);
|
|
}
|
|
--- 65,75 ----
|
|
{
|
|
return this.getSharedKey((PrivateKey)null);
|
|
}
|
|
|
|
/**
|
|
! * Return verifyToken, decrypting it with the server's RSA private key
|
|
*/
|
|
public byte[] getVerifyToken(PrivateKey par1PrivateKey)
|
|
{
|
|
return par1PrivateKey == null ? this.verifyToken : CryptManager.decryptData(par1PrivateKey, this.verifyToken);
|
|
}
|
|
*** Packet253ServerAuthData.java Sat Feb 5 04:19:43 2022
|
|
--- Packet253ServerAuthData.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 53,73 ****
|
|
*/
|
|
public int getPacketSize()
|
|
{
|
|
return 2 + this.serverId.length() * 2 + 2 + this.publicKey.getEncoded().length + 2 + this.verifyToken.length;
|
|
}
|
|
-
|
|
- public String getServerId()
|
|
- {
|
|
- return this.serverId;
|
|
- }
|
|
-
|
|
- public PublicKey getPublicKey()
|
|
- {
|
|
- return this.publicKey;
|
|
- }
|
|
-
|
|
- public byte[] getVerifyToken()
|
|
- {
|
|
- return this.verifyToken;
|
|
- }
|
|
}
|
|
--- 53,58 ----
|
|
*** Packet254ServerPing.java Sat Feb 5 04:19:43 2022
|
|
--- Packet254ServerPing.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 11,29 ****
|
|
/** Always 1, unless readByte threw an exception. */
|
|
public int readSuccessfully;
|
|
public String field_140052_b;
|
|
public int field_140053_c;
|
|
|
|
- public Packet254ServerPing() {}
|
|
-
|
|
- public Packet254ServerPing(int par1, String par2Str, int par3)
|
|
- {
|
|
- this.readSuccessfully = par1;
|
|
- this.field_140052_b = par2Str;
|
|
- this.field_140053_c = par3;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 11,20 ----
|
|
*** Packet27PlayerInput.java Sat Feb 5 04:19:43 2022
|
|
--- Packet27PlayerInput.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 9,28 ****
|
|
private float field_111017_a;
|
|
private float field_111015_b;
|
|
private boolean field_111016_c;
|
|
private boolean field_111014_d;
|
|
|
|
- public Packet27PlayerInput() {}
|
|
-
|
|
- public Packet27PlayerInput(float par1, float par2, boolean par3, boolean par4)
|
|
- {
|
|
- this.field_111017_a = par1;
|
|
- this.field_111015_b = par2;
|
|
- this.field_111016_c = par3;
|
|
- this.field_111014_d = par4;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 9,18 ----
|
|
*** Packet2ClientProtocol.java Sat Feb 5 04:19:43 2022
|
|
--- Packet2ClientProtocol.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 9,28 ****
|
|
private int protocolVersion;
|
|
private String username;
|
|
private String serverHost;
|
|
private int serverPort;
|
|
|
|
- public Packet2ClientProtocol() {}
|
|
-
|
|
- public Packet2ClientProtocol(int par1, String par2Str, String par3Str, int par4)
|
|
- {
|
|
- this.protocolVersion = par1;
|
|
- this.username = par2Str;
|
|
- this.serverHost = par3Str;
|
|
- this.serverPort = par4;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 9,18 ----
|
|
*** Packet40EntityMetadata.java Sat Feb 5 04:19:43 2022
|
|
--- Packet40EntityMetadata.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 57,67 ****
|
|
*/
|
|
public int getPacketSize()
|
|
{
|
|
return 5;
|
|
}
|
|
-
|
|
- public List getMetadata()
|
|
- {
|
|
- return this.metadata;
|
|
- }
|
|
}
|
|
--- 57,62 ----
|
|
*** Packet41EntityEffect.java Sat Feb 5 04:19:43 2022
|
|
--- Packet41EntityEffect.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 52,69 ****
|
|
par1DataOutput.writeByte(this.effectAmplifier);
|
|
par1DataOutput.writeShort(this.duration);
|
|
}
|
|
|
|
/**
|
|
- * Returns true if duration is at maximum, false otherwise.
|
|
- */
|
|
- public boolean isDurationMax()
|
|
- {
|
|
- return this.duration == 32767;
|
|
- }
|
|
-
|
|
- /**
|
|
* Passes this Packet on to the NetHandler for processing.
|
|
*/
|
|
public void processPacket(NetHandler par1NetHandler)
|
|
{
|
|
par1NetHandler.handleEntityEffect(this);
|
|
--- 52,61 ----
|
|
*** Packet44UpdateAttributes.java Sat Feb 5 04:19:43 2022
|
|
--- Packet44UpdateAttributes.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 94,109 ****
|
|
*/
|
|
public int getPacketSize()
|
|
{
|
|
return 8 + this.field_111004_b.size() * 24;
|
|
}
|
|
-
|
|
- public int func_111002_d()
|
|
- {
|
|
- return this.field_111005_a;
|
|
- }
|
|
-
|
|
- public List func_111003_f()
|
|
- {
|
|
- return this.field_111004_b;
|
|
- }
|
|
}
|
|
--- 94,99 ----
|
|
*** Packet51MapChunk.java Sat Feb 5 04:19:43 2022
|
|
--- Packet51MapChunk.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 151,165 ****
|
|
public int getPacketSize()
|
|
{
|
|
return 17 + this.tempLength;
|
|
}
|
|
|
|
- public byte[] getCompressedChunkData()
|
|
- {
|
|
- return this.compressedChunkData;
|
|
- }
|
|
-
|
|
public static Packet51MapChunkData getMapChunkData(Chunk par0Chunk, boolean par1, int par2)
|
|
{
|
|
int var3 = 0;
|
|
ExtendedBlockStorage[] var4 = par0Chunk.getBlockStorageArray();
|
|
int var5 = 0;
|
|
--- 151,160 ----
|
|
*** Packet55BlockDestroy.java Sat Feb 5 04:19:43 2022
|
|
--- Packet55BlockDestroy.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 71,120 ****
|
|
{
|
|
return 13;
|
|
}
|
|
|
|
/**
|
|
- * Gets the ID of the entity breaking the block
|
|
- */
|
|
- public int getEntityId()
|
|
- {
|
|
- return this.entityId;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the X position of the block
|
|
- */
|
|
- public int getPosX()
|
|
- {
|
|
- return this.posX;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the Y position of the block
|
|
- */
|
|
- public int getPosY()
|
|
- {
|
|
- return this.posY;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the Z position of the block
|
|
- */
|
|
- public int getPosZ()
|
|
- {
|
|
- return this.posZ;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets how far destroyed this block is
|
|
- */
|
|
- public int getDestroyedStage()
|
|
- {
|
|
- return this.destroyedStage;
|
|
- }
|
|
-
|
|
- /**
|
|
* only false for the abstract Packet class, all real packets return true
|
|
*/
|
|
public boolean isRealPacket()
|
|
{
|
|
return true;
|
|
--- 71,80 ----
|
|
*** Packet56MapChunks.java Sat Feb 5 04:19:43 2022
|
|
--- Packet56MapChunks.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 180,204 ****
|
|
public int getPacketSize()
|
|
{
|
|
return 6 + this.dataLength + 12 * this.getNumberOfChunkInPacket();
|
|
}
|
|
|
|
- public int getChunkPosX(int par1)
|
|
- {
|
|
- return this.chunkPostX[par1];
|
|
- }
|
|
-
|
|
- public int getChunkPosZ(int par1)
|
|
- {
|
|
- return this.chunkPosZ[par1];
|
|
- }
|
|
-
|
|
public int getNumberOfChunkInPacket()
|
|
{
|
|
return this.chunkPostX.length;
|
|
- }
|
|
-
|
|
- public byte[] getChunkCompressedData(int par1)
|
|
- {
|
|
- return this.field_73584_f[par1];
|
|
}
|
|
}
|
|
--- 180,189 ----
|
|
*** Packet5PlayerInventory.java Sat Feb 5 04:19:43 2022
|
|
--- Packet5PlayerInventory.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 59,76 ****
|
|
{
|
|
return 8;
|
|
}
|
|
|
|
/**
|
|
- * Gets the item in the slot format (an ItemStack)
|
|
- */
|
|
- public ItemStack getItemSlot()
|
|
- {
|
|
- return this.itemSlot;
|
|
- }
|
|
-
|
|
- /**
|
|
* only false for the abstract Packet class, all real packets return true
|
|
*/
|
|
public boolean isRealPacket()
|
|
{
|
|
return true;
|
|
--- 59,68 ----
|
|
*** Packet60Explosion.java Sat Feb 5 04:19:43 2022
|
|
--- Packet60Explosion.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 114,143 ****
|
|
*/
|
|
public int getPacketSize()
|
|
{
|
|
return 32 + this.chunkPositionRecords.size() * 3 + 3;
|
|
}
|
|
-
|
|
- /**
|
|
- * Gets the X velocity of the player being pushed by the explosion.
|
|
- */
|
|
- public float getPlayerVelocityX()
|
|
- {
|
|
- return this.playerVelocityX;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the Y velocity of the player being pushed by the explosion.
|
|
- */
|
|
- public float getPlayerVelocityY()
|
|
- {
|
|
- return this.playerVelocityY;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the Z velocity of the player being pushed by the explosion.
|
|
- */
|
|
- public float getPlayerVelocityZ()
|
|
- {
|
|
- return this.playerVelocityZ;
|
|
- }
|
|
}
|
|
--- 114,119 ----
|
|
*** Packet61DoorChange.java Sat Feb 5 04:19:43 2022
|
|
--- Packet61DoorChange.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 64,74 ****
|
|
*/
|
|
public int getPacketSize()
|
|
{
|
|
return 21;
|
|
}
|
|
-
|
|
- public boolean getRelativeVolumeDisabled()
|
|
- {
|
|
- return this.disableRelativeVolume;
|
|
- }
|
|
}
|
|
--- 64,69 ----
|
|
*** Packet62LevelSound.java Sat Feb 5 04:19:43 2022
|
|
--- Packet62LevelSound.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 70,112 ****
|
|
par1DataOutput.writeInt(this.effectZ);
|
|
par1DataOutput.writeFloat(this.volume);
|
|
par1DataOutput.writeByte(this.pitch);
|
|
}
|
|
|
|
- public String getSoundName()
|
|
- {
|
|
- return this.soundName;
|
|
- }
|
|
-
|
|
- public double getEffectX()
|
|
- {
|
|
- return (double)((float)this.effectX / 8.0F);
|
|
- }
|
|
-
|
|
- public double getEffectY()
|
|
- {
|
|
- return (double)((float)this.effectY / 8.0F);
|
|
- }
|
|
-
|
|
- public double getEffectZ()
|
|
- {
|
|
- return (double)((float)this.effectZ / 8.0F);
|
|
- }
|
|
-
|
|
- public float getVolume()
|
|
- {
|
|
- return this.volume;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the pitch divided by 63 (63 is 100%)
|
|
- */
|
|
- public float getPitch()
|
|
- {
|
|
- return (float)this.pitch / 63.0F;
|
|
- }
|
|
-
|
|
/**
|
|
* Passes this Packet on to the NetHandler for processing.
|
|
*/
|
|
public void processPacket(NetHandler par1NetHandler)
|
|
{
|
|
--- 70,79 ----
|
|
*** Packet63WorldParticles.java Sat Feb 5 04:19:43 2022
|
|
--- Packet63WorldParticles.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 71,149 ****
|
|
par1DataOutput.writeFloat(this.offsetZ);
|
|
par1DataOutput.writeFloat(this.speed);
|
|
par1DataOutput.writeInt(this.quantity);
|
|
}
|
|
|
|
- public String getParticleName()
|
|
- {
|
|
- return this.particleName;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the X position of the particle.
|
|
- */
|
|
- public double getPositionX()
|
|
- {
|
|
- return (double)this.posX;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the Y position of the particle.
|
|
- */
|
|
- public double getPositionY()
|
|
- {
|
|
- return (double)this.posY;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the Z position of the particle.
|
|
- */
|
|
- public double getPositionZ()
|
|
- {
|
|
- return (double)this.posZ;
|
|
- }
|
|
-
|
|
- /**
|
|
- * This is added to the X position after being multiplied by random.nextGaussian()
|
|
- */
|
|
- public float getOffsetX()
|
|
- {
|
|
- return this.offsetX;
|
|
- }
|
|
-
|
|
- /**
|
|
- * This is added to the Y position after being multiplied by random.nextGaussian()
|
|
- */
|
|
- public float getOffsetY()
|
|
- {
|
|
- return this.offsetY;
|
|
- }
|
|
-
|
|
- /**
|
|
- * This is added to the Z position after being multiplied by random.nextGaussian()
|
|
- */
|
|
- public float getOffsetZ()
|
|
- {
|
|
- return this.offsetZ;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the speed of the particles.
|
|
- */
|
|
- public float getSpeed()
|
|
- {
|
|
- return this.speed;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets the number of particles to create.
|
|
- */
|
|
- public int getQuantity()
|
|
- {
|
|
- return this.quantity;
|
|
- }
|
|
-
|
|
/**
|
|
* Passes this Packet on to the NetHandler for processing.
|
|
*/
|
|
public void processPacket(NetHandler par1NetHandler)
|
|
{
|
|
--- 71,80 ----
|
|
*** Packet7UseEntity.java Sat Feb 5 04:19:43 2022
|
|
--- Packet7UseEntity.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 15,33 ****
|
|
/**
|
|
* Seems to be true when the player is pointing at an entity and left-clicking and false when right-clicking.
|
|
*/
|
|
public int isLeftClick;
|
|
|
|
- public Packet7UseEntity() {}
|
|
-
|
|
- public Packet7UseEntity(int par1, int par2, int par3)
|
|
- {
|
|
- this.playerEntityId = par1;
|
|
- this.targetEntity = par2;
|
|
- this.isLeftClick = par3;
|
|
- }
|
|
-
|
|
/**
|
|
* Abstract. Reads the raw packet data from the data stream.
|
|
*/
|
|
public void readPacketData(DataInput par1DataInput) throws IOException
|
|
{
|
|
--- 15,24 ----
|
|
*** PathFinder.java Sat Feb 5 04:19:43 2022
|
|
--- PathFinder.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 274,286 ****
|
|
|
|
return var5;
|
|
}
|
|
|
|
/**
|
|
! * Checks if an entity collides with blocks at a position. Returns 1 if clear, 0 for colliding with any solid block,
|
|
! * -1 for water(if avoiding water) but otherwise clear, -2 for lava, -3 for fence, -4 for closed trapdoor, 2 if
|
|
! * otherwise clear except for open trapdoor or water(if not avoiding)
|
|
*/
|
|
public int getVerticalOffset(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint)
|
|
{
|
|
return func_82565_a(par1Entity, par2, par3, par4, par5PathPoint, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed);
|
|
}
|
|
--- 274,284 ----
|
|
|
|
return var5;
|
|
}
|
|
|
|
/**
|
|
! * Given an x y z, returns a vertical offset needed to search to find a block to stand on
|
|
*/
|
|
public int getVerticalOffset(Entity par1Entity, int par2, int par3, int par4, PathPoint par5PathPoint)
|
|
{
|
|
return func_82565_a(par1Entity, par2, par3, par4, par5PathPoint, this.isPathingInWater, this.isMovementBlockAllowed, this.isWoddenDoorAllowed);
|
|
}
|
|
*** PathNavigate.java Sat Feb 5 04:19:43 2022
|
|
--- PathNavigate.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 105,125 ****
|
|
public void setCanSwim(boolean par1)
|
|
{
|
|
this.canSwim = par1;
|
|
}
|
|
|
|
! public float func_111269_d()
|
|
{
|
|
return (float)this.pathSearchRange.getAttributeValue();
|
|
}
|
|
|
|
/**
|
|
* Returns the path to the given coordinates
|
|
*/
|
|
public PathEntity getPathToXYZ(double par1, double par3, double par5)
|
|
{
|
|
! return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(par1), (int)par3, MathHelper.floor_double(par5), this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim);
|
|
}
|
|
|
|
/**
|
|
* Try to find and set a path to XYZ. Returns true if successful.
|
|
*/
|
|
--- 105,128 ----
|
|
public void setCanSwim(boolean par1)
|
|
{
|
|
this.canSwim = par1;
|
|
}
|
|
|
|
! /**
|
|
! * Gets the maximum distance that the path finding will search in.
|
|
! */
|
|
! public float getPathSearchRange()
|
|
{
|
|
return (float)this.pathSearchRange.getAttributeValue();
|
|
}
|
|
|
|
/**
|
|
* Returns the path to the given coordinates
|
|
*/
|
|
public PathEntity getPathToXYZ(double par1, double par3, double par5)
|
|
{
|
|
! return !this.canNavigate() ? null : this.worldObj.getEntityPathToXYZ(this.theEntity, MathHelper.floor_double(par1), (int)par3, MathHelper.floor_double(par5), this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim);
|
|
}
|
|
|
|
/**
|
|
* Try to find and set a path to XYZ. Returns true if successful.
|
|
*/
|
|
***************
|
|
*** 132,142 ****
|
|
/**
|
|
* Returns the path to the given EntityLiving
|
|
*/
|
|
public PathEntity getPathToEntityLiving(Entity par1Entity)
|
|
{
|
|
! return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, par1Entity, this.func_111269_d(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim);
|
|
}
|
|
|
|
/**
|
|
* Try to find and set a path to EntityLiving. Returns true if successful.
|
|
*/
|
|
--- 135,145 ----
|
|
/**
|
|
* Returns the path to the given EntityLiving
|
|
*/
|
|
public PathEntity getPathToEntityLiving(Entity par1Entity)
|
|
{
|
|
! return !this.canNavigate() ? null : this.worldObj.getPathEntityToEntity(this.theEntity, par1Entity, this.getPathSearchRange(), this.canPassOpenWoodenDoors, this.canPassClosedWoodenDoors, this.avoidsWater, this.canSwim);
|
|
}
|
|
|
|
/**
|
|
* Try to find and set a path to EntityLiving. Returns true if successful.
|
|
*/
|
|
*** PlayerCapabilities.java Sat Feb 5 04:19:43 2022
|
|
--- PlayerCapabilities.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 60,79 ****
|
|
public float getFlySpeed()
|
|
{
|
|
return this.flySpeed;
|
|
}
|
|
|
|
- public void setFlySpeed(float par1)
|
|
- {
|
|
- this.flySpeed = par1;
|
|
- }
|
|
-
|
|
public float getWalkSpeed()
|
|
{
|
|
return this.walkSpeed;
|
|
- }
|
|
-
|
|
- public void setPlayerWalkSpeed(float par1)
|
|
- {
|
|
- this.walkSpeed = par1;
|
|
}
|
|
}
|
|
--- 60,69 ----
|
|
*** PlayerInstance.java Sat Feb 5 04:19:44 2022
|
|
--- PlayerInstance.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 3,18 ****
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
class PlayerInstance
|
|
{
|
|
! private final List playersInChunk;
|
|
|
|
! /** note: this is final */
|
|
! private final ChunkCoordIntPair chunkLocation;
|
|
! private short[] locationOfBlockChange;
|
|
! private int numberOfTilesToUpdate;
|
|
|
|
/**
|
|
* Integer field where each bit means to make update 16x16x16 division of chunk (from bottom).
|
|
*/
|
|
private int flagsYAreasToUpdate;
|
|
--- 3,23 ----
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
class PlayerInstance
|
|
{
|
|
! /** the list of all players in this instance (chunk) */
|
|
! private final List players;
|
|
|
|
! /** the chunk the player currently resides in */
|
|
! private final ChunkCoordIntPair currentChunk;
|
|
!
|
|
! /** array of blocks to update this tick */
|
|
! private short[] blocksToUpdate;
|
|
!
|
|
! /** the number of blocks that need to be updated next tick */
|
|
! private int numBlocksToUpdate;
|
|
|
|
/**
|
|
* Integer field where each bit means to make update 16x16x16 division of chunk (from bottom).
|
|
*/
|
|
private int flagsYAreasToUpdate;
|
|
***************
|
|
*** 23,88 ****
|
|
final PlayerManager thePlayerManager;
|
|
|
|
public PlayerInstance(PlayerManager par1PlayerManager, int par2, int par3)
|
|
{
|
|
this.thePlayerManager = par1PlayerManager;
|
|
! this.playersInChunk = new ArrayList();
|
|
! this.locationOfBlockChange = new short[64];
|
|
! this.chunkLocation = new ChunkCoordIntPair(par2, par3);
|
|
! par1PlayerManager.getWorldServer().theChunkProviderServer.loadChunk(par2, par3);
|
|
}
|
|
|
|
public void addPlayer(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! if (this.playersInChunk.contains(par1EntityPlayerMP))
|
|
{
|
|
! throw new IllegalStateException("Failed to add player. " + par1EntityPlayerMP + " already is in chunk " + this.chunkLocation.chunkXPos + ", " + this.chunkLocation.chunkZPos);
|
|
}
|
|
else
|
|
{
|
|
! if (this.playersInChunk.isEmpty())
|
|
{
|
|
this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime();
|
|
}
|
|
|
|
! this.playersInChunk.add(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.loadedChunks.add(this.chunkLocation);
|
|
}
|
|
}
|
|
|
|
public void removePlayer(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! if (this.playersInChunk.contains(par1EntityPlayerMP))
|
|
{
|
|
! Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos);
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet51MapChunk(var2, true, 0));
|
|
! this.playersInChunk.remove(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.loadedChunks.remove(this.chunkLocation);
|
|
|
|
! if (this.playersInChunk.isEmpty())
|
|
{
|
|
! long var3 = (long)this.chunkLocation.chunkXPos + 2147483647L | (long)this.chunkLocation.chunkZPos + 2147483647L << 32;
|
|
this.increaseInhabitedTime(var2);
|
|
PlayerManager.getChunkWatchers(this.thePlayerManager).remove(var3);
|
|
PlayerManager.getChunkWatcherList(this.thePlayerManager).remove(this);
|
|
|
|
! if (this.numberOfTilesToUpdate > 0)
|
|
{
|
|
PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).remove(this);
|
|
}
|
|
|
|
! this.thePlayerManager.getWorldServer().theChunkProviderServer.unloadChunksIfNotNearSpawn(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This method currently only increases chunk inhabited time. Extension is possible in next versions
|
|
*/
|
|
public void processChunk()
|
|
{
|
|
! this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos));
|
|
}
|
|
|
|
/**
|
|
* Increases chunk inhabited time every 8000 ticks
|
|
*/
|
|
--- 28,93 ----
|
|
final PlayerManager thePlayerManager;
|
|
|
|
public PlayerInstance(PlayerManager par1PlayerManager, int par2, int par3)
|
|
{
|
|
this.thePlayerManager = par1PlayerManager;
|
|
! this.players = new ArrayList();
|
|
! this.blocksToUpdate = new short[64];
|
|
! this.currentChunk = new ChunkCoordIntPair(par2, par3);
|
|
! par1PlayerManager.getMinecraftServer().theChunkProviderServer.loadChunk(par2, par3);
|
|
}
|
|
|
|
public void addPlayer(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! if (this.players.contains(par1EntityPlayerMP))
|
|
{
|
|
! throw new IllegalStateException("Failed to add player. " + par1EntityPlayerMP + " already is in chunk " + this.currentChunk.chunkXPos + ", " + this.currentChunk.chunkZPos);
|
|
}
|
|
else
|
|
{
|
|
! if (this.players.isEmpty())
|
|
{
|
|
this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime();
|
|
}
|
|
|
|
! this.players.add(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.loadedChunks.add(this.currentChunk);
|
|
}
|
|
}
|
|
|
|
public void removePlayer(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
! if (this.players.contains(par1EntityPlayerMP))
|
|
{
|
|
! Chunk var2 = PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos);
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet51MapChunk(var2, true, 0));
|
|
! this.players.remove(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.loadedChunks.remove(this.currentChunk);
|
|
|
|
! if (this.players.isEmpty())
|
|
{
|
|
! long var3 = (long)this.currentChunk.chunkXPos + 2147483647L | (long)this.currentChunk.chunkZPos + 2147483647L << 32;
|
|
this.increaseInhabitedTime(var2);
|
|
PlayerManager.getChunkWatchers(this.thePlayerManager).remove(var3);
|
|
PlayerManager.getChunkWatcherList(this.thePlayerManager).remove(this);
|
|
|
|
! if (this.numBlocksToUpdate > 0)
|
|
{
|
|
PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).remove(this);
|
|
}
|
|
|
|
! this.thePlayerManager.getMinecraftServer().theChunkProviderServer.dropChunk(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* This method currently only increases chunk inhabited time. Extension is possible in next versions
|
|
*/
|
|
public void processChunk()
|
|
{
|
|
! this.increaseInhabitedTime(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos));
|
|
}
|
|
|
|
/**
|
|
* Increases chunk inhabited time every 8000 ticks
|
|
*/
|
|
***************
|
|
*** 90,222 ****
|
|
{
|
|
par1Chunk.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime;
|
|
this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime();
|
|
}
|
|
|
|
! public void flagChunkForUpdate(int par1, int par2, int par3)
|
|
{
|
|
! if (this.numberOfTilesToUpdate == 0)
|
|
{
|
|
PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).add(this);
|
|
}
|
|
|
|
this.flagsYAreasToUpdate |= 1 << (par2 >> 4);
|
|
|
|
! if (this.numberOfTilesToUpdate < 64)
|
|
{
|
|
short var4 = (short)(par1 << 12 | par3 << 8 | par2);
|
|
|
|
! for (int var5 = 0; var5 < this.numberOfTilesToUpdate; ++var5)
|
|
{
|
|
! if (this.locationOfBlockChange[var5] == var4)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
! this.locationOfBlockChange[this.numberOfTilesToUpdate++] = var4;
|
|
}
|
|
}
|
|
|
|
! public void sendToAllPlayersWatchingChunk(Packet par1Packet)
|
|
{
|
|
! for (int var2 = 0; var2 < this.playersInChunk.size(); ++var2)
|
|
{
|
|
! EntityPlayerMP var3 = (EntityPlayerMP)this.playersInChunk.get(var2);
|
|
|
|
! if (!var3.loadedChunks.contains(this.chunkLocation))
|
|
{
|
|
! var3.playerNetServerHandler.sendPacketToPlayer(par1Packet);
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void sendChunkUpdate()
|
|
{
|
|
! if (this.numberOfTilesToUpdate != 0)
|
|
{
|
|
int var1;
|
|
int var2;
|
|
int var3;
|
|
|
|
! if (this.numberOfTilesToUpdate == 1)
|
|
{
|
|
! var1 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[0] >> 12 & 15);
|
|
! var2 = this.locationOfBlockChange[0] & 255;
|
|
! var3 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[0] >> 8 & 15);
|
|
! this.sendToAllPlayersWatchingChunk(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager)));
|
|
|
|
if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3))
|
|
{
|
|
! this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
int var4;
|
|
|
|
! if (this.numberOfTilesToUpdate == 64)
|
|
{
|
|
! var1 = this.chunkLocation.chunkXPos * 16;
|
|
! var2 = this.chunkLocation.chunkZPos * 16;
|
|
! this.sendToAllPlayersWatchingChunk(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos), false, this.flagsYAreasToUpdate));
|
|
|
|
for (var3 = 0; var3 < 16; ++var3)
|
|
{
|
|
if ((this.flagsYAreasToUpdate & 1 << var3) != 0)
|
|
{
|
|
var4 = var3 << 4;
|
|
! List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getAllTileEntityInBox(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16);
|
|
|
|
for (int var6 = 0; var6 < var5.size(); ++var6)
|
|
{
|
|
! this.sendTileToAllPlayersWatchingChunk((TileEntity)var5.get(var6));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.sendToAllPlayersWatchingChunk(new Packet52MultiBlockChange(this.chunkLocation.chunkXPos, this.chunkLocation.chunkZPos, this.locationOfBlockChange, this.numberOfTilesToUpdate, PlayerManager.getWorldServer(this.thePlayerManager)));
|
|
|
|
! for (var1 = 0; var1 < this.numberOfTilesToUpdate; ++var1)
|
|
{
|
|
! var2 = this.chunkLocation.chunkXPos * 16 + (this.locationOfBlockChange[var1] >> 12 & 15);
|
|
! var3 = this.locationOfBlockChange[var1] & 255;
|
|
! var4 = this.chunkLocation.chunkZPos * 16 + (this.locationOfBlockChange[var1] >> 8 & 15);
|
|
|
|
if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4))
|
|
{
|
|
! this.sendTileToAllPlayersWatchingChunk(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
! this.numberOfTilesToUpdate = 0;
|
|
this.flagsYAreasToUpdate = 0;
|
|
}
|
|
}
|
|
|
|
! private void sendTileToAllPlayersWatchingChunk(TileEntity par1TileEntity)
|
|
{
|
|
if (par1TileEntity != null)
|
|
{
|
|
Packet var2 = par1TileEntity.getDescriptionPacket();
|
|
|
|
if (var2 != null)
|
|
{
|
|
! this.sendToAllPlayersWatchingChunk(var2);
|
|
}
|
|
}
|
|
}
|
|
|
|
static ChunkCoordIntPair getChunkLocation(PlayerInstance par0PlayerInstance)
|
|
{
|
|
! return par0PlayerInstance.chunkLocation;
|
|
}
|
|
|
|
static List getPlayersInChunk(PlayerInstance par0PlayerInstance)
|
|
{
|
|
! return par0PlayerInstance.playersInChunk;
|
|
}
|
|
}
|
|
--- 95,236 ----
|
|
{
|
|
par1Chunk.inhabitedTime += PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime() - this.previousWorldTime;
|
|
this.previousWorldTime = PlayerManager.getWorldServer(this.thePlayerManager).getTotalWorldTime();
|
|
}
|
|
|
|
! /**
|
|
! * mark the block as changed so that it will update clients who need to know about it
|
|
! */
|
|
! public void markBlockNeedsUpdate(int par1, int par2, int par3)
|
|
{
|
|
! if (this.numBlocksToUpdate == 0)
|
|
{
|
|
PlayerManager.getChunkWatchersWithPlayers(this.thePlayerManager).add(this);
|
|
}
|
|
|
|
this.flagsYAreasToUpdate |= 1 << (par2 >> 4);
|
|
|
|
! if (this.numBlocksToUpdate < 64)
|
|
{
|
|
short var4 = (short)(par1 << 12 | par3 << 8 | par2);
|
|
|
|
! for (int var5 = 0; var5 < this.numBlocksToUpdate; ++var5)
|
|
{
|
|
! if (this.blocksToUpdate[var5] == var4)
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
! this.blocksToUpdate[this.numBlocksToUpdate++] = var4;
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * sends the packet to all players in the current instance
|
|
! */
|
|
! public void sendPacketToPlayersInInstance(Packet par1Packet)
|
|
{
|
|
! for (int var2 = 0; var2 < this.players.size(); ++var2)
|
|
{
|
|
! EntityPlayerMP var3 = (EntityPlayerMP)this.players.get(var2);
|
|
|
|
! if (!var3.loadedChunks.contains(this.currentChunk))
|
|
{
|
|
! var3.playerNetServerHandler.sendPacket(par1Packet);
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void onUpdate()
|
|
{
|
|
! if (this.numBlocksToUpdate != 0)
|
|
{
|
|
int var1;
|
|
int var2;
|
|
int var3;
|
|
|
|
! if (this.numBlocksToUpdate == 1)
|
|
{
|
|
! var1 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[0] >> 12 & 15);
|
|
! var2 = this.blocksToUpdate[0] & 255;
|
|
! var3 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[0] >> 8 & 15);
|
|
! this.sendPacketToPlayersInInstance(new Packet53BlockChange(var1, var2, var3, PlayerManager.getWorldServer(this.thePlayerManager)));
|
|
|
|
if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var1, var2, var3))
|
|
{
|
|
! this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var1, var2, var3));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
int var4;
|
|
|
|
! if (this.numBlocksToUpdate == 64)
|
|
{
|
|
! var1 = this.currentChunk.chunkXPos * 16;
|
|
! var2 = this.currentChunk.chunkZPos * 16;
|
|
! this.sendPacketToPlayersInInstance(new Packet51MapChunk(PlayerManager.getWorldServer(this.thePlayerManager).getChunkFromChunkCoords(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos), false, this.flagsYAreasToUpdate));
|
|
|
|
for (var3 = 0; var3 < 16; ++var3)
|
|
{
|
|
if ((this.flagsYAreasToUpdate & 1 << var3) != 0)
|
|
{
|
|
var4 = var3 << 4;
|
|
! List var5 = PlayerManager.getWorldServer(this.thePlayerManager).getTileEntityList(var1, var4, var2, var1 + 16, var4 + 16, var2 + 16);
|
|
|
|
for (int var6 = 0; var6 < var5.size(); ++var6)
|
|
{
|
|
! this.updateTileEntity((TileEntity)var5.get(var6));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! this.sendPacketToPlayersInInstance(new Packet52MultiBlockChange(this.currentChunk.chunkXPos, this.currentChunk.chunkZPos, this.blocksToUpdate, this.numBlocksToUpdate, PlayerManager.getWorldServer(this.thePlayerManager)));
|
|
|
|
! for (var1 = 0; var1 < this.numBlocksToUpdate; ++var1)
|
|
{
|
|
! var2 = this.currentChunk.chunkXPos * 16 + (this.blocksToUpdate[var1] >> 12 & 15);
|
|
! var3 = this.blocksToUpdate[var1] & 255;
|
|
! var4 = this.currentChunk.chunkZPos * 16 + (this.blocksToUpdate[var1] >> 8 & 15);
|
|
|
|
if (PlayerManager.getWorldServer(this.thePlayerManager).blockHasTileEntity(var2, var3, var4))
|
|
{
|
|
! this.updateTileEntity(PlayerManager.getWorldServer(this.thePlayerManager).getBlockTileEntity(var2, var3, var4));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
! this.numBlocksToUpdate = 0;
|
|
this.flagsYAreasToUpdate = 0;
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * sends players update packet about the given entity
|
|
! */
|
|
! private void updateTileEntity(TileEntity par1TileEntity)
|
|
{
|
|
if (par1TileEntity != null)
|
|
{
|
|
Packet var2 = par1TileEntity.getDescriptionPacket();
|
|
|
|
if (var2 != null)
|
|
{
|
|
! this.sendPacketToPlayersInInstance(var2);
|
|
}
|
|
}
|
|
}
|
|
|
|
static ChunkCoordIntPair getChunkLocation(PlayerInstance par0PlayerInstance)
|
|
{
|
|
! return par0PlayerInstance.currentChunk;
|
|
}
|
|
|
|
static List getPlayersInChunk(PlayerInstance par0PlayerInstance)
|
|
{
|
|
! return par0PlayerInstance.players;
|
|
}
|
|
}
|
|
*** PlayerManager.java Sat Feb 5 04:19:44 2022
|
|
--- PlayerManager.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 8,27 ****
|
|
private final WorldServer theWorldServer;
|
|
|
|
/** players in the current instance */
|
|
private final List players = new ArrayList();
|
|
|
|
! /**
|
|
! * A map of chunk position (two ints concatenated into a long) to PlayerInstance
|
|
! */
|
|
private final LongHashMap playerInstances = new LongHashMap();
|
|
|
|
! /**
|
|
! * contains a PlayerInstance for every chunk they can see. the "player instance" cotains a list of all players who
|
|
! * can also that chunk
|
|
! */
|
|
! private final List chunkWatcherWithPlayers = new ArrayList();
|
|
|
|
/** This field is using when chunk should be processed (every 8000 ticks) */
|
|
private final List playerInstanceList = new ArrayList();
|
|
|
|
/**
|
|
--- 8,22 ----
|
|
private final WorldServer theWorldServer;
|
|
|
|
/** players in the current instance */
|
|
private final List players = new ArrayList();
|
|
|
|
! /** the hash of all playerInstances created */
|
|
private final LongHashMap playerInstances = new LongHashMap();
|
|
|
|
! /** the playerInstances(chunks) that need to be updated */
|
|
! private final List playerInstancesToUpdate = new ArrayList();
|
|
|
|
/** This field is using when chunk should be processed (every 8000 ticks) */
|
|
private final List playerInstanceList = new ArrayList();
|
|
|
|
/**
|
|
***************
|
|
*** 50,60 ****
|
|
this.playerViewRadius = par2;
|
|
this.theWorldServer = par1WorldServer;
|
|
}
|
|
}
|
|
|
|
! public WorldServer getWorldServer()
|
|
{
|
|
return this.theWorldServer;
|
|
}
|
|
|
|
/**
|
|
--- 45,58 ----
|
|
this.playerViewRadius = par2;
|
|
this.theWorldServer = par1WorldServer;
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * Returns the MinecraftServer associated with the PlayerManager.
|
|
! */
|
|
! public WorldServer getMinecraftServer()
|
|
{
|
|
return this.theWorldServer;
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 71,94 ****
|
|
this.previousTotalWorldTime = var1;
|
|
|
|
for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3)
|
|
{
|
|
var4 = (PlayerInstance)this.playerInstanceList.get(var3);
|
|
! var4.sendChunkUpdate();
|
|
var4.processChunk();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! for (var3 = 0; var3 < this.chunkWatcherWithPlayers.size(); ++var3)
|
|
{
|
|
! var4 = (PlayerInstance)this.chunkWatcherWithPlayers.get(var3);
|
|
! var4.sendChunkUpdate();
|
|
}
|
|
}
|
|
|
|
! this.chunkWatcherWithPlayers.clear();
|
|
|
|
if (this.players.isEmpty())
|
|
{
|
|
WorldProvider var5 = this.theWorldServer.provider;
|
|
|
|
--- 69,92 ----
|
|
this.previousTotalWorldTime = var1;
|
|
|
|
for (var3 = 0; var3 < this.playerInstanceList.size(); ++var3)
|
|
{
|
|
var4 = (PlayerInstance)this.playerInstanceList.get(var3);
|
|
! var4.onUpdate();
|
|
var4.processChunk();
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! for (var3 = 0; var3 < this.playerInstancesToUpdate.size(); ++var3)
|
|
{
|
|
! var4 = (PlayerInstance)this.playerInstancesToUpdate.get(var3);
|
|
! var4.onUpdate();
|
|
}
|
|
}
|
|
|
|
! this.playerInstancesToUpdate.clear();
|
|
|
|
if (this.players.isEmpty())
|
|
{
|
|
WorldProvider var5 = this.theWorldServer.provider;
|
|
|
|
***************
|
|
*** 97,107 ****
|
|
this.theWorldServer.theChunkProviderServer.unloadAllChunks();
|
|
}
|
|
}
|
|
}
|
|
|
|
! private PlayerInstance getOrCreateChunkWatcher(int par1, int par2, boolean par3)
|
|
{
|
|
long var4 = (long)par1 + 2147483647L | (long)par2 + 2147483647L << 32;
|
|
PlayerInstance var6 = (PlayerInstance)this.playerInstances.getValueByKey(var4);
|
|
|
|
if (var6 == null && par3)
|
|
--- 95,108 ----
|
|
this.theWorldServer.theChunkProviderServer.unloadAllChunks();
|
|
}
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * passi n the chunk x and y and a flag as to whether or not the instance should be made if it doesnt exist
|
|
! */
|
|
! private PlayerInstance getPlayerInstance(int par1, int par2, boolean par3)
|
|
{
|
|
long var4 = (long)par1 + 2147483647L | (long)par2 + 2147483647L << 32;
|
|
PlayerInstance var6 = (PlayerInstance)this.playerInstances.getValueByKey(var4);
|
|
|
|
if (var6 == null && par3)
|
|
***************
|
|
*** 119,138 ****
|
|
*/
|
|
public void markBlockForUpdate(int par1, int par2, int par3)
|
|
{
|
|
int var4 = par1 >> 4;
|
|
int var5 = par3 >> 4;
|
|
! PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false);
|
|
|
|
if (var6 != null)
|
|
{
|
|
! var6.flagChunkForUpdate(par1 & 15, par2, par3 & 15);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Adds an EntityPlayerMP to the PlayerManager.
|
|
*/
|
|
public void addPlayer(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
int var2 = (int)par1EntityPlayerMP.posX >> 4;
|
|
int var3 = (int)par1EntityPlayerMP.posZ >> 4;
|
|
--- 120,139 ----
|
|
*/
|
|
public void markBlockForUpdate(int par1, int par2, int par3)
|
|
{
|
|
int var4 = par1 >> 4;
|
|
int var5 = par3 >> 4;
|
|
! PlayerInstance var6 = this.getPlayerInstance(var4, var5, false);
|
|
|
|
if (var6 != null)
|
|
{
|
|
! var6.markBlockNeedsUpdate(par1 & 15, par2, par3 & 15);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Adds an EntityPlayerMP to the PlayerManager and to all player instances within player visibility
|
|
*/
|
|
public void addPlayer(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
int var2 = (int)par1EntityPlayerMP.posX >> 4;
|
|
int var3 = (int)par1EntityPlayerMP.posZ >> 4;
|
|
***************
|
|
*** 141,151 ****
|
|
|
|
for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4)
|
|
{
|
|
for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5)
|
|
{
|
|
! this.getOrCreateChunkWatcher(var4, var5, true).addPlayer(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
|
|
this.players.add(par1EntityPlayerMP);
|
|
this.filterChunkLoadQueue(par1EntityPlayerMP);
|
|
--- 142,152 ----
|
|
|
|
for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4)
|
|
{
|
|
for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5)
|
|
{
|
|
! this.getPlayerInstance(var4, var5, true).addPlayer(par1EntityPlayerMP);
|
|
}
|
|
}
|
|
|
|
this.players.add(par1EntityPlayerMP);
|
|
this.filterChunkLoadQueue(par1EntityPlayerMP);
|
|
***************
|
|
*** 161,171 ****
|
|
int var4 = this.playerViewRadius;
|
|
int var5 = (int)par1EntityPlayerMP.posX >> 4;
|
|
int var6 = (int)par1EntityPlayerMP.posZ >> 4;
|
|
int var7 = 0;
|
|
int var8 = 0;
|
|
! ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5, var6, true));
|
|
par1EntityPlayerMP.loadedChunks.clear();
|
|
|
|
if (var2.contains(var9))
|
|
{
|
|
par1EntityPlayerMP.loadedChunks.add(var9);
|
|
--- 162,172 ----
|
|
int var4 = this.playerViewRadius;
|
|
int var5 = (int)par1EntityPlayerMP.posX >> 4;
|
|
int var6 = (int)par1EntityPlayerMP.posZ >> 4;
|
|
int var7 = 0;
|
|
int var8 = 0;
|
|
! ChunkCoordIntPair var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5, var6, true));
|
|
par1EntityPlayerMP.loadedChunks.clear();
|
|
|
|
if (var2.contains(var9))
|
|
{
|
|
par1EntityPlayerMP.loadedChunks.add(var9);
|
|
***************
|
|
*** 181,191 ****
|
|
|
|
for (int var13 = 0; var13 < var10; ++var13)
|
|
{
|
|
var7 += var12[0];
|
|
var8 += var12[1];
|
|
! var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true));
|
|
|
|
if (var2.contains(var9))
|
|
{
|
|
par1EntityPlayerMP.loadedChunks.add(var9);
|
|
}
|
|
--- 182,192 ----
|
|
|
|
for (int var13 = 0; var13 < var10; ++var13)
|
|
{
|
|
var7 += var12[0];
|
|
var8 += var12[1];
|
|
! var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true));
|
|
|
|
if (var2.contains(var9))
|
|
{
|
|
par1EntityPlayerMP.loadedChunks.add(var9);
|
|
}
|
|
***************
|
|
*** 197,207 ****
|
|
|
|
for (var10 = 0; var10 < var4 * 2; ++var10)
|
|
{
|
|
var7 += this.xzDirectionsConst[var3][0];
|
|
var8 += this.xzDirectionsConst[var3][1];
|
|
! var9 = PlayerInstance.getChunkLocation(this.getOrCreateChunkWatcher(var5 + var7, var6 + var8, true));
|
|
|
|
if (var2.contains(var9))
|
|
{
|
|
par1EntityPlayerMP.loadedChunks.add(var9);
|
|
}
|
|
--- 198,208 ----
|
|
|
|
for (var10 = 0; var10 < var4 * 2; ++var10)
|
|
{
|
|
var7 += this.xzDirectionsConst[var3][0];
|
|
var8 += this.xzDirectionsConst[var3][1];
|
|
! var9 = PlayerInstance.getChunkLocation(this.getPlayerInstance(var5 + var7, var6 + var8, true));
|
|
|
|
if (var2.contains(var9))
|
|
{
|
|
par1EntityPlayerMP.loadedChunks.add(var9);
|
|
}
|
|
***************
|
|
*** 218,228 ****
|
|
|
|
for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4)
|
|
{
|
|
for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5)
|
|
{
|
|
! PlayerInstance var6 = this.getOrCreateChunkWatcher(var4, var5, false);
|
|
|
|
if (var6 != null)
|
|
{
|
|
var6.removePlayer(par1EntityPlayerMP);
|
|
}
|
|
--- 219,229 ----
|
|
|
|
for (int var4 = var2 - this.playerViewRadius; var4 <= var2 + this.playerViewRadius; ++var4)
|
|
{
|
|
for (int var5 = var3 - this.playerViewRadius; var5 <= var3 + this.playerViewRadius; ++var5)
|
|
{
|
|
! PlayerInstance var6 = this.getPlayerInstance(var4, var5, false);
|
|
|
|
if (var6 != null)
|
|
{
|
|
var6.removePlayer(par1EntityPlayerMP);
|
|
}
|
|
***************
|
|
*** 268,283 ****
|
|
{
|
|
for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16)
|
|
{
|
|
if (!this.overlaps(var15, var16, var10, var11, var12))
|
|
{
|
|
! this.getOrCreateChunkWatcher(var15, var16, true).addPlayer(par1EntityPlayerMP);
|
|
}
|
|
|
|
if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12))
|
|
{
|
|
! PlayerInstance var17 = this.getOrCreateChunkWatcher(var15 - var13, var16 - var14, false);
|
|
|
|
if (var17 != null)
|
|
{
|
|
var17.removePlayer(par1EntityPlayerMP);
|
|
}
|
|
--- 269,284 ----
|
|
{
|
|
for (int var16 = var3 - var12; var16 <= var3 + var12; ++var16)
|
|
{
|
|
if (!this.overlaps(var15, var16, var10, var11, var12))
|
|
{
|
|
! this.getPlayerInstance(var15, var16, true).addPlayer(par1EntityPlayerMP);
|
|
}
|
|
|
|
if (!this.overlaps(var15 - var13, var16 - var14, var2, var3, var12))
|
|
{
|
|
! PlayerInstance var17 = this.getPlayerInstance(var15 - var13, var16 - var14, false);
|
|
|
|
if (var17 != null)
|
|
{
|
|
var17.removePlayer(par1EntityPlayerMP);
|
|
}
|
|
***************
|
|
*** 292,302 ****
|
|
}
|
|
}
|
|
|
|
public boolean isPlayerWatchingChunk(EntityPlayerMP par1EntityPlayerMP, int par2, int par3)
|
|
{
|
|
! PlayerInstance var4 = this.getOrCreateChunkWatcher(par2, par3, false);
|
|
return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(par1EntityPlayerMP) && !par1EntityPlayerMP.loadedChunks.contains(PlayerInstance.getChunkLocation(var4));
|
|
}
|
|
|
|
/**
|
|
* Get the furthest viewable block given player's view distance
|
|
--- 293,303 ----
|
|
}
|
|
}
|
|
|
|
public boolean isPlayerWatchingChunk(EntityPlayerMP par1EntityPlayerMP, int par2, int par3)
|
|
{
|
|
! PlayerInstance var4 = this.getPlayerInstance(par2, par3, false);
|
|
return var4 == null ? false : PlayerInstance.getPlayersInChunk(var4).contains(par1EntityPlayerMP) && !par1EntityPlayerMP.loadedChunks.contains(PlayerInstance.getChunkLocation(var4));
|
|
}
|
|
|
|
/**
|
|
* Get the furthest viewable block given player's view distance
|
|
***************
|
|
*** 324,331 ****
|
|
return par0PlayerManager.playerInstanceList;
|
|
}
|
|
|
|
static List getChunkWatchersWithPlayers(PlayerManager par0PlayerManager)
|
|
{
|
|
! return par0PlayerManager.chunkWatcherWithPlayers;
|
|
}
|
|
}
|
|
--- 325,332 ----
|
|
return par0PlayerManager.playerInstanceList;
|
|
}
|
|
|
|
static List getChunkWatchersWithPlayers(PlayerManager par0PlayerManager)
|
|
{
|
|
! return par0PlayerManager.playerInstancesToUpdate;
|
|
}
|
|
}
|
|
*** PlayerSelector.java Sat Feb 5 04:19:44 2022
|
|
--- PlayerSelector.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 78,88 ****
|
|
int var6 = getDefaultMaximumRange(var4);
|
|
int var7 = getDefaultMinimumLevel(var4);
|
|
int var8 = getDefaultMaximumLevel(var4);
|
|
int var9 = getDefaultCount(var4);
|
|
int var10 = EnumGameType.NOT_SET.getID();
|
|
! ChunkCoordinates var11 = par0ICommandSender.getPlayerCoordinates();
|
|
Map var12 = func_96560_a(var3);
|
|
String var13 = null;
|
|
String var14 = null;
|
|
boolean var15 = false;
|
|
|
|
--- 78,88 ----
|
|
int var6 = getDefaultMaximumRange(var4);
|
|
int var7 = getDefaultMinimumLevel(var4);
|
|
int var8 = getDefaultMaximumLevel(var4);
|
|
int var9 = getDefaultCount(var4);
|
|
int var10 = EnumGameType.NOT_SET.getID();
|
|
! ChunkCoordinates var11 = par0ICommandSender.getCommandSenderPosition();
|
|
Map var12 = func_96560_a(var3);
|
|
String var13 = null;
|
|
String var14 = null;
|
|
boolean var15 = false;
|
|
|
|
*** PlayerUsageSnooper.java Sat Feb 5 04:19:44 2022
|
|
--- PlayerUsageSnooper.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 4,18 ****
|
|
import java.lang.management.RuntimeMXBean;
|
|
import java.net.MalformedURLException;
|
|
import java.net.URL;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
- import java.util.LinkedHashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
- import java.util.Map.Entry;
|
|
|
|
public class PlayerUsageSnooper
|
|
{
|
|
/** String map for report data */
|
|
private Map dataMap = new HashMap();
|
|
--- 4,17 ----
|
|
import java.lang.management.RuntimeMXBean;
|
|
import java.net.MalformedURLException;
|
|
import java.net.URL;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
+ import java.util.Timer;
|
|
import java.util.UUID;
|
|
|
|
public class PlayerUsageSnooper
|
|
{
|
|
/** String map for report data */
|
|
private Map dataMap = new HashMap();
|
|
***************
|
|
*** 21,31 ****
|
|
/** URL of the server to send the report to */
|
|
private final URL serverUrl;
|
|
private final IPlayerUsage playerStatsCollector;
|
|
|
|
/** set to fire the snooperThread every 15 mins */
|
|
! private final java.util.Timer threadTrigger = new java.util.Timer("Snooper Timer", true);
|
|
private final Object syncLock = new Object();
|
|
private final long field_98224_g;
|
|
private boolean isRunning;
|
|
|
|
/** incremented on every getSelfCounterFor */
|
|
--- 20,30 ----
|
|
/** URL of the server to send the report to */
|
|
private final URL serverUrl;
|
|
private final IPlayerUsage playerStatsCollector;
|
|
|
|
/** set to fire the snooperThread every 15 mins */
|
|
! private final Timer threadTrigger = new Timer("Snooper Timer", true);
|
|
private final Object syncLock = new Object();
|
|
private final long field_98224_g;
|
|
private boolean isRunning;
|
|
|
|
/** incremented on every getSelfCounterFor */
|
|
***************
|
|
*** 111,153 ****
|
|
{
|
|
this.dataMap.put(par1Str, par2Obj);
|
|
}
|
|
}
|
|
|
|
- public Map getCurrentStats()
|
|
- {
|
|
- LinkedHashMap var1 = new LinkedHashMap();
|
|
- Object var2 = this.syncLock;
|
|
-
|
|
- synchronized (this.syncLock)
|
|
- {
|
|
- this.addMemoryStatsToSnooper();
|
|
- Iterator var3 = this.dataMap.entrySet().iterator();
|
|
-
|
|
- while (var3.hasNext())
|
|
- {
|
|
- Entry var4 = (Entry)var3.next();
|
|
- var1.put(var4.getKey(), var4.getValue().toString());
|
|
- }
|
|
-
|
|
- return var1;
|
|
- }
|
|
- }
|
|
-
|
|
public boolean isSnooperRunning()
|
|
{
|
|
return this.isRunning;
|
|
}
|
|
|
|
public void stopSnooper()
|
|
{
|
|
this.threadTrigger.cancel();
|
|
- }
|
|
-
|
|
- public String getUniqueID()
|
|
- {
|
|
- return this.uniqueID;
|
|
}
|
|
|
|
public long func_130105_g()
|
|
{
|
|
return this.field_98224_g;
|
|
--- 110,127 ----
|
|
*** Potion.java Sat Feb 5 04:19:44 2022
|
|
--- Potion.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 243,289 ****
|
|
public String getName()
|
|
{
|
|
return this.name;
|
|
}
|
|
|
|
- /**
|
|
- * Returns true if the potion has a associated status icon to display in then inventory when active.
|
|
- */
|
|
- public boolean hasStatusIcon()
|
|
- {
|
|
- return this.statusIconIndex >= 0;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the index for the icon to display when the potion is active.
|
|
- */
|
|
- public int getStatusIconIndex()
|
|
- {
|
|
- return this.statusIconIndex;
|
|
- }
|
|
-
|
|
- /**
|
|
- * This method returns true if the potion effect is bad - negative - for the entity.
|
|
- */
|
|
- public boolean isBadEffect()
|
|
- {
|
|
- return this.isBadEffect;
|
|
- }
|
|
-
|
|
- public static String getDurationString(PotionEffect par0PotionEffect)
|
|
- {
|
|
- if (par0PotionEffect.getIsPotionDurationMax())
|
|
- {
|
|
- return "**:**";
|
|
- }
|
|
- else
|
|
- {
|
|
- int var1 = par0PotionEffect.getDuration();
|
|
- return StringUtils.ticksToElapsedTime(var1);
|
|
- }
|
|
- }
|
|
-
|
|
protected Potion setEffectiveness(double par1)
|
|
{
|
|
this.effectiveness = par1;
|
|
return this;
|
|
}
|
|
--- 243,252 ----
|
|
***************
|
|
*** 309,323 ****
|
|
public Potion func_111184_a(Attribute par1Attribute, String par2Str, double par3, int par5)
|
|
{
|
|
AttributeModifier var6 = new AttributeModifier(UUID.fromString(par2Str), this.getName(), par3, par5);
|
|
this.field_111188_I.put(par1Attribute, var6);
|
|
return this;
|
|
- }
|
|
-
|
|
- public Map func_111186_k()
|
|
- {
|
|
- return this.field_111188_I;
|
|
}
|
|
|
|
public void removeAttributesModifiersFromEntity(EntityLivingBase par1EntityLivingBase, BaseAttributeMap par2BaseAttributeMap, int par3)
|
|
{
|
|
Iterator var4 = this.field_111188_I.entrySet().iterator();
|
|
--- 272,281 ----
|
|
*** PotionEffect.java Sat Feb 5 04:19:44 2022
|
|
--- PotionEffect.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 15,27 ****
|
|
private boolean isSplashPotion;
|
|
|
|
/** Whether the potion effect came from a beacon */
|
|
private boolean isAmbient;
|
|
|
|
- /** True if potion effect duration is at maximum, false otherwise. */
|
|
- private boolean isPotionDurationMax;
|
|
-
|
|
public PotionEffect(int par1, int par2)
|
|
{
|
|
this(par1, par2, 0);
|
|
}
|
|
|
|
--- 15,24 ----
|
|
***************
|
|
*** 197,216 ****
|
|
byte var1 = par0NBTTagCompound.getByte("Id");
|
|
byte var2 = par0NBTTagCompound.getByte("Amplifier");
|
|
int var3 = par0NBTTagCompound.getInteger("Duration");
|
|
boolean var4 = par0NBTTagCompound.getBoolean("Ambient");
|
|
return new PotionEffect(var1, var3, var2, var4);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Toggle the isPotionDurationMax field.
|
|
- */
|
|
- public void setPotionDurationMax(boolean par1)
|
|
- {
|
|
- this.isPotionDurationMax = par1;
|
|
- }
|
|
-
|
|
- public boolean getIsPotionDurationMax()
|
|
- {
|
|
- return this.isPotionDurationMax;
|
|
}
|
|
}
|
|
--- 194,200 ----
|
|
*** PotionHelper.java Sat Feb 5 04:19:44 2022
|
|
--- PotionHelper.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 28,38 ****
|
|
|
|
/** An array of possible potion prefix names, as translation IDs. */
|
|
private static final String[] potionPrefixes;
|
|
|
|
/**
|
|
! * Is the bit given set to 1?
|
|
*/
|
|
public static boolean checkFlag(int par0, int par1)
|
|
{
|
|
return (par0 & 1 << par1) != 0;
|
|
}
|
|
--- 28,38 ----
|
|
|
|
/** An array of possible potion prefix names, as translation IDs. */
|
|
private static final String[] potionPrefixes;
|
|
|
|
/**
|
|
! * Checks if the bit at 1 << j is on in i.
|
|
*/
|
|
public static boolean checkFlag(int par0, int par1)
|
|
{
|
|
return (par0 & 1 << par1) != 0;
|
|
}
|
|
***************
|
|
*** 115,145 ****
|
|
while (var2.getIsAmbient());
|
|
|
|
return false;
|
|
}
|
|
|
|
- public static int func_77915_a(int par0, boolean par1)
|
|
- {
|
|
- if (!par1)
|
|
- {
|
|
- if (field_77925_n.containsKey(Integer.valueOf(par0)))
|
|
- {
|
|
- return ((Integer)field_77925_n.get(Integer.valueOf(par0))).intValue();
|
|
- }
|
|
- else
|
|
- {
|
|
- int var2 = calcPotionLiquidColor(getPotionEffects(par0, false));
|
|
- field_77925_n.put(Integer.valueOf(par0), Integer.valueOf(var2));
|
|
- return var2;
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- return calcPotionLiquidColor(getPotionEffects(par0, par1));
|
|
- }
|
|
- }
|
|
-
|
|
public static String func_77905_c(int par0)
|
|
{
|
|
int var1 = func_77909_a(par0);
|
|
return potionPrefixes[var1];
|
|
}
|
|
--- 115,124 ----
|
|
***************
|
|
*** 184,194 ****
|
|
|
|
return var7;
|
|
}
|
|
|
|
/**
|
|
! * Count the number of bits in an integer set to ON.
|
|
*/
|
|
private static int countSetFlags(int par0)
|
|
{
|
|
int var1;
|
|
|
|
--- 163,173 ----
|
|
|
|
return var7;
|
|
}
|
|
|
|
/**
|
|
! * Returns the number of 1 bits in the given integer.
|
|
*/
|
|
private static int countSetFlags(int par0)
|
|
{
|
|
int var1;
|
|
|
|
***************
|
|
*** 440,452 ****
|
|
|
|
return var2;
|
|
}
|
|
|
|
/**
|
|
! * Does bit operations for brewPotionData, given data, the index of the bit being operated upon, whether the bit
|
|
! * will be removed, whether the bit will be toggled (NOT), or whether the data field will be set to 0 if the bit is
|
|
! * not present.
|
|
*/
|
|
private static int brewBitOperations(int par0, int par1, boolean par2, boolean par3, boolean par4)
|
|
{
|
|
if (par4)
|
|
{
|
|
--- 419,429 ----
|
|
|
|
return var2;
|
|
}
|
|
|
|
/**
|
|
! * Manipulates the specified bit of the potion damage value according to the rules passed from applyIngredient.
|
|
*/
|
|
private static int brewBitOperations(int par0, int par1, boolean par2, boolean par3, boolean par4)
|
|
{
|
|
if (par4)
|
|
{
|
|
***************
|
|
*** 477,488 ****
|
|
|
|
return par0;
|
|
}
|
|
|
|
/**
|
|
! * Generate a data value for a potion, given its previous data value and the encoded string of new effects it will
|
|
! * receive
|
|
*/
|
|
public static int applyIngredient(int par0, String par1Str)
|
|
{
|
|
byte var2 = 0;
|
|
int var3 = par1Str.length();
|
|
--- 454,464 ----
|
|
|
|
return par0;
|
|
}
|
|
|
|
/**
|
|
! * Returns the new potion damage value after the specified ingredient info is applied to the specified potion.
|
|
*/
|
|
public static int applyIngredient(int par0, String par1Str)
|
|
{
|
|
byte var2 = 0;
|
|
int var3 = par1Str.length();
|
|
*** ProfilerResult.java Sat Feb 5 04:19:44 2022
|
|
--- ProfilerResult.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 16,30 ****
|
|
public int func_76328_a(ProfilerResult par1ProfilerResult)
|
|
{
|
|
return par1ProfilerResult.field_76332_a < this.field_76332_a ? -1 : (par1ProfilerResult.field_76332_a > this.field_76332_a ? 1 : par1ProfilerResult.field_76331_c.compareTo(this.field_76331_c));
|
|
}
|
|
|
|
- public int func_76329_a()
|
|
- {
|
|
- return (this.field_76331_c.hashCode() & 11184810) + 4473924;
|
|
- }
|
|
-
|
|
public int compareTo(Object par1Obj)
|
|
{
|
|
return this.func_76328_a((ProfilerResult)par1Obj);
|
|
}
|
|
}
|
|
--- 16,25 ----
|
|
*** PropertyManager.java Sat Feb 5 04:19:44 2022
|
|
--- PropertyManager.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 6,39 ****
|
|
import java.io.IOException;
|
|
import java.util.Properties;
|
|
|
|
public class PropertyManager
|
|
{
|
|
! private final Properties properties = new Properties();
|
|
|
|
/** Reference to the logger. */
|
|
private final ILogAgent logger;
|
|
! private final File associatedFile;
|
|
|
|
public PropertyManager(File par1File, ILogAgent par2ILogAgent)
|
|
{
|
|
! this.associatedFile = par1File;
|
|
this.logger = par2ILogAgent;
|
|
|
|
if (par1File.exists())
|
|
{
|
|
FileInputStream var3 = null;
|
|
|
|
try
|
|
{
|
|
var3 = new FileInputStream(par1File);
|
|
! this.properties.load(var3);
|
|
}
|
|
catch (Exception var13)
|
|
{
|
|
par2ILogAgent.logWarningException("Failed to load " + par1File, var13);
|
|
! this.logMessageAndSave();
|
|
}
|
|
finally
|
|
{
|
|
if (var3 != null)
|
|
{
|
|
--- 6,42 ----
|
|
import java.io.IOException;
|
|
import java.util.Properties;
|
|
|
|
public class PropertyManager
|
|
{
|
|
! /** The server properties object. */
|
|
! private final Properties serverProperties = new Properties();
|
|
|
|
/** Reference to the logger. */
|
|
private final ILogAgent logger;
|
|
!
|
|
! /** The server properties file. */
|
|
! private final File serverPropertiesFile;
|
|
|
|
public PropertyManager(File par1File, ILogAgent par2ILogAgent)
|
|
{
|
|
! this.serverPropertiesFile = par1File;
|
|
this.logger = par2ILogAgent;
|
|
|
|
if (par1File.exists())
|
|
{
|
|
FileInputStream var3 = null;
|
|
|
|
try
|
|
{
|
|
var3 = new FileInputStream(par1File);
|
|
! this.serverProperties.load(var3);
|
|
}
|
|
catch (Exception var13)
|
|
{
|
|
par2ILogAgent.logWarningException("Failed to load " + par1File, var13);
|
|
! this.generateNewProperties();
|
|
}
|
|
finally
|
|
{
|
|
if (var3 != null)
|
|
{
|
|
***************
|
|
*** 49,67 ****
|
|
}
|
|
}
|
|
else
|
|
{
|
|
par2ILogAgent.logWarning(par1File + " does not exist");
|
|
! this.logMessageAndSave();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * logs an info message then calls saveSettingsToFile Yes this appears to be a potential stack overflow - these 2
|
|
! * functions call each other repeatdly if an exception occurs.
|
|
*/
|
|
! public void logMessageAndSave()
|
|
{
|
|
this.logger.logInfo("Generating new properties file");
|
|
this.saveProperties();
|
|
}
|
|
|
|
--- 52,69 ----
|
|
}
|
|
}
|
|
else
|
|
{
|
|
par2ILogAgent.logWarning(par1File + " does not exist");
|
|
! this.generateNewProperties();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Generates a new properties file.
|
|
*/
|
|
! public void generateNewProperties()
|
|
{
|
|
this.logger.logInfo("Generating new properties file");
|
|
this.saveProperties();
|
|
}
|
|
|
|
***************
|
|
*** 72,88 ****
|
|
{
|
|
FileOutputStream var1 = null;
|
|
|
|
try
|
|
{
|
|
! var1 = new FileOutputStream(this.associatedFile);
|
|
! this.properties.store(var1, "Minecraft server properties");
|
|
}
|
|
catch (Exception var11)
|
|
{
|
|
! this.logger.logWarningException("Failed to save " + this.associatedFile, var11);
|
|
! this.logMessageAndSave();
|
|
}
|
|
finally
|
|
{
|
|
if (var1 != null)
|
|
{
|
|
--- 74,90 ----
|
|
{
|
|
FileOutputStream var1 = null;
|
|
|
|
try
|
|
{
|
|
! var1 = new FileOutputStream(this.serverPropertiesFile);
|
|
! this.serverProperties.store(var1, "Minecraft server properties");
|
|
}
|
|
catch (Exception var11)
|
|
{
|
|
! this.logger.logWarningException("Failed to save " + this.serverPropertiesFile, var11);
|
|
! this.generateNewProperties();
|
|
}
|
|
finally
|
|
{
|
|
if (var1 != null)
|
|
{
|
|
***************
|
|
*** 101,139 ****
|
|
/**
|
|
* Returns this PropertyManager's file object used for property saving.
|
|
*/
|
|
public File getPropertiesFile()
|
|
{
|
|
! return this.associatedFile;
|
|
}
|
|
|
|
/**
|
|
! * Gets a property. If it does not exist, set it to the specified value.
|
|
*/
|
|
! public String getProperty(String par1Str, String par2Str)
|
|
{
|
|
! if (!this.properties.containsKey(par1Str))
|
|
{
|
|
! this.properties.setProperty(par1Str, par2Str);
|
|
this.saveProperties();
|
|
}
|
|
|
|
! return this.properties.getProperty(par1Str, par2Str);
|
|
}
|
|
|
|
/**
|
|
* Gets an integer property. If it does not exist, set it to the specified value.
|
|
*/
|
|
public int getIntProperty(String par1Str, int par2)
|
|
{
|
|
try
|
|
{
|
|
! return Integer.parseInt(this.getProperty(par1Str, "" + par2));
|
|
}
|
|
catch (Exception var4)
|
|
{
|
|
! this.properties.setProperty(par1Str, "" + par2);
|
|
return par2;
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 103,141 ----
|
|
/**
|
|
* Returns this PropertyManager's file object used for property saving.
|
|
*/
|
|
public File getPropertiesFile()
|
|
{
|
|
! return this.serverPropertiesFile;
|
|
}
|
|
|
|
/**
|
|
! * Returns a string property. If the property doesn't exist the default is returned.
|
|
*/
|
|
! public String getStringProperty(String par1Str, String par2Str)
|
|
{
|
|
! if (!this.serverProperties.containsKey(par1Str))
|
|
{
|
|
! this.serverProperties.setProperty(par1Str, par2Str);
|
|
this.saveProperties();
|
|
}
|
|
|
|
! return this.serverProperties.getProperty(par1Str, par2Str);
|
|
}
|
|
|
|
/**
|
|
* Gets an integer property. If it does not exist, set it to the specified value.
|
|
*/
|
|
public int getIntProperty(String par1Str, int par2)
|
|
{
|
|
try
|
|
{
|
|
! return Integer.parseInt(this.getStringProperty(par1Str, "" + par2));
|
|
}
|
|
catch (Exception var4)
|
|
{
|
|
! this.serverProperties.setProperty(par1Str, "" + par2);
|
|
return par2;
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 141,162 ****
|
|
*/
|
|
public boolean getBooleanProperty(String par1Str, boolean par2)
|
|
{
|
|
try
|
|
{
|
|
! return Boolean.parseBoolean(this.getProperty(par1Str, "" + par2));
|
|
}
|
|
catch (Exception var4)
|
|
{
|
|
! this.properties.setProperty(par1Str, "" + par2);
|
|
return par2;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Saves an Object with the given property name.
|
|
*/
|
|
public void setProperty(String par1Str, Object par2Obj)
|
|
{
|
|
! this.properties.setProperty(par1Str, "" + par2Obj);
|
|
}
|
|
}
|
|
--- 143,164 ----
|
|
*/
|
|
public boolean getBooleanProperty(String par1Str, boolean par2)
|
|
{
|
|
try
|
|
{
|
|
! return Boolean.parseBoolean(this.getStringProperty(par1Str, "" + par2));
|
|
}
|
|
catch (Exception var4)
|
|
{
|
|
! this.serverProperties.setProperty(par1Str, "" + par2);
|
|
return par2;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Saves an Object with the given property name.
|
|
*/
|
|
public void setProperty(String par1Str, Object par2Obj)
|
|
{
|
|
! this.serverProperties.setProperty(par1Str, "" + par2Obj);
|
|
}
|
|
}
|
|
*** RConConsoleSource.java Sat Feb 5 04:19:44 2022
|
|
--- RConConsoleSource.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 2,13 ****
|
|
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
public class RConConsoleSource implements ICommandSender
|
|
{
|
|
! /** only ever used by MinecraftServer.executeCommand */
|
|
! public static final RConConsoleSource consoleBuffer = new RConConsoleSource();
|
|
|
|
/** RCon string buffer for log. */
|
|
private StringBuffer buffer = new StringBuffer();
|
|
|
|
/**
|
|
--- 2,13 ----
|
|
|
|
import net.minecraft.server.MinecraftServer;
|
|
|
|
public class RConConsoleSource implements ICommandSender
|
|
{
|
|
! /** Single instance of RConConsoleSource */
|
|
! public static final RConConsoleSource instance = new RConConsoleSource();
|
|
|
|
/** RCon string buffer for log. */
|
|
private StringBuffer buffer = new StringBuffer();
|
|
|
|
/**
|
|
***************
|
|
*** 16,26 ****
|
|
public void resetLog()
|
|
{
|
|
this.buffer.setLength(0);
|
|
}
|
|
|
|
! public String getChatBuffer()
|
|
{
|
|
return this.buffer.toString();
|
|
}
|
|
|
|
/**
|
|
--- 16,29 ----
|
|
public void resetLog()
|
|
{
|
|
this.buffer.setLength(0);
|
|
}
|
|
|
|
! /**
|
|
! * Gets the contents of the RCon log
|
|
! */
|
|
! public String getLogContents()
|
|
{
|
|
return this.buffer.toString();
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 45,55 ****
|
|
}
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! public ChunkCoordinates getPlayerCoordinates()
|
|
{
|
|
return new ChunkCoordinates(0, 0, 0);
|
|
}
|
|
|
|
public World getEntityWorld()
|
|
--- 48,58 ----
|
|
}
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! public ChunkCoordinates getCommandSenderPosition()
|
|
{
|
|
return new ChunkCoordinates(0, 0, 0);
|
|
}
|
|
|
|
public World getEntityWorld()
|
|
*** RConThreadClient.java Sat Feb 5 04:19:44 2022
|
|
--- RConThreadClient.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 78,88 ****
|
|
{
|
|
String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2);
|
|
|
|
try
|
|
{
|
|
! this.sendMultipacketResponse(var5, this.server.executeCommand(var8));
|
|
}
|
|
catch (Exception var16)
|
|
{
|
|
this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")");
|
|
}
|
|
--- 78,88 ----
|
|
{
|
|
String var8 = RConUtils.getBytesAsString(this.buffer, var21, var2);
|
|
|
|
try
|
|
{
|
|
! this.sendMultipacketResponse(var5, this.server.handleRConCommand(var8));
|
|
}
|
|
catch (Exception var16)
|
|
{
|
|
this.sendMultipacketResponse(var5, "Error executing: " + var8 + " (" + var16.getMessage() + ")");
|
|
}
|
|
*** RConThreadQuery.java Sat Feb 5 04:19:44 2022
|
|
--- RConThreadQuery.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 70,80 ****
|
|
{
|
|
super(par1IServer);
|
|
this.queryPort = par1IServer.getIntProperty("query.port", 0);
|
|
this.serverHostname = par1IServer.getHostname();
|
|
this.serverPort = par1IServer.getPort();
|
|
! this.serverMotd = par1IServer.getServerMOTD();
|
|
this.maxPlayers = par1IServer.getMaxPlayers();
|
|
this.worldName = par1IServer.getFolderName();
|
|
this.lastQueryResponseTime = 0L;
|
|
this.queryHostname = "0.0.0.0";
|
|
|
|
--- 70,80 ----
|
|
{
|
|
super(par1IServer);
|
|
this.queryPort = par1IServer.getIntProperty("query.port", 0);
|
|
this.serverHostname = par1IServer.getHostname();
|
|
this.serverPort = par1IServer.getPort();
|
|
! this.serverMotd = par1IServer.getMotd();
|
|
this.maxPlayers = par1IServer.getMaxPlayers();
|
|
this.worldName = par1IServer.getFolderName();
|
|
this.lastQueryResponseTime = 0L;
|
|
this.queryHostname = "0.0.0.0";
|
|
|
|
***************
|
|
*** 182,192 ****
|
|
/**
|
|
* Creates a query response as a byte array for the specified query DatagramPacket
|
|
*/
|
|
private byte[] createQueryResponse(DatagramPacket par1DatagramPacket) throws IOException
|
|
{
|
|
! long var2 = MinecraftServer.getSystemTimeMillis();
|
|
|
|
if (var2 < this.lastQueryResponseTime + 5000L)
|
|
{
|
|
byte[] var7 = this.output.toByteArray();
|
|
byte[] var8 = this.getRequestID(par1DatagramPacket.getSocketAddress());
|
|
--- 182,192 ----
|
|
/**
|
|
* Creates a query response as a byte array for the specified query DatagramPacket
|
|
*/
|
|
private byte[] createQueryResponse(DatagramPacket par1DatagramPacket) throws IOException
|
|
{
|
|
! long var2 = MinecraftServer.getCurrentTimeMillis();
|
|
|
|
if (var2 < this.lastQueryResponseTime + 5000L)
|
|
{
|
|
byte[] var7 = this.output.toByteArray();
|
|
byte[] var8 = this.getRequestID(par1DatagramPacket.getSocketAddress());
|
|
***************
|
|
*** 283,293 ****
|
|
*/
|
|
private void cleanQueryClientsMap()
|
|
{
|
|
if (this.running)
|
|
{
|
|
! long var1 = MinecraftServer.getSystemTimeMillis();
|
|
|
|
if (var1 >= this.lastAuthCheckTime + 30000L)
|
|
{
|
|
this.lastAuthCheckTime = var1;
|
|
Iterator var3 = this.queryClients.entrySet().iterator();
|
|
--- 283,293 ----
|
|
*/
|
|
private void cleanQueryClientsMap()
|
|
{
|
|
if (this.running)
|
|
{
|
|
! long var1 = MinecraftServer.getCurrentTimeMillis();
|
|
|
|
if (var1 >= this.lastAuthCheckTime + 30000L)
|
|
{
|
|
this.lastAuthCheckTime = var1;
|
|
Iterator var3 = this.queryClients.entrySet().iterator();
|
|
***************
|
|
*** 306,316 ****
|
|
}
|
|
|
|
public void run()
|
|
{
|
|
this.logInfo("Query running on " + this.serverHostname + ":" + this.queryPort);
|
|
! this.lastAuthCheckTime = MinecraftServer.getSystemTimeMillis();
|
|
this.incomingPacket = new DatagramPacket(this.buffer, this.buffer.length);
|
|
|
|
try
|
|
{
|
|
while (this.running)
|
|
--- 306,316 ----
|
|
}
|
|
|
|
public void run()
|
|
{
|
|
this.logInfo("Query running on " + this.serverHostname + ":" + this.queryPort);
|
|
! this.lastAuthCheckTime = MinecraftServer.getCurrentTimeMillis();
|
|
this.incomingPacket = new DatagramPacket(this.buffer, this.buffer.length);
|
|
|
|
try
|
|
{
|
|
while (this.running)
|
|
*** RConThreadQueryAuth.java Sat Feb 5 04:19:44 2022
|
|
--- RConThreadQueryAuth.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 7,17 ****
|
|
class RConThreadQueryAuth
|
|
{
|
|
/** The creation timestamp for this auth */
|
|
private long timestamp;
|
|
|
|
! /** A random challenge */
|
|
private int randomChallenge;
|
|
|
|
/** A client-provided request ID associated with this query. */
|
|
private byte[] requestId;
|
|
|
|
--- 7,17 ----
|
|
class RConThreadQueryAuth
|
|
{
|
|
/** The creation timestamp for this auth */
|
|
private long timestamp;
|
|
|
|
! /** A random integer value to be used for client response authentication */
|
|
private int randomChallenge;
|
|
|
|
/** A client-provided request ID associated with this query. */
|
|
private byte[] requestId;
|
|
|
|
*** RegionFile.java Sat Feb 5 04:19:44 2022
|
|
--- RegionFile.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 274,284 ****
|
|
this.write(var6, par3ArrayOfByte, par4);
|
|
this.setOffset(par1, par2, var6 << 8 | var8);
|
|
}
|
|
}
|
|
|
|
! this.setChunkTimestamp(par1, par2, (int)(MinecraftServer.getSystemTimeMillis() / 1000L));
|
|
}
|
|
catch (IOException var12)
|
|
{
|
|
var12.printStackTrace();
|
|
}
|
|
--- 274,284 ----
|
|
this.write(var6, par3ArrayOfByte, par4);
|
|
this.setOffset(par1, par2, var6 << 8 | var8);
|
|
}
|
|
}
|
|
|
|
! this.setChunkTimestamp(par1, par2, (int)(MinecraftServer.getCurrentTimeMillis() / 1000L));
|
|
}
|
|
catch (IOException var12)
|
|
{
|
|
var12.printStackTrace();
|
|
}
|
|
*** RegionFileCache.java Sat Feb 5 04:19:44 2022
|
|
--- RegionFileCache.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 40,50 ****
|
|
return var6;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Saves the current Chunk Map Cache
|
|
*/
|
|
public static synchronized void clearRegionFileReferences()
|
|
{
|
|
Iterator var0 = regionsByFilename.values().iterator();
|
|
|
|
--- 40,50 ----
|
|
return var6;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * clears region file references
|
|
*/
|
|
public static synchronized void clearRegionFileReferences()
|
|
{
|
|
Iterator var0 = regionsByFilename.values().iterator();
|
|
|
|
*** SaveFormatOld.java Sat Feb 5 04:19:44 2022
|
|
--- SaveFormatOld.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 1,12 ****
|
|
package net.minecraft.src;
|
|
|
|
import java.io.File;
|
|
import java.io.FileInputStream;
|
|
- import java.io.FileOutputStream;
|
|
- import java.util.ArrayList;
|
|
- import java.util.List;
|
|
|
|
public class SaveFormatOld implements ISaveFormat
|
|
{
|
|
/**
|
|
* Reference to the File object representing the directory for the world saves
|
|
--- 1,9 ----
|
|
***************
|
|
*** 21,48 ****
|
|
}
|
|
|
|
this.savesDirectory = par1File;
|
|
}
|
|
|
|
- public List getSaveList() throws AnvilConverterException
|
|
- {
|
|
- ArrayList var1 = new ArrayList();
|
|
-
|
|
- for (int var2 = 0; var2 < 5; ++var2)
|
|
- {
|
|
- String var3 = "World" + (var2 + 1);
|
|
- WorldInfo var4 = this.getWorldInfo(var3);
|
|
-
|
|
- if (var4 != null)
|
|
- {
|
|
- var1.add(new SaveFormatComparator(var3, "", var4.getLastTimePlayed(), var4.getSizeOnDisk(), var4.getGameType(), false, var4.isHardcoreModeEnabled(), var4.areCommandsAllowed()));
|
|
- }
|
|
- }
|
|
-
|
|
- return var1;
|
|
- }
|
|
-
|
|
public void flushCache() {}
|
|
|
|
/**
|
|
* gets the world info
|
|
*/
|
|
--- 18,27 ----
|
|
***************
|
|
*** 93,132 ****
|
|
return null;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * @args: Takes two arguments - first the name of the directory containing the world and second the new name for
|
|
- * that world. @desc: Renames the world by storing the new name in level.dat. It does *not* rename the directory
|
|
- * containing the world data.
|
|
- */
|
|
- public void renameWorld(String par1Str, String par2Str)
|
|
- {
|
|
- File var3 = new File(this.savesDirectory, par1Str);
|
|
-
|
|
- if (var3.exists())
|
|
- {
|
|
- File var4 = new File(var3, "level.dat");
|
|
-
|
|
- if (var4.exists())
|
|
- {
|
|
- try
|
|
- {
|
|
- NBTTagCompound var5 = CompressedStreamTools.readCompressed(new FileInputStream(var4));
|
|
- NBTTagCompound var6 = var5.getCompoundTag("Data");
|
|
- var6.setString("LevelName", par2Str);
|
|
- CompressedStreamTools.writeCompressed(var5, new FileOutputStream(var4));
|
|
- }
|
|
- catch (Exception var7)
|
|
- {
|
|
- var7.printStackTrace();
|
|
- }
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* @args: Takes one argument - the name of the directory of the world to delete. @desc: Delete the world by deleting
|
|
* the associated directory recursively.
|
|
*/
|
|
public boolean deleteWorldDirectory(String par1Str)
|
|
{
|
|
--- 72,81 ----
|
|
***************
|
|
*** 202,230 ****
|
|
{
|
|
return new SaveHandler(this.savesDirectory, par1Str, par2);
|
|
}
|
|
|
|
/**
|
|
! * Checks if the save directory uses the old map format
|
|
*/
|
|
public boolean isOldMapFormat(String par1Str)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
! * Converts the specified map to the new map format. Args: worldName, loadingScreen
|
|
*/
|
|
public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate)
|
|
{
|
|
return false;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return whether the given world can be loaded.
|
|
- */
|
|
- public boolean canLoadWorld(String par1Str)
|
|
- {
|
|
- File var2 = new File(this.savesDirectory, par1Str);
|
|
- return var2.isDirectory();
|
|
}
|
|
}
|
|
--- 151,170 ----
|
|
{
|
|
return new SaveHandler(this.savesDirectory, par1Str, par2);
|
|
}
|
|
|
|
/**
|
|
! * gets if the map is old chunk saving (true) or McRegion (false)
|
|
*/
|
|
public boolean isOldMapFormat(String par1Str)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
! * converts the map to mcRegion
|
|
*/
|
|
public boolean convertMapFormat(String par1Str, IProgressUpdate par2IProgressUpdate)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
*** SaveHandler.java Sat Feb 5 04:19:44 2022
|
|
--- SaveHandler.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 18,28 ****
|
|
private final File mapDataDir;
|
|
|
|
/**
|
|
* The time in milliseconds when this field was initialized. Stored in the session lock file.
|
|
*/
|
|
! private final long initializationTime = MinecraftServer.getSystemTimeMillis();
|
|
|
|
/** The directory name of the world */
|
|
private final String saveDirectoryName;
|
|
|
|
public SaveHandler(File par1File, String par2Str, boolean par3)
|
|
--- 18,28 ----
|
|
private final File mapDataDir;
|
|
|
|
/**
|
|
* The time in milliseconds when this field was initialized. Stored in the session lock file.
|
|
*/
|
|
! private final long initializationTime = MinecraftServer.getCurrentTimeMillis();
|
|
|
|
/** The directory name of the world */
|
|
private final String saveDirectoryName;
|
|
|
|
public SaveHandler(File par1File, String par2Str, boolean par3)
|
|
***************
|
|
*** 103,113 ****
|
|
throw new MinecraftException("Failed to check session lock, aborting");
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Returns the chunk loader with the provided world provider
|
|
*/
|
|
public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
|
|
{
|
|
throw new RuntimeException("Old Chunk Storage is no longer supported.");
|
|
}
|
|
--- 103,113 ----
|
|
throw new MinecraftException("Failed to check session lock, aborting");
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * initializes and returns the chunk loader for the specified world provider
|
|
*/
|
|
public IChunkLoader getChunkLoader(WorldProvider par1WorldProvider)
|
|
{
|
|
throw new RuntimeException("Old Chunk Storage is no longer supported.");
|
|
}
|
|
***************
|
|
*** 194,204 ****
|
|
var8.printStackTrace();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Saves the passed in world info.
|
|
*/
|
|
public void saveWorldInfo(WorldInfo par1WorldInfo)
|
|
{
|
|
NBTTagCompound var2 = par1WorldInfo.getNBTTagCompound();
|
|
NBTTagCompound var3 = new NBTTagCompound();
|
|
--- 194,204 ----
|
|
var8.printStackTrace();
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * used to update level.dat from old format to MCRegion format
|
|
*/
|
|
public void saveWorldInfo(WorldInfo par1WorldInfo)
|
|
{
|
|
NBTTagCompound var2 = par1WorldInfo.getNBTTagCompound();
|
|
NBTTagCompound var3 = new NBTTagCompound();
|
|
***************
|
|
*** 297,310 ****
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
! /**
|
|
! * returns null if no saveHandler is relevent (eg. SMP)
|
|
! */
|
|
! public IPlayerFileData getSaveHandler()
|
|
{
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
--- 297,307 ----
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
! public IPlayerFileData getPlayerNBTManager()
|
|
{
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
*** Score.java Sat Feb 5 04:19:44 2022
|
|
--- Score.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 73,82 ****
|
|
--- 73,85 ----
|
|
public ScoreObjective func_96645_d()
|
|
{
|
|
return this.theScoreObjective;
|
|
}
|
|
|
|
+ /**
|
|
+ * Returns the name of the player this score belongs to
|
|
+ */
|
|
public String getPlayerName()
|
|
{
|
|
return this.field_96654_d;
|
|
}
|
|
|
|
*** Scoreboard.java Sat Feb 5 04:19:44 2022
|
|
--- Scoreboard.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 191,201 ****
|
|
public ScorePlayerTeam func_96508_e(String par1Str)
|
|
{
|
|
return (ScorePlayerTeam)this.field_96542_e.get(par1Str);
|
|
}
|
|
|
|
! public ScorePlayerTeam func_96527_f(String par1Str)
|
|
{
|
|
ScorePlayerTeam var2 = this.func_96508_e(par1Str);
|
|
|
|
if (var2 != null)
|
|
{
|
|
--- 191,201 ----
|
|
public ScorePlayerTeam func_96508_e(String par1Str)
|
|
{
|
|
return (ScorePlayerTeam)this.field_96542_e.get(par1Str);
|
|
}
|
|
|
|
! public ScorePlayerTeam createTeam(String par1Str)
|
|
{
|
|
ScorePlayerTeam var2 = this.func_96508_e(par1Str);
|
|
|
|
if (var2 != null)
|
|
{
|
|
***************
|
|
*** 222,243 ****
|
|
}
|
|
|
|
this.func_96513_c(par1ScorePlayerTeam);
|
|
}
|
|
|
|
! public void func_96521_a(String par1Str, ScorePlayerTeam par2ScorePlayerTeam)
|
|
{
|
|
if (this.getPlayersTeam(par1Str) != null)
|
|
{
|
|
! this.func_96524_g(par1Str);
|
|
}
|
|
|
|
this.teamMemberships.put(par1Str, par2ScorePlayerTeam);
|
|
par2ScorePlayerTeam.getMembershipCollection().add(par1Str);
|
|
}
|
|
|
|
! public boolean func_96524_g(String par1Str)
|
|
{
|
|
ScorePlayerTeam var2 = this.getPlayersTeam(par1Str);
|
|
|
|
if (var2 != null)
|
|
{
|
|
--- 222,243 ----
|
|
}
|
|
|
|
this.func_96513_c(par1ScorePlayerTeam);
|
|
}
|
|
|
|
! public void addPlayerToTeam(String par1Str, ScorePlayerTeam par2ScorePlayerTeam)
|
|
{
|
|
if (this.getPlayersTeam(par1Str) != null)
|
|
{
|
|
! this.removePlayerFromTeams(par1Str);
|
|
}
|
|
|
|
this.teamMemberships.put(par1Str, par2ScorePlayerTeam);
|
|
par2ScorePlayerTeam.getMembershipCollection().add(par1Str);
|
|
}
|
|
|
|
! public boolean removePlayerFromTeams(String par1Str)
|
|
{
|
|
ScorePlayerTeam var2 = this.getPlayersTeam(par1Str);
|
|
|
|
if (var2 != null)
|
|
{
|
|
*** ScoreboardSaveData.java Sat Feb 5 04:19:44 2022
|
|
--- ScoreboardSaveData.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 58,91 ****
|
|
protected void func_96498_a(NBTTagList par1NBTTagList)
|
|
{
|
|
for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2)
|
|
{
|
|
NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2);
|
|
! ScorePlayerTeam var4 = this.theScoreboard.func_96527_f(var3.getString("Name"));
|
|
! var4.func_96664_a(var3.getString("DisplayName"));
|
|
! var4.func_96666_b(var3.getString("Prefix"));
|
|
! var4.func_96662_c(var3.getString("Suffix"));
|
|
|
|
if (var3.hasKey("AllowFriendlyFire"))
|
|
{
|
|
var4.setAllowFriendlyFire(var3.getBoolean("AllowFriendlyFire"));
|
|
}
|
|
|
|
if (var3.hasKey("SeeFriendlyInvisibles"))
|
|
{
|
|
! var4.func_98300_b(var3.getBoolean("SeeFriendlyInvisibles"));
|
|
}
|
|
|
|
this.func_96502_a(var4, var3.getTagList("Players"));
|
|
}
|
|
}
|
|
|
|
protected void func_96502_a(ScorePlayerTeam par1ScorePlayerTeam, NBTTagList par2NBTTagList)
|
|
{
|
|
for (int var3 = 0; var3 < par2NBTTagList.tagCount(); ++var3)
|
|
{
|
|
! this.theScoreboard.func_96521_a(((NBTTagString)par2NBTTagList.tagAt(var3)).data, par1ScorePlayerTeam);
|
|
}
|
|
}
|
|
|
|
protected void func_96504_c(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
--- 58,91 ----
|
|
protected void func_96498_a(NBTTagList par1NBTTagList)
|
|
{
|
|
for (int var2 = 0; var2 < par1NBTTagList.tagCount(); ++var2)
|
|
{
|
|
NBTTagCompound var3 = (NBTTagCompound)par1NBTTagList.tagAt(var2);
|
|
! ScorePlayerTeam var4 = this.theScoreboard.createTeam(var3.getString("Name"));
|
|
! var4.setTeamName(var3.getString("DisplayName"));
|
|
! var4.setNamePrefix(var3.getString("Prefix"));
|
|
! var4.setNameSuffix(var3.getString("Suffix"));
|
|
|
|
if (var3.hasKey("AllowFriendlyFire"))
|
|
{
|
|
var4.setAllowFriendlyFire(var3.getBoolean("AllowFriendlyFire"));
|
|
}
|
|
|
|
if (var3.hasKey("SeeFriendlyInvisibles"))
|
|
{
|
|
! var4.setSeeFriendlyInvisiblesEnabled(var3.getBoolean("SeeFriendlyInvisibles"));
|
|
}
|
|
|
|
this.func_96502_a(var4, var3.getTagList("Players"));
|
|
}
|
|
}
|
|
|
|
protected void func_96502_a(ScorePlayerTeam par1ScorePlayerTeam, NBTTagList par2NBTTagList)
|
|
{
|
|
for (int var3 = 0; var3 < par2NBTTagList.tagCount(); ++var3)
|
|
{
|
|
! this.theScoreboard.addPlayerToTeam(((NBTTagString)par2NBTTagList.tagAt(var3)).data, par1ScorePlayerTeam);
|
|
}
|
|
}
|
|
|
|
protected void func_96504_c(NBTTagCompound par1NBTTagCompound)
|
|
{
|
|
*** ScoreObjective.java Sat Feb 5 04:19:44 2022
|
|
--- ScoreObjective.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 15,29 ****
|
|
this.name = par2Str;
|
|
this.objectiveCriteria = par3ScoreObjectiveCriteria;
|
|
this.displayName = par2Str;
|
|
}
|
|
|
|
- public Scoreboard getScoreboard()
|
|
- {
|
|
- return this.theScoreboard;
|
|
- }
|
|
-
|
|
public String getName()
|
|
{
|
|
return this.name;
|
|
}
|
|
|
|
--- 15,24 ----
|
|
*** ScorePlayerTeam.java Sat Feb 5 04:19:44 2022
|
|
--- ScorePlayerTeam.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 32,42 ****
|
|
public String func_96669_c()
|
|
{
|
|
return this.field_96673_d;
|
|
}
|
|
|
|
! public void func_96664_a(String par1Str)
|
|
{
|
|
if (par1Str == null)
|
|
{
|
|
throw new IllegalArgumentException("Name cannot be null");
|
|
}
|
|
--- 32,42 ----
|
|
public String func_96669_c()
|
|
{
|
|
return this.field_96673_d;
|
|
}
|
|
|
|
! public void setTeamName(String par1Str)
|
|
{
|
|
if (par1Str == null)
|
|
{
|
|
throw new IllegalArgumentException("Name cannot be null");
|
|
}
|
|
***************
|
|
*** 58,68 ****
|
|
public String getColorPrefix()
|
|
{
|
|
return this.field_96674_e;
|
|
}
|
|
|
|
! public void func_96666_b(String par1Str)
|
|
{
|
|
if (par1Str == null)
|
|
{
|
|
throw new IllegalArgumentException("Prefix cannot be null");
|
|
}
|
|
--- 58,68 ----
|
|
public String getColorPrefix()
|
|
{
|
|
return this.field_96674_e;
|
|
}
|
|
|
|
! public void setNamePrefix(String par1Str)
|
|
{
|
|
if (par1Str == null)
|
|
{
|
|
throw new IllegalArgumentException("Prefix cannot be null");
|
|
}
|
|
***************
|
|
*** 79,89 ****
|
|
public String getColorSuffix()
|
|
{
|
|
return this.colorSuffix;
|
|
}
|
|
|
|
! public void func_96662_c(String par1Str)
|
|
{
|
|
if (par1Str == null)
|
|
{
|
|
throw new IllegalArgumentException("Suffix cannot be null");
|
|
}
|
|
--- 79,89 ----
|
|
public String getColorSuffix()
|
|
{
|
|
return this.colorSuffix;
|
|
}
|
|
|
|
! public void setNameSuffix(String par1Str)
|
|
{
|
|
if (par1Str == null)
|
|
{
|
|
throw new IllegalArgumentException("Suffix cannot be null");
|
|
}
|
|
***************
|
|
*** 121,131 ****
|
|
public boolean func_98297_h()
|
|
{
|
|
return this.field_98301_h;
|
|
}
|
|
|
|
! public void func_98300_b(boolean par1)
|
|
{
|
|
this.field_98301_h = par1;
|
|
this.theScoreboard.func_96538_b(this);
|
|
}
|
|
|
|
--- 121,131 ----
|
|
public boolean func_98297_h()
|
|
{
|
|
return this.field_98301_h;
|
|
}
|
|
|
|
! public void setSeeFriendlyInvisiblesEnabled(boolean par1)
|
|
{
|
|
this.field_98301_h = par1;
|
|
this.theScoreboard.func_96538_b(this);
|
|
}
|
|
|
|
***************
|
|
*** 142,154 ****
|
|
{
|
|
var1 |= 2;
|
|
}
|
|
|
|
return var1;
|
|
- }
|
|
-
|
|
- public void func_98298_a(int par1)
|
|
- {
|
|
- this.setAllowFriendlyFire((par1 & 1) > 0);
|
|
- this.func_98300_b((par1 & 2) > 0);
|
|
}
|
|
}
|
|
--- 142,148 ----
|
|
*** ServerCommandScoreboard.java Sat Feb 5 04:19:44 2022
|
|
--- ServerCommandScoreboard.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 358,377 ****
|
|
throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", new Object[] {var6, Integer.valueOf(32)});
|
|
}
|
|
|
|
if (var6.length() > 0)
|
|
{
|
|
! var5.func_96527_f(var4).func_96664_a(var6);
|
|
}
|
|
else
|
|
{
|
|
! var5.func_96527_f(var4);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! var5.func_96527_f(var4);
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.add.success", new Object[] {var4});
|
|
}
|
|
}
|
|
--- 358,377 ----
|
|
throw new SyntaxErrorException("commands.scoreboard.teams.add.displayTooLong", new Object[] {var6, Integer.valueOf(32)});
|
|
}
|
|
|
|
if (var6.length() > 0)
|
|
{
|
|
! var5.createTeam(var4).setTeamName(var6);
|
|
}
|
|
else
|
|
{
|
|
! var5.createTeam(var4);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! var5.createTeam(var4);
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.add.success", new Object[] {var4});
|
|
}
|
|
}
|
|
***************
|
|
*** 414,425 ****
|
|
if (var6 == null)
|
|
{
|
|
throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(EnumChatFormatting.func_96296_a(true, false))});
|
|
}
|
|
|
|
! var4.func_96666_b(var7.toString());
|
|
! var4.func_96662_c(EnumChatFormatting.RESET.toString());
|
|
}
|
|
else if (var5.equalsIgnoreCase("friendlyfire"))
|
|
{
|
|
if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false"))
|
|
{
|
|
--- 414,425 ----
|
|
if (var6 == null)
|
|
{
|
|
throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(EnumChatFormatting.func_96296_a(true, false))});
|
|
}
|
|
|
|
! var4.setNamePrefix(var7.toString());
|
|
! var4.setNameSuffix(EnumChatFormatting.RESET.toString());
|
|
}
|
|
else if (var5.equalsIgnoreCase("friendlyfire"))
|
|
{
|
|
if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false"))
|
|
{
|
|
***************
|
|
*** 433,443 ****
|
|
if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false"))
|
|
{
|
|
throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))});
|
|
}
|
|
|
|
! var4.func_98300_b(var6.equalsIgnoreCase("true"));
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.option.success", new Object[] {var5, var4.func_96661_b(), var6});
|
|
}
|
|
}
|
|
--- 433,443 ----
|
|
if (!var6.equalsIgnoreCase("true") && !var6.equalsIgnoreCase("false"))
|
|
{
|
|
throw new WrongUsageException("commands.scoreboard.teams.option.noValue", new Object[] {var5, func_96333_a(Arrays.asList(new String[]{"true", "false"}))});
|
|
}
|
|
|
|
! var4.setSeeFriendlyInvisiblesEnabled(var6.equalsIgnoreCase("true"));
|
|
}
|
|
|
|
notifyAdmins(par1ICommandSender, "commands.scoreboard.teams.option.success", new Object[] {var5, var4.func_96661_b(), var6});
|
|
}
|
|
}
|
|
***************
|
|
*** 504,522 ****
|
|
String var7;
|
|
|
|
if (par1ICommandSender instanceof EntityPlayer && par3 == par2ArrayOfStr.length)
|
|
{
|
|
var7 = getCommandSenderAsPlayer(par1ICommandSender).getEntityName();
|
|
! var4.func_96521_a(var7, var5);
|
|
var6.add(var7);
|
|
}
|
|
else
|
|
{
|
|
while (par3 < par2ArrayOfStr.length)
|
|
{
|
|
var7 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]);
|
|
! var4.func_96521_a(var7, var5);
|
|
var6.add(var7);
|
|
}
|
|
}
|
|
|
|
if (!var6.isEmpty())
|
|
--- 504,522 ----
|
|
String var7;
|
|
|
|
if (par1ICommandSender instanceof EntityPlayer && par3 == par2ArrayOfStr.length)
|
|
{
|
|
var7 = getCommandSenderAsPlayer(par1ICommandSender).getEntityName();
|
|
! var4.addPlayerToTeam(var7, var5);
|
|
var6.add(var7);
|
|
}
|
|
else
|
|
{
|
|
while (par3 < par2ArrayOfStr.length)
|
|
{
|
|
var7 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]);
|
|
! var4.addPlayerToTeam(var7, var5);
|
|
var6.add(var7);
|
|
}
|
|
}
|
|
|
|
if (!var6.isEmpty())
|
|
***************
|
|
*** 537,547 ****
|
|
|
|
if (par1ICommandSender instanceof EntityPlayer && par3 == par2ArrayOfStr.length)
|
|
{
|
|
var7 = getCommandSenderAsPlayer(par1ICommandSender).getEntityName();
|
|
|
|
! if (var4.func_96524_g(var7))
|
|
{
|
|
var5.add(var7);
|
|
}
|
|
else
|
|
{
|
|
--- 537,547 ----
|
|
|
|
if (par1ICommandSender instanceof EntityPlayer && par3 == par2ArrayOfStr.length)
|
|
{
|
|
var7 = getCommandSenderAsPlayer(par1ICommandSender).getEntityName();
|
|
|
|
! if (var4.removePlayerFromTeams(var7))
|
|
{
|
|
var5.add(var7);
|
|
}
|
|
else
|
|
{
|
|
***************
|
|
*** 552,562 ****
|
|
{
|
|
while (par3 < par2ArrayOfStr.length)
|
|
{
|
|
var7 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]);
|
|
|
|
! if (var4.func_96524_g(var7))
|
|
{
|
|
var5.add(var7);
|
|
}
|
|
else
|
|
{
|
|
--- 552,562 ----
|
|
{
|
|
while (par3 < par2ArrayOfStr.length)
|
|
{
|
|
var7 = func_96332_d(par1ICommandSender, par2ArrayOfStr[par3++]);
|
|
|
|
! if (var4.removePlayerFromTeams(var7))
|
|
{
|
|
var5.add(var7);
|
|
}
|
|
else
|
|
{
|
|
*** ServerConfigurationManager.java Sat Feb 5 04:19:44 2022
|
|
--- ServerConfigurationManager.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 66,97 ****
|
|
NBTTagCompound var3 = this.readPlayerDataFromFile(par2EntityPlayerMP);
|
|
par2EntityPlayerMP.setWorld(this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension));
|
|
par2EntityPlayerMP.theItemInWorldManager.setWorld((WorldServer)par2EntityPlayerMP.worldObj);
|
|
String var4 = "local";
|
|
|
|
! if (par1INetworkManager.getSocketAddress() != null)
|
|
{
|
|
! var4 = par1INetworkManager.getSocketAddress().toString();
|
|
}
|
|
|
|
this.mcServer.getLogAgent().logInfo(par2EntityPlayerMP.getCommandSenderName() + "[" + var4 + "] logged in with entity id " + par2EntityPlayerMP.entityId + " at (" + par2EntityPlayerMP.posX + ", " + par2EntityPlayerMP.posY + ", " + par2EntityPlayerMP.posZ + ")");
|
|
WorldServer var5 = this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension);
|
|
ChunkCoordinates var6 = var5.getSpawnPoint();
|
|
this.func_72381_a(par2EntityPlayerMP, (EntityPlayerMP)null, var5);
|
|
NetServerHandler var7 = new NetServerHandler(this.mcServer, par1INetworkManager, par2EntityPlayerMP);
|
|
! var7.sendPacketToPlayer(new Packet1Login(par2EntityPlayerMP.entityId, var5.getWorldInfo().getTerrainType(), par2EntityPlayerMP.theItemInWorldManager.getGameType(), var5.getWorldInfo().isHardcoreModeEnabled(), var5.provider.dimensionId, var5.difficultySetting, var5.getHeight(), this.getMaxPlayers()));
|
|
! var7.sendPacketToPlayer(new Packet250CustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8)));
|
|
! var7.sendPacketToPlayer(new Packet6SpawnPosition(var6.posX, var6.posY, var6.posZ));
|
|
! var7.sendPacketToPlayer(new Packet202PlayerAbilities(par2EntityPlayerMP.capabilities));
|
|
! var7.sendPacketToPlayer(new Packet16BlockItemSwitch(par2EntityPlayerMP.inventory.currentItem));
|
|
this.func_96456_a((ServerScoreboard)var5.getScoreboard(), par2EntityPlayerMP);
|
|
this.updateTimeAndWeatherForPlayer(par2EntityPlayerMP, var5);
|
|
this.sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.joined", new Object[] {par2EntityPlayerMP.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
|
|
this.playerLoggedIn(par2EntityPlayerMP);
|
|
var7.setPlayerLocation(par2EntityPlayerMP.posX, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZ, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch);
|
|
this.mcServer.getNetworkThread().addPlayer(var7);
|
|
! var7.sendPacketToPlayer(new Packet4UpdateTime(var5.getTotalWorldTime(), var5.getWorldTime(), var5.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));
|
|
|
|
if (this.mcServer.getTexturePack().length() > 0)
|
|
{
|
|
par2EntityPlayerMP.requestTexturePackLoad(this.mcServer.getTexturePack(), this.mcServer.textureSize());
|
|
}
|
|
--- 66,97 ----
|
|
NBTTagCompound var3 = this.readPlayerDataFromFile(par2EntityPlayerMP);
|
|
par2EntityPlayerMP.setWorld(this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension));
|
|
par2EntityPlayerMP.theItemInWorldManager.setWorld((WorldServer)par2EntityPlayerMP.worldObj);
|
|
String var4 = "local";
|
|
|
|
! if (par1INetworkManager.getRemoteAddress() != null)
|
|
{
|
|
! var4 = par1INetworkManager.getRemoteAddress().toString();
|
|
}
|
|
|
|
this.mcServer.getLogAgent().logInfo(par2EntityPlayerMP.getCommandSenderName() + "[" + var4 + "] logged in with entity id " + par2EntityPlayerMP.entityId + " at (" + par2EntityPlayerMP.posX + ", " + par2EntityPlayerMP.posY + ", " + par2EntityPlayerMP.posZ + ")");
|
|
WorldServer var5 = this.mcServer.worldServerForDimension(par2EntityPlayerMP.dimension);
|
|
ChunkCoordinates var6 = var5.getSpawnPoint();
|
|
this.func_72381_a(par2EntityPlayerMP, (EntityPlayerMP)null, var5);
|
|
NetServerHandler var7 = new NetServerHandler(this.mcServer, par1INetworkManager, par2EntityPlayerMP);
|
|
! var7.sendPacket(new Packet1Login(par2EntityPlayerMP.entityId, var5.getWorldInfo().getTerrainType(), par2EntityPlayerMP.theItemInWorldManager.getGameType(), var5.getWorldInfo().isHardcoreModeEnabled(), var5.provider.dimensionId, var5.difficultySetting, var5.getHeight(), this.getMaxPlayers()));
|
|
! var7.sendPacket(new Packet250CustomPayload("MC|Brand", this.getServerInstance().getServerModName().getBytes(Charsets.UTF_8)));
|
|
! var7.sendPacket(new Packet6SpawnPosition(var6.posX, var6.posY, var6.posZ));
|
|
! var7.sendPacket(new Packet202PlayerAbilities(par2EntityPlayerMP.capabilities));
|
|
! var7.sendPacket(new Packet16BlockItemSwitch(par2EntityPlayerMP.inventory.currentItem));
|
|
this.func_96456_a((ServerScoreboard)var5.getScoreboard(), par2EntityPlayerMP);
|
|
this.updateTimeAndWeatherForPlayer(par2EntityPlayerMP, var5);
|
|
this.sendChatMsg(ChatMessageComponent.createFromTranslationWithSubstitutions("multiplayer.player.joined", new Object[] {par2EntityPlayerMP.getTranslatedEntityName()}).setColor(EnumChatFormatting.YELLOW));
|
|
this.playerLoggedIn(par2EntityPlayerMP);
|
|
var7.setPlayerLocation(par2EntityPlayerMP.posX, par2EntityPlayerMP.posY, par2EntityPlayerMP.posZ, par2EntityPlayerMP.rotationYaw, par2EntityPlayerMP.rotationPitch);
|
|
this.mcServer.getNetworkThread().addPlayer(var7);
|
|
! var7.sendPacket(new Packet4UpdateTime(var5.getTotalWorldTime(), var5.getWorldTime(), var5.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));
|
|
|
|
if (this.mcServer.getTexturePack().length() > 0)
|
|
{
|
|
par2EntityPlayerMP.requestTexturePackLoad(this.mcServer.getTexturePack(), this.mcServer.textureSize());
|
|
}
|
|
***************
|
|
*** 99,109 ****
|
|
Iterator var8 = par2EntityPlayerMP.getActivePotionEffects().iterator();
|
|
|
|
while (var8.hasNext())
|
|
{
|
|
PotionEffect var9 = (PotionEffect)var8.next();
|
|
! var7.sendPacketToPlayer(new Packet41EntityEffect(par2EntityPlayerMP.entityId, var9));
|
|
}
|
|
|
|
par2EntityPlayerMP.addSelfToInternalCraftingInventory();
|
|
|
|
if (var3 != null && var3.hasKey("Riding"))
|
|
--- 99,109 ----
|
|
Iterator var8 = par2EntityPlayerMP.getActivePotionEffects().iterator();
|
|
|
|
while (var8.hasNext())
|
|
{
|
|
PotionEffect var9 = (PotionEffect)var8.next();
|
|
! var7.sendPacket(new Packet41EntityEffect(par2EntityPlayerMP.entityId, var9));
|
|
}
|
|
|
|
par2EntityPlayerMP.addSelfToInternalCraftingInventory();
|
|
|
|
if (var3 != null && var3.hasKey("Riding"))
|
|
***************
|
|
*** 126,136 ****
|
|
Iterator var4 = par1ServerScoreboard.func_96525_g().iterator();
|
|
|
|
while (var4.hasNext())
|
|
{
|
|
ScorePlayerTeam var5 = (ScorePlayerTeam)var4.next();
|
|
! par2EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet209SetPlayerTeam(var5, 0));
|
|
}
|
|
|
|
for (int var9 = 0; var9 < 3; ++var9)
|
|
{
|
|
ScoreObjective var10 = par1ServerScoreboard.func_96539_a(var9);
|
|
--- 126,136 ----
|
|
Iterator var4 = par1ServerScoreboard.func_96525_g().iterator();
|
|
|
|
while (var4.hasNext())
|
|
{
|
|
ScorePlayerTeam var5 = (ScorePlayerTeam)var4.next();
|
|
! par2EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet209SetPlayerTeam(var5, 0));
|
|
}
|
|
|
|
for (int var9 = 0; var9 < 3; ++var9)
|
|
{
|
|
ScoreObjective var10 = par1ServerScoreboard.func_96539_a(var9);
|
|
***************
|
|
*** 141,151 ****
|
|
Iterator var7 = var6.iterator();
|
|
|
|
while (var7.hasNext())
|
|
{
|
|
Packet var8 = (Packet)var7.next();
|
|
! par2EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(var8);
|
|
}
|
|
|
|
var3.add(var10);
|
|
}
|
|
}
|
|
--- 141,151 ----
|
|
Iterator var7 = var6.iterator();
|
|
|
|
while (var7.hasNext())
|
|
{
|
|
Packet var8 = (Packet)var7.next();
|
|
! par2EntityPlayerMP.playerNetServerHandler.sendPacket(var8);
|
|
}
|
|
|
|
var3.add(var10);
|
|
}
|
|
}
|
|
***************
|
|
*** 154,164 ****
|
|
/**
|
|
* Sets the NBT manager to the one for the WorldServer given.
|
|
*/
|
|
public void setPlayerManager(WorldServer[] par1ArrayOfWorldServer)
|
|
{
|
|
! this.playerNBTManagerObj = par1ArrayOfWorldServer[0].getSaveHandler().getSaveHandler();
|
|
}
|
|
|
|
public void func_72375_a(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
|
|
{
|
|
WorldServer var3 = par1EntityPlayerMP.getServerForPlayer();
|
|
--- 154,164 ----
|
|
/**
|
|
* Sets the NBT manager to the one for the WorldServer given.
|
|
*/
|
|
public void setPlayerManager(WorldServer[] par1ArrayOfWorldServer)
|
|
{
|
|
! this.playerNBTManagerObj = par1ArrayOfWorldServer[0].getSaveHandler().getPlayerNBTManager();
|
|
}
|
|
|
|
public void func_72375_a(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
|
|
{
|
|
WorldServer var3 = par1EntityPlayerMP.getServerForPlayer();
|
|
***************
|
|
*** 219,229 ****
|
|
this.func_72375_a(par1EntityPlayerMP, (WorldServer)null);
|
|
|
|
for (int var3 = 0; var3 < this.playerEntityList.size(); ++var3)
|
|
{
|
|
EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3);
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet201PlayerInfo(var4.getCommandSenderName(), true, var4.ping));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* using player's dimension, update their movement when in a vehicle (e.g. cart, boat)
|
|
--- 219,229 ----
|
|
this.func_72375_a(par1EntityPlayerMP, (WorldServer)null);
|
|
|
|
for (int var3 = 0; var3 < this.playerEntityList.size(); ++var3)
|
|
{
|
|
EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3);
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet201PlayerInfo(var4.getCommandSenderName(), true, var4.ping));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* using player's dimension, update their movement when in a vehicle (e.g. cart, boat)
|
|
***************
|
|
*** 320,330 ****
|
|
Iterator var5 = var2.iterator();
|
|
|
|
while (var5.hasNext())
|
|
{
|
|
var4 = (EntityPlayerMP)var5.next();
|
|
! var4.playerNetServerHandler.kickPlayerFromServer("You logged in from another location");
|
|
}
|
|
|
|
Object var6;
|
|
|
|
if (this.mcServer.isDemo())
|
|
--- 320,330 ----
|
|
Iterator var5 = var2.iterator();
|
|
|
|
while (var5.hasNext())
|
|
{
|
|
var4 = (EntityPlayerMP)var5.next();
|
|
! var4.playerNetServerHandler.kickPlayer("You logged in from another location");
|
|
}
|
|
|
|
Object var6;
|
|
|
|
if (this.mcServer.isDemo())
|
|
***************
|
|
*** 338,355 ****
|
|
|
|
return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), par1Str, (ItemInWorldManager)var6);
|
|
}
|
|
|
|
/**
|
|
! * creates and returns a respawned player based on the provided PlayerEntity. Args are the PlayerEntityMP to
|
|
! * respawn, an INT for the dimension to respawn into (usually 0), and a boolean value that is true if the player
|
|
! * beat the game rather than dying
|
|
*/
|
|
! public EntityPlayerMP respawnPlayer(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3)
|
|
{
|
|
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removeEntityFromAllTrackingPlayers(par1EntityPlayerMP);
|
|
par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP);
|
|
this.playerEntityList.remove(par1EntityPlayerMP);
|
|
this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension).removePlayerEntityDangerously(par1EntityPlayerMP);
|
|
ChunkCoordinates var4 = par1EntityPlayerMP.getBedLocation();
|
|
boolean var5 = par1EntityPlayerMP.isSpawnForced();
|
|
--- 338,353 ----
|
|
|
|
return new EntityPlayerMP(this.mcServer, this.mcServer.worldServerForDimension(0), par1Str, (ItemInWorldManager)var6);
|
|
}
|
|
|
|
/**
|
|
! * Called on respawn
|
|
*/
|
|
! public EntityPlayerMP recreatePlayerEntity(EntityPlayerMP par1EntityPlayerMP, int par2, boolean par3)
|
|
{
|
|
par1EntityPlayerMP.getServerForPlayer().getEntityTracker().removePlayerFromTrackers(par1EntityPlayerMP);
|
|
! par1EntityPlayerMP.getServerForPlayer().getEntityTracker().untrackEntity(par1EntityPlayerMP);
|
|
par1EntityPlayerMP.getServerForPlayer().getPlayerManager().removePlayer(par1EntityPlayerMP);
|
|
this.playerEntityList.remove(par1EntityPlayerMP);
|
|
this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension).removePlayerEntityDangerously(par1EntityPlayerMP);
|
|
ChunkCoordinates var4 = par1EntityPlayerMP.getBedLocation();
|
|
boolean var5 = par1EntityPlayerMP.isSpawnForced();
|
|
***************
|
|
*** 382,423 ****
|
|
var7.setLocationAndAngles((double)((float)var9.posX + 0.5F), (double)((float)var9.posY + 0.1F), (double)((float)var9.posZ + 0.5F), 0.0F, 0.0F);
|
|
var7.setSpawnChunk(var4, var5);
|
|
}
|
|
else
|
|
{
|
|
! var7.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(0, 0));
|
|
}
|
|
}
|
|
|
|
var8.theChunkProviderServer.loadChunk((int)var7.posX >> 4, (int)var7.posZ >> 4);
|
|
|
|
while (!var8.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty())
|
|
{
|
|
var7.setPosition(var7.posX, var7.posY + 1.0D, var7.posZ);
|
|
}
|
|
|
|
! var7.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(var7.dimension, (byte)var7.worldObj.difficultySetting, var7.worldObj.getWorldInfo().getTerrainType(), var7.worldObj.getHeight(), var7.theItemInWorldManager.getGameType()));
|
|
var9 = var8.getSpawnPoint();
|
|
var7.playerNetServerHandler.setPlayerLocation(var7.posX, var7.posY, var7.posZ, var7.rotationYaw, var7.rotationPitch);
|
|
! var7.playerNetServerHandler.sendPacketToPlayer(new Packet6SpawnPosition(var9.posX, var9.posY, var9.posZ));
|
|
! var7.playerNetServerHandler.sendPacketToPlayer(new Packet43Experience(var7.experience, var7.experienceTotal, var7.experienceLevel));
|
|
this.updateTimeAndWeatherForPlayer(var7, var8);
|
|
var8.getPlayerManager().addPlayer(var7);
|
|
var8.spawnEntityInWorld(var7);
|
|
this.playerEntityList.add(var7);
|
|
var7.addSelfToInternalCraftingInventory();
|
|
var7.setHealth(var7.getHealth());
|
|
return var7;
|
|
}
|
|
|
|
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
|
|
{
|
|
int var3 = par1EntityPlayerMP.dimension;
|
|
WorldServer var4 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
|
par1EntityPlayerMP.dimension = par2;
|
|
WorldServer var5 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
|
|
var4.removePlayerEntityDangerously(par1EntityPlayerMP);
|
|
par1EntityPlayerMP.isDead = false;
|
|
this.transferEntityToWorld(par1EntityPlayerMP, var3, var4, var5);
|
|
this.func_72375_a(par1EntityPlayerMP, var4);
|
|
par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
|
|
--- 380,424 ----
|
|
var7.setLocationAndAngles((double)((float)var9.posX + 0.5F), (double)((float)var9.posY + 0.1F), (double)((float)var9.posZ + 0.5F), 0.0F, 0.0F);
|
|
var7.setSpawnChunk(var4, var5);
|
|
}
|
|
else
|
|
{
|
|
! var7.playerNetServerHandler.sendPacket(new Packet70GameEvent(0, 0));
|
|
}
|
|
}
|
|
|
|
var8.theChunkProviderServer.loadChunk((int)var7.posX >> 4, (int)var7.posZ >> 4);
|
|
|
|
while (!var8.getCollidingBoundingBoxes(var7, var7.boundingBox).isEmpty())
|
|
{
|
|
var7.setPosition(var7.posX, var7.posY + 1.0D, var7.posZ);
|
|
}
|
|
|
|
! var7.playerNetServerHandler.sendPacket(new Packet9Respawn(var7.dimension, (byte)var7.worldObj.difficultySetting, var7.worldObj.getWorldInfo().getTerrainType(), var7.worldObj.getHeight(), var7.theItemInWorldManager.getGameType()));
|
|
var9 = var8.getSpawnPoint();
|
|
var7.playerNetServerHandler.setPlayerLocation(var7.posX, var7.posY, var7.posZ, var7.rotationYaw, var7.rotationPitch);
|
|
! var7.playerNetServerHandler.sendPacket(new Packet6SpawnPosition(var9.posX, var9.posY, var9.posZ));
|
|
! var7.playerNetServerHandler.sendPacket(new Packet43Experience(var7.experience, var7.experienceTotal, var7.experienceLevel));
|
|
this.updateTimeAndWeatherForPlayer(var7, var8);
|
|
var8.getPlayerManager().addPlayer(var7);
|
|
var8.spawnEntityInWorld(var7);
|
|
this.playerEntityList.add(var7);
|
|
var7.addSelfToInternalCraftingInventory();
|
|
var7.setHealth(var7.getHealth());
|
|
return var7;
|
|
}
|
|
|
|
+ /**
|
|
+ * moves provided player from overworld to nether or vice versa
|
|
+ */
|
|
public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
|
|
{
|
|
int var3 = par1EntityPlayerMP.dimension;
|
|
WorldServer var4 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
|
par1EntityPlayerMP.dimension = par2;
|
|
WorldServer var5 = this.mcServer.worldServerForDimension(par1EntityPlayerMP.dimension);
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet9Respawn(par1EntityPlayerMP.dimension, (byte)par1EntityPlayerMP.worldObj.difficultySetting, var5.getWorldInfo().getTerrainType(), var5.getHeight(), par1EntityPlayerMP.theItemInWorldManager.getGameType()));
|
|
var4.removePlayerEntityDangerously(par1EntityPlayerMP);
|
|
par1EntityPlayerMP.isDead = false;
|
|
this.transferEntityToWorld(par1EntityPlayerMP, var3, var4, var5);
|
|
this.func_72375_a(par1EntityPlayerMP, var4);
|
|
par1EntityPlayerMP.playerNetServerHandler.setPlayerLocation(par1EntityPlayerMP.posX, par1EntityPlayerMP.posY, par1EntityPlayerMP.posZ, par1EntityPlayerMP.rotationYaw, par1EntityPlayerMP.rotationPitch);
|
|
***************
|
|
*** 427,437 ****
|
|
Iterator var6 = par1EntityPlayerMP.getActivePotionEffects().iterator();
|
|
|
|
while (var6.hasNext())
|
|
{
|
|
PotionEffect var7 = (PotionEffect)var6.next();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet41EntityEffect(par1EntityPlayerMP.entityId, var7));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Transfers an entity from a world to another world.
|
|
--- 428,438 ----
|
|
Iterator var6 = par1EntityPlayerMP.getActivePotionEffects().iterator();
|
|
|
|
while (var6.hasNext())
|
|
{
|
|
PotionEffect var7 = (PotionEffect)var6.next();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet41EntityEffect(par1EntityPlayerMP.entityId, var7));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Transfers an entity from a world to another world.
|
|
***************
|
|
*** 514,526 ****
|
|
|
|
par1Entity.setWorld(par4WorldServer);
|
|
}
|
|
|
|
/**
|
|
! * sends 1 player per tick, but only sends a player once every 600 ticks
|
|
*/
|
|
! public void sendPlayerInfoToAllPlayers()
|
|
{
|
|
if (++this.playerPingIndex > 600)
|
|
{
|
|
this.playerPingIndex = 0;
|
|
}
|
|
--- 515,527 ----
|
|
|
|
par1Entity.setWorld(par4WorldServer);
|
|
}
|
|
|
|
/**
|
|
! * self explanitory
|
|
*/
|
|
! public void onTick()
|
|
{
|
|
if (++this.playerPingIndex > 600)
|
|
{
|
|
this.playerPingIndex = 0;
|
|
}
|
|
***************
|
|
*** 537,547 ****
|
|
*/
|
|
public void sendPacketToAllPlayers(Packet par1Packet)
|
|
{
|
|
for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2)
|
|
{
|
|
! ((EntityPlayerMP)this.playerEntityList.get(var2)).playerNetServerHandler.sendPacketToPlayer(par1Packet);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Sends a packet to all players in the specified Dimension
|
|
--- 538,548 ----
|
|
*/
|
|
public void sendPacketToAllPlayers(Packet par1Packet)
|
|
{
|
|
for (int var2 = 0; var2 < this.playerEntityList.size(); ++var2)
|
|
{
|
|
! ((EntityPlayerMP)this.playerEntityList.get(var2)).playerNetServerHandler.sendPacket(par1Packet);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Sends a packet to all players in the specified Dimension
|
|
***************
|
|
*** 552,562 ****
|
|
{
|
|
EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3);
|
|
|
|
if (var4.dimension == par2)
|
|
{
|
|
! var4.playerNetServerHandler.sendPacketToPlayer(par1Packet);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
--- 553,563 ----
|
|
{
|
|
EntityPlayerMP var4 = (EntityPlayerMP)this.playerEntityList.get(var3);
|
|
|
|
if (var4.dimension == par2)
|
|
{
|
|
! var4.playerNetServerHandler.sendPacket(par1Packet);
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 635,645 ****
|
|
public boolean isPlayerOpped(String par1Str)
|
|
{
|
|
return this.ops.contains(par1Str.trim().toLowerCase()) || this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() && this.mcServer.getServerOwner().equalsIgnoreCase(par1Str) || this.commandsAllowedForAll;
|
|
}
|
|
|
|
! public EntityPlayerMP getPlayerForUsername(String par1Str)
|
|
{
|
|
Iterator var2 = this.playerEntityList.iterator();
|
|
EntityPlayerMP var3;
|
|
|
|
do
|
|
--- 636,649 ----
|
|
public boolean isPlayerOpped(String par1Str)
|
|
{
|
|
return this.ops.contains(par1Str.trim().toLowerCase()) || this.mcServer.isSinglePlayer() && this.mcServer.worldServers[0].getWorldInfo().areCommandsAllowed() && this.mcServer.getServerOwner().equalsIgnoreCase(par1Str) || this.commandsAllowedForAll;
|
|
}
|
|
|
|
! /**
|
|
! * gets the player entity for the player with the name specified
|
|
! */
|
|
! public EntityPlayerMP getPlayerEntity(String par1Str)
|
|
{
|
|
Iterator var2 = this.playerEntityList.iterator();
|
|
EntityPlayerMP var3;
|
|
|
|
do
|
|
***************
|
|
*** 702,712 ****
|
|
}
|
|
}
|
|
|
|
if (par1ChunkCoordinates != null && (par2 > 0 || par3 > 0))
|
|
{
|
|
! float var22 = par1ChunkCoordinates.getDistanceSquaredToChunkCoordinates(var19.getPlayerCoordinates());
|
|
|
|
if (par2 > 0 && var22 < (float)var16 || par3 > 0 && var22 > (float)var17)
|
|
{
|
|
continue;
|
|
}
|
|
--- 706,716 ----
|
|
}
|
|
}
|
|
|
|
if (par1ChunkCoordinates != null && (par2 > 0 || par3 > 0))
|
|
{
|
|
! float var22 = par1ChunkCoordinates.getDistanceSquaredToChunkCoordinates(var19.getCommandSenderPosition());
|
|
|
|
if (par2 > 0 && var22 < (float)var16 || par3 > 0 && var22 > (float)var17)
|
|
{
|
|
continue;
|
|
}
|
|
***************
|
|
*** 789,801 ****
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * params: x,y,z,d,dimension. The packet is sent to all players within d distance of x,y,z (d^2<x^2+y^2+z^2)
|
|
*/
|
|
! public void sendToAllNear(double par1, double par3, double par5, double par7, int par9, Packet par10Packet)
|
|
{
|
|
this.sendToAllNearExcept((EntityPlayer)null, par1, par3, par5, par7, par9, par10Packet);
|
|
}
|
|
|
|
/**
|
|
--- 793,805 ----
|
|
return true;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * sends a packet to players within d3 of point (x,y,z)
|
|
*/
|
|
! public void sendPacketToPlayersAroundPoint(double par1, double par3, double par5, double par7, int par9, Packet par10Packet)
|
|
{
|
|
this.sendToAllNearExcept((EntityPlayer)null, par1, par3, par5, par7, par9, par10Packet);
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 814,824 ****
|
|
double var16 = par4 - var13.posY;
|
|
double var18 = par6 - var13.posZ;
|
|
|
|
if (var14 * var14 + var16 * var16 + var18 * var18 < par8 * par8)
|
|
{
|
|
! var13.playerNetServerHandler.sendPacketToPlayer(par11Packet);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
--- 818,828 ----
|
|
double var16 = par4 - var13.posY;
|
|
double var18 = par6 - var13.posZ;
|
|
|
|
if (var14 * var14 + var16 * var16 + var18 * var18 < par8 * par8)
|
|
{
|
|
! var13.playerNetServerHandler.sendPacket(par11Packet);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
***************
|
|
*** 870,895 ****
|
|
/**
|
|
* Updates the time and weather for the given player to those of the given world
|
|
*/
|
|
public void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet4UpdateTime(par2WorldServer.getTotalWorldTime(), par2WorldServer.getWorldTime(), par2WorldServer.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));
|
|
|
|
if (par2WorldServer.isRaining())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet70GameEvent(1, 0));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* sends the players inventory to himself
|
|
*/
|
|
public void syncPlayerInventory(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
par1EntityPlayerMP.sendContainerToPlayer(par1EntityPlayerMP.inventoryContainer);
|
|
par1EntityPlayerMP.setPlayerHealthUpdated();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacketToPlayer(new Packet16BlockItemSwitch(par1EntityPlayerMP.inventory.currentItem));
|
|
}
|
|
|
|
/**
|
|
* Returns the number of players currently on the server.
|
|
*/
|
|
--- 874,899 ----
|
|
/**
|
|
* Updates the time and weather for the given player to those of the given world
|
|
*/
|
|
public void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet4UpdateTime(par2WorldServer.getTotalWorldTime(), par2WorldServer.getWorldTime(), par2WorldServer.getGameRules().getGameRuleBooleanValue("doDaylightCycle")));
|
|
|
|
if (par2WorldServer.isRaining())
|
|
{
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet70GameEvent(1, 0));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* sends the players inventory to himself
|
|
*/
|
|
public void syncPlayerInventory(EntityPlayerMP par1EntityPlayerMP)
|
|
{
|
|
par1EntityPlayerMP.sendContainerToPlayer(par1EntityPlayerMP.inventoryContainer);
|
|
par1EntityPlayerMP.setPlayerHealthUpdated();
|
|
! par1EntityPlayerMP.playerNetServerHandler.sendPacket(new Packet16BlockItemSwitch(par1EntityPlayerMP.inventory.currentItem));
|
|
}
|
|
|
|
/**
|
|
* Returns the number of players currently on the server.
|
|
*/
|
|
***************
|
|
*** 909,919 ****
|
|
/**
|
|
* Returns an array of usernames for which player.dat exists for.
|
|
*/
|
|
public String[] getAvailablePlayerDat()
|
|
{
|
|
! return this.mcServer.worldServers[0].getSaveHandler().getSaveHandler().getAvailablePlayerDat();
|
|
}
|
|
|
|
public boolean isWhiteListEnabled()
|
|
{
|
|
return this.whiteListEnforced;
|
|
--- 913,923 ----
|
|
/**
|
|
* Returns an array of usernames for which player.dat exists for.
|
|
*/
|
|
public String[] getAvailablePlayerDat()
|
|
{
|
|
! return this.mcServer.worldServers[0].getSaveHandler().getPlayerNBTManager().getAvailablePlayerDat();
|
|
}
|
|
|
|
public boolean isWhiteListEnabled()
|
|
{
|
|
return this.whiteListEnforced;
|
|
***************
|
|
*** 961,975 ****
|
|
public NBTTagCompound getHostPlayerData()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
- public void setGameType(EnumGameType par1EnumGameType)
|
|
- {
|
|
- this.gameType = par1EnumGameType;
|
|
- }
|
|
-
|
|
private void func_72381_a(EntityPlayerMP par1EntityPlayerMP, EntityPlayerMP par2EntityPlayerMP, World par3World)
|
|
{
|
|
if (par2EntityPlayerMP != null)
|
|
{
|
|
par1EntityPlayerMP.theItemInWorldManager.setGameType(par2EntityPlayerMP.theItemInWorldManager.getGameType());
|
|
--- 965,974 ----
|
|
***************
|
|
*** 981,1005 ****
|
|
|
|
par1EntityPlayerMP.theItemInWorldManager.initializeGameType(par3World.getWorldInfo().getGameType());
|
|
}
|
|
|
|
/**
|
|
- * Sets whether all players are allowed to use commands (cheats) on the server.
|
|
- */
|
|
- public void setCommandsAllowedForAll(boolean par1)
|
|
- {
|
|
- this.commandsAllowedForAll = par1;
|
|
- }
|
|
-
|
|
- /**
|
|
* Kicks everyone with "Server closed" as reason.
|
|
*/
|
|
public void removeAllPlayers()
|
|
{
|
|
while (!this.playerEntityList.isEmpty())
|
|
{
|
|
! ((EntityPlayerMP)this.playerEntityList.get(0)).playerNetServerHandler.kickPlayerFromServer("Server closed");
|
|
}
|
|
}
|
|
|
|
public void func_110459_a(ChatMessageComponent par1ChatMessageComponent, boolean par2)
|
|
{
|
|
--- 980,996 ----
|
|
|
|
par1EntityPlayerMP.theItemInWorldManager.initializeGameType(par3World.getWorldInfo().getGameType());
|
|
}
|
|
|
|
/**
|
|
* Kicks everyone with "Server closed" as reason.
|
|
*/
|
|
public void removeAllPlayers()
|
|
{
|
|
while (!this.playerEntityList.isEmpty())
|
|
{
|
|
! ((EntityPlayerMP)this.playerEntityList.get(0)).playerNetServerHandler.kickPlayer("Server closed");
|
|
}
|
|
}
|
|
|
|
public void func_110459_a(ChatMessageComponent par1ChatMessageComponent, boolean par2)
|
|
{
|
|
*** ServerListenThread.java Sat Feb 5 04:19:44 2022
|
|
--- ServerListenThread.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 47,61 ****
|
|
{
|
|
var3.tryLogin();
|
|
}
|
|
catch (Exception var6)
|
|
{
|
|
! var3.raiseErrorAndDisconnect("Internal server error");
|
|
this.myNetworkListenThread.getServer().getLogAgent().logWarningException("Failed to handle packet for " + var3.getUsernameAndAddress() + ": " + var6, var6);
|
|
}
|
|
|
|
! if (var3.connectionComplete)
|
|
{
|
|
this.pendingConnections.remove(var2--);
|
|
}
|
|
|
|
var3.myTCPConnection.wakeThreads();
|
|
--- 47,61 ----
|
|
{
|
|
var3.tryLogin();
|
|
}
|
|
catch (Exception var6)
|
|
{
|
|
! var3.kickUser("Internal server error");
|
|
this.myNetworkListenThread.getServer().getLogAgent().logWarningException("Failed to handle packet for " + var3.getUsernameAndAddress() + ": " + var6, var6);
|
|
}
|
|
|
|
! if (var3.finishedProcessing)
|
|
{
|
|
this.pendingConnections.remove(var2--);
|
|
}
|
|
|
|
var3.myTCPConnection.wakeThreads();
|
|
***************
|
|
*** 120,131 ****
|
|
}
|
|
catch (Throwable var2)
|
|
{
|
|
;
|
|
}
|
|
- }
|
|
-
|
|
- public int getMyPort()
|
|
- {
|
|
- return this.myPort;
|
|
}
|
|
}
|
|
--- 120,126 ----
|
|
*** ServerScoreboard.java Sat Feb 5 04:19:44 2022
|
|
--- ServerScoreboard.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 68,80 ****
|
|
}
|
|
|
|
this.func_96551_b();
|
|
}
|
|
|
|
! public void func_96521_a(String par1Str, ScorePlayerTeam par2ScorePlayerTeam)
|
|
{
|
|
! super.func_96521_a(par1Str, par2ScorePlayerTeam);
|
|
this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(par2ScorePlayerTeam, Arrays.asList(new String[] {par1Str}), 3));
|
|
this.func_96551_b();
|
|
}
|
|
|
|
/**
|
|
--- 68,80 ----
|
|
}
|
|
|
|
this.func_96551_b();
|
|
}
|
|
|
|
! public void addPlayerToTeam(String par1Str, ScorePlayerTeam par2ScorePlayerTeam)
|
|
{
|
|
! super.addPlayerToTeam(par1Str, par2ScorePlayerTeam);
|
|
this.field_96555_a.getConfigurationManager().sendPacketToAllPlayers(new Packet209SetPlayerTeam(par2ScorePlayerTeam, Arrays.asList(new String[] {par1Str}), 3));
|
|
this.func_96551_b();
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 187,197 ****
|
|
Iterator var5 = var2.iterator();
|
|
|
|
while (var5.hasNext())
|
|
{
|
|
Packet var6 = (Packet)var5.next();
|
|
! var4.playerNetServerHandler.sendPacketToPlayer(var6);
|
|
}
|
|
}
|
|
|
|
this.field_96553_b.add(par1ScoreObjective);
|
|
}
|
|
--- 187,197 ----
|
|
Iterator var5 = var2.iterator();
|
|
|
|
while (var5.hasNext())
|
|
{
|
|
Packet var6 = (Packet)var5.next();
|
|
! var4.playerNetServerHandler.sendPacket(var6);
|
|
}
|
|
}
|
|
|
|
this.field_96553_b.add(par1ScoreObjective);
|
|
}
|
|
***************
|
|
*** 223,233 ****
|
|
Iterator var5 = var2.iterator();
|
|
|
|
while (var5.hasNext())
|
|
{
|
|
Packet var6 = (Packet)var5.next();
|
|
! var4.playerNetServerHandler.sendPacketToPlayer(var6);
|
|
}
|
|
}
|
|
|
|
this.field_96553_b.remove(par1ScoreObjective);
|
|
}
|
|
--- 223,233 ----
|
|
Iterator var5 = var2.iterator();
|
|
|
|
while (var5.hasNext())
|
|
{
|
|
Packet var6 = (Packet)var5.next();
|
|
! var4.playerNetServerHandler.sendPacket(var6);
|
|
}
|
|
}
|
|
|
|
this.field_96553_b.remove(par1ScoreObjective);
|
|
}
|
|
*** Slot.java Sat Feb 5 04:19:44 2022
|
|
--- Slot.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 109,150 ****
|
|
{
|
|
return this.inventory.getInventoryStackLimit();
|
|
}
|
|
|
|
/**
|
|
- * Returns the icon index on items.png that is used as background image of the slot.
|
|
- */
|
|
- public Icon getBackgroundIconIndex()
|
|
- {
|
|
- return null;
|
|
- }
|
|
-
|
|
- /**
|
|
* Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new
|
|
* stack.
|
|
*/
|
|
public ItemStack decrStackSize(int par1)
|
|
{
|
|
return this.inventory.decrStackSize(this.slotIndex, par1);
|
|
}
|
|
|
|
/**
|
|
! * returns true if this slot is in par2 of par1
|
|
*/
|
|
! public boolean isSlotInInventory(IInventory par1IInventory, int par2)
|
|
{
|
|
return par1IInventory == this.inventory && par2 == this.slotIndex;
|
|
}
|
|
|
|
/**
|
|
* Return whether this slot's stack can be taken from this slot.
|
|
*/
|
|
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- public boolean func_111238_b()
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
--- 109,137 ----
|
|
{
|
|
return this.inventory.getInventoryStackLimit();
|
|
}
|
|
|
|
/**
|
|
* Decrease the size of the stack in slot (first int arg) by the amount of the second int arg. Returns the new
|
|
* stack.
|
|
*/
|
|
public ItemStack decrStackSize(int par1)
|
|
{
|
|
return this.inventory.decrStackSize(this.slotIndex, par1);
|
|
}
|
|
|
|
/**
|
|
! * returns true if the slot exists in the given inventory and location
|
|
*/
|
|
! public boolean isHere(IInventory par1IInventory, int par2)
|
|
{
|
|
return par1IInventory == this.inventory && par2 == this.slotIndex;
|
|
}
|
|
|
|
/**
|
|
* Return whether this slot's stack can be taken from this slot.
|
|
*/
|
|
public boolean canTakeStack(EntityPlayer par1EntityPlayer)
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
*** SlotArmor.java Sat Feb 5 04:19:44 2022
|
|
--- SlotArmor.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 33,46 ****
|
|
*/
|
|
public boolean isItemValid(ItemStack par1ItemStack)
|
|
{
|
|
return par1ItemStack == null ? false : (par1ItemStack.getItem() instanceof ItemArmor ? ((ItemArmor)par1ItemStack.getItem()).armorType == this.armorType : (par1ItemStack.getItem().itemID != Block.pumpkin.blockID && par1ItemStack.getItem().itemID != Item.skull.itemID ? false : this.armorType == 0));
|
|
}
|
|
-
|
|
- /**
|
|
- * Returns the icon index on items.png that is used as background image of the slot.
|
|
- */
|
|
- public Icon getBackgroundIconIndex()
|
|
- {
|
|
- return ItemArmor.func_94602_b(this.armorType);
|
|
- }
|
|
}
|
|
--- 33,38 ----
|
|
*** StatBase.java Sat Feb 5 04:19:44 2022
|
|
--- StatBase.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 1,9 ****
|
|
--- 1,10 ----
|
|
package net.minecraft.src;
|
|
|
|
import java.text.DecimalFormat;
|
|
import java.text.NumberFormat;
|
|
+ import java.util.Locale;
|
|
|
|
public class StatBase
|
|
{
|
|
/** The Stat ID */
|
|
public final int statId;
|
|
***************
|
|
*** 13,23 ****
|
|
public boolean isIndependent;
|
|
|
|
/** Holds the GUID of the stat. */
|
|
public String statGuid;
|
|
private final IStatType type;
|
|
! private static NumberFormat numberFormat = NumberFormat.getIntegerInstance(java.util.Locale.US);
|
|
public static IStatType simpleStatType = new StatTypeSimple();
|
|
private static DecimalFormat decimalFormat = new DecimalFormat("########0.00");
|
|
public static IStatType timeStatType = new StatTypeTime();
|
|
public static IStatType distanceStatType = new StatTypeDistance();
|
|
public static IStatType field_111202_k = new StatTypeFloat();
|
|
--- 14,24 ----
|
|
public boolean isIndependent;
|
|
|
|
/** Holds the GUID of the stat. */
|
|
public String statGuid;
|
|
private final IStatType type;
|
|
! private static NumberFormat numberFormat = NumberFormat.getIntegerInstance(Locale.US);
|
|
public static IStatType simpleStatType = new StatTypeSimple();
|
|
private static DecimalFormat decimalFormat = new DecimalFormat("########0.00");
|
|
public static IStatType timeStatType = new StatTypeTime();
|
|
public static IStatType distanceStatType = new StatTypeDistance();
|
|
public static IStatType field_111202_k = new StatTypeFloat();
|
|
***************
|
|
*** 60,97 ****
|
|
this.statGuid = AchievementMap.getGuid(this.statId);
|
|
return this;
|
|
}
|
|
}
|
|
|
|
- /**
|
|
- * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot).
|
|
- */
|
|
- public boolean isAchievement()
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
- public String func_75968_a(int par1)
|
|
- {
|
|
- return this.type.format(par1);
|
|
- }
|
|
-
|
|
- public String getName()
|
|
- {
|
|
- return this.statName;
|
|
- }
|
|
-
|
|
public String toString()
|
|
{
|
|
return StatCollector.translateToLocal(this.statName);
|
|
- }
|
|
-
|
|
- static NumberFormat getNumberFormat()
|
|
- {
|
|
- return numberFormat;
|
|
- }
|
|
-
|
|
- static DecimalFormat getDecimalFormat()
|
|
- {
|
|
- return decimalFormat;
|
|
}
|
|
}
|
|
--- 61,70 ----
|
|
*** StatCollector.java Sat Feb 5 04:19:44 2022
|
|
--- StatCollector.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 20,27 ****
|
|
return localizedName.translateKeyFormat(par0Str, par1ArrayOfObj);
|
|
}
|
|
|
|
public static boolean func_94522_b(String par0Str)
|
|
{
|
|
! return localizedName.containsTranslateKey(par0Str);
|
|
}
|
|
}
|
|
--- 20,27 ----
|
|
return localizedName.translateKeyFormat(par0Str, par1ArrayOfObj);
|
|
}
|
|
|
|
public static boolean func_94522_b(String par0Str)
|
|
{
|
|
! return localizedName.isKeyTranslated(par0Str);
|
|
}
|
|
}
|
|
*** StatCrafting.java Sat Feb 5 04:19:44 2022
|
|
--- StatCrafting.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 7,17 ****
|
|
public StatCrafting(int par1, String par2Str, int par3)
|
|
{
|
|
super(par1, par2Str);
|
|
this.itemID = par3;
|
|
}
|
|
-
|
|
- public int getItemID()
|
|
- {
|
|
- return this.itemID;
|
|
- }
|
|
}
|
|
--- 7,12 ----
|
|
*** StatList.java Sat Feb 5 04:19:45 2022
|
|
--- StatList.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 272,286 ****
|
|
generalStats.remove(par0ArrayOfStatBase[par1]);
|
|
par0ArrayOfStatBase[par1] = par0ArrayOfStatBase[par2];
|
|
}
|
|
}
|
|
|
|
- public static StatBase getOneShotStat(int par0)
|
|
- {
|
|
- return (StatBase)oneShotStats.get(Integer.valueOf(par0));
|
|
- }
|
|
-
|
|
static
|
|
{
|
|
AchievementList.init();
|
|
}
|
|
}
|
|
--- 272,281 ----
|
|
*** StatTypeDistance.java Sat Feb 5 04:19:45 2022
|
|
--- StatTypeDistance.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 1,14 ****
|
|
package net.minecraft.src;
|
|
|
|
final class StatTypeDistance implements IStatType
|
|
{
|
|
- /**
|
|
- * Formats a given stat for human consumption.
|
|
- */
|
|
- public String format(int par1)
|
|
- {
|
|
- double var2 = (double)par1 / 100.0D;
|
|
- double var4 = var2 / 1000.0D;
|
|
- return var4 > 0.5D ? StatBase.getDecimalFormat().format(var4) + " km" : (var2 > 0.5D ? StatBase.getDecimalFormat().format(var2) + " m" : par1 + " cm");
|
|
- }
|
|
}
|
|
--- 1,5 ----
|
|
*** StatTypeFloat.java Sat Feb 5 04:19:45 2022
|
|
--- StatTypeFloat.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 1,12 ****
|
|
package net.minecraft.src;
|
|
|
|
final class StatTypeFloat implements IStatType
|
|
{
|
|
- /**
|
|
- * Formats a given stat for human consumption.
|
|
- */
|
|
- public String format(int par1)
|
|
- {
|
|
- return StatBase.getDecimalFormat().format((double)par1 * 0.1D);
|
|
- }
|
|
}
|
|
--- 1,5 ----
|
|
*** StatTypeSimple.java Sat Feb 5 04:19:45 2022
|
|
--- StatTypeSimple.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 1,12 ****
|
|
package net.minecraft.src;
|
|
|
|
final class StatTypeSimple implements IStatType
|
|
{
|
|
- /**
|
|
- * Formats a given stat for human consumption.
|
|
- */
|
|
- public String format(int par1)
|
|
- {
|
|
- return StatBase.getNumberFormat().format((long)par1);
|
|
- }
|
|
}
|
|
--- 1,5 ----
|
|
*** StatTypeTime.java Sat Feb 5 04:19:45 2022
|
|
--- StatTypeTime.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 1,17 ****
|
|
package net.minecraft.src;
|
|
|
|
final class StatTypeTime implements IStatType
|
|
{
|
|
- /**
|
|
- * Formats a given stat for human consumption.
|
|
- */
|
|
- public String format(int par1)
|
|
- {
|
|
- double var2 = (double)par1 / 20.0D;
|
|
- double var4 = var2 / 60.0D;
|
|
- double var6 = var4 / 60.0D;
|
|
- double var8 = var6 / 24.0D;
|
|
- double var10 = var8 / 365.0D;
|
|
- return var10 > 0.5D ? StatBase.getDecimalFormat().format(var10) + " y" : (var8 > 0.5D ? StatBase.getDecimalFormat().format(var8) + " d" : (var6 > 0.5D ? StatBase.getDecimalFormat().format(var6) + " h" : (var4 > 0.5D ? StatBase.getDecimalFormat().format(var4) + " m" : var2 + " s")));
|
|
- }
|
|
}
|
|
--- 1,5 ----
|
|
*** StringTranslate.java Sat Feb 5 04:19:45 2022
|
|
--- StringTranslate.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 57,72 ****
|
|
static StringTranslate getInstance()
|
|
{
|
|
return instance;
|
|
}
|
|
|
|
- public static synchronized void func_135063_a(Map par0Map)
|
|
- {
|
|
- instance.languageList.clear();
|
|
- instance.languageList.putAll(par0Map);
|
|
- }
|
|
-
|
|
/**
|
|
* Translate a key to current language.
|
|
*/
|
|
public synchronized String translateKey(String par1Str)
|
|
{
|
|
--- 57,66 ----
|
|
***************
|
|
*** 94,103 ****
|
|
{
|
|
String var2 = (String)this.languageList.get(par1Str);
|
|
return var2 == null ? par1Str : var2;
|
|
}
|
|
|
|
! public synchronized boolean containsTranslateKey(String par1Str)
|
|
{
|
|
return this.languageList.containsKey(par1Str);
|
|
}
|
|
}
|
|
--- 88,100 ----
|
|
{
|
|
String var2 = (String)this.languageList.get(par1Str);
|
|
return var2 == null ? par1Str : var2;
|
|
}
|
|
|
|
! /**
|
|
! * Returns true if the passed key is in the translation table.
|
|
! */
|
|
! public synchronized boolean isKeyTranslated(String par1Str)
|
|
{
|
|
return this.languageList.containsKey(par1Str);
|
|
}
|
|
}
|
|
*** StringUtils.java Sat Feb 5 04:19:45 2022
|
|
--- StringUtils.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 4,24 ****
|
|
|
|
public class StringUtils
|
|
{
|
|
private static final Pattern patternControlCode = Pattern.compile("(?i)\\u00A7[0-9A-FK-OR]");
|
|
|
|
- /**
|
|
- * Returns the time elapsed for the given number of ticks, in "mm:ss" format.
|
|
- */
|
|
- public static String ticksToElapsedTime(int par0)
|
|
- {
|
|
- int var1 = par0 / 20;
|
|
- int var2 = var1 / 60;
|
|
- var1 %= 60;
|
|
- return var1 < 10 ? var2 + ":0" + var1 : var2 + ":" + var1;
|
|
- }
|
|
-
|
|
public static String stripControlCodes(String par0Str)
|
|
{
|
|
return patternControlCode.matcher(par0Str).replaceAll("");
|
|
}
|
|
}
|
|
--- 4,13 ----
|
|
*** StructureBoundingBox.java Sat Feb 5 04:19:45 2022
|
|
--- StructureBoundingBox.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 96,106 ****
|
|
this.minY = 1;
|
|
this.maxY = 512;
|
|
}
|
|
|
|
/**
|
|
! * Returns whether the given bounding box intersects with this one. Args: structureboundingbox
|
|
*/
|
|
public boolean intersectsWith(StructureBoundingBox par1StructureBoundingBox)
|
|
{
|
|
return this.maxX >= par1StructureBoundingBox.minX && this.minX <= par1StructureBoundingBox.maxX && this.maxZ >= par1StructureBoundingBox.minZ && this.minZ <= par1StructureBoundingBox.maxZ && this.maxY >= par1StructureBoundingBox.minY && this.minY <= par1StructureBoundingBox.maxY;
|
|
}
|
|
--- 96,106 ----
|
|
this.minY = 1;
|
|
this.maxY = 512;
|
|
}
|
|
|
|
/**
|
|
! * Discover if bounding box can fit within the current bounding box object.
|
|
*/
|
|
public boolean intersectsWith(StructureBoundingBox par1StructureBoundingBox)
|
|
{
|
|
return this.maxX >= par1StructureBoundingBox.minX && this.minX <= par1StructureBoundingBox.maxX && this.maxZ >= par1StructureBoundingBox.minZ && this.minZ <= par1StructureBoundingBox.maxZ && this.maxY >= par1StructureBoundingBox.minY && this.minY <= par1StructureBoundingBox.maxY;
|
|
}
|
|
***************
|
|
*** 138,172 ****
|
|
this.maxY += par2;
|
|
this.maxZ += par3;
|
|
}
|
|
|
|
/**
|
|
! * Returns true if block is inside bounding box
|
|
*/
|
|
public boolean isVecInside(int par1, int par2, int par3)
|
|
{
|
|
return par1 >= this.minX && par1 <= this.maxX && par3 >= this.minZ && par3 <= this.maxZ && par2 >= this.minY && par2 <= this.maxY;
|
|
}
|
|
|
|
/**
|
|
! * Returns width of a bounding box
|
|
*/
|
|
public int getXSize()
|
|
{
|
|
return this.maxX - this.minX + 1;
|
|
}
|
|
|
|
/**
|
|
! * Returns height of a bounding box
|
|
*/
|
|
public int getYSize()
|
|
{
|
|
return this.maxY - this.minY + 1;
|
|
}
|
|
|
|
/**
|
|
! * Returns length of a bounding box
|
|
*/
|
|
public int getZSize()
|
|
{
|
|
return this.maxZ - this.minZ + 1;
|
|
}
|
|
--- 138,172 ----
|
|
this.maxY += par2;
|
|
this.maxZ += par3;
|
|
}
|
|
|
|
/**
|
|
! * Discover if a coordinate is inside the bounding box volume.
|
|
*/
|
|
public boolean isVecInside(int par1, int par2, int par3)
|
|
{
|
|
return par1 >= this.minX && par1 <= this.maxX && par3 >= this.minZ && par3 <= this.maxZ && par2 >= this.minY && par2 <= this.maxY;
|
|
}
|
|
|
|
/**
|
|
! * Get dimension of the bounding box in the x direction.
|
|
*/
|
|
public int getXSize()
|
|
{
|
|
return this.maxX - this.minX + 1;
|
|
}
|
|
|
|
/**
|
|
! * Get dimension of the bounding box in the y direction.
|
|
*/
|
|
public int getYSize()
|
|
{
|
|
return this.maxY - this.minY + 1;
|
|
}
|
|
|
|
/**
|
|
! * Get dimension of the bounding box in the z direction.
|
|
*/
|
|
public int getZSize()
|
|
{
|
|
return this.maxZ - this.minZ + 1;
|
|
}
|
|
*** TcpConnection.java Sat Feb 5 04:19:45 2022
|
|
--- TcpConnection.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 23,33 ****
|
|
{
|
|
public static AtomicInteger field_74471_a = new AtomicInteger();
|
|
public static AtomicInteger field_74469_b = new AtomicInteger();
|
|
|
|
/** The object used for synchronization on the send queue. */
|
|
! private final Object sendQueueLock;
|
|
|
|
/** Log agent for TCP connection */
|
|
private final ILogAgent tcpConLogAgent;
|
|
|
|
/** The socket used by this network manager. */
|
|
--- 23,33 ----
|
|
{
|
|
public static AtomicInteger field_74471_a = new AtomicInteger();
|
|
public static AtomicInteger field_74469_b = new AtomicInteger();
|
|
|
|
/** The object used for synchronization on the send queue. */
|
|
! private final Object sendQueueLock = new Object();
|
|
|
|
/** Log agent for TCP connection */
|
|
private final ILogAgent tcpConLogAgent;
|
|
|
|
/** The socket used by this network manager. */
|
|
***************
|
|
*** 41,67 ****
|
|
|
|
/** The output stream connected to the socket. */
|
|
private volatile DataOutputStream socketOutputStream;
|
|
|
|
/** Whether the network is currently operational. */
|
|
! private volatile boolean isRunning;
|
|
|
|
/**
|
|
* Whether this network manager is currently terminating (and should ignore further errors).
|
|
*/
|
|
private volatile boolean isTerminating;
|
|
|
|
/**
|
|
* Linked list of packets that have been read and are awaiting processing.
|
|
*/
|
|
! private Queue readPackets;
|
|
|
|
/** Linked list of packets awaiting sending. */
|
|
! private List dataPackets;
|
|
|
|
/** Linked list of packets with chunk data that are awaiting sending. */
|
|
! private List chunkDataPackets;
|
|
|
|
/** A reference to the NetHandler object. */
|
|
private NetHandler theNetHandler;
|
|
|
|
/**
|
|
--- 41,67 ----
|
|
|
|
/** The output stream connected to the socket. */
|
|
private volatile DataOutputStream socketOutputStream;
|
|
|
|
/** Whether the network is currently operational. */
|
|
! private volatile boolean isRunning = true;
|
|
|
|
/**
|
|
* Whether this network manager is currently terminating (and should ignore further errors).
|
|
*/
|
|
private volatile boolean isTerminating;
|
|
|
|
/**
|
|
* Linked list of packets that have been read and are awaiting processing.
|
|
*/
|
|
! private Queue readPackets = new ConcurrentLinkedQueue();
|
|
|
|
/** Linked list of packets awaiting sending. */
|
|
! private List dataPackets = Collections.synchronizedList(new ArrayList());
|
|
|
|
/** Linked list of packets with chunk data that are awaiting sending. */
|
|
! private List chunkDataPackets = Collections.synchronizedList(new ArrayList());
|
|
|
|
/** A reference to the NetHandler object. */
|
|
private NetHandler theNetHandler;
|
|
|
|
/**
|
|
***************
|
|
*** 74,84 ****
|
|
|
|
/** The thread used for reading. */
|
|
private Thread readThread;
|
|
|
|
/** A String indicating why the network has shutdown. */
|
|
! private String terminationReason;
|
|
|
|
/** Contains shutdown description (internal error, etc.) as string array */
|
|
private Object[] shutdownDescription;
|
|
private int field_74490_x;
|
|
|
|
--- 74,84 ----
|
|
|
|
/** The thread used for reading. */
|
|
private Thread readThread;
|
|
|
|
/** A String indicating why the network has shutdown. */
|
|
! private String terminationReason = "";
|
|
|
|
/** Contains shutdown description (internal error, etc.) as string array */
|
|
private Object[] shutdownDescription;
|
|
private int field_74490_x;
|
|
|
|
***************
|
|
*** 95,120 ****
|
|
private PrivateKey field_74463_A;
|
|
|
|
/**
|
|
* Delay for sending pending chunk data packets (as opposed to pending non-chunk data packets)
|
|
*/
|
|
! private int chunkDataPacketsDelay;
|
|
!
|
|
! public TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler) throws IOException
|
|
! {
|
|
! this(par1ILogAgent, par2Socket, par3Str, par4NetHandler, (PrivateKey)null);
|
|
! }
|
|
|
|
public TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler, PrivateKey par5PrivateKey) throws IOException
|
|
{
|
|
- this.sendQueueLock = new Object();
|
|
- this.isRunning = true;
|
|
- this.readPackets = new ConcurrentLinkedQueue();
|
|
- this.dataPackets = Collections.synchronizedList(new ArrayList());
|
|
- this.chunkDataPackets = Collections.synchronizedList(new ArrayList());
|
|
- this.terminationReason = "";
|
|
- this.chunkDataPacketsDelay = 50;
|
|
this.field_74463_A = par5PrivateKey;
|
|
this.networkSocket = par2Socket;
|
|
this.tcpConLogAgent = par1ILogAgent;
|
|
this.remoteSocketAddress = par2Socket.getRemoteSocketAddress();
|
|
this.theNetHandler = par4NetHandler;
|
|
--- 95,108 ----
|
|
private PrivateKey field_74463_A;
|
|
|
|
/**
|
|
* Delay for sending pending chunk data packets (as opposed to pending non-chunk data packets)
|
|
*/
|
|
! private int chunkDataPacketsDelay = 50;
|
|
|
|
public TcpConnection(ILogAgent par1ILogAgent, Socket par2Socket, String par3Str, NetHandler par4NetHandler, PrivateKey par5PrivateKey) throws IOException
|
|
{
|
|
this.field_74463_A = par5PrivateKey;
|
|
this.networkSocket = par2Socket;
|
|
this.tcpConLogAgent = par1ILogAgent;
|
|
this.remoteSocketAddress = par2Socket.getRemoteSocketAddress();
|
|
this.theNetHandler = par4NetHandler;
|
|
***************
|
|
*** 135,151 ****
|
|
this.writeThread = new TcpWriterThread(this, par3Str + " write thread");
|
|
this.readThread.start();
|
|
this.writeThread.start();
|
|
}
|
|
|
|
- public void closeConnections()
|
|
- {
|
|
- this.wakeThreads();
|
|
- this.writeThread = null;
|
|
- this.readThread = null;
|
|
- }
|
|
-
|
|
/**
|
|
* Sets the NetHandler for this NetworkManager. Server-only.
|
|
*/
|
|
public void setNetHandler(NetHandler par1NetHandler)
|
|
{
|
|
--- 123,132 ----
|
|
***************
|
|
*** 181,191 ****
|
|
{
|
|
int[] var10000;
|
|
int var10001;
|
|
Packet var2;
|
|
|
|
! if (this.field_74468_e == 0 || !this.dataPackets.isEmpty() && MinecraftServer.getSystemTimeMillis() - ((Packet)this.dataPackets.get(0)).creationTimeMillis >= (long)this.field_74468_e)
|
|
{
|
|
var2 = this.func_74460_a(false);
|
|
|
|
if (var2 != null)
|
|
{
|
|
--- 162,172 ----
|
|
{
|
|
int[] var10000;
|
|
int var10001;
|
|
Packet var2;
|
|
|
|
! if (this.field_74468_e == 0 || !this.dataPackets.isEmpty() && MinecraftServer.getCurrentTimeMillis() - ((Packet)this.dataPackets.get(0)).creationTimeMillis >= (long)this.field_74468_e)
|
|
{
|
|
var2 = this.func_74460_a(false);
|
|
|
|
if (var2 != null)
|
|
{
|
|
***************
|
|
*** 206,216 ****
|
|
var10000[var10001] += var2.getPacketSize() + 1;
|
|
var1 = true;
|
|
}
|
|
}
|
|
|
|
! if (this.chunkDataPacketsDelay-- <= 0 && (this.field_74468_e == 0 || !this.chunkDataPackets.isEmpty() && MinecraftServer.getSystemTimeMillis() - ((Packet)this.chunkDataPackets.get(0)).creationTimeMillis >= (long)this.field_74468_e))
|
|
{
|
|
var2 = this.func_74460_a(true);
|
|
|
|
if (var2 != null)
|
|
{
|
|
--- 187,197 ----
|
|
var10000[var10001] += var2.getPacketSize() + 1;
|
|
var1 = true;
|
|
}
|
|
}
|
|
|
|
! if (this.chunkDataPacketsDelay-- <= 0 && (this.field_74468_e == 0 || !this.chunkDataPackets.isEmpty() && MinecraftServer.getCurrentTimeMillis() - ((Packet)this.chunkDataPackets.get(0)).creationTimeMillis >= (long)this.field_74468_e))
|
|
{
|
|
var2 = this.func_74460_a(true);
|
|
|
|
if (var2 != null)
|
|
{
|
|
***************
|
|
*** 460,472 ****
|
|
this.theNetHandler.handleErrorMessage(this.terminationReason, this.shutdownDescription);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Return the InetSocketAddress of the remote endpoint
|
|
*/
|
|
! public SocketAddress getSocketAddress()
|
|
{
|
|
return this.remoteSocketAddress;
|
|
}
|
|
|
|
/**
|
|
--- 441,453 ----
|
|
this.theNetHandler.handleErrorMessage(this.terminationReason, this.shutdownDescription);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Returns the socket address of the remote side. Server-only.
|
|
*/
|
|
! public SocketAddress getRemoteAddress()
|
|
{
|
|
return this.remoteSocketAddress;
|
|
}
|
|
|
|
/**
|
|
***************
|
|
*** 500,512 ****
|
|
BufferedOutputStream var1 = new BufferedOutputStream(CryptManager.encryptOuputStream(this.sharedKeyForEncryption, this.networkSocket.getOutputStream()), 5120);
|
|
this.socketOutputStream = new DataOutputStream(var1);
|
|
}
|
|
|
|
/**
|
|
! * returns 0 for memoryConnections
|
|
*/
|
|
! public int packetSize()
|
|
{
|
|
return this.chunkDataPackets.size();
|
|
}
|
|
|
|
public Socket getSocket()
|
|
--- 481,493 ----
|
|
BufferedOutputStream var1 = new BufferedOutputStream(CryptManager.encryptOuputStream(this.sharedKeyForEncryption, this.networkSocket.getOutputStream()), 5120);
|
|
this.socketOutputStream = new DataOutputStream(var1);
|
|
}
|
|
|
|
/**
|
|
! * Returns the number of chunk data packets waiting to be sent.
|
|
*/
|
|
! public int getNumChunkDataPackets()
|
|
{
|
|
return this.chunkDataPackets.size();
|
|
}
|
|
|
|
public Socket getSocket()
|
|
*** Team.java Sat Feb 5 04:19:45 2022
|
|
--- Team.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 12,20 ****
|
|
|
|
public abstract String func_96661_b();
|
|
|
|
public abstract String func_142053_d(String var1);
|
|
|
|
- public abstract boolean func_98297_h();
|
|
-
|
|
public abstract boolean getAllowFriendlyFire();
|
|
}
|
|
--- 12,18 ----
|
|
*** Teleporter.java Sat Feb 5 04:19:45 2022
|
|
--- Teleporter.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 222,232 ****
|
|
else if (var50 == Direction.rotateOpposite[var30])
|
|
{
|
|
var40 = -1.0F;
|
|
var41 = -1.0F;
|
|
}
|
|
! else if (var50 == Direction.rotateRight[var30])
|
|
{
|
|
var42 = 1.0F;
|
|
var43 = -1.0F;
|
|
}
|
|
else
|
|
--- 222,232 ----
|
|
else if (var50 == Direction.rotateOpposite[var30])
|
|
{
|
|
var40 = -1.0F;
|
|
var41 = -1.0F;
|
|
}
|
|
! else if (var50 == Direction.enderEyeMetaToDirection[var30])
|
|
{
|
|
var42 = 1.0F;
|
|
var43 = -1.0F;
|
|
}
|
|
else
|
|
*** ThreadLoginVerifier.java Sat Feb 5 04:19:45 2022
|
|
--- ThreadLoginVerifier.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 26,43 ****
|
|
String var4 = var3.readLine();
|
|
var3.close();
|
|
|
|
if (!"YES".equals(var4))
|
|
{
|
|
! this.loginHandler.raiseErrorAndDisconnect("Failed to verify username!");
|
|
return;
|
|
}
|
|
|
|
NetLoginHandler.func_72531_a(this.loginHandler, true);
|
|
}
|
|
catch (Exception var5)
|
|
{
|
|
! this.loginHandler.raiseErrorAndDisconnect("Failed to verify username! [internal error " + var5 + "]");
|
|
var5.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
--- 26,43 ----
|
|
String var4 = var3.readLine();
|
|
var3.close();
|
|
|
|
if (!"YES".equals(var4))
|
|
{
|
|
! this.loginHandler.kickUser("Failed to verify username!");
|
|
return;
|
|
}
|
|
|
|
NetLoginHandler.func_72531_a(this.loginHandler, true);
|
|
}
|
|
catch (Exception var5)
|
|
{
|
|
! this.loginHandler.kickUser("Failed to verify username! [internal error " + var5 + "]");
|
|
var5.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
*** TileEntity.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntity.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 171,196 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Returns the square of the distance between this entity and the passed in coordinates.
|
|
- */
|
|
- public double getDistanceFrom(double par1, double par3, double par5)
|
|
- {
|
|
- double var7 = (double)this.xCoord + 0.5D - par1;
|
|
- double var9 = (double)this.yCoord + 0.5D - par3;
|
|
- double var11 = (double)this.zCoord + 0.5D - par5;
|
|
- return var7 * var7 + var9 * var9 + var11 * var11;
|
|
- }
|
|
-
|
|
- public double getMaxRenderDistanceSquared()
|
|
- {
|
|
- return 4096.0D;
|
|
- }
|
|
-
|
|
- /**
|
|
* Gets the block type at the location of this entity (client-only).
|
|
*/
|
|
public Block getBlockType()
|
|
{
|
|
if (this.blockType == null)
|
|
--- 171,180 ----
|
|
*** TileEntityBeacon.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityBeacon.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 5,16 ****
|
|
|
|
public class TileEntityBeacon extends TileEntity implements IInventory
|
|
{
|
|
/** List of effects that Beacon can apply */
|
|
public static final Potion[][] effectsList = new Potion[][] {{Potion.moveSpeed, Potion.digSpeed}, {Potion.resistance, Potion.jump}, {Potion.damageBoost}, {Potion.regeneration}};
|
|
- private long field_82137_b;
|
|
- private float field_82138_c;
|
|
private boolean isBeaconActive;
|
|
|
|
/** Level of this beacon's pyramid. */
|
|
private int levels = -1;
|
|
|
|
--- 5,14 ----
|
|
***************
|
|
*** 125,166 ****
|
|
this.isBeaconActive = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
- public float func_82125_v_()
|
|
- {
|
|
- if (!this.isBeaconActive)
|
|
- {
|
|
- return 0.0F;
|
|
- }
|
|
- else
|
|
- {
|
|
- int var1 = (int)(this.worldObj.getTotalWorldTime() - this.field_82137_b);
|
|
- this.field_82137_b = this.worldObj.getTotalWorldTime();
|
|
-
|
|
- if (var1 > 1)
|
|
- {
|
|
- this.field_82138_c -= (float)var1 / 40.0F;
|
|
-
|
|
- if (this.field_82138_c < 0.0F)
|
|
- {
|
|
- this.field_82138_c = 0.0F;
|
|
- }
|
|
- }
|
|
-
|
|
- this.field_82138_c += 0.025F;
|
|
-
|
|
- if (this.field_82138_c > 1.0F)
|
|
- {
|
|
- this.field_82138_c = 1.0F;
|
|
- }
|
|
-
|
|
- return this.field_82138_c;
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Return the primary potion effect given by this beacon.
|
|
*/
|
|
public int getPrimaryEffect()
|
|
{
|
|
--- 123,132 ----
|
|
***************
|
|
*** 181,198 ****
|
|
public int getLevels()
|
|
{
|
|
return this.levels;
|
|
}
|
|
|
|
- /**
|
|
- * Set the levels of this beacon's pyramid.
|
|
- */
|
|
- public void setLevels(int par1)
|
|
- {
|
|
- this.levels = par1;
|
|
- }
|
|
-
|
|
public void setPrimaryEffect(int par1)
|
|
{
|
|
this.primaryEffect = 0;
|
|
|
|
for (int var2 = 0; var2 < this.levels && var2 < 3; ++var2)
|
|
--- 147,156 ----
|
|
***************
|
|
*** 244,258 ****
|
|
public Packet getDescriptionPacket()
|
|
{
|
|
NBTTagCompound var1 = new NBTTagCompound();
|
|
this.writeToNBT(var1);
|
|
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 3, var1);
|
|
- }
|
|
-
|
|
- public double getMaxRenderDistanceSquared()
|
|
- {
|
|
- return 65536.0D;
|
|
}
|
|
|
|
/**
|
|
* Reads a tile entity from NBT.
|
|
*/
|
|
--- 202,211 ----
|
|
*** TileEntityBrewingStand.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityBrewingStand.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 83,93 ****
|
|
int var1 = this.getFilledSlots();
|
|
|
|
if (var1 != this.filledSlots)
|
|
{
|
|
this.filledSlots = var1;
|
|
! this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, var1, 2);
|
|
}
|
|
|
|
super.updateEntity();
|
|
}
|
|
|
|
--- 83,93 ----
|
|
int var1 = this.getFilledSlots();
|
|
|
|
if (var1 != this.filledSlots)
|
|
{
|
|
this.filledSlots = var1;
|
|
! this.worldObj.setBlockMetadata(this.xCoord, this.yCoord, this.zCoord, var1, 2);
|
|
}
|
|
|
|
super.updateEntity();
|
|
}
|
|
|
|
***************
|
|
*** 187,197 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * The result of brewing a potion of the specified damage value with an ingredient itemstack.
|
|
*/
|
|
private int getPotionResult(int par1, ItemStack par2ItemStack)
|
|
{
|
|
return par2ItemStack == null ? par1 : (Item.itemsList[par2ItemStack.itemID].isPotionIngredient() ? PotionHelper.applyIngredient(par1, Item.itemsList[par2ItemStack.itemID].getPotionEffect()) : par1);
|
|
}
|
|
--- 187,197 ----
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Returns the new potion damage value after the specified item is applied as an ingredient to the specified potion.
|
|
*/
|
|
private int getPotionResult(int par1, ItemStack par2ItemStack)
|
|
{
|
|
return par2ItemStack == null ? par1 : (Item.itemsList[par2ItemStack.itemID].isPotionIngredient() ? PotionHelper.applyIngredient(par1, Item.itemsList[par2ItemStack.itemID].getPotionEffect()) : par1);
|
|
}
|
|
***************
|
|
*** 334,348 ****
|
|
public boolean isItemValidForSlot(int par1, ItemStack par2ItemStack)
|
|
{
|
|
return par1 == 3 ? Item.itemsList[par2ItemStack.itemID].isPotionIngredient() : par2ItemStack.itemID == Item.potion.itemID || par2ItemStack.itemID == Item.glassBottle.itemID;
|
|
}
|
|
|
|
- public void setBrewTime(int par1)
|
|
- {
|
|
- this.brewTime = par1;
|
|
- }
|
|
-
|
|
/**
|
|
* returns an integer with each bit specifying wether that slot of the stand contains a potion
|
|
*/
|
|
public int getFilledSlots()
|
|
{
|
|
--- 334,343 ----
|
|
***************
|
|
*** 358,371 ****
|
|
|
|
return var1;
|
|
}
|
|
|
|
/**
|
|
! * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this
|
|
! * block.
|
|
*/
|
|
! public int[] getAccessibleSlotsFromSide(int par1)
|
|
{
|
|
return par1 == 1 ? field_102017_a : field_102016_b;
|
|
}
|
|
|
|
/**
|
|
--- 353,365 ----
|
|
|
|
return var1;
|
|
}
|
|
|
|
/**
|
|
! * param side
|
|
*/
|
|
! public int[] getSlotsForFace(int par1)
|
|
{
|
|
return par1 == 1 ? field_102017_a : field_102016_b;
|
|
}
|
|
|
|
/**
|
|
*** TileEntityChest.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityChest.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 31,52 ****
|
|
/** The number of players currently using this chest */
|
|
public int numUsingPlayers;
|
|
|
|
/** Server sync counter (once per 20 ticks) */
|
|
private int ticksSinceSync;
|
|
! private int cachedChestType;
|
|
private String customName;
|
|
-
|
|
- public TileEntityChest()
|
|
- {
|
|
- this.cachedChestType = -1;
|
|
- }
|
|
-
|
|
- public TileEntityChest(int par1)
|
|
- {
|
|
- this.cachedChestType = par1;
|
|
- }
|
|
|
|
/**
|
|
* Returns the number of slots in the inventory.
|
|
*/
|
|
public int getSizeInventory()
|
|
--- 31,42 ----
|
|
/** The number of players currently using this chest */
|
|
public int numUsingPlayers;
|
|
|
|
/** Server sync counter (once per 20 ticks) */
|
|
private int ticksSinceSync;
|
|
! private int cachedChestType = -1;
|
|
private String customName;
|
|
|
|
/**
|
|
* Returns the number of slots in the inventory.
|
|
*/
|
|
public int getSizeInventory()
|
|
*** TileEntityCommandBlock.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityCommandBlock.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 20,37 ****
|
|
this.command = par1Str;
|
|
this.onInventoryChanged();
|
|
}
|
|
|
|
/**
|
|
- * Return the command this command block is set to execute.
|
|
- */
|
|
- public String getCommand()
|
|
- {
|
|
- return this.command;
|
|
- }
|
|
-
|
|
- /**
|
|
* Execute the command, called when the command block is powered.
|
|
*/
|
|
public int executeCommandOnPowered(World par1World)
|
|
{
|
|
if (par1World.isRemote)
|
|
--- 20,29 ----
|
|
***************
|
|
*** 107,117 ****
|
|
}
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! public ChunkCoordinates getPlayerCoordinates()
|
|
{
|
|
return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord);
|
|
}
|
|
|
|
public World getEntityWorld()
|
|
--- 99,109 ----
|
|
}
|
|
|
|
/**
|
|
* Return the position for this command sender.
|
|
*/
|
|
! public ChunkCoordinates getCommandSenderPosition()
|
|
{
|
|
return new ChunkCoordinates(this.xCoord, this.yCoord, this.zCoord);
|
|
}
|
|
|
|
public World getEntityWorld()
|
|
***************
|
|
*** 127,141 ****
|
|
NBTTagCompound var1 = new NBTTagCompound();
|
|
this.writeToNBT(var1);
|
|
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, var1);
|
|
}
|
|
|
|
! public int func_96103_d()
|
|
{
|
|
return this.succesCount;
|
|
}
|
|
|
|
! public void func_96102_a(int par1)
|
|
{
|
|
this.succesCount = par1;
|
|
}
|
|
}
|
|
--- 119,133 ----
|
|
NBTTagCompound var1 = new NBTTagCompound();
|
|
this.writeToNBT(var1);
|
|
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, var1);
|
|
}
|
|
|
|
! public int getSignalStrength()
|
|
{
|
|
return this.succesCount;
|
|
}
|
|
|
|
! public void setSignalStrength(int par1)
|
|
{
|
|
this.succesCount = par1;
|
|
}
|
|
}
|
|
*** TileEntityEnchantmentTable.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityEnchantmentTable.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 16,26 ****
|
|
public float field_70374_e;
|
|
|
|
/** The amount that the book is open. */
|
|
public float bookSpread;
|
|
|
|
! /** The amount that the book is open. */
|
|
public float bookSpreadPrev;
|
|
public float bookRotation2;
|
|
public float bookRotationPrev;
|
|
public float bookRotation;
|
|
private static Random rand = new Random();
|
|
--- 16,26 ----
|
|
public float field_70374_e;
|
|
|
|
/** The amount that the book is open. */
|
|
public float bookSpread;
|
|
|
|
! /** The amount that the book was open last tick. */
|
|
public float bookSpreadPrev;
|
|
public float bookRotation2;
|
|
public float bookRotationPrev;
|
|
public float bookRotation;
|
|
private static Random rand = new Random();
|
|
*** TileEntityFurnace.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityFurnace.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 196,228 ****
|
|
{
|
|
return 64;
|
|
}
|
|
|
|
/**
|
|
- * Returns an integer between 0 and the passed value representing how close the current item is to being completely
|
|
- * cooked
|
|
- */
|
|
- public int getCookProgressScaled(int par1)
|
|
- {
|
|
- return this.furnaceCookTime * par1 / 200;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns an integer between 0 and the passed value representing how much burn time is left on the current fuel
|
|
- * item, where 0 means that the item is exhausted and the passed value means that the item is fresh
|
|
- */
|
|
- public int getBurnTimeRemainingScaled(int par1)
|
|
- {
|
|
- if (this.currentItemBurnTime == 0)
|
|
- {
|
|
- this.currentItemBurnTime = 200;
|
|
- }
|
|
-
|
|
- return this.furnaceBurnTime * par1 / this.currentItemBurnTime;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns true if the furnace is currently burning
|
|
*/
|
|
public boolean isBurning()
|
|
{
|
|
return this.furnaceBurnTime > 0;
|
|
--- 196,205 ----
|
|
***************
|
|
*** 403,416 ****
|
|
{
|
|
return par1 == 2 ? false : (par1 == 1 ? isItemFuel(par2ItemStack) : true);
|
|
}
|
|
|
|
/**
|
|
! * Returns an array containing the indices of the slots that can be accessed by automation on the given side of this
|
|
! * block.
|
|
*/
|
|
! public int[] getAccessibleSlotsFromSide(int par1)
|
|
{
|
|
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
|
|
}
|
|
|
|
/**
|
|
--- 380,392 ----
|
|
{
|
|
return par1 == 2 ? false : (par1 == 1 ? isItemFuel(par2ItemStack) : true);
|
|
}
|
|
|
|
/**
|
|
! * param side
|
|
*/
|
|
! public int[] getSlotsForFace(int par1)
|
|
{
|
|
return par1 == 0 ? slots_bottom : (par1 == 1 ? slots_top : slots_sides);
|
|
}
|
|
|
|
/**
|
|
*** TileEntityHopper.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityHopper.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 217,232 ****
|
|
--this.transferCooldown;
|
|
|
|
if (!this.isCoolingDown())
|
|
{
|
|
this.setTransferCooldown(0);
|
|
! this.updateHopper();
|
|
}
|
|
}
|
|
}
|
|
|
|
! public boolean updateHopper()
|
|
{
|
|
if (this.worldObj != null && !this.worldObj.isRemote)
|
|
{
|
|
if (!this.isCoolingDown() && BlockHopper.getIsBlockNotPoweredFromMetadata(this.getBlockMetadata()))
|
|
{
|
|
--- 217,232 ----
|
|
--this.transferCooldown;
|
|
|
|
if (!this.isCoolingDown())
|
|
{
|
|
this.setTransferCooldown(0);
|
|
! this.func_98045_j();
|
|
}
|
|
}
|
|
}
|
|
|
|
! public boolean func_98045_j()
|
|
{
|
|
if (this.worldObj != null && !this.worldObj.isRemote)
|
|
{
|
|
if (!this.isCoolingDown() && BlockHopper.getIsBlockNotPoweredFromMetadata(this.getBlockMetadata()))
|
|
{
|
|
***************
|
|
*** 295,309 ****
|
|
byte var2 = 0;
|
|
|
|
if (var1 instanceof ISidedInventory && var2 > -1)
|
|
{
|
|
ISidedInventory var7 = (ISidedInventory)var1;
|
|
! int[] var8 = var7.getAccessibleSlotsFromSide(var2);
|
|
|
|
for (int var5 = 0; var5 < var8.length; ++var5)
|
|
{
|
|
! if (insertStackFromInventory(par0Hopper, var1, var8[var5], var2))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
--- 295,309 ----
|
|
byte var2 = 0;
|
|
|
|
if (var1 instanceof ISidedInventory && var2 > -1)
|
|
{
|
|
ISidedInventory var7 = (ISidedInventory)var1;
|
|
! int[] var8 = var7.getSlotsForFace(var2);
|
|
|
|
for (int var5 = 0; var5 < var8.length; ++var5)
|
|
{
|
|
! if (func_102012_a(par0Hopper, var1, var8[var5], var2))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
***************
|
|
*** 311,341 ****
|
|
{
|
|
int var3 = var1.getSizeInventory();
|
|
|
|
for (int var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
! if (insertStackFromInventory(par0Hopper, var1, var4, var2))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! EntityItem var6 = getEntityAbove(par0Hopper.getWorldObj(), par0Hopper.getXPos(), par0Hopper.getYPos() + 1.0D, par0Hopper.getZPos());
|
|
|
|
if (var6 != null)
|
|
{
|
|
! return insertStackFromEntity(par0Hopper, var6);
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
! private static boolean insertStackFromInventory(Hopper par0Hopper, IInventory par1IInventory, int par2, int par3)
|
|
{
|
|
ItemStack var4 = par1IInventory.getStackInSlot(par2);
|
|
|
|
if (var4 != null && canExtractItemFromInventory(par1IInventory, var4, par2, par3))
|
|
{
|
|
--- 311,341 ----
|
|
{
|
|
int var3 = var1.getSizeInventory();
|
|
|
|
for (int var4 = 0; var4 < var3; ++var4)
|
|
{
|
|
! if (func_102012_a(par0Hopper, var1, var4, var2))
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
! EntityItem var6 = func_96119_a(par0Hopper.getWorldObj(), par0Hopper.getXPos(), par0Hopper.getYPos() + 1.0D, par0Hopper.getZPos());
|
|
|
|
if (var6 != null)
|
|
{
|
|
! return func_96114_a(par0Hopper, var6);
|
|
}
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
! private static boolean func_102012_a(Hopper par0Hopper, IInventory par1IInventory, int par2, int par3)
|
|
{
|
|
ItemStack var4 = par1IInventory.getStackInSlot(par2);
|
|
|
|
if (var4 != null && canExtractItemFromInventory(par1IInventory, var4, par2, par3))
|
|
{
|
|
***************
|
|
*** 352,362 ****
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
! public static boolean insertStackFromEntity(IInventory par0IInventory, EntityItem par1EntityItem)
|
|
{
|
|
boolean var2 = false;
|
|
|
|
if (par1EntityItem == null)
|
|
{
|
|
--- 352,362 ----
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
! public static boolean func_96114_a(IInventory par0IInventory, EntityItem par1EntityItem)
|
|
{
|
|
boolean var2 = false;
|
|
|
|
if (par1EntityItem == null)
|
|
{
|
|
***************
|
|
*** 387,397 ****
|
|
public static ItemStack insertStack(IInventory par0IInventory, ItemStack par1ItemStack, int par2)
|
|
{
|
|
if (par0IInventory instanceof ISidedInventory && par2 > -1)
|
|
{
|
|
ISidedInventory var6 = (ISidedInventory)par0IInventory;
|
|
! int[] var7 = var6.getAccessibleSlotsFromSide(par2);
|
|
|
|
for (int var5 = 0; var5 < var7.length && par1ItemStack != null && par1ItemStack.stackSize > 0; ++var5)
|
|
{
|
|
par1ItemStack = func_102014_c(par0IInventory, par1ItemStack, var7[var5], par2);
|
|
}
|
|
--- 387,397 ----
|
|
public static ItemStack insertStack(IInventory par0IInventory, ItemStack par1ItemStack, int par2)
|
|
{
|
|
if (par0IInventory instanceof ISidedInventory && par2 > -1)
|
|
{
|
|
ISidedInventory var6 = (ISidedInventory)par0IInventory;
|
|
! int[] var7 = var6.getSlotsForFace(par2);
|
|
|
|
for (int var5 = 0; var5 < var7.length && par1ItemStack != null && par1ItemStack.stackSize > 0; ++var5)
|
|
{
|
|
par1ItemStack = func_102014_c(par0IInventory, par1ItemStack, var7[var5], par2);
|
|
}
|
|
***************
|
|
*** 480,490 ****
|
|
public static IInventory getInventoryAboveHopper(Hopper par0Hopper)
|
|
{
|
|
return getInventoryAtLocation(par0Hopper.getWorldObj(), par0Hopper.getXPos(), par0Hopper.getYPos() + 1.0D, par0Hopper.getZPos());
|
|
}
|
|
|
|
! public static EntityItem getEntityAbove(World par0World, double par1, double par3, double par5)
|
|
{
|
|
List var7 = par0World.selectEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getAABBPool().getAABB(par1, par3, par5, par1 + 1.0D, par3 + 1.0D, par5 + 1.0D), IEntitySelector.selectAnything);
|
|
return var7.size() > 0 ? (EntityItem)var7.get(0) : null;
|
|
}
|
|
|
|
--- 480,490 ----
|
|
public static IInventory getInventoryAboveHopper(Hopper par0Hopper)
|
|
{
|
|
return getInventoryAtLocation(par0Hopper.getWorldObj(), par0Hopper.getXPos(), par0Hopper.getYPos() + 1.0D, par0Hopper.getZPos());
|
|
}
|
|
|
|
! public static EntityItem func_96119_a(World par0World, double par1, double par3, double par5)
|
|
{
|
|
List var7 = par0World.selectEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getAABBPool().getAABB(par1, par3, par5, par1 + 1.0D, par3 + 1.0D, par5 + 1.0D), IEntitySelector.selectAnything);
|
|
return var7.size() > 0 ? (EntityItem)var7.get(0) : null;
|
|
}
|
|
|
|
*** TileEntityPiston.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntityPiston.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 59,73 ****
|
|
public int getPistonOrientation()
|
|
{
|
|
return this.storedOrientation;
|
|
}
|
|
|
|
- public boolean shouldRenderHead()
|
|
- {
|
|
- return this.shouldHeadBeRendered;
|
|
- }
|
|
-
|
|
/**
|
|
* Get interpolated progress value (between lastProgress and progress) given the fractional time between ticks as an
|
|
* argument.
|
|
*/
|
|
public float getProgress(float par1)
|
|
--- 59,68 ----
|
|
***************
|
|
*** 76,100 ****
|
|
{
|
|
par1 = 1.0F;
|
|
}
|
|
|
|
return this.lastProgress + (this.progress - this.lastProgress) * par1;
|
|
- }
|
|
-
|
|
- public float getOffsetX(float par1)
|
|
- {
|
|
- return this.extending ? (this.getProgress(par1) - 1.0F) * (float)Facing.offsetsXForSide[this.storedOrientation] : (1.0F - this.getProgress(par1)) * (float)Facing.offsetsXForSide[this.storedOrientation];
|
|
- }
|
|
-
|
|
- public float getOffsetY(float par1)
|
|
- {
|
|
- return this.extending ? (this.getProgress(par1) - 1.0F) * (float)Facing.offsetsYForSide[this.storedOrientation] : (1.0F - this.getProgress(par1)) * (float)Facing.offsetsYForSide[this.storedOrientation];
|
|
- }
|
|
-
|
|
- public float getOffsetZ(float par1)
|
|
- {
|
|
- return this.extending ? (this.getProgress(par1) - 1.0F) * (float)Facing.offsetsZForSide[this.storedOrientation] : (1.0F - this.getProgress(par1)) * (float)Facing.offsetsZForSide[this.storedOrientation];
|
|
}
|
|
|
|
private void updatePushedObjects(float par1, float par2)
|
|
{
|
|
if (this.extending)
|
|
--- 71,80 ----
|
|
*** TileEntitySign.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntitySign.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 57,79 ****
|
|
public boolean isEditable()
|
|
{
|
|
return this.isEditable;
|
|
}
|
|
|
|
- /**
|
|
- * Sets the sign's isEditable flag to the specified parameter.
|
|
- */
|
|
- public void setEditable(boolean par1)
|
|
- {
|
|
- this.isEditable = par1;
|
|
-
|
|
- if (!par1)
|
|
- {
|
|
- this.field_142011_d = null;
|
|
- }
|
|
- }
|
|
-
|
|
public void func_142010_a(EntityPlayer par1EntityPlayer)
|
|
{
|
|
this.field_142011_d = par1EntityPlayer;
|
|
}
|
|
|
|
--- 57,66 ----
|
|
*** TileEntitySkull.java Sat Feb 5 04:19:45 2022
|
|
--- TileEntitySkull.java Sat Feb 5 04:19:58 2022
|
|
***************
|
|
*** 62,76 ****
|
|
public int getSkullType()
|
|
{
|
|
return this.skullType;
|
|
}
|
|
|
|
- public int func_82119_b()
|
|
- {
|
|
- return this.skullRotation;
|
|
- }
|
|
-
|
|
/**
|
|
* Set the skull's rotation
|
|
*/
|
|
public void setSkullRotation(int par1)
|
|
{
|
|
--- 62,71 ----
|
|
*** Vec3.java Sat Feb 5 04:19:45 2022
|
|
--- Vec3.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 59,76 ****
|
|
this.zCoord = par5;
|
|
return this;
|
|
}
|
|
|
|
/**
|
|
- * Returns a new vector with the result of the specified vector minus this.
|
|
- */
|
|
- public Vec3 subtract(Vec3 par1Vec3)
|
|
- {
|
|
- return this.myVec3LocalPool.getVecFromPool(par1Vec3.xCoord - this.xCoord, par1Vec3.yCoord - this.yCoord, par1Vec3.zCoord - this.zCoord);
|
|
- }
|
|
-
|
|
- /**
|
|
* Normalizes the vector to a length of 1 (except if it is the zero vector)
|
|
*/
|
|
public Vec3 normalize()
|
|
{
|
|
double var1 = (double)MathHelper.sqrt_double(this.xCoord * this.xCoord + this.yCoord * this.yCoord + this.zCoord * this.zCoord);
|
|
--- 59,68 ----
|
|
***************
|
|
*** 81,98 ****
|
|
{
|
|
return this.xCoord * par1Vec3.xCoord + this.yCoord * par1Vec3.yCoord + this.zCoord * par1Vec3.zCoord;
|
|
}
|
|
|
|
/**
|
|
- * Returns a new vector with the result of this vector x the specified vector.
|
|
- */
|
|
- public Vec3 crossProduct(Vec3 par1Vec3)
|
|
- {
|
|
- return this.myVec3LocalPool.getVecFromPool(this.yCoord * par1Vec3.zCoord - this.zCoord * par1Vec3.yCoord, this.zCoord * par1Vec3.xCoord - this.xCoord * par1Vec3.zCoord, this.xCoord * par1Vec3.yCoord - this.yCoord * par1Vec3.xCoord);
|
|
- }
|
|
-
|
|
- /**
|
|
* Adds the specified x,y,z vector components to this vector and returns the resulting vector. Does not change this
|
|
* vector.
|
|
*/
|
|
public Vec3 addVector(double par1, double par3, double par5)
|
|
{
|
|
--- 73,82 ----
|
|
***************
|
|
*** 231,255 ****
|
|
float var2 = MathHelper.cos(par1);
|
|
float var3 = MathHelper.sin(par1);
|
|
double var4 = this.xCoord * (double)var2 + this.zCoord * (double)var3;
|
|
double var6 = this.yCoord;
|
|
double var8 = this.zCoord * (double)var2 - this.xCoord * (double)var3;
|
|
- this.xCoord = var4;
|
|
- this.yCoord = var6;
|
|
- this.zCoord = var8;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Rotates the vector around the z axis by the specified angle.
|
|
- */
|
|
- public void rotateAroundZ(float par1)
|
|
- {
|
|
- float var2 = MathHelper.cos(par1);
|
|
- float var3 = MathHelper.sin(par1);
|
|
- double var4 = this.xCoord * (double)var2 + this.yCoord * (double)var3;
|
|
- double var6 = this.yCoord * (double)var2 - this.xCoord * (double)var3;
|
|
- double var8 = this.zCoord;
|
|
this.xCoord = var4;
|
|
this.yCoord = var6;
|
|
this.zCoord = var8;
|
|
}
|
|
}
|
|
--- 215,224 ----
|
|
*** Vec3Pool.java Sat Feb 5 04:19:45 2022
|
|
--- Vec3Pool.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 76,94 ****
|
|
|
|
this.nextFreeSpace = 0;
|
|
}
|
|
}
|
|
|
|
- public void clearAndFreeCache()
|
|
- {
|
|
- if (!this.func_82589_e())
|
|
- {
|
|
- this.nextFreeSpace = 0;
|
|
- this.vec3Cache.clear();
|
|
- }
|
|
- }
|
|
-
|
|
public int getPoolSize()
|
|
{
|
|
return this.vec3Cache.size();
|
|
}
|
|
|
|
--- 76,85 ----
|
|
*** World.java Sat Feb 5 04:19:45 2022
|
|
--- World.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 58,68 ****
|
|
* Set to 2 whenever a lightning bolt is generated in SSP. Decrements if > 0 in updateWeather(). Value appears to be
|
|
* unused.
|
|
*/
|
|
public int lastLightningBolt;
|
|
|
|
! /** Option > Difficulty setting (0 - 3) */
|
|
public int difficultySetting;
|
|
|
|
/** RNG for World. */
|
|
public Random rand = new Random();
|
|
|
|
--- 58,68 ----
|
|
* Set to 2 whenever a lightning bolt is generated in SSP. Decrements if > 0 in updateWeather(). Value appears to be
|
|
* unused.
|
|
*/
|
|
public int lastLightningBolt;
|
|
|
|
! /** Whether monsters are enabled or not. (1 = on, 0 = off) */
|
|
public int difficultySetting;
|
|
|
|
/** RNG for World. */
|
|
public Random rand = new Random();
|
|
|
|
***************
|
|
*** 77,87 ****
|
|
/**
|
|
* holds information about a world (size on disk, time, spawn point, seed, ...)
|
|
*/
|
|
protected WorldInfo worldInfo;
|
|
|
|
! /** Boolean that is set to true when trying to find a spawn point */
|
|
public boolean findingSpawnPoint;
|
|
public MapStorage mapStorage;
|
|
public final VillageCollection villageCollectionObj;
|
|
protected final VillageSiege villageSiegeObj = new VillageSiege(this);
|
|
public final Profiler theProfiler;
|
|
--- 77,90 ----
|
|
/**
|
|
* holds information about a world (size on disk, time, spawn point, seed, ...)
|
|
*/
|
|
protected WorldInfo worldInfo;
|
|
|
|
! /**
|
|
! * if set, this flag forces a request to load a chunk to load the chunk rather than defaulting to the world's
|
|
! * chunkprovider's dummy if possible
|
|
! */
|
|
public boolean findingSpawnPoint;
|
|
public MapStorage mapStorage;
|
|
public final VillageCollection villageCollectionObj;
|
|
protected final VillageSiege villageSiegeObj = new VillageSiege(this);
|
|
public final Profiler theProfiler;
|
|
***************
|
|
*** 100,110 ****
|
|
protected boolean spawnHostileMobs = true;
|
|
|
|
/** A flag indicating whether we should spawn peaceful mobs. */
|
|
protected boolean spawnPeacefulMobs = true;
|
|
|
|
! /** Positions to update */
|
|
protected Set activeChunkSet = new HashSet();
|
|
|
|
/** number of ticks until the next random ambients play */
|
|
private int ambientTickCountdown;
|
|
|
|
--- 103,113 ----
|
|
protected boolean spawnHostileMobs = true;
|
|
|
|
/** A flag indicating whether we should spawn peaceful mobs. */
|
|
protected boolean spawnPeacefulMobs = true;
|
|
|
|
! /** populated by chunks that are within 9 chunks of any player */
|
|
protected Set activeChunkSet = new HashSet();
|
|
|
|
/** number of ticks until the next random ambients play */
|
|
private int ambientTickCountdown;
|
|
|
|
***************
|
|
*** 140,178 ****
|
|
public WorldChunkManager getWorldChunkManager()
|
|
{
|
|
return this.provider.worldChunkMgr;
|
|
}
|
|
|
|
- public World(ISaveHandler par1ISaveHandler, String par2Str, WorldProvider par3WorldProvider, WorldSettings par4WorldSettings, Profiler par5Profiler, ILogAgent par6ILogAgent)
|
|
- {
|
|
- this.ambientTickCountdown = this.rand.nextInt(12000);
|
|
- this.lightUpdateBlockList = new int[32768];
|
|
- this.saveHandler = par1ISaveHandler;
|
|
- this.theProfiler = par5Profiler;
|
|
- this.worldInfo = new WorldInfo(par4WorldSettings, par2Str);
|
|
- this.provider = par3WorldProvider;
|
|
- this.mapStorage = new MapStorage(par1ISaveHandler);
|
|
- this.worldLogAgent = par6ILogAgent;
|
|
- VillageCollection var7 = (VillageCollection)this.mapStorage.loadData(VillageCollection.class, "villages");
|
|
-
|
|
- if (var7 == null)
|
|
- {
|
|
- this.villageCollectionObj = new VillageCollection(this);
|
|
- this.mapStorage.setData("villages", this.villageCollectionObj);
|
|
- }
|
|
- else
|
|
- {
|
|
- this.villageCollectionObj = var7;
|
|
- this.villageCollectionObj.func_82566_a(this);
|
|
- }
|
|
-
|
|
- par3WorldProvider.registerWorld(this);
|
|
- this.chunkProvider = this.createChunkProvider();
|
|
- this.calculateInitialSkylight();
|
|
- this.calculateInitialWeather();
|
|
- }
|
|
-
|
|
public World(ISaveHandler par1ISaveHandler, String par2Str, WorldSettings par3WorldSettings, WorldProvider par4WorldProvider, Profiler par5Profiler, ILogAgent par6ILogAgent)
|
|
{
|
|
this.ambientTickCountdown = this.rand.nextInt(12000);
|
|
this.lightUpdateBlockList = new int[32768];
|
|
this.saveHandler = par1ISaveHandler;
|
|
--- 143,152 ----
|
|
***************
|
|
*** 183,195 ****
|
|
|
|
if (par4WorldProvider != null)
|
|
{
|
|
this.provider = par4WorldProvider;
|
|
}
|
|
! else if (this.worldInfo != null && this.worldInfo.getVanillaDimension() != 0)
|
|
{
|
|
! this.provider = WorldProvider.getProviderForDimension(this.worldInfo.getVanillaDimension());
|
|
}
|
|
else
|
|
{
|
|
this.provider = WorldProvider.getProviderForDimension(0);
|
|
}
|
|
--- 157,169 ----
|
|
|
|
if (par4WorldProvider != null)
|
|
{
|
|
this.provider = par4WorldProvider;
|
|
}
|
|
! else if (this.worldInfo != null && this.worldInfo.getDimension() != 0)
|
|
{
|
|
! this.provider = WorldProvider.getProviderForDimension(this.worldInfo.getDimension());
|
|
}
|
|
else
|
|
{
|
|
this.provider = WorldProvider.getProviderForDimension(0);
|
|
}
|
|
***************
|
|
*** 257,274 ****
|
|
{
|
|
this.worldInfo.setServerInitialized(true);
|
|
}
|
|
|
|
/**
|
|
- * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.
|
|
- */
|
|
- public void setSpawnLocation()
|
|
- {
|
|
- this.setSpawnLocation(8, 64, 8);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the block ID of the first block at this (x,z) location with air above it, searching from sea level
|
|
* upwards.
|
|
*/
|
|
public int getFirstUncoveredBlock(int par1, int par2)
|
|
{
|
|
--- 231,240 ----
|
|
***************
|
|
*** 519,529 ****
|
|
|
|
/**
|
|
* Sets the blocks metadata and if set will then notify blocks that this block changed, depending on the flag. Args:
|
|
* x, y, z, metadata, flag. See setBlock for flag description
|
|
*/
|
|
! public boolean setBlockMetadataWithNotify(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000)
|
|
{
|
|
if (par2 < 0)
|
|
{
|
|
--- 485,495 ----
|
|
|
|
/**
|
|
* Sets the blocks metadata and if set will then notify blocks that this block changed, depending on the flag. Args:
|
|
* x, y, z, metadata, flag. See setBlock for flag description
|
|
*/
|
|
! public boolean setBlockMetadata(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000)
|
|
{
|
|
if (par2 < 0)
|
|
{
|
|
***************
|
|
*** 772,782 ****
|
|
{
|
|
return this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4).canBlockSeeTheSky(par1 & 15, par2, par3 & 15);
|
|
}
|
|
|
|
/**
|
|
! * Does the same as getBlockLightValue_do but without checking if its not a normal block
|
|
*/
|
|
public int getFullBlockLightValue(int par1, int par2, int par3)
|
|
{
|
|
if (par2 < 0)
|
|
{
|
|
--- 738,748 ----
|
|
{
|
|
return this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4).canBlockSeeTheSky(par1 & 15, par2, par3 & 15);
|
|
}
|
|
|
|
/**
|
|
! * gets the block's light value - without the _do function's checks.
|
|
*/
|
|
public int getFullBlockLightValue(int par1, int par2, int par3)
|
|
{
|
|
if (par2 < 0)
|
|
{
|
|
***************
|
|
*** 915,997 ****
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Brightness for SkyBlock.Sky is clear white and (through color computing it is assumed) DEPENDENT ON DAYTIME.
|
|
- * Brightness for SkyBlock.Block is yellowish and independent.
|
|
- */
|
|
- public int getSkyBlockTypeBrightness(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
|
|
- {
|
|
- if (this.provider.hasNoSky && par1EnumSkyBlock == EnumSkyBlock.Sky)
|
|
- {
|
|
- return 0;
|
|
- }
|
|
- else
|
|
- {
|
|
- if (par3 < 0)
|
|
- {
|
|
- par3 = 0;
|
|
- }
|
|
-
|
|
- if (par3 >= 256)
|
|
- {
|
|
- return par1EnumSkyBlock.defaultLightValue;
|
|
- }
|
|
- else if (par2 >= -30000000 && par4 >= -30000000 && par2 < 30000000 && par4 < 30000000)
|
|
- {
|
|
- int var5 = par2 >> 4;
|
|
- int var6 = par4 >> 4;
|
|
-
|
|
- if (!this.chunkExists(var5, var6))
|
|
- {
|
|
- return par1EnumSkyBlock.defaultLightValue;
|
|
- }
|
|
- else if (Block.useNeighborBrightness[this.getBlockId(par2, par3, par4)])
|
|
- {
|
|
- int var12 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3 + 1, par4);
|
|
- int var8 = this.getSavedLightValue(par1EnumSkyBlock, par2 + 1, par3, par4);
|
|
- int var9 = this.getSavedLightValue(par1EnumSkyBlock, par2 - 1, par3, par4);
|
|
- int var10 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3, par4 + 1);
|
|
- int var11 = this.getSavedLightValue(par1EnumSkyBlock, par2, par3, par4 - 1);
|
|
-
|
|
- if (var8 > var12)
|
|
- {
|
|
- var12 = var8;
|
|
- }
|
|
-
|
|
- if (var9 > var12)
|
|
- {
|
|
- var12 = var9;
|
|
- }
|
|
-
|
|
- if (var10 > var12)
|
|
- {
|
|
- var12 = var10;
|
|
- }
|
|
-
|
|
- if (var11 > var12)
|
|
- {
|
|
- var12 = var11;
|
|
- }
|
|
-
|
|
- return var12;
|
|
- }
|
|
- else
|
|
- {
|
|
- Chunk var7 = this.getChunkFromChunkCoords(var5, var6);
|
|
- return var7.getSavedLightValue(par1EnumSkyBlock, par2 & 15, par3, par4 & 15);
|
|
- }
|
|
- }
|
|
- else
|
|
- {
|
|
- return par1EnumSkyBlock.defaultLightValue;
|
|
- }
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns saved light value without taking into account the time of day. Either looks in the sky light map or
|
|
* block light map based on the enumSkyBlock arg.
|
|
*/
|
|
public int getSavedLightValue(EnumSkyBlock par1EnumSkyBlock, int par2, int par3, int par4)
|
|
{
|
|
--- 881,890 ----
|
|
***************
|
|
*** 1063,1100 ****
|
|
((IWorldAccess)this.worldAccesses.get(var4)).markBlockForRenderUpdate(par1, par2, par3);
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Any Light rendered on a 1.8 Block goes through here
|
|
- */
|
|
- public int getLightBrightnessForSkyBlocks(int par1, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Sky, par1, par2, par3);
|
|
- int var6 = this.getSkyBlockTypeBrightness(EnumSkyBlock.Block, par1, par2, par3);
|
|
-
|
|
- if (var6 < par4)
|
|
- {
|
|
- var6 = par4;
|
|
- }
|
|
-
|
|
- return var5 << 20 | var6 << 4;
|
|
- }
|
|
-
|
|
- public float getBrightness(int par1, int par2, int par3, int par4)
|
|
- {
|
|
- int var5 = this.getBlockLightValue(par1, par2, par3);
|
|
-
|
|
- if (var5 < par4)
|
|
- {
|
|
- var5 = par4;
|
|
- }
|
|
-
|
|
- return this.provider.lightBrightnessTable[var5];
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns how bright the block is shown as which is the block's light value looked up in a lookup table (light
|
|
* values aren't linear for brightness). Args: x, y, z
|
|
*/
|
|
public float getLightBrightness(int par1, int par2, int par3)
|
|
{
|
|
--- 956,965 ----
|
|
***************
|
|
*** 1108,1133 ****
|
|
{
|
|
return this.skylightSubtracted < 4;
|
|
}
|
|
|
|
/**
|
|
! * Performs a raycast against all blocks in the world except liquids.
|
|
*/
|
|
! public MovingObjectPosition clip(Vec3 par1Vec3, Vec3 par2Vec3)
|
|
{
|
|
! return this.rayTraceBlocks_do_do(par1Vec3, par2Vec3, false, false);
|
|
}
|
|
|
|
! /**
|
|
! * Performs a raycast against all blocks in the world, and optionally liquids.
|
|
! */
|
|
! public MovingObjectPosition clip(Vec3 par1Vec3, Vec3 par2Vec3, boolean par3)
|
|
{
|
|
! return this.rayTraceBlocks_do_do(par1Vec3, par2Vec3, par3, false);
|
|
}
|
|
|
|
! public MovingObjectPosition rayTraceBlocks_do_do(Vec3 par1Vec3, Vec3 par2Vec3, boolean par3, boolean par4)
|
|
{
|
|
if (!Double.isNaN(par1Vec3.xCoord) && !Double.isNaN(par1Vec3.yCoord) && !Double.isNaN(par1Vec3.zCoord))
|
|
{
|
|
if (!Double.isNaN(par2Vec3.xCoord) && !Double.isNaN(par2Vec3.yCoord) && !Double.isNaN(par2Vec3.zCoord))
|
|
{
|
|
--- 973,995 ----
|
|
{
|
|
return this.skylightSubtracted < 4;
|
|
}
|
|
|
|
/**
|
|
! * ray traces all blocks, including non-collideable ones
|
|
*/
|
|
! public MovingObjectPosition rayTraceBlocks(Vec3 par1Vec3, Vec3 par2Vec3)
|
|
{
|
|
! return this.rayTraceBlocks(par1Vec3, par2Vec3, false, false);
|
|
}
|
|
|
|
! public MovingObjectPosition rayTraceBlocks(Vec3 par1Vec3, Vec3 par2Vec3, boolean par3)
|
|
{
|
|
! return this.rayTraceBlocks(par1Vec3, par2Vec3, par3, false);
|
|
}
|
|
|
|
! public MovingObjectPosition rayTraceBlocks(Vec3 par1Vec3, Vec3 par2Vec3, boolean par3, boolean par4)
|
|
{
|
|
if (!Double.isNaN(par1Vec3.xCoord) && !Double.isNaN(par1Vec3.yCoord) && !Double.isNaN(par1Vec3.zCoord))
|
|
{
|
|
if (!Double.isNaN(par2Vec3.xCoord) && !Double.isNaN(par2Vec3.yCoord) && !Double.isNaN(par2Vec3.zCoord))
|
|
{
|
|
***************
|
|
*** 1415,1425 ****
|
|
this.weatherEffects.add(par1Entity);
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Called to place all entities as part of a world
|
|
*/
|
|
public boolean spawnEntityInWorld(Entity par1Entity)
|
|
{
|
|
int var2 = MathHelper.floor_double(par1Entity.posX / 16.0D);
|
|
int var3 = MathHelper.floor_double(par1Entity.posZ / 16.0D);
|
|
--- 1277,1287 ----
|
|
this.weatherEffects.add(par1Entity);
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Called when an entity is spawned in the world. This includes players.
|
|
*/
|
|
public boolean spawnEntityInWorld(Entity par1Entity)
|
|
{
|
|
int var2 = MathHelper.floor_double(par1Entity.posX / 16.0D);
|
|
int var3 = MathHelper.floor_double(par1Entity.posZ / 16.0D);
|
|
***************
|
|
*** 1522,1539 ****
|
|
{
|
|
this.worldAccesses.add(par1IWorldAccess);
|
|
}
|
|
|
|
/**
|
|
- * Removes a worldAccess from the worldAccesses object
|
|
- */
|
|
- public void removeWorldAccess(IWorldAccess par1IWorldAccess)
|
|
- {
|
|
- this.worldAccesses.remove(par1IWorldAccess);
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a list of bounding boxes that collide with aabb excluding the passed in entity's collision. Args: entity,
|
|
* aabb
|
|
*/
|
|
public List getCollidingBoundingBoxes(Entity par1Entity, AxisAlignedBB par2AxisAlignedBB)
|
|
{
|
|
--- 1384,1393 ----
|
|
***************
|
|
*** 1646,1762 ****
|
|
var3 = 1.0F - var3;
|
|
return (int)(var3 * 11.0F);
|
|
}
|
|
|
|
/**
|
|
- * Returns the sun brightness - checks time of day, rain and thunder
|
|
- */
|
|
- public float getSunBrightness(float par1)
|
|
- {
|
|
- float var2 = this.getCelestialAngle(par1);
|
|
- float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.2F);
|
|
-
|
|
- if (var3 < 0.0F)
|
|
- {
|
|
- var3 = 0.0F;
|
|
- }
|
|
-
|
|
- if (var3 > 1.0F)
|
|
- {
|
|
- var3 = 1.0F;
|
|
- }
|
|
-
|
|
- var3 = 1.0F - var3;
|
|
- var3 = (float)((double)var3 * (1.0D - (double)(this.getRainStrength(par1) * 5.0F) / 16.0D));
|
|
- var3 = (float)((double)var3 * (1.0D - (double)(this.getWeightedThunderStrength(par1) * 5.0F) / 16.0D));
|
|
- return var3 * 0.8F + 0.2F;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Calculates the color for the skybox
|
|
- */
|
|
- public Vec3 getSkyColor(Entity par1Entity, float par2)
|
|
- {
|
|
- float var3 = this.getCelestialAngle(par2);
|
|
- float var4 = MathHelper.cos(var3 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
|
|
-
|
|
- if (var4 < 0.0F)
|
|
- {
|
|
- var4 = 0.0F;
|
|
- }
|
|
-
|
|
- if (var4 > 1.0F)
|
|
- {
|
|
- var4 = 1.0F;
|
|
- }
|
|
-
|
|
- int var5 = MathHelper.floor_double(par1Entity.posX);
|
|
- int var6 = MathHelper.floor_double(par1Entity.posZ);
|
|
- BiomeGenBase var7 = this.getBiomeGenForCoords(var5, var6);
|
|
- float var8 = var7.getFloatTemperature();
|
|
- int var9 = var7.getSkyColorByTemp(var8);
|
|
- float var10 = (float)(var9 >> 16 & 255) / 255.0F;
|
|
- float var11 = (float)(var9 >> 8 & 255) / 255.0F;
|
|
- float var12 = (float)(var9 & 255) / 255.0F;
|
|
- var10 *= var4;
|
|
- var11 *= var4;
|
|
- var12 *= var4;
|
|
- float var13 = this.getRainStrength(par2);
|
|
- float var14;
|
|
- float var15;
|
|
-
|
|
- if (var13 > 0.0F)
|
|
- {
|
|
- var14 = (var10 * 0.3F + var11 * 0.59F + var12 * 0.11F) * 0.6F;
|
|
- var15 = 1.0F - var13 * 0.75F;
|
|
- var10 = var10 * var15 + var14 * (1.0F - var15);
|
|
- var11 = var11 * var15 + var14 * (1.0F - var15);
|
|
- var12 = var12 * var15 + var14 * (1.0F - var15);
|
|
- }
|
|
-
|
|
- var14 = this.getWeightedThunderStrength(par2);
|
|
-
|
|
- if (var14 > 0.0F)
|
|
- {
|
|
- var15 = (var10 * 0.3F + var11 * 0.59F + var12 * 0.11F) * 0.2F;
|
|
- float var16 = 1.0F - var14 * 0.75F;
|
|
- var10 = var10 * var16 + var15 * (1.0F - var16);
|
|
- var11 = var11 * var16 + var15 * (1.0F - var16);
|
|
- var12 = var12 * var16 + var15 * (1.0F - var16);
|
|
- }
|
|
-
|
|
- if (this.lastLightningBolt > 0)
|
|
- {
|
|
- var15 = (float)this.lastLightningBolt - par2;
|
|
-
|
|
- if (var15 > 1.0F)
|
|
- {
|
|
- var15 = 1.0F;
|
|
- }
|
|
-
|
|
- var15 *= 0.45F;
|
|
- var10 = var10 * (1.0F - var15) + 0.8F * var15;
|
|
- var11 = var11 * (1.0F - var15) + 0.8F * var15;
|
|
- var12 = var12 * (1.0F - var15) + 1.0F * var15;
|
|
- }
|
|
-
|
|
- return this.getWorldVec3Pool().getVecFromPool((double)var10, (double)var11, (double)var12);
|
|
- }
|
|
-
|
|
- /**
|
|
* calls calculateCelestialAngle
|
|
*/
|
|
public float getCelestialAngle(float par1)
|
|
{
|
|
return this.provider.calculateCelestialAngle(this.worldInfo.getWorldTime(), par1);
|
|
}
|
|
|
|
- public int getMoonPhase()
|
|
- {
|
|
- return this.provider.getMoonPhase(this.worldInfo.getWorldTime());
|
|
- }
|
|
-
|
|
/**
|
|
* gets the current fullness of the moon expressed as a float between 1.0 and 0.0, in steps of .25
|
|
*/
|
|
public float getCurrentMoonPhaseFactor()
|
|
{
|
|
--- 1500,1516 ----
|
|
***************
|
|
*** 1770,1836 ****
|
|
{
|
|
float var2 = this.getCelestialAngle(par1);
|
|
return var2 * (float)Math.PI * 2.0F;
|
|
}
|
|
|
|
- public Vec3 getCloudColour(float par1)
|
|
- {
|
|
- float var2 = this.getCelestialAngle(par1);
|
|
- float var3 = MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
|
|
-
|
|
- if (var3 < 0.0F)
|
|
- {
|
|
- var3 = 0.0F;
|
|
- }
|
|
-
|
|
- if (var3 > 1.0F)
|
|
- {
|
|
- var3 = 1.0F;
|
|
- }
|
|
-
|
|
- float var4 = (float)(this.cloudColour >> 16 & 255L) / 255.0F;
|
|
- float var5 = (float)(this.cloudColour >> 8 & 255L) / 255.0F;
|
|
- float var6 = (float)(this.cloudColour & 255L) / 255.0F;
|
|
- float var7 = this.getRainStrength(par1);
|
|
- float var8;
|
|
- float var9;
|
|
-
|
|
- if (var7 > 0.0F)
|
|
- {
|
|
- var8 = (var4 * 0.3F + var5 * 0.59F + var6 * 0.11F) * 0.6F;
|
|
- var9 = 1.0F - var7 * 0.95F;
|
|
- var4 = var4 * var9 + var8 * (1.0F - var9);
|
|
- var5 = var5 * var9 + var8 * (1.0F - var9);
|
|
- var6 = var6 * var9 + var8 * (1.0F - var9);
|
|
- }
|
|
-
|
|
- var4 *= var3 * 0.9F + 0.1F;
|
|
- var5 *= var3 * 0.9F + 0.1F;
|
|
- var6 *= var3 * 0.85F + 0.15F;
|
|
- var8 = this.getWeightedThunderStrength(par1);
|
|
-
|
|
- if (var8 > 0.0F)
|
|
- {
|
|
- var9 = (var4 * 0.3F + var5 * 0.59F + var6 * 0.11F) * 0.2F;
|
|
- float var10 = 1.0F - var8 * 0.95F;
|
|
- var4 = var4 * var10 + var9 * (1.0F - var10);
|
|
- var5 = var5 * var10 + var9 * (1.0F - var10);
|
|
- var6 = var6 * var10 + var9 * (1.0F - var10);
|
|
- }
|
|
-
|
|
- return this.getWorldVec3Pool().getVecFromPool((double)var4, (double)var5, (double)var6);
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns vector(ish) with R/G/B for fog
|
|
- */
|
|
- public Vec3 getFogColor(float par1)
|
|
- {
|
|
- float var2 = this.getCelestialAngle(par1);
|
|
- return this.provider.getFogColor(var2, par1);
|
|
- }
|
|
-
|
|
/**
|
|
* Gets the height to which rain/snow will fall. Calculates it if not already stored.
|
|
*/
|
|
public int getPrecipitationHeight(int par1, int par2)
|
|
{
|
|
--- 1524,1533 ----
|
|
***************
|
|
*** 1858,1889 ****
|
|
|
|
return -1;
|
|
}
|
|
|
|
/**
|
|
! * How bright are stars in the sky
|
|
! */
|
|
! public float getStarBrightness(float par1)
|
|
! {
|
|
! float var2 = this.getCelestialAngle(par1);
|
|
! float var3 = 1.0F - (MathHelper.cos(var2 * (float)Math.PI * 2.0F) * 2.0F + 0.25F);
|
|
!
|
|
! if (var3 < 0.0F)
|
|
! {
|
|
! var3 = 0.0F;
|
|
! }
|
|
!
|
|
! if (var3 > 1.0F)
|
|
! {
|
|
! var3 = 1.0F;
|
|
! }
|
|
!
|
|
! return var3 * var3 * 0.5F;
|
|
! }
|
|
!
|
|
! /**
|
|
! * Schedules a tick to a block with a delay (Most commonly the tick rate)
|
|
*/
|
|
public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) {}
|
|
|
|
public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) {}
|
|
|
|
--- 1555,1565 ----
|
|
|
|
return -1;
|
|
}
|
|
|
|
/**
|
|
! * Used to schedule a call to the updateTick method on the specified block.
|
|
*/
|
|
public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5) {}
|
|
|
|
public void scheduleBlockUpdateWithPriority(int par1, int par2, int par3, int par4, int par5, int par6) {}
|
|
|
|
***************
|
|
*** 2537,2547 ****
|
|
{
|
|
double var14 = par2AxisAlignedBB.minX + (par2AxisAlignedBB.maxX - par2AxisAlignedBB.minX) * (double)var11;
|
|
double var16 = par2AxisAlignedBB.minY + (par2AxisAlignedBB.maxY - par2AxisAlignedBB.minY) * (double)var12;
|
|
double var18 = par2AxisAlignedBB.minZ + (par2AxisAlignedBB.maxZ - par2AxisAlignedBB.minZ) * (double)var13;
|
|
|
|
! if (this.clip(this.getWorldVec3Pool().getVecFromPool(var14, var16, var18), par1Vec3) == null)
|
|
{
|
|
++var9;
|
|
}
|
|
|
|
++var10;
|
|
--- 2213,2223 ----
|
|
{
|
|
double var14 = par2AxisAlignedBB.minX + (par2AxisAlignedBB.maxX - par2AxisAlignedBB.minX) * (double)var11;
|
|
double var16 = par2AxisAlignedBB.minY + (par2AxisAlignedBB.maxY - par2AxisAlignedBB.minY) * (double)var12;
|
|
double var18 = par2AxisAlignedBB.minZ + (par2AxisAlignedBB.maxZ - par2AxisAlignedBB.minZ) * (double)var13;
|
|
|
|
! if (this.rayTraceBlocks(this.getWorldVec3Pool().getVecFromPool(var14, var16, var18), par1Vec3) == null)
|
|
{
|
|
++var9;
|
|
}
|
|
|
|
++var10;
|
|
***************
|
|
*** 2599,2624 ****
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * This string is 'All: (number of loaded entities)' Viewable by press ing F3
|
|
- */
|
|
- public String getDebugLoadedEntities()
|
|
- {
|
|
- return "All: " + this.loadedEntityList.size();
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns the name of the current chunk provider, by calling chunkprovider.makeString()
|
|
- */
|
|
- public String getProviderName()
|
|
- {
|
|
- return this.chunkProvider.makeString();
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns the TileEntity associated with a given block in X,Y,Z coordinates, or null if no TileEntity exists
|
|
*/
|
|
public TileEntity getBlockTileEntity(int par1, int par2, int par3)
|
|
{
|
|
if (par2 >= 0 && par2 < 256)
|
|
--- 2275,2284 ----
|
|
***************
|
|
*** 2741,2751 ****
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * adds tile entity to despawn list (renamed from markEntityForDespawn)
|
|
*/
|
|
public void markTileEntityForDespawn(TileEntity par1TileEntity)
|
|
{
|
|
this.entityRemoval.add(par1TileEntity);
|
|
}
|
|
--- 2401,2411 ----
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Adds TileEntity to despawn list
|
|
*/
|
|
public void markTileEntityForDespawn(TileEntity par1TileEntity)
|
|
{
|
|
this.entityRemoval.add(par1TileEntity);
|
|
}
|
|
***************
|
|
*** 2758,2768 ****
|
|
Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)];
|
|
return var4 == null ? false : var4.isOpaqueCube();
|
|
}
|
|
|
|
/**
|
|
! * Indicate if a material is a normal solid opaque cube.
|
|
*/
|
|
public boolean isBlockNormalCube(int par1, int par2, int par3)
|
|
{
|
|
return Block.isNormalCube(this.getBlockId(par1, par2, par3));
|
|
}
|
|
--- 2418,2428 ----
|
|
Block var4 = Block.blocksList[this.getBlockId(par1, par2, par3)];
|
|
return var4 == null ? false : var4.isOpaqueCube();
|
|
}
|
|
|
|
/**
|
|
! * Returns true if the block at the specified coordinates is an opaque cube. Args: x, y, z
|
|
*/
|
|
public boolean isBlockNormalCube(int par1, int par2, int par3)
|
|
{
|
|
return Block.isNormalCube(this.getBlockId(par1, par2, par3));
|
|
}
|
|
***************
|
|
*** 2838,2848 ****
|
|
this.skylightSubtracted = var1;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Set which types of mobs are allowed to spawn (peaceful vs hostile).
|
|
*/
|
|
public void setAllowedSpawnTypes(boolean par1, boolean par2)
|
|
{
|
|
this.spawnHostileMobs = par1;
|
|
this.spawnPeacefulMobs = par2;
|
|
--- 2498,2508 ----
|
|
this.skylightSubtracted = var1;
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * first boolean for hostile mobs and second for peaceful mobs
|
|
*/
|
|
public void setAllowedSpawnTypes(boolean par1, boolean par2)
|
|
{
|
|
this.spawnHostileMobs = par1;
|
|
this.spawnPeacefulMobs = par2;
|
|
***************
|
|
*** 2969,2979 ****
|
|
this.thunderingStrength = 1.0F;
|
|
}
|
|
}
|
|
}
|
|
|
|
! public void toggleRain()
|
|
{
|
|
this.worldInfo.setRainTime(1);
|
|
}
|
|
|
|
protected void setActivePlayerChunksAndCheckLight()
|
|
--- 2629,2642 ----
|
|
this.thunderingStrength = 1.0F;
|
|
}
|
|
}
|
|
}
|
|
|
|
! /**
|
|
! * start precipitation in this world (2 ticks after command posted)
|
|
! */
|
|
! public void commandToggleDownfall()
|
|
{
|
|
this.worldInfo.setRainTime(1);
|
|
}
|
|
|
|
protected void setActivePlayerChunksAndCheckLight()
|
|
***************
|
|
*** 3466,3483 ****
|
|
* Returns the Entity with the given ID, or null if it doesn't exist in this World.
|
|
*/
|
|
public abstract Entity getEntityByID(int var1);
|
|
|
|
/**
|
|
- * Accessor for world Loaded Entity List
|
|
- */
|
|
- public List getLoadedEntityList()
|
|
- {
|
|
- return this.loadedEntityList;
|
|
- }
|
|
-
|
|
- /**
|
|
* Args: X, Y, Z, tile entity Marks the chunk the tile entity is in as modified. This is essential as chunks that
|
|
* are not marked as modified may be rolled back when exiting the game.
|
|
*/
|
|
public void markTileEntityChunkModified(int par1, int par2, int par3, TileEntity par4TileEntity)
|
|
{
|
|
--- 3129,3138 ----
|
|
***************
|
|
*** 3519,3529 ****
|
|
this.onEntityAdded((Entity)par1List.get(var2));
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Adds a list of entities to be unloaded on the next pass of World.updateEntities()
|
|
*/
|
|
public void unloadEntities(List par1List)
|
|
{
|
|
this.unloadedEntityList.addAll(par1List);
|
|
}
|
|
--- 3174,3184 ----
|
|
this.onEntityAdded((Entity)par1List.get(var2));
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * adds entities to the list of unloaded entities
|
|
*/
|
|
public void unloadEntities(List par1List)
|
|
{
|
|
this.unloadedEntityList.addAll(par1List);
|
|
}
|
|
***************
|
|
*** 3817,3845 ****
|
|
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
- * If on MP, sends a quitting packet.
|
|
- */
|
|
- public void sendQuittingDisconnectingPacket() {}
|
|
-
|
|
- /**
|
|
* Checks whether the session lock file was modified by another process
|
|
*/
|
|
public void checkSessionLock() throws MinecraftException
|
|
{
|
|
this.saveHandler.checkSessionLock();
|
|
}
|
|
|
|
- public void func_82738_a(long par1)
|
|
- {
|
|
- this.worldInfo.incrementTotalWorldTime(par1);
|
|
- }
|
|
-
|
|
/**
|
|
! * Retrieve the world seed from level.dat
|
|
*/
|
|
public long getSeed()
|
|
{
|
|
return this.worldInfo.getSeed();
|
|
}
|
|
--- 3472,3490 ----
|
|
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* Checks whether the session lock file was modified by another process
|
|
*/
|
|
public void checkSessionLock() throws MinecraftException
|
|
{
|
|
this.saveHandler.checkSessionLock();
|
|
}
|
|
|
|
/**
|
|
! * gets the random world seed
|
|
*/
|
|
public long getSeed()
|
|
{
|
|
return this.worldInfo.getSeed();
|
|
}
|
|
***************
|
|
*** 3868,3905 ****
|
|
public ChunkCoordinates getSpawnPoint()
|
|
{
|
|
return new ChunkCoordinates(this.worldInfo.getSpawnX(), this.worldInfo.getSpawnY(), this.worldInfo.getSpawnZ());
|
|
}
|
|
|
|
- public void setSpawnLocation(int par1, int par2, int par3)
|
|
- {
|
|
- this.worldInfo.setSpawnPosition(par1, par2, par3);
|
|
- }
|
|
-
|
|
- /**
|
|
- * spwans an entity and loads surrounding chunks
|
|
- */
|
|
- public void joinEntityInSurroundings(Entity par1Entity)
|
|
- {
|
|
- int var2 = MathHelper.floor_double(par1Entity.posX / 16.0D);
|
|
- int var3 = MathHelper.floor_double(par1Entity.posZ / 16.0D);
|
|
- byte var4 = 2;
|
|
-
|
|
- for (int var5 = var2 - var4; var5 <= var2 + var4; ++var5)
|
|
- {
|
|
- for (int var6 = var3 - var4; var6 <= var3 + var4; ++var6)
|
|
- {
|
|
- this.getChunkFromChunkCoords(var5, var6);
|
|
- }
|
|
- }
|
|
-
|
|
- if (!this.loadedEntityList.contains(par1Entity))
|
|
- {
|
|
- this.loadedEntityList.add(par1Entity);
|
|
- }
|
|
- }
|
|
-
|
|
/**
|
|
* Called when checking if a certain block can be mined or not. The 'spawn safe zone' check is located here.
|
|
*/
|
|
public boolean canMineBlock(EntityPlayer par1EntityPlayer, int par2, int par3, int par4)
|
|
{
|
|
--- 3513,3522 ----
|
|
***************
|
|
*** 3910,3920 ****
|
|
* sends a Packet 38 (Entity Status) to all tracked players of that entity
|
|
*/
|
|
public void setEntityState(Entity par1Entity, byte par2) {}
|
|
|
|
/**
|
|
! * gets the IChunkProvider this world uses.
|
|
*/
|
|
public IChunkProvider getChunkProvider()
|
|
{
|
|
return this.chunkProvider;
|
|
}
|
|
--- 3527,3537 ----
|
|
* sends a Packet 38 (Entity Status) to all tracked players of that entity
|
|
*/
|
|
public void setEntityState(Entity par1Entity, byte par2) {}
|
|
|
|
/**
|
|
! * gets the world's chunk provider
|
|
*/
|
|
public IChunkProvider getChunkProvider()
|
|
{
|
|
return this.chunkProvider;
|
|
}
|
|
***************
|
|
*** 3938,3948 ****
|
|
{
|
|
return this.saveHandler;
|
|
}
|
|
|
|
/**
|
|
! * Gets the World's WorldInfo instance
|
|
*/
|
|
public WorldInfo getWorldInfo()
|
|
{
|
|
return this.worldInfo;
|
|
}
|
|
--- 3555,3565 ----
|
|
{
|
|
return this.saveHandler;
|
|
}
|
|
|
|
/**
|
|
! * Returns the world's WorldInfo object
|
|
*/
|
|
public WorldInfo getWorldInfo()
|
|
{
|
|
return this.worldInfo;
|
|
}
|
|
***************
|
|
*** 3971,3986 ****
|
|
public float getRainStrength(float par1)
|
|
{
|
|
return this.prevRainingStrength + (this.rainingStrength - this.prevRainingStrength) * par1;
|
|
}
|
|
|
|
- public void setRainStrength(float par1)
|
|
- {
|
|
- this.prevRainingStrength = par1;
|
|
- this.rainingStrength = par1;
|
|
- }
|
|
-
|
|
/**
|
|
* Returns true if the current thunder strength (weighted with the rain strength) is greater than 0.9
|
|
*/
|
|
public boolean isThundering()
|
|
{
|
|
--- 3588,3597 ----
|
|
***************
|
|
*** 4059,4069 ****
|
|
((IWorldAccess)this.worldAccesses.get(var6)).broadcastSound(par1, par2, par3, par4, par5);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * See description for playAuxSFX.
|
|
*/
|
|
public void playAuxSFX(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
this.playAuxSFXAtEntity((EntityPlayer)null, par1, par2, par3, par4, par5);
|
|
}
|
|
--- 3670,3681 ----
|
|
((IWorldAccess)this.worldAccesses.get(var6)).broadcastSound(par1, par2, par3, par4, par5);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Plays a sound or particle effect. Parameters: Effect ID, X, Y, Z, Data. For a list of ids and data, see
|
|
! * http://wiki.vg/Protocol#Effects
|
|
*/
|
|
public void playAuxSFX(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
this.playAuxSFXAtEntity((EntityPlayer)null, par1, par2, par3, par4, par5);
|
|
}
|
|
***************
|
|
*** 4091,4101 ****
|
|
throw new ReportedException(var8);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Returns current world height.
|
|
*/
|
|
public int getHeight()
|
|
{
|
|
return 256;
|
|
}
|
|
--- 3703,3713 ----
|
|
throw new ReportedException(var8);
|
|
}
|
|
}
|
|
|
|
/**
|
|
! * Returns maximum world height.
|
|
*/
|
|
public int getHeight()
|
|
{
|
|
return 256;
|
|
}
|
|
***************
|
|
*** 4130,4155 ****
|
|
{
|
|
return this.getChunkProvider().findClosestStructure(this, par1Str, par2, par3, par4);
|
|
}
|
|
|
|
/**
|
|
- * set by !chunk.getAreLevelsEmpty
|
|
- */
|
|
- public boolean extendedLevelsInChunkCache()
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns horizon height for use in rendering the sky.
|
|
- */
|
|
- public double getHorizon()
|
|
- {
|
|
- return this.worldInfo.getTerrainType() == WorldType.FLAT ? 0.0D : 63.0D;
|
|
- }
|
|
-
|
|
- /**
|
|
* Adds some basic stats of the world to the given crash report.
|
|
*/
|
|
public CrashReportCategory addWorldInfoToCrashReport(CrashReport par1CrashReport)
|
|
{
|
|
CrashReportCategory var2 = par1CrashReport.makeCategoryDepth("Affected level", 1);
|
|
--- 3742,3751 ----
|
|
***************
|
|
*** 4195,4211 ****
|
|
*/
|
|
public Calendar getCurrentDate()
|
|
{
|
|
if (this.getTotalWorldTime() % 600L == 0L)
|
|
{
|
|
! this.theCalendar.setTimeInMillis(MinecraftServer.getSystemTimeMillis());
|
|
}
|
|
|
|
return this.theCalendar;
|
|
}
|
|
-
|
|
- public void func_92088_a(double par1, double par3, double par5, double par7, double par9, double par11, NBTTagCompound par13NBTTagCompound) {}
|
|
|
|
public Scoreboard getScoreboard()
|
|
{
|
|
return this.worldScoreboard;
|
|
}
|
|
--- 3791,3805 ----
|
|
*/
|
|
public Calendar getCurrentDate()
|
|
{
|
|
if (this.getTotalWorldTime() % 600L == 0L)
|
|
{
|
|
! this.theCalendar.setTimeInMillis(MinecraftServer.getCurrentTimeMillis());
|
|
}
|
|
|
|
return this.theCalendar;
|
|
}
|
|
|
|
public Scoreboard getScoreboard()
|
|
{
|
|
return this.worldScoreboard;
|
|
}
|
|
*** WorldChunkManager.java Sat Feb 5 04:19:45 2022
|
|
--- WorldChunkManager.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 9,19 ****
|
|
private GenLayer genBiomes;
|
|
|
|
/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
|
|
private GenLayer biomeIndexLayer;
|
|
|
|
! /** The BiomeCache object for this world. */
|
|
private BiomeCache biomeCache;
|
|
|
|
/** A list of biomes that the player can spawn in. */
|
|
private List biomesToSpawnIn;
|
|
|
|
--- 9,19 ----
|
|
private GenLayer genBiomes;
|
|
|
|
/** A GenLayer containing the indices into BiomeGenBase.biomeList[] */
|
|
private GenLayer biomeIndexLayer;
|
|
|
|
! /** The biome list. */
|
|
private BiomeCache biomeCache;
|
|
|
|
/** A list of biomes that the player can spawn in. */
|
|
private List biomesToSpawnIn;
|
|
|
|
***************
|
|
*** 87,104 ****
|
|
|
|
return par1ArrayOfFloat;
|
|
}
|
|
|
|
/**
|
|
- * Return an adjusted version of a given temperature based on the y height
|
|
- */
|
|
- public float getTemperatureAtHeight(float par1, int par2)
|
|
- {
|
|
- return par1;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, y, width, length
|
|
*/
|
|
public float[] getTemperatures(float[] par1ArrayOfFloat, int par2, int par3, int par4, int par5)
|
|
{
|
|
IntCache.resetIntCache();
|
|
--- 87,96 ----
|
|
***************
|
|
*** 214,225 ****
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks.
|
|
! * Strongly favors positive y positions.
|
|
*/
|
|
public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)
|
|
{
|
|
IntCache.resetIntCache();
|
|
int var6 = par1 - par3 >> 2;
|
|
--- 206,216 ----
|
|
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
! * Finds a valid position within a range, that is once of the listed biomes.
|
|
*/
|
|
public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)
|
|
{
|
|
IntCache.resetIntCache();
|
|
int var6 = par1 - par3 >> 2;
|
|
*** WorldChunkManagerHell.java Sat Feb 5 04:19:45 2022
|
|
--- WorldChunkManagerHell.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 4,33 ****
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class WorldChunkManagerHell extends WorldChunkManager
|
|
{
|
|
! /** this is the sole biome to utilize for this world */
|
|
! private BiomeGenBase biomeToUse;
|
|
private float hellTemperature;
|
|
|
|
/** The rainfall in the world */
|
|
private float rainfall;
|
|
|
|
public WorldChunkManagerHell(BiomeGenBase par1BiomeGenBase, float par2, float par3)
|
|
{
|
|
! this.biomeToUse = par1BiomeGenBase;
|
|
this.hellTemperature = par2;
|
|
this.rainfall = par3;
|
|
}
|
|
|
|
/**
|
|
* Returns the BiomeGenBase related to the x, z position on the world.
|
|
*/
|
|
public BiomeGenBase getBiomeGenAt(int par1, int par2)
|
|
{
|
|
! return this.biomeToUse;
|
|
}
|
|
|
|
/**
|
|
* Returns an array of biomes for the location input.
|
|
*/
|
|
--- 4,33 ----
|
|
import java.util.List;
|
|
import java.util.Random;
|
|
|
|
public class WorldChunkManagerHell extends WorldChunkManager
|
|
{
|
|
! /** The biome generator object. */
|
|
! private BiomeGenBase biomeGenerator;
|
|
private float hellTemperature;
|
|
|
|
/** The rainfall in the world */
|
|
private float rainfall;
|
|
|
|
public WorldChunkManagerHell(BiomeGenBase par1BiomeGenBase, float par2, float par3)
|
|
{
|
|
! this.biomeGenerator = par1BiomeGenBase;
|
|
this.hellTemperature = par2;
|
|
this.rainfall = par3;
|
|
}
|
|
|
|
/**
|
|
* Returns the BiomeGenBase related to the x, z position on the world.
|
|
*/
|
|
public BiomeGenBase getBiomeGenAt(int par1, int par2)
|
|
{
|
|
! return this.biomeGenerator;
|
|
}
|
|
|
|
/**
|
|
* Returns an array of biomes for the location input.
|
|
*/
|
|
***************
|
|
*** 36,46 ****
|
|
if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
|
|
{
|
|
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
|
|
}
|
|
|
|
! Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeToUse);
|
|
return par1ArrayOfBiomeGenBase;
|
|
}
|
|
|
|
/**
|
|
* Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, y, width, length
|
|
--- 36,46 ----
|
|
if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
|
|
{
|
|
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
|
|
}
|
|
|
|
! Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeGenerator);
|
|
return par1ArrayOfBiomeGenBase;
|
|
}
|
|
|
|
/**
|
|
* Returns a list of temperatures to use for the specified blocks. Args: listToReuse, x, y, width, length
|
|
***************
|
|
*** 79,89 ****
|
|
if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
|
|
{
|
|
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
|
|
}
|
|
|
|
! Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeToUse);
|
|
return par1ArrayOfBiomeGenBase;
|
|
}
|
|
|
|
/**
|
|
* Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
|
|
--- 79,89 ----
|
|
if (par1ArrayOfBiomeGenBase == null || par1ArrayOfBiomeGenBase.length < par4 * par5)
|
|
{
|
|
par1ArrayOfBiomeGenBase = new BiomeGenBase[par4 * par5];
|
|
}
|
|
|
|
! Arrays.fill(par1ArrayOfBiomeGenBase, 0, par4 * par5, this.biomeGenerator);
|
|
return par1ArrayOfBiomeGenBase;
|
|
}
|
|
|
|
/**
|
|
* Return a list of biomes for the specified blocks. Args: listToReuse, x, y, width, length, cacheFlag (if false,
|
|
***************
|
|
*** 93,113 ****
|
|
{
|
|
return this.loadBlockGeneratorData(par1ArrayOfBiomeGenBase, par2, par3, par4, par5);
|
|
}
|
|
|
|
/**
|
|
! * Finds a valid position within a range, that is in one of the listed biomes. Searches {par1,par2} +-par3 blocks.
|
|
! * Strongly favors positive y positions.
|
|
*/
|
|
public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)
|
|
{
|
|
! return par4List.contains(this.biomeToUse) ? new ChunkPosition(par1 - par3 + par5Random.nextInt(par3 * 2 + 1), 0, par2 - par3 + par5Random.nextInt(par3 * 2 + 1)) : null;
|
|
}
|
|
|
|
/**
|
|
* checks given Chunk's Biomes against List of allowed ones
|
|
*/
|
|
public boolean areBiomesViable(int par1, int par2, int par3, List par4List)
|
|
{
|
|
! return par4List.contains(this.biomeToUse);
|
|
}
|
|
}
|
|
--- 93,112 ----
|
|
{
|
|
return this.loadBlockGeneratorData(par1ArrayOfBiomeGenBase, par2, par3, par4, par5);
|
|
}
|
|
|
|
/**
|
|
! * Finds a valid position within a range, that is once of the listed biomes.
|
|
*/
|
|
public ChunkPosition findBiomePosition(int par1, int par2, int par3, List par4List, Random par5Random)
|
|
{
|
|
! return par4List.contains(this.biomeGenerator) ? new ChunkPosition(par1 - par3 + par5Random.nextInt(par3 * 2 + 1), 0, par2 - par3 + par5Random.nextInt(par3 * 2 + 1)) : null;
|
|
}
|
|
|
|
/**
|
|
* checks given Chunk's Biomes against List of allowed ones
|
|
*/
|
|
public boolean areBiomesViable(int par1, int par2, int par3, List par4List)
|
|
{
|
|
! return par4List.contains(this.biomeGenerator);
|
|
}
|
|
}
|
|
*** WorldGenDungeons.java Sat Feb 5 04:19:45 2022
|
|
--- WorldGenDungeons.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 81,91 ****
|
|
|
|
while (true)
|
|
{
|
|
if (var11 < 3)
|
|
{
|
|
! label101:
|
|
{
|
|
var12 = par3 + par2Random.nextInt(var7 * 2 + 1) - var7;
|
|
int var14 = par5 + par2Random.nextInt(var8 * 2 + 1) - var8;
|
|
|
|
if (par1World.isAirBlock(var12, par4, var14))
|
|
--- 81,91 ----
|
|
|
|
while (true)
|
|
{
|
|
if (var11 < 3)
|
|
{
|
|
! label197:
|
|
{
|
|
var12 = par3 + par2Random.nextInt(var7 * 2 + 1) - var7;
|
|
int var14 = par5 + par2Random.nextInt(var8 * 2 + 1) - var8;
|
|
|
|
if (par1World.isAirBlock(var12, par4, var14))
|
|
***************
|
|
*** 121,131 ****
|
|
if (var17 != null)
|
|
{
|
|
WeightedRandomChestContent.generateChestContents(par2Random, var16, var17, 8);
|
|
}
|
|
|
|
! break label101;
|
|
}
|
|
}
|
|
|
|
++var11;
|
|
continue;
|
|
--- 121,131 ----
|
|
if (var17 != null)
|
|
{
|
|
WeightedRandomChestContent.generateChestContents(par2Random, var16, var17, 8);
|
|
}
|
|
|
|
! break label197;
|
|
}
|
|
}
|
|
|
|
++var11;
|
|
continue;
|
|
*** WorldInfo.java Sat Feb 5 04:19:45 2022
|
|
--- WorldInfo.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 249,259 ****
|
|
par1NBTTagCompound.setInteger("SpawnY", this.spawnY);
|
|
par1NBTTagCompound.setInteger("SpawnZ", this.spawnZ);
|
|
par1NBTTagCompound.setLong("Time", this.totalTime);
|
|
par1NBTTagCompound.setLong("DayTime", this.worldTime);
|
|
par1NBTTagCompound.setLong("SizeOnDisk", this.sizeOnDisk);
|
|
! par1NBTTagCompound.setLong("LastPlayed", MinecraftServer.getSystemTimeMillis());
|
|
par1NBTTagCompound.setString("LevelName", this.levelName);
|
|
par1NBTTagCompound.setInteger("version", this.saveVersion);
|
|
par1NBTTagCompound.setInteger("rainTime", this.rainTime);
|
|
par1NBTTagCompound.setBoolean("raining", this.raining);
|
|
par1NBTTagCompound.setInteger("thunderTime", this.thunderTime);
|
|
--- 249,259 ----
|
|
par1NBTTagCompound.setInteger("SpawnY", this.spawnY);
|
|
par1NBTTagCompound.setInteger("SpawnZ", this.spawnZ);
|
|
par1NBTTagCompound.setLong("Time", this.totalTime);
|
|
par1NBTTagCompound.setLong("DayTime", this.worldTime);
|
|
par1NBTTagCompound.setLong("SizeOnDisk", this.sizeOnDisk);
|
|
! par1NBTTagCompound.setLong("LastPlayed", MinecraftServer.getCurrentTimeMillis());
|
|
par1NBTTagCompound.setString("LevelName", this.levelName);
|
|
par1NBTTagCompound.setInteger("version", this.saveVersion);
|
|
par1NBTTagCompound.setInteger("rainTime", this.rainTime);
|
|
par1NBTTagCompound.setBoolean("raining", this.raining);
|
|
par1NBTTagCompound.setInteger("thunderTime", this.thunderTime);
|
|
***************
|
|
*** 312,367 ****
|
|
public long getWorldTime()
|
|
{
|
|
return this.worldTime;
|
|
}
|
|
|
|
- public long getSizeOnDisk()
|
|
- {
|
|
- return this.sizeOnDisk;
|
|
- }
|
|
-
|
|
/**
|
|
* Returns the player's NBTTagCompound to be loaded
|
|
*/
|
|
public NBTTagCompound getPlayerNBTTagCompound()
|
|
{
|
|
return this.playerTag;
|
|
}
|
|
|
|
! /**
|
|
! * Returns vanilla MC dimension (-1,0,1). For custom dimension compatibility, always prefer
|
|
! * WorldProvider.dimensionID accessed from World.provider.dimensionID
|
|
! */
|
|
! public int getVanillaDimension()
|
|
{
|
|
return this.dimension;
|
|
}
|
|
|
|
- /**
|
|
- * Set the x spawn position to the passed in value
|
|
- */
|
|
- public void setSpawnX(int par1)
|
|
- {
|
|
- this.spawnX = par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Sets the y spawn position
|
|
- */
|
|
- public void setSpawnY(int par1)
|
|
- {
|
|
- this.spawnY = par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Set the z spawn position to the passed in value
|
|
- */
|
|
- public void setSpawnZ(int par1)
|
|
- {
|
|
- this.spawnZ = par1;
|
|
- }
|
|
-
|
|
public void incrementTotalWorldTime(long par1)
|
|
{
|
|
this.totalTime = par1;
|
|
}
|
|
|
|
--- 312,334 ----
|
|
public long getWorldTime()
|
|
{
|
|
return this.worldTime;
|
|
}
|
|
|
|
/**
|
|
* Returns the player's NBTTagCompound to be loaded
|
|
*/
|
|
public NBTTagCompound getPlayerNBTTagCompound()
|
|
{
|
|
return this.playerTag;
|
|
}
|
|
|
|
! public int getDimension()
|
|
{
|
|
return this.dimension;
|
|
}
|
|
|
|
public void incrementTotalWorldTime(long par1)
|
|
{
|
|
this.totalTime = par1;
|
|
}
|
|
|
|
***************
|
|
*** 408,425 ****
|
|
* Sets the save version of the world
|
|
*/
|
|
public void setSaveVersion(int par1)
|
|
{
|
|
this.saveVersion = par1;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return the last time the player was in this world.
|
|
- */
|
|
- public long getLastTimePlayed()
|
|
- {
|
|
- return this.lastTimePlayed;
|
|
}
|
|
|
|
/**
|
|
* Returns true if it is thundering, false otherwise.
|
|
*/
|
|
--- 375,384 ----
|
|
*** WorldManager.java Sat Feb 5 04:19:45 2022
|
|
--- WorldManager.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 26,53 ****
|
|
* Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any
|
|
* necessary textures. On server worlds, adds the entity to the entity tracker.
|
|
*/
|
|
public void onEntityCreate(Entity par1Entity)
|
|
{
|
|
! this.theWorldServer.getEntityTracker().addEntityToTracker(par1Entity);
|
|
}
|
|
|
|
/**
|
|
* Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded
|
|
* textures. On server worlds, removes the entity from the entity tracker.
|
|
*/
|
|
public void onEntityDestroy(Entity par1Entity)
|
|
{
|
|
! this.theWorldServer.getEntityTracker().removeEntityFromAllTrackingPlayers(par1Entity);
|
|
}
|
|
|
|
/**
|
|
* Plays the specified sound. Arg: soundName, x, y, z, volume, pitch
|
|
*/
|
|
public void playSound(String par1Str, double par2, double par4, double par6, float par8, float par9)
|
|
{
|
|
! this.mcServer.getConfigurationManager().sendToAllNear(par2, par4, par6, par8 > 1.0F ? (double)(16.0F * par8) : 16.0D, this.theWorldServer.provider.dimensionId, new Packet62LevelSound(par1Str, par2, par4, par6, par8, par9));
|
|
}
|
|
|
|
/**
|
|
* Plays sound to all near players except the player reference given
|
|
*/
|
|
--- 26,53 ----
|
|
* Called on all IWorldAccesses when an entity is created or loaded. On client worlds, starts downloading any
|
|
* necessary textures. On server worlds, adds the entity to the entity tracker.
|
|
*/
|
|
public void onEntityCreate(Entity par1Entity)
|
|
{
|
|
! this.theWorldServer.getEntityTracker().trackEntity(par1Entity);
|
|
}
|
|
|
|
/**
|
|
* Called on all IWorldAccesses when an entity is unloaded or destroyed. On client worlds, releases any downloaded
|
|
* textures. On server worlds, removes the entity from the entity tracker.
|
|
*/
|
|
public void onEntityDestroy(Entity par1Entity)
|
|
{
|
|
! this.theWorldServer.getEntityTracker().untrackEntity(par1Entity);
|
|
}
|
|
|
|
/**
|
|
* Plays the specified sound. Arg: soundName, x, y, z, volume, pitch
|
|
*/
|
|
public void playSound(String par1Str, double par2, double par4, double par6, float par8, float par9)
|
|
{
|
|
! this.mcServer.getConfigurationManager().sendPacketToPlayersAroundPoint(par2, par4, par6, par8 > 1.0F ? (double)(16.0F * par8) : 16.0D, this.theWorldServer.provider.dimensionId, new Packet62LevelSound(par1Str, par2, par4, par6, par8, par9));
|
|
}
|
|
|
|
/**
|
|
* Plays sound to all near players except the player reference given
|
|
*/
|
|
***************
|
|
*** 112,122 ****
|
|
double var10 = (double)par3 - var7.posY;
|
|
double var12 = (double)par4 - var7.posZ;
|
|
|
|
if (var8 * var8 + var10 * var10 + var12 * var12 < 1024.0D)
|
|
{
|
|
! var7.playerNetServerHandler.sendPacketToPlayer(new Packet55BlockDestroy(par1, par2, par3, par4, par5));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
--- 112,122 ----
|
|
double var10 = (double)par3 - var7.posY;
|
|
double var12 = (double)par4 - var7.posZ;
|
|
|
|
if (var8 * var8 + var10 * var10 + var12 * var12 < 1024.0D)
|
|
{
|
|
! var7.playerNetServerHandler.sendPacket(new Packet55BlockDestroy(par1, par2, par3, par4, par5));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
*** WorldProvider.java Sat Feb 5 04:19:45 2022
|
|
--- WorldProvider.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 126,187 ****
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
- * Returns array with sunrise/sunset colors
|
|
- */
|
|
- public float[] calcSunriseSunsetColors(float par1, float par2)
|
|
- {
|
|
- float var3 = 0.4F;
|
|
- float var4 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) - 0.0F;
|
|
- float var5 = -0.0F;
|
|
-
|
|
- if (var4 >= var5 - var3 && var4 <= var5 + var3)
|
|
- {
|
|
- float var6 = (var4 - var5) / var3 * 0.5F + 0.5F;
|
|
- float var7 = 1.0F - (1.0F - MathHelper.sin(var6 * (float)Math.PI)) * 0.99F;
|
|
- var7 *= var7;
|
|
- this.colorsSunriseSunset[0] = var6 * 0.3F + 0.7F;
|
|
- this.colorsSunriseSunset[1] = var6 * var6 * 0.7F + 0.2F;
|
|
- this.colorsSunriseSunset[2] = var6 * var6 * 0.0F + 0.2F;
|
|
- this.colorsSunriseSunset[3] = var7;
|
|
- return this.colorsSunriseSunset;
|
|
- }
|
|
- else
|
|
- {
|
|
- return null;
|
|
- }
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return Vec3D with biome specific fog color
|
|
- */
|
|
- public Vec3 getFogColor(float par1, float par2)
|
|
- {
|
|
- float var3 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
|
|
-
|
|
- if (var3 < 0.0F)
|
|
- {
|
|
- var3 = 0.0F;
|
|
- }
|
|
-
|
|
- if (var3 > 1.0F)
|
|
- {
|
|
- var3 = 1.0F;
|
|
- }
|
|
-
|
|
- float var4 = 0.7529412F;
|
|
- float var5 = 0.84705883F;
|
|
- float var6 = 1.0F;
|
|
- var4 *= var3 * 0.94F + 0.06F;
|
|
- var5 *= var3 * 0.94F + 0.06F;
|
|
- var6 *= var3 * 0.91F + 0.09F;
|
|
- return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var4, (double)var5, (double)var6);
|
|
- }
|
|
-
|
|
- /**
|
|
* True if the player can respawn in this dimension (true = overworld, false = nether).
|
|
*/
|
|
public boolean canRespawnHere()
|
|
{
|
|
return true;
|
|
--- 126,135 ----
|
|
***************
|
|
*** 191,250 ****
|
|
{
|
|
return (WorldProvider)(par0 == -1 ? new WorldProviderHell() : (par0 == 0 ? new WorldProviderSurface() : (par0 == 1 ? new WorldProviderEnd() : null)));
|
|
}
|
|
|
|
/**
|
|
- * the y level at which clouds are rendered.
|
|
- */
|
|
- public float getCloudHeight()
|
|
- {
|
|
- return 128.0F;
|
|
- }
|
|
-
|
|
- public boolean isSkyColored()
|
|
- {
|
|
- return true;
|
|
- }
|
|
-
|
|
- /**
|
|
* Gets the hard-coded portal location to use when entering this dimension.
|
|
*/
|
|
public ChunkCoordinates getEntrancePortalLocation()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public int getAverageGroundLevel()
|
|
{
|
|
return this.terrainType == WorldType.FLAT ? 4 : 64;
|
|
- }
|
|
-
|
|
- /**
|
|
- * returns true if this dimension is supposed to display void particles and pull in the far plane based on the
|
|
- * user's Y offset.
|
|
- */
|
|
- public boolean getWorldHasVoidParticles()
|
|
- {
|
|
- return this.terrainType != WorldType.FLAT && !this.hasNoSky;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns a double value representing the Y value relative to the top of the map at which void fog is at its
|
|
- * maximum. The default factor of 0.03125 relative to 256, for example, means the void fog will be at its maximum at
|
|
- * (256*0.03125), or 8.
|
|
- */
|
|
- public double getVoidFogYFactor()
|
|
- {
|
|
- return this.terrainType == WorldType.FLAT ? 1.0D : 0.03125D;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given X,Z coordinate should show environmental fog.
|
|
- */
|
|
- public boolean doesXZShowFog(int par1, int par2)
|
|
- {
|
|
- return false;
|
|
}
|
|
|
|
/**
|
|
* Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
|
|
*/
|
|
--- 139,158 ----
|
|
*** WorldProviderEnd.java Sat Feb 5 04:19:45 2022
|
|
--- WorldProviderEnd.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 27,76 ****
|
|
{
|
|
return 0.0F;
|
|
}
|
|
|
|
/**
|
|
- * Returns array with sunrise/sunset colors
|
|
- */
|
|
- public float[] calcSunriseSunsetColors(float par1, float par2)
|
|
- {
|
|
- return null;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Return Vec3D with biome specific fog color
|
|
- */
|
|
- public Vec3 getFogColor(float par1, float par2)
|
|
- {
|
|
- int var3 = 10518688;
|
|
- float var4 = MathHelper.cos(par1 * (float)Math.PI * 2.0F) * 2.0F + 0.5F;
|
|
-
|
|
- if (var4 < 0.0F)
|
|
- {
|
|
- var4 = 0.0F;
|
|
- }
|
|
-
|
|
- if (var4 > 1.0F)
|
|
- {
|
|
- var4 = 1.0F;
|
|
- }
|
|
-
|
|
- float var5 = (float)(var3 >> 16 & 255) / 255.0F;
|
|
- float var6 = (float)(var3 >> 8 & 255) / 255.0F;
|
|
- float var7 = (float)(var3 & 255) / 255.0F;
|
|
- var5 *= var4 * 0.0F + 0.15F;
|
|
- var6 *= var4 * 0.0F + 0.15F;
|
|
- var7 *= var4 * 0.0F + 0.15F;
|
|
- return this.worldObj.getWorldVec3Pool().getVecFromPool((double)var5, (double)var6, (double)var7);
|
|
- }
|
|
-
|
|
- public boolean isSkyColored()
|
|
- {
|
|
- return false;
|
|
- }
|
|
-
|
|
- /**
|
|
* True if the player can respawn in this dimension (true = overworld, false = nether).
|
|
*/
|
|
public boolean canRespawnHere()
|
|
{
|
|
return false;
|
|
--- 27,36 ----
|
|
***************
|
|
*** 83,100 ****
|
|
{
|
|
return false;
|
|
}
|
|
|
|
/**
|
|
- * the y level at which clouds are rendered.
|
|
- */
|
|
- public float getCloudHeight()
|
|
- {
|
|
- return 8.0F;
|
|
- }
|
|
-
|
|
- /**
|
|
* Will check if the x, z position specified is alright to be set as the map spawn point
|
|
*/
|
|
public boolean canCoordinateBeSpawn(int par1, int par2)
|
|
{
|
|
int var3 = this.worldObj.getFirstUncoveredBlock(par1, par2);
|
|
--- 43,52 ----
|
|
***************
|
|
*** 110,127 ****
|
|
}
|
|
|
|
public int getAverageGroundLevel()
|
|
{
|
|
return 50;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given X,Z coordinate should show environmental fog.
|
|
- */
|
|
- public boolean doesXZShowFog(int par1, int par2)
|
|
- {
|
|
- return true;
|
|
}
|
|
|
|
/**
|
|
* Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
|
|
*/
|
|
--- 62,71 ----
|
|
*** WorldProviderHell.java Sat Feb 5 04:19:45 2022
|
|
--- WorldProviderHell.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 12,29 ****
|
|
this.hasNoSky = true;
|
|
this.dimensionId = -1;
|
|
}
|
|
|
|
/**
|
|
- * Return Vec3D with biome specific fog color
|
|
- */
|
|
- public Vec3 getFogColor(float par1, float par2)
|
|
- {
|
|
- return this.worldObj.getWorldVec3Pool().getVecFromPool(0.20000000298023224D, 0.029999999329447746D, 0.029999999329447746D);
|
|
- }
|
|
-
|
|
- /**
|
|
* Creates the light to brightness table
|
|
*/
|
|
protected void generateLightBrightnessTable()
|
|
{
|
|
float var1 = 0.1F;
|
|
--- 12,21 ----
|
|
***************
|
|
*** 71,88 ****
|
|
* True if the player can respawn in this dimension (true = overworld, false = nether).
|
|
*/
|
|
public boolean canRespawnHere()
|
|
{
|
|
return false;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Returns true if the given X,Z coordinate should show environmental fog.
|
|
- */
|
|
- public boolean doesXZShowFog(int par1, int par2)
|
|
- {
|
|
- return true;
|
|
}
|
|
|
|
/**
|
|
* Returns the dimension's name, e.g. "The End", "Nether", or "Overworld".
|
|
*/
|
|
--- 63,72 ----
|
|
*** WorldServer.java Sat Feb 5 04:19:45 2022
|
|
--- WorldServer.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 18,29 ****
|
|
|
|
/** All work to do in future ticks. */
|
|
private TreeSet pendingTickListEntriesTreeSet;
|
|
public ChunkProviderServer theChunkProviderServer;
|
|
|
|
! /** set by CommandServerSave{all,Off,On} */
|
|
! public boolean canNotSave;
|
|
|
|
/** is false if there are no players */
|
|
private boolean allPlayersSleeping;
|
|
private int updateEntityTick;
|
|
|
|
--- 18,29 ----
|
|
|
|
/** All work to do in future ticks. */
|
|
private TreeSet pendingTickListEntriesTreeSet;
|
|
public ChunkProviderServer theChunkProviderServer;
|
|
|
|
! /** Whether or not level saving is enabled */
|
|
! public boolean levelSaving;
|
|
|
|
/** is false if there are no players */
|
|
private boolean allPlayersSleeping;
|
|
private int updateEntityTick;
|
|
|
|
***************
|
|
*** 228,267 ****
|
|
return false;
|
|
}
|
|
}
|
|
|
|
/**
|
|
- * Sets a new spawn location by finding an uncovered block at a random (x,z) location in the chunk.
|
|
- */
|
|
- public void setSpawnLocation()
|
|
- {
|
|
- if (this.worldInfo.getSpawnY() <= 0)
|
|
- {
|
|
- this.worldInfo.setSpawnY(64);
|
|
- }
|
|
-
|
|
- int var1 = this.worldInfo.getSpawnX();
|
|
- int var2 = this.worldInfo.getSpawnZ();
|
|
- int var3 = 0;
|
|
-
|
|
- while (this.getFirstUncoveredBlock(var1, var2) == 0)
|
|
- {
|
|
- var1 += this.rand.nextInt(8) - this.rand.nextInt(8);
|
|
- var2 += this.rand.nextInt(8) - this.rand.nextInt(8);
|
|
- ++var3;
|
|
-
|
|
- if (var3 == 10000)
|
|
- {
|
|
- break;
|
|
- }
|
|
- }
|
|
-
|
|
- this.worldInfo.setSpawnX(var1);
|
|
- this.worldInfo.setSpawnZ(var2);
|
|
- }
|
|
-
|
|
- /**
|
|
* plays random cave ambient sounds and runs updateTick on random blocks within each chunk in the vacinity of a
|
|
* player
|
|
*/
|
|
protected void tickBlocksAndAmbiance()
|
|
{
|
|
--- 228,237 ----
|
|
***************
|
|
*** 379,389 ****
|
|
NextTickListEntry var5 = new NextTickListEntry(par1, par2, par3, par4);
|
|
return this.pendingTickListEntriesThisTick.contains(var5);
|
|
}
|
|
|
|
/**
|
|
! * Schedules a tick to a block with a delay (Most commonly the tick rate)
|
|
*/
|
|
public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
this.scheduleBlockUpdateWithPriority(par1, par2, par3, par4, par5, 0);
|
|
}
|
|
--- 349,359 ----
|
|
NextTickListEntry var5 = new NextTickListEntry(par1, par2, par3, par4);
|
|
return this.pendingTickListEntriesThisTick.contains(var5);
|
|
}
|
|
|
|
/**
|
|
! * Used to schedule a call to the updateTick method on the specified block.
|
|
*/
|
|
public void scheduleBlockUpdate(int par1, int par2, int par3, int par4, int par5)
|
|
{
|
|
this.scheduleBlockUpdateWithPriority(par1, par2, par3, par4, par5, 0);
|
|
}
|
|
***************
|
|
*** 646,658 ****
|
|
this.theChunkProviderServer = new ChunkProviderServer(this, var1, this.provider.createChunkGenerator());
|
|
return this.theChunkProviderServer;
|
|
}
|
|
|
|
/**
|
|
! * pars: min x,y,z , max x,y,z
|
|
*/
|
|
! public List getAllTileEntityInBox(int par1, int par2, int par3, int par4, int par5, int par6)
|
|
{
|
|
ArrayList var7 = new ArrayList();
|
|
|
|
for (int var8 = 0; var8 < this.loadedTileEntityList.size(); ++var8)
|
|
{
|
|
--- 616,628 ----
|
|
this.theChunkProviderServer = new ChunkProviderServer(this, var1, this.provider.createChunkGenerator());
|
|
return this.theChunkProviderServer;
|
|
}
|
|
|
|
/**
|
|
! * get a list of tileEntity's
|
|
*/
|
|
! public List getTileEntityList(int par1, int par2, int par3, int par4, int par5, int par6)
|
|
{
|
|
ArrayList var7 = new ArrayList();
|
|
|
|
for (int var8 = 0; var8 < this.loadedTileEntityList.size(); ++var8)
|
|
{
|
|
***************
|
|
*** 785,802 ****
|
|
{
|
|
if (this.chunkProvider.canSave())
|
|
{
|
|
if (par2IProgressUpdate != null)
|
|
{
|
|
! par2IProgressUpdate.displayProgressMessage("Saving level");
|
|
}
|
|
|
|
this.saveLevel();
|
|
|
|
if (par2IProgressUpdate != null)
|
|
{
|
|
! par2IProgressUpdate.resetProgresAndWorkingMessage("Saving chunks");
|
|
}
|
|
|
|
this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
|
|
}
|
|
}
|
|
--- 755,772 ----
|
|
{
|
|
if (this.chunkProvider.canSave())
|
|
{
|
|
if (par2IProgressUpdate != null)
|
|
{
|
|
! par2IProgressUpdate.displaySavingString("Saving level");
|
|
}
|
|
|
|
this.saveLevel();
|
|
|
|
if (par2IProgressUpdate != null)
|
|
{
|
|
! par2IProgressUpdate.displayLoadingString("Saving chunks");
|
|
}
|
|
|
|
this.chunkProvider.saveChunks(par1, par2IProgressUpdate);
|
|
}
|
|
}
|
|
***************
|
|
*** 865,875 ****
|
|
*/
|
|
public boolean addWeatherEffect(Entity par1Entity)
|
|
{
|
|
if (super.addWeatherEffect(par1Entity))
|
|
{
|
|
! this.mcServer.getConfigurationManager().sendToAllNear(par1Entity.posX, par1Entity.posY, par1Entity.posZ, 512.0D, this.provider.dimensionId, new Packet71Weather(par1Entity));
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
--- 835,845 ----
|
|
*/
|
|
public boolean addWeatherEffect(Entity par1Entity)
|
|
{
|
|
if (super.addWeatherEffect(par1Entity))
|
|
{
|
|
! this.mcServer.getConfigurationManager().sendPacketToPlayersAroundPoint(par1Entity.posX, par1Entity.posY, par1Entity.posZ, 512.0D, this.provider.dimensionId, new Packet71Weather(par1Entity));
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
***************
|
|
*** 880,890 ****
|
|
* sends a Packet 38 (Entity Status) to all tracked players of that entity
|
|
*/
|
|
public void setEntityState(Entity par1Entity, byte par2)
|
|
{
|
|
Packet38EntityStatus var3 = new Packet38EntityStatus(par1Entity.entityId, par2);
|
|
! this.getEntityTracker().sendPacketToAllAssociatedPlayers(par1Entity, var3);
|
|
}
|
|
|
|
/**
|
|
* returns a new explosion. Does initiation (at time of writing Explosion is not finished)
|
|
*/
|
|
--- 850,860 ----
|
|
* sends a Packet 38 (Entity Status) to all tracked players of that entity
|
|
*/
|
|
public void setEntityState(Entity par1Entity, byte par2)
|
|
{
|
|
Packet38EntityStatus var3 = new Packet38EntityStatus(par1Entity.entityId, par2);
|
|
! this.getEntityTracker().sendPacketToTrackedPlayersAndTrackedEntity(par1Entity, var3);
|
|
}
|
|
|
|
/**
|
|
* returns a new explosion. Does initiation (at time of writing Explosion is not finished)
|
|
*/
|
|
***************
|
|
*** 907,917 ****
|
|
{
|
|
EntityPlayer var13 = (EntityPlayer)var12.next();
|
|
|
|
if (var13.getDistanceSq(par2, par4, par6) < 4096.0D)
|
|
{
|
|
! ((EntityPlayerMP)var13).playerNetServerHandler.sendPacketToPlayer(new Packet60Explosion(par2, par4, par6, par8, var11.affectedBlockPositions, (Vec3)var11.func_77277_b().get(var13)));
|
|
}
|
|
}
|
|
|
|
return var11;
|
|
}
|
|
--- 877,887 ----
|
|
{
|
|
EntityPlayer var13 = (EntityPlayer)var12.next();
|
|
|
|
if (var13.getDistanceSq(par2, par4, par6) < 4096.0D)
|
|
{
|
|
! ((EntityPlayerMP)var13).playerNetServerHandler.sendPacket(new Packet60Explosion(par2, par4, par6, par8, var11.affectedBlockPositions, (Vec3)var11.func_77277_b().get(var13)));
|
|
}
|
|
}
|
|
|
|
return var11;
|
|
}
|
|
***************
|
|
*** 954,964 ****
|
|
{
|
|
BlockEventData var3 = (BlockEventData)var2.next();
|
|
|
|
if (this.onBlockEventReceived(var3))
|
|
{
|
|
! this.mcServer.getConfigurationManager().sendToAllNear((double)var3.getX(), (double)var3.getY(), (double)var3.getZ(), 64.0D, this.provider.dimensionId, new Packet54PlayNoteBlock(var3.getX(), var3.getY(), var3.getZ(), var3.getBlockID(), var3.getEventID(), var3.getEventParameter()));
|
|
}
|
|
}
|
|
|
|
this.blockEventCache[var1].clear();
|
|
}
|
|
--- 924,934 ----
|
|
{
|
|
BlockEventData var3 = (BlockEventData)var2.next();
|
|
|
|
if (this.onBlockEventReceived(var3))
|
|
{
|
|
! this.mcServer.getConfigurationManager().sendPacketToPlayersAroundPoint((double)var3.getX(), (double)var3.getY(), (double)var3.getZ(), 64.0D, this.provider.dimensionId, new Packet54PlayNoteBlock(var3.getX(), var3.getY(), var3.getZ(), var3.getBlockID(), var3.getEventID(), var3.getEventParameter()));
|
|
}
|
|
}
|
|
|
|
this.blockEventCache[var1].clear();
|
|
}
|
|
*** WorldSettings.java Sat Feb 5 04:19:45 2022
|
|
--- WorldSettings.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 46,64 ****
|
|
{
|
|
this.bonusChestEnabled = true;
|
|
return this;
|
|
}
|
|
|
|
- /**
|
|
- * Enables Commands (cheats).
|
|
- */
|
|
- public WorldSettings enableCommands()
|
|
- {
|
|
- this.commandsAllowed = true;
|
|
- return this;
|
|
- }
|
|
-
|
|
public WorldSettings func_82750_a(String par1Str)
|
|
{
|
|
this.field_82751_h = par1Str;
|
|
return this;
|
|
}
|
|
--- 46,55 ----
|
|
*** WorldType.java Sat Feb 5 04:19:45 2022
|
|
--- WorldType.java Sat Feb 5 04:19:59 2022
|
|
***************
|
|
*** 17,28 ****
|
|
/** Default (1.1) world type. */
|
|
public static final WorldType DEFAULT_1_1 = (new WorldType(8, "default_1_1", 0)).setCanBeCreated(false);
|
|
|
|
/** ID for this world type. */
|
|
private final int worldTypeId;
|
|
-
|
|
- /** 'default' or 'flat' */
|
|
private final String worldType;
|
|
|
|
/** The int version of the ChunkProvider that generated this world. */
|
|
private final int generatorVersion;
|
|
|
|
--- 17,26 ----
|
|
***************
|
|
*** 52,69 ****
|
|
{
|
|
return this.worldType;
|
|
}
|
|
|
|
/**
|
|
- * Gets the translation key for the name of this world type.
|
|
- */
|
|
- public String getTranslateName()
|
|
- {
|
|
- return "generator." + this.worldType;
|
|
- }
|
|
-
|
|
- /**
|
|
* Returns generatorVersion.
|
|
*/
|
|
public int getGeneratorVersion()
|
|
{
|
|
return this.generatorVersion;
|
|
--- 50,59 ----
|
|
***************
|
|
*** 79,96 ****
|
|
*/
|
|
private WorldType setCanBeCreated(boolean par1)
|
|
{
|
|
this.canBeCreated = par1;
|
|
return this;
|
|
- }
|
|
-
|
|
- /**
|
|
- * Gets whether this WorldType can be used to generate a new world.
|
|
- */
|
|
- public boolean getCanBeCreated()
|
|
- {
|
|
- return this.canBeCreated;
|
|
}
|
|
|
|
/**
|
|
* Flags this world type as having an associated version.
|
|
*/
|
|
--- 69,78 ----
|