diff --git a/TODO.txt b/TODO.txt index 8cb8321..4ea2f15 100644 --- a/TODO.txt +++ b/TODO.txt @@ -5,7 +5,6 @@ deco No Copper pots deco No Copper plates deco No Lanterns ------------------------------------------------------------------------------------------------------- -plants No? Tomatoes plants No? Turnips plants No? Cabbages plants No? Zucchinis diff --git a/graphics/tomato-plant.xcf b/graphics/tomato-plant.xcf new file mode 100644 index 0000000..189fad4 Binary files /dev/null and b/graphics/tomato-plant.xcf differ diff --git a/src/java/mmm/plants/PTomato.java b/src/java/mmm/plants/PTomato.java index ee9a501..2bac0ff 100644 --- a/src/java/mmm/plants/PTomato.java +++ b/src/java/mmm/plants/PTomato.java @@ -220,7 +220,7 @@ public class PTomato { final int age = this.getAge( state ); final int size = ( age & 7 ) >> 1; - final boolean highest = age < 15 || worldIn.getBlockState( pos.up( ) ).getBlock( ) != this; + final boolean highest = age < 7 || worldIn.getBlockState( pos.up( ) ).getBlock( ) != this; final boolean withFruits = ( age & 8 ) != 0; return state.withProperty( PTomato.SIZE , size ) // .withProperty( PTomato.HIGHEST , highest ) // @@ -372,6 +372,7 @@ public class PTomato } if ( this.getAge( s ) != 15 ) { this.grow( worldIn , bPos , s , MathHelper.getRandomIntegerInRange( worldIn.rand , 2 , 5 ) ); + this.grow( worldIn , bPos , s , 1 ); } } } @@ -381,7 +382,7 @@ public class PTomato { final int newAge = Math.min( 15 , this.getAge( state ) + increase ); worldIn.setBlockState( pos , this.withAge( newAge ) , 2 ); - if ( newAge > 7 && !this.isHighestBlock( worldIn , pos ) + if ( newAge > 6 && !this.isHighestBlock( worldIn , pos ) && worldIn.getBlockState( pos.up( ) ).getMaterial( ) == Material.AIR ) { worldIn.setBlockState( pos.up( ) , this.getDefaultState( ) ); } diff --git a/src/resources/assets/mmm/blockstates/plant/block/tomato.json b/src/resources/assets/mmm/blockstates/plant/block/tomato.json new file mode 100644 index 0000000..7b62d6b --- /dev/null +++ b/src/resources/assets/mmm/blockstates/plant/block/tomato.json @@ -0,0 +1,27 @@ +{ + "variants": { + "fruits=false,highest=true,size=0": { "model": "mmm:plant/tomato/s0" }, + "fruits=false,highest=false,size=0": { "model": "mmm:plant/tomato/s0" }, + + "fruits=false,highest=true,size=1": { "model": "mmm:plant/tomato/s1" }, + "fruits=false,highest=false,size=1": { "model": "mmm:plant/tomato/s1" }, + + "fruits=false,highest=true,size=2": { "model": "mmm:plant/tomato/s2" }, + "fruits=false,highest=false,size=2": { "model": "mmm:plant/tomato/s2" }, + + "fruits=false,highest=true,size=3": { "model": "mmm:plant/tomato/s3h" }, + "fruits=false,highest=false,size=3": { "model": "mmm:plant/tomato/s3c" }, + + "fruits=true,highest=true,size=0": { "model": "mmm:plant/tomato/f0h" }, + "fruits=true,highest=false,size=0": { "model": "mmm:plant/tomato/f0c" }, + + "fruits=true,highest=true,size=1": { "model": "mmm:plant/tomato/f1h" }, + "fruits=true,highest=false,size=1": { "model": "mmm:plant/tomato/f1c" }, + + "fruits=true,highest=true,size=2": { "model": "mmm:plant/tomato/f2h" }, + "fruits=true,highest=false,size=2": { "model": "mmm:plant/tomato/f2c" }, + + "fruits=true,highest=true,size=3": { "model": "mmm:plant/tomato/f3h" }, + "fruits=true,highest=false,size=3": { "model": "mmm:plant/tomato/f3c" } + } +} \ No newline at end of file diff --git a/src/resources/assets/mmm/models/block/plant.json b/src/resources/assets/mmm/models/block/plant.json new file mode 100644 index 0000000..79a291c --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant.json @@ -0,0 +1,24 @@ +{ + "ambientocclusion": false, + "textures": { + "particle": "#plant" + }, + "elements": [ + { "from": [ 0, -1, 8 ], + "to": [ 16, 15, 8 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant" }, + "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#plant" } + } + }, + { "from": [ 8, -1, 0 ], + "to": [ 8, 15, 16 ], + "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true }, + "faces": { + "west": { "uv": [ 0, 0, 16, 16 ], "texture": "#plant" }, + "east": { "uv": [ 16, 0, 0, 16 ], "texture": "#plant" } + } + } + ] +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f0c.json b/src/resources/assets/mmm/models/block/plant/tomato/f0c.json new file mode 100644 index 0000000..c2ddbba --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f0c.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f0c" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f0h.json b/src/resources/assets/mmm/models/block/plant/tomato/f0h.json new file mode 100644 index 0000000..25c8c6b --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f0h.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f0h" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f1c.json b/src/resources/assets/mmm/models/block/plant/tomato/f1c.json new file mode 100644 index 0000000..130e1f7 --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f1c.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f1c" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f1h.json b/src/resources/assets/mmm/models/block/plant/tomato/f1h.json new file mode 100644 index 0000000..4f64d1c --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f1h.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f1h" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f2c.json b/src/resources/assets/mmm/models/block/plant/tomato/f2c.json new file mode 100644 index 0000000..17d16dc --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f2c.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f2c" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f2h.json b/src/resources/assets/mmm/models/block/plant/tomato/f2h.json new file mode 100644 index 0000000..e2e23e8 --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f2h.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f2h" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f3c.json b/src/resources/assets/mmm/models/block/plant/tomato/f3c.json new file mode 100644 index 0000000..726926f --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f3c.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f3c" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/f3h.json b/src/resources/assets/mmm/models/block/plant/tomato/f3h.json new file mode 100644 index 0000000..02c2a40 --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/f3h.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/f3h" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/s0.json b/src/resources/assets/mmm/models/block/plant/tomato/s0.json new file mode 100644 index 0000000..e789be2 --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/s0.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/s0" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/s1.json b/src/resources/assets/mmm/models/block/plant/tomato/s1.json new file mode 100644 index 0000000..e72ccec --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/s1.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/s1" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/s2.json b/src/resources/assets/mmm/models/block/plant/tomato/s2.json new file mode 100644 index 0000000..5eb4728 --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/s2.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/s2" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/s3c.json b/src/resources/assets/mmm/models/block/plant/tomato/s3c.json new file mode 100644 index 0000000..5381be2 --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/s3c.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/s3c" + } +} diff --git a/src/resources/assets/mmm/models/block/plant/tomato/s3h.json b/src/resources/assets/mmm/models/block/plant/tomato/s3h.json new file mode 100644 index 0000000..81178b3 --- /dev/null +++ b/src/resources/assets/mmm/models/block/plant/tomato/s3h.json @@ -0,0 +1,6 @@ +{ + "parent": "mmm:block/plant" , + "textures": { + "plant": "mmm:blocks/plant/tomato/s3h" + } +} diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f0c.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f0c.png new file mode 100644 index 0000000..8841ce5 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f0c.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f0h.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f0h.png new file mode 100644 index 0000000..bd2c170 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f0h.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f1c.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f1c.png new file mode 100644 index 0000000..f437b40 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f1c.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f1h.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f1h.png new file mode 100644 index 0000000..4d54b1c Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f1h.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f2c.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f2c.png new file mode 100644 index 0000000..087aacf Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f2c.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f2h.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f2h.png new file mode 100644 index 0000000..a36efa6 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f2h.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f3c.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f3c.png new file mode 100644 index 0000000..fc5d356 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f3c.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/f3h.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/f3h.png new file mode 100644 index 0000000..7dd3040 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/f3h.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/s0.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/s0.png new file mode 100644 index 0000000..03f67ad Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/s0.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/s1.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/s1.png new file mode 100644 index 0000000..976d7b2 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/s1.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/s2.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/s2.png new file mode 100644 index 0000000..2f174ac Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/s2.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/s3c.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/s3c.png new file mode 100644 index 0000000..29a9f84 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/s3c.png differ diff --git a/src/resources/assets/mmm/textures/blocks/plant/tomato/s3h.png b/src/resources/assets/mmm/textures/blocks/plant/tomato/s3h.png new file mode 100644 index 0000000..533d884 Binary files /dev/null and b/src/resources/assets/mmm/textures/blocks/plant/tomato/s3h.png differ