Native controller fullbright. #1860

This commit is contained in:
raoulvdberge
2018-07-11 20:29:26 +02:00
parent ddb89f5ae5
commit 4a2634586a
26 changed files with 233 additions and 52 deletions

View File

@@ -8,6 +8,7 @@ import com.raoulvdberge.refinedstorage.block.info.BlockInfoBuilder;
import com.raoulvdberge.refinedstorage.item.itemblock.ItemBlockController;
import com.raoulvdberge.refinedstorage.render.IModelRegistration;
import com.raoulvdberge.refinedstorage.render.meshdefinition.ItemMeshDefinitionController;
import com.raoulvdberge.refinedstorage.render.model.baked.BakedModelFullbright;
import com.raoulvdberge.refinedstorage.tile.TileController;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
@@ -19,6 +20,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
@@ -36,12 +38,24 @@ public class BlockController extends BlockNodeProxy {
super(BlockInfoBuilder.forId("controller").tileEntity(TileController::new).create());
}
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
}
@Override
@SideOnly(Side.CLIENT)
public void registerModels(IModelRegistration modelRegistration) {
modelRegistration.setModelMeshDefinition(this, new ItemMeshDefinitionController());
modelRegistration.setStateMapper(this, new StateMap.Builder().ignore(TYPE).build());
modelRegistration.addBakedModelOverride(info.getId(), base -> new BakedModelFullbright(
base,
RS.ID + ":blocks/controller/cutouts/nearly_off",
RS.ID + ":blocks/controller/cutouts/nearly_on",
RS.ID + ":blocks/controller/cutouts/on"
));
}
@Override

View File

@@ -33,11 +33,11 @@ public class BlockSecurityManager extends BlockNode {
modelRegistration.addBakedModelOverride(info.getId(), base -> new BakedModelFullbright(
base,
"refinedstorage:blocks/security_manager/cutouts/top_connected",
"refinedstorage:blocks/security_manager/cutouts/front_connected",
"refinedstorage:blocks/security_manager/cutouts/left_connected",
"refinedstorage:blocks/security_manager/cutouts/back_connected",
"refinedstorage:blocks/security_manager/cutouts/right_connected"
RS.ID + ":blocks/security_manager/cutouts/top_connected",
RS.ID + ":blocks/security_manager/cutouts/front_connected",
RS.ID + ":blocks/security_manager/cutouts/left_connected",
RS.ID + ":blocks/security_manager/cutouts/back_connected",
RS.ID + ":blocks/security_manager/cutouts/right_connected"
));
}

View File

@@ -1,10 +1,11 @@
{
"forge_marker": 1,
"defaults": {
"model": "cube_all",
"model": "refinedstorage:cube_all_cutout",
"textures": {
"particle": "refinedstorage:blocks/controller_off",
"all": "refinedstorage:blocks/controller_off"
"particle": "refinedstorage:blocks/controller/controller_off",
"all": "refinedstorage:blocks/controller/controller_off",
"cutout": "refinedstorage:blocks/controller/cutouts/off"
}
},
"variants": {
@@ -17,18 +18,25 @@
"off": {
},
"nearly_off": {
"model": "refinedstorage:controller_nearly_on_off",
"textures": {
"all": "refinedstorage:blocks/controller_nearly_off"
"all": "refinedstorage:blocks/controller/controller",
"cutout": "refinedstorage:blocks/controller/cutouts/nearly_off",
"cutout_gray": "refinedstorage:blocks/controller/cutouts/nearly_off_gray"
}
},
"nearly_on": {
"model": "refinedstorage:controller_nearly_on_off",
"textures": {
"all": "refinedstorage:blocks/controller_nearly_on"
"all": "refinedstorage:blocks/controller/controller",
"cutout": "refinedstorage:blocks/controller/cutouts/nearly_on",
"cutout_gray": "refinedstorage:blocks/controller/cutouts/nearly_on_gray"
}
},
"on": {
"textures": {
"all": "refinedstorage:blocks/controller_on"
"all": "refinedstorage:blocks/controller/controller",
"cutout": "refinedstorage:blocks/controller/cutouts/on"
}
}
}

View File

@@ -0,0 +1,119 @@
{
"parent": "block/cube",
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"down": {
"texture": "#all",
"cullface": "down"
},
"up": {
"texture": "#all",
"cullface": "up"
},
"north": {
"texture": "#all",
"cullface": "north"
},
"south": {
"texture": "#all",
"cullface": "south"
},
"west": {
"texture": "#all",
"cullface": "west"
},
"east": {
"texture": "#all",
"cullface": "east"
}
}
},
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"up": {
"texture": "#cutout",
"cullface": "up"
},
"down": {
"texture": "#cutout",
"cullface": "down"
},
"north": {
"texture": "#cutout",
"cullface": "north"
},
"south": {
"texture": "#cutout",
"cullface": "south"
},
"west": {
"texture": "#cutout",
"cullface": "west"
},
"east": {
"texture": "#cutout",
"cullface": "east"
}
}
},
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"up": {
"texture": "#cutout_gray",
"cullface": "up"
},
"down": {
"texture": "#cutout_gray",
"cullface": "down"
},
"north": {
"texture": "#cutout_gray",
"cullface": "north"
},
"south": {
"texture": "#cutout_gray",
"cullface": "south"
},
"west": {
"texture": "#cutout_gray",
"cullface": "west"
},
"east": {
"texture": "#cutout_gray",
"cullface": "east"
}
}
}
]
}

View File

@@ -0,0 +1,81 @@
{
"parent": "block/cube",
"elements": [
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"down": {
"texture": "#all",
"cullface": "down"
},
"up": {
"texture": "#all",
"cullface": "up"
},
"north": {
"texture": "#all",
"cullface": "north"
},
"south": {
"texture": "#all",
"cullface": "south"
},
"west": {
"texture": "#all",
"cullface": "west"
},
"east": {
"texture": "#all",
"cullface": "east"
}
}
},
{
"from": [
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"up": {
"texture": "#cutout",
"cullface": "up"
},
"down": {
"texture": "#cutout",
"cullface": "down"
},
"north": {
"texture": "#cutout",
"cullface": "north"
},
"south": {
"texture": "#cutout",
"cullface": "south"
},
"west": {
"texture": "#cutout",
"cullface": "west"
},
"east": {
"texture": "#cutout",
"cullface": "east"
}
}
}
]
}

View File

@@ -50,7 +50,6 @@
16,
16
],
"shade": false,
"faces": {
"up": {
"texture": "#cutout_up",

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

View File

@@ -1,11 +1,4 @@
{
"ctm": {
"ctm_version": 1,
"layer": "CUTOUT",
"extra": {
"light": 15
}
},
"animation": {
"frametime": 1,
"frames": [

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

View File

@@ -1,11 +1,4 @@
{
"ctm": {
"ctm_version": 1,
"layer": "CUTOUT",
"extra": {
"light": 15
}
},
"animation": {
"frametime": 2,
"frames": [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -1,26 +0,0 @@
{
"ctm": {
"ctm_version": 1,
"layer": "CUTOUT",
"extra": {
"light": 15
}
},
"animation": {
"frametime": 2,
"frames": [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB