diff --git a/src/main/java/biomesoplenty/api/block/BOPBlocks.java b/src/main/java/biomesoplenty/api/block/BOPBlocks.java index f17056a26..8d0f29fe2 100644 --- a/src/main/java/biomesoplenty/api/block/BOPBlocks.java +++ b/src/main/java/biomesoplenty/api/block/BOPBlocks.java @@ -145,4 +145,6 @@ public class BOPBlocks public static Fluid blood_fluid; public static Block poison; public static Fluid poison_fluid; + public static Block hot_spring_water; + public static Fluid hot_spring_water_fluid; } diff --git a/src/main/java/biomesoplenty/api/item/BOPItems.java b/src/main/java/biomesoplenty/api/item/BOPItems.java index bab242bf2..bcbd5f59f 100644 --- a/src/main/java/biomesoplenty/api/item/BOPItems.java +++ b/src/main/java/biomesoplenty/api/item/BOPItems.java @@ -114,6 +114,7 @@ public class BOPItems public static Item honey_bucket; public static Item blood_bucket; public static Item poison_bucket; + public static Item hot_spring_water_bucket; public static Item record_wanderer; public static Item record_corruption; diff --git a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java index 178253e5c..ae63f2203 100644 --- a/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java +++ b/src/main/java/biomesoplenty/common/biome/overworld/BiomeGenAlps.java @@ -8,11 +8,14 @@ package biomesoplenty.common.biome.overworld; +import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import biomesoplenty.api.biome.BOPBiome; import biomesoplenty.api.biome.generation.GeneratorStage; +import biomesoplenty.api.block.BOPBlocks; import biomesoplenty.common.enums.BOPClimates; import biomesoplenty.common.world.BOPWorldSettings; +import biomesoplenty.common.world.feature.GeneratorLakes; import biomesoplenty.common.world.feature.GeneratorOreSingle; public class BiomeGenAlps extends BOPBiome @@ -39,6 +42,9 @@ public class BiomeGenAlps extends BOPBiome this.spawnableCreatureList.clear(); + // hot springs + this.addGenerator("hot_springs", GeneratorStage.SAND, (new GeneratorLakes.Builder()).amountPerChunk(0.1F).waterLakeForBiome(this).liquid(BOPBlocks.hot_spring_water).frozenLiquid((IBlockState)null).create()); + // gem this.addGenerator("emeralds", GeneratorStage.SAND, (new GeneratorOreSingle.Builder()).amountPerChunk(12).with(Blocks.emerald_ore.getDefaultState()).create()); diff --git a/src/main/java/biomesoplenty/common/fluids/HotSpringWaterFluid.java b/src/main/java/biomesoplenty/common/fluids/HotSpringWaterFluid.java new file mode 100644 index 000000000..a69ed2768 --- /dev/null +++ b/src/main/java/biomesoplenty/common/fluids/HotSpringWaterFluid.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.common.fluids; + +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fluids.Fluid; + +public class HotSpringWaterFluid extends Fluid { + + public static final String name = "hot_spring_water"; + public static final HotSpringWaterFluid instance = new HotSpringWaterFluid(); + + public HotSpringWaterFluid() + { + super(name, new ResourceLocation("biomesoplenty:blocks/hot_spring_water_still"), new ResourceLocation("biomesoplenty:blocks/hot_spring_water_flowing")); + } + +} diff --git a/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java new file mode 100644 index 000000000..615a7712e --- /dev/null +++ b/src/main/java/biomesoplenty/common/fluids/blocks/BlockHotSpringWaterFluid.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright 2014-2016, the Biomes O' Plenty Team + * + * This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License. + * + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + ******************************************************************************/ + +package biomesoplenty.common.fluids.blocks; + +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.BlockPos; +import net.minecraft.util.EnumParticleTypes; +import net.minecraft.world.World; +import net.minecraftforge.fluids.BlockFluidClassic; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +public class BlockHotSpringWaterFluid extends BlockFluidClassic +{ + + public BlockHotSpringWaterFluid(Fluid fluid) + { + super(fluid, Material.water); + } + + @Override + public void onEntityCollidedWithBlock(World world, BlockPos pos, Entity entity) + { + if (entity instanceof EntityLivingBase) + { + ((EntityLivingBase)entity).addPotionEffect(new PotionEffect(Potion.regeneration.id, 100)); + } + } + + @Override + @SideOnly(Side.CLIENT) + public void randomDisplayTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { + + super.randomDisplayTick(worldIn, pos, state, rand); + if (rand.nextInt(20)==0) + { + worldIn.spawnParticle(EnumParticleTypes.CLOUD, pos.getX() + rand.nextFloat(), pos.getY() + 1.0F, pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]); + } + } + +} \ No newline at end of file diff --git a/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java b/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java index 79b9dcd71..3142439a8 100644 --- a/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/BucketEventHandler.java @@ -22,6 +22,7 @@ import biomesoplenty.api.block.BOPBlocks; import biomesoplenty.api.item.BOPItems; import biomesoplenty.common.fluids.blocks.BlockBloodFluid; import biomesoplenty.common.fluids.blocks.BlockHoneyFluid; +import biomesoplenty.common.fluids.blocks.BlockHotSpringWaterFluid; import biomesoplenty.common.fluids.blocks.BlockPoisonFluid; public class BucketEventHandler @@ -52,6 +53,10 @@ public class BucketEventHandler { filled_bucket = BOPItems.poison_bucket; } + else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && ((Integer)iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL)).intValue() == 0) + { + filled_bucket = Items.water_bucket; + } else { return; diff --git a/src/main/java/biomesoplenty/common/init/ModBlocks.java b/src/main/java/biomesoplenty/common/init/ModBlocks.java index 829550ee9..0325e90de 100644 --- a/src/main/java/biomesoplenty/common/init/ModBlocks.java +++ b/src/main/java/biomesoplenty/common/init/ModBlocks.java @@ -12,6 +12,7 @@ import static biomesoplenty.api.block.BOPBlocks.*; import static biomesoplenty.api.item.BOPItems.blood_bucket; import static biomesoplenty.api.item.BOPItems.honey_bucket; import static biomesoplenty.api.item.BOPItems.poison_bucket; +import static biomesoplenty.api.item.BOPItems.hot_spring_water_bucket; import net.minecraft.block.Block; import net.minecraft.block.BlockSlab; import net.minecraft.block.BlockStairs; @@ -28,17 +29,59 @@ import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.fluids.BlockFluidBase; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fml.common.registry.GameData; import net.minecraftforge.fml.common.registry.GameRegistry; import biomesoplenty.api.block.IBOPBlock; import biomesoplenty.api.item.BOPItems; -import biomesoplenty.common.block.*; +import biomesoplenty.common.block.BlockBOPAsh; +import biomesoplenty.common.block.BlockBOPBamboo; +import biomesoplenty.common.block.BlockBOPBiomeBlock; +import biomesoplenty.common.block.BlockBOPBones; +import biomesoplenty.common.block.BlockBOPCoral; +import biomesoplenty.common.block.BlockBOPCrystal; +import biomesoplenty.common.block.BlockBOPDirt; +import biomesoplenty.common.block.BlockBOPDoor; +import biomesoplenty.common.block.BlockBOPDoubleOtherSlab; +import biomesoplenty.common.block.BlockBOPDoublePlant; +import biomesoplenty.common.block.BlockBOPDoubleWoodSlab; +import biomesoplenty.common.block.BlockBOPFence; +import biomesoplenty.common.block.BlockBOPFenceGate; +import biomesoplenty.common.block.BlockBOPFlesh; +import biomesoplenty.common.block.BlockBOPFlower; +import biomesoplenty.common.block.BlockBOPFruit; +import biomesoplenty.common.block.BlockBOPGem; +import biomesoplenty.common.block.BlockBOPGemOre; +import biomesoplenty.common.block.BlockBOPGeneric; +import biomesoplenty.common.block.BlockBOPGrass; +import biomesoplenty.common.block.BlockBOPHalfOtherSlab; +import biomesoplenty.common.block.BlockBOPHalfWoodSlab; +import biomesoplenty.common.block.BlockBOPHive; +import biomesoplenty.common.block.BlockBOPHoney; +import biomesoplenty.common.block.BlockBOPLeaves; +import biomesoplenty.common.block.BlockBOPLilypad; +import biomesoplenty.common.block.BlockBOPLog; +import biomesoplenty.common.block.BlockBOPMud; +import biomesoplenty.common.block.BlockBOPMushroom; +import biomesoplenty.common.block.BlockBOPPlanks; +import biomesoplenty.common.block.BlockBOPPlant; +import biomesoplenty.common.block.BlockBOPSand; +import biomesoplenty.common.block.BlockBOPSapling; +import biomesoplenty.common.block.BlockBOPSeaweed; +import biomesoplenty.common.block.BlockBOPStone; +import biomesoplenty.common.block.BlockBOPStoneFormations; +import biomesoplenty.common.block.BlockBOPTerrarium; +import biomesoplenty.common.block.BlockBOPTurnip; +import biomesoplenty.common.block.BlockBOPVine; +import biomesoplenty.common.block.BlockBOPWoodStairs; import biomesoplenty.common.command.BOPCommand; -import biomesoplenty.common.enums.*; +import biomesoplenty.common.enums.BOPWoods; import biomesoplenty.common.fluids.BloodFluid; import biomesoplenty.common.fluids.HoneyFluid; +import biomesoplenty.common.fluids.HotSpringWaterFluid; import biomesoplenty.common.fluids.PoisonFluid; -import biomesoplenty.common.fluids.blocks.*; +import biomesoplenty.common.fluids.blocks.BlockBloodFluid; +import biomesoplenty.common.fluids.blocks.BlockHoneyFluid; +import biomesoplenty.common.fluids.blocks.BlockHotSpringWaterFluid; +import biomesoplenty.common.fluids.blocks.BlockPoisonFluid; import biomesoplenty.common.util.BOPReflectionHelper; import biomesoplenty.common.util.block.BlockStateUtils; import biomesoplenty.common.util.inventory.CreativeTabBOP; @@ -238,10 +281,14 @@ public class ModBlocks FluidRegistry.registerFluid(poison_fluid); poison = registerFluidBlock(poison_fluid, new BlockPoisonFluid(poison_fluid), "poison"); + hot_spring_water_fluid = HotSpringWaterFluid.instance; + FluidRegistry.registerFluid(hot_spring_water_fluid); + hot_spring_water = registerFluidBlock(hot_spring_water_fluid, new BlockHotSpringWaterFluid(hot_spring_water_fluid), "hot_spring_water"); + honey_bucket = ModItems.registerItem((new ItemBucket(honey)).setContainerItem(Items.bucket), "honey_bucket"); blood_bucket = ModItems.registerItem((new ItemBucket(blood)).setContainerItem(Items.bucket), "blood_bucket"); poison_bucket = ModItems.registerItem((new ItemBucket(poison)).setContainerItem(Items.bucket), "poison_bucket"); - + hot_spring_water_bucket = ModItems.registerItem((new ItemBucket(hot_spring_water)).setContainerItem(Items.bucket), "hot_spring_water_bucket"); } diff --git a/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java b/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java index 476f949b9..9384e0202 100644 --- a/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java +++ b/src/main/java/biomesoplenty/common/world/layer/GenLayerRiverMixBOP.java @@ -47,7 +47,7 @@ public class GenLayerRiverMixBOP extends BOPGenLayer { if (riverValues[i] == BiomeGenBase.river.biomeID) { - if (biomeIds[i] == BiomeGenBase.icePlains.biomeID || (BOPBiomes.cold_desert.isPresent() && biomeIds[i] == BOPBiomes.cold_desert.get().biomeID) || (BOPBiomes.frozen_desert.isPresent() && biomeIds[i] == BOPBiomes.frozen_desert.get().biomeID)) + if (biomeIds[i] == BiomeGenBase.icePlains.biomeID || (BOPBiomes.frozen_desert.isPresent() && biomeIds[i] == BOPBiomes.frozen_desert.get().biomeID) || (BOPBiomes.frost_forest.isPresent() && biomeIds[i] == BOPBiomes.frost_forest.get().biomeID) || (BOPBiomes.alps.isPresent() && biomeIds[i] == BOPBiomes.alps.get().biomeID)) { out[i] = BiomeGenBase.frozenRiver.biomeID; } diff --git a/src/main/resources/assets/biomesoplenty/blockstates/fluids.json b/src/main/resources/assets/biomesoplenty/blockstates/fluids.json index d012b5aaa..12b3e1702 100644 --- a/src/main/resources/assets/biomesoplenty/blockstates/fluids.json +++ b/src/main/resources/assets/biomesoplenty/blockstates/fluids.json @@ -12,6 +12,10 @@ "poison": { "model": "forge:fluid", "custom": { "fluid": "poison" } - } + }, + "hot_spring_water": { + "model": "forge:fluid", + "custom": { "fluid": "hot_spring_water" } + } } } \ No newline at end of file diff --git a/src/main/resources/assets/biomesoplenty/lang/en_US.lang b/src/main/resources/assets/biomesoplenty/lang/en_US.lang index 2a8cfc1dd..d6fcdd4ae 100644 --- a/src/main/resources/assets/biomesoplenty/lang/en_US.lang +++ b/src/main/resources/assets/biomesoplenty/lang/en_US.lang @@ -118,6 +118,7 @@ item.gold_scythe.name=Golden Scythe item.hellbark_door.name=Hellbark Door item.honey_bucket.name=Honey Bucket item.honeycomb.name=Empty Honeycomb +item.hot_spring_water_bucket.name=Hot Spring Water Bucket item.ichor.name=Ichor item.iron_scythe.name=Iron Scythe item.jacaranda_door.name=Jacaranda Door diff --git a/src/main/resources/assets/biomesoplenty/models/item/hot_spring_water_bucket.json b/src/main/resources/assets/biomesoplenty/models/item/hot_spring_water_bucket.json new file mode 100644 index 000000000..5499b77ed --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/models/item/hot_spring_water_bucket.json @@ -0,0 +1,18 @@ +{ + "parent": "builtin/generated", + "textures": { + "layer0": "biomesoplenty:items/hot_spring_water_bucket" + }, + "display": { + "thirdperson": { + "rotation": [ -90, 0, 0 ], + "translation": [ 0, 1, -3 ], + "scale": [ 0.55, 0.55, 0.55 ] + }, + "firstperson": { + "rotation": [ 0, -135, 25 ], + "translation": [ 0, 4, 2 ], + "scale": [ 1.7, 1.7, 1.7 ] + } + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_flowing.png b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_flowing.png new file mode 100644 index 000000000..c1a3e7faf Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_flowing.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_flowing.png.mcmeta b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_flowing.png.mcmeta new file mode 100644 index 000000000..472c7ff43 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_flowing.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_still.png b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_still.png new file mode 100644 index 000000000..cc2393a71 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_still.png differ diff --git a/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_still.png.mcmeta b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_still.png.mcmeta new file mode 100644 index 000000000..0645f48c6 --- /dev/null +++ b/src/main/resources/assets/biomesoplenty/textures/blocks/hot_spring_water_still.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} diff --git a/src/main/resources/assets/biomesoplenty/textures/items/hot_spring_water_bucket.png b/src/main/resources/assets/biomesoplenty/textures/items/hot_spring_water_bucket.png new file mode 100644 index 000000000..c6b76d363 Binary files /dev/null and b/src/main/resources/assets/biomesoplenty/textures/items/hot_spring_water_bucket.png differ