mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Merge release build 246
This commit is contained in:
commit
71607ae3bd
50 files changed
+510
-102
No files matched your search
@@ -1,4 +1,4 @@
|
||||
@API(owner = "Botania", apiVersion = "74", provides = "BotaniaAPI")
|
||||
@API(owner = "Botania", apiVersion = "75", provides = "BotaniaAPI")
|
||||
package vazkii.botania.api;
|
||||
import net.minecraftforge.fml.common.API;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 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 @ [29/12/2015, 23:00:06 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.api.subtile;
|
||||
|
||||
/**
|
||||
* An extension of ISubTileContainer that allows for the SubTile to be "slowed down".
|
||||
* Slowing down is the action that happens when a flower is planted in Podzol or Mycellium.
|
||||
* Any flowers that pick up items from the ground should have a delay on the time the item
|
||||
* needs to be on the floor equal to the value of getSlowDownFactor().
|
||||
*/
|
||||
public interface ISubTileSlowableContainer extends ISubTileContainer {
|
||||
|
||||
public static final int SLOWDOWN_FACTOR_PODZOL = 5;
|
||||
public static final int SLOWDOWN_FACTOR_MYCEL = 10;
|
||||
|
||||
public int getSlowdownFactor();
|
||||
|
||||
}
|
||||
@@ -224,6 +224,19 @@ public class SubTileEntity {
|
||||
public boolean isOvergrowthAffected() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets ths slowdown factor of this SubTile.
|
||||
* @see ISubTileSlowableContainer
|
||||
*/
|
||||
public int getSlowdownFactor() {
|
||||
if(supertile instanceof ISubTileSlowableContainer) {
|
||||
ISubTileSlowableContainer slowable = (ISubTileSlowableContainer) supertile;
|
||||
return slowable.getSlowdownFactor();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -142,8 +142,12 @@ public class CorporeaAutoCompleteHandler {
|
||||
}
|
||||
|
||||
private ArrayList<CompletionData> getNames(String prefix) {
|
||||
String s = prefix.trim();
|
||||
if(s.isEmpty())
|
||||
return new ArrayList();
|
||||
|
||||
TreeSet<CompletionData> result = new TreeSet<CompletionData>();
|
||||
String[] words = prefix.split(" ");
|
||||
String[] words = s.split(" ");
|
||||
int i = words.length - 1;
|
||||
String curPrefix = words[i];
|
||||
while(i >= 0) {
|
||||
|
||||
@@ -129,11 +129,29 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
entriesToDisplay.clear();
|
||||
ILexicon lex = (ILexicon) stackUsed.getItem();
|
||||
for(LexiconEntry entry : category == null ? BotaniaAPI.getAllEntries() : category.entries) {
|
||||
if(entry.isVisible() && lex.isKnowledgeUnlocked(stackUsed, entry.getKnowledgeType()) && StatCollector.translateToLocal(entry.getUnlocalizedName()).toLowerCase().contains(searchField.getText().toLowerCase().trim()))
|
||||
if(entry.isVisible() && lex.isKnowledgeUnlocked(stackUsed, entry.getKnowledgeType()) && matchesSearch(entry))
|
||||
entriesToDisplay.add(entry);
|
||||
}
|
||||
Collections.sort(entriesToDisplay);
|
||||
}
|
||||
|
||||
boolean matchesSearch(LexiconEntry e) {
|
||||
String search = searchField.getText().trim();
|
||||
if(search.isEmpty())
|
||||
return true;
|
||||
|
||||
search = search.toLowerCase();
|
||||
if(StatCollector.translateToLocal(e.getUnlocalizedName()).toLowerCase().contains(search))
|
||||
return true;
|
||||
|
||||
for(ItemStack stack : e.getDisplayedRecipes()) {
|
||||
String stackName = stack.getDisplayName().toLowerCase().trim();
|
||||
if(stackName.contains(search))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
void populateIndex() {
|
||||
@@ -170,6 +188,14 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
drawTexturedModalRect(left + 134, top + guiHeight - 26, 86, 180, 12, 12);
|
||||
|
||||
if(entriesToDisplay.size() == 1) {
|
||||
boolean unicode = mc.fontRendererObj.getUnicodeFlag();
|
||||
mc.fontRendererObj.setUnicodeFlag(true);
|
||||
String s = StatCollector.translateToLocal("botaniamisc.enterToView");
|
||||
mc.fontRendererObj.drawString(s, left + guiWidth / 2 - mc.fontRendererObj.getStringWidth(s) / 2, top + 30, 0x666666);
|
||||
mc.fontRendererObj.setUnicodeFlag(unicode);
|
||||
}
|
||||
} else {
|
||||
boolean unicode = mc.fontRendererObj.getUnicodeFlag();
|
||||
mc.fontRendererObj.setUnicodeFlag(true);
|
||||
|
||||
@@ -1,11 +1,24 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerBrewery;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerElvenTrade;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerFloatingFlowers;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerLexicaBotania;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerManaPool;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerPetalApothecary;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerPureDaisy;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerRunicAltar;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
|
||||
public class NEIBotaniaConfig implements IConfigureNEI {
|
||||
|
||||
public static final String CORPOREA_KEY = "gui.botania_corporea_request";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return LibMisc.MOD_NAME;
|
||||
@@ -41,6 +54,9 @@ public class NEIBotaniaConfig implements IConfigureNEI {
|
||||
|
||||
API.registerRecipeHandler(new RecipeHandlerLexicaBotania());
|
||||
API.registerUsageHandler(new RecipeHandlerLexicaBotania());
|
||||
|
||||
API.addKeyBind(CORPOREA_KEY, Keyboard.KEY_C);
|
||||
GuiContainerManager.addInputHandler(new NEIInputHandler());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
* 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 @ [25/12/2015, 02:22:32 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.integration.nei;
|
||||
|
||||
import vazkii.botania.api.corporea.CorporeaHelper;
|
||||
import vazkii.botania.common.block.tile.corporea.TileCorporeaIndex;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import codechicken.nei.LayoutManager;
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.guihook.GuiContainerManager;
|
||||
import codechicken.nei.guihook.IContainerInputHandler;
|
||||
|
||||
public class NEIInputHandler implements IContainerInputHandler {
|
||||
|
||||
@Override
|
||||
public boolean keyTyped(GuiContainer gui, char c, int i) {
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if(TileCorporeaIndex.InputHandler.getNearbyIndexes(mc.thePlayer).isEmpty())
|
||||
return false;
|
||||
|
||||
int bind = NEIClientConfig.getKeyBinding(NEIBotaniaConfig.CORPOREA_KEY);
|
||||
|
||||
if(i == bind) {
|
||||
LayoutManager layoutManager = LayoutManager.instance();
|
||||
if(layoutManager != null && LayoutManager.itemPanel != null && !NEIClientConfig.isHidden()) {
|
||||
ItemStack stack = GuiContainerManager.getStackMouseOver(gui);
|
||||
if(stack != null && stack.getItem() != null) {
|
||||
int count = 1;
|
||||
int max = stack.getMaxStackSize();
|
||||
if(gui.isShiftKeyDown()) {
|
||||
count = max;
|
||||
if(gui.isCtrlKeyDown())
|
||||
count /= 4;
|
||||
} else if(gui.isCtrlKeyDown())
|
||||
count = max / 2;
|
||||
|
||||
if(count > 0) {
|
||||
String name = CorporeaHelper.stripControlCodes(stack.getDisplayName());
|
||||
String full = count + " " + name;
|
||||
|
||||
mc.ingameGUI.getChatGUI().addToSentMessages(full);
|
||||
mc.thePlayer.sendChatMessage(full);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean lastKeyTyped(GuiContainer arg0, char arg1, int arg2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(GuiContainer arg0, int arg1, int arg2, int arg3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseScrolled(GuiContainer arg0, int arg1, int arg2, int arg3) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyTyped(GuiContainer arg0, char arg1, int arg2) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseClicked(GuiContainer arg0, int arg1, int arg2, int arg3) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseDragged(GuiContainer arg0, int arg1, int arg2, int arg3, long arg4) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseScrolled(GuiContainer arg0, int arg1, int arg2, int arg3) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMouseUp(GuiContainer arg0, int arg1, int arg2, int arg3) {
|
||||
// NO-OP
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
+2
-2
@@ -8,7 +8,7 @@
|
||||
*
|
||||
* File Created @ [12/12/2015, 23:25:47 (GMT)]
|
||||
*/
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
@@ -32,7 +32,7 @@ import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
|
||||
import vazkii.botania.api.recipe.RecipeManaInfusion;
|
||||
import vazkii.botania.client.core.handler.HUDHandler;
|
||||
import vazkii.botania.client.integration.nei.RecipeHandlerManaPool.CachedManaPoolRecipe;
|
||||
import vazkii.botania.client.integration.nei.recipe.RecipeHandlerManaPool.CachedManaPoolRecipe;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.client.render.tile.RenderTilePool;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package vazkii.botania.client.integration.nei;
|
||||
package vazkii.botania.client.integration.nei.recipe;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -24,6 +24,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import vazkii.botania.client.core.handler.ClientTickHandler;
|
||||
import vazkii.botania.client.core.helper.ShaderHelper;
|
||||
import vazkii.botania.common.block.BlockLightRelay;
|
||||
|
||||
public class RenderTileLightRelay extends TileEntitySpecialRenderer {
|
||||
@@ -58,7 +59,10 @@ public class RenderTileLightRelay extends TileEntitySpecialRenderer {
|
||||
GlStateManager.translate(0F, -off, 0F);
|
||||
|
||||
mc.renderEngine.bindTexture(TextureMap.locationBlocksTexture);
|
||||
ShaderHelper.useShader(ShaderHelper.halo);
|
||||
func_77026_a(tessellator, iicon);
|
||||
ShaderHelper.releaseShader();
|
||||
|
||||
GlStateManager.popMatrix();
|
||||
GlStateManager.color(1F, 1F, 1F, 1F);
|
||||
GlStateManager.disableBlend();
|
||||
@@ -71,6 +75,13 @@ public class RenderTileLightRelay extends TileEntitySpecialRenderer {
|
||||
float f1 = p_77026_2_.getMaxU();
|
||||
float f2 = p_77026_2_.getMinV();
|
||||
float f3 = p_77026_2_.getMaxV();
|
||||
float size = f1 - f;
|
||||
float pad = size / 8F;
|
||||
f += pad;
|
||||
f1 -= pad;
|
||||
f2 += pad;
|
||||
f3 -= pad;
|
||||
|
||||
float f4 = 1.0F;
|
||||
float f5 = 0.5F;
|
||||
float f6 = 0.25F;
|
||||
|
||||
@@ -63,8 +63,10 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
float f3 = (float)vec3.zCoord;
|
||||
float f6;
|
||||
|
||||
int startFade = 25;
|
||||
float insideVoid = Math.max(0F, ((float) (startFade - mc.thePlayer.posY) / startFade));
|
||||
float insideVoid = 0;
|
||||
if(mc.thePlayer.posY <= -2)
|
||||
insideVoid = (float) Math.min(1F, -(mc.thePlayer.posY + 2) / 30F);
|
||||
|
||||
f1 = Math.max(0F, f1 - insideVoid);
|
||||
f2 = Math.max(0F, f2 - insideVoid);
|
||||
f3 = Math.max(0F, f3 - insideVoid);
|
||||
@@ -136,7 +138,7 @@ public class SkyblockSkyRenderer extends IRenderHandler {
|
||||
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1F, 1F, 1F, a * 4);
|
||||
GL11.glColor4f(1F, 1F, 1F, (a * 4) * (1F - insideVoid));
|
||||
GL11.glRotatef(90F, 0.5F, 0.5F, 0.0F);
|
||||
for(int p = 0; p < planetTextures.length; p++) {
|
||||
mc.renderEngine.bindTexture(planetTextures[p]);
|
||||
|
||||
@@ -32,6 +32,7 @@ import vazkii.botania.api.state.enums.PlatformVariant;
|
||||
import vazkii.botania.api.state.enums.PylonVariant;
|
||||
import vazkii.botania.client.lib.LibRenderIDs;
|
||||
import vazkii.botania.common.block.tile.TilePylon;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
import vazkii.botania.common.item.block.ItemBlockWithMetadataAndName;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibBlockNames;
|
||||
@@ -123,8 +124,9 @@ public class BlockPylon extends BlockModContainer implements ILexiconable, IInfu
|
||||
PylonVariant variant = ((PylonVariant) world.getBlockState(pos).getValue(BotaniaStateProps.PYLON_VARIANT));
|
||||
return variant == PylonVariant.MANA ? LexiconData.pylon : variant == PylonVariant.NATURA ? LexiconData.alfhomancyIntro : LexiconData.gaiaRitual;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canStabaliseInfusion(World world, BlockPos pos) {
|
||||
return true;
|
||||
return ConfigHandler.enableThaumcraftStablizers;
|
||||
}
|
||||
}
|
||||
@@ -248,7 +248,7 @@ public class BlockSpecialFlower extends BlockFlower implements ITileEntityProvid
|
||||
|
||||
@Override
|
||||
protected boolean canPlaceBlockOn(Block block) {
|
||||
return super.canPlaceBlockOn(block) || block == ModBlocks.redStringRelay;
|
||||
return super.canPlaceBlockOn(block) || block == ModBlocks.redStringRelay || block == Blocks.mycelium;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -262,6 +262,6 @@ public class BlockFloatingFlower extends BlockModContainer implements ILexiconab
|
||||
|
||||
@Override
|
||||
public boolean canStabaliseInfusion(World world, BlockPos pos) {
|
||||
return true;
|
||||
return ConfigHandler.enableThaumcraftStablizers;
|
||||
}
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public class BlockModMushroom extends BlockMushroom implements IInfusionStabilis
|
||||
|
||||
@Override
|
||||
public boolean canStabaliseInfusion(World world, BlockPos pos) {
|
||||
return true;
|
||||
return ConfigHandler.enableThaumcraftStablizers;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -57,7 +57,7 @@ public class BlockShinyFlower extends BlockModFlower implements IInfusionStabili
|
||||
|
||||
@Override
|
||||
public boolean canStabaliseInfusion(World world, BlockPos pos) {
|
||||
return true;
|
||||
return ConfigHandler.enableThaumcraftStablizers;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,11 +49,13 @@ public class SubTileDaffomill extends SubTileFunctional {
|
||||
|
||||
if(axis != null) {
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, axis);
|
||||
for(EntityItem item : items) {
|
||||
item.motionX += orientation.getFrontOffsetX() * 0.05;
|
||||
item.motionY += orientation.getFrontOffsetY() * 0.05;
|
||||
item.motionZ += orientation.getFrontOffsetZ() * 0.05;
|
||||
}
|
||||
int slowdown = getSlowdownFactor();
|
||||
for(EntityItem item : items)
|
||||
if(!item.isDead && item.getAge() >= slowdown) {
|
||||
item.motionX += orientation.getFrontOffsetX() * 0.05;
|
||||
item.motionY += orientation.getFrontOffsetY() * 0.05;
|
||||
item.motionZ += orientation.getFrontOffsetZ() * 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
windTicks--;
|
||||
|
||||
+23
-8
@@ -11,7 +11,10 @@
|
||||
package vazkii.botania.common.block.subtile.functional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -32,6 +35,7 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import scala.reflect.internal.util.WeakHashSet;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.mana.IManaItem;
|
||||
import vazkii.botania.api.subtile.RadiusDescriptor;
|
||||
@@ -49,6 +53,8 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
private static final int RANGE_MANA_MINI = 2;
|
||||
private static final int RANGE_MINI = 1;
|
||||
|
||||
private static Set<EntityItem> particled = Collections.newSetFromMap(new WeakHashMap());
|
||||
|
||||
int filterType = 0;
|
||||
|
||||
@Override
|
||||
@@ -64,8 +70,10 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
BlockPos pos = supertile.getPos();
|
||||
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pos.add(-range, -range, -range), pos.add(range + 1, range + 1, range + 1)));
|
||||
int slowdown = getSlowdownFactor();
|
||||
|
||||
for(EntityItem item : items) {
|
||||
if(item.getAge() < 60 || item.getAge() >= 105 && item.getAge() < 110 || item.isDead)
|
||||
if(item.getAge() < (60 + slowdown) || item.getAge() >= 105 && item.getAge() < 110 || item.isDead)
|
||||
continue;
|
||||
|
||||
ItemStack stack = item.getEntityItem();
|
||||
@@ -73,6 +81,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
IInventory invToPutItemIn = null;
|
||||
EnumFacing sideToPutItemIn = null;
|
||||
boolean priorityInv = false;
|
||||
int amountToPutIn = 0;
|
||||
|
||||
for(EnumFacing dir : EnumFacing.VALUES) {
|
||||
BlockPos pos_ = pos.offset(dir);
|
||||
@@ -81,8 +90,8 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
if(inv != null) {
|
||||
List<ItemStack> filter = getFilterForInventory(inv, pos_, true);
|
||||
boolean canAccept = canAcceptItem(stack, filter, filterType);
|
||||
int stackSize = InventoryHelper.testInventoryInsertion(inv, stack, dir);
|
||||
canAccept &= stackSize == stack.stackSize;
|
||||
int availablePut = InventoryHelper.testInventoryInsertion(inv, stack, dir);
|
||||
canAccept &= availablePut > 0;
|
||||
|
||||
if(canAccept) {
|
||||
boolean priority = !filter.isEmpty();
|
||||
@@ -94,6 +103,7 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
invToPutItemIn = inv;
|
||||
priorityInv = priority;
|
||||
sideToPutItemIn = dir.getOpposite();
|
||||
amountToPutIn = availablePut;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,12 +111,17 @@ public class SubTileHopperhock extends SubTileFunctional {
|
||||
|
||||
if(invToPutItemIn != null) {
|
||||
boolean remote = supertile.getWorld().isRemote;
|
||||
if(!item.isDead && remote)
|
||||
SubTileSpectranthemum.spawnExplosionParticles(item, 1);
|
||||
else {
|
||||
InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.copy(), sideToPutItemIn, -1);
|
||||
if(!item.isDead && remote) {
|
||||
if(!particled.contains(item)) {
|
||||
SubTileSpectranthemum.spawnExplosionParticles(item, 3);
|
||||
particled.add(item);
|
||||
}
|
||||
} else {
|
||||
InventoryHelper.insertItemIntoInventory(invToPutItemIn, stack.splitStack(amountToPutIn), sideToPutItemIn, -1);
|
||||
item.setEntityItemStack(stack); // Just in case someone subclasses EntityItem and changes something important.
|
||||
invToPutItemIn.markDirty();
|
||||
item.setDead();
|
||||
if(item.getEntityItem().stackSize == 0)
|
||||
item.setDead();
|
||||
pulledAny = true;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -36,6 +36,8 @@ public class SubTilePollidisiac extends SubTileFunctional {
|
||||
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
List<EntityAnimal> animals = supertile.getWorld().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
int slowdown = getSlowdownFactor();
|
||||
|
||||
for(EntityAnimal animal : animals) {
|
||||
if(mana < manaCost)
|
||||
break;
|
||||
@@ -43,7 +45,7 @@ public class SubTilePollidisiac extends SubTileFunctional {
|
||||
int love = ReflectionHelper.getPrivateValue(EntityAnimal.class, animal, LibObfuscation.IN_LOVE);
|
||||
if(animal.getGrowingAge() == 0 && love <= 0) {
|
||||
for(EntityItem item : items) {
|
||||
if(item.getAge() < 60 || item.isDead)
|
||||
if(item.getAge() < (60 + slowdown) || item.isDead)
|
||||
continue;
|
||||
|
||||
ItemStack stack = item.getEntityItem();
|
||||
|
||||
+3
-2
@@ -75,10 +75,11 @@ public class SubTileRannuncarpus extends SubTileFunctional {
|
||||
int rangePlaceY = getRangeY();
|
||||
|
||||
BlockPos pos = supertile.getPos();
|
||||
|
||||
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE_Y, -RANGE), supertile.getPos().add(RANGE + 1, RANGE_Y + 1, RANGE + 1)));
|
||||
int slowdown = getSlowdownFactor();
|
||||
for(EntityItem item : items) {
|
||||
if(item.getAge() < 60 || item.isDead)
|
||||
if(item.getAge() < (60 + slowdown) || item.isDead)
|
||||
continue;
|
||||
|
||||
ItemStack stack = item.getEntityItem();
|
||||
|
||||
@@ -38,9 +38,6 @@ public class SubTileSolegnolia extends SubTileFunctional {
|
||||
if(!registered)
|
||||
registered = true;
|
||||
}
|
||||
|
||||
if(ticksExisted % 10 == 0 && mana > 0 && redstoneSignal == 0)
|
||||
mana--;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -50,7 +47,7 @@ public class SubTileSolegnolia extends SubTileFunctional {
|
||||
|
||||
public static boolean hasSolegnoliaAround(Entity e) {
|
||||
for(SubTileSolegnolia flower : existingFlowers) {
|
||||
if(flower.mana == 0 || flower.redstoneSignal > 0 || flower.supertile.getWorld() != e.worldObj || flower.supertile.getWorld().getTileEntity(flower.supertile.getPos()) != flower.supertile)
|
||||
if(flower.redstoneSignal > 0 || flower.supertile.getWorld() != e.worldObj || flower.supertile.getWorld().getTileEntity(flower.supertile.getPos()) != flower.supertile)
|
||||
continue;
|
||||
|
||||
double range = flower.getRange();
|
||||
@@ -63,7 +60,7 @@ public class SubTileSolegnolia extends SubTileFunctional {
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return 20;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-1
@@ -51,9 +51,12 @@ public class SubTileSpectranthemum extends SubTileFunctional {
|
||||
BlockPos pos = supertile.getPos();
|
||||
|
||||
boolean did = false;
|
||||
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
int slowdown = getSlowdownFactor();
|
||||
|
||||
for(EntityItem item : items) {
|
||||
if(item.getAge() < 60 || item.isDead || item.getEntityData().getBoolean(TAG_TELEPORTED))
|
||||
if(item.getAge() < (60 + slowdown) || item.isDead || item.getEntityData().getBoolean(TAG_TELEPORTED))
|
||||
continue;
|
||||
|
||||
ItemStack stack = item.getEntityItem();
|
||||
|
||||
@@ -43,9 +43,11 @@ public class SubTileEndoflame extends SubTileGenerating {
|
||||
if(mana < getMaxMana()) {
|
||||
boolean didSomething = false;
|
||||
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
int slowdown = getSlowdownFactor();
|
||||
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
for(EntityItem item : items) {
|
||||
if(item.getAge() >= 59 && !item.isDead) {
|
||||
if(item.getAge() >= (59 + slowdown) && !item.isDead) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack.getItem().hasContainerItem(stack))
|
||||
continue;
|
||||
|
||||
+5
-2
@@ -44,11 +44,14 @@ public class SubTileGourmaryllis extends SubTileGenerating {
|
||||
sync();
|
||||
}
|
||||
|
||||
int slowdown = getSlowdownFactor();
|
||||
|
||||
boolean remote = supertile.getWorld().isRemote;
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
|
||||
for(EntityItem item : items) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead) {
|
||||
if(stack != null && stack.getItem() instanceof ItemFood && !item.isDead && item.getAge() >= slowdown) {
|
||||
if(cooldown == 0) {
|
||||
if(!remote) {
|
||||
int val = ((ItemFood) stack.getItem()).getHealAmount(stack);
|
||||
|
||||
@@ -47,10 +47,13 @@ public class SubTileSpectrolus extends SubTileGenerating {
|
||||
|
||||
boolean remote = supertile.getWorld().isRemote;
|
||||
Item wool = Item.getItemFromBlock(Blocks.wool);
|
||||
|
||||
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
|
||||
int slowdown = getSlowdownFactor();
|
||||
|
||||
for(EntityItem item : items) {
|
||||
ItemStack stack = item.getEntityItem();
|
||||
if(stack != null && stack.getItem() == wool) {
|
||||
if(stack != null && stack.getItem() == wool && !item.isDead && item.getAge() >= slowdown) {
|
||||
int meta = stack.getItemDamage();
|
||||
if(meta == nextColor) {
|
||||
if(!remote) {
|
||||
|
||||
@@ -225,7 +225,7 @@ public class TileAlfPortal extends TileMod implements ITickable {
|
||||
for(ItemStack stack : stacksIn) {
|
||||
if(stack != null && stack.getItem() instanceof ILexicon) {
|
||||
((ILexicon) stack.getItem()).unlockKnowledge(stack, BotaniaAPI.elvenKnowledge);
|
||||
ItemLexicon.setForcedPage(stack, LexiconData.elvenMessage.unlocalizedName);
|
||||
ItemLexicon.setForcedPage(stack, LexiconData.elvenMessage.getUnlocalizedName());
|
||||
spawnItem(stack);
|
||||
stacksIn.remove(i);
|
||||
return;
|
||||
|
||||
@@ -52,4 +52,13 @@ public class TileFloatingSpecialFlower extends TileSpecialFlower implements IFlo
|
||||
type = IslandType.ofType(cmp.getString(TAG_ISLAND_TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlowdownFactor() {
|
||||
switch(getIslandType()) {
|
||||
case MYCEL: return SLOWDOWN_FACTOR_MYCEL;
|
||||
case PODZOL: return SLOWDOWN_FACTOR_PODZOL;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -13,7 +13,9 @@ package vazkii.botania.common.block.tile;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -24,18 +26,17 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ITickable;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.ISubTileContainer;
|
||||
import vazkii.botania.api.subtile.ISubTileSlowableContainer;
|
||||
import vazkii.botania.api.subtile.SubTileEntity;
|
||||
import vazkii.botania.api.wand.IWandBindable;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.string.TileRedStringRelay;
|
||||
|
||||
public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTileContainer, ITickable {
|
||||
public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTileSlowableContainer, ITickable {
|
||||
|
||||
private static final String TAG_SUBTILE_NAME = "subTileName";
|
||||
private static final String TAG_SUBTILE_CMP = "subTileCmp";
|
||||
@@ -213,4 +214,19 @@ public class TileSpecialFlower extends TileMod implements IWandBindable, ISubTil
|
||||
return 0;
|
||||
return subTile.getPowerLevel(side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSlowdownFactor() {
|
||||
Block below = worldObj.getBlockState(getPos().down()).getBlock();
|
||||
if(below == Blocks.mycelium)
|
||||
return SLOWDOWN_FACTOR_MYCEL;
|
||||
|
||||
if(below == Blocks.dirt) {
|
||||
BlockDirt.DirtType type = worldObj.getBlockState(getPos().down()).getValue(BlockDirt.VARIANT);
|
||||
if(type == BlockDirt.DirtType.PODZOL)
|
||||
return SLOWDOWN_FACTOR_PODZOL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
|
||||
}
|
||||
}
|
||||
|
||||
public List<TileCorporeaIndex> getNearbyIndexes(EntityPlayer player) {
|
||||
public static List<TileCorporeaIndex> getNearbyIndexes(EntityPlayer player) {
|
||||
List<TileCorporeaIndex> indexList = new ArrayList();
|
||||
for(TileCorporeaIndex index : indexes)
|
||||
if(isInRangeOfIndex(player, index) && index.worldObj.isRemote == player.worldObj.isRemote)
|
||||
|
||||
@@ -26,8 +26,21 @@ public class TileRedStringContainer extends TileRedString implements ISidedInven
|
||||
|
||||
@Override
|
||||
public boolean acceptBlock(BlockPos pos) {
|
||||
TileEntity inv = worldObj.getTileEntity(pos);
|
||||
return inv != null && inv instanceof IInventory;
|
||||
TileEntity tile = worldObj.getTileEntity(pos);
|
||||
if(tile != null && tile instanceof IInventory) {
|
||||
IInventory inv = (IInventory) tile;
|
||||
if(inv instanceof ISidedInventory) {
|
||||
ISidedInventory sidedInv = (ISidedInventory) inv;
|
||||
for(EnumFacing e : EnumFacing.VALUES)
|
||||
if(sidedInv.getSlotsForFace(e).length != 0)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -88,6 +88,10 @@ public final class ConfigHandler {
|
||||
public static boolean ringOfOdinFireResist = true;
|
||||
public static boolean enderStuff19Enabled = true;
|
||||
public static boolean invertMagnetRing = false;
|
||||
public static boolean enableThaumcraftStablizers = true;
|
||||
|
||||
public static int harvestLevelWeight = 2;
|
||||
public static int harvestLevelBore = 3;
|
||||
|
||||
public static int flowerQuantity = 2;
|
||||
public static int flowerDensity = 2;
|
||||
@@ -245,6 +249,15 @@ public final class ConfigHandler {
|
||||
desc = "Set this to true to invert the Ring of Magnetization's controls (from shift to stop to shift to work)";
|
||||
invertMagnetRing = loadPropBool("magnetRing.invert", desc, invertMagnetRing);
|
||||
|
||||
desc = "Set this to false to disable Thaumcraft Infusion Stabilizing in botania blocks";
|
||||
enableThaumcraftStablizers = loadPropBool("thaumraftStabilizers.enabled", desc, enableThaumcraftStablizers);
|
||||
|
||||
desc = "The harvest level of the Mana Lens: Weight. 3 is diamond level. Defaults to 2 (iron level)";
|
||||
harvestLevelWeight = loadPropInt("harvestLevel.weightLens", desc, harvestLevelWeight);
|
||||
|
||||
desc = "The harvest level of the Mana Lens: Bore. 3 is diamond level. Defaults to 3";
|
||||
harvestLevelBore = loadPropInt("harvestLevel.boreLens", desc, harvestLevelBore);
|
||||
|
||||
desc = "The quantity of Botania flower patches to generate in the world, defaults to 2, the lower the number the less patches generate.";
|
||||
flowerQuantity = loadPropInt("worldgen.flower.quantity", desc, flowerQuantity);
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ package vazkii.botania.common.entity;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -79,7 +80,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWithShader {
|
||||
|
||||
public static final int SPAWN_TICKS = 100;
|
||||
public static final int SPAWN_TICKS = 160;
|
||||
private static final float RANGE = 12F;
|
||||
private static final float MAX_HP = 800F;
|
||||
|
||||
@@ -106,6 +107,11 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
new BlockPos(-4, 1, -4)
|
||||
};
|
||||
|
||||
private static final List<String> CHEATY_BLOCKS = Arrays.asList(new String[] {
|
||||
"OpenBlocks:beartrap",
|
||||
"ThaumicTinkerer:magnet"
|
||||
});
|
||||
|
||||
boolean spawnLandmines = false;
|
||||
boolean spawnPixies = false;
|
||||
boolean anyWithArmor = false;
|
||||
@@ -517,17 +523,28 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
setDead();
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
BlockPos pos = new BlockPos(this);
|
||||
Block block = worldObj.getBlockState(pos).getBlock();
|
||||
if(block.getBlockHardness(worldObj, pos) >= 0) {
|
||||
List<ItemStack> items = block.getDrops(worldObj, pos, worldObj.getBlockState(pos), 0);
|
||||
for(ItemStack stack : items) {
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
worldObj.playAuxSFX(2001, pos, Block.getStateId(worldObj.getBlockState(pos)));
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, stack));
|
||||
}
|
||||
worldObj.setBlockToAir(pos);
|
||||
}
|
||||
int radius = 1;
|
||||
int posXInt = MathHelper.floor_double(posX);
|
||||
int posYInt = MathHelper.floor_double(posY);
|
||||
int posZInt = MathHelper.floor_double(posZ);
|
||||
for(int i = -radius; i < radius + 1; i++)
|
||||
for(int j = -radius; j < radius + 1; j++)
|
||||
for(int k = -radius; k < radius + 1; k++) {
|
||||
int xp = posXInt + i;
|
||||
int yp = posYInt + j;
|
||||
int zp = posZInt + k;
|
||||
BlockPos posp = new BlockPos(xp, yp, zp);
|
||||
if(isCheatyBlock(worldObj, posp)) {
|
||||
Block block = worldObj.getBlockState(posp).getBlock();
|
||||
List<ItemStack> items = block.getDrops(worldObj, posp, worldObj.getBlockState(posp), 0);
|
||||
for(ItemStack stack : items) {
|
||||
if(ConfigHandler.blockBreakParticles)
|
||||
worldObj.playAuxSFX(2001, posp, Block.getStateId(worldObj.getBlockState(posp)));
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, xp + 0.5, yp + 0.5, zp + 0.5, stack));
|
||||
}
|
||||
worldObj.setBlockToAir(posp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BlockPos source = getSource();
|
||||
@@ -593,10 +610,37 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
int mobTicks = getMobSpawnTicks();
|
||||
boolean spawnMissiles = hard && ticksExisted % 15 < 4;
|
||||
|
||||
if(invul > 10) {
|
||||
Vector3 pos = Vector3.fromEntityCenter(this).subtract(new Vector3(0, 0.2, 0));
|
||||
for(int i = 0; i < PYLON_LOCATIONS.length; i++) {
|
||||
BlockPos arr = PYLON_LOCATIONS[i];
|
||||
|
||||
Vector3 pylonPos = new Vector3(source.getX() + arr.getX(), source.getY() + arr.getY(), source.getZ() + arr.getZ());
|
||||
double worldTime = ticksExisted;
|
||||
worldTime /= 5;
|
||||
|
||||
float rad = 0.75F + (float) Math.random() * 0.05F;
|
||||
double xp = pylonPos.x + 0.5 + Math.cos(worldTime) * rad;
|
||||
double zp = pylonPos.z + 0.5 + Math.sin(worldTime) * rad;
|
||||
|
||||
Vector3 partPos = new Vector3(xp, pylonPos.y, zp);
|
||||
Vector3 mot = pos.copy().sub(partPos).multiply(0.04);
|
||||
|
||||
float r = 0.7F + (float) Math.random() * 0.3F;
|
||||
float g = (float) Math.random() * 0.3F;
|
||||
float b = 0.7F + (float) Math.random() * 0.3F;
|
||||
|
||||
Botania.proxy.wispFX(worldObj, partPos.x, partPos.y, partPos.z, r, g, b, 0.25F + (float) Math.random() * 0.1F, -0.075F - (float) Math.random() * 0.015F);
|
||||
Botania.proxy.wispFX(worldObj, partPos.x, partPos.y, partPos.z, r, g, b, 0.4F, (float) mot.x, (float) mot.y, (float) mot.z);
|
||||
}
|
||||
}
|
||||
|
||||
if(invul > 0 && mobTicks == MOB_SPAWN_TICKS) {
|
||||
if(invul < SPAWN_TICKS && invul > SPAWN_TICKS / 2 && worldObj.rand.nextInt(SPAWN_TICKS - invul + 1) == 0)
|
||||
for(int i = 0; i < 2; i++)
|
||||
spawnExplosionParticle();
|
||||
if(invul < SPAWN_TICKS) {
|
||||
if(invul > SPAWN_TICKS / 2 && worldObj.rand.nextInt(SPAWN_TICKS - invul + 1) == 0)
|
||||
for(int i = 0; i < 2; i++)
|
||||
spawnExplosionParticle();
|
||||
}
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
setHealth(getHealth() + (getMaxHealth() - 1F) / SPAWN_TICKS);
|
||||
@@ -624,7 +668,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
switch(worldObj.rand.nextInt(2)) {
|
||||
case 0 : {
|
||||
entity = new EntityZombie(worldObj);
|
||||
if(worldObj.rand.nextInt(hard ? 9 : 12) == 0)
|
||||
if(worldObj.rand.nextInt(hard ? 3 : 12) == 0)
|
||||
entity = new EntityWitch(worldObj);
|
||||
|
||||
break;
|
||||
@@ -677,8 +721,9 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
if(tries >= 50)
|
||||
teleportTo(source.getX() + 0.5, source.getY() + 1.6, source.getZ() + 0.5);
|
||||
|
||||
if(spawnLandmines)
|
||||
for(int i = 0; i < 6; i++) {
|
||||
if(spawnLandmines) {
|
||||
int count = dying && hard ? 7 : 6;
|
||||
for(int i = 0; i < count; i++) {
|
||||
int x = source.getX() - 10 + rand.nextInt(20);
|
||||
int z = source.getZ() - 10 + rand.nextInt(20);
|
||||
int y = worldObj.getTopSolidOrLiquidBlock(new BlockPos(x, -1, z)).getY();
|
||||
@@ -689,6 +734,8 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
worldObj.spawnEntityInWorld(landmine);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!players.isEmpty())
|
||||
for(int pl = 0; pl < playerCount; pl++)
|
||||
for(int i = 0; i < (spawnPixies ? worldObj.rand.nextInt(hard ? 6 : 3) : 1); i++) {
|
||||
@@ -698,7 +745,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
worldObj.spawnEntityInWorld(pixie);
|
||||
}
|
||||
|
||||
setTPDelay(hard ? dying ? 20 : 45 : dying ? 40 : 60);
|
||||
setTPDelay(hard ? (dying ? 35 : 45) : (dying ? 40 : 60));
|
||||
spawnLandmines = true;
|
||||
spawnPixies = false;
|
||||
}
|
||||
@@ -726,6 +773,12 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isCheatyBlock(World world, BlockPos pos) {
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
String name = Block.blockRegistry.getNameForObject(block).toString();
|
||||
return CHEATY_BLOCKS.contains(name);
|
||||
}
|
||||
|
||||
// EntityEnderman code below ============================================================================
|
||||
|
||||
protected boolean teleportRandomly() {
|
||||
|
||||
@@ -34,23 +34,27 @@ public class LensMine extends Lens {
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
World world = entity.worldObj;
|
||||
|
||||
BlockPos pos_ = pos.getBlockPos();
|
||||
Block block = world.getBlockState(pos_).getBlock();
|
||||
|
||||
ItemStack composite = ((ItemLens) ModItems.lens).getCompositeLens(stack);
|
||||
boolean warp = composite != null && composite.getItem() == ModItems.lens && composite.getItemDamage() == ItemLens.WARP;
|
||||
|
||||
|
||||
if(warp && (block == ModBlocks.pistonRelay || block == Blocks.piston || block == Blocks.piston_extension || block == Blocks.piston_head))
|
||||
return false;
|
||||
|
||||
int harvestLevel = ConfigHandler.harvestLevelBore;
|
||||
|
||||
TileEntity tile = world.getTileEntity(pos_);
|
||||
|
||||
IBlockState state = world.getBlockState(pos_);
|
||||
float hardness = block.getBlockHardness(world, pos_);
|
||||
int neededHarvestLevel = block.getHarvestLevel(state);
|
||||
int mana = burst.getMana();
|
||||
|
||||
BlockPos coords = burst.getBurstSourceBlockPos();
|
||||
if(!coords.equals(pos.getBlockPos()) && !(tile instanceof IManaBlock) && block != null && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) {
|
||||
if(!coords.equals(pos.getBlockPos()) && !(tile instanceof IManaBlock) && neededHarvestLevel <= harvestLevel && hardness != -1 && hardness < 50F && (burst.isFake() || mana >= 24)) {
|
||||
List<ItemStack> items = new ArrayList();
|
||||
|
||||
items.addAll(block.getDrops(world, pos_, world.getBlockState(pos_), 0));
|
||||
|
||||
@@ -11,21 +11,28 @@
|
||||
package vazkii.botania.common.item.lens;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.item.EntityFallingBlock;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import vazkii.botania.api.internal.IManaBurst;
|
||||
import vazkii.botania.common.core.handler.ConfigHandler;
|
||||
|
||||
public class LensWeight extends Lens {
|
||||
|
||||
@Override
|
||||
public boolean collideBurst(IManaBurst burst, EntityThrowable entity, MovingObjectPosition pos, boolean isManaBlock, boolean dead, ItemStack stack) {
|
||||
if(!burst.isFake()) {
|
||||
int harvestLevel = ConfigHandler.harvestLevelWeight;
|
||||
|
||||
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
|
||||
Block blockBelow = entity.worldObj.getBlockState(pos.getBlockPos().down()).getBlock();
|
||||
if(blockBelow.isAir(entity.worldObj, pos.getBlockPos().down()) && block.getBlockHardness(entity.worldObj, pos.getBlockPos()) != -1 && entity.worldObj.getTileEntity(pos.getBlockPos()) == null && block.canSilkHarvest(entity.worldObj, pos.getBlockPos(), entity.worldObj.getBlockState(pos.getBlockPos()), null)) {
|
||||
EntityFallingBlock falling = new EntityFallingBlock(entity.worldObj, pos.getBlockPos().getX() + 0.5, pos.getBlockPos().getY() + 0.5, pos.getBlockPos().getZ() + 0.5, entity.worldObj.getBlockState(pos.getBlockPos()));
|
||||
IBlockState state = entity.worldObj.getBlockState(pos.getBlockPos());
|
||||
int neededHarvestLevel = block.getHarvestLevel(state);
|
||||
|
||||
if(blockBelow.isAir(entity.worldObj, pos.getBlockPos().down()) && block.getBlockHardness(entity.worldObj, pos.getBlockPos()) != -1 && neededHarvestLevel <= harvestLevel && entity.worldObj.getTileEntity(pos.getBlockPos()) == null && block.canSilkHarvest(entity.worldObj, pos.getBlockPos(), entity.worldObj.getBlockState(pos.getBlockPos()), null)) {
|
||||
EntityFallingBlock falling = new EntityFallingBlock(entity.worldObj, pos.getBlockPos().getX() + 0.5, pos.getBlockPos().getY() + 0.5, pos.getBlockPos().getZ() + 0.5, state);
|
||||
if(!entity.worldObj.isRemote)
|
||||
entity.worldObj.spawnEntityInWorld(falling);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ public final class LexiconData {
|
||||
|
||||
public static LexiconEntry functionalIntro;
|
||||
public static LexiconEntry flowerShrinking;
|
||||
public static LexiconEntry flowerSpeed;
|
||||
public static LexiconEntry jadedAmaranthus;
|
||||
public static LexiconEntry bellethorne;
|
||||
public static LexiconEntry dreadthorne;
|
||||
@@ -451,6 +452,10 @@ public final class LexiconData {
|
||||
flowerShrinking = new BLexiconEntry(LibLexicon.FFLOWER_SHRINKING, categoryFunctionalFlowers);
|
||||
flowerShrinking.setPriority().setLexiconPages(new PageText("0"), new PageManaInfusionRecipe("1", BotaniaAPI.miniFlowerRecipes)).setIcon(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_BELLETHORN + "Chibi"));
|
||||
|
||||
flowerSpeed = new BLexiconEntry(LibLexicon.FFLOWER_SPEED, categoryFunctionalFlowers);
|
||||
flowerSpeed.setPriority().setLexiconPages(new PageText("0"), new PageText("1"));
|
||||
flowerSpeed.setIcon(new ItemStack(Blocks.dirt, 1, 2));
|
||||
|
||||
jadedAmaranthus = new BLexiconEntry(LibLexicon.FFLOWER_JADED_AMARANTHUS, categoryFunctionalFlowers);
|
||||
jadedAmaranthus.setLexiconPages(new PageText("0"), new PagePetalRecipe("1", ModPetalRecipes.jadedAmaranthusRecipe), new PageText("2"));
|
||||
|
||||
@@ -852,7 +857,7 @@ public final class LexiconData {
|
||||
corporea.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeCorporeaSpark), new PageCraftingRecipe("8", ModCraftingRecipes.recipeMasterCorporeaSpark));
|
||||
|
||||
corporeaIndex = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_INDEX, categoryEnder);
|
||||
corporeaIndex.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeCorporeaIndex));
|
||||
corporeaIndex.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"), new PageText("4"), new PageText("5"), new PageText("8"), new PageText("6"), new PageCraftingRecipe("7", ModCraftingRecipes.recipeCorporeaIndex));
|
||||
|
||||
corporeaFunnel = new ALexiconEntry(LibLexicon.ENDER_CORPOREA_FUNNEL, categoryEnder);
|
||||
corporeaFunnel.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeCorporeaFunnel));
|
||||
@@ -1100,7 +1105,10 @@ public final class LexiconData {
|
||||
|
||||
if(Botania.thaumcraftLoaded) {
|
||||
tcIntegration = new CLexiconEntry(LibLexicon.MISC_TC_INTEGRATION, BotaniaAPI.categoryMisc, "Thaumcraft");
|
||||
tcIntegration.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeHelmetOfRevealing), new PageText("3"), new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaInkwellRecipe), new PageText("5"), new PageBrew(ModBrewRecipes.warpWardBrew, "6a", "6b")).setIcon(new ItemStack(ModItems.manaInkwell));
|
||||
|
||||
if(ConfigHandler.enableThaumcraftStablizers)
|
||||
tcIntegration.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeHelmetOfRevealing), new PageText("3"), new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaInkwellRecipe), new PageText("5"), new PageBrew(ModBrewRecipes.warpWardBrew, "6a", "6b")).setIcon(new ItemStack(ModItems.manaInkwell));
|
||||
else tcIntegration.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCraftingRecipes.recipeHelmetOfRevealing), new PageText("3"), new PageManaInfusionRecipe("4", ModManaInfusionRecipes.manaInkwellRecipe), new PageBrew(ModBrewRecipes.warpWardBrew, "6a", "6b")).setIcon(new ItemStack(ModItems.manaInkwell));
|
||||
}
|
||||
|
||||
if(Botania.etFuturumLoaded) {
|
||||
|
||||
@@ -64,6 +64,7 @@ public final class LibLexicon {
|
||||
|
||||
public static final String FFLOWER_INTRO = "fIntro";
|
||||
public static final String FFLOWER_SHRINKING = "flowerShrinking";
|
||||
public static final String FFLOWER_SPEED = "flowerSpeed";
|
||||
public static final String FFLOWER_JADED_AMARANTHUS = "jadedAmaranthus";
|
||||
public static final String FFLOWER_BELLETHORNE = "bellethorne";
|
||||
public static final String FFLOWER_DREADTHORNE = "dreadthorne";
|
||||
|
||||
Reference in new issue
Block a user