From cacb5121b39df33243b92c50bca4e337409b9e23 Mon Sep 17 00:00:00 2001 From: Hubry Date: Sat, 14 Mar 2020 12:50:34 +0100 Subject: [PATCH 01/17] Cocoons can now be forced to spawn rare mobs with gaia spirits Tweaks to cocoon emerald particles to reduce overlap --- .../vazkii/botania/common/block/BlockCocoon.java | 14 ++++++++++++-- .../botania/common/block/tile/TileCocoon.java | 16 +++++++++++++--- .../resources/assets/botania/lang/en_us.json | 2 +- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/BlockCocoon.java b/src/main/java/vazkii/botania/common/block/BlockCocoon.java index 98e0238bb..ebf25ab00 100644 --- a/src/main/java/vazkii/botania/common/block/BlockCocoon.java +++ b/src/main/java/vazkii/botania/common/block/BlockCocoon.java @@ -28,7 +28,10 @@ import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.world.IBlockReader; import net.minecraft.world.World; import net.minecraft.world.server.ServerWorld; + +import vazkii.botania.client.fx.WispParticleData; import vazkii.botania.common.block.tile.TileCocoon; +import vazkii.botania.common.item.ModItems; import javax.annotation.Nonnull; @@ -74,18 +77,25 @@ public class BlockCocoon extends BlockMod { TileCocoon cocoon = (TileCocoon) world.getTileEntity(pos); Item item = stack.getItem(); - if(cocoon != null && (item == Items.EMERALD || item == Items.CHORUS_FRUIT)) { + if(cocoon != null && (item == Items.EMERALD || item == Items.CHORUS_FRUIT || item == ModItems.lifeEssence)) { if(!world.isRemote) { if(item == Items.EMERALD && cocoon.emeraldsGiven < TileCocoon.MAX_EMERALDS) { if(!creative) stack.shrink(1); cocoon.emeraldsGiven++; - ((ServerWorld) world).spawnParticle(ParticleTypes.HAPPY_VILLAGER, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0, 0, 0, 0.5); + ((ServerWorld) world).spawnParticle(ParticleTypes.HAPPY_VILLAGER, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 1, 0.1, 0.05, 0.1, 0.5); } else if(item == Items.CHORUS_FRUIT && cocoon.chorusFruitGiven < TileCocoon.MAX_CHORUS_FRUITS) { if(!creative) stack.shrink(1); cocoon.chorusFruitGiven++; ((ServerWorld) world).spawnParticle(ParticleTypes.PORTAL, pos.getX() + 0.5, pos.getY(), pos.getZ() + 0.5, 32, 0, 0, 0, 0.5); + } else if (item == ModItems.lifeEssence && !cocoon.gaiaSpiritGiven) { + if(!creative) { + stack.shrink(1); + } + cocoon.forceRare(); + WispParticleData data = WispParticleData.wisp(0.6F, 0F, 1F, 0F); + ((ServerWorld) world).spawnParticle(data, pos.getX() + 0.5, pos.getY() + 0.7, pos.getZ() + 0.5, 8, 0.1, 0.1, 0.1, 0.04); } } 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 eb3205e27..e8e0afb12 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileCocoon.java @@ -38,6 +38,8 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{ private static final String TAG_TIME_PASSED = "timePassed"; private static final String TAG_EMERALDS_GIVEN = "emeraldsGiven"; private static final String TAG_CHORUS_FRUIT_GIVEN = "chorusFruitGiven"; + private static final String TAG_GAIA_SPIRIT_GIVEN = "gaiaSpiritGiven"; + private static final List> SPECIALS = ImmutableList.of( EntityType.HORSE, EntityType.DONKEY, EntityType.WOLF, EntityType.OCELOT, EntityType.CAT, EntityType.PARROT, EntityType.LLAMA, EntityType.FOX, @@ -58,6 +60,7 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{ public int timePassed; public int emeraldsGiven; public int chorusFruitGiven; + public boolean gaiaSpiritGiven; public TileCocoon() { super(TYPE); @@ -77,6 +80,7 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{ MobEntity entity = null; BlockPos placePos = pos; + float rareChance = gaiaSpiritGiven ? 1F : SPECIAL_CHANCE; float villagerChance = Math.min(1F, (float) emeraldsGiven / (float) MAX_EMERALDS); float shulkerChance = Math.min(1F, (float) chorusFruitGiven / (float) MAX_CHORUS_FRUITS); @@ -103,13 +107,13 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{ entity = villager; } else if (!validWater.isEmpty()) { placePos = validWater.get(world.rand.nextInt(validWater.size())); - if (Math.random() < SPECIAL_CHANCE) { + if (Math.random() < rareChance) { entity = EntityType.DOLPHIN.create(world); } else { entity = AQUATIC.get(world.rand.nextInt(AQUATIC.size())).create(world); } } else { - if(Math.random() < SPECIAL_CHANCE) { + if(Math.random() < rareChance) { entity = SPECIALS.get(world.rand.nextInt(SPECIALS.size())).create(world); } else { EntityType type = NORMALS.get(world.rand.nextInt(NORMALS.size())); @@ -131,11 +135,17 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{ } } + public void forceRare() { + gaiaSpiritGiven = true; + timePassed = Math.min(timePassed, TOTAL_TIME / 3); + } + @Override public void writePacketNBT(CompoundNBT cmp) { cmp.putInt(TAG_TIME_PASSED, timePassed); cmp.putInt(TAG_EMERALDS_GIVEN, emeraldsGiven); cmp.putInt(TAG_CHORUS_FRUIT_GIVEN, chorusFruitGiven); + cmp.putBoolean(TAG_GAIA_SPIRIT_GIVEN, gaiaSpiritGiven); } @Override @@ -143,6 +153,6 @@ public class TileCocoon extends TileMod implements ITickableTileEntity{ timePassed = cmp.getInt(TAG_TIME_PASSED); emeraldsGiven = cmp.getInt(TAG_EMERALDS_GIVEN); chorusFruitGiven = cmp.getInt(TAG_CHORUS_FRUIT_GIVEN); + gaiaSpiritGiven = cmp.getBoolean(TAG_GAIA_SPIRIT_GIVEN); } - } diff --git a/src/main/resources/assets/botania/lang/en_us.json b/src/main/resources/assets/botania/lang/en_us.json index 14d0b30aa..1ef08c15e 100644 --- a/src/main/resources/assets/botania/lang/en_us.json +++ b/src/main/resources/assets/botania/lang/en_us.json @@ -2433,7 +2433,7 @@ "botania.entry.cocoon": "Cocoon of Caprice", "botania.tagline.cocoon": "Hatch your own animals", "botania.page.cocoon0": "A cocoon is a symbol of change, of evolution.$(p)A $(item)Cocoon of Caprice$(0), when placed, will slowly evolve the rudimentary bits of life inside into a $(item)Baby Animal$(0). More often than not, the cocoon will hatch into a farm animal, but on rare occasions, different animals such as $(item)Wolves$(0) or $(item)Horses$(0) can be created.", - "botania.page.cocoon1": "A cocoon near water seems to create aquatic animals instead.$(p)Rumor has it that giving a cocoon $(item)Emeralds$(0) or $(item)Chorus Fruit$(0) will influence its outcome towards something... different. What such experiments would yield is anyone's guess, really.$(p)(Giving a cocoon an item can be done via right-click or by simply tossing the item.)", + "botania.page.cocoon1": "A cocoon near water seems to create aquatic animals instead.$(p)Rumor has it that giving a cocoon $(item)Emeralds$(0), $(item)Chorus Fruit$(0), or a certain $(l:alfhomancy/gaia_ritual)$(item)otherworldly essence$(0)$(/l) will influence its outcome towards something... different. What such experiments would yield is anyone's guess, really.$(p)(Giving a cocoon an item can be done via right-click or by simply tossing the item.)", "botania.page.cocoon2": "New World, Perfect World", "botania.entry.manaBomb": "Manastorm Charge", From ad7666e66817a7b49a5dda3aeb7b99e93dce53e1 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sun, 15 Mar 2020 21:46:17 +0000 Subject: [PATCH 02/17] Update contributors.properties --- contributors.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.properties b/contributors.properties index 79c5c3899..316ee30a4 100644 --- a/contributors.properties +++ b/contributors.properties @@ -311,3 +311,4 @@ jalewis1990=manastar flarefolf=10 24minecraftsam=9 lewdc1na=15 +bryceio=14 From 9d99c7184f2f4c91f2b0890d0cfff4ae4478474e Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Thu, 19 Mar 2020 21:04:36 -0500 Subject: [PATCH 03/17] Account for nullable placer in onBlockPlacedBy. Closes #3215 --- .../vazkii/botania/api/subtile/TileEntitySpecialFlower.java | 2 +- .../vazkii/botania/common/block/BlockAnimatedTorch.java | 3 ++- .../botania/common/block/BlockFloatingSpecialFlower.java | 3 ++- .../vazkii/botania/common/block/BlockSpecialFlower.java | 3 ++- .../vazkii/botania/common/block/decor/BlockTinyPotato.java | 3 ++- .../vazkii/botania/common/block/mana/BlockSpreader.java | 6 +++--- .../vazkii/botania/common/block/tile/TileAnimatedTorch.java | 3 ++- 7 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java b/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java index 6f6297c5a..17634ded3 100644 --- a/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java +++ b/src/main/java/vazkii/botania/api/subtile/TileEntitySpecialFlower.java @@ -232,7 +232,7 @@ public class TileEntitySpecialFlower extends TileEntity implements ITickableTile /** * Called when this sub tile is placed in the world (by an entity). */ - public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity entity, ItemStack stack) {} + public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, @Nullable LivingEntity entity, ItemStack stack) {} /** * Called when a player right clicks this sub tile. diff --git a/src/main/java/vazkii/botania/common/block/BlockAnimatedTorch.java b/src/main/java/vazkii/botania/common/block/BlockAnimatedTorch.java index a0aac5cfc..4eab7dd9f 100644 --- a/src/main/java/vazkii/botania/common/block/BlockAnimatedTorch.java +++ b/src/main/java/vazkii/botania/common/block/BlockAnimatedTorch.java @@ -36,6 +36,7 @@ import vazkii.botania.api.wand.IWandable; import vazkii.botania.common.block.tile.TileAnimatedTorch; import javax.annotation.Nonnull; +import javax.annotation.Nullable; public class BlockAnimatedTorch extends BlockMod implements IWandable, IManaTrigger, IHourglassTrigger, IWandHUD { @@ -56,7 +57,7 @@ public class BlockAnimatedTorch extends BlockMod implements IWandable, IManaTrig } @Override - public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity entity, ItemStack stack) { + public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, @Nullable LivingEntity entity, ItemStack stack) { ((TileAnimatedTorch) world.getTileEntity(pos)).onPlace(entity); } diff --git a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java index afe1bbf35..e92d5d53a 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java @@ -34,6 +34,7 @@ import vazkii.botania.api.wand.IWandable; import vazkii.botania.common.block.decor.BlockFloatingFlower; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.List; import java.util.Random; import java.util.function.Supplier; @@ -100,7 +101,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I } @Override - public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity entity, ItemStack stack) { + public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, @Nullable LivingEntity entity, ItemStack stack) { ((TileEntitySpecialFlower) world.getTileEntity(pos)).onBlockPlacedBy(world, pos, state, entity, stack); } diff --git a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java index 38ee01953..e02de97a7 100644 --- a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java @@ -41,6 +41,7 @@ import vazkii.botania.api.wand.IWandable; import vazkii.botania.common.item.material.ItemDye; import javax.annotation.Nonnull; +import javax.annotation.Nullable; import java.util.List; import java.util.function.Supplier; @@ -134,7 +135,7 @@ public class BlockSpecialFlower extends FlowerBlock implements IWandable, IWandH } @Override - public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity entity, ItemStack stack) { + public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, @Nullable LivingEntity entity, ItemStack stack) { ((TileEntitySpecialFlower) world.getTileEntity(pos)).onBlockPlacedBy(world, pos, state, entity, stack); } diff --git a/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java b/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java index c729ebaf1..0541f15cf 100644 --- a/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java +++ b/src/main/java/vazkii/botania/common/block/decor/BlockTinyPotato.java @@ -37,6 +37,7 @@ import vazkii.botania.common.block.tile.TileTinyPotato; import vazkii.botania.common.core.helper.InventoryHelper; import javax.annotation.Nonnull; +import javax.annotation.Nullable; public class BlockTinyPotato extends BlockMod { @@ -87,7 +88,7 @@ public class BlockTinyPotato extends BlockMod { } @Override - public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity par5EntityLiving, ItemStack stack) { + public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, @Nullable LivingEntity living, ItemStack stack) { if (stack.hasDisplayName()) ((TileTinyPotato) world.getTileEntity(pos)).name = stack.getDisplayName(); } diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java b/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java index af8bb84b6..2d0adb0d3 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java @@ -74,8 +74,8 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, IWir } @Override - public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) { - Direction orientation = Direction.getFacingDirections(placer)[0].getOpposite(); + public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, @Nullable LivingEntity placer, ItemStack stack) { + Direction orientation = placer == null ? Direction.WEST : Direction.getFacingDirections(placer)[0].getOpposite(); TileSpreader spreader = (TileSpreader) world.getTileEntity(pos); switch(orientation) { @@ -93,7 +93,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, IWir break; case WEST: break; - default: + case EAST: spreader.rotationX = 180F; break; } diff --git a/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java b/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java index fcda7c43a..25f45857d 100644 --- a/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java +++ b/src/main/java/vazkii/botania/common/block/tile/TileAnimatedTorch.java @@ -28,6 +28,7 @@ import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.lib.LibBlockNames; import vazkii.botania.common.lib.LibMisc; +import javax.annotation.Nullable; import java.util.Arrays; public class TileAnimatedTorch extends TileMod implements ITickableTileEntity { @@ -76,7 +77,7 @@ public class TileAnimatedTorch extends TileMod implements ITickableTileEntity { world.addBlockEvent(getPos(), ModBlocks.animatedTorch, 0, (side + 1) % 4); } - public void onPlace(LivingEntity entity) { + public void onPlace(@Nullable LivingEntity entity) { if(entity != null) { side = Arrays.asList(SIDES).indexOf(entity.getHorizontalFacing().getOpposite()); } From 24b6f06a8095a0c684aafeefe94c47cb1f085f9a Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Thu, 19 Mar 2020 21:25:17 -0500 Subject: [PATCH 04/17] Fix a bunch of waterlogging edge cases. Closes #3188 --- .../botania/common/block/BlockPistonRelay.java | 3 ++- .../botania/common/item/ItemLaputaShard.java | 8 +++++++- .../botania/common/item/lens/LensPiston.java | 15 +++++++++++++-- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java b/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java index 5768bc0ea..1c3ce2791 100644 --- a/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java +++ b/src/main/java/vazkii/botania/common/block/BlockPistonRelay.java @@ -46,6 +46,7 @@ import net.minecraftforge.fml.server.ServerLifecycleHooks; import vazkii.botania.api.wand.IWandable; import vazkii.botania.common.core.handler.ModSounds; import vazkii.botania.common.item.ItemTwigWand; +import vazkii.botania.common.item.lens.LensPiston; import vazkii.botania.common.network.PacketBotaniaEffect; import vazkii.botania.common.network.PacketHandler; @@ -246,7 +247,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable { Material destMat = world.getBlockState(destPos.offset(dir)).getMaterial(); if(world.isAirBlock(destPos.offset(dir)) || destMat.isReplaceable()) { world.setBlockState(destPos, Blocks.AIR.getDefaultState()); - world.setBlockState(destPos.offset(dir), srcState); + world.setBlockState(destPos.offset(dir), LensPiston.unWaterlog(srcState)); mappedPositions.put(s, GlobalPos.of(world.getDimension().getType(), destPos.offset(dir))); } } diff --git a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java index a87eb0286..c9d902a3e 100644 --- a/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java +++ b/src/main/java/vazkii/botania/common/item/ItemLaputaShard.java @@ -24,6 +24,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; import net.minecraft.particles.BlockParticleData; import net.minecraft.particles.ParticleTypes; +import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ActionResultType; import net.minecraft.util.NonNullList; @@ -153,7 +154,8 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet TileEntity newTile = block.createTileEntity(state, world); world.setTileEntity(pos_, newTile); } - world.destroyBlock(pos_, false); + world.playEvent(2001, pos_, Block.getStateId(state)); + world.setBlockState(pos_, Blocks.AIR.getDefaultState()); ItemStack copyLens = new ItemStack(this); copyLens.getOrCreateTag().putInt(TAG_LEVEL, getShardLevel(shard)); @@ -255,6 +257,10 @@ public class ItemLaputaShard extends ItemMod implements ILensEffect, ITinyPlanet state = NBTUtil.readBlockState(lens.getTag().getCompound(TAG_STATE)); } + if (entity.world.getDimension().doesWaterVaporize() && state.has(BlockStateProperties.WATERLOGGED)) { + state = state.with(BlockStateProperties.WATERLOGGED, false); + } + TileEntity tile = null; CompoundNBT tilecmp = ItemNBTHelper.getCompound(lens, TAG_TILE, false); if(tilecmp.contains("id")) diff --git a/src/main/java/vazkii/botania/common/item/lens/LensPiston.java b/src/main/java/vazkii/botania/common/item/lens/LensPiston.java index 3007cbb93..7968eabaf 100644 --- a/src/main/java/vazkii/botania/common/item/lens/LensPiston.java +++ b/src/main/java/vazkii/botania/common/item/lens/LensPiston.java @@ -10,11 +10,13 @@ */ package vazkii.botania.common.item.lens; +import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.block.material.PushReaction; import net.minecraft.entity.projectile.ThrowableEntity; import net.minecraft.item.ItemStack; +import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; @@ -40,8 +42,9 @@ public class LensPiston extends Lens { if(state.getPushReaction() == PushReaction.NORMAL && state.getBlock() != Blocks.OBSIDIAN && state.getBlockHardness(entity.world, pos_) >= 0 && tile == null) { - entity.world.destroyBlock(rtr.getPos(), false); - entity.world.setBlockState(pos_, state, 1 | 2); + entity.world.playEvent(2001, rtr.getPos(), Block.getStateId(state)); + entity.world.setBlockState(rtr.getPos(), Blocks.AIR.getDefaultState()); + entity.world.setBlockState(pos_, unWaterlog(state)); } } } @@ -50,4 +53,12 @@ public class LensPiston extends Lens { return dead; } + public static BlockState unWaterlog(BlockState state) { + if (state.has(BlockStateProperties.WATERLOGGED)) { + return state.with(BlockStateProperties.WATERLOGGED, false); + } else { + return state; + } + } + } From d67e884b6928d3467779493ab10e1a6d605304e9 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 21 Mar 2020 16:38:30 +0000 Subject: [PATCH 05/17] Update contributors.properties --- contributors.properties | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/contributors.properties b/contributors.properties index 316ee30a4..2d425c7fb 100644 --- a/contributors.properties +++ b/contributors.properties @@ -312,3 +312,43 @@ flarefolf=10 24minecraftsam=9 lewdc1na=15 bryceio=14 +daveyx0=11 +drrk=11 +skyshayde=spectrolus +softwerker=4 +uv_searching=1 +edacth=hydroangeas +omgmypoppit=orechid +satosha=6 +noobfortress=10 +jfkxc=fallenkanade +neeko_iko=3 +artanis199=dandelifeon +matthew_117=10 +nillermeddild=10 +dizzydizzyd=15 +thelucraft=5 +spectacular101=pollidisiac +marvin=hopperhock_chibi +bigal607=0 +the_shadow_=11 +traverse_joe=3 +talanist=loonium +matthijsvdmeulen=3 +prototypep=manastar +kingofaces2=fallenkanade +antimuffn=2 +qsflay=14 +briguy64=kekimurus +xnerbop596=0 +ssyl=15 +agnor99=munchdew +sexbeine=13 +atomicmage=0 +dead_gyps=0 +samboy063=fallenkanade +pha3l=11 +nuc1e4r5n4k3=2 +mirrorsound=shulk_me_not +ivystar12=10 +sirjamu=6 From e0cc95c52161406ddb9d69976bafa190319a006a Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 21 Mar 2020 17:31:35 +0000 Subject: [PATCH 06/17] Update contributors.properties --- contributors.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.properties b/contributors.properties index 2d425c7fb..33c0c5be8 100644 --- a/contributors.properties +++ b/contributors.properties @@ -352,3 +352,4 @@ nuc1e4r5n4k3=2 mirrorsound=shulk_me_not ivystar12=10 sirjamu=6 +minimarm=6 From 527e3b07fdf5e257522a0971bd859c34a59e5ad8 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 21 Mar 2020 20:24:33 +0000 Subject: [PATCH 07/17] Update contributors.properties --- contributors.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.properties b/contributors.properties index 33c0c5be8..b9a47f013 100644 --- a/contributors.properties +++ b/contributors.properties @@ -353,3 +353,4 @@ mirrorsound=shulk_me_not ivystar12=10 sirjamu=6 minimarm=6 +chupacaubrey=10 From 1a0c730b4ff3e57578dc0521d8371a4199e540e7 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Mon, 23 Mar 2020 01:20:21 +0000 Subject: [PATCH 08/17] Update contributors.properties --- contributors.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.properties b/contributors.properties index b9a47f013..2a06d45e6 100644 --- a/contributors.properties +++ b/contributors.properties @@ -354,3 +354,4 @@ ivystar12=10 sirjamu=6 minimarm=6 chupacaubrey=10 +kilofman=gourmaryllis From 64bd4cb39036e0cb3cacb1cd1d7a596ae5dd4537 Mon Sep 17 00:00:00 2001 From: Hubry Date: Wed, 25 Mar 2020 20:23:35 +0100 Subject: [PATCH 09/17] Fix bergamute wrapped sounds being discarded as silent, closes #3218 --- .../common/block/subtile/functional/BergamuteEventHandler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java b/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java index f17621b26..47f5a4e28 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java +++ b/src/main/java/vazkii/botania/common/block/subtile/functional/BergamuteEventHandler.java @@ -89,6 +89,7 @@ public class BergamuteEventHandler { @Override public float getX() { return compose.getX(); } @Override public float getY() { return compose.getY(); } @Override public float getZ() { return compose.getZ(); } + @Override public boolean canBeSilent() { return compose.canBeSilent(); } @Nonnull @Override public AttenuationType getAttenuationType() { return compose.getAttenuationType(); } } From 5c22d60477eea7bd0fad85a0bf64d044f9016bde Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Thu, 26 Mar 2020 17:31:24 +0000 Subject: [PATCH 10/17] Update contributors.properties --- contributors.properties | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contributors.properties b/contributors.properties index 2a06d45e6..46a92ba33 100644 --- a/contributors.properties +++ b/contributors.properties @@ -229,7 +229,7 @@ xenolicious=15 cellmembrane=3 mr_hacks101=shulk_me_not nerevardzn=9 -cosmicparticl=15 +cosmicparticl=rafflowsia hypnoticharry=2 shawndaddy=4 quaternary=6 @@ -355,3 +355,7 @@ sirjamu=6 minimarm=6 chupacaubrey=10 kilofman=gourmaryllis +daPorkchop_=4 +c4j3=fallenkanade +tbk_iron=dreadthorne +italicsjenga=15 From 02c3c82cf3e4fb4324f02b4c99d9cb1b08c43fb4 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 28 Mar 2020 10:48:15 +0000 Subject: [PATCH 11/17] Update contributors.properties --- contributors.properties | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contributors.properties b/contributors.properties index 46a92ba33..94e85b793 100644 --- a/contributors.properties +++ b/contributors.properties @@ -359,3 +359,5 @@ daPorkchop_=4 c4j3=fallenkanade tbk_iron=dreadthorne italicsjenga=15 +teendude=2 +eternalone=5 From c412c671f92178dc61b2b55dcfd65390f50cb5e3 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 28 Mar 2020 18:56:57 +0000 Subject: [PATCH 12/17] Update contributors.properties --- contributors.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributors.properties b/contributors.properties index 94e85b793..fd1d685a7 100644 --- a/contributors.properties +++ b/contributors.properties @@ -361,3 +361,6 @@ tbk_iron=dreadthorne italicsjenga=15 teendude=2 eternalone=5 +gnomemaster42=daffomill +retfar=11 +pabthelamb=4 From 90b5f32a60229f12a0ef6e8e93c277113d46f2fc Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sun, 29 Mar 2020 06:59:33 +0100 Subject: [PATCH 13/17] Update contributors.properties --- contributors.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.properties b/contributors.properties index fd1d685a7..afe66ef6b 100644 --- a/contributors.properties +++ b/contributors.properties @@ -364,3 +364,4 @@ eternalone=5 gnomemaster42=daffomill retfar=11 pabthelamb=4 +lotlahzii=2 From ba943c81580fa9fab7c1d3438bbcabfb741a561f Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 4 Apr 2020 00:13:37 +0100 Subject: [PATCH 14/17] Update contributors.properties --- contributors.properties | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/contributors.properties b/contributors.properties index afe66ef6b..0daea2959 100644 --- a/contributors.properties +++ b/contributors.properties @@ -365,3 +365,8 @@ gnomemaster42=daffomill retfar=11 pabthelamb=4 lotlahzii=2 +sterrywhals=14 +drklicker=11 +pieterv24=dandelifeon +pilkae10=14 +blacbirdjr=0 From 37f60f05a5eab8193aa3776316b5648ced9afe03 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sat, 4 Apr 2020 18:46:09 -0500 Subject: [PATCH 15/17] Fix #3225 hopefully. My workspace is broken so I can't test --- .../common/core/helper/PlayerHelper.java | 15 ++++++++++++-- .../botania/common/item/ItemSpawnerMover.java | 20 ++++++++++++++----- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/main/java/vazkii/botania/common/core/helper/PlayerHelper.java b/src/main/java/vazkii/botania/common/core/helper/PlayerHelper.java index e92c284b1..982de491a 100644 --- a/src/main/java/vazkii/botania/common/core/helper/PlayerHelper.java +++ b/src/main/java/vazkii/botania/common/core/helper/PlayerHelper.java @@ -1,16 +1,19 @@ package vazkii.botania.common.core.helper; +import com.mojang.datafixers.util.Pair; import net.minecraft.advancements.Advancement; import net.minecraft.advancements.AdvancementManager; import net.minecraft.advancements.PlayerAdvancements; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.util.ActionResultType; import net.minecraft.util.Hand; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; import java.util.function.Predicate; @@ -115,14 +118,20 @@ public final class PlayerHelper { } } + public static ActionResultType substituteUse(ItemUseContext ctx, ItemStack toUse) { + return substituteUseTrackPos(ctx, toUse).getFirst(); + } + /** * Temporarily swap toUse into the hand of the player, use it, then swap it back out. * This is to ensure that any code in mods' onItemUse that relies on player.getHeldItem(ctx.hand) == ctx.stack * will work as intended. * * Properly handles null players, as long as the Item's onItemUse also handles them. + * @return The usage result, as well as a properly offset block position pointing at where the block was placed + * (if the item was a BlockItem) */ - public static ActionResultType substituteUse(ItemUseContext ctx, ItemStack toUse) { + public static Pair substituteUseTrackPos(ItemUseContext ctx, ItemStack toUse) { ItemStack save = ItemStack.EMPTY; BlockRayTraceResult hit = new BlockRayTraceResult(ctx.getHitVec(), ctx.getFace(), ctx.getPos(), ctx.func_221533_k()); ItemUseContext newCtx; @@ -136,13 +145,15 @@ public final class PlayerHelper { newCtx = new ItemUseContext(ctx.getWorld(), null, ctx.getHand(), toUse, hit); } + BlockPos finalPos = new BlockItemUseContext(newCtx).getPos(); + ActionResultType result = toUse.onItemUse(newCtx); if(ctx.getPlayer() != null) { ctx.getPlayer().setHeldItem(ctx.getHand(), save); } - return result; + return Pair.of(result, finalPos); } private PlayerHelper() {} diff --git a/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java b/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java index 4d051af78..059e7727d 100644 --- a/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java +++ b/src/main/java/vazkii/botania/common/item/ItemSpawnerMover.java @@ -10,11 +10,13 @@ */ package vazkii.botania.common.item; +import com.mojang.datafixers.util.Pair; import net.minecraft.block.Blocks; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.entity.EntityType; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUseContext; import net.minecraft.nbt.CompoundNBT; @@ -91,18 +93,26 @@ public class ItemSpawnerMover extends ItemMod { private ActionResultType placeSpawner(ItemUseContext ctx) { ItemStack useStack = new ItemStack(Blocks.SPAWNER); - useStack.getOrCreateTag().put("BlockEntityTag", ctx.getItem().getChildTag(TAG_SPAWNER)); - ActionResultType res = PlayerHelper.substituteUse(ctx, useStack); + Pair res = PlayerHelper.substituteUseTrackPos(ctx, useStack); - if(res == ActionResultType.SUCCESS) { + if(res.getFirst() == ActionResultType.SUCCESS) { World world = ctx.getWorld(); - BlockPos pos = ctx.getPos(); + BlockPos pos = res.getSecond(); ItemStack mover = ctx.getItem(); if(!world.isRemote) { if(ctx.getPlayer() != null) ctx.getPlayer().sendBreakAnimation(ctx.getHand()); mover.shrink(1); + + TileEntity te = world.getTileEntity(pos); + if (te instanceof MobSpawnerTileEntity) { + CompoundNBT spawnerTag = ctx.getItem().getChildTag(TAG_SPAWNER).copy(); + spawnerTag.putInt("x", pos.getX()); + spawnerTag.putInt("y", pos.getY()); + spawnerTag.putInt("z", pos.getZ()); + te.read(spawnerTag); + } } else { for(int i = 0; i < 100; i++) { SparkleParticleData data = SparkleParticleData.sparkle(0.45F + 0.2F * (float) Math.random(), (float) Math.random(), (float) Math.random(), (float) Math.random(), 6); @@ -111,7 +121,7 @@ public class ItemSpawnerMover extends ItemMod { } } - return res; + return res.getFirst(); } private boolean captureSpawner(ItemUseContext ctx) { From 6a6af5535891afe34868cfa0eb4ce48eea49bbf9 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sat, 4 Apr 2020 23:56:39 -0500 Subject: [PATCH 16/17] Build --- build.properties | 4 ++-- version/1.14.4.txt | 2 +- web/versions.ini | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build.properties b/build.properties index 6a95c856a..a7b7de92e 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ # -#Tue Feb 04 17:42:07 CST 2020 +#Sat Apr 04 23:56:30 CDT 2020 version=r1.11 dir_output=../Build Output/Botania/ dir_repo=./ -build_number=379 +build_number=380 mod_name=Botania diff --git a/version/1.14.4.txt b/version/1.14.4.txt index 14ce463e6..97721540a 100644 --- a/version/1.14.4.txt +++ b/version/1.14.4.txt @@ -1 +1 @@ -r1.11-377 \ No newline at end of file +r1.11-379 \ No newline at end of file diff --git a/web/versions.ini b/web/versions.ini index 59b800487..b44dbcc09 100644 --- a/web/versions.ini +++ b/web/versions.ini @@ -320,4 +320,5 @@ r1.11-373=1.14.4 r1.11-374=1.14.4 r1.11-375=1.14.4 r1.11-376=1.14.4 -r1.11-377=1.14.4 \ No newline at end of file +r1.11-377=1.14.4 +r1.11-379=1.14.4 \ No newline at end of file From 573a8fe9d189d8d86c58740b57368ea42b558510 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sun, 5 Apr 2020 00:06:41 -0500 Subject: [PATCH 17/17] Write the changelog and paste the one that somehow never got committed --- web/changelog.txt | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/web/changelog.txt b/web/changelog.txt index 9fb09c078..85f273d67 100644 --- a/web/changelog.txt +++ b/web/changelog.txt @@ -1,3 +1,47 @@ +r1.11 379 +* This is the final build for 1.14.x. See you in 1.15.2 very soon! +* Add additional checks so that crashes unrelated to Botania don't blame Botania +* Fix dyeing fabulous pools not adjusting the color +* Dispensers can now use the Wand of the Forest's sneak right click actions, consult the lexicon for more. (eutropius225) +* Runic Altar and Petal Apothecary fast-recraft no longer consumes items in creative mode +* Fix mana tablet recipe not accepting mana pearls +* Fix bifrost pane being unbreakable +* Fix floating endoflame recipe being missing +* Fix entropinnyum accepting TNT resting in waterlogged blocks +* Fix mana clip attachment destroying lenses +* Fix Resolute Ivy not working on curios +* Fix crash when a minecart that is Spectral Rail boosted lands directly on another Spectral Rail then runs into a normal rail +* Items that generate mana and provide it to other items in inventory only do so serverside. May fix some desyncs. +* Remove "Status Unknown". The current mana levels of all blocks now automatically update. +* Cocoons can now be forced to spawn rare mobs using Gaia Spirits +* Fix rannuncarpus crashing when placing certain blocks +* Fix some mechanisms like the Force Relay/Lens allowing you to move waterlogged blocks +* Fix minecart sounds being silent when Botania is installed +* Fix Life Aggregator not placing down spawners correctly +r1.11 378 +* Fix narslimmus eating spawner-spawned slimes +* Fix exoflames trying to smelt unsmeltable items in some cases +* Hydroangeas now show a durability bar for their decay time +* Fix agricarnation not speeding up sweet berries and bamboo +* Fix a crash in the Platforms +* Cocoon-spawned entities no longer despawn +* Fix Loki Ring being completely broken. There are still some edge-cases left but it should work mostly. +* Loki Ring grid now keeps the center position highlighted in bold for consistency with the building phase +* Replace slots in the Trinket Case texture with a player render (what else would I put there?) +* (Internal) Move recipe jsons to data generator +* Remove old Thaumcraft recipes and integration pages (F to pay respects) +* Fix Rod of Plentiful Mantle showing same color particles for all ores +* Add temporary recipes so the Botania banner patterns are accessible again +* Azulejo can now be crafted with any blue dye +* New Advancement - Hand in Hand - place over 255 blocks at once with a ring of loki +* New Hidden Advancement - That's Why I Baked Bread. Try to figure this one out! It shouldn't be very hard if you know the Botania memes. +* Fix non-English advancement names being broken +* Remove a bunch of dead lang entries +* Fix a bunch of animations stopping and/or jittering when the pause menu is open (even on servers) +* Fix force relays not moving properly when retracted indirectly using slime blocks +* Fix at least one known case of the "chunk loses all light" vanilla bug happening +* Lexicon typo fixes and tweaks (Alwinfy) +* Temporary fix for force relays in non-overworld dimensions not saving r1.11 377 * Fix cell blocks not respecting red string spoofers * Potential fix for lighting issues. Please reset/relight any affected areas and continue monitoring.