Partially restore corporea crystal cube model

This commit is contained in:
Vincent Lee committed 2019-09-27 22:37:45 -05:00
1 parent bf79be5210
commit 90977798d4
8 files changed
+58 -51

No files matched your search

@@ -21,6 +21,7 @@ import vazkii.botania.client.model.FloatingFlowerModel;
import vazkii.botania.client.model.GunModel;
import vazkii.botania.client.model.LexiconModel;
import vazkii.botania.client.model.PlatformModel;
import vazkii.botania.client.render.tile.RenderTileCorporeaCrystalCube;
import vazkii.botania.common.Botania;
import vazkii.botania.common.item.equipment.bauble.ItemFlightTiara;
import vazkii.botania.common.item.relic.ItemKingKey;
@@ -113,6 +114,8 @@ public class MiscellaneousIcons {
ModelResourceLocation clipKey = new ModelResourceLocation("botania:mana_gun_clip", "inventory");
IBakedModel originalModelClip = evt.getModelRegistry().get(clipKey);
evt.getModelRegistry().put(key, new GunModel(evt.getModelLoader(), originalModel, originalModelClip));
RenderTileCorporeaCrystalCube.cubeModel = evt.getModelRegistry().get(new ResourceLocation(LibMisc.MOD_ID, "block/corporea_crystal_cube_glass"));
}
@SubscribeEvent
@@ -13,6 +13,7 @@ import net.minecraft.client.renderer.entity.SpriteRenderer;
import net.minecraft.client.renderer.entity.SpriteRenderer;
import net.minecraft.client.renderer.model.ModelResourceLocation;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.animation.TileEntityRendererAnimation;
@@ -64,6 +65,7 @@ public final class ModelHandler {
ModelLoader.addSpecialModel(new ModelResourceLocation(LibMisc.MOD_ID + ":mana_gun_clip", "inventory"));
ModelLoader.addSpecialModel(new ModelResourceLocation(LibMisc.MOD_ID + ":desu_gun", "inventory"));
ModelLoader.addSpecialModel(new ModelResourceLocation(LibMisc.MOD_ID + ":desu_gun_clip", "inventory"));
ModelLoader.addSpecialModel(new ResourceLocation(LibMisc.MOD_ID, "block/corporea_crystal_cube_glass"));
registerSubtiles();
RenderTileFloatingFlower renderTileFloatingFlower = new RenderTileFloatingFlower();
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.tileentity.ItemStackTileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
@@ -49,6 +50,8 @@ import javax.annotation.Nullable;
// TODO 1.13 move this back to a normal tesr. Byebye animation API
public class RenderTileCorporeaCrystalCube extends TileEntityRenderer<TileCorporeaCrystalCube> {
// Ugly but there's no other way to get the model besides grabbing it from the event
public static IBakedModel cubeModel = null;
private ItemEntity entity = null;
private ItemRenderer itemRenderer = null;
@@ -95,6 +98,11 @@ public class RenderTileCorporeaCrystalCube extends TileEntityRenderer<TileCorpor
GlStateManager.popMatrix();
}
if (cubeModel != null) {
GlStateManager.color4f(1, 1, 1, 0.4F);
Minecraft.getInstance().getBlockRendererDispatcher().getBlockModelRenderer().renderModelBrightnessColor(cubeModel, 1, 1, 1, 1);
}
GlStateManager.color3f(1F, 1F, 1F);
if(!stack.isEmpty()) {
@@ -51,18 +51,8 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
private int compValue = 0;
public boolean locked = false;
private final IAnimationStateMachine asm;
private final LazyOptional<IAnimationStateMachine> asmCap;
public TileCorporeaCrystalCube() {
super(TYPE);
if (FMLEnvironment.dist == Dist.CLIENT) {
asm = ModelLoaderRegistry.loadASM(new ResourceLocation("botania", "asms/block/corporeacrystalcube.json"), ImmutableMap.of());
asmCap = LazyOptional.of(() -> asm);
} else {
asm = null;
asmCap = LazyOptional.empty();
}
}
@Override
@@ -174,13 +164,4 @@ public class TileCorporeaCrystalCube extends TileCorporeaBase implements ICorpor
onUpdateCount();
}
}
@Override
@Nonnull
public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, Direction side) {
if(cap == CapabilityAnimation.ANIMATION_CAPABILITY) {
return asmCap.cast();
} else return super.getCapability(cap, side);
}
}
@@ -1,33 +1,5 @@
{
"forge_marker": 1,
"defaults": {
"textures": {
"cloth": "botania:blocks/corporea_crystal_cube_cloth",
"base": "botania:blocks/corporea_crystal_cube_base",
"glass": "botania:blocks/corporea_crystal_cube_glass",
"particle": "botania:blocks/corporea_crystal_cube_base"
}
},
"variants": {
"static": {
"true": {
"model": "botania:block/corporea_crystal_cube_base"
},
"false": {
"model": "botania:block/corporea_crystal_cube_glass"
}
},
"inventory": [{
"model": "botania:block/corporea_crystal_cube_base",
"transform": "forge:default-block",
"submodel": {
"cube": {
"model": "botania:block/corporea_crystal_cube_glass",
"transform": {
"translation": [ 0, 0.5, 0 ]
}
}
}
}]
}
"variants": {
"": { "model": "botania:block/corporea_crystal_cube_base" }
}
}
@@ -1,5 +1,10 @@
{
"comment": "Designed by Wiiv with Cubik Studio - https://cubik.studio",
"textures": {
"cloth": "botania:blocks/corporea_crystal_cube_cloth",
"base": "botania:blocks/corporea_crystal_cube_base",
"particle": "botania:blocks/corporea_crystal_cube_base"
},
"elements": [
{
"__comment": "base",
@@ -1,6 +1,7 @@
{
"textures": {
"particle": "#glass"
"glass": "botania:blocks/corporea_crystal_cube_glass",
"particle": "botania:blocks/corporea_crystal_cube_glass"
},
"elements": [
{
@@ -0,0 +1,35 @@
{
"parent": "builtin/entity",
"display": {
"gui": {
"rotation": [ 30, 225, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"fixed": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 45, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 45, 0 ],
"translation": [ 0, 0, 0 ],
"scale": [ 0.40, 0.40, 0.40 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 225, 0 ],
"translation": [ 0, 0, 0 ],
"scale": [ 0.40, 0.40, 0.40 ]
}
}
}