diff --git a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java index f71f13654..130249d3f 100644 --- a/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/src/main/java/vazkii/botania/client/core/proxy/ClientProxy.java @@ -69,7 +69,6 @@ import vazkii.botania.client.fx.FXWisp; import vazkii.botania.client.gui.lexicon.GuiLexicon; import vazkii.botania.client.gui.lexicon.GuiLexiconEntry; import vazkii.botania.client.gui.lexicon.GuiLexiconIndex; -// todo 1.8.8 restore when nei updates import vazkii.botania.client.integration.nei.NEIGuiHooks; import vazkii.botania.client.render.entity.RenderBabylonWeapon; import vazkii.botania.client.render.entity.RenderCorporeaSpark; import vazkii.botania.client.render.entity.RenderDoppleganger; diff --git a/src/main/java/vazkii/botania/client/fx/FXWisp.java b/src/main/java/vazkii/botania/client/fx/FXWisp.java index e5a4ac533..e7889398d 100644 --- a/src/main/java/vazkii/botania/client/fx/FXWisp.java +++ b/src/main/java/vazkii/botania/client/fx/FXWisp.java @@ -84,7 +84,7 @@ public class FXWisp extends EntityFX { Minecraft.getMinecraft().renderEngine.bindTexture(ConfigHandler.matrixMode ? ObfuscationHelper.getParticleTexture() : particles); if(!queuedRenders.isEmpty()) { - tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); for(FXWisp wisp : queuedRenders) wisp.renderQueued(tessellator, true); tessellator.draw(); @@ -92,7 +92,7 @@ public class FXWisp extends EntityFX { if(!queuedDepthIgnoringRenders.isEmpty()) { GlStateManager.disableDepth(); - tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR); + tessellator.getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_LMAP_COLOR); for(FXWisp wisp : queuedDepthIgnoringRenders) wisp.renderQueued(tessellator, false); tessellator.draw(); @@ -118,11 +118,13 @@ public class FXWisp extends EntityFX { float f11 = (float)(prevPosX + (posX - prevPosX) * f - interpPosX); float f12 = (float)(prevPosY + (posY - prevPosY) * f - interpPosY); float f13 = (float)(prevPosZ + (posZ - prevPosZ) * f - interpPosZ); - // todo 1.8.8 setbrightness call? - tessellator.getBuffer().pos(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10).tex(0, 1).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); - tessellator.getBuffer().pos(f11 - f1 * f10 + f4 * f10, f12 + f2 * f10, f13 - f3 * f10 + f5 * f10).tex(1, 1).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); - tessellator.getBuffer().pos(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10).tex(1, 0).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); - tessellator.getBuffer().pos(f11 + f1 * f10 - f4 * f10, f12 - f2 * f10, f13 + f3 * f10 - f5 * f10).tex(0, 0).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); + int combined = 15 << 20 | 15 << 4; + int k3 = combined >> 16 & 0xFFFF; + int l3 = combined & 0xFFFF; + tessellator.getBuffer().pos(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10).tex(0, 1).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); + tessellator.getBuffer().pos(f11 - f1 * f10 + f4 * f10, f12 + f2 * f10, f13 - f3 * f10 + f5 * f10).tex(1, 1).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); + tessellator.getBuffer().pos(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10).tex(1, 0).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); + tessellator.getBuffer().pos(f11 + f1 * f10 - f4 * f10, f12 - f2 * f10, f13 + f3 * f10 - f5 * f10).tex(0, 0).lightmap(k3, l3).color(particleRed, particleGreen, particleBlue, 0.5F).endVertex(); } @Override diff --git a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java index 82211babc..4dce7062c 100644 --- a/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockModDoubleFlower.java @@ -95,45 +95,13 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I } @Override - public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) { - return true; + public boolean canHarvestBlock(IBlockAccess world, BlockPos pos, EntityPlayer player) { + return false; } @Override - public void harvestBlock(World p_149636_1_, EntityPlayer p_149636_2_, BlockPos pos, IBlockState state, TileEntity te, ItemStack stack) { - if(p_149636_1_.isRemote || stack == null || stack.getItem() != Items.shears || state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.LOWER) - harvestBlockCopy(p_149636_1_, p_149636_2_, pos, state); - } - - // This is how I get around encapsulation - // todo 1.9 is this necessary? - public void harvestBlockCopy(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state) { - player.addStat(StatList.getBlockStats(this)); - player.addExhaustion(0.025F); - - if (this.canSilkHarvest(worldIn, pos, worldIn.getBlockState(pos), player) && EnchantmentHelper.getEnchantmentLevel(Enchantments.silkTouch, player.getHeldItemMainhand()) > 0) - { - java.util.ArrayList items = new java.util.ArrayList<>(); - ItemStack itemstack = this.createStackedBlock(state); - - if (itemstack != null) - { - items.add(itemstack); - } - - net.minecraftforge.event.ForgeEventFactory.fireBlockHarvesting(items, worldIn, pos, worldIn.getBlockState(pos), 0, 1.0f, true, player); - for (ItemStack stack : items) - { - spawnAsEntity(worldIn, pos, stack); - } - } - else - { - harvesters.set(player); - int i = EnchantmentHelper.getEnchantmentLevel(Enchantments.fortune, player.getHeldItemMainhand()); - this.dropBlockAsItem(worldIn, pos, state, i); - harvesters.set(null); - } + public boolean canUseBonemeal(World worldIn, Random rand, BlockPos pos, IBlockState state) { + return true; } @Override @@ -162,7 +130,7 @@ public abstract class BlockModDoubleFlower extends BlockDoublePlant implements I } } else if(player.capabilities.isCreativeMode && world.getBlockState(pos.up()).getBlock() == this) world.setBlockState(pos.up(), Blocks.air.getDefaultState(), 2); - + player.addStat(StatList.getBlockStats(this)); //super.onBlockHarvested(p_149681_1_, p_149681_2_, p_149681_3_, p_149681_4_, p_149681_5_, p_149681_6_); } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java b/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java index 80d48a254..c9d18f52d 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java @@ -23,6 +23,7 @@ import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fml.common.registry.VillagerRegistry; public class TileCocoon extends TileMod { @@ -53,7 +54,7 @@ public class TileCocoon extends TileMod { if(Math.random() < villagerChance) { EntityVillager villager = new EntityVillager(worldObj); - // todo 1.8 village registry incomplete. VillagerRegistry.applyRandomTrade(villager, worldObj.rand); + VillagerRegistry.setRandomProfession(villager, worldObj.rand); entity = villager; } else { float specialChance = 0.05F; diff --git a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java index f3622c3ef..09a1d215e 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java +++ b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java @@ -60,6 +60,7 @@ import net.minecraft.util.text.Style; import net.minecraft.util.text.TextComponentTranslation; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.BossInfo; +import net.minecraft.world.BossInfoServer; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; @@ -127,14 +128,16 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi private static final List CHEATY_BLOCKS = Arrays.asList("OpenBlocks:beartrap", "ThaumicTinkerer:magnet"); - boolean spawnLandmines = false; - boolean spawnPixies = false; - boolean anyWithArmor = false; + private boolean spawnLandmines = false; + private boolean spawnPixies = false; + private boolean anyWithArmor = false; - List playersWhoAttacked = new ArrayList<>(); + private List playersWhoAttacked = new ArrayList<>(); private static boolean isPlayingMusic = false; + private final BossInfoServer bossInfo = (BossInfoServer) (new BossInfoServer(this.getDisplayName(), BossInfo.Color.PINK, BossInfo.Overlay.PROGRESS)).setDarkenSky(true); + public EntityDoppleganger(World par1World) { super(par1World); setSize(0.6F, 1.8F); @@ -505,7 +508,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi super.setDead(); } - public List getPlayersAround() { + private List getPlayersAround() { BlockPos source = getSource(); float range = 15F; return worldObj.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(source.getX() + 0.5 - range, source.getY() + 0.5 - range, source.getZ() + 0.5 - range, source.getX() + 0.5 + range, source.getY() + 0.5 + range, source.getZ() + 0.5 + range)); @@ -762,7 +765,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } } - void spawnMissile() { + private void spawnMissile() { if(!worldObj.isRemote) { EntityMagicMissile missile = new EntityMagicMissile(this, true); missile.setPosition(posX + (Math.random() - 0.5 * 0.1), posY + 2.4 + (Math.random() - 0.5 * 0.1), posZ + (Math.random() - 0.5 * 0.1)); @@ -773,7 +776,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } } - public static boolean isCheatyBlock(World world, BlockPos pos) { + private static boolean isCheatyBlock(World world, BlockPos pos) { Block block = world.getBlockState(pos).getBlock(); String name = Block.blockRegistry.getNameForObject(block).toString(); return CHEATY_BLOCKS.contains(name); @@ -781,14 +784,14 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi // EntityEnderman code below ============================================================================ - protected boolean teleportRandomly() { + private boolean teleportRandomly() { double d0 = posX + (rand.nextDouble() - 0.5D) * 64.0D; double d1 = posY + (rand.nextInt(64) - 32); double d2 = posZ + (rand.nextDouble() - 0.5D) * 64.0D; return teleportTo(d0, d1, d2); } - protected boolean teleportTo(double par1, double par3, double par5) { + private boolean teleportTo(double par1, double par3, double par5) { double d3 = posX; double d4 = posY; double d5 = posZ; @@ -899,7 +902,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi @Override public BossInfo getBossInfo() { - return null; // todo 1.9 + return bossInfo; } @Override @@ -934,7 +937,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi return background ? null : shaderCallback; } - public static class BeaconComponent extends MultiblockComponent { + private static class BeaconComponent extends MultiblockComponent { public BeaconComponent(BlockPos relPos) { super(relPos, Blocks.iron_block.getDefaultState()); @@ -947,7 +950,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi } - public static class BeaconBeamComponent extends MultiblockComponent { + private static class BeaconBeamComponent extends MultiblockComponent { public BeaconBeamComponent(BlockPos relPos) { super(relPos, Blocks.beacon.getDefaultState());