Drums, runic altar, mana pool kinda, distributor, force relay, starfield

This commit is contained in:
Vincent Lee committed 2015-12-23 20:26:33 -06:00
1 parent eabb0f94e3
commit 64a8dfbcfe
23 files changed
+242 -7

No files matched your search

@@ -54,6 +54,7 @@ public final class ModelHandler {
registerPanes();
registerPylons();
registerUnstableBeaconPetal();
registerDrums();
/** Normal Items **/
registerStandardItems();
@@ -65,7 +66,10 @@ public final class ModelHandler {
private static void registerStandardBlocks() {
registerItemModel(ModBlocks.manaGlass);
registerItemModel(ModBlocks.elfGlass);
registerItemModel(ModBlocks.runeAltar);
registerItemModel(ModBlocks.pistonRelay);
registerItemModel(ModBlocks.distributor);
registerItemModel(ModBlocks.starfield);
}
private static void registerStandardItems() {
@@ -122,6 +126,9 @@ public final class ModelHandler {
}
private static void registerStateMappers() {
// Ignore redstone power state in some blocks
ModelLoader.setCustomStateMapper(ModBlocks.starfield, (new StateMap.Builder()).ignore(BotaniaStateProps.POWERED).build());
// Ignore color in unstable cube, mana beacon, and petals (handled by color multiplier)
ModelLoader.setCustomStateMapper(ModBlocks.unstableBlock, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
ModelLoader.setCustomStateMapper(ModBlocks.manaBeacon, (new StateMap.Builder()).ignore(BotaniaStateProps.COLOR).build());
@@ -326,6 +333,15 @@ public final class ModelHandler {
}
}
private static void registerDrums() {
Item item = Item.getItemFromBlock(ModBlocks.forestDrum);
for (LivingRockVariant variant : LivingRockVariant.values()) {
String name = "botania:drum_" + variant.getName();
ModelLoader.addVariantName(item, name);
ModelLoader.setCustomModelResourceLocation(item, variant.ordinal(), new ModelResourceLocation(name, "inventory"));
}
}
private static void registerItemModel(Block b) {
registerItemModel(Item.getItemFromBlock(b));
}
@@ -73,7 +73,7 @@ public class RenderTilePool extends TileEntitySpecialRenderer {
time += new Random(tileentity.getPos().hashCode()).nextInt(100000);
Color color = Color.getHSBColor(time * 0.005F, 0.6F, 1F);
GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255);
GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255);
} else {
int hex = pool.color.getMapColor().colorValue;
int r = (hex & 0xFF0000) >> 16;
@@ -44,7 +44,7 @@ public class RenderTileStarfield extends TileEntitySpecialRenderer {
float f2 = (float)this.rendererDispatcher.entityZ;
GlStateManager.disableLighting();
field_147527_e.setSeed(31100L);
float f3 = 0.75F;
float f3 = 0.24F;
for (int i = 0; i < 16; ++i)
{
@@ -97,7 +97,7 @@ public class RenderTileStarfield extends TileEntitySpecialRenderer {
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.loadIdentity();
GlStateManager.translate(0.0F, (float)(Minecraft.getSystemTime() % 700000L) / 700000.0F, 0.0F);
GlStateManager.translate(0.0F, (float)(Minecraft.getSystemTime() % 20000) / 20000.0F, 0.0F);
GlStateManager.scale(f5, f5, f5);
GlStateManager.translate(0.5F, 0.5F, 0.0F);
GlStateManager.rotate((float)(i * i * 4321 + i * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
@@ -117,6 +117,13 @@ public class RenderTileStarfield extends TileEntitySpecialRenderer {
f11 = f12 = f13 = 1.0F * f6;
}
Color color = Color.getHSBColor(Minecraft.getSystemTime() / 20F % 360 / 360F, 1F, 1F);
f11 = color.getRed() / 255F;
f12 = color.getGreen() / 255F;
f13 = color.getBlue() / 255F;
f11 *= f6; f12 *= f6; f13 *= f6;
worldrenderer.pos(x, y + (double)f3, z).color(f11, f12, f13, 1.0F).endVertex();
worldrenderer.pos(x, y + (double)f3, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex();
worldrenderer.pos(x + 1.0D, y + (double)f3, z + 1.0D).color(f11, f12, f13, 1.0F).endVertex();
@@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumWorldBlockLayer;
import net.minecraft.world.World;
import vazkii.botania.api.lexicon.ILexiconable;
import vazkii.botania.api.lexicon.LexiconEntry;
@@ -39,6 +40,16 @@ public class BlockStarfield extends BlockModContainer implements ILexiconable {
setBlockBounds(0F, 0F, 0F, 1F, 0.25F, 1F);
}
@Override
public int getRenderType() {
return 3;
}
@Override
public EnumWorldBlockLayer getBlockLayer() {
return EnumWorldBlockLayer.CUTOUT_MIPPED;
}
@Override
public BlockState createBlockState() {
return new BlockState(this, BotaniaStateProps.POWERED);
@@ -35,6 +35,11 @@ public class BlockDistributor extends BlockModContainer implements ILexiconable
setUnlocalizedName(LibBlockNames.DISTRIBUTOR);
}
@Override
public int getRenderType() {
return 3;
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileDistributor();
@@ -192,7 +192,7 @@ public class BlockPool extends BlockModContainer implements IWandHUD, IWandable,
@Override
public int getRenderType() {
return LibRenderIDs.idPool;
return 2;
}
@Override
@@ -52,6 +52,11 @@ public class BlockRuneAltar extends BlockModContainer implements IWandable, ILex
random = new Random();
}
@Override
public int getRenderType() {
return 3;
}
@Override
public boolean isOpaqueCube() {
return false;
@@ -51,7 +51,6 @@ public class ItemDye extends Item16Colors {
TileEntity tile = par3World.getTileEntity(pos);
if(tile instanceof IDyablePool) {
IDyablePool dyable = (IDyablePool) tile;
int itemMeta = par1ItemStack.getItemDamage();
if(color != dyable.getColor()) {
dyable.setColor(color);
par1ItemStack.stackSize--;
@@ -138,7 +138,7 @@ public class PageCraftingRecipe extends PageRecipe {
for(int x = 0; x < width; x++) {
Object input = shaped.getInput()[y * width + x];
if(input != null)
renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((ArrayList<ItemStack>) input).get(0), true);
renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((List<ItemStack>) input).get(0), true);
}
oreDictRecipe = true;
@@ -0,0 +1,17 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_bottom_top",
"textures": {
"top": "botania:blocks/distributor0",
"side": "botania:blocks/distributor1",
"bottom": "botania:blocks/livingrock0"
}
},
"variants": {
"normal": [{}],
"inventory": [{
"transform": "forge:default-block"
}]
}
}
@@ -0,0 +1,7 @@
{
"variants": {
"variant=wild": { "model": "botania:drum_wild" },
"variant=gathering": { "model": "botania:drum_gathering" },
"variant=canopy": { "model": "botania:drum_canopy" }
}
}
@@ -0,0 +1,15 @@
{
"forge_marker": 1,
"defaults": {
"model": "minecraft:cube_all",
"textures": {
"all": "botania:blocks/pistonRelay"
}
},
"variants": {
"normal": [{}],
"inventory": [{
"transform": "forge:default-block"
}]
}
}
@@ -0,0 +1,17 @@
{
"forge_marker": 1,
"defaults": {
"model": "botania:biggerthanslab",
"textures": {
"top": "botania:blocks/runeAltar1",
"side": "botania:blocks/runeAltar2",
"bottom": "botania:blocks/runeAltar0"
}
},
"variants": {
"normal": [{}],
"inventory": [{
"transform": "forge:default-block"
}]
}
}
@@ -0,0 +1,29 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block"
},
"variants": {
"normal": [{
"model": "botania:thinnerthanslab",
"textures": {
"bottom": "botania:blocks/starfield0",
"top": "botania:blocks/starfield1",
"side": "botania:blocks/starfield2"
}
}],
"inventory": [{
"model": "botania:thinnerthanslab",
"textures": {
"bottom": "botania:blocks/starfield0",
"top": "botania:blocks/starfield0",
"side": "botania:blocks/starfield2"
},
"transform": {
"firstperson": {
"translation": [ 0, 0.125, 0 ]
}
}
}]
}
}
@@ -0,0 +1,19 @@
{
"textures": {
"particle": "#side"
},
"elements": [
{
"from": [ 0, 0, 0 ],
"to": [ 16, 12, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
"north": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "north" },
"south": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "south" },
"west": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "west" },
"east": { "uv": [ 0, 4, 16, 16 ], "texture": "#side", "cullface": "east" }
}
}
]
}
@@ -0,0 +1,18 @@
{
"textures": {
"particle": "#side"
},
"elements": [{
"name": "Drum",
"from": [ 3.0, 0.0, 3.0 ],
"to": [ 13.0, 14.0, 13.0 ],
"faces": {
"north": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] },
"south": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] },
"west": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] },
"east": { "texture": "#side", "uv": [ 3, 2, 13, 16 ] },
"up": { "texture": "#top", "uv": [ 3, 3, 12, 12 ] },
"down": { "texture": "#top", "uv": [ 3, 3, 12, 12 ], "cullface": "down" }
}
}]
}
@@ -0,0 +1,7 @@
{
"parent": "botania:block/drum",
"textures": {
"top": "botania:blocks/forestDrum4",
"side": "botania:blocks/forestDrum5"
}
}
@@ -0,0 +1,7 @@
{
"parent": "botania:block/drum",
"textures": {
"top": "botania:blocks/forestDrum2",
"side": "botania:blocks/forestDrum3"
}
}
@@ -0,0 +1,7 @@
{
"parent": "botania:block/drum",
"textures": {
"top": "botania:blocks/forestDrum0",
"side": "botania:blocks/forestDrum1"
}
}
@@ -0,0 +1,19 @@
{
"textures": {
"particle": "#side"
},
"elements": [
{
"from": [ 0, 0, 0 ],
"to": [ 16, 4, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
"north": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "north" },
"south": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "south" },
"west": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "west" },
"east": { "uv": [ 0, 12, 16, 16 ], "texture": "#side", "cullface": "east" }
}
}
]
}
@@ -0,0 +1,10 @@
{
"parent": "botania:block/drum_canopy",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
@@ -0,0 +1,10 @@
{
"parent": "botania:block/drum_gathering",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
@@ -0,0 +1,10 @@
{
"parent": "botania:block/drum_wild",
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}