Fix some block methods

This commit is contained in:
Vincent Lee committed 2019-06-08 18:08:15 -07:00
1 parent c7cc76e1f3
commit ee08a279a7
33 files changed
+74 -45

No files matched your search

@@ -29,6 +29,7 @@ import net.minecraft.util.Hand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IEnviromentBlockReader;
import net.minecraft.world.IWorldReader;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@@ -55,10 +56,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public int getLightValue(@Nonnull BlockState state, IWorldReader world, @Nonnull BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) {
TileEntity tile = world.getTileEntity(pos);
return tile instanceof TileEntitySpecialFlower ? ((TileEntitySpecialFlower) tile).getLightValue() : lightValue;
}
@@ -142,7 +140,7 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I
}
@Override
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState) {
public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean isMoving) {
((TileEntitySpecialFlower) world.getTileEntity(pos)).onBlockAdded(world, pos, state);
}