mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 00:37:57 +00:00
Cleanup, cleanup~
This commit is contained in:
1 parent
dd49ff68f9
commit
b614bcbc7b
35 files changed
+109
-119
No files matched your search
@@ -272,7 +272,7 @@ public final class BotaniaAPI {
|
||||
public static void registerSubTileSignature(Class<? extends SubTileEntity> subtileClass, SubTileSignature signature) {
|
||||
subTileSignatures.put(subtileClass, signature);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the singleton signature for a SubTileEntity class. Registers a fallback if one wasn't registered
|
||||
* before the call.
|
||||
@@ -280,10 +280,10 @@ public final class BotaniaAPI {
|
||||
public static SubTileSignature getSignatureForClass(Class<? extends SubTileEntity> subtileClass) {
|
||||
if(!subTileSignatures.containsKey(subtileClass))
|
||||
registerSubTileSignature(subtileClass, new BasicSignature(subTiles.inverse().get(subtileClass)));
|
||||
|
||||
|
||||
return subTileSignatures.get(subtileClass);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the singleton signature for a SubTileEntity's name. Registers a fallback if one wasn't registered
|
||||
* before the call.
|
||||
@@ -292,7 +292,7 @@ public final class BotaniaAPI {
|
||||
Class<? extends SubTileEntity> subtileClass = subTiles.get(name);
|
||||
return getSignatureForClass(subtileClass);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds the key for a SubTileEntity into the creative menu. This goes into the
|
||||
* subtilesForCreativeMenu Set.
|
||||
|
||||
@@ -103,7 +103,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
public IIcon getSubTileIconForName(String name) {
|
||||
return Blocks.red_flower.getIcon(0, 0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerBasicSignatureIcons(String name, IIconRegister register) {
|
||||
// NO-OP
|
||||
@@ -118,7 +118,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) {
|
||||
// NO-OP
|
||||
@@ -138,7 +138,7 @@ public class DummyMethodHandler implements IInternalMethodHandler {
|
||||
public boolean shouldForceCheck() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPassiveFlowerDecay() {
|
||||
return 0;
|
||||
|
||||
@@ -67,11 +67,11 @@ public interface IInternalMethodHandler {
|
||||
public ItemStack getSubTileAsStack(String subTile);
|
||||
|
||||
public IIcon getSubTileIconForName(String name);
|
||||
|
||||
|
||||
public void registerBasicSignatureIcons(String name, IIconRegister register);
|
||||
|
||||
public boolean shouldForceCheck();
|
||||
|
||||
|
||||
public int getPassiveFlowerDecay();
|
||||
|
||||
public IInventory getBaublesInventory(EntityPlayer player);
|
||||
@@ -81,7 +81,7 @@ public interface IInternalMethodHandler {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText);
|
||||
|
||||
|
||||
public void sparkleFX(World world, double x, double y, double z, float r, float g, float b, float size, int m);
|
||||
|
||||
}
|
||||
@@ -100,7 +100,7 @@ public class SubTileEntity {
|
||||
public ChunkCoordinates getBinding() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @see IWandBindable#canSelect(EntityPlayer, ItemStack, int, int, int, int)
|
||||
*/
|
||||
|
||||
@@ -78,7 +78,7 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
if(!supertile.getWorldObj().isRemote) {
|
||||
++ticksExisted;
|
||||
int muhBalance = BotaniaAPI.internalHandler.getPassiveFlowerDecay();
|
||||
|
||||
|
||||
if(isPassiveFlower() && muhBalance > 0 && ticksExisted > muhBalance) {
|
||||
supertile.getWorldObj().playAuxSFX(2001, supertile.xCoord, supertile.yCoord, supertile.zCoord, Block.getIdFromBlock(supertile.getBlockType()));
|
||||
supertile.getWorldObj().setBlockToAir(supertile.xCoord, supertile.yCoord, supertile.zCoord);
|
||||
@@ -217,12 +217,12 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
public boolean canSelect(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
|
||||
int range = 6;
|
||||
range *= range;
|
||||
|
||||
|
||||
double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord);
|
||||
if(range >= dist) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(x, y, z);
|
||||
@@ -231,10 +231,10 @@ public class SubTileGenerating extends SubTileEntity {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderHUD(Minecraft mc, ScaledResolution res) {
|
||||
String name = StatCollector.translateToLocal("tile.botania:flower." + getUnlocalizedName() + ".name");
|
||||
|
||||
@@ -22,7 +22,7 @@ import vazkii.botania.api.BotaniaAPI;
|
||||
public class BasicSignature extends SubTileSignature {
|
||||
|
||||
final String name;
|
||||
|
||||
|
||||
public BasicSignature(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
@@ -41,18 +41,18 @@ public class BasicSignature extends SubTileSignature {
|
||||
public String getUnlocalizedNameForStack(ItemStack stack) {
|
||||
return unlocalizedName("");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedLoreTextForStack(ItemStack stack) {
|
||||
return unlocalizedName(".reference");
|
||||
}
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
private String unlocalizedName(String end) {
|
||||
return "tile." + SubTileSignature.SPECIAL_FLOWER_PREFIX + name + end;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -26,17 +26,17 @@ public abstract class SubTileSignature {
|
||||
* Equivalent to Block.registerBlockIcons.
|
||||
*/
|
||||
public abstract void registerIcons(IIconRegister register);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the icon to display for the flower item.
|
||||
*/
|
||||
public abstract IIcon getIconForStack(ItemStack stack);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the display name for the flower item.
|
||||
*/
|
||||
public abstract String getUnlocalizedNameForStack(ItemStack stack);
|
||||
|
||||
|
||||
/**
|
||||
* Gets the lore text for the flower item, displayed in the item's tooltip.
|
||||
* If you do not want a reference return a key that does not have localization such
|
||||
|
||||
@@ -13,7 +13,6 @@ package vazkii.botania.api.wand;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
||||
/**
|
||||
* A TileEntity that implements this can be bound to another block
|
||||
@@ -21,7 +20,7 @@ import net.minecraft.util.MovingObjectPosition;
|
||||
* the displayed bounding box.
|
||||
*/
|
||||
public interface IWandBindable extends ITileBound {
|
||||
|
||||
|
||||
/**
|
||||
* Return true if the Wand can select this tile.
|
||||
*/
|
||||
@@ -29,8 +28,8 @@ public interface IWandBindable extends ITileBound {
|
||||
|
||||
/**
|
||||
* Call to bind the TileEntity to where the player clicked. Return true to deselect
|
||||
* the TileEntity for another bind or false case the TileEntity should stay selected.
|
||||
* the TileEntity for another bind or false case the TileEntity should stay selected.
|
||||
*/
|
||||
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side);
|
||||
|
||||
|
||||
}
|
||||
@@ -11,13 +11,13 @@
|
||||
*/
|
||||
package vazkii.botania.api.wiki;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
public class SimpleWikiProvider implements IWikiProvider {
|
||||
|
||||
final String name, urlBase, replacement;
|
||||
|
||||
@@ -71,7 +71,7 @@ public final class HUDHandler {
|
||||
if(stack != null) {
|
||||
if(pos != null && stack.getItem() == ModItems.twigWand) {
|
||||
renderWandModeDisplay(event.resolution);
|
||||
|
||||
|
||||
if(block instanceof IWandHUD)
|
||||
((IWandHUD) block).renderHUD(mc, event.resolution, mc.theWorld, pos.blockX, pos.blockY, pos.blockZ);
|
||||
}
|
||||
@@ -122,19 +122,19 @@ public final class HUDHandler {
|
||||
renderManaInvBar(event.resolution, creative, totalMana, totalMaxMana);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void renderWandModeDisplay(ScaledResolution res) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
int ticks = ReflectionHelper.getPrivateValue(GuiIngame.class, mc.ingameGUI, LibObfuscation.REMAINING_HIGHLIGHT_TICKS);
|
||||
ticks -= 15;
|
||||
if(ticks > 0) {
|
||||
int alpha = Math.min(255, (int) ((float) ticks * 256.0F / 10.0F));
|
||||
int alpha = Math.min(255, (int) (ticks * 256.0F / 10.0F));
|
||||
int color = 0x00CC00 + (alpha << 24);
|
||||
String disp = StatCollector.translateToLocal(ItemTwigWand.getModeString(mc.thePlayer.getCurrentEquippedItem()));
|
||||
|
||||
|
||||
int x = res.getScaledWidth() / 2 - mc.fontRenderer.getStringWidth(disp) / 2;
|
||||
int y = res.getScaledHeight() - 70;
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
mc.fontRenderer.drawStringWithShadow(disp, x, y, color);
|
||||
@@ -184,17 +184,17 @@ public final class HUDHandler {
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
|
||||
mc.renderEngine.bindTexture(manaBar);
|
||||
RenderHelper.drawTexturedModalRect(x, y, 0, u, v, 22, 15);
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
|
||||
|
||||
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
|
||||
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, stack, x - 20, y);
|
||||
RenderItem.getInstance().renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x + 26, y);
|
||||
RenderItem.getInstance().renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, recipe.getOutput(), x + 26, y);
|
||||
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
|
||||
|
||||
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ public final class RenderHelper {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
|
||||
public static String getKeyDisplayString(String keyName) {
|
||||
String key = null;
|
||||
KeyBinding[] keys = Minecraft.getMinecraft().gameSettings.keyBindings;
|
||||
@@ -199,7 +199,7 @@ public final class RenderHelper {
|
||||
key = Keyboard.getKeyName(otherKey.getKeyCode());
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return key;
|
||||
}
|
||||
}
|
||||
@@ -23,17 +23,17 @@ public final class ParticleRenderDispatcher {
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
|
||||
boolean isLightingEnabled = GL11.glGetBoolean(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
GL11.glDepthMask(false);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
|
||||
if(isLightingEnabled)
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
FXSparkle.dispatchQueuedRenders(tessellator);
|
||||
FXWisp.dispatchQueuedRenders(tessellator);
|
||||
|
||||
|
||||
if(isLightingEnabled)
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
|
||||
@@ -253,7 +253,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
boolean closeScreenOnInvKey() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char par1, int par2) {
|
||||
if(closeScreenOnInvKey() && mc.gameSettings.keyBindInventory.getKeyCode() == par2) {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
GuiButton leftButton, rightButton, backButton;
|
||||
GuiLexicon parent;
|
||||
GuiTextField searchField;
|
||||
|
||||
|
||||
List<LexiconEntry> entriesToDisplay = new ArrayList();
|
||||
|
||||
public GuiLexiconIndex(LexiconCategory category) {
|
||||
@@ -66,21 +66,21 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
buttonList.add(backButton = new GuiButtonBack(12, left + guiWidth / 2 - 8, top + guiHeight + 2));
|
||||
buttonList.add(leftButton = new GuiButtonPage(13, left, top + guiHeight - 10, false));
|
||||
buttonList.add(rightButton = new GuiButtonPage(14, left + guiWidth - 18, top + guiHeight - 10, true));
|
||||
|
||||
|
||||
searchField = new GuiTextField(fontRendererObj, left + guiWidth / 2 + 28, top + guiHeight + 6, 200, 10);
|
||||
searchField.setCanLoseFocus(false);
|
||||
searchField.setFocused(true);
|
||||
searchField.setEnableBackgroundDrawing(false);
|
||||
|
||||
|
||||
updateAll();
|
||||
}
|
||||
|
||||
|
||||
void updateAll() {
|
||||
buildEntries();
|
||||
updatePageButtons();
|
||||
populateIndex();
|
||||
}
|
||||
|
||||
|
||||
void buildEntries() {
|
||||
entriesToDisplay.clear();
|
||||
ILexicon lex = (ILexicon) stackUsed.getItem();
|
||||
@@ -101,11 +101,11 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
else button.displayString = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drawScreen(int par1, int par2, float par3) {
|
||||
super.drawScreen(par1, par2, par3);
|
||||
|
||||
|
||||
if(!searchField.getText().isEmpty()) {
|
||||
drawBookmark(left + 138, top + guiHeight - 24, " " + searchField.getText(), false);
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
@@ -141,7 +141,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
openEntry(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void openEntry(int index) {
|
||||
if(index >= entriesToDisplay.size())
|
||||
return;
|
||||
@@ -201,7 +201,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
else if(w > 0)
|
||||
prevPage();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
boolean closeScreenOnInvKey() {
|
||||
return false;
|
||||
@@ -220,12 +220,12 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
ClientTickHandler.notifyPageChange();
|
||||
} else if(par2 == 28 && entriesToDisplay.size() == 1) // Enter
|
||||
openEntry(0);
|
||||
|
||||
|
||||
String search = searchField.getText();
|
||||
searchField.textboxKeyTyped(par1, par2);
|
||||
if(!searchField.getText().equalsIgnoreCase(search))
|
||||
updateAll();
|
||||
|
||||
|
||||
super.keyTyped(par1, par2);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.ISpecialFlower;
|
||||
import vazkii.botania.api.wand.IWandHUD;
|
||||
import vazkii.botania.api.wand.IWandable;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.BotaniaCreativeTab;
|
||||
|
||||
@@ -52,7 +52,7 @@ public class SubTileAgricarnation extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
|
||||
@@ -74,7 +74,7 @@ public class SubTileExoflame extends SubTileFunctional {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(did)
|
||||
sync();
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SubTileHydroangeas extends SubTileGenerating {
|
||||
public Block getBlockToSearchBelow() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void playSound() {
|
||||
supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.drink", 0.2F, 0.5F + (float) Math.random() * 0.5F);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class SubTileThermalily extends SubTileHydroangeas {
|
||||
public Block getBlockToSearchBelow() {
|
||||
return ConfigHandler.thermalilyObsidian ? Blocks.obsidian : null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void playSound() {
|
||||
supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "botania:thermalily", 0.2F, 1F);
|
||||
|
||||
@@ -23,7 +23,6 @@ import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.ISubTileContainer;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.api.wand.ITileBound;
|
||||
import vazkii.botania.api.wand.IWandBindable;
|
||||
|
||||
public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTileContainer {
|
||||
@@ -134,6 +133,6 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
|
||||
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
|
||||
if(subTile == null)
|
||||
return false;
|
||||
return subTile.bindTo(player, wand, x, y, z, side);
|
||||
return subTile.bindTo(player, wand, x, y, z, side);
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
}
|
||||
|
||||
public boolean collideEntityItem(EntityItem item) {
|
||||
if(item.isDead || (item.age > 100 && item.age < 130) || !catalystsRegistered)
|
||||
if(item.isDead || item.age > 100 && item.age < 130 || !catalystsRegistered)
|
||||
return false;
|
||||
|
||||
boolean didChange = false;
|
||||
@@ -193,7 +193,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
alchemy = worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.alchemyCatalyst;
|
||||
conjuration = worldObj.getBlock(xCoord, yCoord - 1, zCoord) == ModBlocks.conjurationCatalyst;
|
||||
catalystsRegistered = true;
|
||||
|
||||
|
||||
List<EntityItem> items = worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord, zCoord, xCoord + 1, yCoord + 1, zCoord + 1));
|
||||
for(EntityItem item : items) {
|
||||
if(item.isDead)
|
||||
@@ -211,7 +211,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
didSomething = true;
|
||||
|
||||
int manaVal = Math.min(1000, Math.min(getCurrentMana(), mana.getMaxMana(stack) - mana.getMana(stack)));
|
||||
if(!worldObj.isRemote)
|
||||
if(!worldObj.isRemote)
|
||||
mana.addMana(stack, manaVal);
|
||||
recieveMana(-manaVal);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
|
||||
didSomething = true;
|
||||
|
||||
int manaVal = Math.min(1000, Math.min(manaCap - getCurrentMana(), mana.getMana(stack)));
|
||||
if(!worldObj.isRemote)
|
||||
if(!worldObj.isRemote)
|
||||
mana.addMana(stack, -manaVal);
|
||||
recieveMana(manaVal);
|
||||
}
|
||||
|
||||
@@ -43,13 +43,13 @@ public class CommandOpen extends CommandBase {
|
||||
} else sender.addChatMessage(new ChatComponentTranslation("botaniamisc.noLexicon").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getRequiredPermissionLevel() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) {
|
||||
return p_71519_1_ instanceof EntityPlayer;
|
||||
|
||||
@@ -41,12 +41,12 @@ public class CommandShare extends CommandBase {
|
||||
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(component);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getRequiredPermissionLevel() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) {
|
||||
return p_71519_1_ instanceof EntityPlayer;
|
||||
|
||||
@@ -110,7 +110,7 @@ public final class ConfigHandler {
|
||||
|
||||
desc = "Set to true to disable the mana spreader shooting sound.";
|
||||
silentSpreaders = loadPropBool("manaSpreaders.silent", desc, silentSpreaders);
|
||||
|
||||
|
||||
desc = "Set to true to use alternate flower textures by Futureazoo, not all flowers are textured. http://redd.it/2b3o3f";
|
||||
altFlowerTextures = loadPropBool("flowerTextures.alt", desc, altFlowerTextures);
|
||||
|
||||
|
||||
@@ -77,9 +77,9 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
IIcon normal = IconHelper.forName(register, name);
|
||||
IIcon alt = IconHelper.forName(register, BlockModFlower.ALT_DIR + "/" + name);
|
||||
BlockSpecialFlower.icons.put(name, normal);
|
||||
BlockSpecialFlower.iconsAlt.put(name, alt == null ? normal : alt);
|
||||
BlockSpecialFlower.iconsAlt.put(name, alt == null ? normal : alt);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public LexiconPage petalRecipesPage(String key, List<RecipePetals> recipes) {
|
||||
return new PagePetalRecipe(key, recipes);
|
||||
@@ -139,7 +139,7 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
public void drawSimpleManaHUD(int color, int mana, int maxMana, String name, ScaledResolution res) {
|
||||
HUDHandler.drawSimpleManaHUD(color, mana, maxMana, name, res);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void renderLexiconText(int x, int y, int width, int height, String unlocalizedText) {
|
||||
PageText.renderText(x, y, width, height, unlocalizedText);
|
||||
@@ -154,7 +154,7 @@ public class InternalMethodHandler extends DummyMethodHandler {
|
||||
public boolean shouldForceCheck() {
|
||||
return ConfigHandler.flowerForceCheck;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPassiveFlowerDecay() {
|
||||
return ConfigHandler.hardcorePassiveGeneration;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class CommonProxy {
|
||||
MinecraftForge.EVENT_BUS.register(new SpawnerChangingHandler());
|
||||
|
||||
FMLCommonHandler.instance().bus().register(new CommonTickHandler());
|
||||
|
||||
|
||||
FMLInterModComms.sendMessage("ProjectE", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.mana.ILens;
|
||||
import vazkii.botania.common.item.ItemManaGun;
|
||||
|
||||
public class ManaGunRemoveLensRecipe implements IRecipe {
|
||||
|
||||
@@ -20,7 +20,6 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
@@ -108,19 +107,19 @@ public class ItemManaGun extends ItemMod implements IManaUsingItem {
|
||||
}
|
||||
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
// ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN ASADA-SAN
|
||||
private boolean isSugoiKawaiiDesuNe(ItemStack stack) {
|
||||
return stack.getDisplayName().equalsIgnoreCase("desu gun");
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte
|
||||
world = w;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(world != null) {
|
||||
TileEntity tile = world.getTileEntity(coords.posX, coords.posY, coords.posZ);
|
||||
if(tile != null && tile instanceof IManaPool)
|
||||
|
||||
@@ -26,14 +26,12 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.wand.ICoordBoundItem;
|
||||
import vazkii.botania.api.wand.ITileBound;
|
||||
import vazkii.botania.api.wand.IWandBindable;
|
||||
@@ -43,11 +41,9 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.BlockPistonRelay;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileEnchanter;
|
||||
import vazkii.botania.common.block.tile.mana.TileSpreader;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.Vector3;
|
||||
import vazkii.botania.common.item.equipment.tool.ToolCommons;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
|
||||
public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
@@ -83,22 +79,22 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
int iters = (int) (diff.mag() / movement.mag());
|
||||
float huePer = 1F / iters;
|
||||
float hueSum = (float) Math.random();
|
||||
|
||||
|
||||
Vector3 currentPos = orig.copy();
|
||||
for(int i = 0; i < iters; i++) {
|
||||
float hue = i * huePer + hueSum;
|
||||
Color color = Color.getHSBColor(hue, 1F, 1F);
|
||||
float r = (float) color.getRed() / 255F;
|
||||
float g = (float) color.getGreen() / 255F;
|
||||
float b = (float) color.getBlue() / 255F;
|
||||
|
||||
float r = color.getRed() / 255F;
|
||||
float g = color.getGreen() / 255F;
|
||||
float b = color.getBlue() / 255F;
|
||||
|
||||
Botania.proxy.setSparkleFXNoClip(true);
|
||||
Botania.proxy.sparkleFX(par3World, currentPos.x, currentPos.y, currentPos.z, r, g, b, 0.5F, 4);
|
||||
Botania.proxy.setSparkleFXNoClip(false);
|
||||
currentPos.add(movement);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
par3World.markBlockForUpdate(boundTile.posX, boundTile.posY, boundTile.posZ);
|
||||
setBoundTile(par1ItemStack, 0, -1, 0);
|
||||
}
|
||||
@@ -179,7 +175,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
if(tile == null || !(tile instanceof IWandBindable))
|
||||
setBoundTile(par1ItemStack, 0, -1, 0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(!world.isRemote && player.isSneaking()) {
|
||||
@@ -239,7 +235,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return getUnlocalizedNameLazy(par1ItemStack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer p, List list, boolean adv) {
|
||||
list.add(StatCollector.translateToLocal(getModeString(stack)));
|
||||
@@ -286,7 +282,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
|
||||
public static void setBindMode(ItemStack stack, boolean bindMode) {
|
||||
ItemNBTHelper.setBoolean(stack, TAG_BIND_MODE, bindMode);
|
||||
}
|
||||
|
||||
|
||||
public static String getModeString(ItemStack stack) {
|
||||
return "botaniamisc.wandMode." + (getBindMode(stack) ? "bind" : "function");
|
||||
}
|
||||
|
||||
@@ -70,13 +70,13 @@ public class ItemVirus extends ItemMod {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingHurt(LivingHurtEvent event) {
|
||||
EntityLivingBase entity = event.entityLiving;
|
||||
if(entity.ridingEntity != null && entity.ridingEntity instanceof EntityLivingBase)
|
||||
entity = (EntityLivingBase) entity.ridingEntity;
|
||||
|
||||
|
||||
if(entity instanceof EntityHorse && event.source == DamageSource.fall) {
|
||||
EntityHorse horse = (EntityHorse) entity;
|
||||
if((horse.getHorseType() == 3 || horse.getHorseType() == 4) && horse.isTame())
|
||||
|
||||
@@ -30,7 +30,6 @@ import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.TileSpecialFlower;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
|
||||
public class ItemBlockSpecialFlower extends ItemBlockMod implements IRecipeKeyProvider {
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ItemItemFinder extends ItemBauble {
|
||||
|
||||
String pos = ItemNBTHelper.getString(stack, TAG_POSITIONS, "");
|
||||
String[] tokens = pos.split(";");
|
||||
|
||||
|
||||
for(String token : tokens) {
|
||||
if(token.isEmpty())
|
||||
continue;
|
||||
|
||||
@@ -13,9 +13,6 @@ package vazkii.botania.common.item.equipment.bauble;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
@@ -33,31 +30,34 @@ import vazkii.botania.common.lib.LibItemNames;
|
||||
import baubles.api.BaubleType;
|
||||
import baubles.common.container.InventoryBaubles;
|
||||
import baubles.common.lib.PlayerHandler;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemMagnetRing extends ItemBauble {
|
||||
|
||||
IIcon iconOff;
|
||||
|
||||
|
||||
private static final String TAG_COOLDOWN = "cooldown";
|
||||
|
||||
|
||||
public ItemMagnetRing() {
|
||||
super(LibItemNames.MAGNET_RING);
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister par1IconRegister) {
|
||||
itemIcon = IconHelper.forItem(par1IconRegister, this, 0);
|
||||
iconOff = IconHelper.forItem(par1IconRegister, this, 1);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconIndex(ItemStack stack) {
|
||||
return getCooldown(stack) <= 0 ? itemIcon : iconOff;
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTossItem(ItemTossEvent event) {
|
||||
InventoryBaubles inv = PlayerHandler.getPlayerBaubles(event.player);
|
||||
@@ -73,7 +73,7 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
super.onWornTick(stack, player);
|
||||
|
||||
int cooldown = getCooldown(stack);
|
||||
|
||||
|
||||
if(cooldown <= 0) {
|
||||
if(!player.isSneaking()) {
|
||||
int range = 6;
|
||||
@@ -96,11 +96,11 @@ public class ItemMagnetRing extends ItemBauble {
|
||||
public static int getCooldown(ItemStack stack) {
|
||||
return ItemNBTHelper.getInt(stack, TAG_COOLDOWN, 0);
|
||||
}
|
||||
|
||||
|
||||
public static void setCooldown(ItemStack stack, int cooldown) {
|
||||
ItemNBTHelper.setInt(stack, TAG_COOLDOWN, cooldown);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public BaubleType getBaubleType(ItemStack arg0) {
|
||||
return BaubleType.RING;
|
||||
|
||||
@@ -104,16 +104,16 @@ public class PageManaInfusionRecipe extends PageRecipe {
|
||||
String dropString = StatCollector.translateToLocal("botaniamisc.drop") + " " + EnumChatFormatting.BOLD + "(?)";
|
||||
|
||||
boolean hoveringOverDrop = false;
|
||||
|
||||
|
||||
boolean unicode = font.getUnicodeFlag();
|
||||
font.setUnicodeFlag(true);
|
||||
int dw = font.getStringWidth(dropString);
|
||||
int dx = x + 35 - dw / 2;
|
||||
int dy = gui.getTop() + 30;
|
||||
|
||||
|
||||
if(mx > dx && mx <= dx + dw && my > dy && my <= dy + 10)
|
||||
hoveringOverDrop = true;
|
||||
|
||||
|
||||
font.drawString(dropString, dx, dy, 0x77000000);
|
||||
font.drawString(ratioString, x + 100 - font.getStringWidth(ratioString), y + 5, 0x99000000);
|
||||
font.setUnicodeFlag(unicode);
|
||||
@@ -127,7 +127,7 @@ public class PageManaInfusionRecipe extends PageRecipe {
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
((GuiScreen) gui).drawTexturedModalRect(gui.getLeft(), gui.getTop(), 0, 0, gui.getWidth(), gui.getHeight());
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
|
||||
|
||||
if(hoveringOverDrop) {
|
||||
String key = RenderHelper.getKeyDisplayString("key.drop");
|
||||
String tip0 = StatCollector.translateToLocal("botaniamisc.dropTip0").replaceAll("%key%", EnumChatFormatting.GREEN + key + EnumChatFormatting.WHITE);
|
||||
|
||||
Reference in new issue
Block a user