diff --git a/.gitignore b/.gitignore index f25e594..691e418 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,8 @@ javascript/classes.js javascript/EaglercraftX_1.8_Offline_en_US.html javascript/EaglercraftX_1.8_Offline_International.html javascript/EaglercraftL_1.9_Offline_en_US.html +javascript/EaglercraftL_1.9_Offline_International.html +javascript/classes.js.map resources/hashes/* resources/optimizedResources/* .idea/* diff --git a/CompileEPK.sh b/CompileEPK.sh old mode 100644 new mode 100755 index 05f907c..96f4d55 --- a/CompileEPK.sh +++ b/CompileEPK.sh @@ -1,2 +1,7 @@ #!/bin/sh -java -jar "desktopRuntime/CompileEPK.jar" "desktopRuntime/resources" "javascript/assets.epk" \ No newline at end of file +cd resources +python optimize.py +cd .. +echo compiling, please wait... +java -jar "resources/CompileEPK.jar" "resources/optimizedResources" "javascript/assets.epk" +echo finished compiling epk diff --git a/build.gradle b/build.gradle index 0a0eb84..76af709 100644 --- a/build.gradle +++ b/build.gradle @@ -23,8 +23,8 @@ dependencies { } teavm.js { - obfuscated = true - sourceMap = false + obfuscated = false + sourceMap = true targetFileName = "../classes.js" optimization = org.teavm.gradle.api.OptimizationLevel.AGGRESSIVE outOfProcess = false diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/resources/resources/assets/minecraft/textures/gui/container/brewing_stand.png b/resources/resources/assets/minecraft/textures/gui/container/brewing_stand.png index e7dc203..50f260c 100644 Binary files a/resources/resources/assets/minecraft/textures/gui/container/brewing_stand.png and b/resources/resources/assets/minecraft/textures/gui/container/brewing_stand.png differ diff --git a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java index 001a2f3..0dec74a 100644 --- a/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java +++ b/src/main/java/net/lax1dude/eaglercraft/v1_8/EaglercraftVersion.java @@ -9,7 +9,7 @@ public class EaglercraftVersion { /// Customize these to fit your fork: public static final String projectForkName = "Eaglercraft Lambda"; - public static final String projectForkVersion = "0.5.1"; + public static final String projectForkVersion = "0.6.0"; public static final String projectForkVendor = "HoosierTransfer"; public static final String projectForkURL = "https://gitlab.com/lax1dude/eaglercraftx-1.8"; diff --git a/src/main/java/net/minecraft/block/Block.java b/src/main/java/net/minecraft/block/Block.java index 345fabf..88d52d6 100644 --- a/src/main/java/net/minecraft/block/Block.java +++ b/src/main/java/net/minecraft/block/Block.java @@ -366,6 +366,10 @@ public class Block implements ILitBlock { return true; } + public boolean isFullyOpaque(IBlockState state) { + return state.getBlock().getMaterial().isOpaque() && state.getBlock().isFullCube(); + } + public boolean isPassable(IBlockAccess var1, BlockPos var2) { return !this.blockMaterial.blocksMovement(); } @@ -1230,7 +1234,7 @@ public class Block implements ILitBlock { registerBlock(6, (String) "sapling", (new BlockSapling()).setHardness(0.0F).setStepSound(soundTypeGrass).setUnlocalizedName("sapling")); registerBlock(7, (String) "bedrock", - (new Block(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston) + (new BlockEmptyDrops(Material.rock)).setBlockUnbreakable().setResistance(6000000.0F).setStepSound(soundTypePiston) .setUnlocalizedName("bedrock").disableStats().setCreativeTab(CreativeTabs.tabBlock)); registerBlock(8, (String) "flowing_water", (new BlockDynamicLiquid(Material.water)).setHardness(100.0F) .setLightOpacity(3).setUnlocalizedName("water").disableStats()); diff --git a/src/main/java/net/minecraft/block/BlockBeetroot.java b/src/main/java/net/minecraft/block/BlockBeetroot.java index c595e35..808a602 100644 --- a/src/main/java/net/minecraft/block/BlockBeetroot.java +++ b/src/main/java/net/minecraft/block/BlockBeetroot.java @@ -1,9 +1,36 @@ package net.minecraft.block; +import java.util.Random; + import net.hoosiertransfer.EaglerItems; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.minecraft.block.state.IBlockState; import net.minecraft.item.Item; +import net.minecraft.util.BlockPos; +import net.minecraft.world.World; public class BlockBeetroot extends BlockCrops { + public int getMaxAge() { + return 3; + } + + public void updateTick(World worldIn, BlockPos pos, IBlockState state, EaglercraftRandom rand) + { + if (rand.nextInt(3) == 0) + { + this.checkAndDropBlock(worldIn, pos, state); + } + else + { + super.updateTick(worldIn, pos, state, rand); + } + } + + protected int getBonemealAgeIncrease(World worldIn) + { + return super.getBonemealAgeIncrease(worldIn) / 3; + } + protected Item getSeed() { return EaglerItems.getEaglerItem("beetroot_seeds"); } diff --git a/src/main/java/net/minecraft/block/BlockCactus.java b/src/main/java/net/minecraft/block/BlockCactus.java index 40a56e9..adebc5a 100644 --- a/src/main/java/net/minecraft/block/BlockCactus.java +++ b/src/main/java/net/minecraft/block/BlockCactus.java @@ -122,16 +122,18 @@ public class BlockCactus extends Block { } public boolean canBlockStay(World worldIn, BlockPos pos) { - EnumFacing[] facings = EnumFacing.Plane.HORIZONTAL.facingsArray; - for (int i = 0; i < facings.length; ++i) { - EnumFacing enumfacing = facings[i]; - if (worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial().isSolid()) { - return false; - } - } + for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL) + { + Material material = worldIn.getBlockState(pos.offset(enumfacing)).getBlock().getMaterial(); + + if (material.isSolid() || material == Material.lava) + { + return false; + } + } Block block = worldIn.getBlockState(pos.down()).getBlock(); - return block == Blocks.cactus || block == Blocks.sand; + return block == Blocks.cactus || block == Blocks.sand && !worldIn.getBlockState(pos.up()).getBlock().getMaterial().isLiquid(); } /** diff --git a/src/main/java/net/minecraft/block/BlockCauldron.java b/src/main/java/net/minecraft/block/BlockCauldron.java index 46366ea..e5ce6c3 100644 --- a/src/main/java/net/minecraft/block/BlockCauldron.java +++ b/src/main/java/net/minecraft/block/BlockCauldron.java @@ -135,10 +135,34 @@ public class BlockCauldron extends Block { new ItemStack(Items.bucket)); } - entityplayer.triggerAchievement(StatList.field_181725_I); + entityplayer.triggerAchievement(StatList.CAULDRON_USED); this.setWaterLevel(world, blockpos, iblockstate, 3); } + return true; + } else if (item == Items.bucket) { + if (i == 3 && !world.isRemote) + { + if (!entityplayer.capabilities.isCreativeMode) + { + ItemStack heldItem = entityplayer.inventory.getCurrentItem(); + --heldItem.stackSize; + + if (heldItem.stackSize == 0) + { + entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, + new ItemStack(Items.water_bucket)); + } + else if (!entityplayer.inventory.addItemStackToInventory(new ItemStack(Items.water_bucket))) + { + entityplayer.dropPlayerItemWithRandomChoice(new ItemStack(Items.water_bucket), false); + } + } + + entityplayer.addStat(StatList.CAULDRON_USED, 1); + this.setWaterLevel(world, blockpos, iblockstate, 0); + } + return true; } else if (item == Items.glass_bottle) { if (i > 0) { diff --git a/src/main/java/net/minecraft/block/BlockCrops.java b/src/main/java/net/minecraft/block/BlockCrops.java index d43d4db..77daaf5 100644 --- a/src/main/java/net/minecraft/block/BlockCrops.java +++ b/src/main/java/net/minecraft/block/BlockCrops.java @@ -80,14 +80,28 @@ public class BlockCrops extends BlockBush implements IGrowable { } - public void grow(World worldIn, BlockPos pos, IBlockState state) { - int i = ((Integer) state.getValue(AGE)).intValue() + MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); - if (i > 7) { - i = 7; - } + public IBlockState withAge(int age) + { + return this.getDefaultState().withProperty(AGE, Integer.valueOf(age)); + } - worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(i)), 2); - } + protected int getAge(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue(); + } + + public void grow(World worldIn, BlockPos pos, IBlockState state) + { + int i = this.getAge(state) + this.getBonemealAgeIncrease(worldIn); + int j = this.getMaxAge(); + + if (i > j) + { + i = j; + } + + worldIn.setBlockState(pos, this.withAge(i), 2); + } protected static float getGrowthChance(Block blockIn, World worldIn, BlockPos pos) { float f = 1.0F; @@ -148,6 +162,11 @@ public class BlockCrops extends BlockBush implements IGrowable { return Items.wheat; } + public int getMaxAge() + { + return 7; + } + /** * + * Spawns this Block's drops into the World as EntityItems. @@ -160,7 +179,7 @@ public class BlockCrops extends BlockBush implements IGrowable { int k = 3 + i; for (int l = 0; l < k; ++l) { - if (world.rand.nextInt(15) <= j) { + if (world.rand.nextInt(2 * this.getMaxAge()) <= j) { spawnAsEntity(world, blockpos, new ItemStack(this.getSeed(), 1, 0)); } } @@ -192,10 +211,20 @@ public class BlockCrops extends BlockBush implements IGrowable { return true; } + protected int getBonemealAgeIncrease(World worldIn) + { + return MathHelper.getRandomIntegerInRange(worldIn.rand, 2, 5); + } + public void grow(World world, EaglercraftRandom var2, BlockPos blockpos, IBlockState iblockstate) { this.grow(world, blockpos, iblockstate); } + public boolean isMaxAge(IBlockState state) + { + return ((Integer)state.getValue(AGE)).intValue() >= this.getMaxAge(); + } + /** * + * Convert the given metadata into a BlockState for this Block diff --git a/src/main/java/net/minecraft/block/BlockDaylightDetector.java b/src/main/java/net/minecraft/block/BlockDaylightDetector.java index 49815f4..20d49a8 100644 --- a/src/main/java/net/minecraft/block/BlockDaylightDetector.java +++ b/src/main/java/net/minecraft/block/BlockDaylightDetector.java @@ -74,25 +74,34 @@ public class BlockDaylightDetector extends BlockContainer { return ((Integer) iblockstate.getValue(POWER)).intValue(); } - public void updatePower(World worldIn, BlockPos pos) { - if (!worldIn.provider.getHasNoSky()) { - IBlockState iblockstate = worldIn.getBlockState(pos); - int i = worldIn.getLightFor(EnumSkyBlock.SKY, pos) - worldIn.getSkylightSubtracted(); - float f = worldIn.getCelestialAngleRadians(1.0F); - float f1 = f < 3.1415927F ? 0.0F : 6.2831855F; - f = f + (f1 - f) * 0.2F; - i = Math.round((float) i * MathHelper.cos(f)); - i = MathHelper.clamp_int(i, 0, 15); - if (this.inverted) { - i = 15 - i; - } + public void updatePower(World worldIn, BlockPos pos) + { + if (!worldIn.provider.getHasNoSky()) + { + IBlockState iblockstate = worldIn.getBlockState(pos); + int i = worldIn.getLightFor(EnumSkyBlock.SKY, pos) - worldIn.getSkylightSubtracted(); + float f = worldIn.getCelestialAngleRadians(1.0F); - if (((Integer) iblockstate.getValue(POWER)).intValue() != i) { - worldIn.setBlockState(pos, iblockstate.withProperty(POWER, Integer.valueOf(i)), 3); - } + if (this.inverted) + { + i = 15 - i; + } - } - } + if (i > 0 && !this.inverted) + { + float f1 = f < (float)Math.PI ? 0.0F : ((float)Math.PI * 2F); + f = f + (f1 - f) * 0.2F; + i = Math.round((float)i * MathHelper.cos(f)); + } + + i = MathHelper.clamp_int(i, 0, 15); + + if (((Integer)iblockstate.getValue(POWER)).intValue() != i) + { + worldIn.setBlockState(pos, iblockstate.withProperty(POWER, Integer.valueOf(i)), 3); + } + } + } public boolean onBlockActivated(World world, BlockPos blockpos, IBlockState iblockstate, EntityPlayer entityplayer, EnumFacing enumfacing, float f, float f1, float f2) { diff --git a/src/main/java/net/minecraft/block/BlockDeadBush.java b/src/main/java/net/minecraft/block/BlockDeadBush.java index 87fed2c..4af675b 100644 --- a/src/main/java/net/minecraft/block/BlockDeadBush.java +++ b/src/main/java/net/minecraft/block/BlockDeadBush.java @@ -82,9 +82,17 @@ public class BlockDeadBush extends BlockBush { * Get the Item that this Block should drop when harvested. */ public Item getItemDropped(IBlockState var1, EaglercraftRandom var2, int var3) { - return null; + return Items.stick; } + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) + { + return random.nextInt(3); + } + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, TileEntity tileentity) { if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null diff --git a/src/main/java/net/minecraft/block/BlockEmptyDrops.java b/src/main/java/net/minecraft/block/BlockEmptyDrops.java new file mode 100644 index 0000000..06b32d7 --- /dev/null +++ b/src/main/java/net/minecraft/block/BlockEmptyDrops.java @@ -0,0 +1,36 @@ +package net.minecraft.block; + +import java.util.Random; + +import javax.annotation.Nullable; + +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.item.Item; + +public class BlockEmptyDrops extends Block +{ + public BlockEmptyDrops(Material materialIn) + { + super(materialIn); + } + + /** + * Returns the quantity of items to drop on block destruction. + */ + public int quantityDropped(EaglercraftRandom random) + { + return 0; + } + + @Nullable + + /** + * Get the Item that this Block should drop when harvested. + */ + public Item getItemDropped(IBlockState state, EaglercraftRandom rand, int fortune) + { + return null; + } +} diff --git a/src/main/java/net/minecraft/block/BlockEndPortal.java b/src/main/java/net/minecraft/block/BlockEndPortal.java index 9754a88..19846ab 100644 --- a/src/main/java/net/minecraft/block/BlockEndPortal.java +++ b/src/main/java/net/minecraft/block/BlockEndPortal.java @@ -62,7 +62,7 @@ public class BlockEndPortal extends BlockContainer { } public void setBlockBoundsBasedOnState(IBlockAccess var1, BlockPos var2) { - float f = 0.0625F; + float f = 0.75F; this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F); } diff --git a/src/main/java/net/minecraft/block/BlockFarmland.java b/src/main/java/net/minecraft/block/BlockFarmland.java index 423020c..12ddbf2 100644 --- a/src/main/java/net/minecraft/block/BlockFarmland.java +++ b/src/main/java/net/minecraft/block/BlockFarmland.java @@ -92,22 +92,17 @@ public class BlockFarmland extends Block { } /** - * + - * Block's chance to react to a living entity falling on it. - */ - public void onFallenUpon(World world, BlockPos blockpos, Entity entity, float f) { - if (entity instanceof EntityLivingBase) { - if (!world.isRemote && world.rand.nextFloat() < f - 0.5F) { - if (!(entity instanceof EntityPlayer) && !world.getGameRules().getBoolean("mobGriefing")) { - return; - } + * Block's chance to react to a living entity falling on it. + */ + public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) + { + if (!worldIn.isRemote && worldIn.rand.nextFloat() < fallDistance - 0.5F && entityIn instanceof EntityLivingBase && (entityIn instanceof EntityPlayer || worldIn.getGameRules().getBoolean("mobGriefing")) && entityIn.width * entityIn.width * entityIn.height > 0.512F) + { + worldIn.setBlockState(pos, Blocks.dirt.getDefaultState()); + } - world.setBlockState(blockpos, Blocks.dirt.getDefaultState()); - } - - super.onFallenUpon(world, blockpos, entity, f); - } - } + super.onFallenUpon(worldIn, pos, entityIn, fallDistance); + } private boolean hasCrops(World worldIn, BlockPos pos) { Block block = worldIn.getBlockState(pos.up()).getBlock(); diff --git a/src/main/java/net/minecraft/block/BlockHay.java b/src/main/java/net/minecraft/block/BlockHay.java index 115e562..e964349 100644 --- a/src/main/java/net/minecraft/block/BlockHay.java +++ b/src/main/java/net/minecraft/block/BlockHay.java @@ -6,6 +6,7 @@ import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -100,4 +101,12 @@ public class BlockHay extends BlockRotatedPillar { return super.onBlockPlaced(world, blockpos, enumfacing, f, f1, f2, i, entitylivingbase).withProperty(AXIS, enumfacing.getAxis()); } + + /** + * Block's chance to react to a living entity falling on it. + */ + public void onFallenUpon(World worldIn, BlockPos pos, Entity entityIn, float fallDistance) + { + entityIn.fall(fallDistance, 0.2F); + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/block/BlockLilyPad.java b/src/main/java/net/minecraft/block/BlockLilyPad.java index f379535..71c4383 100644 --- a/src/main/java/net/minecraft/block/BlockLilyPad.java +++ b/src/main/java/net/minecraft/block/BlockLilyPad.java @@ -44,9 +44,7 @@ import net.minecraft.world.World; */ public class BlockLilyPad extends BlockBush { protected BlockLilyPad() { - float f = 0.5F; - float f1 = 0.015625F; - this.setBlockBounds(0.5F - f, 0.0F, 0.5F - f, 0.5F + f, f1, 0.5F + f); + this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.09375F, 0.9375F); this.setCreativeTab(CreativeTabs.tabDecorations); } @@ -92,8 +90,9 @@ public class BlockLilyPad extends BlockBush { public boolean canBlockStay(World world, BlockPos blockpos, IBlockState var3) { if (blockpos.getY() >= 0 && blockpos.getY() < 256) { IBlockState iblockstate = world.getBlockState(blockpos.down()); - return iblockstate.getBlock().getMaterial() == Material.water - && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0; + Material material = iblockstate.getBlock().getMaterial(); + return material == Material.water + && ((Integer) iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 || material == Material.ice; } else { return false; } diff --git a/src/main/java/net/minecraft/block/BlockPotato.java b/src/main/java/net/minecraft/block/BlockPotato.java index 0f179c9..f810cd9 100644 --- a/src/main/java/net/minecraft/block/BlockPotato.java +++ b/src/main/java/net/minecraft/block/BlockPotato.java @@ -46,15 +46,18 @@ public class BlockPotato extends BlockCrops { } /** - * + - * Spawns this Block's drops into the World as EntityItems. - */ - public void dropBlockAsItemWithChance(World world, BlockPos blockpos, IBlockState iblockstate, float f, int i) { - super.dropBlockAsItemWithChance(world, blockpos, iblockstate, f, i); - if (!world.isRemote) { - if (((Integer) iblockstate.getValue(AGE)).intValue() >= 7 && world.rand.nextInt(50) == 0) { - spawnAsEntity(world, blockpos, new ItemStack(Items.poisonous_potato)); - } - } - } + * Spawns this Block's drops into the World as EntityItems. + */ + public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, IBlockState state, float chance, int fortune) + { + super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune); + + if (!worldIn.isRemote) + { + if (this.isMaxAge(state) && worldIn.rand.nextInt(50) == 0) + { + spawnAsEntity(worldIn, pos, new ItemStack(Items.poisonous_potato)); + } + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/block/BlockRedstoneDiode.java b/src/main/java/net/minecraft/block/BlockRedstoneDiode.java index 5b558e3..e3bcee3 100644 --- a/src/main/java/net/minecraft/block/BlockRedstoneDiode.java +++ b/src/main/java/net/minecraft/block/BlockRedstoneDiode.java @@ -1,7 +1,6 @@ package net.minecraft.block; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; - import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; @@ -182,7 +181,7 @@ public abstract class BlockRedstoneDiode extends BlockDirectional { IBlockState iblockstate = worldIn.getBlockState(pos); Block block = iblockstate.getBlock(); return this.canPowerSide(block) - ? (block == Blocks.redstone_wire ? ((Integer) iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() + ? (block == Blocks.redstone_block ? 15 : block == Blocks.redstone_wire ? ((Integer) iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : worldIn.getStrongPower(pos, side)) : 0; } diff --git a/src/main/java/net/minecraft/block/BlockTrapDoor.java b/src/main/java/net/minecraft/block/BlockTrapDoor.java index 42b3116..8f3127a 100644 --- a/src/main/java/net/minecraft/block/BlockTrapDoor.java +++ b/src/main/java/net/minecraft/block/BlockTrapDoor.java @@ -210,9 +210,7 @@ public class BlockTrapDoor extends Block { * Check whether this Block can be placed on the given side */ public boolean canPlaceBlockOnSide(World world, BlockPos blockpos, EnumFacing enumfacing) { - // Hoosiertransfer mod - // this is a feature from newer versions of minecraft - return !enumfacing.getAxis().isVertical(); + return true; } protected static EnumFacing getFacing(int meta) { diff --git a/src/main/java/net/minecraft/block/BlockWeb.java b/src/main/java/net/minecraft/block/BlockWeb.java index 3ef79df..d9961c9 100644 --- a/src/main/java/net/minecraft/block/BlockWeb.java +++ b/src/main/java/net/minecraft/block/BlockWeb.java @@ -6,8 +6,12 @@ import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.stats.StatList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumWorldBlockLayer; @@ -88,4 +92,18 @@ public class BlockWeb extends Block { public EnumWorldBlockLayer getBlockLayer() { return EnumWorldBlockLayer.CUTOUT; } + + public void harvestBlock(World world, EntityPlayer entityplayer, BlockPos blockpos, IBlockState iblockstate, + TileEntity tileentity) { + ItemStack stack = entityplayer.inventory.getCurrentItem(); + if (!world.isRemote && stack != null && stack.getItem() == Items.shears) + { + entityplayer.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]); + spawnAsEntity(world, blockpos, new ItemStack(Item.getItemFromBlock(this), 1)); + } + else + { + super.harvestBlock(world, entityplayer, blockpos, iblockstate, tileentity); + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java b/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java index 17b2058..200bf50 100644 --- a/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java +++ b/src/main/java/net/minecraft/client/gui/inventory/GuiBrewingStand.java @@ -4,6 +4,7 @@ import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ContainerBrewingStand; import net.minecraft.inventory.IInventory; +import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; /** @@ -38,6 +39,7 @@ import net.minecraft.util.ResourceLocation; public class GuiBrewingStand extends GuiContainer { private static final ResourceLocation brewingStandGuiTextures = new ResourceLocation( "textures/gui/container/brewing_stand.png"); + private static final int[] BUBBLELENGTHS = new int[] {29, 24, 20, 16, 11, 6, 0}; private final InventoryPlayer playerInventory; private IInventory tileBrewingStand; @@ -52,12 +54,11 @@ public class GuiBrewingStand extends GuiContainer { * Draw the foreground layer for the GuiContainer (everything in * front of the items). Args : mouseX, mouseY */ - protected void drawGuiContainerForegroundLayer(int var1, int var2) { - String s = this.tileBrewingStand.getDisplayName().getUnformattedText(); - this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); - this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, - this.ySize - 96 + 2, 4210752); - } + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { + String s = this.tileBrewingStand.getDisplayName().getUnformattedText(); + this.fontRendererObj.drawString(s, this.xSize / 2 - this.fontRendererObj.getStringWidth(s) / 2, 6, 4210752); + this.fontRendererObj.drawString(this.playerInventory.getDisplayName().getUnformattedText(), 8, this.ySize - 96 + 2, 4210752); + } /** * + @@ -65,45 +66,36 @@ public class GuiBrewingStand extends GuiContainer { */ protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); - int i = (this.width - this.xSize) / 2; - int j = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); - int k = this.tileBrewingStand.getField(0); - if (k > 0) { - int l = (int) (28.0F * (1.0F - (float) k / 400.0F)); - if (l > 0) { - this.drawTexturedModalRect(i + 97, j + 16, 176, 0, 9, l); - } + this.mc.getTextureManager().bindTexture(brewingStandGuiTextures); + int i = (this.width - this.xSize) / 2; + int j = (this.height - this.ySize) / 2; + this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize); + int k = this.tileBrewingStand.getField(1); + int l = MathHelper.clamp_int((18 * k + 20 - 1) / 20, 0, 18); - int i1 = k / 2 % 7; - switch (i1) { - case 0: - l = 29; - break; - case 1: - l = 24; - break; - case 2: - l = 20; - break; - case 3: - l = 16; - break; - case 4: - l = 11; - break; - case 5: - l = 6; - break; - case 6: - l = 0; - } + if (l > 0) + { + this.drawTexturedModalRect(i + 60, j + 44, 176, 29, l, 4); + } - if (l > 0) { - this.drawTexturedModalRect(i + 65, j + 14 + 29 - l, 185, 29 - l, 12, l); - } - } + int i1 = this.tileBrewingStand.getField(0); + + if (i1 > 0) + { + int j1 = (int)(28.0F * (1.0F - (float)i1 / 400.0F)); + + if (j1 > 0) + { + this.drawTexturedModalRect(i + 97, j + 16, 176, 0, 9, j1); + } + + j1 = BUBBLELENGTHS[i1 / 2 % 7]; + + if (j1 > 0) + { + this.drawTexturedModalRect(i + 63, j + 14 + 29 - j1, 185, 29 - j1, 12, j1); + } + } } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java index 6059fe7..b64a608 100644 --- a/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java +++ b/src/main/java/net/minecraft/client/renderer/entity/RenderItem.java @@ -746,6 +746,7 @@ public class RenderItem implements IResourceManagerReloadListener { this.registerBlock(Blocks.wool, EnumDyeColor.SILVER.getMetadata(), "silver_wool"); this.registerBlock(Blocks.wool, EnumDyeColor.WHITE.getMetadata(), "white_wool"); this.registerBlock(Blocks.wool, EnumDyeColor.YELLOW.getMetadata(), "yellow_wool"); + this.registerBlock(Blocks.farmland, "farmland"); this.registerBlock(Blocks.acacia_stairs, "acacia_stairs"); this.registerBlock(Blocks.activator_rail, "activator_rail"); this.registerBlock(Blocks.beacon, "beacon"); diff --git a/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java b/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java index 9de267b..157d4a5 100644 --- a/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java +++ b/src/main/java/net/minecraft/enchantment/EnchantmentUntouching.java @@ -73,13 +73,4 @@ public class EnchantmentUntouching extends Enchantment { public boolean canApplyTogether(Enchantment enchantment) { return super.canApplyTogether(enchantment) && enchantment.effectId != fortune.effectId; } - - /** - * + - * Determines if this enchantment can be applied to a specific - * ItemStack. - */ - public boolean canApply(ItemStack itemstack) { - return itemstack.getItem() == Items.shears ? true : super.canApply(itemstack); - } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java b/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java index a31a158..dbd07e7 100644 --- a/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java +++ b/src/main/java/net/minecraft/inventory/ContainerBrewingStand.java @@ -1,5 +1,7 @@ package net.minecraft.inventory; +import javax.annotation.Nullable; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Items; @@ -40,26 +42,31 @@ public class ContainerBrewingStand extends Container { private final Slot theSlot; private int brewTime; + /** + * Used to cache the fuel remaining in the brewing stand to send changes to ICrafting listeners. + */ + private int prevFuel; + public ContainerBrewingStand(InventoryPlayer playerInventory, IInventory tileBrewingStandIn) { this.tileBrewingStand = tileBrewingStandIn; - this.addSlotToContainer( - new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 0, 56, 46)); - this.addSlotToContainer( - new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 1, 79, 53)); - this.addSlotToContainer( - new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 2, 102, 46)); - this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(tileBrewingStandIn, 3, 79, 17)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 0, 56, 51)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 1, 79, 58)); + this.addSlotToContainer(new ContainerBrewingStand.Potion(playerInventory.player, tileBrewingStandIn, 2, 102, 51)); + this.theSlot = this.addSlotToContainer(new ContainerBrewingStand.Ingredient(tileBrewingStandIn, 3, 79, 17)); + this.addSlotToContainer(new ContainerBrewingStand.Fuel(tileBrewingStandIn, 4, 17, 17)); - for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 9; ++j) { - this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); - } - } - - for (int k = 0; k < 9; ++k) { - this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); - } + for (int i = 0; i < 3; ++i) + { + for (int j = 0; j < 9; ++j) + { + this.addSlotToContainer(new Slot(playerInventory, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + } + } + for (int k = 0; k < 9; ++k) + { + this.addSlotToContainer(new Slot(playerInventory, k, 8 + k * 18, 142)); + } } public void onCraftGuiOpened(ICrafting icrafting) { @@ -80,9 +87,16 @@ public class ContainerBrewingStand extends Container { if (this.brewTime != this.tileBrewingStand.getField(0)) { icrafting.sendProgressBarUpdate(this, 0, this.tileBrewingStand.getField(0)); } + + if (this.prevFuel != this.tileBrewingStand.getField(1)) + { + icrafting.sendProgressBarUpdate(this, 1, this.tileBrewingStand.getField(1)); + } } this.brewTime = this.tileBrewingStand.getField(0); + this.prevFuel = this.tileBrewingStand.getField(1); + } public void updateProgressBar(int i, int j) { @@ -190,4 +204,27 @@ public class ContainerBrewingStand extends Container { && (parItemStack.getItem() == Items.potionitem || parItemStack.getItem() == Items.glass_bottle); } } + + static class Fuel extends Slot + { + public Fuel(IInventory iInventoryIn, int index, int xPosition, int yPosition) + { + super(iInventoryIn, index, xPosition, yPosition); + } + + public boolean isItemValid(@Nullable ItemStack stack) + { + return isValidBrewingFuel(stack); + } + + public static boolean isValidBrewingFuel(@Nullable ItemStack itemStackIn) + { + return itemStackIn != null && itemStackIn.getItem() == Items.blaze_powder; + } + + public int getSlotStackLimit() + { + return 64; + } + } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/inventory/ContainerRepair.java b/src/main/java/net/minecraft/inventory/ContainerRepair.java index 5a975da..dc7c129 100644 --- a/src/main/java/net/minecraft/inventory/ContainerRepair.java +++ b/src/main/java/net/minecraft/inventory/ContainerRepair.java @@ -327,7 +327,10 @@ public class ContainerRepair extends Container { k2 = itemstack2.getRepairCost(); } - k2 = k2 * 2 + 1; + if (b0 != i || b0 == 0) + { + k2 = k2 * 2 + 1; + } itemstack1.setRepairCost(k2); EnchantmentHelper.setEnchantments(map, itemstack1); } diff --git a/src/main/java/net/minecraft/item/ItemAppleGold.java b/src/main/java/net/minecraft/item/ItemAppleGold.java index c836dc7..69e12dd 100644 --- a/src/main/java/net/minecraft/item/ItemAppleGold.java +++ b/src/main/java/net/minecraft/item/ItemAppleGold.java @@ -1,6 +1,7 @@ package net.minecraft.item; import java.util.List; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.potion.Potion; @@ -56,19 +57,17 @@ public class ItemAppleGold extends ItemFood { protected void onFoodEaten(ItemStack itemstack, World world, EntityPlayer entityplayer) { if (!world.isRemote) { - entityplayer.addPotionEffect(new PotionEffect(Potion.absorption.id, 2400, 0)); - } - - if (itemstack.getMetadata() > 0) { - if (!world.isRemote) { - entityplayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 600, 4)); + if (itemstack.getMetadata() > 0) { + entityplayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 400, 1)); entityplayer.addPotionEffect(new PotionEffect(Potion.resistance.id, 6000, 0)); entityplayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 6000, 0)); - } - } else { - super.onFoodEaten(itemstack, world, entityplayer); - } + entityplayer.addPotionEffect(new PotionEffect(Potion.absorption.id, 2400, 3)); + } else { + entityplayer.addPotionEffect(new PotionEffect(Potion.regeneration.id, 100, 1)); + entityplayer.addPotionEffect(new PotionEffect(Potion.absorption.id, 2400, 0)); + } + } } /** diff --git a/src/main/java/net/minecraft/item/ItemAxe.java b/src/main/java/net/minecraft/item/ItemAxe.java index 78004eb..285f35a 100644 --- a/src/main/java/net/minecraft/item/ItemAxe.java +++ b/src/main/java/net/minecraft/item/ItemAxe.java @@ -42,7 +42,7 @@ public class ItemAxe extends ItemTool { public static void bootstrap() { EFFECTIVE_ON = Sets.newHashSet(new Block[] { Blocks.planks, Blocks.bookshelf, Blocks.log, Blocks.log2, - Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder }); + Blocks.chest, Blocks.pumpkin, Blocks.lit_pumpkin, Blocks.melon_block, Blocks.ladder, Blocks.wooden_button, Blocks.wooden_pressure_plate }); } protected ItemAxe(Item.ToolMaterial material) { diff --git a/src/main/java/net/minecraft/item/ItemEnderPearl.java b/src/main/java/net/minecraft/item/ItemEnderPearl.java index 97ada54..bfc775e 100644 --- a/src/main/java/net/minecraft/item/ItemEnderPearl.java +++ b/src/main/java/net/minecraft/item/ItemEnderPearl.java @@ -48,7 +48,7 @@ public class ItemEnderPearl extends Item { * button is pressed. Args: itemStack, world, entityPlayer */ public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - if (entityplayer.capabilities.isCreativeMode && world.isRemote + if (world.isRemote && !SingleplayerServerController.isClientInEaglerSingleplayerOrLAN()) { return itemstack; } else { diff --git a/src/main/java/net/minecraft/item/ItemHoe.java b/src/main/java/net/minecraft/item/ItemHoe.java index fec7850..b063cdf 100644 --- a/src/main/java/net/minecraft/item/ItemHoe.java +++ b/src/main/java/net/minecraft/item/ItemHoe.java @@ -6,6 +6,7 @@ import net.minecraft.block.BlockDirt; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; @@ -100,6 +101,16 @@ public class ItemHoe extends Item { } } + /** + * Current implementations of this method in child classes do not use the entry argument beside ev. They just raise + * the damage on the stack. + */ + public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker) + { + stack.damageItem(1, attacker); + return true; + } + /** * + * Returns True is the item is renderer in full 3D when hold. diff --git a/src/main/java/net/minecraft/item/ItemPickaxe.java b/src/main/java/net/minecraft/item/ItemPickaxe.java index 3fd21a3..fb3fc9f 100644 --- a/src/main/java/net/minecraft/item/ItemPickaxe.java +++ b/src/main/java/net/minecraft/item/ItemPickaxe.java @@ -46,7 +46,7 @@ public class ItemPickaxe extends ItemTool { Blocks.golden_rail, Blocks.gold_block, Blocks.gold_ore, Blocks.ice, Blocks.iron_block, Blocks.iron_ore, Blocks.lapis_block, Blocks.lapis_ore, Blocks.lit_redstone_ore, Blocks.mossy_cobblestone, Blocks.netherrack, Blocks.packed_ice, Blocks.rail, Blocks.redstone_ore, Blocks.sandstone, - Blocks.red_sandstone, Blocks.stone, Blocks.stone_slab }); + Blocks.red_sandstone, Blocks.stone, Blocks.stone_slab, Blocks.stone_button, Blocks.stone_pressure_plate }); } protected ItemPickaxe(Item.ToolMaterial material) { diff --git a/src/main/java/net/minecraft/item/ItemShears.java b/src/main/java/net/minecraft/item/ItemShears.java index a4a8e19..c63c0c0 100644 --- a/src/main/java/net/minecraft/item/ItemShears.java +++ b/src/main/java/net/minecraft/item/ItemShears.java @@ -51,13 +51,13 @@ public class ItemShears extends Item { */ public boolean onBlockDestroyed(ItemStack stack, World worldIn, Block blockIn, BlockPos pos, EntityLivingBase playerIn) { + stack.damageItem(1, playerIn); if (blockIn.getMaterial() != Material.leaves && blockIn != Blocks.web && blockIn != Blocks.tallgrass && blockIn != Blocks.vine && blockIn != Blocks.tripwire && blockIn != Blocks.wool) { return super.onBlockDestroyed(stack, worldIn, blockIn, pos, playerIn); - } else { - stack.damageItem(1, playerIn); - return true; } + + return true; } /** diff --git a/src/main/java/net/minecraft/item/ItemSign.java b/src/main/java/net/minecraft/item/ItemSign.java index 530de1c..0257e90 100644 --- a/src/main/java/net/minecraft/item/ItemSign.java +++ b/src/main/java/net/minecraft/item/ItemSign.java @@ -2,6 +2,7 @@ package net.minecraft.item; import net.minecraft.block.BlockStandingSign; import net.minecraft.block.BlockWallSign; +import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -53,6 +54,8 @@ public class ItemSign extends Item { */ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, BlockPos blockpos, EnumFacing enumfacing, float var6, float var7, float var8) { + IBlockState iblockstate = world.getBlockState(blockpos); + boolean flag = iblockstate.getBlock().isReplaceable(world, blockpos); if (enumfacing == EnumFacing.DOWN) { return false; } else if (!world.getBlockState(blockpos).getBlock().getMaterial().isSolid()) { @@ -66,6 +69,8 @@ public class ItemSign extends Item { } else if (world.isRemote) { return true; } else { + blockpos = flag ? blockpos.down() : blockpos; + if (enumfacing == EnumFacing.UP) { int i = MathHelper .floor_double((double) ((entityplayer.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; diff --git a/src/main/java/net/minecraft/item/crafting/CraftingManager.java b/src/main/java/net/minecraft/item/crafting/CraftingManager.java index ede05c0..62df27e 100644 --- a/src/main/java/net/minecraft/item/crafting/CraftingManager.java +++ b/src/main/java/net/minecraft/item/crafting/CraftingManager.java @@ -312,8 +312,6 @@ public class CraftingManager { Items.stick, Character.valueOf('X'), Items.leather }); this.addRecipe(new ItemStack(Items.golden_apple, 1, 0), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Items.gold_ingot, Character.valueOf('X'), Items.apple }); - this.addRecipe(new ItemStack(Items.golden_apple, 1, 1), new Object[] { "###", "#X#", "###", - Character.valueOf('#'), Blocks.gold_block, Character.valueOf('X'), Items.apple }); this.addRecipe(new ItemStack(Items.golden_carrot, 1, 0), new Object[] { "###", "#X#", "###", Character.valueOf('#'), Items.gold_nugget, Character.valueOf('X'), Items.carrot }); this.addRecipe(new ItemStack(Items.speckled_melon, 1), new Object[] { "###", "#X#", "###", diff --git a/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java b/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java index 4b09905..8417ab3 100644 --- a/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java +++ b/src/main/java/net/minecraft/item/crafting/RecipesCrafting.java @@ -157,5 +157,8 @@ public class RecipesCrafting { parCraftingManager.addRecipe(new ItemStack(EaglerItems.getEaglerItem("beetroot_soup"), 1), new Object[] { "FFF", "FFF", " B ", Character.valueOf('F'), EaglerItems.getEaglerItem("beetroot"), Character.valueOf('B'), Items.bowl }); + parCraftingManager.addRecipe(new ItemStack(EaglerItems.getEaglerBlock("end_rod"), 1), + new Object[] { "B", "P", Character.valueOf('B'), + Items.blaze_rod, Character.valueOf('P'), EaglerItems.getEaglerItem("chorus_fruit_popped")}); } } \ No newline at end of file diff --git a/src/main/java/net/minecraft/stats/StatList.java b/src/main/java/net/minecraft/stats/StatList.java index 7f77cce..d78b224 100644 --- a/src/main/java/net/minecraft/stats/StatList.java +++ b/src/main/java/net/minecraft/stats/StatList.java @@ -209,7 +209,7 @@ public class StatList { new ChatComponentTranslation("stat.tradedWithVillager", new Object[0]))).registerStat(); public static StatBase field_181724_H = (new StatBasic("stat.cakeSlicesEaten", new ChatComponentTranslation("stat.cakeSlicesEaten", new Object[0]))).registerStat(); - public static StatBase field_181725_I = (new StatBasic("stat.cauldronFilled", + public static StatBase CAULDRON_USED = (new StatBasic("stat.cauldronFilled", new ChatComponentTranslation("stat.cauldronFilled", new Object[0]))).registerStat(); public static StatBase field_181726_J = (new StatBasic("stat.cauldronUsed", new ChatComponentTranslation("stat.cauldronUsed", new Object[0]))).registerStat(); diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java b/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java index acc4c8f..99ea96b 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBeacon.java @@ -65,7 +65,7 @@ public class TileEntityBeacon extends TileEntityLockable implements ITickable, I { Potion.resistance, Potion.jump }, { Potion.damageBoost }, { Potion.regeneration } }; /** * + - * A list of beam segments for this beacon + * A list of beam segments for this */ private final List beamSegments = Lists.newArrayList(); private long beamRenderCounter; diff --git a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java index ec30635..00b32f2 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityBrewingStand.java @@ -2,6 +2,7 @@ package net.minecraft.tileentity; import java.util.Arrays; import java.util.List; + import net.minecraft.block.BlockBrewingStand; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; @@ -49,26 +50,25 @@ import net.minecraft.util.ITickable; * */ public class TileEntityBrewingStand extends TileEntityLockable implements ITickable, ISidedInventory { - /** - * + - * an array of the input slot indices - */ - private static final int[] inputSlots = new int[] { 3 }; - /** - * + - * an array of the output slot indices - */ - private static final int[] outputSlots = new int[] { 0, 1, 2 }; + /** an array of the input slot indices */ + private static final int[] SLOTS_FOR_UP = new int[] {3}; + private static final int[] SLOTS_FOR_DOWN = new int[] {0, 1, 2, 3}; + + /** an array of the output slot indices */ + private static final int[] OUTPUT_SLOTS = new int[] {0, 1, 2, 4}; + /** * + * The ItemStacks currently placed in the slots of the brewing * stand */ - private ItemStack[] brewingItemStacks = new ItemStack[4]; + private ItemStack[] brewingItemStacks = new ItemStack[5]; private int brewTime; private boolean[] filledSlots; private Item ingredientID; private String customName; + private int fuel; + /** * + @@ -100,46 +100,78 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka } /** - * + - * Like the old updateEntity(), except more generic. - */ - public void update() { - if (this.brewTime > 0) { - --this.brewTime; - if (this.brewTime == 0) { - this.brewPotions(); - this.markDirty(); - } else if (!this.canBrew()) { - this.brewTime = 0; - this.markDirty(); - } else if (this.ingredientID != this.brewingItemStacks[3].getItem()) { - this.brewTime = 0; - this.markDirty(); - } - } else if (this.canBrew()) { - this.brewTime = 400; - this.ingredientID = this.brewingItemStacks[3].getItem(); - } + * Like the old updateEntity(), except more generic. + */ + public void update() + { + if (this.fuel <= 0 && this.brewingItemStacks[4] != null && this.brewingItemStacks[4].getItem() == Items.blaze_powder) + { + this.fuel = 20; + --this.brewingItemStacks[4].stackSize; - if (!this.worldObj.isRemote) { - boolean[] aboolean = this.func_174902_m(); - if (!Arrays.equals(aboolean, this.filledSlots)) { - this.filledSlots = aboolean; - IBlockState iblockstate = this.worldObj.getBlockState(this.getPos()); - if (!(iblockstate.getBlock() instanceof BlockBrewingStand)) { - return; - } + if (this.brewingItemStacks[4].stackSize <= 0) + { + this.brewingItemStacks[4] = null; + } - for (int i = 0; i < BlockBrewingStand.HAS_BOTTLE.length; ++i) { - iblockstate = iblockstate.withProperty(BlockBrewingStand.HAS_BOTTLE[i], - Boolean.valueOf(aboolean[i])); - } + this.markDirty(); + } - this.worldObj.setBlockState(this.pos, iblockstate, 2); - } - } + boolean flag = this.canBrew(); + boolean flag1 = this.brewTime > 0; - } + if (flag1) + { + --this.brewTime; + boolean flag2 = this.brewTime == 0; + + if (flag2 && flag) + { + this.brewPotions(); + this.markDirty(); + } + else if (!flag) + { + this.brewTime = 0; + this.markDirty(); + } + else if (this.ingredientID != this.brewingItemStacks[3].getItem()) + { + this.brewTime = 0; + this.markDirty(); + } + } + else if (flag && this.fuel > 0) + { + --this.fuel; + this.brewTime = 400; + this.ingredientID = this.brewingItemStacks[3].getItem(); + this.markDirty(); + } + + if (!this.worldObj.isRemote) + { + boolean[] aboolean = this.createFilledSlotsArray(); + + if (!Arrays.equals(aboolean, this.filledSlots)) + { + this.filledSlots = aboolean; + IBlockState iblockstate = this.worldObj.getBlockState(this.getPos()); + + if (!(iblockstate.getBlock() instanceof BlockBrewingStand)) + { + return; + } + + for (int i = 0; i < BlockBrewingStand.HAS_BOTTLE.length; ++i) + { + iblockstate = iblockstate.withProperty(BlockBrewingStand.HAS_BOTTLE[i], Boolean.valueOf(aboolean[i])); + } + + this.worldObj.setBlockState(this.pos, iblockstate, 2); + } + } + } private boolean canBrew() { if (this.brewingItemStacks[3] != null && this.brewingItemStacks[3].stackSize > 0) { @@ -237,6 +269,7 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka this.customName = nbttagcompound.getString("CustomName"); } + this.fuel = nbttagcompound.getByte("Fuel"); } public void writeToNBT(NBTTagCompound nbttagcompound) { @@ -258,6 +291,7 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka nbttagcompound.setString("CustomName", this.customName); } + nbttagcompound.setByte("Fuel", (byte)this.fuel); } /** @@ -345,7 +379,7 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka : itemstack.getItem() == Items.potionitem || itemstack.getItem() == Items.glass_bottle; } - public boolean[] func_174902_m() { + public boolean[] createFilledSlotsArray() { boolean[] aboolean = new boolean[3]; for (int i = 0; i < 3; ++i) { @@ -358,7 +392,7 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka } public int[] getSlotsForFace(EnumFacing side) { - return side == EnumFacing.UP ? inputSlots : outputSlots; + return side == EnumFacing.UP ? SLOTS_FOR_UP : (side == EnumFacing.DOWN ? SLOTS_FOR_DOWN : OUTPUT_SLOTS); } /** @@ -391,6 +425,8 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka switch (i) { case 0: return this.brewTime; + case 1: + return this.fuel; default: return 0; } @@ -400,7 +436,9 @@ public class TileEntityBrewingStand extends TileEntityLockable implements ITicka switch (i) { case 0: this.brewTime = j; - default: + break; + case 1: + this.fuel = j; } } diff --git a/src/main/java/net/minecraft/tileentity/TileEntityNote.java b/src/main/java/net/minecraft/tileentity/TileEntityNote.java index 36f2921..3689517 100644 --- a/src/main/java/net/minecraft/tileentity/TileEntityNote.java +++ b/src/main/java/net/minecraft/tileentity/TileEntityNote.java @@ -43,12 +43,14 @@ public class TileEntityNote extends TileEntity { public void writeToNBT(NBTTagCompound nbttagcompound) { super.writeToNBT(nbttagcompound); nbttagcompound.setByte("note", this.note); + nbttagcompound.setBoolean("powered", this.previousRedstoneState); } public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); this.note = nbttagcompound.getByte("note"); this.note = (byte) MathHelper.clamp_int(this.note, 0, 24); + this.previousRedstoneState = nbttagcompound.getBoolean("powered"); } /** diff --git a/src/main/java/net/minecraft/world/Explosion.java b/src/main/java/net/minecraft/world/Explosion.java index e42662f..92304ff 100644 --- a/src/main/java/net/minecraft/world/Explosion.java +++ b/src/main/java/net/minecraft/world/Explosion.java @@ -3,12 +3,12 @@ package net.minecraft.world; import java.util.HashSet; import java.util.List; import java.util.Map; -import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; +import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; @@ -171,7 +171,7 @@ public class Explosion { double d14 = (double) this.worldObj.getBlockDensity(vec3, entity.getEntityBoundingBox()); double d10 = (1.0D - d12) * d14; entity.attackEntityFrom(DamageSource.setExplosionSource(this), - (float) ((int) ((d10 * d10 + d10) / 2.0D * 8.0D * (double) f3 + 1.0D))); + (float) ((int) ((d10 * d10 + d10) / 2.0D * 7.0D * (double) f3 + 1.0D))); double d11 = EnchantmentProtection.func_92092_a(entity, d10); entity.motionX += d5 * d11; entity.motionY += d7 * d11; diff --git a/src/main/java/net/minecraft/world/World.java b/src/main/java/net/minecraft/world/World.java index f41a4d8..ca8607f 100644 --- a/src/main/java/net/minecraft/world/World.java +++ b/src/main/java/net/minecraft/world/World.java @@ -17,7 +17,9 @@ import net.hoosiertransfer.Alfheim.ILightingEngineProvider; import net.hoosiertransfer.Alfheim.lighting.LightingEngine; import net.lax1dude.eaglercraft.v1_8.EagRuntime; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; + import java.util.Set; + import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID; import net.lax1dude.eaglercraft.v1_8.HString; @@ -26,6 +28,8 @@ import java.util.concurrent.Callable; import net.minecraft.block.Block; import net.minecraft.block.BlockHopper; import net.minecraft.block.BlockLiquid; +import net.minecraft.block.BlockPistonBase; +import net.minecraft.block.BlockPistonExtension; import net.minecraft.block.BlockSlab; import net.minecraft.block.BlockSnow; import net.minecraft.block.BlockStairs; @@ -2044,6 +2048,8 @@ public abstract class World implements IBlockAccess, ILightingEngineProvider, IL public static boolean doesBlockHaveSolidTopSurface(IBlockAccess blockAccess, BlockPos pos) { IBlockState iblockstate = blockAccess.getBlockState(pos); Block block = iblockstate.getBlock(); + if (block instanceof BlockPistonExtension && iblockstate.getValue(BlockPistonExtension.FACING) == EnumFacing.UP) return true; + if (block instanceof BlockPistonBase && (!((Boolean)iblockstate.getValue(BlockPistonBase.EXTENDED)).booleanValue() || iblockstate.getValue(BlockPistonBase.FACING) == EnumFacing.DOWN)) return true; return block.getMaterial().isOpaque() && block.isFullCube() ? true : (block instanceof BlockStairs ? iblockstate.getValue(BlockStairs.HALF) == BlockStairs.EnumHalf.TOP : (block instanceof BlockSlab