...
 
Commits (4)
......@@ -58,12 +58,14 @@ public class ChairBlock extends HorizontalBlock implements IWaterLoggable
}
@SuppressWarnings("deprecation")
@Override
public IFluidState getFluidState(BlockState state)
{
return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
}
@SuppressWarnings("deprecation")
@Override
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos)
{
if (stateIn.get(WATERLOGGED))
......@@ -74,6 +76,7 @@ public class ChairBlock extends HorizontalBlock implements IWaterLoggable
return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context)
{
BlockPos blockpos = context.getPos();
......@@ -91,6 +94,7 @@ public class ChairBlock extends HorizontalBlock implements IWaterLoggable
}
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
{
builder.add(FACING, WATERLOGGED);
......
......@@ -12,6 +12,7 @@ import net.minecraft.world.gen.feature.TreeFeature;
public class CherryTree extends Tree
{
@Nullable
@Override
protected AbstractTreeFeature<NoFeatureConfig> getTreeFeature(Random random)
{
return new TreeFeature(NoFeatureConfig::deserialize, false, 4, RediscoveredBlocks.cherry_log.getDefaultState(), RediscoveredBlocks.cherry_leaves.getDefaultState(), false);
......
......@@ -26,11 +26,13 @@ public class RedDragonEggBlock extends FallingBlock
super(properties);
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
{
return SHAPE;
}
@Override
public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit)
{
worldIn.destroyBlock(pos, false);
......@@ -42,11 +44,13 @@ public class RedDragonEggBlock extends FallingBlock
return true;
}
@Override
public int tickRate(IWorldReader worldIn)
{
return 5;
}
@Override
public boolean allowsMovement(BlockState state, IBlockReader worldIn, BlockPos pos, PathType type)
{
return false;
......
......@@ -131,9 +131,9 @@ public class RediscoveredBlocks
red_dragon_egg = register("red_dragon_egg", new RedDragonEggBlock(Block.Properties.from(Blocks.DRAGON_EGG)));
potted_rose = registerBlock("potted_rose", new RediscoveredFlowerPotBlock(rose));
potted_paeonia = registerBlock("potted_paeonia", new RediscoveredFlowerPotBlock(paeonia));
potted_cherry_sapling = registerBlock("potted_cherry_sapling", new RediscoveredFlowerPotBlock(cherry_sapling));
potted_rose = registerBlock("potted_rose", new RediscoveredFlowerPotBlock(() -> rose.delegate.get()));
potted_paeonia = registerBlock("potted_paeonia", new RediscoveredFlowerPotBlock(() -> paeonia.delegate.get()));
potted_cherry_sapling = registerBlock("potted_cherry_sapling", new RediscoveredFlowerPotBlock(() -> cherry_sapling.delegate.get()));
}
public static void setBlockRegistry(IForgeRegistry<Block> iBlockRegistry)
......
package com.legacy.rediscovered.block;
import java.util.function.Supplier;
import javax.annotation.Nullable;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.FlowerPotBlock;
import net.minecraft.block.material.Material;
@SuppressWarnings("deprecation")
public class RediscoveredFlowerPotBlock extends FlowerPotBlock
{
public RediscoveredFlowerPotBlock(Block blockIn)
public RediscoveredFlowerPotBlock(@Nullable Supplier<FlowerPotBlock> emptyPot, Supplier<? extends Block> flower, Block.Properties properties)
{
super(emptyPot, flower, properties);
((FlowerPotBlock) Blocks.FLOWER_POT).addPlant(flower.get().getRegistryName(), () -> this);
}
public RediscoveredFlowerPotBlock(Supplier<? extends Block> flower, Block.Properties properties)
{
super(blockIn, Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0.0F));
this(() -> (FlowerPotBlock) Blocks.FLOWER_POT.delegate.get(), flower, properties);
}
public RediscoveredFlowerPotBlock(Block.Properties properties, Block blockIn)
public RediscoveredFlowerPotBlock(java.util.function.Supplier<? extends Block> flower)
{
super(blockIn, properties);
this(flower, Block.Properties.create(Material.MISCELLANEOUS).hardnessAndResistance(0.0F));
}
}
......@@ -41,6 +41,7 @@ public class SpikeBlock extends DirectionalBlock implements IWaterLoggable
this.setDefaultState(this.stateContainer.getBaseState().with(FACING, Direction.NORTH).with(WATERLOGGED, false));
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context)
{
switch ((Direction) state.get(FACING))
......@@ -61,44 +62,51 @@ public class SpikeBlock extends DirectionalBlock implements IWaterLoggable
}
}
@Override
public boolean causesSuffocation(BlockState state, IBlockReader worldIn, BlockPos pos)
{
return false;
}
@Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos)
{
return true;
}
@Override
public void onEntityCollision(BlockState state, World worldIn, BlockPos pos, Entity entityIn)
{
if (entityIn instanceof LivingEntity)
{
if (!worldIn.isRemote)
{
entityIn.attackEntityFrom(DamageSource.SWEET_BERRY_BUSH, 3.0F);
entityIn.attackEntityFrom(DamageSource.GENERIC, 3.0F);
}
}
}
@Override
public BlockRenderLayer getRenderLayer()
{
return BlockRenderLayer.CUTOUT_MIPPED;
}
@Override
public boolean isNormalCube(BlockState state, IBlockReader worldIn, BlockPos pos)
{
return false;
}
@SuppressWarnings("deprecation")
@Override
public IFluidState getFluidState(BlockState state)
{
return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
}
@SuppressWarnings("deprecation")
@Override
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos)
{
if (stateIn.get(WATERLOGGED))
......@@ -108,6 +116,7 @@ public class SpikeBlock extends DirectionalBlock implements IWaterLoggable
return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
}
@Override
public BlockState getStateForPlacement(BlockItemUseContext context)
{
BlockPos blockpos = context.getPos();
......@@ -124,21 +133,25 @@ public class SpikeBlock extends DirectionalBlock implements IWaterLoggable
}
}
@Override
public BlockState rotate(BlockState state, Rotation rot)
{
return state.with(FACING, rot.rotate(state.get(FACING)));
}
@Override
public BlockState mirror(BlockState state, Mirror mirrorIn)
{
return state.rotate(mirrorIn.toRotation(state.get(FACING)));
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
{
builder.add(FACING, WATERLOGGED);
}
@Override
public boolean allowsMovement(BlockState state, IBlockReader worldIn, BlockPos pos, PathType type)
{
return false;
......
......@@ -34,12 +34,14 @@ public class TableBlock extends Block
}
@SuppressWarnings("deprecation")
@Override
public IFluidState getFluidState(BlockState state)
{
return state.get(WATERLOGGED) ? Fluids.WATER.getStillFluidState(false) : super.getFluidState(state);
}
@SuppressWarnings("deprecation")
@Override
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn, BlockPos currentPos, BlockPos facingPos)
{
if (stateIn.get(WATERLOGGED))
......@@ -66,6 +68,7 @@ public class TableBlock extends Block
}
}
@Override
protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder)
{
builder.add(WATERLOGGED);
......
......@@ -43,6 +43,7 @@ public class BeastBoyEntity extends MonsterEntity
super(type, world);
}
@Override
protected void registerGoals()
{
this.goalSelector.addGoal(0, new SwimGoal(this));
......@@ -64,16 +65,19 @@ public class BeastBoyEntity extends MonsterEntity
}
}
@Override
public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
{
return super.onInitialSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag);
}
@Override
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
{
return 1.60F;
}
@Override
protected void registerAttributes()
{
super.registerAttributes();
......@@ -81,6 +85,7 @@ public class BeastBoyEntity extends MonsterEntity
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
}
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return super.attackEntityAsMob(entityIn);
......@@ -92,21 +97,25 @@ public class BeastBoyEntity extends MonsterEntity
super.tick();
}
@Override
protected SoundEvent getAmbientSound()
{
return null;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return super.getHurtSound(damageSourceIn);
}
@Override
protected SoundEvent getDeathSound()
{
return super.getDeathSound();
}
@Override
public boolean preventDespawn()
{
return true;
......
......@@ -43,6 +43,7 @@ public class BlackSteveEntity extends MonsterEntity
super(type, world);
}
@Override
protected void registerGoals()
{
this.goalSelector.addGoal(0, new SwimGoal(this));
......@@ -64,16 +65,19 @@ public class BlackSteveEntity extends MonsterEntity
}
}
@Override
public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
{
return super.onInitialSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag);
}
@Override
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
{
return 1.60F;
}
@Override
protected void registerAttributes()
{
super.registerAttributes();
......@@ -81,6 +85,7 @@ public class BlackSteveEntity extends MonsterEntity
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
}
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return super.attackEntityAsMob(entityIn);
......@@ -92,21 +97,25 @@ public class BlackSteveEntity extends MonsterEntity
super.tick();
}
@Override
protected SoundEvent getAmbientSound()
{
return null;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return super.getHurtSound(damageSourceIn);
}
@Override
protected SoundEvent getDeathSound()
{
return super.getDeathSound();
}
@Override
public boolean preventDespawn()
{
return true;
......
......@@ -17,26 +17,31 @@ public class FishEntity extends AbstractGroupFishEntity
super(type, world);
}
@Override
protected ItemStack getFishBucket()
{
return new ItemStack(RediscoveredItems.fish_bucket);
}
@Override
protected SoundEvent getAmbientSound()
{
return SoundEvents.ENTITY_COD_AMBIENT;
}
@Override
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_COD_DEATH;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_COD_HURT;
}
@Override
protected SoundEvent getFlopSound()
{
return SoundEvents.ENTITY_COD_FLOP;
......
......@@ -35,26 +35,31 @@ public class PurpleArrowEntity extends AbstractArrowEntity
this(RediscoveredEntityTypes.PURPLE_ARROW, world);
}
@Override
public void tick()
{
super.tick();
}
@Override
protected ItemStack getArrowStack()
{
return new ItemStack(RediscoveredItems.purple_arrow);
}
@Override
protected void arrowHit(LivingEntity living)
{
super.arrowHit(living);
}
@Override
public void readAdditional(CompoundNBT compound)
{
super.readAdditional(compound);
}
@Override
public void writeAdditional(CompoundNBT compound)
{
super.writeAdditional(compound);
......
......@@ -37,6 +37,7 @@ public class RanaEntity extends CreatureEntity
((GroundPathNavigator) this.getNavigator()).setBreakDoors(true);
}
@Override
protected void registerGoals()
{
this.goalSelector.addGoal(0, new SwimGoal(this));
......@@ -46,16 +47,19 @@ public class RanaEntity extends CreatureEntity
this.goalSelector.addGoal(7, new LookRandomlyGoal(this));
}
@Override
public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
{
return super.onInitialSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag);
}
@Override
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
{
return 1.60F;
}
@Override
protected void registerAttributes()
{
super.registerAttributes();
......@@ -63,6 +67,7 @@ public class RanaEntity extends CreatureEntity
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return super.attackEntityAsMob(entityIn);
......@@ -74,21 +79,25 @@ public class RanaEntity extends CreatureEntity
super.tick();
}
@Override
protected SoundEvent getAmbientSound()
{
return null;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return super.getHurtSound(damageSourceIn);
}
@Override
protected SoundEvent getDeathSound()
{
return super.getDeathSound();
}
@Override
public boolean preventDespawn()
{
return true;
......
......@@ -75,20 +75,20 @@ public class ScarecrowEntity extends LivingEntity
return !this.hasMarker() && !this.hasNoGravity();
}
/**
* Returns whether the entity is in a server world
*/
@Override
public boolean isServerWorld()
{
return super.isServerWorld() && this.func_213814_A();
}
@Override
protected void registerData()
{
super.registerData();
this.dataManager.register(STATUS, (byte) 0);
}
@Override
public void writeAdditional(CompoundNBT compound)
{
super.writeAdditional(compound);
......@@ -102,9 +102,7 @@ public class ScarecrowEntity extends LivingEntity
}
}
/**
* (abstract) Protected helper method to read subclass entity data from NBT.
*/
@Override
public void readAdditional(CompoundNBT compound)
{
super.readAdditional(compound);
......@@ -115,15 +113,18 @@ public class ScarecrowEntity extends LivingEntity
this.noClip = !this.func_213814_A();
}
@Override
public boolean canBePushed()
{
return false;
}
@Override
protected void collideWithEntity(Entity entityIn)
{
}
@Override
protected void collideWithNearbyEntities()
{
List<Entity> list = this.world.getEntitiesInAABBexcluding(this, this.getBoundingBox(), IS_RIDEABLE_MINECART);
......@@ -139,10 +140,10 @@ public class ScarecrowEntity extends LivingEntity
}
@SuppressWarnings("deprecation")
@Override
public boolean attackEntityFrom(DamageSource source, float amount)
{
if (!this.world.isRemote && !this.removed)
if (!this.world.isRemote && this.isAlive())
{
if (DamageSource.OUT_OF_WORLD.equals(source))
{
......@@ -232,9 +233,6 @@ public class ScarecrowEntity extends LivingEntity
}
}
/**
* Handler for {@link World#setEntityState}
*/
@OnlyIn(Dist.CLIENT)
public void handleStatusUpdate(byte id)
{
......@@ -253,9 +251,6 @@ public class ScarecrowEntity extends LivingEntity
}
/**
* Checks if the entity is in range to render.
*/
@OnlyIn(Dist.CLIENT)
public boolean isInRangeToRenderDist(double distance)
{
......@@ -354,6 +349,7 @@ public class ScarecrowEntity extends LivingEntity
this.prevRotationYawHead = this.rotationYawHead = rotation;
}
@Override
public void tick()
{
super.tick();
......
......@@ -43,6 +43,7 @@ public class SteveEntity extends CreatureEntity
super(type, world);
}
@Override
protected void registerGoals()
{
this.goalSelector.addGoal(0, new SwimGoal(this));
......@@ -64,16 +65,19 @@ public class SteveEntity extends CreatureEntity
}
}
@Override
public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
{
return super.onInitialSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag);
}
@Override
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
{
return 1.60F;
}
@Override
protected void registerAttributes()
{
super.registerAttributes();
......@@ -83,6 +87,7 @@ public class SteveEntity extends CreatureEntity
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.3D);
}
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return super.attackEntityAsMob(entityIn);
......@@ -94,21 +99,25 @@ public class SteveEntity extends CreatureEntity
super.tick();
}
@Override
protected SoundEvent getAmbientSound()
{
return null;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return super.getHurtSound(damageSourceIn);
}
@Override
protected SoundEvent getDeathSound()
{
return super.getDeathSound();
}
@Override
public boolean preventDespawn()
{
return true;
......
......@@ -89,11 +89,13 @@ public class PigmanEntity extends AbstractVillagerEntity
this.brain = this.createBrain(new Dynamic<>(NBTDynamicOps.INSTANCE, new CompoundNBT()));
}
@Override
protected void registerGoals()
{
super.registerGoals();
}
@Override
protected void onGrowingAdult()
{
super.onGrowingAdult();
......@@ -104,16 +106,19 @@ public class PigmanEntity extends AbstractVillagerEntity
}
}
@Override
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
{
return this.isChild() ? 0.85F : 1.80F;
}
@Override
public boolean canDespawn(double distanceToClosestPlayer)
{
return false;
}
@Override
protected void registerAttributes()
{
super.registerAttributes();
......@@ -191,28 +196,33 @@ public class PigmanEntity extends AbstractVillagerEntity
super.updateAITasks();
}
@Override
protected SoundEvent getAmbientSound()
{
return this.isSleeping() ? null : SoundEvents.ENTITY_PIG_AMBIENT;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_PIG_HURT;
}
@Override
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_PIG_DEATH;
}
public SoundEvent func_213714_ea()
@Override
public SoundEvent getYesSound()
{
this.playSound(SoundEvents.ENTITY_PIG_AMBIENT, this.getSoundVolume(), 1.3F);
return null;
}
protected SoundEvent func_213721_r(boolean positive)
@Override
protected SoundEvent getVillagerYesNoSound(boolean positive)
{
if (positive)
{
......@@ -226,6 +236,7 @@ public class PigmanEntity extends AbstractVillagerEntity
return null;
}
@Override
protected void playStepSound(BlockPos pos, BlockState blockIn)
{
this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
......@@ -237,6 +248,7 @@ public class PigmanEntity extends AbstractVillagerEntity
return RediscoveredEntityTypes.PIGMAN.create(this.world);
}
@Override
public boolean processInteract(PlayerEntity player, Hand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
......@@ -300,7 +312,6 @@ public class PigmanEntity extends AbstractVillagerEntity
@Override
protected void populateTradeData()
{
VillagerTrades.ITrade[] avillagertrades$itrade = PigmanTrades.pigmanTrades.get(this.getLevel());
if (avillagertrades$itrade != null)
{
......@@ -347,15 +358,16 @@ public class PigmanEntity extends AbstractVillagerEntity
return this.homePos;
}
@Override
public void onDeath(DamageSource cause)
{
this.func_213742_a(MemoryModuleType.HOME);
this.func_213742_a(MemoryModuleType.MEETING_POINT);
this.removeModule(MemoryModuleType.HOME);
this.removeModule(MemoryModuleType.MEETING_POINT);
super.onDeath(cause);
}
public void func_213742_a(MemoryModuleType<GlobalPos> p_213742_1_)
public void removeModule(MemoryModuleType<GlobalPos> p_213742_1_)
{
if (this.world instanceof ServerWorld)
{
......@@ -437,9 +449,6 @@ public class PigmanEntity extends AbstractVillagerEntity
}
villagerBrain.registerActivity(Activity.CORE, PigmanTasks.core(f));
// villagerBrain.registerActivity(Activity.MEET, PigmanTasks.meet(f),
// ImmutableSet.of(Pair.of(MemoryModuleType.MEETING_POINT,
// MemoryModuleStatus.VALUE_PRESENT)));
villagerBrain.registerActivity(Activity.REST, PigmanTasks.rest(f));
villagerBrain.registerActivity(Activity.IDLE, PigmanTasks.idle(f));
villagerBrain.registerActivity(Activity.PANIC, PigmanTasks.panic(f));
......@@ -449,9 +458,9 @@ public class PigmanEntity extends AbstractVillagerEntity
villagerBrain.updateActivity(this.world.getDayTime(), this.world.getGameTime());
}
public void startSleeping(BlockPos p_213342_1_)
public void startSleeping(BlockPos pos)
{
super.startSleeping(p_213342_1_);
super.startSleeping(pos);
this.brain.setMemory(MemoryModuleType.LAST_SLEPT, LongSerializable.of(this.world.getGameTime()));
}
}
\ No newline at end of file
......@@ -60,6 +60,7 @@ public class RangedPigmanEntity extends MonsterEntity implements IRangedAttackMo
((GroundPathNavigator) this.getNavigator()).setBreakDoors(true);
}
@Override
protected void registerGoals()
{
this.goalSelector.addGoal(0, new SwimGoal(this));
......@@ -78,13 +79,14 @@ public class RangedPigmanEntity extends MonsterEntity implements IRangedAttackMo
{
return mob instanceof IMob && !(mob instanceof CreeperEntity);
}));
if (!RediscoveredConfig.pigmenNeutral)
{
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, false));
}
}
@Override
public ILivingEntityData onInitialSpawn(IWorld worldIn, DifficultyInstance difficultyIn, SpawnReason reason, @Nullable ILivingEntityData spawnDataIn, @Nullable CompoundNBT dataTag)
{
this.setItemStackToSlot(EquipmentSlotType.MAINHAND, new ItemStack(Items.BOW));
......@@ -93,11 +95,13 @@ public class RangedPigmanEntity extends MonsterEntity implements IRangedAttackMo
return super.onInitialSpawn(worldIn, difficultyIn, reason, spawnDataIn, dataTag);
}
@Override
protected float getStandingEyeHeight(Pose poseIn, EntitySize sizeIn)
{
return this.isChild() ? 0.85F : 1.80F;
}
@Override
protected void registerAttributes()
{
super.registerAttributes();
......@@ -105,6 +109,7 @@ public class RangedPigmanEntity extends MonsterEntity implements IRangedAttackMo
this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
@Override
public boolean attackEntityAsMob(Entity entityIn)
{
return super.attackEntityAsMob(entityIn);
......@@ -116,6 +121,7 @@ public class RangedPigmanEntity extends MonsterEntity implements IRangedAttackMo
super.tick();
}
@Override
public void attackEntityWithRangedAttack(LivingEntity target, float distanceFactor)
{
ItemStack itemstack = new ItemStack(RediscoveredItems.purple_arrow);
......@@ -131,9 +137,9 @@ public class RangedPigmanEntity extends MonsterEntity implements IRangedAttackMo
this.world.addEntity(abstractarrowentity);
}
protected AbstractArrowEntity fireArrow(ItemStack p_213624_1_, float p_213624_2_)
protected AbstractArrowEntity fireArrow(ItemStack stack, float p_213624_2_)
{
return ProjectileHelper.fireArrow(this, p_213624_1_, p_213624_2_);
return ProjectileHelper.fireArrow(this, stack, p_213624_2_);
}
@Override
......@@ -149,21 +155,25 @@ public class RangedPigmanEntity extends MonsterEntity implements IRangedAttackMo
}
}
@Override
protected SoundEvent getAmbientSound()
{
return SoundEvents.ENTITY_PIG_AMBIENT;
}
@Override
protected SoundEvent getHurtSound(DamageSource damageSourceIn)
{
return SoundEvents.ENTITY_PIG_HURT;
}
@Override
protected SoundEvent getDeathSound()
{
return SoundEvents.ENTITY_PIG_DEATH;
}
@Override
protected void playStepSound(BlockPos pos, BlockState blockIn)
{
this.playSound(SoundEvents.ENTITY_PIG_STEP, 0.15F, 1.0F);
......
......@@ -37,7 +37,7 @@ public class PigmanStayNearPointTask extends Task<PigmanEntity>
private void func_225457_a(PigmanEntity p_225457_1_, long p_225457_2_)
{
Brain<?> brain = p_225457_1_.getBrain();
p_225457_1_.func_213742_a(this.field_220548_a);
p_225457_1_.removeModule(this.field_220548_a);
brain.removeMemory(this.field_220548_a);
brain.setMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, p_225457_2_);
}
......
......@@ -26,43 +26,52 @@ public class RedDragonEntityPart extends Entity
this.field_213853_c = p_i50232_2_;
}
@Override
protected void registerData()
{
}
@Override
protected void readAdditional(CompoundNBT compound)
{
}
@Override
protected void writeAdditional(CompoundNBT compound)
{
}
@Override
public boolean canBeCollidedWith()
{
return true;
}
@Override
public boolean processInitialInteract(PlayerEntity player, Hand hand)
{
return super.processInitialInteract(player, hand);
}
@Override
public boolean attackEntityFrom(DamageSource source, float amount)
{
return this.isInvulnerableTo(source) ? false : this.dragon.attackEntityFrom(source, amount);
}
@Override
public boolean isEntityEqual(Entity entityIn)
{
return this == entityIn || this.dragon == entityIn;
}
@Override
public IPacket<?> createSpawnPacket()
{
throw new UnsupportedOperationException();
}
@Override
public EntitySize getSize(Pose poseIn)
{
return this.field_213854_d;
......
......@@ -27,6 +27,7 @@ public class ScarecrowItem extends Item
super(builder);
}
@Override
public ActionResultType onItemUse(ItemUseContext context)
{
Direction direction = context.getFace();
......
......@@ -62,37 +62,44 @@ public enum RediscoveredArmorMaterials implements IArmorMaterial
this.repairMaterial = new LazyLoadBase<>(repairMaterialSupplier);
}
@Override
public int getDurability(EquipmentSlotType slotIn)
{
return MAX_DAMAGE_ARRAY[slotIn.getIndex()] * this.maxDamageFactor;
}
@Override
public int getDamageReductionAmount(EquipmentSlotType slotIn)
{
return this.damageReductionAmountArray[slotIn.getIndex()];
}
@Override
public int getEnchantability()
{
return this.enchantability;
}
@Override
public SoundEvent getSoundEvent()
{
return this.soundEvent;
}
@Override
public Ingredient getRepairMaterial()
{
return this.repairMaterial.getValue();
}
@OnlyIn(Dist.CLIENT)
@Override
public String getName()
{
return this.name;
}
@Override
public float getToughness()
{
return this.toughness;
......