Detector, disk manipulator and wireless transmitter fullbright. #1860

This commit is contained in:
raoulvdberge
2018-07-12 03:29:07 +02:00
parent 13d6e7f2b9
commit f2d393d1f2
39 changed files with 380 additions and 269 deletions

View File

@@ -1,9 +1,11 @@
package com.raoulvdberge.refinedstorage.block; package com.raoulvdberge.refinedstorage.block;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.RSGui; import com.raoulvdberge.refinedstorage.RSGui;
import com.raoulvdberge.refinedstorage.block.info.BlockInfoBuilder; import com.raoulvdberge.refinedstorage.block.info.BlockInfoBuilder;
import com.raoulvdberge.refinedstorage.render.IModelRegistration; import com.raoulvdberge.refinedstorage.render.IModelRegistration;
import com.raoulvdberge.refinedstorage.render.collision.constants.ConstantsDetector; import com.raoulvdberge.refinedstorage.render.collision.constants.ConstantsDetector;
import com.raoulvdberge.refinedstorage.render.model.baked.BakedModelFullbright;
import com.raoulvdberge.refinedstorage.tile.TileDetector; import com.raoulvdberge.refinedstorage.tile.TileDetector;
import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.properties.PropertyBool;
import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockFaceShape;
@@ -33,6 +35,8 @@ public class BlockDetector extends BlockNode {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerModels(IModelRegistration modelRegistration) { public void registerModels(IModelRegistration modelRegistration) {
modelRegistration.setModel(this, 0, new ModelResourceLocation(info.getId(), "inventory")); modelRegistration.setModel(this, 0, new ModelResourceLocation(info.getId(), "inventory"));
modelRegistration.addBakedModelOverride(info.getId(), base -> new BakedModelFullbright(base, RS.ID + ":blocks/detector/cutouts/on"));
} }
@Override @Override

View File

@@ -13,6 +13,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
@@ -39,6 +40,11 @@ public class BlockDiskManipulator extends BlockNode {
modelRegistration.addModelLoader(() -> new CustomModelLoaderDefault(info.getId(), ModelDiskManipulator::new)); modelRegistration.addModelLoader(() -> new CustomModelLoaderDefault(info.getId(), ModelDiskManipulator::new));
} }
@Override
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
}
@Override @Override
@Nullable @Nullable
public BlockDirection getDirection() { public BlockDirection getDirection() {

View File

@@ -1,9 +1,11 @@
package com.raoulvdberge.refinedstorage.block; package com.raoulvdberge.refinedstorage.block;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.RSGui; import com.raoulvdberge.refinedstorage.RSGui;
import com.raoulvdberge.refinedstorage.block.info.BlockInfoBuilder; import com.raoulvdberge.refinedstorage.block.info.BlockInfoBuilder;
import com.raoulvdberge.refinedstorage.render.IModelRegistration; import com.raoulvdberge.refinedstorage.render.IModelRegistration;
import com.raoulvdberge.refinedstorage.render.collision.constants.ConstantsWirelessTransmitter; import com.raoulvdberge.refinedstorage.render.collision.constants.ConstantsWirelessTransmitter;
import com.raoulvdberge.refinedstorage.render.model.baked.BakedModelFullbright;
import com.raoulvdberge.refinedstorage.tile.TileWirelessTransmitter; import com.raoulvdberge.refinedstorage.tile.TileWirelessTransmitter;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.BlockFaceShape; import net.minecraft.block.state.BlockFaceShape;
@@ -36,6 +38,8 @@ public class BlockWirelessTransmitter extends BlockNode {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public void registerModels(IModelRegistration modelRegistration) { public void registerModels(IModelRegistration modelRegistration) {
modelRegistration.setModel(this, 0, new ModelResourceLocation(info.getId(), "inventory")); modelRegistration.setModel(this, 0, new ModelResourceLocation(info.getId(), "inventory"));
modelRegistration.addBakedModelOverride(info.getId(), base -> new BakedModelFullbright(base, RS.ID + ":blocks/wireless_transmitter/cutouts/connected"));
} }
@Override @Override

View File

@@ -2,6 +2,7 @@ package com.raoulvdberge.refinedstorage.render.model;
import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.render.model.baked.BakedModelDiskManipulator; import com.raoulvdberge.refinedstorage.render.model.baked.BakedModelDiskManipulator;
import com.raoulvdberge.refinedstorage.render.model.baked.BakedModelFullbright;
import net.minecraft.client.renderer.block.model.IBakedModel; import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormat;
@@ -17,6 +18,7 @@ import java.util.List;
import java.util.function.Function; import java.util.function.Function;
public class ModelDiskManipulator implements IModel { public class ModelDiskManipulator implements IModel {
private static final ResourceLocation MODEL_BASE_CUTOUT = new ResourceLocation(RS.ID + ":block/cube_north_cutout");
private static final ResourceLocation MODEL_BASE_CONNECTED = new ResourceLocation(RS.ID + ":block/disk_manipulator_connected"); private static final ResourceLocation MODEL_BASE_CONNECTED = new ResourceLocation(RS.ID + ":block/disk_manipulator_connected");
private static final ResourceLocation MODEL_BASE_DISCONNECTED = new ResourceLocation(RS.ID + ":block/disk_manipulator_disconnected"); private static final ResourceLocation MODEL_BASE_DISCONNECTED = new ResourceLocation(RS.ID + ":block/disk_manipulator_disconnected");
@@ -25,13 +27,11 @@ public class ModelDiskManipulator implements IModel {
private static final ResourceLocation MODEL_DISK_FULL = new ResourceLocation(RS.ID + ":block/disk_full"); private static final ResourceLocation MODEL_DISK_FULL = new ResourceLocation(RS.ID + ":block/disk_full");
private static final ResourceLocation MODEL_DISK_DISCONNECTED = new ResourceLocation(RS.ID + ":block/disk_disconnected"); private static final ResourceLocation MODEL_DISK_DISCONNECTED = new ResourceLocation(RS.ID + ":block/disk_disconnected");
// TODO: Remove?
private static final ResourceLocation TEXTURE_BASE_CONNECTED_GLOW = new ResourceLocation(RS.ID + ":blocks/disk_manipulator_connected_glow");
@Override @Override
public Collection<ResourceLocation> getDependencies() { public Collection<ResourceLocation> getDependencies() {
List<ResourceLocation> dependencies = new ArrayList<>(); List<ResourceLocation> dependencies = new ArrayList<>();
dependencies.add(MODEL_BASE_CUTOUT);
dependencies.add(MODEL_BASE_CONNECTED); dependencies.add(MODEL_BASE_CONNECTED);
dependencies.add(MODEL_BASE_DISCONNECTED); dependencies.add(MODEL_BASE_DISCONNECTED);
dependencies.add(MODEL_DISK); dependencies.add(MODEL_DISK);
@@ -44,7 +44,7 @@ public class ModelDiskManipulator implements IModel {
@Override @Override
public Collection<ResourceLocation> getTextures() { public Collection<ResourceLocation> getTextures() {
return Collections.singletonList(TEXTURE_BASE_CONNECTED_GLOW); return Collections.emptyList();
} }
@Override @Override
@@ -67,7 +67,7 @@ public class ModelDiskManipulator implements IModel {
} }
return new BakedModelDiskManipulator( return new BakedModelDiskManipulator(
baseModelConnected.bake(state, format, bakedTextureGetter), new BakedModelFullbright(baseModelConnected.bake(state, format, bakedTextureGetter), RS.ID + ":blocks/disk_manipulator/cutouts/connected"),
baseModelDisconnected.bake(state, format, bakedTextureGetter), baseModelDisconnected.bake(state, format, bakedTextureGetter),
diskModel.bake(state, format, bakedTextureGetter), diskModel.bake(state, format, bakedTextureGetter),
diskModelNearCapacity.bake(state, format, bakedTextureGetter), diskModelNearCapacity.bake(state, format, bakedTextureGetter),

View File

@@ -1,7 +1,7 @@
{ {
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"model": "refinedstorage:cube_cutout_north", "model": "refinedstorage:cube_north_cutout",
"textures": { "textures": {
"particle": "refinedstorage:blocks/side", "particle": "refinedstorage:blocks/side",
"north": "refinedstorage:blocks/crafter_manager/front", "north": "refinedstorage:blocks/crafter_manager/front",

View File

@@ -1,7 +1,7 @@
{ {
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"model": "refinedstorage:cube_cutout_north", "model": "refinedstorage:cube_north_cutout",
"textures": { "textures": {
"particle": "refinedstorage:blocks/crafting_monitor/front", "particle": "refinedstorage:blocks/crafting_monitor/front",
"north": "refinedstorage:blocks/crafting_monitor/front", "north": "refinedstorage:blocks/crafting_monitor/front",

View File

@@ -2,11 +2,11 @@
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"textures": { "textures": {
"particle": "refinedstorage:blocks/detector_top", "side": "refinedstorage:blocks/detector/side",
"torch": "refinedstorage:blocks/detector_side_off", "bottom": "refinedstorage:blocks/detector/bottom",
"side": "refinedstorage:blocks/detector_side_off", "top": "refinedstorage:blocks/detector/top",
"top": "refinedstorage:blocks/detector_top", "torch": "refinedstorage:blocks/detector/cutouts/off",
"bottom": "refinedstorage:blocks/detector_bottom" "particle": "refinedstorage:blocks/detector/side"
}, },
"model": "refinedstorage:detector" "model": "refinedstorage:detector"
}, },
@@ -19,7 +19,7 @@
"powered": { "powered": {
"true": { "true": {
"textures": { "textures": {
"torch": "refinedstorage:blocks/detector_side_on" "torch": "refinedstorage:blocks/detector/cutouts/on"
} }
}, },
"false": { "false": {

View File

@@ -1,7 +1,7 @@
{ {
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"model": "refinedstorage:cube_cutout_north", "model": "refinedstorage:cube_north_cutout",
"textures": { "textures": {
"particle": "refinedstorage:blocks/side", "particle": "refinedstorage:blocks/side",
"east": "refinedstorage:blocks/grid/left", "east": "refinedstorage:blocks/grid/left",

View File

@@ -1,9 +1,10 @@
{ {
"forge_marker": 1, "forge_marker": 1,
"defaults": { "defaults": {
"model": "torch", "model": "refinedstorage:wireless_transmitter",
"textures": { "textures": {
"torch": "refinedstorage:blocks/wireless_transmitter_disconnected" "torch": "refinedstorage:blocks/wireless_transmitter/wireless_transmitter",
"cutout": "refinedstorage:blocks/wireless_transmitter/cutouts/disconnected"
} }
}, },
"variants": { "variants": {
@@ -15,7 +16,7 @@
"connected": { "connected": {
"true": { "true": {
"textures": { "textures": {
"torch": "refinedstorage:blocks/wireless_transmitter_connected" "cutout": "refinedstorage:blocks/wireless_transmitter/cutouts/connected"
} }
}, },
"false": { "false": {

View File

@@ -1,210 +1,201 @@
{ {
"__comment": "Model made by CyanideX", "credit": "Made with Blockbench",
"elements": [ "elements": [
{ {
"name": "Element", "name": "Handle",
"from": [ "from": [
7.0, 7,
5.0, 5,
7.0 7
], ],
"to": [ "to": [
9.0, 9,
10.0, 8,
9.0 9
], ],
"shade": false, "shade": false,
"faces": { "faces": {
"north": { "north": {
"texture": "#torch",
"uv": [ "uv": [
7.0, 7,
5.0, 7,
9.0, 9,
11.0 11
] ],
"texture": "#side"
}, },
"east": { "east": {
"texture": "#torch",
"uv": [ "uv": [
7.0, 7,
5.0, 7,
9.0, 9,
11.0 11
] ],
"texture": "#side"
}, },
"south": { "south": {
"texture": "#torch",
"uv": [ "uv": [
7.0, 7,
5.0, 7,
9.0, 9,
11.0 11
] ],
"texture": "#side"
}, },
"west": { "west": {
"texture": "#torch",
"uv": [ "uv": [
7.0, 7,
5.0, 7,
9.0, 9,
11.0 11
] ],
"texture": "#side"
}, },
"up": { "up": {
"texture": "#torch",
"uv": [ "uv": [
7.0, 7,
5.0, 7,
9.0, 9,
7.0 9
] ],
}, "texture": "#side"
"down": {
"texture": "#torch",
"uv": [
7.0,
7.0,
9.0,
9.0
]
} }
} }
}, },
{ {
"name": "Element", "name": "Torch",
"from": [ "from": [
7.0, 7,
5.0, 5,
6.0 6
], ],
"to": [ "to": [
9.0, 9,
11.0, 11,
10.0 10
], ],
"shade": false, "shade": false,
"faces": { "faces": {
"east": { "east": {
"texture": "#torch",
"uv": [ "uv": [
6.0, 6,
4.0, 4,
10.0, 10,
11.0 12
] ],
"texture": "#torch"
}, },
"west": { "west": {
"texture": "#torch",
"uv": [ "uv": [
6.0, 6,
4.0, 4,
10.0, 10,
11.0 12
] ],
"texture": "#torch"
} }
} }
}, },
{ {
"name": "Element", "name": "Torch",
"from": [ "from": [
6.0, 6,
5.0, 5,
7.0 7
], ],
"to": [ "to": [
10.0, 10,
11.0, 11,
9.0 9
], ],
"shade": false, "shade": false,
"faces": { "faces": {
"north": { "north": {
"texture": "#torch",
"uv": [ "uv": [
6.0, 6,
4.0, 4,
10.0, 10,
11.0 12
] ],
"texture": "#torch"
}, },
"south": { "south": {
"texture": "#torch",
"uv": [ "uv": [
6.0, 6,
4.0, 4,
10.0, 10,
11.0 12
] ],
"texture": "#torch"
} }
} }
}, },
{ {
"name": "base", "name": "Base",
"from": [ "from": [
0.0, 0,
0.0, 0,
0.0 0
], ],
"to": [ "to": [
16.0, 16,
5.0, 5,
16.0 16
], ],
"faces": { "faces": {
"north": { "north": {
"texture": "#side",
"uv": [ "uv": [
0.0, 0,
11.0, 11,
16.0, 16,
16.0 16
] ],
"texture": "#side"
}, },
"east": { "east": {
"texture": "#side",
"uv": [ "uv": [
0.0, 0,
11.0, 11,
16.0, 16,
16.0 16
] ],
"texture": "#side"
}, },
"south": { "south": {
"texture": "#side",
"uv": [ "uv": [
0.0, 0,
11.0, 11,
16.0, 16,
16.0 16
] ],
"texture": "#side"
}, },
"west": { "west": {
"texture": "#side",
"uv": [ "uv": [
0.0, 0,
11.0, 11,
16.0, 16,
16.0 16
] ],
"texture": "#side"
}, },
"up": { "up": {
"texture": "#top",
"uv": [ "uv": [
0.0, 0,
0.0, 0,
16.0, 16,
16.0 16
] ],
"texture": "#top"
}, },
"down": { "down": {
"texture": "#bottom",
"uv": [ "uv": [
0.0, 0,
0.0, 0,
16.0, 16,
16.0 16
] ],
"texture": "#bottom"
} }
} }
} }

View File

@@ -1,50 +1,13 @@
{ {
"parent": "block/block", "parent": "refinedstorage:block/cube_north_cutout",
"textures": { "textures": {
"particle": "refinedstorage:blocks/disk_manipulator_connected", "particle": "refinedstorage:blocks/disk_manipulator/disk_manipulator",
"front": "refinedstorage:blocks/disk_manipulator_connected", "north": "refinedstorage:blocks/disk_manipulator/disk_manipulator",
"bottom": "refinedstorage:blocks/side", "east": "refinedstorage:blocks/side",
"top": "refinedstorage:blocks/side", "south": "refinedstorage:blocks/side",
"side": "refinedstorage:blocks/side" "west": "refinedstorage:blocks/side",
}, "up": "refinedstorage:blocks/side",
"elements": [ "down": "refinedstorage:blocks/side",
{ "cutout": "refinedstorage:blocks/disk_manipulator/cutouts/connected"
"from": [ }
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"down": {
"texture": "#bottom",
"cullface": "down"
},
"up": {
"texture": "#top",
"cullface": "up"
},
"north": {
"texture": "#front",
"cullface": "north"
},
"south": {
"texture": "#side",
"cullface": "south"
},
"west": {
"texture": "#side",
"cullface": "west"
},
"east": {
"texture": "#side",
"cullface": "east"
}
}
}
]
} }

View File

@@ -1,50 +1,13 @@
{ {
"parent": "block/block", "parent": "refinedstorage:block/cube_north_cutout",
"textures": { "textures": {
"particle": "refinedstorage:blocks/disk_manipulator_disconnected", "particle": "refinedstorage:blocks/disk_manipulator/disk_manipulator",
"front": "refinedstorage:blocks/disk_manipulator_disconnected", "north": "refinedstorage:blocks/disk_manipulator/disk_manipulator",
"bottom": "refinedstorage:blocks/side", "east": "refinedstorage:blocks/side",
"top": "refinedstorage:blocks/side", "south": "refinedstorage:blocks/side",
"side": "refinedstorage:blocks/side" "west": "refinedstorage:blocks/side",
}, "up": "refinedstorage:blocks/side",
"elements": [ "down": "refinedstorage:blocks/side",
{ "cutout": "refinedstorage:blocks/disk_manipulator/cutouts/disconnected"
"from": [ }
0,
0,
0
],
"to": [
16,
16,
16
],
"faces": {
"down": {
"texture": "#bottom",
"cullface": "down"
},
"up": {
"texture": "#top",
"cullface": "up"
},
"north": {
"texture": "#front",
"cullface": "north"
},
"south": {
"texture": "#side",
"cullface": "south"
},
"west": {
"texture": "#side",
"cullface": "west"
},
"east": {
"texture": "#side",
"cullface": "east"
}
}
}
]
} }

View File

@@ -0,0 +1,206 @@
{
"ambientocclusion": false,
"textures": {
"particle": "#torch"
},
"elements": [
{
"from": [
7,
0,
7
],
"to": [
9,
10,
9
],
"shade": false,
"faces": {
"down": {
"uv": [
7,
13,
9,
15
],
"texture": "#torch"
},
"up": {
"uv": [
7,
6,
9,
8
],
"texture": "#torch"
}
}
},
{
"from": [
7,
0,
0
],
"to": [
9,
16,
16
],
"shade": false,
"faces": {
"west": {
"uv": [
0,
0,
16,
16
],
"texture": "#torch"
},
"east": {
"uv": [
0,
0,
16,
16
],
"texture": "#torch"
}
}
},
{
"from": [
0,
0,
7
],
"to": [
16,
16,
9
],
"shade": false,
"faces": {
"north": {
"uv": [
0,
0,
16,
16
],
"texture": "#torch"
},
"south": {
"uv": [
0,
0,
16,
16
],
"texture": "#torch"
}
}
},
{
"from": [
7,
0,
7
],
"to": [
9,
10,
9
],
"shade": false,
"faces": {
"down": {
"uv": [
7,
13,
9,
15
],
"texture": "#cutout"
},
"up": {
"uv": [
7,
6,
9,
8
],
"texture": "#cutout"
}
}
},
{
"from": [
7,
0,
0
],
"to": [
9,
16,
16
],
"shade": false,
"faces": {
"west": {
"uv": [
0,
0,
16,
16
],
"texture": "#cutout"
},
"east": {
"uv": [
0,
0,
16,
16
],
"texture": "#cutout"
}
}
},
{
"from": [
0,
0,
7
],
"to": [
16,
16,
9
],
"shade": false,
"faces": {
"north": {
"uv": [
0,
0,
16,
16
],
"texture": "#cutout"
},
"south": {
"uv": [
0,
0,
16,
16
],
"texture": "#cutout"
}
}
}
]
}

View File

@@ -1,8 +1,8 @@
{ {
"type": "minecraft:crafting_shaped", "type": "minecraft:crafting_shaped",
"pattern": [ "pattern": [
"ECE", "ERE",
"RMR", "CMC",
"EPE" "EPE"
], ],
"key": { "key": {
@@ -13,7 +13,7 @@
"item": "minecraft:comparator" "item": "minecraft:comparator"
}, },
"R": { "R": {
"item": "minecraft:redstone" "item": "minecraft:redstone_torch"
}, },
"M": { "M": {
"item": "refinedstorage:machine_casing" "item": "refinedstorage:machine_casing"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,9 +0,0 @@
{
"ctm": {
"ctm_version": 1,
"layer": "CUTOUT",
"extra": {
"light": 15
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 625 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,9 +0,0 @@
{
"ctm": {
"ctm_version": 1,
"layer": "CUTOUT",
"extra": {
"light": 15
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -1,9 +0,0 @@
{
"ctm": {
"ctm_version": 1,
"layer": "CUTOUT",
"extra": {
"light": 15
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB