Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions art/workspace.ase
Git LFS file not shown
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class BlockSettings {
public Material material = Material.ROCK;
public CreativeTabs creativeTab = CreativeTabs.BUILDING_BLOCKS;
public int lightValue = 0;
public int variant = 1;

public <T extends Block> T createMat(Function<Material, T> constructor) {
T block = constructor.apply(this.material);
Expand Down
102 changes: 102 additions & 0 deletions common/src/main/java/net/macmv/rgen/block/JungleFlower.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package net.macmv.rgen.block;

import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class JungleFlower extends Block implements net.minecraftforge.common.IPlantable {

protected static final AxisAlignedBB FLOWER_AABB = new AxisAlignedBB(
0.0D, 0.0D, 0.0D,
1.0D, 0.75D, 1.0D
);

public JungleFlower(BlockSettings settings) {
super(settings.material);
this.setCreativeTab(settings.creativeTab);
this.setSoundType(settings.soundType);
this.setTickRandomly(true);
this.setHardness(0.0F);
this.setResistance(0.0F);
}

@Override
public net.minecraftforge.common.EnumPlantType getPlantType(IBlockAccess world, BlockPos pos) {
return net.minecraftforge.common.EnumPlantType.Plains;
}

@Override
public IBlockState getPlant(IBlockAccess world, BlockPos pos) {
return this.getDefaultState();
}


// Visual bounding box
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return FLOWER_AABB;
}

// No collision (walk through)
@Override
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return NULL_AABB;
}

@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}

@Override
public boolean isFullCube(IBlockState state) {
return false;
}

@SideOnly(Side.CLIENT)
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
}

/*
// Optional: makes it plant-like in behavior
@Override
public boolean canSustainBush(IBlockState state) {
return true;
}
*/

@Override
public boolean canPlaceBlockAt(World worldIn, BlockPos pos) {
IBlockState soil = worldIn.getBlockState(pos.down());
return super.canPlaceBlockAt(worldIn, pos)
&& soil.getBlock().canSustainPlant(soil, worldIn, pos.down(), net.minecraft.util.EnumFacing.UP, this);
}


/*
// Optional: drop itself when broken
@Override
public int quantityDropped(net.minecraft.util.math.MathHelper random) {
return 1;
}
*/

@Override
public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) {
return new ItemStack(this);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package net.macmv.rgen.block;

import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public class JungleFlowerCarpetType extends JungleFlower {

// Shrunk by 1px (1/16 = 0.0625) on each side to allow 1px offset
private static final AxisAlignedBB SHRUNK_CARPET_AABB = new AxisAlignedBB(
0.03125D, 0.0D, 0.03125D,
0.96875D, 0.0625D, 0.96875D
);

public JungleFlowerCarpetType(BlockSettings settings) {
super(settings);
}

@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return SHRUNK_CARPET_AABB;
}

// Custom subtle offset — replaces getOffsetType()
@Override
@SideOnly(Side.CLIENT)
public Vec3d getOffset(IBlockState state, IBlockAccess world, BlockPos pos) {
long seed = MathHelper.getCoordinateRandom(pos.getX(), 0, pos.getZ());
double x = ((double)((int)(seed >> 16 & 15L)) / 15.0 - 0.5) * 0.1; // ±0.05
double z = ((double)((int)(seed >> 24 & 15L)) / 15.0 - 0.5) * 0.1;
return new Vec3d(x, 0.0D, z);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package net.macmv.rgen.block;

import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;

public class JungleFlowerFlowerType extends JungleFlower {

private static final AxisAlignedBB ALLIUM_AABB = new AxisAlignedBB(
0.125D, 0.0D, 0.125D,
0.875D, 0.8125D, 0.875D
);

public JungleFlowerFlowerType(BlockSettings settings) {
super(settings);
}

@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return ALLIUM_AABB;
}

@Override
public EnumOffsetType getOffsetType() {
return EnumOffsetType.XZ;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package net.macmv.rgen.block;

import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;

public class JungleFlowerGrassType extends JungleFlower {

private static final AxisAlignedBB GRASS_AABB = new AxisAlignedBB(
0.1D, 0.0D, 0.1D,
0.9D, 0.8D, 0.9D
);

public JungleFlowerGrassType(BlockSettings settings) {
super(settings);
}

@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return GRASS_AABB;
}

@Override
public EnumOffsetType getOffsetType() {
return EnumOffsetType.XZ;
}
}
20 changes: 20 additions & 0 deletions common/src/main/java/net/macmv/rgen/block/RBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public final class RBlocks {
public static final Block COVERED_BIRCH_LOG = register("covered_birch_log", s -> new RCoveredLog(s, true), new BlockSettings().hardness(3.0f).resistance(5.0f).soundType(SoundType.WOOD));
public static final Block COVERED_JUNGLE_LOG = register("covered_jungle_log", s -> new RCoveredLog(s, true), new BlockSettings().hardness(3.0f).resistance(5.0f).soundType(SoundType.WOOD));

// This block is to be deprecated do not USE
public static final Block MOSSY_STUMP = register("mossy_stump", MossyLogBlock::new, new BlockSettings().creativeTab(RCreativeTabs.BUILDING_BLOCKS));
public static final Block BAMBOO = register("bamboo", Bamboo::new, new BlockSettings().material(Material.PLANTS));

Expand All @@ -92,6 +93,25 @@ public final class RBlocks {
public static final Block PINK_FLOWERBED = register("pink_flowerbed", PinkFlowerbed::new, new BlockSettings().material(Material.PLANTS));
public static final Block HANGING_VINES = register("hanging_vines", HangingVines::new, new BlockSettings().material(Material.PLANTS));

public static final Block PINK_ORCHID = register("pink_orchid", JungleFlowerFlowerType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block PASSION_FLOWER = register("passion_flower", JungleFlowerFlowerType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block HELICONIA = register("heliconia", JungleFlowerFlowerType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block PINK_HEART = register("pink_heart", JungleFlowerFlowerType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block TORCH_GINGER = register("torch_ginger", JungleFlowerFlowerType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block ORCHIDACEAE = register("orchidaceae", JungleFlowerFlowerType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block IPOMOEA = register("ipomoea", JungleFlowerCarpetType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block BROMELIADS = register("bromeliads", JungleFlowerGrassType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block FICUS_ELASTICA = register("ficus_elastica", JungleFlowerGrassType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block YELLOW_JUNGLE_ROSE = register("yellow_jungle_rose", JungleFlowerGrassType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block BIRD_OF_PARADISE = register("bird_of_paradise", JungleFlowerGrassType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));
public static final Block JUNGLE_BUSH = register("jungle_bush", JungleFlowerGrassType::new, new BlockSettings().material(Material.PLANTS).creativeTab(RCreativeTabs.DECORATIONS).soundType(SoundType.PLANT));







private static Block register(String name, Function<BlockSettings, Block> blockSupplier) {
Block block = blockSupplier.apply(new BlockSettings());
block.setRegistryName(RGen.MOD_ID, name);
Expand Down
14 changes: 14 additions & 0 deletions common/src/main/java/net/macmv/rgen/item/RItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ public class RItems {
public static final Item GREEN_CACTUS_FRUIT = registerItem("green_cactus_fruit", new GreenCactusFruit()).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item BLUE_CACTUS_FRUIT = registerItem("blue_cactus_fruit", new BlueCactusFruit()).setCreativeTab(RCreativeTabs.DECORATIONS);

public static final Item PINK_ORCHID = registerBlockItem(RBlocks.PINK_ORCHID).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item PASSION_FLOWER = registerBlockItem(RBlocks.PASSION_FLOWER).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item HELICONIA = registerBlockItem(RBlocks.HELICONIA).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item PINK_HEART = registerBlockItem(RBlocks.PINK_HEART).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item TORCH_GINGER = registerBlockItem(RBlocks.TORCH_GINGER).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item ORCHIDACEAE = registerBlockItem(RBlocks.ORCHIDACEAE).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item IPOMOEA = registerBlockItem(RBlocks.IPOMOEA).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item BROMELIADS = registerBlockItem(RBlocks.BROMELIADS).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item FICUS_ELASTICA = registerBlockItem(RBlocks.FICUS_ELASTICA).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item YELLOW_JUNGLE_ROSE = registerBlockItem(RBlocks.YELLOW_JUNGLE_ROSE).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item BIRD_OF_PARADISE = registerBlockItem(RBlocks.BIRD_OF_PARADISE).setCreativeTab(RCreativeTabs.DECORATIONS);
public static final Item JUNGLE_BUSH = registerBlockItem(RBlocks.JUNGLE_BUSH).setCreativeTab(RCreativeTabs.DECORATIONS);



// Other cactus fruits

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun11" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun08" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun09" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun03" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun07" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun12" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun06" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun02" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun04" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun01" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun05" }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variants": {
"normal": { "model": "rgen:flower/jungleflower/jun10" }
}
}
14 changes: 14 additions & 0 deletions common/src/main/resources/assets/rgen/lang/en_pt.lang
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,17 @@ tile.mossy_stone.name=Mossy Stone

item.debug_stick.name=Debuggin' Stick
item.green_cactus_fruit.name=Green Cactus Fruit o' Doom

tile.pink_orchid.name=Pink Orchid Bush
tile.passion_flower.name=Kissin’ Flower
tile.heliconia.name=Crabclaw’s Bloom
tile.pink_heart.name=Heart o’ the Jungle
tile.torch_ginger.name=Ginger Stick
tile.orchidaceae.name=Pink Stick Orchid
tile.ipomoea.name=Moonvine
tile.bromeliads.name=Flamin’ Jungle Bush
tile.ficus_elastica.name=Rubbery Shrub
tile.yellow_jungle_rose.name=Golden Rose Bush
tile.bird_of_paradise.name=Feathered Bird Flower
tile.jungle_bush.name=Wild Scrubbery

14 changes: 14 additions & 0 deletions common/src/main/resources/assets/rgen/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,18 @@ tile.mossy_stone.name=Mossy Stone
item.debug_stick.name=Debug Stick
item.green_cactus_fruit.name=Green Cactus Fruit

tile.pink_orchid.name=Pink Orchid
tile.passion_flower.name=Passion Flower
tile.heliconia.name=Heliconia
tile.pink_heart.name=Pink Heart
tile.torch_ginger.name=Torch Ginger
tile.orchidaceae.name=Orchidaceae
tile.ipomoea.name=Ipomoea
tile.bromeliads.name=Bromeliads
tile.ficus_elastica.name=Ficus Elastica
tile.yellow_jungle_rose.name=Yellow Jungle Rose
tile.bird_of_paradise.name=Bird of Paradise
tile.jungle_bush.name=Jungle Bush



Git LFS file not shown
Git LFS file not shown
Loading
Loading