Moar clenaup

This commit is contained in:
Vincent Lee committed 2016-05-26 23:22:50 -05:00
1 parent e3e6f8996f
commit 51c7d310a7
8 files changed
+21 -26

No files matched your search

@@ -10,7 +10,6 @@
*/
package vazkii.botania.client.model;
import com.google.common.base.Function;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import net.minecraft.client.Minecraft;
@@ -33,6 +32,7 @@ import org.lwjgl.opengl.GL11;
import vazkii.botania.api.state.enums.PylonVariant;
import java.util.List;
import java.util.function.Function;
public class ModelPylon implements IPylonModel {
@@ -61,19 +61,19 @@ public class ModelPylon implements IPylonModel {
// (OBJState constructor is derp, so the boolean condition is inverted - pass false to turn on a group)
// Turn on "Crystal"
manaCrystal = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaCrystal = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaCrystal = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
manaCrystal = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
naturaCrystal = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
gaiaCrystal = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
// Turn on "Crystal_Ring", and "Ring_Panel0x"
manaRingsAndPanes = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaRingsAndPanes = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaRingsAndPanes = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
manaRingsAndPanes = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
naturaRingsAndPanes = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
gaiaRingsAndPanes = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Crystal_Ring", "Ring_Panel01", "Ring_Panel02", "Ring_Panel03", "Ring_Panel04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
// Turn on "Ring_Gem0x"
manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER);
manaGems = manaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
naturaGems = naturaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
gaiaGems = gaiaModel.bake(new OBJModel.OBJState(ImmutableList.of("Ring_Gem01", "Ring_Gem02", "Ring_Gem03", "Ring_Gem04"), false), Attributes.DEFAULT_BAKED_FORMAT, TEXTUREGETTER::apply);
} catch(Exception e) {
throw new ReportedException(new CrashReport("Error making pylon submodels for TESR!", e));
}
@@ -8,7 +8,6 @@
*/
package vazkii.botania.client.render.entity;
import com.google.common.base.Function;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderSnowball;
@@ -17,6 +16,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import javax.annotation.Nonnull;
import java.util.function.Function;
// Same as RenderSnowball, but ItemStack sensitive
public class RenderSnowballStack<T extends Entity> extends RenderSnowball<T> {
@@ -10,7 +10,6 @@
*/
package vazkii.botania.common.block.subtile.functional;
import com.google.common.base.Predicate;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityWitch;
@@ -23,6 +22,7 @@ import vazkii.botania.api.subtile.SubTileFunctional;
import vazkii.botania.common.lexicon.LexiconData;
import java.util.List;
import java.util.function.Predicate;
public class SubTileBellethorn extends SubTileFunctional {
@@ -53,13 +53,9 @@ public class SubTileBellethorn extends SubTileFunctional {
if(ticksExisted % 5 == 0) {
int range = getRange();
List<EntityLivingBase> entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.getPos().add(-range, -range, -range), supertile.getPos().add(range + 1, range + 1, range + 1)));
Predicate<Entity> selector = getSelector();
List<EntityLivingBase> entities = supertile.getWorld().getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(supertile.getPos().add(-range, -range, -range), supertile.getPos().add(range + 1, range + 1, range + 1)), getSelector()::test);
for(EntityLivingBase entity : entities) {
if(!selector.apply(entity))
continue;
if(entity.hurtTime == 0 && mana >= manaToUse) {
int dmg = 4;
if(entity instanceof EntityWitch)
@@ -10,12 +10,13 @@
*/
package vazkii.botania.common.block.subtile.functional;
import com.google.common.base.Predicate;
import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityAnimal;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.common.lexicon.LexiconData;
import java.util.function.Predicate;
public class SubTileDreadthorn extends SubTileBellethorn {
@Override
@@ -42,7 +42,9 @@ public class SubTileHeiseiDream extends SubTileFunctional {
final int cost = 100;
@SuppressWarnings("unchecked")
List<IMob> mobs = (List<IMob>) (List) supertile.getWorld().getEntitiesWithinAABB(Entity.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)), Predicates.instanceOf(IMob.class));
if(mobs.size() > 1 && mana >= cost)
for(IMob mob : mobs) {
if(mob instanceof EntityLiving) {
@@ -52,10 +52,9 @@ public abstract class TileSimpleInventory extends TileMod {
@Nonnull
@Override
@SuppressWarnings("unchecked")
public <T> T getCapability(@Nonnull Capability<T> cap, @Nonnull EnumFacing side) {
if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
return (T) itemHandler;
return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(itemHandler);
return super.getCapability(cap, side);
}
@@ -88,11 +88,8 @@ public class EntitySpark extends Entity implements ISparkEntity {
if(first || upgrade == SparkUpgradeType.DOMINANT || upgrade == SparkUpgradeType.RECESSIVE)
allSparks = SparkHelper.getSparksAround(worldObj, posX, posY, posZ);
if(first)
Collection<ISparkEntity> transfers = getTransfers();
if(upgrade != SparkUpgradeType.NONE) {
switch(upgrade) {
case DISPERSIVE : {
@@ -10,7 +10,6 @@
*/
package vazkii.botania.common.item.equipment.tool;
import com.google.common.base.Predicate;
import com.google.common.collect.Multimap;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -37,6 +36,7 @@ import javax.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.function.Predicate;
public class ItemThunderSword extends ItemManasteelSword implements ICraftAchievement {
@@ -50,7 +50,7 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
public boolean hitEntity(ItemStack stack, EntityLivingBase entity, @Nonnull EntityLivingBase attacker) {
if(!(entity instanceof EntityPlayer) && entity != null) {
double range = 8;
final List<EntityLivingBase> alreadyTargetedEntities = new ArrayList<>();
List<EntityLivingBase> alreadyTargetedEntities = new ArrayList<>();
int dmg = 5;
long lightningSeed = ItemNBTHelper.getLong(stack, TAG_LIGHTNING_SEED, 0);
@@ -60,7 +60,7 @@ public class ItemThunderSword extends ItemManasteelSword implements ICraftAchiev
EntityLivingBase lightningSource = entity;
int hops = entity.worldObj.isThundering() ? 10 : 4;
for(int i = 0; i < hops; i++) {
List<Entity> entities = entity.worldObj.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector);
List<Entity> entities = entity.worldObj.getEntitiesInAABBexcluding(lightningSource, new AxisAlignedBB(lightningSource.posX - range, lightningSource.posY - range, lightningSource.posZ - range, lightningSource.posX + range, lightningSource.posY + range, lightningSource.posZ + range), selector::test);
if(entities.isEmpty())
break;