Red Water now has a configurable AoE effect and duration.
This commit is contained in:
parent
e1ed736955
commit
dbad48245d
|
@ -2,7 +2,6 @@ package ee3.block;
|
|||
|
||||
import ee3.core.helper.LocalizationHelper;
|
||||
import ee3.lib.Reference;
|
||||
import ee3.lib.RenderIds;
|
||||
import net.minecraft.src.BlockStationary;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.Material;
|
||||
|
@ -29,9 +28,4 @@ public class BlockRedWaterStill extends BlockStationary {
|
|||
return Reference.SPRITE_SHEET_LOCATION + Reference.BLOCK_SPRITE_SHEET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.io.File;
|
|||
import java.util.HashMap;
|
||||
|
||||
import static ee3.lib.ItemIds.*;
|
||||
import static ee3.lib.BlockIds.*;
|
||||
import ee3.mod_EE3;
|
||||
import ee3.lib.Reference;
|
||||
|
||||
|
@ -38,6 +39,7 @@ public class ConfigurationManager {
|
|||
config.load();
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
config = null;
|
||||
}
|
||||
|
||||
|
@ -53,11 +55,8 @@ public class ConfigurationManager {
|
|||
ENABLE_PARTICLES = prop.getBoolean(false);
|
||||
|
||||
/* Block Ids */
|
||||
prop = config.getOrCreateBlockIdProperty("stone", 175);
|
||||
prop = config.getOrCreateBlockIdProperty("pedestal", 176);
|
||||
prop = config.getOrCreateBlockIdProperty("chest", 177);
|
||||
prop = config.getOrCreateBlockIdProperty("torch", 178);
|
||||
prop = config.getOrCreateBlockIdProperty("device", 179);
|
||||
prop = config.getOrCreateBlockIdProperty("redWater", 176);
|
||||
RED_WATER_STILL = prop.getInt();
|
||||
|
||||
/* Item Ids */
|
||||
prop = config.getOrCreateIntProperty("miniumShard", CATEGORY_ITEM, 27269);
|
||||
|
@ -72,15 +71,15 @@ public class ConfigurationManager {
|
|||
EYE_OF_THE_VOID = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("idolOfGaia", CATEGORY_ITEM, 27274);
|
||||
IDOL_OF_GAIA = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("luminator", CATEGORY_ITEM, 27275);
|
||||
LUMINATOR = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("pahisTempest", CATEGORY_ITEM, 27276);
|
||||
PAHIS_TEMPEST = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("umbralDisplacer", CATEGORY_ITEM, 27275);
|
||||
UMBRAL_DISPLACER = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("wikidsTempest", CATEGORY_ITEM, 27276);
|
||||
WIKIDS_TEMPEST = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("hornOfEverflowing", CATEGORY_ITEM, 27277);
|
||||
HORN_OF_EVERFLOWING = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("timelordsPocketWatch", CATEGORY_ITEM, 27278);
|
||||
TIMELORDS_POCKET_WATCH = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("caclinedAsh", CATEGORY_ITEM, 27279);
|
||||
prop = config.getOrCreateIntProperty("calcinedAsh", CATEGORY_ITEM, 27279);
|
||||
CALCINED_ASH = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("alchemicalCoal", CATEGORY_ITEM, 27280);
|
||||
ALCHEMICAL_COAL = prop.getInt();
|
||||
|
@ -102,23 +101,23 @@ public class ConfigurationManager {
|
|||
WOLF_BOOTS = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("darkMatter", CATEGORY_ITEM, 27289);
|
||||
DARK_MATTER = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Pickaxe", CATEGORY_ITEM, 27290);
|
||||
prop = config.getOrCreateIntProperty("dmPickaxe", CATEGORY_ITEM, 27290);
|
||||
DARK_MATTER_PICKAXE = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Shovel", CATEGORY_ITEM, 27291);
|
||||
prop = config.getOrCreateIntProperty("dmShovel", CATEGORY_ITEM, 27291);
|
||||
DARK_MATTER_SHOVEL = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Hoe", CATEGORY_ITEM, 27292);
|
||||
prop = config.getOrCreateIntProperty("dmHoe", CATEGORY_ITEM, 27292);
|
||||
DARK_MATTER_HOE = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Shears", CATEGORY_ITEM, 27292);
|
||||
prop = config.getOrCreateIntProperty("dmShears", CATEGORY_ITEM, 27292);
|
||||
DARK_MATTER_SHEARS = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Hammer", CATEGORY_ITEM, 27293);
|
||||
prop = config.getOrCreateIntProperty("dmHammer", CATEGORY_ITEM, 27293);
|
||||
DARK_MATTER_HAMMER = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Sword", CATEGORY_ITEM, 27294);
|
||||
prop = config.getOrCreateIntProperty("dmSword", CATEGORY_ITEM, 27294);
|
||||
DARK_MATTER_SWORD = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Bow", CATEGORY_ITEM, 27295);
|
||||
prop = config.getOrCreateIntProperty("dmBow", CATEGORY_ITEM, 27295);
|
||||
DARK_MATTER_BOW = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_FishingRod", CATEGORY_ITEM, 27296);
|
||||
prop = config.getOrCreateIntProperty("dmFishingRod", CATEGORY_ITEM, 27296);
|
||||
DARK_MATTER_FISHING_ROD = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("dm_Armor", CATEGORY_ITEM, 27297);
|
||||
prop = config.getOrCreateIntProperty("dmArmor", CATEGORY_ITEM, 27297);
|
||||
DARK_MATTER_ARMOR = prop.getInt();
|
||||
prop = config.getOrCreateIntProperty("wardOfXeno", CATEGORY_ITEM, 27297);
|
||||
WARD_OF_XENOPHOBIA = prop.getInt();
|
||||
|
|
|
@ -9,6 +9,7 @@ import ee3.lib.Reference;
|
|||
import net.minecraft.src.DamageSource;
|
||||
import net.minecraft.src.EntityLiving;
|
||||
import net.minecraft.src.EntityPlayer;
|
||||
import net.minecraft.src.ModLoader;
|
||||
import net.minecraft.src.Potion;
|
||||
import net.minecraft.src.PotionEffect;
|
||||
import net.minecraft.src.forge.adaptors.EntityLivingHandlerAdaptor;
|
||||
|
@ -32,11 +33,16 @@ public class EntityLivingHandler extends EntityLivingHandlerAdaptor {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onEntityLivingUpdate(EntityLiving entity) {
|
||||
if (Helper.handleRedWaterMovement(entity)) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, Reference.BLOCK_RED_WATER_EFFECT_DURATION * 20, 0));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.poison.id, Reference.BLOCK_RED_WATER_EFFECT_DURATION * 20, 0));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.blindness.id, Reference.BLOCK_RED_WATER_EFFECT_DURATION * 20, 0));
|
||||
public boolean onEntityLivingUpdate(EntityLiving entity) {
|
||||
if (entity.worldObj.getWorldTime() % 4 == 0) {
|
||||
if (Helper.handleRedWaterDetection(entity)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
entity.addPotionEffect(new PotionEffect(Potion.weakness.id, Reference.BLOCK_RED_WATER_EFFECT_DURATION_MODIFIER * Reference.BLOCK_RED_WATER_EFFECT_DURATION_BASE * Reference.SECOND_IN_TICKS, 0));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.poison.id, Reference.BLOCK_RED_WATER_EFFECT_DURATION_MODIFIER * Reference.BLOCK_RED_WATER_EFFECT_DURATION_BASE * Reference.SECOND_IN_TICKS, 0));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.blindness.id, Reference.BLOCK_RED_WATER_EFFECT_DURATION_MODIFIER * Reference.BLOCK_RED_WATER_EFFECT_DURATION_BASE * Reference.SECOND_IN_TICKS, 0));
|
||||
entity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, Reference.BLOCK_RED_WATER_EFFECT_DURATION_MODIFIER * Reference.BLOCK_RED_WATER_EFFECT_DURATION_BASE * Reference.SECOND_IN_TICKS, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -83,29 +83,29 @@ public class Helper {
|
|||
ModLoader.getLogger().finer(getLogMessage("No addons for loaded mods found"));
|
||||
}
|
||||
|
||||
public static boolean handleRedWaterMovement(EntityLiving entity) {
|
||||
return (isBlockInBB(entity.worldObj, entity.boundingBox.expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), ModBlocks.redWaterFlowing) || isBlockInBB(entity.worldObj, entity.boundingBox.expand(-0.10000000149011612D, -0.4000000059604645D, -0.10000000149011612D), ModBlocks.redWaterStill));
|
||||
public static boolean handleRedWaterDetection(EntityLiving entity) {
|
||||
return (isBlockInBB(entity.worldObj, entity.boundingBox, ModBlocks.redWaterFlowing)
|
||||
|| isBlockInBB(entity.worldObj, entity.boundingBox, ModBlocks.redWaterStill));
|
||||
}
|
||||
|
||||
public static boolean isBlockInBB(World world, AxisAlignedBB par1AxisAlignedBB, Block block) {
|
||||
int var3 = MathHelper.floor_double(par1AxisAlignedBB.minX);
|
||||
int var4 = MathHelper.floor_double(par1AxisAlignedBB.maxX + 1.0D);
|
||||
int var5 = MathHelper.floor_double(par1AxisAlignedBB.minY);
|
||||
int var6 = MathHelper.floor_double(par1AxisAlignedBB.maxY + 1.0D);
|
||||
int var7 = MathHelper.floor_double(par1AxisAlignedBB.minZ);
|
||||
int var8 = MathHelper.floor_double(par1AxisAlignedBB.maxZ + 1.0D);
|
||||
|
||||
for (int var9 = var3; var9 < var4; ++var9) {
|
||||
for (int var10 = var5; var10 < var6; ++var10) {
|
||||
for (int var11 = var7; var11 < var8; ++var11) {
|
||||
Block var12 = Block.blocksList[world.getBlockId(var9, var10, var11)];
|
||||
if (var12 != null && var12.blockID == block.blockID) {
|
||||
return true;
|
||||
int minX = MathHelper.floor_double(par1AxisAlignedBB.minX - Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
|
||||
int maxX = MathHelper.floor_double(par1AxisAlignedBB.maxX + Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
|
||||
int minY = MathHelper.floor_double(par1AxisAlignedBB.minY - Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
|
||||
int maxY = MathHelper.floor_double(par1AxisAlignedBB.maxY + Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
|
||||
int minZ = MathHelper.floor_double(par1AxisAlignedBB.minZ - Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
|
||||
int maxZ = MathHelper.floor_double(par1AxisAlignedBB.maxZ + Reference.BLOCK_RED_WATER_RANGE_BASE * Reference.BLOCK_RED_WATER_RANGE_MODIFIER * 1.0D);
|
||||
|
||||
for (int i = minX; i < maxX; ++i) {
|
||||
for (int j = minY; j < maxY; ++j) {
|
||||
for (int k = minZ; k < maxZ; ++k) {
|
||||
Block currentBlock = Block.blocksList[world.getBlockId(i, j, k)];
|
||||
if (currentBlock != null && currentBlock.blockID == block.blockID) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ package ee3.lib;
|
|||
*/
|
||||
public class BlockIds {
|
||||
|
||||
public static int RED_WATER_FLOWING = 250;
|
||||
public static int RED_WATER_STILL = 251;
|
||||
public static int RED_WATER_STILL;
|
||||
|
||||
}
|
||||
|
|
|
@ -7,14 +7,14 @@ package ee3.lib;
|
|||
*
|
||||
*/
|
||||
public class ItemIds {
|
||||
public static int MINIUM_SHARD = 27269;
|
||||
public static int MINIUM_STONE = 27270;
|
||||
public static int PHIL_STONE = 27271;
|
||||
public static int MINIUM_SHARD;
|
||||
public static int MINIUM_STONE;
|
||||
public static int PHIL_STONE;
|
||||
public static int DJINN_RING;
|
||||
public static int EYE_OF_THE_VOID;
|
||||
public static int IDOL_OF_GAIA;
|
||||
public static int LUMINATOR;
|
||||
public static int PAHIS_TEMPEST;
|
||||
public static int UMBRAL_DISPLACER;
|
||||
public static int WIKIDS_TEMPEST;
|
||||
public static int HORN_OF_EVERFLOWING;
|
||||
public static int TIMELORDS_POCKET_WATCH;
|
||||
public static int WARD_OF_XENOPHOBIA;
|
||||
|
|
|
@ -25,6 +25,8 @@ public class Reference {
|
|||
public static final String SOUND_PREFIX = "ee3.sound.";
|
||||
public static final String LANG_RESOURCE_LOCATION = "/ee3/lang/";
|
||||
|
||||
public static final int SECOND_IN_TICKS = 20;
|
||||
|
||||
public static final int MINIUM_STONE_DURABILITY = 1531;
|
||||
public static final int MINIUM_STONE_TRANSMUTE_COST = 4;
|
||||
|
||||
|
@ -32,5 +34,8 @@ public class Reference {
|
|||
public static final String ITEM_NAME_MINIUM_STONE = "item.name.minium_stone";
|
||||
public static final String ITEM_NAME_PHILOSOPHERS_STONE = "item.name.philosophers_stone";
|
||||
|
||||
public static final int BLOCK_RED_WATER_EFFECT_DURATION = 30;
|
||||
public static final int BLOCK_RED_WATER_EFFECT_DURATION_BASE = 5;
|
||||
public static final int BLOCK_RED_WATER_EFFECT_DURATION_MODIFIER = 1;
|
||||
public static final int BLOCK_RED_WATER_RANGE_BASE = 1;
|
||||
public static final int BLOCK_RED_WATER_RANGE_MODIFIER = 1;
|
||||
}
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
package ee3.lib;
|
||||
|
||||
import ee3.mod_EE3;
|
||||
import net.minecraft.src.ModLoader;
|
||||
|
||||
/**
|
||||
* TODO Class Description
|
||||
* @author pahimar
|
||||
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
|
||||
*
|
||||
*/
|
||||
public class RenderIds {
|
||||
|
||||
public static int RED_WATER_MODEL;
|
||||
|
||||
|
||||
public static void init() {
|
||||
RED_WATER_MODEL = ModLoader.getUniqueBlockModelID(mod_EE3.instance(), false);
|
||||
}
|
||||
}
|
|
@ -13,7 +13,6 @@ import ee3.gui.GuiHandler;
|
|||
import ee3.item.ModItems;
|
||||
import ee3.lib.ItemIds;
|
||||
import ee3.lib.Reference;
|
||||
import ee3.lib.RenderIds;
|
||||
import ee3.lib.Sounds;
|
||||
import ee3.lib.Version;
|
||||
import ee3.network.PacketHandler;
|
||||
|
@ -77,9 +76,6 @@ public class mod_EE3 extends NetworkMod {
|
|||
// Pre-load Textures
|
||||
this.proxy.preloadTextures();
|
||||
|
||||
// Initialise the render models
|
||||
RenderIds.init();
|
||||
|
||||
// Initialise the mod blocks
|
||||
ModBlocks.init();
|
||||
|
||||
|
|
Loading…
Reference in a new issue