diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-01-29 05:13:11 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-01-29 05:13:11 +0000 |
commit | 222fbc044f89a2d272f0bace58c28db1e6927e0f (patch) | |
tree | 19a16783690890d374ec6af5814b1d067eda3d97 /src/Java/gtPlusPlus/core/entity | |
parent | 22c6a05a8a3a00294bcb8890a1e2a0fdc9196de8 (diff) | |
download | GT5-Unofficial-222fbc044f89a2d272f0bace58c28db1e6927e0f.tar.gz GT5-Unofficial-222fbc044f89a2d272f0bace58c28db1e6927e0f.tar.bz2 GT5-Unofficial-222fbc044f89a2d272f0bace58c28db1e6927e0f.zip |
+ Added Super Busses.
+ Added Breaker Boxes.
+ Added Super Jukebox. (framework)
+ Added King Bat. (framework)
+ Added Custom WAILA plugin. (framework)
+ Added lots of simple function calls to CI. (Recipe simplification)
% Rewrote the recipes for Wireless Chargers, they now require assembly.
% Cleaned up some old code.
$ Adjusted bug with pollution scrubbers using no durability and removing LOTS of pollution.
$ Greatly improved code base for pollution scrubbers.
$ Added pollution back to the Cyclotron.
Diffstat (limited to 'src/Java/gtPlusPlus/core/entity')
-rw-r--r-- | src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java | 2 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java | 228 |
2 files changed, 230 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java index f130a1f936..36f5b86184 100644 --- a/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java +++ b/src/Java/gtPlusPlus/core/entity/InternalEntityRegistry.java @@ -8,6 +8,7 @@ import gtPlusPlus.australia.entity.type.EntityAustralianSpiderBase; import gtPlusPlus.australia.entity.type.EntityBoar; import gtPlusPlus.australia.entity.type.EntityDingo; import gtPlusPlus.australia.entity.type.EntityOctopus; +import gtPlusPlus.core.entity.monster.EntityBatKing; import gtPlusPlus.core.entity.monster.EntityGiantChickenBase; import gtPlusPlus.core.entity.monster.EntitySickBlaze; import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct; @@ -55,6 +56,7 @@ public class InternalEntityRegistry { */ EntityRegistry.registerGlobalEntityID(EntityGiantChickenBase.class, "bigChickenFriendly", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(255, 0, 0), Utils.rgbtoHexValue(175, 175, 175)); + EntityRegistry.registerGlobalEntityID(EntityBatKing.class, "batKing", EntityRegistry.findGlobalUniqueEntityId(), Utils.rgbtoHexValue(175, 175, 0), Utils.rgbtoHexValue(0, 175, 175)); //EntityRegistry.registerModEntity(EntityGiantChickenBase.class, "bigChickenFriendly", mEntityID++, GTplusplus.instance, 64, 20, true); diff --git a/src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java b/src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java new file mode 100644 index 0000000000..114ca50b4b --- /dev/null +++ b/src/Java/gtPlusPlus/core/entity/monster/EntityBatKing.java @@ -0,0 +1,228 @@ +package gtPlusPlus.core.entity.monster; + +import java.util.Calendar; +import net.minecraft.entity.Entity; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class EntityBatKing extends EntityBat +{ + /** Coordinates of where the bat spawned. */ + private ChunkCoordinates spawnPosition; + + public EntityBatKing(World p_i1680_1_) + { + super(p_i1680_1_); + this.setSize(2F, 3.6F); + this.setIsBatHanging(false); + } + + protected void entityInit() + { + super.entityInit(); + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume() + { + return 0.3F; + } + + /** + * Gets the pitch of living sounds in living entities. + */ + protected float getSoundPitch() + { + return super.getSoundPitch() * 0.35F; + } + + /** + * Returns the sound this mob makes while it's alive. + */ + protected String getLivingSound() + { + return this.getIsBatHanging() && this.rand.nextInt(4) != 0 ? null : "mob.bat.idle"; + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound() + { + return "mob.bat.hurt"; + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound() + { + return "mob.bat.death"; + } + + /** + * Returns true if this entity should push and be pushed by other entities when colliding. + */ + public boolean canBePushed() + { + return false; + } + + protected void collideWithEntity(Entity p_82167_1_) {} + + protected void collideWithNearbyEntities() {} + + protected void applyEntityAttributes() + { + super.applyEntityAttributes(); + this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(60.0D); + } + + public boolean getIsBatHanging() + { + return (this.dataWatcher.getWatchableObjectByte(16) & 1) != 0; + } + + public void setIsBatHanging(boolean p_82236_1_) + { + byte b0 = this.dataWatcher.getWatchableObjectByte(16); + + if (p_82236_1_) + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 | 1))); + } + else + { + this.dataWatcher.updateObject(16, Byte.valueOf((byte)(b0 & -2))); + } + } + + /** + * Returns true if the newer Entity AI code should be run + */ + protected boolean isAIEnabled() + { + return true; + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate() + { + super.onUpdate(); + } + + protected void updateAITasks() + { + super.updateAITasks(); + + } + + /** + * returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to + * prevent them from trampling crops + */ + protected boolean canTriggerWalking() + { + return false; + } + + /** + * Called when the mob is falling. Calculates and applies fall damage. + */ + protected void fall(float p_70069_1_) {} + + /** + * Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance + * and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround + */ + protected void updateFallState(double p_70064_1_, boolean p_70064_3_) {} + + /** + * Return whether this entity should NOT trigger a pressure plate or a tripwire. + */ + public boolean doesEntityNotTriggerPressurePlate() + { + return true; + } + + /** + * Called when the entity is attacked. + */ + public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_) + { + if (this.isEntityInvulnerable()) + { + return false; + } + else + { + if (!this.worldObj.isRemote && this.getIsBatHanging()) + { + this.setIsBatHanging(false); + } + + return super.attackEntityFrom(p_70097_1_, p_70097_2_); + } + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT(NBTTagCompound p_70037_1_) + { + super.readEntityFromNBT(p_70037_1_); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT(NBTTagCompound p_70014_1_) + { + super.writeEntityToNBT(p_70014_1_); + } + + /** + * Checks if the entity's current position is a valid location to spawn this entity. + */ + public boolean getCanSpawnHere() + { + int i = MathHelper.floor_double(this.boundingBox.minY); + + if (i >= 63) + { + return false; + } + else + { + int j = MathHelper.floor_double(this.posX); + int k = MathHelper.floor_double(this.posZ); + int l = this.worldObj.getBlockLightValue(j, i, k); + byte b0 = 4; + Calendar calendar = this.worldObj.getCurrentDate(); + + if ((calendar.get(2) + 1 != 10 || calendar.get(5) < 20) && (calendar.get(2) + 1 != 11 || calendar.get(5) > 3)) + { + if (this.rand.nextBoolean()) + { + return false; + } + } + else + { + b0 = 7; + } + + return l > this.rand.nextInt(b0) ? false : super.getCanSpawnHere(); + } + } +}
\ No newline at end of file |