aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java20
-rw-r--r--src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java4
-rw-r--r--src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java3
-rw-r--r--src/Java/gtPlusPlus/core/lib/LoadedMods.java6
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java12
5 files changed, 39 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java b/src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java
index 7ec418cbb1..55e0f4c571 100644
--- a/src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java
+++ b/src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java
@@ -18,6 +18,7 @@ import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAIWander;
+import net.minecraft.entity.ai.RandomPositionGenerator;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.entity.player.EntityPlayer;
@@ -66,7 +67,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob {
//this.tasks.addTask(6, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
- this.targetTasks.addTask(2, this.aiAttack);
+ //this.targetTasks.addTask(2, this.aiAttack);
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityBat.class, 0, false));
@@ -123,7 +124,7 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob {
* colliding.
*/
public boolean canBePushed() {
- return false;
+ return true;
}
protected void collideWithEntity(Entity aEntity) {
@@ -145,10 +146,10 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob {
this.getAttributeMap().registerAttribute(SharedMonsterAttributes.movementSpeed);
this.getAttributeMap().registerAttribute(SharedMonsterAttributes.followRange);
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(60.0D);
+ this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(250.0D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
- this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D);
+ this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1D);
+ this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(120.0D);
}
public boolean getIsBatHanging() {
@@ -215,6 +216,15 @@ public class EntityBatKing extends EntityMob implements IRangedAttackMob {
}
}
+ else {
+ Vec3 vec3 = RandomPositionGenerator.findRandomTarget(this, 32, 20);
+ if (vec3 != null) {
+ double xPosition = vec3.xCoord;
+ double yPosition = vec3.yCoord;
+ double zPosition = vec3.zCoord;
+ this.getNavigator().tryMoveToXYZ(xPosition, yPosition, zPosition, 3);
+ }
+ }
}
}
diff --git a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
index d6a24d718a..b7efcf08ea 100644
--- a/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
+++ b/src/Java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java
@@ -13,6 +13,7 @@ import gtPlusPlus.xmod.gregtech.HANDLER_GT;
import gtPlusPlus.xmod.growthcraft.HANDLER_GC;
import gtPlusPlus.xmod.ic2.HANDLER_IC2;
import gtPlusPlus.xmod.railcraft.HANDLER_Railcraft;
+import gtPlusPlus.xmod.reliquary.HANDLER_Reliquary;
import gtPlusPlus.xmod.sc2.HANDLER_SC2;
import gtPlusPlus.xmod.thaumcraft.HANDLER_Thaumcraft;
import gtPlusPlus.xmod.thermalfoundation.HANDLER_TF;
@@ -35,6 +36,7 @@ public class COMPAT_IntermodStaging {
HANDLER_GalactiCraft.preInit();
HANDLER_CropsPlusPlus.preInit(preinit);
HANDLER_Railcraft.preInit();
+ HANDLER_Reliquary.preInit();
}
public static void init(FMLInitializationEvent init){
@@ -52,6 +54,7 @@ public class COMPAT_IntermodStaging {
HANDLER_GalactiCraft.init();
HANDLER_CropsPlusPlus.init(init);
HANDLER_Railcraft.init();
+ HANDLER_Reliquary.init();
}
public static void postInit(FMLPostInitializationEvent postinit){
@@ -69,6 +72,7 @@ public class COMPAT_IntermodStaging {
HANDLER_GalactiCraft.postInit();
HANDLER_CropsPlusPlus.postInit(postinit);
HANDLER_Railcraft.postInit();
+ HANDLER_Reliquary.postInit();
}
public static void onLoadComplete(FMLLoadCompleteEvent event) {
diff --git a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
index 04467091c0..3c7ea9d2c9 100644
--- a/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
+++ b/src/Java/gtPlusPlus/core/item/bauble/FireProtectionBauble.java
@@ -11,6 +11,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
import gtPlusPlus.core.creative.AddToCreativeTab;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.reflect.ReflectionUtils;
+import gtPlusPlus.preloader.DevHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@@ -28,7 +29,7 @@ public class FireProtectionBauble extends BaseBauble {
private static Field isImmuneToFire;
static {
- isImmuneToFire = ReflectionUtils.getField(Entity.class, "isImmuneToFire");
+ isImmuneToFire = ReflectionUtils.getField(Entity.class, DevHelper.IsObfuscatedEnvironment() ? "func_70045_F" : "isImmuneToFire");
}
public static boolean fireImmune(Entity aEntity) {
diff --git a/src/Java/gtPlusPlus/core/lib/LoadedMods.java b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
index 5a2b75337b..d96875b811 100644
--- a/src/Java/gtPlusPlus/core/lib/LoadedMods.java
+++ b/src/Java/gtPlusPlus/core/lib/LoadedMods.java
@@ -55,6 +55,7 @@ public class LoadedMods {
public static boolean Witchery = false;
public static boolean Waila = false;
public static boolean CropsPlusPlus = false; //Barts Crop Mod
+ public static boolean Reliquary = false;
@@ -102,6 +103,11 @@ public class LoadedMods {
Logger.INFO("Components enabled for: Crops++");
totalMods++;
}
+ if (Loader.isModLoaded("xreliquary")) {
+ Reliquary = true;
+ Logger.INFO("Components enabled for: Reliquary");
+ totalMods++;
+ }
if (Loader.isModLoaded("TConstruct")){
TiCon = true;
Logger.INFO("Components enabled for: Tinkers Construct");
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index efc86122e2..19e42735d7 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -813,5 +813,17 @@ public class ReflectionUtils {
return false;
}
+ public static Object getFieldValue(Field field) {
+ return getFieldValue(field, null);
+ }
+
+ public static Object getFieldValue(Field field, Object instance) {
+ try {
+ return field.get(instance);
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ }
+ return null;
+ }
+
}