Tomato appearance

This commit is contained in:
Emmanuel BENOîT 2016-07-20 13:09:04 +02:00
parent 007dd0d819
commit 2b1ece9012
31 changed files with 132 additions and 3 deletions

View file

@ -5,7 +5,6 @@ deco No Copper pots
deco No Copper plates deco No Copper plates
deco No Lanterns deco No Lanterns
------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------
plants No? Tomatoes
plants No? Turnips plants No? Turnips
plants No? Cabbages plants No? Cabbages
plants No? Zucchinis plants No? Zucchinis

BIN
graphics/tomato-plant.xcf Normal file

Binary file not shown.

View file

@ -220,7 +220,7 @@ public class PTomato
{ {
final int age = this.getAge( state ); final int age = this.getAge( state );
final int size = ( age & 7 ) >> 1; 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; final boolean withFruits = ( age & 8 ) != 0;
return state.withProperty( PTomato.SIZE , size ) // return state.withProperty( PTomato.SIZE , size ) //
.withProperty( PTomato.HIGHEST , highest ) // .withProperty( PTomato.HIGHEST , highest ) //
@ -372,6 +372,7 @@ public class PTomato
} }
if ( this.getAge( s ) != 15 ) { if ( this.getAge( s ) != 15 ) {
this.grow( worldIn , bPos , s , MathHelper.getRandomIntegerInRange( worldIn.rand , 2 , 5 ) ); 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 ); final int newAge = Math.min( 15 , this.getAge( state ) + increase );
worldIn.setBlockState( pos , this.withAge( newAge ) , 2 ); 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.getBlockState( pos.up( ) ).getMaterial( ) == Material.AIR ) {
worldIn.setBlockState( pos.up( ) , this.getDefaultState( ) ); worldIn.setBlockState( pos.up( ) , this.getDefaultState( ) );
} }

View file

@ -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" }
}
}

View file

@ -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" }
}
}
]
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f0c"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f0h"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f1c"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f1h"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f2c"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f2h"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f3c"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/f3h"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/s0"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/s1"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/s2"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/s3c"
}
}

View file

@ -0,0 +1,6 @@
{
"parent": "mmm:block/plant" ,
"textures": {
"plant": "mmm:blocks/plant/tomato/s3h"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B