Improved compression handler, updated buildings.zip, added temporary portal configs
This commit is contained in:
parent
5ba77eaedf
commit
1115eaf9a7
|
@ -12,6 +12,8 @@ import net.minecraftforge.common.config.Configuration;
|
|||
import WayofTime.alchemicalWizardry.api.rituals.Rituals;
|
||||
import WayofTime.alchemicalWizardry.client.renderer.ColourThreshold;
|
||||
import WayofTime.alchemicalWizardry.client.renderer.RenderHelper;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.DemonVillagePath;
|
||||
import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal;
|
||||
import WayofTime.alchemicalWizardry.common.items.BoundArmour;
|
||||
import WayofTime.alchemicalWizardry.common.summoning.meteor.MeteorParadigm;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
@ -133,6 +135,20 @@ public class BloodMagicConfiguration
|
|||
AlchemicalWizardry.ritualDisabledVeilOfEvil = config.get("Ritual Blacklist", "Veil of Evil", false).getBoolean(false);
|
||||
AlchemicalWizardry.ritualDisabledFullStomach = config.get("Ritual Blacklist", "Requiem of the Satiated Stomach", false).getBoolean(false);
|
||||
|
||||
String tempDemonConfigs = "Temp Demon Configs";
|
||||
TEDemonPortal.buildingGridDelay = config.get(tempDemonConfigs, "Building Grid Delay", 25).getInt();
|
||||
TEDemonPortal.roadGridDelay = config.get(tempDemonConfigs, "Road Grid Delay", 10).getInt();
|
||||
TEDemonPortal.demonHoardDelay = config.get(tempDemonConfigs, "Demon Hoard Delay", 40).getInt();
|
||||
TEDemonPortal.demonRoadChance = (float)(config.get(tempDemonConfigs, "Demon Road Chance", 0.6f).getDouble());
|
||||
TEDemonPortal.demonHouseChance = (float)(config.get(tempDemonConfigs, "Demon House Chance", 0.6f).getDouble());
|
||||
TEDemonPortal.demonPortalChance = (float)(config.get(tempDemonConfigs, "Demon Portal Chance", 0.5f).getDouble());
|
||||
TEDemonPortal.demonHoardChance = (float)(config.get(tempDemonConfigs, "Demon Hoard Chance", 1.0f).getDouble());
|
||||
TEDemonPortal.portalTickRate = (float)(config.get(tempDemonConfigs, "Portal Tick Rate", 0.1f).getDouble());
|
||||
|
||||
DemonVillagePath.canGoDown = config.get(tempDemonConfigs, "canRoadGoDown", true).getBoolean();
|
||||
DemonVillagePath.tunnelIfObstructed = config.get(tempDemonConfigs, "tunnelIfObstructed", false).getBoolean();
|
||||
DemonVillagePath.createBridgeInAirIfObstructed = config.get(tempDemonConfigs, "createBridgeInAirIfObstructed", false).getBoolean();
|
||||
|
||||
BoundArmour.tryComplexRendering = config.get("WimpySettings", "UseFancyBoundArmour", true).getBoolean(true);
|
||||
|
||||
Side side = FMLCommonHandler.instance().getSide();
|
||||
|
|
|
@ -26,14 +26,14 @@ public class AdvancedCompressionHandler extends CompressionHandler
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
int threshold = CompressionRegistry.getItemThreshold(invStack);
|
||||
|
||||
|
||||
for(int i=2; i<=3; i++)
|
||||
{
|
||||
ItemStack stacky = getRecipe(invStack, world, i);
|
||||
if(isResultStackReversible(stacky, i, world))
|
||||
{
|
||||
int threshold = CompressionRegistry.getItemThreshold(invStack);
|
||||
|
||||
int needed = i*i;
|
||||
int neededLeft = iterateThroughInventory(invStack, threshold, inv, needed, false);
|
||||
if(neededLeft <= 0)
|
||||
|
|
|
@ -16,9 +16,9 @@ public class DemonVillagePath
|
|||
public ForgeDirection dir;
|
||||
public int length;
|
||||
|
||||
public boolean canGoDown = true;
|
||||
public boolean tunnelIfObstructed = true;
|
||||
public boolean createBridgeInAirIfObstructed = false;
|
||||
public static boolean canGoDown = true;
|
||||
public static boolean tunnelIfObstructed = true;
|
||||
public static boolean createBridgeInAirIfObstructed = false;
|
||||
|
||||
public DemonVillagePath(int xi, int yi, int zi, ForgeDirection dir, int length)
|
||||
{
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.minecraft.pathfinding.PathEntity;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.common.EntityAITargetAggro;
|
||||
import WayofTime.alchemicalWizardry.common.Int3;
|
||||
|
@ -49,7 +50,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
|
||||
public EntityMinorDemonGrunt(World par1World)
|
||||
{
|
||||
super(par1World, "GruntString");
|
||||
super(par1World, AlchemicalWizardry.entityMinorDemonGruntID);
|
||||
this.setSize(0.7F, 1.8F);
|
||||
this.getNavigator().setAvoidsWater(true);
|
||||
this.tasks.addTask(1, new EntityAISwimming(this));
|
||||
|
@ -62,7 +63,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
|
||||
this.targetTasks.addTask(3, new EntityDemonAIHurtByTarget(this, true));
|
||||
this.targetTasks.addTask(4, new EntityAITargetAggro(this, EntityPlayer.class, 0, false));
|
||||
this.setAggro(false);
|
||||
this.setAggro(true);
|
||||
this.setTamed(false);
|
||||
|
||||
demonPortal = new Int3(0,0,0);
|
||||
|
@ -417,7 +418,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
@Override
|
||||
public boolean attackEntityAsMob(Entity par1Entity)
|
||||
{
|
||||
int i = this.isTamed() ? 6 : 7;
|
||||
int i = this.isTamed() ? 20 : 20;
|
||||
return par1Entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float) i);
|
||||
}
|
||||
|
||||
|
@ -430,7 +431,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
double xCoord;
|
||||
double yCoord;
|
||||
double zCoord;
|
||||
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600);
|
||||
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 15, 600);
|
||||
this.worldObj.spawnEntityInWorld(hol);
|
||||
}
|
||||
|
||||
|
@ -457,4 +458,13 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
|
|||
this.setPortalLocation(new Int3(teDemonPortal.xCoord, teDemonPortal.yCoord, teDemonPortal.zCoord));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSamePortal(IHoardDemon demon)
|
||||
{
|
||||
Int3 position = demon.getPortalLocation();
|
||||
TileEntity portal = worldObj.getTileEntity(this.demonPortal.xCoord, this.demonPortal.yCoord, this.demonPortal.zCoord);
|
||||
|
||||
return portal instanceof TEDemonPortal ? portal == worldObj.getTileEntity(position.xCoord, position.yCoord, position.zCoord) : false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,4 +8,5 @@ public interface IHoardDemon
|
|||
public void setPortalLocation(Int3 position);
|
||||
public Int3 getPortalLocation();
|
||||
public boolean thrallDemon(TEDemonPortal teDemonPortal);
|
||||
public boolean isSamePortal(IHoardDemon demon);
|
||||
}
|
||||
|
|
|
@ -31,6 +31,13 @@ public class TEDemonChest extends TileEntityChest implements ITilePortalNode
|
|||
tag.setTag("portalLocation", portalTag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openInventory()
|
||||
{
|
||||
super.openInventory();
|
||||
this.notifyPortalOfInteraction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkForAdjacentChests()
|
||||
{
|
||||
|
@ -64,6 +71,6 @@ public class TEDemonChest extends TileEntityChest implements ITilePortalNode
|
|||
return;
|
||||
}
|
||||
|
||||
portal.notifyDemons(xCoord, yCoord, zCoord, 25);
|
||||
portal.notifyDemons(xCoord, yCoord, zCoord, 50);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,11 @@ public class TEDemonPortal extends TileEntity
|
|||
public static int buildingGridDelay = 25;
|
||||
public static int roadGridDelay = 10;
|
||||
public static int demonHoardDelay = 40;
|
||||
public static float demonRoadChance = 0.6f;
|
||||
public static float demonHouseChance = 0.6f;
|
||||
public static float demonPortalChance = 0.5f;
|
||||
public static float demonHoardChance = 1.0f;
|
||||
public static float portalTickRate = 0.1f;
|
||||
|
||||
public static int[] tierCostList = new int[]{1000, 5000, 10000};
|
||||
|
||||
|
@ -121,7 +126,7 @@ public class TEDemonPortal extends TileEntity
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
return 0.6f;
|
||||
return demonRoadChance;
|
||||
}
|
||||
|
||||
public float getHouseChance()
|
||||
|
@ -130,7 +135,7 @@ public class TEDemonPortal extends TileEntity
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
return 0.6f;
|
||||
return demonHouseChance;
|
||||
}
|
||||
|
||||
public float getDemonPortalChance()
|
||||
|
@ -139,12 +144,12 @@ public class TEDemonPortal extends TileEntity
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
return 0.5f;
|
||||
return demonPortalChance;
|
||||
}
|
||||
|
||||
public float getDemonHoardChance()
|
||||
{
|
||||
return 1.0f;
|
||||
return demonHoardChance;
|
||||
}
|
||||
|
||||
public boolean decreaseRandomCooldown(int amount)
|
||||
|
@ -257,7 +262,7 @@ public class TEDemonPortal extends TileEntity
|
|||
|
||||
if((xi-xf)*(xi-xf) + (yi-yf)*(yi-yf) + (zi-zf)*(zi-zf) <= radius*radius)
|
||||
{
|
||||
((EntityCreature) thrallDemon).getNavigator().tryMoveToXYZ(xf, yf, zf, 2);
|
||||
((EntityCreature) thrallDemon).getNavigator().tryMoveToXYZ(xf, yf, zf, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -397,7 +402,7 @@ public class TEDemonPortal extends TileEntity
|
|||
|
||||
public void incrementPoints()
|
||||
{
|
||||
this.pointPool += 1f;
|
||||
this.pointPool += portalTickRate;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue