From d502c90b914c21cc14682ca6412d76c8f6eebaa2 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 14 Mar 2018 20:12:10 -0500 Subject: [PATCH 01/11] Fix sparks not transferring mana properly to mana-voided pools. Closes #2557 --- .../vazkii/botania/common/block/tile/mana/TilePool.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java index 73f646fe9..02a9a8465 100644 --- a/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java +++ b/src/main/java/vazkii/botania/common/block/tile/mana/TilePool.java @@ -481,7 +481,12 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt @Override public int getAvailableSpaceForMana() { - return Math.max(0, manaCap - getCurrentMana()); + int space = Math.max(0, manaCap - getCurrentMana()); + if(space > 0) + return space; + else if(world.getBlockState(pos.down()).getBlock() == ModBlocks.manaVoid) + return manaCap; + else return 0; } @Override From bb087f3d82c085c24f9ebc06dac97d2f607b19da Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 14 Mar 2018 20:16:40 -0500 Subject: [PATCH 02/11] Fix missing sideonlies, closes #2572 --- src/main/java/vazkii/botania/common/block/mana/BlockPool.java | 1 + .../java/vazkii/botania/common/block/mana/BlockSpreader.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/vazkii/botania/common/block/mana/BlockPool.java b/src/main/java/vazkii/botania/common/block/mana/BlockPool.java index 8683fd4fe..015675883 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockPool.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockPool.java @@ -212,6 +212,7 @@ public class BlockPool extends BlockMod implements IWandHUD, IWandable, ILexicon return TilePool.calculateComparatorLevel(pool.getCurrentMana(), pool.manaCap); } + @SideOnly(Side.CLIENT) @Override public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { ((TilePool) world.getTileEntity(pos)).renderHUD(mc, res); 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 b06e57a19..cdb6c4671 100644 --- a/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java +++ b/src/main/java/vazkii/botania/common/block/mana/BlockSpreader.java @@ -213,6 +213,7 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, ILex return new TileSpreader(); } + @SideOnly(Side.CLIENT) @Override public void renderHUD(Minecraft mc, ScaledResolution res, World world, BlockPos pos) { ((TileSpreader) world.getTileEntity(pos)).renderHUD(mc, res); From 54f901dce916c8e327c5ebbe6d7a4498d0bf6288 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 14 Mar 2018 20:37:48 -0500 Subject: [PATCH 03/11] Featherfeet no longer increases fall distance, fixes #2516 --- .../vazkii/botania/common/brew/potion/PotionFeatherfeet.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java b/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java index d3f7e4e5e..45b9366e8 100644 --- a/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java +++ b/src/main/java/vazkii/botania/common/brew/potion/PotionFeatherfeet.java @@ -29,7 +29,8 @@ public class PotionFeatherfeet extends PotionMod { @Override public void performEffect(@Nonnull EntityLivingBase living, int amplified) { - living.fallDistance = 2.5F; + if(living.fallDistance > 2.5F) + living.fallDistance = 2.5F; } } From 6cc3af360bfa7348a9fe6a044370caa503a6c221 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Wed, 14 Mar 2018 20:50:39 -0500 Subject: [PATCH 04/11] Fix tiny potato banners being unobtainable, closes #2537. Registration was done in preinit before the itemblock was registered --- src/main/java/vazkii/botania/common/Botania.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/vazkii/botania/common/Botania.java b/src/main/java/vazkii/botania/common/Botania.java index 423e9e357..562c87af3 100644 --- a/src/main/java/vazkii/botania/common/Botania.java +++ b/src/main/java/vazkii/botania/common/Botania.java @@ -129,9 +129,7 @@ public class Botania { PacketHandler.init(); ModEntities.init(); ModBrews.init(); - ModMultiblocks.init(); - ModBanners.init(); if(Botania.gardenOfGlassLoaded) new WorldTypeSkyblock(); @@ -147,6 +145,7 @@ public class Botania { @EventHandler public void init(FMLInitializationEvent event) { + ModBanners.init(); ModPetalRecipes.init(); ModPureDaisyRecipes.init(); ModRuneRecipes.init(); From 16afd621527fd115f738acf5af30c00b10aa528b Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Thu, 15 Mar 2018 20:08:03 +0000 Subject: [PATCH 05/11] Update contributors.properties --- contributors.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.properties b/contributors.properties index 1a94f7b7d..9786f997f 100644 --- a/contributors.properties +++ b/contributors.properties @@ -95,3 +95,4 @@ lukidwen=9 quirkyrose=10 cynicalroses=6 adenmck=5 +thenewdreamer=6 From 4e8b4a6422296bc2ec29c40ce8d6ca97ff1bdc0c Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Thu, 15 Mar 2018 16:39:00 -0500 Subject: [PATCH 06/11] Clean up special flower model code. No longer loads all flower models twice --- .../client/model/SpecialFlowerModel.java | 169 +++++++----------- .../common/block/BlockSpecialFlower.java | 2 +- .../botania/blockstates/specialflower.json | 10 +- 3 files changed, 65 insertions(+), 116 deletions(-) diff --git a/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java b/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java index 209f477f6..62a1d3745 100644 --- a/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java +++ b/src/main/java/vazkii/botania/client/model/SpecialFlowerModel.java @@ -8,14 +8,9 @@ */ package vazkii.botania.client.model; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.block.model.BakedQuad; @@ -45,29 +40,25 @@ import net.minecraftforge.common.property.IExtendedBlockState; import org.apache.commons.lang3.tuple.Pair; import vazkii.botania.api.BotaniaAPIClient; import vazkii.botania.api.state.BotaniaStateProps; -import vazkii.botania.common.Botania; -import vazkii.botania.common.block.ModBlocks; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import javax.annotation.Nonnull; import javax.vecmath.Matrix4f; -import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.Map; -import java.util.Optional; import java.util.function.Function; public class SpecialFlowerModel implements IModel { + private static final ModelResourceLocation MISSING = new ModelResourceLocation("builtin/missing", "missing"); + private final ModelResourceLocation baseModel; + private final ImmutableMap blockModels; + private final ImmutableMap itemModels; - // SpecialFlowerModel for when there are no blockModels registered for a subtile - public static final SpecialFlowerModel INSTANCE = new SpecialFlowerModel(ImmutableMap.of(), ImmutableMap.of()); - - private final ImmutableMap, ModelResourceLocation> blockModels; - private final ImmutableMap, ModelResourceLocation> itemModels; - - public SpecialFlowerModel(ImmutableMap, ModelResourceLocation> blockModels, - ImmutableMap, ModelResourceLocation> itemModels) { + private SpecialFlowerModel(ModelResourceLocation baseModel, + ImmutableMap blockModels, + ImmutableMap itemModels) { + this.baseModel = baseModel; this.blockModels = blockModels; this.itemModels = itemModels; } @@ -75,6 +66,8 @@ public class SpecialFlowerModel implements IModel { @Override public Collection getDependencies() { ImmutableSet.Builder builder = ImmutableSet.builder(); + if(!MISSING.equals(baseModel)) + builder.add(baseModel); builder.addAll(blockModels.values()); builder.addAll(itemModels.values()); @@ -91,8 +84,27 @@ public class SpecialFlowerModel implements IModel { @Override public IBakedModel bake(IModelState state, VertexFormat format, Function bakedTextureGetter) { - // "Bake" the SpecialFlowerModel (in reality, just create another wrapper for all the delegate blockModels) - return new SpecialFlowerBakedModel(blockModels, itemModels, PerspectiveMapWrapper.getTransforms(state)); + ImmutableMap transforms = PerspectiveMapWrapper.getTransforms(state); + IModelState transformState = new SimpleModelState(transforms); + + IBakedModel baseModelBaked = ModelLoaderRegistry.getModelOrMissing(baseModel) + .bake(transformState, DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter()); + + ImmutableMap.Builder bakedBlockBuilder = ImmutableMap.builder(); + for(Map.Entry e : blockModels.entrySet()) { + IModel model = ModelLoaderRegistry.getModelOrMissing(e.getValue()); + if(model != ModelLoaderRegistry.getMissingModel()) + bakedBlockBuilder.put(e.getKey(), model.bake(transformState, DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter())); + } + + ImmutableMap.Builder bakedItemBuilder = ImmutableMap.builder(); + for(Map.Entry e : itemModels.entrySet()) { + IModel model = ModelLoaderRegistry.getModelOrMissing(e.getValue()); + if(model != ModelLoaderRegistry.getMissingModel()) + bakedItemBuilder.put(e.getKey(), model.bake(transformState, DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter())); + } + + return new SpecialFlowerBakedModel(baseModelBaked, bakedBlockBuilder.build(), bakedItemBuilder.build(), transforms); } @Override @@ -103,35 +115,15 @@ public class SpecialFlowerModel implements IModel { @Override public IModel process(ImmutableMap customData) { // Load the base variant from blockstate json, and also add all the model paths we received from external API - ImmutableMap.Builder, ModelResourceLocation> blockBuilder = ImmutableMap.builder(); - ImmutableMap.Builder, ModelResourceLocation> itemBuilder = ImmutableMap.builder(); - for(String key : customData.keySet()) { - if("base".equals(key)) { - blockBuilder.put(Optional.empty(), getLocation(customData.get(key))); - } - } + ModelResourceLocation base = baseModel; + if(customData.containsKey("base")) + // Forge blockstate gives custom data in json form, have to drop the quotes + base = new ModelResourceLocation(customData.get("base").substring(1, customData.get("base").length() - 1)); - for(Map.Entry e : BotaniaAPIClient.getRegisteredSubtileBlockModels().entrySet()) { - blockBuilder.put(Optional.of(e.getKey()), e.getValue()); - } - for(Map.Entry e : BotaniaAPIClient.getRegisteredSubtileItemModels().entrySet()) { - itemBuilder.put(Optional.of(e.getKey()), e.getValue()); - } - - ImmutableMap, ModelResourceLocation> blockModels = blockBuilder.build(); - ImmutableMap, ModelResourceLocation> itemModels = itemBuilder.build(); - if(blockModels.isEmpty() && itemModels.isEmpty()) return INSTANCE; - return new SpecialFlowerModel(blockModels, itemModels); - } - - private ModelResourceLocation getLocation(String json) { - JsonElement e = new JsonParser().parse(json); - if(e.isJsonPrimitive() && e.getAsJsonPrimitive().isString()) { - return new ModelResourceLocation(e.getAsString()); - } - Botania.LOGGER.error("Expect ModelResourceLocation, got: ", json); - return new ModelResourceLocation("builtin/missing", "missing"); + ImmutableMap blockModels = ImmutableMap.copyOf(BotaniaAPIClient.getRegisteredSubtileBlockModels()); + ImmutableMap itemModels = ImmutableMap.copyOf(BotaniaAPIClient.getRegisteredSubtileItemModels()); + return new SpecialFlowerModel(base, blockModels, itemModels); } public enum Loader implements ICustomModelLoader { @@ -149,79 +141,40 @@ public class SpecialFlowerModel implements IModel { } @Override - public IModel loadModel(ResourceLocation modelLocation) throws IOException { + public IModel loadModel(ResourceLocation modelLocation) { // Load a dummy model for now, all actual blockModels added in process(). - return SpecialFlowerModel.INSTANCE; + return new SpecialFlowerModel(new ModelResourceLocation("builtin/missing", "missing"), ImmutableMap.of(), ImmutableMap.of()); } } } private static class SpecialFlowerBakedModel implements IBakedModel { - - private final ImmutableMap transforms; - private final ImmutableMap, ModelResourceLocation> blockModels; - private final ImmutableMap, ModelResourceLocation> itemModels; - private final IBakedModel baseModel; - private final LoadingCache> bakedBlockModels; - private final LoadingCache> bakedItemModels; + private final ImmutableMap bakedBlockModels; + private final ImmutableMap bakedItemModels; + private final ImmutableMap transforms; - SpecialFlowerBakedModel(ImmutableMap, ModelResourceLocation> blockModels, - ImmutableMap, ModelResourceLocation> itemModels, ImmutableMap cameraTransforms) { - this.blockModels = blockModels; - this.itemModels = itemModels; - transforms = cameraTransforms; - - ModelResourceLocation baseModelPath = blockModels.getOrDefault(Optional.empty(), - new ModelResourceLocation("builtin/missing", "missing")); - baseModel = ModelLoaderRegistry.getModelOrMissing(baseModelPath) - .bake(new SimpleModelState(transforms), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter()); - - bakedBlockModels = CacheBuilder.newBuilder().build(new Loader(true)); - bakedItemModels = CacheBuilder.newBuilder().build(new Loader(false)); - } - - private class Loader extends CacheLoader> { - - private final boolean loadBlocks; - - Loader(boolean blocks) { - loadBlocks = blocks; - } - - @Override - public Optional load(@Nonnull String key) { - Map, ModelResourceLocation> loadFrom = loadBlocks ? blockModels : itemModels; - - ModelResourceLocation loc = loadFrom.get(Optional.of(key)); - if(loc == null) - return Optional.empty(); - - IModel model = ModelLoaderRegistry.getModelOrMissing(loc); - if(model == ModelLoaderRegistry.getMissingModel()) - return Optional.empty(); - - return Optional.of(model.bake(new SimpleModelState(transforms), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter())); - } + SpecialFlowerBakedModel(IBakedModel baseModel, + ImmutableMap bakedBlockModels, + ImmutableMap bakedItemModels, + ImmutableMap cameraTransforms) { + this.baseModel = baseModel; + this.bakedBlockModels = bakedBlockModels; + this.bakedItemModels = bakedItemModels; + this.transforms = cameraTransforms; } @Nonnull @Override public List getQuads(IBlockState state, EnumFacing face, long rand) { - if(state.getBlock() != ModBlocks.specialFlower) { - Botania.LOGGER.fatal("FOREIGN BLOCK: " + state); - return Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel().getQuads(state, face, rand); - } - IExtendedBlockState extendedState = (IExtendedBlockState) state; String subtileId = extendedState.getValue(BotaniaStateProps.SUBTILE_ID); - IBakedModel ret = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - Optional specialModel = bakedBlockModels.getUnchecked(subtileId == null ? "" : subtileId); - if(specialModel.isPresent()) - ret = specialModel.get(); + IBakedModel model = bakedBlockModels.get(subtileId == null ? "" : subtileId); + if(model == null) + model = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelShapes().getModelManager().getMissingModel(); - return ret.getQuads(state, face, rand); + return model.getQuads(state, face, rand); } @Nonnull @@ -236,14 +189,14 @@ public class SpecialFlowerModel implements IModel { @Nonnull @Override public IBakedModel handleItemState(@Nonnull IBakedModel original, ItemStack stack, World world, EntityLivingBase living) { - Optional item = bakedItemModels.getUnchecked(ItemBlockSpecialFlower.getType(stack)); + IBakedModel model = bakedItemModels.get(ItemBlockSpecialFlower.getType(stack)); - if(!item.isPresent()) - item = bakedBlockModels.getUnchecked(ItemBlockSpecialFlower.getType(stack)); + if(model == null) + model = bakedBlockModels.get(ItemBlockSpecialFlower.getType(stack)); + if(model == null) + model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(roseFallback); - return item.isPresent() - ? item.get() - : Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(roseFallback); + return model; } }; diff --git a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java index b3c457735..00469c57d 100644 --- a/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockSpecialFlower.java @@ -334,6 +334,6 @@ public class BlockSpecialFlower extends BlockFlower implements ISpecialFlower, I public void registerModels() { // Let custom loader work ModelLoader.setCustomStateMapper(this, new StateMap.Builder().ignore(BotaniaStateProps.COLOR).ignore(getTypeProperty()).build()); - ModelHandler.registerInventoryVariant(this); + ModelHandler.registerBlockToState(this, 0, getDefaultState()); } } diff --git a/src/main/resources/assets/botania/blockstates/specialflower.json b/src/main/resources/assets/botania/blockstates/specialflower.json index 0712053f5..bb8fde559 100644 --- a/src/main/resources/assets/botania/blockstates/specialflower.json +++ b/src/main/resources/assets/botania/blockstates/specialflower.json @@ -2,15 +2,11 @@ "forge_marker": 1, "defaults": { "model": "botania_special:specialFlower", - "transform": "forge:default-item" + "transform": "forge:default-item", + "custom": { "base": "botania:specialflower#basemodel" } }, "variants": { - "normal": [{ - "custom": { "base": "botania:specialflower#basemodel" } - }], - "inventory": [{ - "custom": { "base": "botania:specialflower#basemodel" } - }], + "normal": [{}], "basemodel": [{ "model": "minecraft:cross", "textures": { From 51e8c30c7b2b870a81252714e8fbf88399a4d89d Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Thu, 15 Mar 2018 18:07:39 -0500 Subject: [PATCH 07/11] Add config to disable botania's f3 debug info. Closes #2232 --- .../java/vazkii/botania/client/core/handler/DebugHandler.java | 2 +- .../vazkii/botania/common/core/handler/ConfigHandler.java | 4 ++++ src/main/resources/assets/botania/lang/en_us.lang | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java b/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java index 9dfc1e698..724685322 100644 --- a/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java +++ b/src/main/java/vazkii/botania/client/core/handler/DebugHandler.java @@ -47,7 +47,7 @@ public final class DebugHandler { @SubscribeEvent public static void onDrawDebugText(RenderGameOverlayEvent.Text event) { World world = Minecraft.getMinecraft().world; - if(Minecraft.getMinecraft().gameSettings.showDebugInfo) { + if(ConfigHandler.debugInfo && Minecraft.getMinecraft().gameSettings.showDebugInfo) { event.getLeft().add(""); String version = LibMisc.VERSION; if(version.contains("GRADLE")) diff --git a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java index b0ca16298..8a64f8214 100644 --- a/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java +++ b/src/main/java/vazkii/botania/common/core/handler/ConfigHandler.java @@ -66,6 +66,7 @@ public final class ConfigHandler { public static boolean altFlowerTextures = false; public static boolean staticFloaters = false; + public static boolean debugInfo = true; public static boolean matrixMode = false; public static boolean referencesEnabled = true; @@ -183,6 +184,9 @@ public final class ConfigHandler { desc = "Set this to true if you use lots of floating flowers and are experiencing rendering lag. Will disable the floating flowers' animations and render them statically for a major performance boost. Hit F3+A in-world after toggling this."; staticFloaters = loadPropBool("staticFloaters.enabled", desc, staticFloaters); + desc = "Set to false to disable Botania's messages in the F3 debug screen"; + debugInfo = loadPropBool("debugInfo.enabled", desc, debugInfo); + desc = "Set this to true if you are the chosen one. For lovers of glitch art and just general mad people."; matrixMode = loadPropBool("matrixMode.enabled", desc, matrixMode); diff --git a/src/main/resources/assets/botania/lang/en_us.lang b/src/main/resources/assets/botania/lang/en_us.lang index 75c29e205..3b845f015 100644 --- a/src/main/resources/assets/botania/lang/en_us.lang +++ b/src/main/resources/assets/botania/lang/en_us.lang @@ -351,6 +351,7 @@ shaders.enabled=Enable Shader Usage baubleRender.enabled=Enable Bauble Rendering spreader.posShift=Spreader Pos Shift staticFloaters.enabled=Enable Static Floating Flowers +debugInfo.enabled=Enable Botania's F3 debug information versionChecking.enabled=Enable Version Checking wandBeam.static=Enable Static Wand Beam worldgen.flower.density=Worldgen Flower Density From 4f4971ca73c00a0ce681f2d4efc1b98416be1362 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Fri, 16 Mar 2018 17:50:38 -0500 Subject: [PATCH 08/11] Gaia guardian minor fixes: make anti-flight smarter, and search for initial player aggro further in the entire arena. Closes #2304 --- .../vazkii/botania/common/entity/EntityDoppleganger.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java index 8e25b3aab..e070bc4d5 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java +++ b/src/main/java/vazkii/botania/common/entity/EntityDoppleganger.java @@ -688,7 +688,8 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { if (world.isRemote) { particles(); EntityPlayer player = Botania.proxy.getClientPlayer(); - player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode; + if(getPlayersAround().contains(player)) + player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode; return; } @@ -814,8 +815,6 @@ public class EntityDoppleganger extends EntityLiving implements IBotaniaBoss { if(spawnMissiles) spawnMissile(); } else { - float range = 3F; - players = world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(posX - range, posY - range, posZ - range, posX + range, posY + range, posZ + range)); if(!players.isEmpty()) damageEntity(DamageSource.causePlayerDamage(players.get(0)), 0); } From 34280c942bc264f5c25a7e29d2736c3c2503b30b Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Mon, 19 Mar 2018 22:26:31 -0500 Subject: [PATCH 09/11] Fix particles 'snapping into place', a vanilla bug. Closes #2217 --- src/main/java/vazkii/botania/client/fx/FXSparkle.java | 7 +++++++ src/main/java/vazkii/botania/client/fx/FXWisp.java | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/main/java/vazkii/botania/client/fx/FXSparkle.java b/src/main/java/vazkii/botania/client/fx/FXSparkle.java index 005f51ee3..eaa632994 100644 --- a/src/main/java/vazkii/botania/client/fx/FXSparkle.java +++ b/src/main/java/vazkii/botania/client/fx/FXSparkle.java @@ -160,6 +160,13 @@ public class FXSparkle extends Particle { setExpired(); } + @Override + protected void setSize(float width, float height) { + super.setSize(width, height); + // fix MC-12269: the bb is expanded only in +X +Z directions by super, call setPosition again to recalculate a correct BB + setPosition(posX, posY, posZ); + } + public void setGravity(float value) { particleGravity = value; } diff --git a/src/main/java/vazkii/botania/client/fx/FXWisp.java b/src/main/java/vazkii/botania/client/fx/FXWisp.java index 0642f680c..904177a68 100644 --- a/src/main/java/vazkii/botania/client/fx/FXWisp.java +++ b/src/main/java/vazkii/botania/client/fx/FXWisp.java @@ -158,6 +158,13 @@ public class FXWisp extends Particle { this.motionZ *= 0.9800000190734863D; } + @Override + protected void setSize(float width, float height) { + super.setSize(width, height); + // fix MC-12269: the bb is expanded only in +X +Z directions by super, call setPosition again to recalculate a correct BB + setPosition(posX, posY, posZ); + } + public void setGravity(float value) { particleGravity = value; } From f477d4eb291d0be9c216bb123c08bd36f6b69ced Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sat, 24 Mar 2018 02:00:59 -0500 Subject: [PATCH 10/11] Fix thermalilies not penalizing for giving it lava while on cooldown No idea how that return snuck back in there, it got explicitly removed in the past. Looks like 5211ed9 introduced it. Enjoy your unnerfed thermalilies for the last 2 years while you can! --- .../common/block/subtile/generating/SubTileHydroangeas.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java index 08b735a45..0aabcc464 100644 --- a/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java +++ b/src/main/java/vazkii/botania/common/block/subtile/generating/SubTileHydroangeas.java @@ -52,7 +52,6 @@ public class SubTileHydroangeas extends SubTileGenerating { cooldown--; for(int i = 0; i < 3; i++) Botania.proxy.wispFX(supertile.getPos().getX() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getY() + 0.5 + Math.random() * 0.2 - 0.1, supertile.getPos().getZ() + 0.5 + Math.random() * 0.2 - 0.1, 0.1F, 0.1F, 0.1F, (float) Math.random() / 6, (float) -Math.random() / 30); - return; } if(burnTime == 0) { From 920f9e267691af01033f94a75ca19e19dc5ec167 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Sun, 25 Mar 2018 10:18:25 -0500 Subject: [PATCH 11/11] Extrapolated bucket now picks up mod fluids. Closes #2585 --- .../vazkii/botania/common/item/ItemOpenBucket.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java b/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java index aa4e9d50f..b55e4ceb2 100644 --- a/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java +++ b/src/main/java/vazkii/botania/common/item/ItemOpenBucket.java @@ -10,7 +10,9 @@ */ package vazkii.botania.common.item; +import net.minecraft.block.BlockLiquid; import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ActionResult; @@ -20,6 +22,9 @@ import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.RayTraceResult; import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.IFluidBlock; import vazkii.botania.common.lib.LibItemNames; import javax.annotation.Nonnull; @@ -49,10 +54,13 @@ public class ItemOpenBucket extends ItemMod { if(!player.canPlayerEdit(pos, rtr.sideHit, stack)) return ActionResult.newResult(EnumActionResult.PASS, stack); - Material material = world.getBlockState(pos).getMaterial(); - int l = world.getBlockState(pos).getBlock().getMetaFromState(world.getBlockState(pos)); // hack to get meta so we don't have to know the level prop + IBlockState state = world.getBlockState(pos); + Fluid fluid = FluidRegistry.lookupFluidForBlock(state.getBlock()); + boolean isFull = state.getBlock() instanceof BlockLiquid && state.getValue(BlockLiquid.LEVEL) == 0 + || state.getBlock() instanceof IFluidBlock && Math.abs(((IFluidBlock) state.getBlock()).getFilledPercentage(world, pos)) >= 1; - if((material == Material.LAVA || material == Material.WATER) && l == 0) { + if(fluid != null && isFull) { + player.playSound(fluid.getFillSound(world, pos), 1.0f, 1.0f); world.setBlockToAir(pos); for(int x = 0; x < 5; x++)