Complete migration of spreaders to baked models

This commit is contained in:
Vincent Lee committed 2020-02-26 10:27:53 -06:00
1 parent fcb301a97f
commit 049936bc30
29 files changed
+234 -71

No files matched your search

@@ -83,7 +83,12 @@ public class MiscellaneousIcons {
crimsonGem,
cirrusGem,
nimbusGem,
terrasteelHelmWillModel;
terrasteelHelmWillModel,
elvenSpreaderInside,
gaiaSpreaderInside,
manaSpreaderInside,
redstoneSpreaderInside
;
public final IBakedModel[] kingKeyWeaponModels = new IBakedModel[ItemKingKey.WEAPON_TYPES];
@@ -146,6 +151,10 @@ public class MiscellaneousIcons {
RenderTileCorporeaCrystalCube.cubeModel = evt.getModelRegistry().get(prefix("block/corporea_crystal_cube_glass"));
RenderTilePump.headModel = evt.getModelRegistry().get(prefix("block/pump_head"));
elvenSpreaderInside = evt.getModelRegistry().get(prefix("block/elven_spreader_inside"));
gaiaSpreaderInside = evt.getModelRegistry().get(prefix("block/gaia_spreader_inside"));
manaSpreaderInside = evt.getModelRegistry().get(prefix("block/mana_spreader_inside"));
redstoneSpreaderInside = evt.getModelRegistry().get(prefix("block/redstone_spreader_inside"));
// Icons
goldfishModel = evt.getModelRegistry().get(prefix("icon/goldfish"));
@@ -104,6 +104,10 @@ public final class ModelHandler {
ModelLoader.addSpecialModel(new ModelResourceLocation(LibMisc.MOD_ID + ":desu_gun_clip", "inventory"));
ModelLoader.addSpecialModel(prefix("block/corporea_crystal_cube_glass"));
ModelLoader.addSpecialModel(prefix("block/pump_head"));
ModelLoader.addSpecialModel(prefix("block/elven_spreader_inside"));
ModelLoader.addSpecialModel(prefix("block/gaia_spreader_inside"));
ModelLoader.addSpecialModel(prefix("block/mana_spreader_inside"));
ModelLoader.addSpecialModel(prefix("block/redstone_spreader_inside"));
registerSubtiles();
ClientRegistry.bindTileEntityRenderer(TileAltar.TYPE, RenderTileAltar::new);
@@ -31,14 +31,6 @@ public final class LibResources {
public static final String GUI_BAUBLE_BOX = PREFIX_GUI + "bauble_box.png";
public static final String GUI_HUD_ICONS = PREFIX_GUI + "hud_icons.png";
public static final String MODEL_SPREADER = PREFIX_MODEL + "spreader_mana.png";
public static final String MODEL_SPREADER_REDSTONE = PREFIX_MODEL + "spreader_redstone.png";
public static final String MODEL_SPREADER_DREAMWOOD = PREFIX_MODEL + "spreader_dreamwood.png";
public static final String MODEL_SPREADER_GAIA = PREFIX_MODEL + "spreader_gaia.png";
public static final String MODEL_SPREADER_HALLOWEEN = PREFIX_MODEL + "spreader_mana_halloween.png";
public static final String MODEL_SPREADER_REDSTONE_HALLOWEEN = PREFIX_MODEL + "spreader_redstone_halloween.png";
public static final String MODEL_SPREADER_DREAMWOOD_HALLOWEEN = PREFIX_MODEL + "spreader_dreamwood_halloween.png";
public static final String MODEL_SPREADER_GAIA_HALLOWEEN = PREFIX_MODEL + "spreader_gaia_halloween.png";
public static final String MODEL_PYLON_MANA = PREFIX_MODEL + "pylon_mana.png";
public static final String MODEL_PYLON_NATURA = PREFIX_MODEL + "pylon_natura.png";
public static final String MODEL_PYLON_GAIA = PREFIX_MODEL + "pylon_gaia.png";
@@ -28,6 +28,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;
import vazkii.botania.api.ColorHelper;
import vazkii.botania.client.core.handler.ClientTickHandler;
import vazkii.botania.client.core.handler.MiscellaneousIcons;
import vazkii.botania.client.core.proxy.ClientProxy;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.block.tile.mana.TileSpreader;
@@ -37,22 +38,12 @@ import java.util.Random;
public class RenderTileSpreader extends TileEntityRenderer<TileSpreader> {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_SPREADER);
private static final ResourceLocation textureRs = new ResourceLocation(LibResources.MODEL_SPREADER_REDSTONE);
private static final ResourceLocation textureDw = new ResourceLocation(LibResources.MODEL_SPREADER_DREAMWOOD);
private static final ResourceLocation textureG = new ResourceLocation(LibResources.MODEL_SPREADER_GAIA);
private static final ResourceLocation textureHalloween = new ResourceLocation(LibResources.MODEL_SPREADER_HALLOWEEN);
private static final ResourceLocation textureRsHalloween = new ResourceLocation(LibResources.MODEL_SPREADER_REDSTONE_HALLOWEEN);
private static final ResourceLocation textureDwHalloween = new ResourceLocation(LibResources.MODEL_SPREADER_DREAMWOOD_HALLOWEEN);
private static final ResourceLocation textureGHalloween = new ResourceLocation(LibResources.MODEL_SPREADER_GAIA_HALLOWEEN);
public RenderTileSpreader(TileEntityRendererDispatcher manager) {
super(manager);
}
@Override
public void render(@Nonnull TileSpreader spreader, float ticks, MatrixStack ms, IRenderTypeBuffer buffers, int light, int overlay) {
public void render(@Nonnull TileSpreader spreader, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int light, int overlay) {
ms.push();
ms.translate(0.5F, 0.5, 0.5F);
@@ -62,16 +53,8 @@ public class RenderTileSpreader extends TileEntityRenderer<TileSpreader> {
ms.multiply(transform);
ms.translate(-0.5F, -0.5F, -0.5F);
//ms.translate(0F, -1F, 0F);
//ms.translate(0F, 1F, 0F);
ResourceLocation texture = spreader.isRedstone() ? textureRs : spreader.isDreamwood() ? textureDw : spreader.isULTRA_SPREADER() ? textureG : RenderTileSpreader.texture;
if(ClientProxy.dootDoot)
texture = spreader.isRedstone() ? textureRsHalloween : spreader.isDreamwood() ? textureDwHalloween : spreader.isULTRA_SPREADER() ? textureGHalloween : textureHalloween;
//ms.scale(1F, -1F, -1F);
double time = ClientTickHandler.ticksInGame + ticks;
double time = ClientTickHandler.ticksInGame + partialTicks;
float r = 1, g = 1, b = 1;
if(spreader.isULTRA_SPREADER()) {
@@ -80,6 +63,7 @@ public class RenderTileSpreader extends TileEntityRenderer<TileSpreader> {
g = (color >> 8 & 0xFF) / 255F;
b = (color & 0xFF) / 255F;
}
IVertexBuilder buffer = buffers.getBuffer(Atlases.getEntitySolid());
IBakedModel bakedModel = Minecraft.getInstance().getBlockRendererDispatcher().getModelForState(spreader.getBlockState());
Minecraft.getInstance().getBlockRendererDispatcher().getBlockModelRenderer()
@@ -87,11 +71,14 @@ public class RenderTileSpreader extends TileEntityRenderer<TileSpreader> {
bakedModel, r, g, b, light, overlay);
ms.push();
double worldTicks = spreader.getWorld() == null ? 0 : time;
ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion((float) worldTicks % 360));
ms.translate(0F, (float) Math.sin(worldTicks / 20.0) * 0.05F, 0F);
// model.renderCube(ms, buffer, light, overlay);
// todo 1.15 migrate the cube too
ms.translate(0.5, 0.5, 0.5);
ms.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion((float) time % 360));
ms.translate(-0.5, -0.5, -0.5);
ms.translate(0F, (float) Math.sin(time / 20.0) * 0.05F, 0F);
IBakedModel cube = getInsideModel(spreader);
Minecraft.getInstance().getBlockRendererDispatcher().getBlockModelRenderer()
.render(ms.peek(), buffer, spreader.getBlockState(),
cube, 1, 1, 1, light, overlay);
ms.pop();
ms.translate(0.5, 1.5, 0.5);
@@ -151,4 +138,16 @@ public class RenderTileSpreader extends TileEntityRenderer<TileSpreader> {
ms.pop();
}
private IBakedModel getInsideModel(TileSpreader tile) {
if (tile.isULTRA_SPREADER()) {
return MiscellaneousIcons.INSTANCE.gaiaSpreaderInside;
} else if (tile.isDreamwood()) {
return MiscellaneousIcons.INSTANCE.elvenSpreaderInside;
} else if (tile.isRedstone()) {
return MiscellaneousIcons.INSTANCE.redstoneSpreaderInside;
} else {
return MiscellaneousIcons.INSTANCE.manaSpreaderInside;
}
}
}
@@ -1,8 +1,7 @@
{
"parent": "botania:block/shapes/spreader",
"textures": {
"inside": "botania:model/spreader_item/elven_inside",
"side": "botania:model/spreader_item/elven_side",
"side": "botania:blocks/elven_spreader_side",
"material": "botania:blocks/dreamwood0"
}
}
@@ -0,0 +1,6 @@
{
"parent": "botania:block/shapes/spreader_inside",
"textures": {
"inside": "botania:blocks/elven_spreader_inside"
}
}
@@ -1,8 +1,7 @@
{
"parent": "botania:block/shapes/spreader",
"textures": {
"inside": "botania:model/spreader_item/gaia_inside",
"side": "botania:model/spreader_item/gaia_side",
"material": "botania:model/spreader_item/gaia_material"
"side": "botania:blocks/gaia_spreader_side",
"material": "botania:blocks/gaia_spreader_material"
}
}
@@ -0,0 +1,6 @@
{
"parent": "botania:block/shapes/spreader_inside",
"textures": {
"inside": "botania:blocks/gaia_spreader_inside"
}
}
@@ -1,8 +1,7 @@
{
"parent": "botania:block/shapes/spreader",
"textures": {
"inside": "botania:model/spreader_item/mana_inside",
"side": "botania:model/spreader_item/mana_side",
"side": "botania:blocks/mana_spreader_side",
"material": "botania:blocks/livingwood0"
}
}
@@ -0,0 +1,6 @@
{
"parent": "botania:block/shapes/spreader_inside",
"textures": {
"inside": "botania:blocks/mana_spreader_inside"
}
}
@@ -1,8 +1,7 @@
{
"parent": "botania:block/shapes/spreader",
"textures": {
"inside": "botania:model/spreader_item/redstone_inside",
"side": "botania:model/spreader_item/redstone_side",
"side": "botania:blocks/redstone_spreader_side",
"material": "botania:blocks/livingwood0"
}
}
@@ -0,0 +1,6 @@
{
"parent": "botania:block/shapes/spreader_inside",
"textures": {
"inside": "botania:blocks/redstone_spreader_inside"
}
}
@@ -4,25 +4,10 @@
"particle": "#material"
},
"elements": [
{
"name": "inside",
"from": [5, 5, 5],
"to": [11, 11, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"east": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"south": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"west": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"up": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"down": {"uv": [2, 2, 14, 14], "texture": "#inside"}
}
},
{
"name": "bottom",
"from": [1, 1, 1],
"to": [15, 2, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [1, 1, 15, 2], "texture": "#material", "tintindex": 0},
"east": {"uv": [1, 1, 15, 2], "texture": "#material", "tintindex": 0},
@@ -36,7 +21,6 @@
"name": "back",
"from": [1, 2, 14],
"to": [15, 14, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [0, 0, 14, 12], "texture": "#material", "tintindex": 0},
"east": {"uv": [0, 0, 1, 12], "texture": "#material", "tintindex": 0},
@@ -50,7 +34,6 @@
"name": "top",
"from": [1, 14, 1],
"to": [15, 15, 15],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0},
"east": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0},
@@ -64,7 +47,6 @@
"name": "west",
"from": [1, 2, 2],
"to": [2, 14, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"east": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0},
"west": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0}
@@ -74,7 +56,6 @@
"name": "east",
"from": [14, 2, 2],
"to": [15, 14, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"east": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0},
"west": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0}
@@ -84,7 +65,6 @@
"name": "front_bottom",
"from": [6, 2, 1],
"to": [10, 6, 2],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
"south": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
@@ -95,7 +75,6 @@
"name": "front_top",
"from": [6, 10, 1],
"to": [10, 14, 2],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
"south": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
@@ -106,7 +85,6 @@
"name": "front_left",
"from": [1, 2, 1],
"to": [6, 14, 2],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [1, 1, 5, 13], "texture": "#material", "tintindex": 0},
"east": {"uv": [1, 1, 2, 13], "texture": "#material", "tintindex": 0},
@@ -118,7 +96,6 @@
"name": "front_right",
"from": [10, 2, 1],
"to": [15, 14, 2],
"rotation": {"angle": 0, "axis": "y", "origin": [8, 9, 8]},
"faces": {
"north": {"uv": [12, 1, 16, 13], "texture": "#material", "tintindex": 0},
"east": {"uv": [15, 1, 16, 13], "texture": "#material", "tintindex": 0},
@@ -0,0 +1,21 @@
{
"parent": "minecraft:block/block",
"textures": {
"particle": "#inside"
},
"elements": [
{
"name": "inside",
"from": [5, 5, 5],
"to": [11, 11, 11],
"faces": {
"north": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"east": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"south": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"west": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"up": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"down": {"uv": [2, 2, 14, 14], "texture": "#inside"}
}
}
]
}
@@ -0,0 +1,121 @@
{
"__comment": "Combination of spreader and spreader_inside",
"parent": "minecraft:block/block",
"textures": {
"particle": "#material"
},
"elements": [
{
"name": "inside",
"from": [5, 5, 5],
"to": [11, 11, 11],
"faces": {
"north": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"east": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"south": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"west": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"up": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"down": {"uv": [2, 2, 14, 14], "texture": "#inside"}
}
},
{
"name": "bottom",
"from": [1, 1, 1],
"to": [15, 2, 15],
"faces": {
"north": {"uv": [1, 1, 15, 2], "texture": "#material", "tintindex": 0},
"east": {"uv": [1, 1, 15, 2], "texture": "#material", "tintindex": 0},
"south": {"uv": [1, 1, 15, 2], "texture": "#material", "tintindex": 0},
"west": {"uv": [1, 1, 15, 2], "texture": "#material", "tintindex": 0},
"up": {"uv": [1, 1, 15, 15], "texture": "#material", "tintindex": 0},
"down": {"uv": [1, 1, 15, 15], "texture": "#material", "tintindex": 0}
}
},
{
"name": "back",
"from": [1, 2, 14],
"to": [15, 14, 15],
"faces": {
"north": {"uv": [0, 0, 14, 12], "texture": "#material", "tintindex": 0},
"east": {"uv": [0, 0, 1, 12], "texture": "#material", "tintindex": 0},
"south": {"uv": [0, 0, 14, 12], "texture": "#material", "tintindex": 0},
"west": {"uv": [0, 0, 1, 12], "texture": "#material", "tintindex": 0},
"up": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0},
"down": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0}
}
},
{
"name": "top",
"from": [1, 14, 1],
"to": [15, 15, 15],
"faces": {
"north": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0},
"east": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0},
"south": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0},
"west": {"uv": [0, 0, 14, 1], "texture": "#material", "tintindex": 0},
"up": {"uv": [1, 1, 15, 15], "texture": "#material", "tintindex": 0},
"down": {"uv": [1, 1, 15, 15], "texture": "#material", "tintindex": 0}
}
},
{
"name": "west",
"from": [1, 2, 2],
"to": [2, 14, 14],
"faces": {
"east": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0},
"west": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0}
}
},
{
"name": "east",
"from": [14, 2, 2],
"to": [15, 14, 14],
"faces": {
"east": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0},
"west": {"uv": [2, 2, 14, 14], "texture": "#side", "tintindex": 0}
}
},
{
"name": "front_bottom",
"from": [6, 2, 1],
"to": [10, 6, 2],
"faces": {
"north": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
"south": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
"up": {"uv": [0, 0, 4, 1], "texture": "#material", "tintindex": 0}
}
},
{
"name": "front_top",
"from": [6, 10, 1],
"to": [10, 14, 2],
"faces": {
"north": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
"south": {"uv": [0, 0, 4, 4], "texture": "#material", "tintindex": 0},
"down": {"uv": [0, 0, 4, 1], "texture": "#material", "tintindex": 0}
}
},
{
"name": "front_left",
"from": [1, 2, 1],
"to": [6, 14, 2],
"faces": {
"north": {"uv": [1, 1, 5, 13], "texture": "#material", "tintindex": 0},
"east": {"uv": [1, 1, 2, 13], "texture": "#material", "tintindex": 0},
"south": {"uv": [1, 1, 5, 13], "texture": "#material", "tintindex": 0},
"west": {"uv": [1, 1, 2, 13], "texture": "#material", "tintindex": 0}
}
},
{
"name": "front_right",
"from": [10, 2, 1],
"to": [15, 14, 2],
"faces": {
"north": {"uv": [12, 1, 16, 13], "texture": "#material", "tintindex": 0},
"east": {"uv": [15, 1, 16, 13], "texture": "#material", "tintindex": 0},
"south": {"uv": [12, 1, 16, 13], "texture": "#material", "tintindex": 0},
"west": {"uv": [15, 1, 16, 13], "texture": "#material", "tintindex": 0}
}
}
]
}
@@ -1,3 +1,8 @@
{
"parent": "botania:block/elven_spreader"
}
"parent": "botania:block/shapes/spreader_item",
"textures": {
"inside": "botania:blocks/elven_spreader_inside",
"side": "botania:blocks/elven_spreader_side",
"material": "botania:blocks/dreamwood0"
}
}
@@ -1,3 +1,8 @@
{
"parent": "botania:block/gaia_spreader"
"parent": "botania:block/shapes/spreader_item",
"textures": {
"inside": "botania:blocks/gaia_spreader_inside",
"side": "botania:blocks/gaia_spreader_side",
"material": "botania:blocks/gaia_spreader_material"
}
}
@@ -1,3 +1,8 @@
{
"parent": "botania:block/mana_spreader"
"parent": "botania:block/shapes/spreader_item",
"textures": {
"inside": "botania:blocks/mana_spreader_inside",
"side": "botania:blocks/mana_spreader_side",
"material": "botania:blocks/livingwood0"
}
}
@@ -1,3 +1,8 @@
{
"parent": "botania:block/redstone_spreader"
"parent": "botania:block/shapes/spreader_item",
"textures": {
"inside": "botania:blocks/redstone_spreader_inside",
"side": "botania:blocks/redstone_spreader_side",
"material": "botania:blocks/livingwood0"
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 328 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 635 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 327 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 659 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 307 B

After

Width:  |  Height:  |  Size: 307 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 569 B

After

Width:  |  Height:  |  Size: 569 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 484 B

File renamed without changes.

Before

Width:  |  Height:  |  Size: 536 B

After

Width:  |  Height:  |  Size: 536 B