mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -4,99 +4,82 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MetalSlime extends BlueSlime
|
||||
{
|
||||
public class MetalSlime extends BlueSlime {
|
||||
|
||||
public MetalSlime(World world)
|
||||
{
|
||||
public MetalSlime(World world) {
|
||||
super(world);
|
||||
// this.texture = "/mods/tinker/textures/mob/slimemetal.png";
|
||||
this.setHealth(getMaxHealthForSize());
|
||||
}
|
||||
|
||||
public boolean attackEntityFrom (DamageSource damageSource, int damage)
|
||||
{
|
||||
if (!damageSource.isExplosion() && damageSource.isProjectile())
|
||||
return false;
|
||||
public boolean attackEntityFrom(DamageSource damageSource, int damage) {
|
||||
if (!damageSource.isExplosion() && damageSource.isProjectile()) return false;
|
||||
return super.attackEntityFrom(damageSource, damage);
|
||||
}
|
||||
|
||||
// Invoked by constructor to set max health dependant on current size
|
||||
protected float getMaxHealthForSize ()
|
||||
{
|
||||
protected float getMaxHealthForSize() {
|
||||
int i = this.getSlimeSize();
|
||||
if (i == 1)
|
||||
return 4;
|
||||
if (i == 1) return 4;
|
||||
return (float) Math.min(i * i + 20, 100);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTotalArmorValue ()
|
||||
{
|
||||
public int getTotalArmorValue() {
|
||||
return super.getTotalArmorValue() + 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDead ()
|
||||
{
|
||||
public void setDead() {
|
||||
this.isDead = true;
|
||||
}
|
||||
|
||||
/*
|
||||
* protected void dropFewItems (boolean par1, int par2) { int j =
|
||||
* this.getDropItemId();
|
||||
*
|
||||
*
|
||||
* if (j > 0) { int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize());
|
||||
*
|
||||
*
|
||||
* if (par2 > 0) { k += this.rand.nextInt(par2 + 1); }
|
||||
*
|
||||
*
|
||||
* for (int l = 0; l < k; ++l) { this.dropItem(j, 1); } } }
|
||||
*/
|
||||
|
||||
@Override
|
||||
protected void updateEntityActionState ()
|
||||
{
|
||||
protected void updateEntityActionState() {
|
||||
this.despawnEntity();
|
||||
EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);
|
||||
|
||||
if (entityplayer != null)
|
||||
{
|
||||
if (entityplayer != null) {
|
||||
this.faceEntity(entityplayer, 10.0F, 20.0F);
|
||||
}
|
||||
else if (this.onGround && this.slimeJumpDelay == 1)
|
||||
{
|
||||
} else if (this.onGround && this.slimeJumpDelay == 1) {
|
||||
this.rotationYaw = this.rotationYaw + rand.nextFloat() * 180 - 90;
|
||||
if (rotationYaw > 360)
|
||||
rotationYaw -= 360;
|
||||
if (rotationYaw < 0)
|
||||
rotationYaw += 360;
|
||||
if (rotationYaw > 360) rotationYaw -= 360;
|
||||
if (rotationYaw < 0) rotationYaw += 360;
|
||||
}
|
||||
|
||||
if (this.onGround && this.slimeJumpDelay-- <= 0)
|
||||
{
|
||||
if (this.onGround && this.slimeJumpDelay-- <= 0) {
|
||||
this.slimeJumpDelay = this.getJumpDelay();
|
||||
|
||||
if (entityplayer != null)
|
||||
{
|
||||
if (entityplayer != null) {
|
||||
this.slimeJumpDelay /= 3;
|
||||
}
|
||||
|
||||
this.isJumping = true;
|
||||
|
||||
if (this.makesSoundOnJump())
|
||||
{
|
||||
this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||
if (this.makesSoundOnJump()) {
|
||||
this.playSound(
|
||||
this.getJumpSound(),
|
||||
this.getSoundVolume(),
|
||||
((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F);
|
||||
}
|
||||
|
||||
this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F;
|
||||
this.moveForward = (float) (1 * this.getSlimeSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.isJumping = false;
|
||||
|
||||
if (this.onGround)
|
||||
{
|
||||
if (this.onGround) {
|
||||
this.moveStrafing = this.moveForward = 0.0F;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user