mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 11:49:37 +00:00
Added the Spectrolus.
This commit is contained in:
1 parent
b6d4513fdc
commit
ab580ef5fa
6 files changed
+113
-1
No files matched your search
@@ -71,6 +71,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
LibBlockNames.SUBTILE_KEKIMURUS,
|
||||
LibBlockNames.SUBTILE_GOURMARYLLIS,
|
||||
LibBlockNames.SUBTILE_NARSLIMMUS,
|
||||
LibBlockNames.SUBTILE_SPECTROLUS,
|
||||
|
||||
// Functional
|
||||
LibBlockNames.SUBTILE_JADED_AMARANTHUS,
|
||||
|
||||
@@ -92,6 +92,7 @@ import vazkii.botania.common.block.subtile.generating.SubTileKekimurus;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileMunchdew;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileNarslimmus;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileNightshade;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileSpectrolus;
|
||||
import vazkii.botania.common.block.subtile.generating.SubTileThermalily;
|
||||
import vazkii.botania.common.block.tile.TileAlfPortal;
|
||||
import vazkii.botania.common.block.tile.TileAltar;
|
||||
@@ -330,6 +331,7 @@ public final class ModBlocks {
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_KEKIMURUS, SubTileKekimurus.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_GOURMARYLLIS, SubTileGourmaryllis.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_NARSLIMMUS, SubTileNarslimmus.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_SPECTROLUS, SubTileSpectrolus.class);
|
||||
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_BELLETHORN, SubTileBellethorn.class);
|
||||
BotaniaAPI.registerSubTile(LibBlockNames.SUBTILE_DREADTHORN, SubTileDreadthorn.class);
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Jan 30, 2015, 1:37:26 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.block.subtile.generating;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import vazkii.botania.api.subtile.SubTileGenerating;
|
||||
|
||||
public class SubTileSpectrolus extends SubTileGenerating {
|
||||
|
||||
private static final String TAG_NEXT_COLOR = "nextColor";
|
||||
|
||||
int nextColor;
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
int range = 1;
|
||||
Item wool = Item.getItemFromBlock(Blocks.wool);
|
||||
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + range + 1, supertile.zCoord + range + 1));
|
||||
for(EntityItem item : items) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack != null && stack.getItem() == wool) {
|
||||
int meta = stack.getItemDamage();
|
||||
if(meta == nextColor) {
|
||||
mana = Math.min(getMaxMana(), mana + 100);
|
||||
nextColor = nextColor == 15 ? 0 : nextColor + 1;
|
||||
|
||||
sync();
|
||||
}
|
||||
item.setDead();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 2000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return Color.HSBtoRGB((float) ticksExisted / 100F, 1F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
super.renderHUD(mc, res);
|
||||
|
||||
ItemStack stack = new ItemStack(Blocks.wool, 1, nextColor);
|
||||
int color = getColor();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
if(stack != null && stack.getItem() != null) {
|
||||
String stackName = stack.getDisplayName();
|
||||
int width = 16 + mc.fontRenderer.getStringWidth(stackName) / 2;
|
||||
int x = res.getScaledWidth() / 2 - width;
|
||||
int y = res.getScaledHeight() / 2 + 30;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(stackName, x + 20, y + 5, color);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x, y);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToPacketNBT(NBTTagCompound cmp) {
|
||||
super.writeToPacketNBT(cmp);
|
||||
cmp.setInteger(TAG_NEXT_COLOR, nextColor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromPacketNBT(NBTTagCompound cmp) {
|
||||
super.readFromPacketNBT(cmp);
|
||||
nextColor = cmp.getInteger(TAG_NEXT_COLOR);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -686,6 +686,8 @@ tile.botania:flower.gourmaryllis.name=Gourmaryllis
|
||||
tile.botania:flower.gourmaryllis.reference=Fuyukai Desu
|
||||
tile.botania:flower.narslimmus.name=Narslimmus
|
||||
tile.botania:flower.narslimmus.reference=What's this? It's all sticky
|
||||
tile.botania:flower.spectrolus.name=Spectrolus
|
||||
tile.botania:flower.spectrolus.reference=Profiting off Hate
|
||||
|
||||
# - FUNCTIONAL
|
||||
tile.botania:flower.bellethorn.name=Bellethorne
|
||||
@@ -2168,4 +2170,3 @@ botania.page.tcIntegration6b=The official frowny face
|
||||
# -- BUILDCRAFT INTEGRATION
|
||||
botania.entry.bcIntegration=Buildcraft Integration
|
||||
botania.page.bcIntegration0=Recent advances in piping technology have allowed &1Gates&0 to get a feel of the &4Mana&0 around them. A &1Gate&0 can now sense whether a &4Mana&0 container is empty, full or if it contains any mana.<br>&1Gates&0 can also use the &1Mana Detector&0 trigger to detect if a mana is passing by the pipe block. In addition, they can also sense when a &1Runic Altar&0 is ready to create runes.
|
||||
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Reference in new issue
Block a user