mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-23 03:49:22 +01:00
New oil gen texture/model.
Top texture not finished. Need canola press,oil and coal generators set up for on/off textures.
This commit is contained in:
parent
230c5a8743
commit
5fed8383fc
5 changed files with 146 additions and 5 deletions
|
@ -18,7 +18,9 @@ import de.ellpeck.actuallyadditions.mod.proxy.ClientProxy;
|
|||
import de.ellpeck.actuallyadditions.mod.tile.TileEntityOilGenerator;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -27,6 +29,7 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
@ -35,6 +38,8 @@ import java.util.Random;
|
|||
|
||||
public class BlockOilGenerator extends BlockContainerBase{
|
||||
|
||||
private static final PropertyInteger META = PropertyInteger.create("meta", 0, 7);
|
||||
|
||||
public BlockOilGenerator(String name){
|
||||
super(Material.ROCK, name);
|
||||
this.setHarvestLevel("pickaxe", 0);
|
||||
|
@ -45,6 +50,17 @@ public class BlockOilGenerator extends BlockContainerBase{
|
|||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state){
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int par2){
|
||||
return new TileEntityOilGenerator();
|
||||
|
@ -77,6 +93,26 @@ public class BlockOilGenerator extends BlockContainerBase{
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack stack){
|
||||
int rotation = MathHelper.floor_double((double)(player.rotationYaw*4.0F/360.0F)+0.5D) & 3;
|
||||
|
||||
if(rotation == 0){
|
||||
world.setBlockState(pos, this.getStateFromMeta(0), 2);
|
||||
}
|
||||
if(rotation == 1){
|
||||
world.setBlockState(pos, this.getStateFromMeta(3), 2);
|
||||
}
|
||||
if(rotation == 2){
|
||||
world.setBlockState(pos, this.getStateFromMeta(1), 2);
|
||||
}
|
||||
if(rotation == 3){
|
||||
world.setBlockState(pos, this.getStateFromMeta(2), 2);
|
||||
}
|
||||
|
||||
super.onBlockPlacedBy(world, pos, state, player, stack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumRarity getRarity(ItemStack stack){
|
||||
return EnumRarity.RARE;
|
||||
|
@ -87,4 +123,10 @@ public class BlockOilGenerator extends BlockContainerBase{
|
|||
this.dropInventory(world, pos);
|
||||
super.breakBlock(world, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyInteger getMetaProperty(){
|
||||
return META;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,16 +1,20 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"model": "minecraft:cube_bottom_top",
|
||||
"model": "actuallyadditions:blockOilGenerator",
|
||||
"textures": {
|
||||
"side": "actuallyadditions:blocks/blockOilGenerator",
|
||||
"bottom": "actuallyadditions:blocks/blockOilGeneratorBottom",
|
||||
"top": "actuallyadditions:blocks/blockOilGeneratorTop"
|
||||
"particle": "actuallyadditions:blocks/blockOilGenerator"
|
||||
},
|
||||
"transform": "forge:default-block"
|
||||
},
|
||||
"variants": {
|
||||
"normal": [{}],
|
||||
"inventory": [{}]
|
||||
"inventory": [{}],
|
||||
"meta": {
|
||||
"0": { "y" : 0 },
|
||||
"1": { "y" : 180 },
|
||||
"2": { "y" : 270 },
|
||||
"3": { "y" : 90 }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
"__comment": "Model generated using MrCrayfish's Model Creator (http://mrcrayfish.com/modelcreator/)",
|
||||
"textures": {
|
||||
"0": "actuallyadditions:blocks/blockOilGenerator",
|
||||
"1": "actuallyadditions:blocks/blockCoalGeneratorSide",
|
||||
"2": "actuallyadditions:blocks/blockCoalGeneratorTop",
|
||||
"3": "actuallyadditions:blocks/blockCoalGeneratorBottom"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 1.0, 0.0, 1.0 ],
|
||||
"to": [ 15.0, 15.0, 15.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 1.0, 1.0, 15.0, 16.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 1.0, 1.0, 15.0, 16.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 1.0, 1.0, 15.0, 16.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 1.0, 1.0, 15.0, 16.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 1.0, 1.0, 15.0, 15.0 ], "cullface": "up" },
|
||||
"down": { "texture": "#3", "uv": [ 1.0, 1.0, 15.0, 15.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Outline",
|
||||
"from": [ 0.0, 0.0, 0.0 ],
|
||||
"to": [ 1.0, 15.0, 1.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 15.0, 1.0, 16.0, 15.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 0.0, 0.0, 15.0 ],
|
||||
"to": [ 1.0, 15.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 15.0, 0.0, 15.0 ],
|
||||
"to": [ 16.0, 15.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 15.0, 0.0, 0.0 ],
|
||||
"to": [ 16.0, 15.0, 1.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#0", "uv": [ 0.0, 1.0, 1.0, 15.0 ] },
|
||||
"east": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"south": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"west": { "texture": "#1", "uv": [ 0.0, 1.0, 1.0, 16.0 ] },
|
||||
"up": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"down": { "texture": "#1", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Cube",
|
||||
"from": [ 0.0, 15.0, 0.0 ],
|
||||
"to": [ 16.0, 16.0, 16.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
|
||||
"east": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
|
||||
"south": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
|
||||
"west": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 1.0 ] },
|
||||
"up": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] },
|
||||
"down": { "texture": "#2", "uv": [ 0.0, 0.0, 16.0, 16.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 660 B After Width: | Height: | Size: 3.9 KiB |
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"animation":
|
||||
{
|
||||
"frametime": 3
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue