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;